Permalink
Browse files

the request queue partial flushing seems to work (on directory change…

…) but Request.Queue seems to have an issue with not really cleaning up the .requests object in there... :-S
  • Loading branch information...
1 parent b921dbc commit bf86019920c92b6e832d502cd4aa4377610356f2 @GerHobbelt GerHobbelt committed Apr 30, 2011
Showing with 26 additions and 11 deletions.
  1. +2 −2 Assets/Css/Additions.css
  2. +22 −7 Source/FileManager.js
  3. +2 −2 Source/Gallery.js
View
@@ -41,12 +41,12 @@ div.filemanager-dialog {
font-family: Tahoma, sans-serif;
font-size: 12px;
background: rgba(0, 0, 0, 0.8);
-
+
-o-border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-
+
box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
-moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
-webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 10px;
View
@@ -141,32 +141,47 @@ var FileManager = new Class({
this.dir_gallery_click_timer = null;
+ var dbg_cnt = 0;
+
this.RequestQueue = new Request.Queue({
concurrent: 3, // 3 --> 75% max load on a quad core server
autoAdvance: true,
stopOnFailure: false,
onRequest: (function(){
- this.diag.log('request queue: onRequest: ', arguments);
+ //this.diag.log('request queue: onRequest: ', arguments);
}).bind(this),
- onComplete: (function(){
- this.diag.log('request queue: onComplete: ', arguments);
+ onComplete: (function(name){
+ //this.diag.log('request queue: onComplete: ', arguments);
+
+ // clean out the item from the queue; doesn't seem to happen automatically :-(
+ var cnt = 0;
+ Object.each(this.RequestQueue.requests, function() {
+ cnt++;
+ });
+ // cut down on the number of reports:
+ if (Math.abs(cnt - dbg_cnt) >= 25)
+ {
+ this.diag.log('request queue: name counts: ', cnt, ', queue length: ', this.RequestQueue.queue.length);
+ dbg_cnt = cnt;
+ }
+
}).bind(this),
onCancel: (function(){
this.diag.log('request queue: onCancel: ', arguments);
}).bind(this),
onSuccess: (function(){
- this.diag.log('request queue: onSuccess: ', arguments);
+ //this.diag.log('request queue: onSuccess: ', arguments);
}).bind(this),
- onFailure: (function(){
+ onFailure: (function(name){
this.diag.log('request queue: onFailure: ', arguments);
}).bind(this),
- onException: (function(){
+ onException: (function(name){
this.diag.log('request queue: onException: ', arguments);
}).bind(this)
@@ -184,7 +199,7 @@ var FileManager = new Class({
this.cancel(name);
this.removeRequest(name);
- this.clear(name); // eek, a full table scan! yech.
+ this.clear(name); // eek, a full table scan! yech.
delete this.requests[name];
delete this.reqBinders[name];
}
View
@@ -257,8 +257,8 @@ FileManager.Gallery = new Class({
// determine how many images we can show next to one another:
var galWidthComp = 2; // 2px not accounted for in the Width calculation; without these the width slowly grows instead of 'jump' to fit one more/less image horizontally
var imgMarginWidth = 4; // 4px unaccounted for in the element width
- var radiiCorr = 20; // correction for the radii in the FileManager container: looks better that way
- var imgWidth = 84; // derived from current CSS; bad form to do it this way, but this is a good guess when there's no image in there yet.
+ var radiiCorr = 20; // correction for the radii in the FileManager container: looks better that way
+ var imgWidth = 84; // derived from current CSS; bad form to do it this way, but this is a good guess when there's no image in there yet.
var imgs = this.galleryContainer.getElements('li');
if (imgs && imgs[0])
{

0 comments on commit bf86019

Please sign in to comment.