4122: Moved poptastic to ATutor.js - new function name is ATutor.poptastic. Fixed...
authorlaurel <laurel.williams@utoronto.ca>
Fri, 23 Apr 2010 20:23:08 +0000 (20:23 -0000)
committerlaurel <laurel.williams@utoronto.ca>
Fri, 23 Apr 2010 20:23:08 +0000 (20:23 -0000)
12 files changed:
docs/jscripts/ATutor.js
docs/mods/_core/editor/editor_tabs/alternatives.inc.php
docs/mods/_core/modules/index.php
docs/mods/_core/modules/module_install_step_2.php
docs/mods/_standard/social/html/applications.tmpl.php
docs/themes/blumin/include/header.tmpl.php
docs/themes/default/include/header.tmpl.php
docs/themes/default15/include/header.tmpl.php
docs/themes/default_classic/include/header.tmpl.php
docs/themes/fluid/include/header.tmpl.php
docs/themes/greenmin/include/header.tmpl.php
docs/themes/mobile/include/header.tmpl.php

index 8750763..f21615c 100644 (file)
@@ -17,6 +17,14 @@ ATutor.users.preferences = ATutor.users.preferences || {};
 
 (function() {
        
+       ATutor.poptastic = function (url) {
+               var newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
+               if (window.focus) {
+                       newwindow.focus();
+               }
+       };
+
+       
        //styles block for user preferences
        //used by ATutor.users.preferences.setStyles
     ATutor.users.preferences.user_styles = 
index 3ccedf4..17d4c87 100644 (file)
@@ -61,7 +61,7 @@ function display_alternative_cell($secondary_result, $alternative_type, $content
                        {
                                echo '    <div id="'.$pid.'_'.$alternative_type.'">'."\n";
                                echo '      <a href="'.get_preview_link($secondary_resource['secondary_resource']).'" title="'._AT('new_window').'" target="_new">'.$secondary_resource['secondary_resource'].'</a><br />'."\n";
-                               echo '      <a href="#" onclick="poptastic(\''.AT_BASE_HREF.'mods/_core/file_manager/index.php?framed=1'. SEP.'popup=1'. SEP.'cp='. $content_row['content_path'].SEP.'cid='.$content_id.SEP.'pid='.$pid.SEP.'a_type='.$alternative_type.'\');return false;" title="'._AT('new_window').'">'."\n";
+                               echo '      <a href="#" onclick="ATutor.poptastic(\''.AT_BASE_HREF.'mods/_core/file_manager/index.php?framed=1'. SEP.'popup=1'. SEP.'cp='. $content_row['content_path'].SEP.'cid='.$content_id.SEP.'pid='.$pid.SEP.'a_type='.$alternative_type.'\');return false;" title="'._AT('new_window').'">'."\n";
                                echo '        <img src="'.AT_BASE_HREF.'images/home-tests_sm.png" border="0" title="'._AT('alter').'" alt="'._AT('alter').'" />'."\n";
                                echo '      </a>'."\n";
                                echo '      <a href="#" onclick="removeAlternative(\''.$content_row['content_path'].'\', '.$content_id.','.$pid.','.$alternative_type.');return false;">'."\n";
@@ -76,7 +76,7 @@ function display_alternative_cell($secondary_result, $alternative_type, $content
        if (!$found_alternative)
        {
                echo '    <div id="'.$pid.'_'.$alternative_type.'">'."\n";
-               echo '      <input type="button" value="'._AT('add').'" title="'._AT('new_window').'" onclick="poptastic(\''.AT_BASE_HREF.'mods/_core/file_manager/index.php?framed=1'. SEP.'popup=1'. SEP.'cp='. $content_row['content_path'].SEP.'cid='.$content_id.SEP.'pid='.$pid.SEP.'a_type='.$alternative_type.'\');return false;" />'."\n";
+               echo '      <input type="button" value="'._AT('add').'" title="'._AT('new_window').'" onclick="ATutor.poptastic(\''.AT_BASE_HREF.'mods/_core/file_manager/index.php?framed=1'. SEP.'popup=1'. SEP.'cp='. $content_row['content_path'].SEP.'cid='.$content_id.SEP.'pid='.$pid.SEP.'a_type='.$alternative_type.'\');return false;" />'."\n";
                echo '    </div>'."\n";
        }
        echo '    </td>'."\n";
@@ -234,7 +234,7 @@ function removeAlternative(contentPath, cid, pid, a_type)
                        {"pid":pid, "a_type":a_type}, 
                        function(data) {});
 
-       var button_html = '      <input type="button" value="<?php echo _AT('add'); ?>" title="<?php echo _AT('new_window'); ?>" onclick="poptastic(\\\'<?php echo AT_BASE_HREF; ?>mods/_core/file_manager/index.php?framed=1<?php echo SEP; ?>popup=1<?php echo SEP; ?>cp='+contentPath+'<?php echo SEP; ?>cid='+cid+'<?php echo SEP; ?>pid='+pid+'<?php echo SEP; ?>a_type='+a_type+'\\\');return false;" />';
+       var button_html = '      <input type="button" value="<?php echo _AT('add'); ?>" title="<?php echo _AT('new_window'); ?>" onclick="ATutor.poptastic(\\\'<?php echo AT_BASE_HREF; ?>mods/_core/file_manager/index.php?framed=1<?php echo SEP; ?>popup=1<?php echo SEP; ?>cp='+contentPath+'<?php echo SEP; ?>cid='+cid+'<?php echo SEP; ?>pid='+pid+'<?php echo SEP; ?>a_type='+a_type+'\\\');return false;" />';
        eval("document.getElementById(\""+pid+"_"+a_type+"\").innerHTML = '"+button_html+"'");
 }
 //-->
index 639bf0b..41b384f 100644 (file)
@@ -228,7 +228,7 @@ $keys = array_keys($module_list);
 
        <tr onmousedown="document.form['t_<?php echo $i; ?>'].checked = true; rowselect(this);" id="r_<?php echo $i; ?>">
                <td valign="top"><input type="radio" id="t_<?php echo $i; ?>" name="mod_dir" value="<?php echo $dir_name; ?>" /></td>
-               <td nowrap="nowrap" valign="top"><label for="t_<?php echo $i; ?>"><?php echo $module->getName(); if ($readme <> '') echo '&nbsp;<a href="#" onclick="poptastic(\''.AT_BASE_HREF.'mods/'.$dir_name.'/'.$readme.'\');return false;">'._AT('view_readme').'</a>'; ?></label></td>
+               <td nowrap="nowrap" valign="top"><label for="t_<?php echo $i; ?>"><?php echo $module->getName(); if ($readme <> '') echo '&nbsp;<a href="#" onclick="ATutor.poptastic(\''.AT_BASE_HREF.'mods/'.$dir_name.'/'.$readme.'\');return false;">'._AT('view_readme').'</a>'; ?></label></td>
                <td valign="top"><?php
                        if ($module->isCore()) {
                                echo '<strong>'._AT('core').'</strong>';
index 3ecc188..1659381 100644 (file)
@@ -151,7 +151,7 @@ $properties = $module->getProperties(array('maintainers', 'url', 'date', 'licens
 
        <div class="row">
                <?php echo _AT('description'); ?><br />
-               <?php echo nl2br($module->getDescription($_SESSION['lang'])); if ($readme <> '') echo '<br /><a href="#" onclick="poptastic(\''.AT_BASE_HREF.'mods/'.$mod.'/'.$readme.'\');return false;">'._AT('view_readme').'</a>'; ?>
+               <?php echo nl2br($module->getDescription($_SESSION['lang'])); if ($readme <> '') echo '<br /><a href="#" onclick="ATutor.poptastic(\''.AT_BASE_HREF.'mods/'.$mod.'/'.$readme.'\');return false;">'._AT('view_readme').'</a>'; ?>
        </div>
 
        <div class="row">
index aa09038..e69d8d9 100644 (file)
@@ -26,7 +26,7 @@
                        <input type="submit" value="<?php echo _AT('show_your_applications'); ?>" class="button" />     
                        <?php endif; ?>
                        </form>
-                       <button type="button"  onclick="poptastic('http://atutor.ca/get_gadgets.php')" class="button" /><?php echo _AT('find_gadgets'); ?></button>
+                       <button type="button"  onclick="ATutor.poptastic('http://atutor.ca/get_gadgets.php')" class="button" /><?php echo _AT('find_gadgets'); ?></button>
                </div>
 </div>
 
index 7e9f592..cfa264f 100644 (file)
@@ -84,12 +84,6 @@ global $system_courses, $_custom_css, $_base_path;
 <body onload="<?php echo $this->onload; ?>">
 <script language="javascript" type="text/javascript">
 //<!--
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();
index 6cdc5a6..4487394 100644 (file)
@@ -86,12 +86,6 @@ global $system_courses, $_custom_css, $db;
 <body onload="<?php echo $this->onload; ?>">
 <script language="javascript" type="text/javascript">
 //<!--
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();
index cce81cd..fc04a91 100644 (file)
@@ -70,13 +70,6 @@ global $system_courses;
 </head>
 <body onload="setstates(); <?php echo $this->onload; ?>"><script language="javascript" type="text/javascript">
 //<!--
-
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=700,width=700,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();
index dd51982..f30de9d 100644 (file)
@@ -39,13 +39,6 @@ global $system_courses, $_custom_css, $_base_path;
 <body onload="setstates(); <?php echo $this->onload; ?>">
 <script language="javascript" type="text/javascript">
 //<!--
-
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();
index 77a4e95..135265e 100644 (file)
@@ -110,12 +110,6 @@ jQuery(document).ready(function () {
        });
 });
 
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();
index 8e34597..00147db 100644 (file)
@@ -85,12 +85,6 @@ global $system_courses, $_custom_css, $_base_path;
 <body onload="<?php echo $this->onload; ?>">
 <script language="javascript" type="text/javascript">
 //<!--
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();
index 2c4cfdf..7069252 100644 (file)
@@ -90,17 +90,13 @@ jQuery('#content_link').click(function(e) {
        jQuery.noConflict();
        //-->
        </script>
-<?php echo $this->custom_css; ?>
+    <script src="<?php echo $this->base_path; ?>jscripts/ATutor.js" type="text/javascript"></script>   
+    <?php echo $this->custom_css; ?>
+    <style id="pref_style" type="text/css"></style> 
 </head>
 <body onload="<?php echo $this->onload; ?>">
 <script language="javascript" type="text/javascript">
 //<!--
-var newwindow;
-function poptastic(url) {
-       newwindow=window.open(url,'popup','height=600,width=600,scrollbars=yes,resizable=yes');
-       if (window.focus) {newwindow.focus()}
-}
-
 function getexpirydate(nodays){
        var UTCstring;
        Today = new Date();