[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /publisher lonpubdir.pm

raeburn raeburn at source.lon-capa.org
Wed Sep 14 12:48:02 EDT 2016


raeburn		Wed Sep 14 16:48:02 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/publisher	lonpubdir.pm 
  Log:
  - For 2.11
    - Backport 1.163
  
  
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.160.2.1 loncom/publisher/lonpubdir.pm:1.160.2.2
--- loncom/publisher/lonpubdir.pm:1.160.2.1	Sun Aug  7 20:23:42 2016
+++ loncom/publisher/lonpubdir.pm	Wed Sep 14 16:48:02 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Authoring Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.160.2.1 2016/08/07 20:23:42 raeburn Exp $
+# $Id: lonpubdir.pm,v 1.160.2.2 2016/09/14 16:48:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -563,7 +563,44 @@
                     <option value="newtaskfile">$lt{'nbt'}:</option>
                     <option value="newlibraryfile">$lt{'nlib'}:</option>
 	            <option value="newdir">$lt{'nsub'}:</option>
-		  </select> <input type="text" name="newfilename" value="$lt{'type'}" onfocus="if (this.value == '$mytype') this.value=''" /> <input type="button" value="Go" onclick="validate_go();" />
+		  </select> <input type="text" name="newfilename" placeholder="$lt{'type'}" value="" onfocus="if (this.value == is.empty()) this.value=''" /> <input type="button" value="Go" onclick="validate_go();" />
+                <br />
+                <span>Quickactions:
+                 <input type="hidden" name="mode"/>
+                 <a href="javascript:void(0)" onclick="javascript:validate_action('blank')">
+                    <img src="/adm/lonIcons/unknown.gif" title="Create blank problem file"></a>
+                 <a href="javascript:void(0)" onclick="javascript:validate_action('problemtempl')">
+                    <img src="/adm/lonIcons/problem.gif" title="Create new problem from template"></a>
+                 <a href="javascript:void(0)" onclick="javascript:validate_action('blankhtml')">
+                    <img src="/adm/lonIcons/html.gif" title="Create new blank HTML file"></a>
+                 <a href="javascript:void(0)" onclick="javascript:validate_action('folder')">
+                    <img src="/adm/lonIcons/navmap.folder.closed.gif" title="Create new subdirectory"></a>
+                </span>
+                 <script type="text/javascript">
+                     function validate_action(action){
+
+                         if (document.getElementsByName(\'newfilename\')[0].value != \'\'){
+                             if (action == "blank") {
+                                                                 document.fileaction.action.value=\'newproblemfile\';
+                                                                 document.fileaction.mode.value=\'blank\';
+                                                         } else if (action == "problemtempl") {
+                                                                 document.fileaction.action.value=\'newproblemfile\';
+                                 validate_go();
+                             } else if (action == "blankhtml") {
+                                 document.fileaction.action.value=\'newhtmlfile\';
+                                 validate_go();
+                             } else if (action == "folder") {
+                                 document.fileaction.action.value=\'newdir\';
+                                 document.fileaction.mode.value=\'folder\';
+                             }
+                             fileaction.submit();
+                         } else {
+                             alert(\'Please specify file name.\');
+                             // TODO: ask for filename? if so, do some refactoring
+
+                         }
+                     }
+                 </script>
 		 </span>
       </fieldset>
     </form>




More information about the LON-CAPA-cvs mailing list