rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
} | }; | var sendAjax = function(tagname, reason, action, callback){ url = scriptUrl; if (action == 'add'){ url += $.i18n._('mark-tag/'); if (reason == 'good'){ url += $.i18n._('interesting/'); } else { url += $.i18n._('ignored/'); } } else { url += $.i18n._('unmark-tag/'); } url = url + tagname + '/'; call_settings = { type:'POST', url:url } if (callback != false){ call_settings['success'] = callback; } $.ajax(call_settings); } |
}; | } | function serializeChildren(table_id, parent, serialed, cur_child_string) { serialed.push(table_id+"["+cur_level+"]"+cur_child_string+"[id]="+parent[0].id); var kids = $(parent).nextAll("tr.child-of-" + parent[0].id); cur_child_string += "[children]"; if(kids.length > 0) { var kid_level = 0; kids.each(function() { serializeChildren(table_id, $(this), serialed, cur_child_string + "["+kid_level+"]"); kid_level++; }); } }; |
this.set_article_path = function () { | function set_article_path(e) { | this.set_article_path = function () { var subj = document.getElementById("subject").value; var path = subj.toLowerCase(); if (document.getElementById("short_path").value) return true; path = path.replace(/\W+/g, " "); path = path.replace(/^ */, ""); path = path.replace(/ *$/, ""); path = path.replace(/\W+/g, "_"); document.getElementById("short_path").value = path; return true; } |
this.button.setActive(active); | if (this.button) { this.button.setActive(active); } | setActive: function(active) { this.button.setActive(active); }, |
this.log("setActive"); | setActive: function(activeItem) { this.log("setActive"); $(this.selectedLi).removeClass(this.css.liActive); this.selectedLi = activeItem; $(this.selectedLi).addClass(this.css.liActive); }, |
|
this.activeButton.domA.removeEvent('click', this.clickHandler); | this.activeButton.domA.removeEvent('click', this.bound.click); | setActiveButton: function(button) { if (this.activeButton) { this.activeButton.domA.dispose(); this.activeButton.domA.removeEvent('click', this.clickHandler); } if (button && button.domA) { this.domObj.grab(button.domA, 'top'); this.domA = button.domA; this.domA.addEvent('click', this.clickHandler); if (this.options.toggle) { this.options.active = false; this.setActive(true); } } this.activeButton = button; }, |
this.domA.addEvent('click', this.clickHandler); | this.domA.addEvent('click', this.bound.click); | setActiveButton: function(button) { if (this.activeButton) { this.activeButton.domA.dispose(); this.activeButton.domA.removeEvent('click', this.clickHandler); } if (button && button.domA) { this.domObj.grab(button.domA, 'top'); this.domA = button.domA; this.domA.addEvent('click', this.clickHandler); if (this.options.toggle) { this.options.active = false; this.setActive(true); } } this.activeButton = button; }, |
alert(exception.msg); return; | adminLogout(); | function setAlbumCoverResponse(cover, exception) { if (exception) { alert(exception.msg); return; } document.getElementById('albumCoverDiv').innerHTML = "<table id='albumCover' style='width:200px;' border='0' cellspacing='0' cellpadding='1'></table>"; var table = document.getElementById('albumCover'); var row = table.insertRow(0); var column = row.insertCell(0); if (cover != null) { var img = document.createElement("img"); img.src = (window.location.href).replace("admin/upload.html", "") + "gallery/" + albumName + "/" + cover; var img_html = "<img src=" + img.src + " class=\"slideImage\" width=200px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>"; var html = "<table border=\"0\" style=\"width:180px; text-align: center;\"><tr style=\"cellpadding:10\"><td><a>" + img_html + "</a></td></tr><tr><td>" + albumName + "</td></tr></table>"; column.innerHTML = html; }} |
if (onSuccessFn) onSuccessFn(r.getResult().Result); | if (onSuccessFn) onSuccessFn(r.Result); | setContainsItem: function(id, item, onSuccessFn, onErrorFn) { this.gateway.getFromService('SetContainsItem', { Id: id || null, Item: item || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); }, onErrorFn || RedisClient.errorFn); }, |
this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped) { //unwrap this.wrapper.before(this.selectbox); } // console.timeEnd("1"); // console.time("2"); //get dimensions un-wrapped, in case of % width etc. this.originalSelectboxWidth = this.selectbox.outerWidth(); var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); this.wrapper.get(0).appendChild(this.selectbox.get(0)); //wrap // console.timeEnd("2.5"); // console.time("3"); this.wrapper.removeClass(this.css.hidden); this.selectIsWrapped = true; //match original width var newSelectWidth = this.originalSelectboxWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); // console.timeEnd("4"); }, |
|
this.wrapper.removeClass(this.css.hidden); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped && (!this.options.manualWidth || this.options.unwrapForCSS)) { // unwrap this.wrapper.before(this.selectbox); this.selectIsWrapped = false; } // console.timeEnd("1"); // console.time("2"); //match original width var newSelectWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else { newSelectWidth = this.selectbox.outerWidth(); if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } } var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); if(!this.selectIsWrapped) { // wrap this.wrapper.get(0).appendChild(this.selectbox.get(0)); this.selectIsWrapped = true; } this.wrapper.removeClass(this.css.hidden); // console.timeEnd("2.5"); // console.time("3"); var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
|
var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); | var buttonWidth = this.button.outerWidth(true); var wrapperBP = this.wrapper.outerWidth() - this.wrapper.width(); var inputBP = this.input.outerWidth(true) - this.input.width(); var listScrollBP = this.listScroll.outerWidth() - this.listScroll.width(); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped && (!this.options.manualWidth || this.options.unwrapForCSS)) { // unwrap this.wrapper.before(this.selectbox); this.selectIsWrapped = false; } // console.timeEnd("1"); // console.time("2"); //match original width var newSelectWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else { newSelectWidth = this.selectbox.outerWidth(); if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } } var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); if(!this.selectIsWrapped) { // wrap this.wrapper.get(0).appendChild(this.selectbox.get(0)); this.selectIsWrapped = true; } this.wrapper.removeClass(this.css.hidden); // console.timeEnd("2.5"); // console.time("3"); var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped && (!this.options.manualWidth || this.options.unwrapForCSS)) { // unwrap this.wrapper.before(this.selectbox); this.selectIsWrapped = false; } // console.timeEnd("1"); // console.time("2"); //match original width var newSelectWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else { newSelectWidth = this.selectbox.outerWidth(); if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } } var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); if(!this.selectIsWrapped) { // wrap this.wrapper.get(0).appendChild(this.selectbox.get(0)); this.selectIsWrapped = true; } this.wrapper.removeClass(this.css.hidden); // console.timeEnd("2.5"); // console.time("3"); var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
|
this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); | this.listWrapper.width(newSelectWidth + wrapperBP); this.listScroll.width(newSelectWidth + wrapperBP - listScrollBP); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped && (!this.options.manualWidth || this.options.unwrapForCSS)) { // unwrap this.wrapper.before(this.selectbox); this.selectIsWrapped = false; } // console.timeEnd("1"); // console.time("2"); //match original width var newSelectWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else { newSelectWidth = this.selectbox.outerWidth(); if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } } var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); if(!this.selectIsWrapped) { // wrap this.wrapper.get(0).appendChild(this.selectbox.get(0)); this.selectIsWrapped = true; } this.wrapper.removeClass(this.css.hidden); // console.timeEnd("2.5"); // console.time("3"); var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
console.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + listScrollBP); this.listWrapper.addClass(this.css.hidden); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped && (!this.options.manualWidth || this.options.unwrapForCSS)) { // unwrap this.wrapper.before(this.selectbox); this.selectIsWrapped = false; } // console.timeEnd("1"); // console.time("2"); //match original width var newSelectWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else { newSelectWidth = this.selectbox.outerWidth(); if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } } var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); if(!this.selectIsWrapped) { // wrap this.wrapper.get(0).appendChild(this.selectbox.get(0)); this.selectIsWrapped = true; } this.wrapper.removeClass(this.css.hidden); // console.timeEnd("2.5"); // console.time("3"); var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
|
if(this.selectIsWrapped) { | if(this.selectIsWrapped && (!this.options.manualWidth || this.options.unwrapForCSS)) { | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped) { //unwrap this.wrapper.before(this.selectbox); } // console.timeEnd("1"); // console.time("2"); //get dimensions un-wrapped, in case of % width etc. this.originalSelectboxWidth = this.selectbox.outerWidth(); var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); this.wrapper.get(0).appendChild(this.selectbox.get(0)); //wrap // console.timeEnd("2.5"); // console.time("3"); this.wrapper.removeClass(this.css.hidden); this.selectIsWrapped = true; //match original width var newSelectWidth = this.originalSelectboxWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
this.originalSelectboxWidth = this.selectbox.outerWidth(); | var newSelectWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else { newSelectWidth = this.selectbox.outerWidth(); if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } } | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped) { //unwrap this.wrapper.before(this.selectbox); } // console.timeEnd("1"); // console.time("2"); //get dimensions un-wrapped, in case of % width etc. this.originalSelectboxWidth = this.selectbox.outerWidth(); var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); this.wrapper.get(0).appendChild(this.selectbox.get(0)); //wrap // console.timeEnd("2.5"); // console.time("3"); this.wrapper.removeClass(this.css.hidden); this.selectIsWrapped = true; //match original width var newSelectWidth = this.originalSelectboxWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
this.wrapper.get(0).appendChild(this.selectbox.get(0)); | if(!this.selectIsWrapped) { this.wrapper.get(0).appendChild(this.selectbox.get(0)); this.selectIsWrapped = true; } this.wrapper.removeClass(this.css.hidden); | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped) { //unwrap this.wrapper.before(this.selectbox); } // console.timeEnd("1"); // console.time("2"); //get dimensions un-wrapped, in case of % width etc. this.originalSelectboxWidth = this.selectbox.outerWidth(); var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); this.wrapper.get(0).appendChild(this.selectbox.get(0)); //wrap // console.timeEnd("2.5"); // console.time("3"); this.wrapper.removeClass(this.css.hidden); this.selectIsWrapped = true; //match original width var newSelectWidth = this.originalSelectboxWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
this.wrapper.removeClass(this.css.hidden); this.selectIsWrapped = true; var newSelectWidth = this.originalSelectboxWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } | setDimensions: function() { // console.time("1"); this.wrapper.addClass(this.css.hidden); if(this.selectIsWrapped) { //unwrap this.wrapper.before(this.selectbox); } // console.timeEnd("1"); // console.time("2"); //get dimensions un-wrapped, in case of % width etc. this.originalSelectboxWidth = this.selectbox.outerWidth(); var props = this.options.mimicCSS; for(propPtr in props){ var prop = props[propPtr]; this.wrapper.css(prop, this.selectbox.css(prop)); // copy property from selectbox to wrapper } // console.timeEnd("2"); // console.time("2.5"); this.wrapper.get(0).appendChild(this.selectbox.get(0)); //wrap // console.timeEnd("2.5"); // console.time("3"); this.wrapper.removeClass(this.css.hidden); this.selectIsWrapped = true; //match original width var newSelectWidth = this.originalSelectboxWidth; if(this.options.manualWidth) { newSelectWidth = this.options.manualWidth; } else if (newSelectWidth < this.options.minWidth) { newSelectWidth = this.options.minWidth; } else if (this.options.maxWidth && (newSelectWidth > this.options.maxWidth) ) { newSelectWidth = this.options.maxWidth; } var buttonWidth = this.button.outerWidth(); var inputBP = this.input.outerWidth() - this.input.width(); var inputWidth = newSelectWidth - buttonWidth - inputBP; var listWrapBP = this.listWrapper.outerWidth() - this.listWrapper.width(); // console.timeEnd("3"); // console.time("4"); this.input.width(inputWidth); this.wrapper.width(newSelectWidth); this.listWrapper.width(newSelectWidth - listWrapBP); this.listScroll.width(newSelectWidth - listWrapBP); /* this.log(newSelectWidth + " : " + inputWidth + " : " + buttonWidth + " : " + (newSelectWidth - listWrapBP)); */ // console.timeEnd("4"); }, |
|
var limitType = Jx.type(this.options.limit); | var limitType = this.options.limit != null ? Jx.type(this.options.limit) : false; | setDragLimit : function(reference) { if($defined(reference)) this.options.limit = reference; // check drag limit if it is an container or string for an element and use dimensions var limitType = Jx.type(this.options.limit); if(this.options.limit && limitType != 'object') { var coords = false; switch(limitType) { case 'string': if(document.id(this.options.limit)) { coords = document.id(this.options.limit).getCoordinates(); } break; case 'element': case 'document': case 'window': coords = this.options.limit.getCoordinates(); break; } if(coords) { this.options.limitOrig = this.options.limit; this.options.limit = { x : [coords.left, coords.right], y : [coords.top, coords.bottom] } }else{ this.options.limit = false; } } return this.options.limit; }, |
return this.button.setEnabled(enabled); | return this.button ? this.button.setEnabled(enabled) : this.options.enable; | setEnabled: function(enabled) { return this.button.setEnabled(enabled); }, |
if (onSuccessFn) onSuccessFn(r.getResult().Result); | if (onSuccessFn) onSuccessFn(r.Result); | setEntryIfNotExists: function(key, value, onSuccessFn, onErrorFn) { this.gateway.getFromService('SetEntryIfNotExists', { Key: key || null, Value: value || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); }, onErrorFn || RedisClient.errorFn); }, |
if (onSuccessFn) onSuccessFn(r.getResult().Result); | if (onSuccessFn) onSuccessFn(r.Result); | setEntryInHash: function(id, key, value, onSuccessFn, onErrorFn) { this.gateway.getFromService('SetEntryInHash', { Id: id || null, Key: key || null, Value: value || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); }, onErrorFn || RedisClient.errorFn); }, |
if (onSuccessFn) onSuccessFn(r.getResult().Result); | if (onSuccessFn) onSuccessFn(r.Result); | setEntryInHashIfNotExists: function(id, key, value, onSuccessFn, onErrorFn) { this.gateway.getFromService('SetEntryInHashIfNotExists', { Id: id || null, Key: key || null, Value: value || null }, function(r) { if (onSuccessFn) onSuccessFn(r.getResult().Result); }, onErrorFn || RedisClient.errorFn); }, |
if (efId == null) { this.store.removeAll(); return; } | setExperimentalFactor : function(efId, callback) { var options = { params : [{ id : efId, classDelegatingFor : "ExperimentalFactor" }] }; if (callback) { options.callback = callback; } this.store.load(options); }, |
|
this.service.setString('hudson.feeds.' + id + '.name', feed.getName()); this.service.setString('hudson.feeds.' + id + '.url', feed.getUrl()); | this.service.setString('extensions.hudson.buildmonitor.feeds.' + id + '.name', feed.getName()); this.service.setString('extensions.hudson.buildmonitor.feeds.' + id + '.url', feed.getUrl()); | setFeed: function(feed) { var id = feed.getId(); this.service.setString('hudson.feeds.' + id + '.name', feed.getName()); this.service.setString('hudson.feeds.' + id + '.url', feed.getUrl()); var lastFail = ''; if (feed.getLastFail() !== null) { lastFail = com_mattkruse_formatDate(feed.getLastFail(), 'yyyy-MM-ddTHH:mm:ssZ'); } this.service.setString('hudson.feeds.' + id + '.lastfail', lastFail); } |
this.service.setString('hudson.feeds.' + id + '.lastfail', lastFail); } | this.service.setString('extensions.hudson.buildmonitor.feeds.' + id + '.lastfail', lastFail); }, | setFeed: function(feed) { var id = feed.getId(); this.service.setString('hudson.feeds.' + id + '.name', feed.getName()); this.service.setString('hudson.feeds.' + id + '.url', feed.getUrl()); var lastFail = ''; if (feed.getLastFail() !== null) { lastFail = com_mattkruse_formatDate(feed.getLastFail(), 'yyyy-MM-ddTHH:mm:ssZ'); } this.service.setString('hudson.feeds.' + id + '.lastfail', lastFail); } |
lastFail = formatDate(feed.getLastFail(), 'yyyy-MM-ddTHH:mm:ssZ'); | lastFail = com_mattkruse_formatDate(feed.getLastFail(), 'yyyy-MM-ddTHH:mm:ssZ'); | setFeed: function(feed) { var id = feed.getId(); this.service.setString('hudson.feeds.' + id + '.name', feed.getName()); this.service.setString('hudson.feeds.' + id + '.url', feed.getUrl()); var lastFail = ''; if (feed.getLastFail() !== null) { lastFail = formatDate(feed.getLastFail(), 'yyyy-MM-ddTHH:mm:ssZ'); } this.service.setString('hudson.feeds.' + id + '.lastfail', lastFail); } |
Op.title = $(this).children('legend').remove().text(); | Op.title = $(this).children('legend').remove().text() || $sbmt.val(); | setFileOps: function () { var form = imce.el('imce-fileop-form'); if (!form) return; $(form.elements.filenames).parent().remove(); $(form).find('fieldset').each(function() {//remove fieldsets var $sbmt = $('input:submit', this); if (!$sbmt.size()) return; var Op = {name: $sbmt.attr('id').substr(5)}; var func = function() {imce.fopSubmit(Op.name); return false;}; $sbmt.click(func); Op.title = $(this).children('legend').remove().text(); Op.name == 'delete' ? (Op.func = func) : (Op.content = this.childNodes); imce.opAdd(Op); }).remove(); imce.vars.opform = $(form).serialize();//serialize remaining parts.}, |
this.taxon = gene.taxon; | this.taxon = { id : gene.taxonId, commonName : gene.taxonCommonName, scientificname : gene.taxonScientificName }; | setGene : function(gene) { if (this.tooltip) { this.tooltip.destroy(); } if (gene) { this.selectedGene = gene; this.taxon = gene.taxon; this.tooltip = new Ext.ToolTip({ target : this.getEl(), html : String.format('{0} ({1})', gene.officialName || "no description", gene.taxon.scientificName) }); } }, |
gene.taxon.scientificName) | gene.taxonScientificName) | setGene : function(gene) { if (this.tooltip) { this.tooltip.destroy(); } if (gene) { this.selectedGene = gene; this.taxon = gene.taxon; this.tooltip = new Ext.ToolTip({ target : this.getEl(), html : String.format('{0} ({1})', gene.officialName || "no description", gene.taxon.scientificName) }); } }, |
html : String.format('{0} ({1})', geneGroup.name, description) | html : String.format('{0} ({1})', geneGroup.name, geneGroup.description) | setGeneGroup : function(geneGroup) { if (this.tooltip) { this.tooltip.destroy(); } if (geneGroup) { this.selectedGeneGroup = geneGroup; //FIXME: gene group contains no taxon, taxon is in the gene members contained in the genegroup.... this.taxon = geneGroup.taxon; this.tooltip = new Ext.ToolTip({ target : this.getEl(), html : String.format('{0} ({1})', geneGroup.name, description) }); } }, |
setGeneGroup : function(geneGroup) { if (this.tooltip) { this.tooltip.destroy(); } if (geneGroup) { this.selectedGeneGroup = geneGroup; this.taxon = geneGroup.taxon; this.tooltip = new Ext.ToolTip({ target : this.getEl(), html : String.format('{0} ({1})', geneGroup.name, geneGroup.description) }); } | setGeneGroup : function(combo, geneGroup, index) { this.selectedGeneGroup = geneGroup.data; this.tooltip = new Ext.ToolTip({ target : this.getEl(), html : String.format('{0} ({1})', this.selectedGeneGroup.name, this.selectedGeneGroup.description) }); this.lastQuery = null; | setGeneGroup : function(geneGroup) { if (this.tooltip) { this.tooltip.destroy(); } if (geneGroup) { this.selectedGeneGroup = geneGroup; // FIXME: gene group contains no taxon, taxon is in the gene members contained in the genegroup.... this.taxon = geneGroup.taxon; this.tooltip = new Ext.ToolTip({ target : this.getEl(), html : String.format('{0} ({1})', geneGroup.name, geneGroup.description) }); } }, |
this.button.setImage(path); | if (this.button) { this.button.setImage(path); } | setImage: function(path) { this.button.setImage(path); }, |
setImage: function(url) { | setImage: function(url, imageClass) { | setImage: function(url) { if ($defined(this.icon)) { this.icon.setStyle('background', 'url('+url+') no-repeat center center'); } if (!url) { this.wrapper.addClass('jxInputIconHidden'); } else { this.wrapper.removeClass('jxInputIconHidden'); } }, |
this.icon.setStyle('background', 'url('+url+') no-repeat center center'); | this.icon.setStyle('background-image', 'url('+url+')'); this.icon.setStyle('background-repeat', 'no-repeat'); if (this.options.imageClass) { this.icon.removeClass(this.options.imageClass); } if (imageClass) { this.options.imageClass = imageClass; this.icon.addClass(imageClass); this.icon.setStyle('background-position',''); } else { this.options.imageClass = null; this.icon.setStyle('background-position','center center'); } | setImage: function(url) { if ($defined(this.icon)) { this.icon.setStyle('background', 'url('+url+') no-repeat center center'); } if (!url) { this.wrapper.addClass('jxInputIconHidden'); } else { this.wrapper.removeClass('jxInputIconHidden'); } }, |
var selectedIndex = this.selectbox.get(0).selectedIndex; | var selectNode = this.selectbox.get(0); | setInputFromMaster: function() { var selectedIndex = this.selectbox.get(0).selectedIndex; var val = ""; try { val = selectNode.options[selectedIndex].text; } catch(e) { //must have no items! } this.log("setting input to: " + val); this.input.val(val); }, |
val = selectNode.options[selectedIndex].text; | val = selectNode.options[selectNode.selectedIndex].text; | setInputFromMaster: function() { var selectedIndex = this.selectbox.get(0).selectedIndex; var val = ""; try { val = selectNode.options[selectedIndex].text; } catch(e) { //must have no items! } this.log("setting input to: " + val); this.input.val(val); }, |
this.log("setting input to: " + val); | setInputFromMaster: function() { var selectedIndex = this.selectbox.get(0).selectedIndex; var val = ""; try { val = selectNode.options[selectedIndex].text; } catch(e) { //must have no items! } this.log("setting input to: " + val); this.input.val(val); }, |
|
} | }, | setInteger: function(key, value) { this.ffPreferencesService.setIntPref(key, value); } |
this.button.setLabel(label); | if (this.button) { this.button.setLabel(label); } | setLabel: function(label) { this.button.setLabel(label); }, |
this.log("listItemHeight: " + this.itemHeight); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); // console.timeEnd("listDisplay"); return height; }, |
|
this.log("height set to: " + height); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); // console.timeEnd("listDisplay"); return height; }, |
|
this.scrollTo(); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); // console.timeEnd("listDisplay"); return height; }, |
|
this.itemHeight = this.listItems.filter("li:first").outerHeight(); | this.itemHeight = this.listItems.filter("li:first").outerHeight(true); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
var visibleCount = this.visibleCount; | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
|
if (visibleCount > this.options.listMaxVisible) { | if (this.visibleCount > this.options.listMaxVisible) { | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
height = visibleCount * this.itemHeight; | height = this.visibleCount * this.itemHeight; | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
this.listWrapper.height(height); | var outerHeight = this.listScroll.outerHeight(); this.listWrapper.height(outerHeight); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; | var offset = this.wrapper.offset(); var wrapperOuterHeight = this.wrapper.outerHeight(); var bottomPos = offset.top + wrapperOuterHeight + outerHeight; | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
top = (offset.top - this.listScroll.height() - 1) ; | top = (offset.top - outerHeight) ; | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
top = (offset.top + this.input.outerHeight() - 1); | top = (offset.top + wrapperOuterHeight); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
this.listWrapper.css("left", offset.left); | this.listWrapper.css("left", left); | setListDisplay: function() { // console.time("listDisplay"); if(!this.itemHeight) { // caclulate only once this.itemHeight = this.listItems.filter("li:first").outerHeight(); // this.log("listItemHeight: " + this.itemHeight); } var visibleCount = this.visibleCount; var height; if (visibleCount > this.options.listMaxVisible) { height = this.options.listMaxVisible * this.itemHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { height = visibleCount * this.itemHeight; this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var offset = this.input.offset(); var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); this.scrollTo(); // console.timeEnd("listDisplay"); return height; }, |
var doDropUp = false; | setListDisplay: function() { var listHeight = this.list.outerHeight(); var maxHeight = this.listMaxHeight; // this.log("set list height - listItemsHeight: " + listHeight + " : maxHeight: " + maxHeight ); var height = listHeight; if (height > maxHeight) { height = maxHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var doDropUp = false; var offset = this.input.offset(); if(this.options.allowDropUp) { var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); doDropUp = (bottomPos > maxShown); } var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); return height; }, |
|
if(this.options.allowDropUp) { var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); doDropUp = (bottomPos > maxShown); } | var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); var doDropUp = (bottomPos > maxShown); | setListDisplay: function() { var listHeight = this.list.outerHeight(); var maxHeight = this.listMaxHeight; // this.log("set list height - listItemsHeight: " + listHeight + " : maxHeight: " + maxHeight ); var height = listHeight; if (height > maxHeight) { height = maxHeight; this.listScroll.css(this.overflowCSS, "scroll"); } else { this.listScroll.css(this.overflowCSS, "hidden"); } // this.log("height set to: " + height); this.listScroll.height(height); this.listWrapper.height(height); var doDropUp = false; var offset = this.input.offset(); if(this.options.allowDropUp) { var listSpace = height; var inputHeight = this.wrapper.height(); var bottomPos = offset.top + inputHeight + listSpace; var maxShown = $(window).height() + $(document).scrollTop(); doDropUp = (bottomPos > maxShown); } var top; if (doDropUp) { this.listWrapper.addClass(this.css.listWrapperUp); top = (offset.top - this.listScroll.height() - 1) ; } else { this.listWrapper.removeClass(this.css.listWrapperUp); top = (offset.top + this.input.outerHeight() - 1); } this.listWrapper.css("left", offset.left); this.listWrapper.css("top", top ); return height; }, |
setPopUpButtons : function(innerWrapper) { | setPopUpButtons : function() { | setPopUpButtons : function(innerWrapper) { var self = this, buttons = { submit : null, cancel : null }; // check if buttons are needed, innerWrapper exists and no buttons already exist if(this.options.popup.useButtons && this.popup.innerWrapper != null && this.popup.buttons.submit == null) { buttons.submit = new Jx.Button({ label : this.options.popup.button.submit.label, image : this.options.popup.button.submit.image, onClick: function() { self.deactivate(true); } }).addTo(this.popup.innerWrapper); buttons.cancel = new Jx.Button({ label : this.options.popup.button.cancel.label, image : this.options.popup.button.cancel.image, onClick: function() { self.deactivate(false); } }).addTo(this.popup.innerWrapper); }else if(this.options.popup.useButtons && this.popup.buttons.submit != null) { buttons = { submit : this.popup.buttons.submit, cancel : this.popup.buttons.cancel }; // check if buttons are not needed and buttons already exist to remove them }else if(this.options.popup.useButtons == false && this.popup.buttons.submit != null) { this.popup.buttons.submit.cleanup(); this.popup.buttons.cancel.cleanup(); } this.popup.buttons = buttons; }, |
html = imce.vars.previewImages && width ? imce.imgHtml(fid, width, row.cells[3].innerHTML) : imce.decode(fid); | html = imce.vars.previewImages && width ? imce.imgHtml(fid, width, row.cells[3].innerHTML) : imce.decodePlain(fid); | setPreview: function (fid) { var row, html = ''; imce.vars.prvfid = fid; if (fid && (row = imce.fids[fid])) { var width = row.cells[2].innerHTML * 1; html = imce.vars.previewImages && width ? imce.imgHtml(fid, width, row.cells[3].innerHTML) : imce.decode(fid); html = '<a href="#" onclick="imce.send(\''+ fid +'\'); return false;" title="'+ (imce.vars.prvtitle||'') +'">'+ html +'</a>'; } imce.el('file-preview').innerHTML = html;}, |
var min = axisOptions.min != null ? +axisOptions.min : axis.datamin, max = axisOptions.max != null ? +axisOptions.max : axis.datamax; | var min = +(axisOptions.min != null ? axisOptions.min : axis.datamin), max = +(axisOptions.max != null ? axisOptions.max : axis.datamax), delta = max - min; | function setRange(axis, axisOptions) { var min = axisOptions.min != null ? +axisOptions.min : axis.datamin, max = axisOptions.max != null ? +axisOptions.max : axis.datamax; // degenerate case if (min == Number.POSITIVE_INFINITY) min = 0; if (max == Number.NEGATIVE_INFINITY) max = 1; if (max - min == 0.0) { // degenerate case var widen = max == 0 ? 1 : 0.01; if (axisOptions.min == null) min -= widen; // alway widen max if we couldn't widen min to ensure we // don't fall into min == max which doesn't work if (axisOptions.max == null || axisOptions.min != null) max += widen; } else { // consider autoscaling var margin = axisOptions.autoscaleMargin; if (margin != null) { if (axisOptions.min == null) { min -= (max - min) * margin; // make sure we don't go below zero if all values // are positive if (min < 0 && axis.datamin >= 0) min = 0; } if (axisOptions.max == null) { max += (max - min) * margin; if (max > 0 && axis.datamax <= 0) max = 0; } } } axis.min = min; axis.max = max; } |
if (min == Number.POSITIVE_INFINITY) min = 0; if (max == Number.NEGATIVE_INFINITY) max = 1; if (max - min == 0.0) { | if (delta == 0.0) { | function setRange(axis, axisOptions) { var min = axisOptions.min != null ? +axisOptions.min : axis.datamin, max = axisOptions.max != null ? +axisOptions.max : axis.datamax; // degenerate case if (min == Number.POSITIVE_INFINITY) min = 0; if (max == Number.NEGATIVE_INFINITY) max = 1; if (max - min == 0.0) { // degenerate case var widen = max == 0 ? 1 : 0.01; if (axisOptions.min == null) min -= widen; // alway widen max if we couldn't widen min to ensure we // don't fall into min == max which doesn't work if (axisOptions.max == null || axisOptions.min != null) max += widen; } else { // consider autoscaling var margin = axisOptions.autoscaleMargin; if (margin != null) { if (axisOptions.min == null) { min -= (max - min) * margin; // make sure we don't go below zero if all values // are positive if (min < 0 && axis.datamin >= 0) min = 0; } if (axisOptions.max == null) { max += (max - min) * margin; if (max > 0 && axis.datamax <= 0) max = 0; } } } axis.min = min; axis.max = max; } |
min -= (max - min) * margin; | min -= delta * margin; | function setRange(axis, axisOptions) { var min = axisOptions.min != null ? +axisOptions.min : axis.datamin, max = axisOptions.max != null ? +axisOptions.max : axis.datamax; // degenerate case if (min == Number.POSITIVE_INFINITY) min = 0; if (max == Number.NEGATIVE_INFINITY) max = 1; if (max - min == 0.0) { // degenerate case var widen = max == 0 ? 1 : 0.01; if (axisOptions.min == null) min -= widen; // alway widen max if we couldn't widen min to ensure we // don't fall into min == max which doesn't work if (axisOptions.max == null || axisOptions.min != null) max += widen; } else { // consider autoscaling var margin = axisOptions.autoscaleMargin; if (margin != null) { if (axisOptions.min == null) { min -= (max - min) * margin; // make sure we don't go below zero if all values // are positive if (min < 0 && axis.datamin >= 0) min = 0; } if (axisOptions.max == null) { max += (max - min) * margin; if (max > 0 && axis.datamax <= 0) max = 0; } } } axis.min = min; axis.max = max; } |
max += (max - min) * margin; if (max > 0 && axis.datamax <= 0) | max += delta * margin; if (max > 0 && axis.datamax != null && axis.datamax <= 0) | function setRange(axis, axisOptions) { var min = axisOptions.min != null ? +axisOptions.min : axis.datamin, max = axisOptions.max != null ? +axisOptions.max : axis.datamax; // degenerate case if (min == Number.POSITIVE_INFINITY) min = 0; if (max == Number.NEGATIVE_INFINITY) max = 1; if (max - min == 0.0) { // degenerate case var widen = max == 0 ? 1 : 0.01; if (axisOptions.min == null) min -= widen; // alway widen max if we couldn't widen min to ensure we // don't fall into min == max which doesn't work if (axisOptions.max == null || axisOptions.min != null) max += widen; } else { // consider autoscaling var margin = axisOptions.autoscaleMargin; if (margin != null) { if (axisOptions.min == null) { min -= (max - min) * margin; // make sure we don't go below zero if all values // are positive if (min < 0 && axis.datamin >= 0) min = 0; } if (axisOptions.max == null) { max += (max - min) * margin; if (max > 0 && axis.datamax <= 0) max = 0; } } } axis.min = min; axis.max = max; } |
this.button.setTooltip(tooltip); | if (this.button) { this.button.setTooltip(tooltip); } | setTooltip: function(tooltip) { this.button.setTooltip(tooltip); }, |
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= | {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; | Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= |
elements.unbind('click').click(handler_function); elements.unbind('keypress').keypress( function(e){ if ((e.which && e.which == 13)||(e.keyCode && e.keyCode == 13)){ return handler_function(); } } ); | setup_click_handler(elements, handler_function); setup_enter_key_handler(elements); | var setup_event_handlers = function(elements, handler_function){ elements.unbind('click').click(handler_function); elements.unbind('keypress').keypress( function(e){ if ((e.which && e.which == 13)||(e.keyCode && e.keyCode == 13)){ return handler_function(); } } ); }; |
post_new_book(obj.value, obj.info, obj.id); } | showLoadingGif(); post_new_book(obj.value, obj.info, obj.id); hideLoadingGif(); } | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ onEnterDo(e, changeNickname, jQuery(this).val()); }); $("#search").keypress(function(e){ onEnterDo(e, searchAvailable, jQuery(this).val()); }); $("#searchmine").keypress(function(e){ onEnterDo(e, searchMine, jQuery(this).val()); }); /** * $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? * e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } }); */ }// end setup handlers |
$(window).scroll(function() { if(!availableTabInFocus) return; var gap = $(document).height() - $(window).height() - $(window).scrollTop(); if (gap < 2) { loadMore(); } }); | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ onEnterDo(e, changeNickname, jQuery(this).val()); }); $("#search").keypress(function(e){ onEnterDo(e, searchAvailable, jQuery(this).val()); }); $("#searchmine").keypress(function(e){ onEnterDo(e, searchMine, jQuery(this).val()); }); /** * $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? * e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } }); */ }// end setup handlers |
|
nickname = jQuery(this).val(); | handler(arg); return false; } return true; } function changeNickname(newNick){ | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
"new_nick": nickname | "new_nick": newNick | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
$("#hi_msg").text("Hi " + nickname); | $("#hi_msg").text("Hi " + newNick); | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
return false; } return true; | } $("#search").keypress(function(e){ onEnterDo(e, searchAvailable, jQuery(this).val()); | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
$("#btn_search").click(function(e){ | function searchAvailable(term){ | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
searchTerm = jQuery($("#search")).val(); | $.ajax({ url: "/search", type: "POST", data: {"term": term}, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab(); }, error: on_ajax_fail, dataType: "json" }); } $("#searchmine").keypress(function(e){ onEnterDo(e, searchMine, jQuery(this).val()); }); function searchMine(term){ $("#searchmine_progress").show(); | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
"term": searchTerm | "term": term, "whose": 'mine' | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
$("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, | $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab(); }, | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
}); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); | } | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ c = e.which ? e.which : e.keyCode; if (c == 13) { nickname = jQuery(this).val(); $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": nickname }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + nickname); }, error: on_ajax_fail }); return false; } return true; }); $("#btn_search").click(function(e){ $("#search_progress").show(); searchTerm = jQuery($("#search")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm }, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab();}, error: on_ajax_fail, dataType: "json" }); }); $("#btn_searchmine").click(function(e){ $("#searchmine_progress").show(); searchTerm = jQuery($("#searchmine")).val(); $.ajax({ url: "/search", type: "POST", data: { "term": searchTerm, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab();}, error: on_ajax_fail, dataType: "json" }); }); /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
if(term.length < 4){ alert("search term should be at least 4 characters long!"); return; } | function setup_handlers(){ var options = { script: "/lookup_amz?", varname: "fragment", json: true, callback: function(obj){ post_new_book(obj.value, obj.info, obj.id); } }; new bsn.AutoSuggest('suggestbox', options); $("#btn_add_book").click(function(){ post_new_book($("#book_title").val(), $("#book_author").val(), 0); }); $("#edit_nick").click(function(){ $(this).hide(); $("#nick_text").show().focus(); }); $("#nick_text").keypress(function(e){ onEnterDo(e, changeNickname, jQuery(this).val()); }); function onEnterDo(e, handler, arg){ c = e.which ? e.which : e.keyCode; if (c == 13) { handler(arg); return false; } return true; } function changeNickname(newNick){ $.ajax({ url: "/nickname", type: "POST", data: { "new_nick": newNick }, success: function(msg){ $("#nick_text").hide(); $("#hi_msg").text("Hi " + newNick); }, error: on_ajax_fail }); } $("#search").keypress(function(e){ onEnterDo(e, searchAvailable, jQuery(this).val()); }); function searchAvailable(term){ $("#search_progress").show(); $.ajax({ url: "/search", type: "POST", data: {"term": term}, success: function(books){ $("#search_progress").hide(); renderOtherBooks(books); showAvailableTab(); }, error: on_ajax_fail, dataType: "json" }); } $("#searchmine").keypress(function(e){ onEnterDo(e, searchMine, jQuery(this).val()); }); function searchMine(term){ $("#searchmine_progress").show(); $.ajax({ url: "/search", type: "POST", data: { "term": term, "whose": 'mine' }, success: function(books){ $("#searchmine_progress").hide(); myBooks.render(books); showOwnedTab(); }, error: on_ajax_fail, dataType: "json" }); } /** $("#bookshelf_inner").keypress(function(e){//not working?? c = e.which ? e.which : e.keyCode; if (c == 97) { $("#suggestbox").focus(); } });**/ } |
|
if (span.length == 0) { | if (span.length === 0) { | function setupFormValidation(formSelector, validationRules, validationMessages, onSubmitCallback) { enableSubmitButton(formSelector); $(formSelector).validate({ rules: (validationRules ? validationRules : {}), messages: (validationMessages ? validationMessages : {}), errorElement: "span", errorClass: "form-error", errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length == 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); }, submitHandler: function(form) { disableSubmitButton(formSelector); if (onSubmitCallback) onSubmitCallback(); else form.submit(); } });} |
if (onSubmitCallback) | if (onSubmitCallback){ | function setupFormValidation(formSelector, validationRules, validationMessages, onSubmitCallback) { enableSubmitButton(formSelector); $(formSelector).validate({ rules: (validationRules ? validationRules : {}), messages: (validationMessages ? validationMessages : {}), errorElement: "span", errorClass: "form-error", errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length == 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); }, submitHandler: function(form) { disableSubmitButton(formSelector); if (onSubmitCallback) onSubmitCallback(); else form.submit(); } });} |
else | } else{ | function setupFormValidation(formSelector, validationRules, validationMessages, onSubmitCallback) { enableSubmitButton(formSelector); $(formSelector).validate({ rules: (validationRules ? validationRules : {}), messages: (validationMessages ? validationMessages : {}), errorElement: "span", errorClass: "form-error", errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length == 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); }, submitHandler: function(form) { disableSubmitButton(formSelector); if (onSubmitCallback) onSubmitCallback(); else form.submit(); } });} |
} | function setupFormValidation(formSelector, validationRules, validationMessages, onSubmitCallback) { enableSubmitButton(formSelector); $(formSelector).validate({ rules: (validationRules ? validationRules : {}), messages: (validationMessages ? validationMessages : {}), errorElement: "span", errorClass: "form-error", errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length == 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); }, submitHandler: function(form) { disableSubmitButton(formSelector); if (onSubmitCallback) onSubmitCallback(); else form.submit(); } });} |
|
span = element.parent().find("span.form-error"); | var span = element.parent().find("span.form-error"); if (span.length === 0){ var element_id = element.attr('id'); span = $("label[for='" + element_id + "']"); } | function setupFormValidation(formSelector, validationRules, validationMessages, onSubmitCallback) { enableSubmitButton(formSelector); $(formSelector).validate({ rules: (validationRules ? validationRules : {}), messages: (validationMessages ? validationMessages : {}), errorElement: "span", errorClass: "form-error", errorPlacement: function(error, element) { var span = element.next().find("span.form-error"); if (span.length === 0) { span = element.parent().find("span.form-error"); } span.replaceWith(error); }, submitHandler: function(form) { disableSubmitButton(formSelector); if (onSubmitCallback){ onSubmitCallback(); } else{ form.submit(); } } });} |
function setupAxis(axis, options) { setRange(axis, options); prepareTickGeneration(axis, options); setTicks(axis, options); | function setTransformationHelpers(axis, o) { function identity(x) { return x; } var s, m, t = o.transform || identity, it = o.inverseTransform; | function setupGrid() { function setupAxis(axis, options) { setRange(axis, options); prepareTickGeneration(axis, options); setTicks(axis, options); // add transformation helpers if (axis == axes.xaxis || axis == axes.x2axis) { // data point to canvas coordinate axis.p2c = function (p) { return (p - axis.min) * axis.scale; }; // canvas coordinate to data point axis.c2p = function (c) { return axis.min + c / axis.scale; }; } else { axis.p2c = function (p) { return (axis.max - p) * axis.scale; }; axis.c2p = function (p) { return axis.max - p / axis.scale; }; } } for (var axis in axes) setupAxis(axes[axis], options[axis]); setSpacing(); insertLabels(); insertLegend(); } |
axis.p2c = function (p) { return (p - axis.min) * axis.scale; }; axis.c2p = function (c) { return axis.min + c / axis.scale; }; | if (t == identity) axis.p2c = function (p) { return (p - m) * s; }; else axis.p2c = function (p) { return (t(p) - m) * s; }; if (!it) axis.c2p = function (c) { return m + c / s; }; else axis.c2p = function (c) { return it(m + c / s); }; | function setupGrid() { function setupAxis(axis, options) { setRange(axis, options); prepareTickGeneration(axis, options); setTicks(axis, options); // add transformation helpers if (axis == axes.xaxis || axis == axes.x2axis) { // data point to canvas coordinate axis.p2c = function (p) { return (p - axis.min) * axis.scale; }; // canvas coordinate to data point axis.c2p = function (c) { return axis.min + c / axis.scale; }; } else { axis.p2c = function (p) { return (axis.max - p) * axis.scale; }; axis.c2p = function (p) { return axis.max - p / axis.scale; }; } } for (var axis in axes) setupAxis(axes[axis], options[axis]); setSpacing(); insertLabels(); insertLegend(); } |
axis.p2c = function (p) { return (axis.max - p) * axis.scale; }; axis.c2p = function (p) { return axis.max - p / axis.scale; }; | s = axis.scale = plotHeight / (t(axis.max) - t(axis.min)); m = t(axis.max); if (t == identity) axis.p2c = function (p) { return (m - p) * s; }; else axis.p2c = function (p) { return (m - t(p)) * s; }; if (!it) axis.c2p = function (c) { return m - c / s; }; else axis.c2p = function (c) { return it(m - c / s); }; | function setupGrid() { function setupAxis(axis, options) { setRange(axis, options); prepareTickGeneration(axis, options); setTicks(axis, options); // add transformation helpers if (axis == axes.xaxis || axis == axes.x2axis) { // data point to canvas coordinate axis.p2c = function (p) { return (p - axis.min) * axis.scale; }; // canvas coordinate to data point axis.c2p = function (c) { return axis.min + c / axis.scale; }; } else { axis.p2c = function (p) { return (axis.max - p) * axis.scale; }; axis.c2p = function (p) { return axis.max - p / axis.scale; }; } } for (var axis in axes) setupAxis(axes[axis], options[axis]); setSpacing(); insertLabels(); insertLegend(); } |
for (var axis in axes) setupAxis(axes[axis], options[axis]); | function measureLabels(axis, axisOptions) { var i, labels = [], l; axis.labelWidth = axisOptions.labelWidth; axis.labelHeight = axisOptions.labelHeight; | function setupGrid() { function setupAxis(axis, options) { setRange(axis, options); prepareTickGeneration(axis, options); setTicks(axis, options); // add transformation helpers if (axis == axes.xaxis || axis == axes.x2axis) { // data point to canvas coordinate axis.p2c = function (p) { return (p - axis.min) * axis.scale; }; // canvas coordinate to data point axis.c2p = function (c) { return axis.min + c / axis.scale; }; } else { axis.p2c = function (p) { return (axis.max - p) * axis.scale; }; axis.c2p = function (p) { return axis.max - p / axis.scale; }; } } for (var axis in axes) setupAxis(axes[axis], options[axis]); setSpacing(); insertLabels(); insertLegend(); } |
setSpacing(); insertLabels(); | if (axis == axes.xaxis || axis == axes.x2axis) { if (axis.labelWidth == null) axis.labelWidth = canvasWidth / (axis.ticks.length > 0 ? axis.ticks.length : 1); if (axis.labelHeight == null) { labels = []; for (i = 0; i < axis.ticks.length; ++i) { l = axis.ticks[i].label; if (l) labels.push('<div class="tickLabel" style="float:left;width:' + axis.labelWidth + 'px">' + l + '</div>'); } if (labels.length > 0) { var dummyDiv = $('<div style="position:absolute;top:-10000px;width:10000px;font-size:smaller">' + labels.join("") + '<div style="clear:left"></div></div>').appendTo(placeholder); axis.labelHeight = dummyDiv.height(); dummyDiv.remove(); } } } else if (axis.labelWidth == null || axis.labelHeight == null) { for (i = 0; i < axis.ticks.length; ++i) { l = axis.ticks[i].label; if (l) labels.push('<div class="tickLabel">' + l + '</div>'); } if (labels.length > 0) { var dummyDiv = $('<div style="position:absolute;top:-10000px;font-size:smaller">' + labels.join("") + '</div>').appendTo(placeholder); if (axis.labelWidth == null) axis.labelWidth = dummyDiv.width(); if (axis.labelHeight == null) axis.labelHeight = dummyDiv.find("div").height(); dummyDiv.remove(); } } if (axis.labelWidth == null) axis.labelWidth = 0; if (axis.labelHeight == null) axis.labelHeight = 0; } function setGridSpacing() { var maxOutset = options.grid.borderWidth; for (i = 0; i < series.length; ++i) maxOutset = Math.max(maxOutset, 2 * (series[i].points.radius + series[i].points.lineWidth/2)); plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset; var margin = options.grid.labelMargin + options.grid.borderWidth; if (axes.xaxis.labelHeight > 0) plotOffset.bottom = Math.max(maxOutset, axes.xaxis.labelHeight + margin); if (axes.yaxis.labelWidth > 0) plotOffset.left = Math.max(maxOutset, axes.yaxis.labelWidth + margin); if (axes.x2axis.labelHeight > 0) plotOffset.top = Math.max(maxOutset, axes.x2axis.labelHeight + margin); if (axes.y2axis.labelWidth > 0) plotOffset.right = Math.max(maxOutset, axes.y2axis.labelWidth + margin); plotWidth = canvasWidth - plotOffset.left - plotOffset.right; plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top; } var axis; for (axis in axes) setRange(axes[axis], options[axis]); if (options.grid.show) { for (axis in axes) { prepareTickGeneration(axes[axis], options[axis]); setTicks(axes[axis], options[axis]); measureLabels(axes[axis], options[axis]); } setGridSpacing(); } else { plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = 0; plotWidth = canvasWidth; plotHeight = canvasHeight; } for (axis in axes) setTransformationHelpers(axes[axis], options[axis]); if (options.grid.show) insertLabels(); | function setupGrid() { function setupAxis(axis, options) { setRange(axis, options); prepareTickGeneration(axis, options); setTicks(axis, options); // add transformation helpers if (axis == axes.xaxis || axis == axes.x2axis) { // data point to canvas coordinate axis.p2c = function (p) { return (p - axis.min) * axis.scale; }; // canvas coordinate to data point axis.c2p = function (c) { return axis.min + c / axis.scale; }; } else { axis.p2c = function (p) { return (axis.max - p) * axis.scale; }; axis.c2p = function (p) { return axis.max - p / axis.scale; }; } } for (var axis in axes) setupAxis(axes[axis], options[axis]); setSpacing(); insertLabels(); insertLegend(); } |
} | }; | var setupHideIgnoredQuestionsControl = function(){ $('#hideIgnoredTagsCb').unbind('click').click(function(){ $.ajax({ type: 'POST', dataType: 'json', cache: false, url: scriptUrl + $.i18n._('command/'), data: {command:'toggle-ignored-questions'} }); }); } |
} | }; | var setupTagDeleteEvents = function(obj,tag_store,tagname,reason,send_ajax){ obj.unbind('mouseover').bind('mouseover', function(){ $(this).attr('src', scriptUrl + 'content/images/close-small-hover.png'); }); obj.unbind('mouseout').bind('mouseout', function(){ $(this).attr('src', scriptUrl + 'content/images/close-small-dark.png'); }); obj.click( function(){ unpickTag(tag_store,tagname,reason,send_ajax); }); } |
$(this).attr('src', scriptUrl + 'media/images/close-small-hover.png'); | $(this).attr('src', mediaUrl('media/images/close-small-hover.png')); | var setupTagDeleteEvents = function(obj,tag_store,tagname,reason,send_ajax){ obj.unbind('mouseover').bind('mouseover', function(){ $(this).attr('src', scriptUrl + 'media/images/close-small-hover.png'); }); obj.unbind('mouseout').bind('mouseout', function(){ $(this).attr('src', scriptUrl + 'media/images/close-small-dark.png'); }); obj.click( function(){ unpickTag(tag_store,tagname,reason,send_ajax); }); }; |
$(this).attr('src', scriptUrl + 'media/images/close-small-dark.png'); | $(this).attr('src', mediaUrl('media/images/close-small-dark.png')); | var setupTagDeleteEvents = function(obj,tag_store,tagname,reason,send_ajax){ obj.unbind('mouseover').bind('mouseover', function(){ $(this).attr('src', scriptUrl + 'media/images/close-small-hover.png'); }); obj.unbind('mouseout').bind('mouseout', function(){ $(this).attr('src', scriptUrl + 'media/images/close-small-dark.png'); }); obj.click( function(){ unpickTag(tag_store,tagname,reason,send_ajax); }); }; |
setUrl: function(index, fWidth, fHeight) { | setUrl: function(index, shimWidth, shimHeight) { | setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, |
this.shimWidth = fWidth; this.shimHeight = fHeight; | this.shimWidth = shimWidth; this.shimHeight = shimHeight; | setUrl: function(index, fWidth, fHeight) { activeUrl = index; els.shim.dom.src = urls[activeUrl][0]; this.urlIsSet = true; this.shimWidth = fWidth; this.shimHeight = fHeight; }, |
this.field.set('value', v); | if (!this.options.readonly) { this.field.set('value', v); } | setValue : function (v) { this.field.set('value', v); }, |
if (v === 'checked') { this.field.set('checked', "checked"); } else { this.field.erase('checked'); | if (!this.options.readonly) { if (v === 'checked' || v === 'true' || v === true) { this.field.set('checked', "checked"); } else { this.field.erase('checked'); } | setValue : function (v) { if (v === 'checked') { this.field.set('checked', "checked"); } else { this.field.erase('checked'); } }, |
if (button.options.label === value) { button.setActive(true); } | button.setActive(button.options.label === value); | setValue: function(value) { this.buttonSet.buttons.each(function(button){ if (button.options.label === value) { button.setActive(true); } },this); }, |
$$(this.field.options).each(function (opt) { if (opt.get('value') === v) { document.id(opt).set("selected", true); } }, this); | if (!this.options.readonly) { $$(this.field.options).each(function (opt) { if (opt.get('value') === v) { document.id(opt).set("selected", true); } }, this); } | setValue: function (v) { //loop through the options and set the one that matches v $$(this.field.options).each(function (opt) { if (opt.get('value') === v) { document.id(opt).set("selected", true); } }, this); }, |
setValue: function() { | setValue: function(value) { this.buttonSet.buttons.each(function(button){ if (button.options.label === value) { this.buttonSet.buttonChanged(button); } },this); | setValue: function() { }, |
if (this.hideTimer) { window.clearTimeout(this.hideTimer); } | setVisibleItem: function(obj) { if (this.visibleItem != obj) { if (this.visibleItem && this.visibleItem.hide) { this.visibleItem.hide(); } this.visibleItem = obj; this.visibleItem.show(); } }, |
|
object.attr("src", scriptUrl + "media/images/vote-arrow-"+ arrow + flag +".png"); | object.attr("src", mediaUrl("media/images/vote-arrow-"+ arrow + flag +".png")); | var setVoteImage = function(voteType, undo, object){ var flag = undo ? "" : "-on"; var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down"; object.attr("src", scriptUrl + "media/images/vote-arrow-"+ arrow + flag +".png"); // if undo voting, then undo the pair of arrows. if(undo){ if(voteType == VoteType.questionUpVote || voteType == VoteType.questionDownVote){ $(getQuestionVoteUpButton()).attr("src", scriptUrl + "media/images/vote-arrow-up.png"); $(getQuestionVoteDownButton()).attr("src", scriptUrl + "media/images/vote-arrow-down.png"); } else{ $(getAnswerVoteUpButton(postId)).attr("src", scriptUrl + "media/images/vote-arrow-up.png"); $(getAnswerVoteDownButton(postId)).attr("src", scriptUrl + "media/images/vote-arrow-down.png"); } } }; |
$(getQuestionVoteUpButton()).attr("src", scriptUrl + "media/images/vote-arrow-up.png"); $(getQuestionVoteDownButton()).attr("src", scriptUrl + "media/images/vote-arrow-down.png"); | $(getQuestionVoteUpButton()).attr("src", mediaUrl("media/images/vote-arrow-up.png")); $(getQuestionVoteDownButton()).attr("src", mediaUrl("media/images/vote-arrow-down.png")); | var setVoteImage = function(voteType, undo, object){ var flag = undo ? "" : "-on"; var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down"; object.attr("src", scriptUrl + "media/images/vote-arrow-"+ arrow + flag +".png"); // if undo voting, then undo the pair of arrows. if(undo){ if(voteType == VoteType.questionUpVote || voteType == VoteType.questionDownVote){ $(getQuestionVoteUpButton()).attr("src", scriptUrl + "media/images/vote-arrow-up.png"); $(getQuestionVoteDownButton()).attr("src", scriptUrl + "media/images/vote-arrow-down.png"); } else{ $(getAnswerVoteUpButton(postId)).attr("src", scriptUrl + "media/images/vote-arrow-up.png"); $(getAnswerVoteDownButton(postId)).attr("src", scriptUrl + "media/images/vote-arrow-down.png"); } } }; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.