[prev in list] [next in list] [prev in thread] [next in thread]
List: asterisk-gui-commits
Subject: espiceland: branch 2.0 r5198 - in /branches/2.0/config: index.html
From: SVN commits to the Asterisk-GUI project
Date: 2011-05-05 14:44:46
Message-ID: E1QHznK-0007u3-Ko () wibble ! digium ! internal
[Download RAW message or body]
Author: espiceland
Date: Thu May 5 09:44:43 2011
New Revision: 5198
URL: http://svnview.digium.com/svn/asterisk-gui?view=rev&rev=5198
Log:
Cache version calculations. They are causing the same code to be executed many
times, and this slows down the responsiveness of the GUI.
Modified:
branches/2.0/config/index.html
branches/2.0/config/js/astman.js
Modified: branches/2.0/config/index.html
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/index.html?view=diff&rev=5198&r1=5197&r2=5198
==============================================================================
--- branches/2.0/config/index.html (original)
+++ branches/2.0/config/index.html Thu May 5 09:44:43 2011
@@ -282,6 +282,9 @@
},
AsteriskVersionString : '',
+ AsteriskVersion: '',
+ AsteriskBranch: '',
+ VersionCache: {},
httpConf: { // store any information from http.conf in this object
prefix: '',
postmappings_defined : false,
Modified: branches/2.0/config/js/astman.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=5198&r1=5197&r2=5198
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Thu May 5 09:44:43 2011
@@ -1362,30 +1362,41 @@
greater_than_equal_to: function (other) {
if (!top.sessionData.AsteriskVersion) { return false; }
if (top.sessionData.AsteriskBranch == 'trunk') { return true; }
+ if (top.sessionData.VersionCache[other] != undefined
+ && (top.sessionData.VersionCache[other] == true
+ || top.sessionData.VersionCache[other] == false
+ || top.sessionData.VersionCache[other] == "equal")) {
+ return top.sessionData.VersionCache[other];
+ }
var thisversion = top.sessionData.AsteriskVersion || \
top.sessionData.AsteriskBranch; var thispieces = thisversion.split('.');
var otherpieces = other.split('.');
for (var i = 0; i < ((thispieces.length < otherpieces.length) ? thispieces.length \
: otherpieces.length); i++) { if (thispieces[i] > otherpieces[i]) {
+ top.sessionData.VersionCache[other] = true;
return true;
} else if (thispieces[i] < otherpieces[i]) {
+ top.sessionData.VersionCache[other] = false;
return false;
}
}
while (thispieces[i] || otherpieces[i] || i < 10) {
- if (thispieces[i] == undefined) {
- if (otherpieces[i] == undefined) {
- return "equal";
- } else {
- return false;
- }
+ if (thispieces[i] == otherpieces[i]) {
+ top.sessionData.VersionCache[other] = "equal";
+ return "equal";
+ } else if (thispieces[i] == undefined) {
+ top.sessionData.VersionCache[other] = false;
+ return false;
} else if (otherpieces[i] == undefined) {
+ top.sessionData.VersionCache[other] = true;
return true;
} else if (thispieces[i] > otherpieces[i]) {
+ top.sessionData.VersionCache[other] = true;
return true;
}
i++;
}
+ top.sessionData.VersionCache[other] = "equal";
return "equal";
}
},
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-gui-commits mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-gui-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic