_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q15000 | getDayPeriodRules | train | function getDayPeriodRules(localeData) {
const dayPeriodRules = localeData.get(`supplemental/dayPeriodRuleSet/${localeData.attributes.language}`);
const rules = {};
if (dayPeriodRules) {
Object.keys(dayPeriodRules).forEach(key => {
if (dayPeriodRules[key]._at) {
| javascript | {
"resource": ""
} |
q15001 | getWeekendRange | train | function getWeekendRange(localeData) {
const startDay =
localeData.get(`supplemental/weekData/weekendStart/${localeData.attributes.territory}`) ||
localeData.get('supplemental/weekData/weekendStart/001');
const endDay =
| javascript | {
"resource": ""
} |
q15002 | getNumberSettings | train | function getNumberSettings(localeData) {
const decimalFormat = localeData.main('numbers/decimalFormats-numberSystem-latn/standard');
const percentFormat = localeData.main('numbers/percentFormats-numberSystem-latn/standard');
const scientificFormat = localeData.main('numbers/scientificFormats-numberSystem-latn/sta... | javascript | {
"resource": ""
} |
q15003 | getCurrencySettings | train | function getCurrencySettings(locale, localeData) {
const currencyInfo = localeData.main(`numbers/currencies`);
let currentCurrency = '';
// find the currency currently used in this country
const currencies =
localeData.get(`supplemental/currencyData/region/${localeData.attributes.territory}`) ||
locale... | javascript | {
"resource": ""
} |
q15004 | _deleteDir | train | function _deleteDir(path) {
if (fs.existsSync(path)) {
var subpaths = fs.readdirSync(path);
subpaths.forEach(function(subpath) {
var curPath = path + '/' + subpath;
| javascript | {
"resource": ""
} |
q15005 | generateAllLocalesFile | train | function generateAllLocalesFile(LOCALES, ALIASES) {
const existingLocalesAliases = {};
const existingLocalesData = {};
// for each locale, get the data and the list of equivalent locales
LOCALES.forEach(locale => {
const eqLocales = new Set();
eqLocales.add(locale);
if (locale.match(/-/)) {
e... | javascript | {
"resource": ""
} |
q15006 | inlineTagDefs | train | function inlineTagDefs() {
const Parser = this.Parser;
const inlineTokenizers = Parser.prototype.inlineTokenizers;
const inlineMethods = Parser.prototype.inlineMethods;
const blockTokenizers = Parser.prototype.blockTokenizers;
const blockMethods = Parser.prototype.blockMethods;
blockTokenizers.... | javascript | {
"resource": ""
} |
q15007 | plainHTMLBlocks | train | function plainHTMLBlocks() {
const plainBlocks = ['code-example', 'code-tabs'];
// Create matchers for each block
const anyBlockMatcher = new RegExp('^' + createOpenMatcher(`(${plainBlocks.join('|')})`));
const Parser = this.Parser;
const blockTokenizers = Parser.prototype.blockTokenizers;
co... | javascript | {
"resource": ""
} |
q15008 | setConf | train | function setConf(conf, name, value, msg) {
if (conf[name] && conf[name] !== value) {
console.warn(
| javascript | {
"resource": ""
} |
q15009 | runProtractorAoT | train | function runProtractorAoT(appDir, outputFile) {
fs.appendFileSync(outputFile, '++ AoT version ++\n');
const aotBuildSpawnInfo = spawnExt('yarn', ['build:aot'], {cwd: appDir});
let promise = aotBuildSpawnInfo.promise;
const copyFileCmd = 'copy-dist-files.js';
if (fs.existsSync(appDir + '/' + copyFileCmd)) {
... | javascript | {
"resource": ""
} |
q15010 | loadExampleConfig | train | function loadExampleConfig(exampleFolder) {
// Default config.
let config = {build: 'build', run: 'serve:e2e'};
try {
const exampleConfig = | javascript | {
"resource": ""
} |
q15011 | formatOutput | train | function formatOutput(output) {
var indent = ' ';
var pad = ' ';
var results = [];
results.push('AppDir:' + output.appDir);
output.suites.forEach(function(suite) {
results.push(pad + 'Suite: ' + suite.description + ' -- ' + suite.status);
pad+=indent;
suite.specs.forEach(function... | javascript | {
"resource": ""
} |
q15012 | gulpStatus | train | function gulpStatus() {
const Vinyl = require('vinyl');
const path = require('path');
const gulpGit = require('gulp-git');
const through = require('through2');
const srcStream = through.obj();
const opt = {cwd: process.cwd()};
// https://git-scm.com/docs/git-status#_short_format
const RE_STATUS = /((\... | javascript | {
"resource": ""
} |
q15013 | getAdditionalModulePaths | train | function getAdditionalModulePaths(options = {}) {
const baseUrl = options.baseUrl;
// We need to explicitly check for null and undefined (and not a falsy value) because
// TypeScript treats an empty string as `.`.
if (baseUrl == null) {
// If there's no baseUrl set we respect NODE_PATH
// Note that NOD... | javascript | {
"resource": ""
} |
q15014 | handleSuccess | train | function handleSuccess() {
clearOutdatedErrors();
var isHotUpdate = !isFirstCompilation;
isFirstCompilation = false;
hasCompileErrors = false;
// Attempt to apply hot updates or reload.
if (isHotUpdate) {
tryApplyUpdates(function onHotUpdateSuccess() {
| javascript | {
"resource": ""
} |
q15015 | printFileSizesAfterBuild | train | function printFileSizesAfterBuild(
webpackStats,
previousSizeMap,
buildFolder,
maxBundleGzipSize,
maxChunkGzipSize
) {
var root = previousSizeMap.root;
var sizes = previousSizeMap.sizes;
var assets = (webpackStats.stats || [webpackStats])
.map(stats =>
stats
.toJson({ all: false, asset... | javascript | {
"resource": ""
} |
q15016 | openBrowser | train | function openBrowser(url) {
const { action, value } = getBrowserEnv();
switch (action) {
case Actions.NONE:
// Special case: BROWSER="none" will prevent opening completely.
return false;
case Actions.SCRIPT:
| javascript | {
"resource": ""
} |
q15017 | onProxyError | train | function onProxyError(proxy) {
return (err, req, res) => {
const host = req.headers && req.headers.host;
console.log(
chalk.red('Proxy error:') +
' Could not proxy request ' +
chalk.cyan(req.url) +
' from ' +
chalk.cyan(host) +
' to ' +
chalk.cyan(proxy) +... | javascript | {
"resource": ""
} |
q15018 | finalizeCompile | train | function finalizeCompile() {
if (fs.existsSync(path.join(__dirname, './lib'))) {
// Build package.json version to lib/version/index.js
// prevent json-loader needing in user-side
const versionFilePath = path.join(process.cwd(), 'lib', 'version', 'index.js');
const versionFileContent = fs.readFileSync(... | javascript | {
"resource": ""
} |
q15019 | build | train | async function build() {
console.time('Packager');
let requires = [];
let esmExportString = '';
let cjsExportString = '';
try {
if (!fs.existsSync(DIST_PATH)) fs.mkdirSync(DIST_PATH);
fs.writeFileSync(ROLLUP_INPUT_FILE, '');
fs.writeFileSync(TEST_MODULE_FILE, '');
// All the snippets that a... | javascript | {
"resource": ""
} |
q15020 | train | function (embedder, params) {
if (webViewManager == null) {
webViewManager = process.electronBinding('web_view_manager')
}
const guest = webContents.create({
isGuest: true,
partition: params.partition,
embedder: embedder
})
const guestInstanceId = guest.id
guestInstances[guestInstanceId] = ... | javascript | {
"resource": ""
} | |
q15021 | train | function (embedder, guestInstanceId) {
const guestInstance = guestInstances[guestInstanceId]
if (embedder !== guestInstance.embedder) {
return
}
webViewManager.removeGuest(embedder, | javascript | {
"resource": ""
} | |
q15022 | train | function (visibilityState) {
for (const guestInstanceId in guestInstances) {
const guestInstance = guestInstances[guestInstanceId]
guestInstance.visibilityState = visibilityState
if (guestInstance.embedder === embedder) {
| javascript | {
"resource": ""
} | |
q15023 | train | function (guestInstanceId, contents) {
const guest = getGuest(guestInstanceId)
if (!guest) {
throw new Error(`Invalid guestInstanceId: | javascript | {
"resource": ""
} | |
q15024 | changesToRelease | train | async function changesToRelease () {
const lastCommitWasRelease = new RegExp(`^Bump v[0-9.]*(-beta[0-9.]*)?(-nightly[0-9.]*)?$`, 'g')
const lastCommit = await GitProcess.exec(['log', '-n', | javascript | {
"resource": ""
} |
q15025 | runRetryable | train | async function runRetryable (fn, maxRetries) {
let lastError
for (let i = 0; i < maxRetries; i++) {
try {
return await fn()
} catch (error) {
await new Promise((resolve, reject) => setTimeout(resolve, | javascript | {
"resource": ""
} |
q15026 | wrapArgs | train | function wrapArgs (args, visited = new Set()) {
const valueToMeta = (value) => {
// Check for circular reference.
if (visited.has(value)) {
return {
type: 'value',
value: null
}
}
if (Array.isArray(value)) {
visited.add(value)
const meta = {
type: 'arra... | javascript | {
"resource": ""
} |
q15027 | setObjectMembers | train | function setObjectMembers (ref, object, metaId, members) {
if (!Array.isArray(members)) return
for (const member of members) {
if (object.hasOwnProperty(member.name)) continue
const descriptor = { enumerable: member.enumerable }
if (member.type === 'method') {
const remoteMemberFunction = functi... | javascript | {
"resource": ""
} |
q15028 | setObjectPrototype | train | function setObjectPrototype (ref, object, metaId, descriptor) {
if (descriptor === null) return
const proto = {}
setObjectMembers(ref, proto, metaId, descriptor.members)
| javascript | {
"resource": ""
} |
q15029 | proxyFunctionProperties | train | function proxyFunctionProperties (remoteMemberFunction, metaId, name) {
let loaded = false
// Lazily load function properties
const loadRemoteProperties = () => {
if (loaded) return
loaded = true
const command = 'ELECTRON_BROWSER_MEMBER_GET'
const meta = ipcRendererInternal.sendSync(command, cont... | javascript | {
"resource": ""
} |
q15030 | metaToValue | train | function metaToValue (meta) {
const types = {
value: () => meta.value,
array: () => meta.members.map((member) => metaToValue(member)),
buffer: () => bufferUtils.metaToBuffer(meta.value),
promise: () => resolvePromise({ then: metaToValue(meta.then) }),
error: () => metaToPlainObject(meta),
date... | javascript | {
"resource": ""
} |
q15031 | metaToPlainObject | train | function metaToPlainObject (meta) {
const obj = (() => meta.type === 'error' ? new Error() : {})()
for (let i = 0; i < meta.members.length; i++) {
const | javascript | {
"resource": ""
} |
q15032 | train | function (srcDirectory) {
let manifest
let manifestContent
try {
manifestContent = fs.readFileSync(path.join(srcDirectory, 'manifest.json'))
} catch (readError) {
console.warn(`Reading ${path.join(srcDirectory, 'manifest.json')} failed.`)
console.warn(readError.stack || readError)
throw readErr... | javascript | {
"resource": ""
} | |
q15033 | train | function (webContents) {
const tabId = webContents.id
sendToBackgroundPages('CHROME_TABS_ONCREATED')
webContents.on('will-navigate', (event, url) => {
sendToBackgroundPages('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', {
frameId: 0,
parentFrameId: -1,
processId: webContents.getProcessId(),
... | javascript | {
"resource": ""
} | |
q15034 | train | function (manifest) {
return {
startPage: manifest.startPage,
srcDirectory: manifest.srcDirectory,
| javascript | {
"resource": ""
} | |
q15035 | preloadRequire | train | function preloadRequire (module) {
if (loadedModules.has(module)) {
return loadedModules.get(module)
| javascript | {
"resource": ""
} |
q15036 | generateGroupId | train | function generateGroupId (items, pos) {
if (pos > 0) {
for (let idx = pos - 1; idx >= 0; idx--) {
if (items[idx].type === 'radio') return items[idx].groupId
if (items[idx].type === 'separator') break
}
} else if (pos < items.length) {
for (let idx = pos; idx <= items.length - 1; idx++) {
| javascript | {
"resource": ""
} |
q15037 | train | function (args, detached, callback) {
let error, errorEmitted, stderr, stdout
try {
// Ensure we don't spawn multiple squirrel processes
// Process spawned, same args: Attach events to alread running process
// Process spawned, different args: Return with error
// No process spawned: ... | javascript | {
"resource": ""
} | |
q15038 | sortTopologically | train | function sortTopologically (originalOrder, edgesById) {
const sorted = []
const marked = new Set()
const visit = (mark) => {
if (marked.has(mark)) return
marked.add(mark)
const edges = edgesById.get(mark)
| javascript | {
"resource": ""
} |
q15039 | train | function (object) {
const proto = Object.getPrototypeOf(object)
if (proto === null || proto === Object.prototype) return null
return { | javascript | {
"resource": ""
} | |
q15040 | train | function (sender, contextId, value, optimizeSimpleObject = false) {
// Determine the type of value.
const meta = { type: typeof value }
if (meta.type === 'object') {
// Recognize certain types of objects.
if (value === null) {
meta.type = 'value'
} else if (bufferUtils.isBuffer(value)) {
m... | javascript | {
"resource": ""
} | |
q15041 | train | function (obj) {
return Object.getOwnPropertyNames(obj).map(function (name) {
return {
| javascript | {
"resource": ""
} | |
q15042 | train | function (sender, frameId, contextId, args) {
const metaToValue = function (meta) {
switch (meta.type) {
case 'value':
return meta.value
case 'remote-object':
return objectsRegistry.get(meta.id)
case 'array':
return unwrapArgs(sender, frameId, contextId, meta.value)
... | javascript | {
"resource": ""
} | |
q15043 | isValid | train | function isValid (options) {
const types = options ? options.types : | javascript | {
"resource": ""
} |
q15044 | updateVersion | train | async function updateVersion (version) {
const versionPath = path.resolve(__dirname, | javascript | {
"resource": ""
} |
q15045 | updatePackageJSON | train | async function updatePackageJSON (version) {
['package.json'].forEach(async fileName => {
const filePath = path.resolve(__dirname, | javascript | {
"resource": ""
} |
q15046 | commitVersionBump | train | async function commitVersionBump (version) {
const gitDir = path.resolve(__dirname, '..')
const gitArgs = ['commit', '-a', '-m', | javascript | {
"resource": ""
} |
q15047 | updateWinRC | train | async function updateWinRC (components) {
const filePath = path.resolve(__dirname, '..', 'atom', 'browser', 'resources', 'win', 'atom.rc')
const data = await readFile(filePath, 'utf8')
const arr = data.split('\n')
arr.forEach((line, idx) => {
if (line.includes('FILEVERSION')) {
arr[idx] = ` FILEVERSIO... | javascript | {
"resource": ""
} |
q15048 | train | function (child, parent, visited) {
// Check for circular reference.
if (visited == null) visited = new Set()
if (visited.has(parent)) return
visited.add(parent)
for (const key in parent) {
if (key === 'isBrowserView') continue
if (!hasProp.call(parent, key)) continue
if (key in child && key !== ... | javascript | {
"resource": ""
} | |
q15049 | train | function (embedder, options) {
if (options.webPreferences == null) {
options.webPreferences = {}
}
if (embedder.browserWindowOptions != null) {
let parentOptions = embedder.browserWindowOptions
// if parent's visibility is available, that overrides 'show' flag (#12125)
const win = BrowserWindow.f... | javascript | {
"resource": ""
} | |
q15050 | train | function (embedder, frameName, guest, options) {
// When |embedder| is destroyed we should also destroy attached guest, and if
// guest is closed by user then we should prevent |embedder| from double
// closing guest.
const guestId = guest.webContents.id
const closedByEmbedder = function () {
guest.remove... | javascript | {
"resource": ""
} | |
q15051 | train | function (embedder, url, referrer, frameName, options, postData) {
let guest = frameToGuest.get(frameName)
if (frameName && (guest != null)) {
guest.loadURL(url)
return guest.webContents.id
}
// Remember the embedder window's id.
if (options.webPreferences == null) {
options.webPreferences = {}
... | javascript | {
"resource": ""
} | |
q15052 | getRenderedTree | train | function getRenderedTree(story) {
const { Component, props } = story.render();
const DefaultCompatComponent = Component.default || Component;
// We need to create a target to mount onto.
const target = document.createElement('section');
new DefaultCompatComponent({ target, props }); // eslint-disable-line
... | javascript | {
"resource": ""
} |
q15053 | showException | train | function showException(exception) {
addons.getChannel().emit(Events.STORY_THREW_EXCEPTION, exception);
showErrorDisplay(exception);
// Log the | javascript | {
"resource": ""
} |
q15054 | loadFromPath | train | function loadFromPath(babelConfigPath) {
let config;
if (fs.existsSync(babelConfigPath)) {
const content = fs.readFileSync(babelConfigPath, 'utf-8');
try {
config = JSON5.parse(content);
config.babelrc = false;
logger.info('=> Loading custom .babelrc');
} catch (e) {
logger.error... | javascript | {
"resource": ""
} |
q15055 | importAll | train | function importAll(context) {
const storyStore = window.__STORYBOOK_CLIENT_API__._storyStore; // eslint-disable-line no-undef, no-underscore-dangle
context.keys().forEach(filename => {
const fileExports = context(filename);
// A old-style story file
if (!fileExports.default) {
return;
}
... | javascript | {
"resource": ""
} |
q15056 | extractRange | train | function extractRange(ranges, coord) {
var axis, from, to, key, axes = plot.getAxes();
for (var k in axes) {
axis = axes[k];
if (axis.direction == coord) {
key = coord + axis.n + "axis";
if (!ranges[key] && axis.n == 1)
... | javascript | {
"resource": ""
} |
q15057 | train | function(values) {
var max = Number.MIN_VALUE,
min = Number.MAX_VALUE,
val,
cc,
attrs = {};
if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
if (!this.params.min || !this.params.max) {
for (cc in values) {
val =... | javascript | {
"resource": ""
} | |
q15058 | train | function(node) {
assertRangeValid(this);
var parent = node.parentNode;
var nodeIndex = getNodeIndex(node);
if (!parent) {
throw new DOMException("NOT_FOUND_ERR");
}
| javascript | {
"resource": ""
} | |
q15059 | train | function(sel, range) {
var ranges = sel.getAllRanges();
sel.removeAllRanges();
for (var i = 0, len = ranges.length; i < len; ++i) {
if (!rangesEqual(range, ranges[i])) {
| javascript | {
"resource": ""
} | |
q15060 | train | function(context) {
var element = context.createElement("div"),
html5 = "<article>foo</article>";
| javascript | {
"resource": ""
} | |
q15061 | train | function() {
var clonedTestElement = testElement.cloneNode(false),
returnValue,
innerHTML;
clonedTestElement.innerHTML = "<p><div></div>";
innerHTML = clonedTestElement.innerHTML.toLowerCase();
| javascript | {
"resource": ""
} | |
q15062 | train | function(needle) {
if (Array.isArray(needle)) {
for (var i = needle.length; i--;) {
if (wysihtml5.lang.array(arr).indexOf(needle[i]) !== -1) {
return true;
}
| javascript | {
"resource": ""
} | |
q15063 | train | function(needle) {
if (arr.indexOf) {
return arr.indexOf(needle);
} else {
for (var i=0, length=arr.length; i<length; i++) {
| javascript | {
"resource": ""
} | |
q15064 | train | function(arrayToSubstract) {
arrayToSubstract = wysihtml5.lang.array(arrayToSubstract);
var newArr = [],
i = 0,
length = arr.length;
for (; i<length; i++) {
| javascript | {
"resource": ""
} | |
q15065 | train | function() {
var i = 0,
length = arr.length,
newArray = [];
for (; i<length; i++) {
| javascript | {
"resource": ""
} | |
q15066 | train | function(callback, thisArg) {
if (Array.prototype.map) {
return arr.map(callback, thisArg);
} else {
var len = arr.length >>> 0,
A = new Array(len),
i = 0;
| javascript | {
"resource": ""
} | |
q15067 | _convertUrlsToLinks | train | function _convertUrlsToLinks(str) {
return str.replace(URL_REG_EXP, function(match, url) {
var punctuation = (url.match(TRAILING_CHAR_REG_EXP) || [])[1] || "",
opening = BRACKETS[punctuation];
url = url.replace(TRAILING_CHAR_REG_EXP, "");
if (url.split(opening).length > url.split(pu... | javascript | {
"resource": ""
} |
q15068 | _wrapMatchesInNode | train | function _wrapMatchesInNode(textNode) {
var parentNode = textNode.parentNode,
nodeValue = wysihtml5.lang.string(textNode.data).escapeHTML(),
tempElement = _getTempElement(parentNode.ownerDocument);
// We need to insert an empty/temporary <span /> to fix IE | javascript | {
"resource": ""
} |
q15069 | train | function(context) {
if (context._wysihtml5_supportsHTML5Tags) {
return;
}
for (var i=0, length=HTML5_ELEMENTS.length; i<length; i++) {
| javascript | {
"resource": ""
} | |
q15070 | parse | train | function parse(elementOrHtml, config) {
wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();
var context = config.context || elementOrHtml.ownerDocument || document,
fragment = context.createDocumentFragment(),
isString = typeof(elementOrHtml) === "... | javascript | {
"resource": ""
} |
q15071 | train | function() {
var that = this,
iframe = doc.createElement("iframe");
iframe.className = "wysihtml5-sandbox";
wysihtml5.dom.setAttributes({
"security": "restricted",
"allowtransparency": "true",
"frameborder": 0,
"width": 0,
... | javascript | {
"resource": ""
} | |
q15072 | train | function(contentEditable) {
contentEditable.className = (contentEditable.className && contentEditable.className != '') ? contentEditable.className + " wysihtml5-sandbox" : "wysihtml5-sandbox"; | javascript | {
"resource": ""
} | |
q15073 | train | function(cell) {
if (cell.isColspan) {
var colspan = parseInt(api.getAttribute(cell.el, 'colspan') || 1, 10),
cType = cell.el.tagName.toLowerCase();
if (colspan > 1) {
| javascript | {
"resource": ""
} | |
q15074 | train | function() {
var oldRow = api.getParentElement(this.cell, { nodeName: ["TR"] });
if (oldRow) {
this.setTableMap();
this.idx = this.getMapIndex(this.cell);
if (this.idx !== false) {
var modRow = this.map[this.idx.row];
... | javascript | {
"resource": ""
} | |
q15075 | removeCellSelections | train | function removeCellSelections () {
if (editable) {
var selectedCells = editable.querySelectorAll('.' + selection_class);
if (selectedCells.length > 0) {
for (var i = 0; i < selectedCells.length; i++) { | javascript | {
"resource": ""
} |
q15076 | getDepth | train | function getDepth(ancestor, descendant) {
var ret = 0;
while (descendant !== ancestor) {
ret++;
| javascript | {
"resource": ""
} |
q15077 | expandRangeToSurround | train | function expandRangeToSurround(range) {
if (range.canSurroundContents()) return;
var common = range.commonAncestorContainer,
start_depth = getDepth(common, range.startContainer),
end_depth = getDepth(common, range.endContainer);
while(!range.canSurroundContents()) {
// In... | javascript | {
"resource": ""
} |
q15078 | train | function(node) {
var range = rangy.createRange(this.doc);
| javascript | {
"resource": ""
} | |
q15079 | train | function(node) {
var range = rangy.createRange(this.doc);
| javascript | {
"resource": ""
} | |
q15080 | train | function(controlRange) {
var selection,
range;
if (controlRange && this.doc.selection && this.doc.selection.type === "Control") {
range = this.doc.selection.createRange();
if (range && range.length) {
return range.item(0);
}
}
| javascript | {
"resource": ""
} | |
q15081 | train | function(html) {
var range = rangy.createRange(this.doc),
node = this.doc.createElement('DIV'),
fragment = this.doc.createDocumentFragment(),
lastChild;
node.innerHTML = html;
lastChild = node.lastChild;
while (node.firstChild) {
| javascript | {
"resource": ""
} | |
q15082 | train | function(nodeOptions) {
var ranges = this.getOwnRanges(),
node, nodes = [];
if (ranges.length == 0) {
return nodes;
}
for (var i = ranges.length; i--;) {
node = this.doc.createElement(nodeOptions.nodeName);
nodes.push(node);
if (nodeOptions.className) {... | javascript | {
"resource": ""
} | |
q15083 | train | function() {
var ranges = [],
r = this.getRange(),
tmpRanges;
if (r) { ranges.push(r); }
if (this.unselectableClass && this.contain && r) {
var uneditables = this.getOwnUneditables(),
tmpRange;
if (uneditables.length > 0) {
for (var ... | javascript | {
"resource": ""
} | |
q15084 | train | function(node) {
var cssStyleMatch;
while (node) {
cssStyleMatch = this.cssStyle ? hasStyleAttr(node, this.similarStyleRegExp) : false;
if (node.nodeType | javascript | {
"resource": ""
} | |
q15085 | train | function(command, value) {
var obj = wysihtml5.commands[command],
args = wysihtml5.lang.array(arguments).get(),
method = obj && obj.exec,
result = null;
this.editor.fire("beforecommand:composer");
if (method) {
args.unshift(this.composer);
result = method.apply... | javascript | {
"resource": ""
} | |
q15086 | train | function(command, commandValue) {
var obj = wysihtml5.commands[command],
args = wysihtml5.lang.array(arguments).get(),
method = obj && obj.state;
if (method) {
args.unshift(this.composer);
return method.apply(obj, args);
} else {
try { | javascript | {
"resource": ""
} | |
q15087 | _changeLinks | train | function _changeLinks(composer, anchors, attributes) {
var oldAttrs;
for (var a = anchors.length; a--;) {
// Remove all old attributes
oldAttrs = anchors[a].attributes;
for (var oa = oldAttrs.length; oa--;) {
anchors[a].removeAttribute(oldAttrs.item(oa).name);
}
// Set ne... | javascript | {
"resource": ""
} |
q15088 | _execCommand | train | function _execCommand(doc, composer, command, nodeName, className) {
var ranges = composer.selection.getOwnRanges();
for (var i = ranges.length; i--;){
composer.selection.getSelection().removeAllRanges();
composer.selection.setSelection(ranges[i]);
if (className) {
var eventListener = ... | javascript | {
"resource": ""
} |
q15089 | train | function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) {
var that = this;
if (this.state(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) &&
composer.selection.isCollapsed() &&
!composer.selection.caretIsLastInSelection() &&
!co... | javascript | {
"resource": ""
} | |
q15090 | train | function() {
if (this.textarea.element.form) {
var hiddenField = document.createElement("input");
hiddenField.type = "hidden";
hiddenField.name = | javascript | {
"resource": ""
} | |
q15091 | train | function(shouldParseHtml) {
this.textarea.setValue(wysihtml5.lang.string(this.composer.ge | javascript | {
"resource": ""
} | |
q15092 | train | function(shouldParseHtml) {
var textareaValue = this.textarea.getValue(false, false);
if (textareaValue) {
this.composer.setValue(textareaValue, shouldParseHtml);
} | javascript | {
"resource": ""
} | |
q15093 | train | function() {
var interval,
that = this,
form = this.textarea.element.form,
startInterval = function() {
interval = setInterval(function() { that.fromComposerToTextarea(); }, INTERVAL);
},
stopInterval = function() {
clear... | javascript | {
"resource": ""
} | |
q15094 | train | function() {
var that = this,
oldHtml,
cleanHtml;
if (wysihtml5.browser.supportsModenPaste()) {
this.on("paste:composer", function(event) {
event.preventDefault();
oldHtml = wysihtml5.dom.getPastedHtml(event);
if (oldHtml) {
that._cleanA... | javascript | {
"resource": ""
} | |
q15095 | train | function() {
var data = this.elementToChange || {},
fields = this.container.querySelectorAll(SELECTOR_FIELDS),
length = fields.length,
i = 0;
| javascript | {
"resource": ""
} | |
q15096 | train | function() {
clearInterval(this.interval);
this.elementToChange = null;
dom.removeClass(this.link, CLASS_NAME_OPENED);
| javascript | {
"resource": ""
} | |
q15097 | train | function() {
var editor = this;
$.map(this.toolbar.commandMapping, function(value) {
return [value];
}).filter(function(commandObj) {
return commandObj.dialog;
}).map(function(commandObj) {
return commandObj.dialog;
}).forEach(function(dialog) {
... | javascript | {
"resource": ""
} | |
q15098 | store | train | function store(name, val) {
if (typeof (Storage) !== 'undefined') {
localStorage.setItem(name, val)
} else {
| javascript | {
"resource": ""
} |
q15099 | train | function(
val, predefinedColors, fallbackColor, fallbackFormat, hexNumberSignPrefix) {
this.fallbackValue = fallbackColor ?
(
(typeof fallbackColor === 'string') ?
this.parse(fallbackColor) :
fallbackColor
) :
null;
this.fallbackFormat = fallbackFormat ? fallbackFo... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.