text
stringlengths 2
6.14k
|
|---|
var app = require('app');
var BrowserWindow = require('browser-window');
var mainWindow = null;
app.on('ready', function() {
mainWindow = new BrowserWindow({width: 400, height: 360});
mainWindow.loadUrl('file://' + __dirname + '/manager.html');
});
|
/**
*
* Search for multiple elements on the page, starting from an element. The located
* elements will be returned as a WebElement JSON objects. The table below lists the
* locator strategies that each server should support. Elements should be returned in
* the order located in the DOM.
*
* @param {String} ID ID of a WebElement JSON object to route the command to
* @param {String} selector selector to query the elements
* @return {Object[]} A list of WebElement JSON objects for the located elements.
*
* @see https://w3c.github.io/webdriver/webdriver-spec.html#find-elements-from-element
* @type protocol
*
*/
import { ProtocolError } from '../utils/ErrorHandler'
import findStrategy from '../helpers/findElementStrategy'
export default function elementIdElements (id, selector) {
if (typeof id !== 'string' && typeof id !== 'number') {
throw new ProtocolError('number or type of arguments don\'t agree with elementIdElements protocol command')
}
let found = findStrategy(selector, true)
return this.requestHandler.create(`/session/:sessionId/element/${id}/elements`, {
using: found.using,
value: found.value
}).then((result) => {
result.selector = selector
/**
* W3C webdriver protocol has changed element identifier from `ELEMENT` to
* `element-6066-11e4-a52e-4f735466cecf`. Let's make sure both identifier
* are supported.
*/
result.value = result.value.map((elem) => {
const elemValue = elem.ELEMENT || elem['element-6066-11e4-a52e-4f735466cecf']
return {
ELEMENT: elemValue,
'element-6066-11e4-a52e-4f735466cecf': elemValue
}
})
return result
})
}
|
;
define('views/courses/CoursesView', ['appframework', 'mustache', 'controllers/Courses', 'i18n!nls/courses', 'routers/coursesrouter'],
(function ($, mustache, controller, courses, router) {
var courseTemplate, currentSearch;
var $coursesSearch, $courses;
var doInit = function (data) {
router.init();
$coursesSearch = $('#user-courses-search');
$courses = $('#user-courses');
controller.init(this);
require([
'text!../tpl/course-tpl.html'
], function (tpl) {
courseTemplate = tpl;
controller.updateMyCourses(data);
/*
if($('#afui').get(0).className === 'ios7'){
$('body').removeClass('moveDown');
setTimeout(function(){
$('body').addClass('moveDown');
}, 150);
}
*/
});
};
var doShowError = function (msg) {
if (msg) {
$.ui.popup(msg);
}
};
var doShowCourse = function (data) {
var html = mustache.to_html(courseTemplate, data);
$courses.html($courses.html() + html);
};
var doClearCourses = function () {
$courses.html('');
};
var onCourseSearch = function (evt) {
var filter = this.value;
if (currentSearch) {
clearTimeout(currentSearch);
}
currentSearch = setTimeout(function () {
$courses.find('li').each(function (i, e) {
var sel = $(e).find('div strong').text().toLowerCase().trim();
var query = filter.toLowerCase();
if (sel.indexOf(query) === -1) {
$(e).hide();
} else {
$(e).show();
}
});
}, 300);
};
var doInitCoursesInteraction = function (status) {
if (status) {
$courses.bind('tap', onCourseSelection);
$coursesSearch.bind('input', onCourseSearch);
} else {
$courses.unbind('tap', onCourseSelection);
$coursesSearch.unbind('input', onCourseSearch);
}
};
var doShowLoader = function (status, message) {
if (status) {
$.ui.showMask(message || courses.loading);
} else {
$.ui.hideMask();
}
};
var onCourseSelection = function (evt) {
evt.preventDefault();
var target = $(evt.target).parents('li');
var url = target.attr('data-url'),
idCourse = url.match(/course_id=([^&]*)/)[1],
thumb = target.find('img').css('background-image'),
name = target.find('strong').text(),
canAccess = target.attr('data-can'),
courseDescription = target.find('.detail-disclosure').html();
// if(canAccess != true)return;
thumb = /^url\((['"]?)(.*)\1\)$/.exec(thumb);
thumb = thumb ? thumb[2] : '';
localStorage.setItem('currentCourseName', name);
localStorage.setItem('currentCourseThumb', thumb);
localStorage.setItem('currentCourseDescription', courseDescription);
controller.getCourseDetails(idCourse);
};
return {
init: doInit,
showError: doShowError,
showCourse: doShowCourse,
clearCourses: doClearCourses,
showLoader: doShowLoader,
initCoursesInteraction: doInitCoursesInteraction
}
}));
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = timeoutsAsyncScript;
var _ErrorHandler = require('../utils/ErrorHandler');
var _depcrecationWarning = require('../helpers/depcrecationWarning');
var _depcrecationWarning2 = _interopRequireDefault(_depcrecationWarning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
*
* Set the amount of time, in milliseconds, that asynchronous scripts executed
* by /session/:sessionId/execute_async are permitted to run before they are
* aborted and a |Timeout| error is returned to the client.
*
* Deprecated! Please use the `timeouts` command instead.
*
* @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeoutsasync_script
*
* @param {Number} ms The amount of time, in milliseconds, that time-limited commands are permitted to run.
* @type protocol
* @deprecated
*
*/
function timeoutsAsyncScript(ms) {
/*!
* parameter check
*/
if (typeof ms !== 'number') {
throw new _ErrorHandler.ProtocolError('number or type of arguments don\'t agree with timeoutsAsyncScript protocol command');
}
(0, _depcrecationWarning2.default)('timeoutsAsyncScript');
return this.requestHandler.create('/session/:sessionId/timeouts/async_script', { ms: ms });
}
module.exports = exports['default'];
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { isBlank, isPresent, isPrimitive, isStrictStringMap } from './facade/lang';
import * as o from './output/output_ast';
export var MODULE_SUFFIX = '';
var CAMEL_CASE_REGEXP = /([A-Z])/g;
export function camelCaseToDashCase(input) {
return input.replace(CAMEL_CASE_REGEXP, function () {
var m = [];
for (var _i = 0; _i < arguments.length; _i++) {
m[_i - 0] = arguments[_i];
}
return '-' + m[1].toLowerCase();
});
}
export function splitAtColon(input, defaultValues) {
return _splitAt(input, ':', defaultValues);
}
export function splitAtPeriod(input, defaultValues) {
return _splitAt(input, '.', defaultValues);
}
function _splitAt(input, character, defaultValues) {
var characterIndex = input.indexOf(character);
if (characterIndex == -1)
return defaultValues;
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
}
export function sanitizeIdentifier(name) {
return name.replace(/\W/g, '_');
}
export function visitValue(value, visitor, context) {
if (Array.isArray(value)) {
return visitor.visitArray(value, context);
}
if (isStrictStringMap(value)) {
return visitor.visitStringMap(value, context);
}
if (isBlank(value) || isPrimitive(value)) {
return visitor.visitPrimitive(value, context);
}
return visitor.visitOther(value, context);
}
export var ValueTransformer = (function () {
function ValueTransformer() {
}
ValueTransformer.prototype.visitArray = function (arr, context) {
var _this = this;
return arr.map(function (value) { return visitValue(value, _this, context); });
};
ValueTransformer.prototype.visitStringMap = function (map, context) {
var _this = this;
var result = {};
Object.keys(map).forEach(function (key) { result[key] = visitValue(map[key], _this, context); });
return result;
};
ValueTransformer.prototype.visitPrimitive = function (value, context) { return value; };
ValueTransformer.prototype.visitOther = function (value, context) { return value; };
return ValueTransformer;
}());
export function assetUrl(pkg, path, type) {
if (path === void 0) { path = null; }
if (type === void 0) { type = 'src'; }
if (path == null) {
return "asset:@angular/lib/" + pkg + "/index";
}
else {
return "asset:@angular/lib/" + pkg + "/src/" + path;
}
}
export function createDiTokenExpression(token) {
if (isPresent(token.value)) {
return o.literal(token.value);
}
else if (token.identifierIsInstance) {
return o.importExpr(token.identifier)
.instantiate([], o.importType(token.identifier, [], [o.TypeModifier.Const]));
}
else {
return o.importExpr(token.identifier);
}
}
export var SyncAsyncResult = (function () {
function SyncAsyncResult(syncResult, asyncResult) {
if (asyncResult === void 0) { asyncResult = null; }
this.syncResult = syncResult;
this.asyncResult = asyncResult;
if (!asyncResult) {
this.asyncResult = Promise.resolve(syncResult);
}
}
return SyncAsyncResult;
}());
//# sourceMappingURL=util.js.map
|
import { AudioEncoder } from './audioEncoder';
const getUserMedia = ((navigator) => {
if (navigator.mediaDevices) {
return navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
}
const legacyGetUserMedia = navigator.getUserMedia
|| navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
if (legacyGetUserMedia) {
return (options) => new Promise((resolve, reject) => {
legacyGetUserMedia.call(navigator, options, resolve, reject);
});
}
})(window.navigator);
const AudioContext = window.AudioContext || window.webkitAudioContext;
class AudioRecorder {
isSupported() {
return Boolean(getUserMedia) && Boolean(AudioContext);
}
createAudioContext() {
if (this.audioContext) {
return;
}
this.audioContext = new AudioContext();
}
destroyAudioContext() {
if (!this.audioContext) {
return;
}
this.audioContext.close();
delete this.audioContext;
}
async createStream() {
if (this.stream) {
return;
}
this.stream = await getUserMedia({ audio: true });
}
destroyStream() {
if (!this.stream) {
return;
}
this.stream.getAudioTracks().forEach((track) => track.stop());
delete this.stream;
}
async createEncoder() {
if (this.encoder) {
return;
}
const input = this.audioContext.createMediaStreamSource(this.stream);
this.encoder = new AudioEncoder(input);
}
destroyEncoder() {
if (!this.encoder) {
return;
}
this.encoder.close();
delete this.encoder;
}
async start(cb) {
try {
await this.createAudioContext();
await this.createStream();
await this.createEncoder();
cb && cb.call(this, true);
} catch (error) {
console.error(error);
this.destroyEncoder();
this.destroyStream();
this.destroyAudioContext();
cb && cb.call(this, false);
}
}
stop(cb) {
this.encoder.on('encoded', cb);
this.encoder.close();
this.destroyEncoder();
this.destroyStream();
this.destroyAudioContext();
}
}
const instance = new AudioRecorder();
export { instance as AudioRecorder };
|
version https://git-lfs.github.com/spec/v1
oid sha256:1668f227ab9bbb326809d8430e0c9d1105688b38b177ab927f0528eb9593a652
size 7357
|
import mdDialog from './mdDialog.vue';
import mdDialogTitle from './mdDialogTitle.vue';
import mdDialogContent from './mdDialogContent.vue';
import mdDialogActions from './mdDialogActions.vue';
import mdDialogAlert from './presets/mdDialogAlert.vue';
import mdDialogConfirm from './presets/mdDialogConfirm.vue';
import mdDialogPrompt from './presets/mdDialogPrompt.vue';
import mdDialogTheme from './mdDialog.theme';
export default function install(Vue) {
Vue.component('md-dialog', mdDialog);
Vue.component('md-dialog-title', mdDialogTitle);
Vue.component('md-dialog-content', mdDialogContent);
Vue.component('md-dialog-actions', mdDialogActions);
/* Presets */
Vue.component('md-dialog-alert', mdDialogAlert);
Vue.component('md-dialog-confirm', mdDialogConfirm);
Vue.component('md-dialog-prompt', mdDialogPrompt);
Vue.material.styles.push(mdDialogTheme);
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S10.2.2_A1.1_T3;
* @section: 10.2.2;
* @assertion: The scope chain is initialised to contain the same objects,
* in the same order, as the calling context's scope chain;
* @description: eval within global execution context;
*/
var i;
var j;
str1 = '';
str2 = '';
this.x = 1;
this.y = 2;
for(i in this){
str1+=i;
}
eval('for(j in this){\nstr2+=j;\n}');
if(!(str1 === str2)){
$ERROR("#1: scope chain must contain same objects in the same order as the calling context");
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S12.14_A2;
* @section: 12.14;
* @assertion: Throwing exception with "throw" and catching it with "try" statement;
* @description: Checking if execution of "catch" catches an exception thrown with "throw";
*/
// CHECK#1
try {
throw "catchme";
$ERROR('#1: throw "catchme" lead to throwing exception');
}
catch(e){}
// CHECK#2
var c2=0;
try{
try{
throw "exc";
$ERROR('#2.1: throw "exc" lead to throwing exception');
}finally{
c2=1;
}
}
catch(e){
if (c2!==1){
$ERROR('#2.2: "finally" block must be evaluated');
}
}
// CHECK#3
var c3=0;
try{
throw "exc";
$ERROR('#3.1: throw "exc" lead to throwing exception');
}
catch(err){
var x3=1;
}
finally{
c3=1;
}
if (x3!==1){
$ERROR('#3.2: "catch" block must be evaluated');
}
if (c3!==1){
$ERROR('#3.3: "finally" block must be evaluated');
}
|
/* Karma configuration for standalone build */
'use strict';
module.exports = function (config) {
console.log();
console.log('Browser (Standalone) Tests');
console.log();
config.set({
basePath: '.',
frameworks: ['mocha'],
files: [
{pattern: 'swagger-tools-standalone.js', watch: false, included: true},
{pattern: 'test-browser.js', watch: false, included: true}
],
client: {
mocha: {
reporter: 'html',
timeout: 5000,
ui: 'bdd'
}
},
plugins: [
'karma-mocha',
'karma-mocha-reporter',
'karma-phantomjs-launcher'
],
browsers: ['PhantomJS'],
reporters: ['mocha'],
colors: true,
autoWatch: false,
singleRun: true
});
};
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'far';
var iconName = 'save';
var width = 448;
var height = 512;
var ligatures = [];
var unicode = 'f0c7';
var svgPathData = 'M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM272 80v80H144V80h128zm122 352H54a6 6 0 0 1-6-6V86a6 6 0 0 1 6-6h42v104c0 13.255 10.745 24 24 24h176c13.255 0 24-10.745 24-24V83.882l78.243 78.243a6 6 0 0 1 1.757 4.243V426a6 6 0 0 1-6 6zM224 232c-48.523 0-88 39.477-88 88s39.477 88 88 88 88-39.477 88-88-39.477-88-88-88zm0 128c-22.056 0-40-17.944-40-40s17.944-40 40-40 40 17.944 40 40-17.944 40-40 40z';
exports.definition = {
prefix: prefix,
iconName: iconName,
icon: [
width,
height,
ligatures,
unicode,
svgPathData
]};
exports.faSave = exports.definition;
exports.prefix = prefix;
exports.iconName = iconName;
exports.width = width;
exports.height = height;
exports.ligatures = ligatures;
exports.unicode = unicode;
exports.svgPathData = svgPathData;
|
$(document).ready(function () {
//selecting supplier
// $('body').off('click','supplier_id.select_popup').on('click','supplier_id.select_popup' ,function () {
// void window.open('select.php?class_name=supplier', '_blank',
// 'width=1200,height=1000,TOOLBAR=no,MENUBAR=no,SCROLLBARS=yes,RESIZABLE=yes,LOCATION=no,DIRECTORIES=no,STATUS=no');
// return false;
// });
//Popup for selecting address
$('body').off('click','.address_popup').on('click','.address_popup',function (e) {
e.preventDefault();
var rowClass = $(this).closest('div').prop('class');
localStorage.setItem("addressPopupDivClass", rowClass);
void window.open('form.php?class_name=address&mode=9&window_type=popup', '_blank',
'width=1200,height=1000,TOOLBAR=no,MENUBAR=no,SCROLLBARS=yes,RESIZABLE=yes,LOCATION=no,DIRECTORIES=no,STATUS=no');
return false;
});
$("#supplier_site_name").on("change", function () {
if ($(this).val() == 'newentry') {
if (confirm("Do you want to create a new supplier site?")) {
$(this).replaceWith('<input id="supplier_site_name" class="textfield supplier_site_name" type="text" size="25" maxlength="50" name="supplier_site_name[]">');
$(".show.supplier_site_id").hide();
$("#supplier_site_id").val("");
$("#supplier_site_number").val("");
}
}
});
});
|
import { useBackend, useSharedState } from '../backend';
import { Box, Button, Dimmer, Icon, LabeledList, Section, Tabs } from '../components';
import { Window } from '../layouts';
export const Limbgrower = (props, context) => {
const { act, data } = useBackend(context);
const {
reagents = [],
total_reagents,
max_reagents,
categories = [],
busy,
} = data;
const [tab, setTab] = useSharedState(
context, 'category', categories[0]?.name);
const designList = categories
.find(category => category.name === tab)
?.designs || [];
return (
<Window
title="Limb Grower"
width={400}
height={550}>
{!!busy && (
<Dimmer fontSize="32px">
<Icon name="cog" spin={1} />
{' Building...'}
</Dimmer>
)}
<Window.Content scrollable>
<Section title="Reagents">
<Box mb={1}>
{total_reagents} / {max_reagents} reagent capacity used.
</Box>
<LabeledList>
{reagents.map(reagent => (
<LabeledList.Item
key={reagent.reagent_name}
label={reagent.reagent_name}
buttons={(
<Button.Confirm
textAlign="center"
width="120px"
content="Remove Reagent"
color="bad"
onClick={() => act('empty_reagent', {
reagent_type: reagent.reagent_type,
})} />
)}>
{reagent.reagent_amount}u
</LabeledList.Item>
))}
</LabeledList>
</Section>
<Section title="Designs">
<Tabs>
{categories.map(category => (
<Tabs.Tab
fluid
key={category.name}
selected={tab === category.name}
onClick={() => setTab(category.name)}>
{category.name}
</Tabs.Tab>
))}
</Tabs>
<LabeledList>
{designList.map(design => (
<LabeledList.Item
key={design.name}
label={design.name}
buttons={(
<Button
content="Make"
color="good"
onClick={() => act('make_limb', {
design_id: design.id,
active_tab: design.parent_category,
})} />
)}>
{design.needed_reagents.map(reagent => (
<Box key={reagent.name}>
{reagent.name}: {reagent.amount}u
</Box>
))}
</LabeledList.Item>
))}
</LabeledList>
</Section>
</Window.Content>
</Window>
);
};
|
var myTabOption = [
{optionValue:"Default", optionText:"Default", addClass:"", url:"index.html"},
{optionValue:"scriptTab", optionText:"Script Tab", addClass:"", url:"scriptTab.html"}
//{optionValue:"script2Depth", optionText:"Script 2Depth", addClass:"", url:"script2DepthTab.html"}
];
var pageTabChange = function(selectedObject, value){
location.href = selectedObject.url;
};
$(document.body).ready(function(){
var myPageID = "";
try{
myPageID = pageID;
}catch(e){
}
$("#demoPageTabTarget").bindTab({
value: (myPageID||""),
overflow: "scroll",
options: myTabOption,
onchange: pageTabChange
});
});
|
function(doc) {
if(doc.tags.length > 0) {
for(var idx in doc.tags) {
emit(doc.tags[idx], null);
}
}
}
|
#!/usr/bin/env node
var fs = require('fs'),
path = require('path');
//kansorc = require('kanso/kansorc');
//kansorc.load(function (err, cfg) {
var commands = {
'clear-cache': null,
'create': null,
'createdb': null,
'deletedb': null,
'listdb': null,
'replicate': null,
'help': [{list: [
'clear-cache',
'create',
'createdb',
'deletedb',
'listdb',
'replicate',
'help',
'install',
'update',
'ls',
'pack',
'publish',
'push',
'show',
'transform',
'unpublish',
'upload',
'uuids'
]}],
'install': [{directories: true, filenames: /.*\.tar\.gz$/}],
'update': null,
'ls': [{directories: true}],
'pack': [{directories: true}],
'publish': [{directories: true}],
// TODO: add lookup of environments in .kansorc
'push': [{environments: true, directories: true}, {environments: true}],
'show': [{directories: true}],
'transform': [
{list: ['clear-ids', 'add-ids', 'csv', 'map']},
{filenames: /.*/, directories: true}, // could be .json or .csv / .tsv
{filenames: /.*\.json$/, directories: true}
],
'unpublish': null,
'upload': [{filenames: /.*\.json$/, directories: true}, {environments: true}],
'uuids': null
};
var args = process.argv.slice(3);
var arglen = 0;
for (var i = 0; i < args.length; i++) {
if (args[i] && args[i][0] !== '-') {
arglen++;
}
}
var command = null;
for (var j = 0; j < args.length; j++) {
if (args[j] && args[j][0] !== '-') {
command = args[j];
break;
}
}
// the current text being entered
var curr = args[args.length - 1];
function trim(str) {
return str.replace(/^\s+/, '').replace(/\s+$/, '');
}
function matchList(list, curr, /*optional*/nextlist) {
var m = [];
list.forEach(function (l) {
if (l.indexOf(curr) === 0) {
m.push(l + ' ');
}
});
if (m.length === 1 && trim(m[0]) === trim(curr)) {
return nextlist || [];
}
return m;
}
function completeList(argdef) {
if (!argdef) {
return [];
}
var l = [];
if (argdef.list) {
l = l.concat(argdef.list);
}
if (argdef.directories) {
l = l.concat(
fs.readdirSync('.').filter(function (f) {
return fs.statSync(f).isDirectory();
})
);
}
if (argdef.filenames) {
l = l.concat(
fs.readdirSync('.').filter(function (f) {
return argdef.filenames.test(f);
})
);
}
return l;
}
var matches = [];
// list all commands
if (arglen === 0) {
matches = Object.keys(commands);
}
// complete first command
else if (arglen === 1) {
matches = matchList(
Object.keys(commands),
curr,
commands[curr] && completeList(commands[curr][0])
);
}
// match command arguments
else if (arglen > 1) {
if (commands[command] && commands[command][arglen - 2]) {
var argdef = commands[command][arglen - 2];
var next_argdef = commands[command][arglen - 1];
if (argdef.list) {
matches = matches.concat(
matchList(
argdef.list, curr, completeList(next_argdef)
)
);
}
if (argdef.directories) {
var wd = './';
if (curr && /\/$/.test(curr)) {
wd = curr;
}
else if (curr) {
wd = path.dirname(curr) + '/';
}
var files = fs.readdirSync(wd);
var dirs = files.filter(function (f) {
return fs.statSync(wd === './' ? f: wd + f).isDirectory();
}).map(function (d) {
return wd === './' ? d: wd + d;
});
matches = matches.concat(
matchList(dirs, curr, completeList(next_argdef))
);
}
if (argdef.filenames) {
var wd = './';
if (curr && /\/$/.test(curr)) {
wd = curr;
}
else if (curr) {
wd = path.dirname(curr) + '/';
}
var files = fs.readdirSync(wd);
var dirs = files.filter(function (f) {
return argdef.filenames.test(wd === './' ? f: wd + f);
}).map(function (d) {
return wd === './' ? d: wd + d;
});
matches = matches.concat(
matchList(dirs, curr, completeList(next_argdef))
);
}
}
}
process.stdout.write(matches.join('\n'));
//});
|
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
function loadDashboards() {
var dashboards = dashboardProperties.dashboards;
var dashboard_list = '';
for (var i=0; i<dashboards.length; i++) {
var showDashboard = false;
if (dashboards[i].runtimes[0] == "all") {
showDashboard = true;
} else {
for (var j=0; j<dashboards[i].runtimes.length; j++) {
if (dashboards[i].runtimes[j] == selectedApplicationRevision.runtimeId) {
showDashboard = true;
break;
}
}
}
var isAvailable = (dashboards[i].isAvailable == 'true');
var url = dataAnalyticsServerUrl + dashboards[i].dashboardContext + eval(dashboards[i].dashboardTypeUtil).getQueryString();
if (showDashboard) {
var dashboard = '' +
'<div class="col-xs-12 col-md-12 col-lg-12" data-toggle="tooltip" title="' + dashboards[i].title + '">' +
'<a class="block-anch" href="' + url + ' " onclick="return ' + isAvailable +'" target="_blank">' +
'<div class="block-monitoring wrapper">';
if (!isAvailable) {
dashboard += '<div class="ribbon-wrapper"><div class="ribbon">Available Soon</div></div>';
}
dashboard += '<h3 class="ellipsis"><i class="fw fw-dashboard fw-lg icon"></i>' + dashboards[i].title + '</h3>' +
'</div>' +
'</a>' +
'</div>';
dashboard_list += dashboard;
}
}
$("#dashboards").html(dashboard_list);
}
// DashboardTypeUtil interface
var DashboardTypeUtil = {
getQueryString: function () {}
};
// define classes
var OperationalDashboardTypeUtil = function () {};
var HttpMonitoringDashboardTypeUtil = function () {};
var ESBAnalyticsDashboardTypeUtil = function () {};
// extend the DashboardTypeUtil interface
OperationalDashboardTypeUtil.prototype = Object.create(DashboardTypeUtil);
HttpMonitoringDashboardTypeUtil.prototype = Object.create(DashboardTypeUtil);
ESBAnalyticsDashboardTypeUtil.prototype = Object.create(DashboardTypeUtil);
// actual implementation goes here
OperationalDashboardTypeUtil.prototype.getQueryString = function () {
return "/t/" + tenantDomain + "/dashboards/operational-dashboard/?shared=true&id=" + applicationName + "_" + selectedRevision + "_" + selectedApplicationRevision.hashId;
};
HttpMonitoringDashboardTypeUtil.prototype.getQueryString = function () {
return "?";
};
ESBAnalyticsDashboardTypeUtil.prototype.getQueryString = function () {
var currentTime = new Date().getTime();
var prevTime = currentTime - 3600000;
return "/t/" + tenantDomain + "/dashboards/esb-analytics/?shared=true&timeFrom=" + prevTime + "&timeTo=" + currentTime;
};
|
//// [test.tsx]
export class C {
factory() {
return <div></div>;
}
}
//// [test.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.C = void 0;
class C {
factory() {
return factory.createElement("div", null);
}
}
exports.C = C;
|
define(["Ti/_", "Ti/_/declare", "Ti/_/lang", "Ti/_/Evented", "Ti/Network", "Ti/Blob", "Ti/_/event"],
function(_, declare, lang, Evented, Network, Blob, event) {
var is = require.is,
on = require.on;
return declare("Ti.Network.HTTPClient", Evented, {
constructor: function() {
var xhr = this._xhr = new XMLHttpRequest;
this._handles = [
on(xhr, "error", this, "_onError"),
on(xhr.upload, "error", this, "_onError"),
on(xhr, "progress", this, function(evt) {
evt.progress = evt.lengthComputable ? evt.loaded / evt.total : false;
is(this.ondatastream, "Function") && this.ondatastream.call(this, evt);
}),
on(xhr.upload, "progress", this, function(evt) {
evt.progress = evt.lengthComputable ? evt.loaded / evt.total : false;
is(this.onsendstream, "Function") && this.onsendstream.call(this, evt);
})
];
xhr.onreadystatechange = lang.hitch(this, function() {
var c = this.constants;
switch (xhr.readyState) {
case 0: c.readyState = this.UNSENT; break;
case 1: c.readyState = this.OPENED; break;
case 2: c.readyState = this.LOADING; break;
case 3: c.readyState = this.HEADERS_RECEIVED; break;
case 4:
clearTimeout(this._timeoutTimer);
this._completed = 1;
c.readyState = this.DONE;
if (xhr.status == 200) {
if (this.file) {
Filesystem.getFile(Filesystem.applicationDataDirectory,
this.file).write(xhr.responseText);
}
c.responseText = xhr.responseText;
c.responseData = new Blob({
data: xhr.responseText,
length: xhr.responseText.length,
mimeType: xhr.getResponseHeader("Content-Type")
});
c.responseXML = xhr.responseXML;
is(this.onload, "Function") && this.onload.call(this);
} else {
xhr.status / 100 | 0 > 3 && this._onError();
}
}
this._fireStateChange();
});
},
destroy: function() {
if (this._xhr) {
this._xhr.abort();
this._xhr = null;
}
event.off(this._handles);
Evented.destroy.apply(this, arguments);
},
_onError: function(error) {
this.abort();
is(error, "Object") || (error = { message: error });
error.error || (error.error = error.message || this._xhr.status);
parseInt(error.error) || (error.error = "Can't reach host");
is(this.onerror, "Function") && this.onerror.call(this, error);
},
abort: function() {
var c = this.constants;
c.responseText = c.responseXML = c.responseData = "";
this._completed = true;
clearTimeout(this._timeoutTimer);
this.connected && this._xhr.abort();
c.readyState = this.UNSENT;
this._fireStateChange();
},
_fireStateChange: function() {
is(this.onreadystatechange, "Function") && this.onreadystatechange.call(this);
},
getResponseHeader: function(name) {
return this._xhr.readyState > 1 ? this._xhr.getResponseHeader(name) : null;
},
open: function(method, url, async) {
var httpURLFormatter = Ti.Network.httpURLFormatter,
c = this.constants,
wc = this.withCredentials,
async = wc ? true : !!async;
this.abort();
this._xhr.open(
c.connectionType = method,
c.location = _.getAbsolutePath(httpURLFormatter ? httpURLFormatter(url) : url),
async
);
wc && (this._xhr.withCredentials = wc);
},
send: function(args){
try {
var timeout = this.timeout | 0;
this._completed = false;
args = is(args, "Object") ? lang.urlEncode(args) : args;
args && this._xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
this._xhr.send(args);
clearTimeout(this._timeoutTimer);
timeout && (this._timeoutTimer = setTimeout(lang.hitch(this, function() {
if (this.connected) {
this.abort();
!this._completed && this._onError("Request timed out");
}
}, timeout)));
} catch (ex) {console.debug(ex)}
},
setRequestHeader: function(name, value) {
this._xhr.setRequestHeader(name, value);
},
properties: {
ondatastream: void 0,
onerror: void 0,
onload: void 0,
onreadystatechange: void 0,
onsendstream: void 0,
timeout: void 0,
withCredentials: false
},
constants: {
DONE: 4,
HEADERS_RECEIVED: 2,
LOADING: 3,
OPENED: 1,
UNSENT: 1,
connected: function() {
return this.readyState >= this.OPENED;
},
connectionType: void 0,
location: void 0,
readyState: this.UNSENT,
responseData: void 0,
responseText: void 0,
responseXML: void 0,
status: function() {
return this._xhr.status;
},
statusText: function() {
return this._xhr.statusText;
}
}
});
});
|
jQuery(document).ready(function($){
//check if the .cd-image-container is in the viewport
//if yes, animate it
checkPosition($('.cd-image-container'));
$(window).on('scroll', function(){
checkPosition($('.cd-image-container'));
});
//make the .cd-handle element draggable and modify .cd-resize-img width according to its position
$('.cd-image-container').each(function(){
var actual = $(this);
drags(actual.find('.cd-handle'), actual.find('.cd-resize-img'), actual, actual.find('.cd-image-label[data-type="original"]'), actual.find('.cd-image-label[data-type="modified"]'));
});
//upadate images label visibility
$(window).on('resize', function(){
$('.cd-image-container').each(function(){
var actual = $(this);
updateLabel(actual.find('.cd-image-label[data-type="modified"]'), actual.find('.cd-resize-img'), 'left');
updateLabel(actual.find('.cd-image-label[data-type="original"]'), actual.find('.cd-resize-img'), 'right');
});
});
});
function checkPosition(container) {
container.each(function(){
var actualContainer = $(this);
if( $(window).scrollTop() + $(window).height()*0.5 > actualContainer.offset().top) {
actualContainer.addClass('is-visible');
}
});
}
//draggable funtionality - credits to http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/
function drags(dragElement, resizeElement, container, labelContainer, labelResizeElement) {
dragElement.on("mousedown vmousedown", function(e) {
dragElement.addClass('draggable');
resizeElement.addClass('resizable');
var dragWidth = dragElement.outerWidth(),
xPosition = dragElement.offset().left + dragWidth - e.pageX,
containerOffset = container.offset().left,
containerWidth = container.outerWidth(),
minLeft = containerOffset + 10,
maxLeft = containerOffset + containerWidth - dragWidth - 10;
dragElement.parents().on("mousemove vmousemove", function(e) {
leftValue = e.pageX + xPosition - dragWidth;
//constrain the draggable element to move inside his container
if(leftValue < minLeft ) {
leftValue = minLeft;
} else if ( leftValue > maxLeft) {
leftValue = maxLeft;
}
widthValue = (leftValue + dragWidth/2 - containerOffset)*100/containerWidth+'%';
$('.draggable').css('left', widthValue).on("mouseup vmouseup", function() {
$(this).removeClass('draggable');
resizeElement.removeClass('resizable');
});
$('.resizable').css('width', widthValue);
updateLabel(labelResizeElement, resizeElement, 'left');
updateLabel(labelContainer, resizeElement, 'right');
}).on("mouseup vmouseup", function(e){
dragElement.removeClass('draggable');
resizeElement.removeClass('resizable');
});
e.preventDefault();
}).on("mouseup vmouseup", function(e) {
dragElement.removeClass('draggable');
resizeElement.removeClass('resizable');
});
}
function updateLabel(label, resizeElement, position) {
if(position == 'left') {
( label.offset().left + label.outerWidth() < resizeElement.offset().left + resizeElement.outerWidth() ) ? label.removeClass('is-hidden') : label.addClass('is-hidden') ;
} else {
( label.offset().left > resizeElement.offset().left + resizeElement.outerWidth() ) ? label.removeClass('is-hidden') : label.addClass('is-hidden') ;
}
}
|
/*!
* @package yii2-grid
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2015
* @version 3.0.1
*
* Client actions for yii2-grid CheckboxColumn
*
* Author: Kartik Visweswaran
* Copyright: 2015, Kartik Visweswaran, Krajee.com
* For more JQuery plugins visit http://plugins.krajee.com
* For more Yii related demos visit http://demos.krajee.com
*/
var kvSelectRow = function (gridId, css) {
"use strict";
(function ($) {
var $grid = $('#' + gridId), $el;
$grid.find(".kv-row-select input").on('change', function () {
$el = $(this);
if ($el.is(':checked')) {
$el.parents("tr:first").removeClass(css).addClass(css);
} else {
$el.parents("tr:first").removeClass(css);
}
});
$grid.find(".kv-all-select input").on('change', function () {
if ($(this).is(':checked')) {
$grid.find(".kv-row-select").parents("tr").removeClass(css).addClass(css);
}
else {
$grid.find(".kv-row-select").parents("tr").removeClass(css);
}
});
})(window.jQuery);
};
|
function nextLevel(nodeList, startIndex, hlevel, prefix, tocString)
{
var hIndex = 1;
var i = startIndex;
while (i < nodeList.length) {
var currentNode = nodeList[i];
if (currentNode.tagName != "H"+hlevel)
break;
if (currentNode.className == "no-toc") {
++i;
continue;
}
var sectionString = prefix+hIndex;
// Update the TOC
var text = currentNode.innerHTML;
// Strip off names specified via <a name="..."></a>
var tocText = text.replace(/<a name=[\'\"][^\'\"]*[\'\"]>([^<]*)<\/a>/g, "$1");
tocString.s += "<li class='toc-h"+hlevel+"'><a href='#"+sectionString+"'><span class='secno'>"+sectionString+"</span>"+tocText+"</a></li>\n";
// Modify the header
currentNode.innerHTML = "<span class=secno>"+sectionString+"</span> "+text;
currentNode.id = sectionString;
// traverse children
i = nextLevel(nodeList, i+1, hlevel+1, sectionString+".", tocString);
hIndex++;
}
return i;
}
function generateTOC(toc)
{
var nodeList = $("h2,h3,h4,h5,h6");
var tocString = { s:"<ul class='toc'>\n" };
nextLevel(nodeList, 0, 2, "", tocString);
toc.innerHTML = tocString.s;
// Now position the document, in case a #xxx directive was given
var id = window.location.hash.substring(1);
if (id.length > 0) {
var target = document.getElementById(id);
if (target) {
var rect = target.getBoundingClientRect();
setTimeout(function() { window.scrollTo(0, rect.top) }, 0);
}
}
}
|
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008-2009, The KiWi Project (http://www.kiwi-project.eu)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the KiWi Project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Contributor(s):
* Sebastian Schaffert
*
*/
/**
* A jQuery widget to display the KiWi tags for a context content item. Can be
* invoked on arbitrary elements selected by jQuery. The widget currently supports two modes:
* - list: returns the list of currently assigned tags of the content item
* - recommendations: returns the list of tag recommendations for the content item based on text
* analysis
*
* The widget takes the following options when initialising:
* - uri: the URI of the currently displayed content item (either the currentContentItem in KiWi or
* the URL of some external page using the widget); defaults to currently displayed page
*
* - webServiceUrl: the URL to locate the KiWi ActivityWidgetWebService; defaults to
* http://localhost:8080/KiWi/seam/resource/services/widgets/tags/{mode}
*
* - num: the number of results to return (recommendations only); defaults to 10
*
* - mode: one of list/recommendations; defaults to 'list'
*
* - callback: a function that takes the returned JSON data as arguments and returns the HTML to
* be inserted in the tag cloud; defaults to a simple list that renders each tag as
* a link to the search function
*
* Example:
*
* <p id="tags">Test</p>
* <script>
* $(document).ready(function(){
* $('#tags').tags({uri: 'http://localhost:8080/KiWi/content/FrontPage'});
* });
* </script>
*
*/
(function($){
$.widget("kiwi.tags", {
/**
* Constructor;
*/
_init: function() {
this.refresh();
},
refresh: function() {
var webservice = this.getWebServiceUrl();
var context = this.getUri();
var num = this.getNum();
var mode = this.getMode();
var callback = this.getCallback();
if(!callback) {
callback = function(data) {
if(data.length == 0) {
element.html("<em>no tags</em>");
} else {
var html="";
$.each(data, function(i, item) {
html += "<a href=\"\">" + item.tag.@title + "</a> ";
});
}
return html;
}
}
if(webservice.charAt(webservice.length-1) != '/') {
webservice += '/';
}
// compose the query to the webservice
var url = webservice + mode + "?" + $.param({ uri: context, num: num, user: user }) + "&jsonpCallback=?";
this.element.html("Loading ... ");
var element = this.element;
// call the TagsWidgetWebService using JSONP and create a <ul> list of items
$.getJSON(url,
function(data) {
var html= callback(data);
element.html(html);
}
);
},
/**
* The URI of the currently visited page
*/
getUri: function() {
return this._getData("uri");
},
setUri: function(data) {
this._setData("uri",data);
},
/**
* The URL of the web service to connect to
*/
getWebServiceUrl: function() {
return this._getData("webServiceUrl");
},
/**
* The result count to return.
*/
getNum: function() {
return this._getData("num");
},
/**
* The currently active user
*/
getUser: function() {
return this._getData("user");
},
/**
* The mode of the recommendation widget; one of simple/multifactor/personal
*
*/
getMode: function() {
return this._getData("mode");
}
});
$.kiwi.tags.defaults = {
webServiceUrl: 'http://localhost:8080/KiWi/seam/resource/services/widgets/tags',
mode: 'list',
uri: window.location.href,
num: 10
};
})(jQuery);
|
/*
YUI 3.5.0 (build 5089)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("lang/datatype-date-format_fr",function(a){a.Intl.add("datatype-date-format","fr",{"a":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"A":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"b":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"B":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"c":"%a %d %b %Y %H:%M:%S %Z","p":["AM","PM"],"P":["am","pm"],"x":"%d/%m/%y","X":"%H:%M:%S"});},"3.5.0");
|
version https://git-lfs.github.com/spec/v1
oid sha256:ecdcfeb6d9c10e04bf103e6105698af7bda97180bfc3c7545cce74ce2a73f5eb
size 4291
|
/**
* @ngdoc service
* @name merchello.models.extendedDataDisplayBuilder
*
* @description
* A utility service that builds ExtendedDataBuilder models
*/
angular.module('merchello.models')
.factory('extendedDataDisplayBuilder',
['genericModelBuilder', 'ExtendedDataDisplay', 'ExtendedDataItemDisplay',
function(genericModelBuilder, ExtendedDataDisplay, ExtendedDataItemDisplay) {
var Constructor = ExtendedDataDisplay;
return {
createDefault: function() {
return new Constructor();
},
transform: function(jsonResult) {
var extendedData = new Constructor();
if (jsonResult !== undefined) {
var items = genericModelBuilder.transform(jsonResult, ExtendedDataItemDisplay);
if(items.length > 0) {
extendedData.items = items;
}
}
return extendedData;
}
};
}]);
|
import Ember from 'ember-metal/core'; // reexports
import Test from 'ember-testing/test';
import Adapter from 'ember-testing/adapters/adapter';
import setupForTesting from 'ember-testing/setup_for_testing';
import require from 'require';
import 'ember-testing/support'; // to handle various edge cases
import 'ember-testing/ext/application';
import 'ember-testing/ext/rsvp';
import 'ember-testing/helpers'; // adds helpers to helpers object in Test
import 'ember-testing/initializers'; // to setup initializer
/**
@module ember
@submodule ember-testing
*/
Ember.Test = Test;
Ember.Test.Adapter = Adapter;
Ember.setupForTesting = setupForTesting;
Object.defineProperty(Test, 'QUnitAdapter', {
get: () => require('ember-testing/adapters/qunit').default
});
|
CKEDITOR.plugins.setLang( 'html5audio', 'de', {
button: 'HTML5 Audio einfügen',
title: 'HTML5 Audio',
infoLabel: 'Audio Infos',
urlMissing: 'Sie haben keine URL zur Audio-Datei angegeben.',
audioProperties: 'Audio-Einstellungen',
upload: 'Hochladen',
btnUpload: 'Zum Server senden',
advanced: 'Erweitert',
autoplay: 'Autoplay?',
allowdownload: 'Download zulassen?',
yes: 'Ja',
no: 'Nein'
} );
|
function foo() {
console.log('foo');
}
|
/**
@license
* @pnp/logging v1.0.3 - pnp - light-weight, subscribable logging framework
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/issues
*/
/**
* Class used to subscribe ILogListener and log messages throughout an application
*
*/
class Logger {
/**
* Gets or sets the active log level to apply for log filtering
*/
static get activeLogLevel() {
return Logger.instance.activeLogLevel;
}
static set activeLogLevel(value) {
Logger.instance.activeLogLevel = value;
}
static get instance() {
if (typeof Logger._instance === "undefined" || Logger._instance === null) {
Logger._instance = new LoggerImpl();
}
return Logger._instance;
}
/**
* Adds ILogListener instances to the set of subscribed listeners
*
* @param listeners One or more listeners to subscribe to this log
*/
static subscribe(...listeners) {
listeners.map(listener => Logger.instance.subscribe(listener));
}
/**
* Clears the subscribers collection, returning the collection before modifiction
*/
static clearSubscribers() {
return Logger.instance.clearSubscribers();
}
/**
* Gets the current subscriber count
*/
static get count() {
return Logger.instance.count;
}
/**
* Writes the supplied string to the subscribed listeners
*
* @param message The message to write
* @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)
*/
static write(message, level = 0 /* Verbose */) {
Logger.instance.log({ level: level, message: message });
}
/**
* Writes the supplied string to the subscribed listeners
*
* @param json The json object to stringify and write
* @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)
*/
static writeJSON(json, level = 0 /* Verbose */) {
Logger.instance.log({ level: level, message: JSON.stringify(json) });
}
/**
* Logs the supplied entry to the subscribed listeners
*
* @param entry The message to log
*/
static log(entry) {
Logger.instance.log(entry);
}
/**
* Logs an error object to the subscribed listeners
*
* @param err The error object
*/
static error(err) {
Logger.instance.log({ data: err, level: 3 /* Error */, message: err.message });
}
}
class LoggerImpl {
constructor(activeLogLevel = 2 /* Warning */, subscribers = []) {
this.activeLogLevel = activeLogLevel;
this.subscribers = subscribers;
}
subscribe(listener) {
this.subscribers.push(listener);
}
clearSubscribers() {
const s = this.subscribers.slice(0);
this.subscribers.length = 0;
return s;
}
get count() {
return this.subscribers.length;
}
write(message, level = 0 /* Verbose */) {
this.log({ level: level, message: message });
}
log(entry) {
if (typeof entry !== "undefined" && this.activeLogLevel <= entry.level) {
this.subscribers.map(subscriber => subscriber.log(entry));
}
}
}
/**
* Implementation of LogListener which logs to the console
*
*/
class ConsoleListener {
/**
* Any associated data that a given logging listener may choose to log or ignore
*
* @param entry The information to be logged
*/
log(entry) {
const msg = this.format(entry);
switch (entry.level) {
case 0 /* Verbose */:
case 1 /* Info */:
console.log(msg);
break;
case 2 /* Warning */:
console.warn(msg);
break;
case 3 /* Error */:
console.error(msg);
break;
}
}
/**
* Formats the message
*
* @param entry The information to format into a string
*/
format(entry) {
const msg = [];
msg.push("Message: " + entry.message);
if (typeof entry.data !== "undefined") {
msg.push(" Data: " + JSON.stringify(entry.data));
}
return msg.join("");
}
}
/**
* Implementation of LogListener which logs to the supplied function
*
*/
class FunctionListener {
/**
* Creates a new instance of the FunctionListener class
*
* @constructor
* @param method The method to which any logging data will be passed
*/
constructor(method) {
this.method = method;
}
/**
* Any associated data that a given logging listener may choose to log or ignore
*
* @param entry The information to be logged
*/
log(entry) {
this.method(entry);
}
}
export { Logger, ConsoleListener, FunctionListener };
//# sourceMappingURL=logging.js.map
|
/**
@module ember
@submodule ember-runtime
*/
import { get } from "ember-metal/property_get";
import { set } from "ember-metal/property_set";
import { required } from "ember-metal/mixin";
import { Freezable } from "ember-runtime/mixins/freezable";
import { Mixin } from 'ember-metal/mixin';
import { fmt } from "ember-runtime/system/string";
import EmberError from 'ember-metal/error';
/**
Implements some standard methods for copying an object. Add this mixin to
any object you create that can create a copy of itself. This mixin is
added automatically to the built-in array.
You should generally implement the `copy()` method to return a copy of the
receiver.
Note that `frozenCopy()` will only work if you also implement
`Ember.Freezable`.
@class Copyable
@namespace Ember
@since Ember 0.9
*/
export default Mixin.create({
/**
Override to return a copy of the receiver. Default implementation raises
an exception.
@method copy
@param {Boolean} deep if `true`, a deep copy of the object should be made
@return {Object} copy of receiver
*/
copy: required(Function),
/**
If the object implements `Ember.Freezable`, then this will return a new
copy if the object is not frozen and the receiver if the object is frozen.
Raises an exception if you try to call this method on a object that does
not support freezing.
You should use this method whenever you want a copy of a freezable object
since a freezable object can simply return itself without actually
consuming more memory.
@method frozenCopy
@return {Object} copy of receiver or receiver
*/
frozenCopy: function() {
if (Freezable && Freezable.detect(this)) {
return get(this, 'isFrozen') ? this : this.copy().freeze();
} else {
throw new EmberError(fmt("%@ does not support freezing", [this]));
}
}
});
|
/*
* Atari Arcade SDK
* Developed by gskinner.com in partnership with Atari
* Visit http://atari.com/arcade/developers for documentation, updates and examples.
*
* Copyright (c) Atari Interactive, Inc. All Rights Reserved. Atari and the Atari logo are trademarks owned by Atari Interactive, Inc.
*
* Distributed under the terms of the MIT license.
* http://www.opensource.org/licenses/mit-license.html
*
* This notice shall be included in all copies or substantial portions of the Software.
*/
/** @module GameLibs */
(function(scope) {
/**
* A component which monitors the performance of the game, and toggles low quality
* mode if the
* @class PerformanceMonitor
* @param {Function} callback A function to fire when the performance is deemed to be unacceptable.
* @param {Number} threshold The amount of time in milliseconds that the game is allowed to have poor FPS
* before it toggles low quality.
* @constructor
*/
var PerformanceMonitor = function(callback, minFPS, threshold) {
this.initialize(callback, minFPS, threshold);
}
var s = PerformanceMonitor;
/**
* The default threshold value
* @property DEFAULT_THRESHOLD
* @type {Number}
* @default 3000
* @static
*/
s.DEFAULT_THRESHOLD = 3000;
var p = PerformanceMonitor.prototype = {
maxMs: null,
/**
* The minimum FPS allowed.
* @property minFPS
* @type Number
* @default 30
*/
minFPS: 30,
/**
* The number of milliseconds that can pass before the low quality mode is toggled.
* @property threshold
* @type Number
* @default 3000
*/
threshold:s.DEFAULT_THRESHOLD,
/**
* The method to call when the game enters low quality mode. It is recommended to use a proxy
* method to maintain scope. The callback takes a single argument, which indicates if the game
* is in low quality mode.
* @property callback
* @type Function
*/
callback: null,
/**
* If the game is currently in low quality mode.
* @property lowQualityMode
* @type Boolean
* @default false
*/
lowQualityMode: false,
/**
* The amount of time that has elapsed since the framerate has been acceptable.
* @property timeOnLow
* @type Number
* @default 0
*/
timeOnLow: 0,
initialize: function(callback, minFPS, threshold) {
this.callback = callback;
if(!isNaN(threshold)) { this.threshold = threshold; }
if(!isNaN(minFPS)){ this.minFPS = minFPS; }
this.maxMs = 1000 / minFPS;
this.prevTime = createjs.Ticker.getTime();
createjs.Ticker.addListener(this);
},
/**
* Reset the PerformanceMonitor. This happens whenever a game is restarted or continued.
* Note: Currently NOT implemented in any games.
* @method reset
*/
reset: function() {
this.timeOnLow = 0;
this.lowQualityMode = false;
this.prevTime = createjs.Ticker.getTime();
createjs.Ticker.setFPS(60); //TODO: This should lookup the actual FPS we need.
createjs.Ticker.addListener(this);
this.callback(false);
},
tick: function(){
var deltaT = createjs.Ticker.getTime() - this.prevTime;
this.prevTime = createjs.Ticker.getTime();
if(deltaT < 200 && deltaT > this.maxMs){
this.timeOnLow += deltaT;
if(this.timeOnLow > this.threshold) {
/*
Atari.trace("*** Low Quality Mode toggled.")
*/
this.lowQualityMode = true;
this.callback(true);
createjs.Ticker.setFPS(30);
createjs.Ticker.removeListener(this);
}
} else {
this.timeOnLow = 0;
}
}
}
scope.PerformanceMonitor = PerformanceMonitor;
}(window.GameLibs))
|
var searchData=
[
['error_2eh',['error.h',['../error_8h.html',1,'']]]
];
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* global ko
*/
//var viewmodelraw=
//{
// Name:"David",
// LastName:"Desmaisons",
// Local:{ City:'Florianopolis', Region:'SC'},
// Skills: [{Type:'Langage', Name:'French'},{Type:'Info', Name:'C++'}]
//};
//var viewmodel= ko.MapToCommitObservable(viewmodelraw);
////MapToObservable
//ko.applyBindings(viewmodel);
|
/*
* Copyright (c) 2011-2014 YY Digital Pty Ltd. All Rights Reserved.
* Please see the LICENSE file included with this distribution for details.
*/
var jshint = require("jshint").JSHINT,
logger = require("../../server/logger"),
fs = require("fs"),
path =require("path");
exports.checkContent = function(filename, filecontent) {
if (!jshint(filecontent)) {
jshint.data().errors.forEach(function(error) {
logger.error(filename + (error ? " line: " + error.line + ", column:" + error.character + ", " + error.reason : "") );
});
}
};
exports.checkPath = function(target_path) {
fs.getList(target_path).files.forEach(function(file) {
if (file.match("js$") || file.match("json$")) {
exports.checkContent(file, fs.readFileSync(path.join(target_path, file)).toString());
}
});
};
|
import Map from '../src/ol/Map.js';
import View from '../src/ol/View.js';
import {defaults as defaultControls, ZoomToExtent} from '../src/ol/control.js';
import TileLayer from '../src/ol/layer/Tile.js';
import OSM from '../src/ol/source/OSM.js';
const map = new Map({
controls: defaultControls().extend([
new ZoomToExtent({
extent: [
813079.7791264898, 5929220.284081122,
848966.9639063801, 5936863.986909639
]
})
]),
layers: [
new TileLayer({
source: new OSM()
})
],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2
})
});
|
var Example = function Example() {
"use strict";
babelHelpers.classCallCheck(this, Example);
var _Example;
};
var t = new Example();
|
'use strict';
module.exports = function (math, config) {
var util = require('../../util/index'),
Matrix = math.type.Matrix,
Unit = require('../../type/Unit'),
collection = math.collection,
isBoolean = util['boolean'].isBoolean,
isInteger = util.number.isInteger,
isNumber = util.number.isNumber,
isCollection = collection.isCollection;
/**
* Bitwise right logical shift of value x by y number of bits, `x >>> y`.
* For matrices, the function is evaluated element wise.
* For units, the function is evaluated on the best prefix base.
*
* Syntax:
*
* math.rightLogShift(x, y)
*
* Examples:
*
* math.rightLogShift(4, 2); // returns Number 1
*
* math.rightLogShift([16, -32, 64], 4); // returns Array [1, 2, 3]
*
* See also:
*
* bitAnd, bitNot, bitOr, bitXor, leftShift, rightArithShift
*
* @param {Number | Boolean | Array | Matrix | null} x Value to be shifted
* @param {Number | Boolean | null} y Amount of shifts
* @return {Number | Array | Matrix} `x` zero-filled shifted right `y` times
*/
math.rightLogShift = function rightLogShift(x, y) {
if (arguments.length != 2) {
throw new math.error.ArgumentsError('rightLogShift', arguments.length, 2);
}
if (isNumber(x) && isNumber(y)) {
if (!isInteger(x) || !isInteger(y)) {
throw new Error('Parameters in function rightLogShift must be integer numbers');
}
return x >>> y;
}
if (isCollection(x) && isNumber(y)) {
return collection.deepMap2(x, y, rightLogShift);
}
if (isBoolean(x) || x === null) {
return rightLogShift(+x, y);
}
if (isBoolean(y) || y === null) {
return rightLogShift(x, +y);
}
throw new math.error.UnsupportedTypeError('rightLogShift', math['typeof'](x), math['typeof'](y));
};
};
|
import defaults from './defaults.js';
import _ from './underscore.js';
import './templateSettings.js';
// When customizing `_.templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
function escapeChar(match) {
return '\\' + escapes[match];
}
// In order to prevent third-party code injection through
// `_.templateSettings.variable`, we test it against the following regular
// expression. It is intentionally a bit more liberal than just matching valid
// identifiers, but still prevents possible loopholes through defaults or
// destructuring assignment.
var bareIdentifier = /^\s*(\w|\$)+\s*$/;
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
// NB: `oldSettings` only exists for backwards compatibility.
export default function template(text, settings, oldSettings) {
if (!settings && oldSettings) settings = oldSettings;
settings = defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
index = offset + match.length;
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
} else if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
} else if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
// Adobe VMs need the match returned to produce the correct offset.
return match;
});
source += "';\n";
var argument = settings.variable;
if (argument) {
// Insure against third-party code injection. (CVE-2021-23358)
if (!bareIdentifier.test(argument)) throw new Error(
'variable is not a bare identifier: ' + argument
);
} else {
// If a variable is not specified, place data values in local scope.
source = 'with(obj||{}){\n' + source + '}\n';
argument = 'obj';
}
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + 'return __p;\n';
var render;
try {
render = new Function(argument, '_', source);
} catch (e) {
e.source = source;
throw e;
}
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled source as a convenience for precompilation.
template.source = 'function(' + argument + '){\n' + source + '}';
return template;
}
|
var _ref =
/*#__PURE__*/
<foo />;
function render() {
return _ref;
}
var _ref2 =
/*#__PURE__*/
<div className="foo"><input type="checkbox" checked={true} /></div>;
function render() {
return _ref2;
}
|
exports.forward = require('./forward');
exports.respond = require('./respond');
|
/* flatpickr v4.4.2, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.ms = {})));
}(this, (function (exports) { 'use strict';
var fp = typeof window !== "undefined" && window.flatpickr !== undefined ? window.flatpickr : {
l10ns: {}
};
var Malaysian = {
weekdays: {
shorthand: ["Min", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab"],
longhand: ["Minggu", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu"]
},
months: {
shorthand: ["Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"],
longhand: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"]
},
firstDayOfWeek: 1,
ordinal: function ordinal() {
return "";
}
};
var ms = fp.l10ns;
exports.Malaysian = Malaysian;
exports.default = ms;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
Ext.ns('TYPO3');
TYPO3.backendContentIframePanel = Ext.extend(TYPO3.iframePanel ,{
setUrl: function(source) {
var card;
var wrapper;
wrapper = Ext.getCmp('typo3-contentContainerWrapper');
this.url = source;
if(wrapper) {
card = Ext.getCmp('typo3-card-' + TYPO3.ModuleMenu.App.loadedModule);
if((card != undefined) && (source.search('extjspaneldummy.html') > -1)) {
wrapper.getLayout().setActiveItem('typo3-card-' + TYPO3.ModuleMenu.App.loadedModule);
if (typeof wrapper.getComponent(('typo3-card-' + TYPO3.ModuleMenu.App.loadedModule)).setUrl === 'function') {
wrapper.getComponent(('typo3-card-' + TYPO3.ModuleMenu.App.loadedModule)).setUrl(source);
}
} else {
wrapper.getLayout().setActiveItem(this.id);
this.body.dom.src = source;
this.setMask();
}
}
},
getUrl: function () {
var wrapper;
var card;
wrapper = Ext.getCmp('typo3-contentContainerWrapper');
if(wrapper) {
card = wrapper.getLayout().activeItem;
if(card.id == this.id) {
return this.body.dom.src;
} else if(typeof card.getUrl == 'function') {
return card.getUrl();
} else {
return this.url;
}
}
}
});
Ext.reg('backendContentIframePanel', TYPO3.backendContentIframePanel);
|
jQuery(document).ready(function($){
// Pricing Tables Deleting
$('.uds-pricing-admin-table .pricing-delete').click(function(){
if(!confirm("Really delete table?")) {
return false;
}
});
// products
$('#uds-pricing-products form').submit(function(){
$('#uds-pricing-products .product').each(function(i, el){
$("input[type=checkbox]", this).each(function() {
$(this).attr('name', $(this).attr('name').replace('[]', '[' + i + ']'));
});
$("input[type=radio]", this).each(function() {
$(this).val(i);
});
});
});
// products moving
$('#uds-pricing-products').sortable({
containment: '#uds-pricing-products',
cursor: 'crosshair',
forcePlaceholderSize: true,
forceHelpserSize: true,
handle: '.move',
items: '.product',
placeholder: 'placeholder',
opacity: 0.6,
tolerance: 'pointer',
axis: 'y'
});
// products deleting
$('#uds-pricing-products .delete').click(function(){
if(confirm("Really delete product?")) {
$(this).parents('.product').slideUp(300, function(){
$(this).remove();
});
}
});
// products collapsing
$('#uds-pricing-products h3.collapsible').click(function(){
$('.options', $(this).parent()).slideToggle(300);
$(this).add($(this).parent()).toggleClass('collapsed');
}).trigger('click');
var collapsed = true;
$('.collapse-all').click(function(){
if(collapsed) {
$('.options').slideDown(300);
$('.product').add('h3.collapsible').removeClass('collapsed');
collapsed = false;
$(this).html('Collapse all');
} else {
$('.options').slideUp(300);
$('.product').add('h3.collapsible').addClass('collapsed');
collapsed = true;
$(this).html('Open all');
}
return false;
});
// table changer
$('.uds-change-table').click(function(){
window.location = window.location + "&uds_pricing_edit=" + $('.uds-load-pricing-table').val();
});
//structure
$('#uds-pricing-properties table').sortable({
containment: '#uds-pricing-properties',
cursor: 'crosshair',
forcePlaceHolderSize: true,
handle: '.move',
items: 'tr',
axis: 'y'
});
// properties deleting
$('#uds-pricing-properties .delete').live('click', function(){
if(confirm("Really delete?")) {
$(this).parents("tr").remove();
$('#uds-pricing-properties table').sortable('refresh');
}
});
// properties adding
var empty = $('#uds-pricing-properties tr:last').clone();
$('#uds-pricing-properties .add').live('click', function(){
$('#uds-pricing-properties table').append($(empty).clone());
$('#uds-pricing-properties table').sortable('refresh');
});
// Tooltips
$('.tooltip').hover(function(){
$tt = $(this).parent().find('.tooltip-content');
$tt.stop().css({
display: 'block',
top: $(this).position().top,
left: $(this).position().left + 40 + 'px',
opacity: 0
}).animate({
opacity: 1
}, 300);
}, function(){
$tt = $(this).parent().find('.tooltip-content');
$tt.stop().css({
opacity: 1
}).animate({
opacity: 0
}, {
duration: 300,
complete: function(){
$(this).css('display', 'none');
}
});
});
});
|
elementResizeEvent = require('../index.js');
element = document.getElementById("resize");
window.p = p = document.getElementById("width");
console.log(p);
console.log(elementResizeEvent);
console.log(elementResizeEvent(element, function() {
console.log("resized!");
console.log(element.offsetWidth);
console.log(p);
console.log(element.offsetWidth + "px wide");
p.innerHTML = element.offsetWidth + "px wide";
}));
|
OC.L10N.register(
"updatenotification",
{
"Update notifications" : "Обновяване на известията",
"{version} is available. Get more information on how to update." : "{version} е излязла. Прочетете повече как да обновите до нея. ",
"Updated channel" : "Обновен канал",
"ownCloud core" : "ownCloud core",
"Update for %1$s to version %2$s is available." : "Излязло е ново обновление за %1$s до версия %2$s .",
"Updater" : "Център за обновяване",
"A new version is available: %s" : "Излязла е нова версия: %s",
"Open updater" : "Отворяне на център за обновяване",
"Show changelog" : "Показване на доклада с промени",
"Your version is up to date." : "Вие разполагате с най-новата версия.",
"Checked on %s" : "Проверено на %s",
"Update channel:" : "Обновяване на канал:",
"You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Винаги може да обновите до по-нова версия / експирементален канал. Но не можете вече да върнете до по-стабилен канал.",
"Notify members of the following groups about available updates:" : "Уведомяване на членовете на следните групи за излязлите нови версии:",
"Only notification for app updates are available, because the selected update channel for ownCloud itself does not allow notifications." : "Има само известия за обновения на приложения, защото избраният канал за обновяване на ownCloud не предоставя известия."
},
"nplurals=2; plural=(n != 1);");
|
(function(){
// Back to Top - by CodyHouse.co
var backTop = document.getElementsByClassName('js-cd-top')[0],
offset = 300, // browser window scroll (in pixels) after which the "back to top" link is shown
offsetOpacity = 1200, //browser window scroll (in pixels) after which the "back to top" link opacity is reduced
scrollDuration = 700,
scrolling = false;
if( backTop ) {
//update back to top visibility on scrolling
window.addEventListener("scroll", function(event) {
if( !scrolling ) {
scrolling = true;
(!window.requestAnimationFrame) ? setTimeout(checkBackToTop, 250) : window.requestAnimationFrame(checkBackToTop);
}
});
//smooth scroll to top
backTop.addEventListener('click', function(event) {
event.preventDefault();
(!window.requestAnimationFrame) ? window.scrollTo(0, 0) : Util.scrollTo(0, scrollDuration);
});
}
function checkBackToTop() {
var windowTop = window.scrollY || document.documentElement.scrollTop;
( windowTop > offset ) ? Util.addClass(backTop, 'cd-top--is-visible') : Util.removeClass(backTop, 'cd-top--is-visible cd-top--fade-out');
( windowTop > offsetOpacity ) && Util.addClass(backTop, 'cd-top--fade-out');
scrolling = false;
}
})();
|
var gulp = require('gulp');
var config = require('../config').markup;
var browserSync = require('browser-sync');
var taskDef = function () {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({
stream: true
}));
};
module.exports = taskDef;
gulp.task('markup', taskDef);
|
/*global jasmine*/
var excludes = [
"map_events.html",
"map_lazy_init.html",
"map-lazy-load.html",
"marker_with_dynamic_position.html",
"marker_with_dynamic_address.html",
"marker_with_info_window.html",
"places-auto-complete.html"
];
function using(values, func){
for (var i = 0, count = values.length; i < count; i++) {
if (Object.prototype.toString.call(values[i]) !== '[object Array]') {
values[i] = [values[i]];
}
func.apply(this, values[i]);
jasmine.currentEnv_.currentSpec.description += ' (with using ' + values[i].join(', ') + ')';
}
}
describe('testapp directory', function() {
'use strict';
//var urls = ["aerial-rotate.html", "aerial-simple.html", "hello_map.html", "map_control.html"];
var files = require('fs').readdirSync(__dirname + "/../../testapp");
var urls = files.filter(function(filename) {
return filename.match(/\.html$/) && excludes.indexOf(filename) === -1;
});
console.log('urls', urls);
using(urls, function(url){
it('testapp/'+url, function() {
browser.get(url);
browser.wait( function() {
return browser.executeScript( function() {
var el = document.querySelector("map");
var scope = angular.element(el).scope();
//return scope.map.getCenter().lat();
return scope.map.getCenter();
}).then(function(result) {
return result;
});
}, 5000);
//element(by.css("map")).evaluate('map.getCenter().lat()').then(function(lat) {
// console.log('lat', lat);
// expect(lat).toNotEqual(0);
//});
browser.manage().logs().get('browser').then(function(browserLog) {
(browserLog.length > 0) && console.log('log: ' + require('util').inspect(browserLog));
expect(browserLog).toEqual([]);
});
});
});
});
|
module.exports = {
description: 'does not include called-in-unused-code import'
};
|
//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// Source maps are supported by all recent versions of Chrome, Safari, //
// and Firefox, and by Internet Explorer 11. //
// //
//////////////////////////////////////////////////////////////////////////
(function () {
/* Imports */
var Meteor = Package.meteor.Meteor;
var _ = Package.underscore._;
var ReactiveDict = Package['reactive-dict'].ReactiveDict;
var EJSON = Package.ejson.EJSON;
/* Package-scope variables */
var Session;
(function(){
/////////////////////////////////////////////////////////////////////////////////
// //
// packages/session/session.js //
// //
/////////////////////////////////////////////////////////////////////////////////
//
Session = new ReactiveDict('session'); // 1
// 2
// Documentation here is really awkward because the methods are defined // 3
// elsewhere // 4
// 5
/** // 6
* @memberOf Session // 7
* @method set // 8
* @summary Set a variable in the session. Notify any listeners that the value
* has changed (eg: redraw templates, and rerun any // 10
* [`Tracker.autorun`](#tracker_autorun) computations, that called // 11
* [`Session.get`](#session_get) on this `key`.) // 12
* @locus Client // 13
* @param {String} key The key to set, eg, `selectedItem` // 14
* @param {EJSONable | undefined} value The new value for `key` // 15
*/ // 16
// 17
/** // 18
* @memberOf Session // 19
* @method setDefault // 20
* @summary Set a variable in the session if it hasn't been set before. // 21
* Otherwise works exactly the same as [`Session.set`](#session_set). // 22
* @locus Client // 23
* @param {String} key The key to set, eg, `selectedItem` // 24
* @param {EJSONable | undefined} value The new value for `key` // 25
*/ // 26
// 27
/** // 28
* @memberOf Session // 29
* @method get // 30
* @summary Get the value of a session variable. If inside a [reactive // 31
* computation](#reactivity), invalidate the computation the next time the // 32
* value of the variable is changed by [`Session.set`](#session_set). This // 33
* returns a clone of the session value, so if it's an object or an array, // 34
* mutating the returned value has no effect on the value stored in the // 35
* session. // 36
* @locus Client // 37
* @param {String} key The name of the session variable to return // 38
*/ // 39
// 40
/** // 41
* @memberOf Session // 42
* @method equals // 43
* @summary Test if a session variable is equal to a value. If inside a // 44
* [reactive computation](#reactivity), invalidate the computation the next // 45
* time the variable changes to or from the value. // 46
* @locus Client // 47
* @param {String} key The name of the session variable to test // 48
* @param {String | Number | Boolean | null | undefined} value The value to // 49
* test against // 50
*/ // 51
// 52
/////////////////////////////////////////////////////////////////////////////////
}).call(this);
/* Exports */
if (typeof Package === 'undefined') Package = {};
Package.session = {
Session: Session
};
})();
|
// The translations in this file are added by default.
'use strict';
module.exports = {
counterpart: {
names: require('date-names/en'),
pluralize: require('pluralizers/en'),
formats: {
date: {
default: '%a, %e %b %Y',
long: '%A, %B %o, %Y',
short: '%b %e',
},
time: {
default: '%H:%M',
long: '%H:%M:%S %z',
short: '%H:%M',
},
datetime: {
default: '%a, %e %b %Y %H:%M',
long: '%A, %B %o, %Y %H:%M:%S %z',
short: '%e %b %H:%M',
},
},
},
};
|
/*!
* OOjs UI v0.25.0
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2018 OOjs UI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2018-01-10T00:26:02Z
*/
( function ( OO ) {
'use strict';
/**
* @class
* @extends OO.ui.Theme
*
* @constructor
*/
OO.ui.WikimediaUITheme = function OoUiWikimediaUITheme() {
// Parent constructor
OO.ui.WikimediaUITheme.parent.call( this );
};
/* Setup */
OO.inheritClass( OO.ui.WikimediaUITheme, OO.ui.Theme );
/* Methods */
/**
* @inheritdoc
*/
OO.ui.WikimediaUITheme.prototype.getElementClasses = function ( element ) {
// Parent method
var variant, isFramed, isActive,
variants = {
warning: false,
invert: false,
progressive: false,
destructive: false
},
// Parent method
classes = OO.ui.WikimediaUITheme.parent.prototype.getElementClasses.call( this, element );
if ( element.supports( [ 'hasFlag' ] ) ) {
isFramed = element.supports( [ 'isFramed' ] ) && element.isFramed();
isActive = element.supports( [ 'isActive' ] ) && element.isActive();
if (
// Button with a dark background
isFramed && ( isActive || element.isDisabled() || element.hasFlag( 'primary' ) ) ||
// Toolbar with a dark background
OO.ui.ToolGroup && element instanceof OO.ui.ToolGroup && ( isActive || element.hasFlag( 'primary' ) )
) {
// … use white icon / indicator, regardless of other flags
variants.invert = true;
} else if ( !isFramed && element.isDisabled() ) {
// Frameless disabled button, always use black icon / indicator regardless of other flags
variants.invert = false;
} else if ( !element.isDisabled() ) {
// Any other kind of button, use the right colored icon / indicator if available
variants.progressive = element.hasFlag( 'progressive' );
variants.destructive = element.hasFlag( 'destructive' );
variants.warning = element.hasFlag( 'warning' );
}
}
for ( variant in variants ) {
classes[ variants[ variant ] ? 'on' : 'off' ].push( 'oo-ui-image-' + variant );
}
return classes;
};
/**
* @inheritdoc
*/
OO.ui.WikimediaUITheme.prototype.getDialogTransitionDuration = function () {
return 250;
};
/* Instantiation */
OO.ui.theme = new OO.ui.WikimediaUITheme();
}( OO ) );
//# sourceMappingURL=oojs-ui-wikimediaui.js.map
|
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/localization/fi/FontWarnings.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
MathJax.Localization.addTranslation("fi","FontWarnings",{
version: "2.3",
isLoaded: true,
strings: {
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fi/FontWarnings.js");
|
var mkdirp = require('mkdirp');
var path = require('canonical-path');
module.exports = {
create: function(config) {
var currentVersion = config.get('currentVersion');
var docsBase = path.join(config.get('basePath'), config.get('rendering.outputFolder'), 'docs');
var versionDir = path.join(docsBase, currentVersion);
// create the folders for the current version
mkdirp.sync(versionDir);
}
};
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'indent', 'bn', {
indent: 'ইনডেন্ট বাড়াও',
outdent: 'ইনডেন্ট কমাও'
} );
|
jQuery(function($){
$.supersized({
// Functionality
slideshow : 1, // Slideshow on/off
autoplay : 1, // Slideshow starts playing automatically
start_slide : 1, // Start slide (0 is random)
stop_loop : 0, // Pauses slideshow on last slide
random : 0, // Randomize slide order (Ignores start slide)
slide_interval : 12000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 1000, // Speed of transition
new_window : 1, // Image links open in new window/tab
pause_hover : 0, // Pause slideshow on hover
keyboard_nav : 1, // Keyboard navigation on/off
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
image_protect : 1, // Disables image dragging and right click with Javascript
// Size & Position
min_width : 0, // Min width allowed (in pixels)
min_height : 0, // Min height allowed (in pixels)
vertical_center : 1, // Vertically center background
horizontal_center : 1, // Horizontally center background
fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
fit_portrait : 1, // Portrait images will not exceed browser height
fit_landscape : 0, // Landscape images will not exceed browser width
// Components
slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
thumb_links : 0, // Individual thumb links for each slide
thumbnail_navigation : 0, // Thumbnail navigation
slides : [ // Slideshow Images
{image : './images/feat-bg1.jpg', title : '<div class="major">Apollo</div><div class="slidedescription">Quisque non magna ac tortor tincidunt posuere. Vestibulum luctus aliquet gravida. Etiam non dolor sit amet libero porttitor egestas quis sed urna.</div><ul class="footprints"><li><a href="">Our Work</a></li><li><a href="">Our Blog</a></li><li><a href="">Our People</a></li><ul>', thumb : '', url : '#'},
{image : './images/feat-bg6.jpg', title : '<div class="major">LIVE EPIC</div><div class="slidedescription">What a piece of work is a man, how noble in reason, how infinite in faculties, in form and moving how express and admirable, in action how like an angel, in apprehension how like a god.</div>', thumb : '', url : '#'},
{image : './images/feat-bg2.jpg', title : '<div class="major minor">… or lavishly</div><div class="slidedescription">As a space, Work Happy hosts events regularly with the intent to educate and grow our local creative community. From courses on web design and programming, classes on photography, to community meetups to help introduce creatives to other creatives. </div>', thumb : '', url : '#'},
{image : './images/feat-bg3.jpg', title : '<div class="major">Apollo</div><div class="slidedescription">Desks start at $75 a month part time or $125 full time. All Co-workers have access to all Work Happuy events and meetups. Desks are month to month and the facility does have a security system.</div>', thumb : '', url : '#'},
{image : './images/feat-bg4.jpg', title : '<div class="major">Apollo</div><div class="slidedescription">Desks start at $75 a month part time or $125 full time. All Co-workers have access to all Work Happuy events and meetups. Desks are month to month and the facility does have a security system.</div>', thumb : '', url : '#'},
{image : './images/feat-bg5.jpg', title : '<div class="major">Apollo</div><div class="slidedescription">Desks start at $75 a month part time or $125 full time. All Co-workers have access to all Work Happuy events and meetups. Desks are month to month and the facility does have a security system.</div>', thumb : '', url : '#'}
],
// Theme Options
progress_bar : 0, // Timer for each slide
mouse_scrub : 0
});
});
|
var expect = require("chai").expect;
var sinon = require("sinon");
var chalk = require("chalk");
var ReadlineStub = require("../../helpers/readline");
var Base = require("../../../lib/prompts/base");
describe("`base` prompt (e.g. prompt helpers)", function() {
beforeEach(function() {
this.rl = new ReadlineStub();
this.base = new Base({
message: "foo bar",
name: "name"
}, this.rl );
});
it("`suffix` method should only add ':' if last char is a letter", function() {
expect(this.base.suffix("m:")).to.equal("m: ");
expect(this.base.suffix("m?")).to.equal("m? ");
expect(this.base.suffix("my question?")).to.equal("my question? ");
expect(this.base.suffix(chalk.bold("m"))).to.equal("\u001b[1mm:\u001b[22m ");
expect(chalk.stripColor(this.base.suffix(chalk.bold("m?")))).to.equal("m? ");
expect(this.base.suffix("m")).to.equal("m: ");
expect(this.base.suffix("M")).to.equal("M: ");
expect(this.base.suffix("m ")).to.equal("m ");
expect(this.base.suffix("9")).to.equal("9: ");
expect(this.base.suffix("9~")).to.equal("9~ ");
expect(this.base.suffix()).to.equal(": ");
});
it("should not point by reference to the entry `question` object", function() {
var question = {
message: "foo bar",
name: "name"
};
var base = new Base( question, this.rl );
expect(question).to.not.equal(base.opt);
expect(question.name).to.equal(base.opt.name);
expect(question.message).to.equal(base.opt.message);
});
});
|
var formInstance = (
<Form>
<Input placeholder="验证成功" label="验证成功" validation="success" />
<Input placeholder="验证警告" label="验证警告" validation="warning" />
<Input placeholder="验证失败" label="验证失败" validation="error" />
<FormGroup validation="success">
<label>单选按钮:</label>
<Input type="radio" label="男" inline />
<Input type="radio" label="女" inline />
</FormGroup>
</Form>
);
React.render(formInstance, mountNode);
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
erpnext.SMSManager = function SMSManager(doc) {
var me = this;
this.setup = function() {
var default_msg = {
'Lead' : '',
'Opportunity' : 'Your enquiry has been logged into the system. Ref No: ' + doc.name,
'Quotation' : 'Quotation ' + doc.name + ' has been sent via email. Thanks!',
'Sales Order' : 'Sales Order ' + doc.name + ' has been created against '
+ (doc.quotation_no ? ('Quote No:' + doc.quotation_no) : '')
+ (doc.po_no ? (' for your PO: ' + doc.po_no) : ''),
'Delivery Note' : 'Items has been delivered against delivery note: ' + doc.name
+ (doc.po_no ? (' for your PO: ' + doc.po_no) : ''),
'Sales Invoice': 'Invoice ' + doc.name + ' has been sent via email '
+ (doc.po_no ? (' for your PO: ' + doc.po_no) : ''),
'Material Request' : 'Material Request ' + doc.name + ' has been raised in the system',
'Purchase Order' : 'Purchase Order ' + doc.name + ' has been sent via email',
'Purchase Receipt' : 'Items has been received against purchase receipt: ' + doc.name
}
if (in_list(['Sales Order', 'Delivery Note', 'Sales Invoice'], doc.doctype))
this.show(doc.contact_person, 'Customer', doc.customer, '', default_msg[doc.doctype]);
else if (doc.doctype === 'Quotation')
this.show(doc.contact_person, 'Customer', doc.party_name, '', default_msg[doc.doctype]);
else if (in_list(['Purchase Order', 'Purchase Receipt'], doc.doctype))
this.show(doc.contact_person, 'Supplier', doc.supplier, '', default_msg[doc.doctype]);
else if (doc.doctype == 'Lead')
this.show('', '', '', doc.mobile_no, default_msg[doc.doctype]);
else if (doc.doctype == 'Opportunity')
this.show('', '', '', doc.contact_no, default_msg[doc.doctype]);
else if (doc.doctype == 'Material Request')
this.show('', '', '', '', default_msg[doc.doctype]);
};
this.get_contact_number = function(contact, ref_doctype, ref_name) {
frappe.call({
method: "frappe.core.doctype.sms_settings.sms_settings.get_contact_number",
args: {
contact_name: contact,
ref_doctype: ref_doctype,
ref_name: ref_name
},
callback: function(r) {
if(r.exc) { frappe.msgprint(r.exc); return; }
me.number = r.message;
me.show_dialog();
}
});
};
this.show = function(contact, ref_doctype, ref_name, mobile_nos, message) {
this.message = message;
if (mobile_nos) {
me.number = mobile_nos;
me.show_dialog();
} else if (contact){
this.get_contact_number(contact, ref_doctype, ref_name)
} else {
me.show_dialog();
}
}
this.show_dialog = function() {
if(!me.dialog)
me.make_dialog();
me.dialog.set_values({
'message': me.message,
'number': me.number
})
me.dialog.show();
}
this.make_dialog = function() {
var d = new frappe.ui.Dialog({
title: 'Send SMS',
width: 400,
fields: [
{fieldname:'number', fieldtype:'Data', label:'Mobile Number', reqd:1},
{fieldname:'message', fieldtype:'Text', label:'Message', reqd:1},
{fieldname:'send', fieldtype:'Button', label:'Send'}
]
})
d.fields_dict.send.input.onclick = function() {
var btn = d.fields_dict.send.input;
var v = me.dialog.get_values();
if(v) {
$(btn).set_working();
frappe.call({
method: "frappe.core.doctype.sms_settings.sms_settings.send_sms",
args: {
receiver_list: [v.number],
msg: v.message
},
callback: function(r) {
$(btn).done_working();
if(r.exc) {frappe.msgprint(r.exc); return; }
me.dialog.hide();
}
});
}
}
this.dialog = d;
}
this.setup();
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gTestfile = 'regress-441477-01.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 441477-01;
var summary = '';
var actual = 'No Exception';
var expect = 'No Exception';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
try
{
for (i = 0; i < 5;)
{
if (i > 5)
throw "bad";
i++;
continue;
}
}
catch(ex)
{
actual = ex + '';
}
reportCompare(expect, actual, summary);
exitFunc ('test');
}
|
import React from 'react';
import { Provider } from 'react-redux';
import PropTypes from 'prop-types';
import configureStore from '../store/configureStore';
import { BrowserRouter, Route } from 'react-router-dom';
import { ScrollContext } from 'react-router-scroll-4';
import UI from '../features/ui';
import { fetchCustomEmojis } from '../actions/custom_emojis';
import { hydrateStore } from '../actions/store';
import { connectUserStream } from '../actions/streaming';
import { IntlProvider, addLocaleData } from 'react-intl';
import { getLocale } from '../locales';
import initialState from '../initial_state';
import ErrorBoundary from '../components/error_boundary';
const { localeData, messages } = getLocale();
addLocaleData(localeData);
export const store = configureStore();
const hydrateAction = hydrateStore(initialState);
store.dispatch(hydrateAction);
store.dispatch(fetchCustomEmojis());
const createIdentityContext = state => ({
signedIn: !!state.meta.me,
accountId: state.meta.me,
accessToken: state.meta.access_token,
});
export default class Mastodon extends React.PureComponent {
static propTypes = {
locale: PropTypes.string.isRequired,
};
static childContextTypes = {
identity: PropTypes.shape({
signedIn: PropTypes.bool.isRequired,
accountId: PropTypes.string,
accessToken: PropTypes.string,
}).isRequired,
};
identity = createIdentityContext(initialState);
getChildContext() {
return {
identity: this.identity,
};
}
componentDidMount() {
if (this.identity.signedIn) {
this.disconnect = store.dispatch(connectUserStream());
}
}
componentWillUnmount () {
if (this.disconnect) {
this.disconnect();
this.disconnect = null;
}
}
shouldUpdateScroll (prevRouterProps, { location }) {
return !(location.state?.mastodonModalKey && location.state?.mastodonModalKey !== prevRouterProps?.location?.state?.mastodonModalKey);
}
render () {
const { locale } = this.props;
return (
<IntlProvider locale={locale} messages={messages}>
<Provider store={store}>
<ErrorBoundary>
<BrowserRouter basename='/web'>
<ScrollContext shouldUpdateScroll={this.shouldUpdateScroll}>
<Route path='/' component={UI} />
</ScrollContext>
</BrowserRouter>
</ErrorBoundary>
</Provider>
</IntlProvider>
);
}
}
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/
'use strict';
/* global chrome */
var ports = {};
chrome.runtime.onConnect.addListener(function(port) {
var tab = null;
var name = null;
if (isNumeric(port.name)) {
tab = port.name;
name = 'devtools';
installContentScript(+port.name);
} else {
tab = port.sender.tab.id;
name = 'content-script';
}
if (!ports[tab]) {
ports[tab] = {
devtools: null,
'content-script': null,
};
}
ports[tab][name] = port;
if (ports[tab].devtools && ports[tab]['content-script']) {
doublePipe(ports[tab].devtools, ports[tab]['content-script']);
}
});
function isNumeric(str: string): boolean {
return +str + '' === str;
}
function installContentScript(tabId: number) {
chrome.tabs.executeScript(tabId, {file: '/build/contentScript.js'}, function() {
});
}
function doublePipe(one, two) {
one.onMessage.addListener(lOne);
function lOne(message) {
// console.log('dv -> rep', message);
two.postMessage(message);
}
two.onMessage.addListener(lTwo);
function lTwo(message) {
// console.log('rep -> dv', message);
one.postMessage(message);
}
function shutdown() {
one.onMessage.removeListener(lOne);
two.onMessage.removeListener(lTwo);
one.disconnect();
two.disconnect();
}
one.onDisconnect.addListener(shutdown);
two.onDisconnect.addListener(shutdown);
}
|
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Footer.css';
import Link from '../Link';
function Footer() {
return (
<div className={s.root}>
<div className={s.container}>
<span className={s.text}>© Your Company</span>
<span className={s.spacer}>·</span>
<Link className={s.link} to="/">Home</Link>
<span className={s.spacer}>·</span>
<Link className={s.link} to="/privacy">Privacy</Link>
<span className={s.spacer}>·</span>
<Link className={s.link} to="/not-found">Not Found</Link>
</div>
</div>
);
}
export default withStyles(s)(Footer);
|
var path = require('path');
var package = require('./package');
var webpack = require('webpack');
var ProgressPlugin = require('webpack/lib/ProgressPlugin');
var inspect = require('util').inspect;
var Busboy = require('busboy');
var chalk = require('chalk');
var webpackMiddleware = require('webpack-dev-middleware');
var webpackConfig = require('./webpack.config');
var webpackCompiler = webpack(webpackConfig);
var handler;
webpackCompiler.apply(new ProgressPlugin(function(percentage, msg) {
var stream = process.stderr;
if (stream.isTTY && percentage < 0.71) {
stream.cursorTo(0);
stream.write('📦 ' + chalk.magenta(msg));
stream.clearLine(1);
} else if (percentage === 1) {
console.log(chalk.green('\nwebpack: bundle build is now finished.'));
}
}));
// {{ settings for nico
exports.site = {
name: package.title,
description: package.description,
repo: package.repository.url,
issues: package.bugs.url
};
// PRODUCTION
if (process.env.NODE_ENV === 'PRODUCTION') {
exports.minimized = '.min';
}
exports.package = package;
exports.theme = 'site';
exports.source = process.cwd();
exports.output = path.join(process.cwd(), '_site');
exports.permalink = '{{directory}}/{{filename}}';
exports.ignorefilter = function(filepath, subdir) {
var extname = path.extname(filepath);
if (extname === '.tmp' || extname === '.bak') {
return false;
}
if (/\.DS_Store/.test(filepath)) {
return false;
}
if (/^(_site|_theme|node_modules|site|\.idea)/.test(subdir)) {
return false;
}
return true;
};
exports.middlewares = [
{
name: 'upload',
filter: /upload\.do?$/,
handle: function(req, res, next) {
if (req.method === 'POST') {
var busboy = new Busboy({headers: req.headers});
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
console.log('File [' + fieldname + ']: filename: ' + filename + ', encoding: ' + encoding + ', mimetype: ' + mimetype);
file.on('data', function(data) {
console.log('File [' + fieldname + '] got ' + data.length + ' bytes');
});
file.on('end', function() {
console.log('File [' + fieldname + '] Finished');
});
});
busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) {
console.log('Field [' + fieldname + ']: value: ' + inspect(val));
});
busboy.on('finish', function() {
console.log('Done parsing form!');
//res.writeHead(303, { Connection: 'close', Location: '/' });
res.end(JSON.stringify({
'status': 'success',
'url': '/example.file'
}));
});
req.pipe(busboy);
}
}
},
{
name: 'webpackDevMiddleware',
filter: /\.(js|css)(\.map)?$/,
handle: function(req, res, next) {
handler = handler || webpackMiddleware(webpackCompiler, {
publicPath: '/dist/',
lazy: false,
watchOptions: {
aggregateTimeout: 300,
poll: true
},
noInfo: true
});
try {
return handler(req, res, next);
} catch(e) {}
}
}];
exports.writers = [
'nico-jsx.PageWriter',
'nico-jsx.StaticWriter',
'nico-jsx.FileWriter'
];
// end settings }}
process.on('uncaughtException', function(err) {
console.log(err);
});
|
tinyMCE.addI18n('sk.simple',{
bold_desc:"Tu\u010Dn\u00FD text (Ctrl+B)",
italic_desc:"\u0160ikm\u00FD text (kurz\u00EDva) (Ctrl+I)",
underline_desc:"Pod\u010Diarknut\u00FD text (Ctrl+U)",
striketrough_desc:"Pre\u0161krtnut\u00FD text",
bullist_desc:"Zoznam s odr\u00E1\u017Ekami",
numlist_desc:"\u010C\u00EDslovan\u00FD zoznam",
undo_desc:"Sp\u00E4\u0165 (Ctrl+Z)",
redo_desc:"Znovu (Ctrl+Y)",
cleanup_desc:"Vy\u010Disti\u0165 neupraven\u00FD k\u00F3d"
});
|
describe('Controller: FileController', function() {
var $scope,
File;
beforeEach(module('Bastion.files', 'Bastion.test-mocks'));
beforeEach(inject(function($controller, $rootScope, MockResource) {
$scope = $rootScope.$new();
File = MockResource.$new();
$scope.$stateParams = {
fileId: 1
};
$controller('FileController', {
$scope: $scope,
File: File
});
}));
it('attaches file to scope', function() {
expect($scope.file).toBeDefined();
expect($scope.panel.loading).toBe(false);
});
});
|
/*
* SERVER-6127 : $project uasserts if an expected nested field has a non object parent in a document
*
* This test validates the SERVER-6127 ticket. Return undefined when retrieving a field along a
* path, when the subpath does not exist (this is what happens when a field does not exist and
* there is no path). Previous it would uassert causing the aggregation to end.
*/
/*
* 1) Clear and create testing db
* 2) Run an aggregation that simply projects a two fields, one with a sub path one without
* 3) Assert that the result is what we expected
*/
// Clear db
db.s6127.drop();
// Populate db
db.s6127.save({a:1});
db.s6127.save({foo:2});
db.s6127.save({foo:{bar:3}});
// Aggregate checking the field foo and the path foo.bar
var s6127 = db.s6127.aggregate(
{ $project : {
_id : 0,
'foo.bar' : 1,
field : "$foo",
path : "$foo.bar"
}}
);
/*
* The first document should contain nothing as neither field exists, the second document should
* contain only field as it has a value in foo, but foo does not have a field bar so it cannot walk
* that path, the third document should have both the field and path as foo is an object which has
* a field bar
*/
var s6127result = [
{
},
{
field : 2
},
{
foo : {
bar : 3
},
field : {
bar : 3
},
path : 3
}
];
// Assert
assert.eq(s6127.result, s6127result, 's6127 failed');
|
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var aStackPool = [];
var bStackPool = [];
/**
* Checks if two values are equal. Values may be primitives, arrays, or objects.
* Returns true if both arguments have the same keys and values.
*
* @see http://underscorejs.org
* @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* @license MIT
*/
function areEqual(a, b) {
var aStack = aStackPool.length ? aStackPool.pop() : [];
var bStack = bStackPool.length ? bStackPool.pop() : [];
var result = eq(a, b, aStack, bStack);
aStack.length = 0;
bStack.length = 0;
aStackPool.push(aStack);
bStackPool.push(bStack);
return result;
}
function eq(a, b, aStack, bStack) {
if (a === b) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
return a !== 0 || 1 / a == 1 / b;
}
if (a == null || b == null) {
// a or b can be `null` or `undefined`
return false;
}
if (typeof a != 'object' || typeof b != 'object') {
return false;
}
var objToStr = Object.prototype.toString;
var className = objToStr.call(a);
if (className != objToStr.call(b)) {
return false;
}
switch (className) {
case '[object String]':
return a == String(b);
case '[object Number]':
return isNaN(a) || isNaN(b) ? false : a == Number(b);
case '[object Date]':
case '[object Boolean]':
return +a == +b;
case '[object RegExp]':
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase;
}
// Assume equality for cyclic structures.
var length = aStack.length;
while (length--) {
if (aStack[length] == a) {
return bStack[length] == b;
}
}
aStack.push(a);
bStack.push(b);
var size = 0;
// Recursively compare objects and arrays.
if (className === '[object Array]') {
size = a.length;
if (size !== b.length) {
return false;
}
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
if (!eq(a[size], b[size], aStack, bStack)) {
return false;
}
}
} else {
if (a.constructor !== b.constructor) {
return false;
}
if (a.hasOwnProperty('valueOf') && b.hasOwnProperty('valueOf')) {
return a.valueOf() == b.valueOf();
}
var keys = Object.keys(a);
if (keys.length != Object.keys(b).length) {
return false;
}
for (var i = 0; i < keys.length; i++) {
if (!eq(a[keys[i]], b[keys[i]], aStack, bStack)) {
return false;
}
}
}
aStack.pop();
bStack.pop();
return true;
}
module.exports = areEqual;
|
(function() {
var DE = window.DiscourseEmbed || {};
var comments = document.getElementById('discourse-comments');
var iframe = document.createElement('iframe');
['discourseUrl', 'discourseEmbedUrl', 'discourseUserName'].forEach(function(i) {
if (window[i]) { DE[i] = DE[i] || window[i]; }
});
var queryParams = {};
if (DE.discourseEmbedUrl) {
queryParams.embed_url = encodeURIComponent(DE.discourseEmbedUrl);
}
if (DE.discourseUserName) {
queryParams.discourse_username = DE.discourseUserName;
}
if (DE.topicId) {
queryParams.topic_id = DE.topicId;
}
var src = DE.discourseUrl + 'embed/comments';
var keys = Object.keys(queryParams);
if (keys.length > 0) {
src += "?";
for (var i=0; i<keys.length; i++) {
if (i > 0) { src += "&"; }
var k = keys[i];
src += k + "=" + queryParams[k];
}
}
iframe.src = src;
iframe.id = 'discourse-embed-frame';
iframe.width = "100%";
iframe.frameBorder = "0";
iframe.scrolling = "no";
comments.appendChild(iframe);
// Thanks http://amendsoft-javascript.blogspot.ca/2010/04/find-x-and-y-coordinate-of-html-control.html
function findPosY(obj)
{
var top = 0;
if(obj.offsetParent)
{
while(1)
{
top += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
}
else if(obj.y)
{
top += obj.y;
}
return top;
}
function normalizeUrl(url) {
return url.replace(/^https?(\:\/\/)?/, '');
}
function postMessageReceived(e) {
if (!e) { return; }
if (normalizeUrl(DE.discourseUrl).indexOf(normalizeUrl(e.origin)) === -1) { return; }
if (e.data) {
if (e.data.type === 'discourse-resize' && e.data.height) {
iframe.height = e.data.height + "px";
}
if (e.data.type === 'discourse-scroll' && e.data.top) {
// find iframe offset
var destY = findPosY(iframe) + e.data.top;
window.scrollTo(0, destY);
}
}
}
window.addEventListener('message', postMessageReceived, false);
})();
|
/*!
* Copyright 2019 Hitachi Vantara. 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.
*/
define([
"angular"
], function (angular) {
/**
* @param {Function} $document - Angular wrapper for window.document.
* @return {Object} - context directive
*/
function context($document) {
return {
restrict: "A",
link: function (scope, element, attrs) {
var contextMenu = angular.element(document.querySelector('#' + attrs.context));
element.bind('contextmenu', function (event) {
scope.$apply(function () {
event.stopPropagation();
event.preventDefault();
var contextHeight = contextMenu.outerHeight();
var contextWidth = contextMenu.outerWidth();
var documentHeight = $document.height();
var documentWidth = $document.width();
var contextY = event.clientY + contextHeight > documentHeight ? documentHeight - contextHeight : event.clientY;
var contextX = event.clientX + contextWidth > documentWidth ? documentWidth - contextWidth : event.clientX;
contextMenu.css({
'display': 'block',
'top': contextY + 'px',
'left': contextX + 'px'
})
});
});
angular.element($document).bind('click', function (event) {
contextMenu.css({
'display': 'none'
});
});
angular.element($document).bind('keydown', function (event) {
if (event.keyCode === 27) {
contextMenu.css({
'display': 'none'
});
}
});
}
};
}
return {
name: "context",
options: ["$document", context]
};
});
|
#!/usr/bin/env node
var tests = require("./hardcoded_tests.js");
var runTest = require(".//hardcoded_test_runner.js");
var colors = require("colors");
var parseArgs = require("minimist");
var failures = {};
var num_successes = 0;
var num_failures = 0;
var argv = parseArgs(
process.argv.slice(2),
{string: ["filter"]}
);
var todo = {};
function escape_content(content) {
return content
.replace(/[\\]/g, '\\\\')
.replace(/[\/]/g, '\\/')
.replace(/[\b]/g, '\\b')
.replace(/[\f]/g, '\\f')
.replace(/[\n]/g, '\\n')
.replace(/[\r]/g, '\\r')
.replace(/[\t]/g, '\\t');
}
function test_section(section) {
console.log("===%s===".bold, section);
for (var content in tests[section]) {
test = {
content: content,
spec: tests[section][content]
};
test.dumpAst = argv.dumpAst;
test.jsonErrors = argv.jsonErrors;
test.showDifferences = argv.showDifferences;
var name = escape_content(test.content);
process.stdout.write("RUNNING".yellow + " " + name + "\r");
var result = runTest(test);
if (result.passed) {
console.log('%s: "%s"', 'PASSED'.green, name);
num_successes++;
} else {
console.log('%s: "%s"', 'FAILED'.redBG.white, name);
num_failures++;
failures[section] = failures[section] || {};
failures[section][test.content] = result;
}
}
}
function go() {
if (typeof argv.filter == "string") {
var regex = new RegExp(argv.filter);
for (section in tests) {
if (tests.hasOwnProperty(section)) {
var foundOne = false;
for (test in tests[section]) {
if (test.match(regex)) {
foundOne = true;
} else {
delete tests[section][test];
}
}
if (!foundOne) {
delete tests[section];
}
}
}
} else if (typeof argv.filter != "undefined") {
console.log("Filter must be a string, given %s", typeof argv.filter);
return usage();
}
for (prop in tests) {
if (todo[prop]) {
delete tests[prop];
}
}
if (argv.dumpAst) {
var num_tests = 0;
for (prop in tests) {
if (tests.hasOwnProperty(prop)) {
num_tests += tests[prop].length;
}
}
if (num_tests > 20) {
console.log(
"Oh summer child, you really don't want to dump the Ast for %d tests. " +
"Try using --filter to run fewer tests",
num_tests
);
return usage();
}
}
for (prop in tests) {
if (tests.hasOwnProperty(prop)) {
test_section(prop);
}
}
console.log("%d/%d tests passed", num_successes, num_successes + num_failures);
if (num_failures > 0) {
console.log("*** %d TESTS FAILED! ***".redBG.white, num_failures);
for (section in failures) {
if (failures.hasOwnProperty(section)) {
console.log("===%s Failures===".bold, section);
for (test in failures[section]) {
if (failures[section].hasOwnProperty(test)) {
var result = failures[section][test];
console.log('Test failure: "%s"'.redBG.white, escape_content(test));
console.log(result.output);
}
}
}
}
process.exit(1);
}
}
function usage() {
console.log("usage: %s [OPTIONS]", process.argv[0]);
console.log("Supported options");
console.log("\t--dumpAst", "Dumps the esprima & flow ASTs before each test");
console.log("\t--filter=regex", "Only run tests that match the regex");
console.log("\t--jsonErrors", "Output errors in json format");
}
if (argv.help) {
usage();
} else {
go();
}
|
//// [tests/cases/compiler/allowSyntheticDefaultImports7.ts] ////
//// [b.d.ts]
export function foo();
export function bar();
//// [a.ts]
import { default as Foo } from "./b";
Foo.bar();
Foo.foo();
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var b_1;
return {
setters: [
function (b_1_1) {
b_1 = b_1_1;
}
],
execute: function () {
b_1["default"].bar();
b_1["default"].foo();
}
};
});
|
Clazz.declarePackage ("javajs.swing");
Clazz.load (["javajs.swing.AbstractButton"], "javajs.swing.JCheckBox", null, function () {
c$ = Clazz.declareType (javajs.swing, "JCheckBox", javajs.swing.AbstractButton);
Clazz.makeConstructor (c$,
function () {
Clazz.superConstructor (this, javajs.swing.JCheckBox, ["chkJCB"]);
});
Clazz.overrideMethod (c$, "toHTML",
function () {
var s = "<label><input type=checkbox id='" + this.id + "' class='JCheckBox' style='" + this.getCSSstyle (0, 0) + "' " + (this.selected ? "checked='checked' " : "") + "onclick='SwingController.click(this)'>" + this.text + "</label>";
return s;
});
});
|
/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.2.0
build: 2676
*/
YUI.add('querystring-stringify', function(Y) {
/**
* Provides Y.QueryString.stringify method for converting objects to Query Strings.
*
* @module querystring
* @submodule querystring-stringify
* @for QueryString
* @static
*/
var QueryString = Y.namespace("QueryString"),
stack = [],
L = Y.Lang;
/**
* Provides Y.QueryString.escape method to be able to override default encoding
* method. This is important in cases where non-standard delimiters are used, if
* the delimiters would not normally be handled properly by the builtin
* (en|de)codeURIComponent functions.
* Default: encodeURIComponent
* @module querystring
* @submodule querystring-stringify
* @for QueryString
* @static
**/
QueryString.escape = encodeURIComponent;
/**
* <p>Converts an arbitrary value to a Query String representation.</p>
*
* <p>Objects with cyclical references will trigger an exception.</p>
*
* @method stringify
* @param obj {Variant} any arbitrary value to convert to query string
* @param sep {String} (optional) Character that should join param k=v pairs together. Default: "&"
* @param eq {String} (optional) Character that should join keys to their values. Default: "="
* @param name {String} (optional) Name of the current key, for handling children recursively.
* @static
*/
QueryString.stringify = function (obj, c, name) {
var begin, end, i, l, n, s,
sep = c && c.sep ? c.sep : "&",
eq = c && c.eq ? c.eq : "=",
aK = c && c.arrayKey ? c.arrayKey : false;
if (L.isNull(obj) || L.isUndefined(obj) || L.isFunction(obj)) {
return name ? QueryString.escape(name) + eq : '';
}
if (L.isBoolean(obj) || Object.prototype.toString.call(obj) === '[object Boolean]') {
obj =+ obj;
}
if (L.isNumber(obj) || L.isString(obj)) {
return QueryString.escape(name) + eq + QueryString.escape(obj);
}
if (L.isArray(obj)) {
s = [];
name = aK ? name + '[]' : name;
l = obj.length;
for (i = 0; i < l; i++) {
s.push( QueryString.stringify(obj[i], c, name) );
}
return s.join(sep);
}
// now we know it's an object.
// Check for cyclical references in nested objects
for (i = stack.length - 1; i >= 0; --i) {
if (stack[i] === obj) {
throw new Error("QueryString.stringify. Cyclical reference");
}
}
stack.push(obj);
s = [];
begin = name ? name + '[' : '';
end = name ? ']' : '';
for (i in obj) {
if (obj.hasOwnProperty(i)) {
n = begin + i + end;
s.push(QueryString.stringify(obj[i], c, n));
}
}
stack.pop();
s = s.join(sep);
if (!s && name) {
return name + "=";
}
return s;
};
}, '3.2.0' );
|
/**
* A test for ensuring that the WMS's registered in Known Layers are working as expected
*/
Ext.define('admin.tests.KnownLayerWMS', {
extend : 'admin.tests.SingleAJAXTest',
getTitle : function() {
return 'Known layer WMS availability';
},
getDescription : function() {
var baseDescription = 'This tests the backend connection to all web map services that belong to known layers. A simple GetMap and GetFeatureInfo request is with an artificial bounding box.';
baseDescription += this.callParent(arguments);
return baseDescription;
},
/**
* The entirety of our test is making a request to the controller and parsing the resposne
*/
startTest : function() {
//Init our params
var bbox = Ext.create('portal.util.BBox',{
eastBoundLongitude : 116,
westBoundLongitude : 115,
northBoundLatitude : -31,
southBoundLatitude : -32
}); //rough bounds around Perth, WA
var layerNames = [];
var serviceUrls = [];
var onlineResources = this._getKnownLayerOnlineResources('WMS');
if (onlineResources.length == 0) {
this._changeStatus(admin.tests.TestStatus.Unavailable);
return;
}
for (var i = 0; i < onlineResources.length; i++) {
layerNames.push(onlineResources[i].get('name'));
serviceUrls.push(onlineResources[i].get('url'));
}
//Run our test
this._singleAjaxTest('testWMS.diag', {
bbox : Ext.JSON.encode(bbox),
serviceUrls : serviceUrls,
layerNames : layerNames
});
}
});
|
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
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 extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var _this = this;
// Add a lambda to ensure global 'this' capture is triggered
(function () { return _this.window; });
// class inheritance to ensure __extends is emitted
var m;
(function (m) {
var base = /** @class */ (function () {
function base() {
}
return base;
}());
m.base = base;
var child = /** @class */ (function (_super) {
__extends(child, _super);
function child() {
return _super !== null && _super.apply(this, arguments) || this;
}
return child;
}(base));
m.child = child;
})(m || (m = {}));
|
/**
* Copyright 2012 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
DOMSnitch.Heuristics.Json = function() {
/*
this._dbg = DOMSnitch.Heuristics.LightDbg.getInstance();
document.addEventListener("Eval", this._handleEval.bind(this), true);
*/
// Workaround for eval().
// More info at http://radi.r-n-d.org/2011/02/evil-magic-of-eval.html
var collector = DOMSnitch.Heuristics.XhrCollector.getInstance();
collector.addListener(this._checkXhr.bind(this));
window.addEventListener("message", this._checkPostMsg.bind(this), true);
}
DOMSnitch.Heuristics.Json.prototype = {
_checkJsonValidity: function(recordInfo) {
if(!recordInfo.jsData) {
return;
}
var code = 0; // None
var notes = "";
var jsData = recordInfo.jsData;
var canParse = true;
var hasCode = false;
if(jsData[0] == "(" && jsData[jsData.length - 1] == ")") {
jsData = jsData.substring(1, jsData.length - 1);
}
if(this._isJson(jsData)) {
try {
JSON.parse(jsData);
} catch (e) {
canParse = false;
}
jsData = jsData.replace(/,\]/g, ",null]");
jsData = jsData.replace(/\[,/g, "[null,");
jsData = jsData.replace(/,,/g, ",null,");
jsData = jsData.replace(/,,/g, ",null,");
jsData = jsData.replace(/{([\w_]+):/g, "{\"$1\":");
jsData = jsData.replace(/,([\w_]+):/g, ",\"$1\":");
jsData = jsData.replace(/'(\w+)'/g, "\"$1\"");
try {
JSON.parse(jsData);
} catch (e) {
hasCode = true;
}
if(!canParse) {
code = 2; // Medium
notes += "Malformed JSON object.\n";
}
if(!canParse && hasCode) {
code = 2; // Medium
notes += "Found code in JSON object.\n";
}
}
if(code > 1) {
var data = "JSON object:\n" + recordInfo.jsData;
if(!!recordInfo.debugInfo) {
data += "\n\n-----\n\n";
data += "Raw stack trace:\n" + recordInfo.debugInfo;
}
var record = {
documentUrl: location.href,
type: recordInfo.type,
data: data,
callStack: [],
gid: recordInfo.globalId,
env: {},
scanInfo: {code: code, notes: notes}
};
this._report(record);
}
},
_checkPostMsg: function(event) {
var code = this._stripBreakers(event.data);
var globalId = event.origin + "#InvalidJson";
window.setTimeout(
this._checkJsonValidity.bind(
this,
{
jsData: code,
globalId: globalId,
type: "Invalid JSON"
}
),
10
);
},
_checkXhr: function(event) {
var xhr = event.xhr;
var code = this._stripBreakers(xhr.responseBody);
var globalId = xhr.requestUrl + "#InvalidJson";
window.setTimeout(
this._checkJsonValidity.bind(
this,
{
jsData: code,
globalId: globalId,
type: "Invalid JSON"
}
),
10
);
},
_handleEval: function(event) {
var elem = event.target.documentElement;
var args = JSON.parse(elem.getAttribute("evalArgs"));
var code = args[0];
var globalId = elem.getAttribute("evalGid");
var debugInfo = this._dbg.collectStackTrace();
elem.removeAttribute("evalArgs");
elem.removeAttribute("evalGid");
window.setTimeout(
this._checkJsonValidity.bind(
this,
{
jsData: code,
globalId: globalId,
type: "Invalid JSON",
debugInfo: debugInfo
}
),
10
);
},
_isJson: function(jsData) {
var seemsJson = /\{.+\}/.test(jsData);
seemsJson = seemsJson || /\[.+\]/.test(jsData);
seemsJson = seemsJson && !(/(function|while|if)[\s\w]*\(/.test(jsData));
seemsJson = seemsJson && !(/(try|else)\s*\{/.test(jsData));
return seemsJson;
},
_report: function(obj) {
chrome.extension.sendRequest({type: "log", record: obj});
},
_stripBreakers: function(jsData) {
var cIdx = jsData.indexOf("{");
var aIdx = jsData.indexOf("[");
var cfIdx = jsData.lastIndexOf("}");
var afIdx = jsData.lastIndexOf("]");
var idx = 0;
var fidx = 0;
if(cIdx > -1 && aIdx > -1) {
idx = cIdx > aIdx ? aIdx : cIdx;
} else if(cIdx > -1) {
idx = cIdx;
} else if(aIdx > -1) {
idx = aIdx;
}
return jsData.substring(idx);
}
}
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Jesse Ruderman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//-----------------------------------------------------------------------------
var BUGNUMBER = 424311;
var summary = 'Do not assert: entry->kpc == ((PCVCAP_TAG(entry->vcap) > 1) ? (jsbytecode *) JSID_TO_ATOM(id) : cx->fp->regs->pc)';
var actual = 'No Crash';
var expect = 'No Crash';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
(function(){(function(){ constructor=({}); })()})();
reportCompare(expect, actual, summary);
exitFunc ('test');
}
|
define(['exports'], function (exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var App = exports.App = function () {
function App() {
_classCallCheck(this, App);
this.firstName = 'John';
this.lastName = 'Doe';
}
App.prototype.mouseMove = function mouseMove(e) {
this.mouseX = e.clientX;
this.mouseY = e.clientY;
};
App.prototype.mouseMove200 = function mouseMove200(e) {
this.mouse200X = e.clientX;
this.mouse200Y = e.clientY;
};
App.prototype.mouseMove800 = function mouseMove800(e) {
this.mouse800X = e.clientX;
this.mouse800Y = e.clientY;
};
return App;
}();
});
|
'use strict';
module.exports = function renderMenu(props) {
if (!props.menu) {
return;
}
return props.menu({
className: 'z-header-menu-column',
gridColumns: props.columns
});
};
|
var config = require('../config')
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence')
var getEnabledTasks = require('../lib/getEnabledTasks')
var productionTask = function(cb) {
var tasks = getEnabledTasks('production')
gulpSequence('clean', tasks.assetTasks, tasks.codeTasks, 'rev', 'static', cb)
}
gulp.task('production', productionTask)
module.exports = productionTask
|
/**
* @overview If this code is included on a page with wbads it will add the criteo data as global
* targeting params to all ad slots rendered on the page.
*
* Set the globals window.CRTG_* prior to including this script
* so the criteo tags are properly added.
*
* This script must be included AFTER wbads is included.
*
* @todo: consider rewriting all wbads and plugins as amd modules or at least with umd
*
* @requires window.CRTG_NID
* @requires window.CRTG_COOKIE_NAME
* @optional window.CRTG_VAR_NAME - defaults to 'crtg_content'
* @requires window.wbads
*/
/*jslint browser: true, devel: true, todo: true, regexp: true */
/*global wbads: true */
window.CRTG_NID = window.CRTG_NID || false;
window.CRTG_COOKIE_NAME = window.CRTG_COOKIE_NAME || false;
window.CRTG_VAR_NAME = window.CRTG_VAR_NAME || 'crtg_content';
(function(w, d, wbads) {
'use strict';
var ctagId = 'criteo-js',
ctag = d.getElementById(ctagId);
if (ctag) {
if (!w.CRTG_NID) {
w.CRTG_NID = ctag.getAttribute('data-nid') || false;
}
if (!w.CRTG_COOKIE_NAME) {
w.CRTG_COOKIE_NAME = ctag.getAttribute('data-cookie-name') || false;
}
}
if (!w.CRTG_NID || !w.CRTG_COOKIE_NAME || !w.CRTG_VAR_NAME) {
return;
}
if (!ctag) {
ctag = d.createElement('script');
ctag.type = 'text/javascript';
ctag.id = ctagId;
ctag.async = true;
ctag.setAttribute('class', ctagId);
ctag.setAttribute('data-nid', w.CRTG_NID);
ctag.setAttribute('data-cookie-name', w.CRTG_COOKIE_NAME);
ctag.setAttribute('data-var-name', w.CRTG_VAR_NAME);
var rnd = Math.floor(Math.random() * 99999999999);
var url = location.protocol + '//rtax.criteo.com/delivery/rta/rta.js?netId=' + encodeURIComponent(w.CRTG_NID);
url += '&cookieName=' + encodeURIComponent(w.CRTG_COOKIE_NAME);
url += '&rnd=' + rnd;
url += '&varName=' + encodeURIComponent(w.CRTG_VAR_NAME);
ctag.src = url;
d.getElementsByTagName('head')[0].appendChild(ctag);
}
/**
* Get the criteo cookie value.
*
* @param {string} cookieName
* @returns {string}
*/
function getCookie(cookieName) {
var i, x, y, cookies = document.cookie.split(';');
for (i = 0; i < cookies.length; i++) {
x = cookies[i].substr(0, cookies[i].indexOf('='));
y = cookies[i].substr(cookies[i].indexOf('=') + 1);
x = x.replace(/^\s+|\s+$/g, '');
if (x == cookieName) {
return decodeURIComponent(y);
}
}
return'';
}
wbads.defineCallback('pre.enable.services', function() {
var parts, params = getCookie(w.CRTG_COOKIE_NAME).split(';');
for (var i = 0; i < params.length; i++) {
parts = params[i].split('=');
wbads.setGlobalTargetingParam('' + parts[0], '' + parts[1]);
}
});
}(window, document, window.wbads));
|
/* global SnippetedMessages */
Template.snippetedMessages.helpers({
hasMessages() {
return SnippetedMessages.find({ snippeted:true, rid: this.rid }, { sort: { ts: -1 } }).count() > 0;
},
messages() {
return SnippetedMessages.find({ snippeted: true, rid: this.rid }, { sort: { ts: -1 } });
},
message() {
return _.extend(this, { customClass: 'snippeted' });
},
hasMore() {
return Template.instance().hasMore.get();
}
});
Template.snippetedMessages.onCreated(function() {
this.hasMore = new ReactiveVar(true);
this.limit = new ReactiveVar(50);
const self = this;
this.autorun(function() {
const data = Template.currentData();
self.subscribe('snippetedMessages', data.rid, self.limit.get(), function() {
if (SnippetedMessages.find({ snippeted: true, rid: data.rid }).count() < self.limit.get()) {
return self.hasMore.set(false);
}
});
});
});
|
'use strict';
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
var hasSymbolSham = require('./shams');
module.exports = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') { return false; }
if (typeof Symbol !== 'function') { return false; }
if (typeof origSymbol('foo') !== 'symbol') { return false; }
if (typeof Symbol('bar') !== 'symbol') { return false; }
return hasSymbolSham();
};
|
function runTest(config,qualifier) {
var testname = testnamePrefix( qualifier, config.keysystem ) + ', basic events';
var configuration = getSimpleConfigurationForContent( config.content );
if ( config.initDataType && config.initData ) configuration.initDataTypes = [ config.initDataType ]
async_test(function(test)
{
var initDataType;
var initData;
var mediaKeySession;
function processMessage(event)
{
assert_true(event instanceof window.MediaKeyMessageEvent);
assert_equals(event.target, mediaKeySession);
assert_equals(event.type, 'message');
assert_any( assert_equals,
event.messageType,
[ 'license-request', 'individualization-request' ] );
config.messagehandler( event.messageType, event.message ).then( function( response ) {
waitForEventAndRunStep('keystatuseschange', mediaKeySession, test.step_func(processKeyStatusesChange), test);
mediaKeySession.update( response ).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
});
}
function processKeyStatusesChange(event)
{
assert_true(event instanceof Event);
assert_equals(event.target, mediaKeySession);
assert_equals(event.type, 'keystatuseschange');
test.done();
}
navigator.requestMediaKeySystemAccess( config.keysystem, [ configuration ] ).then(function(access) {
initDataType = access.getConfiguration().initDataTypes[0];
if ( config.initDataType && config.initData ) {
initData = config.initData;
} else {
initData = getInitData(config.content, initDataType);
}
return access.createMediaKeys();
}).then(test.step_func(function(mediaKeys) {
mediaKeySession = mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, test.step_func(processMessage), test);
return mediaKeySession.generateRequest(initDataType, initData);
})).catch(test.step_func(function(error) {
forceTestFailureFromPromise(test, error);
}));
}, testname );
}
|
module.exports = {
initialize: function (success, fail, args, env) {
GeofenceComponent.GeofenceTrigger.register();
success && success();
},
addOrUpdate: function (success, fail, args, env) {
args.forEach(function (geo) {
var geoN = new GeofenceComponent.GeoNotification();
geoN.id = geo.id;
geoN.latitude = geo.latitude;
geoN.longitude = geo.longitude;
geoN.transitionType = geo.transitionType;
geoN.radius = geo.radius;
geoN.notificationText = geo.notification.text;
geoN.notificationTitle = geo.notification.title;
geoN.openAppOnClick = geo.notification.openAppOnClick;
geoN.data = JSON.stringify(geo.notification.data);
GeofenceComponent.GeoNotificationManager.addOrUpdate(geoN);
});
success && success();
},
remove: function (success, fail, args, env) {
args.forEach(function (geoId) {
GeofenceComponent.GeoNotificationManager.remove(geoId);
});
success && success();
},
removeAll: function (success, fail, args, env) {
GeofenceComponent.GeoNotificationManager.removeAll();
success && success();
}
};
require("cordova/exec/proxy").add("GeofencePlugin", module.exports);
|
/**
* lodash 3.0.3 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
/** `Object#toString` result references. */
var boolTag = '[object Boolean]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Checks if `value` is classified as a boolean primitive or object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
(isObjectLike(value) && objectToString.call(value) == boolTag);
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
module.exports = isBoolean;
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'newpage', 'da', {
toolbar: 'Ny side'
} );
|
describe("setPathValues", function() {
require("./primitive.spec");
require("./atom.spec");
require("./expired.spec");
require("./branch.spec");
});
|
exports.BattleAbilities = {
"cutecharm": {
inherit: true,
onAfterDamage: function(damage, target, source, move) {
if (move && move.isContact) {
if (this.random(3) < 1) {
source.addVolatile('attract', target);
}
}
}
},
"effectspore": {
inherit: true,
onAfterDamage: function(damage, target, source, move) {
if (move && move.isContact && !source.status) {
var r = this.random(300);
if (r < 10) source.setStatus('slp');
else if (r < 20) source.setStatus('par');
else if (r < 30) source.setStatus('psn');
}
}
},
"flamebody": {
inherit: true,
onAfterDamage: function(damage, target, source, move) {
if (move && move.isContact) {
if (this.random(3) < 1) {
source.trySetStatus('brn', target, move);
}
}
}
},
"flashfire": {
inherit: true,
onTryHit: function(target, source, move) {
if (target !== source && move.type === 'Fire') {
if (move.id === 'willowisp' && (target.hasType('Fire') || target.status || target.volatiles['substitute'])) {
return;
}
if (!target.addVolatile('flashfire')) {
this.add('-immune', target, '[msg]');
}
return null;
}
}
},
"lightningrod": {
desc: "During double battles, this Pokemon draws any single-target Electric-type attack to itself. If an opponent uses an Electric-type attack that affects multiple Pokemon, those targets will be hit. This ability does not affect Electric Hidden Power or Judgment. The user is immune to Electric and its Special Attack is increased one stage when hit by one.",
shortDesc: "This Pokemon draws opposing Electric moves to itself.",
onFoeRedirectTargetPriority: 1,
onFoeRedirectTarget: function(target, source, source2, move) {
if (move.type !== 'Electric') return;
if (this.validTarget(this.effectData.target, source, move.target)) {
return this.effectData.target;
}
},
id: "lightningrod",
name: "Lightningrod",
rating: 3.5,
num: 32
},
"pickup": {
inherit: true,
onResidualOrder: null,
onResidualSubOrder: null,
onResidual: null
},
"poisonpoint": {
inherit: true,
onAfterDamage: function(damage, target, source, move) {
if (move && move.isContact) {
if (this.random(3) < 1) {
source.trySetStatus('psn', target, move);
}
}
}
},
"pressure": {
inherit: true,
onStart: null
},
"rockhead": {
inherit: true,
onModifyMove: function(move) {
if (move.id !== 'struggle') delete move.recoil;
}
},
"roughskin": {
inherit: true,
onAfterDamage: function(damage, target, source, move) {
if (source && source !== target && move && move.isContact) {
this.damage(source.maxhp/16, source, target);
}
}
},
"shadowtag": {
inherit: true,
onFoeModifyPokemon: function(pokemon) {
pokemon.trapped = true;
}
},
"static": {
inherit: true,
onAfterDamage: function(damage, target, source, effect) {
if (effect && effect.isContact) {
if (this.random(3) < 1) {
source.trySetStatus('par', target, effect);
}
}
}
},
"stench": {
inherit: true,
onModifyMove: function(){}
},
"sturdy": {
inherit: true,
onDamage: function(damage, target, source, effect) {
if (effect && effect.ohko) {
this.add('-activate',target,'Sturdy');
return 0;
}
}
},
"synchronize": {
inherit: true,
onAfterSetStatus: function(status, target, source) {
if (!source || source === target) return;
var status = status.id;
if (status === 'slp' || status === 'frz') return;
if (status === 'tox') status = 'psn';
source.trySetStatus(status);
}
},
"trace": {
inherit: true,
onUpdate: function(pokemon) {
var target = pokemon.side.foe.randomActive();
if (!target || target.fainted) return;
var ability = this.getAbility(target.ability);
var bannedAbilities = {forecast:1, multitype:1, trace:1};
if (bannedAbilities[target.ability]) {
return;
}
if (ability === 'Intimidate')
{
if (pokemon.setAbility('Illuminate')) { //Temporary fix so Intimidate doesn't activate in third gen when traced
this.add('-ability',pokemon, ability,'[from] ability: Trace','[of] '+target);
}
}
else if (pokemon.setAbility(ability)) {
this.add('-ability',pokemon, ability,'[from] ability: Trace','[of] '+target);
}
}
},
"voltabsorb": {
inherit: true,
onTryHit: function(target, source, move) {
if (target !== source && move.type === 'Electric' && move.id !== 'thunderwave') {
if (!this.heal(target.maxhp/4)) {
this.add('-immune', target, '[msg]');
}
return null;
}
}
}
};
|
define([
"dojo/_base/declare", // declare
"dojo/Deferred",
"dojo/_base/kernel", // kernel.deprecated
"dojo/_base/lang", // lang.mixin
"dojo/store/util/QueryResults",
"./_AutoCompleterMixin",
"./_ComboBoxMenu",
"../_HasDropDown",
"dojo/text!./templates/DropDownBox.html"
], function(declare, Deferred, kernel, lang, QueryResults, _AutoCompleterMixin, _ComboBoxMenu, _HasDropDown, template){
// module:
// dijit/form/ComboBoxMixin
return declare("dijit.form.ComboBoxMixin", [_HasDropDown, _AutoCompleterMixin], {
// summary:
// Provides main functionality of ComboBox widget
// dropDownClass: [protected extension] Function String
// Dropdown widget class used to select a date/time.
// Subclasses should specify this.
dropDownClass: _ComboBoxMenu,
// hasDownArrow: Boolean
// Set this textbox to have a down arrow button, to display the drop down list.
// Defaults to true.
hasDownArrow: true,
templateString: template,
baseClass: "dijitTextBox dijitComboBox",
/*=====
// store: [const] dojo/store/api/Store|dojo/data/api/Read
// Reference to data provider object used by this ComboBox.
//
// Should be dojo/store/api/Store, but dojo/data/api/Read supported
// for backwards compatibility.
store: null,
=====*/
// Set classes like dijitDownArrowButtonHover depending on
// mouse action over button node
cssStateNodes: {
"_buttonNode": "dijitDownArrowButton"
},
_setHasDownArrowAttr: function(/*Boolean*/ val){
this._set("hasDownArrow", val);
this._buttonNode.style.display = val ? "" : "none";
},
_showResultList: function(){
// hide the tooltip
this.displayMessage("");
this.inherited(arguments);
},
_setStoreAttr: function(store){
// For backwards-compatibility, accept dojo.data store in addition to dojo/store/api/Store. Remove in 2.0.
if(!store.get){
lang.mixin(store, {
_oldAPI: true,
get: function(id){
// summary:
// Retrieves an object by it's identity. This will trigger a fetchItemByIdentity.
// Like dojo/store/DataStore.get() except returns native item.
var deferred = new Deferred();
this.fetchItemByIdentity({
identity: id,
onItem: function(object){
deferred.resolve(object);
},
onError: function(error){
deferred.reject(error);
}
});
return deferred.promise;
},
query: function(query, options){
// summary:
// Queries the store for objects. Like dojo/store/DataStore.query()
// except returned Deferred contains array of native items.
var deferred = new Deferred(function(){ fetchHandle.abort && fetchHandle.abort(); });
deferred.total = new Deferred();
var fetchHandle = this.fetch(lang.mixin({
query: query,
onBegin: function(count){
deferred.total.resolve(count);
},
onComplete: function(results){
deferred.resolve(results);
},
onError: function(error){
deferred.reject(error);
}
}, options));
return QueryResults(deferred);
}
});
}
this._set("store", store);
},
postMixInProperties: function(){
// Since _setValueAttr() depends on this.store, _setStoreAttr() needs to execute first.
// Unfortunately, without special code, it ends up executing second.
var store = this.params.store || this.store;
if(store){
this._setStoreAttr(store);
}
this.inherited(arguments);
// User may try to access this.store.getValue() etc. in a custom labelFunc() function.
// It's not available with the new data store for handling inline <option> tags, so add it.
if(!this.params.store && !this.store._oldAPI){
var clazz = this.declaredClass;
lang.mixin(this.store, {
getValue: function(item, attr){
kernel.deprecated(clazz + ".store.getValue(item, attr) is deprecated for builtin store. Use item.attr directly", "", "2.0");
return item[attr];
},
getLabel: function(item){
kernel.deprecated(clazz + ".store.getLabel(item) is deprecated for builtin store. Use item.label directly", "", "2.0");
return item.name;
},
fetch: function(args){
kernel.deprecated(clazz + ".store.fetch() is deprecated for builtin store.", "Use store.query()", "2.0");
var shim = ["dojo/data/ObjectStore"]; // indirection so it doesn't get rolled into a build
require(shim, lang.hitch(this, function(ObjectStore){
new ObjectStore({objectStore: this}).fetch(args);
}));
}
});
}
}
});
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* Arguments : ()
*
* @path ch11/11.2/11.2.4/S11.2.4_A1.1_T1.js
* @description Function is declared with no FormalParameterList
*/
function f_arg() {
return arguments;
}
//CHECK#1
if (f_arg().length !== 0) {
$ERROR('#1: function f_arg() {return arguments;} f_arg().length === 0. Actual: ' + (f_arg().length));
}
//CHECK#2
if (f_arg()[0] !== undefined) {
$ERROR('#2: function f_arg() {return arguments;} f_arg()[0] === undefined. Actual: ' + (f_arg()[0]));
}
|
/// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-i-26.js
* @description Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters)
*/
function testcase() {
var testResult = false;
var initialValue = 0;
function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 2) {
testResult = (curVal === 2);
}
}
var func = function (a, b, c) {
Array.prototype.reduce.call(arguments, callbackfn, initialValue);
};
func(0, 1, 2);
return testResult;
}
runTestCase(testcase);
|
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart
*
* @path ch07/7.8/7.8.3/S7.8.3_A3.4_T4.js
* @description ExponentPart :: E -DecimalDigits
*/
//CHECK#0
if (0.0E-1 !== 0) {
$ERROR('#0: 0.0E-1 === 0');
}
//CHECK#1
if (1.1E-1 !== 0.11) {
$ERROR('#1: 1.1E-1 === 0.11');
}
//CHECK#2
if (2.2E-1 !== 0.22) {
$ERROR('#2: 2.2E-1 === 0.22');
}
//CHECK#3
if (3.3E-1 !== 0.33) {
$ERROR('#3: 3.3E-1 === 0.33');
}
//CHECK#4
if (4.4E-1 !== 0.44) {
$ERROR('#4: 4.4E-1 === 0.44');
}
//CHECK#5
if (5.5E-1 !== 0.55) {
$ERROR('#5: 5.5E-1 === 0.55');
}
//CHECK#6
if (6.6E-1 !== 0.66) {
$ERROR('#6: 6.E-1 === 0.66');
}
//CHECK#7
if (7.7E-1 !== 0.77) {
$ERROR('#7: 7.7E-1 === 0.77');
}
//CHECK#8
if (8.8E-1 !== 0.88) {
$ERROR('#8: 8.8E-1 === 0.88');
}
//CHECK#9
if (9.9E-1 !== 0.99) {
$ERROR('#9: 9.9E-1 === 0.99');
}
|
var arrayAggregator = require('./_arrayAggregator'),
baseAggregator = require('./_baseAggregator'),
baseIteratee = require('./_baseIteratee'),
isArray = require('./isArray');
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
};
}
module.exports = createAggregator;
|
angular.module('listDemo1', ['ngMaterial'])
.config(function($mdIconProvider) {
$mdIconProvider
.iconSet('communication', 'img/icons/sets/communication-icons.svg', 24);
})
.controller('AppCtrl', function($scope) {
var imagePath = 'img/60.jpeg';
$scope.phones = [
{
type: 'Home',
number: '(555) 251-1234',
options: {
icon: 'communication:phone'
}
},
{
type: 'Cell',
number: '(555) 786-9841',
options: {
icon: 'communication:phone',
avatarIcon: true
}
},
{
type: 'Office',
number: '(555) 314-1592',
options: {
face : imagePath
}
},
{
type: 'Offset',
number: '(555) 192-2010',
options: {
offset: true,
actionIcon: 'communication:phone'
}
}
];
$scope.todos = [
{
face : imagePath,
what: 'My quirky, joyful porg',
who: 'Kaguya w/ #qjporg',
when: '3:08PM',
notes: " I was lucky to find a quirky, joyful porg!"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
];
});
|
import React from 'react'
import { Router, Route, hashHistory } from 'react-router'
import Home from './components/ui/Home'
import About from './components/ui/About'
import MemberList from './components/ui/MemberList'
import { Left, Right, Whoops404 } from './components'
const routes = (
<Router history={hashHistory}>
<Route path="/" component={Home} />
<Route path="/" component={Left}>
<Route path="about" component={About} />
<Route path="members" component={MemberList} />
</Route>
<Route path="*" component={Whoops404} />
</Router>
)
export default routes
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTableBodyUtilityClass = getTableBodyUtilityClass;
exports.default = void 0;
var _unstyled = require("@material-ui/unstyled");
function getTableBodyUtilityClass(slot) {
return (0, _unstyled.generateUtilityClass)('MuiTableBody', slot);
}
const tableBodyClasses = (0, _unstyled.generateUtilityClasses)('MuiTableBody', ['root']);
var _default = tableBodyClasses;
exports.default = _default;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.