You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2014/09/22 15:56:37 UTC

svn commit: r1626777 - in /vcl/trunk/web: .ht-inc/utils.php js/resources.js

Author: jfthomps
Date: Mon Sep 22 13:56:37 2014
New Revision: 1626777

URL: http://svn.apache.org/r1626777
Log:
VCL-776 - rework resource code to have a base class for all resources and inheriting classes for each resource type

utils.php: modified getDojoHTML: added setTimeout to call initViewResources for viewResources mode
resources.js: added initViewResources


Modified:
    vcl/trunk/web/.ht-inc/utils.php
    vcl/trunk/web/js/resources.js

Modified: vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1626777&r1=1626776&r2=1626777&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Mon Sep 22 13:56:37 2014
@@ -12923,14 +12923,7 @@ function getDojoHTML($refresh) {
 			$rt .= "      dojo.registerModulePath(\"vcldojo\", \"../../js/vcldojo\");\n";
 			foreach($dojoRequires as $req)
 				$rt .= "   dojo.require(\"$req\");\n";
-			$rt .= "      setTimeout(function() {\n";
-			$rt .= "      if(typeof resourcestore !== 'undefined') {\n";
-			$rt .= "         if(! resourcestore.comparatorMap) {\n";
-			$rt .= "            resourcestore.comparatorMap = {};\n";
-			$rt .= "         }\n";
-			$rt .= "         resourcestore.comparatorMap['name'] = resource.nocasesort;\n";
-			$rt .= "      }\n";
-			$rt .= "      }, 500);\n";
+			$rt .= "      setTimeout(initViewResources, 100);\n";
 			if($cdata['obj']->restype == 'computer')
 				$rt .= "      initPage();\n";
 			$rt .= "   });\n";

Modified: vcl/trunk/web/js/resources.js
URL: http://svn.apache.org/viewvc/vcl/trunk/web/js/resources.js?rev=1626777&r1=1626776&r2=1626777&view=diff
==============================================================================
--- vcl/trunk/web/js/resources.js (original)
+++ vcl/trunk/web/js/resources.js Mon Sep 22 13:56:37 2014
@@ -174,8 +174,16 @@ var grouptoresourcesstore;
 var mapbyresgroupstore;
 var mapbymaptogroupstore;
 
-var ignorecasemap = {};
-ignorecasemap['name'] = resource.nocasesort;
+function initViewResources() {
+	if(typeof resourcestore === 'undefined') {
+		setTimeout(initViewResources, 100);
+		return;
+	}
+	if(! resourcestore.comparatorMap) {
+	   resourcestore.comparatorMap = {};
+	}
+	resourcestore.comparatorMap['name'] = resource.nocasesort;
+}
 
 function toggleCmapFieldDisplay(obj, field) {
 	for(var i in configmapgrid.layout.cells) {