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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
16,400 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | addDynamicCssRule | function addDynamicCssRule(uniqueToken, site, selector, body) {
flushDynamicCssRules();
var rule = "." + _Constants._listViewClass + " ." + uniqueToken + " " + selector + " { " +
body +
"}";
var perfId = "_addDynamicCssRule:" + uniqueToken + ",info";
if (site) {
... | javascript | function addDynamicCssRule(uniqueToken, site, selector, body) {
flushDynamicCssRules();
var rule = "." + _Constants._listViewClass + " ." + uniqueToken + " " + selector + " { " +
body +
"}";
var perfId = "_addDynamicCssRule:" + uniqueToken + ",info";
if (site) {
... | [
"function",
"addDynamicCssRule",
"(",
"uniqueToken",
",",
"site",
",",
"selector",
",",
"body",
")",
"{",
"flushDynamicCssRules",
"(",
")",
";",
"var",
"rule",
"=",
"\".\"",
"+",
"_Constants",
".",
"_listViewClass",
"+",
"\" .\"",
"+",
"uniqueToken",
"+",
"\... | Creates a dynamic CSS rule and adds it to the DOM. uniqueToken is a class name which uniquely identifies a set of related rules. These rules may be removed using deleteDynamicCssRule. uniqueToken should be created using uniqueCssClassName. | [
"Creates",
"a",
"dynamic",
"CSS",
"rule",
"and",
"adds",
"it",
"to",
"the",
"DOM",
".",
"uniqueToken",
"is",
"a",
"class",
"name",
"which",
"uniquely",
"identifies",
"a",
"set",
"of",
"related",
"rules",
".",
"These",
"rules",
"may",
"be",
"removed",
"us... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L11989-L12001 |
16,401 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | getOuter | function getOuter(side, element) {
return getDimension(element, "margin" + side) +
getDimension(element, "border" + side + "Width") +
getDimension(element, "padding" + side);
} | javascript | function getOuter(side, element) {
return getDimension(element, "margin" + side) +
getDimension(element, "border" + side + "Width") +
getDimension(element, "padding" + side);
} | [
"function",
"getOuter",
"(",
"side",
",",
"element",
")",
"{",
"return",
"getDimension",
"(",
"element",
",",
"\"margin\"",
"+",
"side",
")",
"+",
"getDimension",
"(",
"element",
",",
"\"border\"",
"+",
"side",
"+",
"\"Width\"",
")",
"+",
"getDimension",
"... | Returns the sum of the margin, border, and padding for the side of the element specified by side. side can be "Left", "Right", "Top", or "Bottom". | [
"Returns",
"the",
"sum",
"of",
"the",
"margin",
"border",
"and",
"padding",
"for",
"the",
"side",
"of",
"the",
"element",
"specified",
"by",
"side",
".",
"side",
"can",
"be",
"Left",
"Right",
"Top",
"or",
"Bottom",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L12024-L12028 |
16,402 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LayoutCommon_initialize | function _LayoutCommon_initialize(site, groupsEnabled) {
site._writeProfilerMark("Layout:initialize,info");
if (!this._inListMode) {
_ElementUtilities.addClass(site.surface, _Constants._gridLayoutClass);
}
if (this.... | javascript | function _LayoutCommon_initialize(site, groupsEnabled) {
site._writeProfilerMark("Layout:initialize,info");
if (!this._inListMode) {
_ElementUtilities.addClass(site.surface, _Constants._gridLayoutClass);
}
if (this.... | [
"function",
"_LayoutCommon_initialize",
"(",
"site",
",",
"groupsEnabled",
")",
"{",
"site",
".",
"_writeProfilerMark",
"(",
"\"Layout:initialize,info\"",
")",
";",
"if",
"(",
"!",
"this",
".",
"_inListMode",
")",
"{",
"_ElementUtilities",
".",
"addClass",
"(",
... | Implementation of part of ILayout interface | [
"Implementation",
"of",
"part",
"of",
"ILayout",
"interface"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L12185-L12205 |
16,403 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | updateGroups | function updateGroups() {
function createGroup(groupInfo, itemsContainer) {
var GroupType = (groupInfo.enableCellSpanning ?
Groups.CellSpanningGroup :
Groups.UniformGroup);
ret... | javascript | function updateGroups() {
function createGroup(groupInfo, itemsContainer) {
var GroupType = (groupInfo.enableCellSpanning ?
Groups.CellSpanningGroup :
Groups.UniformGroup);
ret... | [
"function",
"updateGroups",
"(",
")",
"{",
"function",
"createGroup",
"(",
"groupInfo",
",",
"itemsContainer",
")",
"{",
"var",
"GroupType",
"=",
"(",
"groupInfo",
".",
"enableCellSpanning",
"?",
"Groups",
".",
"CellSpanningGroup",
":",
"Groups",
".",
"UniformGr... | Updates the GridLayout's internal state to reflect the current tree. Similarly tells each group to update its internal state via prepareLayout. After this function runs, the ILayout functions will return results that are appropriate for the current tree. | [
"Updates",
"the",
"GridLayout",
"s",
"internal",
"state",
"to",
"reflect",
"the",
"current",
"tree",
".",
"Similarly",
"tells",
"each",
"group",
"to",
"update",
"its",
"internal",
"state",
"via",
"prepareLayout",
".",
"After",
"this",
"function",
"runs",
"the"... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L12365-L12447 |
16,404 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | layoutGroupContent | function layoutGroupContent(groupIndex, realizedItemRange, doRealizedRange) {
var group = that._groups[groupIndex],
firstChangedIndexInGroup = Math.max(0, changedRange.firstIndex - group.startIndex),
realizedItemRangeInGroup = that._rangeFo... | javascript | function layoutGroupContent(groupIndex, realizedItemRange, doRealizedRange) {
var group = that._groups[groupIndex],
firstChangedIndexInGroup = Math.max(0, changedRange.firstIndex - group.startIndex),
realizedItemRangeInGroup = that._rangeFo... | [
"function",
"layoutGroupContent",
"(",
"groupIndex",
",",
"realizedItemRange",
",",
"doRealizedRange",
")",
"{",
"var",
"group",
"=",
"that",
".",
"_groups",
"[",
"groupIndex",
"]",
",",
"firstChangedIndexInGroup",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"chan... | When doRealizedRange is true, this function is synchronous and has no return value. When doRealizedRange is false, this function is asynchronous and returns a promise. | [
"When",
"doRealizedRange",
"is",
"true",
"this",
"function",
"is",
"synchronous",
"and",
"has",
"no",
"return",
"value",
".",
"When",
"doRealizedRange",
"is",
"false",
"this",
"function",
"is",
"asynchronous",
"and",
"returns",
"a",
"promise",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L12451-L12466 |
16,405 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | layoutUnrealizedRange | function layoutUnrealizedRange() {
if (that._groups.length === 0) {
return Promise.wrap();
}
var realizedItemRange = that._getRealizationRange(),
// Last group before the realized range which... | javascript | function layoutUnrealizedRange() {
if (that._groups.length === 0) {
return Promise.wrap();
}
var realizedItemRange = that._getRealizationRange(),
// Last group before the realized range which... | [
"function",
"layoutUnrealizedRange",
"(",
")",
"{",
"if",
"(",
"that",
".",
"_groups",
".",
"length",
"===",
"0",
")",
"{",
"return",
"Promise",
".",
"wrap",
"(",
")",
";",
"}",
"var",
"realizedItemRange",
"=",
"that",
".",
"_getRealizationRange",
"(",
"... | Asynchronously lays out the unrealized items | [
"Asynchronously",
"lays",
"out",
"the",
"unrealized",
"items"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L12489-L12522 |
16,406 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | updateIndicies | function updateIndicies(modifiedElements, cachedRecords) {
var updatedCachedRecords = {};
for (var i = 0, len = modifiedElements.length; i < len; i++) {
var modifiedElementLookup = modifiedElements[i];
var cachedRec... | javascript | function updateIndicies(modifiedElements, cachedRecords) {
var updatedCachedRecords = {};
for (var i = 0, len = modifiedElements.length; i < len; i++) {
var modifiedElementLookup = modifiedElements[i];
var cachedRec... | [
"function",
"updateIndicies",
"(",
"modifiedElements",
",",
"cachedRecords",
")",
"{",
"var",
"updatedCachedRecords",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"modifiedElements",
".",
"length",
";",
"i",
"<",
"len",
";",
"i"... | Update the indicies before the insert since insert needs the new containers. | [
"Update",
"the",
"indicies",
"before",
"the",
"insert",
"since",
"insert",
"needs",
"the",
"new",
"containers",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L13840-L13863 |
16,407 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | assignGroupMarginsAndHeaders | function assignGroupMarginsAndHeaders(offset) {
if (options.last) {
// When looking for the *last* group, the *trailing* header and margin belong to the group.
return offset - that._getHeaderSizeGroupAdjustment() - that._sizes.itemsContaine... | javascript | function assignGroupMarginsAndHeaders(offset) {
if (options.last) {
// When looking for the *last* group, the *trailing* header and margin belong to the group.
return offset - that._getHeaderSizeGroupAdjustment() - that._sizes.itemsContaine... | [
"function",
"assignGroupMarginsAndHeaders",
"(",
"offset",
")",
"{",
"if",
"(",
"options",
".",
"last",
")",
"{",
"// When looking for the *last* group, the *trailing* header and margin belong to the group.",
"return",
"offset",
"-",
"that",
".",
"_getHeaderSizeGroupAdjustment"... | Assign the headers and margins to the appropriate groups. | [
"Assign",
"the",
"headers",
"and",
"margins",
"to",
"the",
"appropriate",
"groups",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L14096-L14106 |
16,408 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LayoutCommon_getGroupInfo | function _LayoutCommon_getGroupInfo(groupIndex) {
var group = this._site.groupFromIndex(groupIndex),
groupInfo = this._groupInfo,
margins = this._sizes.containerMargins,
adjustedInfo = { enableCellSpanning: false };
... | javascript | function _LayoutCommon_getGroupInfo(groupIndex) {
var group = this._site.groupFromIndex(groupIndex),
groupInfo = this._groupInfo,
margins = this._sizes.containerMargins,
adjustedInfo = { enableCellSpanning: false };
... | [
"function",
"_LayoutCommon_getGroupInfo",
"(",
"groupIndex",
")",
"{",
"var",
"group",
"=",
"this",
".",
"_site",
".",
"groupFromIndex",
"(",
"groupIndex",
")",
",",
"groupInfo",
"=",
"this",
".",
"_groupInfo",
",",
"margins",
"=",
"this",
".",
"_sizes",
"."... | Can only be called after measuring has been completed | [
"Can",
"only",
"be",
"called",
"after",
"measuring",
"has",
"been",
"completed"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L14286-L14305 |
16,409 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LayoutCommon_getItemInfo | function _LayoutCommon_getItemInfo(itemIndex) {
var result;
if (!this._itemInfo || typeof this._itemInfo !== "function") {
if (this._useDefaultItemInfo) {
result = this._defaultItemInfo(itemIndex);
} else... | javascript | function _LayoutCommon_getItemInfo(itemIndex) {
var result;
if (!this._itemInfo || typeof this._itemInfo !== "function") {
if (this._useDefaultItemInfo) {
result = this._defaultItemInfo(itemIndex);
} else... | [
"function",
"_LayoutCommon_getItemInfo",
"(",
"itemIndex",
")",
"{",
"var",
"result",
";",
"if",
"(",
"!",
"this",
".",
"_itemInfo",
"||",
"typeof",
"this",
".",
"_itemInfo",
"!==",
"\"function\"",
")",
"{",
"if",
"(",
"this",
".",
"_useDefaultItemInfo",
")"... | itemIndex is optional | [
"itemIndex",
"is",
"optional"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L14308-L14325 |
16,410 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LayoutCommon_groupFromOffset | function _LayoutCommon_groupFromOffset(offset) {
return offset < this._groups[0].offset ?
0 :
this._groupFrom(function (group) {
return offset < group.offset;
});
} | javascript | function _LayoutCommon_groupFromOffset(offset) {
return offset < this._groups[0].offset ?
0 :
this._groupFrom(function (group) {
return offset < group.offset;
});
} | [
"function",
"_LayoutCommon_groupFromOffset",
"(",
"offset",
")",
"{",
"return",
"offset",
"<",
"this",
".",
"_groups",
"[",
"0",
"]",
".",
"offset",
"?",
"0",
":",
"this",
".",
"_groupFrom",
"(",
"function",
"(",
"group",
")",
"{",
"return",
"offset",
"<... | offset should be relative to the grid layout's content box | [
"offset",
"should",
"be",
"relative",
"to",
"the",
"grid",
"layout",
"s",
"content",
"box"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L14366-L14372 |
16,411 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LayoutCommon_viewportSizeChanged | function _LayoutCommon_viewportSizeChanged(viewportContentSize) {
var sizes = this._sizes;
sizes.viewportContentSize = viewportContentSize;
sizes.surfaceContentSize = viewportContentSize - sizes.surfaceOuterCrossSize;
sizes.maxItemsContain... | javascript | function _LayoutCommon_viewportSizeChanged(viewportContentSize) {
var sizes = this._sizes;
sizes.viewportContentSize = viewportContentSize;
sizes.surfaceContentSize = viewportContentSize - sizes.surfaceOuterCrossSize;
sizes.maxItemsContain... | [
"function",
"_LayoutCommon_viewportSizeChanged",
"(",
"viewportContentSize",
")",
"{",
"var",
"sizes",
"=",
"this",
".",
"_sizes",
";",
"sizes",
".",
"viewportContentSize",
"=",
"viewportContentSize",
";",
"sizes",
".",
"surfaceContentSize",
"=",
"viewportContentSize",
... | viewportContentSize is the new viewport size | [
"viewportContentSize",
"is",
"the",
"new",
"viewport",
"size"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L14899-L14922 |
16,412 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LayoutCommon_ensureContainerSize | function _LayoutCommon_ensureContainerSize(group) {
var sizes = this._sizes;
if (!sizes.containerSizeLoaded && !this._ensuringContainerSize) {
var promise;
if ((!this._itemInfo || typeof this._itemInfo !== "function") && this._useDe... | javascript | function _LayoutCommon_ensureContainerSize(group) {
var sizes = this._sizes;
if (!sizes.containerSizeLoaded && !this._ensuringContainerSize) {
var promise;
if ((!this._itemInfo || typeof this._itemInfo !== "function") && this._useDe... | [
"function",
"_LayoutCommon_ensureContainerSize",
"(",
"group",
")",
"{",
"var",
"sizes",
"=",
"this",
".",
"_sizes",
";",
"if",
"(",
"!",
"sizes",
".",
"containerSizeLoaded",
"&&",
"!",
"this",
".",
"_ensuringContainerSize",
")",
"{",
"var",
"promise",
";",
... | Computes container width and height if they haven't been computed yet. This should happen when the first uniform group is created. | [
"Computes",
"container",
"width",
"and",
"height",
"if",
"they",
"haven",
"t",
"been",
"computed",
"yet",
".",
"This",
"should",
"happen",
"when",
"the",
"first",
"uniform",
"group",
"is",
"created",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L14951-L14996 |
16,413 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | VirtualizeContentsView_updateAriaMarkers | function VirtualizeContentsView_updateAriaMarkers(listViewIsEmpty, firstIndexDisplayed, lastIndexDisplayed) {
var that = this;
if (this._listView._isZombie()) {
return;
}
function getFirstVisibleItem() {
... | javascript | function VirtualizeContentsView_updateAriaMarkers(listViewIsEmpty, firstIndexDisplayed, lastIndexDisplayed) {
var that = this;
if (this._listView._isZombie()) {
return;
}
function getFirstVisibleItem() {
... | [
"function",
"VirtualizeContentsView_updateAriaMarkers",
"(",
"listViewIsEmpty",
",",
"firstIndexDisplayed",
",",
"lastIndexDisplayed",
")",
"{",
"var",
"that",
"=",
"this",
";",
"if",
"(",
"this",
".",
"_listView",
".",
"_isZombie",
"(",
")",
")",
"{",
"return",
... | Sets aria-flowto on _ariaStartMarker and x-ms-aria-flowfrom on _ariaEndMarker. The former points to either the first visible group header or the first visible item. The latter points to the last visible item. | [
"Sets",
"aria",
"-",
"flowto",
"on",
"_ariaStartMarker",
"and",
"x",
"-",
"ms",
"-",
"aria",
"-",
"flowfrom",
"on",
"_ariaEndMarker",
".",
"The",
"former",
"points",
"to",
"either",
"the",
"first",
"visible",
"group",
"header",
"or",
"the",
"first",
"visib... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L17659-L17720 |
16,414 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | getLastVisibleItem | function getLastVisibleItem() {
for (var i = lastIndexDisplayed; i >= firstIndexDisplayed; i--) {
if (that.items.itemAt(i)) {
return that.items.itemAt(i);
}
}
r... | javascript | function getLastVisibleItem() {
for (var i = lastIndexDisplayed; i >= firstIndexDisplayed; i--) {
if (that.items.itemAt(i)) {
return that.items.itemAt(i);
}
}
r... | [
"function",
"getLastVisibleItem",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"lastIndexDisplayed",
";",
"i",
">=",
"firstIndexDisplayed",
";",
"i",
"--",
")",
"{",
"if",
"(",
"that",
".",
"items",
".",
"itemAt",
"(",
"i",
")",
")",
"{",
"return",
"t... | At a certain index, the VDS may return null for all items at that index and higher. When this is the case, the end marker should point to the last non-null item in the visible range. | [
"At",
"a",
"certain",
"index",
"the",
"VDS",
"may",
"return",
"null",
"for",
"all",
"items",
"at",
"that",
"index",
"and",
"higher",
".",
"When",
"this",
"is",
"the",
"case",
"the",
"end",
"marker",
"should",
"point",
"to",
"the",
"last",
"non",
"-",
... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L17672-L17679 |
16,415 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | VirtualizeContentsView_updateAriaForAnnouncement | function VirtualizeContentsView_updateAriaForAnnouncement(item, count) {
if (item === this._listView.header || item === this._listView.footer) {
return;
}
var index = -1;
var type = _UI.ObjectType.item;
... | javascript | function VirtualizeContentsView_updateAriaForAnnouncement(item, count) {
if (item === this._listView.header || item === this._listView.footer) {
return;
}
var index = -1;
var type = _UI.ObjectType.item;
... | [
"function",
"VirtualizeContentsView_updateAriaForAnnouncement",
"(",
"item",
",",
"count",
")",
"{",
"if",
"(",
"item",
"===",
"this",
".",
"_listView",
".",
"header",
"||",
"item",
"===",
"this",
".",
"_listView",
".",
"footer",
")",
"{",
"return",
";",
"}"... | Update the ARIA attributes on item that are needed so that Narrator can announce it. item must be in the items container. | [
"Update",
"the",
"ARIA",
"attributes",
"on",
"item",
"that",
"are",
"needed",
"so",
"that",
"Narrator",
"can",
"announce",
"it",
".",
"item",
"must",
"be",
"in",
"the",
"items",
"container",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L17724-L17749 |
16,416 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | VirtualizeContentsView_createChunk | function VirtualizeContentsView_createChunk(groups, count, chunkSize) {
var that = this;
this._listView._writeProfilerMark("createChunk,StartTM");
function addToGroup(itemsContainer, groupSize) {
var children = itemsContainer.element.... | javascript | function VirtualizeContentsView_createChunk(groups, count, chunkSize) {
var that = this;
this._listView._writeProfilerMark("createChunk,StartTM");
function addToGroup(itemsContainer, groupSize) {
var children = itemsContainer.element.... | [
"function",
"VirtualizeContentsView_createChunk",
"(",
"groups",
",",
"count",
",",
"chunkSize",
")",
"{",
"var",
"that",
"=",
"this",
";",
"this",
".",
"_listView",
".",
"_writeProfilerMark",
"(",
"\"createChunk,StartTM\"",
")",
";",
"function",
"addToGroup",
"("... | Overridden by tests. Tests should have _createChunk return true when they want _createContainers to stop creating containers. | [
"Overridden",
"by",
"tests",
".",
"Tests",
"should",
"have",
"_createChunk",
"return",
"true",
"when",
"they",
"want",
"_createContainers",
"to",
"stop",
"creating",
"containers",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L18512-L18563 |
16,417 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function (range, itemsCount) {
range._lastKnownSizeOfData = itemsCount; // store this in order to make unions.
if (!this._range) {
this._range = range;
} else {
// Take the union of these two ranges.
... | javascript | function (range, itemsCount) {
range._lastKnownSizeOfData = itemsCount; // store this in order to make unions.
if (!this._range) {
this._range = range;
} else {
// Take the union of these two ranges.
... | [
"function",
"(",
"range",
",",
"itemsCount",
")",
"{",
"range",
".",
"_lastKnownSizeOfData",
"=",
"itemsCount",
";",
"// store this in order to make unions.",
"if",
"(",
"!",
"this",
".",
"_range",
")",
"{",
"this",
".",
"_range",
"=",
"range",
";",
"}",
"el... | Marks the union of the current affected range and range as requiring layout | [
"Marks",
"the",
"union",
"of",
"the",
"current",
"affected",
"range",
"and",
"range",
"as",
"requiring",
"layout"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L19972-L19989 | |
16,418 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | ListView_convertCoordinatesByCanvasMargins | function ListView_convertCoordinatesByCanvasMargins(coordinates, conversionCallback) {
function fix(field, offset) {
if (coordinates[field] !== undefined) {
coordinates[field] = conversionCallback(coordinates[field], offset);
... | javascript | function ListView_convertCoordinatesByCanvasMargins(coordinates, conversionCallback) {
function fix(field, offset) {
if (coordinates[field] !== undefined) {
coordinates[field] = conversionCallback(coordinates[field], offset);
... | [
"function",
"ListView_convertCoordinatesByCanvasMargins",
"(",
"coordinates",
",",
"conversionCallback",
")",
"{",
"function",
"fix",
"(",
"field",
",",
"offset",
")",
"{",
"if",
"(",
"coordinates",
"[",
"field",
"]",
"!==",
"undefined",
")",
"{",
"coordinates",
... | Convert between canvas coordinates and viewport coordinates | [
"Convert",
"between",
"canvas",
"coordinates",
"and",
"viewport",
"coordinates"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L22783-L22802 |
16,419 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | ListView_getViewportSize | function ListView_getViewportSize() {
if (this._viewportWidth === _Constants._UNINITIALIZED || this._viewportHeight === _Constants._UNINITIALIZED) {
this._viewportWidth = Math.max(0, _ElementUtilities.getContentWidth(this._element));
this._viewportHeig... | javascript | function ListView_getViewportSize() {
if (this._viewportWidth === _Constants._UNINITIALIZED || this._viewportHeight === _Constants._UNINITIALIZED) {
this._viewportWidth = Math.max(0, _ElementUtilities.getContentWidth(this._element));
this._viewportHeig... | [
"function",
"ListView_getViewportSize",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_viewportWidth",
"===",
"_Constants",
".",
"_UNINITIALIZED",
"||",
"this",
".",
"_viewportHeight",
"===",
"_Constants",
".",
"_UNINITIALIZED",
")",
"{",
"this",
".",
"_viewportWidth",
... | Methods in the site interface used by ScrollView | [
"Methods",
"in",
"the",
"site",
"interface",
"used",
"by",
"ScrollView"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L22815-L22828 |
16,420 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | ListView_updateSelection | function ListView_updateSelection() {
var indices = this._selection.getIndices(),
selectAll = this._selection.isEverything(),
selectionMap = {};
if (!selectAll) {
for (var i = 0, len = indices.length ; i < l... | javascript | function ListView_updateSelection() {
var indices = this._selection.getIndices(),
selectAll = this._selection.isEverything(),
selectionMap = {};
if (!selectAll) {
for (var i = 0, len = indices.length ; i < l... | [
"function",
"ListView_updateSelection",
"(",
")",
"{",
"var",
"indices",
"=",
"this",
".",
"_selection",
".",
"getIndices",
"(",
")",
",",
"selectAll",
"=",
"this",
".",
"_selection",
".",
"isEverything",
"(",
")",
",",
"selectionMap",
"=",
"{",
"}",
";",
... | Methods used by SelectionManager | [
"Methods",
"used",
"by",
"SelectionManager"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L22973-L22994 |
16,421 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | FlipView_inserted | function FlipView_inserted(itemPromise, previousHandle, nextHandle) {
that._itemsManager._itemFromPromise(itemPromise).then(function (element) {
var previous = that._itemsManager._elementFromHandle(previousHandle);
var next = th... | javascript | function FlipView_inserted(itemPromise, previousHandle, nextHandle) {
that._itemsManager._itemFromPromise(itemPromise).then(function (element) {
var previous = that._itemsManager._elementFromHandle(previousHandle);
var next = th... | [
"function",
"FlipView_inserted",
"(",
"itemPromise",
",",
"previousHandle",
",",
"nextHandle",
")",
"{",
"that",
".",
"_itemsManager",
".",
"_itemFromPromise",
"(",
"itemPromise",
")",
".",
"then",
"(",
"function",
"(",
"element",
")",
"{",
"var",
"previous",
... | Callbacks for itemsManager | [
"Callbacks",
"for",
"itemsManager"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L26982-L26988 |
16,422 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function (date1, date2) {
return date1.getHours() === date2.getHours() &&
date1.getMinutes() === date2.getMinutes();
} | javascript | function (date1, date2) {
return date1.getHours() === date2.getHours() &&
date1.getMinutes() === date2.getMinutes();
} | [
"function",
"(",
"date1",
",",
"date2",
")",
"{",
"return",
"date1",
".",
"getHours",
"(",
")",
"===",
"date2",
".",
"getHours",
"(",
")",
"&&",
"date1",
".",
"getMinutes",
"(",
")",
"===",
"date2",
".",
"getMinutes",
"(",
")",
";",
"}"
] | date1 and date2 must be Date objects with their date portions set to the sentinel date. | [
"date1",
"and",
"date2",
"must",
"be",
"Date",
"objects",
"with",
"their",
"date",
"portions",
"set",
"to",
"the",
"sentinel",
"date",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L29811-L29814 | |
16,423 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function (event) {
this._lastKeyOrBlurEvent = this._currentKeyOrBlurEvent;
switch (event.type) {
case "keyup":
if (event.keyCode === Key.shift) {
this._currentKeyOrBlurEvent = null;
... | javascript | function (event) {
this._lastKeyOrBlurEvent = this._currentKeyOrBlurEvent;
switch (event.type) {
case "keyup":
if (event.keyCode === Key.shift) {
this._currentKeyOrBlurEvent = null;
... | [
"function",
"(",
"event",
")",
"{",
"this",
".",
"_lastKeyOrBlurEvent",
"=",
"this",
".",
"_currentKeyOrBlurEvent",
";",
"switch",
"(",
"event",
".",
"type",
")",
"{",
"case",
"\"keyup\"",
":",
"if",
"(",
"event",
".",
"keyCode",
"===",
"Key",
".",
"shif... | Support for keyboard navigation | [
"Support",
"for",
"keyboard",
"navigation"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L31080-L31098 | |
16,424 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function () {
var rect = this._anchorElement.getBoundingClientRect();
return {
x: rect.left,
y: rect.top,
width: rect.width,
height: rect.height
};
... | javascript | function () {
var rect = this._anchorElement.getBoundingClientRect();
return {
x: rect.left,
y: rect.top,
width: rect.width,
height: rect.height
};
... | [
"function",
"(",
")",
"{",
"var",
"rect",
"=",
"this",
".",
"_anchorElement",
".",
"getBoundingClientRect",
"(",
")",
";",
"return",
"{",
"x",
":",
"rect",
".",
"left",
",",
"y",
":",
"rect",
".",
"top",
",",
"width",
":",
"rect",
".",
"width",
","... | This function returns the anchor element's position in the Window coordinates. | [
"This",
"function",
"returns",
"the",
"anchor",
"element",
"s",
"position",
"in",
"the",
"Window",
"coordinates",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L31243-L31252 | |
16,425 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function () {
this._closeTooltip();
var firePreviewChange = true;
if (this._tentativeRating <= 0) {
firePreviewChange = false;
} else {
if (this._tentativeRating > 0) {
... | javascript | function () {
this._closeTooltip();
var firePreviewChange = true;
if (this._tentativeRating <= 0) {
firePreviewChange = false;
} else {
if (this._tentativeRating > 0) {
... | [
"function",
"(",
")",
"{",
"this",
".",
"_closeTooltip",
"(",
")",
";",
"var",
"firePreviewChange",
"=",
"true",
";",
"if",
"(",
"this",
".",
"_tentativeRating",
"<=",
"0",
")",
"{",
"firePreviewChange",
"=",
"false",
";",
"}",
"else",
"{",
"if",
"(",
... | decrement tentative rating by one | [
"decrement",
"tentative",
"rating",
"by",
"one"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L32040-L32067 | |
16,426 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function () {
this._closeTooltip();
var firePreviewChange = true;
if (this._tentativeRating < 0 || this._tentativeRating >= this._maxRating) {
firePreviewChange = false;
}
if (this._tentativeRati... | javascript | function () {
this._closeTooltip();
var firePreviewChange = true;
if (this._tentativeRating < 0 || this._tentativeRating >= this._maxRating) {
firePreviewChange = false;
}
if (this._tentativeRati... | [
"function",
"(",
")",
"{",
"this",
".",
"_closeTooltip",
"(",
")",
";",
"var",
"firePreviewChange",
"=",
"true",
";",
"if",
"(",
"this",
".",
"_tentativeRating",
"<",
"0",
"||",
"this",
".",
"_tentativeRating",
">=",
"this",
".",
"_maxRating",
")",
"{",
... | increase tentative rating by one | [
"increase",
"tentative",
"rating",
"by",
"one"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L32147-L32170 | |
16,427 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | filterOnScreen | function filterOnScreen(element) {
var elementBoundingClientRect = element.getBoundingClientRect();
// Can't check left/right since it might be scrolled off.
return elementBoundingClientRect.top < viewportBoundingClientRect.bottom && elementBoundingClientRect.bottom > vie... | javascript | function filterOnScreen(element) {
var elementBoundingClientRect = element.getBoundingClientRect();
// Can't check left/right since it might be scrolled off.
return elementBoundingClientRect.top < viewportBoundingClientRect.bottom && elementBoundingClientRect.bottom > vie... | [
"function",
"filterOnScreen",
"(",
"element",
")",
"{",
"var",
"elementBoundingClientRect",
"=",
"element",
".",
"getBoundingClientRect",
"(",
")",
";",
"// Can't check left/right since it might be scrolled off.",
"return",
"elementBoundingClientRect",
".",
"top",
"<",
"vie... | Find the elements to slide in | [
"Find",
"the",
"elements",
"to",
"slide",
"in"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L35748-L35752 |
16,428 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _allOverlaysCallback | function _allOverlaysCallback(event, nameOfFunctionCall, stopImmediatePropagationWhenHandled) {
var elements = _Global.document.querySelectorAll("." + _Constants.overlayClass);
if (elements) {
var len = elements.length;
for (var i = 0; i < len; i++... | javascript | function _allOverlaysCallback(event, nameOfFunctionCall, stopImmediatePropagationWhenHandled) {
var elements = _Global.document.querySelectorAll("." + _Constants.overlayClass);
if (elements) {
var len = elements.length;
for (var i = 0; i < len; i++... | [
"function",
"_allOverlaysCallback",
"(",
"event",
",",
"nameOfFunctionCall",
",",
"stopImmediatePropagationWhenHandled",
")",
"{",
"var",
"elements",
"=",
"_Global",
".",
"document",
".",
"querySelectorAll",
"(",
"\".\"",
"+",
"_Constants",
".",
"overlayClass",
")",
... | Helper for Global Event listeners. Invokes the specified callback member function on each _Overlay in the DOM. | [
"Helper",
"for",
"Global",
"Event",
"listeners",
".",
"Invokes",
"the",
"specified",
"callback",
"member",
"function",
"on",
"each",
"_Overlay",
"in",
"the",
"DOM",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L38955-L38973 |
16,429 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _Overlay_sendEvent | function _Overlay_sendEvent(eventName, detail) {
if (this._disposed) {
return;
}
var event = _Global.document.createEvent("CustomEvent");
event.initEvent(eventName, true, true, (detail || {}));
th... | javascript | function _Overlay_sendEvent(eventName, detail) {
if (this._disposed) {
return;
}
var event = _Global.document.createEvent("CustomEvent");
event.initEvent(eventName, true, true, (detail || {}));
th... | [
"function",
"_Overlay_sendEvent",
"(",
"eventName",
",",
"detail",
")",
"{",
"if",
"(",
"this",
".",
"_disposed",
")",
"{",
"return",
";",
"}",
"var",
"event",
"=",
"_Global",
".",
"document",
".",
"createEvent",
"(",
"\"CustomEvent\"",
")",
";",
"event",
... | Send one of our events | [
"Send",
"one",
"of",
"our",
"events"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39464-L39471 |
16,430 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _Overlay_showAndHideQueue | function _Overlay_showAndHideQueue() {
// Only called if not currently animating.
// We'll be done with the queued stuff when we return.
this._queuedCommandAnimation = false;
// Shortcut if hidden
if (this.hidden) {
... | javascript | function _Overlay_showAndHideQueue() {
// Only called if not currently animating.
// We'll be done with the queued stuff when we return.
this._queuedCommandAnimation = false;
// Shortcut if hidden
if (this.hidden) {
... | [
"function",
"_Overlay_showAndHideQueue",
"(",
")",
"{",
"// Only called if not currently animating.",
"// We'll be done with the queued stuff when we return.",
"this",
".",
"_queuedCommandAnimation",
"=",
"false",
";",
"// Shortcut if hidden",
"if",
"(",
"this",
".",
"hidden",
... | show and hide the queued commands, perhaps animating if overlay isn't hidden. | [
"show",
"and",
"hide",
"the",
"queued",
"commands",
"perhaps",
"animating",
"if",
"overlay",
"isn",
"t",
"hidden",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39583-L39655 |
16,431 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _Overlay_resolveCommands | function _Overlay_resolveCommands(commands) {
// First make sure they're all DOM elements.
commands = _resolveElements(commands);
// Now make sure they're all in this container
var result = {};
result.commands = [];
... | javascript | function _Overlay_resolveCommands(commands) {
// First make sure they're all DOM elements.
commands = _resolveElements(commands);
// Now make sure they're all in this container
var result = {};
result.commands = [];
... | [
"function",
"_Overlay_resolveCommands",
"(",
"commands",
")",
"{",
"// First make sure they're all DOM elements.",
"commands",
"=",
"_resolveElements",
"(",
"commands",
")",
";",
"// Now make sure they're all in this container",
"var",
"result",
"=",
"{",
"}",
";",
"result"... | Resolves our commands | [
"Resolves",
"our",
"commands"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39779-L39804 |
16,432 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _Overlay_findSiblings | function _Overlay_findSiblings(commands) {
// Now make sure they're all in this container
var siblings = [];
var allCommands = this.element.querySelectorAll(".win-command");
var countAll, countIn;
for (countAll = 0; coun... | javascript | function _Overlay_findSiblings(commands) {
// Now make sure they're all in this container
var siblings = [];
var allCommands = this.element.querySelectorAll(".win-command");
var countAll, countIn;
for (countAll = 0; coun... | [
"function",
"_Overlay_findSiblings",
"(",
"commands",
")",
"{",
"// Now make sure they're all in this container",
"var",
"siblings",
"=",
"[",
"]",
";",
"var",
"allCommands",
"=",
"this",
".",
"element",
".",
"querySelectorAll",
"(",
"\".win-command\"",
")",
";",
"v... | Find siblings, all DOM elements now. Returns all .win-commands in this Overlay that are NOT in the passed in 'commands' array. | [
"Find",
"siblings",
"all",
"DOM",
"elements",
"now",
".",
"Returns",
"all",
".",
"win",
"-",
"commands",
"in",
"this",
"Overlay",
"that",
"are",
"NOT",
"in",
"the",
"passed",
"in",
"commands",
"array",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39808-L39827 |
16,433 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _Overlay_focusOnLastFocusableElement | function _Overlay_focusOnLastFocusableElement() {
if (this._element.firstElementChild) {
var oldFirstTabIndex = this._element.firstElementChild.tabIndex;
var oldLastTabIndex = this._element.lastElementChild.tabIndex;
this._eleme... | javascript | function _Overlay_focusOnLastFocusableElement() {
if (this._element.firstElementChild) {
var oldFirstTabIndex = this._element.firstElementChild.tabIndex;
var oldLastTabIndex = this._element.lastElementChild.tabIndex;
this._eleme... | [
"function",
"_Overlay_focusOnLastFocusableElement",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_element",
".",
"firstElementChild",
")",
"{",
"var",
"oldFirstTabIndex",
"=",
"this",
".",
"_element",
".",
"firstElementChild",
".",
"tabIndex",
";",
"var",
"oldLastTabIn... | Sets focus to what we think is the last tab stop. This element must have a firstDiv with tabIndex equal to the lowest tabIndex in the element and a finalDiv with tabIndex equal to the highest tabIndex in the element. Also the firstDiv must be its first child and finalDiv be its last child. Returns true if successful, f... | [
"Sets",
"focus",
"to",
"what",
"we",
"think",
"is",
"the",
"last",
"tab",
"stop",
".",
"This",
"element",
"must",
"have",
"a",
"firstDiv",
"with",
"tabIndex",
"equal",
"to",
"the",
"lowest",
"tabIndex",
"in",
"the",
"element",
"and",
"a",
"finalDiv",
"wi... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39898-L39918 |
16,434 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _Overlay__focusOnFirstFocusableElement | function _Overlay__focusOnFirstFocusableElement(useSetActive, scroller) {
if (this._element.firstElementChild) {
var oldFirstTabIndex = this._element.firstElementChild.tabIndex;
var oldLastTabIndex = this._element.lastElementChild.tabIndex;
... | javascript | function _Overlay__focusOnFirstFocusableElement(useSetActive, scroller) {
if (this._element.firstElementChild) {
var oldFirstTabIndex = this._element.firstElementChild.tabIndex;
var oldLastTabIndex = this._element.lastElementChild.tabIndex;
... | [
"function",
"_Overlay__focusOnFirstFocusableElement",
"(",
"useSetActive",
",",
"scroller",
")",
"{",
"if",
"(",
"this",
".",
"_element",
".",
"firstElementChild",
")",
"{",
"var",
"oldFirstTabIndex",
"=",
"this",
".",
"_element",
".",
"firstElementChild",
".",
"t... | Sets focus to what we think is the first tab stop. This element must have a firstDiv with tabIndex equal to the lowest tabIndex in the element and a finalDiv with tabIndex equal to the highest tabIndex in the element. Also the firstDiv must be its first child and finalDiv be its last child. Returns true if successful, ... | [
"Sets",
"focus",
"to",
"what",
"we",
"think",
"is",
"the",
"first",
"tab",
"stop",
".",
"This",
"element",
"must",
"have",
"a",
"firstDiv",
"with",
"tabIndex",
"equal",
"to",
"the",
"lowest",
"tabIndex",
"in",
"the",
"element",
"and",
"a",
"finalDiv",
"w... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39935-L39955 |
16,435 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | function (element, scroller) {
if (!element || !_Global.document.body || !_Global.document.body.contains(element)) {
return false;
}
if (!_ElementUtilities._setActive(element, scroller)) {
return false;
... | javascript | function (element, scroller) {
if (!element || !_Global.document.body || !_Global.document.body.contains(element)) {
return false;
}
if (!_ElementUtilities._setActive(element, scroller)) {
return false;
... | [
"function",
"(",
"element",
",",
"scroller",
")",
"{",
"if",
"(",
"!",
"element",
"||",
"!",
"_Global",
".",
"document",
".",
"body",
"||",
"!",
"_Global",
".",
"document",
".",
"body",
".",
"contains",
"(",
"element",
")",
")",
"{",
"return",
"false... | Try to set us as active | [
"Try",
"to",
"set",
"us",
"as",
"active"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L39977-L39985 | |
16,436 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LightDismissableLayer_hiding | function _LightDismissableLayer_hiding(client /*: ILightDismissable */) {
var index = this._clients.indexOf(client);
if (index !== -1) {
this._clients[index]._focusable = false;
this._activateTopFocusableClientIfNeeded();
... | javascript | function _LightDismissableLayer_hiding(client /*: ILightDismissable */) {
var index = this._clients.indexOf(client);
if (index !== -1) {
this._clients[index]._focusable = false;
this._activateTopFocusableClientIfNeeded();
... | [
"function",
"_LightDismissableLayer_hiding",
"(",
"client",
"/*: ILightDismissable */",
")",
"{",
"var",
"index",
"=",
"this",
".",
"_clients",
".",
"indexOf",
"(",
"client",
")",
";",
"if",
"(",
"index",
"!==",
"-",
"1",
")",
"{",
"this",
".",
"_clients",
... | Dismissables should call this at the start of their exit animation. A "hiding", dismissable will still be rendered with the proper z-index but it will no longer be given focus. Also, focus is synchronously moved out of this dismissable. | [
"Dismissables",
"should",
"call",
"this",
"at",
"the",
"start",
"of",
"their",
"exit",
"animation",
".",
"A",
"hiding",
"dismissable",
"will",
"still",
"be",
"rendered",
"with",
"the",
"proper",
"z",
"-",
"index",
"but",
"it",
"will",
"no",
"longer",
"be",... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L40237-L40243 |
16,437 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | fitsVerticallyWithCenteredAnchor | function fitsVerticallyWithCenteredAnchor(anchorBorderBox, flyoutMeasurements) {
// Returns true if the flyout would always fit at least top
// or bottom of its anchor, regardless of the position of the anchor,
// as long as the anchor ... | javascript | function fitsVerticallyWithCenteredAnchor(anchorBorderBox, flyoutMeasurements) {
// Returns true if the flyout would always fit at least top
// or bottom of its anchor, regardless of the position of the anchor,
// as long as the anchor ... | [
"function",
"fitsVerticallyWithCenteredAnchor",
"(",
"anchorBorderBox",
",",
"flyoutMeasurements",
")",
"{",
"// Returns true if the flyout would always fit at least top",
"// or bottom of its anchor, regardless of the position of the anchor,",
"// as long as the anchor never changed its height,... | If the anchor is centered vertically, would the flyout fit above it? | [
"If",
"the",
"anchor",
"is",
"centered",
"vertically",
"would",
"the",
"flyout",
"fit",
"above",
"it?"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L40615-L40621 |
16,438 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | fitTop | function fitTop(bottomConstraint, flyoutMeasurements) {
nextTop = bottomConstraint - flyoutMeasurements.totalHeight;
nextAnimOffset = AnimationOffsets.top;
return (nextTop >= _Overlay._Overlay._keyboardInfo._visibleDocTop &&
... | javascript | function fitTop(bottomConstraint, flyoutMeasurements) {
nextTop = bottomConstraint - flyoutMeasurements.totalHeight;
nextAnimOffset = AnimationOffsets.top;
return (nextTop >= _Overlay._Overlay._keyboardInfo._visibleDocTop &&
... | [
"function",
"fitTop",
"(",
"bottomConstraint",
",",
"flyoutMeasurements",
")",
"{",
"nextTop",
"=",
"bottomConstraint",
"-",
"flyoutMeasurements",
".",
"totalHeight",
";",
"nextAnimOffset",
"=",
"AnimationOffsets",
".",
"top",
";",
"return",
"(",
"nextTop",
">=",
... | See if we can fit in various places, fitting in the main view, ignoring viewport changes, like for the IHM. | [
"See",
"if",
"we",
"can",
"fit",
"in",
"various",
"places",
"fitting",
"in",
"the",
"main",
"view",
"ignoring",
"viewport",
"changes",
"like",
"for",
"the",
"IHM",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L40637-L40642 |
16,439 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | Flyout_ensurePosition | function Flyout_ensurePosition() {
this._keyboardMovedUs = false;
// Remove old height restrictions and scrolling.
this._clearAdjustedStyles();
this._setAlignment();
// Set up the new position, and prep the offset for... | javascript | function Flyout_ensurePosition() {
this._keyboardMovedUs = false;
// Remove old height restrictions and scrolling.
this._clearAdjustedStyles();
this._setAlignment();
// Set up the new position, and prep the offset for... | [
"function",
"Flyout_ensurePosition",
"(",
")",
"{",
"this",
".",
"_keyboardMovedUs",
"=",
"false",
";",
"// Remove old height restrictions and scrolling.",
"this",
".",
"_clearAdjustedStyles",
"(",
")",
";",
"this",
".",
"_setAlignment",
"(",
")",
";",
"// Set up the ... | Find our new flyout position. | [
"Find",
"our",
"new",
"flyout",
"position",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L41232-L41281 |
16,440 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | Flyout_checkKeyboardFit | function Flyout_checkKeyboardFit() {
// Special Flyout positioning rules to determine if the Flyout needs to adjust its
// position because of the IHM. If the Flyout needs to adjust for the IHM, it will reposition
// itself to be pinned to either the top or bo... | javascript | function Flyout_checkKeyboardFit() {
// Special Flyout positioning rules to determine if the Flyout needs to adjust its
// position because of the IHM. If the Flyout needs to adjust for the IHM, it will reposition
// itself to be pinned to either the top or bo... | [
"function",
"Flyout_checkKeyboardFit",
"(",
")",
"{",
"// Special Flyout positioning rules to determine if the Flyout needs to adjust its",
"// position because of the IHM. If the Flyout needs to adjust for the IHM, it will reposition",
"// itself to be pinned to either the top or bottom edge of the v... | If you were not pinned to the bottom, you might have to be now. | [
"If",
"you",
"were",
"not",
"pinned",
"to",
"the",
"bottom",
"you",
"might",
"have",
"to",
"be",
"now",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L41359-L41386 |
16,441 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | Flyout_flyoutAnimateIn | function Flyout_flyoutAnimateIn() {
if (this._keyboardMovedUs) {
return this._baseAnimateIn();
} else {
this._element.style.opacity = 1;
this._element.style.visibility = "visible";
ret... | javascript | function Flyout_flyoutAnimateIn() {
if (this._keyboardMovedUs) {
return this._baseAnimateIn();
} else {
this._element.style.opacity = 1;
this._element.style.visibility = "visible";
ret... | [
"function",
"Flyout_flyoutAnimateIn",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_keyboardMovedUs",
")",
"{",
"return",
"this",
".",
"_baseAnimateIn",
"(",
")",
";",
"}",
"else",
"{",
"this",
".",
"_element",
".",
"style",
".",
"opacity",
"=",
"1",
";",
"... | AppBar flyout animations | [
"AppBar",
"flyout",
"animations"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L41446-L41454 |
16,442 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | Flyout_hideAllOtherFlyouts | function Flyout_hideAllOtherFlyouts(thisFlyout) {
var flyouts = _Global.document.querySelectorAll("." + _Constants.flyoutClass);
for (var i = 0; i < flyouts.length; i++) {
var flyoutControl = flyouts[i].winControl;
if (flyoutControl... | javascript | function Flyout_hideAllOtherFlyouts(thisFlyout) {
var flyouts = _Global.document.querySelectorAll("." + _Constants.flyoutClass);
for (var i = 0; i < flyouts.length; i++) {
var flyoutControl = flyouts[i].winControl;
if (flyoutControl... | [
"function",
"Flyout_hideAllOtherFlyouts",
"(",
"thisFlyout",
")",
"{",
"var",
"flyouts",
"=",
"_Global",
".",
"document",
".",
"querySelectorAll",
"(",
"\".\"",
"+",
"_Constants",
".",
"flyoutClass",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<... | Hide all other flyouts besides this one | [
"Hide",
"all",
"other",
"flyouts",
"besides",
"this",
"one"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L41466-L41474 |
16,443 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | Flyout_addFirstDiv | function Flyout_addFirstDiv() {
var firstDiv = _Global.document.createElement("div");
firstDiv.className = _Constants.firstDivClass;
firstDiv.style.display = "inline";
firstDiv.setAttribute("role", "menuitem");
firstDiv.... | javascript | function Flyout_addFirstDiv() {
var firstDiv = _Global.document.createElement("div");
firstDiv.className = _Constants.firstDivClass;
firstDiv.style.display = "inline";
firstDiv.setAttribute("role", "menuitem");
firstDiv.... | [
"function",
"Flyout_addFirstDiv",
"(",
")",
"{",
"var",
"firstDiv",
"=",
"_Global",
".",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"firstDiv",
".",
"className",
"=",
"_Constants",
".",
"firstDivClass",
";",
"firstDiv",
".",
"style",
".",
"d... | Create and add a new first div as the first child | [
"Create",
"and",
"add",
"a",
"new",
"first",
"div",
"as",
"the",
"first",
"child"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L41500-L41518 |
16,444 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | Flyout_addFinalDiv | function Flyout_addFinalDiv() {
var finalDiv = _Global.document.createElement("div");
finalDiv.className = _Constants.finalDivClass;
finalDiv.style.display = "inline";
finalDiv.setAttribute("role", "menuitem");
finalDiv.... | javascript | function Flyout_addFinalDiv() {
var finalDiv = _Global.document.createElement("div");
finalDiv.className = _Constants.finalDivClass;
finalDiv.style.display = "inline";
finalDiv.setAttribute("role", "menuitem");
finalDiv.... | [
"function",
"Flyout_addFinalDiv",
"(",
")",
"{",
"var",
"finalDiv",
"=",
"_Global",
".",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"finalDiv",
".",
"className",
"=",
"_Constants",
".",
"finalDivClass",
";",
"finalDiv",
".",
"style",
".",
"d... | Create and add a new final div as the last child | [
"Create",
"and",
"add",
"a",
"new",
"final",
"div",
"as",
"the",
"last",
"child"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L41521-L41533 |
16,445 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LegacyAppBar_setFocusToAppBar | function _LegacyAppBar_setFocusToAppBar(useSetActive, scroller) {
if (!this._focusOnFirstFocusableElement(useSetActive, scroller)) {
// No first element, set it to appbar itself
_Overlay._Overlay._trySetActive(this._element, scroller);
... | javascript | function _LegacyAppBar_setFocusToAppBar(useSetActive, scroller) {
if (!this._focusOnFirstFocusableElement(useSetActive, scroller)) {
// No first element, set it to appbar itself
_Overlay._Overlay._trySetActive(this._element, scroller);
... | [
"function",
"_LegacyAppBar_setFocusToAppBar",
"(",
"useSetActive",
",",
"scroller",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_focusOnFirstFocusableElement",
"(",
"useSetActive",
",",
"scroller",
")",
")",
"{",
"// No first element, set it to appbar itself",
"_Overlay",
"... | Set focus to the passed in _LegacyAppBar | [
"Set",
"focus",
"to",
"the",
"passed",
"in",
"_LegacyAppBar"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L47287-L47292 |
16,446 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _LegacyAppBar_updateFirstAndFinalDiv | function _LegacyAppBar_updateFirstAndFinalDiv() {
var appBarFirstDiv = this._element.querySelectorAll("." + _Constants.firstDivClass);
appBarFirstDiv = appBarFirstDiv.length >= 1 ? appBarFirstDiv[0] : null;
var appBarFinalDiv = this._element.querySelectorAll(... | javascript | function _LegacyAppBar_updateFirstAndFinalDiv() {
var appBarFirstDiv = this._element.querySelectorAll("." + _Constants.firstDivClass);
appBarFirstDiv = appBarFirstDiv.length >= 1 ? appBarFirstDiv[0] : null;
var appBarFinalDiv = this._element.querySelectorAll(... | [
"function",
"_LegacyAppBar_updateFirstAndFinalDiv",
"(",
")",
"{",
"var",
"appBarFirstDiv",
"=",
"this",
".",
"_element",
".",
"querySelectorAll",
"(",
"\".\"",
"+",
"_Constants",
".",
"firstDivClass",
")",
";",
"appBarFirstDiv",
"=",
"appBarFirstDiv",
".",
"length"... | If there is a shown non-sticky _LegacyAppBar then it sets the firstDiv tabIndex to the minimum tabIndex found in the _LegacyAppBars and finalDiv to the max found. Otherwise sets their tabIndex to -1 so they are not tab stops. | [
"If",
"there",
"is",
"a",
"shown",
"non",
"-",
"sticky",
"_LegacyAppBar",
"then",
"it",
"sets",
"the",
"firstDiv",
"tabIndex",
"to",
"the",
"minimum",
"tabIndex",
"found",
"in",
"the",
"_LegacyAppBars",
"and",
"finalDiv",
"to",
"the",
"max",
"found",
".",
... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L47496-L47560 |
16,447 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | createQueryLinguisticDetails | function createQueryLinguisticDetails(compositionAlternatives, compositionStartOffset, compositionLength, queryTextPrefix, queryTextSuffix) {
var linguisticDetails = null;
// The linguistic alternatives we receive are only for the composition string being composed. We ne... | javascript | function createQueryLinguisticDetails(compositionAlternatives, compositionStartOffset, compositionLength, queryTextPrefix, queryTextSuffix) {
var linguisticDetails = null;
// The linguistic alternatives we receive are only for the composition string being composed. We ne... | [
"function",
"createQueryLinguisticDetails",
"(",
"compositionAlternatives",
",",
"compositionStartOffset",
",",
"compositionLength",
",",
"queryTextPrefix",
",",
"queryTextSuffix",
")",
"{",
"var",
"linguisticDetails",
"=",
"null",
";",
"// The linguistic alternatives we receiv... | createFilled=false always creates an empty linguistic details object, otherwise generate it or use the cache | [
"createFilled",
"=",
"false",
"always",
"creates",
"an",
"empty",
"linguistic",
"details",
"object",
"otherwise",
"generate",
"it",
"or",
"use",
"the",
"cache"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L48969-L48996 |
16,448 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | SearchBox_requestingFocusOnKeyboardInputHandler | function SearchBox_requestingFocusOnKeyboardInputHandler() {
this._fireEvent(EventName.receivingfocusonkeyboardinput, null);
if (_Global.document.activeElement !== this._inputElement) {
try {
this._inputElement.focus();
... | javascript | function SearchBox_requestingFocusOnKeyboardInputHandler() {
this._fireEvent(EventName.receivingfocusonkeyboardinput, null);
if (_Global.document.activeElement !== this._inputElement) {
try {
this._inputElement.focus();
... | [
"function",
"SearchBox_requestingFocusOnKeyboardInputHandler",
"(",
")",
"{",
"this",
".",
"_fireEvent",
"(",
"EventName",
".",
"receivingfocusonkeyboardinput",
",",
"null",
")",
";",
"if",
"(",
"_Global",
".",
"document",
".",
"activeElement",
"!==",
"this",
".",
... | Type to search helpers | [
"Type",
"to",
"search",
"helpers"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L49968-L49976 |
16,449 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | _getChildSettingsControl | function _getChildSettingsControl(parentElement, id) {
var settingElements = parentElement.querySelectorAll("." + _Constants.settingsFlyoutClass);
var retValue,
control;
for (var i = 0; i < settingElements.length; i++) {
control = s... | javascript | function _getChildSettingsControl(parentElement, id) {
var settingElements = parentElement.querySelectorAll("." + _Constants.settingsFlyoutClass);
var retValue,
control;
for (var i = 0; i < settingElements.length; i++) {
control = s... | [
"function",
"_getChildSettingsControl",
"(",
"parentElement",
",",
"id",
")",
"{",
"var",
"settingElements",
"=",
"parentElement",
".",
"querySelectorAll",
"(",
"\".\"",
"+",
"_Constants",
".",
"settingsFlyoutClass",
")",
";",
"var",
"retValue",
",",
"control",
";... | Get the settings control by matching the settingsCommandId if no match we'll try to match element id | [
"Get",
"the",
"settings",
"control",
"by",
"matching",
"the",
"settingsCommandId",
"if",
"no",
"match",
"we",
"ll",
"try",
"to",
"match",
"element",
"id"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L50105-L50123 |
16,450 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | SettingsFlyout_addFirstDiv | function SettingsFlyout_addFirstDiv() {
var _elms = this._element.getElementsByTagName("*");
var _minTab = 0;
for (var i = 0; i < _elms.length; i++) {
if ((0 < _elms[i].tabIndex) && (_minTab === 0 || _elms[i].tabIndex < _minTab)) {
... | javascript | function SettingsFlyout_addFirstDiv() {
var _elms = this._element.getElementsByTagName("*");
var _minTab = 0;
for (var i = 0; i < _elms.length; i++) {
if ((0 < _elms[i].tabIndex) && (_minTab === 0 || _elms[i].tabIndex < _minTab)) {
... | [
"function",
"SettingsFlyout_addFirstDiv",
"(",
")",
"{",
"var",
"_elms",
"=",
"this",
".",
"_element",
".",
"getElementsByTagName",
"(",
"\"*\"",
")",
";",
"var",
"_minTab",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"_elms",
".",
... | Create and add a new first div to the beginning of the list | [
"Create",
"and",
"add",
"a",
"new",
"first",
"div",
"to",
"the",
"beginning",
"of",
"the",
"list"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L50558-L50580 |
16,451 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | SettingsFlyout_addFinalDiv | function SettingsFlyout_addFinalDiv() {
var _elms = this._element.getElementsByTagName("*");
var _maxTab = 0;
for (var i = 0; i < _elms.length; i++) {
if (_elms[i].tabIndex > _maxTab) {
_maxTab = _elms[i].tab... | javascript | function SettingsFlyout_addFinalDiv() {
var _elms = this._element.getElementsByTagName("*");
var _maxTab = 0;
for (var i = 0; i < _elms.length; i++) {
if (_elms[i].tabIndex > _maxTab) {
_maxTab = _elms[i].tab... | [
"function",
"SettingsFlyout_addFinalDiv",
"(",
")",
"{",
"var",
"_elms",
"=",
"this",
".",
"_element",
".",
"getElementsByTagName",
"(",
"\"*\"",
")",
";",
"var",
"_maxTab",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"_elms",
".",
... | Create and add a new final div to the end of the list | [
"Create",
"and",
"add",
"a",
"new",
"final",
"div",
"to",
"the",
"end",
"of",
"the",
"list"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L50583-L50600 |
16,452 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | ContentDialog_setState | function ContentDialog_setState(NewState, arg0) {
if (!this._disposed) {
this._state && this._state.exit();
this._state = new NewState();
this._state.dialog = this;
this._state.enter(arg0);
... | javascript | function ContentDialog_setState(NewState, arg0) {
if (!this._disposed) {
this._state && this._state.exit();
this._state = new NewState();
this._state.dialog = this;
this._state.enter(arg0);
... | [
"function",
"ContentDialog_setState",
"(",
"NewState",
",",
"arg0",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_disposed",
")",
"{",
"this",
".",
"_state",
"&&",
"this",
".",
"_state",
".",
"exit",
"(",
")",
";",
"this",
".",
"_state",
"=",
"new",
"NewS... | Methods called by states | [
"Methods",
"called",
"by",
"states"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L54047-L54054 |
16,453 | sitewaerts/cordova-plugin-document-viewer | src/common/js/winjs/js/ui.js | ContentDialog_renderForInputPane | function ContentDialog_renderForInputPane() {
var rendered = this._rendered;
if (!rendered.registeredForResize) {
_ElementUtilities._resizeNotifier.subscribe(this._dom.root, this._onUpdateInputPaneRenderingBound);
... | javascript | function ContentDialog_renderForInputPane() {
var rendered = this._rendered;
if (!rendered.registeredForResize) {
_ElementUtilities._resizeNotifier.subscribe(this._dom.root, this._onUpdateInputPaneRenderingBound);
... | [
"function",
"ContentDialog_renderForInputPane",
"(",
")",
"{",
"var",
"rendered",
"=",
"this",
".",
"_rendered",
";",
"if",
"(",
"!",
"rendered",
".",
"registeredForResize",
")",
"{",
"_ElementUtilities",
".",
"_resizeNotifier",
".",
"subscribe",
"(",
"this",
".... | This function assumes it's in an environment that supports -ms-device-fixed. | [
"This",
"function",
"assumes",
"it",
"s",
"in",
"an",
"environment",
"that",
"supports",
"-",
"ms",
"-",
"device",
"-",
"fixed",
"."
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/winjs/js/ui.js#L54142-L54181 |
16,454 | sitewaerts/cordova-plugin-document-viewer | src/windows/sitewaertsdocumentviewer/js/pdfviewer.js | function (requestIndex, countBefore, countAfter) {
if (requestIndex >= pages.length)
return WinJS.Promise.wrapError(
new WinJS.ErrorFromName(
WinJS.UI.F... | javascript | function (requestIndex, countBefore, countAfter) {
if (requestIndex >= pages.length)
return WinJS.Promise.wrapError(
new WinJS.ErrorFromName(
WinJS.UI.F... | [
"function",
"(",
"requestIndex",
",",
"countBefore",
",",
"countAfter",
")",
"{",
"if",
"(",
"requestIndex",
">=",
"pages",
".",
"length",
")",
"return",
"WinJS",
".",
"Promise",
".",
"wrapError",
"(",
"new",
"WinJS",
".",
"ErrorFromName",
"(",
"WinJS",
".... | Called by the virtualized data source to fetch items It will request a specific item and optionally ask for a number of items on either side of the requested item. The implementation should return the specific item and, in addition, can choose to return a range of items on either side of the requested index. The number... | [
"Called",
"by",
"the",
"virtualized",
"data",
"source",
"to",
"fetch",
"items",
"It",
"will",
"request",
"a",
"specific",
"item",
"and",
"optionally",
"ask",
"for",
"a",
"number",
"of",
"items",
"on",
"either",
"side",
"of",
"the",
"requested",
"item",
"."... | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/windows/sitewaertsdocumentviewer/js/pdfviewer.js#L945-L991 | |
16,455 | sitewaerts/cordova-plugin-document-viewer | src/common/js/angular-winjs/js/angular-winjs.js | getElementRoot | function getElementRoot(element) {
var curr = element;
while (curr.parentNode) {
curr = curr.parentNode;
}
return curr;
} | javascript | function getElementRoot(element) {
var curr = element;
while (curr.parentNode) {
curr = curr.parentNode;
}
return curr;
} | [
"function",
"getElementRoot",
"(",
"element",
")",
"{",
"var",
"curr",
"=",
"element",
";",
"while",
"(",
"curr",
".",
"parentNode",
")",
"{",
"curr",
"=",
"curr",
".",
"parentNode",
";",
"}",
"return",
"curr",
";",
"}"
] | Pure utility functions | [
"Pure",
"utility",
"functions"
] | 25b82d959c20d7880d513100c2b979e1e15349dc | https://github.com/sitewaerts/cordova-plugin-document-viewer/blob/25b82d959c20d7880d513100c2b979e1e15349dc/src/common/js/angular-winjs/js/angular-winjs.js#L51-L57 |
16,456 | words/syllable | index.js | syllable | function syllable(value) {
var count = 0
var index
var length
var singular
var parts
var addOne
var subtractOne
if (value.length === 0) {
return count
}
// Return early when possible.
if (value.length < 3) {
return 1
}
// If `value` is a hard to count, it might be in `problematic`.
... | javascript | function syllable(value) {
var count = 0
var index
var length
var singular
var parts
var addOne
var subtractOne
if (value.length === 0) {
return count
}
// Return early when possible.
if (value.length < 3) {
return 1
}
// If `value` is a hard to count, it might be in `problematic`.
... | [
"function",
"syllable",
"(",
"value",
")",
"{",
"var",
"count",
"=",
"0",
"var",
"index",
"var",
"length",
"var",
"singular",
"var",
"parts",
"var",
"addOne",
"var",
"subtractOne",
"if",
"(",
"value",
".",
"length",
"===",
"0",
")",
"{",
"return",
"cou... | Get syllables in a given value. | [
"Get",
"syllables",
"in",
"a",
"given",
"value",
"."
] | 9ce23aae3aa2ccdc5ae9b9136bfdd9a4d50103a5 | https://github.com/words/syllable/blob/9ce23aae3aa2ccdc5ae9b9136bfdd9a4d50103a5/index.js#L254-L340 |
16,457 | azuqua/jwt-redis-session | lib/utils.js | function(claims, callback){
if(typeof claims === "function" && !callback){
callback = claims;
claims = {};
}
var self = this,
sid = uuid.v4();
var token = jwt.sign(_.extend({ jti: sid }, claims || {}), options.secret, { algorithm: options.algorithm });
options.client.setex(options.keyspace + ... | javascript | function(claims, callback){
if(typeof claims === "function" && !callback){
callback = claims;
claims = {};
}
var self = this,
sid = uuid.v4();
var token = jwt.sign(_.extend({ jti: sid }, claims || {}), options.secret, { algorithm: options.algorithm });
options.client.setex(options.keyspace + ... | [
"function",
"(",
"claims",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"claims",
"===",
"\"function\"",
"&&",
"!",
"callback",
")",
"{",
"callback",
"=",
"claims",
";",
"claims",
"=",
"{",
"}",
";",
"}",
"var",
"self",
"=",
"this",
",",
"sid",
... | create a new session and return the jwt | [
"create",
"a",
"new",
"session",
"and",
"return",
"the",
"jwt"
] | 8161f7c2b0a5fc94d913a8a07a78950fee62a045 | https://github.com/azuqua/jwt-redis-session/blob/8161f7c2b0a5fc94d913a8a07a78950fee62a045/lib/utils.js#L32-L44 | |
16,458 | azuqua/jwt-redis-session | lib/utils.js | function(callback){
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.expire(options.keyspace + this.id, options.maxAge, callback);
} | javascript | function(callback){
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.expire(options.keyspace + this.id, options.maxAge, callback);
} | [
"function",
"(",
"callback",
")",
"{",
"if",
"(",
"!",
"this",
".",
"id",
")",
"{",
"return",
"process",
".",
"nextTick",
"(",
"function",
"(",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"Invalid session ID\"",
")",
")",
";",
"}",
")",
";",
... | update the TTL on a session | [
"update",
"the",
"TTL",
"on",
"a",
"session"
] | 8161f7c2b0a5fc94d913a8a07a78950fee62a045 | https://github.com/azuqua/jwt-redis-session/blob/8161f7c2b0a5fc94d913a8a07a78950fee62a045/lib/utils.js#L47-L54 | |
16,459 | azuqua/jwt-redis-session | lib/utils.js | function(callback){
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.setex(options.keyspace + this.id, options.maxAge, JSON.stringify(serializeSession(this)), callback);
} | javascript | function(callback){
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.setex(options.keyspace + this.id, options.maxAge, JSON.stringify(serializeSession(this)), callback);
} | [
"function",
"(",
"callback",
")",
"{",
"if",
"(",
"!",
"this",
".",
"id",
")",
"{",
"return",
"process",
".",
"nextTick",
"(",
"function",
"(",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"Invalid session ID\"",
")",
")",
";",
"}",
")",
";",
... | update a session's data, update the ttl | [
"update",
"a",
"session",
"s",
"data",
"update",
"the",
"ttl"
] | 8161f7c2b0a5fc94d913a8a07a78950fee62a045 | https://github.com/azuqua/jwt-redis-session/blob/8161f7c2b0a5fc94d913a8a07a78950fee62a045/lib/utils.js#L57-L64 | |
16,460 | azuqua/jwt-redis-session | lib/utils.js | function(callback){
var self = this;
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.get(options.keyspace + self.id, function(error, resp){
if(error)
return callback(error);
try{
resp = JSON.parse(resp);
}c... | javascript | function(callback){
var self = this;
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.get(options.keyspace + self.id, function(error, resp){
if(error)
return callback(error);
try{
resp = JSON.parse(resp);
}c... | [
"function",
"(",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"this",
".",
"id",
")",
"{",
"return",
"process",
".",
"nextTick",
"(",
"function",
"(",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"Invalid session ID\"",
... | reload a session data from redis | [
"reload",
"a",
"session",
"data",
"from",
"redis"
] | 8161f7c2b0a5fc94d913a8a07a78950fee62a045 | https://github.com/azuqua/jwt-redis-session/blob/8161f7c2b0a5fc94d913a8a07a78950fee62a045/lib/utils.js#L67-L86 | |
16,461 | azuqua/jwt-redis-session | lib/utils.js | function(callback){
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.del(options.keyspace + this.id, callback);
} | javascript | function(callback){
if(!this.id){
return process.nextTick(function(){
callback(new Error("Invalid session ID"));
});
}
options.client.del(options.keyspace + this.id, callback);
} | [
"function",
"(",
"callback",
")",
"{",
"if",
"(",
"!",
"this",
".",
"id",
")",
"{",
"return",
"process",
".",
"nextTick",
"(",
"function",
"(",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"Invalid session ID\"",
")",
")",
";",
"}",
")",
";",
... | destroy a session | [
"destroy",
"a",
"session"
] | 8161f7c2b0a5fc94d913a8a07a78950fee62a045 | https://github.com/azuqua/jwt-redis-session/blob/8161f7c2b0a5fc94d913a8a07a78950fee62a045/lib/utils.js#L89-L96 | |
16,462 | shama/gaze | lib/gaze.js | Gaze | function Gaze (patterns, opts, done) {
EE.call(this);
// If second arg is the callback
if (typeof opts === 'function') {
done = opts;
opts = {};
}
// Default options
opts = opts || {};
opts.mark = true;
opts.interval = opts.interval || 100;
opts.debounceDelay = opts.debounceDelay || 500;
o... | javascript | function Gaze (patterns, opts, done) {
EE.call(this);
// If second arg is the callback
if (typeof opts === 'function') {
done = opts;
opts = {};
}
// Default options
opts = opts || {};
opts.mark = true;
opts.interval = opts.interval || 100;
opts.debounceDelay = opts.debounceDelay || 500;
o... | [
"function",
"Gaze",
"(",
"patterns",
",",
"opts",
",",
"done",
")",
"{",
"EE",
".",
"call",
"(",
"this",
")",
";",
"// If second arg is the callback",
"if",
"(",
"typeof",
"opts",
"===",
"'function'",
")",
"{",
"done",
"=",
"opts",
";",
"opts",
"=",
"{... | `Gaze` EventEmitter object to return in the callback | [
"Gaze",
"EventEmitter",
"object",
"to",
"return",
"in",
"the",
"callback"
] | 19b87085606e80e02e5ca05ea942cf8a34732b59 | https://github.com/shama/gaze/blob/19b87085606e80e02e5ca05ea942cf8a34732b59/lib/gaze.js#L24-L74 |
16,463 | webpack-contrib/stylelint-webpack-plugin | lib/lint-dirty-modules-plugin.js | LintDirtyModulesPlugin | function LintDirtyModulesPlugin(compiler, options) {
this.startTime = Date.now();
this.prevTimestamps = {};
this.isFirstRun = true;
this.compiler = compiler;
this.options = options;
// bind(this) is here to prevent context overriding by webpack
compiler.plugin('emit', this.lint.bind(this));
} | javascript | function LintDirtyModulesPlugin(compiler, options) {
this.startTime = Date.now();
this.prevTimestamps = {};
this.isFirstRun = true;
this.compiler = compiler;
this.options = options;
// bind(this) is here to prevent context overriding by webpack
compiler.plugin('emit', this.lint.bind(this));
} | [
"function",
"LintDirtyModulesPlugin",
"(",
"compiler",
",",
"options",
")",
"{",
"this",
".",
"startTime",
"=",
"Date",
".",
"now",
"(",
")",
";",
"this",
".",
"prevTimestamps",
"=",
"{",
"}",
";",
"this",
".",
"isFirstRun",
"=",
"true",
";",
"this",
"... | Binds callback with provided options and stores initial values.
@param compiler - webpack compiler object
@param options - stylelint nodejs options | [
"Binds",
"callback",
"with",
"provided",
"options",
"and",
"stores",
"initial",
"values",
"."
] | 5ae9467ef6eaabfb42bd2e77ce34f8d380095601 | https://github.com/webpack-contrib/stylelint-webpack-plugin/blob/5ae9467ef6eaabfb42bd2e77ce34f8d380095601/lib/lint-dirty-modules-plugin.js#L12-L21 |
16,464 | croqaz/clean-mark | lib/read.js | getArticle | function getArticle (candidates, $) {
let topCandidate = null
candidates.forEach(elem => {
const linkDensity = getLinkDensity(elem, $)
const siblings = elem.children('p').length
const score = elem.data('readabilityScore')
elem.data(
'readabilityScore',
Math.min(2, Math.max(siblings, 1))... | javascript | function getArticle (candidates, $) {
let topCandidate = null
candidates.forEach(elem => {
const linkDensity = getLinkDensity(elem, $)
const siblings = elem.children('p').length
const score = elem.data('readabilityScore')
elem.data(
'readabilityScore',
Math.min(2, Math.max(siblings, 1))... | [
"function",
"getArticle",
"(",
"candidates",
",",
"$",
")",
"{",
"let",
"topCandidate",
"=",
"null",
"candidates",
".",
"forEach",
"(",
"elem",
"=>",
"{",
"const",
"linkDensity",
"=",
"getLinkDensity",
"(",
"elem",
",",
"$",
")",
"const",
"siblings",
"=",
... | Select the TopCandidate from all possible candidates | [
"Select",
"the",
"TopCandidate",
"from",
"all",
"possible",
"candidates"
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/read.js#L37-L73 |
16,465 | croqaz/clean-mark | lib/read.js | scoreCandidate | function scoreCandidate (node, contentScore, candidates) {
let score
if (typeof node.data('readabilityScore') === 'undefined') {
score = initializeNode(node)
candidates.push(node)
} else {
score = node.data('readabilityScore') || 0
}
node.data('readabilityScore', score + contentScore)
} | javascript | function scoreCandidate (node, contentScore, candidates) {
let score
if (typeof node.data('readabilityScore') === 'undefined') {
score = initializeNode(node)
candidates.push(node)
} else {
score = node.data('readabilityScore') || 0
}
node.data('readabilityScore', score + contentScore)
} | [
"function",
"scoreCandidate",
"(",
"node",
",",
"contentScore",
",",
"candidates",
")",
"{",
"let",
"score",
"if",
"(",
"typeof",
"node",
".",
"data",
"(",
"'readabilityScore'",
")",
"===",
"'undefined'",
")",
"{",
"score",
"=",
"initializeNode",
"(",
"node"... | Give a score to each node based on the Content.
@param node
@param contentScore
@param candidates | [
"Give",
"a",
"score",
"to",
"each",
"node",
"based",
"on",
"the",
"Content",
"."
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/read.js#L252-L261 |
16,466 | croqaz/clean-mark | lib/read.js | initializeNode | function initializeNode (node) {
if (!node || node.length === 0) {
return 0
}
const tag = node.get(0).name
if (nodeTypes.mostPositive.indexOf(tag) >= 0) {
return 5 + getClassWeight(node)
}
if (nodeTypes.positive.indexOf(tag) >= 0) {
return 3 + getClassWeight(node)
}
if (nodeTypes.negative.in... | javascript | function initializeNode (node) {
if (!node || node.length === 0) {
return 0
}
const tag = node.get(0).name
if (nodeTypes.mostPositive.indexOf(tag) >= 0) {
return 5 + getClassWeight(node)
}
if (nodeTypes.positive.indexOf(tag) >= 0) {
return 3 + getClassWeight(node)
}
if (nodeTypes.negative.in... | [
"function",
"initializeNode",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"node",
"||",
"node",
".",
"length",
"===",
"0",
")",
"{",
"return",
"0",
"}",
"const",
"tag",
"=",
"node",
".",
"get",
"(",
"0",
")",
".",
"name",
"if",
"(",
"nodeTypes",
".",
... | Check the type of node, and get its Weight | [
"Check",
"the",
"type",
"of",
"node",
"and",
"get",
"its",
"Weight"
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/read.js#L308-L326 |
16,467 | croqaz/clean-mark | lib/read.js | getClassWeight | function getClassWeight (node) {
if (node === null || node.length === 0) {
return 0
}
const name = node.get(0).name || ''
const cls = node.attr('class') || ''
const nid = node.attr('id') || ''
let weight = 0
// Schema.org/Article
if (node.attr('itemprop') && /articleBody/.test(node.attr('itemprop')... | javascript | function getClassWeight (node) {
if (node === null || node.length === 0) {
return 0
}
const name = node.get(0).name || ''
const cls = node.attr('class') || ''
const nid = node.attr('id') || ''
let weight = 0
// Schema.org/Article
if (node.attr('itemprop') && /articleBody/.test(node.attr('itemprop')... | [
"function",
"getClassWeight",
"(",
"node",
")",
"{",
"if",
"(",
"node",
"===",
"null",
"||",
"node",
".",
"length",
"===",
"0",
")",
"{",
"return",
"0",
"}",
"const",
"name",
"=",
"node",
".",
"get",
"(",
"0",
")",
".",
"name",
"||",
"''",
"const... | Node Weight is calculated based on className and ID of the node. | [
"Node",
"Weight",
"is",
"calculated",
"based",
"on",
"className",
"and",
"ID",
"of",
"the",
"node",
"."
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/read.js#L332-L377 |
16,468 | croqaz/clean-mark | lib/read.js | getLinkDensity | function getLinkDensity (node, $) {
const links = node.find('a')
const textLength = node.text().length
let linkLength = 0
links.each(function (index, elem) {
const href = $(this).attr('href')
if (!href || (href.length > 0 && href[0] === '#')) {
return
}
linkLength += $(this).text().length... | javascript | function getLinkDensity (node, $) {
const links = node.find('a')
const textLength = node.text().length
let linkLength = 0
links.each(function (index, elem) {
const href = $(this).attr('href')
if (!href || (href.length > 0 && href[0] === '#')) {
return
}
linkLength += $(this).text().length... | [
"function",
"getLinkDensity",
"(",
"node",
",",
"$",
")",
"{",
"const",
"links",
"=",
"node",
".",
"find",
"(",
"'a'",
")",
"const",
"textLength",
"=",
"node",
".",
"text",
"(",
")",
".",
"length",
"let",
"linkLength",
"=",
"0",
"links",
".",
"each",... | Get Link density of this node.
Total length of link text in this node divided by the total text of the node.
Relative links are not included. | [
"Get",
"Link",
"density",
"of",
"this",
"node",
".",
"Total",
"length",
"of",
"link",
"text",
"in",
"this",
"node",
"divided",
"by",
"the",
"total",
"text",
"of",
"the",
"node",
".",
"Relative",
"links",
"are",
"not",
"included",
"."
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/read.js#L385-L399 |
16,469 | croqaz/clean-mark | lib/read.js | extract | function extract ($, base) {
const candidates = getCandidates($, base)
let article = getArticle(candidates, $)
if (article.length < 1) {
article = getArticle([$('body')], $)
}
return article
} | javascript | function extract ($, base) {
const candidates = getCandidates($, base)
let article = getArticle(candidates, $)
if (article.length < 1) {
article = getArticle([$('body')], $)
}
return article
} | [
"function",
"extract",
"(",
"$",
",",
"base",
")",
"{",
"const",
"candidates",
"=",
"getCandidates",
"(",
"$",
",",
"base",
")",
"let",
"article",
"=",
"getArticle",
"(",
"candidates",
",",
"$",
")",
"if",
"(",
"article",
".",
"length",
"<",
"1",
")"... | Main method
If the first run does not succeed, try the body element; | [
"Main",
"method",
"If",
"the",
"first",
"run",
"does",
"not",
"succeed",
"try",
"the",
"body",
"element",
";"
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/read.js#L406-L413 |
16,470 | croqaz/clean-mark | lib/meta/index.js | scrapeMetadata | function scrapeMetadata (html, rules) {
rules = rules || RULES
const keys = Object.keys(rules)
const $ = cheerio.load(html)
const promises = keys.map(function (key) {
return scrapeMetadatum($, '', rules[key])
})
return Promise.all(promises).then(function (values) {
return keys.reduce(function (memo... | javascript | function scrapeMetadata (html, rules) {
rules = rules || RULES
const keys = Object.keys(rules)
const $ = cheerio.load(html)
const promises = keys.map(function (key) {
return scrapeMetadatum($, '', rules[key])
})
return Promise.all(promises).then(function (values) {
return keys.reduce(function (memo... | [
"function",
"scrapeMetadata",
"(",
"html",
",",
"rules",
")",
"{",
"rules",
"=",
"rules",
"||",
"RULES",
"const",
"keys",
"=",
"Object",
".",
"keys",
"(",
"rules",
")",
"const",
"$",
"=",
"cheerio",
".",
"load",
"(",
"html",
")",
"const",
"promises",
... | Scrape each entry in the metadata result dictionary in parallel.
@param {String} html
@param {String} url
@param {Object} rules (optional)
@return {Promise} metadata | [
"Scrape",
"each",
"entry",
"in",
"the",
"metadata",
"result",
"dictionary",
"in",
"parallel",
"."
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/meta/index.js#L17-L31 |
16,471 | croqaz/clean-mark | lib/meta/index.js | scrapeMetadatum | function scrapeMetadatum ($, url, rules) {
if (!Array.isArray(rules)) rules = [rules]
return rules.reduce(function (promise, rule) {
return promise.then(function (value) {
if (value != null && value !== '') return value
var next = rule($, url)
if (next != null && next !== '') return next
... | javascript | function scrapeMetadatum ($, url, rules) {
if (!Array.isArray(rules)) rules = [rules]
return rules.reduce(function (promise, rule) {
return promise.then(function (value) {
if (value != null && value !== '') return value
var next = rule($, url)
if (next != null && next !== '') return next
... | [
"function",
"scrapeMetadatum",
"(",
"$",
",",
"url",
",",
"rules",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"rules",
")",
")",
"rules",
"=",
"[",
"rules",
"]",
"return",
"rules",
".",
"reduce",
"(",
"function",
"(",
"promise",
",",
"... | Scrape the first non-null value returned by an array of `rules` functions for
a single property in the metadata result dictionary.
@param {Cheerio} $
@param {String} url
@param {Array or Function} rules
@return {Promise} value | [
"Scrape",
"the",
"first",
"non",
"-",
"null",
"value",
"returned",
"by",
"an",
"array",
"of",
"rules",
"functions",
"for",
"a",
"single",
"property",
"in",
"the",
"metadata",
"result",
"dictionary",
"."
] | 48e5b95093e086ca88130af1800861a46895d2e6 | https://github.com/croqaz/clean-mark/blob/48e5b95093e086ca88130af1800861a46895d2e6/lib/meta/index.js#L43-L54 |
16,472 | NathanWalker/angular-seed-advanced | tools/install.js | AttemptRootSymlink | function AttemptRootSymlink() {
if (process.platform === 'win32') {
var curPath = resolve("./");
if (debugging) {
console.log("RootSymlink Base path is", curPath);
}
cp.execSync("powershell -Command \"Start-Process 'node' -ArgumentList '"+curPath+"/install.js symlink' -verb runas\... | javascript | function AttemptRootSymlink() {
if (process.platform === 'win32') {
var curPath = resolve("./");
if (debugging) {
console.log("RootSymlink Base path is", curPath);
}
cp.execSync("powershell -Command \"Start-Process 'node' -ArgumentList '"+curPath+"/install.js symlink' -verb runas\... | [
"function",
"AttemptRootSymlink",
"(",
")",
"{",
"if",
"(",
"process",
".",
"platform",
"===",
"'win32'",
")",
"{",
"var",
"curPath",
"=",
"resolve",
"(",
"\"./\"",
")",
";",
"if",
"(",
"debugging",
")",
"{",
"console",
".",
"log",
"(",
"\"RootSymlink Ba... | This will attempt to run the install script as root to make a symlink | [
"This",
"will",
"attempt",
"to",
"run",
"the",
"install",
"script",
"as",
"root",
"to",
"make",
"a",
"symlink"
] | 2d652e157a4841830f616fbc9be69d8fddf2ae2e | https://github.com/NathanWalker/angular-seed-advanced/blob/2d652e157a4841830f616fbc9be69d8fddf2ae2e/tools/install.js#L71-L83 |
16,473 | NathanWalker/angular-seed-advanced | tools/install.js | createRootSymLink | function createRootSymLink() {
var li1 = process.argv[1].lastIndexOf('\\'), li2 = process.argv[1].lastIndexOf('/');
if (li2 > li1) { li1 = li2; }
var AppPath = process.argv[1].substring(0,li1);
var p1 = resolve(AppPath + "/" + nativescriptAppPath);
var p2 = resolve(AppPath + "/" + webAppPath);
i... | javascript | function createRootSymLink() {
var li1 = process.argv[1].lastIndexOf('\\'), li2 = process.argv[1].lastIndexOf('/');
if (li2 > li1) { li1 = li2; }
var AppPath = process.argv[1].substring(0,li1);
var p1 = resolve(AppPath + "/" + nativescriptAppPath);
var p2 = resolve(AppPath + "/" + webAppPath);
i... | [
"function",
"createRootSymLink",
"(",
")",
"{",
"var",
"li1",
"=",
"process",
".",
"argv",
"[",
"1",
"]",
".",
"lastIndexOf",
"(",
"'\\\\'",
")",
",",
"li2",
"=",
"process",
".",
"argv",
"[",
"1",
"]",
".",
"lastIndexOf",
"(",
"'/'",
")",
";",
"if"... | Create the symlink when running as root | [
"Create",
"the",
"symlink",
"when",
"running",
"as",
"root"
] | 2d652e157a4841830f616fbc9be69d8fddf2ae2e | https://github.com/NathanWalker/angular-seed-advanced/blob/2d652e157a4841830f616fbc9be69d8fddf2ae2e/tools/install.js#L88-L98 |
16,474 | contentful/contentful-export | lib/tasks/get-space-data.js | pagedGet | function pagedGet ({source, method, skip = 0, aggregatedResponse = null, query = null}) {
const fullQuery = Object.assign({},
{
skip: skip,
limit: pageLimit,
order: 'sys.createdAt,sys.id'
},
query
)
return source[method](fullQuery)
.then((response) => {
if (!aggregatedResp... | javascript | function pagedGet ({source, method, skip = 0, aggregatedResponse = null, query = null}) {
const fullQuery = Object.assign({},
{
skip: skip,
limit: pageLimit,
order: 'sys.createdAt,sys.id'
},
query
)
return source[method](fullQuery)
.then((response) => {
if (!aggregatedResp... | [
"function",
"pagedGet",
"(",
"{",
"source",
",",
"method",
",",
"skip",
"=",
"0",
",",
"aggregatedResponse",
"=",
"null",
",",
"query",
"=",
"null",
"}",
")",
"{",
"const",
"fullQuery",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"{",
"skip",
... | Gets all the existing entities based on pagination parameters.
The first call will have no aggregated response. Subsequent calls will
concatenate the new responses to the original one. | [
"Gets",
"all",
"the",
"existing",
"entities",
"based",
"on",
"pagination",
"parameters",
".",
"The",
"first",
"call",
"will",
"have",
"no",
"aggregated",
"response",
".",
"Subsequent",
"calls",
"will",
"concatenate",
"the",
"new",
"responses",
"to",
"the",
"or... | 8c5ad62494904967207479f338c6a0e102c9f186 | https://github.com/contentful/contentful-export/blob/8c5ad62494904967207479f338c6a0e102c9f186/lib/tasks/get-space-data.js#L157-L182 |
16,475 | pugjs/pug-cli | index.js | parseObj | function parseObj (input) {
try {
return require(path.resolve(input));
} catch (e) {
var str;
try {
str = fs.readFileSync(program.obj, 'utf8');
} catch (e) {
str = program.obj;
}
try {
return JSON.parse(str);
} catch (e) {
return eval('(' + str + ')');
}
}
} | javascript | function parseObj (input) {
try {
return require(path.resolve(input));
} catch (e) {
var str;
try {
str = fs.readFileSync(program.obj, 'utf8');
} catch (e) {
str = program.obj;
}
try {
return JSON.parse(str);
} catch (e) {
return eval('(' + str + ')');
}
}
} | [
"function",
"parseObj",
"(",
"input",
")",
"{",
"try",
"{",
"return",
"require",
"(",
"path",
".",
"resolve",
"(",
"input",
")",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"var",
"str",
";",
"try",
"{",
"str",
"=",
"fs",
".",
"readFileSync",
"("... | Parse object either in `input` or in the file called `input`. The latter is
searched first. | [
"Parse",
"object",
"either",
"in",
"input",
"or",
"in",
"the",
"file",
"called",
"input",
".",
"The",
"latter",
"is",
"searched",
"first",
"."
] | 0eb8d37c5a38cb297cf09361631b93312e0dfa21 | https://github.com/pugjs/pug-cli/blob/0eb8d37c5a38cb297cf09361631b93312e0dfa21/index.js#L88-L104 |
16,476 | pugjs/pug-cli | index.js | watchFile | function watchFile(path, base, rootPath) {
path = normalize(path);
var log = ' ' + chalk.gray('watching') + ' ' + chalk.cyan(path);
if (!base) {
base = path;
} else {
base = normalize(base);
log += '\n ' + chalk.gray('as a dependency of') + ' ';
log += chalk.cyan(base);
}
if (watchList... | javascript | function watchFile(path, base, rootPath) {
path = normalize(path);
var log = ' ' + chalk.gray('watching') + ' ' + chalk.cyan(path);
if (!base) {
base = path;
} else {
base = normalize(base);
log += '\n ' + chalk.gray('as a dependency of') + ' ';
log += chalk.cyan(base);
}
if (watchList... | [
"function",
"watchFile",
"(",
"path",
",",
"base",
",",
"rootPath",
")",
"{",
"path",
"=",
"normalize",
"(",
"path",
")",
";",
"var",
"log",
"=",
"' '",
"+",
"chalk",
".",
"gray",
"(",
"'watching'",
")",
"+",
"' '",
"+",
"chalk",
".",
"cyan",
"(",... | Watch for changes on path
Renders `base` if specified, otherwise renders `path`. | [
"Watch",
"for",
"changes",
"on",
"path"
] | 0eb8d37c5a38cb297cf09361631b93312e0dfa21 | https://github.com/pugjs/pug-cli/blob/0eb8d37c5a38cb297cf09361631b93312e0dfa21/index.js#L161-L192 |
16,477 | pugjs/pug-cli | index.js | tryRender | function tryRender(path, rootPath) {
try {
renderFile(path, rootPath);
} catch (e) {
// keep watching when error occured.
console.error(errorToString(e) + '\x07');
}
} | javascript | function tryRender(path, rootPath) {
try {
renderFile(path, rootPath);
} catch (e) {
// keep watching when error occured.
console.error(errorToString(e) + '\x07');
}
} | [
"function",
"tryRender",
"(",
"path",
",",
"rootPath",
")",
"{",
"try",
"{",
"renderFile",
"(",
"path",
",",
"rootPath",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"// keep watching when error occured.",
"console",
".",
"error",
"(",
"errorToString",
"(",
... | Try to render `path`; if an exception is thrown it is printed to stderr and
otherwise ignored.
This is used in watch mode. | [
"Try",
"to",
"render",
"path",
";",
"if",
"an",
"exception",
"is",
"thrown",
"it",
"is",
"printed",
"to",
"stderr",
"and",
"otherwise",
"ignored",
"."
] | 0eb8d37c5a38cb297cf09361631b93312e0dfa21 | https://github.com/pugjs/pug-cli/blob/0eb8d37c5a38cb297cf09361631b93312e0dfa21/index.js#L207-L214 |
16,478 | pugjs/pug-cli | index.js | stdin | function stdin() {
var buf = '';
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk){ buf += chunk; });
process.stdin.on('end', function(){
var output;
if (options.client) {
output = pug.compileClient(buf, options);
} else {
var fn = pug.compile(buf, options);
... | javascript | function stdin() {
var buf = '';
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk){ buf += chunk; });
process.stdin.on('end', function(){
var output;
if (options.client) {
output = pug.compileClient(buf, options);
} else {
var fn = pug.compile(buf, options);
... | [
"function",
"stdin",
"(",
")",
"{",
"var",
"buf",
"=",
"''",
";",
"process",
".",
"stdin",
".",
"setEncoding",
"(",
"'utf8'",
")",
";",
"process",
".",
"stdin",
".",
"on",
"(",
"'data'",
",",
"function",
"(",
"chunk",
")",
"{",
"buf",
"+=",
"chunk"... | Compile from stdin. | [
"Compile",
"from",
"stdin",
"."
] | 0eb8d37c5a38cb297cf09361631b93312e0dfa21 | https://github.com/pugjs/pug-cli/blob/0eb8d37c5a38cb297cf09361631b93312e0dfa21/index.js#L220-L234 |
16,479 | pugjs/pug-cli | index.js | renderFile | function renderFile(path, rootPath) {
var isPug = /\.(?:pug|jade)$/;
var isIgnored = /([\/\\]_)|(^_)/;
var stat = fs.lstatSync(path);
// Found pug file
if (stat.isFile() && isPug.test(path) && !isIgnored.test(path)) {
// Try to watch the file if needed. watchFile takes care of duplicates.
if (program... | javascript | function renderFile(path, rootPath) {
var isPug = /\.(?:pug|jade)$/;
var isIgnored = /([\/\\]_)|(^_)/;
var stat = fs.lstatSync(path);
// Found pug file
if (stat.isFile() && isPug.test(path) && !isIgnored.test(path)) {
// Try to watch the file if needed. watchFile takes care of duplicates.
if (program... | [
"function",
"renderFile",
"(",
"path",
",",
"rootPath",
")",
"{",
"var",
"isPug",
"=",
"/",
"\\.(?:pug|jade)$",
"/",
";",
"var",
"isIgnored",
"=",
"/",
"([\\/\\\\]_)|(^_)",
"/",
";",
"var",
"stat",
"=",
"fs",
".",
"lstatSync",
"(",
"path",
")",
";",
"/... | Process the given path, compiling the pug files found.
Always walk the subdirectories.
@param path path of the file, might be relative
@param rootPath path relative to the directory specified in the command | [
"Process",
"the",
"given",
"path",
"compiling",
"the",
"pug",
"files",
"found",
".",
"Always",
"walk",
"the",
"subdirectories",
"."
] | 0eb8d37c5a38cb297cf09361631b93312e0dfa21 | https://github.com/pugjs/pug-cli/blob/0eb8d37c5a38cb297cf09361631b93312e0dfa21/index.js#L244-L300 |
16,480 | pugjs/pug-cli | index.js | getNameFromFileName | function getNameFromFileName(filename) {
var file = basename(filename).replace(/\.(?:pug|jade)$/, '');
return file.toLowerCase().replace(/[^a-z0-9]+([a-z])/g, function (_, character) {
return character.toUpperCase();
}) + 'Template';
} | javascript | function getNameFromFileName(filename) {
var file = basename(filename).replace(/\.(?:pug|jade)$/, '');
return file.toLowerCase().replace(/[^a-z0-9]+([a-z])/g, function (_, character) {
return character.toUpperCase();
}) + 'Template';
} | [
"function",
"getNameFromFileName",
"(",
"filename",
")",
"{",
"var",
"file",
"=",
"basename",
"(",
"filename",
")",
".",
"replace",
"(",
"/",
"\\.(?:pug|jade)$",
"/",
",",
"''",
")",
";",
"return",
"file",
".",
"toLowerCase",
"(",
")",
".",
"replace",
"(... | Get a sensible name for a template function from a file path
@param {String} filename
@returns {String} | [
"Get",
"a",
"sensible",
"name",
"for",
"a",
"template",
"function",
"from",
"a",
"file",
"path"
] | 0eb8d37c5a38cb297cf09361631b93312e0dfa21 | https://github.com/pugjs/pug-cli/blob/0eb8d37c5a38cb297cf09361631b93312e0dfa21/index.js#L308-L313 |
16,481 | npm/init-package-json | init-package-json.js | unParsePeople | function unParsePeople (data) {
if (data.author) data.author = unParsePerson(data.author)
;["maintainers", "contributors"].forEach(function (set) {
if (!Array.isArray(data[set])) return;
data[set] = data[set].map(unParsePerson)
})
return data
} | javascript | function unParsePeople (data) {
if (data.author) data.author = unParsePerson(data.author)
;["maintainers", "contributors"].forEach(function (set) {
if (!Array.isArray(data[set])) return;
data[set] = data[set].map(unParsePerson)
})
return data
} | [
"function",
"unParsePeople",
"(",
"data",
")",
"{",
"if",
"(",
"data",
".",
"author",
")",
"data",
".",
"author",
"=",
"unParsePerson",
"(",
"data",
".",
"author",
")",
";",
"[",
"\"maintainers\"",
",",
"\"contributors\"",
"]",
".",
"forEach",
"(",
"func... | turn the objects into somewhat more humane strings. | [
"turn",
"the",
"objects",
"into",
"somewhat",
"more",
"humane",
"strings",
"."
] | 2b5d21ea3e3434f8e0d6050cd2733d5062b830c6 | https://github.com/npm/init-package-json/blob/2b5d21ea3e3434f8e0d6050cd2733d5062b830c6/init-package-json.js#L136-L143 |
16,482 | dagrejs/graphlib-dot | lib/build-graph.js | collectNodeIds | function collectNodeIds(stmt) {
var ids = {},
stack = [],
curr;
var push = stack.push.bind(stack);
push(stmt);
while(stack.length) {
curr = stack.pop();
switch(curr.type) {
case "node": ids[curr.id] = true; break;
case "edge": _.each(curr.elems, push); break;
case "subgra... | javascript | function collectNodeIds(stmt) {
var ids = {},
stack = [],
curr;
var push = stack.push.bind(stack);
push(stmt);
while(stack.length) {
curr = stack.pop();
switch(curr.type) {
case "node": ids[curr.id] = true; break;
case "edge": _.each(curr.elems, push); break;
case "subgra... | [
"function",
"collectNodeIds",
"(",
"stmt",
")",
"{",
"var",
"ids",
"=",
"{",
"}",
",",
"stack",
"=",
"[",
"]",
",",
"curr",
";",
"var",
"push",
"=",
"stack",
".",
"push",
".",
"bind",
"(",
"stack",
")",
";",
"push",
"(",
"stmt",
")",
";",
"whil... | Collect all nodes involved in a subgraph statement | [
"Collect",
"all",
"nodes",
"involved",
"in",
"a",
"subgraph",
"statement"
] | dfdc417277fe2c51a551edbb497713113f715949 | https://github.com/dagrejs/graphlib-dot/blob/dfdc417277fe2c51a551edbb497713113f715949/lib/build-graph.js#L110-L128 |
16,483 | manuelstofer/json-pointer | index.js | api | function api (obj, pointer, value) {
// .set()
if (arguments.length === 3) {
return api.set(obj, pointer, value);
}
// .get()
if (arguments.length === 2) {
return api.get(obj, pointer);
}
// Return a partially applied function on `obj`.
var wrapped = api.bind(api, obj);
... | javascript | function api (obj, pointer, value) {
// .set()
if (arguments.length === 3) {
return api.set(obj, pointer, value);
}
// .get()
if (arguments.length === 2) {
return api.get(obj, pointer);
}
// Return a partially applied function on `obj`.
var wrapped = api.bind(api, obj);
... | [
"function",
"api",
"(",
"obj",
",",
"pointer",
",",
"value",
")",
"{",
"// .set()",
"if",
"(",
"arguments",
".",
"length",
"===",
"3",
")",
"{",
"return",
"api",
".",
"set",
"(",
"obj",
",",
"pointer",
",",
"value",
")",
";",
"}",
"// .get()",
"if"... | Convenience wrapper around the api.
Calls `.get` when called with an `object` and a `pointer`.
Calls `.set` when also called with `value`.
If only supplied `object`, returns a partially applied function, mapped to the object.
@param {Object} obj
@param {String|Array} pointer
@param value
@returns {*} | [
"Convenience",
"wrapper",
"around",
"the",
"api",
".",
"Calls",
".",
"get",
"when",
"called",
"with",
"an",
"object",
"and",
"a",
"pointer",
".",
"Calls",
".",
"set",
"when",
"also",
"called",
"with",
"value",
".",
"If",
"only",
"supplied",
"object",
"re... | 018e48894b5808db371568471952e9968f8bd830 | https://github.com/manuelstofer/json-pointer/blob/018e48894b5808db371568471952e9968f8bd830/index.js#L19-L38 |
16,484 | lukeed/taskr | packages/taskr/lib/plugins.js | getDependencies | function getDependencies(pkg) {
if (!pkg) {
return [];
}
if (!isObject(pkg)) {
$.error('Content from `package.json` must be an `Object`!');
return [];
}
// get all possible dependencies
const deps = [
'dependencies', 'devDependencies', 'peerDependencies'
].filter(key => pkg[key] !== void 0).map(k => Ob... | javascript | function getDependencies(pkg) {
if (!pkg) {
return [];
}
if (!isObject(pkg)) {
$.error('Content from `package.json` must be an `Object`!');
return [];
}
// get all possible dependencies
const deps = [
'dependencies', 'devDependencies', 'peerDependencies'
].filter(key => pkg[key] !== void 0).map(k => Ob... | [
"function",
"getDependencies",
"(",
"pkg",
")",
"{",
"if",
"(",
"!",
"pkg",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"isObject",
"(",
"pkg",
")",
")",
"{",
"$",
".",
"error",
"(",
"'Content from `package.json` must be an `Object`!'",
")",
... | Find a sibling `package.json` file & return its contents.
@param {Object} file A `package.json` contents as JSON
@return {Array} The names of all dependencies, flattened | [
"Find",
"a",
"sibling",
"package",
".",
"json",
"file",
"&",
"return",
"its",
"contents",
"."
] | 82d0bef537c598d32ef425af7eef7cee3cf59a5f | https://github.com/lukeed/taskr/blob/82d0bef537c598d32ef425af7eef7cee3cf59a5f/packages/taskr/lib/plugins.js#L38-L54 |
16,485 | cgewecke/eth-gas-reporter | gasStats.js | gasToCost | function gasToCost (gas, ethPrice, gasPrice) {
ethPrice = parseFloat(ethPrice)
gasPrice = parseInt(gasPrice)
return ((gasPrice / 1e9) * gas * ethPrice).toFixed(2)
} | javascript | function gasToCost (gas, ethPrice, gasPrice) {
ethPrice = parseFloat(ethPrice)
gasPrice = parseInt(gasPrice)
return ((gasPrice / 1e9) * gas * ethPrice).toFixed(2)
} | [
"function",
"gasToCost",
"(",
"gas",
",",
"ethPrice",
",",
"gasPrice",
")",
"{",
"ethPrice",
"=",
"parseFloat",
"(",
"ethPrice",
")",
"gasPrice",
"=",
"parseInt",
"(",
"gasPrice",
")",
"return",
"(",
"(",
"gasPrice",
"/",
"1e9",
")",
"*",
"gas",
"*",
"... | Expresses gas usage as a nation-state currency price
@param {Number} gas gas used
@param {Number} ethPrice e.g chf/eth
@param {Number} gasPrice in wei e.g 5000000000 (5 gwei)
@return {Number} cost of gas used (0.00) | [
"Expresses",
"gas",
"usage",
"as",
"a",
"nation",
"-",
"state",
"currency",
"price"
] | cb2f540dbf00e3d1ac7871467eb628f05e8d8e90 | https://github.com/cgewecke/eth-gas-reporter/blob/cb2f540dbf00e3d1ac7871467eb628f05e8d8e90/gasStats.js#L43-L47 |
16,486 | cgewecke/eth-gas-reporter | gasStats.js | matchBinaries | function matchBinaries (input, binary) {
const regExp = bytecodeToBytecodeRegex(binary);
return (input.match(regExp) !== null);
} | javascript | function matchBinaries (input, binary) {
const regExp = bytecodeToBytecodeRegex(binary);
return (input.match(regExp) !== null);
} | [
"function",
"matchBinaries",
"(",
"input",
",",
"binary",
")",
"{",
"const",
"regExp",
"=",
"bytecodeToBytecodeRegex",
"(",
"binary",
")",
";",
"return",
"(",
"input",
".",
"match",
"(",
"regExp",
")",
"!==",
"null",
")",
";",
"}"
] | Return true if transaction input and binary are same, ignoring library link code.
@param {String} code
@return {Bool} | [
"Return",
"true",
"if",
"transaction",
"input",
"and",
"binary",
"are",
"same",
"ignoring",
"library",
"link",
"code",
"."
] | cb2f540dbf00e3d1ac7871467eb628f05e8d8e90 | https://github.com/cgewecke/eth-gas-reporter/blob/cb2f540dbf00e3d1ac7871467eb628f05e8d8e90/gasStats.js#L73-L76 |
16,487 | cgewecke/eth-gas-reporter | gasStats.js | getContractNames | function getContractNames(filePath){
const names = [];
const code = fs.readFileSync(filePath, 'utf-8');
const ast = parser.parse(code, {tolerant: true});
parser.visit(ast, {
ContractDefinition: function(node) {
names.push(node.name);
}
});
return names;
} | javascript | function getContractNames(filePath){
const names = [];
const code = fs.readFileSync(filePath, 'utf-8');
const ast = parser.parse(code, {tolerant: true});
parser.visit(ast, {
ContractDefinition: function(node) {
names.push(node.name);
}
});
return names;
} | [
"function",
"getContractNames",
"(",
"filePath",
")",
"{",
"const",
"names",
"=",
"[",
"]",
";",
"const",
"code",
"=",
"fs",
".",
"readFileSync",
"(",
"filePath",
",",
"'utf-8'",
")",
";",
"const",
"ast",
"=",
"parser",
".",
"parse",
"(",
"code",
",",
... | Parses files for contract names
@param {String} filePath path to file
@return {Array} array of contract names | [
"Parses",
"files",
"for",
"contract",
"names"
] | cb2f540dbf00e3d1ac7871467eb628f05e8d8e90 | https://github.com/cgewecke/eth-gas-reporter/blob/cb2f540dbf00e3d1ac7871467eb628f05e8d8e90/gasStats.js#L307-L319 |
16,488 | jshttp/type-is | index.js | typeis | function typeis (value, types_) {
var i
var types = types_
// remove parameters and normalize
var val = tryNormalizeType(value)
// no type or invalid
if (!val) {
return false
}
// support flattened arguments
if (types && !Array.isArray(types)) {
types = new Array(arguments.length - 1)
f... | javascript | function typeis (value, types_) {
var i
var types = types_
// remove parameters and normalize
var val = tryNormalizeType(value)
// no type or invalid
if (!val) {
return false
}
// support flattened arguments
if (types && !Array.isArray(types)) {
types = new Array(arguments.length - 1)
f... | [
"function",
"typeis",
"(",
"value",
",",
"types_",
")",
"{",
"var",
"i",
"var",
"types",
"=",
"types_",
"// remove parameters and normalize",
"var",
"val",
"=",
"tryNormalizeType",
"(",
"value",
")",
"// no type or invalid",
"if",
"(",
"!",
"val",
")",
"{",
... | Compare a `value` content-type with `types`.
Each `type` can be an extension like `html`,
a special shortcut like `multipart` or `urlencoded`,
or a mime type.
If no types match, `false` is returned.
Otherwise, the first `type` that matches is returned.
@param {String} value
@param {Array} types
@public | [
"Compare",
"a",
"value",
"content",
"-",
"type",
"with",
"types",
".",
"Each",
"type",
"can",
"be",
"an",
"extension",
"like",
"html",
"a",
"special",
"shortcut",
"like",
"multipart",
"or",
"urlencoded",
"or",
"a",
"mime",
"type",
"."
] | bfebe3d4ac312debccb7dbbc79242e2581dea5f0 | https://github.com/jshttp/type-is/blob/bfebe3d4ac312debccb7dbbc79242e2581dea5f0/index.js#L43-L79 |
16,489 | jshttp/type-is | index.js | typeofrequest | function typeofrequest (req, types_) {
var types = types_
// no body
if (!hasbody(req)) {
return null
}
// support flattened arguments
if (arguments.length > 2) {
types = new Array(arguments.length - 1)
for (var i = 0; i < types.length; i++) {
types[i] = arguments[i + 1]
}
}
// ... | javascript | function typeofrequest (req, types_) {
var types = types_
// no body
if (!hasbody(req)) {
return null
}
// support flattened arguments
if (arguments.length > 2) {
types = new Array(arguments.length - 1)
for (var i = 0; i < types.length; i++) {
types[i] = arguments[i + 1]
}
}
// ... | [
"function",
"typeofrequest",
"(",
"req",
",",
"types_",
")",
"{",
"var",
"types",
"=",
"types_",
"// no body",
"if",
"(",
"!",
"hasbody",
"(",
"req",
")",
")",
"{",
"return",
"null",
"}",
"// support flattened arguments",
"if",
"(",
"arguments",
".",
"leng... | Check if the incoming request contains the "Content-Type"
header field, and it contains any of the give mime `type`s.
If there is no request body, `null` is returned.
If there is no content type, `false` is returned.
Otherwise, it returns the first `type` that matches.
Examples:
// With Content-Type: text/html; chars... | [
"Check",
"if",
"the",
"incoming",
"request",
"contains",
"the",
"Content",
"-",
"Type",
"header",
"field",
"and",
"it",
"contains",
"any",
"of",
"the",
"give",
"mime",
"type",
"s",
".",
"If",
"there",
"is",
"no",
"request",
"body",
"null",
"is",
"returne... | bfebe3d4ac312debccb7dbbc79242e2581dea5f0 | https://github.com/jshttp/type-is/blob/bfebe3d4ac312debccb7dbbc79242e2581dea5f0/index.js#L123-L143 |
16,490 | jshttp/type-is | index.js | normalize | function normalize (type) {
if (typeof type !== 'string') {
// invalid type
return false
}
switch (type) {
case 'urlencoded':
return 'application/x-www-form-urlencoded'
case 'multipart':
return 'multipart/*'
}
if (type[0] === '+') {
// "+json" -> "*/*+json" expando
return... | javascript | function normalize (type) {
if (typeof type !== 'string') {
// invalid type
return false
}
switch (type) {
case 'urlencoded':
return 'application/x-www-form-urlencoded'
case 'multipart':
return 'multipart/*'
}
if (type[0] === '+') {
// "+json" -> "*/*+json" expando
return... | [
"function",
"normalize",
"(",
"type",
")",
"{",
"if",
"(",
"typeof",
"type",
"!==",
"'string'",
")",
"{",
"// invalid type",
"return",
"false",
"}",
"switch",
"(",
"type",
")",
"{",
"case",
"'urlencoded'",
":",
"return",
"'application/x-www-form-urlencoded'",
... | Normalize a mime type.
If it's a shorthand, expand it to a valid mime type.
In general, you probably want:
var type = is(req, ['urlencoded', 'json', 'multipart']);
Then use the appropriate body parsers.
These three are the most common request body types
and are thus ensured to work.
@param {String} type
@private | [
"Normalize",
"a",
"mime",
"type",
".",
"If",
"it",
"s",
"a",
"shorthand",
"expand",
"it",
"to",
"a",
"valid",
"mime",
"type",
"."
] | bfebe3d4ac312debccb7dbbc79242e2581dea5f0 | https://github.com/jshttp/type-is/blob/bfebe3d4ac312debccb7dbbc79242e2581dea5f0/index.js#L161-L182 |
16,491 | jshttp/type-is | index.js | mimeMatch | function mimeMatch (expected, actual) {
// invalid type
if (expected === false) {
return false
}
// split types
var actualParts = actual.split('/')
var expectedParts = expected.split('/')
// invalid format
if (actualParts.length !== 2 || expectedParts.length !== 2) {
return false
}
// val... | javascript | function mimeMatch (expected, actual) {
// invalid type
if (expected === false) {
return false
}
// split types
var actualParts = actual.split('/')
var expectedParts = expected.split('/')
// invalid format
if (actualParts.length !== 2 || expectedParts.length !== 2) {
return false
}
// val... | [
"function",
"mimeMatch",
"(",
"expected",
",",
"actual",
")",
"{",
"// invalid type",
"if",
"(",
"expected",
"===",
"false",
")",
"{",
"return",
"false",
"}",
"// split types",
"var",
"actualParts",
"=",
"actual",
".",
"split",
"(",
"'/'",
")",
"var",
"exp... | Check if `expected` mime type
matches `actual` mime type with
wildcard and +suffix support.
@param {String} expected
@param {String} actual
@return {Boolean}
@private | [
"Check",
"if",
"expected",
"mime",
"type",
"matches",
"actual",
"mime",
"type",
"with",
"wildcard",
"and",
"+",
"suffix",
"support",
"."
] | bfebe3d4ac312debccb7dbbc79242e2581dea5f0 | https://github.com/jshttp/type-is/blob/bfebe3d4ac312debccb7dbbc79242e2581dea5f0/index.js#L195-L227 |
16,492 | jshttp/type-is | index.js | normalizeType | function normalizeType (value) {
// parse the type
var type = typer.parse(value)
// remove the parameters
type.parameters = undefined
// reformat it
return typer.format(type)
} | javascript | function normalizeType (value) {
// parse the type
var type = typer.parse(value)
// remove the parameters
type.parameters = undefined
// reformat it
return typer.format(type)
} | [
"function",
"normalizeType",
"(",
"value",
")",
"{",
"// parse the type",
"var",
"type",
"=",
"typer",
".",
"parse",
"(",
"value",
")",
"// remove the parameters",
"type",
".",
"parameters",
"=",
"undefined",
"// reformat it",
"return",
"typer",
".",
"format",
"... | Normalize a type and remove parameters.
@param {string} value
@return {string}
@private | [
"Normalize",
"a",
"type",
"and",
"remove",
"parameters",
"."
] | bfebe3d4ac312debccb7dbbc79242e2581dea5f0 | https://github.com/jshttp/type-is/blob/bfebe3d4ac312debccb7dbbc79242e2581dea5f0/index.js#L237-L246 |
16,493 | adametry/gulp-eslint | util.js | isErrorMessage | function isErrorMessage(message) {
const level = message.fatal ? 2 : message.severity;
if (Array.isArray(level)) {
return level[0] > 1;
}
return level > 1;
} | javascript | function isErrorMessage(message) {
const level = message.fatal ? 2 : message.severity;
if (Array.isArray(level)) {
return level[0] > 1;
}
return level > 1;
} | [
"function",
"isErrorMessage",
"(",
"message",
")",
"{",
"const",
"level",
"=",
"message",
".",
"fatal",
"?",
"2",
":",
"message",
".",
"severity",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"level",
")",
")",
"{",
"return",
"level",
"[",
"0",
"]",... | Determine if a message is an error
@param {Object} message - an ESLint message
@returns {Boolean} whether the message is an error message | [
"Determine",
"if",
"a",
"message",
"is",
"an",
"error"
] | 40d004fa2f48325f6a507cb10072ff6667aeaf41 | https://github.com/adametry/gulp-eslint/blob/40d004fa2f48325f6a507cb10072ff6667aeaf41/util.js#L131-L139 |
16,494 | adametry/gulp-eslint | util.js | countFixableErrorMessage | function countFixableErrorMessage(count, message) {
return count + Number(isErrorMessage(message) && message.fix !== undefined);
} | javascript | function countFixableErrorMessage(count, message) {
return count + Number(isErrorMessage(message) && message.fix !== undefined);
} | [
"function",
"countFixableErrorMessage",
"(",
"count",
",",
"message",
")",
"{",
"return",
"count",
"+",
"Number",
"(",
"isErrorMessage",
"(",
"message",
")",
"&&",
"message",
".",
"fix",
"!==",
"undefined",
")",
";",
"}"
] | Increment count if message is a fixable error
@param {Number} count - count of errors
@param {Object} message - an ESLint message
@returns {Number} The number of errors, message included | [
"Increment",
"count",
"if",
"message",
"is",
"a",
"fixable",
"error"
] | 40d004fa2f48325f6a507cb10072ff6667aeaf41 | https://github.com/adametry/gulp-eslint/blob/40d004fa2f48325f6a507cb10072ff6667aeaf41/util.js#L171-L173 |
16,495 | adametry/gulp-eslint | util.js | countFixableWarningMessage | function countFixableWarningMessage(count, message) {
return count + Number(message.severity === 1 && message.fix !== undefined);
} | javascript | function countFixableWarningMessage(count, message) {
return count + Number(message.severity === 1 && message.fix !== undefined);
} | [
"function",
"countFixableWarningMessage",
"(",
"count",
",",
"message",
")",
"{",
"return",
"count",
"+",
"Number",
"(",
"message",
".",
"severity",
"===",
"1",
"&&",
"message",
".",
"fix",
"!==",
"undefined",
")",
";",
"}"
] | Increment count if message is a fixable warning
@param {Number} count - count of errors
@param {Object} message - an ESLint message
@returns {Number} The number of errors, message included | [
"Increment",
"count",
"if",
"message",
"is",
"a",
"fixable",
"warning"
] | 40d004fa2f48325f6a507cb10072ff6667aeaf41 | https://github.com/adametry/gulp-eslint/blob/40d004fa2f48325f6a507cb10072ff6667aeaf41/util.js#L182-L184 |
16,496 | adametry/gulp-eslint | index.js | gulpEslint | function gulpEslint(options) {
options = migrateOptions(options) || {};
const linter = new CLIEngine(options);
return transform((file, enc, cb) => {
const filePath = relative(process.cwd(), file.path);
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new PluginError('gulp-... | javascript | function gulpEslint(options) {
options = migrateOptions(options) || {};
const linter = new CLIEngine(options);
return transform((file, enc, cb) => {
const filePath = relative(process.cwd(), file.path);
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new PluginError('gulp-... | [
"function",
"gulpEslint",
"(",
"options",
")",
"{",
"options",
"=",
"migrateOptions",
"(",
"options",
")",
"||",
"{",
"}",
";",
"const",
"linter",
"=",
"new",
"CLIEngine",
"(",
"options",
")",
";",
"return",
"transform",
"(",
"(",
"file",
",",
"enc",
"... | Append ESLint result to each file
@param {(Object|String)} [options] - Configure rules, env, global, and other options for running ESLint
@returns {stream} gulp file stream | [
"Append",
"ESLint",
"result",
"to",
"each",
"file"
] | 40d004fa2f48325f6a507cb10072ff6667aeaf41 | https://github.com/adametry/gulp-eslint/blob/40d004fa2f48325f6a507cb10072ff6667aeaf41/index.js#L26-L84 |
16,497 | bitovi/syn | src/drag.js | function(focusWindow, fromPoint, toPoint, duration, callback){
this.currentDataTransferItem = null;
this.focusWindow = focusWindow;
// A series of events to simulate a drag operation
this._mouseOver(fromPoint);
this._mouseEnter(fromPoint);
this._mouseMove(fromPoint);
this._mouseDown(fromPoint);
this._... | javascript | function(focusWindow, fromPoint, toPoint, duration, callback){
this.currentDataTransferItem = null;
this.focusWindow = focusWindow;
// A series of events to simulate a drag operation
this._mouseOver(fromPoint);
this._mouseEnter(fromPoint);
this._mouseMove(fromPoint);
this._mouseDown(fromPoint);
this._... | [
"function",
"(",
"focusWindow",
",",
"fromPoint",
",",
"toPoint",
",",
"duration",
",",
"callback",
")",
"{",
"this",
".",
"currentDataTransferItem",
"=",
"null",
";",
"this",
".",
"focusWindow",
"=",
"focusWindow",
";",
"// A series of events to simulate a drag ope... | Performs a series of dragStart, dragEnter, dragOver and drop operations to simulate a dragDrop
@param fromElement: element from where drag is started
@param channel: destination element for drop | [
"Performs",
"a",
"series",
"of",
"dragStart",
"dragEnter",
"dragOver",
"and",
"drop",
"operations",
"to",
"simulate",
"a",
"dragDrop"
] | f04e87b18bee9b4308838db04682d3ce2b98afaa | https://github.com/bitovi/syn/blob/f04e87b18bee9b4308838db04682d3ce2b98afaa/src/drag.js#L47-L86 | |
16,498 | bitovi/syn | src/drag.js | function(point, eventName, options){
if (point){
var targetElement = elementFromPoint(point, this.focusWindow);
syn.trigger(targetElement, eventName, options);
}
} | javascript | function(point, eventName, options){
if (point){
var targetElement = elementFromPoint(point, this.focusWindow);
syn.trigger(targetElement, eventName, options);
}
} | [
"function",
"(",
"point",
",",
"eventName",
",",
"options",
")",
"{",
"if",
"(",
"point",
")",
"{",
"var",
"targetElement",
"=",
"elementFromPoint",
"(",
"point",
",",
"this",
".",
"focusWindow",
")",
";",
"syn",
".",
"trigger",
"(",
"targetElement",
","... | Creates and dispatches an event on the node received
@param node
@param eventName | [
"Creates",
"and",
"dispatches",
"an",
"event",
"on",
"the",
"node",
"received"
] | f04e87b18bee9b4308838db04682d3ce2b98afaa | https://github.com/bitovi/syn/blob/f04e87b18bee9b4308838db04682d3ce2b98afaa/src/drag.js#L138-L143 | |
16,499 | bitovi/syn | src/drag.js | function(dataFlavor, value){
var tempdata = {};
tempdata.dataFlavor = dataFlavor;
tempdata.val = value;
this.data.push(tempdata);
} | javascript | function(dataFlavor, value){
var tempdata = {};
tempdata.dataFlavor = dataFlavor;
tempdata.val = value;
this.data.push(tempdata);
} | [
"function",
"(",
"dataFlavor",
",",
"value",
")",
"{",
"var",
"tempdata",
"=",
"{",
"}",
";",
"tempdata",
".",
"dataFlavor",
"=",
"dataFlavor",
";",
"tempdata",
".",
"val",
"=",
"value",
";",
"this",
".",
"data",
".",
"push",
"(",
"tempdata",
")",
";... | setData function assigns the dragValue to an object's property | [
"setData",
"function",
"assigns",
"the",
"dragValue",
"to",
"an",
"object",
"s",
"property"
] | f04e87b18bee9b4308838db04682d3ce2b98afaa | https://github.com/bitovi/syn/blob/f04e87b18bee9b4308838db04682d3ce2b98afaa/src/drag.js#L176-L181 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.