text
stringlengths 2
6.14k
|
|---|
"use strict";
/*!
* Copyright 2016 The ANTLR Project. All rights reserved.
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
*/
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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicBlockStartState = void 0;
// ConvertTo-TS run at 2016-10-04T11:26:27.7669801-07:00
const ATNStateType_1 = require("./ATNStateType");
const BlockStartState_1 = require("./BlockStartState");
const Decorators_1 = require("../Decorators");
/**
*
* @author Sam Harwell
*/
class BasicBlockStartState extends BlockStartState_1.BlockStartState {
get stateType() {
return ATNStateType_1.ATNStateType.BLOCK_START;
}
}
__decorate([
Decorators_1.Override
], BasicBlockStartState.prototype, "stateType", null);
exports.BasicBlockStartState = BasicBlockStartState;
//# sourceMappingURL=BasicBlockStartState.js.map
|
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var tape = require('tape');
var zlib = require('../');
tape('zero byte', function(t) {
t.plan(2);
var gz = zlib.Gzip()
var emptyBuffer = new Buffer(0);
var received = 0;
gz.on('data', function(c) {
received += c.length;
});
gz.on('end', function() {
t.equal(received, 20);
});
gz.on('finish', function() {
t.ok(true);
});
gz.write(emptyBuffer);
gz.end();
});
|
/**
* $Id: learning_path_item.js 216 2009-11-13 14:08:06Z kariboe $
* @package application.lib.weblcms.tool.learning_path.javascript
*/
/**
* @author Sven Vanpoucke
*/
(function($) {
$(window).bind('beforeunload', function(e) {
var ajaxUri = getPath('WEB_PATH') + 'index.php';
var parameters = {
'application' : trackerContext,
'go' : 'leave_item',
'tracker_id' : trackerId
};
var response = $.ajax({
type : "POST",
url : ajaxUri,
data : parameters,
async : false
});
});
})(jQuery);
|
// Flags: --expose-internals
'use strict';
const common = require('../common');
if (!common.hasCrypto) common.skip('missing crypto');
const fixtures = require('../common/fixtures');
// Test --trace-tls CLI flag.
const assert = require('assert');
const { fork } = require('child_process');
if (process.argv[2] === 'test')
return test();
const binding = require('internal/test/binding').internalBinding;
if (!binding('tls_wrap').HAVE_SSL_TRACE)
return common.skip('no SSL_trace() compiled into openssl');
const child = fork(__filename, ['test'], {
silent: true,
execArgv: ['--trace-tls']
});
let stdout = '';
let stderr = '';
child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');
child.stdout.on('data', (data) => stdout += data);
child.stderr.on('data', (data) => stderr += data);
child.on('close', common.mustCall((code, signal) => {
// For debugging and observation of actual trace output.
console.log(stderr);
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
assert.strictEqual(stdout.trim(), '');
assert(/Warning: Enabling --trace-tls can expose sensitive/.test(stderr));
assert(/Sent Record/.test(stderr));
}));
function test() {
const {
connect, keys
} = require(fixtures.path('tls-connect'));
connect({
client: {
checkServerIdentity: (servername, cert) => { },
ca: `${keys.agent1.cert}\n${keys.agent6.ca}`,
},
server: {
cert: keys.agent6.cert,
key: keys.agent6.key
},
}, common.mustCall((err, pair, cleanup) => {
if (pair.server.err) {
console.trace('server', pair.server.err);
}
if (pair.client.err) {
console.trace('client', pair.client.err);
}
assert.ifError(pair.server.err);
assert.ifError(pair.client.err);
return cleanup();
}));
}
|
'use strict';
var fs = require('fs');
var Promise = require('../ext/promise');
var readFile = Promise.denodeify(fs.readFile);
var lstat = Promise.denodeify(fs.stat);
var chalk = require('chalk');
var EditFileDiff = require('./edit-file-diff');
var EOL = require('os').EOL;
var isBinaryFile = require('isbinaryfile').sync;
var canEdit = require('../utilities/open-editor').canEdit;
function processTemplate(content, context) {
var options = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
};
return require('lodash.template')(content, options)(context);
}
function diffHighlight(line) {
if (line[0] === '+') {
return chalk.green(line);
} else if (line[0] === '-') {
return chalk.red(line);
} else if (line.match(/^@@/)) {
return chalk.cyan(line);
} else {
return line;
}
}
FileInfo.prototype.confirmOverwrite = function(path) {
var promptOptions = {
type: 'expand',
name: 'answer',
default: false,
message: chalk.red('Overwrite') + ' ' + path + '?',
choices: [
{ key: 'y', name: 'Yes, overwrite', value: 'overwrite' },
{ key: 'n', name: 'No, skip', value: 'skip' }
]
};
var outputPathIsFile = false;
try { outputPathIsFile = fs.statSync(this.outputPath).isFile(); } catch (err) { /* ignore */ }
var canDiff = (
!isBinaryFile(this.inputPath) && (
!outputPathIsFile ||
!isBinaryFile(this.outputPath)
)
);
if (canDiff) {
promptOptions.choices.push({ key: 'd', name: 'Diff', value: 'diff' });
if (canEdit()) {
promptOptions.choices.push({ key: 'e', name: 'Edit', value: 'edit' });
}
}
return this.ui.prompt(promptOptions)
.then(function(response) {
return response.answer;
});
};
FileInfo.prototype.displayDiff = function() {
var info = this,
jsdiff = require('diff');
return Promise.hash({
input: this.render(),
output: readFile(info.outputPath)
}).then(function(result) {
var diff = jsdiff.createPatch(
info.outputPath, result.output.toString(), result.input
);
var lines = diff.split('\n');
for (var i = 0; i < lines.length; i++) {
info.ui.write(
diffHighlight(lines[i] + EOL)
);
}
});
};
function FileInfo(options) {
this.action = options.action;
this.outputBasePath = options.outputBasePath;
this.outputPath = options.outputPath;
this.displayPath = options.displayPath;
this.inputPath = options.inputPath;
this.templateVariables = options.templateVariables;
this.ui = options.ui;
}
FileInfo.prototype.render = function() {
var path = this.inputPath,
context = this.templateVariables;
if (!this.rendered) {
this.rendered = readFile(path).then(function(content) {
return lstat(path).then(function(fileStat) {
if (isBinaryFile(content, fileStat.size)) {
return content;
} else {
try {
return processTemplate(content.toString(), context);
} catch (err) {
err.message += ' (Error in blueprint template: ' + path + ')';
throw err;
}
}
});
});
}
return this.rendered;
};
FileInfo.prototype.checkForConflict = function() {
return new Promise(function (resolve, reject) {
fs.exists(this.outputPath, function (doesExist, error) {
if (error) {
reject(error);
return;
}
var result;
if (doesExist) {
result = Promise.hash({
input: this.render(),
output: readFile(this.outputPath)
}).then(function(result) {
var type;
if (result.input.toString() === result.output.toString()) {
type = 'identical';
} else {
type = 'confirm';
}
return type;
}.bind(this));
} else {
result = 'none';
}
resolve(result);
}.bind(this));
}.bind(this));
};
FileInfo.prototype.confirmOverwriteTask = function() {
var info = this;
return function() {
return new Promise(function(resolve, reject) {
function doConfirm() {
info.confirmOverwrite(info.displayPath).then(function(action) {
if (action === 'diff') {
info.displayDiff().then(doConfirm, reject);
} else if (action === 'edit') {
var editFileDiff = new EditFileDiff({info: info});
editFileDiff.edit().then(function() {
info.action = action;
resolve(info);
}).catch(function() {
doConfirm()
.finally(function() {
resolve(info);
});
});
} else {
info.action = action;
resolve(info);
}
}, reject);
}
doConfirm();
});
}.bind(this);
};
module.exports = FileInfo;
|
export * as ns from 'mod';
export v from 'mod';
export a, * as b from 'mod';
export c, { foo } from 'mod';
export * as d, { bar } from 'mod';
export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo";
export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr";
export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo";
|
import * as THREE from 'three';
import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
function GeometryParametersPanel( editor, object ) {
const strings = editor.strings;
const signals = editor.signals;
const container = new UIRow();
const geometry = object.geometry;
const parameters = geometry.parameters;
// radius
const radiusRow = new UIRow();
const radius = new UINumber( parameters.radius ).onChange( update );
radiusRow.add( new UIText( strings.getKey( 'sidebar/geometry/tetrahedron_geometry/radius' ) ).setWidth( '90px' ) );
radiusRow.add( radius );
container.add( radiusRow );
// detail
const detailRow = new UIRow();
const detail = new UIInteger( parameters.detail ).setRange( 0, Infinity ).onChange( update );
detailRow.add( new UIText( strings.getKey( 'sidebar/geometry/tetrahedron_geometry/detail' ) ).setWidth( '90px' ) );
detailRow.add( detail );
container.add( detailRow );
//
function update() {
editor.execute( new SetGeometryCommand( editor, object, new THREE.TetrahedronGeometry(
radius.getValue(),
detail.getValue()
) ) );
signals.objectChanged.dispatch( object );
}
return container;
}
export { GeometryParametersPanel };
|
var Utils = require("../../utils")
, sqlite3 = require('sqlite3').verbose()
, Query = require("./query")
module.exports = (function() {
var ConnectorManager = function(sequelize) {
this.sequelize = sequelize
this.database = db = new sqlite3.Database(sequelize.options.storage || ':memory:', function(err) {
if(!err && sequelize.options.foreignKeys !== false) {
// Make it possible to define and use foreign key constraints unless
// explicitly disallowed. It's still opt-in per relation
db.run('PRAGMA FOREIGN_KEYS=ON')
}
})
}
Utils._.extend(ConnectorManager.prototype, require("../connector-manager").prototype)
ConnectorManager.prototype.query = function(sql, callee, options) {
return new Query(this.database, this.sequelize, callee, options).run(sql)
}
return ConnectorManager
})()
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var a = [];
for(var i = 0; i < 1024*500*10; ++i)
a[i] = i;
|
'use strict';
describe('Loading 0202-layers-overlays-simple-example.html', function() {
beforeEach(function() {
browser.get('0202-layers-overlays-simple-example.html');
browser.wait(function() {
return element(by.css('img.leaflet-tile-loaded')).isPresent();
}, 5000);
});
it('should change the layer tiles if clicked on the leaflet control switch layer', function() {
expect(element(by.xpath('//img[contains(@src, "http://c.tile.openstreetmap.org/")]')).isPresent()).toBe(true);
browser.actions().mouseMove(element(by.xpath('//a[contains(@class, "leaflet-control-layers-toggle")][1]'))).perform();
browser.wait(function() {
return element(by.xpath('//img[contains(@src, "http://suite.opengeo.org/geoserver/usa/wms")]')).isPresent();
}, 5000);
expect(element(by.xpath('//img[contains(@src, "http://suite.opengeo.org/geoserver/usa/wms")]')).isPresent()).toBe(true);
var overlayButton = element(by.xpath('//input[@type=\'checkbox\'][1]'));
overlayButton.click();
browser.driver.sleep(300);
expect(element(by.xpath('//img[contains(@src, "http://suite.opengeo.org/geoserver/usa/wms")]')).isPresent()).toBe(false);
});
});
|
import HasManyHelper from './has-many-helper';
import {module, test} from 'qunit';
module('Integration | ORM | hasMany #accessor');
/*
#association behavior works regardless of the state of the parent
*/
HasManyHelper.forEachScenario((scenario) => {
test(`the references of a ${scenario.title} are correct`, function(assert) {
let { parent, children, accessor, idsAccessor } = scenario.go();
assert.equal(parent[accessor].models.length, children.length, 'parent has correct number of children');
assert.equal(parent[idsAccessor].length, children.length, 'parent has correct number of child ids');
children.forEach(function(child, i) {
assert.deepEqual(parent[accessor].models[i], children[i], 'each child is in parent.children array');
if (!child.isNew()) {
assert.ok(parent[idsAccessor].indexOf(child.id) > -1, 'each saved child id is in parent.childrenIds array');
}
});
});
});
|
/* Tabulator v4.2.3 (c) Oliver Folkerd */
/*
* This file is part of the Tabulator package.
*
* (c) Oliver Folkerd <oliver.folkerd@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Full Documentation & Demos can be found at: http://olifolkerd.github.io/tabulator/
*
*/
(function (factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(require('jquery'));
} else {
factory(jQuery);
}
})(function ($, undefined) {
$.widget("ui.tabulator", {
_create: function _create() {
this.table = new Tabulator(this.element[0], this.options);
//map tabulator functions to jquery wrapper
for (var key in Tabulator.prototype) {
if (typeof Tabulator.prototype[key] === "function" && key.charAt(0) !== "_") {
this[key] = this.table[key].bind(this.table);
}
}
},
_setOption: function _setOption(option, value) {
console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated");
},
_destroy: function _destroy(option, value) {
this.table.destroy();
}
});
});
|
'use strict';
module.exports = {
name: 'ember-cli-legacy-blueprints'
};
|
;
/*!
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/
(function($){
$.fn.superfish = function(op){
var sf = $.fn.superfish,
c = sf.c,
$arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')),
over = function(){
var $$ = $(this), menu = getMenu($$);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();
},
out = function(){
var $$ = $(this), menu = getMenu($$), o = sf.op;
clearTimeout(menu.sfTimer);
menu.sfTimer = setTimeout(function(){
o.retainPath = ($.inArray($$[0],o.$path) > -1);
$$.hideSuperfishUl();
if (o.$path.length && $$.parents(['li.', o.hoverClass].join('')).length < 1){
over.call(o.$path);
}
}, o.delay);
},
getMenu = function($menu){
var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
sf.op = sf.o[menu.serial];
return menu;
},
addArrow = function($a){
$a.addClass(c.anchorClass).append($arrow.clone());
};
return this.each(function() {
var s = this.serial = sf.o.length;
var o = $.extend({},sf.defaults,op);
o.$path = $('li.' + o.pathClass,this).slice(0, o.pathLevels).each(function(){
$(this).addClass([o.hoverClass,c.bcClass].join(' '))
.filter('li:has(ul)').removeClass(o.pathClass);
});
sf.o[s] = sf.op = o;
$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
if (o.autoArrows) {
addArrow($('>a:first-child',this));
}
})
.not('.' + c.bcClass)
.hideSuperfishUl();
var $a = $('a',this);
$a.each(function(i){
var $li = $a.eq(i).parents('li');
$a.eq(i).focus(function(){
over.call($li);
}).blur(function(){
out.call($li);
});
});
o.onInit.call(this);
}).each(function() {
var menuClasses = [c.menuClass];
if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) {
menuClasses.push(c.shadowClass);
}
$(this).addClass(menuClasses.join(' '));
});
};
var sf = $.fn.superfish;
sf.o = [];
sf.op = {};
sf.IE7fix = function(){
var o = sf.op;
if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) {
this.toggleClass(sf.c.shadowClass + '-off');
}
};
sf.c = {
bcClass : 'sf-breadcrumb',
menuClass : 'sf-js-enabled',
anchorClass : 'sf-with-ul',
arrowClass : 'sf-sub-indicator',
shadowClass : 'sf-shadow'
};
sf.defaults = {
hoverClass : 'sfHover',
pathClass : 'overideThisToUse',
pathLevels : 1,
delay : 800,
animation : {
opacity:'show'
},
speed : 'normal',
autoArrows : true,
dropShadows : true,
// true disables hoverIntent detection.
disableHI : false,
onInit : function(){}, // callback functions
onBeforeShow: function(){},
onShow : function(){},
onHide : function(){}
};
$.fn.extend({
hideSuperfishUl : function() {
var o = sf.op,
not = (o.retainPath === true) ? o.$path : '';
o.retainPath = false;
var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
.find('>ul').hide().css('visibility','hidden');
o.onHide.call($ul);
return this;
},
showSuperfishUl : function(){
var o = sf.op,
sh = sf.c.shadowClass + '-off',
$ul = this.addClass(o.hoverClass)
.find('>ul:hidden').css('visibility','visible');
sf.IE7fix.call($ul);
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){
sf.IE7fix.call($ul);
o.onShow.call($ul);
});
return this;
}
});
})(jQuery);
|
module.exports = function (grunt) {
// Load in legacy config
require('./grunt')(grunt);
// Configure nodeunit as test
var testConfig = grunt.config.get('test');
grunt.config.set('nodeunit', testConfig);
// Load in nodeunit
process.chdir('..');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
process.chdir(__dirname);
// Override default task
grunt.registerTask('default', ['sprite', 'nodeunit']);
};
|
/*********************************************************************************************************/
/**
* fileicon plugin for CKEditor 3.x (Author: Lajox ; Email: lajox@19www.com)
* version: 1.0
* Released: On 2009-12-11
* Download: http://code.google.com/p/lajox
*/
/*********************************************************************************************************/
CKEDITOR.dialog.add('fileicon', function (a) {
var b = a.config,
c = b.fileicon_images,
d = 8,
e, f, g = function (k) {
var l = k.data.getTarget(),
m = l.getName();
if (m == 'td') l = l.getChild([0, 0]);
else if (m == 'a') l = l.getChild(0);
else if (m != 'img') return;
var n = l.getAttribute('cke_src'),
o = l.getAttribute('title'),
p = a.document.createElement('img', {
attributes: {
src: n,
_cke_saved_src: n,
title: o,
alt: o
}
});
a.insertElement(p);
f.hide();
},
h = CKEDITOR.tools.addFunction(function (k, l) {
k = new CKEDITOR.dom.event(k);
l = new CKEDITOR.dom.element(l);
var m, n, o = k.getKeystroke();
switch (o) {
case 39:
if (m = l.getParent().getNext()) {
n = m.getChild(0);
n.focus();
}
k.preventDefault();
break;
case 37:
if (m = l.getParent().getPrevious()) {
n = m.getChild(0);
n.focus();
}
k.preventDefault();
break;
case 38:
if (m = l.getParent().getParent().getPrevious()) {
n = m.getChild([l.getParent().getIndex(), 0]);
n.focus();
}
k.preventDefault();
break;
case 40:
if (m = l.getParent().getParent().getNext()) {
n = m.getChild([l.getParent().getIndex(), 0]);
if (n) n.focus();
}
k.preventDefault();
break;
case 32:
g({
data: k
});
k.preventDefault();
break;
case 9:
if (m = l.getParent().getNext()) {
n = m.getChild(0);
n.focus();
k.preventDefault(true);
} else if (m = l.getParent().getParent().getNext()) {
n = m.getChild([0, 0]);
if (n) n.focus();
k.preventDefault(true);
}
break;
case CKEDITOR.SHIFT + 9:
if (m = l.getParent().getPrevious()) {
n = m.getChild(0);
n.focus();
k.preventDefault(true);
} else if (m = l.getParent().getParent().getPrevious()) {
n = m.getLast().getChild(0);
n.focus();
k.preventDefault(true);
}
break;
default:
return;
}
}),
i = ['<table cellspacing="2" cellpadding="2"', CKEDITOR.env.ie && CKEDITOR.env.quirks ? ' style="position:absolute;"' : '', '><tbody>'];
for (e = 0; e < c.length; e++) {
if (e % d === 0) i.push('<tr>');
i.push('<td class="cke_dark_background cke_hand cke_centered" style="vertical-align: middle;"><a href="javascript:void(0)" class="cke_smile" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ', h, ', event, this );">', '<img class="hand" title="', b.fileicon_descriptions[e], '" cke_src="', CKEDITOR.tools.htmlEncode(b.fileicon_path + c[e]), '" alt="', b.fileicon_descriptions[e], '"', ' src="', CKEDITOR.tools.htmlEncode(b.fileicon_path + c[e]), '"', CKEDITOR.env.ie ? " onload=\"this.setAttribute('width', 2); this.removeAttribute('width');\" " : '', '></a>', '</td>');
if (e % d == d - 1) i.push('</tr>');
}
if (e < d - 1) {
for (; e < d - 1; e++) i.push('<td></td>');
i.push('</tr>');
}
i.push('</tbody></table>');
var j = {
type: 'html',
html: i.join(''),
onLoad: function (k) {
f = k.sender;
},
focus: function () {
var k = this.getElement().getChild([0, 0, 0, 0]);
k.focus();
},
onClick: g,
style: 'width: 100%; height: 100%; border-collapse: separate;'
};
return {
title: a.lang.fileicon.title,
minWidth: 280,
minHeight: 150,
contents: [{
id: 'tab1',
label: '',
title: '',
expand: true,
padding: 0,
elements: [j]
}],
buttons: [CKEDITOR.dialog.cancelButton]
};
});
|
/**
* @file
* Appearance settings.
*/
(function ($, Drupal) {
Drupal.behaviors.atCoreLayoutVisualization = {
attach: function () {
$('#edit-layout-select select[id*="edit-settings-page-"]').change(function(){
$('#' + $(this).attr('id')).parent().next().children().removeClass().addClass(this.value);
});
}
};
}(jQuery, Drupal));
|
import { Component, ChangeDetectionStrategy, Input, Output, EventEmitter, TemplateRef, ContentChild, forwardRef, ChangeDetectorRef } from '@angular/core';
import { NgbRatingConfig } from './rating-config';
import { toString, getValueInRange } from '../util/util';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
var Key;
(function (Key) {
Key[Key["End"] = 35] = "End";
Key[Key["Home"] = 36] = "Home";
Key[Key["ArrowLeft"] = 37] = "ArrowLeft";
Key[Key["ArrowUp"] = 38] = "ArrowUp";
Key[Key["ArrowRight"] = 39] = "ArrowRight";
Key[Key["ArrowDown"] = 40] = "ArrowDown";
})(Key || (Key = {}));
var NGB_RATING_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(function () { return NgbRating; }),
multi: true
};
/**
* Rating directive that will take care of visualising a star rating bar.
*/
export var NgbRating = (function () {
function NgbRating(config, _changeDetectorRef) {
this._changeDetectorRef = _changeDetectorRef;
this.range = [];
/**
* An event fired when a user is hovering over a given rating.
* Event's payload equals to the rating being hovered over.
*/
this.hover = new EventEmitter();
/**
* An event fired when a user stops hovering over a given rating.
* Event's payload equals to the rating of the last item being hovered over.
*/
this.leave = new EventEmitter();
/**
* An event fired when a user selects a new rating.
* Event's payload equals to the newly selected rating.
*/
this.rateChange = new EventEmitter(true);
this.onChange = function (_) { };
this.onTouched = function () { };
this.max = config.max;
this.readonly = config.readonly;
}
NgbRating.prototype.ariaValueText = function () { return this.rate + " out of " + this.max; };
NgbRating.prototype.enter = function (value) {
if (!this.readonly) {
this.rate = value;
}
this.hover.emit(value);
};
NgbRating.prototype.handleKeyDown = function (event) {
if (Key[toString(event.which)]) {
event.preventDefault();
switch (event.which) {
case Key.ArrowDown:
case Key.ArrowLeft:
this.update(this.rate - 1);
break;
case Key.ArrowUp:
case Key.ArrowRight:
this.update(this.rate + 1);
break;
case Key.Home:
this.update(0);
break;
case Key.End:
this.update(this.max);
break;
}
}
};
NgbRating.prototype.getFillValue = function (index) {
var diff = this.rate - index;
if (diff >= 1) {
return 100;
}
if (diff < 1 && diff > 0) {
return Number.parseInt((diff * 100).toFixed(2));
}
return 0;
};
NgbRating.prototype.ngOnChanges = function (changes) {
if (changes['rate']) {
this.update(this.rate);
this._oldRate = this.rate;
}
};
NgbRating.prototype.ngOnInit = function () { this.range = Array.from({ length: this.max }, function (v, k) { return k + 1; }); };
NgbRating.prototype.registerOnChange = function (fn) { this.onChange = fn; };
NgbRating.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };
NgbRating.prototype.reset = function () {
this.leave.emit(this.rate);
this.rate = this._oldRate;
};
NgbRating.prototype.update = function (value, internalChange) {
if (internalChange === void 0) { internalChange = true; }
if (!this.readonly) {
var newRate = value ? getValueInRange(value, this.max, 0) : 0;
if (this._oldRate !== newRate) {
this._oldRate = newRate;
this.rate = newRate;
this.rateChange.emit(newRate);
if (internalChange) {
this.onChange(this.rate);
}
}
}
};
NgbRating.prototype.writeValue = function (value) {
this.update(value, false);
this._changeDetectorRef.markForCheck();
};
NgbRating.decorators = [
{ type: Component, args: [{
selector: 'ngb-rating',
changeDetection: ChangeDetectionStrategy.OnPush,
host: { '(keydown)': 'handleKeyDown($event)' },
template: "\n <template #t let-fill=\"fill\">{{ fill === 100 ? '★' : '☆' }}</template>\n <span tabindex=\"0\" (mouseleave)=\"reset()\" role=\"slider\" aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"max\" [attr.aria-valuenow]=\"rate\" [attr.aria-valuetext]=\"ariaValueText()\">\n <template ngFor [ngForOf]=\"range\" let-index=\"index\">\n <span class=\"sr-only\">({{ index < rate ? '*' : ' ' }})</span>\n <span (mouseenter)=\"enter(index + 1)\" (click)=\"update(index + 1)\" \n [style.cursor]=\"readonly ? 'default' : 'pointer'\">\n <template [ngTemplateOutlet]=\"starTemplate || t\" [ngOutletContext]=\"{fill: getFillValue(index)}\"></template>\n </span>\n </template>\n </span>\n ",
providers: [NGB_RATING_VALUE_ACCESSOR]
},] },
];
/** @nocollapse */
NgbRating.ctorParameters = [
{ type: NgbRatingConfig, },
{ type: ChangeDetectorRef, },
];
NgbRating.propDecorators = {
'max': [{ type: Input },],
'rate': [{ type: Input },],
'readonly': [{ type: Input },],
'starTemplate': [{ type: Input }, { type: ContentChild, args: [TemplateRef,] },],
'hover': [{ type: Output },],
'leave': [{ type: Output },],
'rateChange': [{ type: Output },],
};
return NgbRating;
}());
//# sourceMappingURL=rating.js.map
|
// $Id: ajax_view.js,v 1.13 2008/12/02 18:35:50 merlinofchaos Exp $
/**
* @file ajaxView.js
*
* Handles AJAX fetching of views, including filter submission and response.
*/
Drupal.Views.Ajax = Drupal.Views.Ajax || {};
/**
* An ajax responder that accepts a packet of JSON data and acts appropriately.
*
* The following fields control behavior.
* - 'display': Display the associated data in the view area.
*/
Drupal.Views.Ajax.ajaxViewResponse = function(target, response) {
if (response.debug) {
alert(response.debug);
}
var $view = $(target);
// Check the 'display' for data.
if (response.status && response.display) {
var $newView = $(response.display);
$view.replaceWith($newView);
$view = $newView;
Drupal.attachBehaviors($view.parent());
}
if (response.messages) {
// Show any messages (but first remove old ones, if there are any).
$view.find('.views-messages').remove().end().prepend(response.messages);
}
};
/**
* Ajax behavior for views.
*/
Drupal.behaviors.ViewsAjaxView = function() {
var ajax_path = Drupal.settings.views.ajax_path;
// If there are multiple views this might've ended up showing up multiple times.
if (ajax_path.constructor.toString().indexOf("Array") != -1) {
ajax_path = ajax_path[0];
}
if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
$.each(Drupal.settings.views.ajaxViews, function(i, settings) {
var view = '.view-dom-id-' + settings.view_dom_id;
if (!$(view).size()) {
// Backward compatibility: if 'views-view.tpl.php' is old and doesn't
// contain the 'view-dom-id-#' class, we fall back to the old way of
// locating the view:
view = '.view-id-' + settings.view_name + '.view-display-id-' + settings.view_display_id;
}
// Process exposed filter forms.
$('form#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-'))
.filter(':not(.views-processed)')
.each(function () {
// remove 'q' from the form; it's there for clean URLs
// so that it submits to the right place with regular submit
// but this method is submitting elsewhere.
$('input[name=q]', this).remove();
var form = this;
// ajaxSubmit doesn't accept a data argument, so we have to
// pass additional fields this way.
$.each(settings, function(key, setting) {
$(form).append('<input type="hidden" name="'+ key + '" value="'+ setting +'"/>');
});
})
.addClass('views-processed')
.submit(function () {
$('input[@type=submit]', this).after('<span class="views-throbbing"> </span>');
var object = this;
$(this).ajaxSubmit({
url: ajax_path,
type: 'GET',
success: function(response) {
// Call all callbacks.
if (response.__callbacks) {
$.each(response.__callbacks, function(i, callback) {
eval(callback)(view, response);
});
$('.views-throbbing', object).remove();
}
},
error: function() { alert(Drupal.t("An error occurred at @path.", {'@path': ajax_path})); $('.views-throbbing', object).remove(); },
dataType: 'json'
});
return false;
});
$(view).filter(':not(.views-processed)').each(function() {
var target = this;
$(this)
.addClass('views-processed')
// Process pager links.
.find('ul.pager > li > a')
.each(function () {
var viewData = Drupal.Views.parseQueryString($(this).attr('href'));
if (!viewData['view_name']) {
$.each(settings, function (key, setting) {
viewData[key] = setting;
});
}
$(this)
.click(function () {
$(this).addClass('views-throbbing');
$.ajax({
url: ajax_path,
type: 'GET',
data: viewData,
success: function(response) {
$(this).removeClass('views-throbbing');
// Call all callbacks.
if (response.__callbacks) {
$.each(response.__callbacks, function(i, callback) {
eval(callback)(target, response);
});
}
},
error: function() { $(this).removeClass('views-throbbing'); alert(Drupal.t("An error occurred at @path.", {'@path': ajax_path})); },
dataType: 'json'
});
return false;
});
})
.end()
// Process tablesort links.
.find('th.views-field a')
.each(function () {
var viewData = Drupal.Views.parseQueryString($(this).attr('href'));
$.each(settings, function (key, setting) {
viewData[key] = setting;
});
$(this)
.click(function () {
$(this).addClass('views-throbbing');
$.ajax({
url: ajax_path,
type: 'GET',
data: viewData,
success: function(response) {
$(this).removeClass('views-throbbing');
// Call all callbacks.
if (response.__callbacks) {
$.each(response.__callbacks, function(i, callback) {
eval(callback)(target, response);
});
}
},
error: function() { $(this).removeClass('views-throbbing'); alert(Drupal.t("An error occurred at @path.", {'@path': ajax_path})); },
dataType: 'json'
});
return false;
});
}); // .each 'th.views-field a'
}); // $view.filter().each
}); // .each Drupal.settings.views.ajaxViews
} // if
};
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getCellMetadata = getCellMetadata;
var _initCellMetadata = require('./initCellMetadata');
var _initCellMetadata2 = _interopRequireDefault(_initCellMetadata);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Default cell sizes and offsets for use in below tests
function getCellMetadata() {
var cellSizes = [10, // 0: 0..0 (min)
20, // 1: 0..10
15, // 2: 0..30
10, // 3: 5..45
15, // 4: 20..55
30, // 5: 50..70
20, // 6: 70..100
10, // 7: 80..110
30 // 8: 110..110 (max)
];
return (0, _initCellMetadata2.default)({
cellCount: cellSizes.length,
size: function size(_ref) {
var index = _ref.index;
return cellSizes[index];
}
});
}
|
/*
* Meran - MERAN UNLP is a ILS (Integrated Library System) wich provides Catalog,
* Circulation and User's Management. It's written in Perl, and uses Apache2
* Web-Server, MySQL database and Sphinx 2 indexing.
* Copyright (C) 2009-2013 Grupo de desarrollo de Meran CeSPI-UNLP
*
* This file is part of Meran.
*
* Meran 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.
*
* Meran 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 Meran. If not, see <http://www.gnu.org/licenses/>.
*/
function a(a){return a==1?2:17}
|
const { Cc, Ci } = require("chrome");
const { storage } = require("sdk/simple-storage");
const userStorage = require("./userStorage");
userStorage.init();
// Hack: import main first to trigger correct order of dependency resolution
const main = require("./main");
const utils = require('./utils');
const { Policy } = require("./contentPolicy");
let preloadText = "@@||sgizmo.co^$third-party\n"+
"@@||www.logos.co.uk^$third-party\n"+
"@@||www.fuseservice.com^$third-party\n"+
"@@||piclens.co.uk^$third-party\n";
exports.testPreloads = function(assert) {
main.main();
storage.preloads = {};
userStorage.syncPreloads(preloadText);
assert.equal(Object.keys(storage.preloads).length, 4, "test sync preloads");
let goodDomains = [ "https://sgizmo.co",
"http://www.sgizmo.co/abc?query=1#foobar",
"http://www.logos.co.uk/foobar",
"https://abc.piclens.co.uk",
"http://foo.bar.piclens.co.uk",
"https://maps.api.test.www.fuseservice.com" ];
let badDomains = [ "http://google.com",
"https://cdn.logos.co.uk",
"http://cdn.logos.co",
"https://adswww.fuseservice.com",
"http://fuseservice.com",
"https://sgizmo.co.uk",
"https://lens.co.uk/abcdef" ];
goodDomains.forEach(function(element, index, array) {
assert.ok(Policy._isPreloadedWhitelistRequest(utils.makeURI(element)),
"test that " + element + " is whitelisted");
});
badDomains.forEach(function(element, index, array) {
assert.ok(!Policy._isPreloadedWhitelistRequest(utils.makeURI(element)),
"test that " + element + " is NOT whitelisted");
});
main.clearData(true, true);
main.onUnload("disabled");
};
require("sdk/test").run(exports);
|
define(["mui"], function(){
function component($q, $resource, $stateParams, AnnotationProjectIdResource){
var _self=this;
var url="/annotations/:datasetName/annotation/:dimension/new/dataset/command/core/get-rows";
this.AnnotationValuesResource = $resource(url, {
datasetName: $stateParams.datasetId,
limit: 30000
});
//to get rows we first must chain a call to get-project-id
this.get=function(dimension){
return AnnotationProjectIdResource.get(dimension).then(function(data){
if(data.project<=0)
return $q.when({error: "OpenRefine - project not found"});
else
data.datasetName=$stateParams.datasetId;
data.dimension=dimension;
return _self.AnnotationValuesResource.get(data).$promise;
});
};
}
component.$name="AnnotationValuesResource";
component.$inject=["$q", "$resource", "$stateParams", "AnnotationProjectIdResource"];
component.$provider="service";
return component;
});
|
var Utils = {
convertToRoute: function(str) {
str = str || "";
return str.toLowerCase().replace(" ", "-");
},
parseRoute: function(route) {
route = route || "";
return route.split("-").map(function(item) {
return item.charAt(0).toUpperCase() + item.substr(1).toLowerCase();
}).join(" ");
}
};
module.exports = Utils;
|
/* 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/.
*
* This Source Code Form is "Incompatible With Secondary Licenses", as
* defined by the Mozilla Public License, v. 2.0.
*/
function updateCommentPrivacy(checkbox, id) {
var comment_elem = document.getElementById('comment_text_'+id).parentNode;
if (checkbox.checked) {
if (!comment_elem.className.match('bz_private')) {
comment_elem.className = comment_elem.className.concat(' bz_private');
}
}
else {
comment_elem.className =
comment_elem.className.replace(/(\s*|^)bz_private(\s*|$)/, '$2');
}
}
/* The functions below expand and collapse comments */
function toggle_comment_display(link, comment_id) {
var comment = document.getElementById('comment_text_' + comment_id);
var re = new RegExp(/\bcollapsed\b/);
if (comment.className.match(re))
expand_comment(link, comment);
else
collapse_comment(link, comment);
}
function toggle_all_comments(action) {
// If for some given ID the comment doesn't exist, this doesn't mean
// there are no more comments, but that the comment is private and
// the user is not allowed to view it.
var comments = YAHOO.util.Dom.getElementsByClassName('bz_comment_text');
for (var i = 0; i < comments.length; i++) {
var comment = comments[i];
if (!comment)
continue;
var id = comments[i].id.match(/\d*$/);
var link = document.getElementById('comment_link_' + id);
if (action == 'collapse')
collapse_comment(link, comment);
else
expand_comment(link, comment);
}
}
function collapse_comment(link, comment) {
link.innerHTML = "[+]";
YAHOO.util.Dom.addClass(comment, 'collapsed');
}
function expand_comment(link, comment) {
link.innerHTML = "[−]";
YAHOO.util.Dom.removeClass(comment, 'collapsed');
}
function wrapReplyText(text) {
// This is -3 to account for "\n> "
var maxCol = BUGZILLA.constant.COMMENT_COLS - 3;
var text_lines = text.replace(/[\s\n]+$/, '').split("\n");
var wrapped_lines = new Array();
for (var i = 0; i < text_lines.length; i++) {
var paragraph = text_lines[i];
// Don't wrap already-quoted text.
if (paragraph.indexOf('>') == 0) {
wrapped_lines.push('> ' + paragraph);
continue;
}
var replace_lines = new Array();
while (paragraph.length > maxCol) {
var testLine = paragraph.substring(0, maxCol);
var pos = testLine.search(/\s\S*$/);
if (pos < 1) {
// Try to find some ASCII punctuation that's reasonable
// to break on.
var punct = '\\-\\./,!;:';
var punctRe = new RegExp('[' + punct + '][^' + punct + ']+$');
pos = testLine.search(punctRe) + 1;
// Try to find some CJK Punctuation that's reasonable
// to break on.
if (pos == 0)
pos = testLine.search(/[\u3000\u3001\u3002\u303E\u303F]/) + 1;
// If we can't find any break point, we simply break long
// words. This makes long, punctuation-less CJK text wrap,
// even if it wraps incorrectly.
if (pos == 0) pos = maxCol;
}
var wrapped_line = paragraph.substring(0, pos);
replace_lines.push(wrapped_line);
paragraph = paragraph.substring(pos);
// Strip whitespace from the start of the line
paragraph = paragraph.replace(/^\s+/, '');
}
replace_lines.push(paragraph);
wrapped_lines.push("> " + replace_lines.join("\n> "));
}
return wrapped_lines.join("\n") + "\n\n";
}
/* This way, we are sure that browsers which do not support JS
* won't display this link */
function addCollapseLink(count, title) {
document.write(' <a href="#" class="bz_collapse_comment"' +
' id="comment_link_' + count +
'" onclick="toggle_comment_display(this, ' + count +
'); return false;" title="' + title + '">[−]<\/a> ');
}
function goto_add_comments( anchor ){
anchor = (anchor || "add_comment");
// we need this line to expand the comment box
document.getElementById('comment').focus();
setTimeout(function(){
document.location.hash = anchor;
// firefox doesn't seem to keep focus through the anchor change
document.getElementById('comment').focus();
},10);
return false;
}
if (typeof Node == 'undefined') {
/* MSIE doesn't define Node, so provide a compatibility object */
window.Node = {
TEXT_NODE: 3,
ENTITY_REFERENCE_NODE: 5
};
}
/* Concatenates all text from element's childNodes. This is used
* instead of innerHTML because we want the actual text (and
* innerText is non-standard).
*/
function getText(element) {
var child, text = "";
for (var i=0; i < element.childNodes.length; i++) {
child = element.childNodes[i];
var type = child.nodeType;
if (type == Node.TEXT_NODE || type == Node.ENTITY_REFERENCE_NODE) {
text += child.nodeValue;
} else {
/* recurse into nodes of other types */
text += getText(child);
}
}
return text;
}
|
// Generated by CoffeeScript 1.9.3
var Client, Device, ds, fs, ref;
Client = require("request-json").JsonClient;
fs = require('fs');
Device = require('../models/device');
ds = new Client("http://localhost:9101/");
if ((ref = process.env.NODE_ENV) === 'test' || ref === 'production') {
ds.setBasicAuth(process.env.NAME, process.env.TOKEN);
}
module.exports = {
devices: function(req, res, next) {
return Device.all(function(err, devices) {
if (err) {
return next(err);
} else {
return res.send({
rows: devices
});
}
});
},
remove: function(req, res, next) {
var id;
id = req.params.deviceid;
return Device.find(id, function(err, device) {
if (err != null) {
return next(err);
} else {
return ds.del("access/" + id + "/", function(err, response, body) {
if (err) {
log.error(err);
}
return device.destroy(function(err) {
err = err || body.error;
if (err != null) {
return next(err);
} else {
return res.send(200, {
success: true
});
}
});
});
}
});
}
};
|
define(['backbone', 'jquery', 'underscore', 'js/common_helpers/ajax_helpers', 'js/common_helpers/template_helpers',
'js/spec/student_account/helpers',
'js/spec/student_profile/helpers',
'js/views/fields',
'js/student_account/models/user_account_model',
'js/student_account/models/user_preferences_model',
'js/student_profile/views/learner_profile_view',
'js/student_profile/views/learner_profile_fields',
'js/student_profile/views/learner_profile_factory',
'js/views/message_banner'
],
function (Backbone, $, _, AjaxHelpers, TemplateHelpers, Helpers, LearnerProfileHelpers, FieldViews,
UserAccountModel, UserPreferencesModel, LearnerProfileView, LearnerProfileFields, LearnerProfilePage) {
'use strict';
describe("edx.user.LearnerProfileFactory", function () {
var requests;
beforeEach(function () {
loadFixtures('js/fixtures/student_profile/student_profile.html');
TemplateHelpers.installTemplate('templates/fields/field_readonly');
TemplateHelpers.installTemplate('templates/fields/field_dropdown');
TemplateHelpers.installTemplate('templates/fields/field_textarea');
TemplateHelpers.installTemplate('templates/fields/field_image');
TemplateHelpers.installTemplate('templates/fields/message_banner');
TemplateHelpers.installTemplate('templates/student_profile/learner_profile');
});
var createProfilePage = function(ownProfile, options) {
return new LearnerProfilePage({
'accounts_api_url': Helpers.USER_ACCOUNTS_API_URL,
'preferences_api_url': Helpers.USER_PREFERENCES_API_URL,
'own_profile': ownProfile,
'account_settings_page_url': Helpers.USER_ACCOUNTS_API_URL,
'country_options': Helpers.FIELD_OPTIONS,
'language_options': Helpers.FIELD_OPTIONS,
'has_preferences_access': true,
'profile_image_max_bytes': Helpers.IMAGE_MAX_BYTES,
'profile_image_min_bytes': Helpers.IMAGE_MIN_BYTES,
'profile_image_upload_url': Helpers.IMAGE_UPLOAD_API_URL,
'profile_image_remove_url': Helpers.IMAGE_REMOVE_API_URL,
'default_visibility': 'all_users',
'platform_name': 'edX',
'account_settings_data': Helpers.createAccountSettingsData(options),
'preferences_data': Helpers.createUserPreferencesData()
});
};
it("renders the full profile after data is successfully fetched", function() {
requests = AjaxHelpers.requests(this);
var context = createProfilePage(true),
learnerProfileView = context.learnerProfileView;
AjaxHelpers.respondWithJson(requests, Helpers.createAccountSettingsData());
AjaxHelpers.respondWithJson(requests, Helpers.createUserPreferencesData());
// sets the profile for full view.
context.accountPreferencesModel.set({account_privacy: 'all_users'});
LearnerProfileHelpers.expectProfileSectionsAndFieldsToBeRendered(learnerProfileView, false);
});
it("renders the limited profile for undefined 'year_of_birth'", function() {
var context = createProfilePage(true, {year_of_birth: '', requires_parental_consent: true}),
learnerProfileView = context.learnerProfileView;
LearnerProfileHelpers.expectLimitedProfileSectionsAndFieldsToBeRendered(learnerProfileView);
});
it("renders the limited profile for under 13 users", function() {
var context = createProfilePage(
true,
{year_of_birth: new Date().getFullYear() - 10, requires_parental_consent: true}
);
var learnerProfileView = context.learnerProfileView;
LearnerProfileHelpers.expectLimitedProfileSectionsAndFieldsToBeRendered(learnerProfileView);
});
});
});
|
'use strict';
goog.provide('grrUi.core.module');
goog.require('grrUi.core.aff4DownloadLinkDirective.Aff4DownloadLinkDirective');
goog.require('grrUi.core.aff4ItemsProviderDirective.Aff4ItemsProviderDirective');
goog.require('grrUi.core.aff4Service.Aff4Service');
goog.require('grrUi.core.apiItemsProviderDirective.ApiItemsProviderDirective');
goog.require('grrUi.core.apiService.ApiService');
goog.require('grrUi.core.basenameFilter.BasenameFilter');
goog.require('grrUi.core.clockDirective.ClockDirective');
goog.require('grrUi.core.downloadCollectionFilesDirective.DownloadCollectionFilesDirective');
goog.require('grrUi.core.encodeUriComponentFilter.EncodeUriComponentFilter');
goog.require('grrUi.core.forceRefreshDirective.ForceRefreshDirective');
goog.require('grrUi.core.infiniteTableDirective.InfiniteTableDirective');
goog.require('grrUi.core.legacyRendererDirective.LegacyRendererDirective');
goog.require('grrUi.core.memoryItemsProviderDirective.MemoryItemsProviderDirective');
goog.require('grrUi.core.pagedFilteredTableDirective.PagedFilteredTableDirective');
goog.require('grrUi.core.pagedFilteredTableDirective.TableBottomDirective');
goog.require('grrUi.core.pagedFilteredTableDirective.TableTopDirective');
goog.require('grrUi.core.reflectionService.ReflectionService');
goog.require('grrUi.core.resultsCollectionDirective.ResultsCollectionDirective');
goog.require('grrUi.core.splitterDirective.SplitterDirective');
goog.require('grrUi.core.splitterDirective.SplitterPaneDirective');
goog.require('grrUi.core.timeService.TimeService');
goog.require('grrUi.core.timeSinceFilter.TimeSinceFilter');
/**
* Angular module for core GRR UI components.
*/
grrUi.core.module = angular.module('grrUi.core', ['ngCookies',
'ui.bootstrap']);
grrUi.core.module.directive(
grrUi.core.aff4DownloadLinkDirective.Aff4DownloadLinkDirective
.directive_name,
grrUi.core.aff4DownloadLinkDirective.Aff4DownloadLinkDirective);
grrUi.core.module.directive(
grrUi.core.apiItemsProviderDirective.
ApiItemsProviderDirective.directive_name,
grrUi.core.apiItemsProviderDirective.ApiItemsProviderDirective);
grrUi.core.module.directive(
grrUi.core.aff4ItemsProviderDirective.
Aff4ItemsProviderDirective.directive_name,
grrUi.core.aff4ItemsProviderDirective.Aff4ItemsProviderDirective);
grrUi.core.module.directive(
grrUi.core.forceRefreshDirective.ForceRefreshDirective.directive_name,
grrUi.core.forceRefreshDirective.ForceRefreshDirective);
grrUi.core.module.directive(
grrUi.core.legacyRendererDirective.LegacyRendererDirective.directive_name,
grrUi.core.legacyRendererDirective.LegacyRendererDirective);
grrUi.core.module.directive(
grrUi.core.memoryItemsProviderDirective.
MemoryItemsProviderDirective.directive_name,
grrUi.core.memoryItemsProviderDirective.MemoryItemsProviderDirective);
grrUi.core.module.directive(
grrUi.core.pagedFilteredTableDirective.
PagedFilteredTableDirective.directive_name,
grrUi.core.pagedFilteredTableDirective.PagedFilteredTableDirective);
grrUi.core.module.directive(
grrUi.core.pagedFilteredTableDirective.TableTopDirective.directive_name,
grrUi.core.pagedFilteredTableDirective.TableTopDirective);
grrUi.core.module.directive(
grrUi.core.pagedFilteredTableDirective.TableBottomDirective.directive_name,
grrUi.core.pagedFilteredTableDirective.TableBottomDirective);
grrUi.core.module.directive(
grrUi.core.infiniteTableDirective.InfiniteTableDirective.directive_name,
grrUi.core.infiniteTableDirective.InfiniteTableDirective);
grrUi.core.module.service(
grrUi.core.aff4Service.Aff4Service.service_name,
grrUi.core.aff4Service.Aff4Service);
grrUi.core.module.service(
grrUi.core.apiService.ApiService.service_name,
grrUi.core.apiService.ApiService);
grrUi.core.module.directive(
grrUi.core.resultsCollectionDirective.ResultsCollectionDirective
.directive_name,
grrUi.core.resultsCollectionDirective.ResultsCollectionDirective);
grrUi.core.module.directive(
grrUi.core.splitterDirective.SplitterDirective.directive_name,
grrUi.core.splitterDirective.SplitterDirective);
grrUi.core.module.directive(
grrUi.core.splitterDirective.SplitterPaneDirective.directive_name,
grrUi.core.splitterDirective.SplitterPaneDirective);
grrUi.core.module.directive(
grrUi.core.clockDirective.ClockDirective.directive_name,
grrUi.core.clockDirective.ClockDirective);
grrUi.core.module.directive(
grrUi.core.downloadCollectionFilesDirective
.DownloadCollectionFilesDirective.directive_name,
grrUi.core.downloadCollectionFilesDirective
.DownloadCollectionFilesDirective);
grrUi.core.module.service(
grrUi.core.reflectionService.ReflectionService.service_name,
grrUi.core.reflectionService.ReflectionService);
grrUi.core.module.service(
grrUi.core.timeService.TimeService.service_name,
grrUi.core.timeService.TimeService);
grrUi.core.module.filter(grrUi.core.basenameFilter.BasenameFilter.filter_name,
grrUi.core.basenameFilter.BasenameFilter);
grrUi.core.module.filter(
grrUi.core.encodeUriComponentFilter.EncodeUriComponentFilter.filter_name,
grrUi.core.encodeUriComponentFilter.EncodeUriComponentFilter);
grrUi.core.module.filter(grrUi.core.timeSinceFilter.TimeSinceFilter.filter_name,
grrUi.core.timeSinceFilter.TimeSinceFilter);
|
//// [tests/cases/compiler/defaultDeclarationEmitDefaultImport.ts] ////
//// [root.ts]
export function getSomething(): Something { return null as any }
export default class Something {}
//// [main.ts]
import Thing, { getSomething } from "./root";
export const instance = getSomething();
//// [root.js]
"use strict";
exports.__esModule = true;
exports.getSomething = void 0;
function getSomething() { return null; }
exports.getSomething = getSomething;
var Something = /** @class */ (function () {
function Something() {
}
return Something;
}());
exports["default"] = Something;
//// [main.js]
"use strict";
exports.__esModule = true;
exports.instance = void 0;
var root_1 = require("./root");
exports.instance = root_1.getSomething();
//// [root.d.ts]
export declare function getSomething(): Something;
export default class Something {
}
//// [main.d.ts]
import Thing from "./root";
export declare const instance: Thing;
|
/*!
* Bootstrap-select v1.13.9 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2019 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
(function (root, factory) {
if (root === undefined && window !== undefined) root = window;
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function (a0) {
return (factory(a0));
});
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
factory(root["jQuery"]);
}
}(this, function (jQuery) {
(function ($) {
$.fn.selectpicker.defaults = {
noneSelectedText: 'Hiçbiri seçilmedi',
noneResultsText: 'Hiçbir sonuç bulunamadı {0}',
countSelectedText: function (numSelected, numTotal) {
return (numSelected == 1) ? '{0} öğe seçildi' : '{0} öğe seçildi';
},
maxOptionsText: function (numAll, numGroup) {
return [
(numAll == 1) ? 'Limit aşıldı (maksimum {n} sayıda öğe )' : 'Limit aşıldı (maksimum {n} sayıda öğe)',
(numGroup == 1) ? 'Grup limiti aşıldı (maksimum {n} sayıda öğe)' : 'Grup limiti aşıldı (maksimum {n} sayıda öğe)'
];
},
selectAllText: 'Tümünü Seç',
deselectAllText: 'Seçiniz',
multipleSeparator: ', '
};
})(jQuery);
}));
//# sourceMappingURL=defaults-tr_TR.js.map
|
/**
* Generate the node required for user display length changing
* @param {object} oSettings dataTables settings object
* @returns {node} Display length feature node
* @memberof DataTable#oApi
*/
function _fnFeatureHtmlLength(oSettings) {
if (oSettings.oScroll.bInfinite) {
return null;
}
/* This can be overruled by not using the _MENU_ var/macro in the language variable */
var sName = 'name="' + oSettings.sTableId + '_length"';
var sStdMenu = '<select size="1" ' + sName + '>';
var i, iLen;
var aLengthMenu = oSettings.aLengthMenu;
if (aLengthMenu.length == 2 && typeof aLengthMenu[0] === 'object' &&
typeof aLengthMenu[1] === 'object') {
for (i = 0, iLen = aLengthMenu[0].length; i < iLen; i++) {
sStdMenu += '<option value="' + aLengthMenu[0][i] + '">' + aLengthMenu[1][i] + '</option>';
}
}
else {
for (i = 0, iLen = aLengthMenu.length; i < iLen; i++) {
sStdMenu += '<option value="' + aLengthMenu[i] + '">' + aLengthMenu[i] + '</option>';
}
}
sStdMenu += '</select>';
var nLength = document.createElement('div');
if (!oSettings.aanFeatures.l) {
nLength.id = oSettings.sTableId + '_length';
}
nLength.className = oSettings.oClasses.sLength;
nLength.innerHTML = '<label>' + oSettings.oLanguage.sLengthMenu.replace('_MENU_', sStdMenu) + '</label>';
/*
* Set the length to the current display length - thanks to Andrea Pavlovic for this fix,
* and Stefan Skopnik for fixing the fix!
*/
$('select option[value="' + oSettings._iDisplayLength + '"]', nLength).attr("selected", true);
$('select', nLength).bind('change.DT', function (e) {
var iVal = $(this).val();
/* Update all other length options for the new display */
var n = oSettings.aanFeatures.l;
for (i = 0, iLen = n.length; i < iLen; i++) {
if (n[i] != this.parentNode) {
$('select', n[i]).val(iVal);
}
}
/* Redraw the table */
oSettings._iDisplayLength = parseInt(iVal, 10);
_fnCalculateEnd(oSettings);
/* If we have space to show extra rows (backing up from the end point - then do so */
if (oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay()) {
oSettings._iDisplayStart = oSettings.fnDisplayEnd() - oSettings._iDisplayLength;
if (oSettings._iDisplayStart < 0) {
oSettings._iDisplayStart = 0;
}
}
if (oSettings._iDisplayLength == -1) {
oSettings._iDisplayStart = 0;
}
_fnDraw(oSettings);
});
$('select', nLength).attr('aria-controls', oSettings.sTableId);
return nLength;
}
/**
* Recalculate the end point based on the start point
* @param {object} oSettings dataTables settings object
* @memberof DataTable#oApi
*/
function _fnCalculateEnd(oSettings) {
if (oSettings.oFeatures.bPaginate === false) {
oSettings._iDisplayEnd = oSettings.aiDisplay.length;
}
else {
/* Set the end point of the display - based on how many elements there are
* still to display
*/
if (oSettings._iDisplayStart + oSettings._iDisplayLength > oSettings.aiDisplay.length ||
oSettings._iDisplayLength == -1) {
oSettings._iDisplayEnd = oSettings.aiDisplay.length;
}
else {
oSettings._iDisplayEnd = oSettings._iDisplayStart + oSettings._iDisplayLength;
}
}
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
var _echarts = require("./lib/echarts");
(function () {
for (var key in _echarts) {
if (_echarts == null || !_echarts.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;
exports[key] = _echarts[key];
}
})();
var _export = require("./lib/export");
(function () {
for (var key in _export) {
if (_export == null || !_export.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;
exports[key] = _export[key];
}
})();
require("./lib/component/dataset");
require("./lib/chart/line");
require("./lib/chart/bar");
require("./lib/chart/pie");
require("./lib/chart/scatter");
require("./lib/chart/radar");
require("./lib/chart/map");
require("./lib/chart/tree");
require("./lib/chart/treemap");
require("./lib/chart/graph");
require("./lib/chart/gauge");
require("./lib/chart/funnel");
require("./lib/chart/parallel");
require("./lib/chart/sankey");
require("./lib/chart/boxplot");
require("./lib/chart/candlestick");
require("./lib/chart/effectScatter");
require("./lib/chart/lines");
require("./lib/chart/heatmap");
require("./lib/chart/pictorialBar");
require("./lib/chart/themeRiver");
require("./lib/chart/sunburst");
require("./lib/chart/custom");
require("./lib/component/graphic");
require("./lib/component/grid");
require("./lib/component/legendScroll");
require("./lib/component/tooltip");
require("./lib/component/axisPointer");
require("./lib/component/polar");
require("./lib/component/geo");
require("./lib/component/parallel");
require("./lib/component/singleAxis");
require("./lib/component/brush");
require("./lib/component/calendar");
require("./lib/component/title");
require("./lib/component/dataZoom");
require("./lib/component/visualMap");
require("./lib/component/markPoint");
require("./lib/component/markLine");
require("./lib/component/markArea");
require("./lib/component/timeline");
require("./lib/component/toolbox");
require("zrender/lib/vml/vml");
require("zrender/lib/svg/svg");
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.2.3.3-4-214
description: >
Object.getOwnPropertyDescriptor returns accessor desc for
accessors on built-ins (RegExp.prototype.ignoreCase)
---*/
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "ignoreCase");
assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
assert.sameValue(desc.configurable, true, 'desc.configurable');
assert.sameValue(typeof desc.get, 'function', 'typeof desc.get');
assert.sameValue(desc.set, undefined, 'desc.set');
|
'use strict';
angular.module('ontimeApp')
.controller('LocationController', function ($scope, $state, Location) {
$scope.locations = [];
$scope.loadAll = function() {
Location.query(function(result) {
$scope.locations = result;
});
};
$scope.loadAll();
$scope.refresh = function () {
$scope.loadAll();
$scope.clear();
};
$scope.clear = function () {
$scope.location = {
name: null,
address: null,
id: null
};
};
});
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This file exists to aggregate all of the javascript used by the
// settings page into a single file which will be flattened and served
// as a single resource.
<include src="preferences.js">
<include src="controlled_setting.js">
<include src="deletable_item_list.js">
<include src="editable_text_field.js">
<include src="hotword_search_setting_indicator.js">
<include src="inline_editable_list.js">
<include src="options_page.js">
<include src="pref_ui.js">
<include src="settings_dialog.js">
<include src="settings_banner.js">
<if expr="chromeos">
<include src="../chromeos/user_images_grid.js">
<include src="../help/channel_change_page.js">
<include src="../help/help_page.js">
<include src="../../../../ui/webui/resources/js/chromeos/ui_account_tweaks.js">
<include src="chromeos/change_picture_options.js">
<include src="chromeos/internet_detail_ip_address_field.js">
<include src="chromeos/internet_detail.js">
<include src="chromeos/network_list.js">
<include src="chromeos/preferred_networks.js">
<include src="chromeos/bluetooth_device_list.js">
<include src="chromeos/bluetooth_add_device_overlay.js">
<include src="chromeos/bluetooth_pair_device_overlay.js">
<include src="chromeos/accounts_options.js">
<include src="chromeos/proxy_rules_list.js">
<include src="chromeos/accounts_user_list.js">
<include src="chromeos/accounts_user_name_edit.js">
<include src="chromeos/consumer_management_overlay.js">
<include src="chromeos/display_options.js">
<include src="chromeos/display_overscan.js">
<include src="chromeos/keyboard_overlay.js">
<include src="chromeos/pointer_overlay.js">
<include src="chromeos/third_party_ime_confirm_overlay.js">
var AccountsOptions = options.AccountsOptions;
var ChangePictureOptions = options.ChangePictureOptions;
var ConsumerManagementOverlay = options.ConsumerManagementOverlay;
var DetailsInternetPage = options.internet.DetailsInternetPage;
var DisplayOptions = options.DisplayOptions;
var DisplayOverscan = options.DisplayOverscan;
var BluetoothOptions = options.BluetoothOptions;
var BluetoothPairing = options.BluetoothPairing;
var KeyboardOverlay = options.KeyboardOverlay;
var PointerOverlay = options.PointerOverlay;
var UIAccountTweaks = uiAccountTweaks.UIAccountTweaks;
</if>
<if expr="use_nss">
<include src="certificate_tree.js">
<include src="certificate_manager.js">
<include src="certificate_restore_overlay.js">
<include src="certificate_backup_overlay.js">
<include src="certificate_edit_ca_trust_overlay.js">
<include src="certificate_import_error_overlay.js">
var CertificateManager = options.CertificateManager;
var CertificateRestoreOverlay = options.CertificateRestoreOverlay;
var CertificateBackupOverlay = options.CertificateBackupOverlay;
var CertificateEditCaTrustOverlay = options.CertificateEditCaTrustOverlay;
var CertificateImportErrorOverlay = options.CertificateImportErrorOverlay;
</if>
<include src="alert_overlay.js">
<include src="autofill_edit_address_overlay.js">
<include src="autofill_edit_creditcard_overlay.js">
<include src="autofill_options_list.js">
<include src="autofill_options.js">
<include src="automatic_settings_reset_banner.js">
<include src="browser_options.js">
<include src="browser_options_profile_list.js">
<include src="browser_options_startup_page_list.js">
<include src="clear_browser_data_overlay.js">
<include src="confirm_dialog.js">
<include src="content_settings.js">
<include src="content_settings_exceptions_area.js">
<include src="content_settings_ui.js">
<include src="cookies_list.js">
<include src="cookies_view.js">
<include src="easy_unlock_turn_off_overlay.js">
<include src="factory_reset_overlay.js">
<include src="font_settings.js">
<if expr="enable_google_now">
<include src="geolocation_options.js">
</if>
<include src="handler_options.js">
<include src="handler_options_list.js">
<include src="home_page_overlay.js">
<include src="hotword_confirm_dialog.js">
<include src="import_data_overlay.js">
<include src="language_add_language_overlay.js">
<if expr="not is_macosx">
<include src="language_dictionary_overlay_word_list.js">
<include src="language_dictionary_overlay.js">
</if>
<include src="language_list.js">
<include src="language_options.js">
<include src="manage_profile_overlay.js">
<include src="options_focus_manager.js">
<include src="origin_resources_list.js">
<include src="password_manager.js">
<include src="password_manager_list.js">
<include src="profiles_icon_grid.js">
<include src="reset_profile_settings_overlay.js">
<include src="search_engine_manager.js">
<include src="search_engine_manager_engine_list.js">
<include src="search_page.js">
<include src="startup_overlay.js">
<include src="supervised_user_create_confirm.js">
<include src="supervised_user_import.js">
<include src="supervised_user_learn_more.js">
<include src="supervised_user_list.js">
<include src="supervised_user_list_data.js">
<include src="website_settings.js">
<include src="../sync_setup_overlay.js">
<include src="../uber/uber_page_manager_observer.js">
<include src="../uber/uber_utils.js">
<include src="options.js">
<if expr="enable_settings_app">
<include src="options_settings_app.js">
</if>
|
GLOBAL.DEBUG = true;
sys = require("sys");
test = require("assert");
var Db = require('../lib/mongodb').Db,
Connection = require('../lib/mongodb').Connection,
Server = require('../lib/mongodb').Server;
var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost';
var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT;
sys.puts("Connecting to " + host + ":" + port);
var db = new Db('node-mongo-examples', new Server(host, port, {}), {native_parser:true});
db.open(function(err, db) {
db.collection('test', function(err, collection) {
// Erase all records from collection, if any
collection.remove(function(err, result) {
// Insert 3 records
for(var i = 0; i < 3; i++) {
collection.insert({'a':i});
}
// Cursors don't run their queries until you actually attempt to retrieve data
// from them.
// Find returns a Cursor, which is Enumerable. You can iterate:
collection.find(function(err, cursor) {
cursor.each(function(err, item) {
if(item != null) sys.puts(sys.inspect(item));
});
});
// You can turn it into an array
collection.find(function(err, cursor) {
cursor.toArray(function(err, items) {
sys.puts("count: " + items.length);
});
});
// You can iterate after turning it into an array (the cursor will iterate over
// the copy of the array that it saves internally.)
collection.find(function(err, cursor) {
cursor.toArray(function(err, items) {
cursor.each(function(err, item) {
if(item != null) sys.puts(sys.inspect(item));
});
});
});
// You can get the next object
collection.find(function(err, cursor) {
cursor.nextObject(function(err, item) {
if(item != null) sys.puts(sys.inspect(item));
});
});
// next_object returns null if there are no more objects that match
collection.find(function(err, cursor) {
cursor.nextObject(function(err, item) {
cursor.nextObject(function(err, item) {
cursor.nextObject(function(err, item) {
cursor.nextObject(function(err, item) {
sys.puts("nextObject returned: " + sys.inspect(item));
db.close();
});
});
});
});
});
});
});
});
|
'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.bulkInsert('UserMeetings', [
{
user_id: 1,
meeting_id: 2
},
{
user_id: 2,
meeting_id: 2
},
{
user_id: 3,
meeting_id: 2
},
{
user_id: 4,
meeting_id: 2
},
{
user_id: 1,
meeting_id: 4
},
{
user_id: 2,
meeting_id: 4
},
{
user_id: 3,
meeting_id: 4
},
{
user_id: 4,
meeting_id: 4
},
{
user_id: 1,
meeting_id: 6
},
{
user_id: 2,
meeting_id: 6
},
{
user_id: 3,
meeting_id: 6
},
{
user_id: 4,
meeting_id: 6
},
{
user_id: 1,
meeting_id: 8
},
{
user_id: 2,
meeting_id: 8
},
{
user_id: 3,
meeting_id: 8
},
{
user_id: 4,
meeting_id: 8
}
], {});
},
down: function (queryInterface, Sequelize) {
return queryInterface.bulkDelete('UserMeetings', null, {});
}
};
|
/* TimerManager.js
KC3改 Sortie Manager
Container object for timers for expedition, construction, and repair
*/
(function(){
"use strict";
window.KC3TimerManager = {
_exped: [],
_repair: [],
_build: [],
init :function(eMap, rMap, bMap){
this._exped = [
new KC3Timer(eMap[0], 0, 0),
new KC3Timer(eMap[1], 0, 1),
new KC3Timer(eMap[2], 0, 2)
];
this._repair = [
new KC3Timer(rMap[0], 1, 0),
new KC3Timer(rMap[1], 1, 1),
new KC3Timer(rMap[2], 1, 2),
new KC3Timer(rMap[3], 1, 3)
];
this._build = [
new KC3Timer(bMap[0], 2, 0),
new KC3Timer(bMap[1], 2, 1),
new KC3Timer(bMap[2], 2, 2),
new KC3Timer(bMap[3], 2, 3)
];
},
exped :function(num){ return this._exped[num-2]; },
repair :function(num){ return this._repair[num-1]; },
build :function(num){ return this._build[num-1]; },
updateTimerElement : function(eMap, rMap, bMap){
this._exped[0].updateElement(eMap[0]);
this._exped[1].updateElement(eMap[1]);
this._exped[2].updateElement(eMap[2]);
this._repair[0].updateElement(rMap[0]);
this._repair[1].updateElement(rMap[1]);
this._repair[2].updateElement(rMap[2]);
this._repair[3].updateElement(rMap[3]);
this._build[0].updateElement(bMap[0]);
this._build[1].updateElement(bMap[1]);
this._build[2].updateElement(bMap[2]);
this._build[3].updateElement(bMap[3]);
},
update: function(){
this._exped[0].time();
this._exped[1].time();
this._exped[2].time();
this._repair[0].time();
this._repair[1].time();
this._repair[2].time();
this._repair[3].time();
this._build[0].time();
this._build[1].time();
this._build[2].time();
this._build[3].time();
}
};
})();
|
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import { expect } from 'chai';
import { Hello } from 'client/components/Hello';
const setup = () => {
const props = {
message: 'hello'
};
const renderer = TestUtils.createRenderer();
renderer.render(<Hello {...props} />);
const output = renderer.getRenderOutput();
return { output };
};
describe('tests Hello component', () => {
it('renders correctly', () => {
const { output } = setup();
expect(output.type).to.eql('div');
expect(output.props.children).to.eql('hello');
});
});
|
import { rebind } from '@d3fc/d3fc-rebind';
import _slidingWindow from './slidingWindow';
import exponentialMovingAverage from './exponentialMovingAverage';
import { convertNaN } from './fn';
export default function() {
let volumeValue = (d, i) => d.volume;
let closeValue = (d, i) => d.close;
const emaComputer = exponentialMovingAverage()
.period(13);
const slidingWindow = _slidingWindow()
.period(2)
.defined(d => closeValue(d) != null && volumeValue(d) != null)
.accumulator(values => values &&
convertNaN((closeValue(values[1]) - closeValue(values[0])) * volumeValue(values[1])));
const force = data => {
const forceIndex = slidingWindow(data);
return emaComputer(forceIndex);
};
force.volumeValue = (...args) => {
if (!args.length) {
return volumeValue;
}
volumeValue = args[0];
return force;
};
force.closeValue = (...args) => {
if (!args.length) {
return closeValue;
}
closeValue = args[0];
return force;
};
rebind(force, emaComputer, 'period');
return force;
}
|
var format = require('util').format;
var hl = require('highlight.js');
var escape = function(html) {
return html.
replace(/</g, '<').
replace(/>/g, '>').
replace(/"/g, '"').
replace(/'/g, ''');
};
try {
var rs = require('robotskirt');
escape = rs.houdini.escapeHTML;
} catch (e) {
}
exports.render = function(code, language) {
language = exports.language(language);
if (!language) {
return '<pre>' + escape(code) + '</pre>';
}
if (language === 'html') {
language = 'xml';
}
code = hl.highlight(language, code).value;
return format(
'<div class="highlight"><pre><code class="%s">%s</code></pre></div>',
language, code
);
};
exports.language = function(language) {
if (!language) {
return null;
}
if (language === 'html') {
return 'html';
}
var shortcuts = {
'js': 'javascript',
'json': 'javascript',
'py': 'python',
'rb': 'ruby',
'md': 'markdown',
'mkd': 'markdown',
'c++': 'cpp'
};
if (language && shortcuts[language]) {
language = shortcuts[language];
}
if (!language || !hl.LANGUAGES[language]) {
return null;
}
return language;
};
|
'use strict';
// Check that main thread handles an unknown message type from a worker thread
// as expected.
require('../common');
const assert = require('assert');
const { spawnSync } = require('child_process');
const { Worker } = require('worker_threads');
if (process.argv[2] !== 'spawned') {
const result = spawnSync(process.execPath,
[ '--expose-internals', __filename, 'spawned'],
{ encoding: 'utf8' });
assert.ok(result.stderr.includes('Unknown worker message type FHQWHGADS'),
`Expected error not found in: ${result.stderr}`);
} else {
new Worker(`
const { internalBinding } = require('internal/test/binding');
const { getEnvMessagePort } = internalBinding('worker');
const messagePort = getEnvMessagePort();
messagePort.postMessage({ type: 'FHQWHGADS' });
`, { eval: true });
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);
var _svgIcon = require('../../svg-icon');
var _svgIcon2 = _interopRequireDefault(_svgIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PlacesSmokingRooms = _react2.default.createClass({
displayName: 'PlacesSmokingRooms',
mixins: [_reactAddonsPureRenderMixin2.default],
render: function render() {
return _react2.default.createElement(
_svgIcon2.default,
this.props,
_react2.default.createElement('path', { d: 'M2 16h15v3H2zm18.5 0H22v3h-1.5zM18 16h1.5v3H18zm.85-8.27c.62-.61 1-1.45 1-2.38C19.85 3.5 18.35 2 16.5 2v1.5c1.02 0 1.85.83 1.85 1.85S17.52 7.2 16.5 7.2v1.5c2.24 0 4 1.83 4 4.07V15H22v-2.24c0-2.22-1.28-4.14-3.15-5.03zm-2.82 2.47H14.5c-1.02 0-1.85-.98-1.85-2s.83-1.75 1.85-1.75v-1.5c-1.85 0-3.35 1.5-3.35 3.35s1.5 3.35 3.35 3.35h1.53c1.05 0 1.97.74 1.97 2.05V15h1.5v-1.64c0-1.81-1.6-3.16-3.47-3.16z' })
);
}
});
exports.default = PlacesSmokingRooms;
module.exports = exports['default'];
|
'use strict';
var angular = require('angular');
angular
.module('mwl.calendar')
.controller('MwlDragSelectCtrl', function($scope, $element, $parse, $attrs) {
function handleMouseEvent(callbackName) {
return function(event) {
if (callbackName) {
$parse(callbackName)($scope);
$scope.$apply();
}
event.preventDefault();
};
}
var onMouseDown = handleMouseEvent($attrs.onDragSelectStart);
var onMouseMove = handleMouseEvent($attrs.onDragSelectMove);
var onMouseUp = handleMouseEvent($attrs.onDragSelectEnd);
function enableMouseListeners() {
$element.on('mousedown', onMouseDown);
$element.on('mousemove', onMouseMove);
$element.on('mouseup', onMouseUp);
}
function disableMouseListeners() {
$element.off('mousedown', onMouseDown);
$element.off('mousemove', onMouseMove);
$element.off('mouseup', onMouseUp);
}
$scope.$watch($attrs.mwlDragSelect, function(isEnabled) {
if (isEnabled) {
enableMouseListeners();
} else {
disableMouseListeners();
}
});
$scope.$on('$destroy', function() {
disableMouseListeners();
});
})
.directive('mwlDragSelect', function() {
return {
restrict: 'A',
controller: 'MwlDragSelectCtrl'
};
});
|
export default class BatchDeleteController {
constructor($scope, $state, WriteQueries, notification, view) {
this.$scope = $scope;
this.$state = $state;
this.WriteQueries = WriteQueries;
this.notification = notification;
this.view = view;
this.entity = view.getEntity();
this.entityIds = $state.params.ids;
this.selection = []; // fixme: query db to get selection
this.title = view.title();
this.description = view.description();
this.actions = view.actions();
this.loadingPage = false;
this.fields = view.fields();
$scope.$on('$destroy', this.destroy.bind(this));
}
batchDelete() {
var notification = this.notification,
$state = this.$state,
entityName = this.entity.name();
this.WriteQueries.batchDelete(this.view, this.entityIds).then(function () {
$state.go($state.get('list'), angular.extend({
entity: entityName
}, $state.params));
notification.log('Elements successfully deleted.', { addnCls: 'humane-flatty-success' });
}, function (response) {
// @TODO: share this method when splitting controllers
var body = response.data;
if (typeof body === 'object') {
body = JSON.stringify(body);
}
notification.log('Oops, an error occured : (code: ' + response.status + ') ' + body, {addnCls: 'humane-flatty-error'});
});
}
back() {
this.$state.go(this.$state.get('list'), angular.extend({
entity: this.entity.name()
}, this.$state.params));
}
destroy() {
this.$scope = undefined;
this.$state = undefined;
this.WriteQueries = undefined;
}
}
BatchDeleteController.$inject = ['$scope', '$state', 'WriteQueries', 'notification', 'view'];
|
const helpers = require("./global-setup");
const path = require("path");
const request = require("request");
const expect = require("chai").expect;
const describe = global.describe;
const it = global.it;
const beforeEach = global.beforeEach;
const afterEach = global.afterEach;
describe("Position of modules", function () {
helpers.setupTimeout(this);
var app = null;
describe("Using helloworld", function () {
after(function () {
return helpers.stopApplication(app);
});
before(function () {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/modules/positions.js";
return helpers.startApplication({
args: ["js/electron.js"]
}).then(function (startedApp) { app = startedApp; })
});
var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third",
"middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right",
"bottom_bar", "fullscreen_above", "fullscreen_below"];
var position;
var className;
for (idx in positions) {
position = positions[idx];
className = position.replace("_", ".");
it("show text in " + position, function () {
return app.client.waitUntilWindowLoaded()
.getText("." + className).should.eventually.equal("Text in " + position);
});
}
});
});
|
'use strict';
const assert = require('./../../assert');
const common = require('./../../common');
let battle;
describe(`Pursuit`, function () {
afterEach(() => battle.destroy());
it(`should execute before the target switches out and after the user mega evolves`, function () {
battle = common.createBattle();
battle.join('p1', 'Guest 1', 1, [{species: "Beedrill", ability: 'swarm', item: 'beedrillite', moves: ['pursuit']}]);
battle.join('p2', 'Guest 2', 1, [{species: "Alakazam", ability: 'magicguard', moves: ['psyshock']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}]);
battle.p1.chooseMove('pursuit', null, true);
battle.p2.chooseSwitch(2);
assert.species(battle.p1.active[0], "Beedrill-Mega");
assert.fainted(battle.p2.active[0]);
});
});
|
(function($) {
Drupal.plupload = Drupal.plupload || {};
/**
* Attaches the Plupload behavior to each FileField Sources Plupload form element.
*/
Drupal.behaviors.filefield_sources_plupload = {
attach: function (context, settings) {
$(".filefield-source-plupload .plupload-element", context).once('ffs-plupload-init', function () {
// Merge the default settings and the element settings to get a full
// settings object to pass to the Plupload library for this element.
var id = $(this).attr('id');
var defaultSettings = settings.plupload['_default'] ? settings.plupload['_default'] : {};
var elementSettings = (id && settings.plupload[id]) ? settings.plupload[id] : {};
var pluploadSettings = $.extend({}, defaultSettings, elementSettings);
// Initialize Plupload for this element.
$(this).pluploadQueue(pluploadSettings);
// Hide upload button. We will do this using uploader.start()
$(this).find('.plupload_start').hide();
// While we are at it, hide the redundant file validation help
$(this).closest('.filefield-source-plupload').find('div.description').hide();
// Add button.
var add_button = $(this).find('.plupload_button.plupload_add');
// Intercept the submit to start uploading and ensure all files are done
// uploading before triggering the ajax form update.
var $submit = $(this).closest('.filefield-source-plupload').find('.form-submit');
var uploader_element = $(this).closest('.filefield-source-plupload').find('.plupload-element');
var uploader = uploader_element.pluploadQueue();
// Refresh for IE8
uploader.refresh();
uploader.bind('QueueChanged', function() {
// If cardinality is NOT unlimited.
if (pluploadSettings.cardinality > 0) {
// Remove files exceeding the cardinality setting.
if (uploader.files.length >= pluploadSettings.cardinality) {
var i = 0;
for (i=0;i<uploader.files.length;i++) {
if (i >= pluploadSettings.cardinality) {
uploader.removeFile(uploader.files[i]);
}
}
add_button.hide();
}
else {
add_button.show();
}
}
});
$submit.bind('click', function(e) {
e.preventDefault();
uploader.bind('StateChanged', function() {
if (uploader.total.uploaded == uploader.files.length) {
// Custom ajax trigger
$submit.trigger('pud_update');
}
});
if (uploader.files.length > 0) {
$submit.val(Drupal.t('Uploading...'));
uploader.start();
}
return false;
});
});
}
}
})(jQuery);
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'bidi', 'ka', {
ltr: 'ტექსტის მიმართულება მარცხნიდან მარჯვნივ',
rtl: 'ტექსტის მიმართულება მარჯვნიდან მარცხნივ'
} );
|
/*
* Allofthelights.js
* Version: 1.0
* http://www.megaptery.com/allofthelights/
*/
(function ($) {
$.fn.allofthelights = function (options) {
var defaults = {
'color': '#000000',
'opacity': '0.9',
'switch_id': 'switch',
'animation': 'fade',
'delay_turn_on': 400,
'delay_turn_off': 400,
'scrolling': true,
'clickable_bg': false,
'is_responsive': true,
'z_index': '10',
'custom_player': null,
};
var options = $.extend(defaults, options);
return this.each(function () {
var $this = $(this),
first_click = true,
offset = null,
height = null,
width = null,
width_window = null,
height_window = null,
button = null,
switch_off = '#'+options.switch_id+'_off';
if (options.is_responsive) {
var selectors = [
"iframe[src*='player.vimeo.com']",
"iframe[src*='www.youtube.com']",
"iframe[src*='www.dailymotion.com']",
"iframe[src*='www.kickstarter.com']",
"object",
"embed"
];
if (options.custom_player) {
selectors.push(options.custom_player);
}
var $allVideos = $(this).parent().find(selectors.join(','));
var style = '­<style type="text/css"> \
.fluid_width_video_wrapper { \
width: 100%; \
position: relative; \
padding: 0; \
} \
\
.fluid_width_video_wrapper iframe, \
.ffluid_width_video_wrapper object, \
.fluid_width_video_wrapper embed { \
position: absolute; \
top: 0; \
left: 0; \
width: 100%; \
height: 100%; \
} \
</style>';
$('body').append(style);
$allVideos.each(function(){
var $this = $(this);
if (this.tagName.toLowerCase() == 'embed' && $this.parent('object').length || $this.parent('.fluid_width_video_wrapper').length) { return; }
var height = ( this.tagName.toLowerCase() == 'object' || $this.attr('height') ) ? $this.attr('height') : $this.height(),
width = $this.attr('width') ? $this.attr('width') : $this.width(),
aspectRatio = height / width;
if(!$this.attr('id')){
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
$this.attr('id', videoID);
}
$this.wrap('<div class="fluid_width_video_wrapper"></div>').parent('.fluid_width_video_wrapper').css('padding-top', (aspectRatio * 100)+"%");
$this.removeAttr('height').removeAttr('width');
});
}
if (options.animation == 'none') {
options.delay_turn_on = 0;
options.delay_turn_off = 0;
}
if (options.clickable_bg) {
switch_off += ', div.allofthelights_bg';
}
$('body').on('click', switch_off, function() {
variables();
update();
$('div.allofthelights_bg').fadeOut(+options.delay_turn_off);
$('#'+options.switch_id+'_off').fadeOut(0);
if (!options.scrolling) {
$('body').css('overflow', 'auto');
}
}).on('click', '#'+options.switch_id, function() {
variables();
if (first_click) {
first_click = false;
var html = "<style type='text/css'>.allofthelights_bg {display:none;position:absolute;background:"+options.color+";z-index:"+options.z_index+";}</style>" + "<div id='"+options.switch_id+"_off' style='display:none;position:absolute;top:"+button.top+"px;left:"+button.left+"px;'></div>";
var i = 0;
for ( i = 1 ; i <= 4 ; ++i ) {
html += "<div id='allofthelights_bg"+i+"' class='allofthelights_bg'></div>"
}
$('body').append(html);
$('.allofthelights_bg').css('opacity',+options.opacity);
update();
}
$('#'+options.switch_id+'_off').fadeIn(0);
$('div.allofthelights_bg').fadeIn(+options.delay_turn_on);
if (!options.scrolling) {
$('body').css('overflow', 'hidden');
}
});
$(window).on('resize', function() {
var display = false;
if ( $('div.allofthelights_bg').is(':visible') ) {
display = true;
$('div.allofthelights_bg').hide();
}
variables();
update();
if (display) {
$('div.allofthelights_bg').show();
}
});
function variables() {
offset = $this.offset();
height = $this.height();
width = $this.width();
width_window = $(document).width();
height_window = $(document).height();
button = $('#'+options.switch_id).offset();
}
function update() {
$('#'+options.switch_id+'_off').css({
'top': button.top,
'left': button.left
});
$('#allofthelights_bg1').css({
'top': '0px',
'height': offset.top,
'left': '0px',
'right': '0px'
});
$('#allofthelights_bg2').css({
'height': height,
'top': offset.top,
'left': '0px',
'right': (width_window - offset.left)
});
$('#allofthelights_bg3').css({
'height': height,
'top': offset.top,
'right': '0px',
'bottom': '0px',
'left': (offset.left+width)
});
$('#allofthelights_bg4').css({
'height': (height_window-(offset.top+height)),
'top': (offset.top+height),
'bottom': '0px',
'left': '0px',
'right': '0px'
});
}
});
};
})(jQuery);
|
var base = require('settings/teams/update-team-photo');
Vue.component('spark-update-team-photo', {
mixins: [base]
});
|
/*
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("view-node-map",function(e,t){function i(){}var n=e.namespace("View._buildCfg"),r={};n.aggregates||(n.aggregates=[]),n.aggregates.push("getByNode"),i.getByNode=function(t){var n;return e.one(t).ancestor(function(t){return(n=r[e.stamp(t,!0)])||!1},!0),n||null},i._instances=r,i.prototype={initializer:function(){r[e.stamp(this.get("container"))]=this},destructor:function(){var t=e.stamp(this.get("container"),!0);t in r&&delete r[t]}},e.View.NodeMap=i},"3.8.0",{requires:["view"]});
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'horizontalrule', 'pl', {
toolbar: 'Wstaw poziomą linię'
} );
|
/*
* /MathJax/jax/output/HTML-CSS/fonts/TeX/SansSerif/Regular/CombDiacritMarks.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Insert( MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.MathJax_SansSerif, {
768: [694, -527, 0, -417, -199],
769: [694, -527, 0, -302, -84],
770: [694, -527, 0, -422, -79],
771: [677, -543, 0, -417, -84],
772: [631, -552, 0, -431, -70],
774: [694, -508, 0, -427, -74],
775: [680, -576, 0, -302, -198],
776: [680, -582, 0, -397, -104],
778: [694, -527, 0, -319, -99],
779: [694, -527, 0, -399, -84],
780: [654, -487, 0, -422, -79]
} );
MathJax.Ajax.loadComplete( MathJax.OutputJax["HTML-CSS"].fontDir + "/SansSerif/Regular/CombDiacritMarks.js" );
|
/*
* Ample SDK - JavaScript GUI Framework
*
* Copyright (c) 2012 Sergey Ilinsky, Zingus J. Rinkle
* Dual licensed under the MIT and GPL licenses.
* See: http://www.amplesdk.com/about/licensing/
*
*/
ample.locale.addCultureInfo("it", {
messages: {
// window/dialog/wizard
"xul.dialog.button.accept": "OK",
"xul.dialog.button.cancel": "Annulla",
"xul.dialog.button.close": "Chiudi",
"xul.dialog.button.help": "Aiuto",
"xul.dialog.button.finish": "Fine",
"xul.dialog.button.next": "Prossimo",
"xul.dialog.button.previous": "Precedente",
// editor
"xul.editor.button.undo": "Annulla Inserimento",
"xul.editor.button.redo": "Ripristina Inserimento",
"xul.editor.button.justifyleft": "Allinea Testo a Sinistra",
"xul.editor.button.justifycenter": "Allinea Testo al Centro",
"xul.editor.button.justifyright": "Allinea Text a Destra",
"xul.editor.button.justifyfull": "Allineamento giustificato",
"xul.editor.button.outdent": "Diminuisci l'Indentazione del Paragrafo",
"xul.editor.button.indent": "Aumenta l'Indentazione del Paragrafo",
"xul.editor.button.insertunorderedlist":"Inizia una Lista puntata",
"xul.editor.button.insertorderedlist": "Inizia una Lista numerata",
"xul.editor.button.createlink": "Crea un Link",
"xul.editor.button.unlink": "Rimuovi il Link",
"xul.editor.button.bold": "Rendi grassetto il Testo selezionato",
"xul.editor.button.italic": "Rendi corsivo il Testo selezionato",
"xul.editor.button.underline": "Sottolinea il Testo selezionato",
"xul.editor.button.strikethrough": "Sbarra il Testo selezionato",
"xul.editor.button.subscript": "Sposta il Testo in alto (Apice)",
"xul.editor.button.superscript": "Sposta il Testo in basso (Pedice)",
"xul.editor.button.fontsize": "Cambia la Dimensione del Carattere",
"xul.editor.button.fontname": "Cambia il Tipo di Carattere",
"xul.editor.button.formatblock": "Formattazione del Paragrafo",
"xul.editor.button.forecolor": "Cambia il colore del testo",
"xul.editor.button.backcolor": "Cambia il colore di sfondo del testo",
// Stupid text (please keep it for RCS and later editions)
"{":"}"
}
});
|
import Ember from 'ember';
import { sumBy } from 'lodash';
const { Controller, computed } = Ember;
export default Controller.extend({
ticketsTotal: computed(function() {
return sumBy(this.get('model'), 'tickets');
}),
salesTotal: computed(function() {
return sumBy(this.get('model'), 'sales');
}),
discountsTotal: computed(function() {
return sumBy(this.get('model'), 'discounts');
})
});
|
({
L_MENU_GRID: "M\u0159\u00ed\u017eka nab\u00eddky",
L_MENU_ITEM_DISABLED: "Polo\u017eka %1 nen\u00ed dostupn\u00e1.",
L_MENU_ITEM_SUBMENU: "Podnab\u00eddka %1",
L_MENU_SUBMENU: "podnab\u00eddka",
L_MENU_CHECK: "za\u0161krtnout"
})
|
import { test } from 'ember-qunit';
import moduleFor from 'open-event-frontend/tests/helpers/unit-helper';
moduleFor('route:admin/sessions', 'Unit | Route | admin/sessions', []);
test('it exists', function(assert) {
let route = this.subject();
assert.ok(route);
});
|
define(['modules/forms/module','bootstrap-validator'], function(module){
"use strict";
module.registerDirective('bootstrapProfileForm', function(){
return {
restrict: 'E',
replace: true,
templateUrl: 'app/modules/forms/directives/bootstrap-validation/bootstrap-profile-form.tpl.html',
link: function(scope, form){
form.bootstrapValidator({
feedbackIcons : {
valid : 'glyphicon glyphicon-ok',
invalid : 'glyphicon glyphicon-remove',
validating : 'glyphicon glyphicon-refresh'
},
fields : {
email : {
validators : {
notEmpty : {
message : 'The email address is required'
},
emailAddress : {
message : 'The email address is not valid'
}
}
},
password : {
validators : {
notEmpty : {
message : 'The password is required'
}
}
}
}
});
;
}
}
})
});
|
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
* @path ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-32.js
* @description Array.prototype.reduceRight - RegExp Object can be used as accumulator
*/
function testcase() {
var accessed = false;
var objRegExp = new RegExp();
function callbackfn(prevVal, curVal, idx, obj) {
accessed = true;
return prevVal === objRegExp;
}
var obj = { 0: 11, length: 1 };
return Array.prototype.reduceRight.call(obj, callbackfn, objRegExp) === true && accessed;
}
runTestCase(testcase);
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getISODay;
var _index = _interopRequireDefault(require("../toDate/index.js"));
var _index2 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @name getISODay
* @category Weekday Helpers
* @summary Get the day of the ISO week of the given date.
*
* @description
* Get the day of the ISO week of the given date,
* which is 7 for Sunday, 1 for Monday etc.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* @param {Date|Number} date - the given date
* @returns {Number} the day of ISO week
* @throws {TypeError} 1 argument required
*
* @example
* // Which day of the ISO week is 26 February 2012?
* var result = getISODay(new Date(2012, 1, 26))
* //=> 7
*/
function getISODay(dirtyDate) {
(0, _index2.default)(1, arguments);
var date = (0, _index.default)(dirtyDate);
var day = date.getDay();
if (day === 0) {
day = 7;
}
return day;
}
module.exports = exports.default;
|
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import replicationControllerDetailModule from 'replicationcontrollerdetail/replicationcontrollerdetail_module';
import UpdateReplicasDialogController from 'replicationcontrollerdetail/updatereplicas_controller';
describe('Update Replicas controller', () => {
/**
* Replication Controller Detail controller.
* @type {!UpdateReplicasDialogController}
*/
let ctrl;
/** @type {!md.$dialog} */
let mdDialog;
/** @type {!ui.router.$state} */
let state;
/** @type {!angular.$resource} */
let resource;
/** @type {!angular.$httpBackend} */
let httpBackend;
/** @type {!angular.$log} */
let log;
/** @type {string} */
let namespaceMock = 'foo-namespace';
/** @type {string} */
let replicationControllerMock = 'foo-name';
beforeEach(() => {
angular.mock.module(replicationControllerDetailModule.name);
angular.mock.inject(($log, $state, $mdDialog, $controller, $httpBackend, $resource) => {
mdDialog = $mdDialog;
state = $state;
resource = $resource;
httpBackend = $httpBackend;
log = $log;
ctrl = $controller(
UpdateReplicasDialogController, {
$resource: resource,
namespace: namespaceMock,
replicationController: replicationControllerMock,
currentPods: 1,
desiredPods: 1,
},
{updateReplicasForm: {$valid: true}});
});
});
it('should update controller replicas to given number and log success', () => {
// given
let replicaSpec = {
replicas: 5,
};
spyOn(log, 'info');
spyOn(state, 'reload');
httpBackend.whenPOST('api/v1/replicationcontroller/foo-namespace/foo-name/update/pod')
.respond(200, replicaSpec);
// when
ctrl.updateReplicas();
httpBackend.flush();
// then
expect(log.info).toHaveBeenCalledWith(
`Successfully updated replicas number to ${replicaSpec.replicas}`);
expect(state.reload).toHaveBeenCalled();
});
it('should log error on failed update', () => {
// given
spyOn(log, 'error');
httpBackend.whenPOST('api/v1/replicationcontroller/foo-namespace/foo-name/update/pod')
.respond(404);
// when
ctrl.updateReplicas();
httpBackend.flush();
// then
expect(log.error).toHaveBeenCalled();
});
it('should close the dialog on cancel', () => {
spyOn(state, 'reload');
// given
spyOn(mdDialog, 'cancel');
// when
ctrl.cancel();
// then
expect(mdDialog.cancel).toHaveBeenCalled();
expect(state.reload).not.toHaveBeenCalled();
});
});
|
var q = require('q')
var apigeetool = require('apigeetool')
var async = require('async')
var gutil = require('gulp-util')
function createApp(app){
var defer = q.defer()
var sdk = apigeetool.getPromiseSDK()
var opts=baseopts()
opts.name = app.name
opts.apiProducts = app.apiProducts
opts.email = app.email
opts.callback = app.callback
sdk.createApp(opts)
.then(function(appresponse){
defer.resolve(appresponse)
},function(err){
defer.reject(err)
})
return defer.promise
}
function createApps(app,cb){
var sdk = apigeetool.getPromiseSDK()
var opts=baseopts()
opts.name = app.name
opts.apiProducts = app.apiProducts
opts.email = app.email
opts.callback = app.callback
cb(null,sdk.createApp(opts))
}
function deleteApps(app,cb){
var sdk = apigeetool.getPromiseSDK()
var opts=baseopts()
opts.name=app.name
opts.email = app.email
cb(null,sdk.deleteApp(opts))
}
function deleteProducts(prod,cb) {
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
opts.productName = prod.name,
cb(null,sdk.deleteProduct(opts))
}
function createProducts (prod,cb) {
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
prod.productName = prod.name,
opts.productDesc = prod.displayName
var proxies = ''
for(var p in prod.proxies) proxies += prod.proxies[p] +','
opts.proxies = proxies
var env = ''
for(var e in prod.environments) env += prod.environments[e] + ','
opts.environments = env
var scopes = ''
for(var s in prod.scopes) scopes += prod.scopes[s] + ','
opts.scopes =s
opts.productName = prod.name
cb(null,sdk.createProduct(opts))
}
function createDevelopers (dev,cb) {
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
for(k in dev) opts[k]=dev[k]
console.log(opts)
cb(null,sdk.createDeveloper(opts))
}
function deleteDevelopers (dev,cb) {
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
opts.email = dev.email
cb(null,sdk.deleteDeveloper(opts))
}
function deleteApis(it,cb){
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
opts.directory = it.dir
opts.api = it.proxy
console.log('undeploying ' + opts.api)
sdk.undeploy(opts)
.then(function(){
console.log('undeployed ' + opts.api)
return sdk.delete(opts)
},function(err){
console.log(err)
return sdk.delete(opts)
})
.then(function(){
console.log('deleted ' + opts.api)
cb(null, 'done')
},function(err){
console.log('delete failed ' + opts.api)
cb(err)
})
}
function deployApis(it,cb) {
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
opts.directory = it.dir
opts.api = it.proxy
cb(null, sdk.deployProxy(opts))
}
function createCaches(c,cb){
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
opts.cache = c.name
cb(null,sdk.createcache(opts))
}
function deleteCaches(c,cb){
var sdk = apigeetool.getPromiseSDK()
var opts = baseopts()
console.log('deleting cache ' + c.name)
opts.cache = c.name
console.log(opts)
cb(null,sdk.deletecache(opts))
}
function run(arr, func){
var defer=q.defer();
async.mapSeries(arr,function(c,cb){
func(c,cb)
},function(err,results){
if(err){
console.log(err)
defer.reject(err)
}
q.all(results)
.then(function(){
console.log('done')
defer.resolve()
},function(err){
console.log(err)
defer.reject(err)
})
})
return defer.promise
}
function baseopts () {
var opts = {
organization: gutil.env.org,
token: gutil.env.token,
environments: gutil.env.env,
environment: gutil.env.env,
debug: gutil.env.debug ,
usergrid_org: gutil.env.ug_org,
usergrid_app: gutil.env.ug_app,
usergrid_client_id: gutil.env.ug_client_id,
usergrid_secret: gutil.env.ug_secret
}
return opts
}
module.exports = {
run:run,
createCaches: createCaches,
deleteCaches: deleteCaches,
deployApis: deployApis,
deleteApis: deleteApis,
createProducts: createProducts,
createDevelopers: createDevelopers,
createApp: createApp,
createApps: createApps,
deleteProducts: deleteProducts,
deleteDevelopers: deleteDevelopers,
deleteApps: deleteApps
}
|
var LoadingScreen = {
startLoad: function(successCallback, errorCallback, options) {
if(!options) {
options = {};
}
var _options = {
label: options.label ? options.label : 'Loading...',
style: options.style ? options.style : LoadingScreen.STYLEWHITELARGE,
bgColor: options.isBlackBackground ? 'black' : 'clear'
};
if(options.frame) {
jQuery.extend(_options, {frame: options.frame});
}
DynamicApp.exec(successCallback, errorCallback, 'LoadingScreen', 'startLoad', [_options]);
},
stopLoad: function(successCallback, errorCallback) {
DynamicApp.exec(successCallback, errorCallback, 'LoadingScreen', 'stopLoad', [{}]);
}
};
LoadingScreen.STYLEWHITELARGE = 0;
LoadingScreen.STYLEWHITE = 1;
LoadingScreen.STYLEGRAY = 2;
|
import Enumerator from './enumerator';
import { makeSettledResult } from './enumerator';
import Promise from './promise';
import { o_create } from './utils';
function AllSettled(Constructor, entries, label) {
this._superConstructor(Constructor, entries, false /* don't abort on reject */, label);
}
AllSettled.prototype = o_create(Enumerator.prototype);
AllSettled.prototype._superConstructor = Enumerator;
AllSettled.prototype._makeResult = makeSettledResult;
AllSettled.prototype._validationError = function() {
return new Error("allSettled must be called with an array");
};
/**
`RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing
a fail-fast method, it waits until all the promises have returned and
shows you all the results. This is useful if you want to handle multiple
promises' failure states together as a set.
Returns a promise that is fulfilled when all the given promises have been
settled. The return promise is fulfilled with an array of the states of
the promises passed into the `promises` array argument.
Each state object will either indicate fulfillment or rejection, and
provide the corresponding value or reason. The states will take one of
the following formats:
```javascript
{ state: 'fulfilled', value: value }
or
{ state: 'rejected', reason: reason }
```
Example:
```javascript
var promise1 = RSVP.Promise.resolve(1);
var promise2 = RSVP.Promise.reject(new Error('2'));
var promise3 = RSVP.Promise.reject(new Error('3'));
var promises = [ promise1, promise2, promise3 ];
RSVP.allSettled(promises).then(function(array){
// array == [
// { state: 'fulfilled', value: 1 },
// { state: 'rejected', reason: Error },
// { state: 'rejected', reason: Error }
// ]
// Note that for the second item, reason.message will be "2", and for the
// third item, reason.message will be "3".
}, function(error) {
// Not run. (This block would only be called if allSettled had failed,
// for instance if passed an incorrect argument type.)
});
```
@method allSettled
@static
@for RSVP
@param {Array} promises
@param {String} label - optional string that describes the promise.
Useful for tooling.
@return {Promise} promise that is fulfilled with an array of the settled
states of the constituent promises.
*/
export default function allSettled(entries, label) {
return new AllSettled(Promise, entries, label).promise;
}
|
/* @flow */
import {join, relative, resolve} from 'path';
import {format} from 'util';
import {exec, exists, mkdirp, readFile, unlink, writeFile} from '../async';
import {getTestsDir, defaultFlowConfigName} from '../constants';
import type {Args} from './new-testCommand';
async function newTest(bin: string, suiteName: string): Promise<void> {
function log(...args: any) {
console.log("[%s]\t\t%s", suiteName, format(...args));
}
const dest = join(getTestsDir(), suiteName);
const alreadyExists = await exists(dest);
if (alreadyExists) {
log("There is already a test with that name. Skipping...");
return;
}
await mkdirp(dest);
const testFile = join(dest, 'test.js');
const testerLoc = relative(dest, resolve(__dirname, "../test/Tester"));
await writeFile(
join(dest, 'test.js'),
`/* @flow */
import {suite, test} from '${testerLoc}';
export default suite(({addFile, addFiles, addCode}) => [
test('TestName', [
]),
]);
`
);
await exec(format('%s init --options "all=true" %s', bin, dest));
// Rename .flowconfig to _flowconfig
const config = await readFile(join(dest, ".flowconfig"));
await Promise.all([
writeFile(join(dest, defaultFlowConfigName), config.toString()),
unlink(join(dest, ".flowconfig")),
]);
log(
"Created test! To start editing open %s",
relative(process.cwd(), resolve(__dirname, testFile)),
);
}
export default async function(args: Args): Promise<void> {
await Promise.all(
Array.from(args.names).map(newTest.bind(null, args.bin))
);
}
|
require("@fatso83/mini-mocha").install();
const sinon = require("sinon");
const referee = require("@sinonjs/referee");
const assert = referee.assert;
const fs = require("fs");
describe("FakeTest", function () {
it("should create a fake that 'yields asynchronously'", function () {
const fake = sinon.fake.yieldsAsync(null, "file content");
const anotherFake = sinon.fake();
sinon.replace(fs, "readFile", fake);
fs.readFile("somefile", (err, data) => {
// called with fake values given to yields as arguments
assert.isNull(err);
assert.equals(data, "file content");
// since yields is asynchronous, anotherFake is called first
assert.isTrue(anotherFake.called);
});
anotherFake();
});
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.10.1_A1_T4;
* @section: 15.10.1;
* @assertion: RegExp syntax errors must be caught when matcher(s) compiles;
* @description: Tested RegExp is "a+++";
*/
//CHECK#1
try {
$ERROR('#1.1: new RegExp("a+++") throw SyntaxError. Actual: ' + (new RegExp("a+++")));
} catch (e) {
if ((e instanceof SyntaxError) !== true) {
$ERROR('#1.2: new RegExp("a+++") throw SyntaxError. Actual: ' + (e));
}
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:7bb2ff95b5b5b8b9381c3164c00724bbcf60a5e3a249bffc29cd3c7030ebda2a
size 5862
|
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Arrows.js
*
* Copyright (c) 2009-2016 The MathJax Consortium
*
* 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.
*
*/
MathJax.Hub.Insert(
MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['MathJax_AMS'],
{
0x2190: [437,-64,500,64,422], // LEFTWARDS ARROW
0x2192: [437,-64,500,58,417], // RIGHTWARDS ARROW
0x219A: [437,-60,1000,56,942], // LEFTWARDS ARROW WITH STROKE
0x219B: [437,-60,1000,54,942], // RIGHTWARDS ARROW WITH STROKE
0x219E: [417,-83,1000,56,944], // LEFTWARDS TWO HEADED ARROW
0x21A0: [417,-83,1000,55,943], // RIGHTWARDS TWO HEADED ARROW
0x21A2: [417,-83,1111,56,1031], // LEFTWARDS ARROW WITH TAIL
0x21A3: [417,-83,1111,79,1054], // RIGHTWARDS ARROW WITH TAIL
0x21AB: [575,41,1000,56,964], // LEFTWARDS ARROW WITH LOOP
0x21AC: [575,41,1000,35,943], // RIGHTWARDS ARROW WITH LOOP
0x21AD: [417,-83,1389,57,1331], // LEFT RIGHT WAVE ARROW
0x21AE: [437,-60,1000,56,942], // LEFT RIGHT ARROW WITH STROKE
0x21B0: [722,0,500,56,444], // UPWARDS ARROW WITH TIP LEFTWARDS
0x21B1: [722,0,500,55,443], // UPWARDS ARROW WITH TIP RIGHTWARDS
0x21B6: [461,1,1000,17,950], // ANTICLOCKWISE TOP SEMICIRCLE ARROW
0x21B7: [460,1,1000,46,982], // CLOCKWISE TOP SEMICIRCLE ARROW
0x21BA: [650,83,778,56,722], // ANTICLOCKWISE OPEN CIRCLE ARROW
0x21BB: [650,83,778,56,721], // CLOCKWISE OPEN CIRCLE ARROW
0x21BE: [694,194,417,188,375], // UPWARDS HARPOON WITH BARB RIGHTWARDS
0x21BF: [694,194,417,41,228], // UPWARDS HARPOON WITH BARB LEFTWARDS
0x21C2: [694,194,417,188,375], // DOWNWARDS HARPOON WITH BARB RIGHTWARDS
0x21C3: [694,194,417,41,228], // DOWNWARDS HARPOON WITH BARB LEFTWARDS
0x21C4: [667,0,1000,55,944], // RIGHTWARDS ARROW OVER LEFTWARDS ARROW
0x21C6: [667,0,1000,55,944], // LEFTWARDS ARROW OVER RIGHTWARDS ARROW
0x21C7: [583,83,1000,55,944], // LEFTWARDS PAIRED ARROWS
0x21C8: [694,193,833,83,749], // UPWARDS PAIRED ARROWS
0x21C9: [583,83,1000,55,944], // RIGHTWARDS PAIRED ARROWS
0x21CA: [694,194,833,83,749], // DOWNWARDS PAIRED ARROWS
0x21CB: [514,14,1000,55,944], // LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
0x21CC: [514,14,1000,55,944], // RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
0x21CD: [534,35,1000,54,942], // LEFTWARDS DOUBLE ARROW WITH STROKE
0x21CE: [534,37,1000,32,965], // LEFT RIGHT DOUBLE ARROW WITH STROKE
0x21CF: [534,35,1000,55,943], // RIGHTWARDS DOUBLE ARROW WITH STROKE
0x21DA: [611,111,1000,76,944], // LEFTWARDS TRIPLE ARROW
0x21DB: [611,111,1000,55,923], // RIGHTWARDS TRIPLE ARROW
0x21DD: [417,-83,1000,56,943], // RIGHTWARDS SQUIGGLE ARROW
0x21E0: [437,-64,1334,64,1251], // LEFTWARDS DASHED ARROW
0x21E2: [437,-64,1334,84,1251] // RIGHTWARDS DASHED ARROW
}
);
MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir + "/AMS/Regular/Arrows.js");
|
var assert = require('assert');
var Globals = require('../../lib/globals/expect.js');
var common = require('../../common.js');
var CommandQueue = common.require('core/queue.js');
module.exports = {
'test Queue' : {
beforeEach: function (done) {
CommandQueue.reset();
Globals.beforeEach.call(this, done);
},
afterEach: function() {
Globals.afterEach.call(this);
},
'Test commands queue' : function(done) {
var client = this.client, urlCommand, endCommand;
this.client.once('nightwatch:finished', function() {
assert.equal(urlCommand.done, true);
assert.equal(endCommand.children.length, 0);
assert.equal(endCommand.done, true);
assert.equal(CommandQueue.list().length, 0);
done();
});
client.api.url('http://localhost').end();
assert.equal(CommandQueue.list().length, 2);
urlCommand = CommandQueue.instance().rootNode.children[0];
endCommand = CommandQueue.instance().rootNode.children[1];
assert.equal(endCommand.done, false);
assert.equal(urlCommand.done, false);
assert.equal(endCommand.started, false);
this.client.start();
assert.equal(urlCommand.started, true);
}
}
};
|
$(function() {
$widget = $('#calendar-widget')
if ($widget.length) {
$.get('/events/calendar.json', function(data){
$widget.fullCalendar({
editable: false,
header: {
left: 'title',
firstDay: 1,
center: '',
aspectRatio: 1,
right: 'today prev,next'
},
events: data
});
});
}
});
|
import map from './map';
export default map;
|
/**
* @author Richard Davey <rich@photonstorm.com>
* @author Mat Groves (@Doormat23)
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* New version of PIXI.ComplexPrimitiveShader
*
* @class Phaser.Renderer.Canvas
* @constructor
* @param {Phaser.Game} game - Game reference to the currently running game.
*/
Phaser.Renderer.WebGL.Shaders.ComplexPrimitiveGraphics = function (renderer)
{
this.renderer = renderer;
// WebGLContext
this.gl = renderer.gl;
/**
* @property _UID
* @type Number
* @private
*/
this._UID = renderer.getShaderID(this);
/**
* The WebGL program.
* @property program
* @type Any
*/
this.program = null;
/**
* The vertex shader.
* @property vertexSrc
* @type Array
*/
this.fragmentSrc = [];
this.vertexSrc = [];
this.attributes = [];
// @type {WebGLUniformLocation }
this.projectionVector;
// @type {WebGLUniformLocation }
this.offsetVector;
// @type {WebGLUniformLocation }
this.tintColor;
// @type {WebGLUniformLocation }
this.color;
// @type {WebGLUniformLocation }
this.flipY;
// @type {GLint}
this.aVertexPosition;
// @type {GLint}
this.colorAttribute;
// @type {WebGLUniformLocation }
this.translationMatrix;
// @type {WebGLUniformLocation }
this.alpha;
this.init();
};
Phaser.Renderer.WebGL.Shaders.ComplexPrimitiveGraphics.prototype.constructor = Phaser.Renderer.WebGL.Shaders.ComplexPrimitiveGraphics;
Phaser.Renderer.WebGL.Shaders.ComplexPrimitiveGraphics.prototype = {
init: function ()
{
this.fragmentSrc = [
'precision mediump float;',
'varying vec4 vColor;',
'void main(void) {',
' gl_FragColor = vColor;',
'}'
];
this.vertexSrc = [
'attribute vec2 aVertexPosition;',
'uniform mat3 translationMatrix;',
'uniform vec2 projectionVector;',
'uniform vec2 offsetVector;',
'uniform vec3 tint;',
'uniform float alpha;',
'uniform vec3 color;',
'uniform float flipY;',
'varying vec4 vColor;',
'void main(void) {',
' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
' v -= offsetVector.xyx;',
' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);',
' vColor = vec4(color * alpha * tint, alpha);',
'}'
];
var program = this.renderer.compileProgram(this.vertexSrc, this.fragmentSrc);
var gl = this.gl;
gl.useProgram(program);
// get and store the uniforms for the shader
this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
this.tintColor = gl.getUniformLocation(program, 'tint');
this.flipY = gl.getUniformLocation(program, 'flipY');
this.color = gl.getUniformLocation(program, 'color');
// get and store the attributes
this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
this.colorAttribute = gl.getAttribLocation(program, 'aColor');
// this.attributes = [ this.aVertexPosition, this.colorAttribute ];
this.attributes = [ this.aVertexPosition ];
this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
this.alpha = gl.getUniformLocation(program, 'alpha');
this.program = program;
},
destroy: function ()
{
this.gl.deleteProgram(this.program);
this.gl = null;
this.renderer = null;
this.attributes = null;
}
};
|
/**
* Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence.
* @param {Function} [predicate] A function to test each element for a condition.
* @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence.
*/
observableProto.some = function (predicate, thisArg) {
var source = this;
return predicate ?
source.filter(predicate, thisArg).some() :
new AnonymousObservable(function (observer) {
return source.subscribe(function () {
observer.onNext(true);
observer.onCompleted();
}, observer.onError.bind(observer), function () {
observer.onNext(false);
observer.onCompleted();
});
}, source);
};
/** @deprecated use #some instead */
observableProto.any = function () {
//deprecate('any', 'some');
return this.some.apply(this, arguments);
};
|
/**
* The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position.
*
* @typedef {object} Phaser.Types.GameObjects.BitmapText.GlobalBitmapTextSize
* @since 3.0.0
*
* @property {number} x - The x position of the BitmapText, taking into account the x position and scale of the Game Object.
* @property {number} y - The y position of the BitmapText, taking into account the y position and scale of the Game Object.
* @property {number} width - The width of the BitmapText, taking into account the x scale of the Game Object.
* @property {number} height - The height of the BitmapText, taking into account the y scale of the Game Object.
*/
|
version https://git-lfs.github.com/spec/v1
oid sha256:0e7889c818b4129a08bc3843ba39b2e1118e6cfd3f186b1abf15037cd5599dd6
size 547
|
YUI.add('moodle-report_overviewstats-charts', function (Y, NAME) {
M.report_overviewstats = M.report_overviewstats || {};
M.report_overviewstats.charts = M.report_overviewstats.charts || {};
M.report_overviewstats.charts.countries = {
/**
* @method init
* @param data
*/
init: function(data) {
var chart = new Y.Chart({
type: "bar",
categoryKey: "country",
verticalGridlines: true,
dataProvider: data
});
Y.one("#chart_countries").setStyle("backgroundImage", "none");
chart.render("#chart_countries");
}
};
M.report_overviewstats = M.report_overviewstats || {};
M.report_overviewstats.charts = M.report_overviewstats.charts || {};
M.report_overviewstats.charts.courses = {
/**
* @method init
* @param data
*/
init: function(data) {
var sizes = new Y.Chart({
type: "column",
categoryKey: "course_size",
horizontalGridlines: true,
verticalGridlines: true,
dataProvider: data.sizes
});
Y.one("#chart_courses_sizes").setStyle("backgroundImage", "none");
sizes.render("#chart_courses_sizes");
}
};
M.report_overviewstats = M.report_overviewstats || {};
M.report_overviewstats.charts = M.report_overviewstats.charts || {};
M.report_overviewstats.charts.enrolments = {
/**
* @method init
* @param data
*/
init: function(data) {
var lastmonth = new Y.Chart({
type: "combo",
dataProvider: data.lastmonth,
categoryKey: "date",
horizontalGridlines: true,
verticalGridlines: true,
styles: {
axes: {
date: {
label: {
rotation: -90
}
}
}
}
});
Y.one("#chart_enrolments_lastmonth").setStyle("backgroundImage", "none");
lastmonth.render("#chart_enrolments_lastmonth");
var lastyear = new Y.Chart({
type: "combo",
dataProvider: data.lastyear,
categoryKey: "date",
horizontalGridlines: true,
verticalGridlines: true,
styles: {
axes: {
date: {
label: {
rotation: -90
}
}
}
}
});
Y.one("#chart_enrolments_lastyear").setStyle("backgroundImage", "none");
lastyear.render("#chart_enrolments_lastyear");
}
};
M.report_overviewstats = M.report_overviewstats || {};
M.report_overviewstats.charts = M.report_overviewstats.charts || {};
M.report_overviewstats.charts.langs = {
/**
* @method init
* @param data
*/
init: function(data) {
var chart = new Y.Chart({
type: "bar",
categoryKey: "language",
verticalGridlines: true,
dataProvider: data
});
Y.one("#chart_langs").setStyle("backgroundImage", "none");
chart.render("#chart_langs");
}
};
M.report_overviewstats = M.report_overviewstats || {};
M.report_overviewstats.charts = M.report_overviewstats.charts || {};
M.report_overviewstats.charts.logins = {
/**
* @method init
* @param data
*/
init: function(data) {
var perday = new Y.Chart({
type: "combo",
dataProvider: data.perday,
categoryKey: "date",
horizontalGridlines: true,
verticalGridlines: true,
styles: {
axes: {
date: {
label: {
rotation: -90
}
}
}
}
});
Y.one("#chart_logins_perday").setStyle("backgroundImage", "none");
perday.render("#chart_logins_perday");
}
};
}, '@VERSION@', {"requires": ["base", "node", "charts", "charts-legend"]});
|
odoo.define('board.AddToGoogleSpreadsheetMenu', function (require) {
"use strict";
var ActionManager = require('web.ActionManager');
var core = require('web.core');
var data = require('web.data');
var Domain = require('web.Domain');
var favorites_submenus_registry = require('web.favorites_submenus_registry');
var pyUtils = require('web.py_utils');
var Widget = require('web.Widget');
var QWeb = core.qweb;
var AddToGoogleSpreadsheetMenu = Widget.extend({
events: _.extend({}, Widget.prototype.events, {
'click .add_to_spreadsheet': '_onAddToSpreadsheetClick',
}),
/**
* @override
* @param {Object} params
* @param {Object} params.action an ir.actions description
*/
init: function (parent, params) {
this._super(parent);
this.action = params.action;
},
/**
* @override
*/
start: function () {
if (this.action.type === 'ir.actions.act_window') {
this._render();
}
return this._super.apply(this, arguments);
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
* @private
*/
_addToSpreadsheet: function () {
// AAB: trigger_up an event that will be intercepted by the controller,
// as soon as the controller is the parent of the control panel
var actionManager = this.findAncestor(function (ancestor) {
return ancestor instanceof ActionManager;
});
var controller = actionManager.getCurrentController();
var searchQuery;
// TO DO: for now the domains in query are evaluated.
// This should be changed I think.
this.trigger_up('get_search_query', {
callback: function (query) {
searchQuery = query;
}
});
var modelName = this.action.res_model;
var list_view = _.findWhere(controller.widget.actionViews, {type: 'list'});
var list_view_id = list_view ? list_view.viewID : false;
var domain = searchQuery.domain;
var groupBys = pyUtils.eval('groupbys', searchQuery.groupBys).join(" ");
var ds = new data.DataSet(this, 'google.drive.config');
ds.call('set_spreadsheet', [modelName, Domain.prototype.arrayToString(domain), groupBys, list_view_id])
.then(function (res) {
if (res.url){
window.open(res.url, '_blank');
}
});
},
/**
* Renders the `SearchView.addtogooglespreadsheet` template.
*
* @private
*/
_render: function () {
var $el = QWeb.render('SearchView.addtogooglespreadsheet', {widget: this});
this._replaceElement($el);
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* @private
* @param {jQueryEvent} event
*/
_onAddToSpreadsheetClick: function (event) {
event.preventDefault();
event.stopPropagation();
this._addToSpreadsheet();
},
});
favorites_submenus_registry.add('add_to_google_spreadsheet_menu', AddToGoogleSpreadsheetMenu, 20);
return AddToGoogleSpreadsheetMenu;
});
|
/**
* @module
* @description
* Common directives shipped with Angular.
*/
import { CONST_EXPR } from './facade/lang';
import { NgClass } from './directives/ng_class';
import { NgFor } from './directives/ng_for';
import { NgIf } from './directives/ng_if';
import { NgStyle } from './directives/ng_style';
import { NgSwitch, NgSwitchWhen, NgSwitchDefault } from './directives/ng_switch';
export { NgClass } from './directives/ng_class';
export { NgFor } from './directives/ng_for';
export { NgIf } from './directives/ng_if';
export { NgStyle } from './directives/ng_style';
export { NgSwitch, NgSwitchWhen, NgSwitchDefault } from './directives/ng_switch';
export * from './directives/observable_list_diff';
/**
* A collection of Angular core directives that are likely to be used in each and every Angular
* application.
*
* This collection can be used to quickly enumerate all the built-in directives in the `directives`
* property of the `@View` annotation.
*
* ### Example ([live demo](http://plnkr.co/edit/yakGwpCdUkg0qfzX5m8g?p=preview))
*
* Instead of writing:
*
* ```typescript
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could import all the core directives at once:
*
* ```typescript
* import {CORE_DIRECTIVES} from 'angular2/angular2';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
*/
export const CORE_DIRECTIVES = CONST_EXPR([NgClass, NgFor, NgIf, NgStyle, NgSwitch, NgSwitchWhen, NgSwitchDefault]);
//# sourceMappingURL=directives.js.map
|
/**
* Copyright (c) 2014, Oracle and/or its affiliates.
* All rights reserved.
*/
"use strict";var l={"SA":["SA","\u5357\u7F8E\u6D32"]};(this?this:window)['DvtBaseMapManager']['_UNPROCESSED_MAPS'][2].push(["southAmerica","continent",l]);
|
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
import { ElementMixin, version } from './lib/mixins/element-mixin.js';
export { html } from './lib/utils/html-tag.js';
export { version };
/**
* Base class that provides the core API for Polymer's meta-programming
* features including template stamping, data-binding, attribute deserialization,
* and property change observation.
*
* @customElement
* @polymer
* @constructor
* @implements {Polymer_ElementMixin}
* @extends HTMLElement
* @appliesMixin ElementMixin
* @summary Custom element base class that provides the core API for Polymer's
* key meta-programming features including template stamping, data-binding,
* attribute deserialization, and property change observation
*/
export const PolymerElement = ElementMixin(HTMLElement);
|
import Ember from 'ember';
export function addAction(action, selector) {
return function() {
if ( Ember.Component.detectInstance(this) )
{
this._super();
}
else
{
this.get('controller').send(action);
}
Ember.run.next(this, function() {
var matches = this.$(selector);
if ( matches )
{
var last = matches.last();
if ( last )
{
last.focus();
}
}
});
};
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* If x is +0, Math.atan(x) is +0
*
* @path ch15/15.8/15.8.2/15.8.2.4/S15.8.2.4_A2.js
* @description Checking if Math.atan(+0) equals to +0
*/
// CHECK#1
var x = +0;
if (Math.atan(x) !== +0)
{
$ERROR("#1: 'var x = +0; Math.atan(x) !== +0'");
}
|
class Foo {
constructor() {
this.a = 42;
this.b = 'hello';
this.emit('done');
}
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* Since applying the "call" method to Function constructor themself leads to creating a new function instance, the second argument must be a valid function body
*
* @path ch15/15.3/S15.3_A2_T1.js
* @description Checking if executing "Function.call(this, "var x / = 1;")" fails
*/
//CHECK#
try{
Function.call(this, "var x / = 1;");
} catch(e){
if (!(e instanceof SyntaxError)) {
$ERROR('#1: function body must be valid');
}
}
|
"use strict";
var _utils = require("./utils");
var _placeholders = require("./placeholders");
{
(0, _utils.default)("Noop", {
visitor: []
});
}
(0, _utils.default)("Placeholder", {
visitor: [],
builder: ["expectedNode", "name"],
fields: {
name: {
validate: (0, _utils.assertNodeType)("Identifier")
},
expectedNode: {
validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
}
}
});
(0, _utils.default)("V8IntrinsicIdentifier", {
builder: ["name"],
fields: {
name: {
validate: (0, _utils.assertValueType)("string")
}
}
});
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding-for-await/ary-ptrn-elision.case
// - src/dstr-binding-for-await/default/for-await-of-async-func-let.template
/*---
description: Elision advances iterator (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [generators, destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
ArrayBindingPattern : [ Elision ]
1. Return the result of performing
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
as the argument.
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
Elision : ,
1. If iteratorRecord.[[done]] is false, then
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
c. ReturnIfAbrupt(next).
d. If next is false, set iteratorRecord.[[done]] to true.
2. Return NormalCompletion(empty).
---*/
var first = 0;
var second = 0;
function* g() {
first += 1;
yield;
second += 1;
};
var iterCount = 0;
async function fn() {
for await (let [,] of [g()]) {
assert.sameValue(first, 1);
assert.sameValue(second, 0);
iterCount += 1;
}
}
fn()
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
.then($DONE, $DONE);
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @emails oncall+react_native
*/
'use strict';
jest.setMock('NativeModules', {
BlobModule: require('../__mocks__/BlobModule'),
});
var Blob = require('Blob');
describe('Blob', function() {
it('should create empty blob', () => {
const blob = new Blob();
expect(blob).toBeInstanceOf(Blob);
expect(blob.data.offset).toBe(0);
expect(blob.data.size).toBe(0);
expect(blob.size).toBe(0);
expect(blob.type).toBe('');
});
it('should create blob from other blobs and strings', () => {
const blobA = new Blob();
const blobB = new Blob();
const textA = 'i \u2665 dogs';
const textB = '\uD800\uDC00';
const textC =
'Z\u0351\u036B\u0343\u036A\u0302\u036B\u033D\u034F\u0334\u0319\u0324' +
'\u031E\u0349\u035A\u032F\u031E\u0320\u034DA\u036B\u0357\u0334\u0362' +
'\u0335\u031C\u0330\u0354L\u0368\u0367\u0369\u0358\u0320G\u0311\u0357' +
'\u030E\u0305\u035B\u0341\u0334\u033B\u0348\u034D\u0354\u0339O\u0342' +
'\u030C\u030C\u0358\u0328\u0335\u0339\u033B\u031D\u0333!\u033F\u030B' +
'\u0365\u0365\u0302\u0363\u0310\u0301\u0301\u035E\u035C\u0356\u032C' +
'\u0330\u0319\u0317';
blobA.data.size = 34540;
blobB.data.size = 65452;
const blob = new Blob([blobA, blobB, textA, textB, textC]);
expect(blob.size).toBe(
blobA.size +
blobB.size +
global.Buffer.byteLength(textA, 'UTF-8') +
global.Buffer.byteLength(textB, 'UTF-8') +
global.Buffer.byteLength(textC, 'UTF-8'),
);
expect(blob.type).toBe('');
});
it('should slice a blob', () => {
const blob = new Blob();
blob.data.size = 34546;
const sliceA = blob.slice(0, 2354);
expect(sliceA.data.offset).toBe(0);
expect(sliceA.size).toBe(2354);
expect(sliceA.type).toBe('');
const sliceB = blob.slice(2384, 7621);
expect(sliceB.data.offset).toBe(2384);
expect(sliceB.size).toBe(7621 - 2384);
expect(sliceB.type).toBe('');
});
it('should close a blob', () => {
const blob = new Blob();
blob.close();
expect(() => blob.size).toThrow();
});
});
|
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
YUI.add('CM_NewsBinderIndex', function(Y, NAME) {
/**
* The CM_NewsBinderIndex module.
*
* @module CM_NewsBinderIndex
*/
/**
* Constructor for the Binder class.
*
* @param mojitProxy {Object} The proxy to allow the binder to interact
* with its owning mojit.
*
* @class Binder
* @constructor
*/
Y.namespace('mojito.binders')[NAME] = {
/**
* Binder initialization method, invoked after all binders on the page
* have been constructed.
*/
init: function(mojitProxy) {
var self = this;
self.mojitProxy = mojitProxy;
self.id = mojitProxy.data.get('id');
//Y.log('init()', 'debug', NAME);
mojitProxy.listen('myClickEvent', function(evt) {
//Y.log(evt);
//Y.log(self.id + ' heard a click from ' + evt.data.mojitType);
if (self.node) {
self.node.append('<p id="click' + evt.data.clickCount + '">' + self.id + ' heard a click from ' + evt.data.config.id + ' (type: ' + evt.data.mojitType + ') with the data: <b>' + evt.data.message + '</b></p>');
}
}, this);
mojitProxy.listen('anchorClickEvent', function(evt) {
//Y.log(this.id + ' heard a click from ' + evt.source.id);
if (self.node) {
self.node.addClass('alert');
}
}, this);
},
/**
* The binder method, invoked to allow the mojit to attach DOM event
* handlers.
*
* @param node {Node} The DOM node to which this mojit is attached.
*/
bind: function(node) {
this.node = node;
}
};
}, '0.0.1', {requires: []});
|
import { Observable } from 'rx';
import { ofType } from 'redux-epic';
import {
fetchMessagesComplete,
fetchMessagesError
} from './';
import { types as app } from '../../redux';
import { getJSON$ } from '../../../utils/ajax-stream.js';
export default function getMessagesEpic(actions) {
return actions::ofType(app.appMounted)
.flatMap(() => getJSON$('/api/users/get-messages')
.map(fetchMessagesComplete)
.catch(err => Observable.of(fetchMessagesError(err)))
);
}
|
import { defineProperty, deprecateProperty } from '..';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
moduleFor(
'defineProperty',
class extends AbstractTestCase {
['@test toString'](assert) {
let obj = {};
defineProperty(obj, 'toString', undefined, function () {
return 'FOO';
});
assert.equal(obj.toString(), 'FOO', 'should replace toString');
}
}
);
moduleFor(
'Ember.deprecateProperty',
class extends AbstractTestCase {
['@test enables access to deprecated property and returns the value of the new property'](
assert
) {
assert.expect(3);
let obj = { foo: 'bar' };
deprecateProperty(obj, 'baz', 'foo', { id: 'baz-deprecation', until: 'some.version' });
expectDeprecation();
assert.equal(obj.baz, obj.foo, 'baz and foo are equal');
obj.foo = 'blammo';
assert.equal(obj.baz, obj.foo, 'baz and foo are equal');
}
['@test deprecatedKey is not enumerable'](assert) {
assert.expect(2);
let obj = { foo: 'bar', blammo: 'whammy' };
deprecateProperty(obj, 'baz', 'foo', { id: 'baz-deprecation', until: 'some.version' });
for (let prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
assert.notEqual(prop, 'baz');
}
}
}
['@test enables setter to deprecated property and updates the value of the new property'](
assert
) {
assert.expect(3);
let obj = { foo: 'bar' };
deprecateProperty(obj, 'baz', 'foo', { id: 'baz-deprecation', until: 'some.version' });
expectDeprecation();
obj.baz = 'bloop';
assert.equal(obj.foo, 'bloop', 'updating baz updates foo');
assert.equal(obj.baz, obj.foo, 'baz and foo are equal');
}
}
);
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
const models = require('./index');
/**
* Describes a virtual machine scale set extension profile.
*
*/
class VirtualMachineScaleSetExtensionProfile {
/**
* Create a VirtualMachineScaleSetExtensionProfile.
* @member {array} [extensions] The virtual machine scale set child extension
* resources.
*/
constructor() {
}
/**
* Defines the metadata of VirtualMachineScaleSetExtensionProfile
*
* @returns {object} metadata of VirtualMachineScaleSetExtensionProfile
*
*/
mapper() {
return {
required: false,
serializedName: 'VirtualMachineScaleSetExtensionProfile',
type: {
name: 'Composite',
className: 'VirtualMachineScaleSetExtensionProfile',
modelProperties: {
extensions: {
required: false,
serializedName: 'extensions',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'VirtualMachineScaleSetExtensionElementType',
type: {
name: 'Composite',
className: 'VirtualMachineScaleSetExtension'
}
}
}
}
}
}
};
}
}
module.exports = VirtualMachineScaleSetExtensionProfile;
|
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
(function(global) {
global.ng = global.ng || {};
global.ng.common = global.ng.common || {};
global.ng.common.locales = global.ng.common.locales || {};
const u = undefined;
function plural(n) {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
if (i === 1 && v === 0) return 1;
return 5;
}
global.ng.common.locales['en-ki'] = [
'en-KI',
[['a', 'p'], ['am', 'pm'], u],
[['am', 'pm'], u, u],
[
['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
],
u,
[
['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
[
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'
]
],
u,
[['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']],
1,
[6, 0],
['dd/MM/y', 'd MMM y', 'd MMMM y', 'EEEE, d MMMM y'],
['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],
['{1}, {0}', u, '{1} \'at\' {0}', u],
['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'],
'AUD',
'$',
'Australian Dollar',
{'AUD': ['$'], 'JPY': ['JP¥', '¥'], 'USD': ['US$', '$']},
'ltr',
plural,
[
[
['mi', 'n', 'in the morning', 'in the afternoon', 'in the evening', 'at night'],
['midnight', 'noon', 'in the morning', 'in the afternoon', 'in the evening', 'at night'], u
],
[['midnight', 'noon', 'morning', 'afternoon', 'evening', 'night'], u, u],
[
'00:00', '12:00', ['06:00', '12:00'], ['12:00', '18:00'], ['18:00', '21:00'],
['21:00', '06:00']
]
]
];
})(typeof globalThis !== 'undefined' && globalThis || typeof global !== 'undefined' && global ||
typeof window !== 'undefined' && window);
|
export const a = 1;
export const b = 2;
export default 42;
|
define([
'dojo/_base/declare', 'dojo/_base/lang', 'dojo/on', 'dojo/topic',
'dijit/popup', 'dijit/TooltipDialog',
'./IDMappingGrid', './GridContainer'
], function (
declare, lang, on, Topic,
popup, TooltipDialog,
IDMappingGrid, GridContainer
) {
return declare([GridContainer], {
gridCtor: IDMappingGrid,
containerType: 'feature_data',
facetFields: [],
enableFilterPanel: false,
buildQuery: function () {
// prevent further filtering. DO NOT DELETE
},
_setQueryAttr: function (query) {
// block default query handler for now.
},
onSetState: function (state) {
// block default behavior
},
_setStateAttr: function (state) {
this.inherited(arguments);
if (!state) {
return;
}
if (this.grid) {
this.grid.set('state', state);
} else {
// console.log("No Grid Yet (IDMappingGridContainer)");
}
this._set('state', state);
}
});
});
|
(function(){
module('data-method', {
setup: function() {
$('#qunit-fixture').append($('<a />', {
href: '/echo', 'data-method': 'delete', text: 'destroy!'
}));
},
teardown: function() {
$(document).unbind('iframe:loaded');
}
});
function submit(fn, options) {
$(document).bind('iframe:loaded', function(e, data) {
fn(data);
start();
});
$('#qunit-fixture').find('a')
.trigger('click');
}
asyncTest('link with "data-method" set to "delete"', 3, function() {
submit(function(data) {
equal(data.REQUEST_METHOD, 'DELETE');
strictEqual(data.params.authenticity_token, undefined);
strictEqual(data.HTTP_X_CSRF_TOKEN, undefined);
});
});
asyncTest('link with "data-method" and CSRF', 1, function() {
$('#qunit-fixture')
.append('<meta name="csrf-param" content="authenticity_token"/>')
.append('<meta name="csrf-token" content="cf50faa3fe97702ca1ae"/>');
submit(function(data) {
equal(data.params.authenticity_token, 'cf50faa3fe97702ca1ae');
});
});
asyncTest('link "target" should be carried over to generated form', 1, function() {
$('a[data-method]').attr('target', 'super-special-frame');
submit(function(data) {
equal(data.params._target, 'super-special-frame');
});
});
})();
|
colabsShortcodeMeta={
attributes:[
{
label:"Tabs",
id:"content",
controlType:"tab-control"
},
{
label:"Tabber Style",
id:"style",
help:"Set an optional alternate style for the tabber.",
controlType:"select-control",
selectValues:['default', 'boxed', 'vertical'],
defaultValue: 'default',
defaultText: 'default'
},
{
label:"Tabber Title",
id:"tabberTitle",
help:"Set an optional main heading for the tabber.",
defaultText: ''
},
{
label:"CSS Class",
id:"css",
help:"Set an optional custom CSS class for the tabber.",
defaultText: ''
}
],
disablePreview:true,
customMakeShortcode: function(b){
var a=b.data;
var tabTitles = new Array();
if(!a)return"";
var c=a.content;
var tabberStyle = b.style;
var tabberTitle = b.tabberTitle;
var g = ''; // The shortcode.
for ( var i = 0; i < a.numTabs; i++ ) {
var currentField = 'tle_' + ( i + 1 );
if ( b[currentField] == '' ) {
tabTitles.push( 'Tab ' + ( i + 1 ) );
} else {
var currentTitle = b[currentField];
currentTitle = currentTitle.replace( /"/gi, "'" );
tabTitles.push( currentTitle );
} // End IF Statement
} // End FOR Loop
g += '[tabs style="'+ tabberStyle +'"';
if ( tabberTitle ) { g += ' title="' + tabberTitle + '"'; } // End IF Statement
g += '] ';
for ( var t in tabTitles ) {
g += '[tab title="' + tabTitles[t] + '"]' + tabTitles[t] + ' content goes here.[/tab] ';
} // End FOR Loop
g += '[/tabs]';
return g
}
};
|
tinyMCE.addI18n('ps.modxlink',{
link_desc:"Insert/edit link"
});
|
EasyBlog.module( "featured" , function($) {
var module = this;
// require: start
EasyBlog.require()
.done(function(){
// controller: start
EasyBlog.Controller(
"Featured.Scroller",
{
defaultOptions: {
elements: null,
itemWidth: null,
// Auto rotate option
autorotate: {
enabled : false,
interval : 50
},
// Items
"{placeHolder}" : ".slider-holder",
"{slider}" : ".featured-entries",
"{sliderItems}" : ".slider-holder ul li",
"{sliderNavigation}" : ".featured-navi .featured-a a"
}
},
function(self) {return {
/**
* Featured scroller object initialization happens here.
*
*/
init: function() {
// Set the current holder width to a temporary location.
self.options.itemWidth = self.placeHolder().width() + 1;
// Calculate the total width of the whole parent container as we need to multiply this by the number of child elements.
var totalWidth = self.sliderItems().length * parseInt( self.options.itemWidth );
// Now, we need to stretch the parent's width to match the total items.
self.slider().css( 'width' , totalWidth );
// Make sure the width of each child items has the same width as its parent.
self.sliderItems().css( 'width' , self.options.itemWidth );
if( self.options.autorotate.enabled )
{
setTimeout( function(){
self.initAutoRotate();
}, parseInt( self.options.autorotate.interval ) * 1000 );
}
},
nextItem : function( element )
{
var index = $( element ).data( 'slider' );
var left = 0;
// If the current index is 1, we can just leave left as 0
if( index != 1 )
{
left = self.options.itemWidth * parseInt( index - 1 );
}
// Since any items after the first item is hidden by default, we need to show the current item.
self.slider().children( ':nth-child(' + index + ')' ).show();
// Now let's animate the placeholder.
self.slider().animate( {
left : '-' + left + 'px'
}, 'slow' );
// Remove active class from the navigation anchor link.
self.sliderNavigation( '.active' ).removeClass( 'active' );
// Set the active element on the current item.
$( element ).addClass( 'active' );
},
"{sliderNavigation} click" : function( element ){
self.nextItem( element );
},
/**
* This initializes the auto rotation for the featured items.
*/
initAutoRotate: function(){
var set = false;
self.sliderNavigation().each(function(){
if( $( this ).hasClass( 'active' ) && set != true )
{
if( $( this ).next().length == 0 )
{
self.nextItem( self.sliderNavigation( ':first' ) );
}
else
{
self.nextItem( $(this).next() );
}
set = true;
}
});
setTimeout( function(){
self.initAutoRotate();
}, parseInt( self.options.autorotate.interval ) * 1000 );
}
} }
);
module.resolve();
// controller: end
});
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.