rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
function removeEndSlash(str) { return str.replace(rexpEndSlash, ''); }
removeEndSlash: function(str) { return str.replace(rexpEndSlash, ''); },
function removeEndSlash(str) { return str.replace(rexpEndSlash, ''); }
el = $.id(el); if (el.addEventListener) { el.removeEventListener(name, f, false); } else { el.detachEvent('on' + name, f);
el = $.id(el); if (el.addEventListener) { el.removeEventListener(name, f, false); } else { el.detachEvent('on' + name, f); }
$.removeEvent = function(el, name, f) { el = $.id(el); if (el.addEventListener) { el.removeEventListener(name, f, false); } else { el.detachEvent('on' + name, f); }}
}
$.removeEvent = function(el, name, f) { el = $.id(el); if (el.addEventListener) { el.removeEventListener(name, f, false); } else { el.detachEvent('on' + name, f); }}
return cleanText(b.join(""))},setLineContent:function(a,b){this.history.commit();this.replaceRange({node:a,offset:0},{node:a,offset:this.history.textAfter(a).length},b);this.addDirtyNode(a);this.scheduleHighlight()},removeLine:function(a){for(var b=a?a.nextSibling:this.container.firstChild;b;){var d=b.nextSibling;removeElement(b);if(isBR(b))break;b=d}this.addDirtyNode(a);this.scheduleHighlight()},insertIntoLine:function(a,b,d){var f=null;if(b=="end")f=o(a,this.container);else for(var g=a?a.nextSibling:
lineContent:function(a){return this.editor.lineContent(a)},setLineContent:function(a,b){this.editor.setLineContent(a,b)},removeLine:function(a){this.editor.removeLine(a)},insertIntoLine:function(a,b,c){this.editor.insertIntoLine(a,b,c)},selectLines:function(a,b,c,e){this.win.focus();this.editor.selectLines(a,b,c,e)},nthLine:function(a){for(var b=this.firstLine();a>1&&b!==false;a--)b=this.nextLine(b);return b},lineNumber:function(a){for(var b=0;a!==false;){b++;a=this.prevLine(a)}return b},jumpToLine:function(a){if(typeof a==
return cleanText(b.join(""))},setLineContent:function(a,b){this.history.commit();this.replaceRange({node:a,offset:0},{node:a,offset:this.history.textAfter(a).length},b);this.addDirtyNode(a);this.scheduleHighlight()},removeLine:function(a){for(var b=a?a.nextSibling:this.container.firstChild;b;){var d=b.nextSibling;removeElement(b);if(isBR(b))break;b=d}this.addDirtyNode(a);this.scheduleHighlight()},insertIntoLine:function(a,b,d){var f=null;if(b=="end")f=o(a,this.container);else for(var g=a?a.nextSibling:
this.throwIfDisposed();
activity.Listenable.prototype.removeListener = function(listener) { this.throwIfDisposed(); var listeners = this.listeners_; for (var i = 0, len = listeners.length; i < len; i++) { if (listeners[i] == listener) { listeners.splice(i, 1); return; } }};
if (observers.members.length == 0) {
if (observers.getMembers().length == 0) {
removeObserver: function(key, target, method) { var kvoKey, chains, chain, observers, idx ; // normalize. if a function is passed to target, make it the method. if (method === undefined) { method = target; target = this ; } if (!target) target = this ; if (typeof method === "string") method = target[method] ; if (!method) throw "You must pass a method to removeObserver()" ; // if the key contains a '.', this is a chained observer. key = key.toString() ; if (key.indexOf('.') >= 0) { // try to find matching chains kvoKey = SC.keyFor('_kvo_chains', key); if (chains = this[kvoKey]) { // if chains have not been cloned yet, do so now. chains = this._kvo_for(kvoKey) ; // remove any chains idx = chains.length; while(--idx >= 0) { chain = chains[idx]; if (chain && (chain.masterTarget===target) && (chain.masterMethod===method)) { chains[idx] = chain.destroyChain() ; } } } // otherwise, just like a normal observer. } else { if (target === this) target = null ; // use null for observers only. kvoKey = SC.keyFor('_kvo_observers', key) ; if (observers = this[kvoKey]) { // if observers have not been cloned yet, do so now observers = this._kvo_for(kvoKey) ; observers.remove(target, method) ; if (observers.members.length == 0) { this._kvo_for('_kvo_observed_keys', SC.CoreSet).remove(key); } } } if (this.didRemoveObserver) this.didRemoveObserver(key, target, method); return this; },
styleName = styleName.dasherize();
removeStyle: function(styleName) { // avoid case where no styles have been defined if (!this._styles && !this._elem) return this; styleName = styleName.dasherize(); // get styles hash. this will clone if needed. var styles = this.styles(); if (styles[styleName]) { styles[styleName] = null; this._stylesDidChange = YES ; } },
styleName = styleName.dasherize();
removeStyle: function(styleName) { // avoid case where no styles have been defined if (!this._styles && !this._elem) return this; // get styles hash. this will clone if needed. var styles = this.styles(); if (styles[styleName]) { styles[styleName] = null; this._stylesDidChange = YES ; } },
for (let name in array.iterValues(cmd.names))
this._exCommands = this._exCommands.filter(function (c) c !== cmd); for (let name in values(cmd.names))
removeUserCommand: function (name) { let cmd = this.get(name); dactyl.assert(cmd.user, "E184: No such user-defined command: " + name); for (let name in array.iterValues(cmd.names)) delete this._exMap[name]; this._exCommands = this._exCommands.filter(function (c) c != cmd); },
this._exCommands = this._exCommands.filter(function (c) c != cmd);
removeUserCommand: function (name) { let cmd = this.get(name); dactyl.assert(cmd.user, "E184: No such user-defined command: " + name); for (let name in array.iterValues(cmd.names)) delete this._exMap[name]; this._exCommands = this._exCommands.filter(function (c) c != cmd); },
for (let name in values(cmd.names))
for (let name in array.itervalues(cmd.names))
removeUserCommand: function (name) { let cmd = this.get(name); dactyl.assert(cmd.user, "E184: No such user-defined command: " + name); for (let name in values(cmd.names)) delete this._exMap[name]; this._exCommands = this._exCommands.filter(function (c) c != cmd); },
if(separatorPostion > 0 && separatorPostion<len && idx >= len-separatorPostion) { idx++ ; }
render: function(context,firstTime) { sc_super(); var layoutWidth, objects, len, nameKey, iconKey, valueKey, checkboxEnabled, currentSelectedVal, shouldLocalize, separatorPostion, itemList, isChecked, idx, name, icon, value, item, itemEnabled, isEnabledKey ; layoutWidth = this.layout.width ; if(firstTime && layoutWidth) { this.adjust({ width: layoutWidth - this.SELECT_BUTTON_SPRITE_WIDTH }) ; } objects = this.get('objects') ; objects = this.sortObjects(objects) ; len = objects.length ; //Get the namekey, iconKey and valueKey set by the user nameKey = this.get('nameKey') ; iconKey = this.get('iconKey') ; valueKey = this.get('valueKey') ; isEnabledKey = this.get('isEnabledKey') ; checkboxEnabled = this.get('checkboxEnabled') ; //get the current selected value currentSelectedVal = this.get('value') ; // get the localization flag. shouldLocalize = this.get('localize') ; //get the separatorPostion separatorPostion = this.get('separatorPostion') ; //itemList array to set the menu items itemList = [] ; //to set the 'checkbox' property of menu items isChecked = YES ; //index for finding the first item in the list idx = 0 ; objects.forEach(function(object) { if (object) { //Get the name value. If value key is not specified convert obj //to string name = nameKey ? (object.get ? object.get(nameKey) : object[nameKey]) : object.toString() ; // localize name if specified. name = shouldLocalize? name.loc() : name ; //Get the icon value icon = iconKey ? (object.get ? object.get(iconKey) : object[iconKey]) : null ; if (SC.none(object[iconKey])) icon = null ; // get the value using the valueKey or the object value = (valueKey) ? (object.get ? object.get(valueKey) : object[valueKey]) : object ; if (!SC.none(currentSelectedVal) && !SC.none(value)){ if( currentSelectedVal === value ) { this.set('title', name) ; this.set('icon', icon) ; } } //Check if the item is currentSelectedItem or not if(value === this.get('value')) { //set the itemIdx - To change the prefMatrix accordingly. this.set('itemIdx', idx) ; isChecked = !checkboxEnabled ? NO : YES ; } else { isChecked = NO ; } //Check if item is enabled itemEnabled = (isEnabledKey) ? (object.get ? object.get(isEnabledKey) : object[isEnabledKey]) : object ; if(NO !== itemEnabled) itemEnabled = YES ; //Set the first item from the list as default selected item if (idx === 0) { this._defaultVal = value ; this._defaultTitle = name ; this._defaultIcon = icon ; } var item = SC.Object.create({ title: name, icon: icon, value: value, isEnabled: itemEnabled, checkbox: isChecked, target: this, action: 'displaySelectedItem' }) ; //Set the items in the itemList array itemList.push(item); } idx += 1 ; // display the separator if specified by the user if (separatorPostion && idx === (len-separatorPostion)) { var separator = SC.Object.create({ separator: YES }) ; itemList.push(separator); } this.set('itemList', itemList) ; }, this ) ; if(firstTime) { this.invokeLast(function() { var value = this.get('value') ; if(SC.none(value)) { this.set('value', this._defaultVal) ; this.set('title', this._defaultTitle) ; this.set('icon', this._defaultIcon) ; } }); } //Set the preference matrix for the menu pane this.changeSelectButtonPreferMatrix(this.itemIdx) ; },
context.setClass(this.calculateClasses()).addClass(this.controlSize);
context.setClass(this.calculateClasses()); if (this.controlSize) context.addClass(this.controlSize); this._last_control_size = this.controlSize;
render: function(context) { // update the CSS classes for the control. note we reuse the same hash // to avoid consuming more memory context.setClass(this.calculateClasses()).addClass(this.controlSize); },
if (firstTime) this.renderChildViews(context, firstTime) ;
render: function(context, firstTime) { if (firstTime) this.renderChildViews(context, firstTime) ; if (this.createRenderer) { if (firstTime) { if (this.renderer) this.renderer.render(context); } else { if (this.renderer) this.renderer.update(); } } },
} else { if (firstTime) this.renderChildViews(context, firstTime);
render: function(context, firstTime) { if (firstTime) this.renderChildViews(context, firstTime) ; if (this.createRenderer) { if (firstTime) { if (this.renderer) this.renderer.render(context); } else { if (this.renderer) this.renderer.update(); } } },
idx, name, icon, value, item;
idx, name, icon, value, item, itemEnabled, isEnabledKey;
render: function(context,firstTime) { sc_super(); var layoutWidth, items, len, nameKey, iconKey, valueKey, separatorKey, showCheckbox, currentSelectedVal, shouldLocalize, isSeparator, itemList, isChecked, idx, name, icon, value, item; items = this.get('items') ; items = this.sortObjects(items) ; len = items.length ; //Get the namekey, iconKey and valueKey set by the user nameKey = this.get('itemTitleKey') ; iconKey = this.get('itemIconKey') ; valueKey = this.get('itemValueKey') ; separatorKey = this.get('itemSeparatorKey'); showCheckbox = this.get('showCheckbox') ; //get the current selected value currentSelectedVal = this.get('value') ; // get the localization flag. shouldLocalize = this.get('localize') ; //itemList array to set the menu items itemList = [] ; //to set the 'checkbox' property of menu items isChecked = YES ; //index for finding the first item in the list idx = 0 ; items.forEach(function(object) { if (object) { //Get the name value. If value key is not specified convert obj //to string name = nameKey ? (object.get ? object.get(nameKey) : object[nameKey]) : object.toString() ; // localize name if specified. name = shouldLocalize? name.loc() : name ; //Get the icon value icon = iconKey ? (object.get ? object.get(iconKey) : object[iconKey]) : null ; if (SC.none(object[iconKey])) icon = null ; // get the value using the valueKey or the object value = (valueKey) ? (object.get ? object.get(valueKey) : object[valueKey]) : object ; if (!SC.none(currentSelectedVal) && !SC.none(value)){ if( currentSelectedVal === value ) { this.set('title', name) ; this.set('icon', icon) ; } } //Check if the item is currentSelectedItem or not if(value === this.get('value')) { //set the _itemIdx - To change the prefMatrix accordingly. this.set('_itemIdx', idx) ; isChecked = !showCheckbox ? NO : YES ; } else { isChecked = NO ; } // get the separator isSeparator = separatorKey ? (object.get ? object.get(separatorKey) : object[separatorKey]) : NO; //Set the first item from the list as default selected item if (idx === 0) { this._defaultVal = value ; this._defaultTitle = name ; this._defaultIcon = icon ; } var item = SC.Object.create({ separator: isSeparator, title: name, icon: icon, value: value, isEnabled: YES, checkbox: isChecked, action: this.displaySelectedItem }) ; //Set the items in the itemList array itemList.push(item); } idx += 1 ; this.set('_itemList', itemList) ; }, this ) ; if(firstTime) { this.invokeLast(function() { var value = this.get('value') ; if(SC.none(value)) { this.set('value', this._defaultVal) ; this.set('title', this._defaultTitle) ; this.set('icon', this._defaultIcon) ; } }); } //Set the preference matrix for the menu pane this.changeSelectButtonPreferMatrix(this._itemIdx) ; },
isEnabled: YES,
isEnabled: itemEnabled,
render: function(context,firstTime) { sc_super(); var layoutWidth, items, len, nameKey, iconKey, valueKey, separatorKey, showCheckbox, currentSelectedVal, shouldLocalize, isSeparator, itemList, isChecked, idx, name, icon, value, item; items = this.get('items') ; items = this.sortObjects(items) ; len = items.length ; //Get the namekey, iconKey and valueKey set by the user nameKey = this.get('itemTitleKey') ; iconKey = this.get('itemIconKey') ; valueKey = this.get('itemValueKey') ; separatorKey = this.get('itemSeparatorKey'); showCheckbox = this.get('showCheckbox') ; //get the current selected value currentSelectedVal = this.get('value') ; // get the localization flag. shouldLocalize = this.get('localize') ; //itemList array to set the menu items itemList = [] ; //to set the 'checkbox' property of menu items isChecked = YES ; //index for finding the first item in the list idx = 0 ; items.forEach(function(object) { if (object) { //Get the name value. If value key is not specified convert obj //to string name = nameKey ? (object.get ? object.get(nameKey) : object[nameKey]) : object.toString() ; // localize name if specified. name = shouldLocalize? name.loc() : name ; //Get the icon value icon = iconKey ? (object.get ? object.get(iconKey) : object[iconKey]) : null ; if (SC.none(object[iconKey])) icon = null ; // get the value using the valueKey or the object value = (valueKey) ? (object.get ? object.get(valueKey) : object[valueKey]) : object ; if (!SC.none(currentSelectedVal) && !SC.none(value)){ if( currentSelectedVal === value ) { this.set('title', name) ; this.set('icon', icon) ; } } //Check if the item is currentSelectedItem or not if(value === this.get('value')) { //set the _itemIdx - To change the prefMatrix accordingly. this.set('_itemIdx', idx) ; isChecked = !showCheckbox ? NO : YES ; } else { isChecked = NO ; } // get the separator isSeparator = separatorKey ? (object.get ? object.get(separatorKey) : object[separatorKey]) : NO; //Set the first item from the list as default selected item if (idx === 0) { this._defaultVal = value ; this._defaultTitle = name ; this._defaultIcon = icon ; } var item = SC.Object.create({ separator: isSeparator, title: name, icon: icon, value: value, isEnabled: YES, checkbox: isChecked, action: this.displaySelectedItem }) ; //Set the items in the itemList array itemList.push(item); } idx += 1 ; this.set('_itemList', itemList) ; }, this ) ; if(firstTime) { this.invokeLast(function() { var value = this.get('value') ; if(SC.none(value)) { this.set('value', this._defaultVal) ; this.set('title', this._defaultTitle) ; this.set('icon', this._defaultIcon) ; } }); } //Set the preference matrix for the menu pane this.changeSelectButtonPreferMatrix(this._itemIdx) ; },
this.changeSelectButtonPreferMatrix(this._itemIdx) ;
this.set('CUSTOM_MENU_ITEM_HIEGHT', this.get('controlSize') === SC.SMALL_CONTROL_SIZE ? 18 : 20); this.changeSelectButtonPreferMatrix(this.get("_itemIdx")) ;
render: function(context,firstTime) { sc_super(); var layoutWidth, items, len, nameKey, iconKey, valueKey, separatorKey, showCheckbox, currentSelectedVal, shouldLocalize, isSeparator, itemList, isChecked, idx, name, icon, value, item; items = this.get('items') ; items = this.sortObjects(items) ; len = items.length ; //Get the namekey, iconKey and valueKey set by the user nameKey = this.get('itemTitleKey') ; iconKey = this.get('itemIconKey') ; valueKey = this.get('itemValueKey') ; separatorKey = this.get('itemSeparatorKey'); showCheckbox = this.get('showCheckbox') ; //get the current selected value currentSelectedVal = this.get('value') ; // get the localization flag. shouldLocalize = this.get('localize') ; //itemList array to set the menu items itemList = [] ; //to set the 'checkbox' property of menu items isChecked = YES ; //index for finding the first item in the list idx = 0 ; items.forEach(function(object) { if (object) { //Get the name value. If value key is not specified convert obj //to string name = nameKey ? (object.get ? object.get(nameKey) : object[nameKey]) : object.toString() ; // localize name if specified. name = shouldLocalize? name.loc() : name ; //Get the icon value icon = iconKey ? (object.get ? object.get(iconKey) : object[iconKey]) : null ; if (SC.none(object[iconKey])) icon = null ; // get the value using the valueKey or the object value = (valueKey) ? (object.get ? object.get(valueKey) : object[valueKey]) : object ; if (!SC.none(currentSelectedVal) && !SC.none(value)){ if( currentSelectedVal === value ) { this.set('title', name) ; this.set('icon', icon) ; } } //Check if the item is currentSelectedItem or not if(value === this.get('value')) { //set the _itemIdx - To change the prefMatrix accordingly. this.set('_itemIdx', idx) ; isChecked = !showCheckbox ? NO : YES ; } else { isChecked = NO ; } // get the separator isSeparator = separatorKey ? (object.get ? object.get(separatorKey) : object[separatorKey]) : NO; //Set the first item from the list as default selected item if (idx === 0) { this._defaultVal = value ; this._defaultTitle = name ; this._defaultIcon = icon ; } var item = SC.Object.create({ separator: isSeparator, title: name, icon: icon, value: value, isEnabled: YES, checkbox: isChecked, action: this.displaySelectedItem }) ; //Set the items in the itemList array itemList.push(item); } idx += 1 ; this.set('_itemList', itemList) ; }, this ) ; if(firstTime) { this.invokeLast(function() { var value = this.get('value') ; if(SC.none(value)) { this.set('value', this._defaultVal) ; this.set('title', this._defaultTitle) ; this.set('icon', this._defaultIcon) ; } }); } //Set the preference matrix for the menu pane this.changeSelectButtonPreferMatrix(this._itemIdx) ; },
context.setClass('alternating', this.get('showAlternatingRows')); return sc_super(); },
if (firstTime) context.push('<div class="anchor"></div>'); }
render: function(context, firstTime) { context.setClass('alternating', this.get('showAlternatingRows')); return sc_super(); },
image = '<img src="'+blank+'" alt="" class="'+icon+'" />';
image = '<img src="'+blank+'" alt="" class="icon '+icon+'" />';
render: function(context) { var icon = this.icon, image = '', title = this.title, hint = this.hint, needsTitle = (!SC.none(title) && title.length>0), imgTitle; if(this.escapeHTML) title = SC.RenderContext.escapeHTML(title) ; // get the icon. If there is an icon, then get the image and update it. // if there is no image element yet, create it and insert it just before // title. if (icon) { var blank = SC.BLANK_IMAGE_URL; if (icon.indexOf('/') >= 0) { image = '<img src="'+icon+'" alt="" class="icon" />'; } else { image = '<img src="'+blank+'" alt="" class="'+icon+'" />'; } needsTitle = YES ; } if (hint && (!title || title === '')) { if (this.escapeHTML) hint = SC.RenderContext.escapeHTML(hint); title = "<span class='sc-hint'>" + hint + "</span>"; } imgTitle = image + title; // handle ellipsis if(this.needsEllipsis){ context.addClass('ellipsis'); } // push title. context.push(imgTitle); this._ImageTitleCached = imgTitle; },
var panelRenderDelegate = dataSource.getPath('theme').panelRenderDelegate; var displayProperties = dataSource.getChangedDisplayProperties();
var panelRenderDelegate = dataSource.get('theme').panelRenderDelegate;
render: function(dataSource, context) { var panelRenderDelegate = dataSource.getPath('theme').panelRenderDelegate; var displayProperties = dataSource.getChangedDisplayProperties(); panelRenderDelegate.render(dataSource, context); var preferType = displayProperties.preferType; var pointerPosition = displayProperties.pointerPos; var pointerPositionY = displayProperties.pointerPosY; if (preferType == SC.PICKER_POINTER || preferType == SC.PICKER_MENU_POINTER) { context.push('<div class="sc-pointer ' + pointerPosition + '" style="margin-top: ' + pointerPositionY + 'px"></div>'); context.addClass(pointerPosition); } },
var preferType = displayProperties.preferType; var pointerPosition = displayProperties.pointerPos; var pointerPositionY = displayProperties.pointerPosY;
var preferType = dataSource.get('preferType'); var pointerPosition = dataSource.get('pointerPos'); var pointerPositionY = dataSource.get('pointerPosY');
render: function(dataSource, context) { var panelRenderDelegate = dataSource.getPath('theme').panelRenderDelegate; var displayProperties = dataSource.getChangedDisplayProperties(); panelRenderDelegate.render(dataSource, context); var preferType = displayProperties.preferType; var pointerPosition = displayProperties.pointerPos; var pointerPositionY = displayProperties.pointerPosY; if (preferType == SC.PICKER_POINTER || preferType == SC.PICKER_MENU_POINTER) { context.push('<div class="sc-pointer ' + pointerPosition + '" style="margin-top: ' + pointerPositionY + 'px"></div>'); context.addClass(pointerPosition); } },
render: function(dataSource, context) { ok(dataSource.isViewRenderDelegateProxy, "Render delegate should get passed a view's proxy for its data source"); renderDelegateCount++; },
render: function(context, firstTime) { sc_super(); }
render: function(dataSource, context) { ok(dataSource.isViewRenderDelegateProxy, "Render delegate should get passed a view's proxy for its data source"); renderDelegateCount++; },
classes.push('has-count ' + digit + '-digit');
classes.push(digit + '-digit');
render: function(context) { var indent = this.outlineIndent, level = this.outlineLevel, classes = []; this._controlRenderer.attr({ isEnabled: this.isEnabled, isActive: this.isActive, isSelected: this.isSelected, controlSize: this.controlSize }); this._controlRenderer.render(context); classes.push((this.contentIndex % 2 === 0) ? 'even' : 'odd'); if (!this.isEnabled) classes.push('disabled'); if (this.disclosureState) classes.push('has-disclosure'); if (this.checkbox) classes.push('has-checkbox'); if (this.icon) classes.push('has-icon'); if (this.rightIcon) classes.push('has-right-icon'); if (this.count) { classes.push('has-count'); var digits = ['zero', 'one', 'two', 'three', 'four', 'five']; var valueLength = this.count.toString().length; var digitsLength = digits.length; var digit = (valueLength < digitsLength) ? digits[valueLength] : digits[digitsLength-1]; classes.push('has-count ' + digit + '-digit'); } context.addClass(classes); context = context.begin("div").addClass("sc-outline"); if (level>=0 && indent>0) { context.addStyle("left", indent * (level+1)); } this.renderDisclosure(context); this.renderCheckbox(context); this.renderIcon(context); this.renderLabel(context); this.renderRightIcon(context); this.renderCount(context); this.renderBranch(context); context = context.end(); // end outline },
this._controlRenderer.render(context);
if (this.layer()) this._controlRenderer.update(context); else this._controlRenderer.render(context);
render: function(context) { var segments = this.segments, idx, len, segs = [], reusables = this._segments, segment, ren; this._controlRenderer.attr({ isEnabled: this.isEnabled, isActive: this.isActive, isSelected: this.isSelected, controlSize: this.controlSize }); this._controlRenderer.render(context); context.addStyle({ 'textAlign': this.align }); // clean up; get rid of layers on our existing segments for (idx = 0, len = reusables.length; idx < len; idx++) reusables[idx].detachLayer(); // now, create new stuff for (idx = 0, len = segments.length; idx < len; idx++) { segment = segments[idx]; // create an <a> context = context.begin("a"); context.addClass('segment-' + idx); // check if we have a reusable renderer (waste not, want not) if (reusables.length > idx) { ren = reusables[idx]; } else { // otherwise, create a new one. ren = this.theme.segment(); } // set attributes ren.attr(segment); ren.attr('layoutDirection', this.layoutDirection); ren.attr('isFirstSegment', idx === 0); ren.attr('isLastSegment', idx === len - 1); ren.attr('isMiddleSegment', idx < len - 1 && idx > 0); ren.attr('controlSize', this.controlSize); // render to context ren.render(context); // finish context context = context.end(); // add renderer to our list segs.push(ren); // finally, if we have a layer, we need to attach the renderer to the layer. ren.attachLayer(this.provide(".segment-" + idx)); } this._segments = segs; },
ren.attr('isOverflowSegment', !!segment.isOverflowSegment);
render: function(context) { var segments = this.segments, idx, len, segs = [], reusables = this._segments, segment, ren; this._controlRenderer.attr({ isEnabled: this.isEnabled, isActive: this.isActive, isSelected: this.isSelected, controlSize: this.controlSize }); this._controlRenderer.render(context); context.addStyle({ 'textAlign': this.align }); // clean up; get rid of layers on our existing segments for (idx = 0, len = reusables.length; idx < len; idx++) reusables[idx].detachLayer(); // now, create new stuff for (idx = 0, len = segments.length; idx < len; idx++) { segment = segments[idx]; // create an <a> context = context.begin("a"); context.addClass('segment-' + idx); // check if we have a reusable renderer (waste not, want not) if (reusables.length > idx) { ren = reusables[idx]; } else { // otherwise, create a new one. ren = this.theme.segment(); } // set attributes ren.attr(segment); ren.attr('layoutDirection', this.layoutDirection); ren.attr('isFirstSegment', idx === 0); ren.attr('isLastSegment', idx === len - 1); ren.attr('isMiddleSegment', idx < len - 1 && idx > 0); ren.attr('controlSize', this.controlSize); // render to context ren.render(context); // finish context context = context.end(); // add renderer to our list segs.push(ren); // finally, if we have a layer, we need to attach the renderer to the layer. ren.attachLayer(this.provide(".segment-" + idx)); } this._segments = segs; },
var src = this.icon, toolTip = this.toolTip || '', image = ''; if (src && ((this.isSprite !== YES && src.indexOf('/') >= 0) || this.isSprite === NO)) { context.attr('src', src); this._last_sprite_class = NO; } else { context.attr('src', SC.BLANK_IMAGE_URL); context.addClass(src); this._last_sprite_class = src; } context.attr('title', toolTip); context.attr('alt', toolTip);
var icon = this.icon; context.addClass('no-min-width'); if(icon) context.push("<div class='img "+icon+"'></div>"); else context.push("<div class='img'></div>");
render: function(context) { var src = this.icon, toolTip = this.toolTip || '', image = ''; if (src && ((this.isSprite !== YES && src.indexOf('/') >= 0) || this.isSprite === NO)) { context.attr('src', src); this._last_sprite_class = NO; } else { context.attr('src', SC.BLANK_IMAGE_URL); context.addClass(src); this._last_sprite_class = src; } context.attr('title', toolTip); context.attr('alt', toolTip); },
this.renderer.render(context);
if (this.renderer) this.renderer.render(context);
render: function(context, firstTime) { if (firstTime) this.renderChildViews(context, firstTime) ; if (this.createRenderer) { if (firstTime) { this.renderer.render(context); } else { this.renderer.update(); } } },
this.renderer.update();
if (this.renderer) this.renderer.update();
render: function(context, firstTime) { if (firstTime) this.renderChildViews(context, firstTime) ; if (this.createRenderer) { if (firstTime) { this.renderer.render(context); } else { this.renderer.update(); } } },
context = context.begin("span").addClass("label"); this._titleRenderer.render(context); context = context.end();
render: function(context) { sc_super(); context.attr('role', 'checkbox'); context.attr('name', SC.guidFor(this)); context.attr("aria-checked", this.classNames.contains('sel').toString()); context.push('<span class="button"></span>'); this.resetChanges(); },
console.log('render');
render: function(context, firstTime) { sc_super() ; var v, accessoryViewWidths, leftAdjustment, rightAdjustment; // always have at least an empty string v = this.get('fieldValue'); if (SC.none(v)) v = ''; v = String(v); // update layer classes always context.setClass('not-empty', v.length > 0); // If we have accessory views, we'll want to update the padding on the // hint to compensate for the width of the accessory view. (It'd be nice // if we could add in the original padding, too, but there's no efficient // way to do that without first rendering the element somewhere on/off- // screen, and we don't want to take the performance hit.) accessoryViewWidths = this._getAccessoryViewWidths() ; leftAdjustment = accessoryViewWidths['left'] ; rightAdjustment = accessoryViewWidths['right'] ; if (leftAdjustment) leftAdjustment += 'px' ; if (rightAdjustment) rightAdjustment += 'px' ; this._renderField(context, firstTime, v, leftAdjustment, rightAdjustment) ; if(SC.browser.mozilla) this.invokeLast(this._applyFirefoxCursorFix); },
if (this._use_deprecated_render) return this._DEPRECATED_render(context, firstTime);
render: function(context, firstTime) { var toolTip = this.get("toolTip"); if (toolTip && this.get("localize")) toolTip = toolTip.loc(); if (firstTime) { this.buttonRenderer = this.get('theme').renderer('button'); } var size = this.get('controlSize'); this.buttonRenderer.attr({ toolTip: toolTip, isAnchor: this.get('tagName') === 'a', href: this.get('href'), icon: this.get('icon'), supportFocusRing: this.get('supportFocusRing'), titleMinWidth: this.get('titleMinWidth'), title: this.get('displayTitle'), escapeHTML: this.get('escapeHTML'), needsEllipsis: this.get('needsEllipsis'), classNames: { 'active': this.get('isActive'), 'def': this.get('isDefault'), 'cancel': this.get('isCancel'), 'sel': this.get('isSelected') }, size: size === SC.AUTO_CONTROL_SIZE ? this.get('frame') : size }); if (firstTime) this.buttonRenderer.render(context); else this.buttonRenderer.update(context.$()); },
context.resetClassNames();
render: function(context) { context .id(this.layerId) .setClass(this.calculateClassNames()); if (this.backgroundColor) { context.addStyle('backgroundColor', this.backgroundColor); } this.resetChanges(); },
var state = this.state === SC.BRANCH_OPEN ? "open" : "closed"; context.push('<img src="' + SC.BLANK_IMAGE_URL + '" class="disclosure button ' + state + '" />');
this.renderControlRenderer(context); var state = this.state ? "open" : "closed"; context.push('<img src="' + SC.BLANK_IMAGE_URL + '" class="disclosure button ' + state + '" />');
render: function(context) { var state = this.state === SC.BRANCH_OPEN ? "open" : "closed"; context.push('<img src="' + SC.BLANK_IMAGE_URL + '" class="disclosure button ' + state + '" />'); },
var src = this.src, toolTip = this.toolTip || '', image = '';
var src = this.icon, toolTip = this.toolTip || '', image = '';
render: function(context) { var src = this.src, toolTip = this.toolTip || '', image = ''; if ((this.isSprite !== YES && src.indexOf('/') >= 0) || this.isSprite === NO) { context.attr('src', src); this._last_sprite_class = NO; } else { context.attr('src', SC.BLANK_IMAGE_URL); context.addClass(src); this._last_sprite_class = src; } context.attr('title', toolTip); context.attr('alt', toolTip); },
if ((this.isSprite !== YES && src.indexOf('/') >= 0) || this.isSprite === NO) {
if (src && ((this.isSprite !== YES && src.indexOf('/') >= 0) || this.isSprite === NO)) {
render: function(context) { var src = this.src, toolTip = this.toolTip || '', image = ''; if ((this.isSprite !== YES && src.indexOf('/') >= 0) || this.isSprite === NO) { context.attr('src', src); this._last_sprite_class = NO; } else { context.attr('src', SC.BLANK_IMAGE_URL); context.addClass(src); this._last_sprite_class = src; } context.attr('title', toolTip); context.attr('alt', toolTip); },
var displayProperties = dataSource.getDisplayProperties();
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); // Use text-align to align the segments context.addStyle('text-align', displayProperties.align); },
context.addStyle('text-align', displayProperties.align);
context.addStyle('text-align', dataSource.get('align'));
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); // Use text-align to align the segments context.addStyle('text-align', displayProperties.align); },
context.addStyle('text-align', this.align);
render: function(context) { sc_super(); var segments = this.segments, idx, len, segs = [], reusables = this._segments, segment, ren; context.addClass(this.themeName); if (!reusables) reusables = this._segments = []; // now, create new stuff for (idx = 0, len = segments.length; idx < len; idx++) { segment = segments[idx]; // create an <a> context = context.begin("a"); context.addClass('segment-' + idx); // check if we have a reusable renderer (waste not, want not) if (reusables.length > idx) { ren = reusables[idx]; } else { // otherwise, create a new one. ren = this.theme.renderer('segment'); } // set attributes ren.attr(segment); ren.attr('layoutDirection', this.layoutDirection); ren.attr('classNames', { 'sc-first-segment': idx === 0, 'sc-last-segment': idx === len - 1, 'sc-middle-segment': idx < len - 1 && idx > 0 }); // render to context ren.render(context); // finish context context = context.end(); // add renderer to our list segs.push(ren); } this._segments = segs; },
var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth;
var minWidth = dataSource.get('titleMinWidth');
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth; var labelContent; context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel); dataSource.get('theme').slicesRenderDelegate.render(SC.THREE_SLICE, context); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!displayProperties.icon); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); labelContent = this._htmlForTitleAndIcon(displayProperties); context.push(labelContent); // By adding the 'ellipsis' class, the text-overflow: ellipsis CSS // rule will be applied. if (displayProperties.needsEllipsis){ context.addClass('ellipsis'); } context = context.end(); if (displayProperties.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel);
context.setClass('def', dataSource.get('isDefault')); context.setClass('cancel', dataSource.get('isCancel'));
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth; var labelContent; context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel); dataSource.get('theme').slicesRenderDelegate.render(SC.THREE_SLICE, context); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!displayProperties.icon); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); labelContent = this._htmlForTitleAndIcon(displayProperties); context.push(labelContent); // By adding the 'ellipsis' class, the text-overflow: ellipsis CSS // rule will be applied. if (displayProperties.needsEllipsis){ context.addClass('ellipsis'); } context = context.end(); if (displayProperties.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
context.setClass('icon', !!displayProperties.icon);
context.setClass('icon', !!dataSource.get('icon'));
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth; var labelContent; context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel); dataSource.get('theme').slicesRenderDelegate.render(SC.THREE_SLICE, context); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!displayProperties.icon); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); labelContent = this._htmlForTitleAndIcon(displayProperties); context.push(labelContent); // By adding the 'ellipsis' class, the text-overflow: ellipsis CSS // rule will be applied. if (displayProperties.needsEllipsis){ context.addClass('ellipsis'); } context = context.end(); if (displayProperties.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
labelContent = this._htmlForTitleAndIcon(displayProperties);
labelContent = this._htmlForTitleAndIcon(dataSource);
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth; var labelContent; context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel); dataSource.get('theme').slicesRenderDelegate.render(SC.THREE_SLICE, context); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!displayProperties.icon); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); labelContent = this._htmlForTitleAndIcon(displayProperties); context.push(labelContent); // By adding the 'ellipsis' class, the text-overflow: ellipsis CSS // rule will be applied. if (displayProperties.needsEllipsis){ context.addClass('ellipsis'); } context = context.end(); if (displayProperties.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
if (displayProperties.needsEllipsis){
if (dataSource.get('needsEllipsis')){
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth; var labelContent; context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel); dataSource.get('theme').slicesRenderDelegate.render(SC.THREE_SLICE, context); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!displayProperties.icon); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); labelContent = this._htmlForTitleAndIcon(displayProperties); context.push(labelContent); // By adding the 'ellipsis' class, the text-overflow: ellipsis CSS // rule will be applied. if (displayProperties.needsEllipsis){ context.addClass('ellipsis'); } context = context.end(); if (displayProperties.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
if (displayProperties.supportFocusRing) {
if (dataSource.get('supportFocusRing')) {
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(); var minWidth = displayProperties.titleMinWidth; var labelContent; context.setClass('def', displayProperties.isDefault); context.setClass('cancel', displayProperties.isCancel); dataSource.get('theme').slicesRenderDelegate.render(SC.THREE_SLICE, context); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!displayProperties.icon); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); labelContent = this._htmlForTitleAndIcon(displayProperties); context.push(labelContent); // By adding the 'ellipsis' class, the text-overflow: ellipsis CSS // rule will be applied. if (displayProperties.needsEllipsis){ context.addClass('ellipsis'); } context = context.end(); if (displayProperties.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
if (this.renderer) this.renderer.update();
if (firstTime) this.renderChildViews(context, firstTime);
render: function(context, firstTime) { if (this.createRenderer) { if (firstTime) { if (this.renderer) this.renderer.render(context); } else { if (this.renderer) this.renderer.update(); } } else { if (firstTime) this.renderChildViews(context, firstTime); } },
var minWidth = dataSource.get('titleMinWidth');
render: function(dataSource, context) { var minWidth = dataSource.get('titleMinWidth'); var labelContent; context.setClass('def', dataSource.get('isDefault')); context.setClass('cancel', dataSource.get('isCancel')); this.includeSlices(dataSource, context, SC.THREE_SLICE); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!dataSource.get('icon')); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); dataSource.get('theme').labelRenderDelegate.render(dataSource, context); context = context.end(); if (dataSource.get('supportFocusRing')) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
context.setClass('def', dataSource.get('isDefault')); context.setClass('cancel', dataSource.get('isCancel'));
context.setClass('def', dataSource.get('isDefault') || 0); context.setClass('cancel', dataSource.get('isCancel') || 0);
render: function(dataSource, context) { var minWidth = dataSource.get('titleMinWidth'); var labelContent; context.setClass('def', dataSource.get('isDefault')); context.setClass('cancel', dataSource.get('isCancel')); this.includeSlices(dataSource, context, SC.THREE_SLICE); // Add an icon class name to the button if it contains an icon in its // title. context.setClass('icon', !!dataSource.get('icon')); // Create the inner label element that contains the text and, optionally, // an icon. context = context.begin('label').addClass('sc-button-label'); dataSource.get('theme').labelRenderDelegate.render(dataSource, context); context = context.end(); if (dataSource.get('supportFocusRing')) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
context = context.push("<span class='sc-button-inner test'>");
render: function(context) { this._controlRenderer.attr({ isEnabled: this.isEnabled, isActive: this.isActive, isSelected: this.isSelected, controlSize: this.controlSize }); this._controlRenderer.render(context); /* Render OUR stuff */ // add href attr if tagName is anchor... var href, toolTip, classes, theme; if (this.isAnchor) { href = this.href; if (!href || (href.length === 0)) href = "javascript:;"; context.attr('href', href); } // If there is a toolTip set, grab it and localize if necessary. toolTip = this.toolTip; if (SC.typeOf(toolTip) === SC.T_STRING) { context.attr('title', toolTip) ; context.attr('alt', toolTip) ; } // add some standard attributes & classes. classes = this._TEMPORARY_CLASS_HASH ? this._TEMPORARY_CLASS_HASH : this._TEMPORARY_CLASS_HASH = {}; classes.def = this.isDefault; classes.cancel = this.isCancel; classes.icon = !!this.icon; context.attr('role', 'button').setClass(classes); theme = this.oldButtonTheme; if (theme) context.addClass(theme); // render inner html context = context.push("<span class='sc-button-inner test'>"); /* Render title */ this._titleRenderer.attr({ title: this.title, icon: this.icon, needsEllipsis: this.needsEllipsis, escapeHTML: this.escapeHTML }); this._titleRenderer.render(context); context.push("</span>") ; if(this.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
this._titleRenderer.attr({ title: this.title, icon: this.icon, needsEllipsis: this.needsEllipsis, escapeHTML: this.escapeHTML }); this._titleRenderer.render(context); context.push("</span>") ; if(this.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); }
this.renderContents(context);
render: function(context) { this._controlRenderer.attr({ isEnabled: this.isEnabled, isActive: this.isActive, isSelected: this.isSelected, controlSize: this.controlSize }); this._controlRenderer.render(context); /* Render OUR stuff */ // add href attr if tagName is anchor... var href, toolTip, classes, theme; if (this.isAnchor) { href = this.href; if (!href || (href.length === 0)) href = "javascript:;"; context.attr('href', href); } // If there is a toolTip set, grab it and localize if necessary. toolTip = this.toolTip; if (SC.typeOf(toolTip) === SC.T_STRING) { context.attr('title', toolTip) ; context.attr('alt', toolTip) ; } // add some standard attributes & classes. classes = this._TEMPORARY_CLASS_HASH ? this._TEMPORARY_CLASS_HASH : this._TEMPORARY_CLASS_HASH = {}; classes.def = this.isDefault; classes.cancel = this.isCancel; classes.icon = !!this.icon; context.attr('role', 'button').setClass(classes); theme = this.oldButtonTheme; if (theme) context.addClass(theme); // render inner html context = context.push("<span class='sc-button-inner test'>"); /* Render title */ this._titleRenderer.attr({ title: this.title, icon: this.icon, needsEllipsis: this.needsEllipsis, escapeHTML: this.escapeHTML }); this._titleRenderer.render(context); context.push("</span>") ; if(this.supportFocusRing) { context.push('<div class="focus-ring">', '<div class="focus-left"></div>', '<div class="focus-middle"></div>', '<div class="focus-right"></div></div>'); } },
var inner, animatedBackground, value, cssString, backPosition,
var inner, animatedBackground, value = dataSource.get('value') * 100, cssString, backPosition,
render: function(dataSource, context) { var theme = dataSource.get('theme'); var inner, animatedBackground, value, cssString, backPosition, isIndeterminate = dataSource.get('isIndeterminate'), isRunning = dataSource.get('isRunning'), isEnabled = dataSource.get('isEnabled'), offsetRange = theme.PROGRESS_OFFSET_RANGE, offset = (isIndeterminate && isRunning) ? (Math.floor(Date.now()/75)%offsetRange-offsetRange) : 0; // offsetRange from dataSource only supported for backwards-compatibility if (dataSource.get('offsetRange')) { if (!this._hasGivenOffsetRangeDeprecationWarning) { console.warn( "The 'offsetRange' property for progressRenderDelegate is deprecated. " + "Please override the value on your theme, instead, by setting " + "its PROGRESS_OFFSET_RANGE property." ); } this._hasGivenOffsetRangeDeprecationWarning = YES; offsetRange = dataSource.get('offsetRange'); } // compute value for setting the width of the inner progress if (!isEnabled) { value = "0%" ; } else if (isIndeterminate) { value = "120%"; } else { value = (dataSource.get('value') * 100) + "%"; } var classNames = { 'sc-indeterminate': isIndeterminate, 'sc-empty': (value <= 0), 'sc-complete': (value >= 100) }; var classString = this._createClassNameString(classNames); context.push('<div class="sc-inner ', classString, '" style="width: ', value, ';left: ', offset, 'px;">', '<div class="sc-inner-head">','</div>', '<div class="sc-inner-tail"></div></div>', '<div class="sc-outer-head"></div>', '<div class="sc-outer-tail"></div>'); },
value = (dataSource.get('value') * 100) + "%";
value = value + "%";
render: function(dataSource, context) { var theme = dataSource.get('theme'); var inner, animatedBackground, value, cssString, backPosition, isIndeterminate = dataSource.get('isIndeterminate'), isRunning = dataSource.get('isRunning'), isEnabled = dataSource.get('isEnabled'), offsetRange = theme.PROGRESS_OFFSET_RANGE, offset = (isIndeterminate && isRunning) ? (Math.floor(Date.now()/75)%offsetRange-offsetRange) : 0; // offsetRange from dataSource only supported for backwards-compatibility if (dataSource.get('offsetRange')) { if (!this._hasGivenOffsetRangeDeprecationWarning) { console.warn( "The 'offsetRange' property for progressRenderDelegate is deprecated. " + "Please override the value on your theme, instead, by setting " + "its PROGRESS_OFFSET_RANGE property." ); } this._hasGivenOffsetRangeDeprecationWarning = YES; offsetRange = dataSource.get('offsetRange'); } // compute value for setting the width of the inner progress if (!isEnabled) { value = "0%" ; } else if (isIndeterminate) { value = "120%"; } else { value = (dataSource.get('value') * 100) + "%"; } var classNames = { 'sc-indeterminate': isIndeterminate, 'sc-empty': (value <= 0), 'sc-complete': (value >= 100) }; var classString = this._createClassNameString(classNames); context.push('<div class="sc-inner ', classString, '" style="width: ', value, ';left: ', offset, 'px;">', '<div class="sc-inner-head">','</div>', '<div class="sc-inner-tail"></div></div>', '<div class="sc-outer-head"></div>', '<div class="sc-outer-tail"></div>'); },
var classNames = { 'sc-indeterminate': isIndeterminate, 'sc-empty': (value <= 0), 'sc-complete': (value >= 100) };
render: function(dataSource, context) { var theme = dataSource.get('theme'); var inner, animatedBackground, value, cssString, backPosition, isIndeterminate = dataSource.get('isIndeterminate'), isRunning = dataSource.get('isRunning'), isEnabled = dataSource.get('isEnabled'), offsetRange = theme.PROGRESS_OFFSET_RANGE, offset = (isIndeterminate && isRunning) ? (Math.floor(Date.now()/75)%offsetRange-offsetRange) : 0; // offsetRange from dataSource only supported for backwards-compatibility if (dataSource.get('offsetRange')) { if (!this._hasGivenOffsetRangeDeprecationWarning) { console.warn( "The 'offsetRange' property for progressRenderDelegate is deprecated. " + "Please override the value on your theme, instead, by setting " + "its PROGRESS_OFFSET_RANGE property." ); } this._hasGivenOffsetRangeDeprecationWarning = YES; offsetRange = dataSource.get('offsetRange'); } // compute value for setting the width of the inner progress if (!isEnabled) { value = "0%" ; } else if (isIndeterminate) { value = "120%"; } else { value = (dataSource.get('value') * 100) + "%"; } var classNames = { 'sc-indeterminate': isIndeterminate, 'sc-empty': (value <= 0), 'sc-complete': (value >= 100) }; var classString = this._createClassNameString(classNames); context.push('<div class="sc-inner ', classString, '" style="width: ', value, ';left: ', offset, 'px;">', '<div class="sc-inner-head">','</div>', '<div class="sc-inner-tail"></div></div>', '<div class="sc-outer-head"></div>', '<div class="sc-outer-tail"></div>'); },
this.renderUsingRenderer();
this.renderUsingRenderer(context);
render: function(context, firstTime) { if (firstTime) this.renderChildViews(context, firstTime) ; if (this.createRenderer) { if (firstTime) { this.renderUsingRenderer(); } else { this.updateUsingRenderer(); } } },
'" style="position: absolute; width: 100%; height: 100%; border: 0px; margin: 0px; padding: 0p;"></iframe>');
'" style="position: absolute; width: 100%; height: 100%; border: 0px; margin: 0px; padding: 0px;"></iframe>');
render: function(context, firstTime) { var src = this.get('value'); if (firstTime) { context.push('<iframe src="' + src + '" style="position: absolute; width: 100%; height: 100%; border: 0px; margin: 0px; padding: 0p;"></iframe>'); } else { var iframe = this.$('iframe'); // clear out the previous src, to force a reload iframe.attr('src', 'javascript:;'); iframe.attr('src', src); } },
this.renderClassNames(context);
render: function(context) { context.push("<div class='sc-workspace-overlay'>", "<div class='middle'></div>", "<div class='top-left-edge'></div>", "<div class='top-edge'></div>", "<div class='top-right-edge'></div>", "<div class='right-edge'></div>", "<div class='bottom-right-edge'></div>", "<div class='bottom-edge'></div>", "<div class='bottom-left-edge'></div>", "<div class='left-edge'></div>", "<div class='sc-pointer'></div>", "</div>"); if (this.contentProvider) this.contentProvider.renderContent(context); },
var displayProperties = dataSource.getDisplayProperties(), theme = dataSource.get('theme'), buttonDelegate, classes;
var theme = dataSource.get('theme'), buttonDelegate, classes;
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(), // Properties of the data source that affect the rendered output theme = dataSource.get('theme'), buttonDelegate, classes; // Segment specific additions classes = { 'sc-segment': YES, 'sc-first-segment': displayProperties.isFirstSegment, 'sc-middle-segment': displayProperties.isMiddleSegment, 'sc-last-segment': displayProperties.isLastSegment, 'sc-overflow-segment': displayProperties.isOverflowSegment }; classes['sc-segment-' + displayProperties.index] = YES; context.setClass(classes); // Use the SC.ButtonView render delegate for the current theme to render the segment as a button buttonDelegate = theme['buttonRenderDelegate']; buttonDelegate.render(dataSource, context); },
'sc-first-segment': displayProperties.isFirstSegment, 'sc-middle-segment': displayProperties.isMiddleSegment, 'sc-last-segment': displayProperties.isLastSegment, 'sc-overflow-segment': displayProperties.isOverflowSegment
'sc-first-segment': dataSource.get('isFirstSegment'), 'sc-middle-segment': dataSource.get('isMiddleSegment'), 'sc-last-segment': dataSource.get('isLastSegment'), 'sc-overflow-segment': dataSource.get('isOverflowSegment')
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(), // Properties of the data source that affect the rendered output theme = dataSource.get('theme'), buttonDelegate, classes; // Segment specific additions classes = { 'sc-segment': YES, 'sc-first-segment': displayProperties.isFirstSegment, 'sc-middle-segment': displayProperties.isMiddleSegment, 'sc-last-segment': displayProperties.isLastSegment, 'sc-overflow-segment': displayProperties.isOverflowSegment }; classes['sc-segment-' + displayProperties.index] = YES; context.setClass(classes); // Use the SC.ButtonView render delegate for the current theme to render the segment as a button buttonDelegate = theme['buttonRenderDelegate']; buttonDelegate.render(dataSource, context); },
classes['sc-segment-' + displayProperties.index] = YES;
classes['sc-segment-' + dataSource.get('index')] = YES;
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(), // Properties of the data source that affect the rendered output theme = dataSource.get('theme'), buttonDelegate, classes; // Segment specific additions classes = { 'sc-segment': YES, 'sc-first-segment': displayProperties.isFirstSegment, 'sc-middle-segment': displayProperties.isMiddleSegment, 'sc-last-segment': displayProperties.isLastSegment, 'sc-overflow-segment': displayProperties.isOverflowSegment }; classes['sc-segment-' + displayProperties.index] = YES; context.setClass(classes); // Use the SC.ButtonView render delegate for the current theme to render the segment as a button buttonDelegate = theme['buttonRenderDelegate']; buttonDelegate.render(dataSource, context); },
buttonDelegate = theme['buttonRenderDelegate'];
buttonDelegate = theme.buttonRenderDelegate;
render: function(dataSource, context) { var displayProperties = dataSource.getDisplayProperties(), // Properties of the data source that affect the rendered output theme = dataSource.get('theme'), buttonDelegate, classes; // Segment specific additions classes = { 'sc-segment': YES, 'sc-first-segment': displayProperties.isFirstSegment, 'sc-middle-segment': displayProperties.isMiddleSegment, 'sc-last-segment': displayProperties.isLastSegment, 'sc-overflow-segment': displayProperties.isOverflowSegment }; classes['sc-segment-' + displayProperties.index] = YES; context.setClass(classes); // Use the SC.ButtonView render delegate for the current theme to render the segment as a button buttonDelegate = theme['buttonRenderDelegate']; buttonDelegate.render(dataSource, context); },
this.deprecatedRenderWarning();
renderAction: function(context, actionClassName) { this.deprecatedRenderWarning(); context.push('<img src="',SC.BLANK_IMAGE_URL,'" class="action" />'); },
this.mapView(view, index);
renderBackground: function(index) { //console.log("rendering to background", index); var exampleView = this.exampleViewForIndex(index), pool = this.domPoolForExampleView(exampleView), view; if(pool.length < this.domPoolSize) { view = this.renderNew(index); } else { view = this.renderFast(index); } this.sendToDOMPool(view, YES); // if it was just rendered it's obviously not invalid anymore this.validate(index); this.mapView(view, index); return view; },
if(pool.length < this.domPoolSize) view = this.renderNew(index);
if(pool.length < this.DOMPoolSize) view = this.renderNew(index);
renderBackground: function(index) { //console.log("rendering to background", index); var reloaded, exampleView = this.exampleViewForIndex(index), pool = this.domPoolForExampleView(exampleView), view; if (this.willReload) this.willReload(reloaded = SC.IndexSet.create(index)); // create a new view if the pool has room, otherwise just take the fast path if(pool.length < this.domPoolSize) view = this.renderNew(index); else view = this.renderFast(index); this.sendToDOMPool(view, YES); // if it was just rendered it's obviously not invalid anymore this.validate(index); if (this.didReload) this.didReload(reloaded || SC.IndexSet.create(index)); return view; },
this.validate(index); this.mapView(view, index);
renderBackground: function(index) { var exampleView = this.exampleViewForIndex(index), pool = this.domPoolForExampleView(exampleView), view; if(pool.length < this.domPoolSize) { view = this.renderNew(index); } else { view = this.renderFast(index); } this.sendToDOMPool(view, YES); return view; },
if (this.didReload) this.didReload(reloaded || SC.IndexSet.create(index));
renderBackground: function(index) { //console.log("rendering to background", index); var exampleView = this.exampleViewForIndex(index), pool = this.domPoolForExampleView(exampleView), view; if(pool.length < this.domPoolSize) { view = this.renderNew(index); } else { view = this.renderFast(index); } this.sendToDOMPool(view, YES); // if it was just rendered it's obviously not invalid anymore this.validate(index); return view; },
this.deprecatedRenderWarning();
renderBranch: function(context, hasBranch) { this.deprecatedRenderWarning(); var classArray=[]; classArray.push('branch',hasBranch ? 'branch-visible' : 'branch-hidden'); context.begin('span') .addClass(classArray) .push('&nbsp;') .end(); }
var renderer = this.get('theme').renderer('checkbox');
var renderer = this.get('theme').checkboxRenderDelegate;
renderCheckbox: function(context, state) { var renderer = this.get('theme').renderer('checkbox'); // note: checkbox-view is really not the best thing to do here; we should do // sc-list-item-checkbox; however, themes expect something different, unfortunately. context = context.begin('div').addClass('sc-checkbox-view'); renderer.attr({ classNames: { sel: state && (state !== SC.MIXED_STATE), mixed: state === SC.MIXED_STATE, disabled: !(this.get('isEnabled') && this.get('contentIsEditable')), active: this._checkboxIsActive }, size: SC.REGULAR_CONTROL_SIZE }); renderer.render(context); context = context.end(); this._checkboxRenderer = renderer; },
context = context.begin('div').addClass('sc-checkbox-view'); renderer.attr({ classNames: { sel: state && (state !== SC.MIXED_STATE), mixed: state === SC.MIXED_STATE, disabled: !(this.get('isEnabled') && this.get('contentIsEditable')), active: this._checkboxIsActive }, size: SC.REGULAR_CONTROL_SIZE }); renderer.render(context);
context = context.begin('div') .addClass('sc-checkbox-view') .addClass('sc-regular-size') .addClass(this.get('theme').classNames) .addClass(renderer.get('name')); var source = this._checkboxRenderSource; if (!source) { source = this._checkboxRenderSource = SC.Object.create({ renderState: {}, theme: this.get('theme') }); } source .set('isSelected', state && (state !== SC.MIXED_STATE)) .set('isEnabled', this.get('isEnabled') && this.get('contentIsEditable')) .set('isActive', this._checkboxIsActive) .set('title', ''); renderer.render(source, context);
renderCheckbox: function(context, state) { var renderer = this.get('theme').renderer('checkbox'); // note: checkbox-view is really not the best thing to do here; we should do // sc-list-item-checkbox; however, themes expect something different, unfortunately. context = context.begin('div').addClass('sc-checkbox-view'); renderer.attr({ classNames: { sel: state && (state !== SC.MIXED_STATE), mixed: state === SC.MIXED_STATE, disabled: !(this.get('isEnabled') && this.get('contentIsEditable')), active: this._checkboxIsActive }, size: SC.REGULAR_CONTROL_SIZE }); renderer.render(context); context = context.end(); this._checkboxRenderer = renderer; },
this._checkboxRenderer = renderer;
this._checkboxRenderDelegate = renderer;
renderCheckbox: function(context, state) { var renderer = this.get('theme').renderer('checkbox'); // note: checkbox-view is really not the best thing to do here; we should do // sc-list-item-checkbox; however, themes expect something different, unfortunately. context = context.begin('div').addClass('sc-checkbox-view'); renderer.attr({ classNames: { sel: state && (state !== SC.MIXED_STATE), mixed: state === SC.MIXED_STATE, disabled: !(this.get('isEnabled') && this.get('contentIsEditable')), active: this._checkboxIsActive }, size: SC.REGULAR_CONTROL_SIZE }); renderer.render(context); context = context.end(); this._checkboxRenderer = renderer; },
this.deprecatedRenderWarning();
var renderer = this.get('theme').renderer('checkbox');
renderCheckbox: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.MIXED_STATE) ? "mixed" : state ? "sel" : "nosel", cache = this._scli_checkboxHtml, isEnabled = this.get('contentIsEditable') && this.get('isEnabled'), html, tmp, classArray=[]; if (!isEnabled) key = SC.keyFor('disabled', key); if (!cache) cache = this.constructor.prototype._scli_checkboxHtml = {}; html = cache[key]; if (!html) { tmp = SC.RenderContext('div').attr('role', 'button') .classNames(SC.clone(SC.CheckboxView.prototype.classNames)); // set state on html if (state === SC.MIXED_STATE) classArray.push('mixed'); else if(state) classArray.push('sel'); // disabled if(!isEnabled) classArray.push('disabled'); tmp.addClass(classArray); // now add inner content. note we do not add a real checkbox because // we don't want to have to setup a change observer on it. tmp.push('<span class="button"></span>'); // apply edit html = cache[key] = tmp.join(); } context.push(html); },
var key = (state === SC.MIXED_STATE) ? "mixed" : state ? "sel" : "nosel", cache = this._scli_checkboxHtml, isEnabled = this.get('contentIsEditable') && this.get('isEnabled'), html, tmp, classArray=[];
context = context.begin('div').addClass('sc-checkbox-view'); renderer.attr({ classNames: { sel: state && (state !== SC.MIXED_STATE), mixed: state === SC.MIXED_STATE, disabled: !(this.get('isEnabled') && this.get('contentIsEditable')), active: this._checkboxIsActive },
renderCheckbox: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.MIXED_STATE) ? "mixed" : state ? "sel" : "nosel", cache = this._scli_checkboxHtml, isEnabled = this.get('contentIsEditable') && this.get('isEnabled'), html, tmp, classArray=[]; if (!isEnabled) key = SC.keyFor('disabled', key); if (!cache) cache = this.constructor.prototype._scli_checkboxHtml = {}; html = cache[key]; if (!html) { tmp = SC.RenderContext('div').attr('role', 'button') .classNames(SC.clone(SC.CheckboxView.prototype.classNames)); // set state on html if (state === SC.MIXED_STATE) classArray.push('mixed'); else if(state) classArray.push('sel'); // disabled if(!isEnabled) classArray.push('disabled'); tmp.addClass(classArray); // now add inner content. note we do not add a real checkbox because // we don't want to have to setup a change observer on it. tmp.push('<span class="button"></span>'); // apply edit html = cache[key] = tmp.join(); } context.push(html); },
if (!isEnabled) key = SC.keyFor('disabled', key); if (!cache) cache = this.constructor.prototype._scli_checkboxHtml = {}; html = cache[key];
size: SC.REGULAR_CONTROL_SIZE }); renderer.render(context); context = context.end();
renderCheckbox: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.MIXED_STATE) ? "mixed" : state ? "sel" : "nosel", cache = this._scli_checkboxHtml, isEnabled = this.get('contentIsEditable') && this.get('isEnabled'), html, tmp, classArray=[]; if (!isEnabled) key = SC.keyFor('disabled', key); if (!cache) cache = this.constructor.prototype._scli_checkboxHtml = {}; html = cache[key]; if (!html) { tmp = SC.RenderContext('div').attr('role', 'button') .classNames(SC.clone(SC.CheckboxView.prototype.classNames)); // set state on html if (state === SC.MIXED_STATE) classArray.push('mixed'); else if(state) classArray.push('sel'); // disabled if(!isEnabled) classArray.push('disabled'); tmp.addClass(classArray); // now add inner content. note we do not add a real checkbox because // we don't want to have to setup a change observer on it. tmp.push('<span class="button"></span>'); // apply edit html = cache[key] = tmp.join(); } context.push(html); },
if (!html) { tmp = SC.RenderContext('div').attr('role', 'button') .classNames(SC.clone(SC.CheckboxView.prototype.classNames)); if (state === SC.MIXED_STATE) classArray.push('mixed'); else if(state) classArray.push('sel'); if(!isEnabled) classArray.push('disabled'); tmp.addClass(classArray); tmp.push('<span class="button"></span>'); html = cache[key] = tmp.join(); } context.push(html); },
this._checkboxRenderer = renderer; },
renderCheckbox: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.MIXED_STATE) ? "mixed" : state ? "sel" : "nosel", cache = this._scli_checkboxHtml, isEnabled = this.get('contentIsEditable') && this.get('isEnabled'), html, tmp, classArray=[]; if (!isEnabled) key = SC.keyFor('disabled', key); if (!cache) cache = this.constructor.prototype._scli_checkboxHtml = {}; html = cache[key]; if (!html) { tmp = SC.RenderContext('div').attr('role', 'button') .classNames(SC.clone(SC.CheckboxView.prototype.classNames)); // set state on html if (state === SC.MIXED_STATE) classArray.push('mixed'); else if(state) classArray.push('sel'); // disabled if(!isEnabled) classArray.push('disabled'); tmp.addClass(classArray); // now add inner content. note we do not add a real checkbox because // we don't want to have to setup a change observer on it. tmp.push('<span class="button"></span>'); // apply edit html = cache[key] = tmp.join(); } context.push(html); },
return context;
renderChildViews: function(context, firstTime) { if (firstTime) { this.renderContent(context); } else { this.updateContent(); } },
if (firstTime) { this.renderContent(context);
if (firstTime || context) { this.renderContent(context, firstTime);
renderChildViews: function(context, firstTime) { if (firstTime) { this.renderContent(context); } else { this.updateContent(context); } return context; },
last.add(cn[current[idx]]);
last.add(current[idx]);
renderClassNames: function(context) { var cn = {}, size = this.calculateSize(); // do diffing by setting all of last to NO, then // setting all of this time to YES var last = this._LAST_CLASS_NAMES, current = this.classNames, len, idx; if (last) { len = last.length; for (idx = 0; idx < len; idx++) cn[last[idx]] = NO; } else { // we don't need one for diffing, but we'll need _LAST_CLASS_NAMES // to store the current class names for later. last = this._LAST_CLASS_NAMES = SC.CoreSet.create(); } // we don't need any of the old entries anymore. last.clear(); // NOTE: we don't need to diff name, because it should stay the same. len = current.length; for (idx = 0; idx < len; idx++) { cn[current[idx]] = YES; last.add(cn[current[idx]]); } if (size) { cn[size] = YES; last.add(size); } cn[this.name] = YES; context.setClass(cn); return cn; },
renderContent: function(context) {
renderContent: function(context, firstTime) {
renderContent: function(context) { var cv = this.get('childViews'), len = cv.length, idx, view ; for (idx=0; idx<len; ++idx) { view = cv[idx] ; if (!view) continue; context = context.begin(view.get('tagName')) ; view.renderToContext(context); context = context.end() ; } },
view.renderToContext(context);
view.renderToContext(context, firstTime);
renderContent: function(context) { var cv = this.get('childViews'), len = cv.length, idx, view ; for (idx=0; idx<len; ++idx) { view = cv[idx] ; if (!view) continue; context = context.begin(view.get('tagName')) ; view.renderToContext(context); context = context.end() ; } },
context = context.end();
renderContents: function(context) { // render background slices context.push("<span class='button-left'></span>"); // render inner html context.push("<span class='button-middle'>"); this._titleRenderer.render(context); context.push('</span>'); context.push("<span class='button-right'></span>"); }
context.push("<span class='button-middle'></span>"); this._titleRenderer.render(context);
renderContents: function(context) { // render background slices context.push("<span class='button-left'></span>"); context.push("<span class='button-right'></span>"); context.push("<span class='button-middle'></span>"); // render inner html this._titleRenderer.render(context); }
this.deprecatedRenderWarning();
renderCount: function(context, count) { this.deprecatedRenderWarning(); context.push('<span class="count"><span class="inner">', count.toString(),'</span></span>') ; },
var renderer = this.get('theme').renderer('disclosure'); renderer.attr({ classNames: { 'sel': state === SC.BRANCH_OPEN }, size: SC.REGULAR_CONTROL_SIZE });
var renderer = this.get('theme').disclosureRenderDelegate;
renderDisclosure: function(context, state) { var renderer = this.get('theme').renderer('disclosure'); renderer.attr({ classNames: { 'sel': state === SC.BRANCH_OPEN }, size: SC.REGULAR_CONTROL_SIZE }); context = context.begin('div').addClass('sc-disclosure-view'); renderer.render(context); context.end(); this._disclosureRenderer = renderer; },
context = context.begin('div').addClass('sc-disclosure-view'); renderer.render(context); context.end(); this._disclosureRenderer = renderer;
context = context.begin('div') .addClass('sc-disclosure-view') .addClass('sc-regular-size') .addClass(this.get('theme').classNames) .addClass(renderer.get('name')); var source = this._disclosureRenderSource; if (!source) { this._disclosureRenderSource = source = SC.Object.create({ renderState: {}, theme: this.get('theme') }); } source .set('isSelected', state === SC.BRANCH_OPEN) .set('isEnabled', this.get('isEnabled')) .set('title', ''); renderer.render(source, context); context = context.end(); this._disclosureRenderDelegate = renderer;
renderDisclosure: function(context, state) { var renderer = this.get('theme').renderer('disclosure'); renderer.attr({ classNames: { 'sel': state === SC.BRANCH_OPEN }, size: SC.REGULAR_CONTROL_SIZE }); context = context.begin('div').addClass('sc-disclosure-view'); renderer.render(context); context.end(); this._disclosureRenderer = renderer; },
if (state) {
if (!SC.none(state)) {
renderDisclosure: function(context) { var state = this.disclosureState, renderer; if (state) { if (!(renderer = this._disclosureRenderer)) { renderer = this._disclosureRenderer = this.theme.disclosure(); } renderer.attr({ state: this.disclosureState }); renderer.render(context); } },
this.deprecatedRenderWarning();
var renderer = this.get('theme').renderer('disclosure'); renderer.attr({ classNames: { 'sel': state === SC.BRANCH_OPEN }, size: SC.REGULAR_CONTROL_SIZE });
renderDisclosure: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.BRANCH_OPEN) ? "open" : "closed", cache = this._scli_disclosureHtml, html, tmp; if (!cache) cache = this.constructor.prototype._scli_disclosureHtml = {}; html = cache[key]; if (!html) { html = cache[key] = '<img src="'+SC.BLANK_IMAGE_URL+'" class="disclosure button '+key+'" />'; } context.push(html); },
var key = (state === SC.BRANCH_OPEN) ? "open" : "closed", cache = this._scli_disclosureHtml, html, tmp;
context = context.begin('div').addClass('sc-list-item-disclosure'); renderer.render(context); context.end();
renderDisclosure: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.BRANCH_OPEN) ? "open" : "closed", cache = this._scli_disclosureHtml, html, tmp; if (!cache) cache = this.constructor.prototype._scli_disclosureHtml = {}; html = cache[key]; if (!html) { html = cache[key] = '<img src="'+SC.BLANK_IMAGE_URL+'" class="disclosure button '+key+'" />'; } context.push(html); },
if (!cache) cache = this.constructor.prototype._scli_disclosureHtml = {}; html = cache[key]; if (!html) { html = cache[key] = '<img src="'+SC.BLANK_IMAGE_URL+'" class="disclosure button '+key+'" />'; } context.push(html); },
this._disclosureRenderer = renderer; },
renderDisclosure: function(context, state) { this.deprecatedRenderWarning(); var key = (state === SC.BRANCH_OPEN) ? "open" : "closed", cache = this._scli_disclosureHtml, html, tmp; if (!cache) cache = this.constructor.prototype._scli_disclosureHtml = {}; html = cache[key]; if (!html) { html = cache[key] = '<img src="'+SC.BLANK_IMAGE_URL+'" class="disclosure button '+key+'" />'; } context.push(html); },
var renderer = this[name];
var renderer = this._specializedRenderers[name], base = this[name]; if (!renderer || renderer._specializedFrom !== base) { if (!base) return null; renderer = base.extend({ classNames: this.classNames, theme: this }); }
renderer: function(name) { var renderer = this[name]; var args = SC.$A(arguments); args.shift(); if (renderer) { renderer.create.apply(renderer, args); renderer.theme = this; renderer.classNames.addEach(this.classNames); } return null; }
if (renderer) { renderer.create.apply(renderer, args); renderer.theme = this; renderer.classNames.addEach(this.classNames); } return null;
renderer = renderer.create.apply(renderer, args); return renderer;
renderer: function(name) { var renderer = this[name]; var args = SC.$A(arguments); args.shift(); if (renderer) { renderer.create.apply(renderer, args); renderer.theme = this; renderer.classNames.addEach(this.classNames); } return null; }
var attrs = this._tempAttrs; this.setAttributes(index, attrs);
var attrs = this.setAttributes(index, this._tempAttrs);
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); // if we are going to steal the front of the background queue we need to fix it after we're done if(view === pool._lastRendered) { // if it's the head we need to null it, otherwise just use the next one back pool._lastRendered = (view._SCCFP_prev === view ? null : view._SCCFP_prev); } pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapView(view, index); return view; },
this.configureItemView(view, attrs);
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); // if we are going to steal the front of the background queue we need to fix it after we're done if(view === pool._lastRendered) { // if it's the head we need to null it, otherwise just use the next one back pool._lastRendered = (view._SCCFP_prev === view ? null : view._SCCFP_prev); } pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapView(view, index); return view; },
view = this.updateView(view);
view = this.updateView(view, attrs, YES);
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); // if we are going to steal the front of the background queue we need to fix it after we're done if(view === pool._lastRendered) { // if it's the head we need to null it, otherwise just use the next one back pool._lastRendered = (view._SCCFP_prev === view ? null : view._SCCFP_prev); } pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapView(view, index); return view; },
this.configureItemView(view, attrs); this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO;
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); // if we are going to steal the front of the background queue we need to fix it after we're done if(view === pool._lastRendered) { // if it's the head we need to null it, otherwise just use the next one back pool._lastRendered = (view._SCCFP_prev === view ? null : view._SCCFP_prev); } pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapView(view, index); return view; },
view = this.updateView(view, YES);
view = this.updateView(view, attrs, YES);
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); // if we are going to steal the front of the background queue we need to fix it after we're done if(view === pool._lastRendered) { // if it's the head we need to null it, otherwise just use the next one back pool._lastRendered = (view._SCCFP_prev === view ? null : view._SCCFP_prev); } pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapView(view, index); return view; },
if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); }
if(!view) view = this.renderItem(this.exampleViewForIndex(index), attrs);
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); // if we are going to steal the front of the background queue we need to fix it after we're done if(view === pool._lastRendered) { // if it's the head we need to null it, otherwise just use the next one back pool._lastRendered = (view._SCCFP_prev === view ? null : view._SCCFP_prev); } pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapView(view, index); return view; },
this.mapView(view, index);
renderFast: function(index) { var view, exampleView, pool; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { // if we just rendered it, it is no longer in a pool pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger; pool.remove(view); view = this.updateView(view); } var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(!view && (view = this.pooledViewForItem(index))) { pool = this.domPoolForExampleView(view.createdFromExampleView); pool.remove(view); this.configureItemView(view, attrs); view = this.updateView(view); } // if a pooled view exists take it and update it to match its new content if(!view && (view = this.viewFromDOMPoolFor(index))) { //console.log("reusing view from ", view.contentIndex, "for", index); this.configureItemView(view, attrs); // need to fire observers now or else they will trigger an extra run loop later this._ignore = YES; SC.Binding.flushPendingChanges(); this._ignore = NO; // replace the view or force-update it since we know the content changed view = this.updateView(view, YES); } // otherwise it needs to be rendered from scratch if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); } return view; },
if(!view) { view = this.renderItem(this.exampleViewForIndex(index), attrs); }
if(!view) view = this.renderItem(this.exampleViewForIndex(index), attrs);
renderFast: function(index) { //console.log("rendering index " + index); var view, exampleView, attrs; //var cname, aname; // if it already exists in the right place we might be able to use the existing view if(view = this._indexMap[index]) { /*cname = view.content ? view.content.get('fullName') : "undefined"; console.log("found view already at index " + index + " (" + cname + ")");*/ this.unpool(view); // TODO: consider if the item backing this index has changed, skip to the next step view = this.updateView(view); } if(!view) attrs = this.setAttributes(index, this._tempAttrs); // if a view has been rendered for the same item already, just take it and move it into its new position while(!view && (view = this.pooledViewForItem(index))) { /*cname = view.content ? view.content.get('fullName') : "undefined"; console.log("attempting to reuse view for " + cname);*/ this.unpool(view); view = this.updateView(view, attrs, YES); } // if a pooled view exists take it and update it to match its new content while(!view && (view = this.viewFromDOMPoolFor(index))) { /*cname = view.content ? view.content.get('fullName') : "undefined"; aname = attrs.content ? attrs.content.get('fullName') : "undefined"; console.log("using pooled view " + cname + " for " + aname);*/ this.unpool(view); // replace the view or force-update it since we know the content changed view = this.updateView(view, attrs, YES); } // otherwise it needs to be rendered from scratch if(!view) { /*aname = attrs.content ? attrs.content.get('fullName') : "undefined"; console.log("rendering new view for " + aname);*/ view = this.renderItem(this.exampleViewForIndex(index), attrs); } this.mapToItem(view); this.mapToIndex(view); return view; },
var view, exampleView;
var view, exampleView, pool;
renderFast: function(index) { var view, exampleView; // if it already exists in the right place we don't need to do anything if(view = this._indexMap[index]) { // maybe move this logic down in case an item can be rendered more than one way exampleView = this.exampleViewForIndex(index); // if we just rendered it, it is no longer in a pool var pool = this.domPoolForExampleView(view.createdFromExampleView); pool.remove(view); // if the item changed types we have to move the view to an offscreen pool (like the original fastpath) and replace it with a new view for the new type if(exampleView !== view.createdFromExampleView) { // make sure it is no longer treated as a rendered view; this is like unmap but it leaves it mapped to the item in case the item is rendered later this._indexMap[index] = null; // move it off screen var f = view.get("frame"); view.adjust({ top: -f.height }); // pool it and null so we render it later this.sendToDOMPool(view); view = null; // if we are going to be keeping the view, make sure that it's updated } else if(this.isInvalid(index)) { view.update(); } } // we have to do actual work :( if(!view ) { var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(view = this.pooledViewForItem(index)) { this.configureItemView(view, attrs); if(view._cfp_dirty) { view.update(); view._cfp_dirty = NO; } // if a pooled view exists take it and update it to match its new content } else if(view = this.viewFromDOMPoolFor(index)) { this.configureItemView(view, attrs); view.update(); // otherwise it needs to be rendered from scratch } else { view = this.renderItem(this.exampleViewForIndex(index), attrs); } } // if it was just rendered it's obviously not invalid anymore this.validate(index); this.mapView(view, index); return view; },
exampleView = this.exampleViewForIndex(index);
renderFast: function(index) { var view, exampleView; // if it already exists in the right place we don't need to do anything if(view = this._indexMap[index]) { // maybe move this logic down in case an item can be rendered more than one way exampleView = this.exampleViewForIndex(index); // if we just rendered it, it is no longer in a pool var pool = this.domPoolForExampleView(view.createdFromExampleView); pool.remove(view); // if the item changed types we have to move the view to an offscreen pool (like the original fastpath) and replace it with a new view for the new type if(exampleView !== view.createdFromExampleView) { // make sure it is no longer treated as a rendered view; this is like unmap but it leaves it mapped to the item in case the item is rendered later this._indexMap[index] = null; // move it off screen var f = view.get("frame"); view.adjust({ top: -f.height }); // pool it and null so we render it later this.sendToDOMPool(view); view = null; // if we are going to be keeping the view, make sure that it's updated } else if(this.isInvalid(index)) { view.update(); } } // we have to do actual work :( if(!view ) { var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(view = this.pooledViewForItem(index)) { this.configureItemView(view, attrs); if(view._cfp_dirty) { view.update(); view._cfp_dirty = NO; } // if a pooled view exists take it and update it to match its new content } else if(view = this.viewFromDOMPoolFor(index)) { this.configureItemView(view, attrs); view.update(); // otherwise it needs to be rendered from scratch } else { view = this.renderItem(this.exampleViewForIndex(index), attrs); } } // if it was just rendered it's obviously not invalid anymore this.validate(index); this.mapView(view, index); return view; },
var pool = this.domPoolForExampleView(view.createdFromExampleView);
pool = this.domPoolForExampleView(view.createdFromExampleView); if(pool._lastRendered == view) debugger;
renderFast: function(index) { var view, exampleView; // if it already exists in the right place we don't need to do anything if(view = this._indexMap[index]) { // maybe move this logic down in case an item can be rendered more than one way exampleView = this.exampleViewForIndex(index); // if we just rendered it, it is no longer in a pool var pool = this.domPoolForExampleView(view.createdFromExampleView); pool.remove(view); // if the item changed types we have to move the view to an offscreen pool (like the original fastpath) and replace it with a new view for the new type if(exampleView !== view.createdFromExampleView) { // make sure it is no longer treated as a rendered view; this is like unmap but it leaves it mapped to the item in case the item is rendered later this._indexMap[index] = null; // move it off screen var f = view.get("frame"); view.adjust({ top: -f.height }); // pool it and null so we render it later this.sendToDOMPool(view); view = null; // if we are going to be keeping the view, make sure that it's updated } else if(this.isInvalid(index)) { view.update(); } } // we have to do actual work :( if(!view ) { var attrs = this._tempAttrs; this.setAttributes(index, attrs); // if a view has been rendered for the same item already, just take it and move it into its new position if(view = this.pooledViewForItem(index)) { this.configureItemView(view, attrs); if(view._cfp_dirty) { view.update(); view._cfp_dirty = NO; } // if a pooled view exists take it and update it to match its new content } else if(view = this.viewFromDOMPoolFor(index)) { this.configureItemView(view, attrs); view.update(); // otherwise it needs to be rendered from scratch } else { view = this.renderItem(this.exampleViewForIndex(index), attrs); } } // if it was just rendered it's obviously not invalid anymore this.validate(index); this.mapView(view, index); return view; },