[LON-CAPA-cvs] cvs: rat /client parameter.html loncom/interface lonhtmlcommon.pm lonparmset.pm
www
www at source.lon-capa.org
Thu Dec 8 16:37:51 EST 2011
www Thu Dec 8 21:37:51 2011 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm lonparmset.pm
/rat/client parameter.html
Log:
Bug #4046: eliminate date setting popup
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.294 loncom/interface/lonhtmlcommon.pm:1.295
--- loncom/interface/lonhtmlcommon.pm:1.294 Sun Oct 23 00:27:10 2011
+++ loncom/interface/lonhtmlcommon.pm Thu Dec 8 21:37:46 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.294 2011/10/23 00:27:10 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.295 2011/12/08 21:37:46 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -748,13 +748,12 @@
sub pjump_javascript_definition {
my $Str = <<END;
function pjump(type,dis,value,marker,ret,call,hour,min,sec) {
- parmwin=window.open("/adm/rat/parameter.html?type="+escape(type)
+ openMyModal("/adm/rat/parameter.html?type="+escape(type)
+"&value="+escape(value)+"&marker="+escape(marker)
+"&return="+escape(ret)
+"&call="+escape(call)+"&name="+escape(dis)
+"&defhour="+escape(hour)+"&defmin="+escape(min)
- +"&defsec="+escape(sec),"LONCAPAparms",
- "height=350,width=350,scrollbars=no,menubar=no");
+ +"&defsec="+escape(sec)+"&modal=1",350,350,'no');
}
END
return $Str;
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.517 loncom/interface/lonparmset.pm:1.518
--- loncom/interface/lonparmset.pm:1.517 Sun Dec 4 16:27:06 2011
+++ loncom/interface/lonparmset.pm Thu Dec 8 21:37:46 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.517 2011/12/04 16:27:06 www Exp $
+# $Id: lonparmset.pm,v 1.518 2011/12/08 21:37:46 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -855,16 +855,10 @@
return(<<ENDJS);
<script type="text/javascript">
// <![CDATA[
- function pclose() {
- parmwin=window.open("/adm/rat/empty.html","LONCAPAparms",
- "height=350,width=350,scrollbars=no,menubar=no");
- parmwin.close();
- }
$pjump_def
function psub() {
- pclose();
if (document.parmform.pres_marker.value!='') {
document.parmform.action+='#'+document.parmform.pres_marker.value;
var typedef=new Array();
@@ -904,7 +898,6 @@
my ($r,$psymb) = @_;
my %loaditems = (
- 'onunload' => "pclose()",
'onload' => "group_or_section('cgroup')",
);
if (!$psymb) {
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.62 rat/client/parameter.html:1.63
--- rat/client/parameter.html:1.62 Mon Nov 21 04:10:34 2011
+++ rat/client/parameter.html Thu Dec 8 21:37:51 2011
@@ -5,7 +5,7 @@
The LearningOnline Network with CAPA
Parameter Input Window
//
-// $Id: parameter.html,v 1.62 2011/11/21 04:10:34 raeburn Exp $
+// $Id: parameter.html,v 1.63 2011/12/08 21:37:51 www Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -43,6 +43,7 @@
var pcode='';
var pscat='';
var pmarker='';
+var pmodal='';
var pname='';
var defhour=0;
@@ -836,6 +837,7 @@
if (pair[0]=='call') { pcode=pair[1]; }
if (pair[0]=='marker') { pmarker=pair[1]; }
if (pair[0]=='name') { pname=pair[1]; }
+ if (pair[0]=='modal') { pmodal=pair[1]; }
if (pair[0]=='defhour' && pair[1] >= 0 && pair[1] < 24 ) {
defhour=pair[1];
}
@@ -960,56 +962,34 @@
}
selwrite('</select></form>');
-
+ var targ='parent.opener';
+ if (pmodal==1) {
+ targ='parent.parent';
+ }
selwrite('<a href="javascript:parent.assemble();');
if (preturn!='') {
- selwrite(
- 'parent.opener.document.'+preturn+'_value.value=parent.window.svalue;');
- selwrite(
- 'parent.opener.document.'+preturn+'_type.value=parent.window.stype;');
+ selwrite(targ+'.document.'+preturn+'_value.value=parent.window.svalue;');
+ selwrite(targ+'.document.'+preturn+'_type.value=parent.window.stype;');
}
if (pmarker!='') {
- selwrite(
- 'parent.opener.document.'+preturn+'_marker.value=parent.window.pmarker;');
+ selwrite(targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
}
if (pcode!='') {
- selwrite('parent.opener.'+pcode+'();');
+ selwrite(targ+'.'+pcode+'();');
}
selwrite('">Save</a> ');
selwrite('<a href="javascript:');
- selwrite(
- 'parent.opener.document.'+preturn+'_value.value='+"'';");
+ selwrite(targ+'.document.'+preturn+'_value.value='+"'';");
if (pmarker!='') {
selwrite(
- 'parent.opener.document.'+preturn+'_marker.value=parent.window.pmarker;');
+ targ+'.document.'+preturn+'_marker.value=parent.window.pmarker;');
}
if (pcode!='') {
- selwrite('parent.opener.'+pcode+'();');
+ selwrite(targ+'.'+pcode+'();');
}
selwrite('">Delete</a> ');
- selwrite('<a href="javascript:');
-// Old code :
-//----------------------------------------------------------------------
-// if (preturn!='') {
-// selwrite('parent.opener.document.'+preturn+'_value.value='+"'';");
-// selwrite('parent.opener.document.'+preturn+'_type.value='+"'';");
-// }
-// if (pmarker!='') {
-// selwrite('parent.opener.document.'+preturn+'_marker.value='+"'';");
-// }
-// if (pcode!='') {
-// selwrite('parent.opener.'+pcode+'();');
-// }
-//----------------------------------------------------------------------
-// Just close the window to 'cancel' the operation. There are javascript
-// errors in the above commented out code that I have not been able to
-// track down. I think they reside in 'parent.opener.'+pcode+'();'
-//
- selwrite('this.parent.close();');
- selwrite('">Cancel</a>');
-
selwrite('</body></html>');
this.window.selector.document.close();
draw();
More information about the LON-CAPA-cvs
mailing list