text
stringlengths
2
6.14k
intelli.database = []; $(function() { if ($('#query_out').text()) { setTimeout( (function(){ $('#query_out').height(window.screen.height - $('#query_out').offset().top - 300) }), 1000); } $('a', '.js-selecting').on('click', function(e) { e.preventDefault(); var $ctl = $('#tbl option'); switch ($(this).data('action')) { case 'select': $ctl.prop('selected', true); break; case 'drop': $ctl.prop('selected', false); break; case 'invert': $ctl.each(function(i, obj) { $(obj).prop('selected', !$(obj).prop('selected')); }); } }); $('#save_file').on('change', function() { var obj = $('#js-save-options'); (1 == $(this).val()) ? obj.show() : obj.hide(); }); $('#form-dump').on('submit', function(e) { if (!$('#sql_structure').prop('checked') && !$('#sql_data').prop('checked')) { e.preventDefault(); intelli.admin.alert({title: _t('error'), type: 'error', msg: _t('export_not_checked')}); } }); $('#js-cmd-import').on('click', function() { if ($('#sql_file').val().length > 0) { $('#run_update').val('1'); $('#update').submit(); return true; } else { intelli.admin.alert( { title: _t('error'), type: 'error', msg: _t('choose_import_file') }); } return false; }); $('#addTableButton').on('click', function(e) { e.preventDefault(); addData('table'); }); $('#table').dblclick(function() { addData('table'); }).click(function() { var table = $(this).val(); if (table) { if (!intelli.database[table]) { $.ajax( { url: intelli.config.admin_url + '/database.json', data: {table: table}, success: function(data){ var fields = $('#field')[0]; intelli.database[table] = data; fields.options.length = 0; for (var i = 0; i < data.length; i++) { fields.options[fields.options.length] = new Option(data[i], data[i]); } fields.options[0].selected = true; // Show dropdown and the button $('#field').parent().fadeIn(); } }); } else { var items = intelli.database[table]; var fields = $('#field')[0]; fields.options.length = 0; for (var i = 0; i < items.length; i++) { fields.options[fields.options.length] = new Option(items[i], items[i]); } fields.options[0].selected = true; // Show dropdown and the button $('#field').parent().fadeIn(); } } }); $('#addFieldButton').click(function(e) { e.preventDefault(); addData('field'); }); $('#field').dblclick(function() { addData('field'); }); $('a', '#query_history').on('click', function(e) { e.preventDefault(); $('#query').val($(this).closest('li').find('span').text()).focus(); $(window).scrollTop(0); }); $('#clearButton').on('click', function() { Ext.Msg.confirm(_t('confirm'), _t('clear_confirm'), function(btn, text) { if (btn == 'yes') { $('#query').prop('value', 'SELECT * FROM '); $('#field').parent().fadeOut(); } }); return true; }); function addData(item) { var value = $('#' + item).val(); if (value) { addText('`' + value + '`'); } else { intelli.admin.alert( { title: _t('error'), type: 'error', msg: 'Please choose any ' + item + '.' }); } } // add text to query function addText(text) { text = ' ' + text + ' '; var query = $('#query'); if (document.selection) { query.focus(); sel = document.selection.createRange(); sel.text = text; } else if (query.selectionStart || query.selectionStart == '0') { var startPos = query.selectionStart; var endPos = query.selectionEnd; var flag = false; if(query.value.length == startPos) flag = true; query.value = query.value.substring(0, startPos) + text + query.value.substring(endPos, query.value.length); if(flag) query.selectionStart = query.value.length; } else { query.val(query.val() + text); } focusCampo('query'); } // sql template click $('a', '#sqlButtons').on('click', function(e) { e.preventDefault(); addText($(this).text()); }); // reset tables $('#js-reset-all, #js-reset').on('click', function(e) { if ($(this).attr('id') == 'js-reset-all') { $('input[name="options[]"]').each(function() { $(this).prop('checked', true); }); } else { if (!$('input:checkbox[name="options[]"]:checked').length) { intelli.notifBox({msg: _t('reset_choose_table'), type: 'error'}); return false; } } var $self = $(this); Ext.Msg.confirm(_t('confirm'), _t('clear_reset'), function(btn, text) { if ('yes' == btn) { $self.closest('form').submit(); } }); }); if ($('#query').length > 0) { focusCampo('query'); } }); function focusCampo(id) { var inputField = document.getElementById(id); if (inputField != null && inputField.value.length != 0){ if (inputField.createTextRange){ var FieldRange = inputField.createTextRange(); FieldRange.moveStart('character',inputField.value.length); FieldRange.collapse(); FieldRange.select(); }else if (inputField.selectionStart || inputField.selectionStart == '0') { var elemLen = inputField.value.length; inputField.selectionStart = elemLen; inputField.selectionEnd = elemLen; inputField.focus(); } }else{ inputField.focus(); } }
$(document).ready(function() { /* Add a [>>>] button on the top-right corner of getthecode div to show the code */ var div = $('.getthecode-header') var button_text = 'Show/Hide the code'; var button_styles = { 'cursor':'pointer', 'float': 'right', 'text-size': '75%', 'font-family': 'monospace' } div.each(function(index) { var jthis = $(this); var button = $('<span class="show-code-button">&gt;&gt;&gt;</span><div style="clear:both;"></div>'); button.css(button_styles) button.attr('title', button_text); jthis.append(button); jthis.parent().find('.highlight-python').toggle(); }); // define the behavior of the button when it's clicked $('.show-code-button').click(function() { var button = $(this); button.parent().parent().find('.highlight-python').toggle(); }); });
function init() { em.setProperty("state", "0"); em.setProperty("leader", "true"); } function setup(eim, leaderid) { em.setProperty("state", "1"); em.setProperty("leader", "true"); var eim = em.newInstance("2095_tokyo" + leaderid); var map = eim.createInstanceMap(802000311); map.killAllMonsters(false); eim.startEventTimer(1200000); // 20 min return eim; } function playerEntry(eim, player) { var map = eim.getMapInstance(0); player.changeMap(map, map.getPortal(0)); } function playerRevive(eim, player) { return false; } function scheduledTimeout(eim) { if (eim.disposeIfPlayerBelow(100, 802000312)) { em.setProperty("state", "0"); em.setProperty("leader", "true"); } } function changedMap(eim, player, mapid) { if (mapid != 802000311 && mapid != 802000313 && mapid == 802000312) { eim.unregisterPlayer(player); if (eim.disposeIfPlayerBelow(0, 0)) { em.setProperty("state", "0"); em.setProperty("leader", "true"); } } } function playerDisconnected(eim, player) { return 0; } function monsterValue(eim, mobId) { return 1; } function playerExit(eim, player) { eim.unregisterPlayer(player); if (eim.disposeIfPlayerBelow(0, 0)) { em.setProperty("state", "0"); em.setProperty("leader", "true"); } } function end(eim) { eim.disposeIfPlayerBelow(100, 0); em.setProperty("state", "0"); em.setProperty("leader", "true"); } function clearPQ(eim) { end(eim); } function allMonstersDead(eim) {} function leftParty (eim, player) {} function disbandParty (eim) {} function playerDead(eim, player) {} function cancelSchedule() {}
module.exports = { getOne: require('./get-one'), getAllByUser: require('./get-all-by-user'), create: require('./create'), update: require('./update'), delete: require('./delete'), testProjects: require('./test-projects') };
define([ 'dojo/_base/declare', 'dojo/dom-construct', 'JBrowse/View/Track/BlockBased', 'JBrowse/Util'], function( declare, dom, BlockBased, Util ) { return declare(BlockBased, /** * @lends JBrowse.View.Track.LocationScale.prototype */ { /** * This track is for (e.g.) position and sequence information that should * always stay visible at the top of the view. * @constructs */ constructor: function( args ) {//name, labelClass, posHeight) { this.loaded = true; this.labelClass = args.labelClass; this.posHeight = args.posHeight; this.height = Math.round( args.posHeight * 1.2 ); }, // this track has no track label or track menu, stub them out makeTrackLabel: function() {}, makeTrackMenu: function() {}, fillBlock: function( args ) { var blockIndex = args.blockIndex; var block = args.block; var leftBase = args.leftBase; var scale = args.scale; var thisB = this; // find the number that is within 2 px of the left boundary of // the block that ends with the most zeroes, or a 5 if no // zeroes var labelNumber = this.chooseLabel( args ); var labelOffset = (leftBase+1-labelNumber)*scale/10; // console.log( leftBase+1, labelNumber, labelOffset ); var posLabel = document.createElement("div"); var numtext = Util.addCommas( labelNumber ); posLabel.className = this.labelClass; // give the position label a negative left offset in ex's to // more-or-less center it over the left boundary of the block posLabel.style.left = "-" + Number(numtext.length)/1.7 + labelOffset + "ex"; posLabel.appendChild( document.createTextNode( numtext ) ); block.domNode.appendChild(posLabel); var highlight = this.browser.getHighlight(); if( highlight && highlight.ref == this.refSeq.name ) { this.renderRegionHighlight( args, highlight ); } var bookmarks = this.browser.getBookmarks(); if( bookmarks ) { this.renderRegionBookmark( args, bookmarks, this.refSeq.name, true ); } this.heightUpdate( Math.round( this.posHeight*1.2 ), blockIndex); args.finishCallback(); }, chooseLabel: function( viewArgs ) { var left = viewArgs.leftBase + 1; var width = viewArgs.rightBase - left + 1; var scale = viewArgs.scale; for( var mod = 1000000; mod > 0; mod /= 10 ) { if( left % mod * scale <= 3 ) return left - left%mod; } return left; } }); });
/** * @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Spell checker. */ // Register a plugin named "wsc". CKEDITOR.plugins.add( 'wsc', { requires: 'dialog', lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', // %REMOVE_LINE_CORE% icons: 'spellchecker', // %REMOVE_LINE_CORE% init: function( editor ) { var commandName = 'checkspell'; var command = editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName ) ); // SpellChecker doesn't work in Opera and with custom domain command.modes = { wysiwyg: ( !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname ) }; if(typeof editor.plugins.scayt == 'undefined'){ editor.ui.addButton && editor.ui.addButton( 'SpellChecker', { label: editor.lang.wsc.toolbar, command: commandName, toolbar: 'spellchecker,10' }); } CKEDITOR.dialog.add( commandName, this.path + 'dialogs/wsc.js' ); } }); CKEDITOR.config.wsc_customerId = CKEDITOR.config.wsc_customerId || '1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk'; CKEDITOR.config.wsc_customLoaderScript = CKEDITOR.config.wsc_customLoaderScript || null;
import { isLeapYear } from "../../Source/Cesium.js"; describe("Core/isLeapYear", function () { it("Check for valid leap years", function () { expect(isLeapYear(2000)).toEqual(true); expect(isLeapYear(2004)).toEqual(true); expect(isLeapYear(2003)).toEqual(false); expect(isLeapYear(2300)).toEqual(false); expect(isLeapYear(2400)).toEqual(true); expect(isLeapYear(-1)).toEqual(false); expect(isLeapYear(-2000)).toEqual(true); }); it("Fail with null value", function () { expect(function () { isLeapYear(null); }).toThrowDeveloperError(); }); it("Fail with undefined value", function () { expect(function () { isLeapYear(undefined); }).toThrowDeveloperError(); }); it("Fail with non-numerical value", function () { expect(function () { isLeapYear("asd"); }).toThrowDeveloperError(); }); });
/** * @license * Copyright Google Inc. 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 export default [ 'en-ZM', [ ['a', 'p'], ['AM', 'PM'], ], [ ['AM', 'PM'], , ], [ ['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'] ], , [ ['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' ] ], , [['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}', , '{1} \'at\' {0}', ], ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], 'K', 'Zambian Kwacha', function (n) { var i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length; if (i === 1 && v === 0) return 1; return 5; } ]; //# sourceMappingURL=en-ZM.js.map
'use strict'; var assert = require('assert'); var fixtures = require('../fixtures'); var sharp = require('../../index'); var defaultConcurrency = sharp.concurrency(); describe('Utilities', function() { describe('Cache', function() { it('Can be disabled', function() { var cache = sharp.cache(0, 0); assert.strictEqual(0, cache.memory); assert.strictEqual(0, cache.items); }); it('Can be set to a maximum of 50MB and 500 items', function() { var cache = sharp.cache(50, 500); assert.strictEqual(50, cache.memory); assert.strictEqual(500, cache.items); }); it('Ignores invalid values', function() { sharp.cache(50, 500); var cache = sharp.cache('spoons'); assert.strictEqual(50, cache.memory); assert.strictEqual(500, cache.items); }); }); describe('Concurrency', function() { it('Can be set to use 16 threads', function() { sharp.concurrency(16); assert.strictEqual(16, sharp.concurrency()); }); it('Can be reset to default', function() { sharp.concurrency(0); assert.strictEqual(defaultConcurrency, sharp.concurrency()); }); it('Ignores invalid values', function() { sharp.concurrency(0); sharp.concurrency('spoons'); assert.strictEqual(defaultConcurrency, sharp.concurrency()); }); }); describe('Counters', function() { it('Have zero value at rest', function() { var counters = sharp.counters(); assert.strictEqual(0, counters.queue); assert.strictEqual(0, counters.process); }); }); describe('Format', function() { it('Contains expected attributes', function() { assert.strictEqual('object', typeof sharp.format); Object.keys(sharp.format).forEach(function(format) { assert.strictEqual(true, 'id' in sharp.format[format]); assert.strictEqual(format, sharp.format[format].id); ['input', 'output'].forEach(function(direction) { assert.strictEqual(true, direction in sharp.format[format]); assert.strictEqual('object', typeof sharp.format[format][direction]); assert.strictEqual(3, Object.keys(sharp.format[format][direction]).length); assert.strictEqual(true, 'file' in sharp.format[format][direction]); assert.strictEqual(true, 'buffer' in sharp.format[format][direction]); assert.strictEqual(true, 'stream' in sharp.format[format][direction]); assert.strictEqual('boolean', typeof sharp.format[format][direction].file); assert.strictEqual('boolean', typeof sharp.format[format][direction].buffer); assert.strictEqual('boolean', typeof sharp.format[format][direction].stream); }); }); }); }); });
//// [inferTypes1.ts] type Unpacked<T> = T extends (infer U)[] ? U : T extends (...args: any[]) => infer U ? U : T extends Promise<infer U> ? U : T; type T00 = Unpacked<string>; // string type T01 = Unpacked<string[]>; // string type T02 = Unpacked<() => string>; // string type T03 = Unpacked<Promise<string>>; // string type T04 = Unpacked<Unpacked<Promise<string>[]>>; // string type T05 = Unpacked<any>; // any type T06 = Unpacked<never>; // never function f1(s: string) { return { a: 1, b: s }; } class C { x = 0; y = 0; } type T10 = ReturnType<() => string>; // string type T11 = ReturnType<(s: string) => void>; // void type T12 = ReturnType<(<T>() => T)>; // {} type T13 = ReturnType<(<T extends U, U extends number[]>() => T)>; // number[] type T14 = ReturnType<typeof f1>; // { a: number, b: string } type T15 = ReturnType<any>; // any type T16 = ReturnType<never>; // never type T17 = ReturnType<string>; // Error type T18 = ReturnType<Function>; // Error type U10 = InstanceType<typeof C>; // C type U11 = InstanceType<any>; // any type U12 = InstanceType<never>; // never type U13 = InstanceType<string>; // Error type U14 = InstanceType<Function>; // Error type ArgumentType<T extends (x: any) => any> = T extends (a: infer A) => any ? A : any; type T20 = ArgumentType<() => void>; // {} type T21 = ArgumentType<(x: string) => number>; // string type T22 = ArgumentType<(x?: string) => number>; // string | undefined type T23 = ArgumentType<(...args: string[]) => number>; // string type T24 = ArgumentType<(x: string, y: string) => number>; // Error type T25 = ArgumentType<Function>; // Error type T26 = ArgumentType<any>; // any type T27 = ArgumentType<never>; // never type X1<T extends { x: any, y: any }> = T extends { x: infer X, y: infer Y } ? [X, Y] : any; type T30 = X1<{ x: any, y: any }>; // [any, any] type T31 = X1<{ x: number, y: string }>; // [number, string] type T32 = X1<{ x: number, y: string, z: boolean }>; // [number, string] type X2<T> = T extends { a: infer U, b: infer U } ? U : never; type T40 = X2<{}>; // never type T41 = X2<{ a: string }>; // never type T42 = X2<{ a: string, b: string }>; // string type T43 = X2<{ a: number, b: string }>; // string | number type T44 = X2<{ a: number, b: string, c: boolean }>; // string | number type X3<T> = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never; type T50 = X3<{}>; // never type T51 = X3<{ a: (x: string) => void }>; // never type T52 = X3<{ a: (x: string) => void, b: (x: string) => void }>; // string type T53 = X3<{ a: (x: number) => void, b: (x: string) => void }>; // string & number type T54 = X3<{ a: (x: number) => void, b: () => void }>; // number type T60 = infer U; // Error type T61<T> = infer A extends infer B ? infer C : infer D; // Error type T62<T> = U extends (infer U)[] ? U : U; // Error type T63<T> = T extends (infer A extends infer B ? infer C : infer D) ? string : number; type T70<T extends string> = { x: T }; type T71<T> = T extends T70<infer U> ? T70<U> : never; type T72<T extends number> = { y: T }; type T73<T> = T extends T72<infer U> ? T70<U> : never; // Error type T74<T extends number, U extends string> = { x: T, y: U }; type T75<T> = T extends T74<infer U, infer U> ? T70<U> | T72<U> | T74<U, U> : never; type T76<T extends T[], U extends T> = { x: T }; type T77<T> = T extends T76<infer X, infer Y> ? T76<X, Y> : never; type T78<T> = T extends T76<infer X, infer X> ? T76<X, X> : never; type Foo<T extends string, U extends T> = [T, U]; type Bar<T> = T extends Foo<infer X, infer Y> ? Foo<X, Y> : never; type T90 = Bar<[string, string]>; // [string, string] type T91 = Bar<[string, "a"]>; // [string, "a"] type T92 = Bar<[string, "a"] & { x: string }>; // [string, "a"] type T93 = Bar<["a", string]>; // never type T94 = Bar<[number, number]>; // never // Example from #21496 type JsonifiedObject<T extends object> = { [K in keyof T]: Jsonified<T[K]> }; type Jsonified<T> = T extends string | number | boolean | null ? T : T extends undefined | Function ? never // undefined and functions are removed : T extends { toJSON(): infer R } ? R // toJSON is called if it exists (e.g. Date) : T extends object ? JsonifiedObject<T> : "what is this"; type Example = { str: "literalstring", fn: () => void, date: Date, customClass: MyClass, obj: { prop: "property", clz: MyClass, nested: { attr: Date } }, } declare class MyClass { toJSON(): "correct"; } type JsonifiedExample = Jsonified<Example>; declare let ex: JsonifiedExample; const z1: "correct" = ex.customClass; const z2: string = ex.obj.nested.attr; // Repros from #21631 type A1<T, U extends A1<any, any>> = [T, U]; type B1<S> = S extends A1<infer T, infer U> ? [T, U] : never; type A2<T, U extends void> = [T, U]; type B2<S> = S extends A2<infer T, infer U> ? [T, U] : never; type C2<S, U extends void> = S extends A2<infer T, U> ? [T, U] : never; // Repro from #21735 type A<T> = T extends string ? { [P in T]: void; } : T; type B<T> = string extends T ? { [P in T]: void; } : T; // Error // Repro from #22302 type MatchingKeys<T, U, K extends keyof T = keyof T> = K extends keyof T ? T[K] extends U ? K : never : never; type VoidKeys<T> = MatchingKeys<T, void>; interface test { a: 1, b: void } type T80 = MatchingKeys<test, void>; type T81 = VoidKeys<test>; // Repro from #22221 type MustBeString<T extends string> = T; type EnsureIsString<T> = T extends MustBeString<infer U> ? U : never; type Test1 = EnsureIsString<"hello">; // "hello" type Test2 = EnsureIsString<42>; // never //// [inferTypes1.js] "use strict"; function f1(s) { return { a: 1, b: s }; } var C = /** @class */ (function () { function C() { this.x = 0; this.y = 0; } return C; }()); var z1 = ex.customClass; var z2 = ex.obj.nested.attr;
/* eslint-disable no-unused-vars */ // This helps ember-browserify find npm modules in ember-cli addons import md5 from 'npm:js-md5'; import config from 'ember-get-config'; import _get from 'npm:lodash/get'; import Cookie from 'npm:js-cookie'; import keenTracking from 'npm:keen-tracking'; export {default} from 'ember-osf/mixins/keen-tracker';
/* * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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 pref = new gadgets.Prefs(); var node = pref.getString('node') || undefined; var start = pref.getString('startTime') || undefined; var end = pref.getString('endTime') || undefined; var url = pref.getString('dataSource'); var template; function fetchData(startTime, endTime) { var url = pref.getString('dataSource'); var data = { start_time: start, end_time: end, node: node, action: pref.getString('appStatType') }; var appname = pref.getString('appname'); if (appname != '') { data.appname = appname; } $.ajax({ url: url, type: 'GET', dataType: 'json', data: data, success: onDataReceived }); } function onDataReceived(data) { var tableData = data.data; var tableHeadings = data.headings; var orderColumn = data.orderColumn; var applist = data.applist || undefined; var table; var headings; headings = getTableHeader(tableHeadings); $('#placeholder').html(template(headings)); var dataTableOptions = {}; dataTableOptions['data'] = tableData; dataTableOptions['order'] = [orderColumn]; if (!applist) { dataTableOptions['aoColumns'] = [ {'sWidth': '60%'}, {'sWidth': '20%'}, {'sWidth': '20%'} ]; } table = $('#table').dataTable(dataTableOptions); if (applist) { registerWebappSelect(table); } } function registerWebappSelect(table) { table.find('tbody').on('click', 'tr', function () { if ($(this).hasClass('selected')) { $(this).removeClass('selected'); } else { var param = ''; if (node) { param = 'node=' + node; } if (start && end) { param = param + (param == '' ? '' : '&') + 'start-time=' + moment(start, 'YYYY-MM-DD HH:mm').format('X') + '&end-time=' + moment(end, 'YYYY-MM-DD HH:mm').format('X'); } var webapp = table.fnGetData(this)[0]; table.$('tr.selected').removeClass('selected'); $(this).addClass('selected'); var webappUrl = webapp; if (param != '?') { webappUrl = webappUrl + '?' + param; } publishRedirectUrl(webappUrl); } }); } function getTableHeader(tableHeadings) { var headingArray = []; var row = []; var th = {}; var rowSpan = 1; var i, j, len, len2; for (i = 0, len = tableHeadings.length; i < len; i++) { if (tableHeadings[i] instanceof Object) { rowSpan = 2; break; } } for (i = 0, len = tableHeadings.length; i < len; i++) { th = {}; if (typeof(tableHeadings[i]) == 'string') { th.rowSpan = rowSpan; th.text = tableHeadings[i]; } else { th.colSpan = tableHeadings[i]["sub"].length; th.text = tableHeadings[i]['parent']; } row.push(th); } headingArray.push(row); if (rowSpan > 1) { row = []; for (i = 0, len = tableHeadings.length; i < len; i++) { if (tableHeadings[i] instanceof Object) { var subHeadings = tableHeadings[i]['sub']; for (j = 0, len2 = subHeadings.length; j < len2; j++) { th = {}; th.text = subHeadings[j]; row.push(th); } } } headingArray.push(row); } return headingArray; } function publishRedirectUrl(url) { gadgets.Hub.publish('wso2.as.http.dashboard.webapp.url', url); } $(function () { fetchData(); Handlebars.registerHelper('generateHeadingTag', function (th) { var properties = ''; properties += (th.rowSpan) ? " rowspan='" + th.rowSpan + "'" : ''; properties += (th.colSpan) ? " colspan='" + th.colSpan + "'" : ''; return new Handlebars.SafeString('<th' + properties + '>' + th.text + '</th>'); }); template = Handlebars.compile($('#table-template').html()); }); gadgets.HubSettings.onConnect = function () { gadgets.Hub.subscribe('wso2.gadgets.charts.timeRangeChange', function (topic, data, subscriberData) { start = data.start.format('YYYY-MM-DD HH:mm'); end = data.end.format('YYYY-MM-DD HH:mm'); fetchData(); } ); gadgets.Hub.subscribe('wso2.gadgets.charts.ipChange', function (topic, data, subscriberData) { node = data; fetchData(); } ); };
exports.name = 'should'; exports.category = 'bdd/tdd'; exports.homepage = 'https://npmjs.org/package/should';
/* * 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'); /** * Model class for event details of a VMwareAzureV2 event. * * @extends models['EventProviderSpecificDetails'] */ class InMageAzureV2EventDetails extends models['EventProviderSpecificDetails'] { /** * Create a InMageAzureV2EventDetails. * @member {string} [eventType] InMage Event type. Takes one of the values of * {InMageDataContract.InMageMonitoringEventType}. * @member {string} [category] InMage Event Category. * @member {string} [component] InMage Event Component. * @member {string} [correctiveAction] Corrective Action string for the * event. * @member {string} [details] InMage Event Details. * @member {string} [summary] InMage Event Summary. * @member {string} [siteName] VMware Site name. */ constructor() { super(); } /** * Defines the metadata of InMageAzureV2EventDetails * * @returns {object} metadata of InMageAzureV2EventDetails * */ mapper() { return { required: false, serializedName: 'InMageAzureV2', type: { name: 'Composite', polymorphicDiscriminator: { serializedName: 'instanceType', clientName: 'instanceType' }, uberParent: 'EventProviderSpecificDetails', className: 'InMageAzureV2EventDetails', modelProperties: { instanceType: { required: true, serializedName: 'instanceType', isPolymorphicDiscriminator: true, type: { name: 'String' } }, eventType: { required: false, serializedName: 'eventType', type: { name: 'String' } }, category: { required: false, serializedName: 'category', type: { name: 'String' } }, component: { required: false, serializedName: 'component', type: { name: 'String' } }, correctiveAction: { required: false, serializedName: 'correctiveAction', type: { name: 'String' } }, details: { required: false, serializedName: 'details', type: { name: 'String' } }, summary: { required: false, serializedName: 'summary', type: { name: 'String' } }, siteName: { required: false, serializedName: 'siteName', type: { name: 'String' } } } } }; } } module.exports = InMageAzureV2EventDetails;
define({ root: ({ appTitle: 'Dojo Bootstrap Map', navBasemaps: 'Basemaps', navAbout: 'About', sidebarTitle: 'Legend', modalAboutTitle: 'About', modalAboutContent: 'The goal of this application boilerplate is to demonstrate how to build a mapping application that utilizes the best parts of Dojo (AMD modules, classes and widgets, promises, i18n, routing, etc) along with the responsive UI of Bootstrap.', modalAboutMoreInfo: 'More...', widgets : { geocoder : { placeholder : 'Address or Location' } } }), fr: true, es: true, it: true, de: true // TODO: define other locales as needed });
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = formatDistance; // Source: https://www.unicode.org/cldr/charts/32/summary/te.html var formatDistanceLocale = { lessThanXSeconds: { standalone: { one: 'సెకను కన్నా తక్కువ', other: '{{count}} సెకన్ల కన్నా తక్కువ' }, withPreposition: { one: 'సెకను', other: '{{count}} సెకన్ల' } }, xSeconds: { standalone: { one: 'ఒక సెకను', // CLDR #1314 other: '{{count}} సెకన్ల' }, withPreposition: { one: 'ఒక సెకను', other: '{{count}} సెకన్ల' } }, halfAMinute: { standalone: 'అర నిమిషం', withPreposition: 'అర నిమిషం' }, lessThanXMinutes: { standalone: { one: 'ఒక నిమిషం కన్నా తక్కువ', other: '{{count}} నిమిషాల కన్నా తక్కువ' }, withPreposition: { one: 'ఒక నిమిషం', other: '{{count}} నిమిషాల' } }, xMinutes: { standalone: { one: 'ఒక నిమిషం', // CLDR #1311 other: '{{count}} నిమిషాలు' }, withPreposition: { one: 'ఒక నిమిషం', // CLDR #1311 other: '{{count}} నిమిషాల' } }, aboutXHours: { standalone: { one: 'సుమారు ఒక గంట', other: 'సుమారు {{count}} గంటలు' }, withPreposition: { one: 'సుమారు ఒక గంట', other: 'సుమారు {{count}} గంటల' } }, xHours: { standalone: { one: 'ఒక గంట', // CLDR #1308 other: '{{count}} గంటలు' }, withPreposition: { one: 'ఒక గంట', other: '{{count}} గంటల' } }, xDays: { standalone: { one: 'ఒక రోజు', // CLDR #1292 other: '{{count}} రోజులు' }, withPreposition: { one: 'ఒక రోజు', other: '{{count}} రోజుల' } }, aboutXMonths: { standalone: { one: 'సుమారు ఒక నెల', other: 'సుమారు {{count}} నెలలు' }, withPreposition: { one: 'సుమారు ఒక నెల', other: 'సుమారు {{count}} నెలల' } }, xMonths: { standalone: { one: 'ఒక నెల', // CLDR #1281 other: '{{count}} నెలలు' }, withPreposition: { one: 'ఒక నెల', other: '{{count}} నెలల' } }, aboutXYears: { standalone: { one: 'సుమారు ఒక సంవత్సరం', other: 'సుమారు {{count}} సంవత్సరాలు' }, withPreposition: { one: 'సుమారు ఒక సంవత్సరం', other: 'సుమారు {{count}} సంవత్సరాల' } }, xYears: { standalone: { one: 'ఒక సంవత్సరం', // CLDR #1275 other: '{{count}} సంవత్సరాలు' }, withPreposition: { one: 'ఒక సంవత్సరం', other: '{{count}} సంవత్సరాల' } }, overXYears: { standalone: { one: 'ఒక సంవత్సరం పైగా', other: '{{count}} సంవత్సరాలకు పైగా' }, withPreposition: { one: 'ఒక సంవత్సరం', other: '{{count}} సంవత్సరాల' } }, almostXYears: { standalone: { one: 'దాదాపు ఒక సంవత్సరం', other: 'దాదాపు {{count}} సంవత్సరాలు' }, withPreposition: { one: 'దాదాపు ఒక సంవత్సరం', other: 'దాదాపు {{count}} సంవత్సరాల' } } }; function formatDistance(token, count, options) { options = options || {}; var usageGroup = options.addSuffix ? formatDistanceLocale[token].withPreposition : formatDistanceLocale[token].standalone; var result; if (typeof usageGroup === 'string') { result = usageGroup; } else if (count === 1) { result = usageGroup.one; } else { result = usageGroup.other.replace('{{count}}', count); } if (options.addSuffix) { if (options.comparison > 0) { return result + 'లో'; } else { return result + ' క్రితం'; } } return result; } module.exports = exports.default;
// This file was procedurally generated from the following sources: // - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case // - src/dstr-binding/error/async-gen-func-named-expr-dflt.template /*--- description: Error thrown when accessing the corresponding property of the value object (async generator named function expression (default parameter)) esid: sec-asyncgenerator-definitions-evaluation features: [async-iteration] flags: [generated] info: | AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody } [...] 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody, funcEnv, strict). [...] 13.3.3.7 Runtime Semantics: KeyedBindingInitialization BindingElement : BindingPattern Initializeropt 1. Let v be GetV(value, propertyName). 2. ReturnIfAbrupt(v). ---*/ var initEvalCount = 0; var poisonedProperty = Object.defineProperty({}, 'poisoned', { get: function() { throw new Test262Error(); } }); var f; f = async function* h({ poisoned: x = ++initEvalCount } = poisonedProperty) { }; assert.throws(Test262Error, function() { f(); }); assert.sameValue(initEvalCount, 0);
// Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-%typedarray%.prototype.indexof description: > %TypedArray%.prototype.indexOf.name is "indexOf". info: | %TypedArray%.prototype.indexOf (searchElement [ , fromIndex ] ) 17 ECMAScript Standard Built-in Objects: Every built-in Function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, the name property of a built-in Function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ assert.sameValue(TypedArray.prototype.indexOf.name, "indexOf"); verifyNotEnumerable(TypedArray.prototype.indexOf, "name"); verifyNotWritable(TypedArray.prototype.indexOf, "name"); verifyConfigurable(TypedArray.prototype.indexOf, "name");
angular.module('piwikApp').factory('http404CheckInterceptor', function($q) { function isClientError(rejection) { if (rejection.status === 500) { return true; } return rejection.status >= 400 && rejection.status < 408; } return { 'responseError': function(rejection) { if (rejection && isClientError(rejection) && rejection.config && rejection.config.url && -1 !== rejection.config.url.indexOf('.html') && -1 !== rejection.config.url.indexOf('plugins')) { var posEndUrl = rejection.config.url.indexOf('.html') + 5; var url = rejection.config.url.substr(0, posEndUrl); var message = 'Please check your server configuration. You may want to whitelist "*.html" files from the "plugins" directory.'; message += ' The HTTP status code is ' + rejection.status + ' for URL "' + url + '"'; var UI = require('piwik/UI'); var notification = new UI.Notification(); notification.show(message, { title: 'Failed to load HTML file:', context: 'error', id: 'Network_HtmlFileLoadingError' }); } return $q.reject(rejection); } }; }); angular.module('piwikApp').config(['$httpProvider',function($httpProvider) { $httpProvider.interceptors.push('http404CheckInterceptor'); }]);
//= require_self //= require spree/backend/handlebars_extensions //= require spree/backend/variant_autocomplete //= require spree/backend/taxon_autocomplete //= require spree/backend/option_type_autocomplete //= require spree/backend/user_picker //= require spree/backend/product_picker //= require spree/backend/option_value_picker //= require spree/backend/taxons //= require spree/backend/highlight_negative_numbers /** This is a collection of javascript functions and whatnot under the spree namespace that do stuff we find helpful. Hopefully, this will evolve into a propper class. **/ Spree.ready(function() { // Highlight hovered table column $('table').on("mouseenter", 'td.actions a, td.actions button', function(){ var tr = $(this).closest('tr'); var klass = 'highlight action-' + $(this).data('action') tr.addClass(klass) var observer = new MutationObserver(function(mutations) { tr.removeClass(klass); this.disconnect(); }); observer.observe(tr.get(0), { childList: true }); // Using .one() instead of .on() prevents multiple callbacks to be attached // to this event if mouseentered multiple times. $(this).one("mouseleave", function() { tr.removeClass(klass); observer.disconnect(); }); }); }); $.fn.visible = function(cond) { this[cond ? 'show' : 'hide' ]() }; // Apply to individual radio button that makes another element visible when checked $.fn.radioControlsVisibilityOfElement = function(dependentElementSelector){ if(!this.get(0)){ return } var showValue = this.get(0).value; var radioGroup = $("input[name='" + this.get(0).name + "']"); radioGroup.each(function(){ $(this).click(function(){ $(dependentElementSelector).visible(this.checked && this.value == showValue) }); if(this.checked){ this.click() } }); } Spree.ready(function(){ var uniqueId = 1; $('.spree_add_fields').click(function() { var target = $(this).data("target"); var new_table_row = $(target + ' tr:visible:last').clone(); var new_id = new Date().getTime() + (uniqueId++); new_table_row.find("input, select").each(function () { var el = $(this); el.val(""); // Replace last occurrence of a number el.prop("id", el.prop("id").replace(/\d+(?=[^\d]*$)/, new_id)) el.prop("name", el.prop("name").replace(/\d+(?=[^\d]*$)/, new_id)) }) // When cloning a new row, set the href of all icons to be an empty "#" // This is so that clicking on them does not perform the actions for the // duplicated row new_table_row.find("a").each(function () { var el = $(this); el.prop('href', '#'); }) $(target).prepend(new_table_row); }) $('body').on('click', '.delete-resource', function() { var el = $(this); if (confirm(el.data("confirm"))) { Spree.ajax({ type: 'POST', url: $(this).prop("href"), data: { _method: 'delete', }, dataType: 'script', success: function(response) { el.parents("tr").fadeOut('hide', function() { $(this).remove(); }); }, error: function(response, textStatus, errorThrown) { show_flash('error', response.responseText); } }); } return false; }); $('body').on('click', 'a.spree_remove_fields', function() { var el = $(this); el.prev("input[type=hidden]").val("1"); el.closest(".fields").hide(); if (el.prop("href").substr(-1) == '#') { el.parents("tr").fadeOut('hide'); }else if (el.prop("href")) { Spree.ajax({ type: 'POST', url: el.prop("href"), data: { _method: 'delete', }, success: function(response) { el.parents("tr").fadeOut('hide'); }, error: function(response, textStatus, errorThrown) { show_flash('error', response.responseText); } }) } return false; }); window.Spree.advanceOrder = function() { Spree.ajax({ type: "PUT", async: false, data: { token: Spree.api_key }, url: Spree.routes.checkouts_api + "/" + window.order_number + "/advance" }).done(function() { window.location.reload(); }); } });
/* ----------------------------------------------- /* How to use? : Check the GitHub README /* ----------------------------------------------- */ /* To load a config file (particles.json) you need to host this demo (MAMP/WAMP/local)... */ /* particlesJS.load('particles-js', 'particles.json', function() { console.log('particles.js loaded - callback'); }); */ /* Otherwise just put the config content (json): */ particlesJS('particles-js', { "particles": { "number": { "value": 80, "density": { "enable": true, "value_area": 800 } }, "color": { "value": "#888" }, "shape": { "type": "circle", "stroke": { "width": 0, "color": "#000000" }, "polygon": { "nb_sides": 5 }, "image": { "src": "img/github.svg", "width": 100, "height": 100 } }, "opacity": { "value": 0.5, "random": false, "anim": { "enable": false, "speed": 1, "opacity_min": 0.1, "sync": false } }, "size": { "value": 5, "random": true, "anim": { "enable": false, "speed": 40, "size_min": 0.1, "sync": false } }, "line_linked": { "enable": true, "distance": 150, "color": "#777", "opacity": 0.4, "width": 1 }, "move": { "enable": true, "speed": 6, "direction": "none", "random": false, "straight": false, "out_mode": "out", "attract": { "enable": false, "rotateX": 600, "rotateY": 1200 } } }, "interactivity": { "detect_on": "canvas", "events": { "onhover": { "enable": true, "mode": "repulse" }, "onclick": { "enable": true, "mode": "push" }, "resize": true }, "modes": { "grab": { "distance": 400, "line_linked": { "opacity": 1 } }, "bubble": { "distance": 400, "size": 40, "duration": 2, "opacity": 8, "speed": 3 }, "repulse": { "distance": 200 }, "push": { "particles_nb": 4 }, "remove": { "particles_nb": 2 } } }, "retina_detect": true, "config_demo": { "hide_card": false, "background_color": "#b61924", "background_image": "", "background_position": "50% 50%", "background_repeat": "no-repeat", "background_size": "cover" } } );
// Note: You must restart bin/webpack-watcher for changes to take effect const merge = require('webpack-merge') const sharedConfig = require('./shared.js') module.exports = merge(sharedConfig, { devtool: 'sourcemap', stats: { errorDetails: true }, output: { pathinfo: true } })
/** * Interaction for the faq module * * @author Annelies Van Extergem <annelies@netlash.com> * @author Jelmer Snoeck <jelmer.snoeck@netlash.com> * @author Thomas Deceuninck <thomas@fronto.be> */ jsFrontend.faq = { // init, something like a constructor init: function() { if($('#faqFeedbackForm').length > 0) jsFrontend.faq.feedback.init(); } } // feedback form jsFrontend.faq.feedback = { init: function() { // useful status has been changed $('#usefulY, #usefulN').on('click', function() { // get useful status var useful = ($('#usefulY').attr('checked') ? true : false); // show or hide the form if(useful) { $('#message').prop('required', false); $('form#feedback').submit(); } else { $('#feedbackNoInfo').show(); $('#message').prop('required', true); } }); } } $(jsFrontend.faq.init);
// Copyright 2008 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Defines the base class for a module. This is used to allow the * code to be modularized, giving the benefits of lazy loading and loading on * demand. * */ goog.provide('goog.module.BaseModule'); goog.require('goog.Disposable'); /** * A basic module object that represents a module of Javascript code that can * be dynamically loaded. * * @constructor * @extends {goog.Disposable} */ goog.module.BaseModule = function() { goog.Disposable.call(this); }; goog.inherits(goog.module.BaseModule, goog.Disposable); /** * Performs any load-time initialization that the module requires. * @param {Object} context The module context. */ goog.module.BaseModule.prototype.initialize = function(context) {};
/* * Copyright (c) 2012 Dmitri Melikyan * * 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 nt; var filterKeys; var sampleNum; exports.init = function() { nt = global.nodetime; filterKeys = {}; sampleNum = 0; nt.on('sample', function(sample) { if(!nt.headless && nt.sessionId) { collectKeys(undefined, sample, 0); sampleNum++; if(sampleNum == 1 || sampleNum == 10) { sendKeys(); } } }); setInterval(function() { try { sendKeys(); } catch(e) { nt.error(e); } }, 60000); }; var collectKeys = function(key, obj, depth) { if(depth > 20) return 0; var isArray = Array.isArray(obj); for(var prop in obj) { if(prop.match(/^\_/)) continue; if(typeof obj[prop] === 'object') { collectKeys(prop, obj[prop], depth + 1); } else { if(!isArray) { filterKeys[prop] = true; } else { filterKeys[key] = true; } } } }; var sendKeys = function() { var keys = []; for(var prop in filterKeys) { keys.push(prop); } keys = keys.sort(function(a, b) { a = a.toLowerCase(); b = b.toLowerCase(); if(a > b) return 1; if(a < b) return -1; return 0; }); if(keys.length > 0) { nt.agent.send({cmd: 'updateFilterKeys', args: keys}); } }; var PredicateFilter = function() { } exports.PredicateFilter = PredicateFilter; PredicateFilter.prototype.preparePredicates = function(preds) { preds.forEach(function(pred) { try{ pred.valNum = parseFloat(pred.val) } catch(err) { } try{ if(pred.op === 'match') pred.valRe = new RegExp(pred.val); if(typeof pred.val === 'string') pred.valLc = pred.val.toLowerCase(); } catch(err) { return nt.error(err); } }); this.preds = preds; return true; } PredicateFilter.prototype.filter = function(sample) { var matched = 0; this.preds.forEach(function(pred) { matched += walk(pred, sample, 0); }); return (matched > 0); }; function walk(pred, obj, depth) { if(depth > 20) return 0; var matched = 0; for(var prop in obj) { var val = obj[prop]; if(val === undefined || val === null) { continue; } else if(typeof val === 'object') { matched += walk(pred, val, depth + 1); } else if((pred.key === '*' || pred.key === prop) && test(pred, val)) { matched++; } if(matched) break; } return matched; } function test(pred, val) { var ret = false; if(typeof val === 'number') { if(pred.valNum !== NaN) { if (pred.op === '==') { ret = (val == pred.valNum); } else if (pred.op === '!=') { ret = (val != pred.valNum); } else if (pred.op === '<') { ret = (val < pred.valNum); } else if (pred.op === '>') { ret = (val > pred.valNum); } } } else if(typeof val === 'string') { if(pred.op === 'match' && pred.valRe) { ret = pred.valRe.exec(val); } else if (pred.op === '==') { ret = (val.toLowerCase() == pred.valLc); } else if (pred.op === '!=') { ret = (val.toLowerCase() != pred.valLc); } } return ret; }
Polymer('selection-example', { itemTapAction: function(e, detail, sender) { this.$.selection.select(e.target); }, selectAction: function(e, detail, sender) { detail.item.classList.toggle('selected', detail.isSelected); } });
/** * Browser platform description */ SB.createPlatform('browser', { keys: { RIGHT: 39, LEFT: 37, DOWN: 40, UP: 38, RETURN: 27,//esc EXIT: 46,//delete TOOLS: 32,//space FF: 33,//page up RW: 34,//page down NEXT: 107,//num+ PREV: 109,//num- ENTER: 13, RED: 65,//A GREEN: 66,//B YELLOW: 67,//C BLUE: 68,//D CH_UP: 221, // ] CH_DOWN: 219, // [ N0: 48, N1: 49, N2: 50, N3: 51, N4: 52, N5: 53, N6: 54, N7: 55, N8: 56, N9: 57, PRECH: 45,//ins SMART: 36,//home PLAY: 97,//numpad 1 STOP: 98,//numpad 2 PAUSE: 99,//numpad 3 SUBT: 76,//l, INFO: 73,//i REC: 82//r }, detect: function () { // always true for browser platform return true; }, getNativeDUID: function () { if (navigator.userAgent.indexOf('Chrome') != -1) { this.DUID = 'CHROMEISFINETOO'; } else { this.DUID = 'FIREFOXISBEST'; } return this.DUID; } });
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- function test0() { var a = 1; while(1 && (0 & 1) >= (0 | a)) { function test0a() { a; } } } test0(); test0(); test0(); WScript.Echo("pass");
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > Operator x <= y returns ToString(x) <= ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String es5id: 11.8.3_A3.2_T1.2 description: > Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object ---*/ //CHECK#1 if (({} <= function(){return 1}) !== ({}.toString() <= function(){return 1}.toString())) { $ERROR('#1: ({} <= function(){return 1}) === ({}.toString() <= function(){return 1}.toString())'); } //CHECK#2 if ((function(){return 1} <= {}) !== (function(){return 1}.toString() <= {}.toString())) { $ERROR('#2: (function(){return 1} <= {}) === (function(){return 1}.toString() <= {}.toString())'); } //CHECK#3 if ((function(){return 1} <= function(){return 1}) !== (function(){return 1}.toString() <= function(){return 1}.toString())) { $ERROR('#3: (function(){return 1} <= function(){return 1}) === (function(){return 1}.toString() <= function(){return 1}.toString())'); } //CHECK#4 if (({} <= {}) !== ({}.toString() <= {}.toString())) { $ERROR('#4: ({} <= {}) === ({}.toString() <= {}.toString())'); }
var _ = require('underscore'); var Backbone = require('backbone'); var GRAPHICS = require('../util/constants').GRAPHICS; var VisBase = require('../visuals/visBase').VisBase; var VisEdge = VisBase.extend({ defaults: { tail: null, head: null, animationSpeed: GRAPHICS.defaultAnimationTime, animationEasing: GRAPHICS.defaultEasing }, validateAtInit: function() { var required = ['tail', 'head']; _.each(required, function(key) { if (!this.get(key)) { throw new Error(key + ' is required!'); } }, this); }, getID: function() { return this.get('tail').get('id') + '.' + this.get('head').get('id'); }, initialize: function() { this.validateAtInit(); // shorthand for the main objects this.gitVisuals = this.get('gitVisuals'); this.gitEngine = this.get('gitEngine'); this.get('tail').get('outgoingEdges').push(this); }, remove: function() { this.removeKeys(['path']); this.gitVisuals.removeVisEdge(this); }, genSmoothBezierPathString: function(tail, head) { var tailPos = tail.getScreenCoords(); var headPos = head.getScreenCoords(); return this.genSmoothBezierPathStringFromCoords(tailPos, headPos); }, genSmoothBezierPathStringFromCoords: function(tailPos, headPos) { // we need to generate the path and control points for the bezier. format // is M(move abs) C (curve to) (control point 1) (control point 2) (final point) // the control points have to be __below__ to get the curve starting off straight. var coords = function(pos) { return String(Math.round(pos.x)) + ',' + String(Math.round(pos.y)); }; var offset = function(pos, dir, delta) { delta = delta || GRAPHICS.curveControlPointOffset; return { x: pos.x, y: pos.y + delta * dir }; }; var offset2d = function(pos, x, y) { return { x: pos.x + x, y: pos.y + y }; }; // first offset tail and head by radii tailPos = offset(tailPos, -1, this.get('tail').getRadius()); headPos = offset(headPos, 1, this.get('head').getRadius()); var str = ''; // first move to bottom of tail str += 'M' + coords(tailPos) + ' '; // start bezier str += 'C'; // then control points above tail and below head str += coords(offset(tailPos, -1)) + ' '; str += coords(offset(headPos, 1)) + ' '; // now finish str += coords(headPos); // arrow head var delta = GRAPHICS.arrowHeadSize || 10; str += ' L' + coords(offset2d(headPos, -delta, delta)); str += ' L' + coords(offset2d(headPos, delta, delta)); str += ' L' + coords(headPos); // then go back, so we can fill correctly str += 'C'; str += coords(offset(headPos, 1)) + ' '; str += coords(offset(tailPos, -1)) + ' '; str += coords(tailPos); return str; }, getBezierCurve: function() { return this.genSmoothBezierPathString(this.get('tail'), this.get('head')); }, getStrokeColor: function() { return GRAPHICS.visBranchStrokeColorNone; }, setOpacity: function(opacity) { opacity = (opacity === undefined) ? 1 : opacity; this.get('path').attr({opacity: opacity}); }, genGraphics: function(paper) { var pathString = this.getBezierCurve(); var path = paper.path(pathString).attr({ 'stroke-width': GRAPHICS.visBranchStrokeWidth, 'stroke': this.getStrokeColor(), 'stroke-linecap': 'round', 'stroke-linejoin': 'round', 'fill': this.getStrokeColor() }); path.toBack(); this.set('path', path); }, getOpacity: function() { var stat = this.gitVisuals.getCommitUpstreamStatus(this.get('tail')); var map = { 'branch': 1, 'head': GRAPHICS.edgeUpstreamHeadOpacity, 'none': GRAPHICS.edgeUpstreamNoneOpacity }; if (map[stat] === undefined) { throw new Error('bad stat'); } return map[stat]; }, getAttributes: function() { var newPath = this.getBezierCurve(); var opacity = this.getOpacity(); return { path: { path: newPath, opacity: opacity } }; }, animateUpdatedPath: function(speed, easing) { var attr = this.getAttributes(); this.animateToAttr(attr, speed, easing); }, animateFromAttrToAttr: function(fromAttr, toAttr, speed, easing) { // an animation of 0 is essentially setting the attribute directly this.animateToAttr(fromAttr, 0); this.animateToAttr(toAttr, speed, easing); }, animateToAttr: function(attr, speed, easing) { if (speed === 0) { this.get('path').attr(attr.path); return; } this.get('path').toBack(); this.get('path').stop().animate( attr.path, speed !== undefined ? speed : this.get('animationSpeed'), easing || this.get('animationEasing') ); } }); var VisEdgeCollection = Backbone.Collection.extend({ model: VisEdge }); exports.VisEdgeCollection = VisEdgeCollection; exports.VisEdge = VisEdge;
/* * A reply to a screenshot comment made on a review. * * When created, this must take a parentObject attribute that points to a * Review object. */ RB.ScreenshotCommentReply = RB.BaseCommentReply.extend({ rspNamespace: 'screenshot_comment' });
define([ "dojo/_base/declare", "dojo/_base/lang", "dojo/store/Memory", "dojo/query", "dojo/dom-attr", "dijit/_WidgetBase", "dijit/_FocusMixin", "dijit/_TemplatedMixin", "dijit/form/FilteringSelect" ], function(declare, lang, Store, query, domAttr, _WidgetBase, _FocusMixin, _TemplatedMixin, FilteringSelect){ /*===== return declare([_WidgetBase, _FocusMixin, _TemplatedMixin], { // summary: // This grid bar plugin is to switch pages using select widget. // grid: [const] gridx.Grid // The grid widget this plugin works for. grid: null, // stepperClass: Function // The constructor of the select widget stepperClass: FilteringSelect, // stepperProps: Object // The properties passed to select widget when creating it. stepperProps: null, refresh: function(){} }); =====*/ return declare([_WidgetBase, _FocusMixin, _TemplatedMixin], { templateString: '<div class="gridxDropDownPager"><label class="gridxPagerLabel">${pageLabel}</label></div>', constructor: function(args){ lang.mixin(this, args.grid.nls); }, postCreate: function(){ var t = this, g = t.grid, c = 'connect', p = g.pagination; t[c](p, 'onSwitchPage', '_onSwitchPage'); t[c](p, 'onChangePageSize', 'refresh'); t[c](g.model, 'onSizeChange', 'refresh'); g.pagination.loaded.then(function(){ t.refresh(); //Set initial page after pagination module is ready. t._onSwitchPage(g.pagination.currentPage()); }); }, //Public----------------------------------------------------------------------------- grid: null, stepperClass: FilteringSelect, stepperProps: null, refresh: function(){ var t = this, mod = t.module, items = [], selectedItem, p = t.grid.pagination, pageCount = p.pageCount(), currentPage = p.currentPage(), stepper = t._pageStepperSelect, i, v, item; for(i = 0; i < pageCount; ++i){ v = i + 1; item = { id: v, label: v, value: v }; items.push(item); if(currentPage == i){ selectedItem = item; } } var store = new Store({data: items}); if(!stepper){ var cls = t.stepperClass, props = lang.mixin({ store: store, searchAttr: 'label', item: selectedItem, 'class': 'gridxPagerStepperWidget', onChange: function(page){ p.gotoPage(page - 1); } }, t.stepperProps || {}); stepper = t._pageStepperSelect = new cls(props); stepper.placeAt(t.domNode, "last"); stepper.startup(); domAttr.set(query('.gridxPagerLabel', t.domNode)[0], 'for', stepper.id); }else{ stepper.set('store', store); stepper.set('value', currentPage + 1); } stepper.set('disabled', pageCount <= 1); }, //Private---------------------------------------------------------------------------- _onSwitchPage: function(page){ this._pageStepperSelect.set('value', page + 1); } }); });
/** PeriodLister Class */ function PeriodDeltaChain(params) { this.period_root_id = params.period_root_id; this.date_format = this.set_or_default(params.date_format, ''); this.set_due_date(params.due_date); this.period_class = this.set_or_default(params.period_class, 'period'); } PeriodDeltaChain.prototype.refresh = function() { var current_time = this.due_date; var format = this.date_format; var period_selector = '#' + this.period_root_id + ' .' + this.period_class; var me = this; jQuery(period_selector).each(function() { var from_time_node = this.querySelector('.PeriodDeltaChain_FromTime'); var to_time_node = this.querySelector('.PeriodDeltaChain_ToTime'); var hours_value = this.querySelector('.PeriodDeltaChain_Hours').value; var from_time = moment(current_time, me.date_format); var to_time = moment(current_time, me.date_format); jQuery(from_time_node).html(from_time.format(format)); jQuery(to_time_node).html(to_time.add('hours', hours_value).format(format)); current_time = to_time; }); if (jQuery(period_selector).length < 2) { jQuery(period_selector + ' a').hide(); } else { jQuery(period_selector + ' a').show(); } } PeriodDeltaChain.prototype.set_due_date = function(new_due_date) { delete this.due_date; this.due_date = convert_date(new_due_date); } PeriodDeltaChain.prototype.set_or_default = function(value, default_value) { if (typeof value == 'undefined') { return default_value; } return value; } /** Converts date string to an actual Date object. */ function convert_date(due_date) { if (due_date.indexOf(' ') > -1) { var arr_date = due_date.split(/[ T]/).filter(function (s) { return s !== ''; }); due_date = arr_date[0] + ' ' + arr_date[1] + ' ' + arr_date[2]; } return due_date; }
var test = require("tape") var add = require("../index.js") test("add is a function", function (assert) { assert.equal(typeof add, "function") assert.end() }) test("can add numbers", function (assert) { assert.equal(add(3, 9), 12) assert.end() })
var parent = require('../../stable/string/match-all'); module.exports = parent;
const Combinatorics = require('js-combinatorics'); const widths = [null, 20, 60]; const heights = [null, 40, 80]; const horizontalAlignments = [null, 'left', 'right', 'center']; const verticalAlignments = [null, 'bottom', 'top', 'center']; const orients = [null, 'horizontal', 'vertical']; const caps = [null, 10, 20]; const results = { bar: { keys: ['width', 'height', 'horizontalAlign', 'verticalAlign'], combinations: Combinatorics.cartesianProduct( widths, // Bar chart needs a width heights.slice(1), horizontalAlignments, verticalAlignments ).toArray() }, boxPlot: { keys: ['width', 'orient', 'cap'], combinations: Combinatorics.cartesianProduct( widths, orients, caps ).toArray() }, candlestick: { keys: ['width'], combinations: Combinatorics.cartesianProduct( widths ).toArray() }, errorBar: { keys: ['width', 'orient'], combinations: Combinatorics.cartesianProduct( widths, orients ).toArray() }, ohlc: { keys: ['width', 'orient'], combinations: Combinatorics.cartesianProduct( widths, orients ).toArray() } }; module.exports = results;
'use strict'; const { Symbol } = primordials; const { kUpdateTimer, onStreamRead, } = require('internal/stream_base_commons'); const { owner_symbol } = require('internal/async_hooks').symbols; const { Readable } = require('stream'); const kHandle = Symbol('kHandle'); class HeapSnapshotStream extends Readable { constructor(handle) { super({ autoDestroy: true }); this[kHandle] = handle; handle[owner_symbol] = this; handle.onread = onStreamRead; } _read() { if (this[kHandle]) this[kHandle].readStart(); } _destroy() { // Release the references on the handle so that // it can be garbage collected. this[kHandle][owner_symbol] = undefined; this[kHandle] = undefined; } [kUpdateTimer]() { // Does nothing } } module.exports = { HeapSnapshotStream };
import hasFeature from './has'; export function prop(path) { return function(state, props) { const names = path.split('.'); if (!(names[0] in props)) { throw new Error(`Missing required prop ${names[0]}.`); } return names.reduce((p, name) => (p && p[name]), props); }; } export function has(featureName) { return function(_props, _state, browser) { return hasFeature(featureName, browser); }; }
// Returns function that returns deferred or promise object. // // 1. If invoked without arguments then deferred object is returned // Deferred object consist of promise (unresolved) function and resolve // function through which we resolve promise // 2. If invoked with one argument then promise is returned which resolved value // is given argument. Argument may be any value (even undefined), // if it's promise then same promise is returned // 3. If invoked with more than one arguments then promise that resolves with // array of all resolved arguments is returned. 'use strict'; var isError = require('es5-ext/lib/Error/is-error') , validError = require('es5-ext/lib/Error/valid-error') , noop = require('es5-ext/lib/Function/noop') , isPromise = require('./is-promise') , every = Array.prototype.every, push = Array.prototype.push , Deferred, createDeferred, count = 0, timeout, extendShim, ext , protoSupported = Boolean(isPromise.__proto__); extendShim = function (promise) { ext._names.forEach(function (name) { promise[name] = function () { return promise.__proto__[name].apply(promise, arguments); }; }); promise.returnsPromise = true; promise.resolved = promise.__proto__.resolved; }; Deferred = function () { var promise = function (win, fail) { return promise.then(win, fail); }; if (!count) { timeout = setTimeout(noop, 1e9); } ++count; if (createDeferred._monitor) { promise.monitor = createDeferred._monitor(); } promise.__proto__ = ext._unresolved; if (!protoSupported) { extendShim(promise); } createDeferred._profile && createDeferred._profile(); this.promise = promise; this.resolve = this.resolve.bind(this); this.reject = this.reject.bind(this); }; Deferred.prototype = { resolved: false, resolve: function (value) { var i, name, data; if (this.resolved) { return this.promise; } this.resolved = true; if (!--count) { clearTimeout(timeout); } if (this.promise.monitor) { clearTimeout(this.promise.monitor); } if (isPromise(value)) { if (!value.resolved) { if (!value.dependencies) { value.dependencies = []; } value.dependencies.push(this.promise); if (this.promise.pending) { if (value.pending) { push.apply(value.pending, this.promise.pending); this.promise.pending = value.pending; if (this.promise.dependencies) { this.promise.dependencies.forEach(function self(dPromise) { dPromise.pending = value.pending; if (dPromise.dependencies) { dPromise.dependencies.forEach(self); } }); } } else { value.pending = this.promise.pending; } } else if (value.pending) { this.promise.pending = value.pending; } else { this.promise.pending = value.pending = []; } return this.promise; } else { value = value.value; } } this.promise.value = value; this.promise.failed = (value && isError(value)) || false; this.promise.__proto__ = ext._resolved; if (!protoSupported) { this.promise.resolved = true; } if (this.promise.dependencies) { this.promise.dependencies.forEach(function self(dPromise) { dPromise.value = value; dPromise.failed = this.failed; dPromise.__proto__ = ext._resolved; if (!protoSupported) { dPromise.resolved = true; } delete dPromise.pending; if (dPromise.dependencies) { dPromise.dependencies.forEach(self, this); delete dPromise.dependencies; } }, this.promise); delete this.promise.dependencies; } if ((data = this.promise.pending)) { for (i = 0; (name = data[i]); ++i) { ext._onresolve[name].apply(this.promise, data[++i]); } delete this.promise.pending; } return this.promise; }, reject: function (error) { return this.resolve(validError(error)); } }; module.exports = createDeferred = function (value) { var l, d, waiting, initialized, result, promise; if ((l = arguments.length)) { if (l > 1) { d = new Deferred(); waiting = 0; result = new Array(l); every.call(arguments, function (value, index) { if (isPromise(value)) { ++waiting; value.end(function (value) { result[index] = value; if (!--waiting && initialized) { d.resolve(result); } }, d.resolve); } else if (isError(value)) { d.resolve(value); return false; } else { result[index] = value; } return true; }); initialized = true; if (!waiting) { d.resolve(result); } return d.promise; } else if (isPromise(value)) { return value; } else { promise = function (win, fail) { return promise.then(win, fail); }; promise.value = value; promise.failed = isError(value); promise.__proto__ = ext._resolved; if (!protoSupported) { extendShim(promise); } createDeferred._profile && createDeferred._profile(true); return promise; } } return new Deferred(); }; createDeferred.Deferred = Deferred; ext = require('./_ext');
({ // local representation of all CSS3 named colors, companion to dojo.colors. To be used where descriptive information // is required for each color, such as a palette widget, and not for specifying color programatically. //Note: due to the SVG 1.0 spec additions, some of these are alternate spellings for the same color e.g. gray vs. gray. //TODO: should we be using unique rgb values as keys instead and avoid these duplicates, or rely on the caller to do the reverse mapping? aliceblue: "أزرق فاتح", antiquewhite: "أبيض عتيق", aqua: "أزرق مائي", aquamarine: "أزرق مائل للأخضر (زبرجد) ", azure: "أزرق سماوي ", beige: "بيج", bisque: "أصفر برتقالي الى رمادي مصفر", black: "أسود", blanchedalmond: "أخضر مائل للبياض", blue: "أزرق", blueviolet: "أزرق-بنفسجي", brown: "بني", burlywood: "خشبي", cadetblue: "أزرق ملون بالرمادي", chartreuse: "أخضر مائل للصفرة", chocolate: "بني غامق", coral: "مرجاني", cornflowerblue: "أزرق عنبري", cornsilk: "حريري", crimson: "قرمزي", cyan: "أزرق سماوي", darkblue: "أزرق داكن", darkcyan: "أزرق سماوي داكن", darkgoldenrod: "أصفر ذهبي داكن ", darkgray: "رمادي داكن", darkgreen: "أخضر داكن", darkgrey: "رمادي داكن", // same as darkgray darkkhaki: "كاكي داكن", darkmagenta: "قرمزي داكن", darkolivegreen: "أخضر زيتوني داكن", darkorange: "برتقالي داكن", darkorchid: "أرجواني داكن", darkred: "أحمر داكن", darksalmon: "فضي داكن", darkseagreen: "أخضر مائل للأزرق داكن", darkslateblue: "أزرق اردوازي داكن", darkslategray: "رمادي اردوازي داكن", darkslategrey: "رمادي اردوازي داكن", // same as darkslategray darkturquoise: "تركواز داكن", darkviolet: "بنفسجي داكن", deeppink: "أحمر وردي غامق", deepskyblue: "أزرق سماوي غامق", dimgray: "رمادي شاحب", dimgrey: "رمادي شاحب", // same as dimgray dodgerblue: "أزرق عنبري", firebrick: "أصفر زاهي", floralwhite: "أبيض زهري ", forestgreen: "أخضر بلون أشجار الغابات ", fuchsia: "فوشيا", gainsboro: "رمادي مائل للأزرق فاتح ", ghostwhite: "أبيض شفاف", gold: "ذهبي", goldenrod: "أصفر ذهبي ", gray: "رمادي", green: "أخضر", greenyellow: "أخضر مائل للأصفر", grey: "رمادي", // same as gray honeydew: "أبيض مائل للأخضر ", hotpink: "أحمر وردي زاهي", indianred: "أحمر هندي", indigo: "نيلي", ivory: "عاجي", khaki: "كاكي", lavender: "أرجواني شاحب", lavenderblush: "أحمر أرجواني", lawngreen: "أخضر بلون العشب ", lemonchiffon: "أصفر شفاف ", lightblue: "أزرق فاتح", lightcoral: "مرجاني فاتح", lightcyan: "سماوي فاتح", lightgoldenrodyellow: "أصفر ذهبي فاتح", lightgray: "رمادي فاتح", lightgreen: "أخضر فاتح", lightgrey: "رمادي فاتح", // same as lightgray lightpink: "وردي فاتح", lightsalmon: "فضي فاتح", lightseagreen: "أخضر مائل للأزرق فاتح", lightskyblue: "أزرق سماوي فاتح", lightslategray: "رمادي اردوازي فاتح", lightslategrey: "رمادي اردوازي فاتح", // same as lightslategray lightsteelblue: "أزرق معدني فاتح", lightyellow: "أصفر فاتح ", lime: "ليموني ", limegreen: "أخضر ليموني ", linen: "كتاني ", magenta: "أحمر قرمزي ", maroon: "أحمر داكن ", mediumaquamarine: "أزرق مائل للأخضر (زبرجد) متوسط ", mediumblue: "أزرق متوسط ", mediumorchid: "أرجواني متوسط ", mediumpurple: "قرمزي متوسط ", mediumseagreen: "أخضر مائل للأزرق متوسط ", mediumslateblue: "أزرق اردوازي متوسط ", mediumspringgreen: "أخضر ربيعي متوسط ", mediumturquoise: "تركواز متوسط ", mediumvioletred: "أحمر-بنفسجي متوسط ", midnightblue: "أزرق بحري ", mintcream: "أصفر شاحب مائل للأخضر الزرعي ", mistyrose: "وردي ", moccasin: "نحاسي أحمر ", navajowhite: "أبيض ملاحي ", navy: "أزرق داكن ", oldlace: "برتقالي مائل للأصفر شاحب ", olive: "أخضر زيتوني داكن ", olivedrab: "أسود فاتح ", orange: "برتقالي ", orangered: "أحمر مائل للبرتقالي ", orchid: "أرجواني فاتح ", palegoldenrod: "أصفر ذهبي شاحب ", palegreen: "أخضر شاحب ", paleturquoise: "تركواز شاحب ", palevioletred: "أحمر-بنفسجي شاحب ", papayawhip: "خوخي فاتح ", peachpuff: "خوخي مائل للأصفر ", peru: "بني جملي ", pink: "وردي ", plum: "أرجواني داكن ", powderblue: "أزرق مائل للأصفر ", purple: "ارجواني ", red: "أحمر ", rosybrown: "بني وردي ", royalblue: "أزرق ملكي ", saddlebrown: "بني فاتح ", salmon: "برتقالي وردي شاحب ", sandybrown: "بني مائل للصفرة ", seagreen: "أخضر مائل للأزرق ", seashell: "أبيض مائل للأصفر فاتح ", sienna: "بني محروق ", silver: "فضي ", skyblue: "أزرق سماوي ", slateblue: "أزرق اردوازي ", slategray: "رمادي اردوازي ", slategrey: "رمادي اردوازي ", // same as slategray snow: "أبيض ثلجي ", springgreen: "أخضر ربيعي ", steelblue: "أزرق معدني ", tan: "خمري ", teal: "بترولي ", thistle: "ارجواني شاحب ", tomato: "أحمر مائل للأصفر ", turquoise: "تركواز ", violet: "بنفسجي ", wheat: "أخضر قمحي ", white: "أبيض ", whitesmoke: "دخان أبيض ", yellow: "أصفر ", yellowgreen: "أخضر مائل للأصفر " })
$(function() { var resultCache = []; var allItems = $(".index .item"); $("#filter_text").keyup(function(){ var searchString = $(this).val(); allItems.addClass('visibility_hidden'); var items; if (resultCache[searchString] === undefined) { items = $(".index .item .text").textContains(searchString).parent().parent(); resultCache[searchString] = items; } else { items = resultCache[searchString]; } items.removeClass('visibility_hidden'); $("#numberFiltered").text(items.length); $("#numberFilteredText").text(items.length == 1 ? $T("author") : $T("authors")); }); $(".material_icon").each(function() { $(this).qtip({ style: { classes: 'material_tip' }, content: { text: $(this).siblings('.material_list') }, show: { event: 'click' }, hide: { event: 'unfocus' }, position: { my: 'top right', at: 'bottom left' } }); }); });
/** @odoo-module **/ export function isImg(node) { return (node && (node.nodeName === "IMG" || (node.className && node.className.match(/(^|\s)(media_iframe_video|o_image|fa)(\s|$)/i)))); } /** * Returns a list of all the ancestors nodes of the provided node. * * @param {Node} node * @param {Node} [stopElement] include to prevent bubbling up further than the stopElement. * @returns {HTMLElement[]} */ export function ancestors(node, stopElement) { if (!node || !node.parentElement || node === stopElement) return []; return [node.parentElement, ...ancestors(node.parentElement, stopElement)]; }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is JavaScript Engine testing utilities. * * The Initial Developer of the Original Code is * Netscape Communications Corp. * Portions created by the Initial Developer are Copyright (C) 2002 * the Initial Developer. All Rights Reserved. * * Contributor(s): * brendan@mozilla.org, pschwartau@netscape.com * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * * Date: 29 Oct 2002 * SUMMARY: Testing "use" and "set" operations on expressions like a[i][j][k] * See http://bugzilla.mozilla.org/show_bug.cgi?id=96526#c52 * * Brendan: "The idea is to cover all the 'use' and 'set' (as in modify) * operations you can do on an expression like a[i][j][k], including variations * where you replace |a| with arguments (literally) and |i| with 0, 1, 2, etc. * (to hit the optimization for arguments[0]... that uses JSOP_ARGSUB)." */ //----------------------------------------------------------------------------- var gTestfile = 'regress-96526-noargsub.js'; var UBound = 0; var BUGNUMBER = 96526; var summary = 'Testing "use" and "set" ops on expressions like a[i][j][k]'; var status = ''; var statusitems = []; var actual = ''; var actualvalues = []; var expect= ''; var expectedvalues = []; var z='magic'; Number.prototype.magic=42; status = inSection(1); actual = f(2,1,[-1,0,[1,2,[3,4]]]); expect = 42; addThis(); function f(j,k,a) { status = inSection(2); actual = formatArray(a[2]); expect = formatArray([1,2,[3,4]]); addThis(); status = inSection(3); actual = formatArray(a[2][j]); expect = formatArray([3,4]); addThis(); status = inSection(4); actual = a[2][j][k]; expect = 4; addThis(); status = inSection(5); actual = a[2][j][k][z]; expect = 42; addThis(); return a[2][j][k][z]; } //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function addThis() { statusitems[UBound] = status; actualvalues[UBound] = actual; expectedvalues[UBound] = expect; UBound++; } function test() { enterFunc('test'); printBugNumber(BUGNUMBER); printStatus(summary); for (var i=0; i<UBound; i++) { reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); } exitFunc ('test'); }
// |jit-test| error:TypeError if (!this.hasOwnProperty("TypedObject")) throw new TypeError(); new TypedObject.StructType(RegExp);
import { create, visitable } from 'ember-cli-page-object'; import editForm from 'vault/tests/pages/components/identity/edit-form'; export default create({ visit: visitable('/vault/access/identity/:item_type/aliases/add/:id'), editForm, });
// Generated by CoffeeScript 1.11.1 var Fetcher, ware; ware = require('ware'); Fetcher = (function() { function Fetcher() { this.ware = ware(); } Fetcher.prototype.args = function() { this.args = arguments; return this; }; Fetcher.prototype.use = function(operation) { this.ware.use(operation); return this; }; Fetcher.prototype.fetch = function(callback) { var args; args = [].slice.call(this.args); args.push(callback); return this.ware.run.apply(this.ware, args); }; Fetcher.prototype.getLayers = function() { return this.ware.fns; }; return Fetcher; })(); module.exports = { "new": function() { return new Fetcher; } };
var https = require( 'https' ), zlib = require( 'zlib' ), path = require( 'path' ), fs = require( 'fs' ); var count = 0; var resolved = 0; var outputs = []; var done; function check() { if (resolved === count) { normalize(); display(); } } function makeBar( length ) { var i = ''; while (i.length < length) { i += '='; } return i; } function normalize() { var i, max = 0, max2 = 0; for (i = 0; i < count; i++) { max = Math.max( max, outputs[i].gzip ); max2 = Math.max( max2, outputs[i].original ); } for (i = 0; i < count; i++) { outputs[i].bargraph = makeBar( (outputs[i].gzip / max) * 80 ); outputs[i].bargraph2 = makeBar( (outputs[i].original / max2) * 80 ); } } function display() { var i; for (i = 0; i < count; i++) { console.log( outputs[i].version + ' ' + outputs[i].gzip + ' ' + outputs[i].original ); console.log( 'gzip ' + outputs[i].bargraph ); console.log( 'orig ' + outputs[i].bargraph2 ); } done(); } function getSizeAtVersion( version, path ) { var data = '', op = {}, req = https.request( { host: 'raw.github.com', port: 443, path: '/timrwood/moment/' + version + path }, function( res ) { res.setEncoding( 'utf8' ); res.on( 'data', function( chunk ) { data += chunk; } ); res.on( 'end', function( e ) { zlib.gzip( data, function( error, result ) { op.version = version; op.gzip = result.length; op.original = data.length; resolved++; check(); } ); } ); } ); req.on( 'error', function( e ) { console.log( 'problem with request: ' + e.message ); } ); req.end(); count++; outputs.push( op ); } function getRemote() { var old_versions = '1.0.1 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.4.0'.split( ' ' ), new_versions = '1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.7.1'.split( ' ' ), i; for (i = 0; i < old_versions.length; i++) { getSizeAtVersion( old_versions[i], '/moment.min.js' ); } for (i = 0; i < new_versions.length; i++) { getSizeAtVersion( new_versions[i], '/min/moment.min.js' ); } } function getLocal() { count++; var op = {}; outputs.push( op ); fs.readFile( path.normalize( __dirname + '/../min/moment.min.js' ), 'utf8', function( err, data ) { if (err) { throw err; } zlib.gzip( data, function( error, result ) { op.version = '.next'; op.gzip = result.length; op.original = data.length; resolved++; check(); } ); } ); } module.exports = function( grunt ) { grunt.registerTask( 'history', 'Check the codebase filesize over different releases.', function() { done = this.async(); getRemote(); getLocal(); } ); };
/* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> Matthias Butz <matze@odinms.de> Jan Christian Meyer <vimes@odinms.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. You may not use, modify or distribute this program under any other version of the GNU Affero General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Jiyur Little Kid */ function start() { cm.sendNext("I miss my sister... she's always working at the palace as their servant and I only get to see her on Sundays. The King and Queen are so selfish."); cm.dispose(); }
/* Copyright 2011, AUTHORS.txt (http://ui.operamasks.org/about) Dual licensed under the MIT or LGPL Version 2 licenses. */ (function() { OMEDITOR.plugins.add( 'templates', { requires : [ 'dialog' ], init : function( editor ) { OMEDITOR.dialog.add( 'templates', OMEDITOR.getUrl( this.path + 'dialogs/templates.js' ) ); editor.addCommand( 'templates', new OMEDITOR.dialogCommand( 'templates' ) ); editor.ui.addButton( 'Templates', { label : editor.lang.templates.button, command : 'templates' }); } }); var templates = {}, loadedTemplatesFiles = {}; OMEDITOR.addTemplates = function( name, definition ) { templates[ name ] = definition; }; OMEDITOR.getTemplates = function( name ) { return templates[ name ]; }; OMEDITOR.loadTemplates = function( templateFiles, callback ) { // Holds the templates files to be loaded. var toLoad = []; // Look for pending template files to get loaded. for ( var i = 0, count = templateFiles.length ; i < count ; i++ ) { if ( !loadedTemplatesFiles[ templateFiles[ i ] ] ) { toLoad.push( templateFiles[ i ] ); loadedTemplatesFiles[ templateFiles[ i ] ] = 1; } } if ( toLoad.length ) OMEDITOR.scriptLoader.load( toLoad, callback ); else setTimeout( callback, 0 ); }; })(); /** * The templates definition set to use. It accepts a list of names separated by * comma. It must match definitions loaded with the templates_files setting. * @type String * @default 'default' * @example * config.templates = 'my_templates'; */ /** * The list of templates definition files to load. * @type (String) Array * @default [ 'plugins/templates/templates/default.js' ] * @example * config.templates_files = * [ * '/editor_templates/site_default.js', * 'http://www.example.com/user_templates.js * ]; * */ OMEDITOR.config.templates_files = [ OMEDITOR.getUrl( '_source/' + // @Packager.RemoveLine 'plugins/templates/templates/default.js' ) ]; /** * Whether the "Replace actual contents" checkbox is checked by default in the * Templates dialog. * @type Boolean * @default true * @example * config.templates_replaceContent = false; */ OMEDITOR.config.templates_replaceContent = true;
$(document).ready(function() { //extract the data from the table var data = new Object(); $('tr').each(function(index, elem) { var sel = $(this).children(); data[sel.eq(0).text()] = sel.eq(1).text(); }) // remove the table $('#data').remove(); // });
/// 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.3/15.3.4/15.3.4.5/15.3.4.5-13.b-4.js * @description Function.prototype.bind, 'length' set to remaining number of expected args (target takes 0 args) */ function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); if (bf.length === 0) { return true; } } runTestCase(testcase);
/** * Copyright 2016 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS-IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {validateData, writeScript} from '../../3p/3p'; /** * @param {!Window} global * @param {!Object} data */ export function yahoo(global, data) { validateData(data, ['sid', 'site', 'sa']); global.yadData = data; writeScript(global, 'https://s.yimg.com/aaq/ampad/display.js'); }
import { test } from 'ember-qunit'; import moduleForComponent from 'open-event-frontend/tests/helpers/component-helper'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('ui-table/global-filter', 'Integration | Component | ui table/global filter'); const messages = { searchPlaceholder: 'Search' }; test('it renders', function(assert) { this.set('messages', messages); this.render(hbs `{{ui-table/global-filter messages=messages}}`); assert.ok(this.$().html().trim().includes('Search')); });
/// 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.2/15.2.3/15.2.3.6/15.2.3.6-3-80.js * @description Object.defineProperty - 'configurable' property in 'Attributes' is an inherited accessor property (8.10.5 step 4.a) */ function testcase() { var obj = {}; var proto = {}; Object.defineProperty(proto, "configurable", { get: function () { return true; } }); var ConstructFun = function () { }; ConstructFun.prototype = proto; var child = new ConstructFun(); Object.defineProperty(obj, "property", child); var beforeDeleted = obj.hasOwnProperty("property"); delete obj.property; var afterDeleted = obj.hasOwnProperty("property"); return beforeDeleted === true && afterDeleted === false; } runTestCase(testcase);
/* eg: Box.show(div) */ var Box = { show: function (id) { var isIE = (document.all) ? true : false; var isIE6 = isIE && ( [/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6); var box = document.getElementById(id); if (!box) { return; } box.style.zIndex = "9999"; box.style.display = "block" box.style.position = !isIE6 ? "fixed" : "absolute"; box.style.top = box.style.left = "50%"; box.style.marginTop = -box.offsetHeight / 2 + "px"; box.style.marginLeft = -box.offsetWidth / 2 + "px"; var layer = document.getElementById("_box_layer"); if (!layer) { layer = document.createElement("div"); layer.id = "_box_layer"; layer.style.width = layer.style.height = "100%"; layer.style.position = !isIE6 ? "fixed" : "absolute"; layer.style.top = layer.style.left = 0; layer.style.backgroundColor = "#000"; layer.style.zIndex = "9998"; layer.style.opacity = "0.6"; document.body.appendChild(layer); } else { layer.style.display = ""; } var selects = document.getElementsByTagName("select"); if (selects) { for (var i = 0; i < selects.length; i++) { selects[i].style.visibility = "hidden"; } } function layer_iestyle() { layer.style.width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) + "px"; layer.style.height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px"; } function box_iestyle() { box.style.marginTop = document.documentElement.scrollTop - box.offsetHeight / 2 + "px"; box.style.marginLeft = document.documentElement.scrollLeft - box.offsetWidth / 2 + "px"; } if (isIE) { layer.style.filter = "alpha(opacity=60)"; } if (isIE6) { layer_iestyle() box_iestyle(); window.attachEvent("onscroll", function () { box_iestyle(); }) window.attachEvent("onresize", layer_iestyle) } }, hide: function (id) { var box = document.getElementById(id); if (box) { box.style.display = "none"; } var layer = document.getElementById("_box_layer"); if (layer) { layer.style.display = "none"; } var selects = document.getElementsByTagName("select"); if (selects) { for (var i = 0; i < selects.length; i++) { selects[i].style.visibility = "visible"; } } } }
/* YUI 3.6.0 (build 5521) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("widget-skin",function(e){var d="boundingBox",b="contentBox",a="skin",c=e.ClassNameManager.getClassName;e.Widget.prototype.getSkinName=function(){var f=this.get(b)||this.get(d),h=new RegExp("\\b"+c(a)+"-(\\S+)"),g;if(f){f.ancestor(function(i){g=i.get("className").match(h);return g;});}return(g)?g[1]:null;};},"3.6.0",{requires:["widget-base"]});
//baidu var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F4233e74dff0ae5bd0a3d81c6ccf756e6' type='text/javascript'%3E%3C/script%3E")); //google analytics (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); /* ga('create', 'UA-41268416-1', 'lagou.com'); ga('send', 'pageview');*/ ga('create', 'UA-41268416-1', 'lagou.com', { 'allowLinker': true }); ga('require', 'linker'); ga('linker:autoLink', ['lagoujobs.com'],true ); ga('send', 'pageview');
// Copyright 2016 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. cr.define('user_manager.import_supervised_user_tests', function() { function registerTests() { suite('ImportSupervisedUserTests', function() { /** @type {?ImportSupervisedUserElement} */ var importElement = null; /** * @param {!HTMLElement} element * @return {string} */ var getProfileName = function(element) { return element.querySelector('.profile-name').textContent.trim(); } setup(function() { importElement = document.createElement('import-supervised-user'); document.body.appendChild(importElement); // Make sure DOM is up to date. Polymer.dom.flush(); }); teardown(function(done) { importElement.remove(); // Allow asynchronous tasks to finish. setTimeout(done); }); test('Dialog does not show if no signed-in user is provided', function() { // The dialog is initially not visible. assertFalse(importElement.$.dialog.opened); importElement.show(undefined, []); Polymer.dom.flush(); // The dialog is still not visible. assertFalse(importElement.$.dialog.opened); }); test('Can import supervised user', function() { return new Promise(function(resolve, reject) { /** @type {!SignedInUser} */ var signedInUser = {username: 'username', profilePath: 'path/to/profile'}; /** @type {!Array<!SupervisedUser>} */ var supervisedUsers = [{name: 'supervised user 1', onCurrentDevice: true}, {name: 'supervised user 3', onCurrentDevice: false}, {name: 'supervised user 2', onCurrentDevice: false}]; // Expect an event to import the selected supervised user to be fired. importElement.addEventListener('import', function(event) { if (event.detail.signedInUser == signedInUser && event.detail.supervisedUser.name == 'supervised user 2') { Polymer.dom.flush(); // The dialog is no longer visible. assertFalse(importElement.$.dialog.opened); resolve(); } }); // The dialog is initially not visible. assertFalse(importElement.$.dialog.opened); importElement.show(signedInUser, supervisedUsers); Polymer.dom.flush(); // The dialog becomes visible. assertTrue(importElement.$.dialog.opened); // The correct message is displayed. assertEquals(loadTimeData.getString('supervisedUserImportText'), importElement.$$('#message').textContent.trim()); var selectorElement = importElement.$$('paper-listbox'); assertTrue(!!selectorElement); // Supervised users are ordered correctly (Ones that are not on the // current device appear first, then they are alphabetically order in // ascending order). var items = selectorElement.querySelectorAll('paper-item'); assertEquals(3, items.length); assertEquals('supervised user 2', getProfileName(items[0])); assertEquals('supervised user 3', getProfileName(items[1])); assertEquals('supervised user 1', getProfileName(items[2])); // Supervised users that are on this device are disabled. var selectableItems = selectorElement.querySelectorAll('[disabled]'); assertEquals(1, selectableItems.length); assertEquals('supervised user 1', getProfileName(selectableItems[0])); // No user is initially selected. assertEquals(-1, selectorElement.selected); // The import button is disabled if no supervised user is selected. assertTrue(importElement.$$('#import').disabled); // Simulate selecting the third user which is disabled. MockInteractions.tap(items[2]); // Confirm no user is selected. assertEquals(-1, selectorElement.selected); // Simulate selecting the first user. MockInteractions.tap(items[0]); // Confirm the user is selected. assertEquals(0, selectorElement.selected); // The import button becomes enabled once a user is selected. assertFalse(importElement.$$('#import').disabled); // Simulate clicking 'Import'. MockInteractions.tap(importElement.$$('#import')); }); }); }); } return { registerTests: registerTests, }; });
//= require admin/spree_backend
const {addTable} = require('../../utils'); module.exports = addTable('snippets');
var inspector = require('../'); // Custom type schema var personValidation = { type: 'object', properties: { firstname: { type: 'string', minLength: 1 }, lastname: { type: 'string', minLength: 1 }, age: { type: 'integer', gt: 0, lte: 120 } } }; // Custom Validation ($type) var customValidation = { // $type will be like type but with an additional possible value "person" type: function (schema, candidate) { var result; // Custom type if (schema.$type === 'person') result = inspector.validate(personValidation, candidate); // Basic type else result = inspector.validate({ type: schema.$type }, candidate); if (!result.valid) return this.report(result.format()); } }; // Extend SchemaInspector.Validator inspector.Validation.extend(customValidation); var data = { firstname: ' sebastien ', lastname: 'chopin ', age: '21' }; var schema = { $type: 'person' }; var result = inspector.validate(schema, data); if (!result.valid) console.log(result.format()); // Property @.age: must be integer, but is string
/** * Module dependencies. */ var Emitter = require('emitter'); var render = require('render'); var events = require('events'); var empty = require('empty'); var filter = require('laws-filter'); var template = require('./filter-container'); var o = require('query'); var closest = require('closest'); var classes = require('classes'); function FilterView() { if (!(this instanceof FilterView)) { return new FilterView(); }; // Prep event handlers this.refresh = this.refresh.bind(this); this.build(); this.switchOn(); } Emitter(FilterView.prototype); FilterView.prototype.build = function() { this.el = render.dom(template, { filter: filter }); }; FilterView.prototype.switchOn = function() { // View events this.events = events(this.el, this); this.events.bind('click #status-filter a.btn', 'onstatusclick'); this.events.bind('click #sort-filter ul li', 'onsortclick'); this.events.bind('click #hide-voted-filter input[name=hide-voted]', 'onhidevotedclick'); // Behavior events filter.on('change', this.refresh); } FilterView.prototype.switchOff = function() { this.events.unbind(); filter.off('change', this.refresh); } FilterView.prototype.refresh = function() { var old = this.el; this.switchOff(); this.build(); this.switchOn(); if (old.parentNode) old.parentNode.replaceChild(this.el, old); old.remove(); var obj = o('li[data-sort="closing-soon"]', this.el); if (filter.get('status') == 'closed') { classes(obj).add('hide'); if (filter.get('sort') == 'closing-soon') filter.set('sort', 'newest-first'); } else { classes(obj).remove('hide'); } }; FilterView.prototype.onstatusclick = function(ev) { ev.preventDefault(); var target = ev.delegateTarget || closest(ev.target, '[data-status]', true); var status = target.getAttribute('data-status'); filter.set('status', status); } FilterView.prototype.onsortclick = function(ev) { ev.preventDefault(); var target = ev.delegateTarget || closest(ev.target, '[data-sort]', true); var sort = target.getAttribute('data-sort'); filter.set('sort', sort); } FilterView.prototype.onhidevotedclick = function(ev) { ev.preventDefault(); var target = ev.delegateTarget || closest(ev.target, '[type=checkbox]', true); var checked = !!target.checked; filter.set('hide-voted', checked); } FilterView.prototype.ready = function(fn) { filter.ready(fn); filter.ready(this.refresh); } FilterView.prototype.render = function(el) { if (1 === arguments.length) { // if string, then query element if ('string' === typeof el) { el = o(el); }; // if it's not currently inserted // at `el`, then append to `el` if (el !== this.el.parentNode) { el.appendChild(this.el); }; // !!!: Should we return different things // on different conditions? // Or should we be consistent with // render returning always `this.el` return this; }; return this.el; } module.exports = new FilterView();
var ModelForm = { init: function(options) { var ops = $.extend(true, this.getDefaultOptions(), options); Validation.init(ops); }, getDefaultOptions: function() { return { src: '.form', isAjax: false, submitAjax: function(validation) { // }, validate: { rules: { name: { required: true } }, messages: messagesOfRules } } } };
import React, { Component } from "react"; import Home from "../components/home/"; import BlankPage2 from "../components/blankPage2"; import { DrawerNavigator } from "react-navigation"; import DrawBar from "../components/DrawBar"; export default (DrawNav = DrawerNavigator( { Home: { screen: Home }, BlankPage2: { screen: BlankPage2 } }, { contentComponent: props => <DrawBar {...props} /> } ));
describe('Demo test with Mocha', function() { describe('for testing purposes', function() { before(function(client, done) { client.globals.test_calls++; done(); }); after(function(client, done) { setTimeout(function() { client.globals.test_calls++; done(); }, 100); }); afterEach(function(client, done) { setTimeout(function() { client.globals.test_calls++; done(); }, 100); }); beforeEach(function(client, done) { setTimeout(function() { client.globals.test_calls++; done(); }, 100); }); it('demoTestAsyncOne', function(client) { client.url('http://localhost'); }); it('demoTestAsyncTwo', function(client) { client.end(); }); }); });
;(function (global) { if ("EventSource" in global) return; var reTrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g; var EventSource = function (url) { var eventsource = this, interval = 500, // polling interval lastEventId = null, cache = ''; if (!url || typeof url != 'string') { throw new SyntaxError('Not enough arguments'); } this.URL = url; this.readyState = this.CONNECTING; this._pollTimer = null; this._xhr = null; function pollAgain(interval) { eventsource._pollTimer = setTimeout(function () { poll.call(eventsource); }, interval); } function poll() { try { // force hiding of the error message... insane? if (eventsource.readyState == eventsource.CLOSED) return; // NOTE: IE7 and upwards support var xhr = new XMLHttpRequest(); xhr.open('GET', eventsource.URL, true); xhr.setRequestHeader('Accept', 'text/event-stream'); xhr.setRequestHeader('Cache-Control', 'no-cache'); // we must make use of this on the server side if we're working with Android - because they don't trigger // readychange until the server connection is closed xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); if (lastEventId != null) xhr.setRequestHeader('Last-Event-ID', lastEventId); cache = ''; xhr.timeout = 50000; xhr.onreadystatechange = function () { if ((this.readyState == 3 || this.readyState == 4) && this.status == 200) { // on success if (eventsource.readyState == eventsource.CONNECTING) { eventsource.readyState = eventsource.OPEN; eventsource.dispatchEvent('open', { type: 'open' }); } var responseText = ''; try { responseText = this.responseText || ''; } catch (e) {} // process this.responseText var parts = responseText.substr(cache.length).split("\n"), eventType = 'message', data = [], i = 0, line = ''; cache = responseText; // TODO handle 'event' (for buffer name), retry for (; i < parts.length; i++) { line = parts[i].replace(reTrim, ''); if (line.indexOf('event') == 0) { eventType = line.replace(/event:?\s*/, ''); } else if (line.indexOf('retry') == 0) { retry = parseInt(line.replace(/retry:?\s*/, '')); if(!isNaN(retry)) { interval = retry; } } else if (line.indexOf('data') == 0) { data.push(line.replace(/data:?\s*/, '')); } else if (line.indexOf('id:') == 0) { lastEventId = line.replace(/id:?\s*/, ''); } else if (line.indexOf('id') == 0) { // this resets the id lastEventId = null; } else if (line == '') { if (data.length) { var event = new MessageEvent(data.join('\n'), eventsource.url, lastEventId); eventsource.dispatchEvent(eventType, event); data = []; eventType = 'message'; } } } if (this.readyState == 4) pollAgain(interval); // don't need to poll again, because we're long-loading } else if (eventsource.readyState !== eventsource.CLOSED) { if (this.readyState == 4) { // and some other status // dispatch error eventsource.readyState = eventsource.CONNECTING; eventsource.dispatchEvent('error', { type: 'error' }); pollAgain(interval); } else if (this.readyState == 0) { // likely aborted pollAgain(interval); } else { } } }; xhr.send(); setTimeout(function () { if (true || xhr.readyState == 3) xhr.abort(); }, xhr.timeout); eventsource._xhr = xhr; } catch (e) { // in an attempt to silence the errors eventsource.dispatchEvent('error', { type: 'error', data: e.message }); // ??? } }; poll(); // init now }; EventSource.prototype = { close: function () { // closes the connection - disabling the polling this.readyState = this.CLOSED; clearInterval(this._pollTimer); this._xhr.abort(); }, CONNECTING: 0, OPEN: 1, CLOSED: 2, dispatchEvent: function (type, event) { var handlers = this['_' + type + 'Handlers']; if (handlers) { for (var i = 0; i < handlers.length; i++) { handlers[i].call(this, event); } } if (this['on' + type]) { this['on' + type].call(this, event); } }, addEventListener: function (type, handler) { if (!this['_' + type + 'Handlers']) { this['_' + type + 'Handlers'] = []; } this['_' + type + 'Handlers'].push(handler); }, removeEventListener: function () { // TODO }, onerror: null, onmessage: null, onopen: null, readyState: 0, URL: '' }; var MessageEvent = function (data, origin, lastEventId) { this.data = data; this.origin = origin; this.lastEventId = lastEventId || ''; }; MessageEvent.prototype = { data: null, type: 'message', lastEventId: '', origin: '' }; if ('module' in global) module.exports = EventSource; global.EventSource = EventSource; })(this);
import { RocketChat } from 'meteor/rocketchat:lib'; import { Random } from 'meteor/random'; import _ from 'underscore'; import s from 'underscore.string'; import hljs from 'highlight.js'; import _marked from 'marked'; const renderer = new _marked.Renderer(); let msg = null; renderer.code = function(code, lang, escaped) { if (this.options.highlight) { const out = this.options.highlight(code, lang); if (out != null && out !== code) { escaped = true; code = out; } } let text = null; if (!lang) { text = `<pre><code class="code-colors hljs">${ (escaped ? code : s.escapeHTML(code, true)) }</code></pre>`; } else { text = `<pre><code class="code-colors hljs ${ escape(lang, true) }">${ (escaped ? code : s.escapeHTML(code, true)) }</code></pre>`; } if (_.isString(msg)) { return text; } const token = `=!=${ Random.id() }=!=`; msg.tokens.push({ highlight: true, token, text }); return token; }; renderer.codespan = function(text) { text = `<code class="code-colors inline">${ text }</code>`; if (_.isString(msg)) { return text; } const token = `=!=${ Random.id() }=!=`; msg.tokens.push({ token, text }); return token; }; renderer.blockquote = function(quote) { return `<blockquote class="background-transparent-darker-before">${ quote }</blockquote>`; }; const highlight = function(code, lang) { if (!lang) { return code; } try { return hljs.highlight(lang, code).value; } catch (e) { // Unknown language return code; } }; let gfm = null; let tables = null; let breaks = null; let pedantic = null; let smartLists = null; let smartypants = null; export const marked = (message) => { msg = message; if (!msg.tokens) { msg.tokens = []; } if (gfm == null) { gfm = RocketChat.settings.get('Markdown_Marked_GFM'); } if (tables == null) { tables = RocketChat.settings.get('Markdown_Marked_Tables'); } if (breaks == null) { breaks = RocketChat.settings.get('Markdown_Marked_Breaks'); } if (pedantic == null) { pedantic = RocketChat.settings.get('Markdown_Marked_Pedantic'); } if (smartLists == null) { smartLists = RocketChat.settings.get('Markdown_Marked_SmartLists'); } if (smartypants == null) { smartypants = RocketChat.settings.get('Markdown_Marked_Smartypants'); } msg.html = _marked(s.unescapeHTML(msg.html), { gfm, tables, breaks, pedantic, smartLists, smartypants, renderer, sanitize: true, highlight }); return msg; };
define('lodash/lang/isEqual', ['exports', 'lodash/internal/baseIsEqual', 'lodash/internal/bindCallback'], function (exports, _lodashInternalBaseIsEqual, _lodashInternalBindCallback) { 'use strict'; /** * Performs a deep comparison between two values to determine if they are * equivalent. If `customizer` is provided it's invoked to compare values. * If `customizer` returns `undefined` comparisons are handled by the method * instead. The `customizer` is bound to `thisArg` and invoked with up to * three arguments: (value, other [, index|key]). * * **Note:** This method supports comparing arrays, booleans, `Date` objects, * numbers, `Object` objects, regexes, and strings. Objects are compared by * their own, not inherited, enumerable properties. Functions and DOM nodes * are **not** supported. Provide a customizer function to extend support * for comparing other values. * * @static * @memberOf _ * @alias eq * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize value comparisons. * @param {*} [thisArg] The `this` binding of `customizer`. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'user': 'fred' }; * var other = { 'user': 'fred' }; * * object == other; * // => false * * _.isEqual(object, other); * // => true * * // using a customizer callback * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqual(array, other, function(value, other) { * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { * return true; * } * }); * // => true */ function isEqual(value, other, customizer, thisArg) { customizer = typeof customizer == 'function' ? (0, _lodashInternalBindCallback['default'])(customizer, thisArg, 3) : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? (0, _lodashInternalBaseIsEqual['default'])(value, other, customizer) : !!result; } exports['default'] = isEqual; });
'use strict'; const styles = require('./styles'); const permsToString = require('./perms-to-string'); const sizeToString = require('./size-to-string'); const sortFiles = require('./sort-files'); const fs = require('fs'); const path = require('path'); const he = require('he'); const etag = require('../etag'); const url = require('url'); const status = require('../status-handlers'); const supportedIcons = styles.icons; const css = styles.css; module.exports = (opts) => { // opts are parsed by opts.js, defaults already applied const cache = opts.cache; const root = path.resolve(opts.root); const baseDir = opts.baseDir; const humanReadable = opts.humanReadable; const hidePermissions = opts.hidePermissions; const handleError = opts.handleError; const showDotfiles = opts.showDotfiles; const si = opts.si; const weakEtags = opts.weakEtags; return function middleware(req, res, next) { // Figure out the path for the file from the given url const parsed = url.parse(req.url); const pathname = decodeURIComponent(parsed.pathname); const dir = path.normalize( path.join( root, path.relative( path.join('/', baseDir), pathname ) ) ); fs.stat(dir, (statErr, stat) => { if (statErr) { if (handleError) { status[500](res, next, { error: statErr }); } else { next(); } return; } // files are the listing of dir fs.readdir(dir, (readErr, _files) => { let files = _files; if (readErr) { if (handleError) { status[500](res, next, { error: readErr }); } else { next(); } return; } // Optionally exclude dotfiles from directory listing. if (!showDotfiles) { files = files.filter(filename => filename.slice(0, 1) !== '.'); } res.setHeader('content-type', 'text/html'); res.setHeader('etag', etag(stat, weakEtags)); res.setHeader('last-modified', (new Date(stat.mtime)).toUTCString()); res.setHeader('cache-control', cache); function render(dirs, renderFiles, lolwuts) { // each entry in the array is a [name, stat] tuple let html = `${[ '<!doctype html>', '<html>', ' <head>', ' <meta charset="utf-8">', ' <meta name="viewport" content="width=device-width">', ` <title>Index of ${he.encode(pathname)}</title>`, ` <style type="text/css">${css}</style>`, ' </head>', ' <body>', `<h1>Index of ${he.encode(pathname)}</h1>`, ].join('\n')}\n`; html += '<table>'; const failed = false; const writeRow = (file) => { // render a row given a [name, stat] tuple const isDir = file[1].isDirectory && file[1].isDirectory(); let href = `${parsed.pathname.replace(/\/$/, '')}/${encodeURIComponent(file[0])}`; // append trailing slash and query for dir entry if (isDir) { href += `/${he.encode((parsed.search) ? parsed.search : '')}`; } const displayName = he.encode(file[0]) + ((isDir) ? '/' : ''); const ext = file[0].split('.').pop(); const classForNonDir = supportedIcons[ext] ? ext : '_page'; const iconClass = `icon-${isDir ? '_blank' : classForNonDir}`; // TODO: use stylessheets? html += `${'<tr>' + '<td><i class="icon '}${iconClass}"></i></td>`; if (!hidePermissions) { html += `<td class="perms"><code>(${permsToString(file[1])})</code></td>`; } html += `<td class="file-size"><code>${sizeToString(file[1], humanReadable, si)}</code></td>` + `<td class="display-name"><a href="${href}">${displayName}</a></td>` + '</tr>\n'; }; dirs.sort((a, b) => a[0].toString().localeCompare(b[0].toString())).forEach(writeRow); renderFiles.sort((a, b) => a.toString().localeCompare(b.toString())).forEach(writeRow); lolwuts.sort((a, b) => a[0].toString().localeCompare(b[0].toString())).forEach(writeRow); html += '</table>\n'; html += `<br><address>Node.js ${ process.version }/ <a href="https://github.com/jfhbrook/node-ecstatic">ecstatic</a> ` + `server running @ ${ he.encode(req.headers.host || '')}</address>\n` + '</body></html>' ; if (!failed) { res.writeHead(200, { 'Content-Type': 'text/html' }); res.end(html); } } sortFiles(dir, files, (lolwuts, dirs, sortedFiles) => { // It's possible to get stat errors for all sorts of reasons here. // Unfortunately, our two choices are to either bail completely, // or just truck along as though everything's cool. In this case, // I decided to just tack them on as "??!?" items along with dirs // and files. // // Whatever. // if it makes sense to, add a .. link if (path.resolve(dir, '..').slice(0, root.length) === root) { fs.stat(path.join(dir, '..'), (err, s) => { if (err) { if (handleError) { status[500](res, next, { error: err }); } else { next(); } return; } dirs.unshift(['..', s]); render(dirs, sortedFiles, lolwuts); }); } else { render(dirs, sortedFiles, lolwuts); } }); }); }); }; };
'use strict' const assert = require('assert') const http = require('http') const https = require('https') const { kState, kOptions } = require('./symbols') const { codes: { FST_ERR_HTTP2_INVALID_VERSION } } = require('./errors') function createServer (options, httpHandler) { assert(options, 'Missing options') assert(httpHandler, 'Missing http handler') var server = null if (options.serverFactory) { server = options.serverFactory(httpHandler, options) } else if (options.https) { if (options.http2) { server = http2().createSecureServer(options.https, httpHandler) } else { server = https.createServer(options.https, httpHandler) } } else if (options.http2) { server = http2().createServer(httpHandler) server.on('session', sessionTimeout(options.http2SessionTimeout)) } else { server = http.createServer(httpHandler) } return { server, listen } // `this` is the Fastify object function listen () { const normalizeListenArgs = (args) => { if (args.length === 0) { return { port: 0, host: 'localhost' } } const cb = typeof args[args.length - 1] === 'function' ? args.pop() : undefined const options = { cb: cb } const firstArg = args[0] const argsLength = args.length const lastArg = args[argsLength - 1] /* Deal with listen (options) || (handle[, backlog]) */ if (typeof firstArg === 'object' && firstArg !== null) { options.backlog = argsLength > 1 ? lastArg : undefined Object.assign(options, firstArg) } else if (typeof firstArg === 'string' && isNaN(firstArg)) { /* Deal with listen (pipe[, backlog]) */ options.path = firstArg options.backlog = argsLength > 1 ? lastArg : undefined } else { /* Deal with listen ([port[, host[, backlog]]]) */ options.port = argsLength >= 1 && firstArg ? firstArg : 0 // This will listen to what localhost is. // It can be 127.0.0.1 or ::1, depending on the operating system. // Fixes https://github.com/fastify/fastify/issues/1022. options.host = argsLength >= 2 && args[1] ? args[1] : 'localhost' options.backlog = argsLength >= 3 ? args[2] : undefined } return options } const listenOptions = normalizeListenArgs(Array.from(arguments)) const cb = listenOptions.cb const wrap = err => { server.removeListener('error', wrap) if (!err) { const address = logServerAddress() cb(null, address) } else { this[kState].listening = false cb(err, null) } } const listenPromise = (listenOptions) => { if (this[kState].listening) { return Promise.reject(new Error('Fastify is already listening')) } return this.ready().then(() => { var errEventHandler var errEvent = new Promise((resolve, reject) => { errEventHandler = (err) => { this[kState].listening = false reject(err) } server.once('error', errEventHandler) }) var listen = new Promise((resolve, reject) => { server.listen(listenOptions, () => { server.removeListener('error', errEventHandler) resolve(logServerAddress()) }) // we set it afterwards because listen can throw this[kState].listening = true }) return Promise.race([ errEvent, // e.g invalid port range error is always emitted before the server listening listen ]) }) } const logServerAddress = () => { var address = server.address() const isUnixSocket = typeof address === 'string' if (!isUnixSocket) { if (address.address.indexOf(':') === -1) { address = address.address + ':' + address.port } else { address = '[' + address.address + ']:' + address.port } } address = (isUnixSocket ? '' : ('http' + (this[kOptions].https ? 's' : '') + '://')) + address this.log.info('Server listening at ' + address) return address } if (cb === undefined) return listenPromise(listenOptions) this.ready(err => { if (err != null) return cb(err) if (this[kState].listening) { return cb(new Error('Fastify is already listening'), null) } server.once('error', wrap) server.listen(listenOptions, wrap) this[kState].listening = true }) } } function http2 () { try { return require('http2') } catch (err) { throw new FST_ERR_HTTP2_INVALID_VERSION() } } function sessionTimeout (timeout) { return function (session) { session.setTimeout(timeout, close) } } function close () { this.close() } module.exports = { createServer }
OW_FriendRequest = function( itemKey, params ) { var listLoaded = false; var model = OW.Console.getData(itemKey); var list = OW.Console.getItem(itemKey); var counter = new OW_DataModel(); counter.addObserver(this); this.onDataChange = function( data ) { var newCount = data.get('new'); var counterNumber = newCount > 0 ? newCount : data.get('all'); list.setCounter(counterNumber, newCount > 0); if ( counterNumber > 0 ) { list.showItem(); } }; list.onHide = function() { counter.set('new', 0); list.getItems().removeClass('ow_console_new_message'); model.set('counter', counter.get()); }; list.onShow = function() { if ( counter.get('all') <= 0 ) { this.showNoContent(); return; } if ( counter.get('new') > 0 || !listLoaded ) { this.loadList(); listLoaded = true; } }; model.addObserver(function() { if ( !list.opened ) { counter.set(model.get('counter')); } }); this.accept = function( requestKey, userId ) { var item = list.getItem(requestKey); var c = {}; if ( item.hasClass('ow_console_new_message') ) { c["new"] = counter.get("new") - 1; } c["all"] = counter.get("all") - 1; counter.set(c); this.send('friends-accept', {id: userId}); $('#friend_request_accept_'+userId).addClass( "ow_hidden"); $('#friend_request_ignore_'+userId).addClass( "ow_hidden"); return this; }; this.ignore = function( requestKey, userId ) { var item = list.getItem(requestKey); var c = {}; this.send('friends-ignore', {id: userId}); if ( item.hasClass('ow_console_new_message') ) { c["new"] = counter.get("new") - 1; } c["all"] = counter.get("all") - 1; counter.set(c); list.removeItem(item); return this; }; this.send = function( command, data ) { var request = $.ajax({ url: params.rsp, type: "POST", data: { "command": command, "data": JSON.stringify(data) }, dataType: "json" }); request.done(function( res ) { if ( res && res.script ) { OW.addScript(res.script); } }); return this; }; } OW.FriendRequest = null;
jQuery(document).ready(function($) { $(".zilla-tabs").tabs(); $(".zilla-toggle").each( function () { var $this = $(this); if( $this.attr('data-id') == 'closed' ) { $this.accordion({ header: '.zilla-toggle-title', collapsible: true, active: false }); } else { $this.accordion({ header: '.zilla-toggle-title', collapsible: true}); } $this.on('accordionactivate', function( e, ui ) { $this.accordion('refresh'); }); $(window).on('resize', function() { $this.accordion('refresh'); }); }); });
;(function (window, document) { 'use strict'; /** * Global storage manager * * The storage manager provides a unified way to store items in the localStorage and sessionStorage. * It uses a polyfill that uses cookies as a fallback when no localStorage or sessionStore is available or working. * * @example * * Saving an item to localStorage: * * StorageManager.setItem('local', 'key', 'value'); * * Retrieving it: * * var item = StorageManager.getItem('local', 'key'); // item === 'value' * * Basically you can use every method of the Storage interface (http://www.w3.org/TR/webstorage/#the-storage-interface) * But notice that you have to pass the storage type ('local' | 'session') in the first parameter for every call. * * @example * * Getting the localStorage/sessionStorage (polyfill) object * * var localStorage = StorageManager.getStorage('local'); * var sessionStorage = StorageManager.getStorage('session'); * * You can also use its shorthands: * * var localStorage = StorageManager.getLocalStorage(); * var sessionStorage = StorageManager.getSessionStorage(); */ window.StorageManager = (function () { var storage = { local: window.localStorage, session: window.sessionStorage }, p; /** * Helper function to detect if cookies are enabled. * @returns {boolean} */ function hasCookiesSupport() { // if cookies are already present assume cookie support if ('cookie' in document && (document.cookie.length > 0)) { return true; } document.cookie = 'testcookie=1;'; var writeTest = (document.cookie.indexOf('testcookie') !== -1); document.cookie = 'testcookie=1' + ';expires=Sat, 01-Jan-2000 00:00:00 GMT'; return writeTest; } // test for safari's "QUOTA_EXCEEDED_ERR: DOM Exception 22" issue. for (p in storage) { if (!storage.hasOwnProperty(p)) { continue; } try { storage[p].setItem('storage', ''); storage[p].removeItem('storage'); } catch (err) { } } // Just return the public API instead of all available functions return { /** * Returns the storage object/polyfill of the given type. * * @returns {Storage|StoragePolyFill} */ getStorage: function (type) { return storage[type]; }, /** * Returns the sessionStorage object/polyfill. * * @returns {Storage|StoragePolyFill} */ getSessionStorage: function () { return this.getStorage('session'); }, /** * Returns the localStorage object/polyfill. * * @returns {Storage|StoragePolyFill} */ getLocalStorage: function () { return this.getStorage('local'); }, /** * Calls the clear() method of the storage from the given type. * * @param {String} type */ clear: function (type) { this.getStorage(type).clear(); }, /** * Calls the getItem() method of the storage from the given type. * * @param {String} type * @param {String} key * @returns {String} */ getItem: function (type, key) { return this.getStorage(type).getItem(key); }, /** * Calls the key() method of the storage from the given type. * * @param {String} type * @param {Number|String} i * @returns {String} */ key: function (type, i) { return this.getStorage(type).key(i); }, /** * Calls the removeItem() method of the storage from the given type. * * @param {String} type * @param {String} key */ removeItem: function (type, key) { this.getStorage(type).removeItem(key); }, /** * Calls the setItem() method of the storage from the given type. * * @param {String} type * @param {String} key * @param {String} value */ setItem: function (type, key, value) { this.getStorage(type).setItem(key, value); }, /** * Helper function call to check if cookies are enabled. */ hasCookiesSupport: hasCookiesSupport() }; })(); })(window, document);
// [Name] SVGFECompositeElement-dom-k1-attr.js // [Expected rendering result] Four circle with different opacity merged with feComposite filter - and a series of PASS messages description("Tests dynamic updates of the 'k1' attribute of the SVGFECompositeElement object") createSVGTestCase(); var defsElement = createSVGElement("defs"); rootSVGElement.appendChild(defsElement); var off1 = createSVGElement("feOffset"); off1.setAttribute("dx", "35"); off1.setAttribute("dy", "25"); off1.setAttribute("result", "off1"); var flood1 = createSVGElement("feFlood"); flood1.setAttribute("flood-color", "#408067"); flood1.setAttribute("flood-opacity", ".8"); flood1.setAttribute("result", "F1"); var overComposite1 = createSVGElement("feComposite"); overComposite1.setAttribute("in", "F1"); overComposite1.setAttribute("in2", "off1"); overComposite1.setAttribute("operator", "arithmetic"); overComposite1.setAttribute("k1", "1.9"); overComposite1.setAttribute("k2", ".1"); overComposite1.setAttribute("k3", ".5"); overComposite1.setAttribute("k4", ".3"); overComposite1.setAttribute("result", "C1"); var off2 = createSVGElement("feOffset"); off2.setAttribute("in", "SourceGraphic"); off2.setAttribute("dx", "60"); off2.setAttribute("dy", "50"); off2.setAttribute("result", "off2"); var flood2 = createSVGElement("feFlood"); flood2.setAttribute("flood-color", "#408067"); flood2.setAttribute("flood-opacity", ".6"); flood2.setAttribute("result", "F2"); var overComposite2 = createSVGElement("feComposite"); overComposite2.setAttribute("in", "F2"); overComposite2.setAttribute("in2", "off2"); overComposite2.setAttribute("operator", "in"); overComposite2.setAttribute("result", "C2"); var off3 = createSVGElement("feOffset"); off3.setAttribute("in", "SourceGraphic"); off3.setAttribute("dx", "85"); off3.setAttribute("dy", "75"); off3.setAttribute("result", "off3"); var flood3 = createSVGElement("feFlood"); flood3.setAttribute("flood-color", "#408067"); flood3.setAttribute("flood-opacity", ".4"); flood3.setAttribute("result", "F3"); var overComposite3 = createSVGElement("feComposite"); overComposite3.setAttribute("in2", "off3"); overComposite3.setAttribute("operator", "in"); overComposite3.setAttribute("result", "C3"); var merge = createSVGElement("feMerge"); var mergeNode1 = createSVGElement("feMergeNode"); mergeNode1.setAttribute("in", "C1"); var mergeNode2 = createSVGElement("feMergeNode"); mergeNode2.setAttribute("in", "C2"); var mergeNode3 = createSVGElement("feMergeNode"); mergeNode3.setAttribute("in", "C3"); var mergeNode4 = createSVGElement("feMergeNode"); mergeNode4.setAttribute("in", "SourceGraphic"); merge.appendChild(mergeNode3); merge.appendChild(mergeNode2); merge.appendChild(mergeNode1); merge.appendChild(mergeNode4); var overFilter = createSVGElement("filter"); overFilter.setAttribute("id", "overFilter"); overFilter.setAttribute("filterUnits", "objectBoundingBox"); overFilter.setAttribute("x", "0"); overFilter.setAttribute("y", "0"); overFilter.setAttribute("width", "3.5"); overFilter.setAttribute("height", "4"); overFilter.appendChild(off1); overFilter.appendChild(flood1); overFilter.appendChild(overComposite1); overFilter.appendChild(off2); overFilter.appendChild(flood2); overFilter.appendChild(overComposite2); overFilter.appendChild(off3); overFilter.appendChild(flood3); overFilter.appendChild(overComposite3); overFilter.appendChild(merge); defsElement.appendChild(overFilter); rootSVGElement.setAttribute("height", "200"); var rect1 = createSVGElement("circle"); rect1.setAttribute("cx", "100"); rect1.setAttribute("cy", "50"); rect1.setAttribute("r", "50"); rect1.setAttribute("fill", "#408067"); rect1.setAttribute("filter", "url(#overFilter)"); rootSVGElement.appendChild(rect1); shouldBeEqualToString("overComposite1.getAttribute('k1')", "1.9"); function repaintTest() { overComposite1.setAttribute("k1", ".5"); shouldBeEqualToString("overComposite1.getAttribute('k1')", ".5"); completeTest(); } var successfullyParsed = true;
// register-web-ui-test.js // // Test that the home page shows an invitation to join // // Copyright 2012, E14N https://e14n.com/ // // 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. var assert = require("assert"), vows = require("vows"), oauthutil = require("./lib/oauth"), Browser = require("zombie"), Step = require("step"), setupApp = oauthutil.setupApp, setupAppConfig = oauthutil.setupAppConfig; var suite = vows.describe("layout test"); // A batch to test some of the layout basics suite.addBatch({ "When we set up the app": { topic: function() { setupAppConfig({site: "Test"}, this.callback); }, teardown: function(app) { if (app && app.close) { app.close(); } }, "it works": function(err, app) { assert.ifError(err); }, "and we visit the root URL": { topic: function() { var browser, callback = this.callback; browser = new Browser(); browser.visit("http://localhost:4815/main/register", function(err, br) { callback(err, br); }); }, "it works": function(err, br) { assert.ifError(err); assert.isTrue(br.success); }, "and we check the content": { topic: function(br) { var callback = this.callback; callback(null, br); }, "it includes a registration div": function(err, br) { assert.ok(br.query("div#registerpage")); }, "it includes a registration form": function(err, br) { assert.ok(br.query("div#registerpage form")); }, "the registration form has a nickname field": function(err, br) { assert.ok(br.query("div#registerpage form input[name=\"nickname\"]")); }, "the registration form has a password field": function(err, br) { assert.ok(br.query("div#registerpage form input[name=\"password\"]")); }, "the registration form has a password repeat field": function(err, br) { assert.ok(br.query("div#registerpage form input[name=\"repeat\"]")); }, "the registration form has a submit button": function(err, br) { assert.ok(br.query("div#registerpage form button[type=\"submit\"]")); }, "and we submit the form": { topic: function() { var callback = this.callback, br = arguments[0]; Step( function() { br.fill("nickname", "sparks", this); }, function(err) { if (err) throw err; br.fill("password", "redplainsrider1", this); }, function(err) { if (err) throw err; br.fill("repeat", "redplainsrider1", this); }, function(err) { if (err) throw err; br.pressButton("button[type=\"submit\"]", this); }, function(err) { if (err) { callback(err, null); } else { callback(null, br); } } ); }, "it works": function(err, br) { assert.ifError(err); assert.isTrue(br.success); } } } } } }); suite["export"](module);
/* * Copyright (c) 2012-2015 S-Core Co., Ltd. * * 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. */ /** * This file handles the search result data. * * @since 1.4.1 * @author minsung.jin@samsung.com */ define([ './search-result-model', ], function ( model ) { 'use strict'; /** * search with the given metadata. * @param {Object} metadata - search condition(keyword, replace with, scope, options) * @param {viewCallback} callback - out-param(search results) */ function handleFind(metadata, callback) { model.makeFindData(metadata, function (err, title, store) { if (err) { callback(err); } else { callback(null, { title : title, store : store }); } }); } /** * replace the code with the given metadata. * @param {Object} metadata - replacing condition(keyword, replace with, scope, options) * @param {viewCallback} callback - out-param(the replacement result) */ function handleReplace(metadata, callback) { model.makeReplaceData(metadata, function (err, title) { if (err) { callback(err); } else { callback(null, title); } }); } /** * set the search scope * @param {string} scope - set the range of scope(selection, project, workspace) * @param {ViewCallback} callback - out-param(a path of scope) */ function handleSelection(scope, callback) { model.getScopePath(scope, function (err, scope) { if (err) { callback(err); } else { callback(null, scope); } }); } /** * select item replaced * @param {object} item - item replaced or not * @param {boolean} checked - item value * @param {ViewCallback} callback - set a value in the view. */ function handleCheckbox(item, checked, callback) { model.updateReplacePaths(item, checked, function () { callback(); }); } return { handleFind : handleFind, handleReplace : handleReplace, handleSelection : handleSelection, handleCheckbox : handleCheckbox }; });
//// [stringLiteralTypesOverloads03.ts] interface Base { x: string; y: number; } interface HelloOrWorld extends Base { p1: boolean; } interface JustHello extends Base { p2: boolean; } interface JustWorld extends Base { p3: boolean; } let hello: "hello"; let world: "world"; let helloOrWorld: "hello" | "world"; function f(p: "hello"): JustHello; function f(p: "hello" | "world"): HelloOrWorld; function f(p: "world"): JustWorld; function f(p: string): Base; function f(...args: any[]): any { return undefined; } let fResult1 = f(hello); let fResult2 = f(world); let fResult3 = f(helloOrWorld); function g(p: string): Base; function g(p: "hello"): JustHello; function g(p: "hello" | "world"): HelloOrWorld; function g(p: "world"): JustWorld; function g(...args: any[]): any { return undefined; } let gResult1 = g(hello); let gResult2 = g(world); let gResult3 = g(helloOrWorld); //// [stringLiteralTypesOverloads03.js] var hello; var world; var helloOrWorld; function f() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return undefined; } var fResult1 = f(hello); var fResult2 = f(world); var fResult3 = f(helloOrWorld); function g() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return undefined; } var gResult1 = g(hello); var gResult2 = g(world); var gResult3 = g(helloOrWorld); //// [stringLiteralTypesOverloads03.d.ts] interface Base { x: string; y: number; } interface HelloOrWorld extends Base { p1: boolean; } interface JustHello extends Base { p2: boolean; } interface JustWorld extends Base { p3: boolean; } declare let hello: "hello"; declare let world: "world"; declare let helloOrWorld: "hello" | "world"; declare function f(p: "hello"): JustHello; declare function f(p: "hello" | "world"): HelloOrWorld; declare function f(p: "world"): JustWorld; declare function f(p: string): Base; declare let fResult1: JustHello; declare let fResult2: JustWorld; declare let fResult3: HelloOrWorld; declare function g(p: string): Base; declare function g(p: "hello"): JustHello; declare function g(p: "hello" | "world"): HelloOrWorld; declare function g(p: "world"): JustWorld; declare let gResult1: JustHello; declare let gResult2: JustWorld; declare let gResult3: Base;
(function() { 'use strict'; angular.module('replicationControllers', []) .service('replicationControllerService', ['$q', ReplicationControllerDataService]); /** * Replication Controller DataService * Mock async data service. * * @returns {{loadAll: Function}} * @constructor */ function ReplicationControllerDataService($q) { var replicationControllers = { "kind": "List", "apiVersion": "v1", "metadata": {}, "items": [ { "kind": "ReplicationController", "apiVersion": "v1", "metadata": { "name": "redis-master", "namespace": "default", "selfLink": "/api/v1/namespaces/default/replicationcontrollers/redis-master", "uid": "f12969e0-ff77-11e4-8f2d-080027213276", "resourceVersion": "28", "creationTimestamp": "2015-05-21T05:12:14Z", "labels": { "name": "redis-master" } }, "spec": { "replicas": 1, "selector": { "name": "redis-master" }, "template": { "metadata": { "creationTimestamp": null, "labels": { "name": "redis-master" } }, "spec": { "containers": [ { "name": "master", "image": "redis", "ports": [ { "containerPort": 6379, "protocol": "TCP" } ], "resources": {}, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "IfNotPresent", "capabilities": {}, "securityContext": { "capabilities": {}, "privileged": false } } ], "restartPolicy": "Always", "dnsPolicy": "ClusterFirst", "serviceAccount": "" } } }, "status": { "replicas": 1 } } ]}; // Uses promises return { loadAll: function() { // Simulate async call return $q.when(replicationControllers); } }; } })();
module.exports = function(hljs) { var ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?'; var ELIXIR_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?'; var ELIXIR_KEYWORDS = 'and false then defined module in return redo retry end for true self when ' + 'next until do begin unless nil break not case cond alias while ensure or ' + 'include use alias fn quote require import with|0'; var SUBST = { className: 'subst', begin: '#\\{', end: '}', lexemes: ELIXIR_IDENT_RE, keywords: ELIXIR_KEYWORDS }; var SIGIL_DELIMITERS = '[/|([{<"\']' var LOWERCASE_SIGIL = { className: 'string', begin: '~[a-z]' + '(?=' + SIGIL_DELIMITERS + ')', contains: [ { endsParent:true, contains: [{ contains: [hljs.BACKSLASH_ESCAPE, SUBST], variants: [ { begin: /"/, end: /"/ }, { begin: /'/, end: /'/ }, { begin: /\//, end: /\// }, { begin: /\|/, end: /\|/ }, { begin: /\(/, end: /\)/ }, { begin: /\[/, end: /\]/ }, { begin: /\{/, end: /\}/ }, { begin: /</, end: />/ } ] }] }, ], }; var UPCASE_SIGIL = { className: 'string', begin: '~[A-Z]' + '(?=' + SIGIL_DELIMITERS + ')', contains: [ { begin: /"/, end: /"/ }, { begin: /'/, end: /'/ }, { begin: /\//, end: /\// }, { begin: /\|/, end: /\|/ }, { begin: /\(/, end: /\)/ }, { begin: /\[/, end: /\]/ }, { begin: /\{/, end: /\}/ }, { begin: /\</, end: /\>/ } ] }; var STRING = { className: 'string', contains: [hljs.BACKSLASH_ESCAPE, SUBST], variants: [ { begin: /"""/, end: /"""/, }, { begin: /'''/, end: /'''/, }, { begin: /~S"""/, end: /"""/, contains: [] }, { begin: /~S"/, end: /"/, contains: [] }, { begin: /~S'''/, end: /'''/, contains: [] }, { begin: /~S'/, end: /'/, contains: [] }, { begin: /'/, end: /'/ }, { begin: /"/, end: /"/ }, ] }; var FUNCTION = { className: 'function', beginKeywords: 'def defp defmacro', end: /\B\b/, // the mode is ended by the title contains: [ hljs.inherit(hljs.TITLE_MODE, { begin: ELIXIR_IDENT_RE, endsParent: true }) ] }; var CLASS = hljs.inherit(FUNCTION, { className: 'class', beginKeywords: 'defimpl defmodule defprotocol defrecord', end: /\bdo\b|$|;/ }); var ELIXIR_DEFAULT_CONTAINS = [ STRING, UPCASE_SIGIL, LOWERCASE_SIGIL, hljs.HASH_COMMENT_MODE, CLASS, FUNCTION, { begin: '::' }, { className: 'symbol', begin: ':(?![\\s:])', contains: [STRING, {begin: ELIXIR_METHOD_RE}], relevance: 0 }, { className: 'symbol', begin: ELIXIR_IDENT_RE + ':(?!:)', relevance: 0 }, { className: 'number', begin: '(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(.[0-9_]+([eE][-+]?[0-9]+)?)?)', relevance: 0 }, { className: 'variable', begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))' }, { begin: '->' }, { // regexp container begin: '(' + hljs.RE_STARTERS_RE + ')\\s*', contains: [ hljs.HASH_COMMENT_MODE, { className: 'regexp', illegal: '\\n', contains: [hljs.BACKSLASH_ESCAPE, SUBST], variants: [ { begin: '/', end: '/[a-z]*' }, { begin: '%r\\[', end: '\\][a-z]*' } ] } ], relevance: 0 } ]; SUBST.contains = ELIXIR_DEFAULT_CONTAINS; return { lexemes: ELIXIR_IDENT_RE, keywords: ELIXIR_KEYWORDS, contains: ELIXIR_DEFAULT_CONTAINS }; };
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * The length property of the search method is 1 * * @path ch15/15.5/15.5.4/15.5.4.12/S15.5.4.12_A11.js * @description Checking String.prototype.search.length */ ////////////////////////////////////////////////////////////////////////////// //CHECK#1 if (!(String.prototype.search.hasOwnProperty("length"))) { $ERROR('#1: String.prototype.search.hasOwnProperty("length") return true. Actual: '+String.prototype.search.hasOwnProperty("length")); } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#2 if (String.prototype.search.length !== 1) { $ERROR('#2: String.prototype.search.length === 1. Actual: '+String.prototype.search.length ); } // //////////////////////////////////////////////////////////////////////////////
// This file was procedurally generated from the following sources: // - src/dstr-binding-for-await/ary-ptrn-rest-id-iter-step-err.case // - src/dstr-binding-for-await/error/for-await-of-async-gen-var.template /*--- description: Error forwarding when IteratorStep returns an abrupt completion (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 BindingRestElement : ... BindingIdentifier 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier, environment). 2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat, a. If iteratorRecord.[[done]] is false, i. Let next be IteratorStep(iteratorRecord.[[iterator]]). ii. If next is an abrupt completion, set iteratorRecord.[[done]] to true. iii. ReturnIfAbrupt(next). ---*/ var first = 0; var second = 0; var iter = function*() { first += 1; throw new Test262Error(); second += 1; }(); async function * gen() { for await (var [...x] of [iter]) { return; } } gen().next() .then(_ => { throw new Test262Error("Expected async function to reject, but resolved."); }, ({ constructor }) => { assert.sameValue(constructor, Test262Error); }) .then($DONE, $DONE);
// This file was procedurally generated from the following sources: // - src/dstr-binding-for-await/obj-ptrn-id-init-fn-name-cover.case // - src/dstr-binding-for-await/default/for-await-of-async-gen-const.template /*--- description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (for-await-of statement) esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation features: [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.7 Runtime Semantics: KeyedBindingInitialization SingleNameBinding : BindingIdentifier Initializer_opt [...] 6. If Initializer is present and v is undefined, then [...] d. If IsAnonymousFunctionDefinition(Initializer) is true, then i. Let hasNameProperty be HasOwnProperty(v, "name"). ii. ReturnIfAbrupt(hasNameProperty). iii. If hasNameProperty is false, perform SetFunctionName(v, bindingId). ---*/ var iterCount = 0; async function *fn() { for await (const { cover = (function () {}), xCover = (0, function() {}) } of [{}]) { assert.sameValue(cover.name, 'cover'); assert.notSameValue(xCover.name, 'xCover'); iterCount += 1; } } fn().next() .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE) .then($DONE, $DONE);
/* * Copyright (c) 2008-2015 The Open Source Geospatial Foundation * * Published under the BSD license. * See https://github.com/geoext/geoext2/blob/master/license.txt for the full * text of the license. */ /* * @include OpenLayers/Util.js * @requires GeoExt/Version.js */ /** * The permalink provider. * * Sample code displaying a new permalink each time the map is moved: * * // create permalink provider * var permalinkProvider = Ext.create('GeoExt.state.PermalinkProvider', {}); * // set it in the state manager * Ext.state.Manager.setProvider(permalinkProvider); * // create a map panel, and make it stateful * var mapPanel = Ext.create('GeoExt.panel.Map', { * renderTo: "map", * layers: [ * new OpenLayers.Layer.WMS( * "Global Imagery", * "http://maps.opengeo.org/geowebcache/service/wms", * {layers: "bluemarble"} * ) * ], * stateId: "map", * prettyStateKeys: true // for pretty permalinks * }); * // display permalink each time state is changed * permalinkProvider.on({ * statechange: function(provider, name, value) { * alert(provider.getLink()); * } * }); * * @class GeoExt.state.PermalinkProvider */ Ext.define('GeoExt.state.PermalinkProvider', { extend : 'Ext.state.Provider', requires : [ 'GeoExt.Version' ], alias : 'widget.gx_permalinkprovider', /** * */ constructor: function(config){ this.callParent(arguments); config = config || {}; var url = config.url; delete config.url; Ext.apply(this, config); this.state = this.readURL(url); }, /** * Specifies whether type of state values should be encoded and decoded. * Set it to `false` if you work with components that don't require * encoding types, and want pretty permalinks. * * @property{Boolean} * @private */ encodeType: true, /** * Create a state object from a URL. * * @param url {String} The URL to get the state from. * @return {Object} The state object. * @private */ readURL: function(url) { var state = {}; var params = OpenLayers.Util.getParameters(url); var k, split, stateId; for(k in params) { if(params.hasOwnProperty(k)) { split = k.split("_"); if(split.length > 1) { stateId = split[0]; state[stateId] = state[stateId] || {}; state[stateId][split.slice(1).join("_")] = this.encodeType ? this.decodeValue(params[k]) : params[k]; } } } return state; }, /** * Returns the permalink corresponding to the current state. * * @param base {String} The base URL, optional. * @return {String} The permalink. */ getLink: function(base) { base = base || document.location.href; var params = {}; var id, k, state = this.state; for(id in state) { if(state.hasOwnProperty(id)) { for(k in state[id]) { params[id + "_" + k] = this.encodeType ? unescape(this.encodeValue(state[id][k])) : state[id][k]; } } } // merge params in the URL into the state params OpenLayers.Util.applyDefaults( params, OpenLayers.Util.getParameters(base)); var paramsStr = OpenLayers.Util.getParameterString(params); var qMark = base.indexOf("?"); if(qMark > 0) { base = base.substring(0, qMark); } return Ext.urlAppend(base, paramsStr); } });
tinyMCE.init({ theme: "advanced", mode: "specific_textareas", editor_selector: "tinymce", plugins: "fullscreen,autoresize,searchreplace,mediapicker,inlinepopups", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_buttons1: "search,replace,|,cut,copy,paste,|,undo,redo,|,mediapicker,|,link,unlink,charmap,emoticon,codeblock,|,bold,italic,|,numlist,bullist,formatselect,|,code,fullscreen", theme_advanced_buttons2: "", theme_advanced_buttons3: "", convert_urls: false, valid_elements: "*[*]", // shouldn't be needed due to the valid_elements setting, but TinyMCE would strip script.src without it. extended_valid_elements: "script[type|defer|src|language]" });
// PhantomJS is missing Function.prototype.bind: // http://code.google.com/p/phantomjs/issues/detail?id=522 if (!Function.prototype.bind) { Function.prototype.bind = function (oThis) { if (typeof this !== "function") { // closest thing possible to the ECMAScript 5 internal IsCallable function throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function () {}, fBound = function () { return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); }; fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; }; }
export default function identity(x) { return x; }
'use strict'; var _ = require('lodash'); var webpack = require('webpack'); var mergeWebpackConfig = function (config) { // Load webpackConfig only when using `grunt:webpack` // load of grunt tasks is faster var webpackConfig = require('./webpack.config'); return _.merge({}, webpackConfig, config, function (a, b) { if (_.isArray(a)) { return a.concat(b); } }); }; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: { min: { files: { 'dist/react-datepicker.css': 'src/stylesheets/datepicker.scss' }, options: { sourcemap: 'none', style: 'expanded' } }, unmin: { files: { 'dist/react-datepicker.min.css': 'src/stylesheets/datepicker.scss' }, options: { sourcemap: 'none', style: 'compressed' } } }, watch: { jshint: { files: ['src/**/*.js', 'src/**/*.jsx'], tasks: ['jshint'] }, jest: { files: ['src/**/*.jsx', 'src/**/*.js', 'test/**/*.js'], tasks: ['jest'] }, css: { files: '**/*.scss', tasks: ['sass'] }, webpack: { files: ['src/**/*.js', 'src/**/*.jsx'], tasks: ['webpack'] } }, scsslint: { files: 'src/stylesheets/*.scss', options: { config: '.scss-lint.yml', colorizeOutput: true } }, jshint: { all: ['src/**/*.jsx', 'src/**/*.js'], options: { eqnull: true } }, webpack: { example: { entry: './example/boot', output: { filename: 'example.js', library: 'ExampleApp', path: './example/' }, resolve: { extensions: ['', '.js', '.jsx'] }, module: { loaders: [ {test: /\.js/, loaders: ['babel-loader'], exclude: /node_modules/} ] }, node: {Buffer: false}, plugins: [ new webpack.optimize.DedupePlugin(), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }) ] }, unmin: mergeWebpackConfig({ output: { filename: 'react-datepicker.js' } }), min: mergeWebpackConfig({ output: { filename: 'react-datepicker.min.js' }, plugins: [ new webpack.optimize.UglifyJsPlugin({ compressor: { warnings: false } }) ] }) } }); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-scss-lint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-jsxhint'); grunt.loadNpmTasks('grunt-webpack'); grunt.registerTask('default', ['watch', 'scsslint']); grunt.registerTask('travis', ['jshint', 'jest', 'scsslint']); grunt.registerTask('build', ['jshint', 'scsslint', 'webpack', 'sass']); grunt.registerTask('jest', require('./grunt/tasks/jest')); };
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import ReactDOM from 'react-dom'; import Col from '../src/Col'; describe('Col', () => { it('Should set Offset of zero', () => { let instance = ReactTestUtils.renderIntoDocument( <Col xsOffset={0} smOffset={0} mdOffset={0} lgOffset={0} /> ); let instanceClassName = ReactDOM.findDOMNode(instance).className; assert.ok(instanceClassName.match(/\bcol-xs-offset-0\b/)); assert.ok(instanceClassName.match(/\bcol-sm-offset-0\b/)); assert.ok(instanceClassName.match(/\bcol-md-offset-0\b/)); assert.ok(instanceClassName.match(/\bcol-lg-offset-0\b/)); }); it('Should set Pull of zero', () => { let instance = ReactTestUtils.renderIntoDocument( <Col xsPull={0} smPull={0} mdPull={0} lgPull={0} /> ); let instanceClassName = ReactDOM.findDOMNode(instance).className; assert.ok(instanceClassName.match(/\bcol-xs-pull-0\b/)); assert.ok(instanceClassName.match(/\bcol-sm-pull-0\b/)); assert.ok(instanceClassName.match(/\bcol-md-pull-0\b/)); assert.ok(instanceClassName.match(/\bcol-lg-pull-0\b/)); }); it('Should set Push of zero', () => { let instance = ReactTestUtils.renderIntoDocument( <Col xsPush={0} smPush={0} mdPush={0} lgPush={0} /> ); let instanceClassName = ReactDOM.findDOMNode(instance).className; assert.ok(instanceClassName.match(/\bcol-xs-push-0\b/)); assert.ok(instanceClassName.match(/\bcol-sm-push-0\b/)); assert.ok(instanceClassName.match(/\bcol-md-push-0\b/)); assert.ok(instanceClassName.match(/\bcol-lg-push-0\b/)); }); it('Should set Hidden to true', () => { let instance = ReactTestUtils.renderIntoDocument( <Col xsHidden smHidden mdHidden lgHidden /> ); let instanceClassName = ReactDOM.findDOMNode(instance).className; assert.ok(instanceClassName.match(/\bhidden-xs\b/)); assert.ok(instanceClassName.match(/\bhidden-sm\b/)); assert.ok(instanceClassName.match(/\bhidden-md\b/)); assert.ok(instanceClassName.match(/\bhidden-lg\b/)); }); });
/* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ /** * Module: @exports TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/HtmlArea * Initialization script of TYPO3 htmlArea RTE */ define(['TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/UserAgent', 'TYPO3/CMS/Rtehtmlarea/HTMLArea/Util/Util', 'TYPO3/CMS/Rtehtmlarea/HTMLArea/Configuration/Config', 'TYPO3/CMS/Rtehtmlarea/HTMLArea/Editor/Editor'], function (UserAgent, Util, Config, Editor) { /** * * @type {{RE_htmlTag: RegExp, RE_tagName: RegExp, RE_head: RegExp, RE_body: RegExp, reservedClassNames: RegExp, RE_email: RegExp, RE_url: RegExp, RE_numberOrPunctuation: RegExp, init: Function, initEditor: Function, localize: Function, appendToLog: Function}} * @exports TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/HtmlArea */ var HtmlArea = { /*************************************************** * COMPILED REGULAR EXPRESSIONS * ***************************************************/ RE_htmlTag : /<.[^<>]*?>/g, RE_tagName : /(<\/|<)\s*([^ \t\n>]+)/ig, RE_head : /<head>((.|\n)*?)<\/head>/i, RE_body : /<body>((.|\n)*?)<\/body>/i, reservedClassNames : /htmlarea/, RE_email : /([0-9a-z]+([a-z0-9_-]*[0-9a-z])*){1}(\.[0-9a-z]+([a-z0-9_-]*[0-9a-z])*)*@([0-9a-z]+([a-z0-9_-]*[0-9a-z])*\.)+[a-z]{2,9}/i, RE_url : /(([^:/?#]+):\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,})+\.[a-z]{2,5}(:[0-9]+)?(\/\S+)*\/?)/i, RE_numberOrPunctuation : /[0-9.(),;:!¡?¿%#$'"_+=\\\/-]*/g, /*************************************************** * INITIALIZATION * ***************************************************/ init: function () { if (!HTMLArea.isReady) { // Apply global configuration settings Util.apply(HtmlArea, RTEarea[0]); HTMLArea.isReady = true; HtmlArea.appendToLog('', 'HTMLArea', 'init', 'Editor url set to: ' + HtmlArea.editorUrl, 'info'); HtmlArea.appendToLog('', 'HTMLArea', 'init', 'Editor content skin CSS set to: ' + HtmlArea.editedContentCSS, 'info'); Util.apply(HTMLArea, HtmlArea); } }, /** * Create an editor when HTMLArea is loaded and when Ext is ready * * @param string editorId: the id of the editor * @return boolean false if successful */ initEditor: function (editorId) { if (document.getElementById('pleasewait' + editorId)) { if (UserAgent.isSupported()) { document.getElementById('pleasewait' + editorId).style.display = 'block'; document.getElementById('editorWrap' + editorId).style.visibility = 'hidden'; if (!HTMLArea.isReady) { var self = this; window.setTimeout(function () { return self.initEditor(editorId); }, 150); } else { // Create an editor for the textarea var editor = new Editor(Util.apply(new Config(editorId), RTEarea[editorId])); editor.generate(); return false; } } else { document.getElementById('pleasewait' + editorId).style.display = 'none'; document.getElementById('editorWrap' + editorId).style.visibility = 'visible'; } } return true; }, /*************************************************** * LOCALIZATION * ***************************************************/ localize: function (label, plural) { var i = plural || 0; var localized = HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label] || HTMLArea.I18N.msg[label] || ''; if (typeof localized === 'object' && localized !== null && typeof localized[i] !== 'undefined') { localized = localized[i]['target']; } return localized; }, /*************************************************** * LOGGING * ***************************************************/ /** * Write message to JavaScript console * * @param string editorId: the id of the editor issuing the message * @param string objectName: the name of the object issuing the message * @param string functionName: the name of the function issuing the message * @param string text: the text of the message * @param string type: the type of message: 'log', 'info', 'warn' or 'error' * @return void */ appendToLog: function (editorId, objectName, functionName, text, type) { var str = 'RTE[' + editorId + '][' + objectName + '::' + functionName + ']: ' + text; if (typeof type === 'undefined') { var type = 'info'; } // IE may not have any console if (typeof console === 'object' && console !== null && typeof console[type] !== 'undefined') { console[type](str); } } }; return Util.apply(HTMLArea, HtmlArea); });
export default { content: { width: '100%', padding: 10, marginRight: 20, }, header: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', }, };
/* * PLUGIN LoginMGR * * Latvian language file. * * Author: */ theUILang.accLogin = "Login"; theUILang.accPassword = "Password"; theUILang.accAccounts = "Accounts"; theUILang.accAuto = "Autologin"; theUILang.acAutoNone = "None"; theUILang.acAutoDay = "Every day"; theUILang.acAutoWeek = "Every week"; theUILang.acAutoMonth = "Every month"; thePlugins.get("loginmgr").langLoaded();
/** * Created by panos on 4/5/16. */ import angular from 'angular/index' let _app = new WeakMap() export default class Register { constructor (appName, deps) { deps = deps || [] let module try { module = angular.module(appName) } catch (error) { module = angular.module(appName, deps) } _app.set(this, module) } config (constructorFn) { constructorFn = this._normalizeConstructor(constructorFn) let factoryArray = this._createFactoryArray(constructorFn) _app.get(this).config(factoryArray) return this } constant (name, obj) { _app.get(this).constant(name, obj) return this } controller (name, constructorFn) { _app.get(this).controller(name, constructorFn) return this } directive (name, constructorFn) { constructorFn = this._normalizeConstructor(constructorFn) if (!constructorFn.prototype.compile) { // create an empty compile function if none was defined constructorFn.prototype.compile = () => {} } let originalCompileFn = this._cloneFunction(constructorFn.prototype.compile) // Decorate the compile method to automatically return the link method (if it exists) // and bind it to the context of the constructor (so `this` works correctly). // This gets around the problem of a non-lexical "this" which occurs when the directive class itself // returns `this.link` from within the compile function. this._override(constructorFn.prototype, 'compile', () => { return function() { originalCompileFn.apply(this, arguments) if (constructorFn.prototype.link) { return constructorFn.prototype.link.bind(this) } } }) let factoryArray = this._createFactoryArray(constructorFn) _app.get(this).directive(name, factoryArray) return this } factory (name, constructorFn) { constructorFn = this._normalizeConstructor(constructorFn) let factoryArray = this._createFactoryArray(constructorFn) _app.get(this).factory(name, factoryArray) return this } filter (name, constructorFn) { constructorFn = this._normalizeConstructor(constructorFn) let factoryArray = this._createFactoryArray(constructorFn) _app.get(this).filter(name, factoryArray) return this } provider (name, constructorFn) { _app.get(this).provider(name, constructorFn) return this } run (constructorFn) { constructorFn = this._normalizeConstructor(constructorFn) let factoryArray = this._createFactoryArray(constructorFn) _app.get(this).run(factoryArray) return this } service (name, constructorFn) { _app.get(this).service(name, constructorFn) return this } value (name, object) { _app.get(this).value(name, object) return this } /** * If the constructorFn is an array of type ['dep1', 'dep2', ..., constructor() {}] * we need to pull out the array of dependencies and add it as an $inject property of the * actual constructor function. * @param input * @returns {*} * @private */ _normalizeConstructor (input) { let constructorFn if (input.constructor == Array) { let injected = input.slice(0, input.length - 1) constructorFn = input[input.length - 1] constructorFn.$inject = injected } else { constructorFn = input } return constructorFn } /** * Convert a constructor function into a factory function which returns a new instance of that * constructor, with the correct dependencies automatically injected as arguments. * * In order to inject the dependencies, they must be attached to the constructor function with the * `$inject` property annotation. * * @param constructorFn * @returns {Array.<T>} * @private */ _createFactoryArray(constructorFn) { // get the array of dependencies that are needed by this component (as contained in the `$inject` array) let args = constructorFn.$inject || [] let factoryArray = args.slice() // The factoryArray uses Angular's array notation whereby each element of the array is the name of a // dependency, and the final item is the factory function itself. factoryArray.push((...args) => { // return new constructorFn(...args) let instance = new constructorFn(...args) for (let key in instance) { instance[key] = instance[key] } return instance }) return factoryArray } /** * Clone a function * @param original * @returns {Function} * @private */ _cloneFunction (original) { return function() { return original.apply(this, arguments); } } /** * Override an object's method with a new one specified by `callback` * @param object * @param method * @param callback * @private */ _override (object, method, callback) { object[method] = callback(object[method]) } }
/*! * This is a `i18n` language object. * * Spanish * * @author * Jalios (Twitter: @Jalios) * Sascha Greuel (Twitter: @SoftCreatR) * Rafael Miranda (GitHub: @rafa8626) * * @see core/i18n.js */ (function (exports) { if (exports.es === undefined) { exports.es = { 'mejs.plural-form': 1, // core/mediaelement.js 'mejs.download-file': 'Descargar archivo', // renderers/flash.js 'mejs.install-flash': 'Esta usando un navegador que no tiene activado o instalado el reproductor de Flash. Por favor active el plugin del reproductor de Flash o descargue la versión más reciente en https://get.adobe.com/flashplayer/', // features/fullscreen.js 'mejs.fullscreen': 'Pantalla completa', // features/playpause.js 'mejs.play': 'Reproducción', 'mejs.pause': 'Pausa', // features/progress.js 'mejs.time-slider': 'Control deslizante de tiempo', 'mejs.time-help-text': 'Use las flechas Izquierda/Derecha para avanzar un segundo y las flechas Arriba/Abajo para avanzar diez segundos.', 'mejs.live-broadcast': 'Transmisión en Vivo', // features/volume.js 'mejs.volume-help-text': 'Use las flechas Arriba/Abajo para subir o bajar el volumen.', 'mejs.unmute': 'Reactivar silencio', 'mejs.mute': 'Silencio', 'mejs.volume-slider': 'Control deslizante de volumen', // core/player.js 'mejs.video-player': 'Reproductor de video', 'mejs.audio-player': 'Reproductor de audio', // features/tracks.js 'mejs.captions-subtitles': 'Leyendas/Subtítulos', 'mejs.captions-chapters': 'Capítulos', 'mejs.none': 'Ninguno', 'mejs.afrikaans': 'Afrikaans', 'mejs.albanian': 'Albano', 'mejs.arabic': 'Árabe', 'mejs.belarusian': 'Bielorruso', 'mejs.bulgarian': 'Búlgaro', 'mejs.catalan': 'Catalán', 'mejs.chinese': 'Chino', 'mejs.chinese-simplified': 'Chino (Simplificado)', 'mejs.chinese-traditional': 'Chino (Tradicional)', 'mejs.croatian': 'Croata', 'mejs.czech': 'Checo', 'mejs.danish': 'Danés', 'mejs.dutch': 'Holandés', 'mejs.english': 'Inglés', 'mejs.estonian': 'Estoniano', 'mejs.filipino': 'Filipino', 'mejs.finnish': 'Finlandés', 'mejs.french': 'Francés', 'mejs.galician': 'Gallego', 'mejs.german': 'Alemán', 'mejs.greek': 'Griego', 'mejs.haitian-creole': 'Haitiano Criollo', 'mejs.hebrew': 'Hebreo', 'mejs.hindi': 'Hindi', 'mejs.hungarian': 'Húngaro', 'mejs.icelandic': 'Islandés', 'mejs.indonesian': 'Indonesio', 'mejs.irish': 'Irlandés', 'mejs.italian': 'Italiano', 'mejs.japanese': 'Japonés', 'mejs.korean': 'Coreano', 'mejs.latvian': 'Letón', 'mejs.lithuanian': 'Lituano', 'mejs.macedonian': 'Macedonio', 'mejs.malay': 'Malayo', 'mejs.maltese': 'Maltés', 'mejs.norwegian': 'Noruego', 'mejs.persian': 'Persa', 'mejs.polish': 'Polaco', 'mejs.portuguese': 'Portugués', 'mejs.romanian': 'Rumano', 'mejs.russian': 'Ruso', 'mejs.serbian': 'Serbio', 'mejs.slovak': 'Eslovaco', 'mejs.slovenian': 'Eslovenio', 'mejs.spanish': 'Español', 'mejs.swahili': 'Swahili', 'mejs.swedish': 'Suizo', 'mejs.tagalog': 'Tagalog', 'mejs.thai': 'Tailandés', 'mejs.turkish': 'Turco', 'mejs.ukrainian': 'Ucraniano', 'mejs.vietnamese': 'Vietnamita', 'mejs.welsh': 'Galés', 'mejs.yiddish': 'Yiddish' }; } })(mejs.i18n);
odoo.define('website_event.ticket_details', function (require) { var publicWidget = require('web.public.widget'); publicWidget.registry.ticketDetailsWidget = publicWidget.Widget.extend({ selector: '.o_wevent_js_ticket_details', events: { 'click .o_wevent_registration_btn': '_onTicketDetailsClick', 'change .custom-select': '_onTicketQuantityChange' }, start: function (){ this.foldedByDefault = this.$el.data('foldedByDefault') === 1; return this._super.apply(this, arguments); }, //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- /** * @private */ _getTotalTicketCount: function (){ var ticketCount = 0; this.$('.custom-select').each(function (){ ticketCount += parseInt($(this).val()); }); return ticketCount; }, //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- /** * @private * @param {*} ev */ _onTicketDetailsClick: function (ev){ ev.preventDefault(); if (this.foldedByDefault){ $(ev.currentTarget).toggleClass('btn-primary text-left pl-0'); $(ev.currentTarget).siblings().toggleClass('d-none'); this.$('.close').toggleClass('d-none'); } }, /** * @private */ _onTicketQuantityChange: function (){ this.$('button.btn-primary').attr('disabled', this._getTotalTicketCount() === 0); } }); return publicWidget.registry.ticketDetailsWidget; });
/* ***** BEGIN LICENSE BLOCK ***** Copyright © 2009 Center for History and New Media George Mason University, Fairfax, Virginia, USA http://zotero.org This file is part of Zotero. Zotero is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zotero 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Zotero. If not, see <http://www.gnu.org/licenses/>. ***** END LICENSE BLOCK ***** */ var noteEditor; var notifierUnregisterID; function onLoad() { noteEditor = document.getElementById('zotero-note-editor'); noteEditor.mode = 'edit'; noteEditor.focus(); // Set font size from pref Zotero.setFontSize(noteEditor); if (window.arguments) { var io = window.arguments[0]; } var itemID = io.itemID; var collectionID = io.collectionID; var parentItemID = io.parentItemID; if (itemID) { var ref = Zotero.Items.get(itemID); var clearUndo = noteEditor.item ? noteEditor.item.id != ref.id : false; noteEditor.item = ref; // If loading new or different note, disable undo while we repopulate the text field // so Undo doesn't end up clearing the field. This also ensures that Undo doesn't // undo content from another note into the current one. if (clearUndo) { noteEditor.clearUndo(); } document.title = ref.getNoteTitle(); } else { if (parentItemID) { var ref = Zotero.Items.get(parentItemID); noteEditor.parent = ref; } else { if (collectionID && collectionID != '' && collectionID != 'undefined') { noteEditor.collection = Zotero.Collections.get(collectionID); } } noteEditor.refresh(); } notifierUnregisterID = Zotero.Notifier.registerObserver(NotifyCallback, 'item'); } function onUnload() { if(noteEditor && noteEditor.value) noteEditor.save(); Zotero.Notifier.unregisterObserver(notifierUnregisterID); } var NotifyCallback = { notify: function(action, type, ids){ if (noteEditor.item && ids.indexOf(noteEditor.item.id) != -1) { noteEditor.item = noteEditor.item; // If the document title hasn't yet been set, reset undo so // undoing to empty isn't possible var noteTitle = noteEditor.note.getNoteTitle(); if (!document.title && noteTitle != '') { noteEditor.clearUndo(); document.title = noteTitle; } // Update the window name (used for focusing) in case this is a new note window.name = 'zotero-note-' + noteEditor.item.id; } } } addEventListener("load", function(e) { onLoad(e); }, false); addEventListener("unload", function(e) { onUnload(e); }, false);
//// [objectBindingPatternKeywordIdentifiers01.ts] var { while } = { while: 1 } //// [objectBindingPatternKeywordIdentifiers01.js] var = { "while": 1 }["while"];
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'preview', 'sv', { preview: 'Förhandsgranska' } );
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'div', 'de-ch', { IdInputLabel: 'Kennung', advisoryTitleInputLabel: 'Tooltip', cssClassInputLabel: 'Formatvorlagenklasse', edit: 'Div bearbeiten', inlineStyleInputLabel: 'Inline Stil', langDirLTRLabel: 'Links nach Rechs (LTR)', langDirLabel: 'Sprachrichtung', langDirRTLLabel: 'Rechs nach Links (RTL)', languageCodeInputLabel: 'Sprachcode', remove: 'Div entfernen', styleSelectLabel: 'Stil', title: 'Div Container erzeugen', toolbar: 'Div Container erzeugen' } );
/*global define, $, console, window, history, tizen*/ /** * Init page module */ define({ name: 'views/audioPage', def: function viewsAudioPage() { 'use strict'; var appControl = null, appControlReplyCallback = null; function onLaunchSuccess() { console.log('launchAppControl', 'onLaunchSuccess'); } function onLaunchError() { console.error('launchAppControl', 'onLaunchError'); } function launch() { if (typeof tizen !== 'undefined') { return; } tizen.application.launchAppControl( appControl, "com.samsung.w-voicerecorder", onLaunchSuccess, onLaunchError, appControlReplyCallback ); } function init() { if (typeof tizen !== 'undefined' && typeof tizen.ApplicationControl === 'function') { appControl = new tizen.ApplicationControl( "http://tizen.org/appcontrol/operation/create_content", null, "audio/amr", null ); } else { console.warn('tizen.ApplicationControl not available'); } appControlReplyCallback = { // callee sent a reply onsuccess: function onsuccess(data) { var i = 0, key = "http://tizen.org/appcontrol/data/selected"; for (i; i < data.length; i += 1) { if (data[i].key == key) { console.log('selected image is ' + data[i].value[0]); } } }, // callee returned failure onfailure: function onfailure() { console.error('The launch application control failed'); } }; } return { init: init, launch: launch }; } });
// wrapped by build app define("FileSaver/demo/demo", ["dojo","dijit","dojox"], function(dojo,dijit,dojox){ /* FileSaver.js demo script * 2012-01-23 * * By Eli Grey, http://eligrey.com * License: X11/MIT * See LICENSE.md */ /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/demo/demo.js */ (function(view) { "use strict"; // The canvas drawing portion of the demo is based off the demo at // http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/ var document = view.document , $ = function(id) { return document.getElementById(id); } , session = view.sessionStorage // only get URL when necessary in case Blob.js hasn't defined it yet , get_blob = function() { return view.Blob; } , canvas = $("canvas") , canvas_options_form = $("canvas-options") , canvas_filename = $("canvas-filename") , canvas_clear_button = $("canvas-clear") , text = $("text") , text_options_form = $("text-options") , text_filename = $("text-filename") , html = $("html") , html_options_form = $("html-options") , html_filename = $("html-filename") , ctx = canvas.getContext("2d") , drawing = false , x_points = session.x_points || [] , y_points = session.y_points || [] , drag_points = session.drag_points || [] , add_point = function(x, y, dragging) { x_points.push(x); y_points.push(y); drag_points.push(dragging); } , draw = function(){ canvas.width = canvas.width; ctx.lineWidth = 6; ctx.lineJoin = "round"; ctx.strokeStyle = "#000000"; var i = 0 , len = x_points.length ; for(; i < len; i++) { ctx.beginPath(); if (i && drag_points[i]) { ctx.moveTo(x_points[i-1], y_points[i-1]); } else { ctx.moveTo(x_points[i]-1, y_points[i]); } ctx.lineTo(x_points[i], y_points[i]); ctx.closePath(); ctx.stroke(); } } , stop_drawing = function() { drawing = false; } // Title guesser and document creator available at https://gist.github.com/1059648 , guess_title = function(doc) { var h = "h6 h5 h4 h3 h2 h1".split(" ") , i = h.length , headers , header_text ; while (i--) { headers = doc.getElementsByTagName(h[i]); for (var j = 0, len = headers.length; j < len; j++) { header_text = headers[j].textContent.trim(); if (header_text) { return header_text; } } } } , doc_impl = document.implementation , create_html_doc = function(html) { var dt = doc_impl.createDocumentType('html', null, null) , doc = doc_impl.createDocument("http://www.w3.org/1999/xhtml", "html", dt) , doc_el = doc.documentElement , head = doc_el.appendChild(doc.createElement("head")) , charset_meta = head.appendChild(doc.createElement("meta")) , title = head.appendChild(doc.createElement("title")) , body = doc_el.appendChild(doc.createElement("body")) , i = 0 , len = html.childNodes.length ; charset_meta.setAttribute("charset", html.ownerDocument.characterSet); for (; i < len; i++) { body.appendChild(doc.importNode(html.childNodes.item(i), true)); } var title_text = guess_title(doc); if (title_text) { title.appendChild(doc.createTextNode(title_text)); } return doc; } ; canvas.width = 500; canvas.height = 300; if (typeof x_points === "string") { x_points = JSON.parse(x_points); } if (typeof y_points === "string") { y_points = JSON.parse(y_points); } if (typeof drag_points === "string") { drag_points = JSON.parse(drag_points); } if (session.canvas_filename) { canvas_filename.value = session.canvas_filename; } if (session.text) { text.value = session.text; } if (session.text_filename) { text_filename.value = session.text_filename; } if (session.html) { html.innerHTML = session.html; } if (session.html_filename) { html_filename.value = session.html_filename; } drawing = true; draw(); drawing = false; canvas_clear_button.addEventListener("click", function() { canvas.width = canvas.width; x_points.length = y_points.length = drag_points.length = 0; }, false); canvas.addEventListener("mousedown", function(event) { event.preventDefault(); drawing = true; add_point(event.pageX - canvas.offsetLeft, event.pageY - canvas.offsetTop, false); draw(); }, false); canvas.addEventListener("mousemove", function(event) { if (drawing) { add_point(event.pageX - canvas.offsetLeft, event.pageY - canvas.offsetTop, true); draw(); } }, false); canvas.addEventListener("mouseup", stop_drawing, false); canvas.addEventListener("mouseout", stop_drawing, false); canvas_options_form.addEventListener("submit", function(event) { event.preventDefault(); canvas.toBlob(function(blob) { saveAs( blob , (canvas_filename.value || canvas_filename.placeholder) + ".png" ); }, "image/png"); }, false); text_options_form.addEventListener("submit", function(event) { event.preventDefault(); var BB = get_blob(); saveAs( new BB( [text.value || text.placeholder] , {type: "text/plain;charset=" + document.characterSet} ) , (text_filename.value || text_filename.placeholder) + ".txt" ); }, false); html_options_form.addEventListener("submit", function(event) { event.preventDefault(); var BB = get_blob() , xml_serializer = new XMLSerializer , doc = create_html_doc(html) ; saveAs( new BB( [xml_serializer.serializeToString(doc)] , {type: "application/xhtml+xml;charset=" + document.characterSet} ) , (html_filename.value || html_filename.placeholder) + ".xhtml" ); }, false); view.addEventListener("unload", function() { session.x_points = JSON.stringify(x_points); session.y_points = JSON.stringify(y_points); session.drag_points = JSON.stringify(drag_points); session.canvas_filename = canvas_filename.value; session.text = text.value; session.text_filename = text_filename.value; session.html = html.innerHTML; session.html_filename = html_filename.value; }, false); }(self)); });