+ evt = getEventObject(evt);
+ var shift = evt.shiftKey;
+ if (shift && this.lastCBChecked) {
+ var from = this.getCBIndex(this.lastCBChecked);
+ var to = this.getCBIndex(target);
+ var start = Math.min(from, to);
+ var stop = Math.max(from, to);
+ var i;
+ for (i=start ; i<stop ; i++ ) {
+ this.cbIndex[i].setAttribute('checked', 'checked');
+ }
+ }
+ else if (target.checked) {
+ this.lastCBChecked = target;
+ }
+ else {
+ this.lastCBChecked = undefined;
+ }
+};
+
+Lightbox.prototype.refreshGrid = function() {
+ var req = new XMLHttpRequest();
+ self = this;
+ req.onreadystatechange = function() {
+ switch (req.readyState) {
+ case 1 :
+ showProgressImage();
+ break;
+ case 4 :
+ hideProgressImage();
+ if (req.status === 200) {
+ self._refreshGrid(req);
+ }
+ break;
+ }
+ };
+
+ var url = absolute_url() +
+ '/portfolio_thumbnails_tail?start:int=0&size:int=' +
+ this.slides.length;
+ req.open('GET', url, true);
+ req.send();
+};
+
+Lightbox.prototype._refreshGrid = function(req) {
+ var doc = req.responseXML.documentElement;
+ var i, node;
+ var j = 0;
+ for (i=0 ; i<doc.childNodes.length ; i++) {
+ node = doc.childNodes[i];
+ if (node.nodeType === 1) {
+ node = getCopyOfNode(node);
+ this.disableDefaultDragging(node);
+ this.grid.replaceChild(node, this.slides[j]);
+ this.slides[j] = node;
+ j++;
+ }
+ }
+ this.cbIndex = undefined;
+};
+
+Lightbox.prototype.fetchTail = function() {
+ var req = new XMLHttpRequest();
+ var self = this;
+ req.onreadystatechange = function() {
+ switch (req.readyState) {
+ case 1 :
+ showProgressImage();
+ break;
+ case 4 :
+ hideProgressImage();
+ if (req.status === 200) {
+ self._appendTail(req);
+ }
+ break;
+ }
+ };
+
+ var url = absolute_url() +
+ '/portfolio_thumbnails_tail?start:int=' +
+ String(this.slides.length) +
+ '&size:int=10' +
+ '&container_type=' +
+ this.container_type;
+ req.open('GET', url, true);
+ req.send();
+};
+
+Lightbox.prototype._appendTail = function(req) {
+ var doc = req.responseXML.documentElement;
+ var i, node, c;
+ for (i=0 ; i<doc.childNodes.length ; i++) {
+ node = doc.childNodes[i];
+ if (node.nodeType === 1) {
+ this.lastSlide = this.grid.appendChild(getCopyOfNode(node));
+ this.disableDefaultDragging(this.lastSlide);
+ this.slides.push(this.lastSlide);
+ if (this.cbIndex) {
+ c = this.lastSlide.getElementsByTagName('input')[0];
+ c.index = this.cbIndex.length;
+ this.cbIndex.push(c);
+
+ }
+ }
+ }
+ this.fetchingDisabled = false;
+ if (doc.getAttribute('nomore')) {
+ this.complete = true;