[LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm /xml scripttag.pm

www www at source.lon-capa.org
Fri Dec 9 17:04:55 EST 2011


www		Fri Dec  9 22:04:55 2011 EDT

  Modified files:              
    /loncom/homework	functionplotresponse.pm 
    /loncom/xml	scripttag.pm 
  Log:
  Eliminating more popups
  
  
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.88 loncom/homework/functionplotresponse.pm:1.89
--- loncom/homework/functionplotresponse.pm:1.88	Sat Nov 26 01:35:26 2011
+++ loncom/homework/functionplotresponse.pm	Fri Dec  9 22:04:51 2011
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # Functionplot responses
 #
-# $Id: functionplotresponse.pm,v 1.88 2011/11/26 01:35:26 www Exp $
+# $Id: functionplotresponse.pm,v 1.89 2011/12/09 22:04:51 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1300,14 +1300,18 @@
       my $function_name =
                 join('_','LONCAPA_scriptvars',$uname,$udom,
                      $env{'form.counter'},$Apache::lonxml::curdepth);
-      my $rules_var ="<script type=\"text/javascript\">
-// <![CDATA[
-    function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page<pre>".
-    $Apache::functionplotresponse::ruleslog.
-    "<\\/pre>$end_page');newWindow.document.close();newWindow.focus()}
-// ]]>
-</script><a href=\"javascript:$function_name();void(0);\">".&mt('Rules Log')."</a><br />";
-            &Apache::lonxml::add_script_result($rules_var);
+      my $rulelogcontent= $start_page.
+              &Apache::loncommon::start_scrollbox('700px','680px','480px').
+             '<pre>'.
+              $Apache::functionplotresponse::ruleslog.
+              '</pre>'.
+              &Apache::loncommon::end_scrollbox().
+              $end_page;
+      $rulelogcontent=~s/\'/\\'/gs;
+      &Apache::lonxml::add_script_result(
+          &Apache::loncommon::modal_adhoc_script($function_name,700,500,$rulelogcontent).
+              "<a href=\"javascript:$function_name();void(0);\">".&mt('Rules Log')."</a><br />"
+                                        );
         }
 
   return $result;
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.157 loncom/xml/scripttag.pm:1.158
--- loncom/xml/scripttag.pm:1.157	Sun Aug  8 03:00:56 2010
+++ loncom/xml/scripttag.pm	Fri Dec  9 22:04:55 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.157 2010/08/08 03:00:56 raeburn Exp $
+# $Id: scripttag.pm,v 1.158 2011/12/09 22:04:55 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -116,17 +116,16 @@
 	    my $function_name = 
 		join('_','LONCAPA_scriptvars',$uname,$udom,
 		     $env{'form.counter'},$Apache::lonxml::curdepth);
-	    my $script_var ="<script type=\"text/javascript\">
-// <![CDATA[
-    function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page<pre>";
-	    my $listing=&Apache::run::dump($target,$safeeval);
-	    $listing=~s/\\/\\\\/g;
-	    $listing=~s/\'/\\\'/g;
-	    $script_var.=$listing;
-	    $script_var.= "<\\/pre>$end_page');newWindow.document.close();newWindow.focus()}
-// ]]>
-</script><a href=\"javascript:$function_name();void(0);\">".&mt('Script Vars')."</a><br />";
-	    &Apache::lonxml::add_script_result($script_var);
+            my $scriptblocklog=$start_page.
+                               &Apache::loncommon::start_scrollbox('500px','480px','480px').
+                               '<pre>'.&Apache::run::dump($target,$safeeval).'</pre>'.
+                               &Apache::loncommon::end_scrollbox().
+                               $end_page;
+            $scriptblocklog=~s/\'/\\'/gs;
+            &Apache::lonxml::add_script_result(
+	             &Apache::loncommon::modal_adhoc_script($function_name,500,500,$scriptblocklog).
+                     "<a href=\"javascript:$function_name();void(0);\">".&mt('Script Vars')."</a><br />"
+                                              );
 	}
     } elsif ($target eq "edit" ) {
       #&Apache::run::run($bodytext,$safeeval);




More information about the LON-CAPA-cvs mailing list