text
stringlengths 2
6.14k
|
|---|
function f() {
var i32 = new Int32Array(1);
var f32 = new Float32Array(i32.buffer);
for (var i = 0; i < 3; i++) {
var a0 = +1;
var a3 = +4;
i32[0] = a0;
var b0 = f32[0];
i32[0] = a3;
var b3 = f32[0];
assertEq(b0 != b3, true);
}
}
f();
|
/**
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* This is the base module should be extended by all plugins for the
* [document previewer]{@link module:alfresco/preview/AlfDocumentPreview}. This provides basic
* height calculations for the preview (which can be overridden if required). The
* [display]{@link module:alfresco/preview/AlfDocumentPreviewPlugin#display} function should be
* overridden to implement the preview behaviour.
*
* @module alfresco/preview/AlfDocumentPreviewPlugin
* @extends external:dijit/_WidgetBase
* @mixes module:alfresco/layout/HeightMixin
* @mixes module:alfresco/core/ResizeMixin
* @mixes module:alfresco/core/Core
* @author Dave Draper
*/
define(["dojo/_base/declare",
"dijit/_WidgetBase",
"alfresco/layout/HeightMixin",
"alfresco/core/ResizeMixin",
"alfresco/core/Core",
"dojo/_base/lang"],
function(declare, _Widget, HeightMixin, ResizeMixin, Core, lang) {
return declare([_Widget, HeightMixin, ResizeMixin, Core], {
/**
*
* @instance
* @param {object[]} args
*/
constructor: function alfresco_preview_AlfDocumentPreviewPlugin__constructor(args) {
lang.mixin(args);
// Ensure that an initial attributes instance variable is defined to avoid
// errors when the [setAttributes]{@link module:alfresco/preview/AlfDocumentPreviewPlugin#setAttributes}
// function is called.
if (!this.attributes)
{
this.attributes = {};
}
},
/**
* Updates the attributes with the values from the [AlfDocumentPreview]{@link module:alfresco/preview/AlfDocumentPreview}
* instance for the current Node being previewed.
*
* @instance
* @param {object[]} attributes The attributes object to mixin into the default settings.
*/
setAttributes: function alfresco_preview_AlfDocumentPreviewPlugin__setAttributes(attributes) {
var clonedAttributes = lang.clone(attributes);
lang.mixin(this.attributes, clonedAttributes);
},
/**
* If [display]{@link module:alfresco/preview/AlfDocumentPreview#display} returns HTML to be
* added as the preview then this function will be called after it has been added to the document.
* This provides an opportunity for the plugin to perform any additional initialisation.
*
* @instance
* @since 1.0.51
*/
onMarkupAdded: function alfresco_preview_AlfDocumentPreviewPlugin__onMarkupAdded() {
// By default don't report anything.
},
/**
* Tests if the plugin can be used in the users browser.
*
* @instance
* @overridable
*/
report: function alfresco_preview_AlfDocumentPreviewPlugin__report() {
// By default don't report anything.
},
/**
* By default does nothing.
*
* @instance
* @overridable
*/
display: function alfresco_preview_AlfDocumentPreviewPlugin__display() {
this.alfSetupResizeSubscriptions(this.onRecalculatePreviewLayout, this);
},
/**
* Handler for window resize event. This will call [_setPreviewerElementHeight]
* {@link module:alfresco/preview/AlfDocumentPreviewPlugin#_setPreviewerElementHeight}
* but can be extended or overridden to perform additional preview layout actions.
*
* @instance
*/
onRecalculatePreviewLayout: function alfresco_preview_AlfDocumentPreviewPlugin__onRecalculatePreviewLayout() {
this._setPreviewerElementHeight();
},
/**
* Sets the height of the previewer element using functions provided by calling the
* [setHeight function]{@link module:alfresco/layout/HeightMixin#setHeight} provided by the
* [HeightMixin]{@link module:alfresco/layout/HeightMixin} module.
*
* @instance
*/
_setPreviewerElementHeight: function alfresco_preview_AlfDocumentPreviewPlugin___setPreviewerElementHeight() {
var pE = this.previewManager.getPreviewerElement();
this.heightMode = this.previewManager.heightMode;
this.heightAdjustment = this.previewManager.heightAdjustment || 0;
this.setHeight(pE);
}
});
});
|
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var buffer = new ArrayBuffer(0x100);
var array = new Uint8Array(buffer).fill(55);
var tmp = {};
tmp[Symbol.toPrimitive] = function () {
%ArrayBufferNeuter(array.buffer)
return 0;
};
assertEquals(-1, Array.prototype.indexOf.call(array, 0x00, tmp));
buffer = new ArrayBuffer(0x100);
array = new Uint8Array(buffer).fill(55);
tmp = {};
tmp[Symbol.toPrimitive] = function () {
%ArrayBufferNeuter(array.buffer)
return 0;
};
assertEquals(false, Array.prototype.includes.call(array, 0x00, tmp));
buffer = new ArrayBuffer(0x100);
array = new Uint8Array(buffer).fill(55);
tmp = {};
tmp[Symbol.toPrimitive] = function () {
%ArrayBufferNeuter(array.buffer)
return 0;
};
assertEquals(true, Array.prototype.includes.call(array, undefined, tmp));
|
'use strict';
/**
* @ngdoc function
* @name openshiftConsole.controller:ImageController
* @description
* Controller of the openshiftConsole
*/
angular.module('openshiftConsole')
.controller('ImageController', function ($scope, $routeParams, DataService, ProjectsService, $filter, ImageStreamsService) {
$scope.projectName = $routeParams.project;
$scope.imageStream = null;
$scope.tagsByName = {};
$scope.tagShowOlder = {};
$scope.alerts = {};
$scope.renderOptions = $scope.renderOptions || {};
$scope.renderOptions.hideFilterWidget = true;
$scope.breadcrumbs = [
{
title: "Image Streams",
link: "project/" + $routeParams.project + "/browse/images"
},
{
title: $routeParams.image
}
];
$scope.emptyMessage = "Loading...";
var watches = [];
ProjectsService
.get($routeParams.project)
.then(_.spread(function(project, context) {
$scope.project = project;
DataService.get("imagestreams", $routeParams.image, context).then(
// success
function(imageStream) {
$scope.loaded = true;
$scope.imageStream = imageStream;
$scope.emptyMessage = "No tags to show";
// If we found the item successfully, watch for changes on it
watches.push(DataService.watchObject("imagestreams", $routeParams.image, context, function(imageStream, action) {
if (action === "DELETED") {
$scope.alerts["deleted"] = {
type: "warning",
message: "This image stream has been deleted."
};
}
$scope.imageStream = imageStream;
$scope.tagsByName = ImageStreamsService.tagsByName($scope.imageStream);
}));
},
// failure
function(e) {
$scope.loaded = true;
$scope.alerts["load"] = {
type: "error",
message: "The image stream details could not be loaded.",
details: "Reason: " + $filter('getErrorDetails')(e)
};
});
$scope.$on('$destroy', function(){
DataService.unwatchAll(watches);
});
}));
});
|
"use strict";
var Metatags = require("lib/metatags/Metatags");
describe("Metatags", function() {
var metatags;
describe("instantiation", function() {
describe("when pairs are NOT provided", function() {
function instantiateMetatagsWithoutPairs() {
return new Metatags();
}
it("throws an error", function() {
expect(instantiateMetatagsWithoutPairs).toThrow();
});
});
describe("when pairs are provided", function() {
beforeEach(function() {
metatags = new Metatags({
"description": "desc",
"og:image": "a.jpg",
"canonical": "a.com/c"
});
});
it("sets html property to markup of metatags", function() {
expect(metatags.html).toEqual(
'<meta name="description" content="desc" data-ephemeral="true">' +
'<meta property="og:image" content="a.jpg" data-ephemeral="true">' +
'<link rel="canonical" href="a.com/c" data-ephemeral="true">'
);
});
});
describe("deprecation", function() {
beforeEach(function() {
spyOn(console, "warn");
});
it("logs deprecation method for open graph tags", function() {
metatags = new Metatags({
"og:image": "a.jpg"
});
expect(console.warn).toHaveBeenCalled();
});
it("logs deprecation method for canonical tags", function() {
metatags = new Metatags({
"canonical": "a.com/c"
});
expect(console.warn).toHaveBeenCalled();
});
});
});
});
// ----------------------------------------------------------------------------
// Copyright (C) 2015 Bloomberg Finance L.P.
//
// 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.
//
// ----------------------------- END-OF-FILE ----------------------------------
|
const fs = require('fs');
const _ = require('lodash');
const cache = require('./state/cache');
const broadcast = cache.get('broadcast');
const apiKeysFile = __dirname + '/../SECRET-api-keys.json';
// on init:
const noApiKeysFile = !fs.existsSync(apiKeysFile);
if(noApiKeysFile)
fs.writeFileSync(
apiKeysFile,
JSON.stringify({})
);
const apiKeys = JSON.parse( fs.readFileSync(apiKeysFile, 'utf8') );
module.exports = {
get: () => _.keys(apiKeys),
// note: overwrites if exists
add: (exchange, props) => {
apiKeys[exchange] = props;
fs.writeFileSync(apiKeysFile, JSON.stringify(apiKeys));
broadcast({
type: 'apiKeys',
exchanges: _.keys(apiKeys)
});
},
remove: exchange => {
if(!apiKeys[exchange])
return;
delete apiKeys[exchange];
fs.writeFileSync(apiKeysFile, JSON.stringify(apiKeys));
broadcast({
type: 'apiKeys',
exchanges: _.keys(apiKeys)
});
},
// retrieve api keys
// this cannot touch the frontend for security reaons.
_getApiKeyPair: key => apiKeys[key]
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var locale = {
placeholder: 'Zeit auswählen'
};
exports['default'] = locale;
module.exports = exports['default'];
|
$(document).ready(function() {
$('#servicio_ingreso').select2({
width: '60%',
placeholder:'Seleccione...',
allowClear:true
});
$("#fecha_inicio").datepicker().mask("99-99-9999");
$("#fecha_fin").datepicker().mask("99-99-9999");
$("#emitir_informe").click(function() {
if ($("#fecha_inicio").val() == '' || $("#fecha_fin").val() == '') {
($('#error')) ? $('#error').remove() : '';
var elem = $("<div id='error' title='Error de llenado'><center>" +
"Debe de seleccionar ambas fechas para generar el reporte."
+ "</center></div>");
elem.insertAfter($("#pacientesIngresados"));
$("#error").dialog({
close: function() {
if ($("#fecha_inicio").val() == '')
$("#fecha_inicio").focus();
else
$("#fecha_fin").focus();
}
});
} else if( $("#fecha_inicio").datepicker("getDate") > $("#fecha_fin").datepicker("getDate")){
($('#error')) ? $('#error').remove() : '';
var elem = $("<div id='error' title='Error de llenado'><center>" +
"La fecha de inicio debe de ser menor que la fecha fin."
+ "</center></div>");
elem.insertAfter($("#pacientesIngresados"));
$("#error").dialog({
close: function() {
$("#fecha_inicio").val('');
$("#fecha_fin").val('');
$("#fecha_inicio").focus();
}
});
} else {
$('#resultado').load(Routing.generate('buscar_ingresos_pacientes'), {'datos': $('#pacientesIngresados').serialize()});
}
return false;
});
$.getJSON(Routing.generate('get_servicios_hospitalarios_todos'),
function(data) {
$.each(data.especialidades, function(indice, aux) {
$('#servicio_ingreso').append('<option value="' + aux.id + '">' + aux.nombre + '</option>');
});
});
});
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
*
* Take a screenshot of the current viewport. To get the screenshot of the whole page
* use the action command `saveScreenshot`
*
* @returns {String} screenshot The screenshot as a base64 encoded PNG.
*
* @see https://w3c.github.io/webdriver/webdriver-spec.html#dfn-take-screenshot
* @type protocol
*
*/
var screenshot = function screenshot() {
return this.requestHandler.create('/session/:sessionId/screenshot');
};
exports.default = screenshot;
module.exports = exports['default'];
|
function substr(str, start, len) {
// discuss at: http://phpjs.org/functions/substr/
// version: 909.322
// original by: Martijn Wieringa
// bugfixed by: T.Wild
// improved by: Onno Marsman
// improved by: Brett Zamir (http://brett-zamir.me)
// revised by: Theriault
// note: Handles rare Unicode characters if 'unicode.semantics' ini (PHP6) is set to 'on'
// example 1: substr('abcdef', 0, -1);
// returns 1: 'abcde'
// example 2: substr(2, 0, -6);
// returns 2: false
// example 3: ini_set('unicode.semantics', 'on');
// example 3: substr('a\uD801\uDC00', 0, -1);
// returns 3: 'a'
// example 4: ini_set('unicode.semantics', 'on');
// example 4: substr('a\uD801\uDC00', 0, 2);
// returns 4: 'a\uD801\uDC00'
// example 5: ini_set('unicode.semantics', 'on');
// example 5: substr('a\uD801\uDC00', -1, 1);
// returns 5: '\uD801\uDC00'
// example 6: ini_set('unicode.semantics', 'on');
// example 6: substr('a\uD801\uDC00z\uD801\uDC00', -3, 2);
// returns 6: '\uD801\uDC00z'
// example 7: ini_set('unicode.semantics', 'on');
// example 7: substr('a\uD801\uDC00z\uD801\uDC00', -3, -1)
// returns 7: '\uD801\uDC00z'
var i = 0,
allBMP = true,
es = 0,
el = 0,
se = 0,
ret = '';
str += '';
var end = str.length;
// BEGIN REDUNDANT
this.php_js = this.php_js || {};
this.php_js.ini = this.php_js.ini || {};
// END REDUNDANT
switch ((this.php_js.ini['unicode.semantics'] && this.php_js.ini['unicode.semantics'].local_value.toLowerCase())) {
case 'on':
// Full-blown Unicode including non-Basic-Multilingual-Plane characters
// strlen()
for (i = 0; i < str.length; i++) {
if (/[\uD800-\uDBFF]/.test(str.charAt(i)) && /[\uDC00-\uDFFF]/.test(str.charAt(i + 1))) {
allBMP = false;
break;
}
}
if (!allBMP) {
if (start < 0) {
for (i = end - 1, es = (start += end); i >= es; i--) {
if (/[\uDC00-\uDFFF]/.test(str.charAt(i)) && /[\uD800-\uDBFF]/.test(str.charAt(i - 1))) {
start--;
es--;
}
}
} else {
var surrogatePairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
while ((surrogatePairs.exec(str)) != null) {
var li = surrogatePairs.lastIndex;
if (li - 2 < start) {
start++;
} else {
break;
}
}
}
if (start >= end || start < 0) {
return false;
}
if (len < 0) {
for (i = end - 1, el = (end += len); i >= el; i--) {
if (/[\uDC00-\uDFFF]/.test(str.charAt(i)) && /[\uD800-\uDBFF]/.test(str.charAt(i - 1))) {
end--;
el--;
}
}
if (start > end) {
return false;
}
return str.slice(start, end);
} else {
se = start + len;
for (i = start; i < se; i++) {
ret += str.charAt(i);
if (/[\uD800-\uDBFF]/.test(str.charAt(i)) && /[\uDC00-\uDFFF]/.test(str.charAt(i + 1))) {
se++; // Go one further, since one of the "characters" is part of a surrogate pair
}
}
return ret;
}
break;
}
// Fall-through
case 'off':
// assumes there are no non-BMP characters;
// if there may be such characters, then it is best to turn it on (critical in true XHTML/XML)
default:
if (start < 0) {
start += end;
}
end = typeof len === 'undefined' ? end : (len < 0 ? len + end : len + start);
// PHP returns false if start does not fall within the string.
// PHP returns false if the calculated end comes before the calculated start.
// PHP returns an empty string if start and end are the same.
// Otherwise, PHP returns the portion of the string from start to end.
return start >= str.length || start < 0 || start > end ? !1 : str.slice(start, end);
}
return undefined; // Please Netbeans
}
|
/* Copyright (c) 2006-2015 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
/**
* @requires OpenLayers/Format/XML/VersionedOGC.js
*/
/**
* Class: OpenLayers.Format.OWSCommon
* Read OWSCommon. Create a new instance with the <OpenLayers.Format.OWSCommon>
* constructor.
*
* Inherits from:
* - <OpenLayers.Format.XML.VersionedOGC>
*/
OpenLayers.Format.OWSCommon = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC, {
/**
* APIProperty: defaultVersion
* {String} Version number to assume if none found. Default is "1.0.0".
*/
defaultVersion: "1.0.0",
/**
* Constructor: OpenLayers.Format.OWSCommon
* Create a new parser for OWSCommon.
*
* Parameters:
* options - {Object} An optional object whose properties will be set on
* this instance.
*/
/**
* Method: getVersion
* Returns the version to use. Subclasses can override this function
* if a different version detection is needed.
*
* Parameters:
* root - {DOMElement}
* options - {Object} Optional configuration object.
*
* Returns:
* {String} The version to use.
*/
getVersion: function(root, options) {
var version = this.version;
if(!version) {
// remember version does not correspond to the OWS version
// it corresponds to the WMS/WFS/WCS etc. request version
var uri = root.getAttribute("xmlns:ows");
// the above will fail if the namespace prefix is different than
// ows and if the namespace is declared on a different element
if (uri && uri.substring(uri.lastIndexOf("/")+1) === "1.1") {
version ="1.1.0";
}
if(!version) {
version = this.defaultVersion;
}
}
return version;
},
/**
* APIMethod: read
* Read an OWSCommon document and return an object.
*
* Parameters:
* data - {String | DOMElement} Data to read.
* options - {Object} Options for the reader.
*
* Returns:
* {Object} An object representing the structure of the document.
*/
CLASS_NAME: "OpenLayers.Format.OWSCommon"
});
|
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'div', 'km', {
IdInputLabel: 'Id',
advisoryTitleInputLabel: 'ចំណងជើងប្រឹក្សា',
cssClassInputLabel: 'Stylesheet Classes',
edit: 'កែ Div',
inlineStyleInputLabel: 'ស្ទីលក្នុងបន្ទាត់',
langDirLTRLabel: 'ពីឆ្វេងទៅស្តាំ(LTR)',
langDirLabel: 'ទិសដៅភាសា',
langDirRTLLabel: 'ពីស្តាំទៅឆ្វេង(RTL)',
languageCodeInputLabel: 'កូដភាសា',
remove: 'ដក Div ចេញ',
styleSelectLabel: 'ស្ទីល',
title: 'បង្កើតអ្នកផ្ទុក Div',
toolbar: 'បង្កើតអ្នកផ្ទុក Div'
} );
|
// Hungarian
// from Google Translate -- please help improve this translation
if (typeof FlexibleMap != "undefined") {
FlexibleMap.prototype.i18n["hu"] = {
"Click for details" : "Kattintson a részletekért",
"Directions" : "Térkép irányban",
"From" : "Indulás helye",
"Get directions" : "Térkép irányban"
};
}
|
var nodeListTemplate = "<% _.each(nodes, function(name) { %> <li><%= nodes.name %></li> <% }); %>";
//<li><a href="#" class="list-link" data-slug='+nodes.slug+' >' + nodes.name + '</a></li>
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//-----------------------------------------------------------------------------
var BUGNUMBER = 452498;
var summary = 'TM: upvar2 regression tests';
var actual = '';
var expect = '';
//------- Comment #192 From Brendan Eich
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
with({x: (x -= 0)}){([]); const x }
reportCompare(expect, actual, summary);
exitFunc ('test');
}
|
if (getJitCompilerOptions()["ion.warmup.trigger"] > 20)
setJitCompilerOption("ion.warmup.trigger", 20);
function callRegExpTest(i) {
var s = "" + i;
var re = /(\d+)/;
re.test(s);
assertEq(RegExp.$1, s);
}
function callRegExpExec(i) {
var s = "" + i;
var re = /(\d+)/;
var res = re.exec(s);
assertEq(RegExp.$1, s);
return res;
}
function callRegExpReplace(i) {
var s = "" + i;
var re = /(\d+)/;
s.replace(re, "");
assertEq(RegExp.$1, s);
}
for (var i = 0; i < 60; i++) {
callRegExpTest(i);
callRegExpExec(i);
callRegExpReplace(i);
}
|
define(
({
visible: "הצג מפת התמצאות כברירת מחדל",
minWidth: "רוחב מינימלי",
minHeight: "גובה מינימלי",
maxWidth: "אורך מקסימלי",
maxHeight: "גובה מקסימלי",
minText: "מינימום",
maxText: "מקסימום",
attachText: "ציין לאיזו פינה של המפה יש להצמיד וידג'ט זה.",
expandText: "הרחבה ראשונית של הוידג'ט",
topLeft: "צד שמאל למעלה",
topRight: "צד ימין למעלה",
bottomLeft: "צד שמאל למטה",
bottomRight: "צד ימין למטה"
})
);
|
//// [recursiveSpecializationOfSignatures.ts]
class S0<B, A> {
set S1(S2: S0<any,any>) {
}
constructor(public S17: S0<any, (S18) => A>) { }
}
//// [recursiveSpecializationOfSignatures.js]
var S0 = /** @class */ (function () {
function S0(S17) {
this.S17 = S17;
}
Object.defineProperty(S0.prototype, "S1", {
set: function (S2) {
},
enumerable: true,
configurable: true
});
return S0;
}());
|
//// [parserMemberAccessorDeclaration6.ts]
class C {
set 0(i) { }
}
//// [parserMemberAccessorDeclaration6.js]
var C = /** @class */ (function () {
function C() {
}
Object.defineProperty(C.prototype, 0, {
set: function (i) { },
enumerable: true,
configurable: true
});
return C;
}());
|
//// [inheritance1.ts]
class Control {
private state: any;
}
interface SelectableControl extends Control {
select(): void;
}
class Button extends Control implements SelectableControl {
select() { }
}
class TextBox extends Control {
select() { }
}
class ImageBase extends Control implements SelectableControl{
}
class Image1 extends Control {
}
class Locations implements SelectableControl {
select() { }
}
class Locations1 {
select() { }
}
var sc: SelectableControl;
var c: Control;
var b: Button;
sc = b;
c = b;
b = sc;
b = c;
var t: TextBox;
sc = t;
c = t;
t = sc;
t = c;
var i: ImageBase;
sc = i;
c = i;
i = sc;
i = c;
var i1: Image1;
sc = i1;
c = i1;
i1 = sc;
i1 = c;
var l: Locations;
sc = l;
c = l;
l = sc;
l = c;
var l1: Locations1;
sc = l1;
c = l1;
l1 = sc;
l1 = c;
//// [inheritance1.js]
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var Control = (function () {
function Control() {
}
return Control;
})();
var Button = (function (_super) {
__extends(Button, _super);
function Button() {
_super.apply(this, arguments);
}
Button.prototype.select = function () {
};
return Button;
})(Control);
var TextBox = (function (_super) {
__extends(TextBox, _super);
function TextBox() {
_super.apply(this, arguments);
}
TextBox.prototype.select = function () {
};
return TextBox;
})(Control);
var ImageBase = (function (_super) {
__extends(ImageBase, _super);
function ImageBase() {
_super.apply(this, arguments);
}
return ImageBase;
})(Control);
var Image1 = (function (_super) {
__extends(Image1, _super);
function Image1() {
_super.apply(this, arguments);
}
return Image1;
})(Control);
var Locations = (function () {
function Locations() {
}
Locations.prototype.select = function () {
};
return Locations;
})();
var Locations1 = (function () {
function Locations1() {
}
Locations1.prototype.select = function () {
};
return Locations1;
})();
var sc;
var c;
var b;
sc = b;
c = b;
b = sc;
b = c;
var t;
sc = t;
c = t;
t = sc;
t = c;
var i;
sc = i;
c = i;
i = sc;
i = c;
var i1;
sc = i1;
c = i1;
i1 = sc;
i1 = c;
var l;
sc = l;
c = l;
l = sc;
l = c;
var l1;
sc = l1;
c = l1;
l1 = sc;
l1 = c;
|
/**
* Copyright 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
* Please see distribution for license.
*/
(function () {
if (!window.Four) window.Four = {};
/**
* Keeps a tally of meshes that need to support raycasting
*/
window.Four.InteractiveMeshes = function () {
return {
add: function (name, mesh) {
if (!this.meshes[name]) this.meshes[name] = {};
this.meshes[name] = mesh;
},
meshes: {},
remove: function (name) {
if (name in this.meshes) delete this.meshes[name];
}
};
};
})();
|
/**
* Copyright 2013-present, Facebook, Inc.
* 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. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactControlledValuePropTypes
*/
'use strict';
var React = require('React');
var warning = require('warning');
var hasReadOnlyValue = {
'button': true,
'checkbox': true,
'image': true,
'hidden': true,
'radio': true,
'reset': true,
'submit': true,
};
var propTypes = {
value: function(props, propName, componentName) {
if (!props[propName] ||
hasReadOnlyValue[props.type] ||
props.onChange ||
props.readOnly ||
props.disabled) {
return null;
}
return new Error(
'You provided a `value` prop to a form field without an ' +
'`onChange` handler. This will render a read-only field. If ' +
'the field should be mutable use `defaultValue`. Otherwise, ' +
'set either `onChange` or `readOnly`.'
);
},
checked: function(props, propName, componentName) {
if (!props[propName] ||
props.onChange ||
props.readOnly ||
props.disabled) {
return null;
}
return new Error(
'You provided a `checked` prop to a form field without an ' +
'`onChange` handler. This will render a read-only field. If ' +
'the field should be mutable use `defaultChecked`. Otherwise, ' +
'set either `onChange` or `readOnly`.'
);
},
onChange: React.PropTypes.func,
};
var loggedTypeFailures = {};
function getDeclarationErrorAddendum(ownerName) {
if (ownerName) {
return ' Check the render method of `' + ownerName + '`.';
}
return '';
}
/**
* Provide a linked `value` attribute for controlled forms. You should not use
* this outside of the ReactDOM controlled form components.
*/
var ReactControlledValuePropTypes = {
checkPropTypes: function(tagName, props, ownerName) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error = propTypes[propName](
props,
propName,
tagName,
'prop',
);
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var addendum = getDeclarationErrorAddendum(ownerName);
warning(false, 'Failed form propType: %s%s', error.message, addendum);
}
}
},
};
module.exports = ReactControlledValuePropTypes;
|
/**
* @author MPanknin / http://www.redplant.de/
* @author alteredq / http://alteredqualia.com/
*/
THREE.AreaLight = function ( color, intensity ) {
THREE.Light.call( this, color );
this.type = 'AreaLight';
this.normal = new THREE.Vector3( 0, - 1, 0 );
this.right = new THREE.Vector3( 1, 0, 0 );
this.intensity = ( intensity !== undefined ) ? intensity : 1;
this.width = 1.0;
this.height = 1.0;
this.constantAttenuation = 1.5;
this.linearAttenuation = 0.5;
this.quadraticAttenuation = 0.1;
};
THREE.AreaLight.prototype = Object.create( THREE.Light.prototype );
|
'use strict';
const chalk = require('chalk');
module.exports = function(message, test) {
if (test) {
console.log(chalk.yellow(`DEPRECATION: ${message}`));
}
};
module.exports.deprecateUI = function(ui) {
return function(message, test) {
ui.writeDeprecateLine('The deprecateUI utility has been deprecated in favor of ui.writeDeprecateLine');
test = !test;
ui.writeDeprecateLine(message, test);
};
};
|
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "align", "controlSize", "mode", "stretched", "before", "className", "style", "getRef", "getRootRef", "onClick"];
import { createScopedElement } from "../../lib/jsxRuntime";
import { getClassName } from "../../helpers/getClassName";
import Button from "../Button/Button";
import { usePlatform } from "../../hooks/usePlatform";
import { useExternRef } from "../../hooks/useExternRef";
import "./File.css";
var File = function File(props) {
var children = props.children,
align = props.align,
controlSize = props.controlSize,
mode = props.mode,
stretched = props.stretched,
before = props.before,
className = props.className,
style = props.style,
getRef = props.getRef,
getRootRef = props.getRootRef,
_onClick = props.onClick,
restProps = _objectWithoutProperties(props, _excluded);
var platform = usePlatform();
var inputRef = useExternRef(getRef);
return createScopedElement(Button, {
align: align,
vkuiClass: getClassName('File', platform),
className: className,
stretched: stretched,
mode: mode,
size: controlSize,
before: before,
style: style,
getRootRef: getRootRef,
disabled: restProps.disabled,
type: "button",
onClick: function onClick(e) {
inputRef.current.click();
_onClick && _onClick(e);
}
}, createScopedElement("input", _extends({}, restProps, {
vkuiClass: "File__input",
type: "file",
ref: inputRef
})), children);
};
File.defaultProps = {
children: 'Выберите файл',
align: 'left'
};
export default File;
//# sourceMappingURL=File.js.map
|
CKEDITOR.plugins.setLang( 'plugin4', 'en', {
test4: 'Testing'
} );
|
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 690031;
var summary =
'Exclude __proto__ from showing up when enumerating properties of ' +
'Object.prototype again';
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var keys = Object.getOwnPropertyNames(Object.prototype);
assertEq(keys.indexOf("__proto__"), -1,
"shouldn't have gotten __proto__ as a property of Object.prototype " +
"(got these properties: " + keys + ")");
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("Tests complete");
|
/* *
*
* (c) 2009-2020 Øystein Moseng
*
* Accessibility component for chart container.
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
import H from '../../../parts/Globals.js';
var doc = H.win.document;
import U from '../../../parts/Utilities.js';
var extend = U.extend;
import HTMLUtilities from '../utils/htmlUtilities.js';
var stripHTMLTags = HTMLUtilities.stripHTMLTagsFromString;
import ChartUtilities from '../utils/chartUtilities.js';
var unhideChartElementFromAT = ChartUtilities.unhideChartElementFromAT, getChartTitle = ChartUtilities.getChartTitle;
import AccessibilityComponent from '../AccessibilityComponent.js';
/* eslint-disable valid-jsdoc */
/**
* The ContainerComponent class
*
* @private
* @class
* @name Highcharts.ContainerComponent
*/
var ContainerComponent = function () { };
ContainerComponent.prototype = new AccessibilityComponent();
extend(ContainerComponent.prototype, /** @lends Highcharts.ContainerComponent */ {
/**
* Called on first render/updates to the chart, including options changes.
*/
onChartUpdate: function () {
this.handleSVGTitleElement();
this.setSVGContainerLabel();
this.setGraphicContainerAttrs();
this.setRenderToAttrs();
this.makeCreditsAccessible();
},
/**
* @private
*/
handleSVGTitleElement: function () {
var chart = this.chart, titleId = 'highcharts-title-' + chart.index, titleContents = stripHTMLTags(chart.langFormat('accessibility.svgContainerTitle', {
chartTitle: getChartTitle(chart)
}));
if (titleContents.length) {
var titleElement = this.svgTitleElement =
this.svgTitleElement || doc.createElementNS('http://www.w3.org/2000/svg', 'title');
titleElement.textContent = titleContents;
titleElement.id = titleId;
chart.renderTo.insertBefore(titleElement, chart.renderTo.firstChild);
}
},
/**
* @private
*/
setSVGContainerLabel: function () {
var chart = this.chart, svgContainerLabel = stripHTMLTags(chart.langFormat('accessibility.svgContainerLabel', {
chartTitle: getChartTitle(chart)
}));
if (chart.renderer.box && svgContainerLabel.length) {
chart.renderer.box.setAttribute('aria-label', svgContainerLabel);
}
},
/**
* @private
*/
setGraphicContainerAttrs: function () {
var chart = this.chart, label = chart.langFormat('accessibility.graphicContainerLabel', {
chartTitle: getChartTitle(chart)
});
if (label.length) {
chart.container.setAttribute('aria-label', label);
}
},
/**
* @private
*/
setRenderToAttrs: function () {
var chart = this.chart;
if (chart.options.accessibility.landmarkVerbosity !== 'disabled') {
chart.renderTo.setAttribute('role', 'region');
}
else {
chart.renderTo.removeAttribute('role');
}
chart.renderTo.setAttribute('aria-label', chart.langFormat('accessibility.chartContainerLabel', {
title: getChartTitle(chart),
chart: chart
}));
},
/**
* @private
*/
makeCreditsAccessible: function () {
var chart = this.chart, credits = chart.credits;
if (credits) {
if (credits.textStr) {
credits.element.setAttribute('aria-label', stripHTMLTags(chart.langFormat('accessibility.credits', { creditsStr: credits.textStr })));
}
unhideChartElementFromAT(chart, credits.element);
}
},
/**
* Accessibility disabled/chart destroyed.
*/
destroy: function () {
this.chart.renderTo.setAttribute('aria-hidden', true);
}
});
export default ContainerComponent;
|
'use strict';
// Declare app level module which depends on filters, and services
angular.module('myApp', [
'ngRoute',
'myApp.filters',
'myApp.services',
'myApp.directives',
'myApp.controllers',
'UserApp'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/login', {templateUrl: 'partials/login.html', login: true});
$routeProvider.when('/signup', {templateUrl: 'partials/signup.html', public: true});
$routeProvider.when('/verify-email', {templateUrl: 'partials/verify-email.html', verify_email: true});
$routeProvider.when('/reset-password', {templateUrl: 'partials/reset-password.html', public: true});
$routeProvider.when('/set-password', {templateUrl: 'partials/set-password.html', set_password: true});
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'MyCtrl1'});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: 'MyCtrl2'});
$routeProvider.otherwise({redirectTo: '/view1'});
}])
.run(function($rootScope, user) {
// Initiate the user service with your UserApp App Id
// https://help.userapp.io/customer/portal/articles/1322336-how-do-i-find-my-app-id-
user.init({ appId: 'YOUR-USERAPP-APP-ID' });
});
|
/*
* Copyright 2013-2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (require) {
var pathPrefix, template, find, lazyPromise, responsePromise, when;
pathPrefix = require('../../../interceptor/pathPrefix');
template = require('../../../interceptor/template');
find = require('../../../util/find');
lazyPromise = require('../../../util/lazyPromise');
responsePromise = require('../../../util/responsePromise');
when = require('when');
function defineProperty(obj, name, value) {
Object.defineProperty(obj, name, {
value: value,
configurable: true,
enumerable: false,
writeable: true
});
}
/**
* Hypertext Application Language serializer
*
* Implemented to https://tools.ietf.org/html/draft-kelly-json-hal-06
*
* As the spec is still a draft, this implementation will be updated as the
* spec evolves
*
* Objects are read as HAL indexing links and embedded objects on to the
* resource. Objects are written as plain JSON.
*
* Embedded relationships are indexed onto the resource by the relationship
* as a promise for the related resource.
*
* Links are indexed onto the resource as a lazy promise that will GET the
* resource when a handler is first registered on the promise.
*
* A `requestFor` method is added to the entity to make a request for the
* relationship.
*
* A `clientFor` method is added to the entity to get a full Client for a
* relationship.
*
* The `_links` and `_embedded` properties on the resource are made
* non-enumerable.
*/
return {
read: function (str, opts) {
var client, console;
opts = opts || {};
client = opts.client;
console = opts.console || console;
function deprecationWarning(relationship, deprecation) {
if (deprecation && console && console.warn || console.log) {
(console.warn || console.log).call(console, 'Relationship \'' + relationship + '\' is deprecated, see ' + deprecation);
}
}
return opts.registry.lookup(opts.mime.suffix).then(function (converter) {
return when(converter.read(str, opts)).then(function (root) {
find.findProperties(root, '_embedded', function (embedded, resource, name) {
Object.keys(embedded).forEach(function (relationship) {
if (relationship in resource) { return; }
var related = responsePromise({
entity: embedded[relationship]
});
defineProperty(resource, relationship, related);
});
defineProperty(resource, name, embedded);
});
find.findProperties(root, '_links', function (links, resource, name) {
Object.keys(links).forEach(function (relationship) {
var link = links[relationship];
if (relationship in resource) { return; }
defineProperty(resource, relationship, responsePromise.make(lazyPromise(function () {
if (link.deprecation) { deprecationWarning(relationship, link.deprecation); }
if (link.templated === true) {
return template(client)({ path: link.href });
}
return client({ path: link.href });
})));
});
defineProperty(resource, name, links);
defineProperty(resource, 'clientFor', function (relationship, clientOverride) {
var link = links[relationship];
if (!link) {
throw new Error('Unknown relationship: ' + relationship);
}
if (link.deprecation) { deprecationWarning(relationship, link.deprecation); }
if (link.templated === true) {
return template(
clientOverride || client,
{ template: link.href }
);
}
return pathPrefix(
clientOverride || client,
{ prefix: link.href }
);
});
defineProperty(resource, 'requestFor', function (relationship, request, clientOverride) {
var client = this.clientFor(relationship, clientOverride);
return client(request);
});
});
return root;
});
});
},
write: function (obj, opts) {
return opts.registry.lookup(opts.mime.suffix).then(function (converter) {
return converter.write(obj, opts);
});
}
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); }
// Boilerplate for AMD and Node
));
|
/// 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 ch08/8.12/8.12.1/8.12.1-1_33.js
* @description Properties - [[HasOwnProperty]] (configurable, enumerable own setter property)
*/
function testcase() {
var o = {};
Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true, configurable:true});
return o.hasOwnProperty("foo");
}
runTestCase(testcase);
|
/**
* Copyright (c) 2015, Facebook, Inc.
* 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. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
import { describe, it } from 'mocha';
import { expect } from 'chai';
import {
GraphQLID,
GraphQLNonNull,
GraphQLObjectType,
GraphQLSchema,
GraphQLString,
graphql
} from 'graphql';
import {
nodeDefinitions
} from '../node';
var userData = {
1: {
id: 1,
name: 'John Doe'
},
2: {
id: 2,
name: 'Jane Smith'
},
};
var {nodeField, nodeInterface} = nodeDefinitions(
(id) => {
return userData[id];
},
() => {
return userType;
}
);
var userType = new GraphQLObjectType({
name: 'User',
fields: () => ({
id: {
type: new GraphQLNonNull(GraphQLID),
},
name: {
type: GraphQLString,
},
}),
interfaces: [nodeInterface]
});
var queryType = new GraphQLObjectType({
name: 'Query',
fields: () => ({
node: nodeField
})
});
var schema = new GraphQLSchema({
query: queryType
});
describe('Node interface and fields with async object fetcher', () => {
it('Gets the correct ID for users', () => {
var query = `{
node(id: "1") {
id
}
}`;
var expected = {
node: {
id: '1',
}
};
return expect(graphql(schema, query)).to.become({data: expected});
});
it('Gets the correct name for users', () => {
var query = `{
node(id: "1") {
id
... on User {
name
}
}
}`;
var expected = {
node: {
id: '1',
name: 'John Doe',
}
};
return expect(graphql(schema, query)).to.become({data: expected});
});
});
|
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'clipboard', 'bg', {
copy: 'Копирай',
copyError: 'Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни запаметяването. За целта използвайте клавиатурата (Ctrl/Cmd+C).',
cut: 'Отрежи',
cutError: 'Настройките за сигурност на Вашия браузър не позволяват на редактора автоматично да изъплни действията за отрязване. Моля ползвайте клавиатурните команди за целта (ctrl+x).',
paste: 'Вмъкни',
pasteArea: 'Зона за вмъкване',
pasteMsg: 'Вмъкнете тук съдъжанието с клавиатуарата (<STRONG>Ctrl/Cmd+V</STRONG>) и натиснете <STRONG>OK</STRONG>.',
securityMsg: 'Заради настройките за сигурност на Вашия браузър, редакторът не може да прочете данните от клипборда коректно.',
title: 'Вмъкни'
} );
|
var BrowserBuffer = require('../').Buffer // (this module)
var util = require('./util')
var suite = util.suite()
var LENGTH = 160
var browserBuffer = new BrowserBuffer(LENGTH * 8)
var typedarray = new Uint8Array(LENGTH * 8)
var dataview = new DataView(typedarray.buffer)
var nodeBuffer = new Buffer(LENGTH * 8)
;[browserBuffer, nodeBuffer].forEach(function (buf) {
for (var i = 0; i < LENGTH; i++) {
buf.writeDoubleBE(97.1919 + i, i * 8)
}
})
for (var i = 0; i < LENGTH; i++) {
dataview.setFloat64(i * 8, 97.1919 + i)
}
suite
.add('BrowserBuffer#readDoubleBE', function () {
for (var i = 0; i < LENGTH; i++) {
var x = browserBuffer.readDoubleBE(i * 8)
}
})
.add('DataView#getFloat64', function () {
for (var i = 0; i < LENGTH; i++) {
var x = dataview.getFloat64(i * 8)
}
})
if (!process.browser) suite
.add('NodeBuffer#readDoubleBE', function () {
for (var i = 0; i < LENGTH; i++) {
var x = nodeBuffer.readDoubleBE(i * 8)
}
})
|
function getTrimmedAttribute(sourceAttribute) {
return sourceAttribute.substring(8);
}
|
/* flatpickr v4.2.0, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.mn = {})));
}(this, (function (exports) { 'use strict';
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
? window.flatpickr
: {
l10ns: {},
};
var Mongolian = {
firstDayOfWeek: 1,
weekdays: {
shorthand: ["Да", "Мя", "Лх", "Пү", "Ба", "Бя", "Ня"],
longhand: ["Даваа", "Мягмар", "Лхагва", "Пүрэв", "Баасан", "Бямба", "Ням"],
},
months: {
shorthand: [
"1-р сар",
"2-р сар",
"3-р сар",
"4-р сар",
"5-р сар",
"6-р сар",
"7-р сар",
"8-р сар",
"9-р сар",
"10-р сар",
"11-р сар",
"12-р сар",
],
longhand: [
"Нэгдүгээр сар",
"Хоёрдугаар сар",
"Гуравдугаар сар",
"Дөрөвдүгээр сар",
"Тавдугаар сар",
"Зургаадугаар сар",
"Долдугаар сар",
"Наймдугаар сар",
"Есдүгээр сар",
"Аравдугаар сар",
"Арваннэгдүгээр сар",
"Арванхоёрдугаар сар",
],
},
rangeSeparator: "-с ",
};
fp.l10ns.mn = Mongolian;
var mn = fp.l10ns;
exports.Mongolian = Mongolian;
exports['default'] = mn;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
QUnit.test( 'pixel rounding', function( assert ) {
var container = document.querySelector('#pixel-rounding');
var msnry = new Masonry( container, {
gutter: '.gutter-sizer',
itemSelector: '.item',
transitionDuration: 0
});
var lastItem = msnry.items[2];
var containerWidth = 170;
while ( containerWidth < 210 ) {
container.style.width = containerWidth + 'px';
msnry.layout();
assert.equal( lastItem.position.y, 0,'3rd item on top row, container width = ' + containerWidth );
containerWidth++;
}
});
|
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'list', 'lt', {
bulletedlist: 'Suženklintas sąrašas',
numberedlist: 'Numeruotas sąrašas'
} );
|
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'uk', {
preview: 'Попередній перегляд'
} );
|
/*
* Copyright (C) Pootle contributors.
*
* This file is a part of the Pootle project. It is distributed under the GPL3
* or later license. See the LICENSE file for a copy of the license and the
* AUTHORS file for copyright and authorship information.
*/
import { combineReducers } from 'redux';
function screen(state = 'signIn', action) {
switch (action.type) {
case 'GOTO_SCREEN':
return action.screen;
case 'SIGNIN_SUCCESS': {
const { nextURL } = action;
// HACKISH: allauth's XHR responses are not very informative, so
// it's necessary to do some guesswork around URLs in order to know
// what the actual response is supposed to mean
if (nextURL.indexOf('confirm-email') !== -1) {
return 'activation';
} else if (nextURL.indexOf('inactive') !== -1) {
return 'inactive';
}
return state;
}
case 'SIGNUP_SUCCESS':
return 'activation';
case 'REQ_PW_RESET_SUCCESS':
return 'requestPasswordResetSent';
default:
return state;
}
}
function isLoading(state = false, action) {
switch (action.type) {
case 'SIGNIN_REQUEST':
case 'SIGNUP_REQUEST':
case 'REQ_PW_RESET_REQUEST':
case 'PW_RESET_REQUEST':
case 'VERIFY_SOCIAL_REQUEST':
return true;
case 'SIGNIN_SUCCESS':
case 'SIGNIN_FAILURE':
case 'SIGNUP_SUCCESS':
case 'SIGNUP_FAILURE':
case 'REQ_PW_RESET_SUCCESS':
case 'REQ_PW_RESET_FAILURE':
case 'PW_RESET_SUCCESS':
case 'PW_RESET_FAILURE':
case 'VERIFY_SOCIAL_SUCCESS':
case 'VERIFY_SOCIAL_FAILURE':
return false;
default:
return state;
}
}
function redirectTo(state = null, action) {
switch (action.type) {
case 'SIGNIN_SUCCESS': {
const { nextURL } = action;
if (nextURL.indexOf('confirm-email') !== -1 ||
nextURL.indexOf('inactive') !== -1) {
return state;
}
return nextURL;
}
case 'PW_RESET_SUCCESS':
// FIXME: hard-coding redirect path because of django-allauth#735
return l('/');
case 'VERIFY_SOCIAL_SUCCESS':
return action.nextURL;
default:
return state;
}
}
function resetEmail(state = null, action) {
switch (action.type) {
case 'REQ_PW_RESET_REQUEST':
return action.email;
default:
return state;
}
}
function signUpEmail(state = null, action) {
switch (action.type) {
case 'SIGNUP_REQUEST':
return action.email;
default:
return state;
}
}
function formErrors(state = {}, action) {
switch (action.type) {
case 'SIGNIN_FAILURE':
case 'SIGNUP_FAILURE':
case 'REQ_PW_RESET_FAILURE':
case 'PW_RESET_FAILURE':
case 'VERIFY_SOCIAL_FAILURE':
return action.errors;
case 'SIGNIN_REQUEST':
case 'SIGNIN_SUCCESS':
case 'SIGNUP_REQUEST':
case 'SIGNUP_SUCCESS':
case 'REQ_PW_RESET_REQUEST':
case 'REQ_PW_RESET_SUCCESS':
case 'PW_RESET_REQUEST':
case 'PW_RESET_SUCCESS':
case 'VERIFY_SOCIAL_REQUEST':
case 'VERIFY_SOCIAL_SUCCESS':
return {};
default:
return state;
}
}
const authReducer = combineReducers({
screen,
redirectTo,
resetEmail,
signUpEmail,
isLoading,
formErrors,
});
export default authReducer;
|
module.exports = require("core-js-pure/features/reflect/get-own-metadata-keys");
|
/*!
* FullCalendar v1.6.1 Google Calendar Plugin
* Docs & License: http://arshaw.com/fullcalendar/
* (c) 2013 Adam Shaw
*/
(function($) {
var fc = $.fullCalendar;
var formatDate = fc.formatDate;
var parseISO8601 = fc.parseISO8601;
var addDays = fc.addDays;
var applyAll = fc.applyAll;
fc.sourceNormalizers.push(function(sourceOptions) {
if (sourceOptions.dataType == 'gcal' ||
sourceOptions.dataType === undefined &&
(sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\//)) {
sourceOptions.dataType = 'gcal';
if (sourceOptions.editable === undefined) {
sourceOptions.editable = false;
}
}
});
fc.sourceFetchers.push(function(sourceOptions, start, end) {
if (sourceOptions.dataType == 'gcal') {
return transformOptions(sourceOptions, start, end);
}
});
function transformOptions(sourceOptions, start, end) {
var success = sourceOptions.success;
var data = $.extend({}, sourceOptions.data || {}, {
'start-min': formatDate(start, 'u'),
'start-max': formatDate(end, 'u'),
'singleevents': true,
'max-results': 9999
});
var ctz = sourceOptions.currentTimezone;
if (ctz) {
data.ctz = ctz = ctz.replace(' ', '_');
}
return $.extend({}, sourceOptions, {
url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?',
dataType: 'jsonp',
data: data,
startParam: false,
endParam: false,
success: function(data) {
var events = [];
if (data.feed.entry) {
$.each(data.feed.entry, function(i, entry) {
var startStr = entry['gd$when'][0]['startTime'];
var start = parseISO8601(startStr, true);
var end = parseISO8601(entry['gd$when'][0]['endTime'], true);
var allDay = startStr.indexOf('T') == -1;
var url;
$.each(entry.link, function(i, link) {
if (link.type == 'text/html') {
url = link.href;
if (ctz) {
url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
}
}
});
if (allDay) {
addDays(end, -1); // make inclusive
}
events.push({
id: entry['gCal$uid']['value'],
title: entry['title']['$t'],
url: url,
start: start,
end: end,
allDay: allDay,
location: entry['gd$where'][0]['valueString'],
description: entry['content']['$t']
});
});
}
var args = [events].concat(Array.prototype.slice.call(arguments, 1));
var res = applyAll(success, this, args);
if ($.isArray(res)) {
return res;
}
return events;
}
});
}
// legacy
fc.gcalFeed = function(url, sourceOptions) {
return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' });
};
})(jQuery);
|
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.destination-in
// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.
// Note:
importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.");
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');
ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
ctx.fillRect(0, 0, 100, 50);
ctx.globalCompositeOperation = 'destination-in';
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
ctx.drawImage(offscreenCanvas2, 0, 0);
_assertPixelApprox(offscreenCanvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
t.done();
});
done();
|
var specify = require('specify')
, helpers = require('../helpers')
, timeout = helpers.timeout
, nano = helpers.nano
, nock = helpers.nock
;
var mock = nock(helpers.couch, "shared/headers")
, db = nano.use("shared_headers")
;
specify("shared_headers:setup", timeout, function (assert) {
nano.db.create("shared_headers", function (err) {
assert.equal(err, undefined, "Failed to create database");
});
});
specify("shared_headers:test", timeout, function (assert) {
db.attachment.insert("new", "att", "Hello", "text/plain",
function(error, hello) {
assert.equal(error, undefined, "Should store hello");
assert.equal(hello.ok, true, "Response should be ok");
assert.ok(hello.rev, "Should have a revision number");
nano.request({
db: "shared_headers",
doc: "new",
headers: { "If-None-Match": JSON.stringify(hello.rev) }
},
function (error, helloWorld, rh) {
assert.equal(error, undefined, "Should get the hello");
assert.equal(rh["status-code"], 304, "status is 'not modified'");
});
nano.request({
db: "shared_headers",
doc: "new",
att: "att"
},
function (error, helloWorld, rh) {
assert.equal(error, undefined, "Should get the hello");
assert.equal(rh["status-code"], 200, "status is 'ok'");
});
});
});
specify("shared_headers:teardown", timeout, function (assert) {
nano.db.destroy("shared_headers", function (err) {
assert.equal(err, undefined, "Failed to destroy database");
assert.ok(mock.isDone(), "Some mocks didn't run");
});
});
specify.run(process.argv.slice(2));
|
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
gTestfile = 'regress-327534.js';
var summary = "uneval on E4X gives Error: xml is not a function";
var BUGNUMBER = 327534;
var actual = '';
var expect = 'No Error';
printBugNumber(BUGNUMBER);
START(summary);
try
{
uneval(<x/>);
actual = 'No Error';
}
catch(ex)
{
printStatus(ex);
actual = ex + '';
}
TEST(1, expect, actual);
END();
|
/// <binding Clean='clean' ProjectOpened='watch' />
var gulp = require("gulp"),
rimraf = require("rimraf"),
concat = require("gulp-concat"),
cssmin = require("gulp-cssmin"),
ts = require('gulp-typescript'),
fs = require('fs');
// https://www.npmjs.com/package/gulp-typescript
// http://weblogs.asp.net/dwahlin/creating-a-typescript-workflow-with-gulp
var tsProject = ts.createProject('tsconfig.json');
var paths = {
webroot: "./wwwroot/"
};
paths.ts = paths.webroot + "{ts,js}/**/*.ts";
paths.css = paths.webroot + "css/**/*.css";
paths.minCss = paths.webroot + "css/**/*.min.css";
paths.concatCssDest = paths.webroot + "css/site.min.css";
gulp.task("clean", function (cb) {
rimraf(paths.concatCssDest, cb);
});
gulp.task('build:lib', function () {
function getNPMDependencies() {
var buffer, packages, keys;
buffer = fs.readFileSync('package.json');
packages = JSON.parse(buffer.toString());
keys = [];
for (var key in packages.dependencies) {
keys.push(key);
}
return keys;
}
function copyNodeModule(name) {
gulp.src('node_modules/' + name + '/**/*')
.pipe(gulp.dest('wwwroot/lib/' + name + '/'));
};
var dependencies = getNPMDependencies();
for (var i in dependencies) {
copyNodeModule(dependencies[i])
}
})
gulp.task('build:ts', function () {
var tsResult = tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest(paths.webroot));
});
gulp.task("build:css", function () {
return gulp.src([paths.css, "!" + paths.minCss])
.pipe(concat(paths.concatCssDest))
.pipe(cssmin())
.pipe(gulp.dest("."));
});
gulp.task("build", ["build:lib", "build:ts", "build:css"]);
gulp.task("min", ["build"]);
gulp.task("watch", function () {
gulp.watch([paths.css, paths.ts], ["build"]);
});
|
/* Copyright (c) 2012-2013 LevelUP contributors
* See list at <https://github.com/rvagg/node-levelup#contributing>
* MIT +no-false-attribs License <https://github.com/rvagg/node-levelup/blob/master/LICENSE>
*/
var errors = require('../lib/errors.js')
, async = require('async')
, common = require('./common')
, assert = require('referee').assert
, refute = require('referee').refute
, buster = require('bustermove')
buster.testCase('get() / put() / del()', {
'setUp': common.commonSetUp
, 'tearDown': common.commonTearDown
, 'Simple operations': {
'get() on empty database causes error': function (done) {
this.openTestDatabase(function (db) {
db.get('undefkey', function (err, value) {
refute(value)
assert.isInstanceOf(err, Error)
assert.isInstanceOf(err, errors.LevelUPError)
assert.isInstanceOf(err, errors.NotFoundError)
assert(err.notFound === true, 'err.notFound is `true`')
assert.equals(err.status, 404, 'err.status is 404')
assert.match(err, '[undefkey]')
done()
})
})
}
, 'put() and get() simple string key/value pairs': function (done) {
this.openTestDatabase(function (db) {
db.put('some key', 'some value stored in the database', function (err) {
refute(err)
db.get('some key', function (err, value) {
refute(err)
assert.equals(value, 'some value stored in the database')
done()
})
})
})
}
, 'del() on empty database doesn\'t cause error': function (done) {
this.openTestDatabase(function (db) {
db.del('undefkey', function (err) {
refute(err)
done()
})
})
}
, 'del() works on real entries': function (done) {
this.openTestDatabase(function (db) {
async.series(
[
function (callback) {
async.forEach(
['foo', 'bar', 'baz']
, function (key, callback) {
db.put(key, 1 + Math.random(), callback)
}
, callback
)
}
, function (callback) {
db.del('bar', callback)
}
, function (callback) {
async.forEach(
['foo', 'bar', 'baz']
, function (key, callback) {
db.get(key, function (err, value) {
// we should get foo & baz but not bar
if (key == 'bar') {
assert(err)
refute(value)
} else {
refute(err)
assert(value)
}
callback()
})
}
, callback
)
}
]
, done
)
})
}
}
, 'test get() throwables': function (done) {
this.openTestDatabase(function (db) {
assert.exception(
db.get.bind(db)
, { name: 'ReadError', message: 'get() requires key and callback arguments' }
, 'no-arg get() throws'
)
assert.exception(
db.get.bind(db, 'foo')
, { name: 'ReadError', message: 'get() requires key and callback arguments' }
, 'callback-less, 1-arg get() throws'
)
assert.exception(
db.get.bind(db, 'foo', {})
, { name: 'ReadError', message: 'get() requires key and callback arguments' }
, 'callback-less, 2-arg get() throws'
)
done()
})
}
, 'test put() throwables': function (done) {
this.openTestDatabase(function (db) {
assert.exception(
db.put.bind(db)
, { name: 'WriteError', message: 'put() requires key and value arguments' }
, 'no-arg put() throws'
)
assert.exception(
db.put.bind(db, 'foo')
, { name: 'WriteError', message: 'put() requires key and value arguments' }
, 'callback-less, 1-arg put() throws'
)
done()
})
}
, 'test del() throwables': function (done) {
this.openTestDatabase(function (db) {
assert.exception(
db.del.bind(db)
, { name: 'WriteError', message: 'del() requires a key argument' }
, 'no-arg del() throws'
)
done()
})
}
, 'test approximateSize() throwables': function (done) {
this.openTestDatabase(function (db) {
assert.exception(
db.approximateSize.bind(db)
, { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }
, 'no-arg approximateSize() throws'
)
assert.exception(
db.approximateSize.bind(db, 'foo')
, { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }
, 'callback-less, 1-arg approximateSize() throws'
)
assert.exception(
db.approximateSize.bind(db, 'foo', 'bar')
, { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }
, 'callback-less, 2-arg approximateSize() throws'
)
assert.exception(
db.approximateSize.bind(db, 'foo', 'bar', {})
, { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }
, 'callback-less, 3-arg approximateSize(), no cb throws'
)
done()
})
}
})
|
jQuery(document).ready(function() {
// Display initial link
jQuery("#st-clicks-tags .inside").html('<a href="#st_click_tags" id="open_clicktags">'+stHelperClickTagsL10n.show_txt+'</a><a href="#st_click_tags" id="close_clicktags">'+stHelperClickTagsL10n.hide_txt+'</a><div class="container_clicktags"></div>');
// Take current post ID
var current_post_id = jQuery('#post_ID').val();
// Show click tags
jQuery("#open_clicktags").click(function(event) {
event.preventDefault();
jQuery("#st-clicks-tags .container_clicktags")
.fadeIn('slow')
.load( ajaxurl + '?action=simpletags&stags_action=click_tags&post_id='+current_post_id, function() {
jQuery("#st-clicks-tags .container_clicktags span").click(function(event) {
event.preventDefault();
addTag(this.innerHTML);
jQuery(this).addClass('used_term');
});
jQuery("#open_clicktags").hide();
jQuery("#close_clicktags").show();
});
return false;
});
// Hide click tags
jQuery("#close_clicktags").click(function(event) {
event.preventDefault();
jQuery("#st-clicks-tags .container_clicktags").fadeOut('slow', function() {
jQuery("#open_clicktags").show();
jQuery("#close_clicktags").hide();
});
return false;
});
});
|
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
new BenchmarkSuite('StringRepeat', [10], [
new Benchmark('StringRepeat', false, false, 0,
Repeat, RepeatSetup, RepeatTearDown),
]);
new BenchmarkSuite('StringStartsWith', [10], [
new Benchmark('StringStartsWith', false, false, 0,
StartsWith, WithSetup, WithTearDown),
]);
new BenchmarkSuite('StringEndsWith', [10], [
new Benchmark('StringEndsWith', false, false, 0,
EndsWith, WithSetup, WithTearDown),
]);
new BenchmarkSuite('StringIncludes', [10], [
new Benchmark('StringIncludes', false, false, 0,
Includes, IncludesSetup, WithTearDown),
]);
new BenchmarkSuite('StringFromCodePoint', [10000], [
new Benchmark('StringFromCodePoint', false, false, 0,
FromCodePoint, FromCodePointSetup, FromCodePointTearDown),
]);
new BenchmarkSuite('StringCodePointAt', [1000], [
new Benchmark('StringCodePointAt', false, false, 0,
CodePointAt, CodePointAtSetup, CodePointAtTearDown),
]);
new BenchmarkSuite('StringCodePointAtSum', [100000], [
new Benchmark('StringCodePointAtSum', false, true, 3,
CodePointAtSum, CodePointAtSumSetup),
]);
var result;
var stringRepeatSource = "abc";
function RepeatSetup() {
result = undefined;
}
function Repeat() {
result = stringRepeatSource.repeat(500);
}
function RepeatTearDown() {
var expected = "";
for (var i = 0; i < 1000; i++) {
expected += stringRepeatSource;
}
return result === expected;
}
var str;
var substr;
function WithSetup() {
str = "abc".repeat(500);
substr = "abc".repeat(200);
result = undefined;
}
function WithTearDown() {
return !!result;
}
function StartsWith() {
result = str.startsWith(substr);
}
function EndsWith() {
result = str.endsWith(substr);
}
function IncludesSetup() {
str = "def".repeat(100) + "abc".repeat(100) + "qqq".repeat(100);
substr = "abc".repeat(100);
}
function Includes() {
result = str.includes(substr);
}
var MAX_CODE_POINT = 0xFFFFF;
const K = 1024;
function FromCodePointSetup() {
result = new Array((MAX_CODE_POINT + 1) / K);
}
function FromCodePoint() {
for (var i = 0; i <= MAX_CODE_POINT; i += K) {
result[i] = String.fromCodePoint(i);
}
}
function FromCodePointTearDown() {
for (var i = 0; i <= MAX_CODE_POINT; i += K) {
if (i !== result[i].codePointAt(0)) return false;
}
return true;
}
var allCodePoints;
function CodePointAtSetup() {
allCodePoints = new Array((MAX_CODE_POINT + 1) / K);
for (var i = 0; i <= MAX_CODE_POINT; i += K) {
allCodePoints = String.fromCodePoint(i);
}
result = undefined;
}
function CodePointAt() {
result = 0;
for (var i = 0; i <= MAX_CODE_POINT; i += K) {
result += allCodePoints.codePointAt(i);
}
}
function CodePointAtTearDown() {
return result === (MAX_CODE_POINT / K) * ((MAX_CODE_POINT / K) + 1) / 2;
}
var payload;
function CodePointAtSumSetup() {
payload = "abcdefghijklmnopqrstuvwxyz";
for(var j = 0; j < 16; ++j) payload += payload;
}
function CodePointAtSum() {
var c = 0;
for(j=payload.length-1; j >=0; --j) c+=payload.charCodeAt(j);
return c;
}
|
module.exports = function(grunt) {
grunt.registerTask("index", "Generate index.html depending on configuration", function() {
var conf = grunt.config('index'),
appTmpl = grunt.file.read(conf.src.app),
mainTmpl = grunt.file.read(conf.src.main),
mainjs = conf.js + "/main.js";
grunt.file.mkdir(conf.js);
grunt.file.write(mainjs, '//Replace with main logic')
grunt.file.write(conf.dest.app, grunt.template.process(appTmpl));
grunt.log.writeln('Generated \'' + conf.dest.app + '\' from \'' + conf.src.app + '\'');
grunt.file.write(conf.dest.main, grunt.template.process(mainTmpl));
grunt.log.writeln('Generated \'' + conf.dest.main + '\' from \'' + conf.src.main + '\'');
});
}
|
// Copyright 2014 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.
module("multipleLabelableElementsPerLabel");
test("one labelable element within a label tag", function(assert) {
var fixture = document.getElementById("qunit-fixture");
var label = document.createElement("label");
var input = document.createElement("input");
fixture.appendChild(label);
label.appendChild(input);
var config = {
ruleName: "multipleLabelableElementsPerLabel",
expected: axs.constants.AuditResult.PASS,
elements: []
};
assert.runRule(config, "passes the audit with no matching elements");
});
test("multiple labelable elements within a label tag", function(assert) {
var fixture = document.getElementById("qunit-fixture");
var label = document.createElement("label");
var input1 = document.createElement("input");
var input2 = document.createElement("input");
fixture.appendChild(label);
label.appendChild(input1);
label.appendChild(input2);
var config = {
ruleName: "multipleLabelableElementsPerLabel",
expected: axs.constants.AuditResult.FAIL,
elements: [label]
};
assert.runRule(config, "fails the audit on that label");
});
|
var class_mix_e_r_p_1_1_net_1_1_entities_1_1_public_1_1_db_crosstab3_result =
[
[ "Category1", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_public_1_1_db_crosstab3_result.html#ab67529781ecaf859d33bab346d6b44c6", null ],
[ "Category2", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_public_1_1_db_crosstab3_result.html#abe0b808367c5b2171b38874a986c0a05", null ],
[ "Category3", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_public_1_1_db_crosstab3_result.html#a0cd50b45a3007f9b4ef5480a4dfd1348", null ],
[ "RowName", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_public_1_1_db_crosstab3_result.html#af632930424ad0ca734bc14fc4f365bdb", null ]
];
|
/**
* @private
* Private Container class used by the {@link Ext.grid.RowEditor} to hold its buttons.
*/
Ext.define('Ext.grid.RowEditorButtons', {
extend: 'Ext.container.Container',
alias: 'widget.roweditorbuttons',
frame: true,
shrinkWrap: true,
position: 'bottom',
constructor: function(config) {
var me = this,
rowEditor = config.rowEditor,
cssPrefix = Ext.baseCSSPrefix,
plugin = rowEditor.editingPlugin;
config = Ext.apply({
baseCls: cssPrefix + 'grid-row-editor-buttons',
defaults: {
xtype: 'button',
ui: rowEditor.buttonUI,
scope: plugin,
flex: 1,
minWidth: Ext.panel.Panel.prototype.minButtonWidth
},
items: [{
cls: cssPrefix + 'row-editor-update-button',
itemId: 'update',
handler: plugin.completeEdit,
text: rowEditor.saveBtnText,
disabled: rowEditor.updateButtonDisabled,
listeners: {
element: 'el',
keydown: me.onUpdateKeyDown,
scope: me
}
}, {
cls: cssPrefix + 'row-editor-cancel-button',
itemId: 'cancel',
handler: plugin.cancelEdit,
text: rowEditor.cancelBtnText,
listeners: {
element: 'el',
keydown: me.onCancelKeyDown,
scope: me
}
}]
}, config);
me.callParent([config]);
me.addClsWithUI(me.position);
},
// SHIFT+TAB off the update button loops back into the last field.
onUpdateKeyDown: function(e) {
if (e.shiftKey && e.getKey() === e.TAB) {
e.stopEvent();
// Must delay the focus, otherwise the imminent keyup will TAB off that field
this.rowEditor.child(':focusable:not([isButton]):last').focus(false, true);
}
},
// TAB off the cancel button loops back into the first field.
onCancelKeyDown: function(e) {
if (!e.shiftKey && e.getKey() === e.TAB) {
e.stopEvent();
// Must delay the focus, otherwise the imminent keyup will TAB off that field
this.rowEditor.child(':focusable').focus(false, true);
}
},
setButtonPosition: function(position) {
var me = this,
rowEditor = this.rowEditor,
rowEditorHeight = rowEditor.getHeight(),
rowEditorBody = rowEditor.body,
bottom = '',
top = '';
me.removeClsWithUI(me.position);
me.position = position;
me.addClsWithUI(position);
// we tried setting the top/bottom value in the stylesheet based on form field
// height + row editor padding, but that approach does not work when there are
// larger things inside the editor, e.g. textarea, so we have to measure
// the row editor height and position the buttons accordingly (see EXTJSIV-9914).
if (position === 'top') {
bottom = (rowEditorHeight - rowEditorBody.getBorderWidth('t')) + 'px';
} else {
top = (rowEditorHeight - rowEditorBody.getBorderWidth('b')) + 'px';
}
me.el.setStyle({
top: top,
bottom: bottom
});
},
privates: {
getFramingInfoCls: function(){
return this.baseCls + '-' + this.ui + '-' + this.position;
},
getFrameInfo: function() {
var frameInfo = this.callParent();
// Trick Renderable into rendering the top framing elements, even though they
// are not needed in the default "bottom" position. This allows us to flip the
// buttons into "top" position without re-rendering.
frameInfo.top = true;
return frameInfo;
}
}
});
|
import { createFilter, makeLegalIdentifier } from 'rollup-pluginutils';
export default function json(options = {}) {
const filter = createFilter(options.include, options.exclude);
return {
name: 'json',
transform(json, id) {
if (id.slice(-5) !== '.json') return null;
if (!filter(id)) return null;
const data = JSON.parse(json);
let code = '';
const ast = {
type: 'Program',
sourceType: 'module',
start: 0,
end: null,
body: []
};
if (Object.prototype.toString.call(data) !== '[object Object]') {
code = `export default ${json};`;
ast.body.push({
type: 'ExportDefaultDeclaration',
start: 0,
end: code.length,
declaration: {
type: 'Literal',
start: 15,
end: code.length - 1,
value: null,
raw: 'null'
}
});
} else {
const indent = 'indent' in options ? options.indent : '\t';
const validKeys = [];
const invalidKeys = [];
Object.keys(data).forEach(key => {
if (key === makeLegalIdentifier(key)) {
validKeys.push(key);
} else {
invalidKeys.push(key);
}
});
let char = 0;
validKeys.forEach(key => {
const declarationType = options.preferConst ? 'const' : 'var';
const declaration = `export ${declarationType} ${key} = ${JSON.stringify(data[key])};`;
const start = char;
const end = start + declaration.length;
// generate fake AST node while we're here
ast.body.push({
type: 'ExportNamedDeclaration',
start: char,
end: char + declaration.length,
declaration: {
type: 'VariableDeclaration',
start: start + 7, // 'export '.length
end,
declarations: [
{
type: 'VariableDeclarator',
start: start + 7 + declarationType.length + 1, // `export ${declarationType} `.length
end: end - 1,
id: {
type: 'Identifier',
start: start + 7 + declarationType.length + 1, // `export ${declarationType} `.length
end: start + 7 + declarationType.length + 1 + key.length, // `export ${declarationType} ${key}`.length
name: key
},
init: {
type: 'Literal',
start: start +
7 +
declarationType.length +
1 +
key.length +
3, // `export ${declarationType} ${key} = `.length
end: end - 1,
value: null,
raw: 'null'
}
}
],
kind: declarationType
},
specifiers: [],
source: null
});
char = end + 1;
code += `${declaration}\n`;
});
const defaultExportNode = {
type: 'ExportDefaultDeclaration',
start: char,
end: null,
declaration: {
type: 'ObjectExpression',
start: char + 15,
end: null,
properties: []
}
};
char += 17 + indent.length; // 'export default {\n\t'.length'
const defaultExportRows = validKeys
.map(key => {
const row = `${key}: ${key}`;
const start = char;
const end = start + row.length;
defaultExportNode.declaration.properties.push({
type: 'Property',
start,
end,
method: false,
shorthand: false,
computed: false,
key: {
type: 'Identifier',
start,
end: start + key.length,
name: key
},
value: {
type: 'Identifier',
start: start + key.length + 2,
end,
name: key
},
kind: 'init'
});
char += row.length + (2 + indent.length); // ',\n\t'.length
return row;
})
.concat(
invalidKeys.map(key => `"${key}": ${JSON.stringify(data[key])}`)
);
code += `export default {\n${indent}${defaultExportRows.join(`,\n${indent}`)}\n};`;
ast.body.push(defaultExportNode);
const end = code.length;
defaultExportNode.declaration.end = end - 1;
defaultExportNode.end = end;
}
ast.end = code.length;
return { ast, code, map: { mappings: '' } };
}
};
}
|
// Copyright 2008 The Closure Library Authors. 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.
/**
* @fileoverview Default renderer for {@link goog.ui.TabBar}s. Based on the
* original {@code TabPane} code.
*
* @author attila@google.com (Attila Bodis)
* @author eae@google.com (Emil A. Eklund)
*/
goog.provide('goog.ui.TabBarRenderer');
goog.require('goog.a11y.aria.Role');
goog.require('goog.object');
goog.require('goog.ui.ContainerRenderer');
/**
* Default renderer for {@link goog.ui.TabBar}s, based on the {@code TabPane}
* code. The tab bar's DOM structure is determined by its orientation and
* location relative to tab contents. For example, a horizontal tab bar
* located above tab contents looks like this:
* <pre>
* <div class="goog-tab-bar goog-tab-bar-horizontal goog-tab-bar-top">
* ...(tabs here)...
* </div>
* </pre>
* @constructor
* @extends {goog.ui.ContainerRenderer}
*/
goog.ui.TabBarRenderer = function() {
goog.ui.ContainerRenderer.call(this, goog.a11y.aria.Role.TAB_LIST);
};
goog.inherits(goog.ui.TabBarRenderer, goog.ui.ContainerRenderer);
goog.addSingletonGetter(goog.ui.TabBarRenderer);
goog.tagUnsealableClass(goog.ui.TabBarRenderer);
/**
* Default CSS class to be applied to the root element of components rendered
* by this renderer.
* @type {string}
*/
goog.ui.TabBarRenderer.CSS_CLASS = goog.getCssName('goog-tab-bar');
/**
* Returns the CSS class name to be applied to the root element of all tab bars
* rendered or decorated using this renderer.
* @return {string} Renderer-specific CSS class name.
* @override
*/
goog.ui.TabBarRenderer.prototype.getCssClass = function() {
return goog.ui.TabBarRenderer.CSS_CLASS;
};
/**
* Sets the tab bar's state based on the given CSS class name, encountered
* during decoration. Overrides the superclass implementation by recognizing
* class names representing tab bar orientation and location.
* @param {goog.ui.Container} tabBar Tab bar to configure.
* @param {string} className CSS class name.
* @param {string} baseClass Base class name used as the root of state-specific
* class names (typically the renderer's own class name).
* @protected
* @override
*/
goog.ui.TabBarRenderer.prototype.setStateFromClassName = function(tabBar,
className, baseClass) {
// Create the class-to-location lookup table on first access.
if (!this.locationByClass_) {
this.createLocationByClassMap_();
}
// If the class name corresponds to a location, update the tab bar's location;
// otherwise let the superclass handle it.
var location = this.locationByClass_[className];
if (location) {
tabBar.setLocation(location);
} else {
goog.ui.TabBarRenderer.superClass_.setStateFromClassName.call(this, tabBar,
className, baseClass);
}
};
/**
* Returns all CSS class names applicable to the tab bar, based on its state.
* Overrides the superclass implementation by appending the location-specific
* class name to the list.
* @param {goog.ui.Container} tabBar Tab bar whose CSS classes are to be
* returned.
* @return {!Array.<string>} Array of CSS class names applicable to the tab bar.
* @override
*/
goog.ui.TabBarRenderer.prototype.getClassNames = function(tabBar) {
var classNames = goog.ui.TabBarRenderer.superClass_.getClassNames.call(this,
tabBar);
// Create the location-to-class lookup table on first access.
if (!this.classByLocation_) {
this.createClassByLocationMap_();
}
// Apped the class name corresponding to the tab bar's location to the list.
classNames.push(this.classByLocation_[tabBar.getLocation()]);
return classNames;
};
/**
* Creates the location-to-class lookup table.
* @private
*/
goog.ui.TabBarRenderer.prototype.createClassByLocationMap_ = function() {
var baseClass = this.getCssClass();
/**
* Map of locations to location-specific structural class names,
* precomputed and cached on first use to minimize object allocations
* and string concatenation.
* @type {Object}
* @private
*/
this.classByLocation_ = goog.object.create(
goog.ui.TabBar.Location.TOP, goog.getCssName(baseClass, 'top'),
goog.ui.TabBar.Location.BOTTOM, goog.getCssName(baseClass, 'bottom'),
goog.ui.TabBar.Location.START, goog.getCssName(baseClass, 'start'),
goog.ui.TabBar.Location.END, goog.getCssName(baseClass, 'end'));
};
/**
* Creates the class-to-location lookup table, used during decoration.
* @private
*/
goog.ui.TabBarRenderer.prototype.createLocationByClassMap_ = function() {
// We need the classByLocation_ map so we can transpose it.
if (!this.classByLocation_) {
this.createClassByLocationMap_();
}
/**
* Map of location-specific structural class names to locations, used during
* element decoration. Precomputed and cached on first use to minimize object
* allocations and string concatenation.
* @type {Object}
* @private
*/
this.locationByClass_ = goog.object.transpose(this.classByLocation_);
};
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @example: const rReadFile = promisify<Buffer, string>(fs.readFile);
*
*/
exports.promisify = function (func) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new Promise(function (resolve, reject) {
func.apply(void 0, args.concat([function (err, response) {
if (err) {
return reject(err);
}
resolve(response);
}]));
});
};
};
|
/*global window, Backbone, arangoHelper, _ */
window.arangoDocumentModel = Backbone.Model.extend({
initialize: function () {
'use strict';
},
urlRoot: "/_api/document",
defaults: {
_id: "",
_rev: "",
_key: ""
},
getSorted: function () {
'use strict';
var self = this;
var keys = Object.keys(self.attributes).sort(function (l, r) {
var l1 = arangoHelper.isSystemAttribute(l);
var r1 = arangoHelper.isSystemAttribute(r);
if (l1 !== r1) {
if (l1) {
return -1;
}
return 1;
}
return l < r ? -1 : 1;
});
var sorted = {};
_.each(keys, function (k) {
sorted[k] = self.attributes[k];
});
return sorted;
}
});
|
/*
* Copyright 2015-present Open Networking Laboratory
*
* 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.
*/
/*
ONOS GUI -- Topo View -- Topo Panel Service - Unit Tests
*/
describe('factory: view/topo/topoPanel.js', function() {
var $log, fs, tps, bns, ps, panelLayer;
var mockWindow = {
innerWidth: 300,
innerHeight: 100,
navigator: {
userAgent: 'defaultUA'
},
on: function () {},
addEventListener: function () {}
};
beforeEach(module('ovTopo', 'onosUtil', 'onosLayer', 'ngRoute', 'onosNav',
'onosWidget', 'onosMast'));
beforeEach(function () {
module(function ($provide) {
$provide.value('$window', mockWindow);
});
});
beforeEach(inject(function (_$log_, FnService,
TopoPanelService, ButtonService, PanelService) {
$log = _$log_;
fs = FnService;
tps = TopoPanelService;
bns = ButtonService;
ps = PanelService;
panelLayer = d3.select('body').append('div').attr('id', 'floatpanels');
}));
afterEach(function () {
panelLayer.remove();
});
it('should define TopoPanelService', function () {
expect(tps).toBeDefined();
});
it('should define api functions', function () {
expect(fs.areFunctions(tps, [
'initPanels',
'destroyPanels',
'createTopoPanel',
'showSummary',
'toggleSummary',
'hideSummary',
'toggleUseDetailsFlag',
'displaySingle',
'displayMulti',
'displayLink',
'displayNothing',
'displaySomething',
'addAction',
'detailVisible',
'summaryVisible'
])).toBeTruthy();
});
// === topoPanel api ------------------
it('should define topoPanel api functions', function () {
var panel = tps.createTopoPanel('foo');
expect(fs.areFunctions(panel, [
'panel', 'setup', 'destroy',
'appendHeader', 'appendBody', 'appendFooter',
'adjustHeight'
])).toBeTruthy();
panel.destroy();
});
it('should allow you to get panel', function () {
var panel = tps.createTopoPanel('foo');
expect(panel.panel()).toBeTruthy();
panel.destroy();
});
it('should set up panel', function () {
var p = tps.createTopoPanel('foo'),
h, b, f;
p.setup();
expect(p.panel().el().selectAll('div').size()).toBe(3);
h = p.panel().el().select('.header');
expect(h.empty()).toBe(false);
b = p.panel().el().select('.body');
expect(b.empty()).toBe(false);
f = p.panel().el().select('.footer');
expect(f.empty()).toBe(false);
p.destroy();
});
it('should destroy panel', function () {
spyOn(ps, 'destroyPanel').and.callThrough();
var p = tps.createTopoPanel('foo');
p.destroy();
expect(ps.destroyPanel).toHaveBeenCalledWith('foo');
});
it('should append to panel', function () {
var p = tps.createTopoPanel('foo');
p.setup();
p.appendHeader('div').attr('id', 'header-div');
expect(p.panel().el().select('#header-div').empty()).toBe(false);
p.appendBody('p').attr('id', 'body-paragraph');
expect(p.panel().el().select('#body-paragraph').empty()).toBe(false);
p.appendFooter('svg').attr('id', 'footer-svg');
expect(p.panel().el().select('#footer-svg').empty()).toBe(false);
p.destroy();
});
it('should warn if fromTop not given, adjustHeight', function () {
spyOn($log, 'warn');
var p = tps.createTopoPanel('foo');
p.adjustHeight();
expect($log.warn).toHaveBeenCalledWith(
'adjustHeight: height from top of page not given'
);
p.destroy();
});
xit('should warn if panel is not setup/defined, adjustHeight', function () {
spyOn($log, 'warn');
var p = tps.createTopoPanel('foo');
p.adjustHeight(50);
expect($log.warn).toHaveBeenCalledWith(
'adjustHeight: panel contents are not defined'
);
p.destroy();
});
// TODO: test adjustHeight height adjustment
// TODO: more tests...
});
|
el.addEventListener(eventName, eventHandler);
|
var _ = require('lodash'),
util = require('util'),
errors = require('ghost-ignition').errors;
function GhostError(options) {
options = options || {};
this.value = options.value;
errors.IgnitionError.call(this, options);
}
// jscs:disable
var ghostErrors = {
DataExportError: function DataExportError(options) {
GhostError.call(this, _.merge({
statusCode: 500,
errorType: 'DataExportError'
}, options));
},
DataImportError: function DataImportError(options) {
GhostError.call(this, _.merge({
statusCode: 500,
errorType: 'DataImportError'
}, options));
},
DatabaseVersionError: function DatabaseVersionError(options) {
GhostError.call(this, _.merge({
hideStack: true,
statusCode: 500,
errorType: 'DatabaseVersionError'
}, options));
},
DatabaseNotPopulatedError: function DatabaseNotPopulatedError(options) {
GhostError.call(this, _.merge({
statusCode: 500,
errorType: 'DatabaseNotPopulatedError'
}, options));
},
DatabaseNotSeededError: function DatabaseNotSeededError(options) {
GhostError.call(this, _.merge({
statusCode: 500,
errorType: 'DatabaseNotSeededError'
}, options));
},
EmailError: function EmailError(options) {
GhostError.call(this, _.merge({
statusCode: 500,
errorType: 'EmailError'
}, options));
},
ThemeValidationError: function ThemeValidationError(options) {
GhostError.call(this, _.merge({
statusCode: 422,
errorType: 'ThemeValidationError',
errorDetails: {}
}, options));
}
};
util.inherits(GhostError, errors.IgnitionError);
_.each(ghostErrors, function (error) {
util.inherits(error, GhostError);
});
// we need to inherit all general errors from GhostError, otherwise we have to check instanceof IgnitionError
_.each(errors, function (error) {
if (error.name === 'IgnitionError' || typeof error === 'object') {
return;
}
util.inherits(error, GhostError);
});
module.exports = _.merge(ghostErrors, errors);
module.exports.GhostError = GhostError;
|
{
"VALIDATOR.FIELDREQUIRED": "Completare il campo \"%s\", che è obbligatorio.",
"HASMANYFILEFIELD.UPLOADING": "Invio file... %s",
"TABLEFIELD.DELETECONFIRMMESSAGE": "Si è sicuri di voler eliminare questo elemento?",
"LOADING": "caricamento...",
"UNIQUEFIELD.SUGGESTED": "Cambiare il valore di '%s': %s",
"UNIQUEFIELD.ENTERNEWVALUE": "È necessario scegliere un'altro valore per questo campo",
"UNIQUEFIELD.CANNOTLEAVEEMPTY": "Questo campo non può essere lasciato vuoto",
"RESTRICTEDTEXTFIELD.CHARCANTBEUSED": "Il carattere '%s' non può essere utilizzato in questo campo",
"UPDATEURL.CONFIRM": "Volete cambiare l'URL in:\n\n%s/\n\nClicca OK per cambiare l'URL, clicca Annuler per lasciarla a:\n\n%s",
"UPDATEURL.CONFIRMURLCHANGED": "The URL has been changed to\n'%s'",
"FILEIFRAMEFIELD.DELETEFILE": "Delete File",
"FILEIFRAMEFIELD.UNATTACHFILE": "Un-Attach File",
"FILEIFRAMEFIELD.DELETEIMAGE": "Delete Image",
"FILEIFRAMEFIELD.CONFIRMDELETE": "Are you sure you want to delete this file?",
"LeftAndMain.IncompatBrowserWarning": "Your browser is not compatible with the CMS interface. Please use Internet Explorer 7+, Google Chrome 10+ or Mozilla Firefox 3.5+.",
"GRIDFIELD.ERRORINTRANSACTION": "An error occured while fetching data from the server\n Please try again later.",
"HtmlEditorField.SelectAnchor": "Select an anchor",
"UploadField.ConfirmDelete": "Are you sure you want to remove this file from the server filesystem?",
"UploadField.PHP_MAXFILESIZE": "File exceeds upload_max_filesize (php.ini directive)",
"UploadField.HTML_MAXFILESIZE": "File exceeds MAX_FILE_SIZE (HTML form directive)",
"UploadField.ONLYPARTIALUPLOADED": "File was only partially uploaded",
"UploadField.NOFILEUPLOADED": "No File was uploaded",
"UploadField.NOTMPFOLDER": "Missing a temporary folder",
"UploadField.WRITEFAILED": "Failed to write file to disk",
"UploadField.STOPEDBYEXTENSION": "File upload stopped by extension",
"UploadField.TOOLARGE": "Filesize is too large",
"UploadField.TOOSMALL": "Filesize is too small",
"UploadField.INVALIDEXTENSION": "Extension is not allowed",
"UploadField.MAXNUMBEROFFILESSIMPLE": "Max number of files exceeded",
"UploadField.UPLOADEDBYTES": "Uploaded bytes exceed file size",
"UploadField.EMPTYRESULT": "Empty file upload result",
"UploadField.LOADING": "Loading ...",
"UploadField.Editing": "Editing ...",
"UploadField.Uploaded": "Uploaded",
"UploadField.OVERWRITEWARNING": "File with the same name already exists",
"TreeDropdownField.ENTERTOSEARCH": "Press enter to search",
"TreeDropdownField.OpenLink": "Open",
"TreeDropdownField.FieldTitle": "Choose",
"TreeDropdownField.SearchFieldTitle": "Choose or Search"
}
|
"use strict";
exports.__esModule = true;
exports.bar = exports.foo = void 0;
var foo, bar;
exports.bar = bar;
exports.foo = foo;
|
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* @fileOverview The "div" plugin. It wraps the selected block level elements with a 'div' element with specified styles and attributes.
*
*/
(function()
{
CKEDITOR.plugins.add( 'div',
{
requires : [ 'editingblock', 'domiterator', 'styles' ],
init : function( editor )
{
var lang = editor.lang.div;
editor.addCommand( 'creatediv', new CKEDITOR.dialogCommand( 'creatediv' ) );
editor.addCommand( 'editdiv', new CKEDITOR.dialogCommand( 'editdiv' ) );
editor.addCommand( 'removediv',
{
exec : function( editor )
{
var selection = editor.getSelection(),
ranges = selection && selection.getRanges(),
range,
bookmarks = selection.createBookmarks(),
walker,
toRemove = [];
function findDiv( node )
{
var path = new CKEDITOR.dom.elementPath( node ),
blockLimit = path.blockLimit,
div = blockLimit.is( 'div' ) && blockLimit;
if ( div && !div.data( 'cke-div-added' ) )
{
toRemove.push( div );
div.data( 'cke-div-added' );
}
}
for ( var i = 0 ; i < ranges.length ; i++ )
{
range = ranges[ i ];
if ( range.collapsed )
findDiv( selection.getStartElement() );
else
{
walker = new CKEDITOR.dom.walker( range );
walker.evaluator = findDiv;
walker.lastForward();
}
}
for ( i = 0 ; i < toRemove.length ; i++ )
toRemove[ i ].remove( true );
selection.selectBookmarks( bookmarks );
}
} );
editor.ui.addButton( 'CreateDiv',
{
label : lang.toolbar,
command :'creatediv'
} );
if ( editor.addMenuItems )
{
editor.addMenuItems(
{
editdiv :
{
label : lang.edit,
command : 'editdiv',
group : 'div',
order : 1
},
removediv:
{
label : lang.remove,
command : 'removediv',
group : 'div',
order : 5
}
} );
if ( editor.contextMenu )
{
editor.contextMenu.addListener( function( element, selection )
{
if ( !element || element.isReadOnly() )
return null;
var elementPath = new CKEDITOR.dom.elementPath( element ),
blockLimit = elementPath.blockLimit;
if ( blockLimit && blockLimit.getAscendant( 'div', true ) )
{
return {
editdiv : CKEDITOR.TRISTATE_OFF,
removediv : CKEDITOR.TRISTATE_OFF
};
}
return null;
} );
}
}
CKEDITOR.dialog.add( 'creatediv', this.path + 'dialogs/div.js' );
CKEDITOR.dialog.add( 'editdiv', this.path + 'dialogs/div.js' );
}
} );
})();
|
/* String streams are the things fed to parsers (which can feed them
* to a tokenizer if they want). They provide peek and next methods
* for looking at the current character (next 'consumes' this
* character, peek does not), and a get method for retrieving all the
* text that was consumed since the last time get was called.
*
* An easy mistake to make is to let a StopIteration exception finish
* the token stream while there are still characters pending in the
* string stream (hitting the end of the buffer while parsing a
* token). To make it easier to detect such errors, the strings throw
* an exception when this happens.
*/
// Make a string stream out of an iterator that returns strings. This
// is applied to the result of traverseDOM (see codemirror.js), and
// the resulting stream is fed to the parser.
window.stringStream = function(source){
source = iter(source);
// String that's currently being iterated over.
var current = "";
// Position in that string.
var pos = 0;
// Accumulator for strings that have been iterated over but not
// get()-ed yet.
var accum = "";
// Make sure there are more characters ready, or throw
// StopIteration.
function ensureChars() {
while (pos == current.length) {
accum += current;
current = ""; // In case source.next() throws
pos = 0;
try {current = source.next();}
catch (e) {
if (e != StopIteration) throw e;
else return false;
}
}
return true;
}
return {
// Return the next character in the stream.
peek: function() {
if (!ensureChars()) return null;
return current.charAt(pos);
},
// Get the next character, throw StopIteration if at end, check
// for unused content.
next: function() {
if (!ensureChars()) {
if (accum.length > 0)
throw "End of stringstream reached without emptying buffer ('" + accum + "').";
else
throw StopIteration;
}
return current.charAt(pos++);
},
// Return the characters iterated over since the last call to
// .get().
get: function() {
var temp = accum;
accum = "";
if (pos > 0){
temp += current.slice(0, pos);
current = current.slice(pos);
pos = 0;
}
return temp;
},
// Push a string back into the stream.
push: function(str) {
current = current.slice(0, pos) + str + current.slice(pos);
},
lookAhead: function(str, consume, skipSpaces, caseInsensitive) {
function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
str = cased(str);
var found = false;
var _accum = accum, _pos = pos;
if (skipSpaces) this.nextWhile(matcher(/[\s\u00a0]/));
while (true) {
var end = pos + str.length, left = current.length - pos;
if (end <= current.length) {
found = str == cased(current.slice(pos, end));
pos = end;
break;
}
else if (str.slice(0, left) == cased(current.slice(pos))) {
accum += current; current = "";
try {current = source.next();}
catch (e) {break;}
pos = 0;
str = str.slice(left);
}
else {
break;
}
}
if (!(found && consume)) {
current = accum.slice(_accum.length) + current;
pos = _pos;
accum = _accum;
}
return found;
},
// Utils built on top of the above
more: function() {
return this.peek() !== null;
},
applies: function(test) {
var next = this.peek();
return (next !== null && test(next));
},
nextWhile: function(test) {
while (this.applies(test))
this.next();
},
equals: function(ch) {
return ch === this.peek();
},
endOfLine: function() {
var next = this.peek();
return next == null || next == "\n";
}
};
};
|
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* @fileOverview Defines {@link CKEDITOR#verbosity} and binary flags {@link CKEDITOR#VERBOSITY_WARN} and
* {@link CKEDITOR#VERBOSITY_ERROR}. Defines also the {@link CKEDITOR#error} and {@link CKEDITOR#warn} functions
* and the default handler for the {@link CKEDITOR#log} event.
*/
/* global console */
'use strict';
/**
* Warning reporting verbosity level. When {@link CKEDITOR#verbosity} is set to this value, only {@link CKEDITOR#warn}
* messages will be output to the console. It is a binary flag so it might be combined with
* the {@link CKEDITOR#VERBOSITY_ERROR} flag.
*
* @since 4.5.4
* @readonly
* @property {Number} [=1]
* @member CKEDITOR
*/
CKEDITOR.VERBOSITY_WARN = 1;
/**
* Error reporting verbosity level. When {@link CKEDITOR#verbosity} is set to this value, only {@link CKEDITOR#error}
* messages will be output to the console. It is a binary flag so it might be combined with
* the {@link CKEDITOR#VERBOSITY_WARN} flag.
*
* @since 4.5.4
* @readonly
* @property {Number} [=2]
* @member CKEDITOR
*/
CKEDITOR.VERBOSITY_ERROR = 2;
/**
* Verbosity of {@link CKEDITOR#error} and {@link CKEDITOR#warn} methods. Accepts binary flags
* {@link CKEDITOR#VERBOSITY_WARN} and {@link CKEDITOR#VERBOSITY_ERROR}.
*
* CKEDITOR.verbosity = 0; // No console output after CKEDITOR.warn and CKEDITOR.error methods.
* CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN; // Console output after CKEDITOR.warn only.
* CKEDITOR.verbosity = CKEDITOR.VERBOSITY_ERROR; // Console output after CKEDITOR.error only.
* CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR; // Console output after both methods.
*
* Default value enables both {@link CKEDITOR#VERBOSITY_WARN} and {@link CKEDITOR#VERBOSITY_ERROR}.
*
* @since 4.5.4
* @member CKEDITOR
* @type {Number}
*/
CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR;
/**
* Warning reporting function. When {@link CKEDITOR#verbosity} has the {@link CKEDITOR#VERBOSITY_WARN} flag set, it fires
* the {@link CKEDITOR#log} event with type set to `warn`. Fired event contains also provided `errorCode` and `additionalData`.
*
* @since 4.5.4
* @member CKEDITOR
* @param {String} errorCode Error code describing reported problem.
* @param {Object} [additionalData] Additional data associated with reported problem.
*/
CKEDITOR.warn = function( errorCode, additionalData ) {
if ( CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN ) {
CKEDITOR.fire( 'log', { type: 'warn', errorCode: errorCode, additionalData: additionalData } );
}
};
/**
* Error reporting function. When {@link CKEDITOR#verbosity} has {@link CKEDITOR#VERBOSITY_ERROR} flag set, it fires
* {@link CKEDITOR#log} event with the type set to `error`. The fired event also contains the provided `errorCode` and
* `additionalData`.
*
* @since 4.5.4
* @member CKEDITOR
* @param {String} errorCode Error code describing the reported problem.
* @param {Object} [additionalData] Additional data associated with the reported problem.
*/
CKEDITOR.error = function( errorCode, additionalData ) {
if ( CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR ) {
CKEDITOR.fire( 'log', { type: 'error', errorCode: errorCode, additionalData: additionalData } );
}
};
/**
* Fired by {@link CKEDITOR#warn} and {@link CKEDITOR#error} methods.
* Default listener logs provided information to the console.
*
* This event can be used to provide a custom error/warning handler:
*
* CKEDTIOR.on( 'log', function( evt ) {
* // Cancel default listener.
* evt.cancel();
* // Log event data.
* console.log( evt.data.type, evt.data.errorCode, evt.data.additionalData );
* } );
*
* @since 4.5.4
* @event log
* @member CKEDITOR
* @param data
* @param {String} data.type Log type. Can be `error` or `warn`.
* @param {String} data.errorCode Error code describing the reported problem.
* @param {Object} [data.additionalData] Additional data associated with this log event.
*/
CKEDITOR.on( 'log', function( evt ) {
if ( !window.console || !window.console.log ) {
return;
}
var type = console[ evt.data.type ] ? evt.data.type : 'log',
errorCode = evt.data.errorCode,
additionalData = evt.data.additionalData,
prefix = '[CKEDITOR] ',
errorCodeLabel = 'Error code: ';
if ( additionalData ) {
console[ type ]( prefix + errorCodeLabel + errorCode + '.', additionalData );
} else {
console[ type ]( prefix + errorCodeLabel + errorCode + '.' );
}
console[ type ]( prefix + 'For more information about this error go to http://docs.ckeditor.com/#!/guide/dev_errors-section-' + errorCode );
}, null, null, 999 );
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* DecimalLiteral :: DecimalIntegerLiteral
*
* @path ch07/7.8/7.8.3/S7.8.3_A1.1_T2.js
* @description DecimalIntegerLiteral :: NoNZeroDigit DecimalDigits
*/
//CHECK#1
if (11 !== 11) {
$ERROR('#1: 11 === 11');
}
//CHECK#2
if (22 !== 22) {
$ERROR('#2: 22 === 22');
}
//CHECK#3
if (33 !== 33) {
$ERROR('#3: 33 === 33');
}
//CHECK#4
if (44 !== 44) {
$ERROR('#4: 44 === 44');
}
//CHECK#5
if (55 !== 55) {
$ERROR('#5: 55 === 55');
}
//CHECK#6
if (66 !== 66) {
$ERROR('#6: 66 === 66');
}
//CHECK#7
if (77 !== 77) {
$ERROR('#7: 77 === 77');
}
//CHECK#8
if (88 !== 88) {
$ERROR('#8: 88 === 88');
}
//CHECK#9
if (99 !== 99) {
$ERROR('#9: 99 === 99');
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* The "continue" token can not be used as identifier
*
* @path ch07/7.6/7.6.1/7.6.1.1/S7.6.1.1_A1.4.js
* @description Checking if execution of "contunue=1" fails
* @negative
*/
continue = 1;
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* waldemar, rogerl, pschwartau@netscape.com
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
*
* Date: 04 Feb 2002
* SUMMARY: regexp backreferences must hold |undefined| if not used
*
* See http://bugzilla.mozilla.org/show_bug.cgi?id=123437 (SpiderMonkey)
* See http://bugzilla.mozilla.org/show_bug.cgi?id=123439 (Rhino)
*
*/
//-----------------------------------------------------------------------------
var i = 0;
var BUGNUMBER = 123437;
var summary = 'regexp backreferences must hold |undefined| if not used';
var status = '';
var statusmessages = new Array();
var pattern = '';
var patterns = new Array();
var string = '';
var strings = new Array();
var actualmatch = '';
var actualmatches = new Array();
var expectedmatch = '';
var expectedmatches = new Array();
pattern = /(a)?a/;
string = 'a';
status = inSection(1);
actualmatch = string.match(pattern);
expectedmatch = Array('a', undefined);
addThis();
pattern = /a|(b)/;
string = 'a';
status = inSection(2);
actualmatch = string.match(pattern);
expectedmatch = Array('a', undefined);
addThis();
pattern = /(a)?(a)/;
string = 'a';
status = inSection(3);
actualmatch = string.match(pattern);
expectedmatch = Array('a', undefined, 'a');
addThis();
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function addThis()
{
statusmessages[i] = status;
patterns[i] = pattern;
strings[i] = string;
actualmatches[i] = actualmatch;
expectedmatches[i] = expectedmatch;
i++;
}
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
exitFunc ('test');
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
// some daylight savings time cases
var DST_END_1998 = GetDSTEnd(TimeFromYear(1998));
addTestCase( DST_END_1998 );
new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
var start = TimeFromYear(YearFromTime(t));
var stop = TimeFromYear(YearFromTime(t) + 1);
for (var d = start; d < stop; d += msPerDay)
{
new TestCase( SECTION,
"(new Date("+d+")).getDate()",
DateFromTime(LocalTime(d)),
(new Date(d)).getDate() );
}
}
|
var helpers = require('./helpers'),
should = require('should'),
needle = require('./../'),
server;
var port = 7707;
describe('Basic Auth', function() {
before(function(done) {
server = helpers.server({ port: port }, done);
})
after(function(done) {
server.close(done);
})
///////////////// helpers
var get_auth = function(header) {
var token = header.split(/\s+/).pop();
return token && new Buffer(token, 'base64').toString().split(':');
}
describe('when neither username or password are passed', function() {
it('doesnt send any Authorization headers', function(done) {
needle.get('localhost:' + port, { parse: true }, function(err, resp) {
var sent_headers = resp.body.headers;
Object.keys(sent_headers).should.not.include('authorization');
done();
})
})
})
describe('when username is an empty string, and password is a valid string', function() {
var opts = { username: '', password: 'foobar', parse: true };
it('doesnt send any Authorization headers', function(done) {
needle.get('localhost:' + port, { parse: true }, function(err, resp) {
var sent_headers = resp.body.headers;
Object.keys(sent_headers).should.not.include('authorization');
done();
})
})
});
describe('when username is a valid string, but no username is passed', function() {
var opts = { username: 'foobar', parse: true };
it('sends Authorization header', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
Object.keys(sent_headers).should.include('authorization');
done();
})
})
it('Basic Auth only includes username, without colon', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
var auth = get_auth(sent_headers['authorization']);
auth[0].should.equal('foobar');
auth.should.have.lengthOf(1);
done();
})
})
})
describe('when username is a valid string, and password is null', function() {
var opts = { username: 'foobar', password: null, parse: true };
it('sends Authorization header', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
Object.keys(sent_headers).should.include('authorization');
done();
})
})
it('Basic Auth only includes both username and password', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
var auth = get_auth(sent_headers['authorization']);
auth[0].should.equal('foobar');
auth[1].should.equal('');
done();
})
})
})
describe('when username is a valid string, and password is an empty string', function() {
var opts = { username: 'foobar', password: '', parse: true };
it('sends Authorization header', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
Object.keys(sent_headers).should.include('authorization');
done();
})
})
it('Basic Auth only includes both username and password', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
var auth = get_auth(sent_headers['authorization']);
auth[0].should.equal('foobar');
auth[1].should.equal('');
auth.should.have.lengthOf(2);
done();
})
})
})
describe('when username AND password are non empty strings', function() {
var opts = { username: 'foobar', password: 'jakub', parse: true };
it('sends Authorization header', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
Object.keys(sent_headers).should.include('authorization');
done();
})
})
it('Basic Auth only includes both user and password', function(done) {
needle.get('localhost:' + port, opts, function(err, resp) {
var sent_headers = resp.body.headers;
var auth = get_auth(sent_headers['authorization']);
auth[0].should.equal('foobar');
auth[1].should.equal('jakub');
auth.should.have.lengthOf(2);
done();
})
})
})
})
|
/// Copyright (c) 2009 Microsoft Corporation
///
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// * Neither the name of Microsoft nor the names of its contributors may be used to
/// endorse or promote products derived from this software without specific prior written permission.
///
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ES5Harness.registerTest( {
id: "15.2.3.3-4-60",
path: "TestCases/chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-60.js",
description: "Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Array.prototype.reduceRight)",
test: function testcase() {
var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduceRight");
if (desc.value === Array.prototype.reduceRight &&
desc.writable === true &&
desc.enumerable === false &&
desc.configurable === true) {
return true;
}
},
precondition: function prereq() {
return fnExists(Object.getOwnPropertyDescriptor);
}
});
|
/**
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
* Build: `lodash modularize modern exports="npm" -o ./npm/`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
var baseCreate = require('lodash._basecreate'),
isObject = require('lodash.isobject'),
setBindData = require('lodash._setbinddata');
/**
* Used for `Array` method references.
*
* Normally `Array.prototype` would suffice, however, using an array literal
* avoids issues in Narwhal.
*/
var arrayRef = [];
/** Native method shortcuts */
var push = arrayRef.push;
/**
* The base implementation of `_.bind` that creates the bound function and
* sets its meta data.
*
* @private
* @param {Array} bindData The bind data array.
* @returns {Function} Returns the new bound function.
*/
function baseBind(bindData) {
var func = bindData[0],
partialArgs = bindData[2],
thisArg = bindData[4];
function bound() {
// `Function#bind` spec
// http://es5.github.io/#x15.3.4.5
if (partialArgs) {
var args = partialArgs.slice();
push.apply(args, arguments);
}
// mimic the constructor's `return` behavior
// http://es5.github.io/#x13.2.2
if (this instanceof bound) {
// ensure `new bound` is an instance of `func`
var thisBinding = baseCreate(func.prototype),
result = func.apply(thisBinding, args || arguments);
return isObject(result) ? result : thisBinding;
}
return func.apply(thisArg, args || arguments);
}
setBindData(bound, bindData);
return bound;
}
module.exports = baseBind;
|
/**
* MenuOptionWidget is an option widget that looks like a menu item. The class is used with
* OO.ui.MenuSelectWidget to create a menu of mutually exclusive options. Please see
* the [OOjs UI documentation on MediaWiki] [1] for more information.
*
* [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options#Menu_selects_and_options
*
* @class
* @extends OO.ui.DecoratedOptionWidget
*
* @constructor
* @param {Object} [config] Configuration options
*/
OO.ui.MenuOptionWidget = function OoUiMenuOptionWidget( config ) {
// Configuration initialization
config = $.extend( { icon: 'check' }, config );
// Parent constructor
OO.ui.MenuOptionWidget.super.call( this, config );
// Initialization
this.$element
.attr( 'role', 'menuitem' )
.addClass( 'oo-ui-menuOptionWidget' );
};
/* Setup */
OO.inheritClass( OO.ui.MenuOptionWidget, OO.ui.DecoratedOptionWidget );
/* Static Properties */
OO.ui.MenuOptionWidget.static.scrollIntoViewOnSelect = true;
|
// "class" for customizing select2 (with possibility to create selection items on the fly
// Appropriated from http://jsfiddle.net/7AvKZ/59/
// Only minor changes made to this class - largely the original
function Select2Tagging(items,formatProperty, multienabled) {
if(!formatProperty) {
formatProperty="text";
}
if (typeof multienabled === "undefined") {
multienabled = true;
}
var f={};
f.formatProperty=formatProperty;
f.data=items;
var itemMap={};
$.each(items,function(index,value){
itemMap[value.id]=value;
});
f.initSelection = function(element, callback) {
var data = [];
var eleVal=element.val();
var ids = eleVal.split(",");
$(ids).each(function() {
var id=this;
$(f.data).each(function() {
if (id.localeCompare(""+this.id)==0) data.push(this);
});
});
callback(data);
};
f.createSearchChoice = function(term, data) {
if ($(data).filter(function() {
return this[f.formatProperty].localeCompare(term) === 0;
//return this.text.localeCompare(term) === 0;
}
).length === 0) {
var result= {
id: term,
//text: term
};
result[f.formatProperty]=term;
return result;
}
};
formatResult=function(item) {
if(item[f.formatProperty]) {
return item[f.formatProperty];
} else {
return item;
}
};
formatSelection=function(item) {
if(item[f.formatProperty]) {
return item[f.formatProperty];
} else {
return item;
}
};
f.formatResult= formatResult;
f.formatSelection= formatSelection;
f.multiple = multienabled;
return f;
}
function AdhocCtrl($scope, $http, Analyzer, Tokenizer, Filter, Data){
$scope.analyzer = Analyzer;
$scope.tokenizer = Tokenizer;
$scope.filter = Filter;
$scope.data = Data;
$scope.tokenizerSelection = [];
$scope.filterSelection = [];
//Select2 requires objects in format of {id:0, name: 'val'}
//Convert our tokenizer array into a local object
var availTokenizers = [];
for (i in $scope.tokenizer.tokenizers) {
availTokenizers.push( {id: i, name: $scope.tokenizer.tokenizers[i]});
}
$scope.tokenizerAllOptions = new Select2Tagging(availTokenizers, 'name', false);
//Select2 requires objects in format of {id:0, name: 'val'}
//Convert our filter array into a local object
var availFilters = [];
for (i in $scope.filter.filters) {
availFilters.push( {id: i, name: $scope.filter.filters[i]});
}
$scope.filterAllOptions = new Select2Tagging(availFilters, 'name');
$scope.$watch('tokenizerSelection', function(selection) {
$scope.analyzeAdhoc($scope.tokenizerSelection, $scope.filterSelection);
});
$scope.$watch('filterSelection', function(selection) {
$scope.analyzeAdhoc($scope.tokenizerSelection, $scope.filterSelection);
});
//If the text changes, query ES to get the tokens
$scope.$watch('analyzer.query', function(value){
$scope.analyzeAdhoc($scope.tokenizerSelection, $scope.filterSelection);
});
$scope.analyzeAdhoc = function(tokenizer, filters) {
//tokenizer must be supplied, filters is optional
if (typeof tokenizer === "undefined" || tokenizer.length == 0)
return;
var filterList = [];
for (i in filters) {
filterList.push(filters[i].name);
}
filterList = filterList.join(",");
var path = $scope.data.host + "/rtf/_analyze?tokenizer=" + tokenizer.name + "&filters=" + filterList;
$http.post(path, $scope.analyzer.query)
.success(function(response){
var tokens = [];
for(i in response.tokens){
tokens.push(response.tokens[i]);
}
$scope.analyzer.atext['adhoc'] = tokens;
})
.error(function(data, status, headers, config){
//console.log(data);
});
}
};
|
defineSuite([
'DataSources/ColorMaterialProperty',
'Core/Color',
'Core/JulianDate',
'Core/TimeInterval',
'DataSources/ConstantProperty',
'DataSources/TimeIntervalCollectionProperty'
], function(
ColorMaterialProperty,
Color,
JulianDate,
TimeInterval,
ConstantProperty,
TimeIntervalCollectionProperty) {
'use strict';
it('constructor provides the expected defaults', function() {
var property = new ColorMaterialProperty();
expect(property.color).toBeUndefined();
expect(property.getType()).toEqual('Color');
expect(property.isConstant).toBe(true);
var result = property.getValue();
expect(result.color).toEqual(Color.WHITE);
var colorProperty = new ConstantProperty(Color.BLUE);
property = new ColorMaterialProperty(colorProperty);
expect(property.color).toBe(colorProperty);
property = new ColorMaterialProperty(Color.BLUE);
expect(property.color).toBeInstanceOf(ConstantProperty);
expect(property.color.getValue()).toEqual(Color.BLUE);
});
it('works with constant values', function() {
var property = new ColorMaterialProperty();
property.color = new ConstantProperty(Color.RED);
var result = property.getValue(JulianDate.now());
expect(result.color).toEqual(Color.RED);
});
it('works with dynamic values', function() {
var property = new ColorMaterialProperty();
property.color = new TimeIntervalCollectionProperty();
var start = new JulianDate(1, 0);
var stop = new JulianDate(2, 0);
property.color.intervals.addInterval(new TimeInterval({
start : start,
stop : stop,
data : Color.BLUE
}));
expect(property.isConstant).toBe(false);
var result = property.getValue(start);
expect(result.color).toEqual(Color.BLUE);
});
it('works with a result parameter', function() {
var property = new ColorMaterialProperty();
property.color = new ConstantProperty(Color.RED);
var result = {
color : Color.BLUE.clone()
};
var returnedResult = property.getValue(JulianDate.now(), result);
expect(returnedResult).toBe(result);
expect(result.color).toEqual(Color.RED);
});
it('equals works', function() {
var left = new ColorMaterialProperty();
left.color = new ConstantProperty(Color.WHITE);
var right = new ColorMaterialProperty();
right.color = new ConstantProperty(Color.WHITE);
expect(left.equals(right)).toEqual(true);
right.color = new ConstantProperty(Color.BLACK);
expect(left.equals(right)).toEqual(false);
});
it('raises definitionChanged when a color property is assigned or modified', function() {
var property = new ColorMaterialProperty();
var listener = jasmine.createSpy('listener');
property.definitionChanged.addEventListener(listener);
var oldValue = property.color;
property.color = new ConstantProperty(Color.WHITE);
expect(listener).toHaveBeenCalledWith(property, 'color', property.color, oldValue);
listener.calls.reset();
property.color.setValue(Color.BLACK);
expect(listener).toHaveBeenCalledWith(property, 'color', property.color, property.color);
listener.calls.reset();
property.color = property.color;
expect(listener.calls.count()).toEqual(0);
});
});
|
$(document).ready(function() {
pre_content = $("#jalpc_site_pv").html();
$("#jalpc_site_pv").html(pre_content);
$.ajax({
type: "get",
async: false,
url: "https://vps.jack003.com:8443/api/v1.0/jalpc/pv_count",
dataType: "jsonp",
jsonp: "callback",
jsonpCallback: "flightHandler",
success: function(json) {
var website_count = json.data;
$("#jalpc_site_pv").html('<span class="navy">' + website_count + '</span> <span data-i18n="link.view">views</span> || ' + pre_content);
},
error: function() {
console.log('fail');
}
});
});
|
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v12.0.2
* @link http://www.ag-grid.com/
* @license MIT
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var context_1 = require("../context/context");
var column_1 = require("../entities/column");
var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
var utils_1 = require("../utils");
var AutoGroupColService = (function () {
function AutoGroupColService() {
}
AutoGroupColService_1 = AutoGroupColService;
AutoGroupColService.prototype.createAutoGroupColumns = function (rowGroupColumns) {
var _this = this;
var groupAutoColumns = [];
// if doing groupMultiAutoColumn, then we call the method multiple times, once
// for each column we are grouping by
if (this.gridOptionsWrapper.isGroupMultiAutoColumn()) {
rowGroupColumns.forEach(function (rowGroupCol, index) {
groupAutoColumns.push(_this.createOneAutoGroupColumn(rowGroupCol, index));
});
}
else {
groupAutoColumns.push(this.createOneAutoGroupColumn(null));
}
return groupAutoColumns;
};
// rowGroupCol and index are missing if groupMultiAutoColumn=false
AutoGroupColService.prototype.createOneAutoGroupColumn = function (rowGroupCol, index) {
// if one provided by user, use it, otherwise create one
var defaultAutoColDef = this.generateDefaultColDef(rowGroupCol, index);
var userAutoColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();
// if doing multi, set the field
var colId;
if (rowGroupCol) {
colId = AutoGroupColService_1.GROUP_AUTO_COLUMN_ID + "-" + rowGroupCol.getId();
}
else {
colId = AutoGroupColService_1.GROUP_AUTO_COLUMN_BUNDLE_ID;
}
utils_1._.mergeDeep(defaultAutoColDef, userAutoColDef);
defaultAutoColDef.colId = colId;
//If the user is not telling us his preference with regards wether the filtering
//should be suppressed, we suppress it if there are no leaf nodes
if (userAutoColDef == null || userAutoColDef.suppressFilter == null) {
var produceLeafNodeValues = defaultAutoColDef.field != null || defaultAutoColDef.valueGetter != null;
defaultAutoColDef.suppressFilter = !produceLeafNodeValues;
}
// if showing many cols, we don't want to show more than one with a checkbox for selection
if (index > 0) {
defaultAutoColDef.headerCheckboxSelection = false;
}
var newCol = new column_1.Column(defaultAutoColDef, colId, true);
this.context.wireBean(newCol);
return newCol;
};
AutoGroupColService.prototype.generateDefaultColDef = function (rowGroupCol, index) {
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var defaultAutoColDef = {
headerName: localeTextFunc('group', 'Group'),
cellRenderer: 'group'
};
// we never allow moving the group column
defaultAutoColDef.suppressMovable = true;
if (rowGroupCol) {
var rowGroupColDef = rowGroupCol.getColDef();
utils_1._.assign(defaultAutoColDef, {
// cellRendererParams.groupKey: colDefToCopy.field;
headerName: rowGroupColDef.headerName,
headerValueGetter: rowGroupColDef.headerValueGetter
});
defaultAutoColDef.showRowGroup = rowGroupCol.getColId();
}
else {
defaultAutoColDef.showRowGroup = true;
}
return defaultAutoColDef;
};
AutoGroupColService.GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn';
AutoGroupColService.GROUP_AUTO_COLUMN_BUNDLE_ID = AutoGroupColService_1.GROUP_AUTO_COLUMN_ID;
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
], AutoGroupColService.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('context'),
__metadata("design:type", context_1.Context)
], AutoGroupColService.prototype, "context", void 0);
AutoGroupColService = AutoGroupColService_1 = __decorate([
context_1.Bean('autoGroupColService')
], AutoGroupColService);
return AutoGroupColService;
var AutoGroupColService_1;
}());
exports.AutoGroupColService = AutoGroupColService;
|
var _curry2 = require('./internal/_curry2');
var curryN = require('./curryN');
/**
* Returns a function of arity `n` from a (manually) curried function.
*
* @func
* @memberOf R
* @since v0.14.0
* @category Function
* @sig Number -> (a -> b) -> (a -> c)
* @param {Number} length The arity for the returned function.
* @param {Function} fn The function to uncurry.
* @return {Function} A new function.
* @see R.curry
* @example
*
* var addFour = a => b => c => d => a + b + c + d;
*
* var uncurriedAddFour = R.uncurryN(4, addFour);
* uncurriedAddFour(1, 2, 3, 4); //=> 10
*/
module.exports = _curry2(function uncurryN(depth, fn) {
return curryN(depth, function() {
var currentDepth = 1;
var value = fn;
var idx = 0;
var endIdx;
while (currentDepth <= depth && typeof value === 'function') {
endIdx = currentDepth === depth ? arguments.length : idx + value.length;
value = value.apply(this, Array.prototype.slice.call(arguments, idx, endIdx));
currentDepth += 1;
idx = endIdx;
}
return value;
});
});
|
'use strict';
const pMap = (iterable, mapper, options) => new Promise((resolve, reject) => {
options = Object.assign({
concurrency: Infinity
}, options);
if (typeof mapper !== 'function') {
throw new TypeError('Mapper function is required');
}
const {concurrency} = options;
if (!(typeof concurrency === 'number' && concurrency >= 1)) {
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`);
}
const ret = [];
const iterator = iterable[Symbol.iterator]();
let isRejected = false;
let isIterableDone = false;
let resolvingCount = 0;
let currentIndex = 0;
const next = () => {
if (isRejected) {
return;
}
const nextItem = iterator.next();
const i = currentIndex;
currentIndex++;
if (nextItem.done) {
isIterableDone = true;
if (resolvingCount === 0) {
resolve(ret);
}
return;
}
resolvingCount++;
Promise.resolve(nextItem.value)
.then(element => mapper(element, i))
.then(
value => {
ret[i] = value;
resolvingCount--;
next();
},
error => {
isRejected = true;
reject(error);
}
);
};
for (let i = 0; i < concurrency; i++) {
next();
if (isIterableDone) {
break;
}
}
});
module.exports = pMap;
// TODO: Remove this for the next major release
module.exports.default = pMap;
|
version https://git-lfs.github.com/spec/v1
oid sha256:0b4fbf0fb52fb83da41c6260b4a892ed640289c3aeea37becbf67d4337683b10
size 2424
|
// Tests that a library wrapper has to pass
module("Library wrapper");
test("can.trim", function () {
});
test("can.makeArray", function () {
deepEqual([], can.makeArray(null), "Empty argument creates empty array");
var array = ['one', 'two', 'three'];
var made = can.makeArray(array);
notEqual(array, can.makeArray(array), "Should return a cloned version of the array");
});
test("can.isArray", function () {
});
test("can.inArray", function () {
equal(-1, can.inArray('test'), 'Passing an undefined array returns -1');
})
test("can.isPlainObject", function () {
});
test("can.extend", function () {
});
test("can.isEmptyObject", function () {
});
|
/**
* @author sunag / http://www.sunag.com.br/
*/
THREE.FloatNode = function( value ) {
THREE.InputNode.call( this, 'fv1', { share: false } );
this.value = [ value || 0 ];
};
THREE.FloatNode.prototype = Object.create( THREE.InputNode.prototype );
THREE.FloatNode.prototype.constructor = THREE.FloatNode;
Object.defineProperties( THREE.FloatNode.prototype, {
number: {
get: function() {
return this.value[ 0 ];
},
set: function( val ) {
this.value[ 0 ] = val;
}
}
} );
|
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'button', 'it', {
selectedLabel: '%1 (selezionato)'
} );
|
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v11.0.0
* @link http://www.ag-grid.com/
* @license MIT
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
var gridOptionsWrapper_1 = require("./gridOptionsWrapper");
var context_1 = require("./context/context");
var context_2 = require("./context/context");
var LoggerFactory = (function () {
function LoggerFactory() {
}
LoggerFactory.prototype.setBeans = function (gridOptionsWrapper) {
this.logging = gridOptionsWrapper.isDebug();
};
LoggerFactory.prototype.create = function (name) {
return new Logger(name, this.isLogging.bind(this));
};
LoggerFactory.prototype.isLogging = function () {
return this.logging;
};
return LoggerFactory;
}());
__decorate([
__param(0, context_2.Qualifier('gridOptionsWrapper')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [gridOptionsWrapper_1.GridOptionsWrapper]),
__metadata("design:returntype", void 0)
], LoggerFactory.prototype, "setBeans", null);
LoggerFactory = __decorate([
context_1.Bean('loggerFactory')
], LoggerFactory);
exports.LoggerFactory = LoggerFactory;
var Logger = (function () {
function Logger(name, isLoggingFunc) {
this.name = name;
this.isLoggingFunc = isLoggingFunc;
}
Logger.prototype.isLogging = function () {
return this.isLoggingFunc();
};
Logger.prototype.log = function (message) {
if (this.isLoggingFunc()) {
console.log('ag-Grid.' + this.name + ': ' + message);
}
};
return Logger;
}());
exports.Logger = Logger;
|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* The value of the internal [[Prototype]] property of the Boolean
* prototype object is the Object prototype object
*
* @path ch15/15.6/15.6.4/S15.6.4_A2.js
* @description Checking Object.prototype.isPrototypeOf(Boolean.prototype)
*/
//CHECK#1
if (!Object.prototype.isPrototypeOf(Boolean.prototype)) {
$ERROR('#1: Object prototype object is the prototype of Boolean prototype object');
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* Comma Operator evaluates all Expressions and returns the last of them
*
* @path ch11/11.14/S11.14_A3.js
* @description Checking with "="
*/
//CHECK#1
var x = 0;
var y = 0;
var z = 0;
if ((x = 1, y = 2, z = 3) !== 3) {
$ERROR('#1: var x = 0; var y = 0; var z = 0; (x = 1, y = 2, z = 3) === 3. Actual: ' + ((x = 1, y = 2, z = 3)));
}
var x = 0;
var y = 0;
var z = 0;
x = 1, y = 2, z = 3;
//CHECK#2
if (x !== 1) {
$ERROR('#2: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; x === 1. Actual: ' + (x));
}
//CHECK#3
if (y !== 2) {
$ERROR('#3: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; y === 2. Actual: ' + (y));
}
//CHECK#4
if (z !== 3) {
$ERROR('#4: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; z === 3. Actual: ' + (z));
}
|
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var async_1 = require('../scheduler/async');
var isDate_1 = require('../util/isDate');
var Subscriber_1 = require('../Subscriber');
var Notification_1 = require('../Notification');
/**
* Delays the emission of items from the source Observable by a given timeout or
* until a given Date.
*
* <span class="informal">Time shifts each item by some specified amount of
* milliseconds.</span>
*
* <img src="./img/delay.png" width="100%">
*
* If the delay argument is a Number, this operator time shifts the source
* Observable by that amount of time expressed in milliseconds. The relative
* time intervals between the values are preserved.
*
* If the delay argument is a Date, this operator time shifts the start of the
* Observable execution until the given date occurs.
*
* @example <caption>Delay each click by one second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var delayedClicks = clicks.delay(1000); // each click emitted after 1 second
* delayedClicks.subscribe(x => console.log(x));
*
* @example <caption>Delay all clicks until a future date happens</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var date = new Date('March 15, 2050 12:00:00'); // in the future
* var delayedClicks = clicks.delay(date); // click emitted only after that date
* delayedClicks.subscribe(x => console.log(x));
*
* @see {@link debounceTime}
* @see {@link delayWhen}
*
* @param {number|Date} delay The delay duration in milliseconds (a `number`) or
* a `Date` until which the emission of the source items is delayed.
* @param {Scheduler} [scheduler=async] The IScheduler to use for
* managing the timers that handle the time-shift for each item.
* @return {Observable} An Observable that delays the emissions of the source
* Observable by the specified timeout or Date.
* @method delay
* @owner Observable
*/
function delay(delay, scheduler) {
if (scheduler === void 0) { scheduler = async_1.async; }
var absoluteDelay = isDate_1.isDate(delay);
var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };
}
exports.delay = delay;
var DelayOperator = (function () {
function DelayOperator(delay, scheduler) {
this.delay = delay;
this.scheduler = scheduler;
}
DelayOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
};
return DelayOperator;
}());
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
var DelaySubscriber = (function (_super) {
__extends(DelaySubscriber, _super);
function DelaySubscriber(destination, delay, scheduler) {
_super.call(this, destination);
this.delay = delay;
this.scheduler = scheduler;
this.queue = [];
this.active = false;
this.errored = false;
}
DelaySubscriber.dispatch = function (state) {
var source = state.source;
var queue = source.queue;
var scheduler = state.scheduler;
var destination = state.destination;
while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
queue.shift().notification.observe(destination);
}
if (queue.length > 0) {
var delay_1 = Math.max(0, queue[0].time - scheduler.now());
this.schedule(state, delay_1);
}
else {
this.unsubscribe();
source.active = false;
}
};
DelaySubscriber.prototype._schedule = function (scheduler) {
this.active = true;
this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
source: this, destination: this.destination, scheduler: scheduler
}));
};
DelaySubscriber.prototype.scheduleNotification = function (notification) {
if (this.errored === true) {
return;
}
var scheduler = this.scheduler;
var message = new DelayMessage(scheduler.now() + this.delay, notification);
this.queue.push(message);
if (this.active === false) {
this._schedule(scheduler);
}
};
DelaySubscriber.prototype._next = function (value) {
this.scheduleNotification(Notification_1.Notification.createNext(value));
};
DelaySubscriber.prototype._error = function (err) {
this.errored = true;
this.queue = [];
this.destination.error(err);
};
DelaySubscriber.prototype._complete = function () {
this.scheduleNotification(Notification_1.Notification.createComplete());
};
return DelaySubscriber;
}(Subscriber_1.Subscriber));
var DelayMessage = (function () {
function DelayMessage(time, notification) {
this.time = time;
this.notification = notification;
}
return DelayMessage;
}());
//# sourceMappingURL=delay.js.map
|
var esc = Handlebars.Utils.escapeExpression;
Discourse.BBCode.register('quote', {noWrap: true, singlePara: true}, function(contents, bbParams, options) {
var params = {'class': 'quote'},
username = null;
if (bbParams) {
var paramsSplit = bbParams.split(/\,\s*/);
username = paramsSplit[0];
paramsSplit.forEach(function(p,i) {
if (i > 0) {
var assignment = p.split(':');
if (assignment[0] && assignment[1]) {
var escaped = esc(assignment[0]);
// don't escape attributes, makes no sense
if(escaped === assignment[0]) {
params['data-' + assignment[0]] = esc(assignment[1].trim());
}
}
}
});
}
var avatarImg;
if (options.lookupAvatarByPostNumber) {
// client-side, we can retrieve the avatar from the post
var postNumber = parseInt(params['data-post'], 10);
avatarImg = options.lookupAvatarByPostNumber(postNumber);
} else if (options.lookupAvatar) {
// server-side, we need to lookup the avatar from the username
avatarImg = options.lookupAvatar(username);
}
// If there's no username just return a simple quote
if (!username) {
return ['p', ['aside', params, ['blockquote'].concat(contents)]];
}
return ['aside', params,
['div', {'class': 'title'},
['div', {'class': 'quote-controls'}],
avatarImg ? ['__RAW', avatarImg] : "",
username ? I18n.t('user.said', {username: username}) : ""
],
['blockquote'].concat(contents)
];
});
|
/*!
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015
* @package yii2-widgets
* @subpackage yii2-widget-datepicker
* @version 1.3.3
*
* Extension to bootstrap datepicker to use noconflict approach
* so that the plugin does not conflict with other jquery plugins
* of similar name
*
* Built for Yii Framework 2.0
* Author: Kartik Visweswaran
* Year: 2015
* For more Yii related demos visit http://demos.krajee.com
*/
var initDPRemove = function() {
}, initDPAddon = function() {
};
(function ($) {
$.fn.kvDatepicker = $.fn.datepicker.noConflict();
initDPRemove = function(id, range) {
var $id = $('#' + id), $el = $id.parent();
$el.find('.kv-date-remove').on('click.kvdatepicker', function() {
if (range) {
$el.find('input[type="text"]').each(function() {
$(this).kvDatepicker('clearDates');
});
} else {
$el.kvDatepicker('clearDates');
}
});
};
initDPAddon = function(id) {
var $id = $('#' + id), $el = $id.parent();
$el.find('.input-group-addon:not(.kv-date-calendar):not(.kv-date-remove)').each(function() {
var $addon = $(this);
$addon.on('click.kvdatepicker', function(e) {
$el.kvDatepicker('hide');
});
});
};
})(window.jQuery);
|
define([
"../core",
"../core/init",
"../deferred"
], function( jQuery ) {
// The deferred used on DOM ready
var readyList;
jQuery.fn.ready = function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
};
jQuery.extend({
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
}
});
/**
* The ready event handler and self cleanup method
*/
function completed() {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
jQuery.ready();
}
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready );
} else {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed, false );
}
}
return readyList.promise( obj );
};
// Kick off the DOM ready check even if the user does not
jQuery.ready.promise();
});
|
// IE8 doesn't like using var dnnModule = dnnModule || {}
if (typeof dnnModule === "undefined" || dnnModule === null) { dnnModule = {}; };
dnnModule.DigitalAssetsSearchBox = function ($, $scope, servicesFramework) {
var onSearchFunction = null;
function search() {
var newPattern = $("#dnnModuleDigitalAssetsSearchBox>input.searchInput", $scope).val();
newPattern = $.trim(newPattern);
if (onSearchFunction) {
onSearchFunction(newPattern);
}
}
function clearSearch() {
$("#dnnModuleDigitalAssetsSearchBox>input.searchInput", $scope).val('');
}
function doSearch(currentFolderId, pattern, startIndex, numItems, sortExpression, before, done, fail, always) {
var contentServiceUrl = servicesFramework.getServiceRoot('DigitalAssets') + 'ContentService/';
before();
$.ajax({
url: contentServiceUrl + "SearchFolderContent",
data: {
"folderId": currentFolderId,
"pattern": pattern,
"startIndex": startIndex,
"numItems": numItems,
"sortExpression": sortExpression
},
type: "POST",
beforeSend: servicesFramework.setModuleHeaders
}).done(done).fail(fail).always(always);
};
function init () {
$("#dnnModuleDigitalAssetsSearchBox>input.searchInput", $scope).keypress(function(e) {
if (e.which == 13) {
e.preventDefault();
search();
return false;
}
return true;
});
$("#dnnModuleDigitalAssetsSearchBox>a.searchButton", $scope).click(function(e) {
e.preventDefault();
search();
return false;
});
}
function onSearch(onSearchFunc) {
onSearchFunction = onSearchFunc;
}
function highlightItemName(pattern, itemName) {
if (!pattern || pattern == "" || pattern.indexOf("?") != -1) {
return itemName;
}
if (pattern.lastIndexOf("*") == pattern.length - 1) { // example*
pattern = pattern.substring(0, pattern.length - 1);
if (pattern.lastIndexOf("*") == 0) { // *example* --> Highlight al occurrences
pattern = pattern.substring(1, pattern.length);
if (pattern.indexOf("*") == -1) {
var matches = itemName.match(new RegExp(pattern, "i"));
if (matches) {
for (var i = 0; i < matches.length; i++) {
itemName = itemName.replace(matches[i], "<font class='dnnModuleDigitalAssetsHighlight'>" + matches[i] + "</font>");
}
}
}
return itemName;
}
}
if (pattern.indexOf("*") == -1) { // highlight the beginning
itemName = "<font class='dnnModuleDigitalAssetsHighlight'>" + itemName.substring(0, pattern.length) + "</font>" +
itemName.substring(pattern.length);
}
return itemName;
}
return {
init: init,
doSearch: doSearch,
onSearch: onSearch,
clearSearch: clearSearch,
highlightItemName: highlightItemName,
};
}
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'fas';
var iconName = 'beer';
var width = 448;
var height = 512;
var ligatures = [];
var unicode = 'f0fc';
var svgPathData = 'M368 96h-48V56c0-13.255-10.745-24-24-24H24C10.745 32 0 42.745 0 56v400c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24v-42.11l80.606-35.977C429.396 365.063 448 336.388 448 304.86V176c0-44.112-35.888-80-80-80zm16 208.86a16.018 16.018 0 0 1-9.479 14.611L320 343.805V160h48c8.822 0 16 7.178 16 16v128.86zM208 384c-8.836 0-16-7.164-16-16V144c0-8.836 7.164-16 16-16s16 7.164 16 16v224c0 8.836-7.164 16-16 16zm-96 0c-8.836 0-16-7.164-16-16V144c0-8.836 7.164-16 16-16s16 7.164 16 16v224c0 8.836-7.164 16-16 16z';
exports.definition = {
prefix: prefix,
iconName: iconName,
icon: [
width,
height,
ligatures,
unicode,
svgPathData
]};
exports.faBeer = exports.definition;
exports.prefix = prefix;
exports.iconName = iconName;
exports.width = width;
exports.height = height;
exports.ligatures = ligatures;
exports.unicode = unicode;
exports.svgPathData = svgPathData;
|
/*! jQuery UI styling wrapper for Select
* ©2018 SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-jqui', 'datatables.net-select'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net-jqui')(root, $).$;
}
if ( ! $.fn.dataTable.select ) {
require('datatables.net-select')(root, $);
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
return $.fn.dataTable;
}));
|
/**
* jQuery EasyUI 1.5
*
* Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved.
*
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
* To use it on other terms please contact us: info@jeasyui.com
*
*/
(function($){
function _1(_2){
$(_2).addClass("progressbar");
$(_2).html("<div class=\"progressbar-text\"></div><div class=\"progressbar-value\"><div class=\"progressbar-text\"></div></div>");
$(_2).bind("_resize",function(e,_3){
if($(this).hasClass("easyui-fluid")||_3){
_4(_2);
}
return false;
});
return $(_2);
};
function _4(_5,_6){
var _7=$.data(_5,"progressbar").options;
var _8=$.data(_5,"progressbar").bar;
if(_6){
_7.width=_6;
}
_8._size(_7);
_8.find("div.progressbar-text").css("width",_8.width());
_8.find("div.progressbar-text,div.progressbar-value").css({height:_8.height()+"px",lineHeight:_8.height()+"px"});
};
$.fn.progressbar=function(_9,_a){
if(typeof _9=="string"){
var _b=$.fn.progressbar.methods[_9];
if(_b){
return _b(this,_a);
}
}
_9=_9||{};
return this.each(function(){
var _c=$.data(this,"progressbar");
if(_c){
$.extend(_c.options,_9);
}else{
_c=$.data(this,"progressbar",{options:$.extend({},$.fn.progressbar.defaults,$.fn.progressbar.parseOptions(this),_9),bar:_1(this)});
}
$(this).progressbar("setValue",_c.options.value);
_4(this);
});
};
$.fn.progressbar.methods={options:function(jq){
return $.data(jq[0],"progressbar").options;
},resize:function(jq,_d){
return jq.each(function(){
_4(this,_d);
});
},getValue:function(jq){
return $.data(jq[0],"progressbar").options.value;
},setValue:function(jq,_e){
if(_e<0){
_e=0;
}
if(_e>100){
_e=100;
}
return jq.each(function(){
var _f=$.data(this,"progressbar").options;
var _10=_f.text.replace(/{value}/,_e);
var _11=_f.value;
_f.value=_e;
$(this).find("div.progressbar-value").width(_e+"%");
$(this).find("div.progressbar-text").html(_10);
if(_11!=_e){
_f.onChange.call(this,_e,_11);
}
});
}};
$.fn.progressbar.parseOptions=function(_12){
return $.extend({},$.parser.parseOptions(_12,["width","height","text",{value:"number"}]));
};
$.fn.progressbar.defaults={width:"auto",height:22,value:0,text:"{value}%",onChange:function(_13,_14){
}};
})(jQuery);
|
var wasDefinedAlready = (com["trolltech"] != undefined);
__setupPackage__("com.trolltech");
com.trolltech.wasDefinedAlready = wasDefinedAlready;
com.trolltech.name = __extension__;
com.trolltech.level = com.level + 1;
com.trolltech.postInitCallCount = 0;
com.trolltech.originalPostInit = __postInit__;
__postInit__ = function() { ++com.trolltech.postInitCallCount; };
|
/*************************************************************************
* tranSMART - translational medicine data mart
*
* Copyright 2008-2012 Janssen Research & Development, LLC.
*
* This product includes software developed at Janssen Research & Development, LLC.
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later version, along with the following terms:
* 1. You may convey a work based on this program in accordance with section 5, provided that you retain the above notices.
* 2. You may convey verbatim copies of this program code as you receive it, in any medium, provided that you retain the above notices.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
******************************************************************/
d2hStoreMenuItems("TL_57", [["../../Modules/4/Documents/javasecuritywarnings.htm", "right", "Java Security Warnings"]]);
|
'use strict';
var warn = require('./lib/warning');
var hasLocalStorage = 'localStorage' in global;
var ls, testKey;
if (hasLocalStorage) {
testKey = 'react-localstorage.mixin.test-key';
try {
// Access to global `localStorage` property must be guarded as it
// fails under iOS private session mode.
ls = global.localStorage;
ls.setItem(testKey, 'foo');
ls.removeItem(testKey);
} catch (e) {
hasLocalStorage = false;
}
}
// Warn if localStorage cannot be found or accessed.
if (process.browser) {
warn(
hasLocalStorage,
'localStorage not found. Component state will not be stored to localStorage.'
);
}
module.exports = {
/**
* Error checking. On update, ensure that the last state stored in localStorage is equal
* to the state on the component. We skip the check the first time around as state is left
* alone until mount to keep server rendering working.
*
* If it is not consistent, we know that someone else is modifying localStorage out from under us, so we throw
* an error.
*
* There are a lot of ways this can happen, so it is worth throwing the error.
*/
componentWillUpdate: function(nextProps, nextState) {
if (!hasLocalStorage || !this.__stateLoadedFromLS) return;
var key = getLocalStorageKey(this);
if (key === false) return;
var prevStoredState = ls.getItem(key);
if (prevStoredState && process.env.NODE_ENV !== "production") {
warn(
prevStoredState === JSON.stringify(getSyncState(this, this.state)),
'While component ' + getDisplayName(this) + ' was saving state to localStorage, ' +
'the localStorage entry was modified by another actor. This can happen when multiple ' +
'components are using the same localStorage key. Set the property `localStorageKey` ' +
'on ' + getDisplayName(this) + '.'
);
}
// Since setState() can't be called in CWU, it's a fine time to save the state.
ls.setItem(key, JSON.stringify(getSyncState(this, nextState)));
},
/**
* Load data.
* This seems odd to do this on componentDidMount, but it prevents server checksum errors.
* This is because the server has no way to know what is in your localStorage. So instead
* of breaking the checksum and causing a full rerender, we instead change the component after mount
* for an efficient diff.
*/
componentDidMount: function () {
if (!hasLocalStorage) return;
var me = this;
loadStateFromLocalStorage(this, function() {
// After setting state, mirror back to localstorage.
// This prevents invariants if the developer has changed the initial state of the component.
ls.setItem(getLocalStorageKey(me), JSON.stringify(getSyncState(me, me.state)));
});
}
};
function loadStateFromLocalStorage(component, cb) {
if (!ls) return;
var key = getLocalStorageKey(component);
if (key === false) return;
var settingState = false;
try {
var storedState = JSON.parse(ls.getItem(key));
if (storedState) {
settingState = true;
component.setState(storedState, done);
}
} catch(e) {
// eslint-disable-next-line no-console
if (console) console.warn("Unable to load state for", getDisplayName(component), "from localStorage.");
}
// If we didn't set state, run the callback right away.
if (!settingState) done();
function done() {
// Flag this component as loaded.
component.__stateLoadedFromLS = true;
cb();
}
}
function getDisplayName(component) {
// at least, we cannot get displayname
// via this.displayname in react 0.12
return component.displayName || component.constructor.displayName || component.constructor.name;
}
function getLocalStorageKey(component) {
if (component.getLocalStorageKey) return component.getLocalStorageKey();
if (component.props.localStorageKey === false) return false;
if (typeof component.props.localStorageKey === 'function') return component.props.localStorageKey.call(component);
return component.props.localStorageKey || getDisplayName(component) || 'react-localstorage';
}
function getStateFilterKeys(component) {
if (component.getStateFilterKeys) {
return typeof component.getStateFilterKeys() === 'string' ?
[component.getStateFilterKeys()] : component.getStateFilterKeys();
}
return typeof component.props.stateFilterKeys === 'string' ?
[component.props.stateFilterKeys] : component.props.stateFilterKeys;
}
/**
* Filters state to only save keys defined in stateFilterKeys.
* If stateFilterKeys is not set, returns full state.
*/
function getSyncState(component, state) {
var stateFilterKeys = getStateFilterKeys(component);
if (!stateFilterKeys || !state) return state;
var result = {}, key;
for (var i = 0; i < stateFilterKeys.length; i++) {
key = stateFilterKeys[i];
if (state.hasOwnProperty(key)) result[key] = state[key];
}
return result;
}
|
module["exports"] = [
"Agrigento",
"Alessandria",
"Ancona",
"Aosta",
"Arezzo",
"Ascoli Piceno",
"Asti",
"Avellino",
"Bari",
"Barletta-Andria-Trani",
"Belluno",
"Benevento",
"Bergamo",
"Biella",
"Bologna",
"Bolzano",
"Brescia",
"Brindisi",
"Cagliari",
"Caltanissetta",
"Campobasso",
"Carbonia-Iglesias",
"Caserta",
"Catania",
"Catanzaro",
"Chieti",
"Como",
"Cosenza",
"Cremona",
"Crotone",
"Cuneo",
"Enna",
"Fermo",
"Ferrara",
"Firenze",
"Foggia",
"Forlì-Cesena",
"Frosinone",
"Genova",
"Gorizia",
"Grosseto",
"Imperia",
"Isernia",
"La Spezia",
"L'Aquila",
"Latina",
"Lecce",
"Lecco",
"Livorno",
"Lodi",
"Lucca",
"Macerata",
"Mantova",
"Massa-Carrara",
"Matera",
"Messina",
"Milano",
"Modena",
"Monza e della Brianza",
"Napoli",
"Novara",
"Nuoro",
"Olbia-Tempio",
"Oristano",
"Padova",
"Palermo",
"Parma",
"Pavia",
"Perugia",
"Pesaro e Urbino",
"Pescara",
"Piacenza",
"Pisa",
"Pistoia",
"Pordenone",
"Potenza",
"Prato",
"Ragusa",
"Ravenna",
"Reggio Calabria",
"Reggio Emilia",
"Rieti",
"Rimini",
"Roma",
"Rovigo",
"Salerno",
"Medio Campidano",
"Sassari",
"Savona",
"Siena",
"Siracusa",
"Sondrio",
"Taranto",
"Teramo",
"Terni",
"Torino",
"Ogliastra",
"Trapani",
"Trento",
"Treviso",
"Trieste",
"Udine",
"Varese",
"Venezia",
"Verbano-Cusio-Ossola",
"Vercelli",
"Verona",
"Vibo Valentia",
"Vicenza",
"Viterbo"
];
|
/**
* Simple wrapper class that represents a set of records returned by a Proxy.
*/
Ext.define('Ext.data.ResultSet', {
/**
* @property {Boolean} isResultSet
* Identifies this class as a result set.
*/
isResultSet: true,
$configPrefixed: false,
config: {
/**
* @cfg {Boolean} loaded
* True if the records have already been loaded. This is only meaningful when dealing with
* SQL-backed proxies.
*/
loaded: true,
/**
* @cfg {Number} count
* The number of records in this ResultSet. Note that total may differ from this number.
*/
count: null,
/**
* @cfg {Number} total
* The total number of records reported by the data source. This ResultSet may form a subset of
* those records (see {@link #count}).
*/
total: null,
/**
* @cfg {Boolean} success
* True if the ResultSet loaded successfully, false if any errors were encountered.
*/
success: false,
/**
* @cfg {Ext.data.Model[]/Object[]} records (required)
* The array of record instances or record config objects.
*/
records: null,
/**
* @cfg {String} message
* The message that was read in from the data
*/
message: null
},
/**
* Creates the resultSet
* @param {Object} [config] Config object.
*/
constructor: function(config) {
this.initConfig(config);
},
getCount: function() {
var count = this.callParent(),
records;
if (!count) {
records = this.getRecords();
if (records) {
count = records.length;
}
}
return count;
}
});
|
/*!
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @version 3.0.0
*
* Additional enhancements for Select2 widget extension for Yii 2.0.
*
* Author: Kartik Visweswaran
* Copyright: 2014, Kartik Visweswaran, Krajee.com
* For more JQuery plugins visit http://plugins.krajee.com
* For more Yii related demos visit http://demos.krajee.com
*/(function($){initSelect2Loading=function(e){var s=$("#"+e),a="group-"+e,l=$(".kv-hide."+a),r=s.select2("container"),n=$(".kv-plugin-loading.loading-"+e);s.removeClass("kv-hide"),r.removeClass("kv-hide"),n.remove(),Object.keys(l).length>0&&l.removeClass("kv-hide").removeClass(a)};initSelect2DropStyle=function(e){var s,a,l=$("#"+e),r=$("#select2-drop");if(r.removeClass("has-success has-error has-warning"),l.parents("[class*='has-']").length)for(s=l.parents("[class*='has-']")[0].className.split(/\s+/),a=0;a<s.length;a++)s[a].match("has-")&&r.addClass(s[a])};})(jQuery);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.