text
stringlengths 2
6.14k
|
|---|
/*
* Licensed Materials - Property of IBM
* (C) Copyright IBM Corp. 2010, 2017
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
define({
// NLS_CHARSET=UTF-8
// configuration
configuration_pane_aspera_url: "Adresa URL servera IBM Aspera",
configuration_pane_aspera_url_hover: "Zadajte adresu URL servera IBM Aspera. Napríklad: https://názov_hostiteľa:číslo_portu/aspera/faspex",
configuration_pane_aspera_url_prompt: "Dôrazne odporúčame, aby ste používali protokol HTTPS.",
configuration_pane_max_docs_to_send: "Maximálny počet odoslaných položiek",
configuration_pane_max_docs_to_send_hover: "Zadajte maximálny počet položiek, ktoré môžu užívatelia naraz odoslať.",
configuration_pane_max_procs_to_send: "Maximálny počet súbežných požiadaviek",
configuration_pane_max_procs_to_send_hover: "Zadajte maximálny počet požiadaviek, ktoré môžu byť súčasne spustené.",
configuration_pane_target_transfer_rate: "Cieľová prenosová rýchlosť (v Mb/s)",
configuration_pane_target_transfer_rate_hover: "Zadajte cieľovú prenosovú rýchlosť ako Mb/s. Maximálna rýchlosť je obmedzená licenčnými oprávneniami.",
configuration_pane_speed_info: "Vaša aktuálna základná licencia umožňuje maximálnu prenosovú rýchlosť 20 Mb/s. Ak chcete vykonať inováciu na rýchlejšiu skúšobnú licenciu (podporujúcu prenosovú rýchlosť až do 10 Gb/s) pre softvér Aspera Faspex, požiadajte o novú licenciu na stránke <a target='_blank' href='https://ibm.biz/BdjYHq'>Aspera Evaluation Request</a>.",
// runtime
send_dialog_sender_title: "Odosielateľ: ${0}",
send_dialog_not_set: "Nenastavené",
send_dialog_send_one: "Poslať '${0}'.",
send_dialog_send_more: "Poslať súbory: ${0}.",
send_dialog_sender: "Meno užívateľa:",
send_dialog_password: "Heslo:",
send_dialog_missing_sender_message: "Je potrebné zadať meno užívateľa pre prihlásenie na server IBM Aspera.",
send_dialog_missing_password_message: "Je potrebné zadať heslo pre prihlásenie na server IBM Aspera.",
send_dialog_title: "Poslať cez IBM Aspera",
send_dialog_missing_title_message: "Musíte zadať názov.",
send_dialog_info: "Posielajte súbory cez server IBM Aspera a upozornite užívateľov, že si môžu stiahnuť súbory.",
send_dialog_recipients_label: "Príjemcovia:",
send_dialog_recipients_textfield_hover_help: "E-mailové adresy alebo mená užívateľov oddeľte čiarkou. Napríklad, zadajte: 'adresa1, adresa2, meno_užívateľa1, meno_užívateľa2'.",
send_dialog_missing_recipients_message: "Zadajte aspoň jednu e-mailovú adresu alebo meno užívateľa.",
send_dialog_title_label: "Názov:",
send_dialog_note_label: "Pridajte správu.",
send_dialog_earPassphrase_label: "Heslo pre šifrovanie:",
send_dialog_earPassphrase_textfield_hover_help: "Zadajte heslo pre zašifrovanie súborov na serveri. Toto heslo budú musieť príjemcovia zadať, aby mohli dešifrovať chránené súbory po stiahnutí.",
send_dialog_notify_title: "Upozornenie: ${0}",
send_dialog_notifyOnUpload_label: "Upozorniť ma na nahratie súboru",
send_dialog_notifyOnDownload_label: "Upozorniť ma na stiahnutie súboru",
send_dialog_notifyOnUploadDownload: "Upozorniť ma na nahratie a stiahnutie súboru",
send_dialog_send_button_label: "Odoslať",
send_dialog_started: "Balík ${0} sa posiela.",
status_started: "Stav balíka: ${0} - prebieha (${1} %)",
status_stopped: "Stav balíka: ${0} - zastavené",
status_failed: "Stav balíka: ${0} - neúspešné",
status_completed: "Stav balíka: ${0} - dokončené",
// error
send_dialog_too_many_items_error: "Nepodarilo sa odoslať položky.",
send_dialog_too_many_items_error_explanation: "Môžete odoslať najviac ${0} položiek naraz. Pokúšate sa odoslať ${1} položiek.",
send_dialog_too_many_items_error_userResponse: "Vyberte menší počet položiek a znova sa ich pokúste odoslať. Taktiež sa môžete obrátiť na správcu systému a požiadať ho, aby zvýšil maximálny počet súbežne odosielaných položiek.",
send_dialog_too_many_items_error_0: "maximum_number_of_items",
send_dialog_too_many_items_error_1: "number_of_items",
send_dialog_too_many_items_error_number: 5050,
});
|
'use strict';
var commentLineExp = /^[\s]*<!-- (\/|#) (CE|EE)/;
var requireConfExp = /require-conf.js$/;
module.exports = function(config, copyConf) {
var grunt = config.grunt;
var path = require('path');
var now = (new Date()).getTime();
var version = grunt.file.readJSON(path.resolve(__dirname, '../../../../package.json')).version;
version = (version.indexOf('-SNAPSHOT') > -1 ? (version +'-'+ now) : version);
function prod () {
return grunt.config('buildMode') === 'prod';
}
function cacheBust(content, srcpath) {
if (srcpath.slice(-4) !== 'html') { return content; }
return content.split('$GRUNT_CACHE_BUST').join(prod() ? version : now);
}
function fileProcessing(content, srcpath) {
if(prod()) {
// removes the template comments
content = content
.split('\n').filter(function(line) {
return !commentLineExp.test(line);
}).join('\n');
}
content = cacheBust(content, srcpath);
return content;
}
copyConf.cockpit_index = {
options: {
process: fileProcessing
},
files: [
{
expand: true,
cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/scripts/',
src: [
'index.html',
'camunda-cockpit-bootstrap.js'
],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/'
}
]
};
copyConf.cockpit_assets = {
files: [
// custom styles and/or other css files
{
expand: true,
cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/styles',
src: ['*.css'],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/styles/'
},
// images, fonts & stuff
{
expand: true,
cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/',
src: [
'{fonts,images}/**/*.*'
],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/assets'
},
// commons-ui images
{
expand: true,
cwd: '<%= pkg.gruntConfig.commonsUiDir %>/resources/img/',
src: [
'*.*'
],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/assets/images'
},
// dojo & dojox
{
expand: true,
cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/vendor/dojo',
src: [
'**/*.*'
],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/assets/vendor'
},
// bootstrap fonts
{
expand: true,
cwd: 'node_modules/bootstrap/fonts',
src: [
'*.{eot,ttf,svg,woff,woff2}'
],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/'
},
// bpmn fonts
{
expand: true,
cwd: 'node_modules/bpmn-font/dist/font',
src: [
'*.{eot,ttf,svg,woff}'
],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/'
},
// open sans
{
expand: true,
cwd: '<%= pkg.gruntConfig.commonsUiDir %>/vendor/fonts',
src: ['*.{eot,svg,ttf,woff,woff2}'],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/'
},
// dmn
{
expand: true,
cwd: 'node_modules/dmn-js/fonts',
src: ['*.{eot,svg,ttf,woff,woff2}'],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/'
},
// placeholder shims
{
expand: true,
cwd: '<%= pkg.gruntConfig.commonsUiDir %>/vendor',
src: ['placeholders.*'],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/scripts/'
}
]
};
copyConf.cockpit_config = {
files: [
{
expand: true,
cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/scripts',
src: ['config.js'],
dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/scripts/'
}
]
};
};
|
'use strict';
let Joi = require('joi');
class RequestVaildator {
getListParameterValidator() {
return {
type: Joi.any().valid(process.env.TEMPLATE_PARTS.split(','))
}
}
getListQueryValidator() {
return {
page: Joi.number().min(1),
limit: Joi.number().min(parseInt(process.env.PAGINATION_LIMIT))
}
}
getPostValidator() {
return {
name: Joi.string().min(5).max(35).required(),
group: Joi.any().valid(process.env.TEMPLATE_PARTS.split(',')).required(),
subgroup: Joi.string().min(3).max(35),
content: Joi.object().keys({
html: Joi.string().required(),
css: Joi.string(),
js: Joi.string(),
engine: Joi.string()
}).required(),
viewareas: Joi.array()
}
}
getUpdateValidator() {
let updateValidator = this.getPostValidator();
updateValidator.id = Joi.string().alphanum().min(24);
return updateValidator;
}
}
module.exports = new RequestVaildator();
|
var express = require('express');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(favicon());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(require('less-middleware')({ src: path.join(__dirname, 'public') }));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes);
app.use('/users', users);
/// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
/// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
module.exports = app;
|
const path = require('path');
const fs = require('fs');
const morgan = require('morgan');
const morganDebug = require('morgan-debug');
const rfs = require('rotating-file-stream');
const config = require(path.join(__dirname, '..', 'logging'));
module.exports = function () {
if (!config.enabled) {
return;
}
const directory = path.join('../..', 'logs');
if (!fs.existsSync(directory)) {
fs.mkdirSync(directory);
}
const accessStream = rfs('access.log', {
interval: '1d',
path: directory
});
this.use(morgan('combined', {
stream: accessStream
}));
this.use(morganDebug('morten.js:access', 'common'));
};
|
import { LightningElement } from 'lwc';
export default class Example1 extends LightningElement {
}
|
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 3 */,
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(2);
/***/ })
/******/ ]);
//# sourceMappingURL=Bootstrap.js.map
|
/**
* @param {string} foo
* @param {string} [bar]
* @param {string=} baz some blurb
* @param {string} [quuz=Nope Nope Nope] more blurb
* @return {number}
*/
function allTheOptionalForms(foo, bar, baz, quuz) {
return 4;
};
/**
* @param {string} foo
* @param {string} [bar]
* @param {string=} baz some blurb
* @param {string} [quuz=Nope Nope Nope] more blurb
* @return {number}
*/
function allTheOptionalFormsWithDefaults(foo, bar, baz = 'Nope', quuz = 'Nope Nope Nope') {
return 4;
};
/**
* @param {number} foo
* @return {number}
*/
function optionalParamWithWrongJSdoc(foo = '4') {
return Number(foo);
};
|
angular.module("emiolo").factory("apiInterceptor", function ($q) {
return {
request: function (config) {
return config;
},
responseError: function (rejection) {
console.log(rejection.config.url);
return $q.reject(rejection);
}
};
});
angular.module("emiolo").config(function ($httpProvider) {
$httpProvider.interceptors.push("apiInterceptor");
});
/*angular.module("emiolo").run(["$rootScope", "$location", function($rootScope, $location) {
$rootScope.$on("$routeChangeSuccess", function(userInfo) {
console.log(userInfo);
});
$rootScope.$on("$routeChangeError", function(event, current, previous, eventObj) {
if (eventObj.authenticated === false) {
$location.path("/login");
}
});
}]);*/
|
const Discord = require('discord.js');
exports.run = async (client, message, args, level) => { // eslint-disable-line no-unused-vars
const scoreLevel = client.points.get(`${message.guild.id}-${message.author.id}`).level || 0;
let embed = new Discord.RichEmbed()
.setColor('GREEN')
.setAuthor('You are currently')
.setDescription(scoreLevel)
.setFooter(client.user.username, client.user.avatarURL)
!scoreLevel ? message.channel.send('You have no levels yet.') : message.channel.send(embed);
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: 0
};
exports.help = {
name: 'level',
category: 'Fun',
description: 'Well, let\'s see how many levels you have!',
usage: 'level'
};
|
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2013 Mozilla Foundation
*
* 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.
*/
/* globals mozL10n, GrabToPan, Preferences, SecondaryToolbar */
//#include grab_to_pan.js
var HandTool = {
initialize: function handToolInitialize(options) {
var toggleHandTool = options.toggleHandTool;
this.handTool = new GrabToPan({
element: options.container,
onActiveChanged: function(isActive) {
if (!toggleHandTool) {
return;
}
if (isActive) {
toggleHandTool.title =
mozL10n.get('hand_tool_disable.title', null, 'Disable hand tool');
toggleHandTool.firstElementChild.textContent =
mozL10n.get('hand_tool_disable_label', null, 'Disable hand tool');
} else {
toggleHandTool.title =
mozL10n.get('hand_tool_enable.title', null, 'Enable hand tool');
toggleHandTool.firstElementChild.textContent =
mozL10n.get('hand_tool_enable_label', null, 'Enable hand tool');
}
}
});
if (toggleHandTool) {
toggleHandTool.addEventListener('click', this.toggle.bind(this), false);
window.addEventListener('localized', function (evt) {
Preferences.get('enableHandToolOnLoad').then(function resolved(value) {
if (value) {
this.handTool.activate();
}
}.bind(this), function rejected(reason) {});
}.bind(this));
}
},
toggle: function handToolToggle() {
this.handTool.toggle();
SecondaryToolbar.close();
},
enterPresentationMode: function handToolEnterPresentationMode() {
if (this.handTool.active) {
this.wasActive = true;
this.handTool.deactivate();
}
},
exitPresentationMode: function handToolExitPresentationMode() {
if (this.wasActive) {
this.wasActive = null;
this.handTool.activate();
}
}
};
|
/**
* PokemonController
*
* @description :: Server-side logic for managing Pokemons
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
hola: function (req, res) {
return res.send("Hola desde el controlador pokemon");
},
adios: function (req, res) {
return res.send("Adios desde el controlador");
}
};
|
import { helper } from '@ember/component/helper';
export function fooBar(params) {
if (params[0]) {
let penaltyMap = {
30: 'Repeating Substantial Portions of a Song',
32: 'Instrumental Accompaniment',
34: 'Chorus Exceeding 4-Part Texture',
36: 'Excessive Melody Not in Inner Part',
38: 'Lack of Characteristic Chord Progression',
39: 'Excessive Lyrics < 4 parts',
40: 'Primarily Patriotic/Religious Intent',
50: 'Sound Equipment or Electronic Enhancement',
}
return penaltyMap[params[0]];
}
}
export default helper(fooBar);
|
var searchData=
[
['datetime',['datetime',['../structdatetime.html',1,'']]]
];
|
var readFile = require('graceful-fs').readFile
var resolve = require('path').resolve
var spawn = require('win-spawn')
module.exports = function () {
return {
getStatement: function getStatement (callback) {
readFile(
resolve(__dirname, './problem.txt'),
{encoding: 'utf-8'},
callback
)
},
verify: function verify (args, t) {
var filename = args[0]
if (!filename) {
t.fail('must include file to verify')
return t.end()
}
var server = spawn(
'node',
[resolve(__dirname, './server.js')],
{env: {'NODE_DEBUG': 'http', 'PATH': process.env.PATH}}
)
var out = ''
var err = ''
server.stdout.on('data', function (data) {
console.log(data.toString('utf8').trim())
out += data.toString('utf8')
if (out.match(/listening/)) {
var client = spawn('node', [resolve(process.cwd(), filename)])
var cout = ''
var cerr = ''
client.stdout.on('data', function (data) { cout += data.toString('utf8') })
client.stderr.on('data', function (data) { cerr += data.toString('utf8') })
client.on('close', function (code) {
t.equal(code, 0, 'exited without errors')
t.equal(cout, 'BODY: hello\n', 'got expected response from server')
t.equal(cerr, 'done!\n', 'process logged at end')
server.kill()
})
}
})
server.stderr.on('data', function (data) {
console.log(data.toString('utf8').trim())
err += data.toString('utf8')
})
server.on('close', function () {
t.notOk(
out.match(/parse error/) || err.match(/parse error/) || err.match(/EADDRINUSE/),
'request was made successfully'
)
t.end()
})
}
}
}
|
/*
Strike by Appiphony
Version: 1.0.0
Website: http://www.lightningstrike.io
GitHub: https://github.com/appiphony/Strike-Components
License: BSD 3-Clause License
*/
({
afterRender: function(component, helper) {
this.superAfterRender();
helper.selectRadioButtonFromValue(component, helper);
}
})
/*
Copyright 2017 Appiphony, LLC
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder 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 HOLDER 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.
*/
|
module.exports = function notEmpty(o) {
if (o == null) {
return false;
} else if (Array.isArray(o)) {
return !!o.length;
} else if (o === '') {
return false;
}
return true;
};
|
/*
Copyright (c) 2006, Tim Becker 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.
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.
*/
function dumpProperties (obj) {
var result = ""
print(obj)
for (var p in obj){
print(""+p+" = "+obj[p]+"")
}
// print ("<dl>")
// for (var p in obj){
// print("<dt>"+p+"</dt><dd><pre>"+obj[p]+"</pre></dd>")
// }
// print ("<dl>")
}
function print (obj) {
document.writeln(obj+"<br>")
}
function write (obj) {
document.writeln(obj);
}
function toggle(elId) {
var e = document.getElementById(elId);
if (e.style.display == "block")
e.style.display = "none";
else
e.style.display = "block";
return false;
}
function debugInfo () {
print ("Browser Infos (<a href=\"#\" onclick=\"toggle(\'debugInfo\')\">+</a>)")
print("<small><div id=\"debugInfo\" style=\"display:none\" class=\"source\">")
dumpProperties (navigator)
print("")
print("</div></small>")
}
function escapeHTML (str) {
str= str.replace(/</g, "<")
str= str.replace(/>/g, ">")
str= str.replace(/&/g, "&")
return str
}
function runTests (testArr) {
write ("<h1>"+document.title+"</h1>")
var numFailed = 0
var numException = 0
for (var i=0; i!=testArr.length; ++i) {
var result
try {
result = testArr[i]()
if (!result) ++numFailed
}catch (e) {
print("<hr><h3>Exception executing: "+i+"</h3>")
dumpProperties (e)
++numException
++numFailed
}
//print("<hr>")
print ("Test #"+i+" passed: "+result+"")
write ("<small>Show test(<a href=\"#\" onclick=\"toggle(\'test"+i+"\')\">+</small></a>) <div id=\"test"+i+"\" style=\"display:none\" class=\"source\"><pre>")
write (""+escapeHTML(testArr[i].toString())+"")
print("</pre></div>")
}
write("<hr>")
print ("numFailed ="+numFailed+" with Exception: "+numException)
if (parent.frames.menu) {
try {
parent.frames.menu.addResult (document.title, testArr.length, numFailed, numException, this.location)
} catch (e) {
alert(e)
}
}
debugInfo()
}
|
// The ThunderRTC server files are in the lib folder
module.exports = require('./lib/thunderrtc_server');
|
define([
"cali-calcu/base/var",
"$J",
"cali-calcu/CommandParser",
"../dev/Matchers"
], function (func, $J, CommandParser, Matchers) {
describe("cali.module.base.var", function(){
// setup the environment
var parser = null;
var eps;
beforeEach(function() {
parser = new CommandParser();
$J.jasmine.Expectation.addMatchers(Matchers);
eps = 1e-4;
});
it("should computes the var of the input", function(){
var inputs = [
[ [[1], [7]], , ],
[ [[1, 5, 9], [7, 15, 22]], , ],
[ [[1, 5, 9], [7, 15, 22]], ,1 ],
[ [[1, 5, 9], [7, 15, 22]], 0,1 ],
[ [[1, 5, 9], [7, 15, 22]], ,2 ],
[ [[1, 5, 9], [7, 15, 22]], 1 ,2 ],
];
var outputs = [
[[18]],
[[18, 50, 84.5]],
[[18, 50, 84.5]],
[[18, 50, 84.5]],
[[16.0], [56.3333333]],
[[10.66667], [37.55557]],
];
for(var i in inputs){
expect(func(inputs[i][0], inputs[i][1], inputs[i][2])).toBeMatrixCloseTo(outputs[i], eps);
}
});
});
});
|
Kwf.Utils.ResponsiveEl('.kwcTextImage', [420]);
//remove largeText class if >55% of element is covered by image
Kwf.onJElementWidthChange('.kwcTextImage', function textImage(el) {
var img = el.find('div.image .kwcAbstractImage .container');
if (img) {
if (img.width() < (el.width() * 0.55)) {
el.removeClass('largeImage');
el.addClass('largeText');
} else {
el.removeClass('largeText');
el.addClass('largeImage');
}
}
});
|
/*
Language: XL
Author: Christophe de Dinechin <christophe@taodyne.com>
Description: An extensible programming language, based on parse tree rewriting
Website: http://xlr.sf.net
*/
export default function(hljs) {
const KWS = [
"if",
"then",
"else",
"do",
"while",
"until",
"for",
"loop",
"import",
"with",
"is",
"as",
"where",
"when",
"by",
"data",
"constant",
"integer",
"real",
"text",
"name",
"boolean",
"symbol",
"infix",
"prefix",
"postfix",
"block",
"tree"
];
const BUILT_INS = [
"in",
"mod",
"rem",
"and",
"or",
"xor",
"not",
"abs",
"sign",
"floor",
"ceil",
"sqrt",
"sin",
"cos",
"tan",
"asin",
"acos",
"atan",
"exp",
"expm1",
"log",
"log2",
"log10",
"log1p",
"pi",
"at",
"text_length",
"text_range",
"text_find",
"text_replace",
"contains",
"page",
"slide",
"basic_slide",
"title_slide",
"title",
"subtitle",
"fade_in",
"fade_out",
"fade_at",
"clear_color",
"color",
"line_color",
"line_width",
"texture_wrap",
"texture_transform",
"texture",
"scale_?x",
"scale_?y",
"scale_?z?",
"translate_?x",
"translate_?y",
"translate_?z?",
"rotate_?x",
"rotate_?y",
"rotate_?z?",
"rectangle",
"circle",
"ellipse",
"sphere",
"path",
"line_to",
"move_to",
"quad_to",
"curve_to",
"theme",
"background",
"contents",
"locally",
"time",
"mouse_?x",
"mouse_?y",
"mouse_buttons"
];
const BUILTIN_MODULES = [
"ObjectLoader",
"Animate",
"MovieCredits",
"Slides",
"Filters",
"Shading",
"Materials",
"LensFlare",
"Mapping",
"VLCAudioVideo",
"StereoDecoder",
"PointCloud",
"NetworkAccess",
"RemoteControl",
"RegExp",
"ChromaKey",
"Snowfall",
"NodeJS",
"Speech",
"Charts"
];
const LITERALS = [
"true",
"false",
"nil"
];
const KEYWORDS = {
$pattern: /[a-zA-Z][a-zA-Z0-9_?]*/,
keyword: KWS,
literal: LITERALS,
built_in: BUILT_INS.concat(BUILTIN_MODULES)
};
const DOUBLE_QUOTE_TEXT = {
className: 'string',
begin: '"',
end: '"',
illegal: '\\n'
};
const SINGLE_QUOTE_TEXT = {
className: 'string',
begin: '\'',
end: '\'',
illegal: '\\n'
};
const LONG_TEXT = {
className: 'string',
begin: '<<',
end: '>>'
};
const BASED_NUMBER = {
className: 'number',
begin: '[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?'
};
const IMPORT = {
beginKeywords: 'import',
end: '$',
keywords: KEYWORDS,
contains: [ DOUBLE_QUOTE_TEXT ]
};
const FUNCTION_DEFINITION = {
className: 'function',
begin: /[a-z][^\n]*->/,
returnBegin: true,
end: /->/,
contains: [
hljs.inherit(hljs.TITLE_MODE, { starts: {
endsWithParent: true,
keywords: KEYWORDS
} })
]
};
return {
name: 'XL',
aliases: [ 'tao' ],
keywords: KEYWORDS,
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
DOUBLE_QUOTE_TEXT,
SINGLE_QUOTE_TEXT,
LONG_TEXT,
FUNCTION_DEFINITION,
IMPORT,
BASED_NUMBER,
hljs.NUMBER_MODE
]
};
}
|
var namespacecode_1_1models_1_1model_etas_ga =
[
[ "model", "classcode_1_1models_1_1model_etas_ga_1_1model.html", "classcode_1_1models_1_1model_etas_ga_1_1model" ]
];
|
var should = require('should');
var path = require('path');
var _ = require('underscore');
var Graft = require('../server');
var utils = require('./utils');
var sinon = require('sinon');
var testPort = 8924;
function setupSpies() {
sinon.spy(Graft.Server, 'trigger');
}
function restoreSpies() {
Graft.Server.trigger.restore();
}
describe('Systems: Running', function() {
before(setupSpies);
before(function() {
Graft.system('ServerOnly', 'server-only', {
kind: 'server_only'
});
Graft.system('ClientToo', 'client-too', {
kind: 'client_too'
});
require('./fixture/direct-load');
Graft.load(__dirname + '/fixture');
Graft.start({ port: testPort });
});
it('should have all systems and submodules present', function() {
Graft.should.have.property('DirectLoad');
Graft.should.have.property('ServerOnly');
Graft.ServerOnly.should.have.property('SubModule');
Graft.should.have.property('ClientToo');
Graft.ClientToo.should.have.property('SubModule');
});
it('should have called all the mount triggers', function() {
sinon.assert.calledWith(Graft.Server.trigger, 'mount:server');
sinon.assert.calledWith(Graft.Server.trigger, 'before:mount:server');
sinon.assert.calledWith(Graft.Server.trigger, 'after:mount:server');
sinon.assert.calledWith(Graft.Server.trigger, 'mount:static');
sinon.assert.calledWith(Graft.Server.trigger, 'before:mount:static');
sinon.assert.calledWith(Graft.Server.trigger, 'after:mount:static');
sinon.assert.calledWith(Graft.Server.trigger, 'mount:router');
sinon.assert.calledWith(Graft.Server.trigger, 'before:mount:router');
sinon.assert.calledWith(Graft.Server.trigger, 'after:mount:router');
sinon.assert.calledWith(Graft.Server.trigger, 'listen');
sinon.assert.calledWith(Graft.Server.trigger, 'before:listen');
sinon.assert.calledWith(Graft.Server.trigger, 'after:listen');
});
after(restoreSpies);
describe('stop server', utils.stopServer);
});
|
/*
* Licensed under BSD http://en.wikipedia.org/wiki/BSD_License
* Copyright (c) 2010, Duponchel David
* 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 GraouPack 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 DUPONCHEL DAVID 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.
*/
"use strict";
$.namespace("izpack.compatibility");
/*global XMLSerializer, ActiveXObject */
(function () {
var console = window.console,
xmlCompat;
/*DEBUG_START*/
if (typeof console === "undefined") {
console = {};
console.debug =
console.log =
console.info =
console.warn =
console.error =
console.groupCollapsed =
console.time =
console.timeEnd =
console.groupEnd =
function () {};
window.console = console;
} else if (console.log && !console.debug) {
// IE 8 implements console.log in his "developer tools" but not console.debug...
console.debug = console.log;
}
/*DEBUG_END*/
xmlCompat = izpack.compatibility.xml = {
w3c : typeof XMLSerializer !== "undefined" &&
document.implementation && document.implementation.createDocument && typeof document.implementation.createDocument !== "undefined",
ie : typeof window.ActiveXObject !== "undefined"
};
if (!xmlCompat.w3c && !xmlCompat.ie) {
alert("this browser doesn't seem to be recent enough to support this app.");
}
}());
|
var allTestFiles = [];
var TEST_REGEXP = /\.spec\.js$/i;
var pathToModule = function(path) {
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
};
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
allTestFiles.push(pathToModule(file));
}
});
window.expect = window.chai.expect;
require.config({
// Karma serves files under /base, which is the basePath from your config file
baseUrl: '/base',
paths: {
"underscore" : "node_modules/underscore/underscore",
"backbone" : "node_modules/backbone/backbone",
"jquery" : "node_modules/jquery/dist/jquery"
},
shim: {
"underscore": {
exports: "_"
}
},
// dynamically load all test files
deps: allTestFiles,
// we have to kickoff jasmine, as it is asynchronous
callback: window.__karma__.start
});
|
#!/usr/bin/env node
var fs = require("fs"),
_ = require("underscore"),
express = require("express"),
redis = require("redis"),
mongo = require("mongoskin"),
connect_redis = require("connect-redis")(express),
everyauth = require("everyauth");
shortid = require("shortid"),
mediainfo = require("mediainfo"),
common = require("./lib/common");
common.ctx.add_function("nice_time", function(input, args) {
return (input || "").toString();
});
var rds = redis.createClient();
var db = mongo.db(process.env.MONGODB),
clips = db.collection("clips"),
users = db.collection("users");
clips.ensureIndex({id: 1}, {unique: true}, function(){});
users.ensureIndex({id: 1}, {unique: true}, function(){});
everyauth.everymodule.findUserById(function(id, done) {
users.findOne({id: id}, done);
});
everyauth.twitter.consumerKey("jdlTWPGKYNZqUTyvENmdcw").consumerSecret("drEQioZFW3UwMOWbr3P7jdr2nzSIPa1VHBBQbIjs").findOrCreateUser(function(session, access_token, access_token_secret, metadata) {
var promise = this.Promise();
users.findOne({id: metadata.id}, {_id: false}, function(err, doc) {
if (err) {
throw err;
}
if (doc) {
promise.fulfill(doc);
} else {
var user = {
id: metadata.id,
name: metadata.screen_name,
created_at: new Date(),
friends: [],
};
users.save(user, {safe: true}, function(err, doc) {
if (err) {
throw err;
}
promise.fulfill(doc);
});
}
});
return promise;
}).redirectPath("/");
var app = express.createServer();
app.configure(function() {
app.use(function(req, res, next) {
for (var i in common) {
res[i] = common[i];
}
next();
});
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({secret: "sillysession", store: new connect_redis()}));
app.use(everyauth.middleware());
app.use(express.static(__dirname + "/public"));
app.use(express.logger());
});
app.get("/", function(req, res) {
res.send_response("pages/index.html", {app: {user: req.user}, page: {title: "Home"}});
});
app.get("/clips", function(req, res) {
clips.find(null, {_id: false}).sort({created_at: -1}).limit(10).toArray(function(err, docs) {
if (err) {
return res.send(500);
}
res.send_response("pages/clips/list.html", {app: {user: req.user}, page: {title: "Clips"}, clips: docs});
});
});
app.get("/clips/mine", common.ensure_logged_in, function(req, res) {
clips.find({app: {user: req.user}.name}, {_id: false}).sort({created_at: -1}).limit(10).toArray(function(err, docs) {
if (err) {
return res.send(500);
}
res.send_response("pages/clips/list.html", {app: {user: req.user}, page: {title: "My Clips"}, clips: docs});
});
});
app.get("/clips/upload", common.ensure_logged_in, function(req, res) {
res.send_response("pages/clips/upload.html", {app: {user: req.user}, page: {title: "Upload Clip"}});
});
app.get("/clips/:id", function(req, res) {
clips.findOne({id: req.param("id")}, {_id: false}, function(err, doc) {
if (err) {
return res.send(500);
}
if (!doc) {
return res.send(404);
}
return res.send_response("pages/clips/view.html", {app: {user: req.user}, page: {title: doc.name}, clip: doc});
});
});
app.post("/clips", common.ensure_logged_in, function(req, res) {
var doc = req.body;
doc.id = shortid.generate();
doc.created_at = new Date();
doc.created_by = req.user.name;
doc.formats = [];
doc.encoded = false;
if (!req.files || !req.files.file) {
return res.send(406);
}
mediainfo(req.files.file.path, function(err, info) {
if (err) {
return res.send(500);
}
fs.rename(req.files.file.path, __dirname + "/uploads/" + doc.id, function(err) {
if (err) {
return res.send(500);
}
clips.save(doc, {safe: true}, function(err, doc) {
if (err) {
return res.send(500);
}
rds.rpush("riffmint_encoding", [doc.id, "libvorbis", "ogg"].join(":"));
rds.rpush("riffmint_encoding", [doc.id, "libmp3lame", "mp3"].join(":"));
return res.redirect("/clips/" + doc.id);
});
});
});
});
app.get("/download/:id.:format", function(req, res) {
clips.findOne({id: req.param("id")}, {_id: false}, function(err, doc) {
if (err) {
return res.send(500);
}
if (!doc) {
return res.send(404);
}
if (_.indexOf(doc.formats, req.param("format")) === -1) {
return res.send(404);
}
res.setHeader("Content-Type", "audio/" + req.param("format"));
res.sendfile("downloads/" + req.param("id") + "." + req.param("format"));
});
});
app.get("/:user", function(req, res) {
users.findOne({name: req.param("user")}, function(err, doc) {
if (err) {
return res.send(500);
}
if (!doc) {
return res.send(404);
}
return res.send_response("pages/user/view.html", {});
});
});
app.listen(process.env.PORT, process.env.HOST);
|
$(document).ready(function () {
function update_cart(pro_id,type)
{
$.ajax({
url: '/fontend/cart/delete-cart.html',
cache: false,
type: 'post',
data: {product_id: pro_id,type:type},
success: function (result)
{
// document.location = '/fontend/cart/index.html';
},
error: function (result) {
alert("Có lỗi xẩy ra, vui lòng thử lại sau.");
}
});
}
function formatPrice(b1,pra_class) {
var b = b1.toString();
var j = "";
var f = "";
var c = b.length;
if ((c > 0)) {
if (!(b === "") && (b != null)) {
var a = 0;
var d = 0;
for (i = c - 1; i >= 0; i--) {
a++;
if ((a % 3 == 0) && (a < c)) {
var e = c - a;
var g = b.substr(e, 3);
f = g + " " + f;
d++
}
}
var h = c - (d * 3);
j = b.substring(0, h) + " " + f;
if (j.charAt(j.length - 1) == " ") {
j = j.substr(0, (j.length - 1))
}
var string = j.split(' ').join('.');
return string;
//var string = j.replace('/" "/g','.');
$("#"+pra_class).attr("value", string)
}
}
}
$("input.input_price").keydown(function (b) {
var a = (b.which) ? b.which : b.keyCode;
if (a == 46 || a == 8 || a == 37 || a == 39 || a == 9 || a == 229) {
} else {
if (a > 31 && (a < 48 || a > 57) && (a < 96 || a > 105)) {
return false
}
}
});
$("input.input_price").on("keyup", function () {
var p_id = $(this).attr("name");
var value = $(this).val();
if(value == '')
{
value = 0;
}
var p_price = $('#p-'+p_id).text();
var formart_price = p_price.replace(/\./g, "");
var total_price = parseInt(formart_price)*parseInt(value);
var a = formatPrice(total_price,'p-final-'+p_id);
$('#p-final-'+p_id).text(a);
});
$(".action .delete-product").on("click",function(e){
e.preventDefault();
var id = $(this).data('value');
$('.tr-'+id).css("display","none");
update_cart(id,'delete');
});
});
|
/*
* OpenWFEru densha - open source ruby workflow and bpm engine
* (c) 2007-2008 John Mettraux
*
* OpenWFEru densha is freely distributable under the terms
* of a BSD-style license.
* For details, see the OpenWFEru web site: http://openwferu.rubyforge.org
*
* Made in Japan
*/
function toggleWadminAddButton (form_id, button_id) {
var form = $(form_id);
var button = $(button_id);
form.toggle();
if (form.visible())
button.hide();
else
button.show();
}
|
SirTrevor.Blocks.CmsBlock = SirTrevor.Blocks.Abstract.extend({
type: 'cms_block',
title: 'Cms Block',
header: '',
blockHtml: _.template([
'<div class="row">',
'<div class="col-md-12">',
SpreeCmsForm.getSelectTemplate('block_id', 'CMS Block', availableCmsBlocks),
'</div>',
'<input class="js-state" type="hidden" name="state" value="<%- state || "" %>">',
'</div>'
].join("\n"))
});
|
// @flow
import React from "react"
import PeopleList from "./PeopleList"
import type { WidgetComponentProps } from "../../flow/widgetTypes"
const PeopleWidget = ({
widgetInstance: {
json: { people, show_all_members_link } // eslint-disable-line camelcase
}
}: WidgetComponentProps) => (
<PeopleList
profiles={people}
showAllMembersLink={show_all_members_link} // eslint-disable-line camelcase
useDragHandle={true}
/>
)
export default PeopleWidget
|
var fs = require('fs');
var path = require('path');
var sourceFile = '/proc/diskstats',
collectionGroup = '/proc/diskstats',
lastValueFile = __filename + '.lastvalue',
deviceNameRegexp = /^(?:(?:h|s)d[a-z]{1,3}|dm\-\d+)$/;
var lvmList,
dmPath = '/dev/mapper';
var lookupLVMName = function (name) {
// init
if (!lvmList) {
lvmList = {};
try {
fs.readdirSync(dmPath).forEach(function (e) {
try {
var dm = path.basename(fs.readlinkSync(path.join(dmPath, e)));
if (dm) {
lvmList[dm] = e;
}
} catch (e) {
}
});
} catch (e) {
}
}
return lvmList[name] || null;
};
var parseSource = function () {
try {
var source = fs.readFileSync(sourceFile).toString().split(/\n/);
} catch (e) {
return [];
}
var lastValue = {};
try {
lastValue = JSON.parse(fs.readFileSync(lastValueFile).toString());
} catch (e) {
}
var result = [],
now = new Date().getTime(),
deltaMS = now - (lastValue.time || 0),
ps = function (v) {
return v / deltaMS * 1000;
},
nr = function (v, digits) {
var a = Math.pow(10, digits || 3);
return Math.round(v * a) / a;
};
// build
source.forEach(function (line) {
var v = line.trim().split(/\s+/);
if (v.length < 14 || !deviceNameRegexp.test(v[2])) {
return;
}
// 0.rd_ios 1.rd_merges 2.rd_sectors, 3.rd_ticks,
// 4.wr_ios, 5.wr_merges, 6.wr_sectors, 7.wr_ticks,
// 8.ios_progress 9.ticks_request, 10.total_ticks
var deviceName = lookupLVMName(v[2]) || v[2],
values = v.slice(3).map(function (v) { return parseInt(v) || 0; }),
lastValues = lastValue[deviceName] || {},
diffValues = values.map(function (v, i) {
return v - (lastValues[i] || 0);
});
var d_result = [];
// I/O completed
d_result.push({
colName: 'Requests completed per second',
data: {
read: nr(ps(diffValues[0])),
write: nr(ps(diffValues[4])),
},
params: {
read: {},
write: {},
},
});
// I/O merged
d_result.push({
colName: 'Requests merged per second',
data: {
read: nr(ps(diffValues[1])),
write: nr(ps(diffValues[5])),
},
params: {
read: {},
write: {},
},
});
// I/O sectors
d_result.push({
colName: 'Sectors read/write the device per second',
data: {
read: nr(ps(diffValues[2])),
write: nr(ps(diffValues[6])),
},
params: {
read: {unit: 'sectors'},
write: {unit: 'sectors'},
},
});
// I/O time
d_result.push({
colName: 'The average time for I/O requests',
data: {
read: nr(diffValues[0] ? diffValues[3] / diffValues[0] : 0),
write: nr(diffValues[4] ? diffValues[7] / diffValues[4] : 0),
service: nr(diffValues[0] + diffValues[4] ? diffValues[9] / (diffValues[0] + diffValues[4]) : 0),
},
params: {
read: {unit: 'ms'},
write: {unit: 'ms'},
service: {unit: 'ms'},
},
});
// average request size
d_result.push({
colName: 'The average size of the requests',
data: {
read: nr(diffValues[0] ? diffValues[2] / diffValues[0] : 0),
write: nr(diffValues[4] ? diffValues[6] / diffValues[4] : 0),
},
params: {
read: {unit: 'sectors'},
write: {unit: 'sectors'},
},
});
// average queue time
d_result.push({
colName: 'The average queue time of the requests',
data: {
value: nr(deltaMS ? diffValues[10] / deltaMS : 0),
},
params: {
value: {unit: 'ms'},
},
});
// request on progress
/*d_result.push({
colName: 'Requests on progress per second',
data: {
value: nr(ps(values[8])),
},
params: {
value: {},
},
});*/
// Bandwidth utilization
d_result.push({
colName: 'Bandwidth utilization',
data: {
value: Math.min(100, nr(deltaMS ? 100 * diffValues[9] / deltaMS : 0)),
},
params: {
value: {unit: '%'},
},
});
lastValue[deviceName] = values;
result = result.concat(d_result.map(function (el) {
el.colName = [collectionGroup, deviceName, el.colName].join('::');
return el;
}));
});
try {
lastValue.time = now;
fs.writeFileSync(lastValueFile, JSON.stringify(lastValue));
} catch (e) {
}
return result;
};
module.exports.polling = function (save) {
save(parseSource().map(function (el) { delete el.params; return el; }));
};
module.exports.attrs = function () {
return parseSource().map(function (el) {
delete el.data;
for (var k in el.params) {
el.params[k].interpolate = 'step-before';
}
return el;
});
};
|
function (doc) {
function get_date(doc){
switch (doc.doc_type){
case "CommCareCase":
case "CommCareCase-Deleted":
return doc.opened_on;
case "XFormInstance":
case "XFormInstance-Deleted":
case "XFormError":
case "XFormDuplicate":
case "XFormDeprecated":
case "XFormArchived":
case "SubmissionErrorLog":
return doc.received_on;
case "CommCareUser":
case "WebUser":
return doc.created_on;
case "MessageLog":
case "CallLog":
case "SMSLog":
return doc.date;
case "EventLog":
return doc.date;
case "Application":
case "Application-Deleted":
case "RemoteApp":
case "RemoteApp-Deleted":
return doc.copy_of ? doc.built_on : null;
default:
return null;
}
}
if (doc.domain) {
emit([doc.domain, doc.doc_type, get_date(doc)], null);
}
}
|
var searchData=
[
['full_5fscreen',['FULL_SCREEN',['../namespace_comet_engine_1_1_client.html#a608d2e459fd95babca189e50f4182a65ae1a502139199d41bcd8f603a6d579b70',1,'CometEngine::Client']]],
['fullscreen',['FULLSCREEN',['../namespace_comet_engine.html#abdc5ec13bf1dfb1d26eb0bcc9da0ddada5f039f23ee85ddea038ca1ab88ca6755',1,'CometEngine']]]
];
|
var DataSelector = require("logic/model/data-selector").DataSelector;
/**
* Backward compatibility support for logic/service/data-selector after that
* class has been moved to logic/model/data-selector.
*
* @class
* @extends external:Montage
* @todo Deprecate.
*/
exports.DataSelector = DataSelector.specialize();
|
import * as Redux from "redux"
import { composeWithDevTools } from "redux-devtools-extension/developmentOnly"
import thunk from "redux-thunk"
import reducersRegistry from "./reducers"
const configureStore = (initialState) => {
const middlewares = [
thunk
]
const enhancer = composeWithDevTools(
applyMiddleware(...middlewares)
)
const reducer = combineReducers(reducersRegistry)
const store = Redux.createStore(
reducer,
initialState,
enhancer
)
if (module.hot) {
module.hot.accept("./reducers", () => {
const nextReducer = combineReducers(reducersRegistry)
store.replaceReducer(nextReducer)
})
}
return store
}
export default store
|
var Catcher = Class.create({
initialize: function(world) {
this.bodyLeft = createBox(world, 570, 450, 5, 35, true, 'catcher', 1.0);
this.bodyRight = createBox(world, 630, 450, 5, 35, true, 'catcher', 1.0);
this.bodyMiddle = createBox(world, 600, 483, 25, 2, true, 'catcher', 1.0);
this.bodyMiddleInside = createBox(world, 600, 478, 25, 2, true, 'catcherInside', 1.0);
return this;
},
Destroy: function(world){
world.DestroyBody(this.bodyLeft);
world.DestroyBody(this.bodyRight);
world.DestroyBody(this.bodyMiddle);
world.DestroyBody(this.bodyMiddleInside);
},
Step: function(timeStep)
{
//if(this.body.GetCenterPosition().x>456)
// this.body.SetCenterPosition(new b2Vec2(this.body.GetCenterPosition().x-1, this.body.GetCenterPosition().y), 0);
},
Rotate: function(pi)
{
this.rotation++;
if(this.rotation > 3) this.rotation = 0;
switch(this.rotation) {
case 0:
this.bodyLeft.SetCenterPosition(new b2Vec2(570,450), 0);
this.bodyRight.SetCenterPosition(new b2Vec2(630,450), 0);
this.bodyMiddle.SetCenterPosition(new b2Vec2(600,483), 0);
this.bodyMiddleInside.SetCenterPosition(new b2Vec2(600,478), 0);
break;
case 1:
this.bodyLeft.SetCenterPosition(new b2Vec2(600,420), pi/2);
this.bodyRight.SetCenterPosition(new b2Vec2(600,480), pi/2);
this.bodyMiddle.SetCenterPosition(new b2Vec2(567,450), pi/2);
this.bodyMiddleInside.SetCenterPosition(new b2Vec2(572,450), pi/2);
break;
case 2:
this.bodyRight.SetCenterPosition(new b2Vec2(570,450), 0);
this.bodyLeft.SetCenterPosition(new b2Vec2(630,450), 0);
this.bodyMiddle.SetCenterPosition(new b2Vec2(600,417), 0);
this.bodyMiddleInside.SetCenterPosition(new b2Vec2(600,422), 0);
break;
case 3:
this.bodyRight.SetCenterPosition(new b2Vec2(600,420), pi/2);
this.bodyLeft.SetCenterPosition(new b2Vec2(600,480), pi/2);
this.bodyMiddle.SetCenterPosition(new b2Vec2(633,450), pi/2);
this.bodyMiddleInside.SetCenterPosition(new b2Vec2(628,450), pi/2);
break;
}
},
bodyLeft: null,
bodyRight: null,
bodyMiddle: null,
bodyMiddleInside: null,
rotation: 0
});
|
import { AppRegistry } from "react-native-web";
import { mount } from "enzyme";
import {
addSerializers,
compose,
enzymeTreeSerializer,
justChildren,
meltNative,
minimaliseTransform,
minimalWebTransform,
print,
propsNoChildren,
replaceTransform,
rnwTransform
} from "@times-components/jest-serializer";
import shared from "./shared.base";
export default () => {
addSerializers(
expect,
enzymeTreeSerializer(),
compose(
print,
minimalWebTransform,
minimaliseTransform(
(value, key) => key === "style" || key === "className"
),
replaceTransform({
CardComponent: justChildren,
CardContent: justChildren,
Gradient: propsNoChildren,
Loading: justChildren,
TimesImage: propsNoChildren,
...meltNative
}),
rnwTransform(AppRegistry)
)
);
shared(mount);
};
|
/*==================================================
* Exhibit Utility Functions
*==================================================
*/
Exhibit.Util = {};
/**
* Round a number n to the nearest multiple of precision (any positive value),
* such as 5000, 0.1 (one decimal), 1e-12 (twelve decimals), or 1024 (if you'd
* want "to the nearest kilobyte" -- so round(66000, 1024) == "65536"). You are
* also guaranteed to get the precision you ask for, so round(0, 0.1) == "0.0".
*/
Exhibit.Util.round = function(n, precision) {
precision = precision || 1;
var lg = Math.floor( Math.log(precision) / Math.log(10) );
n = (Math.round(n / precision) * precision).toString();
var d = n.split(".");
if (lg >= 0) {
return d[0];
}
lg = -lg;
d[1] = (d[1]||"").substring(0, lg);
while (d[1].length < lg) {
d[1] += "0";
}
return d.join(".");
}
//=============================================================================
// Javascript 1.6 Array extensions
// from Mozilla's compatibility implementations
//=============================================================================
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length;
var from = Number(arguments[1]) || 0;
from = (from < 0)
? Math.ceil(from)
: Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this &&
this[from] === elt)
return from;
}
return -1;
};
}
if (!Array.prototype.filter)
{
Array.prototype.filter = function(fun /*, thisp*/)
{
var len = this.length;
if (typeof fun != "function")
throw new TypeError();
var res = new Array();
var thisp = arguments[1];
for (var i = 0; i < len; i++)
{
if (i in this)
{
var val = this[i]; // in case fun mutates this
if (fun.call(thisp, val, i, this))
res.push(val);
}
}
return res;
};
}
if (!Array.prototype.map) {
Array.prototype.map = function(f, thisp) {
if (typeof f != "function")
throw new TypeError();
if (typeof thisp == "undefined") {
thisp = this;
}
var res = [], length = this.length;
for (var i = 0; i < length; i++) {
if (this.hasOwnProperty(i))
res[i] = f.call(thisp, this[i], i, this);
}
return res;
};
}
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function(fun /*, thisp*/)
{
var len = this.length;
if (typeof fun != "function")
throw new TypeError();
var thisp = arguments[1];
for (var i = 0; i < len; i++)
{
if (i in this)
fun.call(thisp, this[i], i, this);
}
};
}
|
class DocSearchInterface extends ReactSingleAjax {
constructor(props) {
super(props);
let urlP = getURLParams();
this.state = {
termKind: urlP.termKind || "lemmas",
query: urlP.query || "",
operation: urlP.operation || "OR"
};
this.init();
}
componentDidMount() {
if(this.state.query) {
this.onFind(null);
}
}
onFind(evt) {
// one request at a time...
if(this.waiting()) return;
let request = {};
request.termKind = this.state.termKind;
request.query = this.state.query;
request.operation = this.state.operation;
pushURLParams(request);
this.send("/api/MatchDocuments", request);
}
render() {
let results = "";
if(this.error()) {
results = this.errorMessage();
}
if(this.response()) {
results = <pre key="json">{JSON.stringify(this.response())}</pre>;
}
return <div>
<div>Document Search</div>
<textarea value={this.state.query} onChange={(x) => this.setState({query: x.target.value}) } />
<SelectWidget opts={TermKindOpts} selected={this.state.termKind} onChange={(x) => this.setState({termKind: x})} />
<SelectWidget opts={OperationKinds} selected={this.state.operation} onChange={(x) => this.setState({operation: x})} />
<Button label="Find!" onClick={(evt) => this.onFind(evt)}/>
<DocumentResults response={this.state.response} />
</div>
}
}
class DocumentResults extends React.Component {
render() {
let resp = this.props.response;
if(resp == null) {
return <span />;
}
let results = _(resp.results).map(function(obj) {
return <li key={obj.id}><DocumentLink id={obj.id} name={obj.name} /></li>
}).value();
return <div>
<label>Query Terms: <i>{strjoin(resp.queryTerms)}</i></label>
<ul>{results}</ul>
</div>;
}
}
|
/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.7.3
build: 3.7.3
*/
YUI.add("lang/console_en",function(e){e.Intl.add("console","en",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.3");
|
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* 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 Ajax.org B.V. 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 AJAX.ORG B.V. 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.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules;
var PythonFoldMode = require("./folding/pythonic").FoldMode;
var Range = require("../range").Range;
var Mode = function() {
this.HighlightRules = MushCodeRules;
this.foldingRules = new PythonFoldMode("\\:");
};
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "#";
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[\:]\s*$/);
if (match) {
indent += tab;
}
}
return indent;
};
var outdents = {
"pass": 1,
"return": 1,
"raise": 1,
"break": 1,
"continue": 1
};
this.checkOutdent = function(state, line, input) {
if (input !== "\r\n" && input !== "\r" && input !== "\n")
return false;
var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
if (!tokens)
return false;
// ignore trailing comments
do {
var last = tokens.pop();
} while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
if (!last)
return false;
return (last.type == "keyword" && outdents[last.value]);
};
this.autoOutdent = function(state, doc, row) {
// outdenting in python is slightly different because it always applies
// to the next line and only of a new line is inserted
row += 1;
var indent = this.$getIndent(doc.getLine(row));
var tab = doc.getTabString();
if (indent.slice(-tab.length) == tab)
doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
};
this.$id = "ace/mode/mushcode";
}).call(Mode.prototype);
exports.Mode = Mode;
});
|
Engine.Route = {
to: function(path){
return Engine.Config.url + path;
}
};
|
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("placeholder", "en", {title:"Placeholder Properties", toolbar:"Create Placeholder", text:"Placeholder Text", edit:"Edit Placeholder", textMissing:"The placeholder must contain text."});
|
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require("path");
var js = path.resolve(__dirname, "frontend");
module.exports = {
// Input files for the bundles of JS/CSS
entry: {
admin: path.resolve(js, "admin/main.js"),
user: path.resolve(js, "user/main.js"),
sharedDependencies: path.resolve(js, "sharedDependencies")
},
// Output bundle of JS
output: {
path: path.resolve(__dirname, "remoteappmanager/static/dist"),
filename: "[name].js"
},
// Aliases and file extensions supported
resolve: {
extensions: ["*", ".js", ".vue", ".css"],
alias: {
// CSS
"bootstrap-css": "admin-lte/bootstrap/css/bootstrap.min",
"font-awesome-css": "font-awesome/css/font-awesome.min",
"ionicons-css": "ionicons/dist/css/ionicons.min",
"admin-lte-css": "admin-lte/dist/css/AdminLTE.min",
"skin-black-css": "admin-lte/dist/css/skins/skin-black.min",
"skin-red-css": "admin-lte/dist/css/skins/skin-red.min",
"skin-blue-css": "admin-lte/dist/css/skins/skin-blue.min",
// JS
jquery: "admin-lte/plugins/jQuery/jquery-2.2.3.min",
bootstrap: "admin-lte/bootstrap/js/bootstrap.min",
vue: "vue/dist/vue.min",
"vue-router": "vue-router/dist/vue-router",
"admin-resources": path.resolve(js, "admin/admin-resources"),
"user-resources": path.resolve(js, "user/user-resources"),
gamodule: path.resolve(js, "gamodule"),
urlutils: path.resolve(js, "urlutils"),
utils: path.resolve(js, "utils"),
toolkit: path.resolve(js, "toolkit/toolkit"),
}
},
// Loaders for specific file extensions
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.vue$/,
use: {
loader: 'vue-loader'
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
{
test: /\.(eot|svg|ttf|woff|woff2|jpg)$/,
// Output font files
loader: 'file-loader?name=files/[name].[ext]'
}
]
},
// Output bundle of CSS
plugins: [
new ExtractTextPlugin("[name].css")
]
};
|
/**
* 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.
*
* @providesModule LayoutAndTransformPropTypes
* @flow
*/
'use strict';
const LayoutPropTypes = require('LayoutPropTypes');
const TransformPropTypes = require('TransformPropTypes');
/**
* Warning: Some of these properties may not be supported in all releases.
*/
const LayoutAndTransformPropTypes = {
...LayoutPropTypes,
...TransformPropTypes,
};
module.exports = LayoutAndTransformPropTypes;
|
/* ***** 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 Ajax.org Code Editor (ACE).
*
* The Initial Developer of the Original Code is
* Ajax.org B.V.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Fabian Jakobs <fabian AT ajax DOT org>
*
* 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 ***** */
define('ace/theme/merbivore_soft', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
exports.isDark = true;
exports.cssClass = "ace-merbivore-soft";
exports.cssText = "\
.ace-merbivore-soft .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
}\
\
.ace-merbivore-soft .ace_editor.ace_focus {\
border: 2px solid #327fbd;\
}\
\
.ace-merbivore-soft .ace_gutter {\
background: #e8e8e8;\
color: #333;\
}\
\
.ace-merbivore-soft .ace_print_margin {\
width: 1px;\
background: #e8e8e8;\
}\
\
.ace-merbivore-soft .ace_scroller {\
background-color: #1C1C1C;\
}\
\
.ace-merbivore-soft .ace_text-layer {\
cursor: text;\
color: #E6E1DC;\
}\
\
.ace-merbivore-soft .ace_cursor {\
border-left: 1px solid #FFFFFF;\
}\
\
.ace-merbivore-soft .ace_cursor.ace_overwrite {\
border-left: 0px;\
border-bottom: 1px solid #FFFFFF;\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_selection {\
background: #494949;\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_step {\
background: rgb(198, 219, 174);\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_bracket {\
margin: -1px 0 0 -1px;\
border: 1px solid #404040;\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_active_line {\
background: #333435;\
}\
\
.ace-merbivore-soft .ace_marker-layer .ace_selected_word {\
border: 1px solid #494949;\
}\
\
.ace-merbivore-soft .ace_invisible {\
color: #404040;\
}\
\
.ace-merbivore-soft .ace_keyword, .ace-merbivore-soft .ace_meta {\
color:#FC803A;\
}\
\
.ace-merbivore-soft .ace_constant, .ace-merbivore-soft .ace_constant.ace_other {\
color:#68C1D8;\
}\
\
.ace-merbivore-soft .ace_constant.ace_character, {\
color:#68C1D8;\
}\
\
.ace-merbivore-soft .ace_constant.ace_character.ace_escape, {\
color:#68C1D8;\
}\
\
.ace-merbivore-soft .ace_constant.ace_language {\
color:#E1C582;\
}\
\
.ace-merbivore-soft .ace_constant.ace_library {\
color:#8EC65F;\
}\
\
.ace-merbivore-soft .ace_constant.ace_numeric {\
color:#7FC578;\
}\
\
.ace-merbivore-soft .ace_invalid {\
color:#FFFFFF;\
background-color:#FE3838;\
}\
\
.ace-merbivore-soft .ace_invalid.ace_deprecated {\
color:#FFFFFF;\
background-color:#FE3838;\
}\
\
.ace-merbivore-soft .ace_support.ace_constant {\
color:#8EC65F;\
}\
\
.ace-merbivore-soft .ace_fold {\
background-color: #FC803A;\
border-color: #E6E1DC;\
}\
\
.ace-merbivore-soft .ace_storage {\
color:#FC803A;\
}\
\
.ace-merbivore-soft .ace_string {\
color:#8EC65F;\
}\
\
.ace-merbivore-soft .ace_comment {\
font-style:italic;\
color:#AC4BB8;\
}\
\
.ace-merbivore-soft .ace_meta {\
font-style:italic;\
color:#AC4BB8;\
}\
\
.ace-merbivore-soft .ace_meta.ace_tag {\
color:#FC803A;\
}\
\
.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\
color:#EAF1A3;\
}\
\
.ace-merbivore-soft .ace_markup.ace_underline {\
text-decoration:underline;\
}";
var dom = require("../lib/dom");
dom.importCssString(exports.cssText, exports.cssClass);
});
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
/**
* Extension ID of gallery app.
* @type {string}
* @const
*/
var GALLERY_APP_ID = 'nlkncpkkdoccmpiclbokaimcnedabhhm';
var gallery = new RemoteCallGallery(GALLERY_APP_ID);
/**
* Launches the gallery with the given entries.
*
* @param {string} testVolumeName Test volume name passed to the addEntries
* function. Either 'drive' or 'local'.
* @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
* @param {Array<TestEntryInfo>} entries Entries to be parepared and passed to
* the application.
* @param {Array<TestEntryInfo>=} opt_selected Entries to be selected. Should
* be a sub-set of the entries argument.
* @return {Promise} Promise to be fulfilled with the data of the main element
* in the allery.
*/
function launch(testVolumeName, volumeType, entries, opt_selected) {
var entriesPromise = addEntries([testVolumeName], entries).then(function() {
var selectedEntries = opt_selected || entries;
var selectedEntryNames = selectedEntries.map(function(entry) {
return entry.nameText;
});
return gallery.callRemoteTestUtil(
'getFilesUnderVolume', null, [volumeType, selectedEntryNames]);
});
var appId = null;
var urls = [];
return entriesPromise.then(function(result) {
urls = result;
return gallery.callRemoteTestUtil('openGallery', null, [urls]);
}).then(function(windowId) {
chrome.test.assertTrue(!!windowId);
appId = windowId;
return gallery.waitForElement(appId, 'div.gallery');
}).then(function(args) {
return {
appId: appId,
mailElement: args[0],
urls: urls,
};
});
}
/**
* Namespace for test cases.
*/
var testcase = {};
/**
* When the FileManagerBrowserTest harness loads this test extension, request
* configuration and other details from that harness, including the test case
* name to run. Use the configuration/details to setup the test ennvironment,
* then run the test case using chrome.test.RunTests.
*/
window.addEventListener('load', function() {
var steps = [
// Request the guest mode state.
function() {
sendBrowserTestCommand({name: 'isInGuestMode'}, steps.shift());
},
// Request the root entry paths.
function(mode) {
if (JSON.parse(mode) != chrome.extension.inIncognitoContext) {
return;
}
sendBrowserTestCommand({name: 'getRootPaths'}, steps.shift());
},
// Request the test case name.
function(paths) {
var roots = JSON.parse(paths);
RootPath.DOWNLOADS = roots.downloads;
RootPath.DRIVE = roots.drive;
sendBrowserTestCommand({name: 'getTestName'}, steps.shift());
},
// Run the test case.
function(testCaseName) {
// Get the test function from testcase namespace testCaseName.
var test = testcase[testCaseName];
// Verify test is an unnamed (aka 'anonymous') Function.
if (!(test instanceof Function) || test.name) {
chrome.test.fail('[' + testCaseName + '] not found.');
return;
}
// Define the test case and its name for chrome.test logging.
test.generatedName = testCaseName;
var testCaseSymbol = Symbol(testCaseName);
var testCase = {
[testCaseSymbol] :() => {
return testPromiseAndApps(test(), [gallery]);
},
};
// Run the test.
chrome.test.runTests([testCase[testCaseSymbol]]);
}
];
steps.shift()();
});
|
"use strict";
var SassExpandedRenderer = require('./sass-expanded-renderer');
/**
* @class SassNestedRenderer
* Nested style is the default Sass style, because it reflects the structure of
* the document in much the same way Sass does. Each rule is indented based on
* how deeply it's nested. Each property has its own line and is indented
* within the rule.
*/
var SassNestedRenderer = module.exports = SassExpandedRenderer.extend({
/**
* Renders the brace at the end of the rule
* @returns string the brace between the rule and its properties
*/
end: function() {
return " }\n";
},
/**
* Returns the indent string for the node
* @param {SassNode} node - the node being rendered
* @returns {string} the indent string for this SassNode
*/
getIndent: function(node) {
return new Array(node.level + 1).join(this.INDENT);
},
/**
* Renders a directive.
* @param {SassNode} node - the node being rendered
* @param {Array} properties - properties of the directive
* @returns {string} the rendered directive
*/
renderDirective: function(node, properties) {
var directive = this.getIndent(node) + node.directive + this.between() + this.renderProperties(properties);
return directive.replace(/(.*\})\n$/, '$1') + this.end();
},
/**
* Renders rule selectors.
* @param {SassNode} node - the node being rendered
* @returns {string} the rendered selectors
*/
renderSelectors: function(node) {
var indent = this.getIndent(node);
return indent.join(",\n" + indent, node.selectors);
}
});
|
var Ipc = require('ipc');
// init states
var _states = {
'scene-initializing': false,
'scene-playing': false,
'scene-paused': false,
};
Editor.states = {};
function _defprop ( name, value ) {
Editor.states['_'+name] = value;
Object.defineProperty( Editor.states, name, {
get: function () { return Editor.states['_'+name]; },
set: function ( newValue ) {
if ( Editor.states['_'+name] !== newValue ) {
Editor.states['_'+name] = newValue;
Editor.sendToAll( 'editor:state-changed', name, newValue );
}
},
});
}
for ( var name in _states ) {
_defprop ( name, _states[name] );
}
Ipc.on('editor:state-changed', function ( name, value ) {
Editor.states['_'+name] = value;
});
// apply default main menu
var MainMenuTmplFn = require('./main-menu');
Editor.registerDefaultMainMenu(MainMenuTmplFn);
Editor.MainMenu.reset();
// init modules
Editor.Compiler = require('./compiler');
Editor.Builder = require('./builder');
// load scene utils
require('./scene-utils');
// asset-db ipc
require('./asset-db-ipc');
// ====================
// register events
// ====================
Editor.events.on('focus', function () {
Editor.assetdb.watchOFF();
});
Editor.events.on('blur', function () {
Editor.assetdb.watchON();
});
|
/*
* File: app/view/CitiesCombo.js
*
*/
Ext.define('TestApp.view.CitiesCombo', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.citiescombo',
requires: [
'TestApp.view.CitiesComboViewModel'
],
viewModel: {
type: 'citiescombo'
},
itemId: 'educationcombo1',
fieldLabel: 'Город',
name: 'cities',
displayField: 'name',
valueField: 'id',
bind: {
store: '{CitiesStore}'
}
});
|
/**
* Css lint grunt task for CARTO.js
*
*/
module.exports = {
task: function() {
return {
dist: {
options: {
check: 'gzip'
}
},
themes: {
options: {
banner: '/* CartoDB.css minified version: <%= version %> */',
check: 'gzip'
},
files: {
'<%= dist %>/internal/themes/css/cartodb.css': ['<%= dist %>/internal/themes/css/cartodb.css']
}
}
}
}
}
|
var map;
window.onload = function() {
var mm = com.modestmaps;
var dmap = document.getElementById('map');
wax.tilejson('https://a.tiles.mapbox.com/v3/examples.map-i86l3621.jsonp',
function(tj) {
map = new com.modestmaps.Map(dmap,
new wax.mm.connector(tj), null, [
easey_handlers.DragHandler(),
easey_handlers.TouchHandler(),
easey_handlers.MouseWheelHandler(),
easey_handlers.DoubleClickHandler()
]);
map.setCenterZoom(new com.modestmaps.Location(-10, 50), 3);
map.addCallback('zoomed', function() {
// console.log(map.getZoom());
});
var pres = document.getElementsByTagName('pre');
for (var i = 0; i < pres.length; i++) {
pres[i].onclick = function() {
eval(this.innerHTML);
};
}
var scrolly = document.getElementById('scrolly');
var positions = [
map.locationCoordinate({ lat: 33.5, lon: 65.6 }).zoomTo(6),
map.locationCoordinate({ lat: 33.1, lon: 44.6 }).zoomTo(6),
map.locationCoordinate({ lat: 28.7, lon: 69.2 }).zoomTo(6)];
var ea = easey().map(map).easing('easeInOut');
function update() {
var pos = scrolly.scrollTop / 200;
ea.from(positions[Math.floor(pos)])
.to(positions[Math.ceil(pos)])
.t(pos - Math.floor(pos));
}
scrolly.addEventListener('scroll', update, false);
});
};
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Global wallpaperManager reference useful for poking at from the console.
*/
var wallpaperManager;
function init() {
window.addEventListener('load',
windowStateManager.saveStates.bind(windowStateManager));
window.addEventListener('unload',
windowStateManager.restoreStates.bind(windowStateManager));
WallpaperManager.initStrings(function() {
wallpaperManager = new WallpaperManager(document.body);
});
}
document.addEventListener('DOMContentLoaded', init);
|
function FileData_Pairs(x)
{
x.t("managing","samples");
x.t("clear","fields");
x.t("home","page");
x.t("required","click");
x.t("having","entered");
x.t("execute","copy");
x.t("copying","existing");
x.t("icon","having");
x.t("icon","search");
x.t("entitled","new");
x.t("sample","managing");
x.t("sample","copying");
x.t("sample","entitled");
x.t("sample","copied");
x.t("sample","link");
x.t("sample","want");
x.t("sample","features");
x.t("sample","entered");
x.t("sample","follow");
x.t("sample","whose");
x.t("sample","click");
x.t("sample","page");
x.t("sample","appropriate");
x.t("sample","copy");
x.t("sample","names");
x.t("reset","clear");
x.t("editing","sample");
x.t("copied","sample");
x.t("copied","fields");
x.t("partial","text");
x.t("partial","search");
x.t("text","sample");
x.t("text","complete");
x.t("text","system");
x.t("new","sample");
x.t("new","name");
x.t("link","copy");
x.t("want","copy");
x.t("again","cananolab");
x.t("menu","option");
x.t("complete","search");
x.t("complete","exact");
x.t("results","sample");
x.t("features","annotations");
x.t("creating","new");
x.t("name","copied");
x.t("name","complete");
x.t("name","entered");
x.t("name","assigned");
x.t("anyway","sample");
x.t("enables","existing");
x.t("searches","database");
x.t("edit","copied");
x.t("entered","text");
x.t("entered","partial");
x.t("entered","exact");
x.t("entered","enter");
x.t("cananolab","opens");
x.t("cananolab","database");
x.t("skip","search");
x.t("updating","sample");
x.t("search","execute");
x.t("search","icon");
x.t("search","sample");
x.t("search","partial");
x.t("search","results");
x.t("search","cananolab");
x.t("fields","begin");
x.t("fields","page");
x.t("contain","entered");
x.t("request","select");
x.t("begin","again");
x.t("select","search");
x.t("annotations","facilitate");
x.t("samples","home");
x.t("samples","editing");
x.t("samples","menu");
x.t("samples","enables");
x.t("opens","update");
x.t("assigned","edit");
x.t("follow","steps");
x.t("steps","click");
x.t("option","manage");
x.t("exact","text");
x.t("exact","search");
x.t("database","sample");
x.t("database","anyway");
x.t("click","reset");
x.t("click","search");
x.t("click","samples");
x.t("click","submit");
x.t("click","copy");
x.t("enter","name");
x.t("whose","name");
x.t("existing","sample");
x.t("existing","samples");
x.t("page","required");
x.t("page","copied");
x.t("page","click");
x.t("page","enter");
x.t("facilitate","creating");
x.t("information","updating");
x.t("appropriate","information");
x.t("submit","click");
x.t("copy","sample");
x.t("copy","skip");
x.t("copy","request");
x.t("copy","existing");
x.t("manage","samples");
x.t("system","searches");
x.t("names","contain");
x.t("update","sample");
}
|
'use strict'
/* global describe it beforeEach afterEach */
const cli = require('heroku-cli-util')
const { expect } = require('chai')
const nock = require('nock')
const proxyquire = require('proxyquire')
const addon = {
id: 1,
name: 'postgres-1',
plan: { name: 'heroku-postgresql:standard-0' }
}
const fetcher = () => {
return {
addon: () => addon
}
}
const cmd = proxyquire('../../commands/reset', {
'../lib/fetcher': fetcher
})
describe('pg:reset', () => {
let api, pg
beforeEach(() => {
api = nock('https://api.heroku.com')
pg = nock('https://postgres-api.heroku.com')
cli.mockConsole()
})
afterEach(() => {
nock.cleanAll()
pg.done()
api.done()
})
it('reset db', () => {
pg.put('/client/v11/databases/1/reset').reply(200)
return cmd.run({ app: 'myapp', args: {}, flags: { confirm: 'myapp' } })
.then(() => expect(cli.stderr).to.equal('Resetting postgres-1... done\n'))
})
})
|
const log = msg => console.log(msg);
module.exports = log;
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Karl STEIN
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
let Router = window.Router;
function getTemplate(name) {
let tpl = $("template[name=\"" + name + "\"]");
if (tpl.length) {
return tpl.eq(0).html();
}
}
let userIsConnected = false;
Router.autoRun = true;
Router.on("route", function () {
console.log("go to " + this.path);
});
Router.on("beforeRender", function () {
console.log("before " + this.path);
});
Router.on("afterRender", function () {
console.log("after " + this.path);
});
// Declare not found route
Router.notFound = function () {
this.render(getTemplate("not-found"));
};
// Declare root route
Router.route("/", {
name: "home",
action: function () {
this.render(getTemplate("home"));
this.on("leave", function () {
console.log("good bye Home");
});
}
});
Router.route("/pages/:id", {
name: "page",
action: function () {
this.render(getTemplate("page-" + this.params.id));
this.on("leave", function () {
let field = $("[name=field]").val();
if (typeof field === "string" && field.length) {
return confirm("Are you sure you want to quit this page ?");
}
});
}
});
Router.route("/forbidden", {
action: function () {
this.render(getTemplate("forbidden"));
}
});
Router.route("/form", {
action: function () {
this.render(getTemplate("form"));
}
});
Router.route("/login", {
action: function () {
userIsConnected = true;
this.render(getTemplate("login"));
}
});
Router.route("/logout", {
action: function () {
userIsConnected = false;
this.render(getTemplate("logout"));
}
});
Router.route("/account", {
action: function () {
if (userIsConnected) {
this.render(getTemplate("account"));
} else {
this.redirect("/login");
}
}
});
|
'use strict';
describe('Suite', function suiteName() {
it('should finish immediately', function testCase1Name() {});
it('should finish after 100ms', function testCase2Name(done) { setTimeout(done, 100); });
it('should fail', function testCase3Name() { throw new Error('foo'); });
});
|
/**
* TagController
*
* @description :: Server-side logic for managing Tags
*/
module.exports = {
find: (req,res) => {
Tag.findAll({
where: ActionUtil.parseWhere(req),
limit: ActionUtil.parseLimit(req),
offset: ActionUtil.parseSkip(req),
order: ActionUtil.parseSort(req),
include: [],
}).then((recordsFound) => {
return res.ok(recordsFound)
}).catch((err) => {
return res.serverError(err)
});
},
findOne: function(req,res){
const pk = ActionUtil.requirePk(req)
Tag.findById(pk, {
include: ActionUtil.parsePopulate(req)
}).then((recordFound) => {
if(!recordFound) return res.notFound('No record found with the specified `id`.')
res.ok(recordFound);
}).catch((err) => {
return res.serverError(err)
})
},
};
|
define(['angular'], function (ng) {
'use strict';
return ng.module('app.directives', []);
});
|
#!/usr/bin/env node
require("./proof")(1, function (step, parse, deepEqual) {
step(function () {
parse("CancelSpotInstanceRequests", step());
}, function (object) {
var expected =
{ requestId: "59dbff89-35bd-4eac-99ed-be587ed81825"
, spotInstanceRequestSet: [ { spotInstanceRequestId: 'sir-e95fae02', state: "cancelled" } ]
};
deepEqual(object, expected, "parse cancel spot instance requests");
});
});
|
/**
* Display warning messages in console to discover potential errors
*/
(function(seajs) {
var uriCache = {}
var RE_VERSION = /\/(?:\d+\.){1,2}\d+\/|\D(?:\d+\.){1,2}\d+[^/]*\.(?:js|css)\W?/
seajs.on("fetch", checkMultiVersion)
// Only support this version style:
// `zz/1.2.3/xx`
// `zz/xx-1.2.3-beta.js`
// `zz/xx.1.2.3.rc2.js`
function checkMultiVersion(data) {
var uri = data.uri
if (!RE_VERSION.test(uri)) return
var key = uri.replace(RE_VERSION, "{version}")
var versions = uriCache[key] || (uriCache[key] = [])
if (indexOf(versions, uri) === -1) {
versions.push(uri)
}
if (versions.length > 1) {
seajs.log("This module has multiple versions:\n" +
versions.join("\n"), "warn")
}
}
// Helpers
var indexOf = [].indexOf ?
function(arr, item) {
return arr.indexOf(item)
} :
function(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === item) {
return i
}
}
return -1
}
define(seajs.dir + "plugin-warning", [], {})
})(seajs);
|
// @flow
import net from 'net'
import get from 'lodash/get'
import path from 'path'
// TODO: Remove this in favor of a non-overkill incremental port checker package
const getPort = options =>
new Promise((resolve, reject) => {
const server = net.createServer()
server.unref()
server.on('error', reject)
server.listen(options, () => {
const { port } = server.address()
server.close(() => {
resolve(port)
})
})
})
export function getNextPort(port: number, host: string): Promise<number> {
return getPort({ port, host }).catch(() => getPort({ port: port + 1, host }))
}
export function getStaticMappings(pundle: $FlowFixMe, config: Object): Array<{ local: string, remote: string }> {
const mappings = []
const configStatic = [].concat(get(config, 'dev.static', []))
configStatic.forEach(function(item) {
if (typeof item !== 'string') {
console.error(`Error: --dev.static expects an array or string. Got ${typeof item}`)
return
}
const chunks = item.split('::')
if (chunks.length !== 2) {
console.error(
`Error: Invalid dev.static path: '${item}'. Expected format is localPath::serverPath eg. ./static::/assets`,
)
return
}
const resolved = path.resolve(pundle.context.config.rootDirectory, chunks[0])
mappings.push({ local: resolved, remote: chunks[1] })
})
return mappings
}
|
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 10h-3v3c0 .55-.45 1-1 1s-1-.45-1-1v-3H8c-.55 0-1-.45-1-1s.45-1 1-1h3V8c0-.55.45-1 1-1s1 .45 1 1v3h3c.55 0 1 .45 1 1s-.45 1-1 1z" />
, 'AddBoxRounded');
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("../common");
const ENDPT = 'achievementicons';
/**
* Achievement icons resource
*/
class AchievementIconsResource {
/**
* Construct the achievement icons resource
* @param context The context to make requests as
*/
constructor(context) {
this.context = context;
this.common = new common_1.Common(context, ENDPT);
}
/**
* Get a list of all preloaded achievement icons
* @param {object} userOpts option overrides for this request
* @returns {Promise<object[]>} A promise that resolves to an array of achievement icon identifiers
*/
getAllPreloaded(userOpts) {
return this.context.http.makeRequest({
method: 'GET',
url: `/v2/apps/${this.context.applicationId}/${ENDPT}/preloaded`
}, userOpts);
}
/**
* Get a list of all uploaded achievement icons
* @param userOpts option overrides for this request
* @returns A promise that resolves to an array of achievement icon identifiers
*/
getAll(userOpts) {
return this.context.http.makeRequest({
method: 'GET',
url: `/v2/apps/${this.context.applicationId}/${ENDPT}`
}, userOpts);
}
/**
* Delete previously uploaded achievement icon by filename.
* @param iconFileName icon file name (generated by BadgeUp when the icon was uploaded, not the original file name)
* @param userOpts option overrides for this request
* @returns A promise that resolves to the deleted achievement icon
*/
remove(iconFileName, userOpts) {
return this.common.remove(iconFileName, userOpts);
}
}
exports.AchievementIconsResource = AchievementIconsResource;
//# sourceMappingURL=index.js.map
|
"use strict";
let XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
let xhr = new XMLHttpRequest();
// 8346870 - latest v1.0.1
// let url = "https://api.github.com/repos/ZencashOfficial/arizen/releases/8252416";
// 8252416 - v1.0.0
let url = "https://api.github.com/repos/ZencashOfficial/arizen/releases/8252416";
xhr.open("GET", url, true);
xhr.onload = function () {
let resp = JSON.parse(xhr.responseText);
if (xhr.readyState === 4 && (xhr.status === "200")) {
console.log(resp);
for (let i = 0; i < resp["assets"].length; i++) {
let obj = resp["assets"][i];
console.log("Downloaded: " + obj["download_count"] + ", " + obj["name"]);
}
} else {
console.error(resp);
}
};
xhr.send(null);
|
import express from 'express';
import unpackByOutpoint from './unpackByOutpoint';
// Polyfills and `lbry-redux`
global.fetch = require('node-fetch');
global.window = global;
if (typeof global.fetch === 'object') {
global.fetch = global.fetch.default;
}
const { Lbry } = require('lbry-redux');
delete global.window;
export default async function startSandbox() {
const port = 5278;
const sandbox = express();
sandbox.get('/set/:outpoint', async (req, res) => {
const { outpoint } = req.params;
const resolvedPath = await unpackByOutpoint(Lbry, outpoint);
sandbox.use(`/sandbox/${outpoint}/`, express.static(resolvedPath));
res.send(`/sandbox/${outpoint}/`);
});
sandbox
.listen(port, 'localhost', () => console.log(`Sandbox listening on port ${port}.`))
.on('error', err => {
if (err.code === 'EADDRINUSE') {
console.log(
`Server already listening at localhost:${port}. This is probably another LBRY app running. If not, games in the app will not work.`
);
}
});
}
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = yogaNode => {
return yogaNode.getComputedWidth() - yogaNode.getComputedPadding() * 2;
};
exports.default = _default;
|
import {
moduleFor,
test
} from 'ember-qunit';
moduleFor('controller:articles/index', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
var controller = this.subject();
assert.ok(controller);
});
|
(function() {
var checkVersion = Dagaz.Model.checkVersion;
Dagaz.Model.checkVersion = function(design, name, value) {
if (name != "pilare-restrictions") {
checkVersion(design, name, value);
}
}
var CheckInvariants = Dagaz.Model.CheckInvariants;
Dagaz.Model.CheckInvariants = function(board) {
var design = Dagaz.Model.design;
var pos = null;
_.each(design.allPositions(), function(p) {
var piece = board.getPiece(p);
if (piece === null) return;
var v = piece.getValue(1);
if (v === null) return;
pos = p;
});
if (pos !== null) {
Dagaz.View.getView().current = [pos];
_.each(board.moves, function(m) {
if (m.actions.length > 0) {
if (m.actions[0][0][0] != pos) {
m.failed = true;
return;
}
if (m.actions[0][1][0] == board.lastf) {
m.failed = true;
return;
}
}
});
}
CheckInvariants(board);
}
})();
|
/**
* Controller for single index detail
*/
import _ from 'lodash';
import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
import routeInitProvider from 'plugins/monitoring/lib/route_init';
import ajaxErrorHandlersProvider from 'plugins/monitoring/lib/ajax_error_handler';
import template from 'plugins/monitoring/views/elasticsearch/index/index_template.html';
uiRoutes.when('/elasticsearch/indices/:index', {
template,
resolve: {
clusters: function (Private) {
const routeInit = Private(routeInitProvider);
return routeInit();
},
pageData: getPageData
}
});
function getPageData(timefilter, globalState, $route, $http, Private) {
const timeBounds = timefilter.getBounds();
const url = `../api/monitoring/v1/clusters/${globalState.cluster_uuid}/elasticsearch/indices/${$route.current.params.index}`;
return $http.post(url, {
timeRange: {
min: timeBounds.min.toISOString(),
max: timeBounds.max.toISOString()
},
metrics: [
'index_search_request_rate',
{
name: 'index_request_rate',
keys: [
'index_request_rate_total',
'index_request_rate_primary'
]
},
'index_size',
{
name: 'index_mem',
keys: [ 'index_mem_overall' ],
config: 'xpack.monitoring.chart.elasticsearch.index.index_memory'
},
'index_document_count',
'index_segment_count'
]
})
.then(response => response.data)
.catch((err) => {
const ajaxErrorHandlers = Private(ajaxErrorHandlersProvider);
return ajaxErrorHandlers(err);
});
}
const uiModule = uiModules.get('monitoring', []);
uiModule.controller('indexView', (timefilter, $route, title, Private, globalState, $executor, $http, monitoringClusters, $scope) => {
timefilter.enabled = true;
function setClusters(clusters) {
$scope.clusters = clusters;
$scope.cluster = _.find($scope.clusters, { cluster_uuid: globalState.cluster_uuid });
}
setClusters($route.current.locals.clusters);
$scope.pageData = $route.current.locals.pageData;
$scope.indexName = $route.current.params.index;
title($scope.cluster, `Elasticsearch - Indices - ${$scope.indexName}`);
$executor.register({
execute: () => getPageData(timefilter, globalState, $route, $http, Private),
handleResponse: (response) => $scope.pageData = response
});
$executor.register({
execute: () => monitoringClusters(),
handleResponse: setClusters
});
// Start the executor
$executor.start();
// Destory the executor
$scope.$on('$destroy', $executor.destroy);
});
|
/**
* http://gruntjs.com/configuring-tasks
*/
module.exports = function (grunt) {
var path = require('path');
var DIST_PATH = 'demo/dist';
var SRC_PATH = 'demo/sample';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
options: {
hostname: '*'
},
demo: {
options: {
port: 8000,
base: DIST_PATH,
middleware: function (connect, options) {
return [
require('connect-livereload')(),
connect.static(path.resolve(options.base))
];
}
}
}
},
watch: {
options: {
livereload: true
},
less: {
files: ['less/**/*.less'],
tasks: ['less']
},
lesscopy: {
files: ['static/styles/jaguar.css'],
tasks: ['copy:css']
},
jscopy: {
files: ['static/scripts/main.js'],
tasks: ['copy:js']
},
jsdoc: {
files: ['**/*.tmpl', '*.js'],
tasks: ['jsdoc']
},
doc: {
files: ['demo/sample/**/*.js'],
tasks: ['demo']
}
},
clean: {
doc: {
src: DIST_PATH
}
},
jsdoc: {
doc: {
src: [
SRC_PATH + '/**/*.js',
// You can add README.md file for index page at documentations.
'README.md'
],
options: {
verbose: true,
destination: DIST_PATH,
configure: 'conf.json',
template: './',
'private': false
}
},
/**
* egjs 빌드시 사용하는 옵션
*/
egjs: {
src: ['../egjs/src/**/*.js', 'README.md'],
options: {
verbose: true,
destination: DIST_PATH,
configure: 'conf.json',
template: './',
'private': false
}
}
},
less: {
dist: {
src: 'less/**/jaguar.less',
dest: 'static/styles/jaguar.css'
}
},
copy: {
css: {
src: 'static/styles/jaguar.css',
dest: DIST_PATH + '/styles/jaguar.css'
},
js: {
src: 'static/scripts/main.js',
dest: DIST_PATH + '/scripts/main.js'
},
plugin: {
files: [{
src: 'jsdoc-plugin/*.js',
dest: 'node_modules/grunt-jsdoc/node_modules/jsdoc/plugins/',
flatten : true,
expand : true
}]
},
/*
* Alternative task to apply on changed module dir in NPM3
*/
pluginForNewNPM: {
files: [{
src: 'jsdoc-plugin/*.js',
dest: 'node_modules/jsdoc/plugins/',
flatten : true,
expand : true
}]
}
}
});
// Load task libraries
[
'grunt-contrib-connect',
'grunt-contrib-watch',
'grunt-contrib-copy',
'grunt-contrib-clean',
'grunt-contrib-less',
'grunt-jsdoc',
].forEach(function (taskName) {
grunt.loadNpmTasks(taskName);
});
// Definitions of tasks
// grunt.registerTask('default', 'Watch project files', [
// 'demo',
// 'connect:demo',
// 'watch'
// ]);
grunt.registerTask('default', 'Create documentations for yours', [
/*'less',*/
'clean:doc',
'copy:plugin',
'copy:pluginForNewNPM',
'jsdoc:doc'
]);
grunt.registerTask('egjs', 'Create documentations for egjs', [
/*'less',*/
'clean:doc',
'copy:plugin',
'copy:pluginForNewNPM',
'jsdoc:egjs'
]);
};
|
var searchData=
[
['friendstatuschangeevent',['FriendStatusChangeEvent',['../class_cotc_sdk_1_1_friend_status_change_event.html',1,'CotcSdk']]]
];
|
/* jshint node: true */
'use strict';
module.exports = {
name: 'ember-models-table'
};
|
//
// Copyright 2016 Intel Corporation
//
// 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.
//
module.exports = function( grunt ) {
"use strict";
var path = require( "path" );
var suites;
require( "load-grunt-config" )( grunt, {
configPath: [
path.join( __dirname, "grunt-build", "tasks", "options" ),
path.join( __dirname, "grunt-build", "tasks" )
],
init: true
} );
suites = grunt.option( "ocf-suites" ) ?
grunt.option( "ocf-suites" ).split( "," ) : undefined;
if ( suites ) {
grunt.config.set( "iot-js-api.plain.tests", suites );
grunt.config.set( "iot-js-api.secure.tests", suites );
grunt.config.set( "iot-js-api.coverage.tests", suites );
}
require( "load-grunt-tasks" )( grunt );
grunt.task.loadNpmTasks( "iot-js-api" );
};
|
import RecordArray from "./record_array";
/**
@module ember-data
*/
var get = Ember.get;
/**
Represents a list of records whose membership is determined by the
store. As records are created, loaded, or modified, the store
evaluates them to determine if they should be part of the record
array.
@class FilteredRecordArray
@namespace DS
@extends DS.RecordArray
*/
var FilteredRecordArray = RecordArray.extend({
/**
The filterFunction is a function used to test records from the store to
determine if they should be part of the record array.
Example
```javascript
var allPeople = store.all('person');
allPeople.mapBy('name'); // ["Tom Dale", "Yehuda Katz", "Trek Glowacki"]
var people = store.filter('person', function(person) {
if (person.get('name').match(/Katz$/)) { return true; }
});
people.mapBy('name'); // ["Yehuda Katz"]
var notKatzFilter = function(person) {
return !person.get('name').match(/Katz$/);
};
people.set('filterFunction', notKatzFilter);
people.mapBy('name'); // ["Tom Dale", "Trek Glowacki"]
```
@method filterFunction
@param {DS.Model} record
@return {Boolean} `true` if the record should be in the array
*/
filterFunction: null,
isLoaded: true,
replace: function() {
var type = get(this, 'type').toString();
throw new Error("The result of a client-side filter (on " + type + ") is immutable.");
},
/**
@method updateFilter
@private
*/
updateFilter: Ember.observer(function() {
var manager = get(this, 'manager');
manager.updateFilter(this, get(this, 'type'), get(this, 'filterFunction'));
}, 'filterFunction')
});
export default FilteredRecordArray;
|
const findMatchingPermission = (permissions, action, subject) =>
permissions.find(perm => perm.action === action && perm.subject === subject);
export default findMatchingPermission;
|
module.exports = {
development: {
options: {
paths: ['<%= src %>/less'],
cleancss: false,
compress: false,
modifyVars: {
'fa-font-path' : '"//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"'
}
},
files: {
'<%= public %>/css/kc-theme-default.css': '<%= src %>/less/kc-theme-default.less',
'<%= public %>/css/kc-theme-caring.css': '<%= src %>/less/kc-theme-caring.less',
'<%= public %>/css/kc-theme-corporate.css': '<%= src %>/less/kc-theme-corporate.less',
'<%= public %>/css/kc-theme-environment.css': '<%= src %>/less/kc-theme-environment.less',
'<%= public %>/css/kc-print.css': '<%= src %>/less/print/kc-print.less',
'<%= public %>/css/ie-only.css': '<%= src %>/less/IE-only/ie-only.less'
}
},
tfs: {
options: {
paths: ['<%= src %>/src/less'],
cleancss: false,
compress: false,
modifyVars: {
'fa-font-path' : '"//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"'
}
},
files: {
'<%= tfs%>/css/kc-theme-default.css': '<%= src %>/less/kc-theme-default.less',
'<%= tfs %>/css/kc-theme-caring.css': '<%= src %>/less/kc-theme-caring.less',
'<%= tfs %>/css/kc-theme-corporate.css': '<%= src %>/less/kc-theme-corporate.less',
'<%= tfs %>/css/kc-theme-environment.css': '<%= src %>/less/kc-theme-environment.less',
'<%= tfs %>/css/kc-print.css': '<%= src %>/less/print/kc-print.less',
'<%= tfs %>/css/ie-only.css': '<%= src %>/less/IE-only/ie-only.less'
}
},
app: {
options: {
paths: ['<%= app %>/less'],
cleancss: false,
compress: false,
modifyVars: {
'fa-font-path' : '"//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"'
}
},
files: {
'<%= app%>/public/css/kc-app-theme-corporate.css': '<%= app %>/less/kc-app-theme-corporate.less',
}
}
};
|
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M14 6h3v7.88l2 2V4h-5V3H6.12L14 10.88zm-2 5.71V13h-2v-2h1.29L2.41 2.13 1 3.54l4 4V19H3v2h11v-4.46L20.46 23l1.41-1.41z" />
, 'NoMeetingRoomSharp');
|
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.8/esri/copyright.txt for details.
//>>built
define({widgetLabel:"\u8a66_Locate___\u9a57",title:"\u8a66_Find my location______\u9a57"});
|
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap-sprockets
//= require underscore
//= require backbone
//= require codemirror
//= require codemirror/modes/markdown
//= require select2
//= require nprogress
//= require nprogress-ajax
//= require locomotive/vendor
//= require ./locomotive/application
$(document).ready(function() {
$.datepicker.setDefaults($.datepicker.regional[window.locale]);
});
|
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var BaseStream_1 = require("./BaseStream");
var GroupDisposable_1 = require("../Disposable/GroupDisposable");
var ConcatObserver_1 = require("../observer/ConcatObserver");
var registerClass_1 = require("../definition/typescript/decorator/registerClass");
var RepeatStream = (function (_super) {
__extends(RepeatStream, _super);
function RepeatStream(source, count) {
var _this = _super.call(this, null) || this;
_this._source = null;
_this._count = null;
_this._source = source;
_this._count = count;
_this.scheduler = _this._source.scheduler;
return _this;
}
RepeatStream.create = function (source, count) {
var obj = new this(source, count);
return obj;
};
RepeatStream.prototype.subscribeCore = function (observer) {
var self = this, d = GroupDisposable_1.GroupDisposable.create();
function loopRecursive(count) {
if (count === 0) {
observer.completed();
return;
}
d.add(self._source.buildStream(ConcatObserver_1.ConcatObserver.create(observer, function () {
loopRecursive(count - 1);
})));
}
this.scheduler.publishRecursive(observer, this._count, loopRecursive);
return GroupDisposable_1.GroupDisposable.create(d);
};
RepeatStream = __decorate([
registerClass_1.registerClass("RepeatStream")
], RepeatStream);
return RepeatStream;
}(BaseStream_1.BaseStream));
exports.RepeatStream = RepeatStream;
//# sourceMappingURL=RepeatStream.js.map
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const propTypes = {
children: PropTypes.node,
className: PropTypes.string,
info: PropTypes.string
};
const ListItemAction = props => {
const { children, className, info, ...otherProps } = props;
const classes = classNames('mdl-list__item-secondary-content', className);
return (
<span className={classes} {...otherProps}>
{info && <span className="mdl-list__item-secondary-info">{info}</span>}
<span className="mdl-list__item-secondary-action">
{children}
</span>
</span>
);
};
ListItemAction.propTypes = propTypes;
export default ListItemAction;
|
"use strict";
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
const HTMLElement = require("./HTMLElement.js");
const impl = utils.implSymbol;
function HTMLButtonElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLButtonElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLButtonElement, HTMLElement.interface);
Object.defineProperty(HTMLButtonElement.prototype, "autofocus", {
get() {
return this.hasAttribute("autofocus");
},
set(V) {
V = conversions["boolean"](V, {
context: "Failed to set the 'autofocus' property on 'HTMLButtonElement': The provided value"
});
if (V) {
this.setAttribute("autofocus", "");
} else {
this.removeAttribute("autofocus");
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "disabled", {
get() {
return this.hasAttribute("disabled");
},
set(V) {
V = conversions["boolean"](V, {
context: "Failed to set the 'disabled' property on 'HTMLButtonElement': The provided value"
});
if (V) {
this.setAttribute("disabled", "");
} else {
this.removeAttribute("disabled");
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "form", {
get() {
return utils.tryWrapperForImpl(this[impl]["form"]);
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "formNoValidate", {
get() {
return this.hasAttribute("formNoValidate");
},
set(V) {
V = conversions["boolean"](V, {
context: "Failed to set the 'formNoValidate' property on 'HTMLButtonElement': The provided value"
});
if (V) {
this.setAttribute("formNoValidate", "");
} else {
this.removeAttribute("formNoValidate");
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "formTarget", {
get() {
const value = this.getAttribute("formTarget");
return value === null ? "" : value;
},
set(V) {
V = conversions["DOMString"](V, {
context: "Failed to set the 'formTarget' property on 'HTMLButtonElement': The provided value"
});
this.setAttribute("formTarget", V);
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "name", {
get() {
const value = this.getAttribute("name");
return value === null ? "" : value;
},
set(V) {
V = conversions["DOMString"](V, {
context: "Failed to set the 'name' property on 'HTMLButtonElement': The provided value"
});
this.setAttribute("name", V);
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "type", {
get() {
return this[impl]["type"];
},
set(V) {
V = conversions["DOMString"](V, {
context: "Failed to set the 'type' property on 'HTMLButtonElement': The provided value"
});
this[impl]["type"] = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, "value", {
get() {
const value = this.getAttribute("value");
return value === null ? "" : value;
},
set(V) {
V = conversions["DOMString"](V, {
context: "Failed to set the 'value' property on 'HTMLButtonElement': The provided value"
});
this.setAttribute("value", V);
},
enumerable: true,
configurable: true
});
Object.defineProperty(HTMLButtonElement.prototype, Symbol.toStringTag, {
value: "HTMLButtonElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
mixedInto: [],
is(obj) {
if (obj) {
if (obj[impl] instanceof Impl.implementation) {
return true;
}
for (let i = 0; i < module.exports.mixedInto.length; ++i) {
if (obj instanceof module.exports.mixedInto[i]) {
return true;
}
}
}
return false;
},
isImpl(obj) {
if (obj) {
if (obj instanceof Impl.implementation) {
return true;
}
const wrapper = utils.wrapperForImpl(obj);
for (let i = 0; i < module.exports.mixedInto.length; ++i) {
if (wrapper instanceof module.exports.mixedInto[i]) {
return true;
}
}
}
return false;
},
convert(obj, { context = "The provided value" } = {}) {
if (module.exports.is(obj)) {
return utils.implForWrapper(obj);
}
throw new TypeError(`${context} is not of type 'HTMLButtonElement'.`);
},
create(constructorArgs, privateData) {
let obj = Object.create(HTMLButtonElement.prototype);
this.setup(obj, constructorArgs, privateData);
return obj;
},
createImpl(constructorArgs, privateData) {
let obj = Object.create(HTMLButtonElement.prototype);
this.setup(obj, constructorArgs, privateData);
return utils.implForWrapper(obj);
},
_internalSetup(obj) {
HTMLElement._internalSetup(obj);
},
setup(obj, constructorArgs, privateData) {
if (!privateData) privateData = {};
privateData.wrapper = obj;
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});
obj[impl][utils.wrapperSymbol] = obj;
},
interface: HTMLButtonElement,
expose: {
Window: { HTMLButtonElement: HTMLButtonElement }
}
};
module.exports = iface;
const Impl = require("../nodes/HTMLButtonElement-impl.js");
|
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
import type {Tests, Steps} from './Tester';
class Suite {
getBeforeEach: Steps;
tags: Array<string>;
tests: Tests;
constructor(tests: Tests) {
this.tests = tests;
this.tags = [];
this.getBeforeEach = () => [];
}
beforeEach(steps: Steps): this {
this.getBeforeEach = steps;
return this;
}
addTags(tags: Array<string>): this {
this.tags = (this.tags || []).concat(tags);
return this;
}
}
module.exports = {
Suite,
default: Suite,
};
|
/*jshint unused:false */
"use strict";
var _verbosity = 0;
var _prefix = "[videojs-vast-vpaid] ";
function setVerbosity (v)
{
_verbosity = v;
}
function handleMsg (method, args)
{
if ((args.length) > 0 && (typeof args[0] === 'string'))
{
args[0] = _prefix + args[0];
}
if (method.apply)
{
method.apply (console, Array.prototype.slice.call(args));
}
else
{
method (Array.prototype.slice.call(args));
}
}
function debug ()
{
if (_verbosity < 4)
{
return;
}
if (typeof console.debug === 'undefined')
{
// IE 10 doesn't have a console.debug() function
handleMsg (console.log, arguments);
}
else
{
handleMsg (console.debug, arguments);
}
}
function log ()
{
if (_verbosity < 3)
{
return;
}
handleMsg (console.log, arguments);
}
function info ()
{
if (_verbosity < 2)
{
return;
}
handleMsg (console.info, arguments);
}
function warn ()
{
if (_verbosity < 1)
{
return;
}
handleMsg (console.warn, arguments);
}
function error ()
{
handleMsg (console.error, arguments);
}
var consoleLogger = {
setVerbosity: setVerbosity,
debug: debug,
log: log,
info: info,
warn: warn,
error: error
};
if ((typeof (console) === 'undefined') || !console.log)
{
// no console available; make functions no-op
consoleLogger.debug = function () {};
consoleLogger.log = function () {};
consoleLogger.info = function () {};
consoleLogger.warn = function () {};
consoleLogger.error = function () {};
}
module.exports = consoleLogger;
|
'use strict';
const path = require('path');
const taskName = path.basename(__dirname);
const dist = path.resolve(__dirname, '../dist', taskName);
const webpackConfig = {
context: __dirname,
entry: {
'mod2': './js/index.js'
},
output: {
path: dist,
filename: '[name].[chunkhash].js'
},
plugins: []
};
module.exports = webpackConfig;
|
import React from 'react';
import PropTypes from 'prop-types';
import {observer} from 'mobx-react';
import {action} from 'mobx';
import {pluralize} from '../utils';
import { ALL_TODOS, ACTIVE_TODOS, COMPLETED_TODOS } from '../constants';
@observer
export default class TodoFooter extends React.Component {
render() {
const todoStore = this.props.todoStore;
if (!todoStore.activeTodoCount && !todoStore.completedCount)
return null;
const activeTodoWord = pluralize(todoStore.activeTodoCount, 'item');
return (
<footer className="footer">
<span className="todo-count">
<strong>{todoStore.activeTodoCount}</strong> {activeTodoWord} left
</span>
<ul className="filters">
{this.renderFilterLink(ALL_TODOS, "", "All")}
{this.renderFilterLink(ACTIVE_TODOS, "active", "Active")}
{this.renderFilterLink(COMPLETED_TODOS, "completed", "Completed")}
</ul>
{ todoStore.completedCount === 0
? null
: <button
className="clear-completed"
onClick={this.clearCompleted}>
Clear completed
</button>
}
</footer>
);
}
renderFilterLink(filterName, url, caption) {
return (<li>
<a href={"#/" + url}
className={filterName === this.props.viewStore.todoFilter ? "selected" : ""}>
{caption}
</a>
{' '}
</li>)
}
@action
clearCompleted = () => {
this.props.todoStore.clearCompleted();
};
}
TodoFooter.propTypes = {
viewStore: PropTypes.object.isRequired,
todoStore: PropTypes.object.isRequired
}
|
export * from './navbar.component'
|
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { chainPropTypes, getDisplayName } from '@material-ui/utils';
import hoistNonReactStatics from 'hoist-non-react-statics';
import makeStyles from '../makeStyles';
function omit(input, fields) {
const output = {};
Object.keys(input).forEach(prop => {
if (fields.indexOf(prop) === -1) {
output[prop] = input[prop];
}
});
return output;
} // styled-components's API removes the mapping between components and styles.
// Using components as a low-level styling construct can be simpler.
export default function styled(Component) {
const componentCreator = (style, options = {}) => {
const {
name
} = options,
stylesOptions = _objectWithoutPropertiesLoose(options, ["name"]);
if (process.env.NODE_ENV !== 'production' && Component === undefined) {
throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\n'));
}
let classNamePrefix = name;
if (process.env.NODE_ENV !== 'production') {
if (!name) {
// Provide a better DX outside production.
const displayName = getDisplayName(Component);
if (displayName !== undefined) {
classNamePrefix = displayName;
}
}
}
const stylesOrCreator = typeof style === 'function' ? theme => ({
root: props => style(_extends({
theme
}, props))
}) : {
root: style
};
const useStyles = makeStyles(stylesOrCreator, _extends({
Component,
name: name || Component.displayName,
classNamePrefix
}, stylesOptions));
let filterProps;
let propTypes = {};
if (style.filterProps) {
filterProps = style.filterProps;
delete style.filterProps;
}
/* eslint-disable react/forbid-foreign-prop-types */
if (style.propTypes) {
propTypes = style.propTypes;
delete style.propTypes;
}
/* eslint-enable react/forbid-foreign-prop-types */
const StyledComponent = /*#__PURE__*/React.forwardRef(function StyledComponent(props, ref) {
const {
children,
className: classNameProp,
clone,
component: ComponentProp
} = props,
other = _objectWithoutPropertiesLoose(props, ["children", "className", "clone", "component"]);
const classes = useStyles(props);
const className = clsx(classes.root, classNameProp);
let spread = other;
if (filterProps) {
spread = omit(spread, filterProps);
}
if (clone) {
return /*#__PURE__*/React.cloneElement(children, _extends({
className: clsx(children.props.className, className)
}, spread));
}
if (typeof children === 'function') {
return children(_extends({
className
}, spread));
}
const FinalComponent = ComponentProp || Component;
return /*#__PURE__*/React.createElement(FinalComponent, _extends({
ref: ref,
className: className
}, spread), children);
});
process.env.NODE_ENV !== "production" ? StyledComponent.propTypes = _extends({
/**
* A render function or node.
*/
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
/**
* @ignore
*/
className: PropTypes.string,
/**
* If `true`, the component will recycle it's children HTML element.
* It's using `React.cloneElement` internally.
*
* This prop will be deprecated and removed in v5
*/
clone: chainPropTypes(PropTypes.bool, props => {
if (props.clone && props.component) {
return new Error('You can not use the clone and component prop at the same time.');
}
return null;
}),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: PropTypes
/* @typescript-to-proptypes-ignore */
.elementType
}, propTypes) : void 0;
if (process.env.NODE_ENV !== 'production') {
StyledComponent.displayName = `Styled(${classNamePrefix})`;
}
hoistNonReactStatics(StyledComponent, Component);
return StyledComponent;
};
return componentCreator;
}
|
if(typeof Language != "undefined" && Language == 'English'){
setText({
'flat' : 'Flat',
'folder' : 'Folder',
'rate' : 'Rate',
'subscribers' : 'Subscribers',
'domain' : 'Domain'
});
// sort
setText({
'modified_on' : 'By Recency',
'modified_on:reverse' : 'By Age',
'unread_count' : 'Many unreads',
'unread_count:reverse' : 'Less unread',
'title:reverse' : 'By Title',
'rate' : 'By Rate',
'subscribers_count' : 'Many subscribers',
'subscribers_count:reverse' : 'Less subscribers'
});
// api
setText({
'set_rate_complete' : 'change rate',
'create_folder_complete' : 'I created folder',
'print_discover_loading' : 'I am looking for feed. Please wait a little.',
'print_discover_notfound': 'Umm. I can not find valid feed.'
});
setText({
'prefetching' : 'prefetching.',
'prefetch_complete' : 'prefetching done.'
});
// errors
setText({
'cannot_popup' : 'Please disable the pop up block for this domain to use this function.'
})
} else {
// japanese resource
// mode
setText({
'flat' : 'フラット',
'folder' : 'フォルダ',
'rate' : 'レート',
'subscribers' : '購読者数',
'domain' : 'ドメイン'
});
// sort
setText({
'modified_on' : '新着順',
'modified_on:reverse' : '旧着順',
'unread_count' : '未読が多い',
'unread_count:reverse' : '未読が少ない',
'title:reverse' : 'タイトル',
'rate' : 'レート',
'subscribers_count' : '読者が多い',
'subscribers_count:reverse' : '読者が少ない'
});
// api
setText({
'set_rate_complete' : 'レートを変更しました',
'create_folder_complete' : 'フォルダを作成しました',
'print_discover_loading' : 'フィードを探しています',
'print_discover_notfound': '登録可能なフィードが見つかりませんでした'
});
setText({
'prefetching' : '先読み中',
'prefetch_complete' : '先読み完了'
});
// errors
setText({
'cannot_popup' : 'この機能を使うにはポップアップブロックを解除してください。'
})
// keyboard help
setText({
'close' : '閉じる',
'show more' : 'もっと表示',
'hide' : '隠す',
'open in window' : '別ウィンドウで開く'
});
}
/*
system default
*/
var LDR_VARS = {
LeftpaneWidth : 250, // マイフィードの幅
DefaultPrefetch : 2, // デフォルトの先読み件数
MaxPrefetch : 5, // 最大先読み件数
PrintFeedFirstNum : 3, // 初回に描画する件数
PrintFeedDelay : 500, // 2件目以降を描画するまでの待ち時間
PrintFeedDelay2 : 100, // 21件目以降を描画するまでの待ち時間
PrintFeedNum : 20, // 一度に描画する件数
SubsLimit1 : 100, // 初回にロードするSubsの件数
SubsLimit2 : 200, // 二回目以降にロードするSubsの件数
ViewModes : ['flat','folder','rate','subscribers']
};
var DefaultConfig = {
current_font : 14,
use_autoreload : 0,
autoreload : 60,
view_mode : 'folder',
sort_mode : 'modified_on',
touch_when : 'onload',
reverse_mode : false,
keep_new : false,
show_all : true,
max_pin : 5,
prefetch_num : 2,
use_wait : false,
scroll_type : 'px',
scroll_px : 100,
limit_subs : 100,
use_pinsaver : 1,
use_prefetch_hack : false,
use_scroll_hilight: 0,
use_instant_clip : -1,
use_inline_clip : 1,
use_custom_clip : "off",
use_clip_public : "on",
use_limit_subs : 0,
clip_tags : "",
instant_clip_tags : "",
use_instant_clip_public : "on",
use_clip_ratecopy : 1,
use_instant_clip_ratecopy : 1,
default_public_status : 1
};
var TypeofConfig = {
keep_new : 'Boolean',
show_all : 'Boolean',
use_autoreload : 'Boolean',
use_wait : 'Boolean',
use_pinsaver : 'Boolean',
use_scroll_hilight: 'Boolean',
use_prefetch_hack : 'Boolean',
use_clip_ratecopy : 'Boolean',
use_instant_clip_ratecopy : 'Boolean',
reverse_mode : 'Boolean',
use_inline_clip : 'Boolean',
use_limit_subs : 'Boolean',
default_public_status : 'Boolean',
current_font : 'Number',
autoreload : 'Number',
scroll_px : 'Number',
wait : 'Number',
max_pin : 'Number',
max_view : 'Number',
items_per_page : 'Number',
prefetch_num : 'Number',
use_instant_clip : 'Number',
limit_subs : 'Number',
view_mode : 'String',
sort_mode : 'String',
touch_when : 'String',
scroll_type : 'String'
};
var KeyConfig = {
'read_next_subs' : 's|shift+ctrl|shift+down',
'read_prev_subs' : 'a|ctrl+shift|shift+up',
'read_head_subs' : 'w|shift+home',
'read_end_subs' : 'W|shift+end',
'feed_next' : '>|J',
'feed_prev' : '<|K',
'reload_subs' : 'r',
'scroll_next_page' : 'space|pagedown',
'scroll_prev_page' : 'shift+space|pageup',
'pin' : 'p',
'open_pin' : 'o',
'view_original' : 'v|ctrl+enter',
'scroll_next_item' : 'j|enter',
'scroll_prev_item' : 'k|shift+enter',
'compact' : 'c',
'focus_findbox' : 'f',
'blur_findbox' : 'esc',
'unsubscribe' : 'delete',
'toggle_leftpane' : 'z',
'toggle_fullscreen': 'Z',
'toggle_keyhelp' : '?'
};
var KeyHelp = {
'scroll_next_item' : '次のアイテム',
'scroll_prev_item' : '前のアイテム',
'scroll_next_page' : '下にスクロール',
'scroll_prev_page' : '上にスクロール',
'feed_next' : '過去の記事に移動',
'feed_prev' : '未来の記事に移動',
'view_original' : '元記事を開く',
'pin' : 'ピンを付ける / 外す',
'open_pin' : 'ピンを開く',
'toggle_clip' : 'クリップボタン',
'instant_clip' : '一発クリップ',
'compact' : '本文の表示 / 非表示',
'unsubscribe' : '購読停止',
'reload_subs' : 'フィード一覧の更新',
'toggle_leftpane' : 'マイフィードを畳む / 戻す',
'focus_findbox' : '検索ボックスに移動',
'read_next_subs' : '次のフィードに移動',
'read_prev_subs' : '前のフィードに移動',
'read_head_subs' : '最初の未読に移動',
'read_end_subs' : '最後の未読に移動',
'toggle_keyhelp' : 'ヘルプを表示 / 非表示'
};
var KeyHelpOrder = [
[ 'read_next_subs', 'scroll_next_item', 'pin' ],
[ 'read_prev_subs', 'scroll_prev_item', 'open_pin'],
[ 'reload_subs', 'unsubscribe', 'view_original'],
[ 'compact', 'scroll_next_page', 'feed_next'],
[ '', 'scroll_prev_page', 'feed_prev'],
[ '', 'toggle_leftpane', 'focus_findbox'],
[ '', 'toggle_clip', 'instant_clip']
];
|
/** @jsx React.DOM */
'use strict';
// Boats is for presentation, No change.
var AllBoatClass = React.createClass({displayName: 'AllBoatClass',
render:function(){
var boats = this.props.boat
return(
React.DOM.li(null, "All Boats",
React.DOM.span({className:"boat"}, {data: data})
)
)
}
});
React.render(AllBoatClass(null), document.getElementById('boatname')
);
|
// warning: This file is auto generated by `npm run build:tests`
// Do not edit by hand!
process.env.TZ = 'UTC'
var expect = require('chai').expect
var ini_set = require('../../../../src/php/info/ini_set') // eslint-disable-line no-unused-vars,camelcase
var ini_get = require('../../../../src/php/info/ini_get') // eslint-disable-line no-unused-vars,camelcase
var array_fill = require('../../../../src/php/array/array_fill.js') // eslint-disable-line no-unused-vars,camelcase
describe('src/php/array/array_fill.js (tested in test/languages/php/array/test-array_fill.js)', function () {
it('should pass example 1', function (done) {
var expected = { 5: 'banana', 6: 'banana', 7: 'banana', 8: 'banana', 9: 'banana', 10: 'banana' }
var result = array_fill(5, 6, 'banana')
expect(result).to.deep.equal(expected)
done()
})
})
|
/**
* Copyright 2013-2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @providesModule copyProperties
*/
'use strict';
/**
* Copy properties from one or more objects (up to 5) into the first object.
* This is a shallow copy. It mutates the first object and also returns it.
*
* NOTE: `arguments` has a very significant performance penalty, which is why
* we don't support unlimited arguments.
*/
function copyProperties(obj, a, b, c, d, e, f) {
obj = obj || {};
if (process.env.NODE_ENV !== 'production') {
if (f) {
throw new Error('Too many arguments passed to copyProperties');
}
}
var args = [a, b, c, d, e];
var ii = 0, v;
while (args[ii]) {
v = args[ii++];
for (var k in v) {
obj[k] = v[k];
}
// IE ignores toString in object iteration.. See:
// webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html
if (v.hasOwnProperty && v.hasOwnProperty('toString') &&
(typeof v.toString !== 'undefined') && (obj.toString !== v.toString)) {
obj.toString = v.toString;
}
}
return obj;
}
module.exports = copyProperties;
|
window.onload =function () {
var subObj = document.getElementsByTagName('button')[0];
if( subObj && subObj.className=='btn_submit')
subObj.onclick = submit_login;
}; // end function window.onload
function submit_login() {
this.innerHTML = 'Wait...';
this.disabled = true;
document.getElementById('form_login').submit();
return false;
}; // end function submit_login
// -----------------------------------------------------------------------------------
// ------------------ ...give me liberty of give me death! ---------------------------
// -------------------- - American patriots of the 1700 and early 1800s --------------
// -----------------------------------------------------------------------------------
// ------------------ ...Give me your money or die! ----------------------------------
// -------------------- - The Neo-American voter of the 1900s ------------------------
// -----------------------------------------------------------------------------------
// ----------------- Do you know if Jak was really the Mar who built Haven City? -----
|
/**
* @class elFinder command "places"
* Regist to Places
*
* @author Naoki Sawada
**/
elFinder.prototype.commands.places = function() {
"use strict";
var self = this,
fm = this.fm,
filter = function(hashes) {
return $.grep(self.files(hashes), function(f) { return f.mime == 'directory' ? true : false; });
},
places = null;
this.getstate = function(select) {
var sel = this.hashes(select),
cnt = sel.length;
return places && cnt && cnt == filter(sel).length ? 0 : -1;
};
this.exec = function(hashes) {
var files = this.files(hashes);
places.trigger('regist', [ files ]);
return $.Deferred().resolve();
};
fm.one('load', function(){
places = fm.ui.places;
});
};
|
import Ember from 'ember';
import TableBlock from '../views/table-block';
export default TableBlock.extend({
classNames: ['ember-table-header-block'],
// TODO(new-api): Eliminate view alias
itemView: 'header-row',
itemViewClass: Ember.computed.alias('itemView'),
content: Ember.computed(function() {
return [this.get('columns')];
}).property('columns')
});
|
// Copyright (C) 2010 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview
* Registers a language handler for Scala.
*
* Derived from http://lampsvn.epfl.ch/svn-repos/scala/scala-documentation/trunk/src/reference/SyntaxSummary.tex
*
* @author mikesamuel@gmail.com
*/
PR['registerLangHandler'](
PR['createSimpleLexer'](
[
// Whitespace
[PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
// A double or single quoted string
// or a triple double-quoted multi-line string.
[PR['PR_STRING'],
/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,
null, '"'],
[PR['PR_LITERAL'], /^`(?:[^\r\n\\`]|\\.)*`?/, null, '`'],
[PR['PR_PUNCTUATION'], /^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/, null,
'!#%&()*+,-:;<=>?@[\\]^{|}~']
],
[
// A symbol literal is a single quote followed by an identifier with no
// single quote following
// A character literal has single quotes on either side
[PR['PR_STRING'], /^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],
[PR['PR_LITERAL'], /^'[a-zA-Z_$][\w$]*(?!['$\w])/],
[PR['PR_KEYWORD'], /^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/],
[PR['PR_LITERAL'], /^(?:true|false|null|this)\b/],
[PR['PR_LITERAL'], /^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],
// Treat upper camel case identifiers as types.
[PR['PR_TYPE'], /^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],
[PR['PR_PLAIN'], /^[$a-zA-Z_][\w$]*/],
[PR['PR_COMMENT'], /^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],
[PR['PR_PUNCTUATION'], /^(?:\.+|\/)/]
]),
['scala']);
|
'use strict';
angular.module('myApp.viewPopular', ['ngRoute', 'movieApi'])
.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.when('/popular', {
templateUrl: 'viewPopular/view1.html',
controller: 'ViewPopularCtrl'
});
}])
.controller('ViewPopularCtrl', [
'$scope',
'TMDbConfigService',
'TMDbService',
//'$modal',
function ($scope, TMDbConfigService, TMDbService/*,$modal*/) {
//TODO: use $anchorScroll
// http://stackoverflow.com/questions/14107531/retain-scroll-position-on-route-change-in-angularjs
var imagesConfig = null,
totalPages = 2;
$scope.configService = TMDbConfigService;
$scope.movies = [];
$scope.page = 0;
$scope.foundMovies = [];
$scope.loadMoreData = function () {
$scope.page += 1;
if ($scope.page >= totalPages) {
return;
}
TMDbService.movies.get({
verb: "popular",
page: $scope.page
}, function (data) {
totalPages = data.total_pages;
data.results.forEach(function (item) {
item.poster_path = $scope.configService.getPosterImageUrl(item.poster_path);
$scope.movies.push(item);
});
});
};
$scope.loadMovieDetail = function (movieId) {
TMDbService.movie.get({
verb: movieId
}, function (data) {
$scope.selectedMovie = data;
});
};
$scope.searchMovies = function() {
$scope.foundMovies = [];
var searchText = $scope.searchText;
if (searchText && searchText.length > 3) {
TMDbService.movieSearch.get({
query: searchText
//TODO: paging
}, function (data) {
data.results.forEach(function (item) {
item.poster_path = $scope.configService.getPosterImageUrl(item.poster_path);
$scope.foundMovies.push(item);
});
});
}
};
// $scope.showDetails = function (movie) {
// var modalInstance = $modal.open({
// templateUrl: 'movieDetails.html',
// controller: 'ViewDetailsCtrl',
// resolve: {
// movieId: function () {
// return movie.id;
// }
// }
// });
//
// modalInstance.result.then(function (selectedItem) {
// //ok
// }, function () {
// //cancel
// });
// };
$scope.loadMoreData();
}]);
//angular.module('myApp.viewPopular')
// .controller('ViewDetailsCtrl', [
// '$scope',
// '$modalInstance',
// 'TMDbService',
// 'TMDbConfigService',
// 'movieId',
// function ($scope, $modalInstance, TMDbService, TMDbConfigService, movieId) {
// $scope.movieId = movieId;
// $scope.configService = TMDbConfigService;
//
// TMDbService.movie.get({
// verb: $scope.movieId
// }, function (data) {
// $scope.movie = data;
// });
// }]);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.