[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Fri, 08 Mar 2002 18:32:55 -0000
matthew Fri Mar 8 13:32:55 2002 EDT
Modified files:
/loncom/xml lonxml.pm
Log:
Added javascript function "opensearcher(formname,elementname)" and
did a little housecleaning on openbrowser as well.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.155 loncom/xml/lonxml.pm:1.156
--- loncom/xml/lonxml.pm:1.155 Wed Mar 6 15:28:19 2002
+++ loncom/xml/lonxml.pm Fri Mar 8 13:32:55 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.155 2002/03/06 20:28:19 matthew Exp $
+# $Id: lonxml.pm,v 1.156 2002/03/08 18:32:55 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -430,12 +430,18 @@
ENDDONOTREGTHIS
}
if ($target eq 'edit') {
+ # Javascript routines for construction space:
+ # openbrowser and opensearcher will start the file browser
+ # (lonindexer) and searcher (lonsearchcat) respectively.
+ # Inputs are the name of the html form being used
+ # and the name of the element the selected URL should
+ # be placed in.
$result .=<<"ENDBROWSERSCRIPT";
<script>
- var editform;
+ var editbrowser;
function openbrowser(formname,elementname) {
var url = '/res/?';
- if (editform == null) {
+ if (editbrowser == null) {
url += 'launch=1&';
}
url += 'catalogmode=interactive&';
@@ -445,8 +451,24 @@
var title = 'Browser';
var options = 'scrollbars=1,resizable=1,menubar=0';
options += ',width=700,height=600';
- editform = open(url,title,options,'1');
- editform.focus();
+ editbrowser = open(url,title,options,'1');
+ editbrowser.focus();
+ }
+ var editsearcher;
+ function opensearcher(formname,elementname) {
+ var url = '/adm/searchcat?';
+ if (editsearcher == null) {
+ url += 'launch=1&';
+ }
+ url += 'catalogmode=interactive&';
+ url += 'mode=edit&';
+ url += 'form=' + formname + '&';
+ url += 'element=' + elementname + '';
+ var title = 'Search';
+ var options = 'scrollbars=1,resizable=1,menubar=0';
+ options += ',width=700,height=600';
+ editsearcher = open(url,title,options,'1');
+ editsearcher.focus();
}
</script>
ENDBROWSERSCRIPT