rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var searchRunning = false; | completion: function () { var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.get("autoCompleteSearch")) return; context.anchored = false; context.title = ["Smart Completions"]; context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; // XXX context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] for (i in util.range(0, result.matchCount)) ]; }); if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
|
context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; | context.cancel = function () { services.get("autoCompleteSearch").stopSearch(); context.completions = []; }; | completion: function () { var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.get("autoCompleteSearch")) return; context.anchored = false; context.title = ["Smart Completions"]; context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; // XXX context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] for (i in util.range(0, result.matchCount)) ]; }); if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
searchRunning = false; | completion: function () { var searchRunning = false; // only until Firefox fixes https://bugzilla.mozilla.org/show_bug.cgi?id=510589 completion.location = function location(context) { if (!services.get("autoCompleteSearch")) return; context.anchored = false; context.title = ["Smart Completions"]; context.keys.icon = 2; context.incomplete = true; context.hasItems = context.completions.length > 0; // XXX context.filterFunc = null; context.cancel = function () { if (searchRunning) { services.get("autoCompleteSearch").stopSearch(); searchRunning = false; } }; context.compare = CompletionContext.Sort.unsorted; let timer = new Timer(50, 100, function (result) { context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; context.completions = [ [result.getValueAt(i), result.getCommentAt(i), result.getImageAt(i)] for (i in util.range(0, result.matchCount)) ]; }); if (searchRunning) services.get("autoCompleteSearch").stopSearch(); searchRunning = true; services.get("autoCompleteSearch").startSearch(context.filter, "", context.result, { onSearchResult: function onSearchResult(search, result) { timer.tell(result); if (result.searchResult <= result.RESULT_SUCCESS) { searchRunning = false; timer.flush(); } } }); }; completion.sidebar = function sidebar(context) { let menu = document.getElementById("viewSidebarMenu"); context.title = ["Sidebar Panel"]; context.completions = Array.map(menu.childNodes, function (n) [n.label, ""]); }; completion.addUrlCompleter("l", "Firefox location bar entries (bookmarks and history sorted in an intelligent way)", completion.location); }, |
|
JavaScript.setCompleter(this.get, [function () config.autocommands]); | JavaScript.setCompleter(this.get, [function () Iterator(config.autocommands)]); | completion: function () { JavaScript.setCompleter(this.get, [function () config.autocommands]); completion.autocmdEvent = function autocmdEvent(context) { context.completions = config.autocommands; }; completion.macro = function macro(context) { context.title = ["Macro", "Keys"]; context.completions = [item for (item in events.getMacros())]; }; }, |
context.completions = config.autocommands; | context.completions = Iterator(config.autocommands); | completion: function () { JavaScript.setCompleter(this.get, [function () config.autocommands]); completion.autocmdEvent = function autocmdEvent(context) { context.completions = config.autocommands; }; completion.macro = function macro(context) { context.title = ["Macro", "Keys"]; context.completions = [item for (item in events.getMacros())]; }; }, |
let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes)); context.completions = [[abbr.lhs, abbr.rhs] for ([, abbr] in Iterator(abbrevs))]; | let fn = modes ? function (abbr) abbr.inModes(modes) : util.identity; context.keys = { text: "lhs" , description: "rhs" }; context.completions = abbreviations.merged.filter(fn); | completion: function () { completion.abbreviation = function abbreviation(context, modes) { let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes)); context.completions = [[abbr.lhs, abbr.rhs] for ([, abbr] in Iterator(abbrevs))]; }; }, |
completion.history = function _history(context, maxItems) { | completion.history = function _history(context, args, maxItems) { | completion: function () { completion.domain = function (context) { context.anchored = false; context.compare = function (a, b) String.localeCompare(a.key, b.key); context.keys = { text: util.identity, description: util.identity, key: function (host) host.split(".").reverse().join(".") }; // FIXME: Schema-specific context.generate = function () [ Array.slice(row.rev_host).reverse().join("").slice(1) for (row in iter(services.get("history").DBConnection .createStatement("SELECT DISTINCT rev_host FROM moz_places;"))) ].slice(2); }; completion.history = function _history(context, maxItems) { context.format = history.format; context.title = ["History"]; context.compare = CompletionContext.Sort.unsorted; //context.background = true; if (context.maxItems == null) context.maxItems = 100; context.regenerate = true; context.generate = function () history.get(context.filter, this.maxItems); }; completion.addUrlCompleter("h", "History", completion.history); }, |
context.completions = config.dialogs; | context.completions = [[k, v[0]] for ([k, v] in Iterator(config.dialogs))]; | completion: function () { completion.dialog = function dialog(context) { context.title = ["Dialog"]; context.completions = config.dialogs; }; completion.extension = function extension(context) { context.title = ["Extension"]; context.anchored = false; context.keys = { text: "name", description: "description", icon: "iconURL" }, context.incomplete = true; AddonManager.getAddonsByTypes(["extension"], function (addons) { context.incomplete = false; context.completions = addons; }); }; completion.help = function help(context, unchunked) { liberator.initHelp(); context.title = ["Help"]; context.anchored = false; context.completions = services.get("liberator:").HELP_TAGS; if (unchunked) context.keys = { text: 0, description: function () "all" }; }; completion.menuItem = function menuItem(context) { context.title = ["Menu Path", "Label"]; context.anchored = false; context.keys = { text: "fullMenuPath", description: function (item) item.getAttribute("label") }; context.completions = liberator.menuItems; }; var toolbox = document.getElementById("navigator-toolbox"); completion.toolbar = function toolbar(context) { context.title = ["Toolbar"]; context.keys = { text: function (item) item.getAttribute("toolbarname"), description: function () "" }; context.completions = util.evaluateXPath("./*[@toolbarname]", document, toolbox); }; completion.window = function window(context) { context.title = ["Window", "Title"] context.keys = { text: function (win) liberator.windows.indexOf(win) + 1, description: function (win) win.document.title }; context.completions = liberator.windows; }; }, |
completion.macro = function macro(context) { context.title = ["Macro", "Keys"]; context.completions = [item for (item in events.getMacros())]; }; | completion: function () { completion.autocmdEvent = function autocmdEvent(context) { context.completions = Iterator(config.autocommands); }; completion.macro = function macro(context) { context.title = ["Macro", "Keys"]; context.completions = [item for (item in events.getMacros())]; }; }, |
|
this.progressListener_ = this.installProgressListener(); | function ComponentCollectorService() { // Exposing the wrappedJSObject property in this way allows callers // to access the native JS object, not just the xpconnect-wrapped // object. This allows access to the full ComponentCollectorService // API, not just the subset of the API exported via the // IComponentCollector interface. this.wrappedJSObject = this; // Register the observer. var observerService = Components.classes['@mozilla.org/observer-service;1'] .getService(nsIObserverServiceIface); observerService.addObserver(this, HTTP_ON_MODIFY_REQUEST, false); observerService.addObserver(this, HTTP_ON_EXAMINE_RESPONSE, false); observerService.addObserver(this, HTTP_ON_EXAMINE_CACHED_RESPONSE, false); observerService.addObserver(this, HTTP_ON_EXAMINE_MERGED_RESPONSE, false); // Install our progress listener. We must hold a strong reference to // the progress listener, since it implements the // nsISupportsWeakReference interface. this.progressListener_ = this.installProgressListener(); // pendingDocs_ is a map and doubly-linked list that tracks // documents that are pending being transitioned to, and any // HTTP/JS/meta redirects to those documents. The keys in the map // are the URLs of the documents and/or redirects, and the values // are Objects which contain information about the resources. // // NOTE: This is currently a process-global map where the key is the // URL. This makes it possible for different tabs to step on each // others' data if the same URL is loaded in different tabs. A // better solution would be to keep a tab-local map, or at least to // keep some per-tab context as part of the key, so we could // disambiguate requests for the same URL coming from different // tabs. This is possible by extracting the webProgress object from // the opt_context argument of TYPE_DOCUMENT requests. webProgress // is a tab-local object. It is also possible to get the webProgress // for a nsIHttpChannel instance (using the nsIInterfaceRequestor // API), and it's possible to get the DOM window from the // webProgress object (webProgress.DOMWindow), so a future // improvement would use the webProgress object to prevent map // collisions between tabs. this.pendingDocs_ = new LinkedHashMap( entriesNotTooFarApart, isEntryRecentEnough);} |
|
shrinksafe.tests.module.compress = function(source, stripConsole){ | shrinksafe.tests.module.compress = function(source, stripConsole, escapeUnicode){ | shrinksafe.tests.module.compress = function(source, stripConsole){ // summary: Shorthand to compress some String version of JS code return new String(Packages.org.dojotoolkit.shrinksafe.Compressor.compressScript(source, 0, 1, stripConsole)).toString();} |
return new String(Packages.org.dojotoolkit.shrinksafe.Compressor.compressScript(source, 0, 1, stripConsole)).toString(); | return new String(Packages.org.dojotoolkit.shrinksafe.Compressor.compressScript(source, 0, 1, escapeUnicode, stripConsole)).toString(); | shrinksafe.tests.module.compress = function(source, stripConsole){ // summary: Shorthand to compress some String version of JS code return new String(Packages.org.dojotoolkit.shrinksafe.Compressor.compressScript(source, 0, 1, stripConsole)).toString();} |
classes["sc-overflow-segment"] = this.isOverflowSegment; | computeClasses: function() { var classes = this._class_hash || {}; classes["sc-first-segment"] = this.isFirstSegment; classes["sc-middle-segment"] = this.isMiddleSegment; classes["sc-last-segment"] = this.isLastSegment; classes["sc-segment"] = YES; classes["fixed"] = this.width; this._class_hash = classes; return classes; }, |
|
classes["fixed"] = this.width; | computeClasses: function() { var classes = this._class_hash || {}; classes["sc-first-segment"] = this.isFirstSegment; classes["sc-middle-segment"] = this.isMiddleSegment; classes["sc-last-segment"] = this.isLastSegment; classes["sc-segment"] = YES; this._class_hash = classes; return classes; }, |
|
config.features.push(Dactyl.getPlatformFeature()); | let os = services.get("runtime").OS; config.features.push(os == "WINNT" || os == "Darwin" ? os : "Unix"); | config: function () { config.features.push(Dactyl.getPlatformFeature()); }, |
} | }, | configSet: function(config){ TBRL.Config = config; window.localStorage.options = JSON.stringify(config); } |
val instanceof Number){ | val instanceof Number || val === null){ | configUpdate: function(log){ function setter(key, def, target){ var val = def[key]; var res = typeof(val); if(Array.isArray(val)){ if(!(target[key])) target[key] = []; for(var i = 0, l = val.length; i < l; ++i){ setter(i, val, target[key]); } } else { switch(res){ case 'string': case 'number': case 'function': case 'boolean': target[key] = val; break; default: if(val instanceof Date || val instanceof RegExp || val instanceof String || val instanceof Number){ target[key] = val; } else { if(!(target[key])) target[key] = {}; Object.keys(val).forEach(function(k){ setter(k, val, target[key]); }); } } } } Object.keys(log).forEach(function(k){ setter(k, log, TBRL.Config); }); TBRL.Config.version = TBRL.VERSION; } |
itemView.setIfChanged('content', attrs.content); itemView.setIfChanged('contentIndex', attrs.contentIndex); itemView.setIfChanged('parentView', attrs.parentView); itemView.setIfChanged('layerId', attrs.layerId); itemView.setIfChanged('isEnabled', attrs.isEnabled); itemView.setIfChanged('isSelected', attrs.isSelected); itemView.setIfChanged('outlineLevel', attrs.outlineLevel); itemView.setIfChanged('layout', attrs.layout); itemView.setIfChanged('disclosureState', attrs.disclosureState); itemView.setIfChanged('isVisibleInWindow', attrs.isVisibleInWindow); itemView.setIfChanged('isGroupView', attrs.isGroupView); | itemView.setIfChanged(attrs); | configureItemView: function(itemView, attrs) { // set settings. Self explanatory. itemView.beginPropertyChanges(); itemView.setIfChanged('content', attrs.content); itemView.setIfChanged('contentIndex', attrs.contentIndex); itemView.setIfChanged('parentView', attrs.parentView); itemView.setIfChanged('layerId', attrs.layerId); itemView.setIfChanged('isEnabled', attrs.isEnabled); itemView.setIfChanged('isSelected', attrs.isSelected); itemView.setIfChanged('outlineLevel', attrs.outlineLevel); itemView.setIfChanged('layout', attrs.layout); itemView.setIfChanged('disclosureState', attrs.disclosureState); itemView.setIfChanged('isVisibleInWindow', attrs.isVisibleInWindow); itemView.setIfChanged('isGroupView', attrs.isGroupView); itemView.setIfChanged('page', this.page); itemView.endPropertyChanges(); }, |
return itemView; | configureItemView: function(itemView, attrs) { // set settings. Self explanatory. itemView.beginPropertyChanges(); itemView.setIfChanged(attrs); itemView.endPropertyChanges(); }, |
|
console.log("configuring"); | configureItemView: function(itemView, attrs) { // set settings. Self explanatory. console.log("configuring"); itemView.beginPropertyChanges(); itemView.setIfChanged('content', attrs.content); itemView.setIfChanged('contentIndex', attrs.contentIndex); itemView.setIfChanged('parentView', attrs.parentView); itemView.setIfChanged('layerId', attrs.layerId); itemView.setIfChanged('isEnabled', attrs.isEnabled); itemView.setIfChanged('isSelected', attrs.isSelected); itemView.setIfChanged('outlineLevel', attrs.outlineLevel); itemView.setIfChanged('layout', attrs.layout); itemView.setIfChanged('disclosureState', attrs.disclosureState); itemView.setIfChanged('isVisibleInWindow', attrs.isVisibleInWindow); itemView.setIfChanged('isGroupView', attrs.isGroupView); itemView.setIfChanged('page', this.page); itemView.endPropertyChanges(); }, |
|
console.log("configuring"); | configureItemView: function(itemView, attrs) { // set settings. Self explanatory. itemView.beginPropertyChanges(); itemView.setIfChanged('content', attrs.content); itemView.setIfChanged('contentIndex', attrs.contentIndex); itemView.setIfChanged('parentView', attrs.parentView); itemView.setIfChanged('layerId', attrs.layerId); itemView.setIfChanged('isEnabled', attrs.isEnabled); itemView.setIfChanged('isSelected', attrs.isSelected); itemView.setIfChanged('outlineLevel', attrs.outlineLevel); itemView.setIfChanged('layout', attrs.layout); itemView.setIfChanged('disclosureState', attrs.disclosureState); itemView.setIfChanged('isVisibleInWindow', attrs.isVisibleInWindow); itemView.setIfChanged('isGroupView', attrs.isGroupView); itemView.setIfChanged('page', this.page); itemView.endPropertyChanges(); }, |
|
conn.onconnect = bind(this, 'cometSessionOnConnect'); | conn.onconnect = bind(this, 'cometSessionOnConnect', conn); | this.connect = function() { this._state = net.interfaces.STATE.CONNECTING; var conn = new CometSession(); conn.onconnect = bind(this, 'cometSessionOnConnect'); conn.ondisconnect = bind(this, 'onDisconnect'); logger.debug('opening the connection'); this._opts.encoding = 'plain'; var url = this._opts.url; delete this._opts.url; conn.connect(url, this._opts);//{encoding: 'plain'}); } |
var constructor = this._opts.constructor || window.WebSocket; | var constructor = this._opts.wsConstructor || window.WebSocket; logger.info('this._opts', this._opts); | this.connect = function() { var url = this._opts.url; var constructor = this._opts.constructor || window.WebSocket; var ws = new constructor(url); ws.onopen = bind(this, function() { this.onConnect(new Transport(ws)); }); ws.onclose = bind(this, function(code) { logger.debug('conn closed without opening, code:', code); }); } |
contains: function (range, r) range.compareBoundaryPoints(range.START_TO_END, r) >= 0 && range.compareBoundaryPoints(range.END_TO_START, r) <= 0, | contains: function (range, r) { try { return range.compareBoundaryPoints(range.START_TO_END, r) >= 0 && range.compareBoundaryPoints(range.END_TO_START, r) <= 0; } catch (e) { dactyl.reportError(e, true); return false; } }, | contains: function (range, r) range.compareBoundaryPoints(range.START_TO_END, r) >= 0 && range.compareBoundaryPoints(range.END_TO_START, r) <= 0, |
this.get('content').addRangeObserver(null, this, this.rangeDidChange); | contentDidChange: function() { // setup range observer }.observes('content'), |
|
this.reload(); | contentDidChange: function() { if(this._SCCFP_contentRangeObserver) this._SCCFP_contentRangeObserver.destroy(); var content = this.get('content'); if(content) this._SCCFP_contentRangeObserver = content.addRangeObserver(null, this, this.contentIndicesDidChange); }.observes('content'), |
|
contentDidChange: function(a, b, c, d,e) { | contentDidChange: function() { | contentDidChange: function(a, b, c, d,e) { if(this._cfp_contentRangeObserver) this._cfp_contentRangeObserver.destroy(); var content = this.get('content'); if(content) this._cfp_contentRangeObserver = content.addRangeObserver(null, this, this.contentIndicesDidChange); }.observes('content'), |
var layout = this.computeLayout(); if (layout) this.adjust(layout); this._SCCFP_oldLength = length; | contentLengthDidChange: function() { var content = this.get('content'), length = content ? content.get('length') : 0, oldLength = this.get('length'), indexMap = this._indexMap; if(length < oldLength) { var i, view; for(i = length; i < oldLength; i++) { view = indexMap[i]; if(view) this.sendToOffscreenDOMPool(view); } } indexMap.length = length; sc_super(); }, |
|
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType=== | a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== | d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType=== |
width = (f) ? f.width * scale : 0, height = (f) ? f.height * scale : 0, | width = 0, height = 0, | contentViewFrameDidChange: function(force) { var view = this.get('contentView'), f = (view) ? view.get('frame') : null, scale = this._scale, width = (f) ? f.width * scale : 0, height = (f) ? f.height * scale : 0, dim, dimWidth, dimHeight; width = view.get('calculatedWidth') || f.width || 0; height = view.get('calculatedHeight') || f.height || 0; width *= scale; height *= scale; // cache out scroll settings... if (!force && (width === this._scroll_contentWidth) && (height === this._scroll_contentHeight)) return ; this._scroll_contentWidth = width; this._scroll_contentHeight = height; dim = this.getPath('containerView.frame'); dimWidth = dim.width; dimHeight = dim.height; if (this.get('hasHorizontalScroller') && (view = this.get('horizontalScrollerView'))) { // decide if it should be visible or not if (this.get('autohidesHorizontalScroller')) { this.set('isHorizontalScrollerVisible', width > dimWidth); } view.setIfChanged('maximum', width-dimWidth) ; view.setIfChanged('proportion', dimWidth/width); } if (this.get('hasVerticalScroller') && (view = this.get('verticalScrollerView'))) { // decide if it should be visible or not if (this.get('autohidesVerticalScroller')) { this.set('isVerticalScrollerVisible', height > dimHeight); } view.setIfChanged('maximum', height-dimHeight) ; view.setIfChanged('proportion', dimHeight/height); } // If there is no vertical scroller and auto hiding is on, make // sure we are at the top if not already there if (!this.get('isVerticalScrollerVisible') && (this.get('verticalScrollOffset') !== 0) && this.get('autohidesVerticalScroller')) { this.set('verticalScrollOffset', 0); } // Same thing for horizontal scrolling. if (!this.get('isHorizontalScrollerVisible') && (this.get('horizontalScrollOffset') !== 0) && this.get('autohidesHorizontalScroller')) { this.set('horizontalScrollOffset', 0); } // This forces to recalculate the height of the frame when is at the bottom // of the scroll and the content dimension are smaller that the previous one var mxVOffSet = this.get('maximumVerticalScrollOffset'), vOffSet = this.get('verticalScrollOffset'), mxHOffSet = this.get('maximumHorizontalScrollOffset'), hOffSet = this.get('horizontalScrollOffset'), forceHeight = mxVOffSet < vOffSet, forceWidth = mxHOffSet < hOffSet; if (forceHeight || forceWidth) { this.forceDimensionsRecalculation(forceWidth, forceHeight, vOffSet, hOffSet); } }, |
width = view.get('calculatedWidth') || f.width || 0; height = view.get('calculatedHeight') || f.height || 0; | if (view) { width = view.get('calculatedWidth') || f.width || 0; height = view.get('calculatedHeight') || f.height || 0; } | contentViewFrameDidChange: function(force) { var view = this.get('contentView'), f = (view) ? view.get('frame') : null, scale = this._scale, width = (f) ? f.width * scale : 0, height = (f) ? f.height * scale : 0, dim, dimWidth, dimHeight; width = view.get('calculatedWidth') || f.width || 0; height = view.get('calculatedHeight') || f.height || 0; width *= scale; height *= scale; // cache out scroll settings... if (!force && (width === this._scroll_contentWidth) && (height === this._scroll_contentHeight)) return ; this._scroll_contentWidth = width; this._scroll_contentHeight = height; dim = this.getPath('containerView.frame'); dimWidth = dim.width; dimHeight = dim.height; if (this.get('hasHorizontalScroller') && (view = this.get('horizontalScrollerView'))) { // decide if it should be visible or not if (this.get('autohidesHorizontalScroller')) { this.set('isHorizontalScrollerVisible', width > dimWidth); } view.setIfChanged('maximum', width-dimWidth) ; view.setIfChanged('proportion', dimWidth/width); } if (this.get('hasVerticalScroller') && (view = this.get('verticalScrollerView'))) { // decide if it should be visible or not if (this.get('autohidesVerticalScroller')) { this.set('isVerticalScrollerVisible', height > dimHeight); } view.setIfChanged('maximum', height-dimHeight) ; view.setIfChanged('proportion', dimHeight/height); } // If there is no vertical scroller and auto hiding is on, make // sure we are at the top if not already there if (!this.get('isVerticalScrollerVisible') && (this.get('verticalScrollOffset') !== 0) && this.get('autohidesVerticalScroller')) { this.set('verticalScrollOffset', 0); } // Same thing for horizontal scrolling. if (!this.get('isHorizontalScrollerVisible') && (this.get('horizontalScrollOffset') !== 0) && this.get('autohidesHorizontalScroller')) { this.set('horizontalScrollOffset', 0); } // This forces to recalculate the height of the frame when is at the bottom // of the scroll and the content dimension are smaller that the previous one var mxVOffSet = this.get('maximumVerticalScrollOffset'), vOffSet = this.get('verticalScrollOffset'), mxHOffSet = this.get('maximumHorizontalScrollOffset'), hOffSet = this.get('horizontalScrollOffset'), forceHeight = mxVOffSet < vOffSet, forceWidth = mxHOffSet < hOffSet; if (forceHeight || forceWidth) { this.forceDimensionsRecalculation(forceWidth, forceHeight, vOffSet, hOffSet); } }, |
this.parserIndex = -1; this.statementIndex = 0; | doctest.Context = function (testSuite) { if (this === window) { throw('You forgot new!'); } this.parserIndex = -1; this.statementIndex = 0; this.testSuite = testSuite; this.lastExample = null; this.runner = null; this.timeout = 0; this.timeoutFunc = null;}; |
|
this.lastExample = null; | doctest.Context = function (testSuite) { if (this === window) { throw('You forgot new!'); } this.parserIndex = -1; this.statementIndex = 0; this.testSuite = testSuite; this.lastExample = null; this.runner = null; this.timeout = 0; this.timeoutFunc = null;}; |
|
this.timeout = 0; this.timeoutFunc = null; | doctest.Context = function (testSuite) { if (this === window) { throw('You forgot new!'); } this.parserIndex = -1; this.statementIndex = 0; this.testSuite = testSuite; this.lastExample = null; this.runner = null; this.timeout = 0; this.timeoutFunc = null;}; |
|
update(ctx, TBRL.createContext(query && document.querySelector(query))); | update(ctx, TBRL.createContext((query && document.querySelector(query)) || TBRL.getContextMenuTarget())); | contextMenus: function(req, sender, func) { func({}); var content = req.content; var ctx = {}; var query = null; switch (content.mediaType) { case 'video': ctx.onVideo = true; ctx.target = $N('video', { src: content.srcUrl }); query = 'video[src="'+content.srcUrl+'"]'; break; case 'audio': ctx.onVideo = true; ctx.target = $N('audio', { src: content.srcUrl }); query = 'audio[src="'+content.srcUrl+'"]'; break; case 'image': ctx.onImage = true; ctx.target = $N('img', { src: content.srcUrl }); query = 'img[src="'+content.srcUrl+'"]'; break; default: if (content.linkUrl) { // case link ctx.onLink = true; ctx.link = ctx.target = $N('a', { href: content.linkUrl }); ctx.title = content.linkUrl; query = 'a[href="'+content.linkUrl+'"]'; } break; } update(ctx, TBRL.createContext(query && document.querySelector(query))); TBRL.share(ctx, Extractors.check(ctx)[0], true); }, |
}, TBRL.createContext(document.querySelector('audio[src="'+content.srcUrl+'"]'))); | }, TBRL.createContext(document.querySelector('audio[src="'+content.srcUrl+'"]') || TBRL.getContextMenuTarget())); | contextMenusAudio: function(req, sender, func) { func({}); var content = req.content; var ctx = update({ onVideo: true, contextMenu: true }, TBRL.createContext(document.querySelector('audio[src="'+content.srcUrl+'"]'))); TBRL.share(ctx, Extractors.Audio, true); }, |
}, TBRL.createContext()); | }, TBRL.createContext(TBRL.getContextMenuTarget())); | contextMenusCapture: function(req, sender, func) { func({}); var content = req.content; var ctx = update({ contextMenu: true }, TBRL.createContext()); TBRL.share(ctx, Extractors["Photo - Capture"], true); } |
}, TBRL.createContext(document.querySelector('img[src="'+content.srcUrl+'"]'))); | }, TBRL.createContext(document.querySelector('img[src="'+content.srcUrl+'"]') || TBRL.getContextMenuTarget())); | contextMenusImage: function(req, sender, func) { func({}); var content = req.content; var ctx = update({ onImage: true, contextMenu: true }, TBRL.createContext(document.querySelector('img[src="'+content.srcUrl+'"]'))); var ext = Extractors.check(ctx).filter(function(m){ return /^Photo/.test(m.name); })[0]; TBRL.share(ctx, ext, true); }, |
}, TBRL.createContext(document.querySelector('a[href="'+content.linkUrl+'"]'))); | }, TBRL.createContext(document.querySelector('a[href="'+content.linkUrl+'"]') || TBRL.getContextMenuTarget())); | contextMenusLink: function(req, sender, func) { func({}); var content = req.content; var ctx = update({ title: content.linkUrl, onLink: true, contextMenu: true }, TBRL.createContext(document.querySelector('a[href="'+content.linkUrl+'"]'))); ctx.link = ctx.target; var ext = Extractors.check(ctx).filter(function(m){ return /^Link/.test(m.name); })[0]; TBRL.share(ctx, ext, true); }, |
}, TBRL.createContext()); | }, TBRL.createContext(TBRL.getContextMenuTarget())); | contextMenusQuote: function(req, sender, func) { func({}); var content = req.content; var sel = createFlavoredString(window.getSelection()); var ctx = update({ contextMenu: true }, TBRL.createContext()); var ext = Extractors.check(ctx).filter(function(m){ return /^Quote/.test(m.name); })[0]; TBRL.share(ctx, ext, true); }, |
}, TBRL.createContext(document.querySelector('video[src="'+content.srcUrl+'"]'))); | }, TBRL.createContext(document.querySelector('video[src="'+content.srcUrl+'"]') || TBRL.getContextMenuTarget())); | contextMenusVideo: function(req, sender, func) { func({}); var content = req.content; var ctx = update({ onVideo: true, contextMenu: true }, TBRL.createContext(document.querySelector('video[src="'+content.srcUrl+'"]'))); var ext = Extractors.check(ctx).filter(function(m){ return /^Video/.test(m.name); })[0]; TBRL.share(ctx, ext, true); }, |
this._updateUI(); | convert: function () { //Logger.debug("convert:"); if (this._error) { return false; } var ctx = this; this._backend.query(this, function () { ctx._updateCandidates(ctx._predict()); }); return true; }, |
|
if (this._error) { | if (this.error) { | convert: function () { //Logger.debug("convert:"); if (this._error) { return false; } var ctx = this; // set error beforehand in case the query fails, and to prevent repeated queries this._error = {start: 0, end: ctx.input.length}; this._backend.query(this, function () { ctx._updateCandidates(ctx._predict()); }); this._updateUI(); return true; }, |
this._error = {start: 0, end: ctx.input.length}; | this.error = {start: 0, end: ctx.input.length}; this.pending = []; | convert: function () { //Logger.debug("convert:"); if (this._error) { return false; } var ctx = this; // set error beforehand in case the query fails, and to prevent repeated queries this._error = {start: 0, end: ctx.input.length}; this._backend.query(this, function () { ctx._updateCandidates(ctx._predict()); }); this._updateUI(); return true; }, |
var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);if(tinymce.isIE){newObj.innerHTML=targetObj.innerHTML;targetObj.parentNode.replaceChild(newObj,targetObj);}else{editor.dom.replace(newObj,targetObj,true);} tagList=doc.getElementsByTagName(org_tagname);} | var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);editor.dom.replace(newObj,targetObj,true);tagList=doc.getElementsByTagName(org_tagname);} | function convertHtmlTagToDecoTag(doc,tagname){var tagList=doc.getElementsByTagName(tagname);var org_tagname=tagname;var args={};while(tagList.length){targetObj=tagList[0];args={};if(org_tagname=="font"){var size=targetObj.getAttribute("size");var color=targetObj.getAttribute("color");tagname='op:font';if(size&&color){if(tinymce.isIE){targetObj.removeAttribute("color");targetObj.innerHTML='<font color="'+color+'">'+targetObj.innerHTML+"</font>";}else{var fontSize=document.createElement("font");fontSize.setAttribute("size",size);fontSize.removeAttribute("color");var clone=targetObj.cloneNode(true);clone.removeAttribute("size");fontSize.appendChild(clone);targetObj.parentNode.replaceChild(fontSize,targetObj);}tagList=doc.getElementsByTagName(org_tagname);continue;}if(size>=1&&size<=7){args['size']=size;}if(color){args['color']=color;}if(tagname==org_tagname){editor.dom.remove(targetObj,true);tagList=doc.getElementsByTagName(org_tagname);continue;}}else if(org_tagname=='span'){if(targetObj.style.fontWeight=='bold'){tagname='op:b';}else if(targetObj.style.textDecoration=='underline'){tagname='op:u';}else if(targetObj.style.textDecoration=='line-through'){tagname='op:s';}else if(targetObj.style.fontStyle=='italic'){tagname='op:i';}else if(targetObj.style.color){var color=tinyMCE.activeEditor.dom.toHex(targetObj.style.color);tagname='op:font';args['color']=color;}else if(targetObj.style.fontSize){var fontSizeMap={'xx-small':1,'x-small':2,'small':3,'medium':4,'large':5,'x-large':6,'xx-large':7}if(!fontSizeMap[targetObj.style.fontSize]){editor.dom.remove(targetObj,true);continue;}tagname='op:font';args['size']=fontSizeMap[targetObj.style.fontSize];}else{editor.dom.remove(targetObj,true);continue;}}else{tagname='op:'+org_tagname;}if(tinymce.isIE){tagname=tagname.replace("op:","op");}var newObj=editor.dom.create(tagname);editor.dom.setAttribs(newObj,args);if(tinymce.isIE){newObj.innerHTML=targetObj.innerHTML;targetObj.parentNode.replaceChild(newObj,targetObj);}else{editor.dom.replace(newObj,targetObj,true);}tagList=doc.getElementsByTagName(org_tagname);}s=editorDoc.innerHTML;} |
convertToForm : function(ps){ return { 'post[type]' : ps.type, 'post[one]' : getFlavor(ps, 'html') || ps.itemUrl, 'post[two]' : joinText([ (ps.item? ps.item.link(ps.pageUrl) : '') + (ps.author? ' (via ' + ps.author.link(ps.authorUrl) + ')' : ''), ps.description], '\n\n') }; } | convertToForm: function(ps) { return { title: ps.item, address: ps.pageUrl, embed_code: ps.body || '', description: joinText([ (ps.item ? ps.item.link(ps.pageUrl) : '') + (ps.author ? ' (via ' + ps.author.link(ps.authorUrl) + ')' : ''), '<p>' + escapeHTML(ps.description) + '</p>' ], '') }; } | convertToForm : function(ps){ return { 'post[type]' : ps.type, 'post[one]' : getFlavor(ps, 'html') || ps.itemUrl, 'post[two]' : joinText([ (ps.item? ps.item.link(ps.pageUrl) : '') + (ps.author? ' (via ' + ps.author.link(ps.authorUrl) + ')' : ''), ps.description], '\n\n') }; } |
'post[one]' : getFlavor(ps.body, 'html') || ps.itemUrl, | 'post[one]' : getFlavor(ps, 'html') || ps.itemUrl, | convertToForm : function(ps){ return { 'post[type]' : ps.type, 'post[one]' : getFlavor(ps.body, 'html') || ps.itemUrl, 'post[two]' : joinText([ (ps.item? ps.item.link(ps.pageUrl) : '') + (ps.author? ' (via ' + ps.author.link(ps.authorUrl) + ')' : ''), ps.description], '\n\n') }; } |
if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } | function convertToHTMLString(src, safe){ var doc = src.ownerDocument || src.focusNode.ownerDocument; if(src.focusNode){ // common parent node search var current, anchorOffset = src.anchorOffset, focusOffset = src.focusOffset; var anchorAnc = [src.anchorNode]; current = src.anchorNode; console.log(src.anchorOffset, src.focusOffset); while(document !== (current = current.parentNode) && current) anchorAnc.push(current); var focusAnc = [src.focusNode]; current = src.focusNode; while(document !== (current = current.parentNode) && current) focusAnc.push(current); var common, aindex, findex; anchorAnc.some(function(item, index){ if(~(findex = focusAnc.indexOf(item))){ aindex = index; common = item; return true; } else { return false; } }); // common配下nodeまで切捨て anchorAnc.length = aindex; focusAnc.length = findex; // commonから見た順番に変更 focusAnc.reverse(); anchorAnc.reverse(); // indexに変換する => cloneNodeでcloneするので, 位置関係を保存する current = common; for(var i = 0, len = focusAnc.length; i < len; ++i){ var node = focusAnc[i]; focusAnc[i] = $A(current.childNodes).indexOf(node) current = node; } current = common; for(var i = 0, len = anchorAnc.length; i < len; ++i){ var node = anchorAnc[i]; anchorAnc[i] = $A(current.childNodes).indexOf(node) current = node; } // common配下のindexを見て, focus と anchorがどちらが前方かを調べる // commonは最小の共通nodeであるので, すぐ下からindexが異なる if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } // clone common = common.cloneNode(true); // focusに沿って後方をremove // 後方から削る => index調整不要 current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); } } // anchorに沿って前方をremove current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); } } else { var common = src; } var html = (new XMLSerializer).serializeToString(common); if(!safe) return html; // DOMツリーに戻し不要な要素を除去する var root = doc.createElement('span'); root.innerHTML = html; $X('.//*[contains(",' + convertToHTMLString.UNSAFE_ELEMENTS + ',", concat(",", local-name(.), ","))]', root).forEach(removeElement); $X('.//@*[not(contains(",' + convertToHTMLString.SAFE_ATTRIBUTES + ',", concat(",", local-name(.), ",")))]', root).forEach(function(attr){ if(attr && attr.ownerElement) attr.ownerElement.removeAttribute(attr.name); }); src = appendChildNodes($DF(), root.childNodes); // 再度HTML文字列へ変換する return convertToHTMLString(src);} |
|
current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); | if(focusAnc[0] !== undefined){ if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; | function convertToHTMLString(src, safe){ var doc = src.ownerDocument || src.focusNode.ownerDocument; if(src.focusNode){ // common parent node search var current, anchorOffset = src.anchorOffset, focusOffset = src.focusOffset; var anchorAnc = [src.anchorNode]; current = src.anchorNode; console.log(src.anchorOffset, src.focusOffset); while(document !== (current = current.parentNode) && current) anchorAnc.push(current); var focusAnc = [src.focusNode]; current = src.focusNode; while(document !== (current = current.parentNode) && current) focusAnc.push(current); var common, aindex, findex; anchorAnc.some(function(item, index){ if(~(findex = focusAnc.indexOf(item))){ aindex = index; common = item; return true; } else { return false; } }); // common配下nodeまで切捨て anchorAnc.length = aindex; focusAnc.length = findex; // commonから見た順番に変更 focusAnc.reverse(); anchorAnc.reverse(); // indexに変換する => cloneNodeでcloneするので, 位置関係を保存する current = common; for(var i = 0, len = focusAnc.length; i < len; ++i){ var node = focusAnc[i]; focusAnc[i] = $A(current.childNodes).indexOf(node) current = node; } current = common; for(var i = 0, len = anchorAnc.length; i < len; ++i){ var node = anchorAnc[i]; anchorAnc[i] = $A(current.childNodes).indexOf(node) current = node; } // common配下のindexを見て, focus と anchorがどちらが前方かを調べる // commonは最小の共通nodeであるので, すぐ下からindexが異なる if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } // clone common = common.cloneNode(true); // focusに沿って後方をremove // 後方から削る => index調整不要 current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); } } // anchorに沿って前方をremove current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); } } else { var common = src; } var html = (new XMLSerializer).serializeToString(common); if(!safe) return html; // DOMツリーに戻し不要な要素を除去する var root = doc.createElement('span'); root.innerHTML = html; $X('.//*[contains(",' + convertToHTMLString.UNSAFE_ELEMENTS + ',", concat(",", local-name(.), ","))]', root).forEach(removeElement); $X('.//@*[not(contains(",' + convertToHTMLString.SAFE_ATTRIBUTES + ',", concat(",", local-name(.), ",")))]', root).forEach(function(attr){ if(attr && attr.ownerElement) attr.ownerElement.removeAttribute(attr.name); }); src = appendChildNodes($DF(), root.childNodes); // 再度HTML文字列へ変換する return convertToHTMLString(src);} |
current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); | current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); } | function convertToHTMLString(src, safe){ var doc = src.ownerDocument || src.focusNode.ownerDocument; if(src.focusNode){ // common parent node search var current, anchorOffset = src.anchorOffset, focusOffset = src.focusOffset; var anchorAnc = [src.anchorNode]; current = src.anchorNode; console.log(src.anchorOffset, src.focusOffset); while(document !== (current = current.parentNode) && current) anchorAnc.push(current); var focusAnc = [src.focusNode]; current = src.focusNode; while(document !== (current = current.parentNode) && current) focusAnc.push(current); var common, aindex, findex; anchorAnc.some(function(item, index){ if(~(findex = focusAnc.indexOf(item))){ aindex = index; common = item; return true; } else { return false; } }); // common配下nodeまで切捨て anchorAnc.length = aindex; focusAnc.length = findex; // commonから見た順番に変更 focusAnc.reverse(); anchorAnc.reverse(); // indexに変換する => cloneNodeでcloneするので, 位置関係を保存する current = common; for(var i = 0, len = focusAnc.length; i < len; ++i){ var node = focusAnc[i]; focusAnc[i] = $A(current.childNodes).indexOf(node) current = node; } current = common; for(var i = 0, len = anchorAnc.length; i < len; ++i){ var node = anchorAnc[i]; anchorAnc[i] = $A(current.childNodes).indexOf(node) current = node; } // common配下のindexを見て, focus と anchorがどちらが前方かを調べる // commonは最小の共通nodeであるので, すぐ下からindexが異なる if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } // clone common = common.cloneNode(true); // focusに沿って後方をremove // 後方から削る => index調整不要 current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); } } // anchorに沿って前方をremove current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); } } else { var common = src; } var html = (new XMLSerializer).serializeToString(common); if(!safe) return html; // DOMツリーに戻し不要な要素を除去する var root = doc.createElement('span'); root.innerHTML = html; $X('.//*[contains(",' + convertToHTMLString.UNSAFE_ELEMENTS + ',", concat(",", local-name(.), ","))]', root).forEach(removeElement); $X('.//@*[not(contains(",' + convertToHTMLString.SAFE_ATTRIBUTES + ',", concat(",", local-name(.), ",")))]', root).forEach(function(attr){ if(attr && attr.ownerElement) attr.ownerElement.removeAttribute(attr.name); }); src = appendChildNodes($DF(), root.childNodes); // 再度HTML文字列へ変換する return convertToHTMLString(src);} |
} current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); | current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); | function convertToHTMLString(src, safe){ var doc = src.ownerDocument || src.focusNode.ownerDocument; if(src.focusNode){ // common parent node search var current, anchorOffset = src.anchorOffset, focusOffset = src.focusOffset; var anchorAnc = [src.anchorNode]; current = src.anchorNode; console.log(src.anchorOffset, src.focusOffset); while(document !== (current = current.parentNode) && current) anchorAnc.push(current); var focusAnc = [src.focusNode]; current = src.focusNode; while(document !== (current = current.parentNode) && current) focusAnc.push(current); var common, aindex, findex; anchorAnc.some(function(item, index){ if(~(findex = focusAnc.indexOf(item))){ aindex = index; common = item; return true; } else { return false; } }); // common配下nodeまで切捨て anchorAnc.length = aindex; focusAnc.length = findex; // commonから見た順番に変更 focusAnc.reverse(); anchorAnc.reverse(); // indexに変換する => cloneNodeでcloneするので, 位置関係を保存する current = common; for(var i = 0, len = focusAnc.length; i < len; ++i){ var node = focusAnc[i]; focusAnc[i] = $A(current.childNodes).indexOf(node) current = node; } current = common; for(var i = 0, len = anchorAnc.length; i < len; ++i){ var node = anchorAnc[i]; anchorAnc[i] = $A(current.childNodes).indexOf(node) current = node; } // common配下のindexを見て, focus と anchorがどちらが前方かを調べる // commonは最小の共通nodeであるので, すぐ下からindexが異なる if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } // clone common = common.cloneNode(true); // focusに沿って後方をremove // 後方から削る => index調整不要 current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); } } // anchorに沿って前方をremove current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); } } else { var common = src; } var html = (new XMLSerializer).serializeToString(common); if(!safe) return html; // DOMツリーに戻し不要な要素を除去する var root = doc.createElement('span'); root.innerHTML = html; $X('.//*[contains(",' + convertToHTMLString.UNSAFE_ELEMENTS + ',", concat(",", local-name(.), ","))]', root).forEach(removeElement); $X('.//@*[not(contains(",' + convertToHTMLString.SAFE_ATTRIBUTES + ',", concat(",", local-name(.), ",")))]', root).forEach(function(attr){ if(attr && attr.ownerElement) attr.ownerElement.removeAttribute(attr.name); }); src = appendChildNodes($DF(), root.childNodes); // 再度HTML文字列へ変換する return convertToHTMLString(src);} |
current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); | } else { if(common.nodeType === Node.TEXT_NODE){ if(focusOffset < anchorOffset){ var t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } common = $T(common.textContent.substring(anchorOffset, focusOffset)); } | function convertToHTMLString(src, safe){ var doc = src.ownerDocument || src.focusNode.ownerDocument; if(src.focusNode){ // common parent node search var current, anchorOffset = src.anchorOffset, focusOffset = src.focusOffset; var anchorAnc = [src.anchorNode]; current = src.anchorNode; console.log(src.anchorOffset, src.focusOffset); while(document !== (current = current.parentNode) && current) anchorAnc.push(current); var focusAnc = [src.focusNode]; current = src.focusNode; while(document !== (current = current.parentNode) && current) focusAnc.push(current); var common, aindex, findex; anchorAnc.some(function(item, index){ if(~(findex = focusAnc.indexOf(item))){ aindex = index; common = item; return true; } else { return false; } }); // common配下nodeまで切捨て anchorAnc.length = aindex; focusAnc.length = findex; // commonから見た順番に変更 focusAnc.reverse(); anchorAnc.reverse(); // indexに変換する => cloneNodeでcloneするので, 位置関係を保存する current = common; for(var i = 0, len = focusAnc.length; i < len; ++i){ var node = focusAnc[i]; focusAnc[i] = $A(current.childNodes).indexOf(node) current = node; } current = common; for(var i = 0, len = anchorAnc.length; i < len; ++i){ var node = anchorAnc[i]; anchorAnc[i] = $A(current.childNodes).indexOf(node) current = node; } // common配下のindexを見て, focus と anchorがどちらが前方かを調べる // commonは最小の共通nodeであるので, すぐ下からindexが異なる if(focusAnc[0] < anchorAnc[0]){ var t = focusAnc; focusAnc = anchorAnc; anchorAnc = t; t = focusOffset; focusOffset = anchorOffset; anchorOffset = t; } // clone common = common.cloneNode(true); // focusに沿って後方をremove // 後方から削る => index調整不要 current = common; focusAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = obj+1, len = children.length; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE){ var val = current.textContent; if(val.length !== focusOffset){ current.parentNode.replaceChild($T(val.substring(0, focusOffset)), current); } } // anchorに沿って前方をremove current = common; anchorAnc.forEach(function(obj){ var children = $A(current.childNodes); for(var i = 0, len = obj; i < len; i++){ current.removeChild(children[i]); } current = children[obj]; }); if(current.nodeType === Node.TEXT_NODE && anchorOffset){ current.parentNode.replaceChild($T(current.textContent.substring(anchorOffset)), current); } } else { var common = src; } var html = (new XMLSerializer).serializeToString(common); if(!safe) return html; // DOMツリーに戻し不要な要素を除去する var root = doc.createElement('span'); root.innerHTML = html; $X('.//*[contains(",' + convertToHTMLString.UNSAFE_ELEMENTS + ',", concat(",", local-name(.), ","))]', root).forEach(removeElement); $X('.//@*[not(contains(",' + convertToHTMLString.SAFE_ATTRIBUTES + ',", concat(",", local-name(.), ",")))]', root).forEach(function(attr){ if(attr && attr.ownerElement) attr.ownerElement.removeAttribute(attr.name); }); src = appendChildNodes($DF(), root.childNodes); // 再度HTML文字列へ変換する return convertToHTMLString(src);} |
return null; | convertToParams : function(form){ switch(form['post[type]']){ case 'regular': return { type : 'quote', item : form['post[one]'], body : form['post[two]'] } case 'photo': return { itemUrl : form.image, body : form['post[two]'] } case 'link': return { item : form['post[one]'], itemUrl : form['post[two]'], body : form['post[three]'] }; case 'quote': // FIXME: post[two]検討 return { body : form['post[one]'] }; case 'video': // FIXME: post[one]検討 return { body : form['post[two]'] }; case 'conversation': return { item : form['post[one]'], body : form['post[two]'] }; } } |
|
print("copy"); | fileUtil.copyDir = function(/*String*/srcDir, /*String*/destDir, /*RegExp*/regExpFilter, /*boolean?*/onlyCopyNew){ //summary: copies files from srcDir to destDir using the regExpFilter to determine if the //file should be copied. Returns a list file name strings of the destinations that were copied. var fileNames = fileUtil.getFilteredFileList(srcDir, regExpFilter, true); var copiedFiles = []; for(var i = 0; i < fileNames.length; i++){ var srcFileName = fileNames[i]; var destFileName = srcFileName.replace(srcDir, destDir); if(fileUtil.copyFile(srcFileName, destFileName, onlyCopyNew)){ copiedFiles.push(destFileName); } } return copiedFiles.length ? copiedFiles : null; //Array or null} |
|
descendant.prototype[m] = parent.prototype[m]; | if (typeof descendant.prototype[m] == 'undefined') { descendant.prototype[m] = parent.prototype[m]; } | copyPrototype: function(descendant, parent) { var sConstructor = parent.toString(); var aMatch = sConstructor.match( /\s*function (.*)\(/ ); if ( aMatch != null ) { descendant.prototype[aMatch[1]] = parent; } for (var m in parent.prototype) { descendant.prototype[m] = parent.prototype[m]; } } |
}, | } | copyTab: function (to, from) { if (!from) from = config.tabbrowser.mTabContainer.selectedItem; let tabState = services.get("sessionStore").getTabState(from); services.get("sessionStore").setTabState(to, tabState); }, |
equals(view.$('.count').size(), 0, 'should not have count') ; | ok(!cq.hasClass('has-count'), "should not have has-count class"); equals(countCQ.size(), 0, 'should not have count') ; | function count(view, cnt) { if (cnt === null) { equals(view.$('.count').size(), 0, 'should not have count') ; } else { var cq = view.$('.count'); equals(cq.size(), 1, 'should have count'); equals(cq.text(), cnt.toString(), 'should have count'); }} |
var cq = view.$('.count'); equals(cq.size(), 1, 'should have count'); equals(cq.text(), cnt.toString(), 'should have count'); | ok(cq.hasClass('has-count'), "should have has-count class"); equals(countCQ.size(), 1, 'should have count'); equals(countCQ.text(), cnt.toString(), 'should have count text'); | function count(view, cnt) { if (cnt === null) { equals(view.$('.count').size(), 0, 'should not have count') ; } else { var cq = view.$('.count'); equals(cq.size(), 1, 'should have count'); equals(cq.text(), cnt.toString(), 'should have count'); }} |
function CountCheckedRootLevels(field) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if ((TreeParents[field][i]==-1) && (TreeChecked[field][i]==1)) {count++;} } return count; | function CountCheckedRootLevels( field ) { var count = 0; for( var i = 0; i < TreeParents[field].length; i++ ) { if( ( TreeParents[field][i] == -1 ) && ( TreeChecked[field][i] == 1 ) ) { count++; } | function CountCheckedRootLevels(field) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if ((TreeParents[field][i]==-1) && (TreeChecked[field][i]==1)) {count++;} } return count; } |
return( count ); } | function CountCheckedRootLevels(field) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if ((TreeParents[field][i]==-1) && (TreeChecked[field][i]==1)) {count++;} } return count; } |
|
function CountChildren(field,node) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if (TreeParents[field][i]==node) {count++;} } return count; | function CountChildren( field, node ) { var count = 0; for( var i = 0; i < TreeParents[field].length; i++ ) { if( TreeParents[field][i] == node ) { count++; } | function CountChildren(field,node) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if (TreeParents[field][i]==node) {count++;} } return count; } |
return( count ); } | function CountChildren(field,node) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if (TreeParents[field][i]==node) {count++;} } return count; } |
|
function CountTickedChildren(field,node) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if ((TreeParents[field][i]==node) && (TreeChecked[field][i]==1)) {count++;} } return count; | function CountTickedChildren( field, node ) { var count = 0; for( var i = 0; i < TreeParents[field].length; i++ ) { if( ( TreeParents[field][i] == node ) && ( TreeChecked[field][i] == 1 ) ) { count++; } | function CountTickedChildren(field,node) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if ((TreeParents[field][i]==node) && (TreeChecked[field][i]==1)) {count++;} } return count; } |
return( count ); } | function CountTickedChildren(field,node) { var count=0; var i=0; for (i=0;i<TreeParents[field].length;i++) { if ((TreeParents[field][i]==node) && (TreeChecked[field][i]==1)) {count++;} } return count; } |
|
var bindingColumns = columnsByBindingType(bindingTypes[i], xsdTypes); | var bindingColumns = columnsByBindingType(bindingTypes[i].type, xsdTypes); | function countVariables(data, bindingTypes, xsdTypes){ var variables = new Array(); for (var i in bindingTypes) { var bindingColumns = columnsByBindingType(bindingTypes[i], xsdTypes); for (var j in bindingColumns) { var variable = { }; variable.variable = bindingColumns[j]; variable.bindingType = bindingTypes[i].type; variables.push(variable); } } return variables;} |
variable.visType = bindingTypes[i].visType; | function countVariables(data, bindingTypes, xsdTypes){ var variables = new Array(); for (var i in bindingTypes) { var bindingColumns = columnsByBindingType(bindingTypes[i], xsdTypes); for (var j in bindingColumns) { var variable = { }; variable.variable = bindingColumns[j]; variable.bindingType = bindingTypes[i].type; variables.push(variable); } } return variables;} |
|
var ret, idx, pool = SC.Set._pool, isObservable = this.isObservable; | var ret, idx, pool = SC.Set._pool, isObservable = this.isObservable, len; | create: function(items) { var ret, idx, pool = SC.Set._pool, isObservable = this.isObservable; if (!isObservable && items===undefined && pool.length>0) { return pool.pop(); } else { ret = SC.beget(this); if (isObservable) ret.initObservable(); if (items && items.isEnumerable && items.get('length') > 0) { ret.isObservable = NO; // suspend change notifications // arrays and sets get special treatment to make them a bit faster if (items.isSCArray) { idx = items.get('length'); while(--idx>=0) ret.add(items.objectAt(idx)); } else if (items.isSet) { idx = items.length; while(--idx>=0) ret.add(items[idx]); // otherwise use standard SC.Enumerable API } else { items.forEach(function(i) { ret.add(i); }, this); } ret.isObservable = isObservable; } } return ret ; }, |
idx = items.get('length'); while(--idx>=0) ret.add(items.objectAt(idx)); | len = items.get('length'); for(idx = 0; idx < len; idx++) ret.add(items.objectAt(idx)); | create: function(items) { var ret, idx, pool = SC.Set._pool, isObservable = this.isObservable; if (!isObservable && items===undefined && pool.length>0) { return pool.pop(); } else { ret = SC.beget(this); if (isObservable) ret.initObservable(); if (items && items.isEnumerable && items.get('length') > 0) { ret.isObservable = NO; // suspend change notifications // arrays and sets get special treatment to make them a bit faster if (items.isSCArray) { idx = items.get('length'); while(--idx>=0) ret.add(items.objectAt(idx)); } else if (items.isSet) { idx = items.length; while(--idx>=0) ret.add(items[idx]); // otherwise use standard SC.Enumerable API } else { items.forEach(function(i) { ret.add(i); }, this); } ret.isObservable = isObservable; } } return ret ; }, |
idx = items.length; while(--idx>=0) ret.add(items[idx]); | len = items.length; for(idx = 0; idx < len; idx++) ret.add(items[idx]); | create: function(items) { var ret, idx, pool = SC.Set._pool, isObservable = this.isObservable; if (!isObservable && items===undefined && pool.length>0) { return pool.pop(); } else { ret = SC.beget(this); if (isObservable) ret.initObservable(); if (items && items.isEnumerable && items.get('length') > 0) { ret.isObservable = NO; // suspend change notifications // arrays and sets get special treatment to make them a bit faster if (items.isSCArray) { idx = items.get('length'); while(--idx>=0) ret.add(items.objectAt(idx)); } else if (items.isSet) { idx = items.length; while(--idx>=0) ret.add(items[idx]); // otherwise use standard SC.Enumerable API } else { items.forEach(function(i) { ret.add(i); }, this); } ret.isObservable = isObservable; } } return ret ; }, |
var el = doc.createElement(params.tag || 'div'); if(params.style) { $.style(el, params.style); } if(params.attrs) { for(attr in params.attrs) { el.setAttribute(attr, params.attrs[attr]); | var el = doc.createElement(params.tag || 'div'); if(params.style) { $.style(el, params.style); } if(params.attrs) { for(attr in params.attrs) { el.setAttribute(attr, params.attrs[attr]); } | $.create = function(params) { var doc = (params.win || window).document; if(!params) { params = 'div'; } if(typeof params == 'string') { return doc.createElement(params); } var el = doc.createElement(params.tag || 'div'); if(params.style) { $.style(el, params.style); } if(params.attrs) { for(attr in params.attrs) { el.setAttribute(attr, params.attrs[attr]); } } if(params['class'] || params['className']) { el.className = params['class'] || params['className']; } if(params.parent) { params.parent.appendChild(el); } if(params.html) { el.innerHTML = params.html; } if(params.text) { $.setText(el, params.text); } return el;} |
if(params['class'] || params['className']) { el.className = params['class'] || params['className']; } if(params.parent) { params.parent.appendChild(el); } if(params.html) { el.innerHTML = params.html; } if(params.text) { $.setText(el, params.text); } return el; } | $.create = function(params) { var doc = (params.win || window).document; if(!params) { params = 'div'; } if(typeof params == 'string') { return doc.createElement(params); } var el = doc.createElement(params.tag || 'div'); if(params.style) { $.style(el, params.style); } if(params.attrs) { for(attr in params.attrs) { el.setAttribute(attr, params.attrs[attr]); } } if(params['class'] || params['className']) { el.className = params['class'] || params['className']; } if(params.parent) { params.parent.appendChild(el); } if(params.html) { el.innerHTML = params.html; } if(params.text) { $.setText(el, params.text); } return el;} |
|
this._specializedRenderers = {}; | create: function() { var result = SC.beget(this); result.baseTheme = this; // if we don't beget themes, the same instance would be shared between // all themes. this would be bad: imagine that we have two themes: // "Ace" and "Other." Each one has a "capsule" child theme. If they // didn't have their own child themes hash, the two capsule themes // would conflict. result.themes = SC.beget(this.themes); // we could put this in _extend_self, but we don't want to clone // it for each and every argument passed to create(). result.classNames = SC.CoreSet.create(this.classNames); var args = arguments, len = args.length, idx, mixin; for (idx = 0; idx < len; idx++) { this._extend_self(args[idx]); } if (result.name) result.classNames.add(result.name); return result; }, |
|
tail = root, | tail = root; | SC._ChainObserver.createChain = function(rootObject, path, target, method, context) { // First we create the chain. var parts = path.split('.'), root = new SC._ChainObserver(parts[0]), tail = root, for(var i=1, l=parts.length; i<l; i++) { tail = tail.next = new SC._ChainObserver(parts[idx]) ; } // Now root has the first observer and tail has the last one. // Feed the rootObject into the front to setup the chain... // do this BEFORE we set the target/method so they will not be triggered. root.objectDidChange(rootObject); // Finally, set the target/method on the tail so that future changes will // trigger. tail.target = target; tail.method = method ; tail.context = context ; // and return the root to save return root ;}; |
tail = tail.next = new SC._ChainObserver(parts[idx]) ; | tail = tail.next = new SC._ChainObserver(parts[i]) ; | SC._ChainObserver.createChain = function(rootObject, path, target, method, context) { // First we create the chain. var parts = path.split('.'), root = new SC._ChainObserver(parts[0]), tail = root, for(var i=1, l=parts.length; i<l; i++) { tail = tail.next = new SC._ChainObserver(parts[idx]) ; } // Now root has the first observer and tail has the last one. // Feed the rootObject into the front to setup the chain... // do this BEFORE we set the target/method so they will not be triggered. root.objectDidChange(rootObject); // Finally, set the target/method on the tail so that future changes will // trigger. tail.target = target; tail.method = method ; tail.context = context ; // and return the root to save return root ;}; |
else attrs = SC.clone(attrs); | createChildView: function(view, attrs) { // attrs should always exist... if (!attrs) attrs = {} ; attrs.owner = attrs.parentView = this ; attrs.isVisibleInWindow = this.get('isVisibleInWindow'); if (!attrs.page) attrs.page = this.page ; // Now add this to the attributes and create. view = view.create(attrs) ; return view ; }, |
|
v.set("content", content); | v.bind('content', '.owner.content') ; } var vKey = v.get('contentValueKey') ; if (vKey && !v.get('value')) { v.bind('value', '.content.'+vKey) ; | createChildViews: function() { // keep array of keys so we can pass on key to child. var cv = SC.clone(this.get("childViews")); // add label if (this.labelView.isClass) { this.labelView = this.createChildView(this.labelView, { value: this.get("label") }); this.labelView.addObserver("measuredSize", this, "labelSizeDidChange"); this.get("childViews").unshift(this.labelView); } var content = this.get("content"); sc_super(); // now, do the actual passing it var idx, len = cv.length, key, v; for (idx = 0; idx < len; idx++) { key = cv[idx]; // if the view was originally declared as a string, then we have something to give it if (SC.typeOf(key) === SC.T_STRING) { // try to get the actual view v = this.get(key); // see if it does indeed exist, and if it doesn't have a value already if (v && !v.isClass) { if (!v.get("contentValueKey")) { // // NOTE: WE HAVE A SPECIAL CASE // If this is the single field, pass through our contentValueKey if (key === "_singleField") { v.set("contentValueKey", this.get("contentValueKey")); } else { v.set("contentValueKey", key); } } if (!v.get("content")) { v.set("content", content); } } } } }, |
this.rowLabelSizeDidChange(); | createChildViews: function() { // keep array of keys so we can pass on key to child. var cv = SC.clone(this.get("childViews")); // add label if (this.labelView.isClass) { this.labelView = this.createChildView(this.labelView, { value: this.get("label") }); this.labelView.addObserver("measuredSize", this, "labelSizeDidChange"); this.labelView.bind("shouldMeasureSize", this, "shouldMeasureLabel"); this.get("childViews").unshift(this.labelView); } var content = this.get("content"); sc_super(); // now, do the actual passing it var idx, len = cv.length, key, v; for (idx = 0; idx < len; idx++) { key = cv[idx]; // if the view was originally declared as a string, then we have something to give it if (SC.typeOf(key) === SC.T_STRING) { // try to get the actual view v = this.get(key); // see if it does indeed exist, and if it doesn't have a value already if (v && !v.isClass) { if (!v.get("contentValueKey")) { // // NOTE: WE HAVE A SPECIAL CASE // If this is the single field, pass through our contentValueKey if (key === "_singleField") { v.set("contentValueKey", this.get("contentValueKey")); } else { v.set("contentValueKey", key); } } if (!v.get("content")) { v.bind('content', '.owner.content') ; } // Bind the value property of the view to the 'contentValueKey' property of content. var vKey = v.get('contentValueKey') ; if (vKey && !v.get('value')) { v.bind('value', '.content.'+vKey) ; } } } } }, |
|
if (!v.get("contentValueKey")) { v.set("contentValueKey", key); } | createChildViews: function() { // keep array of keys so we can pass on key to child. var cv = SC.clone(this.get("childViews")); var idx, len = cv.length, key, v, exampleRow = this.get("exampleRow"); // preprocess to handle templated rows (rows that use exampleRow to initialize) for (idx = 0; idx < len; idx++) { key = cv[idx]; if (SC.typeOf(key) === SC.T_STRING) { v = this.get(key); if (v && !v.isClass && SC.typeOf(v) === SC.T_HASH) { this[key] = exampleRow.extend(v); } } } // get content for further ops var content = this.get("content"); sc_super(); // now, do the actual passing it for (idx = 0; idx < len; idx++) { key = cv[idx]; // if the view was originally declared as a string, then we have something to give it if (SC.typeOf(key) === SC.T_STRING) { // try to get the actual view v = this.get(key); // see if it does indeed exist, and if it doesn't have a value already if (v && !v.isClass) { // set value key if (!v.get("contentValueKey")) { v.set("contentValueKey", key); } // set content if (!v.get("content")) { v.set("content", content); } // set label (if possible) if (v.get("isFormRow") && SC.none(v.get("label"))) { v.set("label", key.humanize().titleize()); } } } } // our internal bookeeping to prevent . this._hasCreatedRows = YES; }, |
|
v.set("content", content); | v.bind('content', '.owner.content') ; | createChildViews: function() { // keep array of keys so we can pass on key to child. var cv = SC.clone(this.get("childViews")); var idx, len = cv.length, key, v, exampleRow = this.get("exampleRow"); // preprocess to handle templated rows (rows that use exampleRow to initialize) for (idx = 0; idx < len; idx++) { key = cv[idx]; if (SC.typeOf(key) === SC.T_STRING) { v = this.get(key); if (v && !v.isClass && SC.typeOf(v) === SC.T_HASH) { this[key] = exampleRow.extend(v); } } } // get content for further ops var content = this.get("content"); sc_super(); // now, do the actual passing it for (idx = 0; idx < len; idx++) { key = cv[idx]; // if the view was originally declared as a string, then we have something to give it if (SC.typeOf(key) === SC.T_STRING) { // try to get the actual view v = this.get(key); // see if it does indeed exist, and if it doesn't have a value already if (v && !v.isClass) { // set value key if (!v.get("contentValueKey")) { v.set("contentValueKey", key); } // set content if (!v.get("content")) { v.set("content", content); } // set label (if possible) if (v.get("isFormRow") && SC.none(v.get("label"))) { v.set("label", key.humanize().titleize()); } } } } // our internal bookeeping to prevent . this._hasCreatedRows = YES; }, |
var idx, len = cv.length, key, v; | createChildViews: function() { // keep array of keys so we can pass on key to child. var cv = SC.clone(this.get("childViews")); var content = this.get("content"); sc_super(); // now, do the actual passing it var idx, len = cv.length, key, v; for (idx = 0; idx < len; idx++) { key = cv[idx]; // if the view was originally declared as a string, then we have something to give it if (SC.typeOf(key) === SC.T_STRING) { // try to get the actual view v = this.get(key); // see if it does indeed exist, and if it doesn't have a value already if (v && !v.isClass) { // set value key if (!v.get("contentValueKey")) { v.set("contentValueKey", key); } // set content if (!v.get("content")) { v.set("content", content); } // set label (if possible) if (v.get("isFormRow") && SC.none(v.get("label"))) { v.set("label", key.humanize().titleize()); } } } } // our internal bookeeping to prevent . this._hasCreatedRows = YES; }, |
|
selection : createFlavoredString(window.getSelection()), | selection : (!!sel.raw)? sel : null, | createContext: function(target){ var ctx = update({ document :document, window : window, title : document.title, selection : createFlavoredString(window.getSelection()), target : target || TBRL.target || document.documentElement }, window.location); if(ctx.target){ ctx.link = $X('./ancestor-or-self::a', ctx.target)[0]; ctx.onLink = !!ctx.link; ctx.onImage = ctx.target instanceof HTMLImageElement; } return ctx; }, |
selection : window.getSelection(), | selection : createFlavoredString(window.getSelection()), | createContext: function(target){ var ctx = update({ document :document, window : window, title : document.title, selection : window.getSelection(), target : target || TBRL.target || document.documentElement }, window.location); if(ctx.target){ ctx.link = $X('./ancestor-or-self::a', ctx.target)[0]; ctx.onLink = !!ctx.link; ctx.onImage = ctx.target instanceof HTMLImageElement; } return ctx; }, |
var res = src.textContent || src.toString(); res.flavors = { html : convertToHTMLString(src, true), }; return res; | return { raw : src.textContent || src.toString(), html : convertToHTMLString(src, true) }; | function createFlavoredString(src){ var res = src.textContent || src.toString(); res.flavors = { html : convertToHTMLString(src, true), }; return res;} |
if (outer != null) throw Components.results.NS_ERROR_NO_AGGREGATION; if (!clas.instance) clas.instance = new clas(); return clas.instance.QueryInterface(iid); } | if (outer != null) throw Components.results.NS_ERROR_NO_AGGREGATION; if (!Dactyl.instance) Dactyl.instance = new Dactyl(); return Dactyl.instance.QueryInterface(iid); } | createInstance: function (outer, iid) { if (outer != null) throw Components.results.NS_ERROR_NO_AGGREGATION; if (!clas.instance) clas.instance = new clas(); return clas.instance.QueryInterface(iid); } |
factory.createInstance.apply(factory, arguments) | factory.createInstance.apply(factory, arguments); | createInstance: function (iids) { return let (factory = this.module.NSGetFactory(this.classID)) factory.createInstance.apply(factory, arguments) } |
var room = $iq({to: room, type: "set"}) | var roomiq = $iq({to: room, type: "set"}) | createInstantRoom: function(room) { var room = $iq({to: room, type: "set"}) .c("query", {xmlns: Strophe.NS.MUC_OWNER}) .c("x", {xmlns: "jabber:x:data", type: "submit"}); return this._connection.sendIQ(room.tree(), function() {}, function() {}); }, |
return this._connection.sendIQ(room.tree(), | return this._connection.sendIQ(roomiq.tree(), | createInstantRoom: function(room) { var room = $iq({to: room, type: "set"}) .c("query", {xmlns: Strophe.NS.MUC_OWNER}) .c("x", {xmlns: "jabber:x:data", type: "submit"}); return this._connection.sendIQ(room.tree(), function() {}, function() {}); }, |
clone.setAttribute('title', cand.value); | createItem: function(cand){ var self = this; var clone = this.cloned.cloneNode(false); connect(clone, 'onclick', this, function(){ self.tags.injectCandidates(cand.value, true); this.hidePopup(); }); clone.appendChild($T(cand.value)); return clone; }, |
|
createRenderer: function() { var theme = this.get("theme"); | createRenderer: function(theme) { | createRenderer: function() { var theme = this.get("theme"); var ret = theme.button(); this.updateRenderer(ret); // updating looks _exactly_ like normal stuff for us. return ret; }, |
if (style==="renderImage") ret = theme.image(); | if (style==="renderImage") ret = theme.imageButton(); | createRenderer: function(theme) { var ret, style = this.get('renderStyle'); if (style==="renderDefault") ret = theme.button(); if (style==="renderImage") ret = theme.image(); this.updateRenderer(ret); // updating looks _exactly_ like normal stuff for us. return ret; }, |
var ret = theme.button(); | var ret, style = this.get('renderStyle'); if (style==="renderDefault") ret = theme.button(); if (style==="renderImage") ret = theme.image(); | createRenderer: function(theme) { var ret = theme.button(); this.updateRenderer(ret); // updating looks _exactly_ like normal stuff for us. return ret; }, |
csp.createServer = function (connection_listener) { return new csp.Server().addListener('connection', connection_listener); | exports.createServer = function (connection_listener) { return new exports.Server().addListener('connection', connection_listener); | csp.createServer = function (connection_listener) { return new csp.Server().addListener('connection', connection_listener);}; |
lineSpan.appendChild(document.createTextNode(exampleLines[i])); | lineSpan.appendChild(document.createTextNode(doctest.rstrip(exampleLines[i]))); | doctest.Example.prototype.createSpan = function () { var id = doctest.genID('example'); var span = document.createElement('span'); span.className = 'doctest-example'; span.setAttribute('id', id); this.htmlID = id; var exampleSpan = document.createElement('span'); exampleSpan.className = 'doctest-example-code'; var exampleLines = this.example.split(/\n/); for (var i=0; i<exampleLines.length; i++) { var promptSpan = document.createElement('span'); promptSpan.className = 'doctest-example-prompt'; promptSpan.innerHTML = i == 0 ? '$ ' : '> '; exampleSpan.appendChild(promptSpan); var lineSpan = document.createElement('span'); lineSpan.className = 'doctest-example-code-line'; lineSpan.appendChild(document.createTextNode(exampleLines[i])); exampleSpan.appendChild(lineSpan); exampleSpan.appendChild(document.createTextNode('\n')); } span.appendChild(exampleSpan); var outputSpan = document.createElement('span'); outputSpan.className = 'doctest-example-output'; outputSpan.appendChild(document.createTextNode(this.output)); span.appendChild(outputSpan); span.appendChild(document.createTextNode('\n')); return span;}; |
var xhr = new XMLHttpRequest(); xhr.open("GET", str, false); xhr.send(null); return xhr.responseXML; | var p = new DOMParser(); return p.parseFromString(str, "text/xml"); | function createXML(str){ var xhr = new XMLHttpRequest(); xhr.open("GET", str, false); xhr.send(null); return xhr.responseXML;} |
s.defaultView.getComputedStyle,Ka=c.support.cssFloat?"cssFloat":"styleFloat",la=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return $(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!ib.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""=== | function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= | s.defaultView.getComputedStyle,Ka=c.support.cssFloat?"cssFloat":"styleFloat",la=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return $(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!ib.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""=== |
Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }; | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }; |
cumulativeScrollOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return Element._returnOffset(valueL, valueT); }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | cumulativeScrollOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return Element._returnOffset(valueL, valueT); }, |
b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]== null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop=== | c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; | b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=K();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!Z)Z=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop=== |
parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,mb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Ja.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ja.test(b))b=Ka;if(!d&&e&&e[b])f=e[b];else if(pb){if(ja.test(b))b="float";b=b.replace(jb,"-$1").toLowerCase();e= a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ka,la);f=a.currentStyle[b]||a.currentStyle[d];if(!kb.test(f)&&lb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]= | "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= | parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,mb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Ja.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ja.test(b))b=Ka;if(!d&&e&&e[b])f=e[b];else if(pb){if(ja.test(b))b="float";b=b.replace(jb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ka,la);f=a.currentStyle[b]||a.currentStyle[d];if(!kb.test(f)&&lb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]= |
return {'ids' : [id] } | return id; | currentChecked:function(){ var id = this.element.find("[type='radio']:checked").val(); if( id ){ return {'ids' : [id] } }else{ return null; } }, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.