id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
42,100
pbeshai/react-taco-table
lib/Summarizers.js
meanSummarizer
function meanSummarizer(column, tableData, columns) { var stats = tableData.reduce(function (stats, rowData, rowNumber) { var sortValue = Utils.getSortValue(column, rowData, rowNumber, tableData, columns); if (sortValue) { if (stats.sum === null) { stats.sum = sortValue; } else { stats.sum += sortValue; } } return stats; }, { sum: null, count: tableData.length, mean: null }); if (stats.sum !== null) { stats.mean = stats.sum / stats.count; } return stats; }
javascript
function meanSummarizer(column, tableData, columns) { var stats = tableData.reduce(function (stats, rowData, rowNumber) { var sortValue = Utils.getSortValue(column, rowData, rowNumber, tableData, columns); if (sortValue) { if (stats.sum === null) { stats.sum = sortValue; } else { stats.sum += sortValue; } } return stats; }, { sum: null, count: tableData.length, mean: null }); if (stats.sum !== null) { stats.mean = stats.sum / stats.count; } return stats; }
[ "function", "meanSummarizer", "(", "column", ",", "tableData", ",", "columns", ")", "{", "var", "stats", "=", "tableData", ".", "reduce", "(", "function", "(", "stats", ",", "rowData", ",", "rowNumber", ")", "{", "var", "sortValue", "=", "Utils", ".", "getSortValue", "(", "column", ",", "rowData", ",", "rowNumber", ",", "tableData", ",", "columns", ")", ";", "if", "(", "sortValue", ")", "{", "if", "(", "stats", ".", "sum", "===", "null", ")", "{", "stats", ".", "sum", "=", "sortValue", ";", "}", "else", "{", "stats", ".", "sum", "+=", "sortValue", ";", "}", "}", "return", "stats", ";", "}", ",", "{", "sum", ":", "null", ",", "count", ":", "tableData", ".", "length", ",", "mean", ":", "null", "}", ")", ";", "if", "(", "stats", ".", "sum", "!==", "null", ")", "{", "stats", ".", "mean", "=", "stats", ".", "sum", "/", "stats", ".", "count", ";", "}", "return", "stats", ";", "}" ]
Computes the mean, sum, and count in a column as `mean, sum, count`. Does the computation based on the sortValue. @param {Object} column The column definition @param {Object[]} tableData the data for the whole table @param {Object[]} columns The definitions of columns for the whole table @return {Object} The mean of values as `{ mean, sum, count }`
[ "Computes", "the", "mean", "sum", "and", "count", "in", "a", "column", "as", "mean", "sum", "count", ".", "Does", "the", "computation", "based", "on", "the", "sortValue", "." ]
db059ad7d051aefbaf00aea7f7a870e59711968a
https://github.com/pbeshai/react-taco-table/blob/db059ad7d051aefbaf00aea7f7a870e59711968a/lib/Summarizers.js#L102-L122
42,101
pbeshai/react-taco-table
lib/Summarizers.js
frequencySummarizer
function frequencySummarizer(column, tableData, columns) { var mostFrequent = void 0; var counts = tableData.reduce(function (counts, rowData, rowNumber) { var cellData = Utils.getCellData(column, rowData, rowNumber, tableData, columns); if (!counts[cellData]) { counts[cellData] = 1; } else { counts[cellData] += 1; } if (mostFrequent == null || counts[cellData] > counts[mostFrequent]) { mostFrequent = cellData; } return counts; }, {}); return { counts: counts, mostFrequent: mostFrequent }; }
javascript
function frequencySummarizer(column, tableData, columns) { var mostFrequent = void 0; var counts = tableData.reduce(function (counts, rowData, rowNumber) { var cellData = Utils.getCellData(column, rowData, rowNumber, tableData, columns); if (!counts[cellData]) { counts[cellData] = 1; } else { counts[cellData] += 1; } if (mostFrequent == null || counts[cellData] > counts[mostFrequent]) { mostFrequent = cellData; } return counts; }, {}); return { counts: counts, mostFrequent: mostFrequent }; }
[ "function", "frequencySummarizer", "(", "column", ",", "tableData", ",", "columns", ")", "{", "var", "mostFrequent", "=", "void", "0", ";", "var", "counts", "=", "tableData", ".", "reduce", "(", "function", "(", "counts", ",", "rowData", ",", "rowNumber", ")", "{", "var", "cellData", "=", "Utils", ".", "getCellData", "(", "column", ",", "rowData", ",", "rowNumber", ",", "tableData", ",", "columns", ")", ";", "if", "(", "!", "counts", "[", "cellData", "]", ")", "{", "counts", "[", "cellData", "]", "=", "1", ";", "}", "else", "{", "counts", "[", "cellData", "]", "+=", "1", ";", "}", "if", "(", "mostFrequent", "==", "null", "||", "counts", "[", "cellData", "]", ">", "counts", "[", "mostFrequent", "]", ")", "{", "mostFrequent", "=", "cellData", ";", "}", "return", "counts", ";", "}", ",", "{", "}", ")", ";", "return", "{", "counts", ":", "counts", ",", "mostFrequent", ":", "mostFrequent", "}", ";", "}" ]
Computes the frequency for each value in the dataset and computes the most frequent. If there is a tie for most frequent, it returns just the first encountered value. Does the summary based on the cellData value. @param {Object} column The column definition @param {Object[]} tableData the data for the whole table @param {Object[]} columns The definitions of columns for the whole table @return {Object} The most frequently occuring value `{ counts, mostFrequent }`
[ "Computes", "the", "frequency", "for", "each", "value", "in", "the", "dataset", "and", "computes", "the", "most", "frequent", ".", "If", "there", "is", "a", "tie", "for", "most", "frequent", "it", "returns", "just", "the", "first", "encountered", "value", ".", "Does", "the", "summary", "based", "on", "the", "cellData", "value", "." ]
db059ad7d051aefbaf00aea7f7a870e59711968a
https://github.com/pbeshai/react-taco-table/blob/db059ad7d051aefbaf00aea7f7a870e59711968a/lib/Summarizers.js#L178-L197
42,102
pazams/postcss-scopify
index.js
isRuleScopable
function isRuleScopable(rule){ if(rule.parent.type !== 'root') { if (rule.parent.type === 'atrule' && conditionalGroupRules.indexOf(rule.parent.name) > -1){ return true; } else { return false; } } else { return true; } }
javascript
function isRuleScopable(rule){ if(rule.parent.type !== 'root') { if (rule.parent.type === 'atrule' && conditionalGroupRules.indexOf(rule.parent.name) > -1){ return true; } else { return false; } } else { return true; } }
[ "function", "isRuleScopable", "(", "rule", ")", "{", "if", "(", "rule", ".", "parent", ".", "type", "!==", "'root'", ")", "{", "if", "(", "rule", ".", "parent", ".", "type", "===", "'atrule'", "&&", "conditionalGroupRules", ".", "indexOf", "(", "rule", ".", "parent", ".", "name", ")", ">", "-", "1", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "else", "{", "return", "true", ";", "}", "}" ]
Determine if rule should be scoped @param {rule} rule
[ "Determine", "if", "rule", "should", "be", "scoped" ]
69f1b1dc162178c7843a52835d459ed12bb9b08c
https://github.com/pazams/postcss-scopify/blob/69f1b1dc162178c7843a52835d459ed12bb9b08c/index.js#L74-L89
42,103
shama/atlaspack
example/example.js
atlasPack
function atlasPack(img) { var node = atlas.pack(img); if (node === false) { atlas = atlas.expand(img); //atlas.tilepad = true; } }
javascript
function atlasPack(img) { var node = atlas.pack(img); if (node === false) { atlas = atlas.expand(img); //atlas.tilepad = true; } }
[ "function", "atlasPack", "(", "img", ")", "{", "var", "node", "=", "atlas", ".", "pack", "(", "img", ")", ";", "if", "(", "node", "===", "false", ")", "{", "atlas", "=", "atlas", ".", "expand", "(", "img", ")", ";", "//atlas.tilepad = true;", "}", "}" ]
atlas.tilepad = true;
[ "atlas", ".", "tilepad", "=", "true", ";" ]
291e75594b1dc5232fcd37f06430d23ebbd32e43
https://github.com/shama/atlaspack/blob/291e75594b1dc5232fcd37f06430d23ebbd32e43/example/example.js#L12-L18
42,104
Reactive-Extensions/rx.disposables
compositedisposable.js
CompositeDisposable
function CompositeDisposable () { var args = [], i, len; if (Array.isArray(arguments[0])) { args = arguments[0]; len = args.length; } else { len = arguments.length; args = new Array(len); for(i = 0; i < len; i++) { args[i] = arguments[i]; } } this._disposables = args; this.isDisposed = false; this.length = args.length; }
javascript
function CompositeDisposable () { var args = [], i, len; if (Array.isArray(arguments[0])) { args = arguments[0]; len = args.length; } else { len = arguments.length; args = new Array(len); for(i = 0; i < len; i++) { args[i] = arguments[i]; } } this._disposables = args; this.isDisposed = false; this.length = args.length; }
[ "function", "CompositeDisposable", "(", ")", "{", "var", "args", "=", "[", "]", ",", "i", ",", "len", ";", "if", "(", "Array", ".", "isArray", "(", "arguments", "[", "0", "]", ")", ")", "{", "args", "=", "arguments", "[", "0", "]", ";", "len", "=", "args", ".", "length", ";", "}", "else", "{", "len", "=", "arguments", ".", "length", ";", "args", "=", "new", "Array", "(", "len", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "args", "[", "i", "]", "=", "arguments", "[", "i", "]", ";", "}", "}", "this", ".", "_disposables", "=", "args", ";", "this", ".", "isDisposed", "=", "false", ";", "this", ".", "length", "=", "args", ".", "length", ";", "}" ]
Represents a group of disposable resources that are disposed together. @constructor
[ "Represents", "a", "group", "of", "disposable", "resources", "that", "are", "disposed", "together", "." ]
07d5df25ae10e4dfea17da7d98f809e394f0a3ba
https://github.com/Reactive-Extensions/rx.disposables/blob/07d5df25ae10e4dfea17da7d98f809e394f0a3ba/compositedisposable.js#L7-L20
42,105
enyojs/onyx
src/TabBar/TabBar.js
function (inControl) { var c = inControl.caption || ('Tab ' + this.lastIndex); this.selectedId = this.lastIndex++ ; var t = this.$.tabs.createComponent( { content: c, userData: inControl.data || { }, tooltipMsg: inControl.tooltipMsg, //may be null userId: inControl.userId, // may be null tabIndex: this.selectedId, addBefore: this.$.line } ); t.render(); this.resetWidth(); t.raise(); t.setActive(true); return t; }
javascript
function (inControl) { var c = inControl.caption || ('Tab ' + this.lastIndex); this.selectedId = this.lastIndex++ ; var t = this.$.tabs.createComponent( { content: c, userData: inControl.data || { }, tooltipMsg: inControl.tooltipMsg, //may be null userId: inControl.userId, // may be null tabIndex: this.selectedId, addBefore: this.$.line } ); t.render(); this.resetWidth(); t.raise(); t.setActive(true); return t; }
[ "function", "(", "inControl", ")", "{", "var", "c", "=", "inControl", ".", "caption", "||", "(", "'Tab '", "+", "this", ".", "lastIndex", ")", ";", "this", ".", "selectedId", "=", "this", ".", "lastIndex", "++", ";", "var", "t", "=", "this", ".", "$", ".", "tabs", ".", "createComponent", "(", "{", "content", ":", "c", ",", "userData", ":", "inControl", ".", "data", "||", "{", "}", ",", "tooltipMsg", ":", "inControl", ".", "tooltipMsg", ",", "//may be null", "userId", ":", "inControl", ".", "userId", ",", "// may be null", "tabIndex", ":", "this", ".", "selectedId", ",", "addBefore", ":", "this", ".", "$", ".", "line", "}", ")", ";", "t", ".", "render", "(", ")", ";", "this", ".", "resetWidth", "(", ")", ";", "t", ".", "raise", "(", ")", ";", "t", ".", "setActive", "(", "true", ")", ";", "return", "t", ";", "}" ]
Append a new tab to the tab bar. inControl is an object with optional caption and data attributes. When not specified the tab will have a generated caption like 'Tab 0', 'Tab 1'. etc... data is an arbitrary object that will be given back with onTabChanged events @public
[ "Append", "a", "new", "tab", "to", "the", "tab", "bar", ".", "inControl", "is", "an", "object", "with", "optional", "caption", "and", "data", "attributes", ".", "When", "not", "specified", "the", "tab", "will", "have", "a", "generated", "caption", "like", "Tab", "0", "Tab", "1", ".", "etc", "...", "data", "is", "an", "arbitrary", "object", "that", "will", "be", "given", "back", "with", "onTabChanged", "events" ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/TabBar/TabBar.js#L306-L325
42,106
enyojs/onyx
src/TabBar/TabBar.js
function (target) { var tab = this.resolveTab(target,'removeTab'); var tabData = { index: tab.tabIndex, caption: tab.content, tooltipMsg: tab.tooltipMsg, userId: tab.userId, data: tab.userData } ; var that = this ; if (tab) { tabData.next = function (err) { if (err) { throw new Error(err); } else { that.removeTab(target); } } ; this.doTabRemoveRequested( tabData ) ; } }
javascript
function (target) { var tab = this.resolveTab(target,'removeTab'); var tabData = { index: tab.tabIndex, caption: tab.content, tooltipMsg: tab.tooltipMsg, userId: tab.userId, data: tab.userData } ; var that = this ; if (tab) { tabData.next = function (err) { if (err) { throw new Error(err); } else { that.removeTab(target); } } ; this.doTabRemoveRequested( tabData ) ; } }
[ "function", "(", "target", ")", "{", "var", "tab", "=", "this", ".", "resolveTab", "(", "target", ",", "'removeTab'", ")", ";", "var", "tabData", "=", "{", "index", ":", "tab", ".", "tabIndex", ",", "caption", ":", "tab", ".", "content", ",", "tooltipMsg", ":", "tab", ".", "tooltipMsg", ",", "userId", ":", "tab", ".", "userId", ",", "data", ":", "tab", ".", "userData", "}", ";", "var", "that", "=", "this", ";", "if", "(", "tab", ")", "{", "tabData", ".", "next", "=", "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "throw", "new", "Error", "(", "err", ")", ";", "}", "else", "{", "that", ".", "removeTab", "(", "target", ")", ";", "}", "}", ";", "this", ".", "doTabRemoveRequested", "(", "tabData", ")", ";", "}", "}" ]
Request to remove a tab from the tab bar. This is a bit like removeTab, except that a onTabRemoveRequested event is fired to let the application the possibility to cancel the request. @public
[ "Request", "to", "remove", "a", "tab", "from", "the", "tab", "bar", ".", "This", "is", "a", "bit", "like", "removeTab", "except", "that", "a", "onTabRemoveRequested", "event", "is", "fired", "to", "let", "the", "application", "the", "possibility", "to", "cancel", "the", "request", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/TabBar/TabBar.js#L394-L411
42,107
enyojs/onyx
src/TabBar/TabBar.js
function () { var result = 0; utils.forEach( this.$.tabs.getControls(), function (tab){ var w = tab.origWidth() ; // must add margin and padding of inner button and outer tab-item result += w + 18 ; } ); return result; }
javascript
function () { var result = 0; utils.forEach( this.$.tabs.getControls(), function (tab){ var w = tab.origWidth() ; // must add margin and padding of inner button and outer tab-item result += w + 18 ; } ); return result; }
[ "function", "(", ")", "{", "var", "result", "=", "0", ";", "utils", ".", "forEach", "(", "this", ".", "$", ".", "tabs", ".", "getControls", "(", ")", ",", "function", "(", "tab", ")", "{", "var", "w", "=", "tab", ".", "origWidth", "(", ")", ";", "// must add margin and padding of inner button and outer tab-item", "result", "+=", "w", "+", "18", ";", "}", ")", ";", "return", "result", ";", "}" ]
compute tab width by adding width of tabs contained in tab bar. @private
[ "compute", "tab", "width", "by", "adding", "width", "of", "tabs", "contained", "in", "tab", "bar", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/TabBar/TabBar.js#L598-L609
42,108
enyojs/onyx
src/TabBar/TabBar.js
function (inSender, inEvent) { var that = this ; var popup = this.$.popup; for (var name in popup.$) { if (popup.$.hasOwnProperty(name) && /menuItem/.test(name)) { popup.$[name].destroy(); } } //popup.render(); utils.forEach( this.$.tabs.getControls(), function (tab) { that.$.popup.createComponent({ content: tab.content, value: tab.tabIndex }) ; } ); popup.maxHeightChanged(); popup.showAtPosition({top: 30, right:30}); this.render(); this.resize(); // required for IE10 to work correctly return ; }
javascript
function (inSender, inEvent) { var that = this ; var popup = this.$.popup; for (var name in popup.$) { if (popup.$.hasOwnProperty(name) && /menuItem/.test(name)) { popup.$[name].destroy(); } } //popup.render(); utils.forEach( this.$.tabs.getControls(), function (tab) { that.$.popup.createComponent({ content: tab.content, value: tab.tabIndex }) ; } ); popup.maxHeightChanged(); popup.showAtPosition({top: 30, right:30}); this.render(); this.resize(); // required for IE10 to work correctly return ; }
[ "function", "(", "inSender", ",", "inEvent", ")", "{", "var", "that", "=", "this", ";", "var", "popup", "=", "this", ".", "$", ".", "popup", ";", "for", "(", "var", "name", "in", "popup", ".", "$", ")", "{", "if", "(", "popup", ".", "$", ".", "hasOwnProperty", "(", "name", ")", "&&", "/", "menuItem", "/", ".", "test", "(", "name", ")", ")", "{", "popup", ".", "$", "[", "name", "]", ".", "destroy", "(", ")", ";", "}", "}", "//popup.render();", "utils", ".", "forEach", "(", "this", ".", "$", ".", "tabs", ".", "getControls", "(", ")", ",", "function", "(", "tab", ")", "{", "that", ".", "$", ".", "popup", ".", "createComponent", "(", "{", "content", ":", "tab", ".", "content", ",", "value", ":", "tab", ".", "tabIndex", "}", ")", ";", "}", ")", ";", "popup", ".", "maxHeightChanged", "(", ")", ";", "popup", ".", "showAtPosition", "(", "{", "top", ":", "30", ",", "right", ":", "30", "}", ")", ";", "this", ".", "render", "(", ")", ";", "this", ".", "resize", "(", ")", ";", "// required for IE10 to work correctly", "return", ";", "}" ]
Since action buttons of Contextual Popups are not dynamic, this kind is created on the fly and destroyed once the user clicks on a button @private
[ "Since", "action", "buttons", "of", "Contextual", "Popups", "are", "not", "dynamic", "this", "kind", "is", "created", "on", "the", "fly", "and", "destroyed", "once", "the", "user", "clicks", "on", "a", "button" ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/TabBar/TabBar.js#L662-L688
42,109
sheershoff/node-cache-manager-fs-binary
index.js
bufferReviver
function bufferReviver(k, v) { if ( v !== null && typeof v === 'object' && 'type' in v && v.type === 'Buffer' && 'data' in v && Array.isArray(v.data)) { return new Buffer(v.data); } return v; }
javascript
function bufferReviver(k, v) { if ( v !== null && typeof v === 'object' && 'type' in v && v.type === 'Buffer' && 'data' in v && Array.isArray(v.data)) { return new Buffer(v.data); } return v; }
[ "function", "bufferReviver", "(", "k", ",", "v", ")", "{", "if", "(", "v", "!==", "null", "&&", "typeof", "v", "===", "'object'", "&&", "'type'", "in", "v", "&&", "v", ".", "type", "===", "'Buffer'", "&&", "'data'", "in", "v", "&&", "Array", ".", "isArray", "(", "v", ".", "data", ")", ")", "{", "return", "new", "Buffer", "(", "v", ".", "data", ")", ";", "}", "return", "v", ";", "}" ]
Helper function that revives buffers from object representation on JSON.parse
[ "Helper", "function", "that", "revives", "buffers", "from", "object", "representation", "on", "JSON", ".", "parse" ]
8fbdfb6f91a659184736eccf5355321f13c642f7
https://github.com/sheershoff/node-cache-manager-fs-binary/blob/8fbdfb6f91a659184736eccf5355321f13c642f7/index.js#L31-L42
42,110
sheershoff/node-cache-manager-fs-binary
index.js
MetaData
function MetaData() { // the key for the storing this.key = null; // data to store this.value = null; // temporary filename for the cached file because filenames cannot represend urls completely this.filename = null; // expirydate of the entry this.expires = null; // size of the current entry this.size = null; }
javascript
function MetaData() { // the key for the storing this.key = null; // data to store this.value = null; // temporary filename for the cached file because filenames cannot represend urls completely this.filename = null; // expirydate of the entry this.expires = null; // size of the current entry this.size = null; }
[ "function", "MetaData", "(", ")", "{", "// the key for the storing", "this", ".", "key", "=", "null", ";", "// data to store", "this", ".", "value", "=", "null", ";", "// temporary filename for the cached file because filenames cannot represend urls completely", "this", ".", "filename", "=", "null", ";", "// expirydate of the entry", "this", ".", "expires", "=", "null", ";", "// size of the current entry", "this", ".", "size", "=", "null", ";", "}" ]
helper object with meta-informations about the cached data
[ "helper", "object", "with", "meta", "-", "informations", "about", "the", "cached", "data" ]
8fbdfb6f91a659184736eccf5355321f13c642f7
https://github.com/sheershoff/node-cache-manager-fs-binary/blob/8fbdfb6f91a659184736eccf5355321f13c642f7/index.js#L47-L59
42,111
sheershoff/node-cache-manager-fs-binary
index.js
DiskStore
function DiskStore(options) { options = options || {}; this.options = extend({ path: 'cache/', ttl: 60, maxsize: 0, zip: false }, options); // check storage directory for existence (or create it) if (!fs.existsSync(this.options.path)) { fs.mkdirSync(this.options.path); } this.name = 'diskstore'; // current size of the cache this.currentsize = 0; // internal array for informations about the cached files - resists in memory this.collection = {}; // fill the cache on startup with already existing files if (!options.preventfill) { this.intializefill(options.fillcallback); } }
javascript
function DiskStore(options) { options = options || {}; this.options = extend({ path: 'cache/', ttl: 60, maxsize: 0, zip: false }, options); // check storage directory for existence (or create it) if (!fs.existsSync(this.options.path)) { fs.mkdirSync(this.options.path); } this.name = 'diskstore'; // current size of the cache this.currentsize = 0; // internal array for informations about the cached files - resists in memory this.collection = {}; // fill the cache on startup with already existing files if (!options.preventfill) { this.intializefill(options.fillcallback); } }
[ "function", "DiskStore", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "this", ".", "options", "=", "extend", "(", "{", "path", ":", "'cache/'", ",", "ttl", ":", "60", ",", "maxsize", ":", "0", ",", "zip", ":", "false", "}", ",", "options", ")", ";", "// check storage directory for existence (or create it)", "if", "(", "!", "fs", ".", "existsSync", "(", "this", ".", "options", ".", "path", ")", ")", "{", "fs", ".", "mkdirSync", "(", "this", ".", "options", ".", "path", ")", ";", "}", "this", ".", "name", "=", "'diskstore'", ";", "// current size of the cache", "this", ".", "currentsize", "=", "0", ";", "// internal array for informations about the cached files - resists in memory", "this", ".", "collection", "=", "{", "}", ";", "// fill the cache on startup with already existing files", "if", "(", "!", "options", ".", "preventfill", ")", "{", "this", ".", "intializefill", "(", "options", ".", "fillcallback", ")", ";", "}", "}" ]
construction of the disk storage
[ "construction", "of", "the", "disk", "storage" ]
8fbdfb6f91a659184736eccf5355321f13c642f7
https://github.com/sheershoff/node-cache-manager-fs-binary/blob/8fbdfb6f91a659184736eccf5355321f13c642f7/index.js#L64-L93
42,112
enyojs/onyx
src/Slider/Slider.js
function (value) { this.$.animator.play({ startValue: this.value, endValue: value, node: this.hasNode() }); this.setValue(value); }
javascript
function (value) { this.$.animator.play({ startValue: this.value, endValue: value, node: this.hasNode() }); this.setValue(value); }
[ "function", "(", "value", ")", "{", "this", ".", "$", ".", "animator", ".", "play", "(", "{", "startValue", ":", "this", ".", "value", ",", "endValue", ":", "value", ",", "node", ":", "this", ".", "hasNode", "(", ")", "}", ")", ";", "this", ".", "setValue", "(", "value", ")", ";", "}" ]
Animates to the given value. @param {Number} value - The value to animate to. @public @todo functional overlap with {@link module:onyx/ProgressBar~ProgressBar#animateProgressTo}
[ "Animates", "to", "the", "given", "value", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/Slider/Slider.js#L274-L282
42,113
alg/typedoc-dash-theme
bin/theme.js
DashDocsetTheme
function DashDocsetTheme(renderer, basePath) { _super.call(this, renderer, basePath); renderer.on(output.Renderer.EVENT_BEGIN, this.onRendererBegin, this, 1024); this.dashIndexPlugin = new DashIndexPlugin(renderer); this.dashAssetsPlugin = new DashAssetsPlugin(renderer); this.infoPlistPlugin = new InfoPlistPlugin(renderer); }
javascript
function DashDocsetTheme(renderer, basePath) { _super.call(this, renderer, basePath); renderer.on(output.Renderer.EVENT_BEGIN, this.onRendererBegin, this, 1024); this.dashIndexPlugin = new DashIndexPlugin(renderer); this.dashAssetsPlugin = new DashAssetsPlugin(renderer); this.infoPlistPlugin = new InfoPlistPlugin(renderer); }
[ "function", "DashDocsetTheme", "(", "renderer", ",", "basePath", ")", "{", "_super", ".", "call", "(", "this", ",", "renderer", ",", "basePath", ")", ";", "renderer", ".", "on", "(", "output", ".", "Renderer", ".", "EVENT_BEGIN", ",", "this", ".", "onRendererBegin", ",", "this", ",", "1024", ")", ";", "this", ".", "dashIndexPlugin", "=", "new", "DashIndexPlugin", "(", "renderer", ")", ";", "this", ".", "dashAssetsPlugin", "=", "new", "DashAssetsPlugin", "(", "renderer", ")", ";", "this", ".", "infoPlistPlugin", "=", "new", "InfoPlistPlugin", "(", "renderer", ")", ";", "}" ]
Create a new DashDocsetTheme instance. @param renderer The renderer this theme is attached to. @param basePath The base path of this theme.
[ "Create", "a", "new", "DashDocsetTheme", "instance", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L178-L184
42,114
alg/typedoc-dash-theme
bin/theme.js
containsExternals
function containsExternals(modules) { for (var index = 0, length = modules.length; index < length; index++) { if (modules[index].flags.isExternal) return true; } return false; }
javascript
function containsExternals(modules) { for (var index = 0, length = modules.length; index < length; index++) { if (modules[index].flags.isExternal) return true; } return false; }
[ "function", "containsExternals", "(", "modules", ")", "{", "for", "(", "var", "index", "=", "0", ",", "length", "=", "modules", ".", "length", ";", "index", "<", "length", ";", "index", "++", ")", "{", "if", "(", "modules", "[", "index", "]", ".", "flags", ".", "isExternal", ")", "return", "true", ";", "}", "return", "false", ";", "}" ]
Test whether the given list of modules contains an external module. @param modules The list of modules to test. @returns TRUE if any of the modules is marked as being external.
[ "Test", "whether", "the", "given", "list", "of", "modules", "contains", "an", "external", "module", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L284-L290
42,115
alg/typedoc-dash-theme
bin/theme.js
sortReflections
function sortReflections(modules) { modules.sort(function (a, b) { if (a.flags.isExternal && !b.flags.isExternal) return 1; if (!a.flags.isExternal && b.flags.isExternal) return -1; return a.getFullName() < b.getFullName() ? -1 : 1; }); }
javascript
function sortReflections(modules) { modules.sort(function (a, b) { if (a.flags.isExternal && !b.flags.isExternal) return 1; if (!a.flags.isExternal && b.flags.isExternal) return -1; return a.getFullName() < b.getFullName() ? -1 : 1; }); }
[ "function", "sortReflections", "(", "modules", ")", "{", "modules", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "if", "(", "a", ".", "flags", ".", "isExternal", "&&", "!", "b", ".", "flags", ".", "isExternal", ")", "return", "1", ";", "if", "(", "!", "a", ".", "flags", ".", "isExternal", "&&", "b", ".", "flags", ".", "isExternal", ")", "return", "-", "1", ";", "return", "a", ".", "getFullName", "(", ")", "<", "b", ".", "getFullName", "(", ")", "?", "-", "1", ":", "1", ";", "}", ")", ";", "}" ]
Sort the given list of modules by name, groups external modules at the bottom. @param modules The list of modules that should be sorted.
[ "Sort", "the", "given", "list", "of", "modules", "by", "name", "groups", "external", "modules", "at", "the", "bottom", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L296-L304
42,116
alg/typedoc-dash-theme
bin/theme.js
includeDedicatedUrls
function includeDedicatedUrls(reflection, item) { (function walk(reflection) { for (var key in reflection.children) { var child = reflection.children[key]; if (child.hasOwnDocument && !child.kindOf(td.models.ReflectionKind.SomeModule)) { if (!item.dedicatedUrls) item.dedicatedUrls = []; item.dedicatedUrls.push(child.url); walk(child); } } })(reflection); }
javascript
function includeDedicatedUrls(reflection, item) { (function walk(reflection) { for (var key in reflection.children) { var child = reflection.children[key]; if (child.hasOwnDocument && !child.kindOf(td.models.ReflectionKind.SomeModule)) { if (!item.dedicatedUrls) item.dedicatedUrls = []; item.dedicatedUrls.push(child.url); walk(child); } } })(reflection); }
[ "function", "includeDedicatedUrls", "(", "reflection", ",", "item", ")", "{", "(", "function", "walk", "(", "reflection", ")", "{", "for", "(", "var", "key", "in", "reflection", ".", "children", ")", "{", "var", "child", "=", "reflection", ".", "children", "[", "key", "]", ";", "if", "(", "child", ".", "hasOwnDocument", "&&", "!", "child", ".", "kindOf", "(", "td", ".", "models", ".", "ReflectionKind", ".", "SomeModule", ")", ")", "{", "if", "(", "!", "item", ".", "dedicatedUrls", ")", "item", ".", "dedicatedUrls", "=", "[", "]", ";", "item", ".", "dedicatedUrls", ".", "push", "(", "child", ".", "url", ")", ";", "walk", "(", "child", ")", ";", "}", "}", "}", ")", "(", "reflection", ")", ";", "}" ]
Find the urls of all children of the given reflection and store them as dedicated urls of the given NavigationItem. @param reflection The reflection whose children urls should be included. @param item The navigation node whose dedicated urls should be set.
[ "Find", "the", "urls", "of", "all", "children", "of", "the", "given", "reflection", "and", "store", "them", "as", "dedicated", "urls", "of", "the", "given", "NavigationItem", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L312-L324
42,117
alg/typedoc-dash-theme
bin/theme.js
buildChildren
function buildChildren(reflection, parent) { var modules = reflection.getChildrenByKind(td.models.ReflectionKind.SomeModule); modules.sort(function (a, b) { return a.getFullName() < b.getFullName() ? -1 : 1; }); modules.forEach(function (reflection) { var item = output.NavigationItem.create(reflection, parent); includeDedicatedUrls(reflection, item); buildChildren(reflection, item); }); }
javascript
function buildChildren(reflection, parent) { var modules = reflection.getChildrenByKind(td.models.ReflectionKind.SomeModule); modules.sort(function (a, b) { return a.getFullName() < b.getFullName() ? -1 : 1; }); modules.forEach(function (reflection) { var item = output.NavigationItem.create(reflection, parent); includeDedicatedUrls(reflection, item); buildChildren(reflection, item); }); }
[ "function", "buildChildren", "(", "reflection", ",", "parent", ")", "{", "var", "modules", "=", "reflection", ".", "getChildrenByKind", "(", "td", ".", "models", ".", "ReflectionKind", ".", "SomeModule", ")", ";", "modules", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "return", "a", ".", "getFullName", "(", ")", "<", "b", ".", "getFullName", "(", ")", "?", "-", "1", ":", "1", ";", "}", ")", ";", "modules", ".", "forEach", "(", "function", "(", "reflection", ")", "{", "var", "item", "=", "output", ".", "NavigationItem", ".", "create", "(", "reflection", ",", "parent", ")", ";", "includeDedicatedUrls", "(", "reflection", ",", "item", ")", ";", "buildChildren", "(", "reflection", ",", "item", ")", ";", "}", ")", ";", "}" ]
Create navigation nodes for all container children of the given reflection. @param reflection The reflection whose children modules should be transformed into navigation nodes. @param parent The parent NavigationItem of the newly created nodes.
[ "Create", "navigation", "nodes", "for", "all", "container", "children", "of", "the", "given", "reflection", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L331-L341
42,118
alg/typedoc-dash-theme
bin/theme.js
buildGroups
function buildGroups(reflections, parent, callback) { var state = -1; var hasExternals = containsExternals(reflections); sortReflections(reflections); reflections.forEach(function (reflection) { if (hasExternals && !reflection.flags.isExternal && state != 1) { new output.NavigationItem('Internals', null, parent, "tsd-is-external"); state = 1; } else if (hasExternals && reflection.flags.isExternal && state != 2) { new output.NavigationItem('Externals', null, parent, "tsd-is-external"); state = 2; } var item = output.NavigationItem.create(reflection, parent); includeDedicatedUrls(reflection, item); if (callback) callback(reflection, item); }); }
javascript
function buildGroups(reflections, parent, callback) { var state = -1; var hasExternals = containsExternals(reflections); sortReflections(reflections); reflections.forEach(function (reflection) { if (hasExternals && !reflection.flags.isExternal && state != 1) { new output.NavigationItem('Internals', null, parent, "tsd-is-external"); state = 1; } else if (hasExternals && reflection.flags.isExternal && state != 2) { new output.NavigationItem('Externals', null, parent, "tsd-is-external"); state = 2; } var item = output.NavigationItem.create(reflection, parent); includeDedicatedUrls(reflection, item); if (callback) callback(reflection, item); }); }
[ "function", "buildGroups", "(", "reflections", ",", "parent", ",", "callback", ")", "{", "var", "state", "=", "-", "1", ";", "var", "hasExternals", "=", "containsExternals", "(", "reflections", ")", ";", "sortReflections", "(", "reflections", ")", ";", "reflections", ".", "forEach", "(", "function", "(", "reflection", ")", "{", "if", "(", "hasExternals", "&&", "!", "reflection", ".", "flags", ".", "isExternal", "&&", "state", "!=", "1", ")", "{", "new", "output", ".", "NavigationItem", "(", "'Internals'", ",", "null", ",", "parent", ",", "\"tsd-is-external\"", ")", ";", "state", "=", "1", ";", "}", "else", "if", "(", "hasExternals", "&&", "reflection", ".", "flags", ".", "isExternal", "&&", "state", "!=", "2", ")", "{", "new", "output", ".", "NavigationItem", "(", "'Externals'", ",", "null", ",", "parent", ",", "\"tsd-is-external\"", ")", ";", "state", "=", "2", ";", "}", "var", "item", "=", "output", ".", "NavigationItem", ".", "create", "(", "reflection", ",", "parent", ")", ";", "includeDedicatedUrls", "(", "reflection", ",", "item", ")", ";", "if", "(", "callback", ")", "callback", "(", "reflection", ",", "item", ")", ";", "}", ")", ";", "}" ]
Create navigation nodes for the given list of reflections. The resulting nodes will be grouped into an "internal" and an "external" section when applicable. @param reflections The list of reflections which should be transformed into navigation nodes. @param parent The parent NavigationItem of the newly created nodes. @param callback Optional callback invoked for each generated node.
[ "Create", "navigation", "nodes", "for", "the", "given", "list", "of", "reflections", ".", "The", "resulting", "nodes", "will", "be", "grouped", "into", "an", "internal", "and", "an", "external", "section", "when", "applicable", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L350-L368
42,119
alg/typedoc-dash-theme
bin/theme.js
build
function build(hasSeparateGlobals) { var root = new output.NavigationItem('Index', 'index.html'); if (entryPoint == project) { var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root); globals.isGlobals = true; } var modules = []; project.getReflectionsByKind(td.models.ReflectionKind.SomeModule).forEach(function (someModule) { var target = someModule.parent; var inScope = (someModule == entryPoint); while (target) { if (target.kindOf(td.models.ReflectionKind.ExternalModule)) return; if (entryPoint == target) inScope = true; target = target.parent; } if (inScope) { modules.push(someModule); } }); if (modules.length < 10) { buildGroups(modules, root); } else { buildGroups(entryPoint.getChildrenByKind(td.models.ReflectionKind.SomeModule), root, buildChildren); } return root; }
javascript
function build(hasSeparateGlobals) { var root = new output.NavigationItem('Index', 'index.html'); if (entryPoint == project) { var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root); globals.isGlobals = true; } var modules = []; project.getReflectionsByKind(td.models.ReflectionKind.SomeModule).forEach(function (someModule) { var target = someModule.parent; var inScope = (someModule == entryPoint); while (target) { if (target.kindOf(td.models.ReflectionKind.ExternalModule)) return; if (entryPoint == target) inScope = true; target = target.parent; } if (inScope) { modules.push(someModule); } }); if (modules.length < 10) { buildGroups(modules, root); } else { buildGroups(entryPoint.getChildrenByKind(td.models.ReflectionKind.SomeModule), root, buildChildren); } return root; }
[ "function", "build", "(", "hasSeparateGlobals", ")", "{", "var", "root", "=", "new", "output", ".", "NavigationItem", "(", "'Index'", ",", "'index.html'", ")", ";", "if", "(", "entryPoint", "==", "project", ")", "{", "var", "globals", "=", "new", "output", ".", "NavigationItem", "(", "'Globals'", ",", "hasSeparateGlobals", "?", "'globals.html'", ":", "'index.html'", ",", "root", ")", ";", "globals", ".", "isGlobals", "=", "true", ";", "}", "var", "modules", "=", "[", "]", ";", "project", ".", "getReflectionsByKind", "(", "td", ".", "models", ".", "ReflectionKind", ".", "SomeModule", ")", ".", "forEach", "(", "function", "(", "someModule", ")", "{", "var", "target", "=", "someModule", ".", "parent", ";", "var", "inScope", "=", "(", "someModule", "==", "entryPoint", ")", ";", "while", "(", "target", ")", "{", "if", "(", "target", ".", "kindOf", "(", "td", ".", "models", ".", "ReflectionKind", ".", "ExternalModule", ")", ")", "return", ";", "if", "(", "entryPoint", "==", "target", ")", "inScope", "=", "true", ";", "target", "=", "target", ".", "parent", ";", "}", "if", "(", "inScope", ")", "{", "modules", ".", "push", "(", "someModule", ")", ";", "}", "}", ")", ";", "if", "(", "modules", ".", "length", "<", "10", ")", "{", "buildGroups", "(", "modules", ",", "root", ")", ";", "}", "else", "{", "buildGroups", "(", "entryPoint", ".", "getChildrenByKind", "(", "td", ".", "models", ".", "ReflectionKind", ".", "SomeModule", ")", ",", "root", ",", "buildChildren", ")", ";", "}", "return", "root", ";", "}" ]
Build the navigation structure. @param hasSeparateGlobals Has the project a separated globals.html file? @return The root node of the generated navigation structure.
[ "Build", "the", "navigation", "structure", "." ]
7d51c475af263afc4ea0654f93a47e4cb6c46472
https://github.com/alg/typedoc-dash-theme/blob/7d51c475af263afc4ea0654f93a47e4cb6c46472/bin/theme.js#L375-L403
42,120
thomasdondorf/phantomjs-pool
lib/worker/Worker.js
jobDone
function jobDone(err, data) { // TODO: check if function was already called before // check if we close the connection after this (to prevent memory leaks) var closing = totalRequests > REQUESTS_BEFORE_WORKER_RESTART ? true : false; var msg = {}; if (err) { msg.errMessage = err.message; msg.status = 'fail'; closing = true; // always close the worker if any error happens } else { msg.status = 'success'; } msg.data = data; msg.closing = closing; // send our data back to the master res.statusCode = 200; res.write(JSON.stringify(msg)); res.close(); // close this worker if necessary if (closing) { phantom.exit(); } }
javascript
function jobDone(err, data) { // TODO: check if function was already called before // check if we close the connection after this (to prevent memory leaks) var closing = totalRequests > REQUESTS_BEFORE_WORKER_RESTART ? true : false; var msg = {}; if (err) { msg.errMessage = err.message; msg.status = 'fail'; closing = true; // always close the worker if any error happens } else { msg.status = 'success'; } msg.data = data; msg.closing = closing; // send our data back to the master res.statusCode = 200; res.write(JSON.stringify(msg)); res.close(); // close this worker if necessary if (closing) { phantom.exit(); } }
[ "function", "jobDone", "(", "err", ",", "data", ")", "{", "// TODO: check if function was already called before", "// check if we close the connection after this (to prevent memory leaks)", "var", "closing", "=", "totalRequests", ">", "REQUESTS_BEFORE_WORKER_RESTART", "?", "true", ":", "false", ";", "var", "msg", "=", "{", "}", ";", "if", "(", "err", ")", "{", "msg", ".", "errMessage", "=", "err", ".", "message", ";", "msg", ".", "status", "=", "'fail'", ";", "closing", "=", "true", ";", "// always close the worker if any error happens", "}", "else", "{", "msg", ".", "status", "=", "'success'", ";", "}", "msg", ".", "data", "=", "data", ";", "msg", ".", "closing", "=", "closing", ";", "// send our data back to the master", "res", ".", "statusCode", "=", "200", ";", "res", ".", "write", "(", "JSON", ".", "stringify", "(", "msg", ")", ")", ";", "res", ".", "close", "(", ")", ";", "// close this worker if necessary", "if", "(", "closing", ")", "{", "phantom", ".", "exit", "(", ")", ";", "}", "}" ]
job was executed, lets inform the master
[ "job", "was", "executed", "lets", "inform", "the", "master" ]
f734ec445de543cc40497e4154e3077d7f8b753e
https://github.com/thomasdondorf/phantomjs-pool/blob/f734ec445de543cc40497e4154e3077d7f8b753e/lib/worker/Worker.js#L33-L60
42,121
enyojs/onyx
src/ContextualPopup/ContextualPopup.js
function (rect) { var s = ''; for (var n in rect) { s += (n + ':' + rect[n] + (isNaN(rect[n]) ? '; ' : 'px; ')); } this.addStyles(s); }
javascript
function (rect) { var s = ''; for (var n in rect) { s += (n + ':' + rect[n] + (isNaN(rect[n]) ? '; ' : 'px; ')); } this.addStyles(s); }
[ "function", "(", "rect", ")", "{", "var", "s", "=", "''", ";", "for", "(", "var", "n", "in", "rect", ")", "{", "s", "+=", "(", "n", "+", "':'", "+", "rect", "[", "n", "]", "+", "(", "isNaN", "(", "rect", "[", "n", "]", ")", "?", "'; '", ":", "'px; '", ")", ")", ";", "}", "this", ".", "addStyles", "(", "s", ")", ";", "}" ]
Positions the popup. @todo seems to duplicate enyo.Control.setBounds() @private
[ "Positions", "the", "popup", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/ContextualPopup/ContextualPopup.js#L346-L352
42,122
enyojs/onyx
src/ContextualPopup/ContextualPopup.js
function (node) { var r = this.getBoundingRect(node); var pageYOffset = (window.pageYOffset === undefined) ? document.documentElement.scrollTop : window.pageYOffset; var pageXOffset = (window.pageXOffset === undefined) ? document.documentElement.scrollLeft : window.pageXOffset; var rHeight = (r.height === undefined) ? (r.bottom - r.top) : r.height; var rWidth = (r.width === undefined) ? (r.right - r.left) : r.width; return {top: r.top + pageYOffset, left: r.left + pageXOffset, height: rHeight, width: rWidth}; }
javascript
function (node) { var r = this.getBoundingRect(node); var pageYOffset = (window.pageYOffset === undefined) ? document.documentElement.scrollTop : window.pageYOffset; var pageXOffset = (window.pageXOffset === undefined) ? document.documentElement.scrollLeft : window.pageXOffset; var rHeight = (r.height === undefined) ? (r.bottom - r.top) : r.height; var rWidth = (r.width === undefined) ? (r.right - r.left) : r.width; return {top: r.top + pageYOffset, left: r.left + pageXOffset, height: rHeight, width: rWidth}; }
[ "function", "(", "node", ")", "{", "var", "r", "=", "this", ".", "getBoundingRect", "(", "node", ")", ";", "var", "pageYOffset", "=", "(", "window", ".", "pageYOffset", "===", "undefined", ")", "?", "document", ".", "documentElement", ".", "scrollTop", ":", "window", ".", "pageYOffset", ";", "var", "pageXOffset", "=", "(", "window", ".", "pageXOffset", "===", "undefined", ")", "?", "document", ".", "documentElement", ".", "scrollLeft", ":", "window", ".", "pageXOffset", ";", "var", "rHeight", "=", "(", "r", ".", "height", "===", "undefined", ")", "?", "(", "r", ".", "bottom", "-", "r", ".", "top", ")", ":", "r", ".", "height", ";", "var", "rWidth", "=", "(", "r", ".", "width", "===", "undefined", ")", "?", "(", "r", ".", "right", "-", "r", ".", "left", ")", ":", "r", ".", "width", ";", "return", "{", "top", ":", "r", ".", "top", "+", "pageYOffset", ",", "left", ":", "r", ".", "left", "+", "pageXOffset", ",", "height", ":", "rHeight", ",", "width", ":", "rWidth", "}", ";", "}" ]
Calculates the position of the popup relative to the page. @param {Element} node @private
[ "Calculates", "the", "position", "of", "the", "popup", "relative", "to", "the", "page", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/ContextualPopup/ContextualPopup.js#L360-L369
42,123
enyojs/onyx
src/ContextualPopup/ContextualPopup.js
function () { if (this.showing && this.hasNode() && this.activator) { this.resetPositioning(); this.activatorOffset = this.getPageOffset(this.activator); var innerWidth = this.getViewWidth(); var innerHeight = this.getViewHeight(); //These are the view "flush boundaries" var topFlushPt = this.vertFlushMargin; var bottomFlushPt = innerHeight - this.vertFlushMargin; var leftFlushPt = this.horizFlushMargin; var rightFlushPt = innerWidth - this.horizFlushMargin; //Rule 1 - Activator Location based positioning //if the activator is in the top or bottom edges of the view, check if the popup needs flush positioning if ((this.activatorOffset.top + this.activatorOffset.height) < topFlushPt || this.activatorOffset.top > bottomFlushPt) { //check/try vertical flush positioning (rule 1.a.i) if (this.applyVerticalFlushPositioning(leftFlushPt, rightFlushPt)) { return; } //if vertical doesn't fit then check/try horizontal flush (rule 1.a.ii) if (this.applyHorizontalFlushPositioning(leftFlushPt, rightFlushPt)) { return; } //if flush positioning didn't work then try just positioning vertically (rule 1.b.i & rule 1.b.ii) if (this.applyVerticalPositioning()){ return; } //otherwise check if the activator is in the left or right edges of the view & if so try horizontal positioning } else if ((this.activatorOffset.left + this.activatorOffset.width) < leftFlushPt || this.activatorOffset.left > rightFlushPt) { //if flush positioning didn't work then try just positioning horizontally (rule 1.b.iii & rule 1.b.iv) if (this.applyHorizontalPositioning()){ return; } } //Rule 2 - no specific logic below for this rule since it is inheritent to the positioning functions, ie we attempt to never //position a popup where there isn't enough room for it. //Rule 3 - Popup Size based positioning var clientRect = this.getBoundingRect(this.node); //if the popup is wide then use vertical positioning if (clientRect.width > this.widePopup) { if (this.applyVerticalPositioning()){ return; } } //if the popup is long then use horizontal positioning else if (clientRect.height > this.longPopup) { if (this.applyHorizontalPositioning()){ return; } } //Rule 4 - Favor top or bottom positioning if (this.applyVerticalPositioning()) { return; } //but if thats not possible try horizontal else if (this.applyHorizontalPositioning()){ return; } //Rule 5 - no specific logic below for this rule since it is built into the vertical position functions, ie we attempt to // use a bottom position for the popup as much possible. } }
javascript
function () { if (this.showing && this.hasNode() && this.activator) { this.resetPositioning(); this.activatorOffset = this.getPageOffset(this.activator); var innerWidth = this.getViewWidth(); var innerHeight = this.getViewHeight(); //These are the view "flush boundaries" var topFlushPt = this.vertFlushMargin; var bottomFlushPt = innerHeight - this.vertFlushMargin; var leftFlushPt = this.horizFlushMargin; var rightFlushPt = innerWidth - this.horizFlushMargin; //Rule 1 - Activator Location based positioning //if the activator is in the top or bottom edges of the view, check if the popup needs flush positioning if ((this.activatorOffset.top + this.activatorOffset.height) < topFlushPt || this.activatorOffset.top > bottomFlushPt) { //check/try vertical flush positioning (rule 1.a.i) if (this.applyVerticalFlushPositioning(leftFlushPt, rightFlushPt)) { return; } //if vertical doesn't fit then check/try horizontal flush (rule 1.a.ii) if (this.applyHorizontalFlushPositioning(leftFlushPt, rightFlushPt)) { return; } //if flush positioning didn't work then try just positioning vertically (rule 1.b.i & rule 1.b.ii) if (this.applyVerticalPositioning()){ return; } //otherwise check if the activator is in the left or right edges of the view & if so try horizontal positioning } else if ((this.activatorOffset.left + this.activatorOffset.width) < leftFlushPt || this.activatorOffset.left > rightFlushPt) { //if flush positioning didn't work then try just positioning horizontally (rule 1.b.iii & rule 1.b.iv) if (this.applyHorizontalPositioning()){ return; } } //Rule 2 - no specific logic below for this rule since it is inheritent to the positioning functions, ie we attempt to never //position a popup where there isn't enough room for it. //Rule 3 - Popup Size based positioning var clientRect = this.getBoundingRect(this.node); //if the popup is wide then use vertical positioning if (clientRect.width > this.widePopup) { if (this.applyVerticalPositioning()){ return; } } //if the popup is long then use horizontal positioning else if (clientRect.height > this.longPopup) { if (this.applyHorizontalPositioning()){ return; } } //Rule 4 - Favor top or bottom positioning if (this.applyVerticalPositioning()) { return; } //but if thats not possible try horizontal else if (this.applyHorizontalPositioning()){ return; } //Rule 5 - no specific logic below for this rule since it is built into the vertical position functions, ie we attempt to // use a bottom position for the popup as much possible. } }
[ "function", "(", ")", "{", "if", "(", "this", ".", "showing", "&&", "this", ".", "hasNode", "(", ")", "&&", "this", ".", "activator", ")", "{", "this", ".", "resetPositioning", "(", ")", ";", "this", ".", "activatorOffset", "=", "this", ".", "getPageOffset", "(", "this", ".", "activator", ")", ";", "var", "innerWidth", "=", "this", ".", "getViewWidth", "(", ")", ";", "var", "innerHeight", "=", "this", ".", "getViewHeight", "(", ")", ";", "//These are the view \"flush boundaries\"", "var", "topFlushPt", "=", "this", ".", "vertFlushMargin", ";", "var", "bottomFlushPt", "=", "innerHeight", "-", "this", ".", "vertFlushMargin", ";", "var", "leftFlushPt", "=", "this", ".", "horizFlushMargin", ";", "var", "rightFlushPt", "=", "innerWidth", "-", "this", ".", "horizFlushMargin", ";", "//Rule 1 - Activator Location based positioning", "//if the activator is in the top or bottom edges of the view, check if the popup needs flush positioning", "if", "(", "(", "this", ".", "activatorOffset", ".", "top", "+", "this", ".", "activatorOffset", ".", "height", ")", "<", "topFlushPt", "||", "this", ".", "activatorOffset", ".", "top", ">", "bottomFlushPt", ")", "{", "//check/try vertical flush positioning\t(rule 1.a.i)", "if", "(", "this", ".", "applyVerticalFlushPositioning", "(", "leftFlushPt", ",", "rightFlushPt", ")", ")", "{", "return", ";", "}", "//if vertical doesn't fit then check/try horizontal flush (rule 1.a.ii)", "if", "(", "this", ".", "applyHorizontalFlushPositioning", "(", "leftFlushPt", ",", "rightFlushPt", ")", ")", "{", "return", ";", "}", "//if flush positioning didn't work then try just positioning vertically (rule 1.b.i & rule 1.b.ii)", "if", "(", "this", ".", "applyVerticalPositioning", "(", ")", ")", "{", "return", ";", "}", "//otherwise check if the activator is in the left or right edges of the view & if so try horizontal positioning", "}", "else", "if", "(", "(", "this", ".", "activatorOffset", ".", "left", "+", "this", ".", "activatorOffset", ".", "width", ")", "<", "leftFlushPt", "||", "this", ".", "activatorOffset", ".", "left", ">", "rightFlushPt", ")", "{", "//if flush positioning didn't work then try just positioning horizontally (rule 1.b.iii & rule 1.b.iv)", "if", "(", "this", ".", "applyHorizontalPositioning", "(", ")", ")", "{", "return", ";", "}", "}", "//Rule 2 - no specific logic below for this rule since it is inheritent to the positioning functions, ie we attempt to never", "//position a popup where there isn't enough room for it.", "//Rule 3 - Popup Size based positioning", "var", "clientRect", "=", "this", ".", "getBoundingRect", "(", "this", ".", "node", ")", ";", "//if the popup is wide then use vertical positioning", "if", "(", "clientRect", ".", "width", ">", "this", ".", "widePopup", ")", "{", "if", "(", "this", ".", "applyVerticalPositioning", "(", ")", ")", "{", "return", ";", "}", "}", "//if the popup is long then use horizontal positioning", "else", "if", "(", "clientRect", ".", "height", ">", "this", ".", "longPopup", ")", "{", "if", "(", "this", ".", "applyHorizontalPositioning", "(", ")", ")", "{", "return", ";", "}", "}", "//Rule 4 - Favor top or bottom positioning", "if", "(", "this", ".", "applyVerticalPositioning", "(", ")", ")", "{", "return", ";", "}", "//but if thats not possible try horizontal", "else", "if", "(", "this", ".", "applyHorizontalPositioning", "(", ")", ")", "{", "return", ";", "}", "//Rule 5 - no specific logic below for this rule since it is built into the vertical position functions, ie we attempt to", "// use a bottom position for the popup as much possible.", "}", "}" ]
Adjusts the popup position + nub location & direction. ContextualPopup positioning rules: 1. Activator Location: 1. If activator is located in a corner then position using a flush style. 1. Attempt vertical first. 2. Horizontal if vertical doesn't fit. 2. If not in a corner then check if the activator is located in one of the 4 "edges" of the view & position the following way if so: 1. Activator is in top edge, position popup below it. 2. Activator is in bottom edge, position popup above it. 3. Activator is in left edge, position popup to the right of it. 4. Activator is in right edge, position popup to the left of it. 2. Screen Size - the popup should generally extend in the direction where there’s room for it. Note: no specific logic below for this rule since it is built into the positioning functions, ie we attempt to never position a popup where there isn't enough room for it. 3. Popup Size: 1. If popup content is wide, use top or bottom positioning. 2. If popup content is long, use horizontal positioning. 4. Favor top or bottom: If all the above rules have been followed and location can still vary then favor top or bottom positioning. 5. If top or bottom will work, favor bottom. Note: There is no specific logic below for this rule since it is built into the vertical position functions, i.e., we attempt to use a bottom position for the popup as much as possible. Additionally, within the vertical position function, we center the popup if the activator is at the vertical center of the view. @private
[ "Adjusts", "the", "popup", "position", "+", "nub", "location", "&", "direction", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/ContextualPopup/ContextualPopup.js#L413-L482
42,124
enyojs/onyx
src/ContextualPopup/ContextualPopup.js
function () { this.resetPositioning(); this.addClass('vertical'); var clientRect = this.getBoundingRect(this.node); var innerHeight = this.getViewHeight(); if (this.floating){ if (this.activatorOffset.top < (innerHeight / 2)) { this.applyPosition({top: this.activatorOffset.top + this.activatorOffset.height, bottom: 'auto'}); this.addClass('below'); } else { this.applyPosition({top: this.activatorOffset.top - clientRect.height, bottom: 'auto'}); this.addClass('above'); } } else { //if the popup's bottom goes off the screen then put it on the top of the invoking control if ((clientRect.top + clientRect.height > innerHeight) && ((innerHeight - clientRect.bottom) < (clientRect.top - clientRect.height))){ this.addClass('above'); } else { this.addClass('below'); } } //if moving the popup above or below the activator puts it past the edge of the screen then vertical doesn't work clientRect = this.getBoundingRect(this.node); if ((clientRect.top + clientRect.height) > innerHeight || clientRect.top < 0){ return false; } return true; }
javascript
function () { this.resetPositioning(); this.addClass('vertical'); var clientRect = this.getBoundingRect(this.node); var innerHeight = this.getViewHeight(); if (this.floating){ if (this.activatorOffset.top < (innerHeight / 2)) { this.applyPosition({top: this.activatorOffset.top + this.activatorOffset.height, bottom: 'auto'}); this.addClass('below'); } else { this.applyPosition({top: this.activatorOffset.top - clientRect.height, bottom: 'auto'}); this.addClass('above'); } } else { //if the popup's bottom goes off the screen then put it on the top of the invoking control if ((clientRect.top + clientRect.height > innerHeight) && ((innerHeight - clientRect.bottom) < (clientRect.top - clientRect.height))){ this.addClass('above'); } else { this.addClass('below'); } } //if moving the popup above or below the activator puts it past the edge of the screen then vertical doesn't work clientRect = this.getBoundingRect(this.node); if ((clientRect.top + clientRect.height) > innerHeight || clientRect.top < 0){ return false; } return true; }
[ "function", "(", ")", "{", "this", ".", "resetPositioning", "(", ")", ";", "this", ".", "addClass", "(", "'vertical'", ")", ";", "var", "clientRect", "=", "this", ".", "getBoundingRect", "(", "this", ".", "node", ")", ";", "var", "innerHeight", "=", "this", ".", "getViewHeight", "(", ")", ";", "if", "(", "this", ".", "floating", ")", "{", "if", "(", "this", ".", "activatorOffset", ".", "top", "<", "(", "innerHeight", "/", "2", ")", ")", "{", "this", ".", "applyPosition", "(", "{", "top", ":", "this", ".", "activatorOffset", ".", "top", "+", "this", ".", "activatorOffset", ".", "height", ",", "bottom", ":", "'auto'", "}", ")", ";", "this", ".", "addClass", "(", "'below'", ")", ";", "}", "else", "{", "this", ".", "applyPosition", "(", "{", "top", ":", "this", ".", "activatorOffset", ".", "top", "-", "clientRect", ".", "height", ",", "bottom", ":", "'auto'", "}", ")", ";", "this", ".", "addClass", "(", "'above'", ")", ";", "}", "}", "else", "{", "//if the popup's bottom goes off the screen then put it on the top of the invoking control", "if", "(", "(", "clientRect", ".", "top", "+", "clientRect", ".", "height", ">", "innerHeight", ")", "&&", "(", "(", "innerHeight", "-", "clientRect", ".", "bottom", ")", "<", "(", "clientRect", ".", "top", "-", "clientRect", ".", "height", ")", ")", ")", "{", "this", ".", "addClass", "(", "'above'", ")", ";", "}", "else", "{", "this", ".", "addClass", "(", "'below'", ")", ";", "}", "}", "//if moving the popup above or below the activator puts it past the edge of the screen then vertical doesn't work", "clientRect", "=", "this", ".", "getBoundingRect", "(", "this", ".", "node", ")", ";", "if", "(", "(", "clientRect", ".", "top", "+", "clientRect", ".", "height", ")", ">", "innerHeight", "||", "clientRect", ".", "top", "<", "0", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}" ]
Moves the popup below or above the activator and verifies that it fits onscreen. @return {Boolean} `true` if vertical positioning can be used; otherwise, `false`. @private
[ "Moves", "the", "popup", "below", "or", "above", "the", "activator", "and", "verifies", "that", "it", "fits", "onscreen", "." ]
919ea0da6f05296aa5ca0b5f45f0b439ac4a906a
https://github.com/enyojs/onyx/blob/919ea0da6f05296aa5ca0b5f45f0b439ac4a906a/src/ContextualPopup/ContextualPopup.js#L490-L521
42,125
takuhii/PhantomJS-25_Beta
install.js
tryPhantomjsInLib
function tryPhantomjsInLib() { return Q.fcall(function () { return findValidPhantomJsBinary(path.resolve(__dirname, './lib/location.js')) }).then(function (binaryLocation) { if (binaryLocation) { console.log('PhantomJS is previously installed at', binaryLocation) exit(0) } }).fail(function () { // silently swallow any errors }) }
javascript
function tryPhantomjsInLib() { return Q.fcall(function () { return findValidPhantomJsBinary(path.resolve(__dirname, './lib/location.js')) }).then(function (binaryLocation) { if (binaryLocation) { console.log('PhantomJS is previously installed at', binaryLocation) exit(0) } }).fail(function () { // silently swallow any errors }) }
[ "function", "tryPhantomjsInLib", "(", ")", "{", "return", "Q", ".", "fcall", "(", "function", "(", ")", "{", "return", "findValidPhantomJsBinary", "(", "path", ".", "resolve", "(", "__dirname", ",", "'./lib/location.js'", ")", ")", "}", ")", ".", "then", "(", "function", "(", "binaryLocation", ")", "{", "if", "(", "binaryLocation", ")", "{", "console", ".", "log", "(", "'PhantomJS is previously installed at'", ",", "binaryLocation", ")", "exit", "(", "0", ")", "}", "}", ")", ".", "fail", "(", "function", "(", ")", "{", "// silently swallow any errors", "}", ")", "}" ]
Check to see if the binary in lib is OK to use. If successful, exit the process.
[ "Check", "to", "see", "if", "the", "binary", "in", "lib", "is", "OK", "to", "use", ".", "If", "successful", "exit", "the", "process", "." ]
5629951fa99aa54fd0b52102679a254108c3e182
https://github.com/takuhii/PhantomJS-25_Beta/blob/5629951fa99aa54fd0b52102679a254108c3e182/install.js#L314-L325
42,126
takuhii/PhantomJS-25_Beta
install.js
tryPhantomjsOnPath
function tryPhantomjsOnPath() { if (getTargetPlatform() != process.platform || getTargetArch() != process.arch) { console.log('Building for target platform ' + getTargetPlatform() + '/' + getTargetArch() + '. Skipping PATH search') return Q.resolve(false) } return Q.nfcall(which, 'phantomjs') .then(function (result) { phantomPath = result console.log('Considering PhantomJS found at', phantomPath) // Horrible hack to avoid problems during global install. We check to see if // the file `which` found is our own bin script. if (phantomPath.indexOf(path.join('npm', 'phantomjs')) !== -1) { console.log('Looks like an `npm install -g` on windows; skipping installed version.') return } var contents = fs.readFileSync(phantomPath, 'utf8') if (/NPM_INSTALL_MARKER/.test(contents)) { console.log('Looks like an `npm install -g`') var phantomLibPath = path.resolve(fs.realpathSync(phantomPath), '../../lib/location') return findValidPhantomJsBinary(phantomLibPath) .then(function (binaryLocation) { if (binaryLocation) { writeLocationFile(binaryLocation) console.log('PhantomJS linked at', phantomLibPath) exit(0) } console.log('Could not link global install, skipping...') }) } else { return checkPhantomjsVersion(phantomPath).then(function (matches) { if (matches) { writeLocationFile(phantomPath) console.log('PhantomJS is already installed on PATH at', phantomPath) exit(0) } }) } }, function () { console.log('PhantomJS not found on PATH') }) .fail(function (err) { console.error('Error checking path, continuing', err) return false }) }
javascript
function tryPhantomjsOnPath() { if (getTargetPlatform() != process.platform || getTargetArch() != process.arch) { console.log('Building for target platform ' + getTargetPlatform() + '/' + getTargetArch() + '. Skipping PATH search') return Q.resolve(false) } return Q.nfcall(which, 'phantomjs') .then(function (result) { phantomPath = result console.log('Considering PhantomJS found at', phantomPath) // Horrible hack to avoid problems during global install. We check to see if // the file `which` found is our own bin script. if (phantomPath.indexOf(path.join('npm', 'phantomjs')) !== -1) { console.log('Looks like an `npm install -g` on windows; skipping installed version.') return } var contents = fs.readFileSync(phantomPath, 'utf8') if (/NPM_INSTALL_MARKER/.test(contents)) { console.log('Looks like an `npm install -g`') var phantomLibPath = path.resolve(fs.realpathSync(phantomPath), '../../lib/location') return findValidPhantomJsBinary(phantomLibPath) .then(function (binaryLocation) { if (binaryLocation) { writeLocationFile(binaryLocation) console.log('PhantomJS linked at', phantomLibPath) exit(0) } console.log('Could not link global install, skipping...') }) } else { return checkPhantomjsVersion(phantomPath).then(function (matches) { if (matches) { writeLocationFile(phantomPath) console.log('PhantomJS is already installed on PATH at', phantomPath) exit(0) } }) } }, function () { console.log('PhantomJS not found on PATH') }) .fail(function (err) { console.error('Error checking path, continuing', err) return false }) }
[ "function", "tryPhantomjsOnPath", "(", ")", "{", "if", "(", "getTargetPlatform", "(", ")", "!=", "process", ".", "platform", "||", "getTargetArch", "(", ")", "!=", "process", ".", "arch", ")", "{", "console", ".", "log", "(", "'Building for target platform '", "+", "getTargetPlatform", "(", ")", "+", "'/'", "+", "getTargetArch", "(", ")", "+", "'. Skipping PATH search'", ")", "return", "Q", ".", "resolve", "(", "false", ")", "}", "return", "Q", ".", "nfcall", "(", "which", ",", "'phantomjs'", ")", ".", "then", "(", "function", "(", "result", ")", "{", "phantomPath", "=", "result", "console", ".", "log", "(", "'Considering PhantomJS found at'", ",", "phantomPath", ")", "// Horrible hack to avoid problems during global install. We check to see if", "// the file `which` found is our own bin script.", "if", "(", "phantomPath", ".", "indexOf", "(", "path", ".", "join", "(", "'npm'", ",", "'phantomjs'", ")", ")", "!==", "-", "1", ")", "{", "console", ".", "log", "(", "'Looks like an `npm install -g` on windows; skipping installed version.'", ")", "return", "}", "var", "contents", "=", "fs", ".", "readFileSync", "(", "phantomPath", ",", "'utf8'", ")", "if", "(", "/", "NPM_INSTALL_MARKER", "/", ".", "test", "(", "contents", ")", ")", "{", "console", ".", "log", "(", "'Looks like an `npm install -g`'", ")", "var", "phantomLibPath", "=", "path", ".", "resolve", "(", "fs", ".", "realpathSync", "(", "phantomPath", ")", ",", "'../../lib/location'", ")", "return", "findValidPhantomJsBinary", "(", "phantomLibPath", ")", ".", "then", "(", "function", "(", "binaryLocation", ")", "{", "if", "(", "binaryLocation", ")", "{", "writeLocationFile", "(", "binaryLocation", ")", "console", ".", "log", "(", "'PhantomJS linked at'", ",", "phantomLibPath", ")", "exit", "(", "0", ")", "}", "console", ".", "log", "(", "'Could not link global install, skipping...'", ")", "}", ")", "}", "else", "{", "return", "checkPhantomjsVersion", "(", "phantomPath", ")", ".", "then", "(", "function", "(", "matches", ")", "{", "if", "(", "matches", ")", "{", "writeLocationFile", "(", "phantomPath", ")", "console", ".", "log", "(", "'PhantomJS is already installed on PATH at'", ",", "phantomPath", ")", "exit", "(", "0", ")", "}", "}", ")", "}", "}", ",", "function", "(", ")", "{", "console", ".", "log", "(", "'PhantomJS not found on PATH'", ")", "}", ")", ".", "fail", "(", "function", "(", "err", ")", "{", "console", ".", "error", "(", "'Error checking path, continuing'", ",", "err", ")", "return", "false", "}", ")", "}" ]
Check to see if the binary on PATH is OK to use. If successful, exit the process.
[ "Check", "to", "see", "if", "the", "binary", "on", "PATH", "is", "OK", "to", "use", ".", "If", "successful", "exit", "the", "process", "." ]
5629951fa99aa54fd0b52102679a254108c3e182
https://github.com/takuhii/PhantomJS-25_Beta/blob/5629951fa99aa54fd0b52102679a254108c3e182/install.js#L330-L379
42,127
takuhii/PhantomJS-25_Beta
install.js
downloadPhantomjs
function downloadPhantomjs() { var downloadSpec = getDownloadSpec() if (!downloadSpec) { console.error( 'Unexpected platform or architecture: ' + getTargetPlatform() + '/' + getTargetArch() + '\n' + 'It seems there is no binary available for your platform/architecture\n' + 'Try to install PhantomJS globally') exit(1) } var downloadUrl = downloadSpec.url var downloadedFile return Q.fcall(function () { // Can't use a global version so start a download. var tmpPath = findSuitableTempDirectory() var fileName = downloadUrl.split('/').pop() downloadedFile = path.join(tmpPath, fileName) if (fs.existsSync(downloadedFile)) { console.log('Download already available at', downloadedFile) return verifyChecksum(downloadedFile, downloadSpec.checksum) } return false }).then(function (verified) { if (verified) { return downloadedFile } // Start the install. console.log('Downloading', downloadUrl) console.log('Saving to', downloadedFile) return requestBinary(getRequestOptions(), downloadedFile) }) }
javascript
function downloadPhantomjs() { var downloadSpec = getDownloadSpec() if (!downloadSpec) { console.error( 'Unexpected platform or architecture: ' + getTargetPlatform() + '/' + getTargetArch() + '\n' + 'It seems there is no binary available for your platform/architecture\n' + 'Try to install PhantomJS globally') exit(1) } var downloadUrl = downloadSpec.url var downloadedFile return Q.fcall(function () { // Can't use a global version so start a download. var tmpPath = findSuitableTempDirectory() var fileName = downloadUrl.split('/').pop() downloadedFile = path.join(tmpPath, fileName) if (fs.existsSync(downloadedFile)) { console.log('Download already available at', downloadedFile) return verifyChecksum(downloadedFile, downloadSpec.checksum) } return false }).then(function (verified) { if (verified) { return downloadedFile } // Start the install. console.log('Downloading', downloadUrl) console.log('Saving to', downloadedFile) return requestBinary(getRequestOptions(), downloadedFile) }) }
[ "function", "downloadPhantomjs", "(", ")", "{", "var", "downloadSpec", "=", "getDownloadSpec", "(", ")", "if", "(", "!", "downloadSpec", ")", "{", "console", ".", "error", "(", "'Unexpected platform or architecture: '", "+", "getTargetPlatform", "(", ")", "+", "'/'", "+", "getTargetArch", "(", ")", "+", "'\\n'", "+", "'It seems there is no binary available for your platform/architecture\\n'", "+", "'Try to install PhantomJS globally'", ")", "exit", "(", "1", ")", "}", "var", "downloadUrl", "=", "downloadSpec", ".", "url", "var", "downloadedFile", "return", "Q", ".", "fcall", "(", "function", "(", ")", "{", "// Can't use a global version so start a download.", "var", "tmpPath", "=", "findSuitableTempDirectory", "(", ")", "var", "fileName", "=", "downloadUrl", ".", "split", "(", "'/'", ")", ".", "pop", "(", ")", "downloadedFile", "=", "path", ".", "join", "(", "tmpPath", ",", "fileName", ")", "if", "(", "fs", ".", "existsSync", "(", "downloadedFile", ")", ")", "{", "console", ".", "log", "(", "'Download already available at'", ",", "downloadedFile", ")", "return", "verifyChecksum", "(", "downloadedFile", ",", "downloadSpec", ".", "checksum", ")", "}", "return", "false", "}", ")", ".", "then", "(", "function", "(", "verified", ")", "{", "if", "(", "verified", ")", "{", "return", "downloadedFile", "}", "// Start the install.", "console", ".", "log", "(", "'Downloading'", ",", "downloadUrl", ")", "console", ".", "log", "(", "'Saving to'", ",", "downloadedFile", ")", "return", "requestBinary", "(", "getRequestOptions", "(", ")", ",", "downloadedFile", ")", "}", ")", "}" ]
Download phantomjs, reusing the existing copy on disk if available. Exits immediately if there is no binary to download. @return {Promise.<string>} The path to the downloaded file.
[ "Download", "phantomjs", "reusing", "the", "existing", "copy", "on", "disk", "if", "available", ".", "Exits", "immediately", "if", "there", "is", "no", "binary", "to", "download", "." ]
5629951fa99aa54fd0b52102679a254108c3e182
https://github.com/takuhii/PhantomJS-25_Beta/blob/5629951fa99aa54fd0b52102679a254108c3e182/install.js#L395-L429
42,128
neyric/webhookit
public/javascripts/yui/uploader/uploader.js
function() { //kill the Flash Player instance if(this._swf) { var container = YAHOO.util.Dom.get(this._containerID); container.removeChild(this._swf); } var instanceName = this._id; //null out properties for(var prop in this) { if(YAHOO.lang.hasOwnProperty(this, prop)) { this[prop] = null; } } }
javascript
function() { //kill the Flash Player instance if(this._swf) { var container = YAHOO.util.Dom.get(this._containerID); container.removeChild(this._swf); } var instanceName = this._id; //null out properties for(var prop in this) { if(YAHOO.lang.hasOwnProperty(this, prop)) { this[prop] = null; } } }
[ "function", "(", ")", "{", "//kill the Flash Player instance", "if", "(", "this", ".", "_swf", ")", "{", "var", "container", "=", "YAHOO", ".", "util", ".", "Dom", ".", "get", "(", "this", ".", "_containerID", ")", ";", "container", ".", "removeChild", "(", "this", ".", "_swf", ")", ";", "}", "var", "instanceName", "=", "this", ".", "_id", ";", "//null out properties", "for", "(", "var", "prop", "in", "this", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "hasOwnProperty", "(", "this", ",", "prop", ")", ")", "{", "this", "[", "prop", "]", "=", "null", ";", "}", "}", "}" ]
Nulls out the entire FlashAdapter instance and related objects and removes attached event listeners and clears out DOM elements inside the container. After calling this method, the instance reference should be expliclitly nulled by implementer, as in myChart = null. Use with caution! @method destroy
[ "Nulls", "out", "the", "entire", "FlashAdapter", "instance", "and", "related", "objects", "and", "removes", "attached", "event", "listeners", "and", "clears", "out", "DOM", "elements", "inside", "the", "container", ".", "After", "calling", "this", "method", "the", "instance", "reference", "should", "be", "expliclitly", "nulled", "by", "implementer", "as", "in", "myChart", "=", "null", ".", "Use", "with", "caution!" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/uploader/uploader.js#L457-L477
42,129
neyric/webhookit
public/javascripts/yui/uploader/uploader.js
function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode, buttonSkin) { //standard SWFObject embed var swfObj = new YAHOO.deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor); if(expressInstall) { swfObj.useExpressInstall(expressInstall); } //make sure we can communicate with ExternalInterface swfObj.addParam("allowScriptAccess", "always"); if(wmode) { swfObj.addParam("wmode", wmode); } swfObj.addParam("menu", "false"); //again, a useful ExternalInterface trick swfObj.addVariable("allowedDomain", document.location.hostname); //tell the SWF which HTML element it is in swfObj.addVariable("YUISwfId", swfID); // set the name of the function to call when the swf has an event swfObj.addVariable("YUIBridgeCallback", "YAHOO.widget.FlashAdapter.eventHandler"); if (buttonSkin) { swfObj.addVariable("buttonSkin", buttonSkin); } var container = YAHOO.util.Dom.get(containerID); var result = swfObj.write(container); if(result) { this._swf = YAHOO.util.Dom.get(swfID); YAHOO.widget.FlashAdapter.owners[swfID] = this; } else { } }
javascript
function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode, buttonSkin) { //standard SWFObject embed var swfObj = new YAHOO.deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor); if(expressInstall) { swfObj.useExpressInstall(expressInstall); } //make sure we can communicate with ExternalInterface swfObj.addParam("allowScriptAccess", "always"); if(wmode) { swfObj.addParam("wmode", wmode); } swfObj.addParam("menu", "false"); //again, a useful ExternalInterface trick swfObj.addVariable("allowedDomain", document.location.hostname); //tell the SWF which HTML element it is in swfObj.addVariable("YUISwfId", swfID); // set the name of the function to call when the swf has an event swfObj.addVariable("YUIBridgeCallback", "YAHOO.widget.FlashAdapter.eventHandler"); if (buttonSkin) { swfObj.addVariable("buttonSkin", buttonSkin); } var container = YAHOO.util.Dom.get(containerID); var result = swfObj.write(container); if(result) { this._swf = YAHOO.util.Dom.get(swfID); YAHOO.widget.FlashAdapter.owners[swfID] = this; } else { } }
[ "function", "(", "swfURL", ",", "containerID", ",", "swfID", ",", "version", ",", "backgroundColor", ",", "expressInstall", ",", "wmode", ",", "buttonSkin", ")", "{", "//standard SWFObject embed", "var", "swfObj", "=", "new", "YAHOO", ".", "deconcept", ".", "SWFObject", "(", "swfURL", ",", "swfID", ",", "\"100%\"", ",", "\"100%\"", ",", "version", ",", "backgroundColor", ")", ";", "if", "(", "expressInstall", ")", "{", "swfObj", ".", "useExpressInstall", "(", "expressInstall", ")", ";", "}", "//make sure we can communicate with ExternalInterface", "swfObj", ".", "addParam", "(", "\"allowScriptAccess\"", ",", "\"always\"", ")", ";", "if", "(", "wmode", ")", "{", "swfObj", ".", "addParam", "(", "\"wmode\"", ",", "wmode", ")", ";", "}", "swfObj", ".", "addParam", "(", "\"menu\"", ",", "\"false\"", ")", ";", "//again, a useful ExternalInterface trick", "swfObj", ".", "addVariable", "(", "\"allowedDomain\"", ",", "document", ".", "location", ".", "hostname", ")", ";", "//tell the SWF which HTML element it is in", "swfObj", ".", "addVariable", "(", "\"YUISwfId\"", ",", "swfID", ")", ";", "// set the name of the function to call when the swf has an event", "swfObj", ".", "addVariable", "(", "\"YUIBridgeCallback\"", ",", "\"YAHOO.widget.FlashAdapter.eventHandler\"", ")", ";", "if", "(", "buttonSkin", ")", "{", "swfObj", ".", "addVariable", "(", "\"buttonSkin\"", ",", "buttonSkin", ")", ";", "}", "var", "container", "=", "YAHOO", ".", "util", ".", "Dom", ".", "get", "(", "containerID", ")", ";", "var", "result", "=", "swfObj", ".", "write", "(", "container", ")", ";", "if", "(", "result", ")", "{", "this", ".", "_swf", "=", "YAHOO", ".", "util", ".", "Dom", ".", "get", "(", "swfID", ")", ";", "YAHOO", ".", "widget", ".", "FlashAdapter", ".", "owners", "[", "swfID", "]", "=", "this", ";", "}", "else", "{", "}", "}" ]
Embeds the SWF in the page and associates it with this instance. @method _embedSWF @private
[ "Embeds", "the", "SWF", "in", "the", "page", "and", "associates", "it", "with", "this", "instance", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/uploader/uploader.js#L485-L526
42,130
neyric/webhookit
public/javascripts/yui/uploader/uploader.js
function() { this._initialized = false; this._initAttributes(this._attributes); this.setAttributes(this._attributes, true); this._initialized = true; this.fireEvent("contentReady"); }
javascript
function() { this._initialized = false; this._initAttributes(this._attributes); this.setAttributes(this._attributes, true); this._initialized = true; this.fireEvent("contentReady"); }
[ "function", "(", ")", "{", "this", ".", "_initialized", "=", "false", ";", "this", ".", "_initAttributes", "(", "this", ".", "_attributes", ")", ";", "this", ".", "setAttributes", "(", "this", ".", "_attributes", ",", "true", ")", ";", "this", ".", "_initialized", "=", "true", ";", "this", ".", "fireEvent", "(", "\"contentReady\"", ")", ";", "}" ]
Called when the SWF has been initialized. @method _loadHandler @private
[ "Called", "when", "the", "SWF", "has", "been", "initialized", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/uploader/uploader.js#L557-L565
42,131
neyric/webhookit
public/javascripts/yui/uploader/uploader.js
function(fileID, uploadScriptPath, method, vars, fieldName) { this._swf.upload(fileID, uploadScriptPath, method, vars, fieldName); }
javascript
function(fileID, uploadScriptPath, method, vars, fieldName) { this._swf.upload(fileID, uploadScriptPath, method, vars, fieldName); }
[ "function", "(", "fileID", ",", "uploadScriptPath", ",", "method", ",", "vars", ",", "fieldName", ")", "{", "this", ".", "_swf", ".", "upload", "(", "fileID", ",", "uploadScriptPath", ",", "method", ",", "vars", ",", "fieldName", ")", ";", "}" ]
Starts the upload of the file specified by fileID to the location specified by uploadScriptPath. @param fileID {String} The id of the file to start uploading. @param uploadScriptPath {String} The URL of the upload location. @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default. @param vars {Object} The object containing variables to be sent in the same request as the file upload. @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default. </code>
[ "Starts", "the", "upload", "of", "the", "file", "specified", "by", "fileID", "to", "the", "location", "specified", "by", "uploadScriptPath", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/uploader/uploader.js#L937-L940
42,132
neyric/webhookit
public/javascripts/yui/uploader/uploader.js
function(fileIDs, uploadScriptPath, method, vars, fieldName) { this._swf.uploadThese(fileIDs, uploadScriptPath, method, vars, fieldName); }
javascript
function(fileIDs, uploadScriptPath, method, vars, fieldName) { this._swf.uploadThese(fileIDs, uploadScriptPath, method, vars, fieldName); }
[ "function", "(", "fileIDs", ",", "uploadScriptPath", ",", "method", ",", "vars", ",", "fieldName", ")", "{", "this", ".", "_swf", ".", "uploadThese", "(", "fileIDs", ",", "uploadScriptPath", ",", "method", ",", "vars", ",", "fieldName", ")", ";", "}" ]
Starts the upload of the files specified by fileIDs, or adds them to a currently running queue. The upload queue is automatically managed. @param fileIDs {Array} The ids of the files to start uploading. @param uploadScriptPath {String} The URL of the upload location. @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default. @param vars {Object} The object containing variables to be sent in the same request as the file upload. @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default. </code>
[ "Starts", "the", "upload", "of", "the", "files", "specified", "by", "fileIDs", "or", "adds", "them", "to", "a", "currently", "running", "queue", ".", "The", "upload", "queue", "is", "automatically", "managed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/uploader/uploader.js#L952-L955
42,133
neyric/webhookit
public/javascripts/yui/uploader/uploader.js
function(uploadScriptPath, method, vars, fieldName) { this._swf.uploadAll(uploadScriptPath, method, vars, fieldName); }
javascript
function(uploadScriptPath, method, vars, fieldName) { this._swf.uploadAll(uploadScriptPath, method, vars, fieldName); }
[ "function", "(", "uploadScriptPath", ",", "method", ",", "vars", ",", "fieldName", ")", "{", "this", ".", "_swf", ".", "uploadAll", "(", "uploadScriptPath", ",", "method", ",", "vars", ",", "fieldName", ")", ";", "}" ]
Starts uploading all files in the queue. If this function is called, the upload queue is automatically managed. @param uploadScriptPath {String} The URL of the upload location. @param method {String} Either "GET" or "POST", specifying how the variables accompanying the file upload POST request should be submitted. "GET" by default. @param vars {Object} The object containing variables to be sent in the same request as the file upload. @param fieldName {String} The name of the variable in the POST request containing the file data. "Filedata" by default. </code>
[ "Starts", "uploading", "all", "files", "in", "the", "queue", ".", "If", "this", "function", "is", "called", "the", "upload", "queue", "is", "automatically", "managed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/uploader/uploader.js#L966-L969
42,134
neyric/webhookit
public/javascripts/webhookit/editor/wiring_editor.js
function() { var value = this.getValue(); if(value.name === "") { this.alert("Please choose a name"); return; } this.tempSavedWiring = {name: value.name, working: value.working, language: this.options.languageName }; this.adapter.saveWiring(this.tempSavedWiring, { success: this.saveModuleSuccess, failure: this.saveModuleFailure, scope: this }); }
javascript
function() { var value = this.getValue(); if(value.name === "") { this.alert("Please choose a name"); return; } this.tempSavedWiring = {name: value.name, working: value.working, language: this.options.languageName }; this.adapter.saveWiring(this.tempSavedWiring, { success: this.saveModuleSuccess, failure: this.saveModuleFailure, scope: this }); }
[ "function", "(", ")", "{", "var", "value", "=", "this", ".", "getValue", "(", ")", ";", "if", "(", "value", ".", "name", "===", "\"\"", ")", "{", "this", ".", "alert", "(", "\"Please choose a name\"", ")", ";", "return", ";", "}", "this", ".", "tempSavedWiring", "=", "{", "name", ":", "value", ".", "name", ",", "working", ":", "value", ".", "working", ",", "language", ":", "this", ".", "options", ".", "languageName", "}", ";", "this", ".", "adapter", ".", "saveWiring", "(", "this", ".", "tempSavedWiring", ",", "{", "success", ":", "this", ".", "saveModuleSuccess", ",", "failure", ":", "this", ".", "saveModuleFailure", ",", "scope", ":", "this", "}", ")", ";", "}" ]
save the current module @method saveModule
[ "save", "the", "current", "module" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/webhookit/editor/wiring_editor.js#L19-L35
42,135
neyric/webhookit
public/javascripts/webhookit/editor/wiring_editor.js
function() { webhookit.WiringEditor.superclass.renderButtons.call(this); var toolbar = YAHOO.util.Dom.get('toolbar'); var editTemplateButton = new YAHOO.widget.Button({ label:"Edit template", id:"WiringEditor-templateButton", container: toolbar }); editTemplateButton.on("click", webhookit.editTemplateButton, webhookit, true); // "Run" button var runButton = new YAHOO.widget.Button({ label:"Run", id:"WiringEditor-runButton", container: toolbar }); runButton.on("click", webhookit.run, webhookit, true); }
javascript
function() { webhookit.WiringEditor.superclass.renderButtons.call(this); var toolbar = YAHOO.util.Dom.get('toolbar'); var editTemplateButton = new YAHOO.widget.Button({ label:"Edit template", id:"WiringEditor-templateButton", container: toolbar }); editTemplateButton.on("click", webhookit.editTemplateButton, webhookit, true); // "Run" button var runButton = new YAHOO.widget.Button({ label:"Run", id:"WiringEditor-runButton", container: toolbar }); runButton.on("click", webhookit.run, webhookit, true); }
[ "function", "(", ")", "{", "webhookit", ".", "WiringEditor", ".", "superclass", ".", "renderButtons", ".", "call", "(", "this", ")", ";", "var", "toolbar", "=", "YAHOO", ".", "util", ".", "Dom", ".", "get", "(", "'toolbar'", ")", ";", "var", "editTemplateButton", "=", "new", "YAHOO", ".", "widget", ".", "Button", "(", "{", "label", ":", "\"Edit template\"", ",", "id", ":", "\"WiringEditor-templateButton\"", ",", "container", ":", "toolbar", "}", ")", ";", "editTemplateButton", ".", "on", "(", "\"click\"", ",", "webhookit", ".", "editTemplateButton", ",", "webhookit", ",", "true", ")", ";", "// \"Run\" button", "var", "runButton", "=", "new", "YAHOO", ".", "widget", ".", "Button", "(", "{", "label", ":", "\"Run\"", ",", "id", ":", "\"WiringEditor-runButton\"", ",", "container", ":", "toolbar", "}", ")", ";", "runButton", ".", "on", "(", "\"click\"", ",", "webhookit", ".", "run", ",", "webhookit", ",", "true", ")", ";", "}" ]
Add Some buttons
[ "Add", "Some", "buttons" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/webhookit/editor/wiring_editor.js#L55-L68
42,136
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(method, formOpts, callback) { var options = null; if(YAHOO.lang.isObject(formOpts) && YAHOO.lang.isArray(formOpts.fields) ) { options = formOpts; } // create the form directly from the method params else { options = inputEx.RPC.formForMethod(method); // Add user options from formOpts YAHOO.lang.augmentObject(options, formOpts, true); } // Add buttons to launch the service options.type = "form"; if(!options.buttons) { options.buttons = [ {type: 'submit', value: method.name, onClick: function(e) { YAHOO.util.Event.stopEvent(e); form.showMask(); method(form.getValue(), { success: function(results) { form.hideMask(); if(YAHOO.lang.isObject(callback) && YAHOO.lang.isFunction(callback.success)) { callback.success.call(callback.scope || this, results); } }, failure: function() { form.hideMask(); } }); return false; // do NOT send the browser submit event }} ]; } var form = inputEx(options); return form; }
javascript
function(method, formOpts, callback) { var options = null; if(YAHOO.lang.isObject(formOpts) && YAHOO.lang.isArray(formOpts.fields) ) { options = formOpts; } // create the form directly from the method params else { options = inputEx.RPC.formForMethod(method); // Add user options from formOpts YAHOO.lang.augmentObject(options, formOpts, true); } // Add buttons to launch the service options.type = "form"; if(!options.buttons) { options.buttons = [ {type: 'submit', value: method.name, onClick: function(e) { YAHOO.util.Event.stopEvent(e); form.showMask(); method(form.getValue(), { success: function(results) { form.hideMask(); if(YAHOO.lang.isObject(callback) && YAHOO.lang.isFunction(callback.success)) { callback.success.call(callback.scope || this, results); } }, failure: function() { form.hideMask(); } }); return false; // do NOT send the browser submit event }} ]; } var form = inputEx(options); return form; }
[ "function", "(", "method", ",", "formOpts", ",", "callback", ")", "{", "var", "options", "=", "null", ";", "if", "(", "YAHOO", ".", "lang", ".", "isObject", "(", "formOpts", ")", "&&", "YAHOO", ".", "lang", ".", "isArray", "(", "formOpts", ".", "fields", ")", ")", "{", "options", "=", "formOpts", ";", "}", "// create the form directly from the method params", "else", "{", "options", "=", "inputEx", ".", "RPC", ".", "formForMethod", "(", "method", ")", ";", "// Add user options from formOpts", "YAHOO", ".", "lang", ".", "augmentObject", "(", "options", ",", "formOpts", ",", "true", ")", ";", "}", "// Add buttons to launch the service", "options", ".", "type", "=", "\"form\"", ";", "if", "(", "!", "options", ".", "buttons", ")", "{", "options", ".", "buttons", "=", "[", "{", "type", ":", "'submit'", ",", "value", ":", "method", ".", "name", ",", "onClick", ":", "function", "(", "e", ")", "{", "YAHOO", ".", "util", ".", "Event", ".", "stopEvent", "(", "e", ")", ";", "form", ".", "showMask", "(", ")", ";", "method", "(", "form", ".", "getValue", "(", ")", ",", "{", "success", ":", "function", "(", "results", ")", "{", "form", ".", "hideMask", "(", ")", ";", "if", "(", "YAHOO", ".", "lang", ".", "isObject", "(", "callback", ")", "&&", "YAHOO", ".", "lang", ".", "isFunction", "(", "callback", ".", "success", ")", ")", "{", "callback", ".", "success", ".", "call", "(", "callback", ".", "scope", "||", "this", ",", "results", ")", ";", "}", "}", ",", "failure", ":", "function", "(", ")", "{", "form", ".", "hideMask", "(", ")", ";", "}", "}", ")", ";", "return", "false", ";", "// do NOT send the browser submit event", "}", "}", "]", ";", "}", "var", "form", "=", "inputEx", "(", "options", ")", ";", "return", "form", ";", "}" ]
Build a form to run a service ! @param {function} method A method created through inputEx.RPC.Service @param {Object} formOpts
[ "Build", "a", "form", "to", "run", "a", "service", "!" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L14-L53
42,137
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(method) { // convert the method parameters into a json-schema : var schemaIdentifierMap = {}; schemaIdentifierMap[method.name] = { id: method.name, type:'object', properties:{} }; for(var i = 0 ; i < method._parameters.length ; i++) { var p = method._parameters[i]; schemaIdentifierMap[method.name].properties[p.name] = p; } // Use the builder to build an inputEx form from the json-schema var builder = new inputEx.JsonSchema.Builder({ 'schemaIdentifierMap': schemaIdentifierMap, 'defaultOptions':{ 'showMsg':true } }); var options = builder.schemaToInputEx(schemaIdentifierMap[method.name]); return options; }
javascript
function(method) { // convert the method parameters into a json-schema : var schemaIdentifierMap = {}; schemaIdentifierMap[method.name] = { id: method.name, type:'object', properties:{} }; for(var i = 0 ; i < method._parameters.length ; i++) { var p = method._parameters[i]; schemaIdentifierMap[method.name].properties[p.name] = p; } // Use the builder to build an inputEx form from the json-schema var builder = new inputEx.JsonSchema.Builder({ 'schemaIdentifierMap': schemaIdentifierMap, 'defaultOptions':{ 'showMsg':true } }); var options = builder.schemaToInputEx(schemaIdentifierMap[method.name]); return options; }
[ "function", "(", "method", ")", "{", "// convert the method parameters into a json-schema :", "var", "schemaIdentifierMap", "=", "{", "}", ";", "schemaIdentifierMap", "[", "method", ".", "name", "]", "=", "{", "id", ":", "method", ".", "name", ",", "type", ":", "'object'", ",", "properties", ":", "{", "}", "}", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "method", ".", "_parameters", ".", "length", ";", "i", "++", ")", "{", "var", "p", "=", "method", ".", "_parameters", "[", "i", "]", ";", "schemaIdentifierMap", "[", "method", ".", "name", "]", ".", "properties", "[", "p", ".", "name", "]", "=", "p", ";", "}", "// Use the builder to build an inputEx form from the json-schema", "var", "builder", "=", "new", "inputEx", ".", "JsonSchema", ".", "Builder", "(", "{", "'schemaIdentifierMap'", ":", "schemaIdentifierMap", ",", "'defaultOptions'", ":", "{", "'showMsg'", ":", "true", "}", "}", ")", ";", "var", "options", "=", "builder", ".", "schemaToInputEx", "(", "schemaIdentifierMap", "[", "method", ".", "name", "]", ")", ";", "return", "options", ";", "}" ]
Return the inputEx form options from a method @param {function} method A method created through inputEx.RPC.Service
[ "Return", "the", "inputEx", "form", "options", "from", "a", "method" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L59-L83
42,138
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(serviceName, method) { if(this[method]){ throw new Error("WARNING: "+ serviceName+ " already exists for service. Unable to generate function"); } method.name = serviceName; var self = this; var func = function(data, opts) { var envelope = rpc.Envelope[method.envelope || self._smd.envelope]; var callback = { success: function(o) { var results = envelope.deserialize(o); opts.success.call(opts.scope || self, results); }, failure: function(o) { if(lang.isFunction(opts.failure) ) { var results = envelope.deserialize(o); opts.failure.call(opts.scope || self, results); } }, scope: self }; var params = {}; if(self._smd.additionalParameters && lang.isArray(self._smd.parameters) ) { for(var i = 0 ; i < self._smd.parameters.length ; i++) { var p = self._smd.parameters[i]; params[p.name] = p["default"]; } } lang.augmentObject(params, data, true); var url = method.target || self._smd.target; var urlRegexp = /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/i; if(!url.match(urlRegexp) && url != self._smd.target) { url = self._smd.target+url; } if( !!this.smdUrl && !url.match(urlRegexp) ) { // URL is still relative ! var a=this.smdUrl.split('/'); a[a.length-1]=""; url = a.join("/")+url; } var r = { target: url, callback: callback, data: params, origData: data, opts: opts, callbackParamName: method.callbackParamName || self._smd.callbackParamName, transport: method.transport || self._smd.transport }; var serialized = envelope.serialize(self._smd, method, params); lang.augmentObject(r, serialized, true); rpc.Transport[r.transport].call(self, r ); }; func.name = serviceName; func.description = method.description; func._parameters = method.parameters; return func; }
javascript
function(serviceName, method) { if(this[method]){ throw new Error("WARNING: "+ serviceName+ " already exists for service. Unable to generate function"); } method.name = serviceName; var self = this; var func = function(data, opts) { var envelope = rpc.Envelope[method.envelope || self._smd.envelope]; var callback = { success: function(o) { var results = envelope.deserialize(o); opts.success.call(opts.scope || self, results); }, failure: function(o) { if(lang.isFunction(opts.failure) ) { var results = envelope.deserialize(o); opts.failure.call(opts.scope || self, results); } }, scope: self }; var params = {}; if(self._smd.additionalParameters && lang.isArray(self._smd.parameters) ) { for(var i = 0 ; i < self._smd.parameters.length ; i++) { var p = self._smd.parameters[i]; params[p.name] = p["default"]; } } lang.augmentObject(params, data, true); var url = method.target || self._smd.target; var urlRegexp = /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/i; if(!url.match(urlRegexp) && url != self._smd.target) { url = self._smd.target+url; } if( !!this.smdUrl && !url.match(urlRegexp) ) { // URL is still relative ! var a=this.smdUrl.split('/'); a[a.length-1]=""; url = a.join("/")+url; } var r = { target: url, callback: callback, data: params, origData: data, opts: opts, callbackParamName: method.callbackParamName || self._smd.callbackParamName, transport: method.transport || self._smd.transport }; var serialized = envelope.serialize(self._smd, method, params); lang.augmentObject(r, serialized, true); rpc.Transport[r.transport].call(self, r ); }; func.name = serviceName; func.description = method.description; func._parameters = method.parameters; return func; }
[ "function", "(", "serviceName", ",", "method", ")", "{", "if", "(", "this", "[", "method", "]", ")", "{", "throw", "new", "Error", "(", "\"WARNING: \"", "+", "serviceName", "+", "\" already exists for service. Unable to generate function\"", ")", ";", "}", "method", ".", "name", "=", "serviceName", ";", "var", "self", "=", "this", ";", "var", "func", "=", "function", "(", "data", ",", "opts", ")", "{", "var", "envelope", "=", "rpc", ".", "Envelope", "[", "method", ".", "envelope", "||", "self", ".", "_smd", ".", "envelope", "]", ";", "var", "callback", "=", "{", "success", ":", "function", "(", "o", ")", "{", "var", "results", "=", "envelope", ".", "deserialize", "(", "o", ")", ";", "opts", ".", "success", ".", "call", "(", "opts", ".", "scope", "||", "self", ",", "results", ")", ";", "}", ",", "failure", ":", "function", "(", "o", ")", "{", "if", "(", "lang", ".", "isFunction", "(", "opts", ".", "failure", ")", ")", "{", "var", "results", "=", "envelope", ".", "deserialize", "(", "o", ")", ";", "opts", ".", "failure", ".", "call", "(", "opts", ".", "scope", "||", "self", ",", "results", ")", ";", "}", "}", ",", "scope", ":", "self", "}", ";", "var", "params", "=", "{", "}", ";", "if", "(", "self", ".", "_smd", ".", "additionalParameters", "&&", "lang", ".", "isArray", "(", "self", ".", "_smd", ".", "parameters", ")", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "self", ".", "_smd", ".", "parameters", ".", "length", ";", "i", "++", ")", "{", "var", "p", "=", "self", ".", "_smd", ".", "parameters", "[", "i", "]", ";", "params", "[", "p", ".", "name", "]", "=", "p", "[", "\"default\"", "]", ";", "}", "}", "lang", ".", "augmentObject", "(", "params", ",", "data", ",", "true", ")", ";", "var", "url", "=", "method", ".", "target", "||", "self", ".", "_smd", ".", "target", ";", "var", "urlRegexp", "=", "/", "^(http|https):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(([0-9]{1,5})?\\/.*)?$", "/", "i", ";", "if", "(", "!", "url", ".", "match", "(", "urlRegexp", ")", "&&", "url", "!=", "self", ".", "_smd", ".", "target", ")", "{", "url", "=", "self", ".", "_smd", ".", "target", "+", "url", ";", "}", "if", "(", "!", "!", "this", ".", "smdUrl", "&&", "!", "url", ".", "match", "(", "urlRegexp", ")", ")", "{", "// URL is still relative !", "var", "a", "=", "this", ".", "smdUrl", ".", "split", "(", "'/'", ")", ";", "a", "[", "a", ".", "length", "-", "1", "]", "=", "\"\"", ";", "url", "=", "a", ".", "join", "(", "\"/\"", ")", "+", "url", ";", "}", "var", "r", "=", "{", "target", ":", "url", ",", "callback", ":", "callback", ",", "data", ":", "params", ",", "origData", ":", "data", ",", "opts", ":", "opts", ",", "callbackParamName", ":", "method", ".", "callbackParamName", "||", "self", ".", "_smd", ".", "callbackParamName", ",", "transport", ":", "method", ".", "transport", "||", "self", ".", "_smd", ".", "transport", "}", ";", "var", "serialized", "=", "envelope", ".", "serialize", "(", "self", ".", "_smd", ",", "method", ",", "params", ")", ";", "lang", ".", "augmentObject", "(", "r", ",", "serialized", ",", "true", ")", ";", "rpc", ".", "Transport", "[", "r", ".", "transport", "]", ".", "call", "(", "self", ",", "r", ")", ";", "}", ";", "func", ".", "name", "=", "serviceName", ";", "func", ".", "description", "=", "method", ".", "description", ";", "func", ".", "_parameters", "=", "method", ".", "parameters", ";", "return", "func", ";", "}" ]
Generate the function from a service definition @method _generateService @param {String} serviceName @param {Method definition} method
[ "Generate", "the", "function", "from", "a", "service", "definition" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L127-L195
42,139
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(callback) { var serviceDefs = this._smd.services; // Generate the methods to this object for(var serviceName in serviceDefs){ if( serviceDefs.hasOwnProperty(serviceName) ) { // Get the object that will contain the method. // handles "namespaced" services by breaking apart by '.' var current = this; var pieces = serviceName.split("."); for(var i=0; i< pieces.length-1; i++){ current = current[pieces[i]] || (current[pieces[i]] = {}); } current[pieces[pieces.length-1]] = this._generateService(serviceName, serviceDefs[serviceName]); } } // call the success handler if(lang.isObject(callback) && lang.isFunction(callback.success)) { callback.success.call(callback.scope || this); } }
javascript
function(callback) { var serviceDefs = this._smd.services; // Generate the methods to this object for(var serviceName in serviceDefs){ if( serviceDefs.hasOwnProperty(serviceName) ) { // Get the object that will contain the method. // handles "namespaced" services by breaking apart by '.' var current = this; var pieces = serviceName.split("."); for(var i=0; i< pieces.length-1; i++){ current = current[pieces[i]] || (current[pieces[i]] = {}); } current[pieces[pieces.length-1]] = this._generateService(serviceName, serviceDefs[serviceName]); } } // call the success handler if(lang.isObject(callback) && lang.isFunction(callback.success)) { callback.success.call(callback.scope || this); } }
[ "function", "(", "callback", ")", "{", "var", "serviceDefs", "=", "this", ".", "_smd", ".", "services", ";", "// Generate the methods to this object", "for", "(", "var", "serviceName", "in", "serviceDefs", ")", "{", "if", "(", "serviceDefs", ".", "hasOwnProperty", "(", "serviceName", ")", ")", "{", "// Get the object that will contain the method.", "// handles \"namespaced\" services by breaking apart by '.'", "var", "current", "=", "this", ";", "var", "pieces", "=", "serviceName", ".", "split", "(", "\".\"", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "pieces", ".", "length", "-", "1", ";", "i", "++", ")", "{", "current", "=", "current", "[", "pieces", "[", "i", "]", "]", "||", "(", "current", "[", "pieces", "[", "i", "]", "]", "=", "{", "}", ")", ";", "}", "current", "[", "pieces", "[", "pieces", ".", "length", "-", "1", "]", "]", "=", "this", ".", "_generateService", "(", "serviceName", ",", "serviceDefs", "[", "serviceName", "]", ")", ";", "}", "}", "// call the success handler", "if", "(", "lang", ".", "isObject", "(", "callback", ")", "&&", "lang", ".", "isFunction", "(", "callback", ".", "success", ")", ")", "{", "callback", ".", "success", ".", "call", "(", "callback", ".", "scope", "||", "this", ")", ";", "}", "}" ]
Process the SMD definition @method process
[ "Process", "the", "SMD", "definition" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L201-L226
42,140
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(url, callback) { // TODO: if url is not in the same domain, we should use jsonp ! util.Connect.asyncRequest('GET', url, { success: function(o) { try { this._smd = lang.JSON.parse(o.responseText); this.process(callback); } catch(ex) { if(lang.isObject(console) && lang.isFunction(console.log)) console.log(ex); if( lang.isFunction(callback.failure) ) { callback.failure.call(callback.scope || this, {error: ex}); } } }, failure: function(o) { if( lang.isFunction(callback.failure) ) { callback.failure.call(callback.scope || this, {error: "unable to fetch url "+url}); } }, scope: this }); }
javascript
function(url, callback) { // TODO: if url is not in the same domain, we should use jsonp ! util.Connect.asyncRequest('GET', url, { success: function(o) { try { this._smd = lang.JSON.parse(o.responseText); this.process(callback); } catch(ex) { if(lang.isObject(console) && lang.isFunction(console.log)) console.log(ex); if( lang.isFunction(callback.failure) ) { callback.failure.call(callback.scope || this, {error: ex}); } } }, failure: function(o) { if( lang.isFunction(callback.failure) ) { callback.failure.call(callback.scope || this, {error: "unable to fetch url "+url}); } }, scope: this }); }
[ "function", "(", "url", ",", "callback", ")", "{", "// TODO: if url is not in the same domain, we should use jsonp !", "util", ".", "Connect", ".", "asyncRequest", "(", "'GET'", ",", "url", ",", "{", "success", ":", "function", "(", "o", ")", "{", "try", "{", "this", ".", "_smd", "=", "lang", ".", "JSON", ".", "parse", "(", "o", ".", "responseText", ")", ";", "this", ".", "process", "(", "callback", ")", ";", "}", "catch", "(", "ex", ")", "{", "if", "(", "lang", ".", "isObject", "(", "console", ")", "&&", "lang", ".", "isFunction", "(", "console", ".", "log", ")", ")", "console", ".", "log", "(", "ex", ")", ";", "if", "(", "lang", ".", "isFunction", "(", "callback", ".", "failure", ")", ")", "{", "callback", ".", "failure", ".", "call", "(", "callback", ".", "scope", "||", "this", ",", "{", "error", ":", "ex", "}", ")", ";", "}", "}", "}", ",", "failure", ":", "function", "(", "o", ")", "{", "if", "(", "lang", ".", "isFunction", "(", "callback", ".", "failure", ")", ")", "{", "callback", ".", "failure", ".", "call", "(", "callback", ".", "scope", "||", "this", ",", "{", "error", ":", "\"unable to fetch url \"", "+", "url", "}", ")", ";", "}", "}", ",", "scope", ":", "this", "}", ")", ";", "}" ]
Download the SMD at the given url @method fetch @param {String} Absolute or relative url
[ "Download", "the", "SMD", "at", "the", "given", "url" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L233-L257
42,141
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(r) { return util.Connect.asyncRequest('POST', r.target, r.callback, r.data ); }
javascript
function(r) { return util.Connect.asyncRequest('POST', r.target, r.callback, r.data ); }
[ "function", "(", "r", ")", "{", "return", "util", ".", "Connect", ".", "asyncRequest", "(", "'POST'", ",", "r", ".", "target", ",", "r", ".", "callback", ",", "r", ".", "data", ")", ";", "}" ]
Build a ajax request using 'POST' method @method POST @param {Object} r Object specifying target, callback and data attributes
[ "Build", "a", "ajax", "request", "using", "POST", "method" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L280-L282
42,142
neyric/webhookit
public/javascripts/inputex/js/rpc/inputex-rpc.js
function(smd, method, data) { var eURI = encodeURIComponent; var params = []; for(var name in data){ if(data.hasOwnProperty(name)){ var value = data[name]; if(lang.isArray(value)){ for(var i=0; i < value.length; i++){ params.push(eURI(name)+"="+eURI(value[i])); } }else{ params.push(eURI(name)+"="+eURI(value)); } } } return { data: params.join("&") }; }
javascript
function(smd, method, data) { var eURI = encodeURIComponent; var params = []; for(var name in data){ if(data.hasOwnProperty(name)){ var value = data[name]; if(lang.isArray(value)){ for(var i=0; i < value.length; i++){ params.push(eURI(name)+"="+eURI(value[i])); } }else{ params.push(eURI(name)+"="+eURI(value)); } } } return { data: params.join("&") }; }
[ "function", "(", "smd", ",", "method", ",", "data", ")", "{", "var", "eURI", "=", "encodeURIComponent", ";", "var", "params", "=", "[", "]", ";", "for", "(", "var", "name", "in", "data", ")", "{", "if", "(", "data", ".", "hasOwnProperty", "(", "name", ")", ")", "{", "var", "value", "=", "data", "[", "name", "]", ";", "if", "(", "lang", ".", "isArray", "(", "value", ")", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "value", ".", "length", ";", "i", "++", ")", "{", "params", ".", "push", "(", "eURI", "(", "name", ")", "+", "\"=\"", "+", "eURI", "(", "value", "[", "i", "]", ")", ")", ";", "}", "}", "else", "{", "params", ".", "push", "(", "eURI", "(", "name", ")", "+", "\"=\"", "+", "eURI", "(", "value", ")", ")", ";", "}", "}", "}", "return", "{", "data", ":", "params", ".", "join", "(", "\"&\"", ")", "}", ";", "}" ]
Serialize data into URI encoded parameters
[ "Serialize", "data", "into", "URI", "encoded", "parameters" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/inputex/js/rpc/inputex-rpc.js#L348-L366
42,143
neyric/webhookit
public/javascripts/yui/container/container.js
function (owner) { this.owner = owner; this.configChangedEvent = this.createEvent(Config.CONFIG_CHANGED_EVENT); this.configChangedEvent.signature = CustomEvent.LIST; this.queueInProgress = false; this.config = {}; this.initialConfig = {}; this.eventQueue = []; }
javascript
function (owner) { this.owner = owner; this.configChangedEvent = this.createEvent(Config.CONFIG_CHANGED_EVENT); this.configChangedEvent.signature = CustomEvent.LIST; this.queueInProgress = false; this.config = {}; this.initialConfig = {}; this.eventQueue = []; }
[ "function", "(", "owner", ")", "{", "this", ".", "owner", "=", "owner", ";", "this", ".", "configChangedEvent", "=", "this", ".", "createEvent", "(", "Config", ".", "CONFIG_CHANGED_EVENT", ")", ";", "this", ".", "configChangedEvent", ".", "signature", "=", "CustomEvent", ".", "LIST", ";", "this", ".", "queueInProgress", "=", "false", ";", "this", ".", "config", "=", "{", "}", ";", "this", ".", "initialConfig", "=", "{", "}", ";", "this", ".", "eventQueue", "=", "[", "]", ";", "}" ]
Initializes the configuration Object and all of its local members. @method init @param {Object} owner The owner Object to which this Config Object belongs
[ "Initializes", "the", "configuration", "Object", "and", "all", "of", "its", "local", "members", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L110-L123
42,144
neyric/webhookit
public/javascripts/yui/container/container.js
function ( key, propertyObject ) { key = key.toLowerCase(); this.config[key] = propertyObject; propertyObject.event = this.createEvent(key, { scope: this.owner }); propertyObject.event.signature = CustomEvent.LIST; propertyObject.key = key; if (propertyObject.handler) { propertyObject.event.subscribe(propertyObject.handler, this.owner); } this.setProperty(key, propertyObject.value, true); if (! propertyObject.suppressEvent) { this.queueProperty(key, propertyObject.value); } }
javascript
function ( key, propertyObject ) { key = key.toLowerCase(); this.config[key] = propertyObject; propertyObject.event = this.createEvent(key, { scope: this.owner }); propertyObject.event.signature = CustomEvent.LIST; propertyObject.key = key; if (propertyObject.handler) { propertyObject.event.subscribe(propertyObject.handler, this.owner); } this.setProperty(key, propertyObject.value, true); if (! propertyObject.suppressEvent) { this.queueProperty(key, propertyObject.value); } }
[ "function", "(", "key", ",", "propertyObject", ")", "{", "key", "=", "key", ".", "toLowerCase", "(", ")", ";", "this", ".", "config", "[", "key", "]", "=", "propertyObject", ";", "propertyObject", ".", "event", "=", "this", ".", "createEvent", "(", "key", ",", "{", "scope", ":", "this", ".", "owner", "}", ")", ";", "propertyObject", ".", "event", ".", "signature", "=", "CustomEvent", ".", "LIST", ";", "propertyObject", ".", "key", "=", "key", ";", "if", "(", "propertyObject", ".", "handler", ")", "{", "propertyObject", ".", "event", ".", "subscribe", "(", "propertyObject", ".", "handler", ",", "this", ".", "owner", ")", ";", "}", "this", ".", "setProperty", "(", "key", ",", "propertyObject", ".", "value", ",", "true", ")", ";", "if", "(", "!", "propertyObject", ".", "suppressEvent", ")", "{", "this", ".", "queueProperty", "(", "key", ",", "propertyObject", ".", "value", ")", ";", "}", "}" ]
Adds a property to the Config Object's private config hash. @method addProperty @param {String} key The configuration property's name @param {Object} propertyObject The Object containing all of this property's arguments
[ "Adds", "a", "property", "to", "the", "Config", "Object", "s", "private", "config", "hash", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L167-L189
42,145
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var cfg = {}, currCfg = this.config, prop, property; for (prop in currCfg) { if (Lang.hasOwnProperty(currCfg, prop)) { property = currCfg[prop]; if (property && property.event) { cfg[prop] = property.value; } } } return cfg; }
javascript
function () { var cfg = {}, currCfg = this.config, prop, property; for (prop in currCfg) { if (Lang.hasOwnProperty(currCfg, prop)) { property = currCfg[prop]; if (property && property.event) { cfg[prop] = property.value; } } } return cfg; }
[ "function", "(", ")", "{", "var", "cfg", "=", "{", "}", ",", "currCfg", "=", "this", ".", "config", ",", "prop", ",", "property", ";", "for", "(", "prop", "in", "currCfg", ")", "{", "if", "(", "Lang", ".", "hasOwnProperty", "(", "currCfg", ",", "prop", ")", ")", "{", "property", "=", "currCfg", "[", "prop", "]", ";", "if", "(", "property", "&&", "property", ".", "event", ")", "{", "cfg", "[", "prop", "]", "=", "property", ".", "value", ";", "}", "}", "}", "return", "cfg", ";", "}" ]
Returns a key-value configuration map of the values currently set in the Config Object. @method getConfig @return {Object} The current config, represented in a key-value map
[ "Returns", "a", "key", "-", "value", "configuration", "map", "of", "the", "values", "currently", "set", "in", "the", "Config", "Object", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L197-L214
42,146
neyric/webhookit
public/javascripts/yui/container/container.js
function (key) { var property = this.config[key.toLowerCase()]; if (property && property.event) { return property.value; } else { return undefined; } }
javascript
function (key) { var property = this.config[key.toLowerCase()]; if (property && property.event) { return property.value; } else { return undefined; } }
[ "function", "(", "key", ")", "{", "var", "property", "=", "this", ".", "config", "[", "key", ".", "toLowerCase", "(", ")", "]", ";", "if", "(", "property", "&&", "property", ".", "event", ")", "{", "return", "property", ".", "value", ";", "}", "else", "{", "return", "undefined", ";", "}", "}" ]
Returns the value of specified property. @method getProperty @param {String} key The name of the property @return {Object} The value of the specified property
[ "Returns", "the", "value", "of", "specified", "property", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L222-L229
42,147
neyric/webhookit
public/javascripts/yui/container/container.js
function (key) { key = key.toLowerCase(); var property = this.config[key]; if (property && property.event) { if (this.initialConfig[key] && !Lang.isUndefined(this.initialConfig[key])) { this.setProperty(key, this.initialConfig[key]); return true; } } else { return false; } }
javascript
function (key) { key = key.toLowerCase(); var property = this.config[key]; if (property && property.event) { if (this.initialConfig[key] && !Lang.isUndefined(this.initialConfig[key])) { this.setProperty(key, this.initialConfig[key]); return true; } } else { return false; } }
[ "function", "(", "key", ")", "{", "key", "=", "key", ".", "toLowerCase", "(", ")", ";", "var", "property", "=", "this", ".", "config", "[", "key", "]", ";", "if", "(", "property", "&&", "property", ".", "event", ")", "{", "if", "(", "this", ".", "initialConfig", "[", "key", "]", "&&", "!", "Lang", ".", "isUndefined", "(", "this", ".", "initialConfig", "[", "key", "]", ")", ")", "{", "this", ".", "setProperty", "(", "key", ",", "this", ".", "initialConfig", "[", "key", "]", ")", ";", "return", "true", ";", "}", "}", "else", "{", "return", "false", ";", "}", "}" ]
Resets the specified property's value to its initial value. @method resetProperty @param {String} key The name of the property @return {Boolean} True is the property was reset, false if not
[ "Resets", "the", "specified", "property", "s", "value", "to", "its", "initial", "value", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L237-L259
42,148
neyric/webhookit
public/javascripts/yui/container/container.js
function (key) { key = key.toLowerCase(); var property = this.config[key]; if (property && property.event && !Lang.isUndefined(property.value)) { if (this.queueInProgress) { this.queueProperty(key); } else { this.fireEvent(key, property.value); } } }
javascript
function (key) { key = key.toLowerCase(); var property = this.config[key]; if (property && property.event && !Lang.isUndefined(property.value)) { if (this.queueInProgress) { this.queueProperty(key); } else { this.fireEvent(key, property.value); } } }
[ "function", "(", "key", ")", "{", "key", "=", "key", ".", "toLowerCase", "(", ")", ";", "var", "property", "=", "this", ".", "config", "[", "key", "]", ";", "if", "(", "property", "&&", "property", ".", "event", "&&", "!", "Lang", ".", "isUndefined", "(", "property", ".", "value", ")", ")", "{", "if", "(", "this", ".", "queueInProgress", ")", "{", "this", ".", "queueProperty", "(", "key", ")", ";", "}", "else", "{", "this", ".", "fireEvent", "(", "key", ",", "property", ".", "value", ")", ";", "}", "}", "}" ]
Fires the event for a property using the property's current value. @method refireEvent @param {String} key The name of the property
[ "Fires", "the", "event", "for", "a", "property", "using", "the", "property", "s", "current", "value", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L423-L444
42,149
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var i, queueItem, key, value, property; this.queueInProgress = true; for (i = 0;i < this.eventQueue.length; i++) { queueItem = this.eventQueue[i]; if (queueItem) { key = queueItem[0]; value = queueItem[1]; property = this.config[key]; property.value = value; // Clear out queue entry, to avoid it being // re-added to the queue by any queueProperty/supercedes // calls which are invoked during fireEvent this.eventQueue[i] = null; this.fireEvent(key,value); } } this.queueInProgress = false; this.eventQueue = []; }
javascript
function () { var i, queueItem, key, value, property; this.queueInProgress = true; for (i = 0;i < this.eventQueue.length; i++) { queueItem = this.eventQueue[i]; if (queueItem) { key = queueItem[0]; value = queueItem[1]; property = this.config[key]; property.value = value; // Clear out queue entry, to avoid it being // re-added to the queue by any queueProperty/supercedes // calls which are invoked during fireEvent this.eventQueue[i] = null; this.fireEvent(key,value); } } this.queueInProgress = false; this.eventQueue = []; }
[ "function", "(", ")", "{", "var", "i", ",", "queueItem", ",", "key", ",", "value", ",", "property", ";", "this", ".", "queueInProgress", "=", "true", ";", "for", "(", "i", "=", "0", ";", "i", "<", "this", ".", "eventQueue", ".", "length", ";", "i", "++", ")", "{", "queueItem", "=", "this", ".", "eventQueue", "[", "i", "]", ";", "if", "(", "queueItem", ")", "{", "key", "=", "queueItem", "[", "0", "]", ";", "value", "=", "queueItem", "[", "1", "]", ";", "property", "=", "this", ".", "config", "[", "key", "]", ";", "property", ".", "value", "=", "value", ";", "// Clear out queue entry, to avoid it being ", "// re-added to the queue by any queueProperty/supercedes", "// calls which are invoked during fireEvent", "this", ".", "eventQueue", "[", "i", "]", "=", "null", ";", "this", ".", "fireEvent", "(", "key", ",", "value", ")", ";", "}", "}", "this", ".", "queueInProgress", "=", "false", ";", "this", ".", "eventQueue", "=", "[", "]", ";", "}" ]
Fires the normalized list of queued property change events @method fireQueue
[ "Fires", "the", "normalized", "list", "of", "queued", "property", "change", "events" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L499-L529
42,150
neyric/webhookit
public/javascripts/yui/container/container.js
function (key, handler, obj, overrideContext) { var property = this.config[key.toLowerCase()]; if (property && property.event) { if (!Config.alreadySubscribed(property.event, handler, obj)) { property.event.subscribe(handler, obj, overrideContext); } return true; } else { return false; } }
javascript
function (key, handler, obj, overrideContext) { var property = this.config[key.toLowerCase()]; if (property && property.event) { if (!Config.alreadySubscribed(property.event, handler, obj)) { property.event.subscribe(handler, obj, overrideContext); } return true; } else { return false; } }
[ "function", "(", "key", ",", "handler", ",", "obj", ",", "overrideContext", ")", "{", "var", "property", "=", "this", ".", "config", "[", "key", ".", "toLowerCase", "(", ")", "]", ";", "if", "(", "property", "&&", "property", ".", "event", ")", "{", "if", "(", "!", "Config", ".", "alreadySubscribed", "(", "property", ".", "event", ",", "handler", ",", "obj", ")", ")", "{", "property", ".", "event", ".", "subscribe", "(", "handler", ",", "obj", ",", "overrideContext", ")", ";", "}", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Subscribes an external handler to the change event for any given property. @method subscribeToConfigEvent @param {String} key The property name @param {Function} handler The handler function to use subscribe to the property's event @param {Object} obj The Object to use for scoping the event handler (see CustomEvent documentation) @param {Boolean} overrideContext Optional. If true, will override "this" within the handler to map to the scope Object passed into the method. @return {Boolean} True, if the subscription was successful, otherwise false.
[ "Subscribes", "an", "external", "handler", "to", "the", "change", "event", "for", "any", "given", "property", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L546-L559
42,151
neyric/webhookit
public/javascripts/yui/container/container.js
function (key, handler, obj) { var property = this.config[key.toLowerCase()]; if (property && property.event) { return property.event.unsubscribe(handler, obj); } else { return false; } }
javascript
function (key, handler, obj) { var property = this.config[key.toLowerCase()]; if (property && property.event) { return property.event.unsubscribe(handler, obj); } else { return false; } }
[ "function", "(", "key", ",", "handler", ",", "obj", ")", "{", "var", "property", "=", "this", ".", "config", "[", "key", ".", "toLowerCase", "(", ")", "]", ";", "if", "(", "property", "&&", "property", ".", "event", ")", "{", "return", "property", ".", "event", ".", "unsubscribe", "(", "handler", ",", "obj", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Unsubscribes an external handler from the change event for any given property. @method unsubscribeFromConfigEvent @param {String} key The property name @param {Function} handler The handler function to use subscribe to the property's event @param {Object} obj The Object to use for scoping the event handler (see CustomEvent documentation) @return {Boolean} True, if the unsubscription was successful, otherwise false.
[ "Unsubscribes", "an", "external", "handler", "from", "the", "change", "event", "for", "any", "given", "property", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L573-L580
42,152
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var output = "", queueItem, q, nQueue = this.eventQueue.length; for (q = 0; q < nQueue; q++) { queueItem = this.eventQueue[q]; if (queueItem) { output += queueItem[0] + "=" + queueItem[1] + ", "; } } return output; }
javascript
function () { var output = "", queueItem, q, nQueue = this.eventQueue.length; for (q = 0; q < nQueue; q++) { queueItem = this.eventQueue[q]; if (queueItem) { output += queueItem[0] + "=" + queueItem[1] + ", "; } } return output; }
[ "function", "(", ")", "{", "var", "output", "=", "\"\"", ",", "queueItem", ",", "q", ",", "nQueue", "=", "this", ".", "eventQueue", ".", "length", ";", "for", "(", "q", "=", "0", ";", "q", "<", "nQueue", ";", "q", "++", ")", "{", "queueItem", "=", "this", ".", "eventQueue", "[", "q", "]", ";", "if", "(", "queueItem", ")", "{", "output", "+=", "queueItem", "[", "0", "]", "+", "\"=\"", "+", "queueItem", "[", "1", "]", "+", "\", \"", ";", "}", "}", "return", "output", ";", "}" ]
Returns a string representation of the Config object's current CustomEvent queue @method outputEventQueue @return {String} The string list of CustomEvents currently queued for execution
[ "Returns", "a", "string", "representation", "of", "the", "Config", "object", "s", "current", "CustomEvent", "queue" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L602-L616
42,153
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var oConfig = this.config, sProperty, oProperty; for (sProperty in oConfig) { if (Lang.hasOwnProperty(oConfig, sProperty)) { oProperty = oConfig[sProperty]; oProperty.event.unsubscribeAll(); oProperty.event = null; } } this.configChangedEvent.unsubscribeAll(); this.configChangedEvent = null; this.owner = null; this.config = null; this.initialConfig = null; this.eventQueue = null; }
javascript
function () { var oConfig = this.config, sProperty, oProperty; for (sProperty in oConfig) { if (Lang.hasOwnProperty(oConfig, sProperty)) { oProperty = oConfig[sProperty]; oProperty.event.unsubscribeAll(); oProperty.event = null; } } this.configChangedEvent.unsubscribeAll(); this.configChangedEvent = null; this.owner = null; this.config = null; this.initialConfig = null; this.eventQueue = null; }
[ "function", "(", ")", "{", "var", "oConfig", "=", "this", ".", "config", ",", "sProperty", ",", "oProperty", ";", "for", "(", "sProperty", "in", "oConfig", ")", "{", "if", "(", "Lang", ".", "hasOwnProperty", "(", "oConfig", ",", "sProperty", ")", ")", "{", "oProperty", "=", "oConfig", "[", "sProperty", "]", ";", "oProperty", ".", "event", ".", "unsubscribeAll", "(", ")", ";", "oProperty", ".", "event", "=", "null", ";", "}", "}", "this", ".", "configChangedEvent", ".", "unsubscribeAll", "(", ")", ";", "this", ".", "configChangedEvent", "=", "null", ";", "this", ".", "owner", "=", "null", ";", "this", ".", "config", "=", "null", ";", "this", ".", "initialConfig", "=", "null", ";", "this", ".", "eventQueue", "=", "null", ";", "}" ]
Sets all properties to null, unsubscribes all listeners from each property's change event and all listeners from the configChangedEvent. @method destroy
[ "Sets", "all", "properties", "to", "null", "unsubscribes", "all", "listeners", "from", "each", "property", "s", "change", "event", "and", "all", "listeners", "from", "the", "configChangedEvent", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L623-L651
42,154
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var isGeckoWin = (UA.gecko && this.platform == "windows"); if (isGeckoWin) { // Help prevent spinning loading icon which // started with FireFox 2.0.0.8/Win var self = this; setTimeout(function(){self._initResizeMonitor();}, 0); } else { this._initResizeMonitor(); } }
javascript
function () { var isGeckoWin = (UA.gecko && this.platform == "windows"); if (isGeckoWin) { // Help prevent spinning loading icon which // started with FireFox 2.0.0.8/Win var self = this; setTimeout(function(){self._initResizeMonitor();}, 0); } else { this._initResizeMonitor(); } }
[ "function", "(", ")", "{", "var", "isGeckoWin", "=", "(", "UA", ".", "gecko", "&&", "this", ".", "platform", "==", "\"windows\"", ")", ";", "if", "(", "isGeckoWin", ")", "{", "// Help prevent spinning loading icon which ", "// started with FireFox 2.0.0.8/Win", "var", "self", "=", "this", ";", "setTimeout", "(", "function", "(", ")", "{", "self", ".", "_initResizeMonitor", "(", ")", ";", "}", ",", "0", ")", ";", "}", "else", "{", "this", ".", "_initResizeMonitor", "(", ")", ";", "}", "}" ]
Initialize an empty IFRAME that is placed out of the visible area that can be used to detect text resize. @method initResizeMonitor
[ "Initialize", "an", "empty", "IFRAME", "that", "is", "placed", "out", "of", "the", "visible", "area", "that", "can", "be", "used", "to", "detect", "text", "resize", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1336-L1347
42,155
neyric/webhookit
public/javascripts/yui/container/container.js
function() { var oDoc, oIFrame, sHTML; function fireTextResize() { Module.textResizeEvent.fire(); } if (!UA.opera) { oIFrame = Dom.get("_yuiResizeMonitor"); var supportsCWResize = this._supportsCWResize(); if (!oIFrame) { oIFrame = document.createElement("iframe"); if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && UA.ie) { oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL; } if (!supportsCWResize) { // Can't monitor on contentWindow, so fire from inside iframe sHTML = ["<html><head><script ", "type=\"text/javascript\">", "window.onresize=function(){window.parent.", "YAHOO.widget.Module.textResizeEvent.", "fire();};<", "\/script></head>", "<body></body></html>"].join(''); oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML); } oIFrame.id = "_yuiResizeMonitor"; oIFrame.title = "Text Resize Monitor"; /* Need to set "position" property before inserting the iframe into the document or Safari's status bar will forever indicate the iframe is loading (See YUILibrary bug #1723064) */ oIFrame.style.position = "absolute"; oIFrame.style.visibility = "hidden"; var db = document.body, fc = db.firstChild; if (fc) { db.insertBefore(oIFrame, fc); } else { db.appendChild(oIFrame); } // Setting the background color fixes an issue with IE6/IE7, where // elements in the DOM, with -ve margin-top which positioned them // offscreen (so they would be overlapped by the iframe and its -ve top // setting), would have their -ve margin-top ignored, when the iframe // was added. oIFrame.style.backgroundColor = "transparent"; oIFrame.style.borderWidth = "0"; oIFrame.style.width = "2em"; oIFrame.style.height = "2em"; oIFrame.style.left = "0"; oIFrame.style.top = (-1 * (oIFrame.offsetHeight + Module.RESIZE_MONITOR_BUFFER)) + "px"; oIFrame.style.visibility = "visible"; /* Don't open/close the document for Gecko like we used to, since it leads to duplicate cookies. (See YUILibrary bug #1721755) */ if (UA.webkit) { oDoc = oIFrame.contentWindow.document; oDoc.open(); oDoc.close(); } } if (oIFrame && oIFrame.contentWindow) { Module.textResizeEvent.subscribe(this.onDomResize, this, true); if (!Module.textResizeInitialized) { if (supportsCWResize) { if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) { /* This will fail in IE if document.domain has changed, so we must change the listener to use the oIFrame element instead */ Event.on(oIFrame, "resize", fireTextResize); } } Module.textResizeInitialized = true; } this.resizeMonitor = oIFrame; } } }
javascript
function() { var oDoc, oIFrame, sHTML; function fireTextResize() { Module.textResizeEvent.fire(); } if (!UA.opera) { oIFrame = Dom.get("_yuiResizeMonitor"); var supportsCWResize = this._supportsCWResize(); if (!oIFrame) { oIFrame = document.createElement("iframe"); if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && UA.ie) { oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL; } if (!supportsCWResize) { // Can't monitor on contentWindow, so fire from inside iframe sHTML = ["<html><head><script ", "type=\"text/javascript\">", "window.onresize=function(){window.parent.", "YAHOO.widget.Module.textResizeEvent.", "fire();};<", "\/script></head>", "<body></body></html>"].join(''); oIFrame.src = "data:text/html;charset=utf-8," + encodeURIComponent(sHTML); } oIFrame.id = "_yuiResizeMonitor"; oIFrame.title = "Text Resize Monitor"; /* Need to set "position" property before inserting the iframe into the document or Safari's status bar will forever indicate the iframe is loading (See YUILibrary bug #1723064) */ oIFrame.style.position = "absolute"; oIFrame.style.visibility = "hidden"; var db = document.body, fc = db.firstChild; if (fc) { db.insertBefore(oIFrame, fc); } else { db.appendChild(oIFrame); } // Setting the background color fixes an issue with IE6/IE7, where // elements in the DOM, with -ve margin-top which positioned them // offscreen (so they would be overlapped by the iframe and its -ve top // setting), would have their -ve margin-top ignored, when the iframe // was added. oIFrame.style.backgroundColor = "transparent"; oIFrame.style.borderWidth = "0"; oIFrame.style.width = "2em"; oIFrame.style.height = "2em"; oIFrame.style.left = "0"; oIFrame.style.top = (-1 * (oIFrame.offsetHeight + Module.RESIZE_MONITOR_BUFFER)) + "px"; oIFrame.style.visibility = "visible"; /* Don't open/close the document for Gecko like we used to, since it leads to duplicate cookies. (See YUILibrary bug #1721755) */ if (UA.webkit) { oDoc = oIFrame.contentWindow.document; oDoc.open(); oDoc.close(); } } if (oIFrame && oIFrame.contentWindow) { Module.textResizeEvent.subscribe(this.onDomResize, this, true); if (!Module.textResizeInitialized) { if (supportsCWResize) { if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) { /* This will fail in IE if document.domain has changed, so we must change the listener to use the oIFrame element instead */ Event.on(oIFrame, "resize", fireTextResize); } } Module.textResizeInitialized = true; } this.resizeMonitor = oIFrame; } } }
[ "function", "(", ")", "{", "var", "oDoc", ",", "oIFrame", ",", "sHTML", ";", "function", "fireTextResize", "(", ")", "{", "Module", ".", "textResizeEvent", ".", "fire", "(", ")", ";", "}", "if", "(", "!", "UA", ".", "opera", ")", "{", "oIFrame", "=", "Dom", ".", "get", "(", "\"_yuiResizeMonitor\"", ")", ";", "var", "supportsCWResize", "=", "this", ".", "_supportsCWResize", "(", ")", ";", "if", "(", "!", "oIFrame", ")", "{", "oIFrame", "=", "document", ".", "createElement", "(", "\"iframe\"", ")", ";", "if", "(", "this", ".", "isSecure", "&&", "Module", ".", "RESIZE_MONITOR_SECURE_URL", "&&", "UA", ".", "ie", ")", "{", "oIFrame", ".", "src", "=", "Module", ".", "RESIZE_MONITOR_SECURE_URL", ";", "}", "if", "(", "!", "supportsCWResize", ")", "{", "// Can't monitor on contentWindow, so fire from inside iframe", "sHTML", "=", "[", "\"<html><head><script \"", ",", "\"type=\\\"text/javascript\\\">\"", ",", "\"window.onresize=function(){window.parent.\"", ",", "\"YAHOO.widget.Module.textResizeEvent.\"", ",", "\"fire();};<\"", ",", "\"\\/script></head>\"", ",", "\"<body></body></html>\"", "]", ".", "join", "(", "''", ")", ";", "oIFrame", ".", "src", "=", "\"data:text/html;charset=utf-8,\"", "+", "encodeURIComponent", "(", "sHTML", ")", ";", "}", "oIFrame", ".", "id", "=", "\"_yuiResizeMonitor\"", ";", "oIFrame", ".", "title", "=", "\"Text Resize Monitor\"", ";", "/*\n Need to set \"position\" property before inserting the \n iframe into the document or Safari's status bar will \n forever indicate the iframe is loading \n (See YUILibrary bug #1723064)\n */", "oIFrame", ".", "style", ".", "position", "=", "\"absolute\"", ";", "oIFrame", ".", "style", ".", "visibility", "=", "\"hidden\"", ";", "var", "db", "=", "document", ".", "body", ",", "fc", "=", "db", ".", "firstChild", ";", "if", "(", "fc", ")", "{", "db", ".", "insertBefore", "(", "oIFrame", ",", "fc", ")", ";", "}", "else", "{", "db", ".", "appendChild", "(", "oIFrame", ")", ";", "}", "// Setting the background color fixes an issue with IE6/IE7, where", "// elements in the DOM, with -ve margin-top which positioned them ", "// offscreen (so they would be overlapped by the iframe and its -ve top", "// setting), would have their -ve margin-top ignored, when the iframe ", "// was added.", "oIFrame", ".", "style", ".", "backgroundColor", "=", "\"transparent\"", ";", "oIFrame", ".", "style", ".", "borderWidth", "=", "\"0\"", ";", "oIFrame", ".", "style", ".", "width", "=", "\"2em\"", ";", "oIFrame", ".", "style", ".", "height", "=", "\"2em\"", ";", "oIFrame", ".", "style", ".", "left", "=", "\"0\"", ";", "oIFrame", ".", "style", ".", "top", "=", "(", "-", "1", "*", "(", "oIFrame", ".", "offsetHeight", "+", "Module", ".", "RESIZE_MONITOR_BUFFER", ")", ")", "+", "\"px\"", ";", "oIFrame", ".", "style", ".", "visibility", "=", "\"visible\"", ";", "/*\n Don't open/close the document for Gecko like we used to, since it\n leads to duplicate cookies. (See YUILibrary bug #1721755)\n */", "if", "(", "UA", ".", "webkit", ")", "{", "oDoc", "=", "oIFrame", ".", "contentWindow", ".", "document", ";", "oDoc", ".", "open", "(", ")", ";", "oDoc", ".", "close", "(", ")", ";", "}", "}", "if", "(", "oIFrame", "&&", "oIFrame", ".", "contentWindow", ")", "{", "Module", ".", "textResizeEvent", ".", "subscribe", "(", "this", ".", "onDomResize", ",", "this", ",", "true", ")", ";", "if", "(", "!", "Module", ".", "textResizeInitialized", ")", "{", "if", "(", "supportsCWResize", ")", "{", "if", "(", "!", "Event", ".", "on", "(", "oIFrame", ".", "contentWindow", ",", "\"resize\"", ",", "fireTextResize", ")", ")", "{", "/*\n This will fail in IE if document.domain has \n changed, so we must change the listener to \n use the oIFrame element instead\n */", "Event", ".", "on", "(", "oIFrame", ",", "\"resize\"", ",", "fireTextResize", ")", ";", "}", "}", "Module", ".", "textResizeInitialized", "=", "true", ";", "}", "this", ".", "resizeMonitor", "=", "oIFrame", ";", "}", "}", "}" ]
Create and initialize the text resize monitoring iframe. @protected @method _initResizeMonitor
[ "Create", "and", "initialize", "the", "text", "resize", "monitoring", "iframe", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1355-L1453
42,156
neyric/webhookit
public/javascripts/yui/container/container.js
function (headerContent) { var oHeader = this.header || (this.header = createHeader()); if (headerContent.nodeName) { oHeader.innerHTML = ""; oHeader.appendChild(headerContent); } else { oHeader.innerHTML = headerContent; } if (this._rendered) { this._renderHeader(); } this.changeHeaderEvent.fire(headerContent); this.changeContentEvent.fire(); }
javascript
function (headerContent) { var oHeader = this.header || (this.header = createHeader()); if (headerContent.nodeName) { oHeader.innerHTML = ""; oHeader.appendChild(headerContent); } else { oHeader.innerHTML = headerContent; } if (this._rendered) { this._renderHeader(); } this.changeHeaderEvent.fire(headerContent); this.changeContentEvent.fire(); }
[ "function", "(", "headerContent", ")", "{", "var", "oHeader", "=", "this", ".", "header", "||", "(", "this", ".", "header", "=", "createHeader", "(", ")", ")", ";", "if", "(", "headerContent", ".", "nodeName", ")", "{", "oHeader", ".", "innerHTML", "=", "\"\"", ";", "oHeader", ".", "appendChild", "(", "headerContent", ")", ";", "}", "else", "{", "oHeader", ".", "innerHTML", "=", "headerContent", ";", "}", "if", "(", "this", ".", "_rendered", ")", "{", "this", ".", "_renderHeader", "(", ")", ";", "}", "this", ".", "changeHeaderEvent", ".", "fire", "(", "headerContent", ")", ";", "this", ".", "changeContentEvent", ".", "fire", "(", ")", ";", "}" ]
Sets the Module's header content to the string specified, or appends the passed element to the header. If no header is present, one will be automatically created. An empty string can be passed to the method to clear the contents of the header. @method setHeader @param {String} headerContent The string used to set the header. As a convenience, non HTMLElement objects can also be passed into the method, and will be treated as strings, with the header innerHTML set to their default toString implementations. <em>OR</em> @param {HTMLElement} headerContent The HTMLElement to append to <em>OR</em> @param {DocumentFragment} headerContent The document fragment containing elements which are to be added to the header
[ "Sets", "the", "Module", "s", "header", "content", "to", "the", "string", "specified", "or", "appends", "the", "passed", "element", "to", "the", "header", ".", "If", "no", "header", "is", "present", "one", "will", "be", "automatically", "created", ".", "An", "empty", "string", "can", "be", "passed", "to", "the", "method", "to", "clear", "the", "contents", "of", "the", "header", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1508-L1525
42,157
neyric/webhookit
public/javascripts/yui/container/container.js
function (element) { var oHeader = this.header || (this.header = createHeader()); oHeader.appendChild(element); this.changeHeaderEvent.fire(element); this.changeContentEvent.fire(); }
javascript
function (element) { var oHeader = this.header || (this.header = createHeader()); oHeader.appendChild(element); this.changeHeaderEvent.fire(element); this.changeContentEvent.fire(); }
[ "function", "(", "element", ")", "{", "var", "oHeader", "=", "this", ".", "header", "||", "(", "this", ".", "header", "=", "createHeader", "(", ")", ")", ";", "oHeader", ".", "appendChild", "(", "element", ")", ";", "this", ".", "changeHeaderEvent", ".", "fire", "(", "element", ")", ";", "this", ".", "changeContentEvent", ".", "fire", "(", ")", ";", "}" ]
Appends the passed element to the header. If no header is present, one will be automatically created. @method appendToHeader @param {HTMLElement | DocumentFragment} element The element to append to the header. In the case of a document fragment, the children of the fragment will be appended to the header.
[ "Appends", "the", "passed", "element", "to", "the", "header", ".", "If", "no", "header", "is", "present", "one", "will", "be", "automatically", "created", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1535-L1543
42,158
neyric/webhookit
public/javascripts/yui/container/container.js
function (bodyContent) { var oBody = this.body || (this.body = createBody()); if (bodyContent.nodeName) { oBody.innerHTML = ""; oBody.appendChild(bodyContent); } else { oBody.innerHTML = bodyContent; } if (this._rendered) { this._renderBody(); } this.changeBodyEvent.fire(bodyContent); this.changeContentEvent.fire(); }
javascript
function (bodyContent) { var oBody = this.body || (this.body = createBody()); if (bodyContent.nodeName) { oBody.innerHTML = ""; oBody.appendChild(bodyContent); } else { oBody.innerHTML = bodyContent; } if (this._rendered) { this._renderBody(); } this.changeBodyEvent.fire(bodyContent); this.changeContentEvent.fire(); }
[ "function", "(", "bodyContent", ")", "{", "var", "oBody", "=", "this", ".", "body", "||", "(", "this", ".", "body", "=", "createBody", "(", ")", ")", ";", "if", "(", "bodyContent", ".", "nodeName", ")", "{", "oBody", ".", "innerHTML", "=", "\"\"", ";", "oBody", ".", "appendChild", "(", "bodyContent", ")", ";", "}", "else", "{", "oBody", ".", "innerHTML", "=", "bodyContent", ";", "}", "if", "(", "this", ".", "_rendered", ")", "{", "this", ".", "_renderBody", "(", ")", ";", "}", "this", ".", "changeBodyEvent", ".", "fire", "(", "bodyContent", ")", ";", "this", ".", "changeContentEvent", ".", "fire", "(", ")", ";", "}" ]
Sets the Module's body content to the HTML specified. If no body is present, one will be automatically created. An empty string can be passed to the method to clear the contents of the body. @method setBody @param {String} bodyContent The HTML used to set the body. As a convenience, non HTMLElement objects can also be passed into the method, and will be treated as strings, with the body innerHTML set to their default toString implementations. <em>OR</em> @param {HTMLElement} bodyContent The HTMLElement to add as the first and only child of the body element. <em>OR</em> @param {DocumentFragment} bodyContent The document fragment containing elements which are to be added to the body
[ "Sets", "the", "Module", "s", "body", "content", "to", "the", "HTML", "specified", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1563-L1579
42,159
neyric/webhookit
public/javascripts/yui/container/container.js
function (footerContent) { var oFooter = this.footer || (this.footer = createFooter()); if (footerContent.nodeName) { oFooter.innerHTML = ""; oFooter.appendChild(footerContent); } else { oFooter.innerHTML = footerContent; } if (this._rendered) { this._renderFooter(); } this.changeFooterEvent.fire(footerContent); this.changeContentEvent.fire(); }
javascript
function (footerContent) { var oFooter = this.footer || (this.footer = createFooter()); if (footerContent.nodeName) { oFooter.innerHTML = ""; oFooter.appendChild(footerContent); } else { oFooter.innerHTML = footerContent; } if (this._rendered) { this._renderFooter(); } this.changeFooterEvent.fire(footerContent); this.changeContentEvent.fire(); }
[ "function", "(", "footerContent", ")", "{", "var", "oFooter", "=", "this", ".", "footer", "||", "(", "this", ".", "footer", "=", "createFooter", "(", ")", ")", ";", "if", "(", "footerContent", ".", "nodeName", ")", "{", "oFooter", ".", "innerHTML", "=", "\"\"", ";", "oFooter", ".", "appendChild", "(", "footerContent", ")", ";", "}", "else", "{", "oFooter", ".", "innerHTML", "=", "footerContent", ";", "}", "if", "(", "this", ".", "_rendered", ")", "{", "this", ".", "_renderFooter", "(", ")", ";", "}", "this", ".", "changeFooterEvent", ".", "fire", "(", "footerContent", ")", ";", "this", ".", "changeContentEvent", ".", "fire", "(", ")", ";", "}" ]
Sets the Module's footer content to the HTML specified, or appends the passed element to the footer. If no footer is present, one will be automatically created. An empty string can be passed to the method to clear the contents of the footer. @method setFooter @param {String} footerContent The HTML used to set the footer As a convenience, non HTMLElement objects can also be passed into the method, and will be treated as strings, with the footer innerHTML set to their default toString implementations. <em>OR</em> @param {HTMLElement} footerContent The HTMLElement to append to the footer <em>OR</em> @param {DocumentFragment} footerContent The document fragment containing elements which are to be added to the footer
[ "Sets", "the", "Module", "s", "footer", "content", "to", "the", "HTML", "specified", "or", "appends", "the", "passed", "element", "to", "the", "footer", ".", "If", "no", "footer", "is", "present", "one", "will", "be", "automatically", "created", ".", "An", "empty", "string", "can", "be", "passed", "to", "the", "method", "to", "clear", "the", "contents", "of", "the", "footer", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1617-L1634
42,160
neyric/webhookit
public/javascripts/yui/container/container.js
function (element) { var oFooter = this.footer || (this.footer = createFooter()); oFooter.appendChild(element); this.changeFooterEvent.fire(element); this.changeContentEvent.fire(); }
javascript
function (element) { var oFooter = this.footer || (this.footer = createFooter()); oFooter.appendChild(element); this.changeFooterEvent.fire(element); this.changeContentEvent.fire(); }
[ "function", "(", "element", ")", "{", "var", "oFooter", "=", "this", ".", "footer", "||", "(", "this", ".", "footer", "=", "createFooter", "(", ")", ")", ";", "oFooter", ".", "appendChild", "(", "element", ")", ";", "this", ".", "changeFooterEvent", ".", "fire", "(", "element", ")", ";", "this", ".", "changeContentEvent", ".", "fire", "(", ")", ";", "}" ]
Appends the passed element to the footer. If no footer is present, one will be automatically created. @method appendToFooter @param {HTMLElement | DocumentFragment} element The element to append to the footer. In the case of a document fragment, the children of the fragment will be appended to the footer
[ "Appends", "the", "passed", "element", "to", "the", "footer", ".", "If", "no", "footer", "is", "present", "one", "will", "be", "automatically", "created", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1644-L1653
42,161
neyric/webhookit
public/javascripts/yui/container/container.js
function(moduleElement){ moduleElement = moduleElement || this.element; // Need to get everything into the DOM if it isn't already if (this.header && !Dom.inDocument(this.header)) { // There is a header, but it's not in the DOM yet. Need to add it. var firstChild = moduleElement.firstChild; if (firstChild) { moduleElement.insertBefore(this.header, firstChild); } else { moduleElement.appendChild(this.header); } } }
javascript
function(moduleElement){ moduleElement = moduleElement || this.element; // Need to get everything into the DOM if it isn't already if (this.header && !Dom.inDocument(this.header)) { // There is a header, but it's not in the DOM yet. Need to add it. var firstChild = moduleElement.firstChild; if (firstChild) { moduleElement.insertBefore(this.header, firstChild); } else { moduleElement.appendChild(this.header); } } }
[ "function", "(", "moduleElement", ")", "{", "moduleElement", "=", "moduleElement", "||", "this", ".", "element", ";", "// Need to get everything into the DOM if it isn't already", "if", "(", "this", ".", "header", "&&", "!", "Dom", ".", "inDocument", "(", "this", ".", "header", ")", ")", "{", "// There is a header, but it's not in the DOM yet. Need to add it.", "var", "firstChild", "=", "moduleElement", ".", "firstChild", ";", "if", "(", "firstChild", ")", "{", "moduleElement", ".", "insertBefore", "(", "this", ".", "header", ",", "firstChild", ")", ";", "}", "else", "{", "moduleElement", ".", "appendChild", "(", "this", ".", "header", ")", ";", "}", "}", "}" ]
Renders the currently set header into it's proper position under the module element. If the module element is not provided, "this.element" is used. @method _renderHeader @protected @param {HTMLElement} moduleElement Optional. A reference to the module element
[ "Renders", "the", "currently", "set", "header", "into", "it", "s", "proper", "position", "under", "the", "module", "element", ".", "If", "the", "module", "element", "is", "not", "provided", "this", ".", "element", "is", "used", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1731-L1744
42,162
neyric/webhookit
public/javascripts/yui/container/container.js
function(moduleElement){ moduleElement = moduleElement || this.element; if (this.body && !Dom.inDocument(this.body)) { // There is a body, but it's not in the DOM yet. Need to add it. if (this.footer && Dom.isAncestor(moduleElement, this.footer)) { moduleElement.insertBefore(this.body, this.footer); } else { moduleElement.appendChild(this.body); } } }
javascript
function(moduleElement){ moduleElement = moduleElement || this.element; if (this.body && !Dom.inDocument(this.body)) { // There is a body, but it's not in the DOM yet. Need to add it. if (this.footer && Dom.isAncestor(moduleElement, this.footer)) { moduleElement.insertBefore(this.body, this.footer); } else { moduleElement.appendChild(this.body); } } }
[ "function", "(", "moduleElement", ")", "{", "moduleElement", "=", "moduleElement", "||", "this", ".", "element", ";", "if", "(", "this", ".", "body", "&&", "!", "Dom", ".", "inDocument", "(", "this", ".", "body", ")", ")", "{", "// There is a body, but it's not in the DOM yet. Need to add it.", "if", "(", "this", ".", "footer", "&&", "Dom", ".", "isAncestor", "(", "moduleElement", ",", "this", ".", "footer", ")", ")", "{", "moduleElement", ".", "insertBefore", "(", "this", ".", "body", ",", "this", ".", "footer", ")", ";", "}", "else", "{", "moduleElement", ".", "appendChild", "(", "this", ".", "body", ")", ";", "}", "}", "}" ]
Renders the currently set body into it's proper position under the module element. If the module element is not provided, "this.element" is used. @method _renderBody @protected @param {HTMLElement} moduleElement Optional. A reference to the module element.
[ "Renders", "the", "currently", "set", "body", "into", "it", "s", "proper", "position", "under", "the", "module", "element", ".", "If", "the", "module", "element", "is", "not", "provided", "this", ".", "element", "is", "used", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1755-L1766
42,163
neyric/webhookit
public/javascripts/yui/container/container.js
function(moduleElement){ moduleElement = moduleElement || this.element; if (this.footer && !Dom.inDocument(this.footer)) { // There is a footer, but it's not in the DOM yet. Need to add it. moduleElement.appendChild(this.footer); } }
javascript
function(moduleElement){ moduleElement = moduleElement || this.element; if (this.footer && !Dom.inDocument(this.footer)) { // There is a footer, but it's not in the DOM yet. Need to add it. moduleElement.appendChild(this.footer); } }
[ "function", "(", "moduleElement", ")", "{", "moduleElement", "=", "moduleElement", "||", "this", ".", "element", ";", "if", "(", "this", ".", "footer", "&&", "!", "Dom", ".", "inDocument", "(", "this", ".", "footer", ")", ")", "{", "// There is a footer, but it's not in the DOM yet. Need to add it.", "moduleElement", ".", "appendChild", "(", "this", ".", "footer", ")", ";", "}", "}" ]
Renders the currently set footer into it's proper position under the module element. If the module element is not provided, "this.element" is used. @method _renderFooter @protected @param {HTMLElement} moduleElement Optional. A reference to the module element
[ "Renders", "the", "currently", "set", "footer", "into", "it", "s", "proper", "position", "under", "the", "module", "element", ".", "If", "the", "module", "element", "is", "not", "provided", "this", ".", "element", "is", "used", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1777-L1784
42,164
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var parent; if (this.element) { Event.purgeElement(this.element, true); parent = this.element.parentNode; } if (parent) { parent.removeChild(this.element); } this.element = null; this.header = null; this.body = null; this.footer = null; Module.textResizeEvent.unsubscribe(this.onDomResize, this); this.cfg.destroy(); this.cfg = null; this.destroyEvent.fire(); }
javascript
function () { var parent; if (this.element) { Event.purgeElement(this.element, true); parent = this.element.parentNode; } if (parent) { parent.removeChild(this.element); } this.element = null; this.header = null; this.body = null; this.footer = null; Module.textResizeEvent.unsubscribe(this.onDomResize, this); this.cfg.destroy(); this.cfg = null; this.destroyEvent.fire(); }
[ "function", "(", ")", "{", "var", "parent", ";", "if", "(", "this", ".", "element", ")", "{", "Event", ".", "purgeElement", "(", "this", ".", "element", ",", "true", ")", ";", "parent", "=", "this", ".", "element", ".", "parentNode", ";", "}", "if", "(", "parent", ")", "{", "parent", ".", "removeChild", "(", "this", ".", "element", ")", ";", "}", "this", ".", "element", "=", "null", ";", "this", ".", "header", "=", "null", ";", "this", ".", "body", "=", "null", ";", "this", ".", "footer", "=", "null", ";", "Module", ".", "textResizeEvent", ".", "unsubscribe", "(", "this", ".", "onDomResize", ",", "this", ")", ";", "this", ".", "cfg", ".", "destroy", "(", ")", ";", "this", ".", "cfg", "=", "null", ";", "this", ".", "destroyEvent", ".", "fire", "(", ")", ";", "}" ]
Removes the Module element from the DOM and sets all child elements to null. @method destroy
[ "Removes", "the", "Module", "element", "from", "the", "DOM", "and", "sets", "all", "child", "elements", "to", "null", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1791-L1815
42,165
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var monitor = args[0]; if (monitor) { this.initResizeMonitor(); } else { Module.textResizeEvent.unsubscribe(this.onDomResize, this, true); this.resizeMonitor = null; } }
javascript
function (type, args, obj) { var monitor = args[0]; if (monitor) { this.initResizeMonitor(); } else { Module.textResizeEvent.unsubscribe(this.onDomResize, this, true); this.resizeMonitor = null; } }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "monitor", "=", "args", "[", "0", "]", ";", "if", "(", "monitor", ")", "{", "this", ".", "initResizeMonitor", "(", ")", ";", "}", "else", "{", "Module", ".", "textResizeEvent", ".", "unsubscribe", "(", "this", ".", "onDomResize", ",", "this", ",", "true", ")", ";", "this", ".", "resizeMonitor", "=", "null", ";", "}", "}" ]
Default event handler for the "monitorresize" configuration property @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner. @method configMonitorResize
[ "Default", "event", "handler", "for", "the", "monitorresize", "configuration", "property" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L1872-L1880
42,166
neyric/webhookit
public/javascripts/yui/container/container.js
function () { Overlay.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired before the Overlay is moved. * @event beforeMoveEvent * @param {Number} x x coordinate * @param {Number} y y coordinate */ this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE); this.beforeMoveEvent.signature = SIGNATURE; /** * CustomEvent fired after the Overlay is moved. * @event moveEvent * @param {Number} x x coordinate * @param {Number} y y coordinate */ this.moveEvent = this.createEvent(EVENT_TYPES.MOVE); this.moveEvent.signature = SIGNATURE; }
javascript
function () { Overlay.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired before the Overlay is moved. * @event beforeMoveEvent * @param {Number} x x coordinate * @param {Number} y y coordinate */ this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE); this.beforeMoveEvent.signature = SIGNATURE; /** * CustomEvent fired after the Overlay is moved. * @event moveEvent * @param {Number} x x coordinate * @param {Number} y y coordinate */ this.moveEvent = this.createEvent(EVENT_TYPES.MOVE); this.moveEvent.signature = SIGNATURE; }
[ "function", "(", ")", "{", "Overlay", ".", "superclass", ".", "initEvents", ".", "call", "(", "this", ")", ";", "var", "SIGNATURE", "=", "CustomEvent", ".", "LIST", ";", "/**\n * CustomEvent fired before the Overlay is moved.\n * @event beforeMoveEvent\n * @param {Number} x x coordinate\n * @param {Number} y y coordinate\n */", "this", ".", "beforeMoveEvent", "=", "this", ".", "createEvent", "(", "EVENT_TYPES", ".", "BEFORE_MOVE", ")", ";", "this", ".", "beforeMoveEvent", ".", "signature", "=", "SIGNATURE", ";", "/**\n * CustomEvent fired after the Overlay is moved.\n * @event moveEvent\n * @param {Number} x x coordinate\n * @param {Number} y y coordinate\n */", "this", ".", "moveEvent", "=", "this", ".", "createEvent", "(", "EVENT_TYPES", ".", "MOVE", ")", ";", "this", ".", "moveEvent", ".", "signature", "=", "SIGNATURE", ";", "}" ]
Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class. @method initEvents
[ "Initializes", "the", "custom", "events", "for", "Overlay", "which", "are", "fired", "automatically", "at", "appropriate", "times", "by", "the", "Overlay", "class", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L2366-L2390
42,167
neyric/webhookit
public/javascripts/yui/container/container.js
function(show) { Dom.setStyle(this.element, "visibility", (show) ? "visible" : "hidden"); var hiddenClass = Overlay.CSS_HIDDEN; if (show) { Dom.removeClass(this.element, hiddenClass); } else { Dom.addClass(this.element, hiddenClass); } }
javascript
function(show) { Dom.setStyle(this.element, "visibility", (show) ? "visible" : "hidden"); var hiddenClass = Overlay.CSS_HIDDEN; if (show) { Dom.removeClass(this.element, hiddenClass); } else { Dom.addClass(this.element, hiddenClass); } }
[ "function", "(", "show", ")", "{", "Dom", ".", "setStyle", "(", "this", ".", "element", ",", "\"visibility\"", ",", "(", "show", ")", "?", "\"visible\"", ":", "\"hidden\"", ")", ";", "var", "hiddenClass", "=", "Overlay", ".", "CSS_HIDDEN", ";", "if", "(", "show", ")", "{", "Dom", ".", "removeClass", "(", "this", ".", "element", ",", "hiddenClass", ")", ";", "}", "else", "{", "Dom", ".", "addClass", "(", "this", ".", "element", ",", "hiddenClass", ")", ";", "}", "}" ]
Internal implementation to set the visibility of the overlay in the DOM. @method _setDomVisibility @param {boolean} visible Whether to show or hide the Overlay's outer element @protected
[ "Internal", "implementation", "to", "set", "the", "visibility", "of", "the", "overlay", "in", "the", "DOM", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L2699-L2708
42,168
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var val = args[0], alreadySubscribed = Config.alreadySubscribed, windowResizeEvent = Overlay.windowResizeEvent, windowScrollEvent = Overlay.windowScrollEvent; if (val) { this.center(); if (!alreadySubscribed(this.beforeShowEvent, this.center)) { this.beforeShowEvent.subscribe(this.center); } if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) { windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true); } if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) { windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true); } } else { this.beforeShowEvent.unsubscribe(this.center); windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this); windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this); } }
javascript
function (type, args, obj) { var val = args[0], alreadySubscribed = Config.alreadySubscribed, windowResizeEvent = Overlay.windowResizeEvent, windowScrollEvent = Overlay.windowScrollEvent; if (val) { this.center(); if (!alreadySubscribed(this.beforeShowEvent, this.center)) { this.beforeShowEvent.subscribe(this.center); } if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) { windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true); } if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) { windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true); } } else { this.beforeShowEvent.unsubscribe(this.center); windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this); windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this); } }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "val", "=", "args", "[", "0", "]", ",", "alreadySubscribed", "=", "Config", ".", "alreadySubscribed", ",", "windowResizeEvent", "=", "Overlay", ".", "windowResizeEvent", ",", "windowScrollEvent", "=", "Overlay", ".", "windowScrollEvent", ";", "if", "(", "val", ")", "{", "this", ".", "center", "(", ")", ";", "if", "(", "!", "alreadySubscribed", "(", "this", ".", "beforeShowEvent", ",", "this", ".", "center", ")", ")", "{", "this", ".", "beforeShowEvent", ".", "subscribe", "(", "this", ".", "center", ")", ";", "}", "if", "(", "!", "alreadySubscribed", "(", "windowResizeEvent", ",", "this", ".", "doCenterOnDOMEvent", ",", "this", ")", ")", "{", "windowResizeEvent", ".", "subscribe", "(", "this", ".", "doCenterOnDOMEvent", ",", "this", ",", "true", ")", ";", "}", "if", "(", "!", "alreadySubscribed", "(", "windowScrollEvent", ",", "this", ".", "doCenterOnDOMEvent", ",", "this", ")", ")", "{", "windowScrollEvent", ".", "subscribe", "(", "this", ".", "doCenterOnDOMEvent", ",", "this", ",", "true", ")", ";", "}", "}", "else", "{", "this", ".", "beforeShowEvent", ".", "unsubscribe", "(", "this", ".", "center", ")", ";", "windowResizeEvent", ".", "unsubscribe", "(", "this", ".", "doCenterOnDOMEvent", ",", "this", ")", ";", "windowScrollEvent", ".", "unsubscribe", "(", "this", ".", "doCenterOnDOMEvent", ",", "this", ")", ";", "}", "}" ]
The default event handler fired when the "fixedcenter" property is changed. @method configFixedCenter @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "fired", "when", "the", "fixedcenter", "property", "is", "changed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L2902-L2930
42,169
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var height = args[0], el = this.element; Dom.setStyle(el, "height", height); this.cfg.refireEvent("iframe"); }
javascript
function (type, args, obj) { var height = args[0], el = this.element; Dom.setStyle(el, "height", height); this.cfg.refireEvent("iframe"); }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "height", "=", "args", "[", "0", "]", ",", "el", "=", "this", ".", "element", ";", "Dom", ".", "setStyle", "(", "el", ",", "\"height\"", ",", "height", ")", ";", "this", ".", "cfg", ".", "refireEvent", "(", "\"iframe\"", ")", ";", "}" ]
The default event handler fired when the "height" property is changed. @method configHeight @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "fired", "when", "the", "height", "property", "is", "changed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L2941-L2948
42,170
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var x = args[0], y = this.cfg.getProperty("y"); this.cfg.setProperty("x", x, true); this.cfg.setProperty("y", y, true); this.beforeMoveEvent.fire([x, y]); x = this.cfg.getProperty("x"); y = this.cfg.getProperty("y"); Dom.setX(this.element, x, true); this.cfg.setProperty("xy", [x, y], true); this.cfg.refireEvent("iframe"); this.moveEvent.fire([x, y]); }
javascript
function (type, args, obj) { var x = args[0], y = this.cfg.getProperty("y"); this.cfg.setProperty("x", x, true); this.cfg.setProperty("y", y, true); this.beforeMoveEvent.fire([x, y]); x = this.cfg.getProperty("x"); y = this.cfg.getProperty("y"); Dom.setX(this.element, x, true); this.cfg.setProperty("xy", [x, y], true); this.cfg.refireEvent("iframe"); this.moveEvent.fire([x, y]); }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "x", "=", "args", "[", "0", "]", ",", "y", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"y\"", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"x\"", ",", "x", ",", "true", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"y\"", ",", "y", ",", "true", ")", ";", "this", ".", "beforeMoveEvent", ".", "fire", "(", "[", "x", ",", "y", "]", ")", ";", "x", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"x\"", ")", ";", "y", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"y\"", ")", ";", "Dom", ".", "setX", "(", "this", ".", "element", ",", "x", ",", "true", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"xy\"", ",", "[", "x", ",", "y", "]", ",", "true", ")", ";", "this", ".", "cfg", ".", "refireEvent", "(", "\"iframe\"", ")", ";", "this", ".", "moveEvent", ".", "fire", "(", "[", "x", ",", "y", "]", ")", ";", "}" ]
The default event handler fired when the "x" property is changed. @method configX @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "fired", "when", "the", "x", "property", "is", "changed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3077-L3096
42,171
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var oIFrame = this.iframe, oParentNode; if (oIFrame) { oParentNode = this.element.parentNode; if (oParentNode != oIFrame.parentNode) { this._addToParent(oParentNode, oIFrame); } oIFrame.style.display = "block"; } }
javascript
function () { var oIFrame = this.iframe, oParentNode; if (oIFrame) { oParentNode = this.element.parentNode; if (oParentNode != oIFrame.parentNode) { this._addToParent(oParentNode, oIFrame); } oIFrame.style.display = "block"; } }
[ "function", "(", ")", "{", "var", "oIFrame", "=", "this", ".", "iframe", ",", "oParentNode", ";", "if", "(", "oIFrame", ")", "{", "oParentNode", "=", "this", ".", "element", ".", "parentNode", ";", "if", "(", "oParentNode", "!=", "oIFrame", ".", "parentNode", ")", "{", "this", ".", "_addToParent", "(", "oParentNode", ",", "oIFrame", ")", ";", "}", "oIFrame", ".", "style", ".", "display", "=", "\"block\"", ";", "}", "}" ]
Shows the iframe shim, if it has been enabled. @method showIframe
[ "Shows", "the", "iframe", "shim", "if", "it", "has", "been", "enabled", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3132-L3145
42,172
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var oIFrame = this.iframe, oElement = this.element, nOffset = Overlay.IFRAME_OFFSET, nDimensionOffset = (nOffset * 2), aXY; if (oIFrame) { // Size <iframe> oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px"); oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px"); // Position <iframe> aXY = this.cfg.getProperty("xy"); if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) { this.syncPosition(); aXY = this.cfg.getProperty("xy"); } Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]); } }
javascript
function () { var oIFrame = this.iframe, oElement = this.element, nOffset = Overlay.IFRAME_OFFSET, nDimensionOffset = (nOffset * 2), aXY; if (oIFrame) { // Size <iframe> oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px"); oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px"); // Position <iframe> aXY = this.cfg.getProperty("xy"); if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) { this.syncPosition(); aXY = this.cfg.getProperty("xy"); } Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]); } }
[ "function", "(", ")", "{", "var", "oIFrame", "=", "this", ".", "iframe", ",", "oElement", "=", "this", ".", "element", ",", "nOffset", "=", "Overlay", ".", "IFRAME_OFFSET", ",", "nDimensionOffset", "=", "(", "nOffset", "*", "2", ")", ",", "aXY", ";", "if", "(", "oIFrame", ")", "{", "// Size <iframe>", "oIFrame", ".", "style", ".", "width", "=", "(", "oElement", ".", "offsetWidth", "+", "nDimensionOffset", "+", "\"px\"", ")", ";", "oIFrame", ".", "style", ".", "height", "=", "(", "oElement", ".", "offsetHeight", "+", "nDimensionOffset", "+", "\"px\"", ")", ";", "// Position <iframe>", "aXY", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"xy\"", ")", ";", "if", "(", "!", "Lang", ".", "isArray", "(", "aXY", ")", "||", "(", "isNaN", "(", "aXY", "[", "0", "]", ")", "||", "isNaN", "(", "aXY", "[", "1", "]", ")", ")", ")", "{", "this", ".", "syncPosition", "(", ")", ";", "aXY", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"xy\"", ")", ";", "}", "Dom", ".", "setXY", "(", "oIFrame", ",", "[", "(", "aXY", "[", "0", "]", "-", "nOffset", ")", ",", "(", "aXY", "[", "1", "]", "-", "nOffset", ")", "]", ")", ";", "}", "}" ]
Syncronizes the size and position of iframe shim to that of its corresponding Overlay instance. @method syncIframe
[ "Syncronizes", "the", "size", "and", "position", "of", "iframe", "shim", "to", "that", "of", "its", "corresponding", "Overlay", "instance", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3162-L3184
42,173
neyric/webhookit
public/javascripts/yui/container/container.js
function () { if (this.iframe) { var overlayZ = Dom.getStyle(this.element, "zIndex"); if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) { Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1)); } } }
javascript
function () { if (this.iframe) { var overlayZ = Dom.getStyle(this.element, "zIndex"); if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) { Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1)); } } }
[ "function", "(", ")", "{", "if", "(", "this", ".", "iframe", ")", "{", "var", "overlayZ", "=", "Dom", ".", "getStyle", "(", "this", ".", "element", ",", "\"zIndex\"", ")", ";", "if", "(", "!", "YAHOO", ".", "lang", ".", "isUndefined", "(", "overlayZ", ")", "&&", "!", "isNaN", "(", "overlayZ", ")", ")", "{", "Dom", ".", "setStyle", "(", "this", ".", "iframe", ",", "\"zIndex\"", ",", "(", "overlayZ", "-", "1", ")", ")", ";", "}", "}", "}" ]
Sets the zindex of the iframe shim, if it exists, based on the zindex of the Overlay element. The zindex of the iframe is set to be one less than the Overlay element's zindex. <p>NOTE: This method will not bump up the zindex of the Overlay element to ensure that the iframe shim has a non-negative zindex. If you require the iframe zindex to be 0 or higher, the zindex of the Overlay element should be set to a value greater than 0, before this method is called. </p> @method stackIframe
[ "Sets", "the", "zindex", "of", "the", "iframe", "shim", "if", "it", "exists", "based", "on", "the", "zindex", "of", "the", "Overlay", "element", ".", "The", "zindex", "of", "the", "iframe", "is", "set", "to", "be", "one", "less", "than", "the", "Overlay", "element", "s", "zindex", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3199-L3206
42,174
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var bIFrame = args[0]; function createIFrame() { var oIFrame = this.iframe, oElement = this.element, oParent; if (!oIFrame) { if (!m_oIFrameTemplate) { m_oIFrameTemplate = document.createElement("iframe"); if (this.isSecure) { m_oIFrameTemplate.src = Overlay.IFRAME_SRC; } /* Set the opacity of the <iframe> to 0 so that it doesn't modify the opacity of any transparent elements that may be on top of it (like a shadow). */ if (UA.ie) { m_oIFrameTemplate.style.filter = "alpha(opacity=0)"; /* Need to set the "frameBorder" property to 0 supress the default <iframe> border in IE. Setting the CSS "border" property alone doesn't supress it. */ m_oIFrameTemplate.frameBorder = 0; } else { m_oIFrameTemplate.style.opacity = "0"; } m_oIFrameTemplate.style.position = "absolute"; m_oIFrameTemplate.style.border = "none"; m_oIFrameTemplate.style.margin = "0"; m_oIFrameTemplate.style.padding = "0"; m_oIFrameTemplate.style.display = "none"; m_oIFrameTemplate.tabIndex = -1; m_oIFrameTemplate.className = Overlay.CSS_IFRAME; } oIFrame = m_oIFrameTemplate.cloneNode(false); oIFrame.id = this.id + "_f"; oParent = oElement.parentNode; var parentNode = oParent || document.body; this._addToParent(parentNode, oIFrame); this.iframe = oIFrame; } /* Show the <iframe> before positioning it since the "setXY" method of DOM requires the element be in the document and visible. */ this.showIframe(); /* Syncronize the size and position of the <iframe> to that of the Overlay. */ this.syncIframe(); this.stackIframe(); // Add event listeners to update the <iframe> when necessary if (!this._hasIframeEventListeners) { this.showEvent.subscribe(this.showIframe); this.hideEvent.subscribe(this.hideIframe); this.changeContentEvent.subscribe(this.syncIframe); this._hasIframeEventListeners = true; } } function onBeforeShow() { createIFrame.call(this); this.beforeShowEvent.unsubscribe(onBeforeShow); this._iframeDeferred = false; } if (bIFrame) { // <iframe> shim is enabled if (this.cfg.getProperty("visible")) { createIFrame.call(this); } else { if (!this._iframeDeferred) { this.beforeShowEvent.subscribe(onBeforeShow); this._iframeDeferred = true; } } } else { // <iframe> shim is disabled this.hideIframe(); if (this._hasIframeEventListeners) { this.showEvent.unsubscribe(this.showIframe); this.hideEvent.unsubscribe(this.hideIframe); this.changeContentEvent.unsubscribe(this.syncIframe); this._hasIframeEventListeners = false; } } }
javascript
function (type, args, obj) { var bIFrame = args[0]; function createIFrame() { var oIFrame = this.iframe, oElement = this.element, oParent; if (!oIFrame) { if (!m_oIFrameTemplate) { m_oIFrameTemplate = document.createElement("iframe"); if (this.isSecure) { m_oIFrameTemplate.src = Overlay.IFRAME_SRC; } /* Set the opacity of the <iframe> to 0 so that it doesn't modify the opacity of any transparent elements that may be on top of it (like a shadow). */ if (UA.ie) { m_oIFrameTemplate.style.filter = "alpha(opacity=0)"; /* Need to set the "frameBorder" property to 0 supress the default <iframe> border in IE. Setting the CSS "border" property alone doesn't supress it. */ m_oIFrameTemplate.frameBorder = 0; } else { m_oIFrameTemplate.style.opacity = "0"; } m_oIFrameTemplate.style.position = "absolute"; m_oIFrameTemplate.style.border = "none"; m_oIFrameTemplate.style.margin = "0"; m_oIFrameTemplate.style.padding = "0"; m_oIFrameTemplate.style.display = "none"; m_oIFrameTemplate.tabIndex = -1; m_oIFrameTemplate.className = Overlay.CSS_IFRAME; } oIFrame = m_oIFrameTemplate.cloneNode(false); oIFrame.id = this.id + "_f"; oParent = oElement.parentNode; var parentNode = oParent || document.body; this._addToParent(parentNode, oIFrame); this.iframe = oIFrame; } /* Show the <iframe> before positioning it since the "setXY" method of DOM requires the element be in the document and visible. */ this.showIframe(); /* Syncronize the size and position of the <iframe> to that of the Overlay. */ this.syncIframe(); this.stackIframe(); // Add event listeners to update the <iframe> when necessary if (!this._hasIframeEventListeners) { this.showEvent.subscribe(this.showIframe); this.hideEvent.subscribe(this.hideIframe); this.changeContentEvent.subscribe(this.syncIframe); this._hasIframeEventListeners = true; } } function onBeforeShow() { createIFrame.call(this); this.beforeShowEvent.unsubscribe(onBeforeShow); this._iframeDeferred = false; } if (bIFrame) { // <iframe> shim is enabled if (this.cfg.getProperty("visible")) { createIFrame.call(this); } else { if (!this._iframeDeferred) { this.beforeShowEvent.subscribe(onBeforeShow); this._iframeDeferred = true; } } } else { // <iframe> shim is disabled this.hideIframe(); if (this._hasIframeEventListeners) { this.showEvent.unsubscribe(this.showIframe); this.hideEvent.unsubscribe(this.hideIframe); this.changeContentEvent.unsubscribe(this.syncIframe); this._hasIframeEventListeners = false; } } }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "bIFrame", "=", "args", "[", "0", "]", ";", "function", "createIFrame", "(", ")", "{", "var", "oIFrame", "=", "this", ".", "iframe", ",", "oElement", "=", "this", ".", "element", ",", "oParent", ";", "if", "(", "!", "oIFrame", ")", "{", "if", "(", "!", "m_oIFrameTemplate", ")", "{", "m_oIFrameTemplate", "=", "document", ".", "createElement", "(", "\"iframe\"", ")", ";", "if", "(", "this", ".", "isSecure", ")", "{", "m_oIFrameTemplate", ".", "src", "=", "Overlay", ".", "IFRAME_SRC", ";", "}", "/*\n Set the opacity of the <iframe> to 0 so that it \n doesn't modify the opacity of any transparent \n elements that may be on top of it (like a shadow).\n */", "if", "(", "UA", ".", "ie", ")", "{", "m_oIFrameTemplate", ".", "style", ".", "filter", "=", "\"alpha(opacity=0)\"", ";", "/*\n Need to set the \"frameBorder\" property to 0 \n supress the default <iframe> border in IE. \n Setting the CSS \"border\" property alone \n doesn't supress it.\n */", "m_oIFrameTemplate", ".", "frameBorder", "=", "0", ";", "}", "else", "{", "m_oIFrameTemplate", ".", "style", ".", "opacity", "=", "\"0\"", ";", "}", "m_oIFrameTemplate", ".", "style", ".", "position", "=", "\"absolute\"", ";", "m_oIFrameTemplate", ".", "style", ".", "border", "=", "\"none\"", ";", "m_oIFrameTemplate", ".", "style", ".", "margin", "=", "\"0\"", ";", "m_oIFrameTemplate", ".", "style", ".", "padding", "=", "\"0\"", ";", "m_oIFrameTemplate", ".", "style", ".", "display", "=", "\"none\"", ";", "m_oIFrameTemplate", ".", "tabIndex", "=", "-", "1", ";", "m_oIFrameTemplate", ".", "className", "=", "Overlay", ".", "CSS_IFRAME", ";", "}", "oIFrame", "=", "m_oIFrameTemplate", ".", "cloneNode", "(", "false", ")", ";", "oIFrame", ".", "id", "=", "this", ".", "id", "+", "\"_f\"", ";", "oParent", "=", "oElement", ".", "parentNode", ";", "var", "parentNode", "=", "oParent", "||", "document", ".", "body", ";", "this", ".", "_addToParent", "(", "parentNode", ",", "oIFrame", ")", ";", "this", ".", "iframe", "=", "oIFrame", ";", "}", "/*\n Show the <iframe> before positioning it since the \"setXY\" \n method of DOM requires the element be in the document \n and visible.\n */", "this", ".", "showIframe", "(", ")", ";", "/*\n Syncronize the size and position of the <iframe> to that \n of the Overlay.\n */", "this", ".", "syncIframe", "(", ")", ";", "this", ".", "stackIframe", "(", ")", ";", "// Add event listeners to update the <iframe> when necessary", "if", "(", "!", "this", ".", "_hasIframeEventListeners", ")", "{", "this", ".", "showEvent", ".", "subscribe", "(", "this", ".", "showIframe", ")", ";", "this", ".", "hideEvent", ".", "subscribe", "(", "this", ".", "hideIframe", ")", ";", "this", ".", "changeContentEvent", ".", "subscribe", "(", "this", ".", "syncIframe", ")", ";", "this", ".", "_hasIframeEventListeners", "=", "true", ";", "}", "}", "function", "onBeforeShow", "(", ")", "{", "createIFrame", ".", "call", "(", "this", ")", ";", "this", ".", "beforeShowEvent", ".", "unsubscribe", "(", "onBeforeShow", ")", ";", "this", ".", "_iframeDeferred", "=", "false", ";", "}", "if", "(", "bIFrame", ")", "{", "// <iframe> shim is enabled", "if", "(", "this", ".", "cfg", ".", "getProperty", "(", "\"visible\"", ")", ")", "{", "createIFrame", ".", "call", "(", "this", ")", ";", "}", "else", "{", "if", "(", "!", "this", ".", "_iframeDeferred", ")", "{", "this", ".", "beforeShowEvent", ".", "subscribe", "(", "onBeforeShow", ")", ";", "this", ".", "_iframeDeferred", "=", "true", ";", "}", "}", "}", "else", "{", "// <iframe> shim is disabled", "this", ".", "hideIframe", "(", ")", ";", "if", "(", "this", ".", "_hasIframeEventListeners", ")", "{", "this", ".", "showEvent", ".", "unsubscribe", "(", "this", ".", "showIframe", ")", ";", "this", ".", "hideEvent", ".", "unsubscribe", "(", "this", ".", "hideIframe", ")", ";", "this", ".", "changeContentEvent", ".", "unsubscribe", "(", "this", ".", "syncIframe", ")", ";", "this", ".", "_hasIframeEventListeners", "=", "false", ";", "}", "}", "}" ]
The default event handler fired when the "iframe" property is changed. @method configIframe @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "fired", "when", "the", "iframe", "property", "is", "changed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3217-L3325
42,175
neyric/webhookit
public/javascripts/yui/container/container.js
function() { if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) { // Set CFG XY based on DOM XY this.syncPosition(); // Account for XY being set silently in syncPosition (no moveTo fired/called) this.cfg.refireEvent("xy"); this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); } }
javascript
function() { if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) { // Set CFG XY based on DOM XY this.syncPosition(); // Account for XY being set silently in syncPosition (no moveTo fired/called) this.cfg.refireEvent("xy"); this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); } }
[ "function", "(", ")", "{", "if", "(", "YAHOO", ".", "lang", ".", "isUndefined", "(", "this", ".", "cfg", ".", "getProperty", "(", "\"xy\"", ")", ")", ")", "{", "// Set CFG XY based on DOM XY", "this", ".", "syncPosition", "(", ")", ";", "// Account for XY being set silently in syncPosition (no moveTo fired/called)", "this", ".", "cfg", ".", "refireEvent", "(", "\"xy\"", ")", ";", "this", ".", "beforeShowEvent", ".", "unsubscribe", "(", "this", ".", "_primeXYFromDOM", ")", ";", "}", "}" ]
Set's the container's XY value from DOM if not already set. Differs from syncPosition, in that the XY value is only sync'd with DOM if not already set. The method also refire's the XY config property event, so any beforeMove, Move event listeners are invoked. @method _primeXYFromDOM @protected
[ "Set", "s", "the", "container", "s", "XY", "value", "from", "DOM", "if", "not", "already", "set", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3337-L3345
42,176
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var val = args[0]; if (val) { if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) { this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true); } if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) { this.beforeShowEvent.subscribe(this._primeXYFromDOM); } } else { this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this); } }
javascript
function (type, args, obj) { var val = args[0]; if (val) { if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) { this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true); } if (! Config.alreadySubscribed(this.beforeShowEvent, this._primeXYFromDOM)) { this.beforeShowEvent.subscribe(this._primeXYFromDOM); } } else { this.beforeShowEvent.unsubscribe(this._primeXYFromDOM); this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this); } }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "val", "=", "args", "[", "0", "]", ";", "if", "(", "val", ")", "{", "if", "(", "!", "Config", ".", "alreadySubscribed", "(", "this", ".", "beforeMoveEvent", ",", "this", ".", "enforceConstraints", ",", "this", ")", ")", "{", "this", ".", "beforeMoveEvent", ".", "subscribe", "(", "this", ".", "enforceConstraints", ",", "this", ",", "true", ")", ";", "}", "if", "(", "!", "Config", ".", "alreadySubscribed", "(", "this", ".", "beforeShowEvent", ",", "this", ".", "_primeXYFromDOM", ")", ")", "{", "this", ".", "beforeShowEvent", ".", "subscribe", "(", "this", ".", "_primeXYFromDOM", ")", ";", "}", "}", "else", "{", "this", ".", "beforeShowEvent", ".", "unsubscribe", "(", "this", ".", "_primeXYFromDOM", ")", ";", "this", ".", "beforeMoveEvent", ".", "unsubscribe", "(", "this", ".", "enforceConstraints", ",", "this", ")", ";", "}", "}" ]
The default event handler fired when the "constraintoviewport" property is changed. @method configConstrainToViewport @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "fired", "when", "the", "constraintoviewport", "property", "is", "changed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3358-L3372
42,177
neyric/webhookit
public/javascripts/yui/container/container.js
function(t) { var tce = null; if (t instanceof CustomEvent) { tce = t; } else if (Overlay._TRIGGER_MAP[t]) { tce = Overlay._TRIGGER_MAP[t]; } return tce; }
javascript
function(t) { var tce = null; if (t instanceof CustomEvent) { tce = t; } else if (Overlay._TRIGGER_MAP[t]) { tce = Overlay._TRIGGER_MAP[t]; } return tce; }
[ "function", "(", "t", ")", "{", "var", "tce", "=", "null", ";", "if", "(", "t", "instanceof", "CustomEvent", ")", "{", "tce", "=", "t", ";", "}", "else", "if", "(", "Overlay", ".", "_TRIGGER_MAP", "[", "t", "]", ")", "{", "tce", "=", "Overlay", ".", "_TRIGGER_MAP", "[", "t", "]", ";", "}", "return", "tce", ";", "}" ]
Helper method to locate the custom event instance for the event name string passed in. As a convenience measure, any custom events passed in are returned. @method _findTriggerCE @private @param {String|CustomEvent} t Either a CustomEvent, or event type (e.g. "windowScroll") for which a custom event instance needs to be looked up from the Overlay._TRIGGER_MAP.
[ "Helper", "method", "to", "locate", "the", "custom", "event", "instance", "for", "the", "event", "name", "string", "passed", "in", ".", "As", "a", "convenience", "measure", "any", "custom", "events", "passed", "in", "are", "returned", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3459-L3467
42,178
neyric/webhookit
public/javascripts/yui/container/container.js
function(triggers, mode, fn) { var t, tce; for (var i = 0, l = triggers.length; i < l; ++i) { t = triggers[i]; tce = this._findTriggerCE(t); if (tce) { tce[mode](fn, this, true); } else { this[mode](t, fn); } } }
javascript
function(triggers, mode, fn) { var t, tce; for (var i = 0, l = triggers.length; i < l; ++i) { t = triggers[i]; tce = this._findTriggerCE(t); if (tce) { tce[mode](fn, this, true); } else { this[mode](t, fn); } } }
[ "function", "(", "triggers", ",", "mode", ",", "fn", ")", "{", "var", "t", ",", "tce", ";", "for", "(", "var", "i", "=", "0", ",", "l", "=", "triggers", ".", "length", ";", "i", "<", "l", ";", "++", "i", ")", "{", "t", "=", "triggers", "[", "i", "]", ";", "tce", "=", "this", ".", "_findTriggerCE", "(", "t", ")", ";", "if", "(", "tce", ")", "{", "tce", "[", "mode", "]", "(", "fn", ",", "this", ",", "true", ")", ";", "}", "else", "{", "this", "[", "mode", "]", "(", "t", ",", "fn", ")", ";", "}", "}", "}" ]
Utility method that subscribes or unsubscribes the given function from the list of trigger events provided. @method _processTriggers @protected @param {Array[String|CustomEvent]} triggers An array of either CustomEvents, event type strings (e.g. "beforeShow", "windowScroll") to/from which the provided function should be subscribed/unsubscribed respectively. @param {String} mode Either "subscribe" or "unsubscribe", specifying whether or not we are subscribing or unsubscribing trigger listeners @param {Function} fn The function to be subscribed/unsubscribed to/from the trigger event. Context is always set to the overlay instance, and no additional object argument get passed to the subscribed function.
[ "Utility", "method", "that", "subscribes", "or", "unsubscribes", "the", "given", "function", "from", "the", "list", "of", "trigger", "events", "provided", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3487-L3499
42,179
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var pos = args[0]; var cXY = this.getConstrainedXY(pos[0], pos[1]); this.cfg.setProperty("x", cXY[0], true); this.cfg.setProperty("y", cXY[1], true); this.cfg.setProperty("xy", cXY, true); }
javascript
function (type, args, obj) { var pos = args[0]; var cXY = this.getConstrainedXY(pos[0], pos[1]); this.cfg.setProperty("x", cXY[0], true); this.cfg.setProperty("y", cXY[1], true); this.cfg.setProperty("xy", cXY, true); }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "pos", "=", "args", "[", "0", "]", ";", "var", "cXY", "=", "this", ".", "getConstrainedXY", "(", "pos", "[", "0", "]", ",", "pos", "[", "1", "]", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"x\"", ",", "cXY", "[", "0", "]", ",", "true", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"y\"", ",", "cXY", "[", "1", "]", ",", "true", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"xy\"", ",", "cXY", ",", "true", ")", ";", "}" ]
The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true. @method enforceConstraints @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "executed", "when", "the", "moveEvent", "is", "fired", "if", "the", "constraintoviewport", "is", "set", "to", "true", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3611-L3618
42,180
neyric/webhookit
public/javascripts/yui/container/container.js
function(pos, val) { var overlayEl = this.element, buffer = Overlay.VIEWPORT_OFFSET, x = (pos == "x"), overlaySize = (x) ? overlayEl.offsetWidth : overlayEl.offsetHeight, viewportSize = (x) ? Dom.getViewportWidth() : Dom.getViewportHeight(), docScroll = (x) ? Dom.getDocumentScrollLeft() : Dom.getDocumentScrollTop(), overlapPositions = (x) ? Overlay.PREVENT_OVERLAP_X : Overlay.PREVENT_OVERLAP_Y, context = this.cfg.getProperty("context"), bOverlayFitsInViewport = (overlaySize + buffer < viewportSize), bPreventContextOverlap = this.cfg.getProperty("preventcontextoverlap") && context && overlapPositions[(context[1] + context[2])], minConstraint = docScroll + buffer, maxConstraint = docScroll + viewportSize - overlaySize - buffer, constrainedVal = val; if (val < minConstraint || val > maxConstraint) { if (bPreventContextOverlap) { constrainedVal = this._preventOverlap(pos, context[0], overlaySize, viewportSize, docScroll); } else { if (bOverlayFitsInViewport) { if (val < minConstraint) { constrainedVal = minConstraint; } else if (val > maxConstraint) { constrainedVal = maxConstraint; } } else { constrainedVal = minConstraint; } } } return constrainedVal; }
javascript
function(pos, val) { var overlayEl = this.element, buffer = Overlay.VIEWPORT_OFFSET, x = (pos == "x"), overlaySize = (x) ? overlayEl.offsetWidth : overlayEl.offsetHeight, viewportSize = (x) ? Dom.getViewportWidth() : Dom.getViewportHeight(), docScroll = (x) ? Dom.getDocumentScrollLeft() : Dom.getDocumentScrollTop(), overlapPositions = (x) ? Overlay.PREVENT_OVERLAP_X : Overlay.PREVENT_OVERLAP_Y, context = this.cfg.getProperty("context"), bOverlayFitsInViewport = (overlaySize + buffer < viewportSize), bPreventContextOverlap = this.cfg.getProperty("preventcontextoverlap") && context && overlapPositions[(context[1] + context[2])], minConstraint = docScroll + buffer, maxConstraint = docScroll + viewportSize - overlaySize - buffer, constrainedVal = val; if (val < minConstraint || val > maxConstraint) { if (bPreventContextOverlap) { constrainedVal = this._preventOverlap(pos, context[0], overlaySize, viewportSize, docScroll); } else { if (bOverlayFitsInViewport) { if (val < minConstraint) { constrainedVal = minConstraint; } else if (val > maxConstraint) { constrainedVal = maxConstraint; } } else { constrainedVal = minConstraint; } } } return constrainedVal; }
[ "function", "(", "pos", ",", "val", ")", "{", "var", "overlayEl", "=", "this", ".", "element", ",", "buffer", "=", "Overlay", ".", "VIEWPORT_OFFSET", ",", "x", "=", "(", "pos", "==", "\"x\"", ")", ",", "overlaySize", "=", "(", "x", ")", "?", "overlayEl", ".", "offsetWidth", ":", "overlayEl", ".", "offsetHeight", ",", "viewportSize", "=", "(", "x", ")", "?", "Dom", ".", "getViewportWidth", "(", ")", ":", "Dom", ".", "getViewportHeight", "(", ")", ",", "docScroll", "=", "(", "x", ")", "?", "Dom", ".", "getDocumentScrollLeft", "(", ")", ":", "Dom", ".", "getDocumentScrollTop", "(", ")", ",", "overlapPositions", "=", "(", "x", ")", "?", "Overlay", ".", "PREVENT_OVERLAP_X", ":", "Overlay", ".", "PREVENT_OVERLAP_Y", ",", "context", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"context\"", ")", ",", "bOverlayFitsInViewport", "=", "(", "overlaySize", "+", "buffer", "<", "viewportSize", ")", ",", "bPreventContextOverlap", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"preventcontextoverlap\"", ")", "&&", "context", "&&", "overlapPositions", "[", "(", "context", "[", "1", "]", "+", "context", "[", "2", "]", ")", "]", ",", "minConstraint", "=", "docScroll", "+", "buffer", ",", "maxConstraint", "=", "docScroll", "+", "viewportSize", "-", "overlaySize", "-", "buffer", ",", "constrainedVal", "=", "val", ";", "if", "(", "val", "<", "minConstraint", "||", "val", ">", "maxConstraint", ")", "{", "if", "(", "bPreventContextOverlap", ")", "{", "constrainedVal", "=", "this", ".", "_preventOverlap", "(", "pos", ",", "context", "[", "0", "]", ",", "overlaySize", ",", "viewportSize", ",", "docScroll", ")", ";", "}", "else", "{", "if", "(", "bOverlayFitsInViewport", ")", "{", "if", "(", "val", "<", "minConstraint", ")", "{", "constrainedVal", "=", "minConstraint", ";", "}", "else", "if", "(", "val", ">", "maxConstraint", ")", "{", "constrainedVal", "=", "maxConstraint", ";", "}", "}", "else", "{", "constrainedVal", "=", "minConstraint", ";", "}", "}", "}", "return", "constrainedVal", ";", "}" ]
Shared implementation method for getConstrainedX and getConstrainedY. <p> Given a coordinate value, returns the calculated coordinate required to position the Overlay if it is to be constrained to the viewport, based on the current element size, viewport dimensions, scroll values and preventoverlap settings </p> @method _getConstrainedPos @protected @param {String} pos The coordinate which needs to be constrained, either "x" or "y" @param {Number} The coordinate value which needs to be constrained @return {Number} The constrained coordinate value
[ "Shared", "implementation", "method", "for", "getConstrainedX", "and", "getConstrainedY", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3636-L3676
42,181
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var nViewportOffset = Overlay.VIEWPORT_OFFSET, elementWidth = this.element.offsetWidth, elementHeight = this.element.offsetHeight, viewPortWidth = Dom.getViewportWidth(), viewPortHeight = Dom.getViewportHeight(), x, y; if (elementWidth < viewPortWidth) { x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft(); } else { x = nViewportOffset + Dom.getDocumentScrollLeft(); } if (elementHeight < viewPortHeight) { y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop(); } else { y = nViewportOffset + Dom.getDocumentScrollTop(); } this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]); this.cfg.refireEvent("iframe"); if (UA.webkit) { this.forceContainerRedraw(); } }
javascript
function () { var nViewportOffset = Overlay.VIEWPORT_OFFSET, elementWidth = this.element.offsetWidth, elementHeight = this.element.offsetHeight, viewPortWidth = Dom.getViewportWidth(), viewPortHeight = Dom.getViewportHeight(), x, y; if (elementWidth < viewPortWidth) { x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft(); } else { x = nViewportOffset + Dom.getDocumentScrollLeft(); } if (elementHeight < viewPortHeight) { y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop(); } else { y = nViewportOffset + Dom.getDocumentScrollTop(); } this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]); this.cfg.refireEvent("iframe"); if (UA.webkit) { this.forceContainerRedraw(); } }
[ "function", "(", ")", "{", "var", "nViewportOffset", "=", "Overlay", ".", "VIEWPORT_OFFSET", ",", "elementWidth", "=", "this", ".", "element", ".", "offsetWidth", ",", "elementHeight", "=", "this", ".", "element", ".", "offsetHeight", ",", "viewPortWidth", "=", "Dom", ".", "getViewportWidth", "(", ")", ",", "viewPortHeight", "=", "Dom", ".", "getViewportHeight", "(", ")", ",", "x", ",", "y", ";", "if", "(", "elementWidth", "<", "viewPortWidth", ")", "{", "x", "=", "(", "viewPortWidth", "/", "2", ")", "-", "(", "elementWidth", "/", "2", ")", "+", "Dom", ".", "getDocumentScrollLeft", "(", ")", ";", "}", "else", "{", "x", "=", "nViewportOffset", "+", "Dom", ".", "getDocumentScrollLeft", "(", ")", ";", "}", "if", "(", "elementHeight", "<", "viewPortHeight", ")", "{", "y", "=", "(", "viewPortHeight", "/", "2", ")", "-", "(", "elementHeight", "/", "2", ")", "+", "Dom", ".", "getDocumentScrollTop", "(", ")", ";", "}", "else", "{", "y", "=", "nViewportOffset", "+", "Dom", ".", "getDocumentScrollTop", "(", ")", ";", "}", "this", ".", "cfg", ".", "setProperty", "(", "\"xy\"", ",", "[", "parseInt", "(", "x", ",", "10", ")", ",", "parseInt", "(", "y", ",", "10", ")", "]", ")", ";", "this", ".", "cfg", ".", "refireEvent", "(", "\"iframe\"", ")", ";", "if", "(", "UA", ".", "webkit", ")", "{", "this", ".", "forceContainerRedraw", "(", ")", ";", "}", "}" ]
Centers the container in the viewport. @method center
[ "Centers", "the", "container", "in", "the", "viewport", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3791-L3819
42,182
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var pos = Dom.getXY(this.element); this.cfg.setProperty("x", pos[0], true); this.cfg.setProperty("y", pos[1], true); this.cfg.setProperty("xy", pos, true); }
javascript
function () { var pos = Dom.getXY(this.element); this.cfg.setProperty("x", pos[0], true); this.cfg.setProperty("y", pos[1], true); this.cfg.setProperty("xy", pos, true); }
[ "function", "(", ")", "{", "var", "pos", "=", "Dom", ".", "getXY", "(", "this", ".", "element", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"x\"", ",", "pos", "[", "0", "]", ",", "true", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"y\"", ",", "pos", "[", "1", "]", ",", "true", ")", ";", "this", ".", "cfg", ".", "setProperty", "(", "\"xy\"", ",", "pos", ",", "true", ")", ";", "}" ]
Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop. @method syncPosition
[ "Synchronizes", "the", "Panel", "s", "xy", "x", "and", "y", "properties", "with", "the", "Panel", "s", "position", "in", "the", "DOM", ".", "This", "is", "primarily", "used", "to", "update", "position", "information", "during", "drag", "&", "drop", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3827-L3835
42,183
neyric/webhookit
public/javascripts/yui/container/container.js
function(type, args, el) { var height = this.cfg.getProperty("height"); if ((height && height !== "auto") || (height === 0)) { this.fillHeight(el); } }
javascript
function(type, args, el) { var height = this.cfg.getProperty("height"); if ((height && height !== "auto") || (height === 0)) { this.fillHeight(el); } }
[ "function", "(", "type", ",", "args", ",", "el", ")", "{", "var", "height", "=", "this", ".", "cfg", ".", "getProperty", "(", "\"height\"", ")", ";", "if", "(", "(", "height", "&&", "height", "!==", "\"auto\"", ")", "||", "(", "height", "===", "0", ")", ")", "{", "this", ".", "fillHeight", "(", "el", ")", ";", "}", "}" ]
The default custom event handler executed when the overlay's height is changed, if the autofillheight property has been set. @method _autoFillOnHeightChange @protected @param {String} type The event type @param {Array} args The array of arguments passed to event subscribers @param {HTMLElement} el The header, body or footer element which is to be resized to fill out the containers height
[ "The", "default", "custom", "event", "handler", "executed", "when", "the", "overlay", "s", "height", "is", "changed", "if", "the", "autofillheight", "property", "has", "been", "set", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3912-L3917
42,184
neyric/webhookit
public/javascripts/yui/container/container.js
function(el) { var height = el.offsetHeight; if (el.getBoundingClientRect) { var rect = el.getBoundingClientRect(); height = rect.bottom - rect.top; } return height; }
javascript
function(el) { var height = el.offsetHeight; if (el.getBoundingClientRect) { var rect = el.getBoundingClientRect(); height = rect.bottom - rect.top; } return height; }
[ "function", "(", "el", ")", "{", "var", "height", "=", "el", ".", "offsetHeight", ";", "if", "(", "el", ".", "getBoundingClientRect", ")", "{", "var", "rect", "=", "el", ".", "getBoundingClientRect", "(", ")", ";", "height", "=", "rect", ".", "bottom", "-", "rect", ".", "top", ";", "}", "return", "height", ";", "}" ]
Returns the sub-pixel height of the el, using getBoundingClientRect, if available, otherwise returns the offsetHeight @method _getPreciseHeight @private @param {HTMLElement} el @return {Float} The sub-pixel height if supported by the browser, else the rounded height.
[ "Returns", "the", "sub", "-", "pixel", "height", "of", "the", "el", "using", "getBoundingClientRect", "if", "available", "otherwise", "returns", "the", "offsetHeight" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L3927-L3936
42,185
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var aOverlays = [], oElement = this.element; function compareZIndexDesc(p_oOverlay1, p_oOverlay2) { var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"), sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"), nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10), nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10); if (nZIndex1 > nZIndex2) { return -1; } else if (nZIndex1 < nZIndex2) { return 1; } else { return 0; } } function isOverlayElement(p_oElement) { var isOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY), Panel = YAHOO.widget.Panel; if (isOverlay && !Dom.isAncestor(oElement, p_oElement)) { if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) { aOverlays[aOverlays.length] = p_oElement.parentNode; } else { aOverlays[aOverlays.length] = p_oElement; } } } Dom.getElementsBy(isOverlayElement, "DIV", document.body); aOverlays.sort(compareZIndexDesc); var oTopOverlay = aOverlays[0], nTopZIndex; if (oTopOverlay) { nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex"); if (!isNaN(nTopZIndex)) { var bRequiresBump = false; if (oTopOverlay != oElement) { bRequiresBump = true; } else if (aOverlays.length > 1) { var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex"); // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { bRequiresBump = true; } } if (bRequiresBump) { this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); } } } }
javascript
function () { var aOverlays = [], oElement = this.element; function compareZIndexDesc(p_oOverlay1, p_oOverlay2) { var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"), sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"), nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10), nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10); if (nZIndex1 > nZIndex2) { return -1; } else if (nZIndex1 < nZIndex2) { return 1; } else { return 0; } } function isOverlayElement(p_oElement) { var isOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY), Panel = YAHOO.widget.Panel; if (isOverlay && !Dom.isAncestor(oElement, p_oElement)) { if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) { aOverlays[aOverlays.length] = p_oElement.parentNode; } else { aOverlays[aOverlays.length] = p_oElement; } } } Dom.getElementsBy(isOverlayElement, "DIV", document.body); aOverlays.sort(compareZIndexDesc); var oTopOverlay = aOverlays[0], nTopZIndex; if (oTopOverlay) { nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex"); if (!isNaN(nTopZIndex)) { var bRequiresBump = false; if (oTopOverlay != oElement) { bRequiresBump = true; } else if (aOverlays.length > 1) { var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex"); // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { bRequiresBump = true; } } if (bRequiresBump) { this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); } } } }
[ "function", "(", ")", "{", "var", "aOverlays", "=", "[", "]", ",", "oElement", "=", "this", ".", "element", ";", "function", "compareZIndexDesc", "(", "p_oOverlay1", ",", "p_oOverlay2", ")", "{", "var", "sZIndex1", "=", "Dom", ".", "getStyle", "(", "p_oOverlay1", ",", "\"zIndex\"", ")", ",", "sZIndex2", "=", "Dom", ".", "getStyle", "(", "p_oOverlay2", ",", "\"zIndex\"", ")", ",", "nZIndex1", "=", "(", "!", "sZIndex1", "||", "isNaN", "(", "sZIndex1", ")", ")", "?", "0", ":", "parseInt", "(", "sZIndex1", ",", "10", ")", ",", "nZIndex2", "=", "(", "!", "sZIndex2", "||", "isNaN", "(", "sZIndex2", ")", ")", "?", "0", ":", "parseInt", "(", "sZIndex2", ",", "10", ")", ";", "if", "(", "nZIndex1", ">", "nZIndex2", ")", "{", "return", "-", "1", ";", "}", "else", "if", "(", "nZIndex1", "<", "nZIndex2", ")", "{", "return", "1", ";", "}", "else", "{", "return", "0", ";", "}", "}", "function", "isOverlayElement", "(", "p_oElement", ")", "{", "var", "isOverlay", "=", "Dom", ".", "hasClass", "(", "p_oElement", ",", "Overlay", ".", "CSS_OVERLAY", ")", ",", "Panel", "=", "YAHOO", ".", "widget", ".", "Panel", ";", "if", "(", "isOverlay", "&&", "!", "Dom", ".", "isAncestor", "(", "oElement", ",", "p_oElement", ")", ")", "{", "if", "(", "Panel", "&&", "Dom", ".", "hasClass", "(", "p_oElement", ",", "Panel", ".", "CSS_PANEL", ")", ")", "{", "aOverlays", "[", "aOverlays", ".", "length", "]", "=", "p_oElement", ".", "parentNode", ";", "}", "else", "{", "aOverlays", "[", "aOverlays", ".", "length", "]", "=", "p_oElement", ";", "}", "}", "}", "Dom", ".", "getElementsBy", "(", "isOverlayElement", ",", "\"DIV\"", ",", "document", ".", "body", ")", ";", "aOverlays", ".", "sort", "(", "compareZIndexDesc", ")", ";", "var", "oTopOverlay", "=", "aOverlays", "[", "0", "]", ",", "nTopZIndex", ";", "if", "(", "oTopOverlay", ")", "{", "nTopZIndex", "=", "Dom", ".", "getStyle", "(", "oTopOverlay", ",", "\"zIndex\"", ")", ";", "if", "(", "!", "isNaN", "(", "nTopZIndex", ")", ")", "{", "var", "bRequiresBump", "=", "false", ";", "if", "(", "oTopOverlay", "!=", "oElement", ")", "{", "bRequiresBump", "=", "true", ";", "}", "else", "if", "(", "aOverlays", ".", "length", ">", "1", ")", "{", "var", "nNextZIndex", "=", "Dom", ".", "getStyle", "(", "aOverlays", "[", "1", "]", ",", "\"zIndex\"", ")", ";", "// Don't rely on DOM order to stack if 2 overlays are at the same zindex.", "if", "(", "!", "isNaN", "(", "nNextZIndex", ")", "&&", "(", "nTopZIndex", "==", "nNextZIndex", ")", ")", "{", "bRequiresBump", "=", "true", ";", "}", "}", "if", "(", "bRequiresBump", ")", "{", "this", ".", "cfg", ".", "setProperty", "(", "\"zindex\"", ",", "(", "parseInt", "(", "nTopZIndex", ",", "10", ")", "+", "2", ")", ")", ";", "}", "}", "}", "}" ]
Places the Overlay on top of all other instances of YAHOO.widget.Overlay. @method bringToTop
[ "Places", "the", "Overlay", "on", "top", "of", "all", "other", "instances", "of", "YAHOO", ".", "widget", ".", "Overlay", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4010-L4073
42,186
neyric/webhookit
public/javascripts/yui/container/container.js
function () { if (this.iframe) { this.iframe.parentNode.removeChild(this.iframe); } this.iframe = null; Overlay.windowResizeEvent.unsubscribe( this.doCenterOnDOMEvent, this); Overlay.windowScrollEvent.unsubscribe( this.doCenterOnDOMEvent, this); Module.textResizeEvent.unsubscribe(this._autoFillOnHeightChange); if (this._contextTriggers) { // Unsubscribe context triggers - to cover context triggers which listen for global // events such as windowResize and windowScroll. Easier just to unsubscribe all this._processTriggers(this._contextTriggers, _UNSUBSCRIBE, this._alignOnTrigger); } Overlay.superclass.destroy.call(this); }
javascript
function () { if (this.iframe) { this.iframe.parentNode.removeChild(this.iframe); } this.iframe = null; Overlay.windowResizeEvent.unsubscribe( this.doCenterOnDOMEvent, this); Overlay.windowScrollEvent.unsubscribe( this.doCenterOnDOMEvent, this); Module.textResizeEvent.unsubscribe(this._autoFillOnHeightChange); if (this._contextTriggers) { // Unsubscribe context triggers - to cover context triggers which listen for global // events such as windowResize and windowScroll. Easier just to unsubscribe all this._processTriggers(this._contextTriggers, _UNSUBSCRIBE, this._alignOnTrigger); } Overlay.superclass.destroy.call(this); }
[ "function", "(", ")", "{", "if", "(", "this", ".", "iframe", ")", "{", "this", ".", "iframe", ".", "parentNode", ".", "removeChild", "(", "this", ".", "iframe", ")", ";", "}", "this", ".", "iframe", "=", "null", ";", "Overlay", ".", "windowResizeEvent", ".", "unsubscribe", "(", "this", ".", "doCenterOnDOMEvent", ",", "this", ")", ";", "Overlay", ".", "windowScrollEvent", ".", "unsubscribe", "(", "this", ".", "doCenterOnDOMEvent", ",", "this", ")", ";", "Module", ".", "textResizeEvent", ".", "unsubscribe", "(", "this", ".", "_autoFillOnHeightChange", ")", ";", "if", "(", "this", ".", "_contextTriggers", ")", "{", "// Unsubscribe context triggers - to cover context triggers which listen for global", "// events such as windowResize and windowScroll. Easier just to unsubscribe all", "this", ".", "_processTriggers", "(", "this", ".", "_contextTriggers", ",", "_UNSUBSCRIBE", ",", "this", ".", "_alignOnTrigger", ")", ";", "}", "Overlay", ".", "superclass", ".", "destroy", ".", "call", "(", "this", ")", ";", "}" ]
Removes the Overlay element from the DOM and sets all child elements to null. @method destroy
[ "Removes", "the", "Overlay", "element", "from", "the", "DOM", "and", "sets", "all", "child", "elements", "to", "null", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4080-L4103
42,187
neyric/webhookit
public/javascripts/yui/container/container.js
function(overlay) { var mgr = this; if (!overlay.focusEvent) { overlay.focusEvent = overlay.createEvent("focus"); overlay.focusEvent.signature = CustomEvent.LIST; overlay.focusEvent._managed = true; } else { overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler, overlay, mgr); } if (!overlay.focus) { Event.on(overlay.element, mgr.cfg.getProperty("focusevent"), mgr._onOverlayElementFocus, null, overlay); overlay.focus = function () { if (mgr._manageFocus(this)) { // For Panel/Dialog if (this.cfg.getProperty("visible") && this.focusFirst) { this.focusFirst(); } this.focusEvent.fire(); } }; overlay.focus._managed = true; } }
javascript
function(overlay) { var mgr = this; if (!overlay.focusEvent) { overlay.focusEvent = overlay.createEvent("focus"); overlay.focusEvent.signature = CustomEvent.LIST; overlay.focusEvent._managed = true; } else { overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler, overlay, mgr); } if (!overlay.focus) { Event.on(overlay.element, mgr.cfg.getProperty("focusevent"), mgr._onOverlayElementFocus, null, overlay); overlay.focus = function () { if (mgr._manageFocus(this)) { // For Panel/Dialog if (this.cfg.getProperty("visible") && this.focusFirst) { this.focusFirst(); } this.focusEvent.fire(); } }; overlay.focus._managed = true; } }
[ "function", "(", "overlay", ")", "{", "var", "mgr", "=", "this", ";", "if", "(", "!", "overlay", ".", "focusEvent", ")", "{", "overlay", ".", "focusEvent", "=", "overlay", ".", "createEvent", "(", "\"focus\"", ")", ";", "overlay", ".", "focusEvent", ".", "signature", "=", "CustomEvent", ".", "LIST", ";", "overlay", ".", "focusEvent", ".", "_managed", "=", "true", ";", "}", "else", "{", "overlay", ".", "focusEvent", ".", "subscribe", "(", "mgr", ".", "_onOverlayFocusHandler", ",", "overlay", ",", "mgr", ")", ";", "}", "if", "(", "!", "overlay", ".", "focus", ")", "{", "Event", ".", "on", "(", "overlay", ".", "element", ",", "mgr", ".", "cfg", ".", "getProperty", "(", "\"focusevent\"", ")", ",", "mgr", ".", "_onOverlayElementFocus", ",", "null", ",", "overlay", ")", ";", "overlay", ".", "focus", "=", "function", "(", ")", "{", "if", "(", "mgr", ".", "_manageFocus", "(", "this", ")", ")", "{", "// For Panel/Dialog", "if", "(", "this", ".", "cfg", ".", "getProperty", "(", "\"visible\"", ")", "&&", "this", ".", "focusFirst", ")", "{", "this", ".", "focusFirst", "(", ")", ";", "}", "this", ".", "focusEvent", ".", "fire", "(", ")", ";", "}", "}", ";", "overlay", ".", "focus", ".", "_managed", "=", "true", ";", "}", "}" ]
Subscribes to the Overlay based instance focusEvent, to allow the OverlayManager to monitor focus state. If the instance already has a focusEvent (e.g. Menu), OverlayManager will subscribe to the existing focusEvent, however if a focusEvent or focus method does not exist on the instance, the _bindFocus method will add them, and the focus method will update the OverlayManager's state directly. @method _bindFocus @param {Overlay} overlay The overlay for which focus needs to be managed @protected
[ "Subscribes", "to", "the", "Overlay", "based", "instance", "focusEvent", "to", "allow", "the", "OverlayManager", "to", "monitor", "focus", "state", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4463-L4487
42,188
neyric/webhookit
public/javascripts/yui/container/container.js
function(overlay) { var mgr = this; if (!overlay.blurEvent) { overlay.blurEvent = overlay.createEvent("blur"); overlay.blurEvent.signature = CustomEvent.LIST; overlay.focusEvent._managed = true; } else { overlay.blurEvent.subscribe(mgr._onOverlayBlurHandler, overlay, mgr); } if (!overlay.blur) { overlay.blur = function () { if (mgr._manageBlur(this)) { this.blurEvent.fire(); } }; overlay.blur._managed = true; } overlay.hideEvent.subscribe(overlay.blur); }
javascript
function(overlay) { var mgr = this; if (!overlay.blurEvent) { overlay.blurEvent = overlay.createEvent("blur"); overlay.blurEvent.signature = CustomEvent.LIST; overlay.focusEvent._managed = true; } else { overlay.blurEvent.subscribe(mgr._onOverlayBlurHandler, overlay, mgr); } if (!overlay.blur) { overlay.blur = function () { if (mgr._manageBlur(this)) { this.blurEvent.fire(); } }; overlay.blur._managed = true; } overlay.hideEvent.subscribe(overlay.blur); }
[ "function", "(", "overlay", ")", "{", "var", "mgr", "=", "this", ";", "if", "(", "!", "overlay", ".", "blurEvent", ")", "{", "overlay", ".", "blurEvent", "=", "overlay", ".", "createEvent", "(", "\"blur\"", ")", ";", "overlay", ".", "blurEvent", ".", "signature", "=", "CustomEvent", ".", "LIST", ";", "overlay", ".", "focusEvent", ".", "_managed", "=", "true", ";", "}", "else", "{", "overlay", ".", "blurEvent", ".", "subscribe", "(", "mgr", ".", "_onOverlayBlurHandler", ",", "overlay", ",", "mgr", ")", ";", "}", "if", "(", "!", "overlay", ".", "blur", ")", "{", "overlay", ".", "blur", "=", "function", "(", ")", "{", "if", "(", "mgr", ".", "_manageBlur", "(", "this", ")", ")", "{", "this", ".", "blurEvent", ".", "fire", "(", ")", ";", "}", "}", ";", "overlay", ".", "blur", ".", "_managed", "=", "true", ";", "}", "overlay", ".", "hideEvent", ".", "subscribe", "(", "overlay", ".", "blur", ")", ";", "}" ]
Subscribes to the Overlay based instance's blurEvent to allow the OverlayManager to monitor blur state. If the instance already has a blurEvent (e.g. Menu), OverlayManager will subscribe to the existing blurEvent, however if a blurEvent or blur method does not exist on the instance, the _bindBlur method will add them, and the blur method update the OverlayManager's state directly. @method _bindBlur @param {Overlay} overlay The overlay for which blur needs to be managed @protected
[ "Subscribes", "to", "the", "Overlay", "based", "instance", "s", "blurEvent", "to", "allow", "the", "OverlayManager", "to", "monitor", "blur", "state", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4502-L4523
42,189
neyric/webhookit
public/javascripts/yui/container/container.js
function (overlay) { var registered = false, i, n; if (overlay instanceof Overlay) { overlay.cfg.addProperty("manager", { value: this } ); this._bindFocus(overlay); this._bindBlur(overlay); this._bindDestroy(overlay); this._syncZIndex(overlay); this.overlays.push(overlay); this.bringToTop(overlay); registered = true; } else if (overlay instanceof Array) { for (i = 0, n = overlay.length; i < n; i++) { registered = this.register(overlay[i]) || registered; } } return registered; }
javascript
function (overlay) { var registered = false, i, n; if (overlay instanceof Overlay) { overlay.cfg.addProperty("manager", { value: this } ); this._bindFocus(overlay); this._bindBlur(overlay); this._bindDestroy(overlay); this._syncZIndex(overlay); this.overlays.push(overlay); this.bringToTop(overlay); registered = true; } else if (overlay instanceof Array) { for (i = 0, n = overlay.length; i < n; i++) { registered = this.register(overlay[i]) || registered; } } return registered; }
[ "function", "(", "overlay", ")", "{", "var", "registered", "=", "false", ",", "i", ",", "n", ";", "if", "(", "overlay", "instanceof", "Overlay", ")", "{", "overlay", ".", "cfg", ".", "addProperty", "(", "\"manager\"", ",", "{", "value", ":", "this", "}", ")", ";", "this", ".", "_bindFocus", "(", "overlay", ")", ";", "this", ".", "_bindBlur", "(", "overlay", ")", ";", "this", ".", "_bindDestroy", "(", "overlay", ")", ";", "this", ".", "_syncZIndex", "(", "overlay", ")", ";", "this", ".", "overlays", ".", "push", "(", "overlay", ")", ";", "this", ".", "bringToTop", "(", "overlay", ")", ";", "registered", "=", "true", ";", "}", "else", "if", "(", "overlay", "instanceof", "Array", ")", "{", "for", "(", "i", "=", "0", ",", "n", "=", "overlay", ".", "length", ";", "i", "<", "n", ";", "i", "++", ")", "{", "registered", "=", "this", ".", "register", "(", "overlay", "[", "i", "]", ")", "||", "registered", ";", "}", "}", "return", "registered", ";", "}" ]
Registers an Overlay or an array of Overlays with the manager. Upon registration, the Overlay receives functions for focus and blur, along with CustomEvents for each. @method register @param {Overlay} overlay An Overlay to register with the manager. @param {Overlay[]} overlay An array of Overlays to register with the manager. @return {boolean} true if any Overlays are registered.
[ "Registers", "an", "Overlay", "or", "an", "array", "of", "Overlays", "with", "the", "manager", ".", "Upon", "registration", "the", "Overlay", "receives", "functions", "for", "focus", "and", "blur", "along", "with", "CustomEvents", "for", "each", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4566-L4595
42,190
neyric/webhookit
public/javascripts/yui/container/container.js
function (p_oOverlay) { var oOverlay = this.find(p_oOverlay), nTopZIndex, oTopOverlay, aOverlays; if (oOverlay) { aOverlays = this.overlays; aOverlays.sort(this.compareZIndexDesc); oTopOverlay = aOverlays[0]; if (oTopOverlay) { nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex"); if (!isNaN(nTopZIndex)) { var bRequiresBump = false; if (oTopOverlay !== oOverlay) { bRequiresBump = true; } else if (aOverlays.length > 1) { var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex"); // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { bRequiresBump = true; } } if (bRequiresBump) { oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); } } aOverlays.sort(this.compareZIndexDesc); } } }
javascript
function (p_oOverlay) { var oOverlay = this.find(p_oOverlay), nTopZIndex, oTopOverlay, aOverlays; if (oOverlay) { aOverlays = this.overlays; aOverlays.sort(this.compareZIndexDesc); oTopOverlay = aOverlays[0]; if (oTopOverlay) { nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex"); if (!isNaN(nTopZIndex)) { var bRequiresBump = false; if (oTopOverlay !== oOverlay) { bRequiresBump = true; } else if (aOverlays.length > 1) { var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex"); // Don't rely on DOM order to stack if 2 overlays are at the same zindex. if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) { bRequiresBump = true; } } if (bRequiresBump) { oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2)); } } aOverlays.sort(this.compareZIndexDesc); } } }
[ "function", "(", "p_oOverlay", ")", "{", "var", "oOverlay", "=", "this", ".", "find", "(", "p_oOverlay", ")", ",", "nTopZIndex", ",", "oTopOverlay", ",", "aOverlays", ";", "if", "(", "oOverlay", ")", "{", "aOverlays", "=", "this", ".", "overlays", ";", "aOverlays", ".", "sort", "(", "this", ".", "compareZIndexDesc", ")", ";", "oTopOverlay", "=", "aOverlays", "[", "0", "]", ";", "if", "(", "oTopOverlay", ")", "{", "nTopZIndex", "=", "Dom", ".", "getStyle", "(", "oTopOverlay", ".", "element", ",", "\"zIndex\"", ")", ";", "if", "(", "!", "isNaN", "(", "nTopZIndex", ")", ")", "{", "var", "bRequiresBump", "=", "false", ";", "if", "(", "oTopOverlay", "!==", "oOverlay", ")", "{", "bRequiresBump", "=", "true", ";", "}", "else", "if", "(", "aOverlays", ".", "length", ">", "1", ")", "{", "var", "nNextZIndex", "=", "Dom", ".", "getStyle", "(", "aOverlays", "[", "1", "]", ".", "element", ",", "\"zIndex\"", ")", ";", "// Don't rely on DOM order to stack if 2 overlays are at the same zindex.", "if", "(", "!", "isNaN", "(", "nNextZIndex", ")", "&&", "(", "nTopZIndex", "==", "nNextZIndex", ")", ")", "{", "bRequiresBump", "=", "true", ";", "}", "}", "if", "(", "bRequiresBump", ")", "{", "oOverlay", ".", "cfg", ".", "setProperty", "(", "\"zindex\"", ",", "(", "parseInt", "(", "nTopZIndex", ",", "10", ")", "+", "2", ")", ")", ";", "}", "}", "aOverlays", ".", "sort", "(", "this", ".", "compareZIndexDesc", ")", ";", "}", "}", "}" ]
Places the specified Overlay instance on top of all other Overlay instances. @method bringToTop @param {YAHOO.widget.Overlay} p_oOverlay Object representing an Overlay instance. @param {String} p_oOverlay String representing the id of an Overlay instance.
[ "Places", "the", "specified", "Overlay", "instance", "on", "top", "of", "all", "other", "Overlay", "instances", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4606-L4644
42,191
neyric/webhookit
public/javascripts/yui/container/container.js
function (overlay) { var isInstance = overlay instanceof Overlay, overlays = this.overlays, n = overlays.length, found = null, o, i; if (isInstance || typeof overlay == "string") { for (i = n-1; i >= 0; i--) { o = overlays[i]; if ((isInstance && (o === overlay)) || (o.id == overlay)) { found = o; break; } } } return found; }
javascript
function (overlay) { var isInstance = overlay instanceof Overlay, overlays = this.overlays, n = overlays.length, found = null, o, i; if (isInstance || typeof overlay == "string") { for (i = n-1; i >= 0; i--) { o = overlays[i]; if ((isInstance && (o === overlay)) || (o.id == overlay)) { found = o; break; } } } return found; }
[ "function", "(", "overlay", ")", "{", "var", "isInstance", "=", "overlay", "instanceof", "Overlay", ",", "overlays", "=", "this", ".", "overlays", ",", "n", "=", "overlays", ".", "length", ",", "found", "=", "null", ",", "o", ",", "i", ";", "if", "(", "isInstance", "||", "typeof", "overlay", "==", "\"string\"", ")", "{", "for", "(", "i", "=", "n", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "o", "=", "overlays", "[", "i", "]", ";", "if", "(", "(", "isInstance", "&&", "(", "o", "===", "overlay", ")", ")", "||", "(", "o", ".", "id", "==", "overlay", ")", ")", "{", "found", "=", "o", ";", "break", ";", "}", "}", "}", "return", "found", ";", "}" ]
Attempts to locate an Overlay by instance or ID. @method find @param {Overlay} overlay An Overlay to locate within the manager @param {String} overlay An Overlay id to locate within the manager @return {Overlay} The requested Overlay, if found, or null if it cannot be located.
[ "Attempts", "to", "locate", "an", "Overlay", "by", "instance", "or", "ID", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4654-L4674
42,192
neyric/webhookit
public/javascripts/yui/container/container.js
function (o1, o2) { var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed) zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom. if (zIndex1 === null && zIndex2 === null) { return 0; } else if (zIndex1 === null){ return 1; } else if (zIndex2 === null) { return -1; } else if (zIndex1 > zIndex2) { return -1; } else if (zIndex1 < zIndex2) { return 1; } else { return 0; } }
javascript
function (o1, o2) { var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed) zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom. if (zIndex1 === null && zIndex2 === null) { return 0; } else if (zIndex1 === null){ return 1; } else if (zIndex2 === null) { return -1; } else if (zIndex1 > zIndex2) { return -1; } else if (zIndex1 < zIndex2) { return 1; } else { return 0; } }
[ "function", "(", "o1", ",", "o2", ")", "{", "var", "zIndex1", "=", "(", "o1", ".", "cfg", ")", "?", "o1", ".", "cfg", ".", "getProperty", "(", "\"zIndex\"", ")", ":", "null", ",", "// Sort invalid (destroyed)", "zIndex2", "=", "(", "o2", ".", "cfg", ")", "?", "o2", ".", "cfg", ".", "getProperty", "(", "\"zIndex\"", ")", ":", "null", ";", "// objects at bottom.", "if", "(", "zIndex1", "===", "null", "&&", "zIndex2", "===", "null", ")", "{", "return", "0", ";", "}", "else", "if", "(", "zIndex1", "===", "null", ")", "{", "return", "1", ";", "}", "else", "if", "(", "zIndex2", "===", "null", ")", "{", "return", "-", "1", ";", "}", "else", "if", "(", "zIndex1", ">", "zIndex2", ")", "{", "return", "-", "1", ";", "}", "else", "if", "(", "zIndex1", "<", "zIndex2", ")", "{", "return", "1", ";", "}", "else", "{", "return", "0", ";", "}", "}" ]
Used for sorting the manager's Overlays by z-index. @method compareZIndexDesc @private @return {Number} 0, 1, or -1, depending on where the Overlay should fall in the stacking order.
[ "Used", "for", "sorting", "the", "manager", "s", "Overlays", "by", "z", "-", "index", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4683-L4701
42,193
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var overlays = this.overlays, n = overlays.length, i; for (i = n - 1; i >= 0; i--) { overlays[i].show(); } }
javascript
function () { var overlays = this.overlays, n = overlays.length, i; for (i = n - 1; i >= 0; i--) { overlays[i].show(); } }
[ "function", "(", ")", "{", "var", "overlays", "=", "this", ".", "overlays", ",", "n", "=", "overlays", ".", "length", ",", "i", ";", "for", "(", "i", "=", "n", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "overlays", "[", "i", "]", ".", "show", "(", ")", ";", "}", "}" ]
Shows all Overlays in the manager. @method showAll
[ "Shows", "all", "Overlays", "in", "the", "manager", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4707-L4715
42,194
neyric/webhookit
public/javascripts/yui/container/container.js
function () { var overlays = this.overlays, n = overlays.length, i; for (i = n - 1; i >= 0; i--) { overlays[i].hide(); } }
javascript
function () { var overlays = this.overlays, n = overlays.length, i; for (i = n - 1; i >= 0; i--) { overlays[i].hide(); } }
[ "function", "(", ")", "{", "var", "overlays", "=", "this", ".", "overlays", ",", "n", "=", "overlays", ".", "length", ",", "i", ";", "for", "(", "i", "=", "n", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "overlays", "[", "i", "]", ".", "hide", "(", ")", ";", "}", "}" ]
Hides all Overlays in the manager. @method hideAll
[ "Hides", "all", "Overlays", "in", "the", "manager", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4721-L4729
42,195
neyric/webhookit
public/javascripts/yui/container/container.js
function (el, userConfig) { Tooltip.superclass.init.call(this, el); this.beforeInitEvent.fire(Tooltip); Dom.addClass(this.element, Tooltip.CSS_TOOLTIP); if (userConfig) { this.cfg.applyConfig(userConfig, true); } this.cfg.queueProperty("visible", false); this.cfg.queueProperty("constraintoviewport", true); this.setBody(""); this.subscribe("changeContent", setWidthToOffsetWidth); this.subscribe("init", onInit); this.subscribe("render", this.onRender); this.initEvent.fire(Tooltip); }
javascript
function (el, userConfig) { Tooltip.superclass.init.call(this, el); this.beforeInitEvent.fire(Tooltip); Dom.addClass(this.element, Tooltip.CSS_TOOLTIP); if (userConfig) { this.cfg.applyConfig(userConfig, true); } this.cfg.queueProperty("visible", false); this.cfg.queueProperty("constraintoviewport", true); this.setBody(""); this.subscribe("changeContent", setWidthToOffsetWidth); this.subscribe("init", onInit); this.subscribe("render", this.onRender); this.initEvent.fire(Tooltip); }
[ "function", "(", "el", ",", "userConfig", ")", "{", "Tooltip", ".", "superclass", ".", "init", ".", "call", "(", "this", ",", "el", ")", ";", "this", ".", "beforeInitEvent", ".", "fire", "(", "Tooltip", ")", ";", "Dom", ".", "addClass", "(", "this", ".", "element", ",", "Tooltip", ".", "CSS_TOOLTIP", ")", ";", "if", "(", "userConfig", ")", "{", "this", ".", "cfg", ".", "applyConfig", "(", "userConfig", ",", "true", ")", ";", "}", "this", ".", "cfg", ".", "queueProperty", "(", "\"visible\"", ",", "false", ")", ";", "this", ".", "cfg", ".", "queueProperty", "(", "\"constraintoviewport\"", ",", "true", ")", ";", "this", ".", "setBody", "(", "\"\"", ")", ";", "this", ".", "subscribe", "(", "\"changeContent\"", ",", "setWidthToOffsetWidth", ")", ";", "this", ".", "subscribe", "(", "\"init\"", ",", "onInit", ")", ";", "this", ".", "subscribe", "(", "\"render\"", ",", "this", ".", "onRender", ")", ";", "this", ".", "initEvent", ".", "fire", "(", "Tooltip", ")", ";", "}" ]
The Tooltip initialization method. This method is automatically called by the constructor. A Tooltip is automatically rendered by the init method, and it also is set to be invisible by default, and constrained to viewport by default as well. @method init @param {String} el The element ID representing the Tooltip <em>OR</em> @param {HTMLElement} el The element representing the Tooltip @param {Object} userConfig The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.
[ "The", "Tooltip", "initialization", "method", ".", "This", "method", "is", "automatically", "called", "by", "the", "constructor", ".", "A", "Tooltip", "is", "automatically", "rendered", "by", "the", "init", "method", "and", "it", "also", "is", "set", "to", "be", "invisible", "by", "default", "and", "constrained", "to", "viewport", "by", "default", "as", "well", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4928-L4951
42,196
neyric/webhookit
public/javascripts/yui/container/container.js
function () { Tooltip.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired when user mouses over a context element. Returning false from * a subscriber to this event will prevent the tooltip from being displayed for * the current context element. * * @event contextMouseOverEvent * @param {HTMLElement} context The context element which the user just moused over * @param {DOMEvent} e The DOM event object, associated with the mouse over */ this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER); this.contextMouseOverEvent.signature = SIGNATURE; /** * CustomEvent fired when the user mouses out of a context element. * * @event contextMouseOutEvent * @param {HTMLElement} context The context element which the user just moused out of * @param {DOMEvent} e The DOM event object, associated with the mouse out */ this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT); this.contextMouseOutEvent.signature = SIGNATURE; /** * CustomEvent fired just before the tooltip is displayed for the current context. * <p> * You can subscribe to this event if you need to set up the text for the * tooltip based on the context element for which it is about to be displayed. * </p> * <p>This event differs from the beforeShow event in following respects:</p> * <ol> * <li> * When moving from one context element to another, if the tooltip is not * hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not * be fired when the tooltip is displayed for the new context since it is already visible. * However the contextTrigger event is always fired before displaying the tooltip for * a new context. * </li> * <li> * The trigger event provides access to the context element, allowing you to * set the text of the tooltip based on context element for which the tooltip is * triggered. * </li> * </ol> * <p> * It is not possible to prevent the tooltip from being displayed * using this event. You can use the contextMouseOverEvent if you need to prevent * the tooltip from being displayed. * </p> * @event contextTriggerEvent * @param {HTMLElement} context The context element for which the tooltip is triggered */ this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER); this.contextTriggerEvent.signature = SIGNATURE; }
javascript
function () { Tooltip.superclass.initEvents.call(this); var SIGNATURE = CustomEvent.LIST; /** * CustomEvent fired when user mouses over a context element. Returning false from * a subscriber to this event will prevent the tooltip from being displayed for * the current context element. * * @event contextMouseOverEvent * @param {HTMLElement} context The context element which the user just moused over * @param {DOMEvent} e The DOM event object, associated with the mouse over */ this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER); this.contextMouseOverEvent.signature = SIGNATURE; /** * CustomEvent fired when the user mouses out of a context element. * * @event contextMouseOutEvent * @param {HTMLElement} context The context element which the user just moused out of * @param {DOMEvent} e The DOM event object, associated with the mouse out */ this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT); this.contextMouseOutEvent.signature = SIGNATURE; /** * CustomEvent fired just before the tooltip is displayed for the current context. * <p> * You can subscribe to this event if you need to set up the text for the * tooltip based on the context element for which it is about to be displayed. * </p> * <p>This event differs from the beforeShow event in following respects:</p> * <ol> * <li> * When moving from one context element to another, if the tooltip is not * hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not * be fired when the tooltip is displayed for the new context since it is already visible. * However the contextTrigger event is always fired before displaying the tooltip for * a new context. * </li> * <li> * The trigger event provides access to the context element, allowing you to * set the text of the tooltip based on context element for which the tooltip is * triggered. * </li> * </ol> * <p> * It is not possible to prevent the tooltip from being displayed * using this event. You can use the contextMouseOverEvent if you need to prevent * the tooltip from being displayed. * </p> * @event contextTriggerEvent * @param {HTMLElement} context The context element for which the tooltip is triggered */ this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER); this.contextTriggerEvent.signature = SIGNATURE; }
[ "function", "(", ")", "{", "Tooltip", ".", "superclass", ".", "initEvents", ".", "call", "(", "this", ")", ";", "var", "SIGNATURE", "=", "CustomEvent", ".", "LIST", ";", "/**\n * CustomEvent fired when user mouses over a context element. Returning false from\n * a subscriber to this event will prevent the tooltip from being displayed for\n * the current context element.\n * \n * @event contextMouseOverEvent\n * @param {HTMLElement} context The context element which the user just moused over\n * @param {DOMEvent} e The DOM event object, associated with the mouse over\n */", "this", ".", "contextMouseOverEvent", "=", "this", ".", "createEvent", "(", "EVENT_TYPES", ".", "CONTEXT_MOUSE_OVER", ")", ";", "this", ".", "contextMouseOverEvent", ".", "signature", "=", "SIGNATURE", ";", "/**\n * CustomEvent fired when the user mouses out of a context element.\n * \n * @event contextMouseOutEvent\n * @param {HTMLElement} context The context element which the user just moused out of\n * @param {DOMEvent} e The DOM event object, associated with the mouse out\n */", "this", ".", "contextMouseOutEvent", "=", "this", ".", "createEvent", "(", "EVENT_TYPES", ".", "CONTEXT_MOUSE_OUT", ")", ";", "this", ".", "contextMouseOutEvent", ".", "signature", "=", "SIGNATURE", ";", "/**\n * CustomEvent fired just before the tooltip is displayed for the current context.\n * <p>\n * You can subscribe to this event if you need to set up the text for the \n * tooltip based on the context element for which it is about to be displayed.\n * </p>\n * <p>This event differs from the beforeShow event in following respects:</p>\n * <ol>\n * <li>\n * When moving from one context element to another, if the tooltip is not\n * hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not\n * be fired when the tooltip is displayed for the new context since it is already visible.\n * However the contextTrigger event is always fired before displaying the tooltip for\n * a new context.\n * </li>\n * <li>\n * The trigger event provides access to the context element, allowing you to \n * set the text of the tooltip based on context element for which the tooltip is\n * triggered.\n * </li>\n * </ol>\n * <p>\n * It is not possible to prevent the tooltip from being displayed\n * using this event. You can use the contextMouseOverEvent if you need to prevent\n * the tooltip from being displayed.\n * </p>\n * @event contextTriggerEvent\n * @param {HTMLElement} context The context element for which the tooltip is triggered\n */", "this", ".", "contextTriggerEvent", "=", "this", ".", "createEvent", "(", "EVENT_TYPES", ".", "CONTEXT_TRIGGER", ")", ";", "this", ".", "contextTriggerEvent", ".", "signature", "=", "SIGNATURE", ";", "}" ]
Initializes the custom events for Tooltip @method initEvents
[ "Initializes", "the", "custom", "events", "for", "Tooltip" ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L4957-L5015
42,197
neyric/webhookit
public/javascripts/yui/container/container.js
function (type, args, obj) { var container = args[0]; if (typeof container == 'string') { this.cfg.setProperty("container", document.getElementById(container), true); } }
javascript
function (type, args, obj) { var container = args[0]; if (typeof container == 'string') { this.cfg.setProperty("container", document.getElementById(container), true); } }
[ "function", "(", "type", ",", "args", ",", "obj", ")", "{", "var", "container", "=", "args", "[", "0", "]", ";", "if", "(", "typeof", "container", "==", "'string'", ")", "{", "this", ".", "cfg", ".", "setProperty", "(", "\"container\"", ",", "document", ".", "getElementById", "(", "container", ")", ",", "true", ")", ";", "}", "}" ]
The default event handler fired when the "container" property is changed. @method configContainer @param {String} type The CustomEvent type (usually the property name) @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property. @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
[ "The", "default", "event", "handler", "fired", "when", "the", "container", "property", "is", "changed", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L5188-L5194
42,198
neyric/webhookit
public/javascripts/yui/container/container.js
function (e, obj) { var context = this; if (context.title) { obj._tempTitle = context.title; context.title = ""; } // Fire first, to honor disabled set in the listner if (obj.fireEvent("contextMouseOver", context, e) !== false && !obj.cfg.getProperty("disabled")) { // Stop the tooltip from being hidden (set on last mouseout) if (obj.hideProcId) { clearTimeout(obj.hideProcId); obj.hideProcId = null; } Event.on(context, "mousemove", obj.onContextMouseMove, obj); /** * The unique process ID associated with the thread responsible * for showing the Tooltip. * @type int */ obj.showProcId = obj.doShow(e, context); } }
javascript
function (e, obj) { var context = this; if (context.title) { obj._tempTitle = context.title; context.title = ""; } // Fire first, to honor disabled set in the listner if (obj.fireEvent("contextMouseOver", context, e) !== false && !obj.cfg.getProperty("disabled")) { // Stop the tooltip from being hidden (set on last mouseout) if (obj.hideProcId) { clearTimeout(obj.hideProcId); obj.hideProcId = null; } Event.on(context, "mousemove", obj.onContextMouseMove, obj); /** * The unique process ID associated with the thread responsible * for showing the Tooltip. * @type int */ obj.showProcId = obj.doShow(e, context); } }
[ "function", "(", "e", ",", "obj", ")", "{", "var", "context", "=", "this", ";", "if", "(", "context", ".", "title", ")", "{", "obj", ".", "_tempTitle", "=", "context", ".", "title", ";", "context", ".", "title", "=", "\"\"", ";", "}", "// Fire first, to honor disabled set in the listner", "if", "(", "obj", ".", "fireEvent", "(", "\"contextMouseOver\"", ",", "context", ",", "e", ")", "!==", "false", "&&", "!", "obj", ".", "cfg", ".", "getProperty", "(", "\"disabled\"", ")", ")", "{", "// Stop the tooltip from being hidden (set on last mouseout)", "if", "(", "obj", ".", "hideProcId", ")", "{", "clearTimeout", "(", "obj", ".", "hideProcId", ")", ";", "obj", ".", "hideProcId", "=", "null", ";", "}", "Event", ".", "on", "(", "context", ",", "\"mousemove\"", ",", "obj", ".", "onContextMouseMove", ",", "obj", ")", ";", "/**\n * The unique process ID associated with the thread responsible \n * for showing the Tooltip.\n * @type int\n */", "obj", ".", "showProcId", "=", "obj", ".", "doShow", "(", "e", ",", "context", ")", ";", "}", "}" ]
The default event handler fired when the user mouses over the context element. @method onContextMouseOver @param {DOMEvent} e The current DOM event @param {Object} obj The object argument
[ "The", "default", "event", "handler", "fired", "when", "the", "user", "mouses", "over", "the", "context", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L5301-L5328
42,199
neyric/webhookit
public/javascripts/yui/container/container.js
function (e, obj) { var el = this; if (obj._tempTitle) { el.title = obj._tempTitle; obj._tempTitle = null; } if (obj.showProcId) { clearTimeout(obj.showProcId); obj.showProcId = null; } if (obj.hideProcId) { clearTimeout(obj.hideProcId); obj.hideProcId = null; } obj.fireEvent("contextMouseOut", el, e); obj.hideProcId = setTimeout(function () { obj.hide(); }, obj.cfg.getProperty("hidedelay")); }
javascript
function (e, obj) { var el = this; if (obj._tempTitle) { el.title = obj._tempTitle; obj._tempTitle = null; } if (obj.showProcId) { clearTimeout(obj.showProcId); obj.showProcId = null; } if (obj.hideProcId) { clearTimeout(obj.hideProcId); obj.hideProcId = null; } obj.fireEvent("contextMouseOut", el, e); obj.hideProcId = setTimeout(function () { obj.hide(); }, obj.cfg.getProperty("hidedelay")); }
[ "function", "(", "e", ",", "obj", ")", "{", "var", "el", "=", "this", ";", "if", "(", "obj", ".", "_tempTitle", ")", "{", "el", ".", "title", "=", "obj", ".", "_tempTitle", ";", "obj", ".", "_tempTitle", "=", "null", ";", "}", "if", "(", "obj", ".", "showProcId", ")", "{", "clearTimeout", "(", "obj", ".", "showProcId", ")", ";", "obj", ".", "showProcId", "=", "null", ";", "}", "if", "(", "obj", ".", "hideProcId", ")", "{", "clearTimeout", "(", "obj", ".", "hideProcId", ")", ";", "obj", ".", "hideProcId", "=", "null", ";", "}", "obj", ".", "fireEvent", "(", "\"contextMouseOut\"", ",", "el", ",", "e", ")", ";", "obj", ".", "hideProcId", "=", "setTimeout", "(", "function", "(", ")", "{", "obj", ".", "hide", "(", ")", ";", "}", ",", "obj", ".", "cfg", ".", "getProperty", "(", "\"hidedelay\"", ")", ")", ";", "}" ]
The default event handler fired when the user mouses out of the context element. @method onContextMouseOut @param {DOMEvent} e The current DOM event @param {Object} obj The object argument
[ "The", "default", "event", "handler", "fired", "when", "the", "user", "mouses", "out", "of", "the", "context", "element", "." ]
13abf6f072e23d536432235da78fd3e4e5d742b6
https://github.com/neyric/webhookit/blob/13abf6f072e23d536432235da78fd3e4e5d742b6/public/javascripts/yui/container/container.js#L5337-L5360