text
stringlengths
2
6.14k
var VertexList = function() { this.head = this.tail = null; }; VertexList.prototype.clear = function() { this.head = this.tail = null; }; VertexList.prototype.add = function(vertex) { if (this.head === null) { this.head = vertex; } else { this.tail.next = vertex; } vertex.previous = this.tail; vertex.next = null; this.tail = vertex; }; VertexList.prototype.addAll = function(vertex) { if (this.head === null) { this.head = vertex; } else { this.tail.next = vertex; } vertex.previous = this.tail; while (vertex.next !== null) { vertex = vertex.next; } this.tail = vertex; }; VertexList.prototype.delete = function(vertex1, vertex2) { if (vertex2 === void 0) { vertex2 = vertex1; } if (vertex1.previous === null) { this.head = vertex2.next; } else { vertex1.previous.next = vertex2.next; } if (vertex2.next === null) { this.tail = vertex1.previous; } else { vertex2.next.previous = vertex1.previous; } }; VertexList.prototype.insertBefore = function(vertex, target) { vertex.previous = target.previous; if (target.previous === null) { this.head = vertex; } else { target.previous.next = vertex; } vertex.next = target; target.previous = vertex; }; VertexList.prototype.isEmpty = function() { return this.head === null; }; VertexList.prototype.length = function() { var result = 0; for (var vertex = this.head; vertex !== null; vertex = vertex.next) { result++; } return result; };
//// [file.tsx] declare module JSX { interface Element { } interface ElementAttributesProperty { props: {} } interface IntrinsicElements { div: any; h2: any; h1: any; } } class Button { props: {} render() { return (<div>My Button</div>) } } // OK let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>; let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>; let k3 = <div> {1} {"That is a number"} </div>; let k4 = <Button> <h2> Hello </h2> </Button>; //// [file.jsx] var Button = (function () { function Button() { } Button.prototype.render = function () { return (<div>My Button</div>); }; return Button; }()); // OK var k1 = <div> <h2> Hello </h2> <h1> world </h1></div>; var k2 = <div> <h2> Hello </h2> {function (user) { return <h2>{user.name}</h2>; }}</div>; var k3 = <div> {1} {"That is a number"} </div>; var k4 = <Button> <h2> Hello </h2> </Button>;
goog.provide('ol.renderer.dom.ImageLayer'); goog.require('goog.asserts'); goog.require('goog.dom'); goog.require('goog.dom.TagName'); goog.require('goog.vec.Mat4'); goog.require('ol.ImageBase'); goog.require('ol.ViewHint'); goog.require('ol.dom'); goog.require('ol.extent'); goog.require('ol.layer.Image'); goog.require('ol.proj'); goog.require('ol.renderer.dom.Layer'); goog.require('ol.vec.Mat4'); /** * @constructor * @extends {ol.renderer.dom.Layer} * @param {ol.layer.Image} imageLayer Image layer. */ ol.renderer.dom.ImageLayer = function(imageLayer) { var target = goog.dom.createElement(goog.dom.TagName.DIV); target.style.position = 'absolute'; goog.base(this, imageLayer, target); /** * The last rendered image. * @private * @type {?ol.ImageBase} */ this.image_ = null; /** * @private * @type {goog.vec.Mat4.Number} */ this.transform_ = goog.vec.Mat4.createNumberIdentity(); }; goog.inherits(ol.renderer.dom.ImageLayer, ol.renderer.dom.Layer); /** * @inheritDoc */ ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; var rotation = frameState.viewState.rotation; var skippedFeatureUids = frameState.skippedFeatureUids; return source.forEachFeatureAtCoordinate( coordinate, resolution, rotation, skippedFeatureUids, /** * @param {ol.Feature} feature Feature. * @return {?} Callback result. */ function(feature) { return callback.call(thisArg, feature, layer); }); }; /** * @inheritDoc */ ol.renderer.dom.ImageLayer.prototype.clearFrame = function() { goog.dom.removeChildren(this.target); this.image_ = null; }; /** * @inheritDoc */ ol.renderer.dom.ImageLayer.prototype.prepareFrame = function(frameState, layerState) { var viewState = frameState.viewState; var viewCenter = viewState.center; var viewResolution = viewState.resolution; var viewRotation = viewState.rotation; var image = this.image_; var imageLayer = this.getLayer(); goog.asserts.assertInstanceof(imageLayer, ol.layer.Image, 'layer is an instance of ol.layer.Image'); var imageSource = imageLayer.getSource(); var hints = frameState.viewHints; var renderedExtent = frameState.extent; if (layerState.extent !== undefined) { renderedExtent = ol.extent.getIntersection( renderedExtent, layerState.extent); } if (!hints[ol.ViewHint.ANIMATING] && !hints[ol.ViewHint.INTERACTING] && !ol.extent.isEmpty(renderedExtent)) { var projection = viewState.projection; var sourceProjection = imageSource.getProjection(); if (sourceProjection) { goog.asserts.assert(ol.proj.equivalent(projection, sourceProjection), 'projection and sourceProjection are equivalent'); projection = sourceProjection; } var image_ = imageSource.getImage(renderedExtent, viewResolution, frameState.pixelRatio, projection); if (image_) { var loaded = this.loadImage(image_); if (loaded) { image = image_; } } } if (image) { var imageExtent = image.getExtent(); var imageResolution = image.getResolution(); var transform = goog.vec.Mat4.createNumber(); ol.vec.Mat4.makeTransform2D(transform, frameState.size[0] / 2, frameState.size[1] / 2, imageResolution / viewResolution, imageResolution / viewResolution, viewRotation, (imageExtent[0] - viewCenter[0]) / imageResolution, (viewCenter[1] - imageExtent[3]) / imageResolution); if (image != this.image_) { var imageElement = image.getImage(this); // Bootstrap sets the style max-width: 100% for all images, which breaks // prevents the image from being displayed in FireFox. Workaround by // overriding the max-width style. imageElement.style.maxWidth = 'none'; imageElement.style.position = 'absolute'; goog.dom.removeChildren(this.target); this.target.appendChild(imageElement); this.image_ = image; } this.setTransform_(transform); this.updateAttributions(frameState.attributions, image.getAttributions()); this.updateLogos(frameState, imageSource); } return true; }; /** * @param {goog.vec.Mat4.Number} transform Transform. * @private */ ol.renderer.dom.ImageLayer.prototype.setTransform_ = function(transform) { if (!ol.vec.Mat4.equals2D(transform, this.transform_)) { ol.dom.transformElement2D(this.target, transform, 6); goog.vec.Mat4.setFromArray(this.transform_, transform); } };
goog.provide('ol.layer.Vector'); goog.require('ol'); goog.require('ol.layer.Layer'); goog.require('ol.obj'); goog.require('ol.renderer.Type'); goog.require('ol.renderer.canvas.VectorLayer'); goog.require('ol.renderer.webgl.VectorLayer'); goog.require('ol.style.Style'); /** * @classdesc * Vector data that is rendered client-side. * Note that any property set in the options is set as a {@link ol.Object} * property on the layer object; for example, setting `title: 'My Title'` in the * options means that `title` is observable, and has get/set accessors. * * @constructor * @extends {ol.layer.Layer} * @fires ol.render.Event * @param {olx.layer.VectorOptions=} opt_options Options. * @api */ ol.layer.Vector = function(opt_options) { var options = opt_options ? opt_options : /** @type {olx.layer.VectorOptions} */ ({}); var baseOptions = ol.obj.assign({}, options); delete baseOptions.style; delete baseOptions.renderBuffer; delete baseOptions.updateWhileAnimating; delete baseOptions.updateWhileInteracting; ol.layer.Layer.call(this, /** @type {olx.layer.LayerOptions} */ (baseOptions)); /** * @type {number} * @private */ this.renderBuffer_ = options.renderBuffer !== undefined ? options.renderBuffer : 100; /** * User provided style. * @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction} * @private */ this.style_ = null; /** * Style function for use within the library. * @type {ol.StyleFunction|undefined} * @private */ this.styleFunction_ = undefined; this.setStyle(options.style); /** * @type {boolean} * @private */ this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ? options.updateWhileAnimating : false; /** * @type {boolean} * @private */ this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ? options.updateWhileInteracting : false; }; ol.inherits(ol.layer.Vector, ol.layer.Layer); /** * @inheritDoc */ ol.layer.Vector.prototype.createRenderer = function(mapRenderer) { var renderer = null; var type = mapRenderer.getType(); if (ol.ENABLE_CANVAS && type === ol.renderer.Type.CANVAS) { renderer = new ol.renderer.canvas.VectorLayer(this); } else if (ol.ENABLE_WEBGL && type === ol.renderer.Type.WEBGL) { renderer = new ol.renderer.webgl.VectorLayer(/** @type {ol.renderer.webgl.Map} */ (mapRenderer), this); } return renderer; }; /** * @return {number|undefined} Render buffer. */ ol.layer.Vector.prototype.getRenderBuffer = function() { return this.renderBuffer_; }; /** * @return {function(ol.Feature, ol.Feature): number|null|undefined} Render * order. */ ol.layer.Vector.prototype.getRenderOrder = function() { return /** @type {ol.RenderOrderFunction|null|undefined} */ ( this.get(ol.layer.Vector.Property_.RENDER_ORDER)); }; /** * Return the associated {@link ol.source.Vector vectorsource} of the layer. * @function * @return {ol.source.Vector} Source. * @api */ ol.layer.Vector.prototype.getSource; /** * Get the style for features. This returns whatever was passed to the `style` * option at construction or to the `setStyle` method. * @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction} * Layer style. * @api */ ol.layer.Vector.prototype.getStyle = function() { return this.style_; }; /** * Get the style function. * @return {ol.StyleFunction|undefined} Layer style function. * @api */ ol.layer.Vector.prototype.getStyleFunction = function() { return this.styleFunction_; }; /** * @return {boolean} Whether the rendered layer should be updated while * animating. */ ol.layer.Vector.prototype.getUpdateWhileAnimating = function() { return this.updateWhileAnimating_; }; /** * @return {boolean} Whether the rendered layer should be updated while * interacting. */ ol.layer.Vector.prototype.getUpdateWhileInteracting = function() { return this.updateWhileInteracting_; }; /** * @param {ol.RenderOrderFunction|null|undefined} renderOrder * Render order. */ ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) { this.set(ol.layer.Vector.Property_.RENDER_ORDER, renderOrder); }; /** * Set the style for features. This can be a single style object, an array * of styles, or a function that takes a feature and resolution and returns * an array of styles. If it is `undefined` the default style is used. If * it is `null` the layer has no style (a `null` style), so only features * that have their own styles will be rendered in the layer. See * {@link ol.style} for information on the default style. * @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|null|undefined} * style Layer style. * @api */ ol.layer.Vector.prototype.setStyle = function(style) { this.style_ = style !== undefined ? style : ol.style.Style.defaultFunction; this.styleFunction_ = style === null ? undefined : ol.style.Style.createFunction(this.style_); this.changed(); }; /** * @enum {string} * @private */ ol.layer.Vector.Property_ = { RENDER_ORDER: 'renderOrder' };
// Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 9.5.4 description: > Throws a TypeError exception if trap is not callable. info: | [[PreventExtensions]] ( ) ... 1. Let handler be the value of the [[ProxyHandler]] internal slot of O. ... 5. Let trap be GetMethod(handler, "preventExtensions"). ... 7.3.9 GetMethod (O, P) ... 2. Let func be GetV(O, P). 5. If IsCallable(func) is false, throw a TypeError exception. ... features: [Proxy] ---*/ var target = {}; var p = new Proxy(target, { preventExtensions: {} }); assert.throws(TypeError, function() { Object.preventExtensions(p); });
// Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-dataview.prototype.getfloat32 description: > Return values from Buffer info: | 24.2.4.5 DataView.prototype.getFloat32 ( byteOffset [ , littleEndian ] ) 1. Let v be the this value. 2. If littleEndian is not present, let littleEndian be false. 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Float32"). 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... 14. Let bufferIndex be getIndex + viewOffset. 15. Return GetValueFromBuffer(buffer, bufferIndex, type, isLittleEndian). ... 24.1.1.5 GetValueFromBuffer ( arrayBuffer, byteIndex, type [ , isLittleEndian ] ) ... 8. If isLittleEndian is false, reverse the order of the elements of rawValue. ... features: [DataView.prototype.setUint8] ---*/ var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(0, 66); sample.setUint8(1, 40); sample.setUint8(2, 0); sample.setUint8(3, 0); sample.setUint8(4, 64); sample.setUint8(5, 224); sample.setUint8(6, 0); sample.setUint8(7, 0); assert.sameValue(sample.getFloat32(0, false), 42, "0, false"); assert.sameValue(sample.getFloat32(1, false), 7.105481567709626e-15, "1, false"); assert.sameValue(sample.getFloat32(2, false), 2.327276489550656e-41, "2, false"); assert.sameValue(sample.getFloat32(3, false), 5.95782781324968e-39, "3, false"); assert.sameValue(sample.getFloat32(4, false), 7, "4, false"); assert.sameValue(sample.getFloat32(0, true), 1.4441781973331565e-41, "0, true"); assert.sameValue(sample.getFloat32(1, true), 2.000009536743164, "1, true"); assert.sameValue(sample.getFloat32(2, true), -55340232221128655000, "2, true"); assert.sameValue(sample.getFloat32(3, true), 2.059411001342953e-38, "3, true"); assert.sameValue(sample.getFloat32(4, true), 8.04457422399591e-41, "4, true"); sample.setUint8(0, 75); sample.setUint8(1, 75); sample.setUint8(2, 76); sample.setUint8(3, 76); sample.setUint8(4, 75); sample.setUint8(5, 75); sample.setUint8(6, 76); sample.setUint8(7, 76); assert.sameValue(sample.getFloat32(0, false), 13323340, "0, false"); assert.sameValue(sample.getFloat32(1, false), 13388875, "1, false"); assert.sameValue(sample.getFloat32(2, false), 53554476, "2, false"); assert.sameValue(sample.getFloat32(3, false), 53292336, "3, false"); assert.sameValue(sample.getFloat32(4, false), 13323340, "4, false"); assert.sameValue(sample.getFloat32(0, true), 53554476, "0, true"); assert.sameValue(sample.getFloat32(1, true), 13388875, "1, true"); assert.sameValue(sample.getFloat32(2, true), 13323340, "2, true"); assert.sameValue(sample.getFloat32(3, true), 53292336, "3, true"); assert.sameValue(sample.getFloat32(4, true), 53554476, "4, true");
/* * The purpose of this class is to abstract the various tests you'd have on a tab-view * There are several methods and each of them are abstracted in such a way as to * not assume how the module was implemented * The name of this YUI module is "media-test-tabview" */ YUI.add("arrow-test-tabview", function(Y) { var A = Y.Assert; var L = Y.Lang; var self = Y.namespace("Arrow.Test").TabView = { //Confirms the tabs are present validateStructure: function(node, tabs, mods) { for(tab in tabs) { var tabNode = node.one(tabs[tab]); A.isNotNull(tabNode, "tab is present: " + tabs[tab]); } //Confirms the first module displays correctly, with the associated content below it for(mod in mods) { var modNode = node.one(mods[mod]); A.isNotNull(modNode, "module is present: " + mods[mod]); if(0 == mod) { A.areNotEqual(modNode.getStyle("display"), "none", "module should be displayed: " + mods[mod]); } else { A.areEqual(modNode.getStyle("display"), "none", "module should not be displayed: " + mods[mod]); } } }, //Confirms each tab is represented as a link validatePresence: function(node, tabNames) { for(i in tabNames) { var tabName = tabNames[i]; var link = node.oneLink(tabName); A.isNotNull(link, "Tab must exist: " + tabName); } }, //Clicks through the tabs and makes sure they are displayed correctly validateSelection: function(node, tabName, modName) { var tabNode = node.one(tabName); var modNode = node.one(modName); A.areEqual(modNode.getStyle("display"), "none", "module should not be displayed: " + modName); A.isNotNull(tabNode, "tab is present: " + tabName); tabNode.simulate("click"); A.areNotEqual(modNode.getStyle("display"), "none", "module should be displayed: " + modName); } }; var Node = function() {} Node.prototype.oneLink = function(linkText, tagName) { if(!tagName) tagName = "a"; var useRegex = !L.isString(linkText); var links = this.getElementsByTagName(tagName); for(var i = 0; i < links.size(); i++) { var link = links.item(i); if(useRegex) { if(linkText.test(link.get("text"))) { return link; } } else if(linkText == link.get("text")) { return link; } } return null; } Y.augment(Y.Node, Node); }, "0.1", { requires:["event", "node", "node-event-simulate", "test"]});
version https://git-lfs.github.com/spec/v1 oid sha256:9a7960da211b0f6e29b038d26984f6c081ceabcdac76f7e746484c4dbe28952e size 3337
export default function findKey(object, predicate) { let resultKey; Object.keys(object).some((key) => { const isKey = predicate(object[key], key, object); if (isKey) { resultKey = key; return true; } return false; }); return resultKey; }
import fetch from 'utils/fetch'; export function userSearch(name) { return fetch({ url: '/search/user', method: 'get', params: { name } }); }
import Tracking from '~/tracking'; export default { bind(el, binding) { el.dataset.trackingOptions = JSON.stringify(binding.value || {}); el.addEventListener('click', () => { const { category, action, label, property, value } = JSON.parse(el.dataset.trackingOptions); if (!category || !action) { return; } Tracking.event(category, action, { label, property, value }); }); }, update(el, binding) { if (binding.value !== binding.oldValue) { el.dataset.trackingOptions = JSON.stringify(binding.value || {}); } }, };
/** * Catalan translation for bootstrap-datepicker * J. Garcia <jogaco.en@gmail.com> */ ;(function($){ $.fn.datepicker.dates['ca'] = { days: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis"], daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds"], months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], today: "Avui", monthsTitle: "Mesos", clear: "Esborrar", weekStart: 1, format: "dd/mm/yyyy" }; }(jQuery));
/* @license dhtmlxGantt v.4.1.0 Stardard This software is covered by GPL license. You also can obtain Commercial or Enterprise license to use it in non-GPL project - please contact sales@dhtmlx.com. Usage without proper license is prohibited. (c) Dinamenta, UAB. */ gantt.locale = { date: { month_full: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], month_short: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], day_full: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"], day_short: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"] }, labels: { dhx_cal_today_button: "Danes", day_tab: "Dan", week_tab: "Teden", month_tab: "Mesec", new_event: "Nov dogodek", icon_save: "Shrani", icon_cancel: "Prekliči", icon_details: "Podrobnosti", icon_edit: "Uredi", icon_delete: "Izbriši", confirm_closing: "", //Spremembe ne bodo shranjene. Želite nadaljevati ? confirm_deleting: "Dogodek bo izbrisan. Želite nadaljevati?", section_description: "Opis", section_time: "Časovni okvir", section_type:"Type", /* grid columns */ column_text : "Task name", column_start_date : "Start time", column_duration : "Duration", column_add : "", /* link confirmation */ link: "Link", confirm_link_deleting:"will be deleted", link_start: " (start)", link_end: " (end)", type_task: "Task", type_project: "Project", type_milestone: "Milestone", minutes: "Minutes", hours: "Hours", days: "Days", weeks: "Week", months: "Months", years: "Years", /* message popup */ message_ok: "OK", message_cancel: "Prekliči" } };
"use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* Tabulator v4.0.0 (c) Oliver Folkerd */ var HtmlTableImport = function HtmlTableImport(table) { this.table = table; //hold Tabulator object this.fieldIndex = []; this.hasIndex = false; }; HtmlTableImport.prototype.parseTable = function () { var self = this, element = self.table.element, options = self.table.options, columns = options.columns, headers = element.getElementsByTagName("th"), rows = element.getElementsByTagName("tbody")[0].getElementsByTagName("tr"), data = [], newTable; self.hasIndex = false; self.table.options.htmlImporting.call(this.table); //check for tablator inline options self._extractOptions(element, options); if (headers.length) { self._extractHeaders(headers, rows); } else { self._generateBlankHeaders(headers, rows); } //iterate through table rows and build data set for (var index = 0; index < rows.length; index++) { var row = rows[index], cells = row.getElementsByTagName("td"), item = {}; //create index if the dont exist in table if (!self.hasIndex) { item[options.index] = index; } for (var i = 0; i < cells.length; i++) { var cell = cells[i]; if (typeof this.fieldIndex[i] !== "undefined") { item[this.fieldIndex[i]] = cell.innerHTML; } } //add row data to item data.push(item); } //create new element var newElement = document.createElement("div"); //transfer attributes to new element var attributes = element.attributes; // loop through attributes and apply them on div for (var i in attributes) { if (_typeof(attributes[i]) == "object") { newElement.setAttribute(attributes[i].name, attributes[i].value); } } // replace table with div element element.parentNode.replaceChild(newElement, element); options.data = data; self.table.options.htmlImported.call(this.table); // // newElement.tabulator(options); this.table.element = newElement; }; //extract tabluator attribute options HtmlTableImport.prototype._extractOptions = function (element, options) { var attributes = element.attributes; for (var index in attributes) { var attrib = attributes[index]; var name; if ((typeof attrib === "undefined" ? "undefined" : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) { name = attrib.name.replace("tabulator-", ""); for (var key in options) { if (key.toLowerCase() == name) { options[key] = this._attribValue(attrib.value); } } } } }; //get value of attribute HtmlTableImport.prototype._attribValue = function (value) { if (value === "true") { return true; } if (value === "false") { return false; } return value; }; //find column if it has already been defined HtmlTableImport.prototype._findCol = function (title) { var match = this.table.options.columns.find(function (column) { return column.title === title; }); return match || false; }; //extract column from headers HtmlTableImport.prototype._extractHeaders = function (headers, rows) { for (var index = 0; index < headers.length; index++) { var header = headers[index], exists = false, col = this._findCol(header.textContent), width, attributes; if (col) { exists = true; } else { col = { title: header.textContent.trim() }; } if (!col.field) { col.field = header.textContent.trim().toLowerCase().replace(" ", "_"); } width = header.getAttribute("width"); if (width && !col.width) { col.width = width; } //check for tablator inline options attributes = header.attributes; // //check for tablator inline options this._extractOptions(header, col); for (var i in attributes) { var attrib = attributes[i], name; if ((typeof attrib === "undefined" ? "undefined" : _typeof(attrib)) == "object" && attrib.name && attrib.name.indexOf("tabulator-") === 0) { name = attrib.name.replace("tabulator-", ""); col[name] = this._attribValue(attrib.value); } } this.fieldIndex[index] = col.field; if (col.field == this.table.options.index) { this.hasIndex = true; } if (!exists) { this.table.options.columns.push(col); } } }; //generate blank headers HtmlTableImport.prototype._generateBlankHeaders = function (headers, rows) { for (var index = 0; index < headers.length; index++) { var header = headers[index], col = { title: "", field: "col" + index }; this.fieldIndex[index] = col.field; var width = header.getAttribute("width"); if (width) { col.width = width; } this.table.options.columns.push(col); } }; Tabulator.prototype.registerModule("htmlTableImport", HtmlTableImport);
'use strict'; // Modules var path = require('path'); var express = require('express'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookie_parser = require('cookie-parser'); var body_parser = require('body-parser'); var moment = require('moment'); var extend = require('extend'); var hogan = require('hogan-express'); var session = require('express-session'); var raneto = require('./core/lib/raneto.js'); var passport = require('passport'); function initialize (config) { // Load Translations if (!config.locale) { config.locale = 'en'; } if (!config.lang) { config.lang = require('./translations/' + config.locale + '.json'); } // Content_Dir requires trailing slash if (config.content_dir[config.content_dir.length - 1] !== path.sep) { config.content_dir += path.sep; } // Setup config extend(raneto.config, config); // Load Files var authenticate = require('./middleware/authenticate.js') (config); var always_authenticate = require('./middleware/always_authenticate.js') (config); var error_handler = require('./middleware/error_handler.js') (config); var oauth2 = require('./middleware/oauth2.js'); var route_login = require('./routes/login.route.js') (config); var route_login_page = require('./routes/login_page.route.js') (config); var route_logout = require('./routes/logout.route.js'); var route_page_edit = require('./routes/page.edit.route.js') (config, raneto); var route_page_delete = require('./routes/page.delete.route.js') (config, raneto); var route_page_create = require('./routes/page.create.route.js') (config, raneto); var route_category_create = require('./routes/category.create.route.js') (config, raneto); var route_search = require('./routes/search.route.js') (config, raneto); var route_home = require('./routes/home.route.js') (config, raneto); var route_wildcard = require('./routes/wildcard.route.js') (config, raneto); var route_sitemap = require('./routes/sitemap.route.js') (config, raneto); // New Express App var app = express(); // Setup Port app.set('port', process.env.PORT || 3000); // set locale as date and time format moment.locale(config.locale); // Setup Views if (!config.theme_dir) { config.theme_dir = path.join(__dirname, '..', 'themes'); } if (!config.theme_name) { config.theme_name = 'default'; } if (!config.public_dir) { config.public_dir = path.join(config.theme_dir, config.theme_name, 'public'); } app.set('views', path.join(config.theme_dir, config.theme_name, 'templates')); app.set('layout', 'layout'); app.set('view engine', 'html'); app.enable('view cache'); app.engine('html', hogan); // Setup Express app.use(favicon(config.public_dir + '/favicon.ico')); app.use(logger('dev')); app.use(body_parser.json()); app.use(body_parser.urlencoded({ extended : false })); app.use(cookie_parser()); app.use(express.static(config.public_dir)); if (config.theme_dir !== path.join(__dirname, '..', 'themes')) { app.use(express.static(path.join(config.theme_dir, config.theme_name, 'public'))); } app.use(config.image_url, express.static(path.normalize(config.content_dir + config.image_url))); app.use('/translations', express.static(path.normalize(__dirname + '/translations'))); // HTTP Authentication if (config.authentication === true || config.authentication_for_edit) { app.use(session({ secret : config.secret, name : 'raneto.sid', resave : false, saveUninitialized : false })); // OAuth2 if (config.googleoauth === true) { app.use(passport.initialize()); app.use(passport.session()); app.use(oauth2.router(config)); app.use(oauth2.template); } app.post('/rn-login', route_login); app.get('/logout', route_logout); app.get('/login', route_login_page); } // Online Editor Routes if (config.allow_editing === true) { var middlewareToUse = authenticate; if (config.authentication_for_edit === true) { middlewareToUse = always_authenticate; } if (config.googleoauth === true) { middlewareToUse = oauth2.required; } app.post('/rn-edit', middlewareToUse, route_page_edit); app.post('/rn-delete', middlewareToUse, route_page_delete); app.post('/rn-add-page', middlewareToUse, route_page_create); app.post('/rn-add-category', middlewareToUse, route_category_create); } // Router for / and /index with or without search parameter if (config.googleoauth === true) { app.get('/:var(index)?', oauth2.required, route_search, route_home); app.get(/^([^.]*)/, oauth2.required, route_wildcard); } else { app.get('/sitemap.xml', route_sitemap); app.get('/:var(index)?', route_search, route_home); app.get(/^([^.]*)/, route_wildcard); } // Handle Errors app.use(error_handler); return app; } // Exports module.exports = initialize;
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; /** * InMage protected disk details. * */ class InMageProtectedDiskDetails { /** * Create a InMageProtectedDiskDetails. * @member {string} [diskId] The disk id. * @member {string} [diskName] The disk name. * @member {string} [protectionStage] The protection stage. * @member {string} [healthErrorCode] The health error code for the disk. * @member {number} [rpoInSeconds] The RPO in seconds. * @member {string} [resyncRequired] A value indicating whether resync is * required for this disk. * @member {number} [resyncProgressPercentage] The resync progress * percentage. * @member {number} [resyncDurationInSeconds] The resync duration in seconds. * @member {number} [diskCapacityInBytes] The disk capacity in bytes. * @member {number} [fileSystemCapacityInBytes] The file system capacity in * bytes. * @member {number} [sourceDataInMB] The source data transit in MB. * @member {number} [psDataInMB] The PS data transit in MB. * @member {number} [targetDataInMB] The target data transit in MB. * @member {string} [diskResized] A value indicating whether disk is resized. * @member {date} [lastRpoCalculatedTime] The last RPO calculated time. */ constructor() { } /** * Defines the metadata of InMageProtectedDiskDetails * * @returns {object} metadata of InMageProtectedDiskDetails * */ mapper() { return { required: false, serializedName: 'InMageProtectedDiskDetails', type: { name: 'Composite', className: 'InMageProtectedDiskDetails', modelProperties: { diskId: { required: false, serializedName: 'diskId', type: { name: 'String' } }, diskName: { required: false, serializedName: 'diskName', type: { name: 'String' } }, protectionStage: { required: false, serializedName: 'protectionStage', type: { name: 'String' } }, healthErrorCode: { required: false, serializedName: 'healthErrorCode', type: { name: 'String' } }, rpoInSeconds: { required: false, serializedName: 'rpoInSeconds', type: { name: 'Number' } }, resyncRequired: { required: false, serializedName: 'resyncRequired', type: { name: 'String' } }, resyncProgressPercentage: { required: false, serializedName: 'resyncProgressPercentage', type: { name: 'Number' } }, resyncDurationInSeconds: { required: false, serializedName: 'resyncDurationInSeconds', type: { name: 'Number' } }, diskCapacityInBytes: { required: false, serializedName: 'diskCapacityInBytes', type: { name: 'Number' } }, fileSystemCapacityInBytes: { required: false, serializedName: 'fileSystemCapacityInBytes', type: { name: 'Number' } }, sourceDataInMB: { required: false, serializedName: 'sourceDataInMB', type: { name: 'Number' } }, psDataInMB: { required: false, serializedName: 'psDataInMB', type: { name: 'Number' } }, targetDataInMB: { required: false, serializedName: 'targetDataInMB', type: { name: 'Number' } }, diskResized: { required: false, serializedName: 'diskResized', type: { name: 'String' } }, lastRpoCalculatedTime: { required: false, serializedName: 'lastRpoCalculatedTime', type: { name: 'DateTime' } } } } }; } } module.exports = InMageProtectedDiskDetails;
function test() { return String(Symbol("foo")) === "Symbol(foo)"; } if (!test()) throw new Error("Test failed");
// show the difference between calling a short js function // relative to a comparable C++ function. // Reports millions of calls per second. // Note that JS speed goes up, while cxx speed stays about the same. 'use strict'; var assert = require('assert'); var common = require('../../common.js'); // this fails when we try to open with a different version of node, // which is quite common for benchmarks. so in that case, just // abort quietly. try { var binding = require('./build/Release/binding'); } catch (er) { console.error('misc/function_call.js Binding failed to load'); process.exit(0); } var cxx = binding.hello; var c = 0; function js() { return c++; } assert(js() === cxx()); var bench = common.createBenchmark(main, { type: ['js', 'cxx'], millions: [1, 10, 50] }); function main(conf) { var n = +conf.millions * 1e6; var fn = conf.type === 'cxx' ? cxx : js; bench.start(); for (var i = 0; i < n; i++) { fn(); } bench.end(+conf.millions); }
/** * @namespace wtag.IFireable * @created 17/09/2014 * * @class wtag.IFireable * @extends WTag */ window["TFW::wtag.IFireable"] = { superclass: "WTag", init: function() {}, //===================== functions: { /** * @description * Trigger signals according to attributes _fire_ and _fire-arg_. * * @memberof wtag.IFireable */ fireAll: function(attName) { if (typeof attName === 'undefined') attName = 'fire'; var fire = this["_" + attName]; if (!fire) return; var fireArg = this["_" + attName + "Arg"]; var i, sig, arg; for (i = 0 ; i < fire.length ; i++) { sig = fire[i]; arg = fireArg[i]; this.fire(sig, arg); } } } };
/** * @license Highcharts JS v7.0.3 (2019-02-06) * CurrentDateIndicator * * (c) 2010-2019 Lars A. V. Cabrera * * License: www.highcharts.com/license */ 'use strict'; (function (factory) { if (typeof module === 'object' && module.exports) { factory['default'] = factory; module.exports = factory; } else if (typeof define === 'function' && define.amd) { define(function () { return factory; }); } else { factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined); } }(function (Highcharts) { (function (H) { /* * * * (c) 2016-2019 Highsoft AS * * Author: Lars A. V. Cabrera * * License: www.highcharts.com/license * * */ var addEvent = H.addEvent, Axis = H.Axis, PlotLineOrBand = H.PlotLineOrBand, merge = H.merge; var defaultConfig = { /** * Show an indicator on the axis for the current date and time. Can be a * boolean or a configuration object similar to * [xAxis.plotLines](#xAxis.plotLines). * * @sample gantt/current-date-indicator/demo * Current date indicator enabled * @sample gantt/current-date-indicator/object-config * Current date indicator with custom options * * @type {boolean|*} * @default true * @extends xAxis.plotLines * @excluding value * @product gantt * @apioption xAxis.currentDateIndicator */ currentDateIndicator: true, color: '#ccd6eb', width: 2, label: { format: '%a, %b %d %Y, %H:%M', formatter: undefined, rotation: 0, style: { fontSize: '10px' } } }; addEvent(Axis, 'afterSetOptions', function () { var options = this.options, cdiOptions = options.currentDateIndicator; if (cdiOptions) { if (typeof cdiOptions === 'object') { // Ignore formatter if custom format is defined if (cdiOptions.label && cdiOptions.label.format) { cdiOptions.label.formatter = undefined; } cdiOptions = merge(defaultConfig, cdiOptions); } else { cdiOptions = merge(defaultConfig); } cdiOptions.value = new Date(); if (!options.plotLines) { options.plotLines = []; } options.plotLines.push(cdiOptions); } }); addEvent(PlotLineOrBand, 'render', function () { var options = this.options, format, formatter; if (options.currentDateIndicator && options.label) { format = options.label.format; formatter = options.label.formatter; options.value = new Date(); if (typeof formatter === 'function') { options.label.text = formatter(this); } else { options.label.text = H.dateFormat(format, new Date()); } // If the label already exists, update its text if (this.label) { this.label.attr({ text: options.label.text }); } } }); }(Highcharts)); return (function () { }()); }));
/* Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'contextmenu', 'km', { options: 'ជម្រើស​ម៉ឺនុយ​បរិបទ' } );
// A global garbage collection does not disturb onPop handlers. var g = newGlobal(); var dbg = new Debugger(g); var log; dbg.onEnterFrame = function handleEnter(frame) { log += '('; frame.onPop = function handlePop(completion) { log += ')'; }; }; log = ''; assertEq(g.eval('gc(); 42;'), 42); assertEq(log, '()');
// moment.js locale configuration // locale : euskara (eu) // author : Eneko Illarramendi : https://github.com/eillarra (function( factory ) { if (typeof define === 'function' && define.amd) { define( ['moment'], factory ); // AMD } else { if (typeof exports === 'object') { module.exports = factory( require( '../moment' ) ); // Node } else { factory( (typeof global !== 'undefined' ? global : this).moment ); // node or other global } } }( function( moment ) { return moment.defineLocale( 'eu', { months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split( '_' ), monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split( '_' ), weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split( '_' ), weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split( '_' ), weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split( '_' ), longDateFormat: { LT: 'HH:mm', LTS: 'LT:ss', L: 'YYYY-MM-DD', LL: 'YYYY[ko] MMMM[ren] D[a]', LLL: 'YYYY[ko] MMMM[ren] D[a] LT', LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] LT', l: 'YYYY-M-D', ll: 'YYYY[ko] MMM D[a]', lll: 'YYYY[ko] MMM D[a] LT', llll: 'ddd, YYYY[ko] MMM D[a] LT' }, calendar: { sameDay: '[gaur] LT[etan]', nextDay: '[bihar] LT[etan]', nextWeek: 'dddd LT[etan]', lastDay: '[atzo] LT[etan]', lastWeek: '[aurreko] dddd LT[etan]', sameElse: 'L' }, relativeTime: { future: '%s barru', past: 'duela %s', s: 'segundo batzuk', m: 'minutu bat', mm: '%d minutu', h: 'ordu bat', hh: '%d ordu', d: 'egun bat', dd: '%d egun', M: 'hilabete bat', MM: '%d hilabete', y: 'urte bat', yy: '%d urte' }, ordinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7 // The week that contains Jan 1st is the first week of the year. } } ); } ));
var app = angular.module('groupEdit', ['ui.bootstrap', 'bennuToolkit']); app.controller('editGroupController', [ '$scope','$modal', function($scope, $modal) { $scope.setFieldDefs = function(e) { $scope.fieldDefs = e; }; $scope.removeField = function(field) { $scope.groups.remove(field); }; $scope.addField = function() { $scope.groups.push($scope.newField); }; $scope.items = ['item1', 'item2', 'item3']; $scope.open = function (inputId) { var modalInstance = $modal.open({ templateUrl: 'myModalContent.html', controller: 'ModalInstanceCtrl', resolve: { items: function () { return $scope.items; }, target : function() { return inputId; }, } }); modalInstance.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { }); }; }]); app.controller('ModalInstanceCtrl', function ($scope, $modalInstance, items, target) { var expression = angular.element(target).val(); $scope.groups = getUserGroupsFromExpression(expression); $scope.items = items; $scope.target = target; $scope.selected = { item: $scope.items[0] }; $scope.selectedUser; $scope.selectedGroup; $scope.ok = function () { $modalInstance.close($scope.selected.item); angular.element(target).val(groupEncode($scope.groups)); }; $scope.addUser = function (){ if($scope.selectedUser != undefined){ var newUser = getInfoGroup($scope.selectedUser.username); if(newUser != undefined) $scope.groups.push(newUser); $scope.selectedUser = ""; } }; $scope.addGroup = function (){ if($scope.selectedGroup.length > 0){ var newGroup = getInfoGroup($scope.selectedGroup); if(newGroup != undefined) $scope.groups.push(newGroup); } }; $scope.remove = function (idx){ var person = $scope.groups[idx]; if(person == undefined) return; if(idx > -1){ $scope.groups.splice(idx,1); } } $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; });
/** * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Accordion component that uses csszippies. * @author jmwaura@google.com (Jesse Mwaura) */ goog.provide('vit.component.Accordion'); goog.require('goog.dom'); goog.require('goog.dom.classes'); goog.require('goog.events'); goog.require('goog.ui.Zippy'); goog.require('goog.ui.ZippyEvent'); goog.require('vit.component.Component'); goog.require('vit.component.CssZippy'); /** * Accordion component that uses CssZippies. * * @param {goog.dom.DomHelper=} opt_domHelper DOM helper to use. * * @extends {vit.component.Component} * @constructor */ vit.component.Accordion = function(opt_domHelper) { goog.base(this, opt_domHelper); /** * The header. * @type {Array.<vit.component.CssZippy>} * @private */ this.zippies_; /** * The currently selected element. * @type {Element} * @private */ this.selected_; }; goog.inherits(vit.component.Accordion, vit.component.Component); /** @override */ vit.component.Accordion.prototype.decorateInternal = function(element) { goog.base(this, 'decorateInternal', element); /** @type {Array.<vit.component.CssZippy>} */ var zippies = []; var zippyEls = goog.dom.getElementsByClass(goog.getCssName('zippy'), element); goog.array.forEach(zippyEls, function(zippyEl) { var zippy = new vit.component.CssZippy(zippyEl); zippies.push(zippy); }, this); this.zippies_ = zippies; }; /** * Handle zippy toggle events. * @param {goog.ui.ZippyEvent} ev Zippy toggle event. * @private */ vit.component.Accordion.prototype.onZippyToggle_ = function(ev) { if (!ev.expanded) { if (this.selected_ == ev.target.getElement()) { this.selected_ = null; } else { return; } } else { var expandedZippy = ev.target; goog.array.forEach(this.zippies_, function(zippy) { if (expandedZippy != zippy) { zippy.collapse(); } }); this.selected_ = ev.target.getElement(); } this.dispatchEvent(new goog.events.Event(goog.ui.Component.EventType.SELECT, this)); }; /** * Gets selected zippy element. * @return {Element} The selected zippy element. */ vit.component.Accordion.prototype.getSelected = function() { return this.selected_; }; /** @override */ vit.component.Accordion.prototype.enterDocument = function() { var handler = this.getHandler(); goog.array.forEach(this.zippies_, function(zippy) { handler.listen(zippy, goog.ui.Zippy.Events.TOGGLE, this.onZippyToggle_); }, this); }; /** @override */ vit.component.Accordion.prototype.exitDocument = function() { this.getHandler().removeAll(); }; /** @override */ vit.component.Accordion.prototype.disposeInternal = function() { goog.array.forEach(this.zippies_, function(zippy) { zippy.dispose(); }, this); delete this.zippies_; goog.base(this, 'disposeInternal'); };
/*global define*/ define([ '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', '../Core/DeveloperError', '../Core/Iso8601' ], function( defaultValue, defined, defineProperties, DeveloperError, Iso8601) { 'use strict'; /** * The interface for all properties, which represent a value that can optionally vary over time. * This type defines an interface and cannot be instantiated directly. * * @alias Property * @constructor * * @see CompositeProperty * @see ConstantProperty * @see SampledProperty * @see TimeIntervalCollectionProperty * @see MaterialProperty * @see PositionProperty * @see ReferenceProperty */ function Property() { DeveloperError.throwInstantiationError(); } defineProperties(Property.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. * @memberof Property.prototype * * @type {Boolean} * @readonly */ isConstant : { get : DeveloperError.throwInstantiationError }, /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. * @memberof Property.prototype * * @type {Event} * @readonly */ definitionChanged : { get : DeveloperError.throwInstantiationError } }); /** * Gets the value of the property at the provided time. * @function * * @param {JulianDate} time The time for which to retrieve the value. * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned. * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied. */ Property.prototype.getValue = DeveloperError.throwInstantiationError; /** * Compares this property to the provided property and returns * <code>true</code> if they are equal, <code>false</code> otherwise. * @function * * @param {Property} [other] The other property. * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise. */ Property.prototype.equals = DeveloperError.throwInstantiationError; /** * @private */ Property.equals = function(left, right) { return left === right || (defined(left) && left.equals(right)); }; /** * @private */ Property.arrayEquals = function(left, right) { if (left === right) { return true; } if ((!defined(left) || !defined(right)) || (left.length !== right.length)) { return false; } var length = left.length; for (var i = 0; i < length; i++) { if (!Property.equals(left[i], right[i])) { return false; } } return true; }; /** * @private */ Property.isConstant = function(property) { return !defined(property) || property.isConstant; }; /** * @private */ Property.getValueOrUndefined = function(property, time, result) { return defined(property) ? property.getValue(time, result) : undefined; }; /** * @private */ Property.getValueOrDefault = function(property, time, valueDefault, result) { return defined(property) ? defaultValue(property.getValue(time, result), valueDefault) : valueDefault; }; /** * @private */ Property.getValueOrClonedDefault = function(property, time, valueDefault, result) { var value; if (defined(property)) { value = property.getValue(time, result); } if (!defined(value)) { value = valueDefault.clone(value); } return value; }; return Property; });
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-4.js * @description Array.prototype.some - thisArg is object from object template(prototype) */ function testcase() { var res = false; function callbackfn(val, idx, obj) { return this.res; } function foo(){} foo.prototype.res = true; var f = new foo(); var arr = [1]; if(arr.some(callbackfn,f) === true) return true; } runTestCase(testcase);
import { default as React, PropTypes, Component, } from "react"; import { default as PolygonEventList } from "../eventLists/PolygonEventList"; import { default as eventHandlerCreator } from "../utils/eventHandlerCreator"; import { default as defaultPropsCreator } from "../utils/defaultPropsCreator"; import { default as composeOptions } from "../utils/composeOptions"; import { default as componentLifecycleDecorator } from "../utils/componentLifecycleDecorator"; import { default as GoogleMapHolder } from "./GoogleMapHolder"; export const polygonControlledPropTypes = { // NOTICE!!!!!! // // Only expose those with getters & setters in the table as controlled props. // // [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }).filter(function(it){ return it.match(/^set/) && !it.match(/^setMap/); }) // // https://developers.google.com/maps/documentation/javascript/3.exp/reference#Polygon draggable: PropTypes.bool, editable: PropTypes.bool, options: PropTypes.object, path: PropTypes.any, paths: PropTypes.any, visible: PropTypes.bool, }; export const polygonDefaultPropTypes = defaultPropsCreator(polygonControlledPropTypes); const polygonUpdaters = { draggable(draggable, component) { component.getPolygon().setDraggable(draggable); }, editable(editable, component) { component.getPolygon().setEditable(editable); }, options(options, component) { component.getPolygon().setOptions(options); }, path(path, component) { component.getPolygon().setPath(path); }, paths(paths, component) { component.getPolygon().setPaths(paths); }, visible(visible, component) { component.getPolygon().setVisible(visible); }, }; const { eventPropTypes, registerEvents } = eventHandlerCreator(PolygonEventList); export const polygonEventPropTypes = eventPropTypes; @componentLifecycleDecorator({ registerEvents, instanceMethodName: `getPolygon`, updaters: polygonUpdaters, }) export default class PolygonCreator extends Component { static propTypes = { mapHolderRef: PropTypes.instanceOf(GoogleMapHolder).isRequired, polygon: PropTypes.object.isRequired, } static _createPolygon(polygonProps) { const { mapHolderRef } = polygonProps; // https://developers.google.com/maps/documentation/javascript/3.exp/reference#Polygon const polygon = new google.maps.Polygon(composeOptions(polygonProps, polygonControlledPropTypes)); polygon.setMap(mapHolderRef.getMap()); return polygon; } getPolygon() { return this.props.polygon; } render() { return (<noscript />); } }
//Lighting form elements variables var $id = function(d) { return document.getElementById(d); }; function webGLStart() { var xRot = 0, xSpeed = 0, yRot = 0, ySpeed = 0, z = -5.0; //Get lighting form elements var lighting = $id('lighting'), ambient = { r: $id('ambientR'), g: $id('ambientG'), b: $id('ambientB') }, direction = { x: $id('lightDirectionX'), y: $id('lightDirectionY'), z: $id('lightDirectionZ'), r: $id('directionalR'), g: $id('directionalG'), b: $id('directionalB') }; //Create object var cube = new PhiloGL.O3D.Model({ vertices: [-1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1], textures: 'crate.gif', texCoords: [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // Back face 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, // Top face 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, // Bottom face 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // Right face 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, // Left face 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0], normals: [ // Front face 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, // Back face 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, // Top face 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, // Bottom face 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, // Right face 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, // Left face -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0 ], indices: [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23] }); PhiloGL('lesson07-canvas', { textures: { src: ['crate.gif'], parameters: [{ name: 'TEXTURE_MAG_FILTER', value: 'LINEAR' }, { name: 'TEXTURE_MIN_FILTER', value: 'LINEAR_MIPMAP_NEAREST', generateMipmap: true }] }, events: { onKeyDown: function(e) { switch(e.key) { case 'f': filter = (filter + 1) % 3; break; case 'up': xSpeed -= 0.02; break; case 'down': xSpeed += 0.02; break; case 'left': ySpeed -= 0.02; break; case 'right': ySpeed += 0.02; break; //handle page up/down default: if (e.code == 33) { z -= 0.05; } else if (e.code == 34) { z += 0.05; } } } }, onError: function() { alert("An error ocurred while loading the application"); }, onLoad: function(app) { var gl = app.gl, canvas = app.canvas, program = app.program, camera = app.camera, scene = app.scene; gl.viewport(0, 0, canvas.width, canvas.height); gl.clearColor(0, 0, 0, 1); gl.clearDepth(1); gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.LEQUAL); camera.view.id(); //Add object to our default scene scene.add(cube); function animate() { xRot += xSpeed; yRot += ySpeed; } function tick() { drawScene(); animate(); PhiloGL.Fx.requestAnimationFrame(tick); } function drawScene() { gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); //Update Cube position cube.position.set(0, 0, z); cube.rotation.set(xRot, yRot, 0); cube.update(); //Update scene config with light info var lightConfig = scene.config.lights; lightConfig.enable = lighting.checked; lightConfig.ambient = { r: +ambient.r.value, g: +ambient.g.value, b: +ambient.b.value }; lightConfig.directional.direction = { x: +direction.x.value, y: +direction.y.value, z: +direction.z.value }; lightConfig.directional.color = { r: +direction.r.value, g: +direction.g.value, b: +direction.b.value }; //Render all elements in the Scene scene.render(); } tick(); } }); }
var assert = require('assert'); var Collection = require('../../lib/Collection'); var TestCase = require('../../lib/TestCase'); (function testRunningTwoTestCases() { var caseA = new TestCase({ name: 'a', tests: { '1': function() {}, '2': function() {}, }, }); var caseB = new TestCase({ name: 'b', tests: { '3': function() {}, '4': function() {}, }, }); var collection = new Collection(); collection.add(caseA); collection.add(caseB); var pass = []; collection.on('pass', function(testCase, name) { pass.push(testCase.name + ':' + name); }); collection.run(); assert.deepEqual(pass, ['a:1', 'a:2', 'b:3', 'b:4']); var stats = collection.stats(); assert.equal(stats.pass, 4); })(); (function testFailingTestCase() { var testCase = new TestCase({ tests: { 'good test': function() { }, 'bad test': function() { throw new Error('failure'); } }, }); var collection = new Collection(); collection.add(testCase); var fail = []; collection.on('fail', function(testCase, name, error) { fail.push({testCase: testCase, name: name, error: error}); }); collection.run(); assert.equal(fail.length, 1); assert.equal(fail[0].testCase, testCase); assert.equal(fail[0].name, 'bad test'); assert.equal(fail[0].error.message, 'failure'); var stats = collection.stats(); assert.equal(stats.pass, 1); assert.equal(stats.fail, 1); assert.ok(stats.duration >= 0); })(); (function testEmitCompleteTestCase() { var testCase = new TestCase({ tests: { 'good test': function() { }, 'bad test': function() { throw new Error('failure'); } }, }); var collection = new Collection(); collection.add(testCase); var stats; collection.on('complete', function(arg) { stats = arg; }); collection.run(); assert.equal(stats.pass, 1); assert.equal(stats.fail, 1); assert.ok(stats.duration >= 0); })(); (function testEmitRunTestCase() { var testCase1 = new TestCase({ tests: { 'good test': function() {} }, }); var testCase2 = new TestCase({ tests: { 'bad test': function() { throw new Error('failure'); } }, }); var collection = new Collection(); collection.add(testCase1); collection.add(testCase2); var runs = []; collection.on('run', function(testCase) { runs.push(testCase); }); collection.run(); assert.equal(runs.length, 2); assert.strictEqual(runs[0], testCase1); assert.strictEqual(runs[1], testCase2); })();
angular.module('docs', ['mediaPlayer']) .config(function ($interpolateProvider) { $interpolateProvider.startSymbol('[['); $interpolateProvider.endSymbol(']]'); }) .run(function ($rootScope) { // helper function to seek to a percentage $rootScope.seekPercentage = function ($event) { var percentage = ($event.offsetX / $event.target.offsetWidth); if (percentage <= 1) { return percentage; } else { return 0; } }; });
/** * A nuke landing position. * This object cannot be removed or modified. * You can find incoming nukes in the room using the FIND_NUKES constant. * @class * @extends {RoomObject} */ Nuke = function() { }; Nuke.prototype = { /** * A unique object identificator. * You can use Game.getObjectById method to retrieve an object instance by its id. * * @type {string} */ id: "", /** * The name of the room where this nuke has been launched from. * * @type {string} */ launchRoomName: "", /** * The remaining landing time. * * @type {number} */ timeToLand: 0 };
'use strict'; var _ = require('../mindash'); var uuid = require('./utils/uuid'); var Dispatcher = require('flux').Dispatcher; var ActionPayload = require('./actionPayload'); var EventEmitter = require('wolfy87-eventemitter'); var ACTION_DISPATCHED = 'ACTION_DISPATCHED'; function createDispatcher() { var emitter = new EventEmitter(); var dispatcher = new Dispatcher(); dispatcher.id = uuid.generate(); dispatcher.isDefault = false; dispatcher.dispatchAction = function (options) { var action = new ActionPayload(options); this.dispatch(action); action.handled(); emitter.emit(ACTION_DISPATCHED, action); return action; }; dispatcher.onActionDispatched = function (callback, context) { if (context) { callback = _.bind(callback, context); } emitter.on(ACTION_DISPATCHED, callback); return { dispose: function dispose() { emitter.removeListener(ACTION_DISPATCHED, callback); } }; }; return dispatcher; } module.exports = createDispatcher;
// Copyright 2011 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. traceur.define('syntax', function() { 'use strict'; var LineNumberTable = traceur.syntax.LineNumberTable; /** * A source file. * * Immutable. * * @param {string} name * @param {string} content * @constructor */ function SourceFile(name, contents) { this.name = name; this.contents = contents; this.lineNumberTable = new LineNumberTable(this); this.uid = traceur.getUid(); Object.freeze(this); } return { SourceFile: SourceFile }; });
function hello(){ return 'hello' } function deadCode(){ console.log('Run me!') }
// import HomeRoute from 'routes/Home' // // describe('(Route) Home', () => { // let _component // // beforeEach(() => { // _component = HomeRoute.component() // }) // // it('Should return a route configuration object', () => { // expect(typeof HomeRoute).to.equal('object') // }) // // it('Should define a route component', () => { // expect(_component.type).to.equal('div') // }) // })
function date_parse_from_format(format, dateArg) { // http://kevin.vanzonneveld.net // + original by: Brett Zamir (http://brett-zamir.me) // - depends on: strtotime // - depends on: date // - depends on: date_parse // * example 1: date_parse_from_format('j.n.Y H:iP', '6.1.2009 13:00+01:00'); // * returns 1: {year : 2006, month: 12, day: 12, hour: 10, minute: 0, second: 0, fraction: 0.5, warning_count: 0, warnings: [], error_count: 0, errors: [], is_localtime: false, zone_type: 1, zone: -60, is_dst:false} var newtime = 0, retObj = {}; var _dst = function(t) { // Calculate Daylight Saving Time (original by gettimeofday() code) var dst = 0; var jan1 = new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0); // jan 1st var june1 = new Date(t.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st var temp = jan1.toUTCString(); var jan2 = new Date(temp.slice(0, temp.lastIndexOf(' ') - 1)); temp = june1.toUTCString(); var june2 = new Date(temp.slice(0, temp.lastIndexOf(' ') - 1)); var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60); var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60); if (std_time_offset === daylight_time_offset) { dst = false; // daylight savings time is NOT observed } else { // positive is southern, negative is northern hemisphere var hemisphere = std_time_offset - daylight_time_offset; if (hemisphere >= 0) { std_time_offset = daylight_time_offset; } dst = true; // daylight savings time is observed } return dst; }; try { newtime = 0; // fix: needs to use format, dateArg to return a time retObj = this.date_parse(newtime); } catch (e) { return false; // Presumably returns false, as with date_parse() } retObj.is_dst = _dst(newtime); // Fix: need to add the following as well //zone_type: TIMELIB_ZONETYPE_OFFSET 1, TIMELIB_ZONETYPE_ABBR 2, TIMELIB_ZONETYPE_ID 3 //zone: -60 return retObj; }
module.exports = (function () { 'use strict'; var config = require('../../package.json').config; /** Add * * @function * @description Add a new cache entry * @return void * @callback * @arg {String} name - The cache entry name * @arg {String} body - The cache entry body * @arg {Object} options - Optional { type: String, expire: Number } * @arg {Number} expire - The cache life time in seconds [OPTIONAL] * @arg {Function} callback */ function add (name, body, options, callback) { var self = this; /** Adjust arguments in case @options is omitted **/ if ( ! callback && (typeof options === 'function') ) { callback = options; options = {}; } var domain = require('domain').create(); domain.on('error', domain.bind(function (error) { self.emit('error', error); self.connected = false; callback(error); })); domain.run(function () { if (self.connected === false) { return callback(null, []); // simulate cache miss } /** The new cache entry **/ var entry = { body: body, type: options.type || config.type, touched: +new Date(), expire: options.expire || self.expire }; var size = require('../sizeof')(entry); var prefix = self.prefix.match(/:$/) ? self.prefix.replace(/:$/, '') : self.prefix; /* Save as a Redis hash */ var redisKey = prefix + ':' + name; self.client.hmset(redisKey, entry, domain.intercept(function (res) { var calculated_size = (size / 1024).toFixed(2); /** If @expire then tell Redis to expire **/ if ( typeof entry.expire === 'number' && entry.expire > 0 ) { self.client.expire(redisKey, +entry.expire, domain.intercept(function () { self.emit('message', require('util').format('SET %s ~%d Kb %d TTL (sec)', redisKey, calculated_size, +entry.expire)); callback(null, name, entry, res); })); } else { self.emit('message', require('util').format('SET %s ~%d Kb', redisKey, calculated_size)); callback(null, name, entry, res); } })); }); } return add; })();
(function () { 'use strict' document.querySelector('[data-toggle="offcanvas"]').addEventListener('click', function () { document.querySelector('.offcanvas-collapse').classList.toggle('open') }) })()
/** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define(function () { 'use strict'; return { local: { path: 'tests/assets/jsbuild/local', result: 'internal module' }, external: { path: 'tests/assets/jsbuild/external', result: 'external module' } }; });
var fullProject = require('./fixtures/full-project') fullProjectStr = JSON.stringify(fullProject), pbx = require('../lib/pbxProject'), pbxFile = require('../lib/pbxFile'), proj = new pbx('.'); function cleanHash() { return JSON.parse(fullProjectStr); } exports.setUp = function (callback) { proj.hash = cleanHash(); callback(); } exports.addSourceFile = { 'should return a pbxFile': function (test) { var newFile = proj.addSourceFile('file.m'); test.equal(newFile.constructor, pbxFile); test.done() }, 'should set a uuid on the pbxFile': function (test) { var newFile = proj.addSourceFile('file.m'); test.ok(newFile.uuid); test.done() }, 'should set a fileRef on the pbxFile': function (test) { var newFile = proj.addSourceFile('file.m'); test.ok(newFile.fileRef); test.done() }, 'should populate the PBXBuildFile section with 2 fields': function (test) { var newFile = proj.addSourceFile('file.m'), buildFileSection = proj.pbxBuildFileSection(), bfsLength = Object.keys(buildFileSection).length; test.equal(60, bfsLength); test.ok(buildFileSection[newFile.uuid]); test.ok(buildFileSection[newFile.uuid + '_comment']); test.done(); }, 'should add the PBXBuildFile comment correctly': function (test) { var newFile = proj.addSourceFile('file.m'), commentKey = newFile.uuid + '_comment', buildFileSection = proj.pbxBuildFileSection(); test.equal(buildFileSection[commentKey], 'file.m in Sources'); test.done(); }, 'should add the PBXBuildFile object correctly': function (test) { var newFile = proj.addSourceFile('file.m'), buildFileSection = proj.pbxBuildFileSection(), buildFileEntry = buildFileSection[newFile.uuid]; test.equal(buildFileEntry.isa, 'PBXBuildFile'); test.equal(buildFileEntry.fileRef, newFile.fileRef); test.equal(buildFileEntry.fileRef_comment, 'file.m'); test.done(); }, 'should populate the PBXFileReference section with 2 fields': function (test) { var newFile = proj.addSourceFile('file.m'), fileRefSection = proj.pbxFileReferenceSection(), frsLength = Object.keys(fileRefSection).length; test.equal(68, frsLength); test.ok(fileRefSection[newFile.fileRef]); test.ok(fileRefSection[newFile.fileRef + '_comment']); test.done(); }, 'should populate the PBXFileReference comment correctly': function (test) { var newFile = proj.addSourceFile('file.m'), fileRefSection = proj.pbxFileReferenceSection(), commentKey = newFile.fileRef + '_comment'; test.equal(fileRefSection[commentKey], 'file.m'); test.done(); }, 'should add the PBXFileReference object correctly': function (test) { var newFile = proj.addSourceFile('Plugins/file.m'), fileRefSection = proj.pbxFileReferenceSection(), fileRefEntry = fileRefSection[newFile.fileRef]; test.equal(fileRefEntry.isa, 'PBXFileReference'); test.equal(fileRefEntry.fileEncoding, 4); test.equal(fileRefEntry.lastKnownFileType, 'sourcecode.c.objc'); test.equal(fileRefEntry.name, 'file.m'); test.equal(fileRefEntry.path, 'file.m'); test.equal(fileRefEntry.sourceTree, '"<group>"'); test.done(); }, 'should add to the Plugins PBXGroup group': function (test) { var newFile = proj.addSourceFile('Plugins/file.m'), plugins = proj.pbxGroupByName('Plugins'); test.equal(plugins.children.length, 1); test.done(); }, 'should have the right values for the PBXGroup entry': function (test) { var newFile = proj.addSourceFile('Plugins/file.m'), plugins = proj.pbxGroupByName('Plugins'), pluginObj = plugins.children[0]; test.equal(pluginObj.comment, 'file.m'); test.equal(pluginObj.value, newFile.fileRef); test.done(); }, 'should add to the PBXSourcesBuildPhase': function (test) { var newFile = proj.addSourceFile('Plugins/file.m'), sources = proj.pbxSourcesBuildPhaseObj(); test.equal(sources.files.length, 3); test.done(); }, 'should have the right values for the Sources entry': function (test) { var newFile = proj.addSourceFile('Plugins/file.m'), sources = proj.pbxSourcesBuildPhaseObj(), sourceObj = sources.files[2]; test.equal(sourceObj.comment, 'file.m in Sources'); test.equal(sourceObj.value, newFile.uuid); test.done(); } }
(function() { var path, screenOrientation, xmldom; xmldom = require('xmldom'); path = require('path'); module.exports = screenOrientation = function(grunt) { var helpers; helpers = require('../../../../helpers')(grunt); return { set: function(fn) { var activity, doc, dom, manifest, manifestPath, phonegapPath; dom = xmldom.DOMParser; screenOrientation = helpers.config('screenOrientation'); if (screenOrientation) { phonegapPath = helpers.config('path'); manifestPath = path.join(phonegapPath, 'platforms', 'android', 'AndroidManifest.xml'); manifest = grunt.file.read(manifestPath); grunt.log.writeln("Setting screenOrientation to " + screenOrientation + " in " + manifestPath); doc = new dom().parseFromString(manifest, 'text/xml'); activity = doc.getElementsByTagName('activity')[0]; activity.setAttribute('android:screenOrientation', screenOrientation); grunt.file.write(manifestPath, doc); } if (fn) { return fn(); } } }; }; }).call(this);
/*jshint node:true */ define([ "../../buildControl", "../../fs", "./stripConsole", "dojo/_base/lang", "./uglify_worker", "../writeAmd", "require" ], function(bc, fs, stripConsole, lang, uglify, writeAmd, require){ if(!uglify){ throw new Error("Unknown host environment: only nodejs is supported by uglify optimizer."); } if(bc.maxOptimizationProcesses){ var nodeReq = require.nodeRequire, processes = [], fork = nodeReq("child_process").fork, proc, jobs = {}, currentIndex = 0, queue = [], worker = require.toUrl("./uglify_worker.js"); if(bc.maxOptimizationProcesses<0){ bc.maxOptimizationProcesses = nodeReq('os').cpus().length; } for(var i = 0; i < bc.maxOptimizationProcesses; i++){ proc = fork(worker); proc.on("message", function(data){ if(jobs[data.dest]){ var func = jobs[data.dest]; delete jobs[data.dest]; func(data); } }); processes.push(proc); } } return function(resource, text, copyright, optimizeSwitch, callback){ copyright = copyright || ""; var options = bc.optimizeOptions || {}; options.filename = writeAmd.getDestFilename(resource).split("/").pop(); if(optimizeSwitch.indexOf(".keeplines") > -1){ options.gen_options = options.gen_options || {}; options.gen_options.beautify = true; options.gen_options.indent_level = 0; //don't indent, just keep new lines } if(optimizeSwitch.indexOf(".comments") > -1){ throw new Error("'comments' option is not supported by uglify optimizer."); } var handleResult = function(data){ try{ if(data.error){ throw data.error; } var result = copyright + "//>>built" + bc.newline + data.text; fs.writeFile(resource.dest, result, resource.encoding, function(err){ if(err){ bc.log("optimizeFailedWrite", ["filename", resource.dest]); } callback(resource, err); }); }catch(e){ bc.log("optimizeFailed", ["module identifier", resource.mid, "exception", e + ""]); callback(resource, 0); } }; if(bc.maxOptimizationProcesses){ jobs[resource.dest] = handleResult; processes[currentIndex].send({ text: stripConsole(text), options: options, dest: resource.dest, useSourceMaps: bc.useSourceMaps }); currentIndex = (currentIndex+1) % processes.length; } else { process.nextTick(function(){ var o = {}; try{ o.text = uglify(stripConsole(text), options, resource.dest, bc.useSourceMaps); }catch(e){ o.error = e; } handleResult(o); }); } return callback; }; });
(function(window, undefined) { 'use strict'; var Accordion = function(accordionContainer) { // var self = this; this.container = accordionContainer; /** * Hides all content panes in current accordion container. * @params {array} contentPanes - The panes to hide. */ this.hidePanes = function(contentPanes) { var panesLength = contentPanes.length; for (var i = 0; i < panesLength; i++) { var classArray = contentPanes[i].getAttribute('class').split(/\s/); var index = classArray.indexOf('show'); if (index > -1) { classArray.splice(index, 1); // we are collapsing so, update aria-expanded contentPanes[i].setAttribute('aria-hidden', 'true'); // @see https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode.previousElementSibling contentPanes[i].previousElementSibling.setAttribute('aria-expanded', 'false'); } contentPanes[i].setAttribute('class', classArray.join(' ')); } }.bind(this); /** * Shows the triggered content pane. * @params {object} pane - The pane to show. */ this.showPane = function(pane) { var classes = pane.getAttribute('class'); pane.setAttribute('class', classes + ' show'); // as this pane is now expanded, update aria-hidden. pane.setAttribute('aria-hidden', 'false'); pane.focus(); }.bind(this); /** * Handles all events triggered within the accordion container. * @params {object} event - The event that was fired. */ this.handleEvent = function(event) { var anchor = event.target; var contentPanelId = anchor.getAttribute('href'); var parent = event.target.parentNode; var parentRole = parent.getAttribute('role'); var parentExpandedState = parent.getAttribute('aria-expanded'); // only handle event if the parent has a role of tab. // if the tab is currently expanded, collapse it if (parentRole === 'tab' && parentExpandedState === 'true') { event.preventDefault(); // set the clicked tab as collapsed and not selected. parent.setAttribute('aria-expanded', 'false'); parent.setAttribute('aria-selected', 'false'); // hide all the panes this.hidePanes(this.container.querySelectorAll('.content-pane')); } else if (parentRole === 'tab') { event.preventDefault(); // set the newly selected tab as expanded and selected. parent.setAttribute('aria-expanded', 'true'); parent.setAttribute('aria-selected', 'true'); // hide all the panes this.hidePanes(this.container.querySelectorAll('.content-pane')); // show the selected pane this.showPane(document.querySelector(contentPanelId)); } }.bind(this); /** * Handles events delegated to the accordion. * @param {object} event - The event to handle */ this.handleKeyboardEvent = function(event) { // Chrome does not support event.key so, we fallback to keyCode var key = event.key ? event.key : event.keyCode; // handle enter and spacebar keys. if ((key === 13 || key === 32) || (key === 'Enter' || key === 'Spacebar')) { this.handleEvent(event); } }.bind(this); /** * Delegates keyboard events either back to the browser or, stops propogation * and calls handleKeyboardEvent to handle the key event. * @params {object} event - The event to delegate */ this.delegateKeyEvents = function(event) { var key = event.key ? event.key : event.keyCode; switch (key) { case 13: case 32: case 'Enter': case 'Spacebar': event.stopPropagation(); this.handleKeyboardEvent(event); return false; } return true; }.bind(this); this.init = function() { // this.container = accordionContainer; this.container.addEventListener('click', function(event) { // handle edge cases where the original event.targer is removed // riht after the event was trigered causing event.target.parentNode // in handleEvent to be null. if (event.target.parentNode) { this.handleEvent(event); } }.bind(this), false); this.container.addEventListener('keyup', function(event) { if (event.target.parentNode) { this.delegateKeyEvents(event); } }.bind(this), false); this.container.addEventListener('keydown', function(event) { if (event.target.parentNode) { this.delegateKeyEvents(event); } }.bind(this), false); }.bind(this); }; // Expose accordion to the global object window.Accordion = Accordion; })(window);
var libxml = require('libxmljs'); /** * Creates a new Gateway. * * @param {FreshBooks} FreshBooks * @return {Gateway} * @api public */ var Gateway = module.exports = function() { }; /** * Constructs XML requests for the API depending on method. * * @param {String} method * @param {Array} options (optional) * @param {Function} fn * @api private */ Gateway.prototype._setXML = function(method, fn) { var xml = new libxml.Document() , request = xml.node("request").attr("method", method) , options , self = this; //If second argument not a function then we have been passed the 'options' for gateway.list if("function" === typeof arguments[2]) { options = arguments[1]; fn = arguments[2]; } switch(method) { case "gateway.list": for(var key in options) { if("function" !== typeof options[key]) { request.node(key).text(options[key]); } } break; } fn(xml); }; /** * Sets Gateway properties from results of XML request. * * @param {Document} xml * @param {Function} fn * @api private */ Gateway.prototype._getXML = function(xml, fn) { var self = this , nodes = xml.get("//xmlns:gateway", this.freshbooks.ns).childNodes(); for(var x=0; x < nodes.length; x++) { if("text" !== nodes[x].name()) { switch(nodes[x].name()) { default: this[nodes[x].name()] = nodes[x].text(); break; } } } fn(); }; /** * List Gateways. * * @param {Array} options (optional) * @param {Function} fn * @api public */ Gateway.prototype.list = function(fn) { var self = this , options = []; if("function" === typeof arguments[1]) { options = arguments[0]; fn = arguments[1]; } this._setXML("gateway.list", options, function(xml) { self.freshbooks._get(xml, function(err, xml) { if(null !== err) { fn(err); } else if("ok" !== xml.get("//xmlns:response",self.freshbooks.ns).attr("status").value()) { err = xml.get("//xmlns:error",self.freshbooks.ns).text(); fn(new Error("CANNOT LIST GATEWAYS: " + err)); } else { var gateways = xml.get("//xmlns:gateways", self.freshbooks.ns) , options = { page: gateways.attr("page").value() , per_page: gateways.attr("per_page").value() , pages: gateways.attr("pages").value() , total: gateways.attr("total").value() } gateways = []; xml.find("//xmlns:gateway", self.freshbooks.ns).forEach(function(a) { var gateway = new self.freshbooks.Gateway(); xml = libxml.parseXmlString('<?xml version="1.0" encoding="UTF-8"?>' + '<response xmlns="http://www.freshbooks.com/api/" status="ok">' + a.toString() + '</response>'); gateway._getXML(xml, function() { gateways.push(gateway); }); }); fn(null, gateways, options); } }); }); };
import Ember from 'ember'; import layout from './template'; /** * @module ember-osf * @submodule components */ /** * OSF Paginator adapted from osf/website/static/js/paginator.js * * Sample usage: * ```handlebars * {{osf-paginator * totalSearchResults=totalSearchResults * fetchResults=(action 'fetchResults') * query=query}} * ``` * * The osf-paginator will be deprecated. Use pagination-pager instead. * * @class osf-paginator * @param {integer} totalSearchResults Number of total search results to be paginated * @param {action} fetchResults - action for fetching other pages of results * @param {string} query - Query needed for fetchResults action. */ export default Ember.Component.extend({ layout, currentPage: 1, init() { this._super(...arguments); Ember.deprecate('osf-paginator will be deprecated. Use pagination-pager instead', false, { id: 'osf-paginator', until: '1.0.0' }); }, pages: Ember.computed('totalSearchResults', function() { let totalSearchResults = this.get('totalSearchResults'); return Math.ceil(totalSearchResults / 10); }), paginators: Ember.computed('currentPage', 'pages', function() { let currentPage = this.get('currentPage') - 1; var MAX_PAGES_ON_PAGINATOR = 7; var MAX_PAGES_ON_PAGINATOR_SIDE = 5; var pages = this.get('pages'); var paginator = Ember.A(); if (pages > 1) { paginator.pushObject('<'); paginator.pushObject(1); } if (pages <= MAX_PAGES_ON_PAGINATOR) { for (var i = 1; i < pages - 1; i++) { paginator.pushObject(i + 1); } } else if (currentPage < MAX_PAGES_ON_PAGINATOR_SIDE - 1) { for (var j = 1; j < MAX_PAGES_ON_PAGINATOR_SIDE; j++) { paginator.pushObject(j + 1); } paginator.pushObject('...'); } else if (currentPage > pages - MAX_PAGES_ON_PAGINATOR_SIDE) { paginator.pushObject('...'); for (var k = pages - MAX_PAGES_ON_PAGINATOR_SIDE; k < pages - 1; k++) { paginator.pushObject(k + 1); } } else { paginator.pushObject('...'); for (var l = currentPage - 1; l <= currentPage + 1; l++) { paginator.pushObject(l + 1); } paginator.pushObject('...'); } paginator.push(pages); paginator.push('>'); return paginator; }), actions: { findResults(query, page) { this.attrs.fetchResults(query, page).then(() => { this.set('currentPage', page); }); }, nextPage(query) { var page = this.get('currentPage'); if (page < this.get('pages')) { this.send('findResults', query, page + 1); } }, previousPage(query) { var page = this.get('currentPage'); if (page > 1) { this.send('findResults', query, page - 1); } } } });
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * A module containing any utility functions. * @author Jorge Bay Gondra */ 'use strict'; const crypto = require('crypto'); exports.toLong = function toLong(value) { return new Long(value); }; const Long = exports.Long = function Long(value) { if (typeof value !== 'string' && typeof value !== 'number') { throw new TypeError('The value must be a string or a number'); } this.value = value.toString(); }; exports.getUuid = function getUuid() { const buffer = crypto.randomBytes(16); //clear the version buffer[6] &= 0x0f; //set the version 4 buffer[6] |= 0x40; //clear the variant buffer[8] &= 0x3f; //set the IETF variant buffer[8] |= 0x80; const hex = buffer.toString('hex'); return ( hex.substr(0, 8) + '-' + hex.substr(8, 4) + '-' + hex.substr(12, 4) + '-' + hex.substr(16, 4) + '-' + hex.substr(20, 12)); }; exports.emptyArray = Object.freeze([]); class ImmutableMap extends Map { constructor(iterable) { super(iterable); } set(){ return this; } ['delete'](){ return false; } clear() { } } exports.ImmutableMap = ImmutableMap;
//// [tsxSpreadDoesNotReportExcessProps.tsx] /// <reference path="/.lib/react16.d.ts" /> import React from "react"; class MyComponent extends React.Component<{dataSource: number[], onClick?: any}, {}> { render() { return (<div {...this.props} className="ok"></div>); } } //// [tsxSpreadDoesNotReportExcessProps.js] "use strict"; /// <reference path="react16.d.ts" /> var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; exports.__esModule = true; var react_1 = __importDefault(require("react")); var MyComponent = /** @class */ (function (_super) { __extends(MyComponent, _super); function MyComponent() { return _super !== null && _super.apply(this, arguments) || this; } MyComponent.prototype.render = function () { return (react_1["default"].createElement("div", __assign({}, this.props, { className: "ok" }))); }; return MyComponent; }(react_1["default"].Component));
EPUBJS.hooks = {}; EPUBJS.Hooks = (function(){ function hooks(){} //-- Get pre-registered hooks hooks.prototype.getHooks = function(){ var plugs; this.hooks = {}; Array.prototype.slice.call(arguments).forEach(function(arg){ this.hooks[arg] = []; }, this); for (var plugType in this.hooks) { plugs = _.values(EPUBJS.hooks[plugType]); plugs.forEach(function(hook){ this.registerHook(plugType, hook); }, this); } }; //-- Hooks allow for injecting async functions that must all complete before continuing // Functions must have a callback as their first argument. hooks.prototype.registerHook = function(type, toAdd, toFront){ if(typeof(this.hooks[type]) != "undefined"){ if(typeof(toAdd) === "function"){ if(toFront) { this.hooks[type].unshift(toAdd); }else{ this.hooks[type].push(toAdd); } }else if(Array.isArray(toAdd)){ toAdd.forEach(function(hook){ if(toFront) { this.hooks[type].unshift(hook); }else{ this.hooks[type].push(hook); } }, this); } }else{ //-- Allows for undefined hooks this.hooks[type] = [toAdd]; if(typeof(toAdd) === "function"){ this.hooks[type] = [toAdd]; }else if(Array.isArray(toAdd)){ this.hooks[type] = []; toAdd.forEach(function(hook){ this.hooks[type].push(hook); }, this); } } }; hooks.prototype.removeHook = function(type, toRemove){ var index; if(typeof(this.hooks[type]) != "undefined"){ if(typeof(toRemove) === "function"){ index = this.hooks[type].indexOf(toRemove); if (index > -1) { this.hooks[type].splice(index, 1); } }else if(Array.isArray(toRemove)){ toRemove.forEach(function(hook){ index = this.hooks[type].indexOf(hook); if (index > -1) { this.hooks[type].splice(index, 1); } }, this); } } }; hooks.prototype.triggerHooks = function(type, callback, passed){ var hooks, count; if(typeof(this.hooks[type]) == "undefined") return false; hooks = this.hooks[type]; count = hooks.length; if(count === 0 && callback) { callback(); } function countdown(){ count--; if(count <= 0 && callback) callback(); } hooks.forEach(function(hook){ hook(countdown, passed); }); }; return { register: function(name) { if(EPUBJS.hooks[name] === undefined) { EPUBJS.hooks[name] = {}; } if(typeof EPUBJS.hooks[name] !== 'object') { throw "Already registered: "+name; } return EPUBJS.hooks[name]; }, mixin: function(object) { for (var prop in hooks.prototype) { object[prop] = hooks.prototype[prop]; } } }; })();
/* * WARNING! * * Do not edit this file directly, it is built from the sources at * https://github.com/mozilla/source-map/ */ Components.utils.import('resource://test/Utils.jsm'); /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2012 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ define("test/source-map/test-api", ["require", "exports", "module"], function (require, exports, module) { var sourceMap; try { sourceMap = require('source-map'); } catch (e) { sourceMap = {}; Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); } exports['test that the api is properly exposed in the top level'] = function (assert, util) { assert.equal(typeof sourceMap.SourceMapGenerator, "function"); assert.equal(typeof sourceMap.SourceMapConsumer, "function"); assert.equal(typeof sourceMap.SourceNode, "function"); }; }); function run_test() { runSourceMapTests('test/source-map/test-api', do_throw); }
var _poolModule = require('generic-pool'); var mysqlConfig = require('../../../../shared/config/mysql'); var env = process.env.NODE_ENV || 'development'; if(mysqlConfig[env]) { mysqlConfig = mysqlConfig[env]; } /* * Create mysql connection pool. */ var createMysqlPool = function(){ return _poolModule.Pool({ name : 'mysql', create : function(callback) { var mysql = require('mysql'); var client = mysql.createConnection({ host: mysqlConfig.host, user: mysqlConfig.user, password: mysqlConfig.password, database: mysqlConfig.database }); callback(null, client); }, destroy : function(client) { client.end(); }, max : 10, idleTimeoutMillis : 30000, log : false }); }; exports.createMysqlPool = createMysqlPool;
var Webpack = require('webpack'); var WebpackDevServer = require('webpack-dev-server'); var path = require('path'); var fs = require('fs'); var webpackConfig = require(path.resolve('./', 'webpack.config.js')); var mainPath = path.resolve('./', 'src', 'index.js'); module.exports = function () { // First we fire up Webpack an pass in the configuration we // created var compiler = Webpack(webpackConfig, function (arg1, arg2) { var html if (arg2.compilation.assets) { html = arg2.compilation.assets['index.html'].source() } else { html = '<!doctype html>' } // Due to a bug with the style-loader we have to "touch" a file // to force a rebundle after the initial one. Kudos to my colleague // Stephan for this one fs.writeFile('./public/index.html', html, function(err) { if (err) { console.log(err); } }) fs.writeFileSync(mainPath, fs.readFileSync(mainPath).toString()) console.log('Project is ready!') }); var bundler = new WebpackDevServer(compiler, { // We need to tell Webpack to serve our bundled application // from the build path. When proxying: // http://localhost:3000/build -> http://localhost:8080/build publicPath: '/', // Configure hot replacement hot: true, // The rest is terminal configurations quiet: false, noInfo: true, stats: { colors: true } }); // We fire up the development server bundler.listen(8080, 'localhost', function () { console.log('Bundling project, please wait...'); }); };
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * @name: S11.13.2_A4.1_T2.3; * @section: 11.13.2, 11.5.1; * @assertion: The production x *= y is the same as the production x = x * y; * @description: Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null; */ //CHECK#1 x = 1; x *= null; if (x !== 0) { $ERROR('#1: x = 1; x *= null; x === 0. Actual: ' + (x)); } //CHECK#2 x = null; x *= 1; if (x !== 0) { $ERROR('#2: x = null; x *= 1; x === 0. Actual: ' + (x)); } //CHECK#3 x = new Number(1); x *= null; if (x !== 0) { $ERROR('#3: x = new Number(1); x *= null; x === 0. Actual: ' + (x)); } //CHECK#4 x = null; x *= new Number(1); if (x !== 0) { $ERROR('#4: x = null; x *= new Number(1); x === 0. Actual: ' + (x)); }
/*! * ui-grid - v4.6.3 - 2018-08-04 * Copyright (c) 2018 ; License: MIT */ (function () { angular.module('ui.grid').config(['$provide', function($provide) { $provide.decorator('i18nService', ['$delegate', function($delegate) { $delegate.add('ro', { headerCell: { aria: { defaultFilterLabel: 'Filtru pentru coloana', removeFilter: 'Sterge filtru', columnMenuButtonLabel: 'Column Menu' }, priority: 'Prioritate:', filterLabel: "Filtru pentru coloana:" }, aggregate: { label: 'Elemente' }, groupPanel: { description: 'Trage un cap de coloana aici pentru a grupa elementele dupa coloana respectiva' }, search: { placeholder: 'Cauta...', showingItems: 'Arata elementele:', selectedItems: 'Elementele selectate:', totalItems: 'Total elemente:', size: 'Marime pagina:', first: 'Prima pagina', next: 'Pagina urmatoare', previous: 'Pagina anterioara', last: 'Ultima pagina' }, menu: { text: 'Alege coloane:' }, sort: { ascending: 'Ordoneaza crescator', descending: 'Ordoneaza descrescator', none: 'Fara ordonare', remove: 'Sterge ordonarea' }, column: { hide: 'Ascunde coloana' }, aggregation: { count: 'total linii: ', sum: 'total: ', avg: 'medie: ', min: 'min: ', max: 'max: ' }, pinning: { pinLeft: 'Pin la stanga', pinRight: 'Pin la dreapta', unpin: 'Sterge pinul' }, columnMenu: { close: 'Inchide' }, gridMenu: { aria: { buttonLabel: 'Grid Menu' }, columns: 'Coloane:', importerTitle: 'Incarca fisier', exporterAllAsCsv: 'Exporta toate datele ca csv', exporterVisibleAsCsv: 'Exporta datele vizibile ca csv', exporterSelectedAsCsv: 'Exporta datele selectate ca csv', exporterAllAsPdf: 'Exporta toate datele ca pdf', exporterVisibleAsPdf: 'Exporta datele vizibile ca pdf', exporterSelectedAsPdf: 'Exporta datele selectate ca csv pdf', clearAllFilters: 'Sterge toate filtrele' }, importer: { noHeaders: 'Numele coloanelor nu a putut fi incarcat, acest fisier are un header?', noObjects: 'Datele nu au putut fi incarcate, exista date in fisier in afara numelor de coloane?', invalidCsv: 'Fisierul nu a putut fi procesat, ati incarcat un CSV valid ?', invalidJson: 'Fisierul nu a putut fi procesat, ati incarcat un Json valid?', jsonNotArray: 'Json-ul incarcat trebuie sa contina un array, inchidere.' }, pagination: { aria: { pageToFirst: 'Prima pagina', pageBack: 'O pagina inapoi', pageSelected: 'Pagina selectata', pageForward: 'O pagina inainte', pageToLast: 'Ultima pagina' }, sizes: 'Elemente per pagina', totalItems: 'elemente', through: 'prin', of: 'of' }, grouping: { group: 'Grupeaza', ungroup: 'Opreste gruparea', aggregate_count: 'Agg: Count', aggregate_sum: 'Agg: Sum', aggregate_max: 'Agg: Max', aggregate_min: 'Agg: Min', aggregate_avg: 'Agg: Avg', aggregate_remove: 'Agg: Remove' } }); return $delegate; }]); }]); })();
CKEDITOR.plugins.setLang('leaflet', 'de', { buttonLabel: 'Karte einfügen/bearbeiten', dialogTitle: 'Eigenschaften', locationTabLabel: 'Karte', googleSearchFieldLabel: 'Ort suchen', googleSearchFieldHint: 'Geben Sie einen Standort ein', manualCoordinatesFieldLabel: 'oder Koordinaten', manualLatitudeFieldLabel: 'Breitengrad', manualLongitudeFieldLabel: 'Längengrad', popupTextFieldLabel: 'Marker', popupTextFieldHint: 'Pop-up Text (Optional)', optionsTabLabel: 'Optionen', mapWidthFieldLabel: 'Breite', mapHeightFieldLabel: 'Höhe', mapZoomLevelFieldLabel: 'Zoom', baseMapTileLabel: 'Quelle Kartenmaterial', minimapCheckboxLabel: 'Übersichtskarte', responsiveMapCheckboxLabel: 'Responsive', });
/** * @file * Adds a summary of a details element's contents to its summary element. */ (($, Drupal) => { /** * The DetailsSummarizedContent object represents a single details element. * * @constructor Drupal.DetailsSummarizedContent * * @param {HTMLElement} node * A details element, the summary of which may have supplemental text. * The supplemental text summarizes the details element's contents. */ function DetailsSummarizedContent(node) { this.$node = $(node); this.setupSummary(); } $.extend( DetailsSummarizedContent, /** @lends Drupal.DetailsSummarizedContent */ { /** * Holds references to instantiated DetailsSummarizedContent objects. * * @type {Array.<Drupal.DetailsSummarizedContent>} */ instances: [], }, ); $.extend( DetailsSummarizedContent.prototype, /** @lends Drupal.DetailsSummarizedContent# */ { /** * Initialize and setup summary events and markup. * * @fires event:summaryUpdated * * @listens event:summaryUpdated */ setupSummary() { this.$detailsSummarizedContentWrapper = $( Drupal.theme('detailsSummarizedContentWrapper'), ); this.$node .on('summaryUpdated', $.proxy(this.onSummaryUpdated, this)) .trigger('summaryUpdated') .find('> summary') .append(this.$detailsSummarizedContentWrapper); }, /** * Update summary. */ onSummaryUpdated() { const text = this.$node.drupalGetSummary(); this.$detailsSummarizedContentWrapper.html( Drupal.theme('detailsSummarizedContentText', text), ); }, }, ); /** * Adds a summary of a details element's contents to its summary element. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches behavior for the details element. */ Drupal.behaviors.detailsSummary = { attach(context) { DetailsSummarizedContent.instances = DetailsSummarizedContent.instances.concat( once('details', 'details', context).map( (details) => new DetailsSummarizedContent(details), ), ); }, }; Drupal.DetailsSummarizedContent = DetailsSummarizedContent; /** * The element containing a wrapper for summarized details content. * * @return {string} * The markup for the element that will contain the summarized content. */ Drupal.theme.detailsSummarizedContentWrapper = () => `<span class="summary"></span>`; /** * Formats the summarized details content text. * * @param {string|null} [text] * (optional) The summarized content text displayed in the summary. * @return {string} * The formatted summarized content text. */ Drupal.theme.detailsSummarizedContentText = (text) => text ? ` (${text})` : ''; })(jQuery, Drupal);
/* * Kendo UI Web v2013.3.1119 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Web commercial licenses may be obtained at * https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. * For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html */ (function( window, undefined ) { kendo.cultures["quz-PE"] = { name: "quz-PE", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-%n","%n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["$ -n","$ n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "S/." } }, calendars: { standard: { days: { names: ["intichaw","killachaw","atipachaw","quyllurchaw","Ch\u0027 askachaw","Illapachaw","k\u0027uychichaw"], namesAbbr: ["int","kil","ati","quy","Ch\u0027","Ill","k\u0027u"], namesShort: ["d","k","a","m","h","b","k"] }, months: { names: ["Qulla puquy","Hatun puquy","Pauqar waray","ayriwa","Aymuray","Inti raymi","Anta Sitwa","Qhapaq Sitwa","Uma raymi","Kantaray","Ayamarq\u0027a","Kapaq Raymi",""], namesAbbr: ["Qul","Hat","Pau","ayr","Aym","Int","Ant","Qha","Uma","Kan","Aya","Kap",""] }, AM: ["a.m.","a.m.","A.M."], PM: ["p.m.","p.m.","P.M."], patterns: { d: "dd/MM/yyyy", D: "dddd, dd' de 'MMMM' de 'yyyy", F: "dddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt", g: "dd/MM/yyyy hh:mm tt", G: "dd/MM/yyyy hh:mm:ss tt", m: "MMMM dd", M: "MMMM dd", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "hh:mm tt", T: "hh:mm:ss tt", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM' de 'yyyy", Y: "MMMM' de 'yyyy" }, "/": "/", ":": ":", firstDay: 0 } } } })(this);
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var prefix = 'fas'; var iconName = 'medkit'; var width = 512; var height = 512; var ligatures = []; var unicode = 'f0fa'; var svgPathData = 'M96 480h320V128h-32V80c0-26.51-21.49-48-48-48H176c-26.51 0-48 21.49-48 48v48H96v352zm96-384h128v32H192V96zm320 80v256c0 26.51-21.49 48-48 48h-16V128h16c26.51 0 48 21.49 48 48zM64 480H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v352zm288-208v32c0 8.837-7.163 16-16 16h-48v48c0 8.837-7.163 16-16 16h-32c-8.837 0-16-7.163-16-16v-48h-48c-8.837 0-16-7.163-16-16v-32c0-8.837 7.163-16 16-16h48v-48c0-8.837 7.163-16 16-16h32c8.837 0 16 7.163 16 16v48h48c8.837 0 16 7.163 16 16z'; exports.definition = { prefix: prefix, iconName: iconName, icon: [ width, height, ligatures, unicode, svgPathData ]}; exports.faMedkit = exports.definition; exports.prefix = prefix; exports.iconName = iconName; exports.width = width; exports.height = height; exports.ligatures = ligatures; exports.unicode = unicode; exports.svgPathData = svgPathData;
description( 'Tests to ensure that activations mark their values correctly in the face of duplicate parameter names and does not crash.' ); function gc() { if (this.GCController) GCController.collect(); else for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objects to force a GC. ({}); } function eatRegisters(param) { if (param > 10) return; eatRegisters(param + 1); } function test(a, c) { var b = ["success"], a, c; return function() { return b[0]; } } var testClosure = test(); var extra = test(); eatRegisters(0); gc(); shouldBe('testClosure()', '"success"');
//// [parserErrorRecovery_ExtendsOrImplementsClause2.ts] class C extends A, { } //// [parserErrorRecovery_ExtendsOrImplementsClause2.js] var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var C = (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } return C; }(A));
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import resourceQuotaDetailModule from 'resourcequotadetail/resourcequotadetail_module'; describe('Resource Quota Detail Status controller', () => { /** @type {!ResourceQuotaDetailStatusController} */ let ctrl; beforeEach(() => { angular.mock.module(resourceQuotaDetailModule.name); angular.mock.inject(($componentController, $rootScope) => { ctrl = $componentController('kdResourceQuotaDetailStatus', {$scope: $rootScope}, { statusList: { 'limits.cpu': { 'used': '0', 'hard': '2222222', }, }, }); }); }); it('should initialize the ctrl', () => { expect(ctrl.statusList).toBeDefined(); }); });
// Copyright (C) 2011 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 13.1 description: > let: closure inside for loop initialization ---*/ let a = []; for (let i = 0, f = function() { return i }; i < 5; ++i) { a.push(f); } for (let k = 0; k < 5; ++k) { assert.sameValue(0, a[k]()); }
var tree = Object.create(null); tree.Node = require('./node'); tree.Color = require('./color'); tree.AtRule = require('./atrule'); tree.DetachedRuleset = require('./detached-ruleset'); tree.Operation = require('./operation'); tree.Dimension = require('./dimension'); tree.Unit = require('./unit'); tree.Keyword = require('./keyword'); tree.Variable = require('./variable'); tree.Property = require('./property'); tree.Ruleset = require('./ruleset'); tree.Element = require('./element'); tree.Attribute = require('./attribute'); tree.Combinator = require('./combinator'); tree.Selector = require('./selector'); tree.Quoted = require('./quoted'); tree.Expression = require('./expression'); tree.Declaration = require('./declaration'); tree.Call = require('./call'); tree.URL = require('./url'); tree.Import = require('./import'); tree.mixin = { Call: require('./mixin-call'), Definition: require('./mixin-definition') }; tree.Comment = require('./comment'); tree.Anonymous = require('./anonymous'); tree.Value = require('./value'); tree.JavaScript = require('./javascript'); tree.Assignment = require('./assignment'); tree.Condition = require('./condition'); tree.Paren = require('./paren'); tree.Media = require('./media'); tree.UnicodeDescriptor = require('./unicode-descriptor'); tree.Negative = require('./negative'); tree.Extend = require('./extend'); tree.VariableCall = require('./variable-call'); tree.NamespaceValue = require('./namespace-value'); module.exports = tree;
/* eslint-disable */ // Do this as the first thing so that any code reading it knows the right env. process.env.BABEL_ENV = 'development'; process.env.NODE_ENV = 'development'; // Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', (err) => { throw err; }); // Ensure environment variables are read. require('../config/env'); const fs = require('fs'); const chalk = require('chalk'); const webpack = require('webpack'); const WebpackDevServer = require('webpack-dev-server'); const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles'); const { choosePort, createCompiler, prepareProxy, prepareUrls } = require('react-dev-utils/WebpackDevServerUtils'); const openBrowser = require('react-dev-utils/openBrowser'); const paths = require('../config/paths'); const config = require('../config/webpack.config.dev'); const createDevServerConfig = require('../config/webpackDevServer.config'); const useYarn = fs.existsSync(paths.yarnLockFile); const isInteractive = process.stdout.isTTY; const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000; const HOST = process.env.HOST || '0.0.0.0'; // We attempt to use the default port but if it is busy, we offer the user to // run on a different port. `detect()` Promise resolves to the next free port. choosePort(HOST, DEFAULT_PORT) .then((port) => { if (port == null) { // We have not found a port. return; } const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; const appName = require(paths.appPackageJson).name; const urls = prepareUrls(protocol, HOST, port); // Create a webpack compiler that is configured with custom messages. const compiler = createCompiler(webpack, config, appName, urls, useYarn); // Load proxy config const proxySetting = require(paths.appPackageJson).proxy; const proxyConfig = prepareProxy(proxySetting, paths.appPublic); // Serve webpack assets generated by the compiler over a web sever. const serverConfig = createDevServerConfig( proxyConfig, urls.lanUrlForConfig ); const devServer = new WebpackDevServer(compiler, serverConfig); // Launch WebpackDevServer. devServer.listen(port, HOST, (err) => { if (err) { return console.log(err); } console.log(chalk.cyan('Starting the development server...\n')); openBrowser(urls.localUrlForBrowser); }); ['SIGINT', 'SIGTERM'].forEach((sig) => { process.on(sig, () => { devServer.close(); process.exit(); }); }); }) .catch((err) => { if (err && err.message) { console.log(err.message); } process.exit(1); });
pc.extend(pc, function () { 'use strict'; var _typeSize = []; _typeSize[pc.ELEMENTTYPE_INT8 ] = 1; _typeSize[pc.ELEMENTTYPE_UINT8 ] = 1; _typeSize[pc.ELEMENTTYPE_INT16 ] = 2; _typeSize[pc.ELEMENTTYPE_UINT16 ] = 2; _typeSize[pc.ELEMENTTYPE_INT32 ] = 4; _typeSize[pc.ELEMENTTYPE_UINT32 ] = 4; _typeSize[pc.ELEMENTTYPE_FLOAT32] = 4; /** * @name pc.VertexFormat * @class A vertex format is a descriptor that defines the layout of vertex element data inside * a pc.VertexBuffer object. * @constructor Returns a new pc.VertexFormat object. It is constructed from a description * that explicitly defines how data is to be laid out inside a vertex buffer (pc.VertexBuffer). * The description is defined as an array of elements, where each element is an object with the * following properties: * semantic: pc.SEMANTIC_. * components: the number of components used by the element. * type: (pc.ELEMENTTYPE_). * normalize: true to remap element values to a range of 0 to 1. Defaults to false. * @param {pc.GraphicsDevice} graphicsDevice The graphics device used to manage this vertex format. * @param {Array} description An array of vertex element descriptions. * @example * var vertexFormat = new pc.VertexFormat(graphicsDevice, [ * { semantic: pc.SEMANTIC_POSITION, components: 2, type: pc.ELEMENTTYPE_FLOAT32 }, * { semantic: pc.SEMANTIC_TEXCOORD0, components: 2, type: pc.ELEMENTTYPE_FLOAT32 }, * { semantic: pc.SEMANTIC_COLOR, components: 4, type: pc.ELEMENTTYPE_UINT8, normalize: true } * ]); * * @author Will Eastcott */ var VertexFormat = function (graphicsDevice, description) { var i; this.elements = []; this.hasUv1 = false; this.hasColor = false; this.size = 0; for (var i = 0, len = description.length; i < len; i++) { var elementDesc = description[i]; var element = { name: elementDesc.semantic, offset: 0, stride: 0, stream: -1, scopeId: graphicsDevice.scope.resolve(elementDesc.semantic), dataType: elementDesc.type, numComponents: elementDesc.components, normalize: (elementDesc.normalize === undefined) ? false : elementDesc.normalize, size: elementDesc.components * _typeSize[elementDesc.type] }; this.elements.push(element); this.size += element.size; if (elementDesc.semantic===pc.SEMANTIC_TEXCOORD1) { this.hasUv1 = true; } else if (elementDesc.semantic===pc.SEMANTIC_COLOR) { this.hasColor = true; } } var offset = 0; for (var i = 0, len = this.elements.length; i < len; i++) { var element = this.elements[i]; element.offset = offset; element.stride = this.size; offset += element.size; } }; return { VertexFormat: VertexFormat }; }());
const config = require('../../../../config'); const common = require('../../../../lib/common'); const imageLib = require('../../../../lib/image'); const validIconFileSize = (size) => { return (size / 1024) <= 100; }; module.exports = function blogIcon() { // we checked for a valid image file, now we need to do validations for blog icons return function blogIconValidation(req, res, next) { const iconExtensions = (config.get('uploads').icons && config.get('uploads').icons.extensions) || []; // CASE: file should not be larger than 100kb if (!validIconFileSize(req.file.size)) { return next(new common.errors.ValidationError({ message: common.i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions}) })); } return imageLib.blogIcon.getIconDimensions(req.file.path).then((response) => { // save the image dimensions in new property for file req.file.dimensions = response; // CASE: file needs to be a square if (req.file.dimensions.width !== req.file.dimensions.height) { return next(new common.errors.ValidationError({ message: common.i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions}) })); } // CASE: icon needs to be bigger than or equal to 60px // .ico files can contain multiple sizes, we need at least a minimum of 60px (16px is ok, as long as 60px are present as well) if (req.file.dimensions.width < 60) { return next(new common.errors.ValidationError({ message: common.i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions}) })); } // CASE: icon needs to be smaller than or equal to 1000px if (req.file.dimensions.width > 1000) { return next(new common.errors.ValidationError({ message: common.i18n.t('errors.api.icons.invalidFile', {extensions: iconExtensions}) })); } next(); }).catch((err) => { next(err); }); }; };
import Button from './button.vue'; import ButtonGroup from './button-group.vue'; Button.Group = ButtonGroup; export default Button;
/*Owner & Copyrights: Vance King Saxbe. A.*//* Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxbe@yahoo.com. Development teams from Power Dominion Enterprise, Precieux Consulting. Project sponsored by GoldSax Foundation, GoldSax Group and executed by GoldSax Manager.*/jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { this.suite = suite; this.dom = dom; this.views = views; this.element = this.createDom('div', { className: 'suite' }, this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description) ); this.appendToSummary(this.suite, this.element); }; jasmine.HtmlReporter.SuiteView.prototype.status = function() { return this.getSpecStatus(this.suite); }; jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { this.element.className += " " + this.status(); }; jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); /*email to provide support at vancekingsaxbe@powerdominionenterprise.com, businessaffairs@powerdominionenterprise.com, For donations please write to fundraising@powerdominionenterprise.com*/
/** Used for tracking when the user clicks on a link @class ClickTrack @namespace Discourse @module Discourse **/ Discourse.ClickTrack = { /** Track a click on a link @method trackClick @param {jQuery.Event} e The click event that occurred **/ trackClick: function(e) { var $link = $(e.currentTarget); if ($link.hasClass('lightbox')) return true; e.preventDefault(); // We don't track clicks on quote back buttons if ($link.hasClass('back') || $link.hasClass('quote-other-topic')) return true; // Remove the href, put it as a data attribute if (!$link.data('href')) { $link.addClass('no-href'); $link.data('href', $link.attr('href')); $link.attr('href', null); // Don't route to this URL $link.data('auto-route', true); } var href = $link.data('href'), $article = $link.closest('article'), postId = $article.data('post-id'), topicId = $('#topic').data('topic-id'), userId = $link.data('user-id'); if (!userId) userId = $article.data('user-id'); var ownLink = userId && (userId === Discourse.User.currentProp('id')); // Build a Redirect URL var trackingUrl = Discourse.getURL("/clicks/track?url=" + encodeURIComponent(href)); if (postId && (!$link.data('ignore-post-id'))) { trackingUrl += "&post_id=" + encodeURI(postId); } if (topicId) { trackingUrl += "&topic_id=" + encodeURI(topicId); } // Update badge clicks unless it's our own if (!ownLink) { var $badge = $('span.badge', $link); if ($badge.length === 1) { // don't update counts in category badge if ($link.closest('.badge-category').length === 0) { // nor in oneboxes (except when we force it) if ($link.closest(".onebox-result").length === 0 || $link.hasClass("track-link")) { $badge.html(parseInt($badge.html(), 10) + 1); } } } } // If they right clicked, change the destination href if (e.which === 3) { var destination = Discourse.SiteSettings.track_external_right_clicks ? trackingUrl : href; $link.attr('href', destination); return true; } // if they want to open in a new tab, do an AJAX request if (e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) { Discourse.ajax("/clicks/track", { data: { url: href, post_id: postId, topic_id: topicId, redirect: false } }); window.open(href, '_blank'); return false; } // If we're on the same site, use the router and track via AJAX if ((href.indexOf(Discourse.URL.origin()) === 0) && !href.match(/\/uploads\//i)) { Discourse.ajax("/clicks/track", { data: { url: href, post_id: postId, topic_id: topicId, redirect: false } }); Discourse.URL.routeTo(href); return false; } // Otherwise, use a custom URL with a redirect if (Discourse.User.currentProp('external_links_in_new_tab')) { var win = window.open(trackingUrl, '_blank'); win.focus(); } else { Discourse.URL.redirectTo(trackingUrl); } return false; } };
/* global html_sanitize*/ import {helper} from 'ember-helper'; import {htmlSafe} from 'ember-string'; import cajaSanitizers from 'ghost-admin/utils/caja-sanitizers'; export default helper(function (params) { if (!params || !params.length) { return; } let escapedhtml = params[0] || ''; // replace script and iFrame escapedhtml = escapedhtml.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '<pre class="js-embed-placeholder">Embedded JavaScript</pre>'); escapedhtml = escapedhtml.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, '<pre class="iframe-embed-placeholder">Embedded iFrame</pre>'); // sanitize HTML // jscs:disable requireCamelCaseOrUpperCaseIdentifiers escapedhtml = html_sanitize(escapedhtml, cajaSanitizers.url, cajaSanitizers.id); // jscs:enable requireCamelCaseOrUpperCaseIdentifiers return htmlSafe(escapedhtml); });
/** * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ ( function() { /** * Stores language-related functions. * * @class * @singleton */ CKEDITOR.lang = { /** * The list of languages available in the editor core. * * alert( CKEDITOR.lang.languages.en ); // 1 */ languages: { af: 1, ar: 1, bg: 1, bn: 1, bs: 1, ca: 1, cs: 1, cy: 1, da: 1, de: 1, el: 1, 'en-au': 1, 'en-ca': 1, 'en-gb': 1, en: 1, eo: 1, es: 1, et: 1, eu: 1, fa: 1, fi: 1, fo: 1, 'fr-ca': 1, fr: 1, gl: 1, gu: 1, he: 1, hi: 1, hr: 1, hu: 1, id: 1, is: 1, it: 1, ja: 1, ka: 1, km: 1, ko: 1, ku: 1, lt: 1, lv: 1, mk: 1, mn: 1, ms: 1, nb: 1, nl: 1, no: 1, pl: 1, 'pt-br': 1, pt: 1, ro: 1, ru: 1, si: 1, sk: 1, sl: 1, sq: 1, 'sr-latn': 1, sr: 1, sv: 1, th: 1, tr: 1, tt: 1, ug: 1, uk: 1, vi: 1, 'zh-cn': 1, zh: 1 }, /** * The list of languages that are written Right-To-Left (RTL) and are supported by the editor. */ rtl: { ar: 1, fa: 1, he: 1, ku: 1, ug: 1 }, /** * Loads a specific language file, or auto detects it. A callback is * then called when the file gets loaded. * * @param {String} languageCode The code of the language file to be * loaded. If null or empty, autodetection will be performed. The * same happens if the language is not supported. * @param {String} defaultLanguage The language to be used if * `languageCode` is not supported or if the autodetection fails. * @param {Function} callback A function to be called once the * language file is loaded. Two parameters are passed to this * function: the language code and the loaded language entries. */ load: function( languageCode, defaultLanguage, callback ) { // If no languageCode - fallback to browser or default. // If languageCode - fallback to no-localized version or default. if ( !languageCode || !CKEDITOR.lang.languages[ languageCode ] ) languageCode = this.detect( defaultLanguage, languageCode ); var that = this, loadedCallback = function() { that[ languageCode ].dir = that.rtl[ languageCode ] ? 'rtl' : 'ltr'; callback( languageCode, that[ languageCode ] ); }; if ( !this[ languageCode ] ) CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( 'lang/' + languageCode + '.js' ), loadedCallback, this ); else loadedCallback(); }, /** * Returns the language that best fits the user language. For example, * suppose that the user language is "pt-br". If this language is * supported by the editor, it is returned. Otherwise, if only "pt" is * supported, it is returned instead. If none of the previous are * supported, a default language is then returned. * * alert( CKEDITOR.lang.detect( 'en' ) ); // e.g., in a German browser: 'de' * * @param {String} defaultLanguage The default language to be returned * if the user language is not supported. * @param {String} [probeLanguage] A language code to try to use, * instead of the browser-based autodetection. * @returns {String} The detected language code. */ detect: function( defaultLanguage, probeLanguage ) { var languages = this.languages; probeLanguage = probeLanguage || navigator.userLanguage || navigator.language || defaultLanguage; var parts = probeLanguage.toLowerCase().match( /([a-z]+)(?:-([a-z]+))?/ ), lang = parts[ 1 ], locale = parts[ 2 ]; if ( languages[ lang + '-' + locale ] ) lang = lang + '-' + locale; else if ( !languages[ lang ] ) lang = null; CKEDITOR.lang.detect = lang ? function() { return lang; } : function( defaultLanguage ) { return defaultLanguage; }; return lang || defaultLanguage; } }; } )();
/* * Copyright 2019 Adobe * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(window, document, $, Granite) { "use strict"; var ui = $(window).adaptTo("foundation-ui"); $(window).adaptTo("foundation-registry").register("foundation.collection.action.action", { name: "acscommons.clientlib.delete", handler: function(name, el, config, collection, selections) { var message = $("<div/>"); var intro = $("<p/>").appendTo(message); intro.text(Granite.I18n.get("You are going to delete the selected item")); ui.prompt(Granite.I18n.get("Delete"), message.html(), "notice", [{ text: Granite.I18n.get("Cancel") }, { text: Granite.I18n.get("Delete"), warning: true, handler: function() { doDelete(config.data.path); } }]); } }); function doDelete(path) { ui.wait(); $.ajax({ url: path, type: "POST", data: { _charset_: "UTF-8", ":operation": "delete" } }).done(function(data, textStatus, jqXHR) { window.location.reload(); }).fail(function(jqXHR, textStatus, errorThrown) { var message = Granite.I18n.getVar($(jqXHR.responseText).find(".foundation-form-response-description").next().html()); ui.alert(Granite.I18n.get("Error"), message, "error"); }).always(function() { ui.clearWait(); }); } })(window, document, Granite.$, Granite);
'use strict'; const isFullwidthCodePoint = require('is-fullwidth-code-point'); const astralRegex = require('astral-regex'); const ansiStyles = require('ansi-styles'); const ESCAPES = [ '\u001B', '\u009B' ]; const wrapAnsi = code => `${ESCAPES[0]}[${code}m`; const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => { let output = []; ansiCodes = [...ansiCodes]; for (let ansiCode of ansiCodes) { const ansiCodeOrigin = ansiCode; if (ansiCode.includes(';')) { ansiCode = ansiCode.split(';')[0][0] + '0'; } const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10)); if (item) { const indexEscape = ansiCodes.indexOf(item.toString()); if (indexEscape === -1) { output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin)); } else { ansiCodes.splice(indexEscape, 1); } } else if (isEscapes) { output.push(wrapAnsi(0)); break; } else { output.push(wrapAnsi(ansiCodeOrigin)); } } if (isEscapes) { output = output.filter((element, index) => output.indexOf(element) === index); if (endAnsiCode !== undefined) { const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10))); output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []); } } return output.join(''); }; module.exports = (string, begin, end) => { const characters = [...string]; const ansiCodes = []; let stringEnd = typeof end === 'number' ? end : characters.length; let isInsideEscape = false; let ansiCode; let visible = 0; let output = ''; for (const [index, character] of characters.entries()) { let leftEscape = false; if (ESCAPES.includes(character)) { const code = /\d[^m]*/.exec(string.slice(index, index + 18)); ansiCode = code && code.length > 0 ? code[0] : undefined; if (visible < stringEnd) { isInsideEscape = true; if (ansiCode !== undefined) { ansiCodes.push(ansiCode); } } } else if (isInsideEscape && character === 'm') { isInsideEscape = false; leftEscape = true; } if (!isInsideEscape && !leftEscape) { visible++; } if (!astralRegex({exact: true}).test(character) && isFullwidthCodePoint(character.codePointAt())) { visible++; if (typeof end !== 'number') { stringEnd++; } } if (visible > begin && visible <= stringEnd) { output += character; } else if (visible === begin && !isInsideEscape && ansiCode !== undefined) { output = checkAnsi(ansiCodes); } else if (visible >= stringEnd) { output += checkAnsi(ansiCodes, true, ansiCode); break; } } return output; };
/** * Copyright 2015, GeoSolutions Sas. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ const CHANGE_HELP_STATE = 'CHANGE_HELP_STATE'; const CHANGE_HELP_TEXT = 'CHANGE_HELP_TEXT'; const CHANGE_HELPWIN_VIZ = 'CHANGE_HELPWIN_VIZ'; function changeHelpState(enabled) { return { type: CHANGE_HELP_STATE, enabled: enabled }; } function changeHelpText(helpText) { return { type: CHANGE_HELP_TEXT, helpText: helpText }; } function changeHelpwinVisibility(helpwinViz) { return { type: CHANGE_HELPWIN_VIZ, helpwinViz: helpwinViz }; } module.exports = { CHANGE_HELP_STATE, CHANGE_HELP_TEXT, CHANGE_HELPWIN_VIZ, changeHelpState, changeHelpText, changeHelpwinVisibility };
"use strict"; module.exports = exports = testbinary; exports.usage = 'Tests that the binary.node can be required'; var fs = require('fs'); var path = require('path'); var log = require('npmlog'); var cp = require('child_process'); var versioning = require('./util/versioning.js'); var path = require('path'); function testbinary(gyp, argv, callback) { var args = []; var options = {}; var shell_cmd = process.execPath; var package_json = JSON.parse(fs.readFileSync('./package.json')); var opts = versioning.evaluate(package_json, gyp.opts); // ensure on windows that / are used for require path var binary_module = opts.module.replace(/\\/g, '/'); var nw = (opts.runtime && opts.runtime === 'node-webkit'); if ((process.arch != opts.target_arch) || (process.platform != opts.target_platform)) { var msg = "skipping validation since host platform/arch ("; msg += process.platform+'/'+process.arch+")"; msg += " does not match target ("; msg += opts.target_platform+'/'+opts.target_arch+")"; log.info('validate', msg); return callback(); } if (nw) { options.timeout = 5000; if (process.platform === 'darwin') { shell_cmd = 'node-webkit'; } else if (process.platform === 'win32') { shell_cmd = 'nw.exe'; } else { shell_cmd = 'nw'; } var modulePath = path.resolve(binary_module); var appDir = path.join(__dirname, 'util', 'nw-pre-gyp'); args.push(appDir); args.push(modulePath); log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'"); cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) { // check for normal timeout for node-webkit if (err) { if (err.killed === true && err.signal && err.signal.indexOf('SIG') > -1) { return callback(); } var stderrLog = stderr.toString(); log.info('stderr', stderrLog); if( /^\s*Xlib:\s*extension\s*"RANDR"\s*missing\s*on\s*display\s*":\d+\.\d+"\.\s*$/.test(stderrLog) ){ log.info('RANDR', 'stderr contains only RANDR error, ignored'); return callback(); } return callback(err); } return callback(); }); return; } args.push('--eval'); args.push("'require(\\'" + binary_module.replace(/\'/g, '\\\'') +"\\')'"); log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'"); cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) { if (err) { return callback(err, { stdout:stdout, stderr:stderr}); } return callback(); }); }
RocketChat.Migrations.add({ version: 82, up: function() { const admins = RocketChat.authz.getUsersInRole('admin').fetch(); if (admins.length === 1 && admins[0]._id === 'rocket.cat') { RocketChat.authz.removeUserFromRoles('rocket.cat', 'admin'); } } });
app.constant('bunkerConstants', { editWindowMilliseconds: 60000 });
'use strict'; var React = require('react/addons'); var PureRenderMixin = React.addons.PureRenderMixin; var SvgIcon = require('../../svg-icon'); var ContentFilterList = React.createClass({ displayName: 'ContentFilterList', mixins: [PureRenderMixin], render: function render() { return React.createElement( SvgIcon, this.props, React.createElement('path', { d: 'M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z' }) ); } }); module.exports = ContentFilterList;
'use strict'; var ember = require('../../../lib/helpers/ember'); var expect = require('chai').expect; describe('Unit: ember helper', function () { it('returns a value', function () { expect(ember).to.be.ok; // eslint-disable-line no-unused-expressions }); it('returns local ember by default', function () { expect(ember).to.match(/sane[\/\\]*node_modules[\/\\]*\.bin[\/\\]*ember(.cmd)?$/); }); });
'use strict'; var React = require('react/addons'); var PureRenderMixin = React.addons.PureRenderMixin; var SvgIcon = require('../../svg-icon'); var ActionHelp = React.createClass({ displayName: 'ActionHelp', mixins: [PureRenderMixin], render: function render() { return React.createElement( SvgIcon, this.props, React.createElement('path', { d: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z' }) ); } }); module.exports = ActionHelp;
"use strict"; define(['index'], function(index) { describe('Flight distributed as a single file', function() { it('exports flight as a global', function() { expect(flight).toBeDefined(); }); it('contains the same members as index module', function() { var indexKeys = Object.keys(index); expect(Object.keys(flight).length).toBe(indexKeys.length); indexKeys.forEach(function(key) { expect(typeof flight[key]).toBe(typeof index[key]); }); }); }); });
'use strict'; var validationConstants = require('../../validationConstants'), imageValidation = require('../../validationUtils/imageValidation'); module.exports = function (manifestContent, callback) { var description = 'It is recommended to provide icon sizes for multiple platforms, including: 16x16, 32x32, 48x48, 64x64, 90x90, 128x128 and 256x256', platform = validationConstants.platforms.firefox, level = validationConstants.levels.suggestion, requiredIconSizes = ['16x16', '32x32', '48x48', '64x64', '90x90', '128x128','256x256']; imageValidation(manifestContent, description, platform, level, requiredIconSizes, callback); };
/* * * * (c) 2010-2021 Highsoft AS * * License: www.highcharts.com/license * * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! * * */ 'use strict'; /* * * * Namespace * * */ var GeometryUtilities; (function (GeometryUtilities) { /* * * * Functions * * */ /** * Calculates the center between a list of points. * * @private * * @param {Array<Highcharts.PositionObject>} points * A list of points to calculate the center of. * * @return {Highcharts.PositionObject} * Calculated center */ function getCenterOfPoints(points) { var sum = points.reduce(function (sum, point) { sum.x += point.x; sum.y += point.y; return sum; }, { x: 0, y: 0 }); return { x: sum.x / points.length, y: sum.y / points.length }; } GeometryUtilities.getCenterOfPoints = getCenterOfPoints; /** * Calculates the distance between two points based on their x and y * coordinates. * * @private * * @param {Highcharts.PositionObject} p1 * The x and y coordinates of the first point. * * @param {Highcharts.PositionObject} p2 * The x and y coordinates of the second point. * * @return {number} * Returns the distance between the points. */ function getDistanceBetweenPoints(p1, p2) { return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); } GeometryUtilities.getDistanceBetweenPoints = getDistanceBetweenPoints; /** * Calculates the angle between two points. * @todo add unit tests. * @private * @param {Highcharts.PositionObject} p1 The first point. * @param {Highcharts.PositionObject} p2 The second point. * @return {number} Returns the angle in radians. */ function getAngleBetweenPoints(p1, p2) { return Math.atan2(p2.x - p1.x, p2.y - p1.y); } GeometryUtilities.getAngleBetweenPoints = getAngleBetweenPoints; })(GeometryUtilities || (GeometryUtilities = {})); /* * * * Default Export * * */ export default GeometryUtilities;
// MooTools: the javascript framework. // Load this file's selection again by visiting: http://mootools.net/more/98f0420495fa7ed52fb3dc6d680108a9 // Or build this file again with packager using: packager build More/Hash More/Hash.Extras /* --- script: More.js name: More description: MooTools More license: MIT-style license authors: - Guillermo Rauch - Thomas Aylott - Scott Kyle - Arian Stolwijk - Tim Wienk - Christoph Pojer - Aaron Newton - Jacob Thornton requires: - Core/MooTools provides: [MooTools.More] ... */ MooTools.More = { 'version': '1.4.0.1', 'build': 'a4244edf2aa97ac8a196fc96082dd35af1abab87' }; /* --- name: Hash description: Contains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects. license: MIT-style license. requires: - Core/Object - /MooTools.More provides: [Hash] ... */ (function(){ if (this.Hash) return; var Hash = this.Hash = new Type('Hash', function(object){ if (typeOf(object) == 'hash') object = Object.clone(object.getClean()); for (var key in object) this[key] = object[key]; return this; }); this.$H = function(object){ return new Hash(object); }; Hash.implement({ forEach: function(fn, bind){ Object.forEach(this, fn, bind); }, getClean: function(){ var clean = {}; for (var key in this){ if (this.hasOwnProperty(key)) clean[key] = this[key]; } return clean; }, getLength: function(){ var length = 0; for (var key in this){ if (this.hasOwnProperty(key)) length++; } return length; } }); Hash.alias('each', 'forEach'); Hash.implement({ has: Object.prototype.hasOwnProperty, keyOf: function(value){ return Object.keyOf(this, value); }, hasValue: function(value){ return Object.contains(this, value); }, extend: function(properties){ Hash.each(properties || {}, function(value, key){ Hash.set(this, key, value); }, this); return this; }, combine: function(properties){ Hash.each(properties || {}, function(value, key){ Hash.include(this, key, value); }, this); return this; }, erase: function(key){ if (this.hasOwnProperty(key)) delete this[key]; return this; }, get: function(key){ return (this.hasOwnProperty(key)) ? this[key] : null; }, set: function(key, value){ if (!this[key] || this.hasOwnProperty(key)) this[key] = value; return this; }, empty: function(){ Hash.each(this, function(value, key){ delete this[key]; }, this); return this; }, include: function(key, value){ if (this[key] == undefined) this[key] = value; return this; }, map: function(fn, bind){ return new Hash(Object.map(this, fn, bind)); }, filter: function(fn, bind){ return new Hash(Object.filter(this, fn, bind)); }, every: function(fn, bind){ return Object.every(this, fn, bind); }, some: function(fn, bind){ return Object.some(this, fn, bind); }, getKeys: function(){ return Object.keys(this); }, getValues: function(){ return Object.values(this); }, toQueryString: function(base){ return Object.toQueryString(this, base); } }); Hash.alias({indexOf: 'keyOf', contains: 'hasValue'}); })(); /* --- script: Object.Extras.js name: Object.Extras description: Extra Object generics, like getFromPath which allows a path notation to child elements. license: MIT-style license authors: - Aaron Newton requires: - Core/Object - /MooTools.More provides: [Object.Extras] ... */ (function(){ var defined = function(value){ return value != null; }; var hasOwnProperty = Object.prototype.hasOwnProperty; Object.extend({ getFromPath: function(source, parts){ if (typeof parts == 'string') parts = parts.split('.'); for (var i = 0, l = parts.length; i < l; i++){ if (hasOwnProperty.call(source, parts[i])) source = source[parts[i]]; else return null; } return source; }, cleanValues: function(object, method){ method = method || defined; for (var key in object) if (!method(object[key])){ delete object[key]; } return object; }, erase: function(object, key){ if (hasOwnProperty.call(object, key)) delete object[key]; return object; }, run: function(object){ var args = Array.slice(arguments, 1); for (var key in object) if (object[key].apply){ object[key].apply(object, args); } return object; } }); })(); /* --- script: Hash.Extras.js name: Hash.Extras description: Extends the Hash Type to include getFromPath which allows a path notation to child elements. license: MIT-style license authors: - Aaron Newton requires: - /Hash - /Object.Extras provides: [Hash.Extras] ... */ Hash.implement({ getFromPath: function(notation){ return Object.getFromPath(this, notation); }, cleanValues: function(method){ return new Hash(Object.cleanValues(this, method)); }, run: function(){ Object.run(arguments); } });
import Component from 'ember-component'; export default Component.extend({ tagName: 'h2', classNames: ['view-title'], actions: { openMobileMenu() { this.sendAction('openMobileMenu'); } } });
// test for nested constructors function A(x) { this.a = x; } function B() { this.b = 42; } var r = new A(new B()); result = r.a.b == 42;
/** * @author alteredq / http://alteredqualia.com/ * * Depth-of-field shader with bokeh * ported from GLSL shader by Martins Upitis * http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html */ THREE.BokehShader = { uniforms: { "tColor": { type: "t", value: null }, "tDepth": { type: "t", value: null }, "focus": { type: "f", value: 1.0 }, "aspect": { type: "f", value: 1.0 }, "aperture": { type: "f", value: 0.025 }, "maxblur": { type: "f", value: 1.0 } }, vertexShader: [ "varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}" ].join("\n"), fragmentShader: [ "varying vec2 vUv;", "uniform sampler2D tColor;", "uniform sampler2D tDepth;", "uniform float maxblur;", // max blur amount "uniform float aperture;", // aperture - bigger values for shallower depth of field "uniform float focus;", "uniform float aspect;", "void main() {", "vec2 aspectcorrect = vec2( 1.0, aspect );", "vec4 depth1 = texture2D( tDepth, vUv );", "float factor = depth1.x - focus;", "vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );", "vec2 dofblur9 = dofblur * 0.9;", "vec2 dofblur7 = dofblur * 0.7;", "vec2 dofblur4 = dofblur * 0.4;", "vec4 col = vec4( 0.0 );", "col += texture2D( tColor, vUv.xy );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );", "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );", "gl_FragColor = col / 41.0;", "gl_FragColor.a = 1.0;", "}" ].join("\n") };
module.exports = isPromise; module.exports.default = isPromise; function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; }
"use strict"; var _toolsProtectJs2 = require("./../tools/protect.js"); var _toolsProtectJs3 = _interopRequireDefault(_toolsProtectJs2); exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } var _normalizeAst = require("./normalize-ast"); var _normalizeAst2 = _interopRequireDefault(_normalizeAst); var _estraverse = require("estraverse"); var _estraverse2 = _interopRequireDefault(_estraverse); var _acorn = require("../../acorn"); var acorn = _interopRequireWildcard(_acorn); _toolsProtectJs3["default"](module); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } exports["default"] = function (code) { var opts = arguments[1] === undefined ? {} : arguments[1]; var commentsAndTokens = []; var comments = []; var tokens = []; var parseOpts = { allowImportExportEverywhere: opts.looseModules, allowReturnOutsideFunction: opts.looseModules, allowHashBang: true, ecmaVersion: 6, strictMode: opts.strictMode, sourceType: opts.sourceType, locations: true, features: opts.features || {}, plugins: opts.plugins || {}, onToken: tokens, ranges: true }; parseOpts.onToken = function (token) { tokens.push(token); commentsAndTokens.push(token); }; parseOpts.onComment = function (block, text, start, end, startLoc, endLoc) { var comment = { type: block ? "CommentBlock" : "CommentLine", value: text, start: start, end: end, loc: new acorn.SourceLocation(this, startLoc, endLoc), range: [start, end] }; commentsAndTokens.push(comment); comments.push(comment); }; if (opts.nonStandard) { parseOpts.plugins.jsx = true; parseOpts.plugins.flow = true; } var ast = acorn.parse(code, parseOpts); _estraverse2["default"].attachComments(ast, comments, tokens); ast = _normalizeAst2["default"](ast, comments, commentsAndTokens); return ast; }; module.exports = exports["default"];
describe('taBind.sanitize', function () { 'use strict'; beforeEach(module('textAngular')); afterEach(inject(function($document){ $document.find('body').html(''); })); var $rootScope; describe('should use taSanitize to', function () { var $rootScope, element; beforeEach(inject(function (_$compile_, _$rootScope_) { $rootScope = _$rootScope_; $rootScope.html = '<p>Test Contents</p>'; element = _$compile_('<div ta-bind contenteditable="contenteditable" ng-model="html"></div>')($rootScope); $rootScope.$digest(); })); it('parse from change events', function () { element.append('<bad-tag>Test 2 Content</bad-tag>'); $rootScope.updateTaBind(); $rootScope.$digest(); expect($rootScope.html).toBe('<p>Test Contents</p><p>Test 2 Content</p>'); }); it('format from model change', function () { $rootScope.html += '<bad-tag>Test 2 Content</bad-tag>'; $rootScope.$digest(); expect(element.html()).toBe('<p>Test Contents</p><p>Test 2 Content</p>'); }); }); describe('should respect taUnsafeSanitizer attribute', function () { var $rootScope, element; beforeEach(inject(function (_$compile_, _$rootScope_) { $rootScope = _$rootScope_; $rootScope.html = '<p>Test Contents</p>'; element = _$compile_('<div ta-bind contenteditable="contenteditable" ta-unsafe-sanitizer="true" ng-model="html"></div>')($rootScope); $rootScope.$digest(); })); it('allow bad tags', function () { element.append('<bad-tag>Test 2 Content</bad-tag>'); $rootScope.updateTaBind(); $rootScope.$digest(); expect($rootScope.html).toBe('<p>Test Contents</p><p><bad-tag>Test 2 Content</bad-tag></p>'); }); it('not allow malformed html', function () { element.append('<bad-tag Test 2 Content</bad-tag>'); $rootScope.updateTaBind(); $rootScope.$digest(); expect($rootScope.html).toBe('<p>Test Contents</p>'); }); }); });
var $ = jQuery.noConflict(); function safelog(data) {if(console){console.log(data)}} /** * @param link * @return the jQuery selector to use in finding the checkboxes we are attempting to manipulate */ function find_matching_checkboxes(link) { var module = $(link) .parent('td') .parent('tr') .children('td.module_name') .attr('id'); safelog('module name to modify: '+module); var ctd = $(link).parent('td'); // get the index of the current column var col_index = $('tr.'+module+' td').index(ctd); col_index++; return 'td.'+module+':nth-child('+col_index+') input:checkbox'; } $(document).ready(function(){ // get number of columns we will need to manipulate & add // select / unselect options for each module header row var roles = $('#permissions > thead > tr > th.checkbox'); var role_count = roles.size(); // take off the stupid colspan from the module header row, because we // will be matching up to the other rows perfectly now $('td.module').removeAttr('colspan'); // needed to add in a defining class or id to the parent TR in // order to have a reference to grab a proper index for the links // being clicked. $('td.module').each(function(){ var module_id = $(this).attr('id'); $(this) .parent('tr') .addClass(module_id+' module_parent') .attr('rel', module_id); }); // cycle how many roles we have and insert that many columns worth of // select / deselect options $(roles).each(function(){ $('td.module') .after('<td class="pselect"><a href="#" class="check">check all</a>&nbsp;/&nbsp;<a href="#" class="uncheck">uncheck all</a></td>'); }); // give the new boxes the module class to preserve styling of the row $('td.pselect').addClass('module'); // clicky $('a.check').click(function(){ var check_it = find_matching_checkboxes(this); safelog(check_it); $(check_it).attr('checked', true); return false; }); $('a.uncheck').click(function(){ var uncheck_it = find_matching_checkboxes(this); $(uncheck_it).attr('checked', false); return false; }); $('a.rcheck').click(function(){ var check_it = $(this).parent('li').children('span.role').attr('id'); $('td.'+check_it+' input:checkbox').attr('checked', true); return false; }); $('a.runcheck').click(function(){ var check_it = $(this).parent('li').children('span.role').attr('id'); $('td.'+check_it+' input:checkbox').attr('checked', false); return false; }); });
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ gadgets.i18n = gadgets.i18n || {}; gadgets.i18n.DateTimeConstants = { ERAS: ['\u0642.\u0645', '\u0645'], ERANAMES: ['\u0642\u0628\u0644 \u0627\u0644\u0645\u064a\u0644\u0627\u062f', '\u0645\u064a\u0644\u0627\u062f\u064a'], NARROWMONTHS: ['\u064a', '\u0641', '\u0645', '\u0623', '\u0648', '\u0646', '\u0644', '\u063a', '\u0633', '\u0643', '\u0628', '\u062f'], MONTHS: ['\u064a\u0646\u0627\u064a\u0631', '\u0641\u0628\u0631\u0627\u064a\u0631', '\u0645\u0627\u0631\u0633', '\u0623\u0628\u0631\u064a\u0644', '\u0645\u0627\u064a\u0648', '\u064a\u0648\u0646\u064a\u0648', '\u064a\u0648\u0644\u064a\u0648', '\u0623\u063a\u0633\u0637\u0633', '\u0633\u0628\u062a\u0645\u0628\u0631', '\u0623\u0643\u062a\u0648\u0628\u0631', '\u0646\u0648\u0641\u0645\u0628\u0631', '\u062f\u064a\u0633\u0645\u0628\u0631'], SHORTMONTHS: ['\u064a\u0646\u0627\u064a\u0631', '\u0641\u0628\u0631\u0627\u064a\u0631', '\u0645\u0627\u0631\u0633', '\u0623\u0628\u0631\u064a\u0644', '\u0645\u0627\u064a\u0648', '\u064a\u0648\u0646\u064a\u0648', '\u064a\u0648\u0644\u064a\u0648', '\u0623\u063a\u0633\u0637\u0633', '\u0633\u0628\u062a\u0645\u0628\u0631', '\u0623\u0643\u062a\u0648\u0628\u0631', '\u0646\u0648\u0641\u0645\u0628\u0631', '\u062f\u064a\u0633\u0645\u0628\u0631'], WEEKDAYS: ['\u0627\u0644\u0623\u062d\u062f', '\u0627\u0644\u0625\u062b\u0646\u064a\u0646', '\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621', '\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621', '\u0627\u0644\u062e\u0645\u064a\u0633', '\u0627\u0644\u062c\u0645\u0639\u0629', '\u0627\u0644\u0633\u0628\u062a'], SHORTWEEKDAYS: ['\u0627\u0644\u0623\u062d\u062f', '\u0627\u0644\u0627\u062b\u0646\u064a\u0646', '\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621', '\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621', '\u0627\u0644\u062e\u0645\u064a\u0633', '\u0627\u0644\u062c\u0645\u0639\u0629', '\u0627\u0644\u0633\u0628\u062a'], NARROWWEEKDAYS: ['\u062d', '\u0646', '\u062b', '\u0631', '\u062e', '\u062c', '\u0633'], SHORTQUARTERS: ['\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u0623\u0648\u0644', '\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u062b\u0627\u0646\u064a', '\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u062b\u0627\u0644\u062b', '\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u0631\u0627\u0628\u0639'], QUARTERS: ['\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u0623\u0648\u0644', '\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u062b\u0627\u0646\u064a', '\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u062b\u0627\u0644\u062b', '\u0627\u0644\u0631\u0628\u0639 \u0627\u0644\u0631\u0627\u0628\u0639'], AMPMS: ['\u0635', '\u0645'], DATEFORMATS: ['EEEE\u060c d MMMM\u060c y', 'd MMMM\u060c y', 'dd\u200f/MM\u200f/yyyy', 'd\u200f/M\u200f/yyyy'], TIMEFORMATS: ['zzzz h:mm:ss a', 'z h:mm:ss a', 'h:mm:ss a', 'h:mm a'], FIRSTDAYOFWEEK: 5, WEEKENDRANGE: [4, 5], FIRSTWEEKCUTOFFDAY: 1 }; gadgets.i18n.DateTimeConstants.STANDALONENARROWMONTHS = gadgets.i18n.DateTimeConstants.NARROWMONTHS; gadgets.i18n.DateTimeConstants.STANDALONEMONTHS = gadgets.i18n.DateTimeConstants.MONTHS; gadgets.i18n.DateTimeConstants.STANDALONESHORTMONTHS = gadgets.i18n.DateTimeConstants.SHORTMONTHS; gadgets.i18n.DateTimeConstants.STANDALONEWEEKDAYS = gadgets.i18n.DateTimeConstants.WEEKDAYS; gadgets.i18n.DateTimeConstants.STANDALONESHORTWEEKDAYS = gadgets.i18n.DateTimeConstants.SHORTWEEKDAYS; gadgets.i18n.DateTimeConstants.STANDALONENARROWWEEKDAYS = gadgets.i18n.DateTimeConstants.NARROWWEEKDAYS;
/* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'preview', 'th', { preview: 'ดูหน้าเอกสารตัวอย่าง' } );
/** * @author mrdoob / http://mrdoob.com/ */ THREE.Line = function ( geometry, material, mode ) { if ( mode === 1 ) { console.warn( 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.' ); return new THREE.LineSegments( geometry, material ); } THREE.Object3D.call( this ); this.type = 'Line'; this.geometry = geometry !== undefined ? geometry : new THREE.Geometry(); this.material = material !== undefined ? material : new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff } ); }; THREE.Line.prototype = Object.create( THREE.Object3D.prototype ); THREE.Line.prototype.constructor = THREE.Line; THREE.Line.prototype.raycast = ( function () { var inverseMatrix = new THREE.Matrix4(); var ray = new THREE.Ray(); var sphere = new THREE.Sphere(); return function raycast( raycaster, intersects ) { var precision = raycaster.linePrecision; var precisionSq = precision * precision; var geometry = this.geometry; var matrixWorld = this.matrixWorld; // Checking boundingSphere distance to ray if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); sphere.copy( geometry.boundingSphere ); sphere.applyMatrix4( matrixWorld ); if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; // inverseMatrix.getInverse( matrixWorld ); ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); var vStart = new THREE.Vector3(); var vEnd = new THREE.Vector3(); var interSegment = new THREE.Vector3(); var interRay = new THREE.Vector3(); var step = this instanceof THREE.LineSegments ? 2 : 1; if ( geometry instanceof THREE.BufferGeometry ) { var index = geometry.index; var attributes = geometry.attributes; var positions = attributes.position.array; if ( index !== null ) { var indices = index.array; for ( var i = 0, l = indices.length - 1; i < l; i += step ) { var a = indices[ i ]; var b = indices[ i + 1 ]; vStart.fromArray( positions, a * 3 ); vEnd.fromArray( positions, b * 3 ); var distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); if ( distSq > precisionSq ) continue; interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation var distance = raycaster.ray.origin.distanceTo( interRay ); if ( distance < raycaster.near || distance > raycaster.far ) continue; intersects.push( { distance: distance, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: interSegment.clone().applyMatrix4( this.matrixWorld ), index: i, face: null, faceIndex: null, object: this } ); } } else { for ( var i = 0, l = positions.length / 3 - 1; i < l; i += step ) { vStart.fromArray( positions, 3 * i ); vEnd.fromArray( positions, 3 * i + 3 ); var distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); if ( distSq > precisionSq ) continue; interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation var distance = raycaster.ray.origin.distanceTo( interRay ); if ( distance < raycaster.near || distance > raycaster.far ) continue; intersects.push( { distance: distance, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: interSegment.clone().applyMatrix4( this.matrixWorld ), index: i, face: null, faceIndex: null, object: this } ); } } } else if ( geometry instanceof THREE.Geometry ) { var vertices = geometry.vertices; var nbVertices = vertices.length; for ( var i = 0; i < nbVertices - 1; i += step ) { var distSq = ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment ); if ( distSq > precisionSq ) continue; interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation var distance = raycaster.ray.origin.distanceTo( interRay ); if ( distance < raycaster.near || distance > raycaster.far ) continue; intersects.push( { distance: distance, // What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point: interSegment.clone().applyMatrix4( this.matrixWorld ), index: i, face: null, faceIndex: null, object: this } ); } } }; }() ); THREE.Line.prototype.clone = function () { return new this.constructor( this.geometry, this.material ).copy( this ); }; // DEPRECATED THREE.LineStrip = 0; THREE.LinePieces = 1;
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. // OffscreenCanvas test in a worker:2d.imageData.object.nan // Description:ImageData.data converts NaN to 0 // Note: importScripts("/resources/testharness.js"); importScripts("/html/canvas/resources/canvas-tests.js"); var t = async_test("ImageData.data converts NaN to 0"); var t_pass = t.done.bind(t); var t_fail = t.step_func(function(reason) { throw reason; }); t.step(function() { var offscreenCanvas = new OffscreenCanvas(100, 50); var ctx = offscreenCanvas.getContext('2d'); var imgdata = ctx.getImageData(0, 0, 10, 10); imgdata.data[0] = 100; imgdata.data[0] = NaN; _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); imgdata.data[0] = 100; imgdata.data[0] = "cheese"; _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); t.done(); }); done();
var Redux = require('redux'), appReducer = require('./reducers/app'), clientStorage = require('itsa-redux-clientstorage'), store, createStore; createStore = function(initialState) { var state; if (!store) { state = clientStorage.readStateFromClientStorage(initialState); store = Redux.createStore(appReducer, state); clientStorage.watch(store); } return store; }; module.exports = { createStore: createStore, getState: createStore().getState, dispatch: createStore().dispatch, subscribe: createStore().subscribe, replaceReducer: createStore().replaceReducer };
import History from './History'; import { getWindowScrollPosition } from './DOMUtils'; /** * A history interface that assumes a DOM environment. */ class DOMHistory extends History { constructor(options={}) { super(options); this.getScrollPosition = options.getScrollPosition || getWindowScrollPosition; } go(n) { if (n === 0) return; window.history.go(n); } } export default DOMHistory;
function MacroPickerController($scope, entityResource, macroResource, umbPropEditorHelper, macroService, formHelper, localizationService) { if(!$scope.model.title) { $scope.model.title = localizationService.localize("defaultdialogs_selectMacro"); } $scope.macros = []; $scope.model.selectedMacro = null; $scope.wizardStep = "macroSelect"; $scope.model.macroParams = []; $scope.noMacroParams = false; $scope.changeMacro = function() { if ($scope.wizardStep === "macroSelect") { editParams(); } else { submitForm(); } }; /** changes the view to edit the params of the selected macro */ function editParams() { //get the macro params if there are any macroResource.getMacroParameters($scope.model.selectedMacro.id) .then(function (data) { //go to next page if there are params otherwise we can just exit if (!angular.isArray(data) || data.length === 0) { $scope.noMacroParams = true; } else { $scope.wizardStep = "paramSelect"; $scope.model.macroParams = data; //fill in the data if we are editing this macro if ($scope.model.dialogData && $scope.model.dialogData.macroData && $scope.model.dialogData.macroData.macroParamsDictionary) { _.each($scope.model.dialogData.macroData.macroParamsDictionary, function (val, key) { var prop = _.find($scope.model.macroParams, function (item) { return item.alias == key; }); if (prop) { if (_.isString(val)) { //we need to unescape values as they have most likely been escaped while inserted val = _.unescape(val); //detect if it is a json string if (val.detectIsJson()) { try { //Parse it to json prop.value = angular.fromJson(val); } catch (e) { // not json prop.value = val; } } else { prop.value = val; } } else { prop.value = val; } } }); } } }); } //here we check to see if we've been passed a selected macro and if so we'll set the //editor to start with parameter editing if ($scope.model.dialogData && $scope.model.dialogData.macroData) { $scope.wizardStep = "paramSelect"; } //get the macro list - pass in a filter if it is only for rte entityResource.getAll("Macro", ($scope.model.dialogData && $scope.model.dialogData.richTextEditor && $scope.model.dialogData.richTextEditor === true) ? "UseInEditor=true" : null) .then(function (data) { //if 'allowedMacros' is specified, we need to filter if (angular.isArray($scope.model.dialogData.allowedMacros) && $scope.model.dialogData.allowedMacros.length > 0) { $scope.macros = _.filter(data, function(d) { return _.contains($scope.model.dialogData.allowedMacros, d.alias); }); } else { $scope.macros = data; } //check if there's a pre-selected macro and if it exists if ($scope.model.dialogData && $scope.model.dialogData.macroData && $scope.model.dialogData.macroData.macroAlias) { var found = _.find(data, function (item) { return item.alias === $scope.model.dialogData.macroData.macroAlias; }); if (found) { //select the macro and go to next screen $scope.model.selectedMacro = found; editParams(); return; } } //we don't have a pre-selected macro so ensure the correct step is set $scope.wizardStep = "macroSelect"; }); } angular.module("umbraco").controller("Umbraco.Overlays.MacroPickerController", MacroPickerController);
define({ "unit": "יחידה", "style": "סגנון", "dual": "דואלי", "english": "אנגלי", "metric": "מטרי", "ruler": "סרגל", "line": "קו" });
/* @flow */ import { updateListeners } from 'core/vdom/helpers/update-listeners' let target: any function add ( event: string, handler: Function, once: boolean, capture: boolean, passive?: boolean, params?: Array<any> ) { if (capture) { console.log('Weex do not support event in bubble phase.') return } if (once) { const oldHandler = handler const _target = target // save current target element in closure handler = function (ev) { const res = arguments.length === 1 ? oldHandler(ev) : oldHandler.apply(null, arguments) if (res !== null) { remove(event, null, null, _target) } } } target.addEvent(event, handler, params) } function remove ( event: string, handler: any, capture: any, _target?: any ) { (_target || target).removeEvent(event) } function updateDOMListeners (oldVnode: VNodeWithData, vnode: VNodeWithData) { if (!oldVnode.data.on && !vnode.data.on) { return } const on = vnode.data.on || {} const oldOn = oldVnode.data.on || {} target = vnode.elm updateListeners(on, oldOn, add, remove, vnode.context) target = undefined } export default { create: updateDOMListeners, update: updateDOMListeners }