text
stringlengths 2
6.14k
|
|---|
/**
* @module gallery-linkedlist
*/
/**********************************************************************
* Iterator for LinkedList. Stable except when the next item is removed by
* calling list.remove() instead of iter.removeNext(). When items are
* inserted into an empty list, the pointer remains at the end, not the
* beginning.
*
* @class LinkedListIterator
* @method constructor
* @private
* @param list {LinkedList}
*/
function LinkedListIterator(
/* LinkedList */ list)
{
this._list = list;
this.moveToBeginning();
}
LinkedListIterator.prototype =
{
/**
* @method atBeginning
* @return {Boolean} true if at the beginning
*/
atBeginning: function()
{
return (!this._next || (!this._at_end && !this._next._prev));
},
/**
* @method atEnd
* @return {Boolean} true if at the end
*/
atEnd: function()
{
return (!this._next || this._at_end);
},
/**
* Move to the beginning of the list.
*
* @method moveToBeginning
*/
moveToBeginning: function()
{
this._next = this._list._head;
this._at_end = !this._next;
},
/**
* Move to the end of the list.
*
* @method moveToEnd
*/
moveToEnd: function()
{
this._next = this._list._tail;
this._at_end = true;
},
/**
* @method next
* @return {Mixed} next value in the list or undefined if at the end
*/
next: function()
{
if (this._at_end)
{
return;
}
var result = this._next;
if (this._next && this._next._next)
{
this._next = this._next._next;
}
else
{
this._at_end = true;
}
if (result)
{
return result.value;
}
},
/**
* @method prev
* @return {Mixed} previous value in the list or undefined if at the beginning
*/
prev: function()
{
var result;
if (this._at_end)
{
this._at_end = false;
result = this._next;
}
else if (this._next)
{
result = this._next._prev;
if (result)
{
this._next = result;
}
}
if (result)
{
return result.value;
}
},
/**
* Insert the given value at the iteration position. The inserted item
* will be returned by next().
*
* @method insert
* @param value {Mixed} value to insert
* @return {LinkedListItem} inserted item
*/
insert: function(
/* object */ value)
{
if (this._at_end || !this._next)
{
this._next = this._list.append(value);
}
else
{
this._next = this._list.insertBefore(value, this._next);
}
return this._next;
},
/**
* Remove the previous item from the list.
*
* @method removePrev
* @return {LinkedListItem} removed item or undefined if at the end
*/
removePrev: function()
{
var result;
if (this._at_end)
{
result = this._next;
if (this._next)
{
this._next = this._next._prev;
}
}
else if (this._next)
{
result = this._next._prev;
}
if (result)
{
this._list.remove(result);
return result;
}
},
/**
* Remove the next item from the list.
*
* @method removeNext
* @return {LinkedListItem} removed item or undefined if at the end
*/
removeNext: function()
{
var result;
if (this._next && !this._at_end)
{
result = this._next;
if (this._next && this._next._next)
{
this._next = this._next._next;
}
else
{
this._next = this._next ? this._next._prev : null;
this._at_end = true;
}
}
if (result)
{
this._list.remove(result);
return result;
}
}
};
|
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/* Copyright 2008 litl, LLC. */
/**
* The tween list object. Stores all of the properties and information that pertain to individual tweens.
*
* @author Nate Chatellier, Zeh Fernando
* @version 1.0.4
* @private
*/
/*
Licensed under the MIT License
Copyright (c) 2006-2007 Zeh Fernando and Nate Chatellier
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.
http://code.google.com/p/tweener/
http://code.google.com/p/tweener/wiki/License
*/
function TweenList(scope, timeStart, timeComplete,
useFrames, transition, transitionParams) {
this._init(scope, timeStart, timeComplete, useFrames, transition,
transitionParams);
}
TweenList.prototype = {
_init: function(scope, timeStart, timeComplete,
userFrames, transition, transitionParams) {
this.scope = scope;
this.timeStart = timeStart;
this.timeComplete = timeComplete;
this.userFrames = userFrames;
this.transition = transition;
this.transitionParams = transitionParams;
/* Other default information */
this.properties = new Object();
this.isPaused = false;
this.timePaused = undefined;
this.isCaller = false;
this.updatesSkipped = 0;
this.timesCalled = 0;
this.skipUpdates = 0;
this.hasStarted = false;
},
clone: function(omitEvents) {
var tween = new TweenList(this.scope, this.timeStart, this.timeComplete, this.userFrames,
this.transition, this.transitionParams);
tween.properties = new Array();
for (let name in this.properties) {
tween.properties[name] = this.properties[name];
}
tween.skipUpdates = this.skipUpdates;
tween.updatesSkipped = this.updatesSkipped;
if (!omitEvents) {
tween.onStart = this.onStart;
tween.onUpdate = this.onUpdate;
tween.onComplete = this.onComplete;
tween.onOverwrite = this.onOverwrite;
tween.onError = this.onError;
tween.onStartParams = this.onStartParams;
tween.onUpdateParams = this.onUpdateParams;
tween.onCompleteParams = this.onCompleteParams;
tween.onOverwriteParams = this.onOverwriteParams;
tween.onStartScope = this.onStartScope;
tween.onUpdateScope = this.onUpdateScope;
tween.onCompleteScope = this.onCompleteScope;
tween.onOverwriteScope = this.onOverwriteScope;
tween.onErrorScope = this.onErrorScope;
}
tween.rounded = this.rounded;
tween.min = this.min;
tween.max = this.max;
tween.isPaused = this.isPaused;
tween.timePaused = this.timePaused;
tween.isCaller = this.isCaller;
tween.count = this.count;
tween.timesCalled = this.timesCalled;
tween.waitFrames = this.waitFrames;
tween.hasStarted = this.hasStarted;
return tween;
}
};
function makePropertiesChain(obj) {
/* Tweener has a bunch of code here to get all the properties of all
* the objects we inherit from (the objects in the 'base' property).
* I don't think that applies to JavaScript...
*/
return obj;
};
|
import Dashboard from './components/Dashboard'
export function dashboardPlugin(context) {
context.on('application:routes', opts => {
console.info('dashboardPlugin - application:routes')
console.log('dashboardPlugin - application:routes', opts)
opts.nextState.routes.push({
id: 'dashboard',
entries: [
{
path: 'dashboard',
name: 'dashboard',
component: Dashboard,
}
]
})
console.log('dashboardPlugin - application:routes - return', opts)
return opts
})
return {
getName: () => 'dashboardPlugin'
}
}
|
/** @type {import("../../../../").Configuration} */
module.exports = {
name: "compiler-name",
module: {
rules: [
{
test: /a\.js$/,
compiler: "compiler",
use: "./loader"
},
{
test: /b\.js$/,
compiler: "other-compiler",
use: "./loader"
}
]
}
};
|
/*jshint node:true*/
module.exports = {
description: '<%= name %>',
normalizeEntityName: function () {},
afterInstall: function(options) {
return this.addPackagesToProject([{
name: 'ember-jsonapi-resources',
target: '~1.1.2'
}]);
}
};
|
/**
* Module for filters
*/
(function () {
'use strict';
angular.module('<%= appName %>.filters', []);
})();
|
'use strict';
const { createController } = require('../controller');
describe('Default Controller', () => {
test('Creates Collection Type default actions', () => {
const service = {};
const contentType = {
modelName: 'testModel',
kind: 'collectionType',
};
const controller = createController({ service, contentType });
expect(controller).toEqual({
find: expect.any(Function),
findOne: expect.any(Function),
create: expect.any(Function),
update: expect.any(Function),
delete: expect.any(Function),
});
});
test('Creates Single Type default actions', () => {
const service = {};
const contentType = {
modelName: 'testModel',
kind: 'singleType',
};
const controller = createController({ service, contentType });
expect(controller).toEqual({
find: expect.any(Function),
update: expect.any(Function),
delete: expect.any(Function),
});
});
});
|
import { combineReducers } from 'redux';
import loginStatus from './loginStatus';
import getModuleStatusReducer from '../../lib/getModuleStatusReducer';
export function getLoginStatusReducer(types) {
return (state = null, { type, loggedIn, refreshTokenValid }) => {
switch (type) {
case types.login:
return loginStatus.loggingIn;
case types.loginSuccess:
case types.refreshSuccess:
case types.cancelLogout:
return loginStatus.loggedIn;
case types.loginError:
case types.logoutSuccess:
case types.logoutError:
return loginStatus.notLoggedIn;
case types.refreshError:
return refreshTokenValid ? state : loginStatus.notLoggedIn;
case types.logout:
return loginStatus.loggingOut;
case types.beforeLogout:
return loginStatus.beforeLogout;
case types.initSuccess:
case types.tabSync:
return loggedIn ? loginStatus.loggedIn : loginStatus.notLoggedIn;
default:
return state;
}
};
}
export function getTokenReducer(types) {
return (state = {}, { type, token, refreshTokenValid }) => {
switch (type) {
case types.loginSuccess:
case types.refreshSuccess:
return {
ownerId: token.owner_id,
endpointId: token.endpoint_id,
accessToken: token.access_token,
expireTime: token.expire_time,
expiresIn: token.expires_in,
};
case types.loginError:
case types.logoutSuccess:
case types.logoutError:
return {};
case types.refreshError:
if (refreshTokenValid) {
return state;
}
return {};
case types.initSuccess:
case types.tabSync:
if (token) {
return {
ownerId: token.owner_id,
endpointId: token.endpoint_id,
accessToken: token.access_token,
expireTime: token.expire_time,
expiresIn: token.expires_in,
};
}
return {};
default:
return state;
}
};
}
export function getFreshLoginReducer(types) {
return (state = null, { type, loggedIn }) => {
switch (type) {
case types.initSuccess:
case types.tabSync:
return loggedIn ? false : null;
case types.login:
return true;
case types.loginError:
case types.refreshError:
case types.logoutSuccess:
case types.logoutError:
return null;
default:
return state;
}
};
}
export default function getAuthReducer(types) {
return combineReducers({
status: getModuleStatusReducer(types),
loginStatus: getLoginStatusReducer(types),
freshLogin: getFreshLoginReducer(types),
token: getTokenReducer(types),
});
}
|
module.exports = utest;
utest.Collection = require('./lib/Collection');
utest.TestCase = require('./lib/TestCase');
utest.BashReporter = require('./lib/reporter/BashReporter');
var collection;
var reporter;
function utest(name, tests) {
if (!collection) {
collection = new utest.Collection();
reporter = new utest.BashReporter({collection: collection});
}
var testCase = new utest.TestCase({name: name, tests: tests});
collection.add(testCase);
};
|
const express = require("express");
const getApp = () => {
const app = express();
return app;
};
module.exports = { getApp };
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 11.13.2-11-s
description: >
Strict Mode - ReferenceError is thrown if the
LeftHandSideExpression of a Compound Assignment operator(|=)
evaluates to an unresolvable reference
flags: [onlyStrict]
includes: [runTestCase.js]
---*/
function testcase() {
"use strict";
try {
eval("_11_13_2_11 |= 1;");
return false;
} catch (e) {
return e instanceof ReferenceError;
}
}
runTestCase(testcase);
|
'use strict';
var baseDir = 'client';
module.exports = {
//This is the list of file patterns to load into the browser during testing.
files: [
baseDir + '/src/vendor/angular/angular.js',
baseDir + '/src/vendor/angular-mocks/angular-mocks.js',
baseDir + '/src/vendor/angular-ui-router/release/angular-ui-router.js',
baseDir + '/src/**/*.js',
'build/tmp/*.js',
baseDir + '/test/unit/**/*.spec.js'
],
//used framework
frameworks: ['jasmine'],
plugins: [
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-coverage',
'karma-html-reporter',
'karma-mocha-reporter'
],
preprocessors: {
'**/client/src/**/*.js': 'coverage'
},
reporters: ['mocha', 'html', 'coverage'],
coverageReporter: {
type: 'html',
dir: baseDir + '/test/unit-results/coverage',
file: 'coverage.html'
},
htmlReporter: {
outputDir: baseDir + '//test/unit-results/html'
},
logLevel: 'info',
urlRoot: '/__test/',
//used browsers (overriddeng in some gulp task)
browsers: ['Chrome'],
};
|
//>>built
define({previousMessage:"Alegeri anterioare",nextMessage:"Mai multe alegeri"});
|
//TODO: encapsulate back to private function when card design is done
//typical sizes:
/*
portrait:
iPhone 4,5 375px
iPhone 6 320px
iPhone 6+ 414px
Galaxy S3 360px
landscape:
iPhone 4 480px
iPhone 5 568px
iPhone 6 667px (574px container)
iPhone 6+ 736px (574px container)
Galaxy S3 640px (574px container)
*/
const ContainerWidth = {
XS: 375,
SM: 574,
MD: 728,
LG: 938,
XL: 1148,
XXL: 1384
}
const Breakpoints = {
XS: 0, // Extra small screen / phone
SM: 544, // Small screen / phone
MD: 768, // Medium screen / tablet
LG: 992, // Large screen / desktop
XL: 1200, // Extra large screen / wide desktop
XXL: 1440, // Extra large screen / wide desktop
}
const COLUMNS = 14
//since media query defines smaller base font size in typography.scss we need to calculated gutters properly
const getGutter = containerOrBrowserWidth => (containerOrBrowserWidth > Breakpoints.SM ? 16 : 14)
export default {
ContainerWidth : ContainerWidth,
getFluidContainerWidth(browserWidth) {
return browserWidth - getGutter(browserWidth)
},
getContainerWidth(browserWidth) {
//should match variables from bootstrap
if (browserWidth <= ContainerWidth.SM) {
return browserWidth //container becomes fluid for small size
} else if (browserWidth > ContainerWidth.SM && browserWidth < Breakpoints.MD) {
return ContainerWidth.SM
} else if (browserWidth >= Breakpoints.MD && browserWidth < Breakpoints.LG) {
return ContainerWidth.MD
} else if (browserWidth >= Breakpoints.LG && browserWidth < Breakpoints.XL) {
return ContainerWidth.LG
} else if (browserWidth >= Breakpoints.XL && browserWidth < Breakpoints.XXL) {
return ContainerWidth.XL
} else if (browserWidth >= Breakpoints.XXL) {
return ContainerWidth.XXL
}
},
init(containerWidth) {
return {
//returns width in px of Container's content area (width without paddings)
getColumnContentWidth({numberOfCols}) {
const oneColPercent = (100 / COLUMNS) / 100
const containerGutter = containerWidth >= Breakpoints.SM ? getGutter(containerWidth) : 0
return containerWidth * (oneColPercent * numberOfCols) - containerGutter
}
}
},
}
|
// -------------------------------------------------------------------------- \\
// File: Transform.js \\
// Module: Foundation \\
// Author: Neil Jenkins \\
// License: © 2010-2015 FastMail Pty Ltd. MIT Licensed. \\
// -------------------------------------------------------------------------- \\
"use strict";
( function ( NS, undefined ) {
/**
Namespace: O.Transform
Holds a number of useful functions for transforming values, for use with
<O.Binding>.
*/
NS.Transform = {
/**
Function: O.Transform.toBoolean
Converts the given value to a Boolean
Parameter:
value - {*} The value to transform.
Returns:
{Boolean} The numerical value.
*/
toBoolean: function ( value ) {
return !!value;
},
/**
Function: O.Transform.toString
Converts the given value to a String
Parameter:
value - {*} The value to transform.
Returns:
{String} The string value.
*/
toString: function ( value ) {
return value != null ? value + '' : '';
},
/**
Function: O.Transform.toInt
Converts the given value to an integer
Parameter:
value - {*} The value to transform.
Returns:
{Number} The integral numerical value.
*/
toInt: function ( value ) {
return parseInt( value, 10 ) || 0;
},
/**
Function: O.Transform.toFloat
Converts the given value to a floating point Number.
Parameter:
value - {*} The value to transform.
Returns:
{Number} The numerical value.
*/
toFloat: function ( value ) {
return parseFloat( value );
},
/**
Function: O.Transform.invert
Converts the given value to a Boolean then inverts it.
Parameter:
value - {*} The value to transform.
Returns:
{Boolean} The inverse Boolean value.
*/
invert: function ( value ) {
return !value;
},
/**
Function: O.Transform#defaultValue
Returns a function which will transform `undefined` into the default
value, but will pass through any other value untouched.
Parameters:
value - {*} The default value to use.
*/
defaultValue: function ( value ) {
return function ( v ) {
return v !== undefined ? v : value;
};
},
/**
Function: O.Transform.undefinedToNull
Converts an undefined value into null, passes others through unchanged.
Parameter:
value - {*} The value to transform.
Returns:
{*} The value or null if the value is undefined.
*/
undefinedToNull: function ( value ) {
return value === undefined ? null : value;
},
/**
Function: O.Transform.isEqualToValue
Returns a function which will compare a given value to the value
Parameter:
value - {*} The value to compare to.
Returns:
{Function} A function which compares its first argument to the value
given to this function, returning true if equal or false otherwise.
Or, if the sync is in reverse, returns the given value if true or
undefined if false.
*/
isEqualToValue: function ( value ) {
return function ( syncValue, syncForward ) {
return syncForward ?
syncValue === value :
syncValue ? value : undefined;
};
}
};
}( O ) );
|
(function(){
var worker = new ProtocolWorker('web+profile');
navigator.webProfile = {
registerProvider: function(name, uri){
navigator.registerProtocolHandler('web+profile', uri + '?%s', name);
},
getID: function(){
return worker.request({ action: 'get:id' }).then(function(response){
navigator.webProfile.id = response.id;
return response;
})
},
authenticate: function(){
if (!this.id) throw 'Not Connected: you must connect before sending Web Profile requests';
},
getProfile: function(username){
/*
This should be performed by the browser,
platform, or OS so it comes directly from
the blockchain instead of relying on a
third-party middleman.
*/
var name = username || this.id;
return fetch('https://api.onename.com/v1/users/' + name + '?app-id=11783753c820c2004667f4b17efb376d&app-secret=a31496483fa18b96b39845d66d62d15d37f5eea29aca6f161b2f6bcc0a7d8d91')
.then(function(response){
return response.json();
}).then(function(json){
return json[name].profile;
});
}
};
})();
|
define([
'jquery',
'find/app/util/database-name-resolver'
], function($, databaseNameResolver) {
return {
/**
* Get the view document URL for a document in a text index.
* @param {String} reference
* @param {String} model
* @param {Boolean} highlightExpressions
* @return {String}
*/
getHref: function(reference, model, highlightExpressions) {
var database = databaseNameResolver.resolveDatabaseNameForDocumentModel(model);
return 'api/public/view/viewDocument?' + $.param({
reference: reference,
index: database,
highlightExpressions: highlightExpressions || null
}, true);
},
/**
* Get the view document URL for a search result triggered by a static content promotion
* @param {String} reference Reference of the search result
* @return {String}
*/
getStaticContentPromotionHref: function(reference) {
return 'api/public/view/viewStaticContentPromotion?' + $.param({
reference: reference
});
}
};
});
|
//Logged in
function checkRestricted (UserService, $q, $location) {
var deferred = $q.defer();
if (UserService.getToken()) {
deferred.resolve();
} else {
deferred.reject();
$location.url('/');
}
return deferred.promise;
}
function checkedLoggedIn (UserService, $q, $location) {
var deferred = $q.defer();
if (!UserService.getToken()) {
deferred.resolve();
} else {
deferred.reject();
$location.url('/tasks');
}
return deferred.promise;
}
//Bootstrapping the app
angular.module('TasksApp', ['ngMaterial','LocalStorageModule','ngRoute', 'ngMessages'])
//Routes
.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/',
{
templateUrl:'views/login.html',
resolve: {
'loggedIn': ['UserService', '$q', '$location', checkedLoggedIn]
}
}
)
.when('/signup',
{
templateUrl:'views/signup.html',
resolve: {
'loggedIn': ['UserService', '$q', '$location', checkedLoggedIn]
}
}
)
.when('/tasks',
{
templateUrl:'views/tasks.html',
controller: 'TasksCtrl as tc',
resolve: {
'loggedIn': ['UserService', '$q', '$location', checkRestricted]
}
}
)
.otherwise({redirectTo:'/'});
/*
resolve: {
'check': function(UserService,$location) {
if (UserService.getUserToken()) {
return true;
}
$location.path('/');
return false;
}
}
*/
}])
//Themes
.config(['$mdThemingProvider',function($mdThemingProvider) {
$mdThemingProvider.theme('default')
.primaryPalette('blue-grey')
.accentPalette('light-green')
.backgroundPalette('blue-grey');
// .dark();
}]);
|
const glob = require('glob');
const fs = require('fs');
const path = require('path');
const request = require('request');
const checkedUrls = {
'src/archive/index.php': '',
};
function getUrlContents(url) {
return new Promise(function(resolve, reject) {
request(
url,
{ followRedirect: false, followAllRedirects: false, headers: { 'Cache-Control': 'no-cache' } },
(error, response, body) => resolve([response.statusCode, body]));
});
}
function createUrl(file) {
return 'http://localhost:8080/' + file.replace('src/', '');
}
async function isValidUrl(file, url, id) {
let isValid = false;
const currentDirectory = path.dirname(file);
let targetPath;
if (url.startsWith('#')) {
targetPath = file;
} else {
targetPath = path.join(url.startsWith('/') ? 'src' : currentDirectory, url.split('?')[0]);
}
if (targetPath.endsWith('/')) {
targetPath = path.join(targetPath, 'index.php');
}
if (checkedUrls[targetPath] !== undefined || fs.existsSync(targetPath)) {
if (id) {
if (!checkedUrls[targetPath]) {
const [statusCode, contents] = await getUrlContents(createUrl(targetPath));
if (statusCode === 200) {
checkedUrls[targetPath] = contents;
}
}
const html = checkedUrls[targetPath];
const idExists = new RegExp(`id=["']${id}["']`).test(html);
const generatedIds = [];
if (!idExists) {
const headerPattern = /<h([1-4])>(.+)<\/h\1>/g;
let matches;
while ((matches = headerPattern.exec(html))) {
const generatedId = matches[2]
.replace(/<\/?[^\>]+\>/g, '')
.replace(/[^\w\d\s\(\.\-]/g, '')
.replace(/[\s\(\.]/g, '-')
.toLowerCase();
generatedIds.push(generatedId);
}
}
isValid = idExists || generatedIds.indexOf(id) >= 0;
} else {
isValid = true;
if (checkedUrls[targetPath] === undefined) {
checkedUrls[targetPath] = '';
}
}
}
return isValid;
}
async function verifyFile(file) {
const regex = /<a.*href=['"]([^'"]+)['"]/g;
const [statusCode, contents] = await getUrlContents(createUrl(file));
if (statusCode !== 200) {
//console.log(`\u2753 Ignoring ${file} (${statusCode})`);
}
let matches;
let urlCount = 0;
let validUrls = [];
let invalidUrls = [];
let ignoredUrls = [];
while ((matches = regex.exec(contents))) {
const [urlMatch] = matches.slice(1);
const [url, id] = urlMatch.split('#');
const ignoreList = ['mailto:', 'dist/', 'http'];
if (ignoreList.some(x => url.startsWith(x)) || (id && id.startsWith('example-'))) {
ignoredUrls.push(url);
} else {
const isValid = await isValidUrl(file, url, id);
if (isValid) {
validUrls.push(urlMatch);
} else {
invalidUrls.push(urlMatch);
}
}
urlCount++;
}
if (invalidUrls.length) {
console.log(`\u274C Found errors in ${file}. Invalid URLs found linking to:\n-> ${invalidUrls.join('\n-> ')}`);
} else {
//console.log(`\u2714 Verified ${validUrls.length} links in ${file} (ignored ${ignoredUrls.length})`);
}
}
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
glob('src/javascript-*/*.php', {}, async (_, files) => await asyncForEach(files, verifyFile));
|
// The size of Rectangle, Bound etc.
class Size {
constructor(width, height) {
this.type = 'Size'
this.width = width
this.height = height
}
set(width, height) {
this.width = width
this.height = height
}
}
export default Size
|
/*
Template Name: Color Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.2
Version: 1.6.0
Author: Sean Ngu
Website: http://www.seantheme.com/color-admin-v1.6/admin/
*/
var handleEmailToInput = function() {
$('#email-to').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
};
var handleEmailContent = function() {
$('#wysihtml5').wysihtml5();
};
var EmailCompose = function () {
"use strict";
return {
//main function
init: function () {
handleEmailToInput();
handleEmailContent();
}
};
}();
|
var assert = require('assert')
var parse = require('../')
// test parser
assert.equal(parse('***foo***'),
'<p><strong><em>foo</em></strong></p>\n')
assert.equal(parse('# **blah**'),
'<h1><a name="--blah--"></a><strong>blah</strong></h1>\n')
assert.equal(parse('Blah blah\n-----'),
'<h2><a name="blah-blah"></a>Blah blah</h2>\n')
// test sanitizer
assert.equal(parse('<a href="blah" id="wat">foo</a>'),
'<p><a href="blah">foo</a></p>\n')
assert.equal(parse('<a href=blah>foo</a>'),
'<p><a href="blah">foo</a></p>\n')
assert.equal(parse('<div><i>foo <b>blah</i></b>'),
'<div><i>foo <b>blah</b></i></div>')
assert.equal(parse('<a class="evil" href="blah">foo</a>'),
'<p></p>\n')
// highlighter
assert.equal(parse('```js\nvar foo = "bar";\n```'),
'<pre><code class="lang-js"><span class="hljs-keyword">var</span> foo = <span class="hljs-string">"bar"</span>;\n</code></pre>\n')
assert.equal(parse('```sh\n$ test\n```'),
'<pre><code class="lang-sh">$ <span class="hljs-built_in">test</span>\n</code></pre>\n')
assert.equal(parse('```\n-----\n```'),
'<pre><code>-----\n</code></pre>\n')
// metadata
assert.equal(parse('---\naaa: 123\nbbb: "*456*"\n---\n\n*foo*\n'),
'<table>\n<thead>\n<th>\naaa</th>\n<th>\nbbb</th>\n</thead>\n<tbody>\n<td>\n123</td>\n<td>\n*456*</td>\n</tbody>\n</table>\n<p><em>foo</em></p>\n')
|
const name = 'wizard';
describe("Metro 4 :: Wizard", () => {
it('Component Initialization', ()=>{
cy.visit("cypress/"+name+".html");
})
})
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = requirePropFactory;
function requirePropFactory(componentNameInError) {
if (process.env.NODE_ENV === 'production') {
return () => null;
}
const requireProp = requiredProp => (props, propName, componentName, location, propFullName) => {
const propFullNameSafe = propFullName || propName;
if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
return new Error(`The prop \`${propFullNameSafe}\` of ` + `\`${componentNameInError}\` must be used on \`${requiredProp}\`.`);
}
return null;
};
return requireProp;
}
|
(function() {
var cx = scriptParams.google_search_engine_id;
//var cx = '007604623310582658229:j5pu9nxyssu';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
|
function fileSelect(evt) {
alert("hep");
if (window.File && window.FileReader && window.FileList && window.Blob) {
var files = evt.target.files;
var result = '';
var file;
for (var i = 0; file = files[i]; i++) {
// if the file is not an image, continue
// if (!file.type.match('image.*')) {
// continue;
// }
reader = new FileReader();
reader.onload = (function (tFile) {
return function (evt) {
pdfdata = evt.target.result;
var div = document.createElement('div');
processPdf(evt.target.result);
// div.innerHTML = '<img style="width: 90px;" src="' + evt.target.result + '" />';
// document.getElementById('filesInfo').appendChild(div);
};
}(file));
reader.readAsDataURL(file);
}
} else {
alert('The File APIs are not fully supported in this browser.');
}
}
var content = [];
function processPdf(data) {
PDFJS.getDocument(data).then(function(pdf) {
pdfObject = pdf;
// you can now use *pdf* here
for (var i = 1; i <= pdf.numPages; i++) {
pdf.getPage(i).then(function(page) {
pageObject = page;
page.getTextContent().then(function (tc) {
content.push((tc.items || tc).map(function (x) { return x.str; }).join(' '));
});
// you can now use *page* here
var scale = 1.5;
var viewport = page.getViewport(scale);
var canvas = document.getElementById('the-canvas');
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;
var renderContext = {
canvasContext: context,
viewport: viewport
};
page.render(renderContext);
});
}
});
}
document.getElementById('filesToUpload').addEventListener('change', fileSelect, false);
function dragOver(evt) {
evt.stopPropagation();
evt.preventDefault();
evt.dataTransfer.dropEffect = 'copy';
}
var dropTarget = document.getElementById('dropTarget');
dropTarget.addEventListener('dragover', dragOver, false);
dropTarget.addEventListener('drop', fileSelect, false);
|
if(!ORYX.Plugins){ORYX.Plugins=new Object()
}ORYX.Plugins.BPMN2XPDL20=ORYX.Plugins.AbstractPlugin.extend({construct:function(){arguments.callee.$.construct.apply(this,arguments);
this.facade.offer({name:ORYX.I18N.BPMN2XPDL.xpdlExport,functionality:this.transform.bind(this),group:ORYX.I18N.BPMN2XPDL.group,dropDownGroupIcon:ORYX.BASE_FILE_PATH+"images/export2.png",icon:ORYX.BASE_FILE_PATH+"images/page_white_gear.png",description:ORYX.I18N.BPMN2XPDL.xpdlExport,index:1,minShape:0,maxShape:0});
this.facade.offer({name:ORYX.I18N.BPMN2XPDL.xpdlImport,functionality:this.importXPDL.bind(this),group:ORYX.I18N.BPMN2XPDL.group,dropDownGroupIcon:ORYX.BASE_FILE_PATH+"images/import.png",icon:ORYX.BASE_FILE_PATH+"images/page_white_gear.png",description:ORYX.I18N.BPMN2XPDL.xpdlImport,index:1,minShape:0,maxShape:0})
},transform:function(){var a=ORYX.CONFIG.BPMN2XPDLPATH;
var b=this.facade.getSerializedJSON();
Ext.Ajax.request({url:a,method:"POST",success:function(c){this.openDownloadWindow(window.document.title+".xml",c.responseText)
}.bind(this),failure:function(){Ext.Msg.alert("Conversion failed")
},params:{data:b,action:"Export"}})
},importXPDL:function(a){var b=ORYX.CONFIG.BPMN2XPDLPATH;
var d=new Ext.form.FormPanel({baseCls:"x-plain",labelWidth:50,defaultType:"textfield",items:[{text:ORYX.I18N.BPMN2XPDL.selectFile,style:"font-size:12px;margin-bottom:10px;display:block;",anchor:"100%",xtype:"label"},{fieldLabel:ORYX.I18N.BPMN2XPDL.file,name:"subject",inputType:"file",style:"margin-bottom:10px;display:block;",itemCls:"ext_specific_window_overflow"},{xtype:"textarea",hideLabel:true,name:"msg",anchor:"100% -63"}]});
var c=new Ext.Window({autoCreate:true,layout:"fit",plain:true,bodyStyle:"padding:5px;",title:ORYX.I18N.BPMN2XPDL.impXPDL,height:350,width:500,modal:true,fixedcenter:true,shadow:true,proxyDrag:true,resizable:true,items:[d],buttons:[{text:ORYX.I18N.BPMN2XPDL.impBtn,handler:function(){var e=new Ext.LoadMask(Ext.getBody(),{msg:ORYX.I18N.BPMN2XPDL.impProgress});
e.show();
window.setTimeout(function(){var f=d.items.items[2].getValue();
Ext.Ajax.request({url:b,method:"POST",success:function(g){this.facade.importJSON(g.responseText);
e.hide();
c.hide()
}.bind(this),failure:function(){e.hide();
Ext.Msg.alert("Import failed")
},params:{data:f,action:"Import"}})
}.bind(this),100)
}.bind(this)},{text:ORYX.I18N.BPMN2XPDL.close,handler:function(){c.hide()
}.bind(this)}]});
c.on("hide",function(){c.destroy(true);
delete c
});
c.show();
d.items.items[1].getEl().dom.addEventListener("change",function(e){var f=e.target.files[0].getAsText("UTF-8");
d.items.items[2].setValue(f)
},true)
}});
|
// $Id$
(function ($) {
/**
* Toggles the collapsible region.
*/
Drupal.behaviors.mementoAdminToggle = {
attach: function (context, settings) {
$('.collapsible-toggle a, context').click(function() {
$('#section-collapsible').toggleClass('toggle-active').find('.region-collapsible').slideToggle('fast');
return false;
});
}
}
/**
* CSS Help for IE.
* - Adds even odd striping and containers for images in posts.
* - Adds a .first-child class to the first paragraph in each wrapper.
* - Adds a prompt containing the link to a comment for the permalink.
*/
Drupal.behaviors.mementoPosts = {
attach: function (context, settings) {
// Detects IE6-8.
if (!jQuery.support.leadingWhitespace) {
$('.article-content p:first-child').addClass('first-child');
$('.article-content img, context').parent(':not(.field-item, .user-picture)').each(function(index) {
var stripe = (index/2) ? 'even' : 'odd';
$(this).wrap('<div class="content-image-' + stripe + '"></div>');
});
}
// Comment link copy promt.
$("time span a").click( function() {
prompt('Link to this comment:', this.href);
return false;
});
}
}
})(jQuery);
|
define(["three"],
/**
* Extend THREE namespace with ConvolutionShader
*/
function(THREE) {
/**
* @author alteredq / http://alteredqualia.com/
*
* Convolution shader
* ported from o3d sample to WebGL / GLSL
* http://o3d.googlecode.com/svn/trunk/samples/convolution.html
*/
THREE.ConvolutionShader = {
defines: {
"KERNEL_SIZE_FLOAT": "25.0",
"KERNEL_SIZE_INT": "25",
},
uniforms: {
"tDiffuse": { type: "t", value: null },
"uImageIncrement": { type: "v2", value: new THREE.Vector2( 0.001953125, 0.0 ) },
"cKernel": { type: "fv1", value: [] }
},
vertexShader: [
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join("\n"),
fragmentShader: [
"uniform float cKernel[ KERNEL_SIZE_INT ];",
"uniform sampler2D tDiffuse;",
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vec2 imageCoord = vUv;",
"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
"for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
"imageCoord += uImageIncrement;",
"}",
"gl_FragColor = sum;",
"}"
].join("\n"),
buildKernel: function ( sigma ) {
// We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway.
function gauss( x, sigma ) {
return Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) );
}
var i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1;
if ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize;
halfWidth = ( kernelSize - 1 ) * 0.5;
values = new Array( kernelSize );
sum = 0.0;
for ( i = 0; i < kernelSize; ++i ) {
values[ i ] = gauss( i - halfWidth, sigma );
sum += values[ i ];
}
// normalize the kernel
for ( i = 0; i < kernelSize; ++i ) values[ i ] /= sum;
return values;
}
};
}
);
|
/**
* $Id: jquery.multiupload.gears.js 616 2008-11-27 15:43:52Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function($) {
if (!$.multiUpload.initialized && window.google && google.gears) {
$.multiUpload.initialized = 1;
$.multiUpload.runtime = 'gears';
// Override init function
$.extend($.multiUpload.prototype, {
init : function() {
var up = this;
$(up).trigger('multiUpload:init');
$(up).bind('multiUpload:selectFiles', function(e) {
var up = this, desk = google.gears.factory.create('beta.desktop'), s = {};
if (up.settings.filter[0] != '*')
s.filter = $.map(up.settings.filter, function(v) {return '.' + v});
desk.openFiles(function(f) {
var sf = [];
if (f.length) {
up._fireEvent('multiUpload:beforeFilesSelected');
$(f).each(function() {
var fo = {
id : up.generateID(),
name : this.name,
blob : this.blob,
size : this.blob.length,
loaded : 0
};
up.files.push(fo);
sf.push(fo);
});
up._fireEvent('multiUpload:filesSelected', [{files : sf}]);
up._fireEvent('multiUpload:filesChanged');
} else
up._fireEvent('multiUpload:filesSelectionCancelled');
}, s);
});
$(up).bind('multiUpload:uploadFile', function(e, fo) {
var req, up = this, chunkSize, chunk = 0, chunks, i, start, loaded = 0, curChunkSize;
chunkSize = up.settings.chunk_size || 1024 * 1024;
chunks = Math.ceil(fo.blob.length / chunkSize);
uploadNextChunk();
function uploadNextChunk() {
var url = up.settings.upload_url;
if (fo.status)
return;
curChunkSize = Math.min(chunkSize, fo.blob.length - (chunk * chunkSize));
req = google.gears.factory.create('beta.httprequest');
req.open('POST', url + (url.indexOf('?') == -1 ? '?' : '&') + 'name=' + escape(fo.name) + '&chunk=' + chunk + '&chunks=' + chunks + '&path=' + escape(up.settings.path));
req.setRequestHeader('Content-Disposition', 'attachment; filename="' + fo.name + '"');
req.setRequestHeader('Content-Type', 'application/octet-stream');
req.setRequestHeader('Content-Range', 'bytes ' + chunk * chunkSize);
req.upload.onprogress = function(pr) {
fo.loaded = loaded + pr.loaded;
up._fireEvent('multiUpload:fileUploadProgress', [{file : fo, loaded : fo.loaded, total : fo.size}]);
};
req.onreadystatechange = function() {
var ar;
if (req.readyState == 4) {
if (req.status == 200) {
ar = {file : fo, chunk : chunk, chunks : chunks, response : req.responseText};
up._fireEvent('multiUpload:chunkUploaded', [ar]);
if (ar.cancel) {
fo.status = 'failed';
up._fireEvent('multiUpload:filesChanged');
up.uploadNext();
return;
}
loaded += curChunkSize;
if (++chunk >= chunks) {
fo.status = 'completed';
up._fireEvent('multiUpload:fileUploaded', [{file : fo, response : req.responseText}]);
up._fireEvent('multiUpload:filesChanged');
up.uploadNext();
} else
uploadNextChunk();
} else
up._fireEvent('multiUpload:uploadChunkError', [{file : fo, chunk : chunk, chunks : chunks, error : 'Status: ' + req.status}]);
}
};
if (chunk < chunks)
req.send(fo.blob.slice(chunk * chunkSize, curChunkSize));
};
});
},
_fireEvent : function(ev, ar) {
$(this).trigger(ev, ar);
}
});
}
})(jQuery);
|
/*
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*/
ace.define('ace/snippets/objectivec', ['require', 'exports', 'module' ], function(require, exports, module) {
exports.snippetText = "";
exports.scope = "objectivec";
});
|
var source= ('http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-vbw');
document.write ("<scr"+"ipt type='text/javascript' src='"+source);
document.write ("'><\/scr"+"ipt>");
|
/** @jsx React.DOM */
(function( module, undefined) {
var React = require('react');
var CanvasApp = require('./components/Canvas.js');
var FormApp = require('./components/Form.js');
var FormParametroApp = require('./components/FormParametro.js');
var PendulumStore = require('./stores/Pendulum.js');
var Base = React.createClass({
_onChange: function() {
this.setState(PendulumStore.get());
},
componentDidMount: function() {
PendulumStore.addChangeListener(this._onChange);
},
getInitialState: function() {
return PendulumStore.get();
},
componentWillUnmount: function() {
PendulumStore.removeChangeListener(this._onChange);
},
//salvar:function(){
//Acao.salvar();
//Acao.abrirModal('dialogo');
//},
//editor:function(){
//if (this.state.editor=='fechado'){
//Acao.abrirModal('senha');
//}else{
//Acao.editor();
//}
//},
//limpar:function(){
//Acao.abrirModal('restaurar');
//},
render: function() {
return(<div>
<CanvasApp pendulum={this.state}/>
<FormApp pendulum={this.state}/>
<FormParametroApp />
</div>)
}
});
React.render( <Base/> ,document.getElementById('react'));
}( module));
|
/*
* Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
*/
WebInspector.DashboardView = class DashboardView extends WebInspector.Object
{
constructor(representedObject, identifier)
{
console.assert(identifier);
super();
this._representedObject = representedObject;
this._element = document.createElement("div");
this._element.classList.add("dashboard");
this._element.classList.add(identifier);
}
// Static
static create(representedObject)
{
console.assert(representedObject);
if (representedObject instanceof WebInspector.DefaultDashboard)
return new WebInspector.DefaultDashboardView(representedObject);
if (representedObject instanceof WebInspector.DebuggerDashboard)
return new WebInspector.DebuggerDashboardView(representedObject);
if (representedObject instanceof WebInspector.ReplayDashboard)
return new WebInspector.ReplayDashboardView(representedObject);
throw "Can't make a DashboardView for an unknown representedObject.";
}
// Public
get element()
{
return this._element;
}
get representedObject()
{
return this._representedObject;
}
shown()
{
// Implemented by subclasses.
}
hidden()
{
// Implemented by subclasses.
}
closed()
{
// Implemented by subclasses.
}
};
|
/**
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
//Logo size
wp.customize('logo_size',function( value ) {
value.bind( function( newval ) {
$('.site-logo').css('max-width', newval + 'px' );
} );
});
// Font sizes
wp.customize('site_title_size',function( value ) {
value.bind( function( newval ) {
$('.site-title').css('font-size', newval + 'px' );
} );
});
wp.customize('site_desc_size',function( value ) {
value.bind( function( newval ) {
$('.site-description').css('font-size', newval + 'px' );
} );
});
wp.customize('body_size',function( value ) {
value.bind( function( newval ) {
$('body').css('font-size', newval + 'px' );
} );
});
//Site title
wp.customize('site_title_color',function( value ) {
value.bind( function( newval ) {
$('.site-title a').css('color', newval );
} );
});
//Site desc
wp.customize('site_desc_color',function( value ) {
value.bind( function( newval ) {
$('.site-description').css('color', newval );
} );
});
// Body text color
wp.customize('body_text_color',function( value ) {
value.bind( function( newval ) {
$('body, .widget a').css('color', newval );
} );
});
} )( jQuery );
|
function icl_content_lang_propagate(lang, speed) {
var id = '#icl-content-translate-' + lang;
$('#icl-content').show('slow');
$('#icl-content fieldset').hide();
if ( $('#edit-minor-edit')) {
if($('#edit-minor-edit').attr('checked')) {
$(id).hide(speed);
} else {
$(id).show(speed);
}
}
else {
$(id).show(speed);
}
if ($('#edit-icl-content-skip').val() == 'not') {
$('#icl-content fieldset').hide();
}
if (lang.length == 0) {
$('#edit-icl-content-skip').attr('disabled','disabled');
$('#no_language_error').show('fast');
} else {
if($(id).html()!=null){
$('#edit-icl-content-skip').removeAttr('disabled');
}else{
$('#edit-icl-content-skip').attr('disabled','disabled');
}
$('#no_language_error').hide('fast');
}
}
$(document).ready( function() {
$('#edit-icl-content-skip').change( function() {
if (this.value == 'not') {
$('#icl-content fieldset').hide('slow');
} else {
icl_content_lang_propagate($('#edit-language').val(), 'slow');
}
});
$('#edit-language').change( function() {
icl_content_lang_propagate(this.value, '');
});
$('#edit-minor-edit').change( function() {
if($('#edit-minor-edit').attr('checked')) {
$('#edit-icl-content-skip-wrapper').hide('slow');
icl_content_lang_propagate($('#edit-language').val(), 'slow');
} else {
$('#edit-icl-content-skip-wrapper').show('fast');
icl_content_lang_propagate($('#edit-language').val(), 'fast');
}
});
icl_content_lang_propagate($('#edit-language').val(), '');
});
|
/**
* @plugin leanerModal
* @author Finely Sliced <finelysliced.com.au>
* @author Edward Hotchkiss <edwardhotchkiss@me.com>
* @description originally from http://leanmodal.finelysliced.com.au/
*
* @modified by AJ Clarke for the Total WordPress theme
**/
(function($) {
$.fn.extend({
leanerModal: function(options) {
function close_modal(modal_id) {
$(modal_id).removeClass( 'active' );
$("#lean_overlay").fadeOut();
$(modal_id).css({
display: "none"
});
}
var defaults = {
overlay: .5,
closeButton: ".modal_close"
};
var overlay = $('<div id="lean_overlay"></div>');
if (!$("#lean_overlay").length) {
$("body").append(overlay);
}
options = $.extend(defaults, options);
return this.each(function() {
var _options = options;
$(this).live("click", function(e) {
var modal_id = _options.id;
$("#lean_overlay").live("click", function() {
close_modal(modal_id)
});
$(_options.closeButton).live("click", function() {
close_modal(modal_id)
});
var modal_height = $(modal_id).outerHeight();
var modal_width = $(modal_id).outerWidth();
$("#lean_overlay").css({
display: "block",
opacity: 0
});
$("#lean_overlay").stop( true, true ).fadeTo(200, _options.overlay);
$(modal_id).css({
display: "block",
position: "fixed",
opacity: 0,
"z-index": 11e3,
left: 50 + "%",
"margin-left": -(modal_width / 2) + "px"
});
$(modal_id).stop( true, true ).fadeTo(200, 1).addClass( 'active' );
return false;
});
});
}
});
})(jQuery);
|
/**
* WARNING: WHILE THERE ARE TWO VERSIONS OF SPECIAL:CONTACT... THIS WILL BE THE MASTER FILE, AND THE OTHER /extensions/wikia/SpecialContact/SpecialContact.js
* IS A COPY OF THIS FUNCTIONALITY.
*/
var SpecialContact = {
init: function() {
$( '#picker_grid' ).find( 'td > a' ).click( function () {
var trackLabel = $( this ).attr( 'class' ).substr( 23 ),
trackUrl = $( this ).attr( 'href' );
SpecialContact.trackClick( trackLabel, trackUrl );
} );
$( '#SpecialContactFooterPicker a' ).click( function (e) {
var trackLabel = 'footer-picker',
trackUrl = $( this ).attr( 'href' );
SpecialContact.trackClick( trackLabel, trackUrl, e );
} );
$( '#SpecialContactFooterNoForm a' ).click( function (e) {
var trackLabel = 'footer-noform',
trackUrl = $( this ).attr( 'href' );
SpecialContact.trackClick( trackLabel, trackUrl, e );
} );
$( '#SpecialContactIntroNoForm a' ).click( function (e) {
var trackLabel = 'intro-noform',
trackUrl = $( this ).attr( 'href' );
SpecialContact.trackClick( trackLabel, trackUrl, e );
} );
$( '#SpecialContactIntroForm a' ).click( function (e) {
var trackLabel = 'intro-form',
trackUrl = $( this ).attr( 'href' );
SpecialContact.trackClick( trackLabel, trackUrl, e );
} );
$('input[type=file]').change(function() {
$(this).closest('p').next().show();
});
},
trackClick: function ( trackLabel, trackUrl, event ) {
Wikia.Tracker.track({
action: Wikia.Tracker.ACTIONS.CLICK_LINK_TEXT,
category: 'specialcontact',
label: trackLabel,
href: trackUrl,
trackingMethod: 'internal'
});
}
};
// If this user has javascript, they can be part of the A/B tests, so we'll
// embed what groups they're in (and whether that's the control group or not).
(function( window, $, undefined ) {
var AbTest = window.Wikia.AbTest;
if ( AbTest ) {
var abString = '', abTests;
abTests = AbTest.getExperiments();
if ( abTests.length == 0 ) {
abString = 'No active experiments.';
} else {
// Make a single entry for each experiment.
$.each( abTests, function( i, exp ) {
if ( abString != '' ) {
abString += ', ';
}
abString += '[ ' + exp.name + ': ' + exp.group.name + ' ]';
});
}
// Inject this debug-data into a hidden element in the form.
$(function() {
$( '#wpAbTesting' ).val( abString );
});
}
})( window, jQuery );
|
/* bender-tags: editor,unit,pastefromword */
/* bender-ckeditor-plugins: clipboard,pastefromword,format,ajax */
( function() {
'use strict';
bender.editor = true;
var compat = bender.tools.compatHtml;
function testWordFilter( editor ) {
return function( input, output ) {
assertPasteEvent( editor, { dataValue: compat( input, 1 ) }, function( data, msg ) {
assert.areSame( compat( output ), compat( data.dataValue ) );
}, 'tc1', true );
}
}
bender.test( {
'test list transformation': function() {
bender.tools.testInputOut( 'list_1', testWordFilter( this.editor ) );
}
} );
} )();
|
/**
* @file mosync.resource.js
* @author Ali Sarrafi
*
* The library for loading Image resources into Mosync program from Javascript.
* This library only supports image resources and used together with the
* NativeUI library.
*/
/**
* The Resource handler submodule of the bridge module.
*/
mosync.resource = {};
/**
* A Hash containing all registered callback functions for
* loadImage function.
*/
mosync.resource.imageCallBackTable = {};
mosync.resource.imageIDTable = {};
mosync.resource.imageDownloadQueue = [];
/**
* Loads images into image handles for use in MoSync UI systems.
*
* @param imagePath relative path to the image file.
* @param imageID a custom ID used for refering to the image in JavaScript
* @param callBackFunction a function that will be called when the image is ready.
*/
mosync.resource.loadImage = function(imagePath, imageID, successCallback) {
mosync.resource.imageCallBackTable[imageID] = successCallback;
mosync.bridge.send(
[
"Resource",
"loadImage",
imagePath,
imageID
], null);
};
/**
* A function that is called by C++ to pass the loaded image information.
*
* @param imageID JavaScript ID of the image
* @param imageHandle C++ handle of the imge which can be used for refering to the loaded image
*/
mosync.resource.imageLoaded = function(imageID, imageHandle) {
var callbackFun = mosync.resource.imageCallBackTable[imageID];
if (undefined != callbackFun)
{
var args = Array.prototype.slice.call(arguments);
// Call the function.
callbackFun.apply(null, args);
}
};
/**
* Loads images into image handles from a remote URL for use in MoSync UI systems.
*
* @param imageURL URL to the image file.
* @param imageID a custom ID used for refering to the image in JavaScript
* @param callBackFunction a function that will be called when the image is ready.
*/
mosync.resource.loadRemoteImage = function(imageURL, imageID, callBackFunction) {
mosync.resource.imageCallBackTable[imageID] = callBackFunction;
var message = [
"Resource",
"loadRemoteImage",
imageURL,
imageID
];
// Add message to queue.
mosync.resource.imageDownloadQueue.push(message);
if (1 == mosync.resource.imageDownloadQueue.length)
{
mosync.bridge.send(message, null);
}
};
mosync.resource.imageDownloadStarted = function(imageID, imageHandle)
{
mosync.resource.imageIDTable[imageHandle] = imageID;
};
mosync.resource.imageDownloadFinished = function(imageHandle)
{
var imageID = mosync.resource.imageIDTable[imageHandle];
var callbackFun = mosync.resource.imageCallBackTable[imageID];
if (undefined != callbackFun)
{
// Call the function.
callbackFun(imageID, imageHandle);
}
// Remove first message.
if (mosync.resource.imageDownloadQueue.length > 0)
{
mosync.resource.imageDownloadQueue.shift();
}
// If there are more messages, send the next
// message in the queue.
if (mosync.resource.imageDownloadQueue.length > 0)
{
mosync.bridge.send(
mosync.resource.imageDownloadQueue[0],
null);
}
};
|
var Backbone = require('backbone');
var Modules = require('collections/modules');
var ModuleFactory = require('utils/module-factory');
var Builder = Backbone.Model.extend({
defaults: {
selectDefault: modularPageBuilderData.l10n.selectDefault,
addNewButton: modularPageBuilderData.l10n.addNewButton,
selection: [], // Instance of Modules. Can't use a default, otherwise they won't be unique.
allowedModules: [], // Module names allowed for this builder.
requiredModules: [], // Module names required for this builder. They will be required in this order, at these positions.
},
initialize: function() {
// Set default selection to ensure it isn't a reference.
if ( ! ( this.get( 'selection' ) instanceof Modules ) ) {
this.set( 'selection', new Modules() );
}
this.get( 'selection' ).on( 'change reset add remove', this.setRequiredModules, this );
this.setRequiredModules();
},
setData: function( data ) {
var _selection;
if ( '' === data ) {
return;
}
// Handle either JSON string or proper obhect.
data = ( 'string' === typeof data ) ? JSON.parse( data ) : data;
// Convert saved data to Module models.
if ( data && Array.isArray( data ) ) {
_selection = data.map( function( module ) {
return ModuleFactory.create( module.name, module.attr );
} );
}
// Reset selection using data from hidden input.
if ( _selection && _selection.length ) {
this.get('selection').reset( _selection );
} else {
this.get('selection').reset( [] );
}
},
saveData: function() {
var data = [];
this.get('selection').each( function( module ) {
// Skip empty/broken modules.
if ( ! module.get('name' ) ) {
return;
}
data.push( module.toMicroJSON() );
} );
this.trigger( 'save', data );
},
/**
* List all available modules for this builder.
* All modules, filtered by this.allowedModules.
*/
getAvailableModules: function() {
return _.filter( ModuleFactory.availableModules, function( module ) {
return this.isModuleAllowed( module.name );
}.bind( this ) );
},
isModuleAllowed: function( moduleName ) {
return this.get('allowedModules').indexOf( moduleName ) >= 0;
},
setRequiredModules: function() {
var selection = this.get( 'selection' );
var required = this.get( 'requiredModules' );
if ( ! selection || ! required || required.length < 1 ) {
return;
}
for ( var i = 0; i < required.length; i++ ) {
if (
( ! selection.at( i ) || selection.at( i ).get( 'name' ) !== required[ i ] ) &&
this.isModuleAllowed( required[ i ] )
) {
var module = ModuleFactory.create( required[ i ], [], { sortable: false } );
selection.add( module, { at: i, silent: true } );
} else if ( selection.at( i ) && selection.at( i ).get( 'name' ) === required[ i ] ) {
selection.at( i ).set( 'sortable', false );
}
}
}
});
module.exports = Builder;
|
'use strict';
var should = require('should');
var app = require('../../app');
var request = require('supertest');
describe('GET /api/signins', function() {
it('should respond with JSON array', function(done) {
request(app)
.get('/api/signins')
.expect(200)
.expect('Content-Type', /json/)
.end(function(err, res) {
if (err) return done(err);
res.body.should.be.instanceof(Array);
done();
});
});
});
|
var searchData=
[
['quick_5fsort',['quick_sort',['../input__output_8cc.html#af4e9acb1bb4f1aea6ef17d8344679c48',1,'input_output.cc']]]
];
|
// Módulo respnsável pela criação do gráfico Stacked Area do relatório
// de participação dos alunos nas aulas da disciplina
var LectureParticipationGraph = function () {
var chart;
// Definição do gráfico
var options ={
chart: {
renderTo: '',
type: 'area',
style: { lineHeight: 'normal' }
},
title: {
text: ''
},
xAxis: {
title: {
text: 'Dias'
}
},
yAxis: {
title: {
text: 'Participação'
},
min: 0
},
legend: {
layout: 'vertical',
x: -40
},
tooltip: {
crosshairs: true,
shared: true
},
plotOptions: {
area: {
stacking: 'normal',
lineColor: '#666666',
lineWidth: 1,
marker: {
lineWidth: 1,
lineColor: '#666666'
}
}
},
series: [{
name: 'Quantidade de Pedidos de Ajuda',
}, {
name: 'Quantidade de Postagens',
}, {
name: 'Quantidade de Respostas aos Pedidos de Ajuda',
}, {
name: 'Quantidade de Respostas às Postagens'
}]
}
return {
// Carregamento do gráfico
load: function (graphView) {
// Inicializa o form com o gráfico correspondente
var graph = graphView.form.plotGraphForm(graphView.chart.renderTo);
// Passa a função de carregamento do gráfico via JSON
graph.loadGraph(function (json) {
$.extend(options, graphView);
options.series[0].data = json.helps_by_day;
options.series[1].data = json.activities_by_day;
options.series[2].data = json.answered_helps_by_day;
options.series[3].data = json.answered_activities_by_day;
options.xAxis.categories = json.days;
chart = new Highcharts.Chart(options);
})
}
}
};
|
define(
//begin v1.x content
{
"dateFormat-full": "EEEE, d MMMM y 'г'. G",
"dateFormat-long": "d MMMM y 'г'. G",
"dateFormat-medium": "dd.MM.yyyy G",
"dateFormat-short": "dd.MM.yy G",
"dateFormatItem-d": "d",
"dateFormatItem-E": "ccc",
"dateFormatItem-Ed": "E, d",
"dateFormatItem-Gy": "y G",
"dateFormatItem-H": "H",
"dateFormatItem-Hm": "H:mm",
"dateFormatItem-Hms": "H:mm:ss",
"dateFormatItem-M": "L",
"dateFormatItem-Md": "dd.MM",
"dateFormatItem-MEd": "E, dd.MM",
"dateFormatItem-MMdd": "dd.MM",
"dateFormatItem-MMM": "LLL",
"dateFormatItem-MMMd": "d MMM",
"dateFormatItem-MMMEd": "ccc, d MMM",
"dateFormatItem-ms": "mm:ss",
"dateFormatItem-y": "y G",
"dateFormatItem-yM": "MM.y G",
"dateFormatItem-yMd": "dd.MM.y G",
"dateFormatItem-yMEd": "E, dd.MM.y G",
"dateFormatItem-yMMM": "LLL y G",
"dateFormatItem-yMMMd": "d MMM y G",
"dateFormatItem-yMMMEd": "E, d MMM y G",
"dateFormatItem-yQQQ": "QQQ y G",
"dateFormatItem-yyMM": "MM.yy G",
"dateFormatItem-yyMMM": "LLL yy G",
"dateFormatItem-yyMMMEd": "E, d MMM yy G",
"dateFormatItem-yyQ": "Q yy G",
"dateFormatItem-yyyy": "y G",
"dateFormatItem-yyyyLLLL": "LLLL y G",
"dateFormatItem-yyyyMM": "MM.yyyy G",
"dateFormatItem-yyyyMMMM": "LLLL y G",
"dateFormatItem-yyyyQQQQ": "QQQQ y 'г'. G",
"days-format-abbr": [
"вс",
"пн",
"вт",
"ср",
"чт",
"пт",
"сб"
],
"days-format-narrow": [
"В",
"Пн",
"Вт",
"С",
"Ч",
"П",
"С"
],
"days-format-wide": [
"воскресенье",
"понедельник",
"вторник",
"среда",
"четверг",
"пятница",
"суббота"
],
"days-standAlone-abbr": [
"Вс",
"Пн",
"Вт",
"Ср",
"Чт",
"Пт",
"Сб"
],
"days-standAlone-narrow": [
"В",
"П",
"В",
"С",
"Ч",
"П",
"С"
],
"days-standAlone-wide": [
"Воскресенье",
"Понедельник",
"Вторник",
"Среда",
"Четверг",
"Пятница",
"Суббота"
],
"quarters-format-abbr": [
"1-й кв.",
"2-й кв.",
"3-й кв.",
"4-й кв."
],
"quarters-format-wide": [
"1-й квартал",
"2-й квартал",
"3-й квартал",
"4-й квартал"
],
"dayPeriods-format-abbr-am": "до полудня",
"dayPeriods-format-abbr-pm": "после полудня",
"dayPeriods-format-narrow-am": "дп",
"dayPeriods-format-narrow-pm": "пп",
"dayPeriods-format-wide-am": "до полудня",
"dayPeriods-format-wide-pm": "после полудня",
"dateFormatItem-yQ": "QQQ y 'г'.",
"timeFormat-full": "H:mm:ss zzzz",
"timeFormat-long": "H:mm:ss z",
"timeFormat-medium": "H:mm:ss",
"timeFormat-short": "H:mm",
"months-format-abbr": [
"янв.",
"февр.",
"марта",
"апр.",
"мая",
"июня",
"июля",
"авг.",
"сент.",
"окт.",
"нояб.",
"дек."
],
"months-format-narrow": [
"Я",
"Ф",
"М",
"А",
"М",
"И",
"И",
"А",
"С",
"О",
"Н",
"Д"
],
"months-format-wide": [
"января",
"февраля",
"марта",
"апреля",
"мая",
"июня",
"июля",
"августа",
"сентября",
"октября",
"ноября",
"декабря"
],
"months-standAlone-abbr": [
"Янв.",
"Февр.",
"Март",
"Апр.",
"Май",
"Июнь",
"Июль",
"Авг.",
"Сент.",
"Окт.",
"Нояб.",
"Дек."
],
"months-standAlone-narrow": [
"Я",
"Ф",
"М",
"А",
"М",
"И",
"И",
"А",
"С",
"О",
"Н",
"Д"
],
"months-standAlone-wide": [
"Январь",
"Февраль",
"Март",
"Апрель",
"Май",
"Июнь",
"Июль",
"Август",
"Сентябрь",
"Октябрь",
"Ноябрь",
"Декабрь"
]
}
//end v1.x content
);
|
(function () {
"use strict";
function config($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/profile");
$stateProvider
.state("/", {
url: "/",
templateUrl: "js/app/views/home.html",
controller: "homeController",
controllerAs: 'vm'
})
.state("/.profile",{
url:"profile",
templateUrl:"js/app/views/profile.html"
})
.state("/.presentation",{
url:"presentation",
templateUrl: "js/app/views/presentation.html"
})
.state("/.summary",{
url:"summary",
templateUrl: "js/app/views/summary.html"
});
}
config.$inject=["$stateProvider", "$urlRouterProvider"];
angular.module("mlevel").config(config);
}());
|
import tip from 'democracyos-tip'
import View from '../../view/view.js'
import template from './template.jade'
export default class Participant extends View {
/**
* Participants View Class
*
* @param {Array} participants array of ids
* @api public
*/
constructor (participant, index) {
super(template, { participant: participant, index: index })
this.participant = participant
this.index = index
}
switchOn () {
tip(this.el[0])
}
}
|
/*!
* VisualEditor ContentEditable AlignableNode class.
*
* @copyright 2011-2016 VisualEditor Team and others; see http://ve.mit-license.org
*/
/**
* ContentEditable Alignable node.
*
* @class
* @abstract
* @extends ve.ce.ClassAttributeNode
*
* @constructor
*/
ve.ce.AlignableNode = function VeCeAlignableNode() {
// Parent constructor
ve.ce.AlignableNode.super.apply( this, arguments );
this.align = null;
};
/* Inheritance */
OO.inheritClass( ve.ce.AlignableNode, ve.ce.ClassAttributeNode );
/* Events */
/**
* @event align
* @param {string} align New alignment
*/
/**
* @inheritdoc
*/
ve.ce.AlignableNode.prototype.updateAttributeClasses = function () {
var align;
ve.ce.AlignableNode.super.prototype.updateAttributeClasses.apply( this, arguments );
align = this.model.getAttribute( 'align' );
if ( align && align !== this.align ) {
this.emit( 'align', align );
this.align = align;
}
};
|
var searchData=
[
['cosangle',['cosAngle',['../class_polar.html#a4628c596876a75709853a2ac46bb0d86',1,'Polar']]]
];
|
/*
* Copyright (C) 2016-2021 phantombot.github.io/PhantomBot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Function that querys all of the data we need.
$(run = function() {
// Get command settings.
socket.getDBValues('get_command_settings', {
tables: ['settings', 'settings', 'settings', 'settings', 'cooldownSettings',
'cooldownSettings'],
keys: ['permComMsgEnabled', 'priceComMsgEnabled', 'coolDownMsgEnabled',
'pricecomMods', 'modCooldown', 'defaultCooldownTime']
}, true, function(e) {
// Set cost message.
$('#cmd-cost-messages').val((e.priceComMsgEnabled === 'true' ? 'Yes' : 'No'));
// Set permission message.
$('#cmd-perm-messages').val((e.permComMsgEnabled === 'true' ? 'Yes' : 'No'));
// Set cooldown message.
$('#cmd-cooldown-messages').val((e.coolDownMsgEnabled === 'true' ? 'Yes' : 'No'));
// Set cost for mods.
$('#pricecom-mods').val((e.pricecomMods === 'true' ? 'No' : 'Yes'));
// Set cooldown for mods.
$('#cooldown-mods').val((e.modCooldown === 'true' ? 'No' : 'Yes'));
// Set global cooldown.
$('#global-cooldown').val(e.defaultCooldownTime);
});
});
// Function that handles events.
$(function() {
// Save button.
$('#cmd-save-btn').on('click', function() {
let cmdCostMessage = $('#cmd-cost-messages').find(':selected').text() === 'Yes',
cmdPermMessage = $('#cmd-perm-messages').find(':selected').text() === 'Yes',
cmdCooldownMessage = $('#cmd-cooldown-messages').find(':selected').text() === 'Yes',
priceComMods = $('#pricecom-mods').find(':selected').text() !== 'Yes',
cooldownMods = $('#cooldown-mods').find(':selected').text() !== 'Yes',
globalTime = $('#global-cooldown');
switch (false) {
case helpers.handleInputNumber(globalTime, 5):
break;
default:
socket.updateDBValues('update_cmd_settings', {
tables: ['settings', 'settings', 'settings', 'settings', 'cooldownSettings',
'cooldownSettings'],
keys: ['permComMsgEnabled', 'priceComMsgEnabled', 'coolDownMsgEnabled',
'pricecomMods', 'modCooldown', 'defaultCooldownTime'],
values: [cmdPermMessage, cmdCostMessage, cmdCooldownMessage,
priceComMods, cooldownMods, globalTime.val()]
}, function() {
socket.wsEvent('update_cmd_settings_ws', './core/commandCoolDown.js', null, ['update'], function() {
toastr.success('Successfully update command settings!');
});
});
}
});
});
|
module.exports = {
// eslint-disable-next-line global-require
...require('@spotify/prettier-config'),
// your overrides here
printWidth: 100,
};
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'pagebreak', 'ar', {
alt: 'فاصل الصفحة',
toolbar: 'إدخال صفحة جديدة'
} );
|
exports.prefix = '/forms';
//exports.before = function(request, response, next) { next() };
exports.general = function(request, response) {
response.render("forms/general", {
title: "General"
})
};
exports.advanced = function(request, response) {
response.render("forms/advanced", {
title: "Advanced"
})
};
exports.editors = function(request, response) {
response.render("forms/editors", {
title: "Editors"
})
};
|
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var arrayify = require('array-back');
var option = require('./option');
var findReplace = require('find-replace');
var Argv = function () {
function Argv(argv) {
_classCallCheck(this, Argv);
if (argv) {
argv = arrayify(argv);
} else {
argv = process.argv.slice(0);
argv.splice(0, 2);
}
this.list = argv;
}
_createClass(Argv, [{
key: 'clear',
value: function clear() {
this.list.length = 0;
}
}, {
key: 'expandOptionEqualsNotation',
value: function expandOptionEqualsNotation() {
var _this = this;
var optEquals = option.optEquals;
if (this.list.some(optEquals.test.bind(optEquals))) {
(function () {
var expandedArgs = [];
_this.list.forEach(function (arg) {
var matches = arg.match(optEquals.re);
if (matches) {
expandedArgs.push(matches[1], matches[2]);
} else {
expandedArgs.push(arg);
}
});
_this.clear();
_this.list = expandedArgs;
})();
}
}
}, {
key: 'expandGetoptNotation',
value: function expandGetoptNotation() {
var combinedArg = option.combined;
var hasGetopt = this.list.some(combinedArg.test.bind(combinedArg));
if (hasGetopt) {
findReplace(this.list, combinedArg.re, function (arg) {
arg = arg.slice(1);
return arg.split('').map(function (letter) {
return '-' + letter;
});
});
}
}
}, {
key: 'validate',
value: function validate(definitions) {
var invalidOption = undefined;
var optionWithoutDefinition = this.list.filter(function (arg) {
return option.isOption(arg);
}).some(function (arg) {
if (definitions.get(arg) === undefined) {
invalidOption = arg;
return true;
}
});
if (optionWithoutDefinition) {
halt('UNKNOWN_OPTION', 'Unknown option: ' + invalidOption);
}
}
}]);
return Argv;
}();
function halt(name, message) {
var err = new Error(message);
err.name = name;
throw err;
}
module.exports = Argv;
|
var searchData=
[
['btserial',['BTSerial',['../control__2_80_8c.html#a14bb84b12818dd2f13acf63d4cb14d98',1,'control_2.0.c']]]
];
|
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import 'fontsource-roboto';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
|
var path = require('path');
module.exports = {
entry: __dirname + '/src/main.jsx',
output: {
path: __dirname + '/build/js',
filename: '[name].bundle.js'
},
externals: {
'react': 'React',
'react/addons': 'React'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
include: path.resolve(__dirname, 'src')
},
{
test: /\.jsx$/,
loaders: ['babel-loader', 'jsx-loader'],
include: path.resolve(__dirname, 'src')
},
{
test: /\.json$/,
loaders: ['json-loader'],
include: [path.resolve(__dirname, 'www_src'), path.resolve(__dirname, 'node_modules')]
}
]
}
};
|
export const basicSortDataModel = [
{
type: 'pand/address',
},
{
type: 'kadaster/kadastraal_object',
},
{
type: 'bag/pand',
},
]
export const basicDataModel = [
{
uri: 'https://acc.api.data.amsterdam.nl/',
label: 'Warmoesstraat 178',
categoryLabel: 'Adres',
type: 'pand/address',
parent: 'bag/pand',
},
{
uri: 'https://acc.api.data.amsterdam.nl/',
label: 'ASD04 F 06417 G 0000',
categoryLabel: 'Kadastraal object',
type: 'kadaster/kadastraal_object',
},
{
uri: 'https://acc.api.data.amsterdam.nl/',
label: '0363100012168052',
categoryLabel: 'Pand',
type: 'bag/pand',
},
]
export const expectedDataModel = [
{
categoryLabel: 'Pand',
results: [
{
categoryLabel: 'Pand',
label: '0363100012168052',
type: 'bag/pand',
uri: 'https://acc.api.data.amsterdam.nl/',
},
],
subCategories: [
{
categoryLabel: 'Adres',
results: [
{
categoryLabel: 'Adres',
label: 'Warmoesstraat 178',
parent: 'bag/pand',
type: 'pand/address',
uri: 'https://acc.api.data.amsterdam.nl/',
},
],
subCategories: [],
type: 'pand/address',
},
],
type: 'bag/pand',
},
{
categoryLabel: 'Kadastraal object',
results: [
{
categoryLabel: 'Kadastraal object',
label: 'ASD04 F 06417 G 0000',
type: 'kadaster/kadastraal_object',
uri: 'https://acc.api.data.amsterdam.nl/',
},
],
subCategories: [],
type: 'kadaster/kadastraal_object',
},
]
|
OC.L10N.register(
"templateeditor",
{
"Could not load template" : "Klarte ikke å laste mal",
"Saved" : "Lagret",
"Reset" : "Tilbakestill",
"An error occurred" : "En feil har oppstått",
"Sharing email - public link shares (HTML)" : "Delings-epost - offentlige lenke-delinger (HTML)",
"Sharing email - public link shares (plain text fallback)" : "Delings-epost - offentlige lenke-delinger (ren tekst)",
"Sharing email (HTML)" : "Delings-epost (HTML)",
"Sharing email (plain text fallback)" : "Delings-epost (ren tekst)",
"Lost password mail" : "E-post om mistet passord",
"New user email (HTML)" : "E-post om ny bruker (HTML)",
"New user email (plain text fallback)" : "E-post om ny bruker (ren tekst)",
"Activity notification mail" : "E-post med varsling om aktivitet",
"Mail Templates" : "Maler for e-poster",
"Theme" : "Tema",
"Template" : "Mal",
"Please choose a template" : "Velg en mal",
"Save" : "Lagre"
},
"nplurals=2; plural=(n != 1);");
|
import SPELLS from 'common/SPELLS';
/*
* Fields:
* int: spell scales with Intellect
* crit: spell scales with (is able to or procced from) Critical Strike
* hasteHpm: spell does more healing due to Haste, e.g. HoTs that gain more ticks
* hasteHpct: spell can be cast more frequently due to Haste, basically any spell except for non haste scaling CDs
* mastery: spell is boosted by Mastery
* masteryStack: spell's HoT counts as a Mastery Stack
* vers: spell scales with Versatility
* multiplier: spell scales with whatever procs it, should be ignored for purpose of weights and for 'total healing' number
* ignored: spell should be ignored for purpose of stat weights
*/
// This only works with actual healing events; casts are not recognized.
export default {
[SPELLS.OCEANS_EMBRACE.id]: { // Sea Star of the Depthmother
int: false,
crit: true,
hasteHpct: true, // until LoD's CD is below 8 sec, this speeds up the deck cycle time
mastery: false,
vers: true,
},
[SPELLS.GUIDING_HAND.id]: { // The Deceiver's Grand Design
int: false,
crit: true,
hasteHpct: false, // static CD
hasteHpm: true,
mastery: false,
vers: true,
},
[SPELLS.HIGHFATHERS_TIMEKEEPING_HEAL.id]: { // Highfather's Machination
int: false,
crit: true,
hasteHpct: true,
hasteHpm: false,
mastery: false,
vers: true,
},
[SPELLS.LEECH.id]: { // procs a percent of all your healing, so we ignore for weights and total healing
multiplier: true,
},
[SPELLS.VELENS_FUTURE_SIGHT_HEAL.id]: { // while active procs from any healing, so we ignore for weights and total healing
multiplier: true,
},
[SPELLS.LIGHTS_EMBRACE_HEALING.id]: {
int: false,
crit: true,
hasteHpct: false,
mastery: false,
vers: true,
},
[SPELLS.INFUSION_OF_LIGHT_HEALING.id]: {
int: false,
crit: true,
hasteHpct: false,
mastery: false,
vers: true,
},
[SPELLS.CHAOTIC_DARKNESS_HEALING.id]: {
int: false,
crit: true,
hasteHpct: false,
mastery: false,
vers: true,
},
[SPELLS.EONARS_COMPASSION_HEAL.id]: {
int: false,
crit: true,
hasteHpct: false,
mastery: false,
vers: true,
},
[SPELLS.XAVARICS_MAGNUM_OPUS.id]: { // Prydaz
int: false,
crit: false,
hasteHpct: false,
mastery: false,
vers: true,
},
[SPELLS.HEALTHSTONE.id]: {
int: false,
crit: false,
hasteHpct: false,
mastery: false,
vers: false, // not 100% sure
},
[SPELLS.MARK_OF_THE_ANCIENT_PRIESTESS.id]: {
int: false,
crit: true,
hasteHpct: false,
mastery: false,
vers: true,
},
//TODO: Add Shadowbind, it scales from the crit on the damage part
};
|
/* */
var apply = require('./_apply'),
castPath = require('./_castPath'),
isKey = require('./_isKey'),
last = require('./last'),
parent = require('./_parent'),
toKey = require('./_toKey');
function baseInvoke(object, path, args) {
if (!isKey(path, object)) {
path = castPath(path);
object = parent(object, path);
path = last(path);
}
var func = object == null ? object : object[toKey(path)];
return func == null ? undefined : apply(func, object, args);
}
module.exports = baseInvoke;
|
import React from 'react';
import SPELLS from 'common/SPELLS';
import { calculateAzeriteEffects } from 'common/stats';
import { formatPercentage } from 'common/format';
import AzeritePowerStatistic from 'interface/statistics/AzeritePowerStatistic';
import BoringSpellValueText from 'interface/statistics/components/BoringSpellValueText';
import ItemHealingDone from 'interface/others/ItemHealingDone';
import Analyzer from 'parser/core/Analyzer';
import isAtonement from '../core/isAtonement';
const DEPTH_OF_THE_SHADOWS_BONUS_MS = 2000;
const EVANGELISM_BONUS_MS = 6000;
class DepthOfTheShadows extends Analyzer {
_bonusFromAtonementDuration = 0;
_bonusFromDirectHealBuff = 0;
_bonusHealingForSingleDepthStack = 0;
_lastCastIsShadowmend = false;
_shadowmends = [];
constructor(...args) {
super(...args);
this.active = this.selectedCombatant.hasTrait(SPELLS.DEPTH_OF_THE_SHADOWS.id);
if (!this.active) {
return;
}
this._bonusHealingForSingleDepthStack = this.selectedCombatant.traitsBySpellId[SPELLS.DEPTH_OF_THE_SHADOWS.id]
.reduce((sum, rank) => sum + calculateAzeriteEffects(SPELLS.DEPTH_OF_THE_SHADOWS.id, rank)[0], 0);
}
on_byPlayer_cast(event) {
const spellId = event.ability.guid;
if(spellId !== SPELLS.SHADOW_MEND.id && spellId !== SPELLS.EVANGELISM_TALENT.id) {
return;
}
if (spellId === SPELLS.SHADOW_MEND.id) {
this._lastCastIsShadowmend = true;
}
if (spellId === SPELLS.EVANGELISM_TALENT.id){
this._shadowmends.forEach((cast, castIndex) => {
// We search for atonements applied with shadowmend that were in their
// normal atonement window when evangelism was casted
if(event.timestamp > cast.applyBuff.timestamp
&& event.timestamp < cast.applyBuff.timestamp + SPELLS.SHADOW_MEND.atonementDuration) {
this._shadowmends[castIndex].wasExtendedByEvangelismPreDepthWindow = true;
}
// We search for atonements applied with shadowmend that were in their
// depth window when evangelism was casted
if(event.timestamp > cast.applyBuff.timestamp + SPELLS.SHADOW_MEND.atonementDuration
&& event.timestamp < cast.applyBuff.timestamp + SPELLS.SHADOW_MEND.atonementDuration + DEPTH_OF_THE_SHADOWS_BONUS_MS){
this._shadowmends[castIndex].wasExtendedByEvangelismInDepthWindow = true;
}
});
}
}
on_byPlayer_applybuff(event) {
const spellId = event.ability.guid;
if(spellId !== SPELLS.ATONEMENT_BUFF.id){
return;
}
if (this._lastCastIsShadowmend) {
this._lastCastIsShadowmend = false;
this._shadowmends.push({
"applyBuff": event,
"atonementEvents": [],
"wasExtendedByEvangelismPreDepthWindow": false,
"wasExtendedByEvangelismInDepthWindow": false,
});
}
}
// After discussing this with multiple other priests, we concluded that
// atonements that were extended by evangelism in their depth window would
// be counted for it's entire duration since you woudn't have had atonement
// on the target in the first place. This is done here by not increasing
// the lower bound if it was extended by evangelism in the depth window
calculateBonusAtonement(event) {
if(!isAtonement(event)) { return; }
this._shadowmends.forEach((cast, castIndex) => {
const lowerBound = cast.applyBuff.timestamp
+ (cast.wasExtendedByEvangelismPreDepthWindow ? EVANGELISM_BONUS_MS : 0)
+ SPELLS.SHADOW_MEND.atonementDuration;
const upperBound = cast.applyBuff.timestamp
+ (cast.wasExtendedByEvangelismPreDepthWindow || cast.wasExtendedByEvangelismInDepthWindow ? EVANGELISM_BONUS_MS : 0)
+ SPELLS.SHADOW_MEND.atonementDuration
+ DEPTH_OF_THE_SHADOWS_BONUS_MS;
if(event.targetID === cast.applyBuff.targetID && event.timestamp > lowerBound && event.timestamp < upperBound) {
this._bonusFromAtonementDuration += event.amount;
this._shadowmends[castIndex].atonementEvents.push(event);
}
});
}
on_byPlayer_heal(event) {
if (event.ability.guid === SPELLS.SHADOW_MEND.id) {
let _depthStacks = 0;
const depthBuff = this.selectedCombatant.getBuff(SPELLS.DEPTH_OF_THE_SHADOWS_BUFF.id);
if(depthBuff) { _depthStacks = depthBuff.stacks; }
const bonusHealing = _depthStacks * this._bonusHealingForSingleDepthStack;
if(!event.overheal || (event.overheal && event.overheal < bonusHealing)) {
this._bonusFromDirectHealBuff += bonusHealing - (event.overheal || 0);
}
}
this.calculateBonusAtonement(event);
}
statistic() {
const total = this._bonusFromAtonementDuration + this._bonusFromDirectHealBuff;
const totalPct = this.owner.getPercentageOfTotalHealingDone(total);
const bonusFromAtonementPct = this.owner.getPercentageOfTotalHealingDone(this._bonusFromAtonementDuration);
const bonusFromDirectHealBuffPct = this.owner.getPercentageOfTotalHealingDone(this._bonusFromDirectHealBuff);
return (
<AzeritePowerStatistic
size="small"
tooltip={(
<>
Depth of the Shadow provided <b>{formatPercentage(totalPct)}%</b> healing.
<ul>
<li><b>{formatPercentage(bonusFromAtonementPct)}%</b> from extended Atonement</li>
<li><b>{formatPercentage(bonusFromDirectHealBuffPct)}%</b> from direct shadow mend buff</li>
</ul>
</>
)}
>
<BoringSpellValueText
spell={SPELLS.DEPTH_OF_THE_SHADOWS}
>
<ItemHealingDone amount={total} />
</BoringSpellValueText>
</AzeritePowerStatistic>
);
}
}
export default DepthOfTheShadows;
|
// DATA_TEMPLATE: dom_data
oTest.fnStart( "oLanguage.sLengthMenu" );
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
oTest.fnTest(
"Menu language is 'Show _MENU_ entries' by default",
null,
function () { return oSettings.oLanguage.sLengthMenu == "Show _MENU_ entries"; }
);
oTest.fnTest(
"_MENU_ macro is replaced by select menu in DOM",
null,
function () { return $('select', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"A label input is used",
null,
function () { return $('label', oSettings.aanFeatures.l[0]).length == 1 }
);
oTest.fnTest(
"Default is put into DOM",
null,
function () {
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "Show " &&
anChildren[2].nodeValue == " entries";
return bReturn;
}
);
oTest.fnTest(
"Menu length language can be defined - no _MENU_ macro",
function () {
oSession.fnRestore();
oTable = $('#example').dataTable( {
"oLanguage": {
"sLengthMenu": "unit test"
}
} );
oSettings = oTable.fnSettings();
},
function () { return oSettings.oLanguage.sLengthMenu == "unit test"; }
);
oTest.fnTest(
"Menu length language definition is in the DOM",
null,
function () {
return $('label', oSettings.aanFeatures.l[0]).text() == "unit test";
}
);
oTest.fnTest(
"Menu length language can be defined - with _MENU_ macro",
function () {
oSession.fnRestore();
oTable = $('#example').dataTable( {
"oLanguage": {
"sLengthMenu": "unit _MENU_ test"
}
} );
oSettings = oTable.fnSettings();
},
function () {
var anChildren = $('label',oSettings.aanFeatures.l[0])[0].childNodes;
var bReturn =
anChildren[0].nodeValue == "unit " &&
anChildren[2].nodeValue == " test";
return bReturn;
}
);
oTest.fnTest(
"Only the _MENU_ macro",
function () {
oSession.fnRestore();
oTable = $('#example').dataTable( {
"oLanguage": {
"sLengthMenu": "_MENU_"
}
} );
oSettings = oTable.fnSettings();
},
function () {
var anChildren = oSettings.aanFeatures.l[0].childNodes;
var bReturn =
anChildren.length == 1 &&
$('select', oSettings.aanFeatures.l[0]).length == 1;
return bReturn;
}
);
oTest.fnComplete();
} );
|
/*
* Copyright (C) 2018 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas 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, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import PropTypes from 'prop-types'
import {Button} from '@instructure/ui-buttons'
import {IconFeedbackLine} from '@instructure/ui-icons'
import {ScreenReaderContent} from '@instructure/ui-a11y'
import I18n from 'i18n!edit_rubricCommentButton'
const CommentButton = ({onClick}) => (
<div>
<Button variant="icon" icon={<IconFeedbackLine />} margin="0 x-small 0 0" onClick={onClick}>
<ScreenReaderContent>{I18n.t('Add Additional Comments')}</ScreenReaderContent>
</Button>
</div>
)
CommentButton.propTypes = {
onClick: PropTypes.func.isRequired
}
export default CommentButton
|
module.exports = {
plugins: {
"postcss-import": {},
tailwindcss: {},
autoprefixer: {},
}
}
|
import { t } from '@lingui/macro';
import { formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS';
import { SpellLink } from 'interface';
import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events from 'parser/core/Events';
import BoringSpellValue from 'parser/ui/BoringSpellValue';
import Statistic from 'parser/ui/Statistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER';
const GOE_DURATION = 15000;
const debug = false;
class GuardianOfElune extends Analyzer {
GoEProcsTotal = 0;
lastGoEProcTime = 0;
consumedGoEProc = 0;
overwrittenGoEProc = 0;
nonGoEIronFur = 0;
GoEIronFur = 0;
nonGoEFRegen = 0;
GoEFRegen = 0;
constructor(...args) {
super(...args);
this.active = this.selectedCombatant.hasTalent(SPELLS.GUARDIAN_OF_ELUNE_TALENT.id);
this.addEventListener(
Events.applybuff.by(SELECTED_PLAYER).spell(SPELLS.GUARDIAN_OF_ELUNE),
this.onApplyBuff,
);
this.addEventListener(
Events.refreshbuff.by(SELECTED_PLAYER).spell(SPELLS.GUARDIAN_OF_ELUNE),
this.onRefreshBuff,
);
this.addEventListener(
Events.cast.by(SELECTED_PLAYER).spell(SPELLS.IRONFUR),
this.onCastIronfur,
);
this.addEventListener(
Events.cast.by(SELECTED_PLAYER).spell(SPELLS.FRENZIED_REGENERATION),
this.onCastFrenziedRegen,
);
}
onApplyBuff(event) {
this.lastGoEProcTime = event.timestamp;
debug && console.log('Guardian of Elune applied');
this.GoEProcsTotal += 1;
}
onRefreshBuff(event) {
// Captured Overwritten GoE Buffs for use in wasted buff calculations
this.lastGoEProcTime = event.timestamp;
debug && console.log('Guardian of Elune Overwritten');
this.GoEProcsTotal += 1;
this.overwrittenGoEProc += 1;
}
onCastIronfur(event) {
if (this.lastGoEProcTime !== event.timestamp) {
if (this.lastGoEProcTime === null) {
this.nonGoEIronFur += 1;
return;
}
const GoETimeframe = this.lastGoEProcTime + GOE_DURATION;
if (event.timestamp > GoETimeframe) {
this.nonGoEIronFur += 1;
} else {
this.consumedGoEProc += 1;
this.GoEIronFur += 1;
debug && console.log(`Guardian of Elune Proc Consumed / Timestamp: ${event.timestamp}`);
this.lastGoEProcTime = null;
}
}
}
onCastFrenziedRegen(event) {
if (this.lastGoEProcTime !== event.timestamp) {
if (this.lastGoEProcTime === null) {
this.nonGoEFRegen += 1;
return;
}
const GoETimeframe = this.lastGoEProcTime + GOE_DURATION;
if (event.timestamp > GoETimeframe) {
this.nonGoEFRegen += 1;
} else {
this.consumedGoEProc += 1;
this.GoEFRegen += 1;
debug && console.log(`Guardian of Elune Proc Consumed / Timestamp: ${event.timestamp}`);
this.lastGoEProcTime = null;
}
}
}
suggestions(when) {
const unusedGoEProcs = 1 - this.consumedGoEProc / this.GoEProcsTotal;
when(unusedGoEProcs)
.isGreaterThan(0.3)
.addSuggestion((suggest, actual, recommended) =>
suggest(
<span>
You wasted {formatPercentage(unusedGoEProcs)}% of your{' '}
<SpellLink id={SPELLS.GUARDIAN_OF_ELUNE.id} /> procs. Try to use the procs as soon as
you get them so they are not overwritten.
</span>,
)
.icon(SPELLS.GUARDIAN_OF_ELUNE.icon)
.actual(
t({
id: 'druid.guardian.suggestions.guardianOfElune.unused',
message: `${formatPercentage(unusedGoEProcs)}% unused`,
}),
)
.recommended(`${Math.round(formatPercentage(recommended))}% or less is recommended`)
.regular(recommended + 0.15)
.major(recommended + 0.3),
);
}
statistic() {
const unusedGoEProcs = 1 - this.consumedGoEProc / this.GoEProcsTotal;
return (
<Statistic
position={STATISTIC_ORDER.CORE(7)}
category={STATISTIC_CATEGORY.TALENTS}
size="flexible"
tooltip={
<>
You got total <strong>{this.GGProcsTotal}</strong> galactic guardian procs and{' '}
<strong>used {this.consumedGGProc}</strong> of them.
</>
}
>
<BoringSpellValue
spellId={SPELLS.GUARDIAN_OF_ELUNE.id}
value={`${formatPercentage(unusedGoEProcs)}%`}
label="Unused Guardian of Elune"
/>
</Statistic>
);
}
}
export default GuardianOfElune;
|
og.PrintCalendar = {};
og.PrintCalendar.printCalendar = function(genid){
var printWindow = this.createPrintWindow(genid);
var html = document.getElementById(genid + 'view_calendar').innerHTML.replace(/gridcontainer/, '');
printWindow.document.write(html);
og.PrintCalendar.closePrintWindow(printWindow);
}
og.PrintCalendar.createPrintWindow = function(genid){
var ancho = document.getElementById(genid + 'view_calendar').offsetWidth;
var alto = document.getElementById(genid + 'view_calendar').offsetHeight;
var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,scrollbars=yes,width="+ancho+", height="+(alto+20)+", left=100, top=25";
var printWindow = window.open("","",disp_setting);
var cal_height = 0;
var container = $('#calendar');
while ($(container) && $(container).height() == 0) {
container = $(container).parent();
}
if ($(container)) cal_height = $(container).height();
if (cal_height > 0) {
cal_height = (cal_height > 600 ? cal_height : 600) + 'px';
} else {
cal_height = '100%';
}
printWindow.document.open();
printWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">');
printWindow.document.write('<html><head><title>' + lang('print') + '</title>');
printWindow.document.write('<link href="' + og.hostName + '/public/assets/themes/default/stylesheets/website.css" rel="stylesheet" type="text/css">');
printWindow.document.write('<link href="' + og.hostName + '/public/assets/themes/default/stylesheets/event/week.css" rel="stylesheet" type="text/css">');
printWindow.document.write('<link href="' + og.hostName + '/public/assets/themes/default/stylesheets/event/day.css" rel="stylesheet" type="text/css">');
printWindow.document.write('<link href="' + og.hostName + '/public/assets/themes/default/stylesheets/calendar_print.css" rel="stylesheet" type="text/css">');
//printWindow.document.write('<style type="text/css" media="print">div.page {writing-mode: tb-rl;height: 80%;margin: 10% 0%;}</style>');
printWindow.document.write('</head><body onLoad="self.print()"><div class="page">');
return printWindow;
}
og.PrintCalendar.closePrintWindow = function(printWindow){
printWindow.document.write('</div></body></html>');
printWindow.document.close();
printWindow.focus();
}
|
dojo.provide("dojo.widget.ShowSlide");
dojo.require("dojo.widget.*");
dojo.require("dojo.lang.common");
dojo.widget.ShowSlide = function(){
}
dojo.lang.extend(dojo.widget.ShowSlide, {
title: "",
_action: -1,
isContainer: true,
_components: {},
_actions: [],
gotoAction: function(/*int*/ action){
this._action = action;
},
nextAction: function(/*Event?*/ event){
if((this._action + 1) != this._actions.length){
++this._action;
return true; // boolean
}
return false; // boolean
},
previousAction: function(/*Event?*/ event){
if((this._action - 1) != -1){
--this._action;
return true; // boolean
}
return false; // boolean
}
});
dojo.requireAfterIf("html", "dojo.widget.html.ShowSlide");
|
import React, {Component} from "react/addons";
import {createFolder} from "editor/actions/TreeActions";
class CreateFolder extends Component<{}, {}, {}> {
constructor() {
super();
this.handleApply = this.handleApply.bind(this);
this.handleClose = this.handleClose.bind(this);
}
handleClose() {
this.props.onClose();
}
handleApply(e) {
createFolder(this.props.options.get("parentId"), this.refs.nameInput.value);
}
render() {
return (
<div className="modal-dialog width-500">
<div className="modal-content">
<div className="modal-header">
<button className="close" onClick={this.handleClose} aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 className="modal-title">Create folder</h4>
</div>
<div className="modal-body">
<input type="text" className="form-control" name="folderName" ref="nameInput" autoFocus={true} />
</div>
<div className="modal-footer">
<button data-name="Cancel" type="button" className="btn btn-default" onClick={this.handleClose}>Cancel</button>
<input data-name="Apply" type="submit" onClick={this.handleApply} className="btn btn-primary" value="Apply" />
</div>
</div>
</div>
);
}
};
export default CreateFolder;
|
define(['joose', 'Psc/UI/FormBuilder'], function(Joose) {
/**
* Ein Trait für ein Objekt welche einen FormBuilder benutzen
*
*/
Joose.Role('Psc.UI.FormBuilding', {
has: {
formBuilder: { is : 'rw', required: false, isPrivate: true }
},
before: { // after ist bissl schlecht, weil main z.b. den eventmanager schon beim after: initialize braucht, ich weiss aber nicht wie ich steuern kann, welches "after" zuerst ausgeführt wird?, before scheint aber erstmal gut zu laufen
initialize: function (props) {
if (!props.formBuilder) {
this.$$formBuilder = new Psc.UI.FormBuilder();
}
}
}
});
});
|
Ext.ns('Docs');
Docs.ApiViewport = Ext.extend(Ext.Viewport, {
constructor : function(cfg) {
cfg = Ext.apply(cfg ||{}, {
layout:'border',
items : this.buildItems()
});
this.constructor.superclass.constructor.call(this,cfg);
},
buildItems : function() {
return [
//North
{
cls: 'docs-header',
height: 36,
region:'north',
xtype:'box',
el:'header',
border:false,
margins: '0 0 5 0'
},
//West
{
xtype : 'apitreepanel',
itemId : 'apiTreePanel',
region:'west',
split:true,
width: 280,
minSize: 175,
maxSize: 500,
margins:'0 0 5 5',
cmargins:'0 0 0 0',
collapsible: true,
collapseMode:'mini',
listeners : {
scope : this,
click : this.onApiTreePanelClick,
afterrender : function(treePanel) {
treePanel.expandPath('/root/apidocs');
}
}
},
//Central
{
xtype : 'apitabpanel',
itemId : 'apiTabPanel',
id:'doc-body',
region:'center',
margins:'0 5 5 0',
listeners : {
scope : this,
tabchange : this.onApiTabPanelTabChange,
render : {
delay : 250,
fn : this.onAfterRenderLoadClass
}
}
}
];
},
getApiTabPanel : function() {
return this.getComponent('apiTabPanel');
},
getApiTreePanel : function() {
return this.getComponent('apiTreePanel');
},
onAfterRenderLoadClass : function() {
var page = window.location.href.split('?')[1];
if(page){
var ps = Ext.urlDecode(page),
cls = ps['class'];
this.getApiTabPanel().loadClass('output/' + cls + '.html', cls, ps.member);
}
this.doLayout();
},
onApiTreePanelClick : function(node, evtObj) {
if(node.isLeaf()){
evtObj.stopEvent();
this.getApiTabPanel().loadClass(node.attributes.href, node.id);
}
},
onApiTabPanelTabChange : function(tp, tab){
this.getApiTreePanel().selectClass(tab.cclass);
}
});
|
$.extend(window.lang_id, {
"Title": "Apakah Anda Melainkan ..",
"installApp": "Gunakan Aplikasi untuk membagikan jajak pendapat ini!",
"installAppComments": "Download gratis.",
"haveApp": "Aku sudah App!",
"SecondPageButton": "Bermain",
"Welcome": "Halo selamat datang!",
"rules": "1. Klik link aplikasi untuk memuat votasi <br/> 2. Pilih suara anda <br/> 3. Bagikan gambar yang diperbarui kepada siapa saja!",
"MakeNew": "Poll baru",
"Create": "Membuat",
"VotedPolls": "Voting polling:",
"swipeToRemove": "Gesek untuk menghapus",
"showYourPolls": "Tunjukkan jajak pendapatmu",
"Return": "Kembali",
"Share+": "Bagikan +",
"Share": "Bagikan",
"Save": "Menyimpan",
"Voters": "Pemilih",
"Cancel": "Membatalkan",
"needsPhone": "Untuk mendapatkan suara di poling umum, kami mencegah agar bots mengirim SMS ke nomor telepon Anda",
"needsPhoneComment": "Identifikasi ini disediakan oleh rangkaian pengembangan twitter auth dan aplikasi ini akan mengenkripsi nomor telepon Anda.",
"multipleChoice": "Biarkan memilih beberapa pilihan.",
"onlyDevice": "Pilih hanya suara dari App.",
"openVotes": "Membuka suara",
"firstOk": "Baik",
"Activate": "Mengaktifkan",
"downloadAppStore": "Pasang aplikasi dan bagikan!",
"createPoll": "Bagikan polis ke manapun Anda inginkan:",
"QuestionPlaceholder": "Tuliskan disini pertanyaannya, sertakan info tambahan di jalur lain.",
"OptionsPlaceholder": "Masukkan setiap pilihan pada baris yang berbeda.",
"UsernamePlaceholder": "Nama anda (opsional)",
"PublicOnlyFromApp": "Untuk memilih di poling umum, Anda perlu menggunakan <u> APP </ u>",
"PollOnlyAvailableIn": "Jajak pendapat ini hanya tersedia di",
"AllowAppServices": "Tolong, <b> perbaiki </ b> pengalaman pengguna Anda sehingga memungkinkan penggunaan akses <b> '</ b>.",
"whyNeedServicesPermission": "Mengapa perlu ini? <br/> Sejak versi 5.0 Lollipop 5.0, diperlukan izin khusus untuk membaca penggunaan aplikasi. Kami membutuhkan ini untuk meningkatkan penerapan dengan aplikasi sosial lainnya.",
"votationNotExists": "Pemungutan suara tidak ada",
"votationNotSaved": "Tidak dapat terhubung ke server: voting tidak disimpan",
"waitingKey": "Membuat demokrasi ..",
"waitingKeyExpired": "Kesalahan saat menyimpan jajak pendapat Coba lagi..",
"onlyMostVotedShows": "Secara default hanya 4 pilihan yang paling terpilih yang ditampilkan di gambar bersama.",
"hidePolls": "Menyembunyikan jajak pendapat",
"notPublicUsers": "Tidak ada nama pemilih",
"missingAjaxKey": "Batas waktu meminta kunci polling, silakan cek koneksi internet anda.",
"more": "lebih",
"min1Option": "Letakkan setidaknya 1 pilihan",
"min2Options": "Pilihan tidak boleh kosong",
"duplicatedOptions": "Pilihan duplikat!",
"myName": "Masukkan nama panggilan",
"requiredName": "Masukkan nama anda (wajib)",
"privateNeedUserName": "Tambahkan nama Anda diperlukan (hanya untuk polling pribadi)",
"unknown": "Tidak diketahui",
"browser": "Browser",
"notInApp": "Gunakan App untuk meneruskan polling.",
"pollWillVisible": "Terima kasih. Jajak pendapat akan terlihat dalam beberapa jam ke depan!",
"error": "kesalahan",
"errorAjaxResponse": "Kesalahan saat mengambil respon ajax",
"votationNotFound": "Pemungutan suara tidak ditemukan",
"WrongCountry": "Anda tidak berada di tempat",
"notValidUserId": "Id pengguna tidak valid",
"notLoadingPolls": "Kesalahan pemuatan jajak pendapat",
"warnNotPublic": "Peringatkan: jajak pendapat ini bersifat pribadi dan tidak memvalidasi pemilih, jadi tidak berlaku untuk pemungutan suara publik",
"e_noDataReceived": "Tidak ada data yang diambil",
"e_phoneValidationNotWork": "Masalah untuk melakukan verifikasi SMS? Tolong kalau begitu hubungi kami.",
"warnMaximumOptions": "Verifikasi gambar tidak dipotong di lingkungan bersama",
"e_retrievingData": "Polling tidak ditemukan, periksa koneksi internet anda:",
"loadingPublicKey": "Memvalidasi nomor telepon, tunggu sebentar dan coba lagi ..",
"PopularPolls": "Jajak pendapat populer:",
"total": "total",
"New": "Baru",
"search": "pencarian",
"showAll": "Tunjukkan semua negara",
"showMine": "Default",
"duplicatedKey": "Digandakan kunci",
"noPollsFound": "Bukan jajak pendapat yang ditemukan",
"forgetPoll": "lupakan ini",
"UNDO": "MEMBUKA",
"Votes": "Suara",
"ClickTheLink": "Link untuk memilih!",
"CustomStyles": "Gaya default:",
"defaults": "Default",
"Symbol": "Simbol:",
"ChooseFile": "Upload gambar",
"QuestionColor": "Warna pertanyaan:",
"OptionTextColor": "Warna teks opsi:",
"BackgroundColor": "Warna latar belakang:",
"GradientBackground": "Latar belakang gradasi:",
"GradientColor1": "Gradien warna 1:",
"GradientColor2": "Warna gradien 2:",
"LimitByCountry": "Batas menurut wilayah:",
"WillShowPublic": "- Jajak pendapat publik akan ditampilkan di halaman 'jajak pendapat publik'.",
"ChooseCountry": "Memilih",
"ExampleQuestion": "Ini adalah contoh pertanyaan <br> Dan ini adalah beberapa teks tambahan",
"OptionExample1": "Contoh pilihan A",
"OptionExample2": "Contoh pilihan B",
"ownerNameExample": "nama pemilik",
"AddPollLink": "Tambahkan LINK web tambahan untuk polling ini",
"Public": "Publik",
"StyleNamePlaceholder": "Nama gaya",
"SaveStyle": "Menyimpan",
"Delete": "Menghapus",
"allCountries": "Negara manapun ..",
"Yes": "iya nih",
"Not": "Tidak",
"cantChangePublic": "Jajak pendapat ini sudah disimpan. Untuk mengubah nilai Publik, batalkan ini dan buatlah yang baru.",
"noUserCountryFound": "Kesalahan: tidak dapat mengambil negara telepon Anda, hubungi kami",
"p_notEditable": "Tidak tersedia pilihan disini.",
"e_votationRemoved": "Maaf, pemungutan suara ini telah dihapus",
"e_connectionLost": "Koneksi terputus",
"e_votationWithErrors": "Maaf, pemungutan suara memiliki kesalahan. Silahkan hubungi kami.",
"e_flagNotFound": "Tidak bisa memuat bendera",
"e_parsingIndexFile": "Kesalahan parsing file _index.txt",
"e_connection": "Silahkan cek koneksi internet anda dan coba lagi",
"e_publicPolls": "Tidak ditemukan jajak pendapat umum",
"e_imageNotFound": "Kesalahan: gambar tidak ditemukan",
});
|
/* */
var baseDifference = require('./_baseDifference'),
baseFlatten = require('./_baseFlatten'),
isArrayLikeObject = require('./isArrayLikeObject'),
rest = require('./rest');
var difference = rest(function(array, values) {
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, true)) : [];
});
module.exports = difference;
|
// CHANGE FOR APPS HOSTED IN SUBDIRECTORY
FCKRelativePath = '';
// DON'T CHANGE THESE
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector='+FCKRelativePath+'/fckeditor/command';
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector='+FCKRelativePath+'/fckeditor/command';
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector='+FCKRelativePath+'/fckeditor/command';
FCKConfig.LinkUploadURL = FCKRelativePath+'/fckeditor/upload';
FCKConfig.ImageUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Image';
FCKConfig.FlashUploadURL = FCKRelativePath+'/fckeditor/upload?Type=Flash';
FCKConfig.SpellerPagesServerScript = FCKRelativePath+'/fckeditor/check_spelling';
FCKConfig.AllowQueryStringDebug = false;
FCKConfig.SpellChecker = 'SpellerPages';
// ONLY CHANGE BELOW HERE
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/silver/';
FCKConfig.ToolbarSets["Simple"] = [
['Source','-','-','Templates'],
['Cut','Copy','Paste','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'],
'/',
['Image','Table','Rule','Smiley'],
['FontName','FontSize'],
['TextColor','BGColor'],
['-','About']
] ;
|
//// [tests/cases/compiler/importHelpersNoModule.ts] ////
//// [external.ts]
export class A { }
export class B extends A { }
declare var dec: any;
@dec
class C {
method(@dec x: number) {
}
}
//// [script.ts]
class A { }
class B extends A { }
declare var dec: any;
@dec
class C {
method(@dec x: number) {
}
}
//// [external.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var A = (function () {
function A() {
}
return A;
}());
exports.A = A;
var B = (function (_super) {
tslib_1.__extends(B, _super);
function B() {
return _super !== null && _super.apply(this, arguments) || this;
}
return B;
}(A));
exports.B = B;
var C = (function () {
function C() {
}
C.prototype.method = function (x) {
};
tslib_1.__decorate([
tslib_1.__param(0, dec),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", [Number]),
tslib_1.__metadata("design:returntype", void 0)
], C.prototype, "method", null);
C = tslib_1.__decorate([
dec
], C);
return C;
}());
//// [script.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var A = (function () {
function A() {
}
return A;
}());
var B = (function (_super) {
__extends(B, _super);
function B() {
return _super !== null && _super.apply(this, arguments) || this;
}
return B;
}(A));
var C = (function () {
function C() {
}
C.prototype.method = function (x) {
};
__decorate([
__param(0, dec),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Number]),
__metadata("design:returntype", void 0)
], C.prototype, "method", null);
C = __decorate([
dec
], C);
return C;
}());
|
var ListCache = require('./_ListCache'),
stackClear = require('./_stackClear'),
stackDelete = require('./_stackDelete'),
stackGet = require('./_stackGet'),
stackHas = require('./_stackHas'),
stackSet = require('./_stackSet');
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
|
var t = new Map();
var objectKey = {};
var stringKey = 'keykeykey';
var numberKey = 42.24;
var booleanKey = true;
var undefinedKey = undefined;
var nullKey = null;
var nanKey = NaN;
var zeroKey = 0;
var frozenKey = Object.freeze({});
assert.equal(t.size, 0);
assert.isUndefined(t.get(objectKey));
assert.isUndefined(t.get(frozenKey));
assert.isFalse(t.has(objectKey));
assert.isFalse(t.has(frozenKey));
t.set(undefinedKey, 'value8');
t.set(nullKey, 'value9');
t.set(stringKey, 'value5');
t.set(numberKey, 'value6');
t.set(booleanKey, 'value7');
t.set(objectKey, 'value1');
t.set(nanKey, 'value10');
t.set(zeroKey, 'value11');
t.set(frozenKey, 'value12');
assert.equal(t.size, 9);
assert.equal(t.get(objectKey), 'value1');
assert.equal(t.get(stringKey), 'value5');
assert.equal(t.get(numberKey), 'value6');
assert.equal(t.get(booleanKey), 'value7');
assert.equal(t.get(undefinedKey), 'value8');
assert.equal(t.get(nullKey), 'value9');
assert.equal(t.get(nanKey), 'value10');
assert.equal(t.get(zeroKey), 'value11');
assert.equal(t.get(frozenKey), 'value12');
assert.equal(t.get({}), undefined);
assert.equal(t.get('keykeykey'), 'value5');
assert.equal(t.get(42.24), 'value6');
assert.equal(t.get(true), 'value7');
assert.equal(t.get(undefined), 'value8');
assert.equal(t.get(null), 'value9');
assert.equal(t.get(NaN), 'value10');
assert.equal(t.get(0), 'value11');
assert.equal(t.get(1 / Infinity), 'value11');
assert.equal(t.get(Object.freeze({})), undefined);
// V8 is broken for -0
// https://code.google.com/p/v8/issues/detail?id=3906
// assert.equal(t.get(-1 / Infinity), 'value11');
assert.isTrue(!t.has({}));
assert.isTrue(t.has(objectKey));
assert.isTrue(t.has(stringKey));
assert.isTrue(t.has(numberKey));
assert.isTrue(t.has(booleanKey));
assert.isTrue(t.has(undefinedKey));
assert.isTrue(t.has(nullKey));
assert.isTrue(t.has(nanKey));
assert.isTrue(t.has(zeroKey));
assert.isTrue(t.has(frozenKey));
assert.isTrue(t.has('keykeykey'));
assert.isTrue(t.has(42.24));
assert.isTrue(t.has(true));
assert.isTrue(t.has(undefined));
assert.isTrue(t.has(null));
assert.isTrue(t.has(NaN));
assert.isTrue(t.has(0));
// V8 is broken for -0
// https://code.google.com/p/v8/issues/detail?id=3906
// assert.isTrue(t.has(-0));
// forEach
var arrKeys = [];
var arr = [];
var cnt = 0;
t.forEach(function (value, key, map) {
if (cnt === 0) {
t.set('foo', 42);
}
assert.equal(map, t);
arrKeys.push(key);
arr.push(value);
cnt++;
});
assert.equal(cnt, 10);
t.delete('foo');
assertArrayEquals(arrKeys, [
undefinedKey,
nullKey,
stringKey,
numberKey,
booleanKey,
objectKey,
nanKey,
zeroKey,
frozenKey,
'foo'
]);
assertArrayEquals(arr, [
'value8',
'value9',
'value5',
'value6',
'value7',
'value1',
'value10',
'value11',
'value12',
42
]);
// iterator
arrKeys = [];
arr = [];
cnt = 0;
for (var mapIterItem of t) {
if (cnt === 0) {
t.set('foo', 42);
}
var [mapIterItemKey, mapIterItemVal] = mapIterItem;
arrKeys.push(mapIterItemKey);
arr.push(mapIterItemVal);
cnt++;
}
assert.equal(cnt, 10);
t.delete('foo');
assertArrayEquals(arrKeys, [ undefinedKey, nullKey, stringKey,
numberKey, booleanKey, objectKey,
nanKey, zeroKey, frozenKey, 'foo' ]);
assertArrayEquals(arr, [
'value8',
'value9',
'value5',
'value6',
'value7',
'value1',
'value10',
'value11',
'value12',
42
]);
// .entries()
arrKeys = [];
arr = [];
cnt = 0;
for (var mapIterItem of t.entries()) {
var [mapIterItemKey, mapIterItemVal] = mapIterItem;
arrKeys.push(mapIterItemKey);
arr.push(mapIterItemVal);
cnt++;
}
assert.equal(cnt, 9);
assertArrayEquals(arrKeys, [
undefinedKey,
nullKey,
stringKey,
numberKey,
booleanKey,
objectKey,
nanKey,
zeroKey,
frozenKey
]);
assertArrayEquals(arr, [
'value8',
'value9',
'value5',
'value6',
'value7',
'value1',
'value10',
'value11',
'value12'
]);
// .keys()
arrKeys = [];
cnt = 0;
for (var mapIterKey of t.keys()) {
arrKeys.push(mapIterKey);
cnt++;
}
assert.equal(cnt, 9);
assertArrayEquals(arrKeys, [
undefinedKey,
nullKey,
stringKey,
numberKey,
booleanKey,
objectKey,
nanKey,
zeroKey,
frozenKey
]);
// .values()
arr = [];
cnt = 0;
for (var mapIterVal of t.values()) {
arr.push(mapIterVal);
cnt++;
}
assert.equal(cnt, 9);
assertArrayEquals(arr, [
'value8',
'value9',
'value5',
'value6',
'value7',
'value1',
'value10',
'value11',
'value12'
]);
var t3 = new Map([ [[],[]], [{},{}], [NaN,NaN] ]);
var deleteReturnValue;
assert.equal(t3.size, 3);
assert.isTrue(t3.has(NaN));
assert.isTrue(isNaN(t3.get(NaN)));
assert.equal(t3.set(NaN, NaN), t3); // test of 23.1.3.9.11
deleteReturnValue = t3.delete(NaN);
assert.equal(t3.size, 2);
assert.isTrue(deleteReturnValue);
deleteReturnValue = t3.delete(NaN);
assert.equal(t3.size, 2);
assert.isFalse(deleteReturnValue);
t3.clear();
assert.equal(t3.size, 0);
assert.equal(Map.prototype[Symbol.iterator], Map.prototype.entries);
|
//FirstView Component Constructor
var queViewArray = [];
function FirstView() {
var QueDetailWindow = require('ui/common/QueDetailWindow');
var mainBackgroundColor = "gray";
var queWholeValue = [];
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView({
backgroundColor: mainBackgroundColor
});
var queHeight = Ti.Platform.displayCaps.platformHeight / 6;
var pushButtonView = Ti.UI.createImageView({
image: "/images/push_button_250_250.png",
zIndex: 999
});
self.add(pushButtonView);
var resetButtonView = Ti.UI.createImageView({
image: "/images/reset.jpg",
top: 10,
right: 10,
width: 50,
height: 50,
zIndex: 999
});
self.add(resetButtonView);
var queIndex = 0;
pushButtonView.addEventListener("click", function(e) {
if (queIndex < 6) {
var queValue = Math.random() >= 0.5 ? 1 : 0;
console.log(queValue);
queWholeValue.push(queValue);
var options = {
queIndex: queIndex,
queHeight: queHeight,
backgroundColor: mainBackgroundColor
}
var queView = createQueView(queValue, options);
self.add(queView);
} else if (queIndex == 6) { // if que == 6, xin hao dong
// xin hao dong
var haoDong = Math.floor(Math.random() * 6);
highlightHao(haoDong);
// reverse que lai, doc tu duoi len
queWholeValue.reverse();
// add hao dong vao queWholeValue
queWholeValue.push(haoDong);
console.log(queWholeValue.toString());
// xin xong, chuyen sang window khac
self.hide();
var queWindow = new QueDetailWindow({
data: queWholeValue
});
queWindow.open();
}
queIndex++;
});
resetButtonView.addEventListener("click", function(e) {
queWholeValue = [];
queIndex = 0;
removeAllQueViews(self);
queViewArray = [];
});
return self;
}
function createQueView(queValue, options) {
var queIndex = options["queIndex"];
var queHeight = options["queHeight"] * 90 / 100;
var backgroundColor = options["backgroundColor"];
var _queView = Ti.UI.createView({
top: queHeight * queIndex,
height: queHeight,
width: "100%",
borderColor: backgroundColor,
borderWidth: 5,
borderRadius: 20,
backgroundColor: queValue == 1 ? "black" : "white"
});
queViewArray.push(_queView);
return _queView;
}
function removeAllQueViews(window) {
for( var i = 0; i < queViewArray.length; i++) {
var _queView = queViewArray[i];
window.remove(_queView);
}
}
function highlightHao(index) {
var _queView = queViewArray[index];
_queView.backgroundColor = "#900";
}
module.exports = FirstView;
|
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {getMode} from '../mode';
import {urls} from '../config';
/**
* Internal structure that maintains the state of an extension through loading.
*
* @typedef {{
* extensionId: (string|undefined),
* extensionVersion: (string|undefined),
* }}
* @private
*/
let ExtensionInfoDef;
/**
* Calculate the base url for any scripts.
* @param {!Location} location The window's location
* @param {boolean=} opt_isLocalDev
* @return {string}
*/
export function calculateScriptBaseUrl(location, opt_isLocalDev) {
if (opt_isLocalDev) {
let prefix = `${location.protocol}//${location.host}`;
if (
location.protocol == 'about:' ||
location.protocol == 'blob:' ||
location.protocol == 'data:'
) {
prefix = '';
}
return `${prefix}/dist`;
}
return urls.cdn;
}
/**
* Calculate script url for an extension.
* @param {!Location} location The window's location
* @param {string} extensionId
* @param {string=} opt_extensionVersion
* @param {boolean=} opt_isLocalDev
* @return {string}
*/
export function calculateExtensionScriptUrl(
location,
extensionId,
opt_extensionVersion,
opt_isLocalDev
) {
const fileExtension = getMode().esm ? '.mjs' : '.js';
const base = calculateScriptBaseUrl(location, opt_isLocalDev);
const rtv = getMode().rtvVersion;
if (opt_extensionVersion == null) {
opt_extensionVersion = '0.1';
}
const extensionVersion = opt_extensionVersion
? '-' + opt_extensionVersion
: '';
return `${base}/rtv/${rtv}/v0/${extensionId}${extensionVersion}${fileExtension}`;
}
/**
* Calculate script url for an entry point.
* If `opt_rtv` is true, returns the URL matching the current RTV.
* @param {!Location} location The window's location
* @param {string} entryPoint
* @param {boolean=} isLocalDev
* @param {boolean=} opt_rtv
* @return {string}
*/
export function calculateEntryPointScriptUrl(
location,
entryPoint,
isLocalDev,
opt_rtv
) {
const fileExtension = getMode().esm ? '.mjs' : '.js';
const base = calculateScriptBaseUrl(location, isLocalDev);
if (isLocalDev) {
return `${base}/${entryPoint}${fileExtension}`;
}
if (opt_rtv) {
return `${base}/rtv/${getMode().rtvVersion}/${entryPoint}${fileExtension}`;
}
return `${base}/${entryPoint}${fileExtension}`;
}
/**
* Parse the extension version from a given script URL.
* @param {string} scriptUrl
* @return {!ExtensionInfoDef}
*/
export function parseExtensionUrl(scriptUrl) {
// Note that the "(\.max)?" group only applies to local dev.
const matches = scriptUrl.match(
/^(.*)\/(.*)-([0-9.]+|latest)(\.max)?\.(?:js|mjs)$/i
);
return {
extensionId: matches ? matches[2] : undefined,
extensionVersion: matches ? matches[3] : undefined,
};
}
|
Bridge.merge(new System.Globalization.CultureInfo("en-ZM", true), {
englishName: "English (Zambia)",
nativeName: "English (Zambia)",
numberFormat: Bridge.merge(new System.Globalization.NumberFormatInfo(), {
nanSymbol: "NaN",
negativeSign: "-",
positiveSign: "+",
negativeInfinitySymbol: "-∞",
positiveInfinitySymbol: "∞",
percentSymbol: "%",
percentGroupSizes: [3],
percentDecimalDigits: 2,
percentDecimalSeparator: ".",
percentGroupSeparator: ",",
percentPositivePattern: 1,
percentNegativePattern: 1,
currencySymbol: "K",
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: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
abbreviatedMonthGenitiveNames: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],
abbreviatedMonthNames: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],
amDesignator: "AM",
dateSeparator: "/",
dayNames: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
firstDayOfWeek: 1,
fullDateTimePattern: "dddd, d MMMM yyyy h:mm:ss tt",
longDatePattern: "dddd, d MMMM yyyy",
longTimePattern: "h:mm:ss tt",
monthDayPattern: "d MMMM",
monthGenitiveNames: ["January","February","March","April","May","June","July","August","September","October","November","December",""],
monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December",""],
pmDesignator: "PM",
rfc1123: "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
shortDatePattern: "dd/MM/yyyy",
shortestDayNames: ["Su","Mo","Tu","We","Th","Fr","Sa"],
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 yyyy",
roundtripFormat: "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz"
}),
TextInfo: Bridge.merge(new System.Globalization.TextInfo(), {
ANSICodePage: 1252,
CultureName: "en-ZM",
EBCDICCodePage: 500,
IsRightToLeft: false,
LCID: 4096,
listSeparator: ",",
MacCodePage: 10000,
OEMCodePage: 850,
IsReadOnly: true
})
});
|
$(function () {
//popover for app list table
$('[data-toggle="popover"]').popover()
});
|
// do NOT import all the stuff from lab 1
// Lab 2
var view = Ti.UI.createView({
backgroundColor:'#000',
top:0,
left:0,
width:'100%',
height:'100%',
layout:'vertical'
});
// create labels, buttons, text fields
var usernameView = Ti.UI.createView({
backgroundColor:'#000',
top:0,
left:0,
width:'100%',
height:'100%',
layout:'horizontal'
});
// username.add(usernameLabel);
// username.add(usernameField);
// view.add(usernameView);
var helpLabel = Ti.UI.createLabel({
color:'#abcdef',
highlightedColor:'#0f0',
backgroundColor:'transparent',
width:200,
height:'auto',
text:'LOGIN INFO'
});
var usernameField = Titanium.UI.createTextField({
value:'Joe Bloggs',
color:'#abcdef',
backgroundColor: '#fff',
height:35,
top: 10,
//left:10,
width:250,
borderRadius: 10,
font:{fontSize:15},
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_LINE
});
var passwordField = Titanium.UI.createTextField({
hintText:'Enter password here',
color:'#abcdef',
backgroundColor: '#fff',
height:35,
top: 10,
//left:10,
width:250,
borderRadius: 10,
font:{fontSize:15},
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_LINE
});
var submitButton = Titanium.UI.createButton({
color:'#abcdef',
top: 20,
width:100,
height:40,
font:{fontSize:20,fontWeight:'bold',fontFamily:'Helvetica Neue'},
title:'Login'
});
view.add(helpLabel);
view.add(usernameField);
view.add(passwordField);
view.add(submitButton);
Ti.UI.currentWindow.add(view);
submitButton.addEventListener('click', function() {
Titanium.UI.currentTab.open(voteWin, {
animated : true
});
});
var voteWin = Titanium.UI.createWindow({
title : 'Vote',
backButtonTitle : 'Login',
navBarHidden : false,
backgroundColor: '#000',
username: usernameField.value
});
var usernameLabel = Titanium.UI.createLabel({
color:'#abcdef',
highlightedColor:'#0f0',
backgroundColor:'transparent',
width:200,
height:'auto',
text: voteWin.username
});
voteWin.add(usernameLabel);
|
Bridge.merge(new System.Globalization.CultureInfo("en-MH", true), {
englishName: "English (Marshall Islands)",
nativeName: "English (Marshall Islands)",
numberFormat: Bridge.merge(new System.Globalization.NumberFormatInfo(), {
nanSymbol: "NaN",
negativeSign: "-",
positiveSign: "+",
negativeInfinitySymbol: "-∞",
positiveInfinitySymbol: "∞",
percentSymbol: "%",
percentGroupSizes: [3],
percentDecimalDigits: 2,
percentDecimalSeparator: ".",
percentGroupSeparator: ",",
percentPositivePattern: 1,
percentNegativePattern: 1,
currencySymbol: "$",
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: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
abbreviatedMonthGenitiveNames: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],
abbreviatedMonthNames: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],
amDesignator: "AM",
dateSeparator: "/",
dayNames: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
firstDayOfWeek: 0,
fullDateTimePattern: "dddd, MMMM d, yyyy h:mm:ss tt",
longDatePattern: "dddd, MMMM d, yyyy",
longTimePattern: "h:mm:ss tt",
monthDayPattern: "MMMM d",
monthGenitiveNames: ["January","February","March","April","May","June","July","August","September","October","November","December",""],
monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December",""],
pmDesignator: "PM",
rfc1123: "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
shortDatePattern: "M/d/yyyy",
shortestDayNames: ["Su","Mo","Tu","We","Th","Fr","Sa"],
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 yyyy",
roundtripFormat: "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz"
}),
TextInfo: Bridge.merge(new System.Globalization.TextInfo(), {
ANSICodePage: 1252,
CultureName: "en-MH",
EBCDICCodePage: 500,
IsRightToLeft: false,
LCID: 4096,
listSeparator: ",",
MacCodePage: 10000,
OEMCodePage: 850,
IsReadOnly: true
})
});
|
/*global angular */
'use strict';
describe('Unit: ExampleCtrl', function() {
var ctrl;
beforeEach(function() {
// instantiate the app module
angular.mock.module('app');
// mock the controller
angular.mock.inject(function($controller) {
ctrl = $controller('ExampleCtrl');
});
});
it('should exist', function() {
expect(ctrl).toBeDefined();
});
it('should have a number variable equal to 1234', function() {
expect(ctrl.number).toEqual(1234);
});
it('should have a title variable equal to 'AngularJS, Gulp, and Browserify!'', function() {
expect(ctrl.title).toEqual('AngularJS, Gulp, and Browserify!');
});
});
|
var watson = require('watson-developer-cloud');
var config = require('../config');
exports.startSession = function(username, passwd, model, callback) {
if (model instanceof Function) {
callback = model;
if (config.lang == 'cht' || config.lang == 'chs') {
model = 'zh-CN_BroadbandModel';
} else if (config.lang == 'en') {
model = 'en-US_BroadbandModel';
}
}
var speech_to_text = watson.speech_to_text({
'username' : username,
'password' : passwd,
version : 'v1',
url : 'https://stream.watsonplatform.net/speech-to-text/api'
});
var rev = speech_to_text.createRecognizeStream({
'content_type' : 'audio/l16;rate=16000',
//{ 'content_type': 'audio/flac;rate=16000',
'interim_results' : true,
'continuous' : true,
'inactivity_timeout' : -1,
'model' : model
});
rev.on('results', function(data) {
var index = data.results.length ? data.results.length - 1 : 0;
if (data.results[index] && data.results[index].final
&& data.results[index].alternatives && callback) {
callback(data.results[index].alternatives[0].transcript);
}
});
rev.on('connection-close', function(code, description) {
console.info('Watson STT WS connection-closed,', code, description);
});
rev.on('connect', function(conn) {
console.info('Watson STT WS connected');
});
return rev;
}
|
angular.module('classeur.optional.sysPage', [])
.config(
function ($routeProvider) {
$routeProvider
.when('/sys', {
template: '<cl-sys-page></cl-sys-page>',
controller: function (clAnalytics) {
clAnalytics.trackPage('/sys')
}
})
})
.directive('clSysPage',
function ($http, $location, clToast, clSocketSvc) {
return {
restrict: 'E',
templateUrl: 'optional/sysPage/sysPage.html',
link: link
}
function link (scope) {
scope.properties = []
scope.deleteRow = function (propertyToDelete) {
scope.properties = scope.properties.cl_filter(function (property) {
return property !== propertyToDelete
})
}
scope.addRow = function () {
scope.properties.push({})
}
scope.update = function () {
var properties = {}
if (Object.keys(scope.properties).length > 255) {
return clToast('Too many properties.')
}
if (
scope.properties.cl_some(function (property) {
if (!property.key && !property.value) {
return
}
if (!property.key) {
clToast("Property can't be empty.")
return true
}
if (property.key.length > 255) {
clToast('Property key is too long.')
return true
}
if (!property.value) {
clToast("Property can't be empty.")
return true
}
if (property.value.length > 512) {
clToast('Property value is too long.')
return true
}
if (properties.hasOwnProperty(property.key)) {
clToast('Duplicate property: ' + property.key + '.')
return true
}
properties[property.key] = property.value
})
) {
return
}
$http.post('/api/v1/config/app', properties, {
headers: clSocketSvc.makeAuthorizationHeader()
})
.success(function () {
clToast('App config updated.')
})
.error(function (err) {
clToast('Error: ' + (err && err.message) || 'unknown')
})
}
function retrieveConfig () {
$http.get('/api/v1/config/app', {
headers: clSocketSvc.makeAuthorizationHeader()
})
.success(function (res) {
scope.properties = Object.keys(res).sort().cl_map(function (key) {
return {
key: key,
value: res[key]
}
})
})
.error(function (err) {
clToast('Error: ' + (err && err.message) || 'unknown')
})
}
retrieveConfig()
}
})
|
//// [typesWithSpecializedConstructSignatures.ts]
// basic uses of specialized signatures without errors
class Base { foo: string }
class Derived1 extends Base { bar: string }
class Derived2 extends Base { baz: string }
class C {
constructor(x: 'hi');
constructor(x: 'bye');
constructor(x: string);
constructor(x) {
return x;
}
}
var c = new C('a');
interface I {
new(x: 'hi'): Derived1;
new(x: 'bye'): Derived2;
new(x: string): Base;
}
var i: I;
var a: {
new(x: 'hi'): Derived1;
new(x: 'bye'): Derived2;
new(x: string): Base;
};
c = i;
c = a;
i = a;
a = i;
var r1 = new C('hi');
var r2: Derived2 = new i('bye');
var r3: Base = new a('hm');
//// [typesWithSpecializedConstructSignatures.js]
// basic uses of specialized signatures without errors
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var Base = /** @class */ (function () {
function Base() {
}
return Base;
}());
var Derived1 = /** @class */ (function (_super) {
__extends(Derived1, _super);
function Derived1() {
return _super !== null && _super.apply(this, arguments) || this;
}
return Derived1;
}(Base));
var Derived2 = /** @class */ (function (_super) {
__extends(Derived2, _super);
function Derived2() {
return _super !== null && _super.apply(this, arguments) || this;
}
return Derived2;
}(Base));
var C = /** @class */ (function () {
function C(x) {
return x;
}
return C;
}());
var c = new C('a');
var i;
var a;
c = i;
c = a;
i = a;
a = i;
var r1 = new C('hi');
var r2 = new i('bye');
var r3 = new a('hm');
|
/**
* Copyright 2015 The Incremental DOM 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.
*/
/**
* @type {TreeWalker}
*/
var walker_;
/**
* @return {TreeWalker} the current TreeWalker
*/
var getWalker = function() {
return walker_;
};
/**
* Sets the current TreeWalker
* @param {TreeWalker} walker
*/
var setWalker = function(walker) {
walker_ = walker;
};
/** */
export {
getWalker,
setWalker
};
|
// https://jestjs.io/docs/en/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation(query => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'image3', 'cy', {
alt: 'Testun Amgen',
btnUpload: 'Anfon i\'r Gweinydd',
captioned: 'Delwedd â phennawd',
captionPlaceholder: 'Caption', // MISSING
infoTab: 'Gwyb Delwedd',
lockRatio: 'Cloi Cymhareb',
menu: 'Priodweddau Delwedd',
pathName: 'delwedd',
pathNameCaption: 'pennawd',
resetSize: 'Ailosod Maint',
resizer: 'Clicio a llusgo i ail-meintio',
title: 'Priodweddau Delwedd',
uploadTab: 'Lanlwytho',
urlMissing: 'URL gwreiddiol y ddelwedd ar goll.',
altMissing: 'Alternative text is missing.' // MISSING
} );
|
define(
//begin v1.x content
{
"LUF_symbol": "F",
"LUF_decimal": ".",
"LUF_group": ","
}
//end v1.x content
);
|
/*
* 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 ResourceMetricValue class.
* @constructor
* Value of resource metric.
*
* @member {string} [timestamp] Value timestamp.
*
* @member {number} [average] Value average.
*
* @member {number} [minimum] Value minimum.
*
* @member {number} [maximum] Value maximum.
*
* @member {number} [total] Value total.
*
* @member {number} [count] Value count.
*
* @member {array} [properties] Properties.
*
*/
class ResourceMetricValue {
constructor() {
}
/**
* Defines the metadata of ResourceMetricValue
*
* @returns {object} metadata of ResourceMetricValue
*
*/
mapper() {
return {
required: false,
serializedName: 'ResourceMetricValue',
type: {
name: 'Composite',
className: 'ResourceMetricValue',
modelProperties: {
timestamp: {
required: false,
readOnly: true,
serializedName: 'timestamp',
type: {
name: 'String'
}
},
average: {
required: false,
readOnly: true,
serializedName: 'average',
type: {
name: 'Number'
}
},
minimum: {
required: false,
readOnly: true,
serializedName: 'minimum',
type: {
name: 'Number'
}
},
maximum: {
required: false,
readOnly: true,
serializedName: 'maximum',
type: {
name: 'Number'
}
},
total: {
required: false,
readOnly: true,
serializedName: 'total',
type: {
name: 'Number'
}
},
count: {
required: false,
readOnly: true,
serializedName: 'count',
type: {
name: 'Number'
}
},
properties: {
required: false,
readOnly: true,
serializedName: 'properties',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'ResourceMetricPropertyElementType',
type: {
name: 'Composite',
className: 'ResourceMetricProperty'
}
}
}
}
}
}
};
}
}
module.exports = ResourceMetricValue;
|
imgUrl1="data/afficheimg/20140121tpclwh.jpg";
imgtext1="";
imgLink1=escape("http://www.haoid.cn");
imgUrl2="data/afficheimg/20140121tiskvu.jpg";
imgtext2="";
imgLink2=escape("http://www.haoid.cn");
imgUrl3="data/afficheimg/20140121gmlyoj.jpg";
imgtext3="";
imgLink3=escape("http://www.haoid.cn");
var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3;
var links=imgLink1+"|"+imgLink2+"|"+imgLink3;
var texts=imgtext1+"|"+imgtext2+"|"+imgtext3;
|
(function () {
"use strict";
angular
.module('mnWizard')
.controller('mnWizardStep4Controller', mnWizardStep4Controller);
function mnWizardStep4Controller($scope, $state, mnWizardStep4Service, pools, mnPromiseHelper) {
var vm = this;
vm.isEnterprise = pools.isEnterprise;
vm.sendStats = true;
vm.onSubmit = onSubmit;
vm.register = {
email: '',
firstname: '',
lastname: '',
company: '',
version: (pools.implementationVersion || 'unknown')
};
function onSubmit() {
if (pools.isEnterprise) {
vm.form.agree.$setValidity('required', !!vm.register.agree);
}
if (vm.form.$invalid || vm.viewLoading) {
return;
}
vm.register.email && mnWizardStep4Service.postEmail(vm.register);
var promise = mnWizardStep4Service.postStats({sendStats: vm.sendStats});
mnPromiseHelper(vm, promise)
.showErrorsSensitiveSpinner()
.catchErrors()
.getPromise()
.then(function () {
$state.go('app.wizard.step5');
});
};
}
})();
|
/*
* 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');
/**
* Application Upgrade Rollback Completed event.
*
* @extends models['ApplicationEvent']
*/
class ApplicationUpgradeRollbackCompletedEvent extends models['ApplicationEvent'] {
/**
* Create a ApplicationUpgradeRollbackCompletedEvent.
* @property {string} applicationTypeName Application type name.
* @property {string} applicationTypeVersion Application type version.
* @property {string} failureReason Describes reason of failure.
* @property {number} overallUpgradeElapsedTimeInMs Overall upgrade time in
* milli-seconds.
*/
constructor() {
super();
}
/**
* Defines the metadata of ApplicationUpgradeRollbackCompletedEvent
*
* @returns {object} metadata of ApplicationUpgradeRollbackCompletedEvent
*
*/
mapper() {
return {
required: false,
serializedName: 'ApplicationUpgradeRollbackCompleted',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'Kind',
clientName: 'kind'
},
uberParent: 'FabricEvent',
className: 'ApplicationUpgradeRollbackCompletedEvent',
modelProperties: {
eventInstanceId: {
required: true,
serializedName: 'EventInstanceId',
type: {
name: 'String'
}
},
category: {
required: false,
serializedName: 'Category',
type: {
name: 'String'
}
},
timeStamp: {
required: true,
serializedName: 'TimeStamp',
type: {
name: 'DateTime'
}
},
hasCorrelatedEvents: {
required: false,
serializedName: 'HasCorrelatedEvents',
type: {
name: 'Boolean'
}
},
kind: {
required: true,
serializedName: 'Kind',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
applicationId: {
required: true,
serializedName: 'ApplicationId',
type: {
name: 'String'
}
},
applicationTypeName: {
required: true,
serializedName: 'ApplicationTypeName',
type: {
name: 'String'
}
},
applicationTypeVersion: {
required: true,
serializedName: 'ApplicationTypeVersion',
type: {
name: 'String'
}
},
failureReason: {
required: true,
serializedName: 'FailureReason',
type: {
name: 'String'
}
},
overallUpgradeElapsedTimeInMs: {
required: true,
serializedName: 'OverallUpgradeElapsedTimeInMs',
type: {
name: 'Number'
}
}
}
}
};
}
}
module.exports = ApplicationUpgradeRollbackCompletedEvent;
|
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014-2017 The Bootstrap Authors
* Copyright 2014-2017 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
// See the Getting Started docs for more information:
// https://getbootstrap.com/getting-started/#support-ie10-width
(function () {
'use strict'
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
)
document.head.appendChild(msViewportStyle)
}
}())
|
Scalr.regPage('Scalr.ui.account2.environments.clouds.gce', function (loadParams, moduleParams) {
var params = moduleParams['params'];
var form = Ext.create('Ext.form.Panel', {
bodyCls: 'x-container-fieldset',
fieldDefaults: {
anchor: '100%',
labelWidth: 110
},
autoScroll: true,
items: [{
xtype: 'component',
cls: 'x-fieldset-subheader',
html: 'OAuth Service Account'
},{
xtype: 'hidden',
name: 'gce.is_enabled',
value: 'on'
},{
xtype: 'buttongroupfield',
margin: '0 0 12',
layout: 'hbox',
name: 'mode',
submitValue: false,
defaults: {
flex: 1
},
items: [{
text: 'Configure manually',
value: 'manual'
},{
text: 'Upload JSON key',
value: 'jsonkey'
}],
listeners: {
change: function(comp, value) {
var form = comp.up('form'), ct, fields;
form.suspendLayouts();
Ext.each(['manual', 'jsonkey'], function(v){
ct = form.down('#' + v);
ct.setVisible(value === v);
Ext.each(ct.query('[isFormField]'), function(field){
field.setDisabled(value !== v);
});
});
form.resumeLayouts(true);
}
}
},{
xtype: 'textfield',
fieldLabel: 'Project ID',
name: 'gce.project_id',
value: params['gce.project_id']
},{
xtype: 'container',
layout: 'anchor',
itemId: 'manual',
items: [{
xtype: 'textfield',
fieldLabel: 'Client ID',
name: 'gce.client_id',
value: params['gce.client_id']
},{
xtype: 'textfield',
fieldLabel: 'Email (Service account name)',
name: 'gce.service_account_name',
value: params['gce.service_account_name']
},{
xtype: 'filefield',
fieldLabel: 'Private key',
name: 'gce.key',
value: params['gce.key'],
listeners: {
//Bug: file button will not be disabled when filefield is hidden initially
afterrender: function(){
this.setDisabled(this.disabled);
}
}
}]
},{
xtype: 'container',
layout: 'anchor',
itemId: 'jsonkey',
items: [{
xtype: 'filefield',
fieldLabel: 'JSON key',
name: 'gce.json_key',
value: params['gce.json_key'],
listeners: {
//Bug: file button will not be disabled when filefield is hidden initially
afterrender: function(){
this.setDisabled(this.disabled);
}
}
}]
}]
});
form.getForm().findField('mode').setValue(params['gce.json_key'] ? 'jsonkey' : 'manual');
return form;
});
|
/* global describe, it, element, by, expect */
'use strict';
var common = require('../../common/common');
var setup = require('../../common/setup');
var authentication = require('../../authentication/authentication');
var topologyEditorCommon = require('../../topology/topology_editor_common');
var xedit = require('../../common/xedit');
var applications = require('../../applications/applications');
var csarsData = require(__dirname + '/_data/application_topology_suggestions_property/csars.json');
var applicationsData = require(__dirname + '/_data/application_topology_suggestions_property/applications.json');
var applicationversionData = require(__dirname + '/_data/application_topology_suggestions_property/applicationversions.json');
var applicationenvironmentsData = require(__dirname + '/_data/application_topology_suggestions_property/applicationenvironments.json');
var indexedartifacttypesData = require(__dirname + '/_data/application_topology_suggestions_property/indexedartifacttypes.json');
var indexedcapabilitytypesData = require(__dirname + '/_data/application_topology_suggestions_property/indexedcapabilitytypes.json');
var indexeddatatypesData = require(__dirname + '/_data/application_topology_suggestions_property/indexeddatatypes.json');
var indexednodetypesData = require(__dirname + '/_data/application_topology_suggestions_property/indexednodetypes.json');
var indexedrelationshiptypesData = require(__dirname + '/_data/application_topology_suggestions_property/indexedrelationshiptypes.json');
var suggestionentryData = require(__dirname + '/_data/application_topology_suggestions_property/suggestionentry.json');
var topologiesData = require(__dirname + '/_data/application_topology_suggestions_property/topologies.json');
describe('Suggestion on property definition tests', function() {
var appName = 'AlienUI-SuggestionEntry';
var editNodePropertySuggestionAndCheck = function(nodeTemplateName, propertyName, propertyValue, componentType, count, isModalDisplay, save, selectUbuntuValue) {
topologyEditorCommon.showComponentsTab();
topologyEditorCommon.selectNodeAndGoToDetailBloc(nodeTemplateName, topologyEditorCommon.nodeDetailsBlocsIds[componentType]);
var propertyElement = common.element(by.id(topologyEditorCommon.nodeDetailsBlocsIds[componentType] + '-panel'));
propertyElement = common.element(by.id('p_' + propertyName), propertyElement);
var editForm;
common.click(by.css('span[editable-text]'), propertyElement);
editForm = common.element(by.tagName('form'), propertyElement);
var inputValue = common.element(by.tagName('input'), editForm);
inputValue.clear();
inputValue.sendKeys(propertyValue);
expect(element.all(by.repeater('match in matches')).count()).toEqual(count);
editForm.submit();
expect(element(by.className('modal-dialog')).isPresent()).toBe(isModalDisplay);
element(by.className('modal-dialog')).isPresent().then(function (isVisible) {
if (isVisible) {
if (selectUbuntuValue) {
element(by.css('input[value="ubuntu"]')).click();
}
if (save) {
common.click(by.id('btn-create'));
} else {
common.click(by.id('btn-cancel'));
}
}
});
};
it('beforeAll', function() {
setup.setup();
setup.index('csar', 'csar', csarsData);
setup.index('application', 'application', applicationsData);
setup.index('applicationversion', 'applicationversion', applicationversionData);
setup.index('applicationenvironment', 'applicationenvironment', applicationenvironmentsData);
setup.index('toscaelement', 'indexedartifacttype', indexedartifacttypesData);
setup.index('toscaelement', 'indexedcapabilitytype', indexedcapabilitytypesData);
setup.index('toscaelement', 'indexeddatatype', indexeddatatypesData);
setup.index('toscaelement', 'indexednodetype', indexednodetypesData);
setup.index('toscaelement', 'indexedrelationshiptype', indexedrelationshiptypesData);
setup.index('suggestionentry', 'suggestionentry', suggestionentryData);
setup.index('topology', 'topology', topologiesData);
common.home();
authentication.login('admin');
});
it('should set the distribution to xubuntu and add it to the suggestionentry', function() {
applications.goToApplicationTopologyPage(appName);
editNodePropertySuggestionAndCheck('Compute', 'distribution', 'xubuntu', 'cap', 6, true, true);
xedit.expect('div_distribution', 'xubuntu');
});
it('should set the distribution to ubuntu, no modal should be present', function() {
applications.goToApplicationTopologyPage(appName);
editNodePropertySuggestionAndCheck('Compute', 'distribution', 'ubuntu', 'cap', 5, false);
xedit.expect('div_distribution', 'ubuntu');
});
it('should set the distribution to xubuntu, no modal should be present', function() {
applications.goToApplicationTopologyPage(appName);
editNodePropertySuggestionAndCheck('Compute', 'distribution', 'xubuntu', 'cap', 5, false);
xedit.expect('div_distribution', 'xubuntu');
});
it('should set the distribution to lubuntu and select the selection with ubuntu', function() {
applications.goToApplicationTopologyPage(appName);
editNodePropertySuggestionAndCheck('Compute', 'distribution', 'lubuntu', 'cap', 6, true, true, true);
xedit.expect('div_distribution', 'ubuntu');
});
it('should set the distribution to lubuntu and cancel the modal', function() {
applications.goToApplicationTopologyPage(appName);
editNodePropertySuggestionAndCheck('Compute', 'distribution', 'lubuntu', 'cap', 6, true, false);
topologyEditorCommon.checkPropertyEditionError('Compute', 'distribution', 'Cancelled');
});
it('afterAll', function() {
authentication.logout();
});
});
|
'use strict';
// =========================================================================
//
// Policies for users
//
// =========================================================================
var acl = require('acl');
acl = new acl(new acl.memoryBackend());
var helpers = require (require('path').resolve('./modules/core/server/controllers/core.helpers.controller'));
exports.invokeRolesPolicies = function () {
// empty means that ONLY admin can use these paths
helpers.setPathPermissions (acl, [
[ 'guest', 'user', '/api/new/user' ],
['', 'user', '/api/onboardUser']
]);
};
exports.isAllowed = helpers.isAllowed (acl);
|
var mainwindow_8h =
[
[ "MainWindow", "d9/dc6/class_main_window.html", "d9/dc6/class_main_window" ],
[ "BINARY_FILE", "d9/d53/mainwindow_8h.html#a235764c67fdcb87b7484bdc1ef801959", null ],
[ "DEFAULT_DATA_DIR", "d9/d53/mainwindow_8h.html#a89d9b90dbc1df3ab30a2d08519e40e49", null ],
[ "DEFAULT_DATA_FILE_EXT", "d9/d53/mainwindow_8h.html#a7009a0f1670c12ad66218104884f43a8", null ],
[ "DEFAULT_DATA_PLAYER_FILE", "d9/d53/mainwindow_8h.html#a92e4f26a961aad80bec26b9f44030c3d", null ],
[ "DEFAULT_DATA_TEAM_FILE", "d9/d53/mainwindow_8h.html#af219f407cc9a763920d8e798c8d6031b", null ]
];
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.