text
stringlengths 2
6.14k
|
|---|
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Tfile Schema
*/
var TfileSchema = new Schema({
name: {
type: String,
default: '',
required: 'Please add a TestFile name',
trim: true
},
created: {
type: Date,
default: Date.now
},
user: {
type: Schema.ObjectId,
ref: 'User'
},
content: {
type:String,
default: ''
},
tags: {
type:[String],
default: {}
}
});
mongoose.model('Tfile', TfileSchema);
|
'use strict';
// event
// eventType - 'dragStart', 'drag', 'dragStop'
// pos - absolute pos,
// returnCallback
var app = angular.module('utilsDrag', []);
app.directive('utilsDrag', function ( ) {
return {
restrict: 'A',
scope:
{
dragCallback: '&utilsDrag'
},
replace: true,
controller: [ '$scope', '$rootScope', function ( $scope )
{
window.ud = $scope;
$scope.dragElement = U;
$scope.dragStartPosition = U;
$scope.returnCallback = function ()
{
$scope.dragElement.css( $scope.dragStartPosition );
}
}],
link: function ( scope, element )
{
var cursorTop = $(element).height() / 2;
var cursorLeft = $(element).width() / 2;
function getCursorPosition ( topLeft, event )
{
// console.log( 'event: ', event );
// var eventPos = getEventPos( event );
var x = event.pageX;
var y = event.pageY;
return { x: x, y: y };
}
$(element).draggable(
{
cursorAt:
{
top: cursorTop,
left: cursorLeft
},
start: function ( event, ui )
{
scope.dragElement = $(this);
scope.dragElement.css('pointer-events', 'none');
var startDragging = scope.dragCallback(
{
event: event,
eventType: 'dragStart',
pos: getCursorPosition( ui.position, event ),
returnCallback: scope.returnCallback
});
scope.dragStartPosition = ui.position;
},
drag: function( event, ui )
{
var drag = scope.dragCallback(
{
event: event,
eventType: 'drag',
pos: getCursorPosition( ui.position, event ),
returnCallback: scope.returnCallback
});
if ( drag )
return false;
},
stop: function ( event, ui )
{
var stopDragging = scope.dragCallback(
{
event: event,
eventType: 'dragStop',
pos: getCursorPosition( ui.position, event ),
returnCallback: scope.returnCallback
});
scope.dragElement.css('pointer-events', 'all');
}
});
}
};
});
|
/* jshint node: true */
'use strict';
var assign = require('object-assign');
module.exports = {
name: 'ember-cli-cloudinary-images',
config: function(environment, appConfig) {
var CLOUDINARY = appConfig.CLOUDINARY || {};
return {
CLOUDINARY: assign({
/** For future support */
API_KEY: '',
/** The user in Cloudinary */
CLOUD_NAME: '',
/** Used for private CDN or as for sub-domain for given domain */
SUB_DOMAIN: '',
/** The domain of the account if exists (default to shared domain of Cloudinary) */
DOMAIN: '',
/** Use HTTPs or HTTP. The default is HTTPs */
SECURE: true,
/** Use distributions CDN (example: https://res-[1-5].cloudinary.com) */
CDN_DISTRIBUTION: false,
/** Transforms for concatenation with given transforms */
CONCATENATED_TRANSFORMS: [],
/** Default transforms that can be override */
DEFAULT_TRANSFORMS: [],
/** Default images file extensions */
DEFAULT_IMAGE_FORMAT: 'jpg'
}, CLOUDINARY)
};
}
};
|
/* Magic Mirror Test config default weather
*
* By rejas
* MIT Licensed.
*/
let config = {
units: "imperial",
modules: [
{
module: "weather",
position: "bottom_bar",
config: {
type: "forecast",
location: "Munich",
mockData: '"#####WEATHERDATA#####"',
weatherEndpoint: "/forecast/daily",
decimalSymbol: "_"
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
module.exports = config;
}
|
/**
* Produces optimized XTemplates for chunks of tables to be
* used in grids, trees and other table based widgets.
*/
Ext.define('Ext.view.TableChunker', {
singleton: true,
requires: ['Ext.XTemplate'],
metaTableTpl: [
'{%if (this.openTableWrap)out.push(this.openTableWrap())%}',
'<table class="' + Ext.baseCSSPrefix + 'grid-table ' + Ext.baseCSSPrefix + 'grid-table-resizer" border="0" cellspacing="0" cellpadding="0" {[this.embedFullWidth(values)]}>',
'<tbody>',
'<tr class="' + Ext.baseCSSPrefix + 'grid-header-row">',
'<tpl for="columns">',
'<th class="' + Ext.baseCSSPrefix + 'grid-col-resizer-{id}" style="width: {width}px; height: 0px;"></th>',
'</tpl>',
'</tr>',
'{[this.openRows()]}',
'{row}',
'<tpl for="features">',
'{[this.embedFeature(values, parent, xindex, xcount)]}',
'</tpl>',
'{[this.closeRows()]}',
'</tbody>',
'</table>',
'{%if (this.closeTableWrap)out.push(this.closeTableWrap())%}'
],
constructor: function() {
Ext.XTemplate.prototype.recurse = function(values, reference) {
return this.apply(reference ? values[reference] : values);
};
},
embedFeature: function(values, parent, x, xcount) {
if (!values.disabled) {
return values.getFeatureTpl(values, parent, x, xcount);
}
return '';
},
embedFullWidth: function(values) {
var result = 'style="width:{fullWidth}px;';
// If there are no records, we need to give the table a height so that it
// is displayed and causes q scrollbar if the width exceeds the View's width.
if (!values.rowCount) {
result += 'height:1px;';
}
return result + '"';
},
openRows: function() {
return '<tpl for="rows">';
},
closeRows: function() {
return '</tpl>';
},
metaRowTpl: [
'<tr class="' + Ext.baseCSSPrefix + 'grid-row {[this.embedRowCls()]}" {[this.embedRowAttr()]}>',
'<tpl for="columns">',
'<td class="{cls} ' + Ext.baseCSSPrefix + 'grid-cell ' + Ext.baseCSSPrefix + 'grid-cell-{columnId} {{id}-modified} {{id}-tdCls} {[this.firstOrLastCls(xindex, xcount)]}" {{id}-tdAttr}>',
'<div {unselectableAttr} class="' + Ext.baseCSSPrefix + 'grid-cell-inner {unselectableCls}" style="text-align: {align}; {{id}-style};">{{id}}</div>',
'</td>',
'</tpl>',
'</tr>'
],
firstOrLastCls: function(xindex, xcount) {
var result = '';
if (xindex === 1) {
result = Ext.view.Table.prototype.firstCls;
}
if (xindex === xcount) {
result += ' ' + Ext.view.Table.prototype.lastCls;
}
return result;
},
embedRowCls: function() {
return '{rowCls}';
},
embedRowAttr: function() {
return '{rowAttr}';
},
openTableWrap: undefined,
closeTableWrap: undefined,
getTableTpl: function(cfg, textOnly) {
var me = this,
tpl,
tableTplMemberFns = {
openRows: me.openRows,
closeRows: me.closeRows,
embedFeature: me.embedFeature,
embedFullWidth: me.embedFullWidth,
openTableWrap: me.openTableWrap,
closeTableWrap: me.closeTableWrap
},
tplMemberFns = {},
features = cfg.features,
featureCount = features ? features.length : 0,
i = 0,
memberFns = {
embedRowCls: me.embedRowCls,
embedRowAttr: me.embedRowAttr,
firstOrLastCls: me.firstOrLastCls,
unselectableAttr: cfg.enableTextSelection ? '' : 'unselectable="on"',
unselectableCls: cfg.enableTextSelection ? '' : Ext.baseCSSPrefix + 'unselectable'
},
// copy the template spec array if there are Features which might mutate it
metaRowTpl = featureCount ? Array.prototype.slice.call(me.metaRowTpl, 0) : me.metaRowTpl;
for (; i < featureCount; i++) {
if (!features[i].disabled) {
features[i].mutateMetaRowTpl(metaRowTpl);
Ext.apply(memberFns, features[i].getMetaRowTplFragments());
Ext.apply(tplMemberFns, features[i].getFragmentTpl());
Ext.apply(tableTplMemberFns, features[i].getTableFragments());
}
}
cfg.row = new Ext.XTemplate(metaRowTpl.join(''), memberFns).applyTemplate(cfg);
tpl = new Ext.XTemplate(me.metaTableTpl.join(''), tableTplMemberFns).applyTemplate(cfg);
// TODO: Investigate eliminating.
if (!textOnly) {
tpl = new Ext.XTemplate(tpl, tplMemberFns);
}
return tpl;
}
});
|
///////////////
/// main.js //
/////////////
jQuery(function () {
var $ = jQuery;
// happy coding!
});
|
import {
collection
} from 'ember-cli-page-object';
export default {
scope: '.user__skills-list',
emptyState: {
scope: '[data-test-user-skills-list-empty-state]'
},
skills: collection('[data-test-user-skills-list-item]')
};
|
/** @module utils/nodes */
/**
* The default testnet node
*
* @type {string}
*/
let defaultTestnetNode = 'http://bob.nem.ninja:7778';
/**
* The default mainnet node
*
* @type {string}
*/
let defaultMainnetNode = 'http://alice6.nem.ninja:7778';
/**
* The default mijin node
*
* @type {string}
*/
let defaultMijinNode = '';
/**
* The default mainnet block explorer
*
* @type {string}
*/
let defaultMainnetExplorer = 'http://chain.nem.ninja/#/transfer/';
/**
* The default testnet block explorer
*
* @type {string}
*/
let defaultTestnetExplorer = 'http://bob.nem.ninja:8765/#/transfer/';
/**
* The default mijin block explorer
*
* @type {string}
*/
let defaultMijinExplorer = '';
/**
* The nodes allowing search by transaction hash on testnet
*
* @type {array}
*/
let testnetSearchNodes = [
{
'uri': 'http://bigalice2.nem.ninja:7890',
'location': 'America / New_York'
},
{
'uri': 'http://192.3.61.243:7890',
'location': 'America / Los_Angeles'
},
{
'uri': 'http://23.228.67.85:7890',
'location': 'America / Los_Angeles'
}
];
/**
* The nodes allowing search by transaction hash on mainnet
*
* @type {array}
*/
let mainnetSearchNodes = [
{
'uri': 'http://62.75.171.41:7890',
'location': 'Germany'
}, {
'uri': 'http://104.251.212.131:7890',
'location': 'USA'
}, {
'uri': 'http://45.124.65.125:7890',
'location': 'Hong Kong'
}, {
'uri': 'http://185.53.131.101:7890',
'location': 'Netherlands'
}, {
'uri': 'http://sz.nemchina.com:7890',
'location': 'China'
}
];
/**
* The nodes allowing search by transaction hash on mijin
*
* @type {array}
*/
let mijinSearchNodes = [
{
'uri': '',
'location': ''
}
];
/**
* The testnet nodes
*
* @type {array}
*/
let testnetNodes = [
{
uri: 'http://bob.nem.ninja:7778'
}, {
uri: 'http://104.128.226.60:7778'
}, {
uri: 'http://23.228.67.85:7778'
}, {
uri: 'http://192.3.61.243:7778'
}, {
uri: 'http://50.3.87.123:7778'
}, {
uri: 'http://localhost:7778'
}
];
/**
* The mainnet nodes
*
* @type {array}
*/
let mainnetNodes = [
{
uri: 'http://62.75.171.41:7778'
}, {
uri: 'http://san.nem.ninja:7778'
}, {
uri: 'http://go.nem.ninja:7778'
}, {
uri: 'http://hachi.nem.ninja:7778'
}, {
uri: 'http://jusan.nem.ninja:7778'
}, {
uri: 'http://nijuichi.nem.ninja:7778'
}, {
uri: 'http://alice2.nem.ninja:7778'
}, {
uri: 'http://alice3.nem.ninja:7778'
}, {
uri: 'http://alice4.nem.ninja:7778'
}, {
uri: 'http://alice5.nem.ninja:7778'
}, {
uri: 'http://alice6.nem.ninja:7778'
}, {
uri: 'http://alice7.nem.ninja:7778'
}, {
uri: 'http://localhost:7778'
}
];
/**
* The mijin nodes
*
* @type {array}
*/
let mijinNodes = [
{
uri: ''
}
];
/**
* The server verifying signed apostilles
*
* @type {string}
*/
let apostilleAuditServer = 'http://185.117.22.58:4567/verify';
module.exports = {
defaultTestnetNode,
defaultMainnetNode,
defaultMijinNode,
defaultMainnetExplorer,
defaultTestnetExplorer,
defaultMijinExplorer,
testnetSearchNodes,
mainnetSearchNodes,
mijinSearchNodes,
testnetNodes,
mainnetNodes,
mijinNodes,
apostilleAuditServer
}
|
/*
Copyright (c) 2011 Cimaron Shanahan
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.
*/
/**
* IR Instruction Class
*
* Represents a single assembly-like instruction
*/
function IrInstruction(op, d, s1, s2, s3) {
var args;
this.str = null;
this.line = null;
if (arguments.length == 1) {
args = op.split(/[\s,]/);
op = args[0];
d = args[1];
s1 = args[2];
s2 = args[3];
s3 = args[4];
}
this.op = op;
this.d = this.operand(d);
this.s1 = this.operand(s1);
this.s2 = this.operand(s2);
this.s3 = this.operand(s3);
}
IrInstruction.operands = ['d', 's1', 's2', 's3'];
/**
* Create operand for instruction
*
* @param mixed opr String or IrOperand
*
* @return mixed
*/
IrInstruction.prototype.operand = function(opr) {
if (!opr) {
return "";
}
if (opr instanceof IrOperand) {
return opr;
}
return new IrOperand(opr);
};
/**
* Adds the offset to all operands
*
* @param integer The offset to set
*/
IrInstruction.prototype.addOffset = function(offset) {
var i, o;
for (i = 0; i < IrInstruction.operands.length; i++) {
o = IrInstruction.operands[i];
if (this[o]) {
this[o].addOffset(offset);
}
}
};
/**
* Set the swizzle components on all operands
*
* @param string The swizzle to set
*/
IrInstruction.prototype.setSwizzle = function(swz) {
var i, o;
for (i = 0; i < IrInstruction.operands.length; i++) {
o = IrInstruction.operands[i];
if (this[o] && !this[o].swizzle) {
this[o].swizzle = swz;
}
}
};
/**
* toString method
*
* @return string
*/
IrInstruction.prototype.toString = function() {
var out;
out = util.format("%s%s%s%s%s;",
this.op,
this.d ? ' ' + this.d : '',
this.s1 ? ', ' + this.s1 : '',
this.s2 ? ', ' + this.s2 : '',
this.s3 ? ', ' + this.s3 : ''
);
return out;
};
/**
* IR Comment Class
*
* Represents a single comment
*/
function IrComment(comment, loc) {
this.comment = comment;
this.loc = loc;
}
IrComment.prototype.toString = function() {
var c = this.comment;
if (this.loc) {
c = util.format("%s [%s:%s-%s:%s]", c, this.loc.first_line, this.loc.first_column, this.loc.last_line, this.loc.last_column);
}
c = "\n# " + c;
return c;
};
/**
* IR Operand Class
*
* Represents a single operand
*/
function IrOperand(str, raw) {
this.full = "";
this.neg = "";
this.name = "";
this.address = "";
this.swizzle = "";
this.number = "";
this.raw = "";
this.index = "";
if (raw) {
this.full = str;
this.raw = str;
} else {
this.parse(str);
}
}
/**
* Parses operand string
*
* @param string string that represents a single variable
*/
IrOperand.prototype.parse = function(str) {
var parts, regex;
if (!str) {
return;
}
if (!isNaN(parseFloat(str))) {
this.raw = str;
return;
}
//neg
regex = "(\-)?";
//name (include '%' for our code substitution rules)
regex += "([\\w%]+)";
//number
regex += "(?:@(\\d+))?";
//index
regex += "(?:\\[(\\d+)\\])?";
//swizzle
regex += "(?:\\.([xyzw]+))?";
regex = new RegExp("^" + regex + "$");
if (parts = str.match(regex)) {
this.neg = parts[1] || "";
this.name = parts[2];
this.address = parseInt(parts[3]) || 0;
this.index = parseInt(parts[4]) || 0;
this.swizzle = parts[5] || "";
} else {
if (parts = str.match(/^"(.*)"$/)) {
this.raw = parts[1];
} else {
this.raw = str;
}
}
this.full = this.toString();
};
/**
* Adds an offset
*
* @param integer Offset to add
*/
IrOperand.prototype.addOffset = function(offset) {
this.address = this.address || 0;
this.address += offset;
};
/**
* Set components size if not already set
*/
IrOperand.prototype.makeSize = function(size) {
if (!this.swizzle) {
this.swizzle = "xyzw".substring(0, size);
} else if (this.swizzle.length != size) {
throw new Error(util.format("Cannot coerce operand to size %s", size));
}
};
/**
* toString method
*
* @return string
*/
IrOperand.prototype.toString = function() {
var str;
if (this.raw) {
str = this.raw;
} else {
str = this.neg + this.name + ("@" + this.address) + (this.index !== "" ? "[" + this.index + "]" : "") + (this.swizzle ? "." + this.swizzle : "");
}
return str;
};
|
/** @license MIT License (c) copyright B Cavalier & J Hann */
/**
* wire/on plugin
* wire plugin that provides an "on" facet to connect to dom events,
* and includes support for delegation
*
* wire is part of the cujo.js family of libraries (http://cujojs.com/)
*
* Licensed under the MIT License at:
* http://www.opensource.org/licenses/mit-license.php
*/
(function (define) {
define(['./lib/plugin-base/on', './lib/dom/base'], function (createOnPlugin, base) {
'use strict';
var contains;
/**
* Listens for dom events at the given node. If a selector is provided,
* events are filtered to only nodes matching the selector. Note, however,
* that children of the matching nodes can also fire events that bubble.
* To determine the matching node, use the event object's selectorTarget
* property instead of it's target property.
* @param node {HTMLElement} element at which to listen
* @param event {String} event name ('click', 'mouseenter')
* @param handler {Function} handler function with the following signature: function (e) {}
* @param [selector] {String} optional css query string to use to
* @return {Function} removes the event handler
*/
function on (node, event, handler /*, selector */) {
var selector = arguments[3];
if (selector) {
handler = filteringHandler(node, selector, handler);
}
node.addEventListener(event, handler, false);
return function remove () {
node.removeEventListener(node, handler, false);
};
}
on.wire$plugin = createOnPlugin({
on: on
});
if (document && document.compareDocumentPosition) {
contains = function w3cContains (refNode, testNode) {
return (refNode.compareDocumentPosition(testNode) & 16) == 16;
};
}
else {
contains = function oldContains (refNode, testNode) {
return refNode.contains(testNode);
};
}
return on;
/**
* This is a brute-force method of checking if an event target
* matches a query selector.
* @private
* @param node {Node}
* @param selector {String}
* @param handler {Function} function (e) {}
* @returns {Function} function (e) {}
*/
function filteringHandler (node, selector, handler) {
return function (e) {
var target, matches, i, len, match;
// if e.target matches the selector, call the handler
target = e.target;
matches = base.querySelectorAll(selector, node);
for (i = 0, len = matches.length; i < len; i++) {
match = matches[i];
if (target == match || contains(match, target)) {
e.selectorTarget = match;
return handler(e);
}
}
};
}
});
}(
typeof define == 'function' && define.amd
? define
: function (deps, factory) { module.exports = factory.apply(this, deps.map(require)); }
));
|
/* *
*
* (c) 2010-2019 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
/* globals Image, window */
/**
* Reference to the global SVGElement class as a workaround for a name conflict
* in the Highcharts namespace.
*
* @global
* @typedef {global.SVGElement} GlobalSVGElement
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGElement
*/
// glob is a temporary fix to allow our es-modules to work.
var glob = ( // @todo UMD variable named `window`, and glob named `win`
typeof win !== 'undefined' ?
win :
typeof window !== 'undefined' ?
window :
{}), doc = glob.document, SVG_NS = 'http://www.w3.org/2000/svg', userAgent = (glob.navigator && glob.navigator.userAgent) || '', svg = (doc &&
doc.createElementNS &&
!!doc.createElementNS(SVG_NS, 'svg').createSVGRect), isMS = /(edge|msie|trident)/i.test(userAgent) && !glob.opera, isFirefox = userAgent.indexOf('Firefox') !== -1, isChrome = userAgent.indexOf('Chrome') !== -1, hasBidiBug = (isFirefox &&
parseInt(userAgent.split('Firefox/')[1], 10) < 4 // issue #38
);
var H = {
product: 'Highcharts',
version: '8.0.0',
deg2rad: Math.PI * 2 / 360,
doc: doc,
hasBidiBug: hasBidiBug,
hasTouch: !!glob.TouchEvent,
isMS: isMS,
isWebKit: userAgent.indexOf('AppleWebKit') !== -1,
isFirefox: isFirefox,
isChrome: isChrome,
isSafari: !isChrome && userAgent.indexOf('Safari') !== -1,
isTouchDevice: /(Mobile|Android|Windows Phone)/.test(userAgent),
SVG_NS: SVG_NS,
chartCount: 0,
seriesTypes: {},
symbolSizes: {},
svg: svg,
win: glob,
marginNames: ['plotTop', 'marginRight', 'marginBottom', 'plotLeft'],
noop: function () { },
/**
* An array containing the current chart objects in the page. A chart's
* position in the array is preserved throughout the page's lifetime. When
* a chart is destroyed, the array item becomes `undefined`.
*
* @name Highcharts.charts
* @type {Array<Highcharts.Chart|undefined>}
*/
charts: [],
/**
* A hook for defining additional date format specifiers. New
* specifiers are defined as key-value pairs by using the
* specifier as key, and a function which takes the timestamp as
* value. This function returns the formatted portion of the
* date.
*
* @sample highcharts/global/dateformats/
* Adding support for week number
*
* @name Highcharts.dateFormats
* @type {Highcharts.Dictionary<Highcharts.TimeFormatCallbackFunction>}
*/
dateFormats: {}
};
export default H;
|
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.5.3(793ede49d53dba79d39e52205f16321278f5183c)
* Released under the MIT license
* https://github.com/Microsoft/vscode/blob/master/LICENSE.txt
*-----------------------------------------------------------*/
define("vs/base/common/worker/simpleWorker.nls.zh-cn", {
"vs/base/common/errors": [
"{0}。错误代码: {1}",
"权限被拒绝 (HTTP {0})",
"权限被拒绝",
"{0} (HTTP {1}: {2})",
"{0} (HTTP {1})",
"未知连接错误 ({0})",
"出现未知连接错误。您的 Internet 连接已断开,或者您连接的服务器已脱机。",
"{0}: {1}",
"出现未知错误。有关详细信息,请参阅日志。",
"发生了系统错误({0})",
"出现未知错误。有关详细信息,请参阅日志。",
"{0} 个(共 {1} 个错误)",
"出现未知错误。有关详细信息,请参阅日志。",
"未实施",
"非法参数: {0}",
"非法参数",
"非法状态: {0}",
"非法状态",
"无法加载需要的文件。您的 Internet 连接已断开,或者您连接的服务器已脱机。请刷新浏览器并重试。",
"未能加载所需文件。请重启应用程序重试。详细信息: {0}",
],
"vs/base/common/keyCodes": [
"Windows",
"控件",
"Shift",
"Alt",
"命令",
"Windows",
"Ctrl",
"Shift",
"Alt",
"命令",
"Windows",
],
"vs/base/common/severity": [
"错误",
"警告",
"信息",
]
});
|
/**
* Spacelet Manager, 2013 Spaceify Inc.
* SpaceletManager is a class for managing Spacelets and their processes. It launches spacelet processes, manages their quotas and access rights and terminates them when needed.
*
* @class SpaceletManager
*/
var fs = require("fs");
var fibrous = require("fibrous");
var Config = require("./config")();
var Utility = require("./utility");
var Language = require("./language");
var Application = require("./application");
var Database = require("./database");
var DockerContainer = require("./dockercontainer");
function SpaceletManager()
{
var self = this;
var applications = Object();
var ordinal = 0;
var database = new Database();
var isStarting = false;
var delayedStart = [];
self.start = function(unique_name, callback)
{
var application = null;
if(isStarting) // Start one application at a time - retain call order
delayedStart.push({"unique_name": unique_name, "callback": callback});
else
{
isStarting = true;
try {
var build_application = self.find(applications, "unique_name", unique_name); // Application by this unique name alredy build?
// SHARE SPACELET OR START A NEW
//if(!build_application || (build_application && !build_application.isShared())) // 'No' OR 'yes and is not shared' -> add the build application to the applications
// {
// application = self.build.sync(unique_name);
// add(application);
// }
//else if(build_application && build_application.isShared()) // 'Yes and is shared' -> use the existing application
// application = build_application;
// SPACELETS ARE NOW SHARED BY DEFAULT - CREATE IF SPACELET DOESN'T EXIST
if(!build_application)
{
application = self.build.sync(unique_name);
add(application);
}
else
application = build_application;
// START APPLICATION
run.sync(application);
if(!application.isInitialized())
throw Utility.error(Language.E_SPACELET_FAILED_INIT_ITSELF.p("SpaceletManager::start()"));
callback(null, application);
}
catch(err)
{
callback(Utility.error(err), null);
}
isStarting = false;
if(delayedStart.length != 0) // Start next application?
{
var sp = delayedStart.splice(0, 1);
self.start(sp[0].unique_name, sp[0].callback);
}
}
}
self.build = fibrous( function(unique_name)
{
var application = null;
var _applications = null;
try {
database.open(Config.SPACEIFY_DATABASE_FILE);
if(unique_name) // Build one application
_applications = [database.sync.getApplication(unique_name)];
else // Build all applications
_applications = database.sync.getApplication([Config.SPACELET], true);
for(var i=0; i<_applications.length; i++)
{
if((manifest = Utility.sync.loadManifest(Config.SPACELETS_PATH + _applications[i].unique_directory + Config.VOLUME_DIRECTORY + Config.APPLICATION_DIRECTORY + Config.MANIFEST, true)) == null)
throw Utility.error(Language.E_FAILED_TO_READ_SPACELET_MANIFEST.p("SpaceletManager::build()"));
application = self.find("unique_name", manifest.unique_name); // Don't create/add existing application
if(application) continue;
application = new Application.obj(manifest);
application.setDockerImageId(_applications[i].docker_image_id);
add(application);
}
}
catch(err)
{
throw Utility.error(err);
}
finally
{
database.close();
}
return application;
} );
var run = fibrous( function(application)
{
// Start the application in a Docker container
try {
if(application.isRunning()) // Return ports if already running ([] = not running and has no ports)
return application.getServices();
var volumes = {};
volumes[Config.VOLUME_PATH] = {};
volumes[Config.API_PATH] = {};
var binds = [Config.SPACELETS_PATH + application.getUniqueDirectory() + Config.VOLUME_DIRECTORY + ":" + Config.VOLUME_PATH + ":rw",
Config.SPACEIFY_CODE_PATH + ":" + Config.API_PATH + ":r"];
var dockerContainer = new DockerContainer();
application.setDockerContainer(dockerContainer);
dockerContainer.sync.startContainer(application.getProvidesServicesCount(), application.getDockerImageId(), volumes, binds);
application.makeServices(dockerContainer.getPublicPorts(), dockerContainer.getIpAddress());
dockerContainer.sync.runApplication(application);
application.setRunning(true);
return application.getServices();
}
catch(err)
{
throw Utility.error(Language.E_SPACELET_FAILED_RUN.p("SpaceletManager::run()"), err);
}
});
self.stop = fibrous( function(application)
{
if(typeof application == "string")
application = self.find("unique_name", application);
if((dockerContainer = application.getDockerContainer()) != null)
dockerContainer.sync.stopContainer(application);
application.setRunning(false);
});
var add = function(application)
{
application.setOrdinal(++ordinal);
applications[ordinal] = application;
}
self.remove = function(application)
{
if(typeof application == "string")
application = self.find("unique_name", application);
for(i in applications)
{
if(application.getOrdinal() == applications[i].getOrdinal())
{
self.sync.stop(applications[i]);
delete applications[i];
break;
}
}
}
self.removeAll = fibrous( function()
{
for(i in applications)
self.sync.stop(applications[i]);
});
self.isRunning = function(unique_name)
{
var application = self.find("unique_name", unique_name);
return (application ? application.isRunning() : false);
}
self.find = function(_param, _find)
{ // Find based on _param and _find object
return Application.inst.find(applications, _param, _find);
}
self.initialized = function(application, success)
{
application.setInitialized(success);
if((dc = application.getDockerContainer()) != null)
dc.sendClientReadyToStdIn();
}
}
module.exports = SpaceletManager;
|
import React, { Component } from 'react';
import {DataTable} from 'datatables.net-responsive-bs';
const settingsMock = {
header: 'Test Header'
};
describe('DataTables component', () => {
class mock extends Component {}
var comp = new mock(settingsMock);
it('Should have props', () => {
expect(comp.props.header).toEqual('Test Header');
});
});
|
var util = require('util');
var async = require('async');
var path = require('path');
var Router = require('../utils/router.js');
var sandboxHelper = require('../utils/sandbox.js');
// Private fields
var modules, library, self, private = {}, shared = {};
private.loaded = false
// Constructor
function Server(cb, scope) {
library = scope;
self = this;
self.__private = private;
private.attachApi();
setImmediate(cb, null, self);
}
// Private methods
private.attachApi = function() {
var router = new Router();
router.use(function (req, res, next) {
if (modules) return next();
res.status(500).send({success: false, error: "Blockchain is loading"});
});
router.get('/', function (req, res) {
if (private.loaded) {
res.render('wallet.html', {layout: false});
} else {
res.render('index.html');
}
});
router.get('/dapps/:id', function (req, res) {
res.render('dapps/' + req.params.id + '/index.html');
});
router.use(function (req, res, next) {
if (req.url.indexOf('/api/') == -1 && req.url.indexOf('/peer/') == -1) {
return res.redirect('/');
}
next();
// res.status(500).send({ success: false, error: 'api not found' });
});
library.network.app.use('/', router);
}
// Public methods
Server.prototype.sandboxApi = function (call, args, cb) {
sandboxHelper.callMethod(shared, call, args, cb);
}
// Events
Server.prototype.onBind = function (scope) {
modules = scope;
}
Server.prototype.onBlockchainReady = function () {
private.loaded = true;
}
Server.prototype.cleanup = function (cb) {
private.loaded = false;
cb();
}
// Shared
// Export
module.exports = Server;
|
(function(global) {
// simplified version of Object.assign for es3
function assign() {
var result = {};
for (var i = 0, len = arguments.length; i < len; i++) {
var arg = arguments[i];
for (var prop in arg) {
result[prop] = arg[prop];
}
}
return result;
}
var sjsPaths = {};
if (typeof systemJsPaths !== "undefined") {
sjsPaths = systemJsPaths;
}
System.config({
transpiler: 'plugin-babel',
defaultExtension: 'js',
paths: assign({
// paths serve as alias
"npm:": "https://unpkg.com/",
}, sjsPaths),
map: assign(
{
// css plugin
'css': 'npm:systemjs-plugin-css/css.js',
// babel transpiler
'plugin-babel': 'npm:systemjs-plugin-babel@0.0.25/plugin-babel.js',
'systemjs-babel-build': 'npm:systemjs-plugin-babel@0.0.25/systemjs-babel-browser.js',
// react
react: 'npm:react@16.12.0',
'react-dom': 'npm:react-dom@16.12.0',
'react-dom-factories': 'npm:react-dom-factories',
redux: 'npm:redux@3.6.0',
'react-redux': 'npm:react-redux@5.0.6',
'prop-types': 'npm:prop-types',
lodash: 'npm:lodash@4.17.15',
app: 'app'
},
systemJsMap
), // systemJsMap comes from index.html
packages: {
react: {
main: './umd/react.production.min.js'
},
'react-dom': {
main: './umd/react-dom.production.min.js'
},
'prop-types': {
main: './prop-types.min.js',
defaultExtension: 'js'
},
redux: {
main: './dist/redux.min.js',
defaultExtension: 'js'
},
'react-redux': {
main: './dist/react-redux.min.js',
defaultExtension: 'js'
},
app: {
defaultExtension: 'jsx'
},
'ag-charts-react': {
main: './main.js',
defaultExtension: 'js'
}
},
meta: {
'*.jsx': {
babelOptions: {
react: true
}
},
'*.css': { loader: 'css' }
}
});
})(this);
|
import Coordinator from '../models/coordinator';
export default {
name: "setup coordinator",
initialize: function() {
let app = arguments[1] || arguments[0];
app.register("drag:coordinator",Coordinator);
app.inject("component","coordinator","drag:coordinator");
}
};
|
/*-- Addition for remembering expanded state of pages --*/
function writeSessionCookie(cookieName, cookieValue) {
document.cookie = escape(cookieName) + "=" + escape(cookieValue) + ";";
}
function toggle_viewers() {
if (document.add.visibility.value == 'private') {
document.getElementById('viewers').style.display = 'block';
} else if (document.add.visibility.value == 'registered') {
document.getElementById('viewers').style.display = 'block';
} else {
document.getElementById('viewers').style.display = 'none';
}
}
function toggle_visibility(id) {
if (document.getElementById(id).style.display == "block") {
document.getElementById(id).style.display = "none";
writeSessionCookie(id, "0");//Addition for remembering expanded state of pages
} else {
document.getElementById(id).style.display = "block";
writeSessionCookie(id, "1");//Addition for remembering expanded state of pages
}
}
var plus = new Image;
plus.src = THEME_URL + "/images/expand.png";
var minus = new Image;
minus.src = THEME_URL + "/images/collapse.png";
function toggle_plus_minus(id) {
var img_src = document.images['plus_minus_' + id].src;
if (img_src == plus.src) {
document.images['plus_minus_' + id].src = minus.src;
} else {
document.images['plus_minus_' + id].src = plus.src;
}
}
if (typeof jQuery != 'undefined') {
jQuery(document).ready(function ($) {
// fix for Flat Theme
$('div.pages_list table td').css('padding-top', 0).css('padding-bottom', 0);
$('table.pages_view tbody tr td').css('line-height', '12px');
//$('table.pages_view tbody tr td.list_menu_title').css('width','300px');
//$('table.pages_view tbody tr td.list_page_id').css('width','68px');
//$('td.header_list_page_id').css('width','60px').next('td').css('width','78px');
});
}
|
/*
* Copyright (C) 2014 rafa
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
function fNotaRoutes() {
// Path.map("#/nota").to(function () {
// $('#indexContenidoJsp').spinner();
// control('nota').list($('#indexContenido'), param().defaultizeUrlObjectParameters({}), null);
// //notaControl.modalListEventsLoading(notaObject, notaView, $('#indexContenido'), param().defaultizeUrlObjectParameters({}), null);
// $('#indexContenidoJsp').empty();
// return false;
// });
Path.map("#/nota").to(function () {
$('#indexContenidoJsp').spinner();
oNotaControl.list($('#indexContenido'), param().defaultizeUrlObjectParameters({}), null, oNotaModel, oNotaView);
//notaControl.modalListEventsLoading(notaObject, notaView, $('#indexContenido'), param().defaultizeUrlObjectParameters({}), null);
$('#indexContenidoJsp').empty();
//$('#indexContenidoJsp').append(oNotaControl.getClassNameNota());
return false;
});
Path.map("#/nota/list/:url").to(function () {
$('#indexContenidoJsp').spinner();
var paramsObject = param().defaultizeUrlObjectParameters(param().getUrlObjectFromUrlString(this.params['url']));
oNotaControl.list($('#indexContenido'), paramsObject, null, oNotaModel, oNotaView);
$('#indexContenidoJsp').empty();
return false;
});
Path.map("#/nota/view/:id").to(function () {
$('#indexContenidoJsp').spinner();
var paramsObject = param().defaultizeUrlObjectParameters(param().getUrlObjectFromUrlString(this.params['url']));
oNotaControl.view($('#indexContenido'), paramsObject['id'], oNotaModel, oNotaView);
$('#indexContenidoJsp').empty();
return false;
});
Path.map("#/nota/edit/:id").to(function () {
$('#indexContenidoJsp').spinner();
var paramsObject = param().defaultizeUrlObjectParameters(param().getUrlObjectFromUrlString(this.params['url']));
oNotaControl.edit($('#indexContenido'), paramsObject['id'], oNotaModel, oNotaView);
$('#indexContenidoJsp').empty();
});
Path.map("#/nota/new").to(function () {
$('#indexContenidoJsp').spinner();
//var paramsObject = param().defaultizeUrlObjectParameters(param().getUrlObjectFromUrlString(this.params['url']));
oNotaControl.new($('#indexContenido'), null, oNotaModel, oNotaView);
$('#indexContenidoJsp').empty();
return false;
});
Path.map("#/nota/new/:url").to(function () {
$('#indexContenidoJsp').spinner();
var paramsObject = param().defaultizeUrlObjectParameters(param().getUrlObjectFromUrlString(this.params['url']));
oNotaControl.new($('#indexContenido'), paramsObject, oNotaModel, oNotaView);
$('#indexContenidoJsp').empty();
return false;
});
Path.map("#/nota/remove/:id").to(function () {
$('#indexContenidoJsp').spinner();
var paramsObject = param().defaultizeUrlObjectParameters(param().getUrlObjectFromUrlString(this.params['url']));
oNotaControl.remove($('#indexContenido'), paramsObject['id'], oNotaModel, oNotaView);
$('#indexContenidoJsp').empty();
return false;
});
}
|
var searchData=
[
['takeaction',['takeAction',['../classBasicStar.html#aadca2b88ce5766a1a6cd95accbb72bfb',1,'BasicStar::takeAction()'],['../classMovingStar.html#a273dfe02f9eab1148da09619e34480e9',1,'MovingStar::takeAction()']]],
['touches',['touches',['../classPlayer.html#ab6c3ad981fd782f3b59fe19d66bc15d8',1,'Player']]]
];
|
var ZTMenu = function(boxTimer, xOffset, yOffset, smartBoxSuffix, smartBoxClose, isub, xduration, xtransition)
{
var smartBoxes = $(document.body).getElements('[id$=' + smartBoxSuffix + ']');
var closeElem = $(document.body).getElements('.' + smartBoxClose);
var closeBoxes = function() { smartBoxes.setStyle('display', 'none'); };
closeElem.addEvent('click', function(){ closeBoxes() });
var closeBoxesTimer = 0;
var fx = Array();
var h = Array();
var w = Array();
smartBoxes.each(function(item, i)
{
var currentBox = item.getProperty('id');
currentBox = currentBox.replace('' + smartBoxSuffix + '', '');
fx[i] = new Fx.Elements(item.getChildren(), {wait: false, duration: xduration, transition: xtransition,
onComplete: function(){item.setStyle('overflow', '');}});
$(currentBox).addEvent('mouseleave', function(){
item.setStyle('overflow', 'hidden');
fx[i].start({
'0':{
'opacity': [1, 0],
'height': [h[i], 0]
}
});
closeBoxesTimer = closeBoxes.delay(boxTimer);
});
item.addEvent('mouseleave', function(){
closeBoxesTimer = closeBoxes.delay(boxTimer);
});
$(currentBox).addEvent('mouseenter', function(){
if($defined(closeBoxesTimer)) $clear(closeBoxesTimer);
});
item.addEvent('mouseenter', function(){
if($defined(closeBoxesTimer)) $clear(closeBoxesTimer);
});
item.setStyle('margin', '0');
$(currentBox).addEvent('mouseenter', function()
{
smartBoxes.setStyle('display', 'none');
item.setStyles({ display: 'block', position: 'absolute' });
var WindowX = window.getWidth();
var boxSize = item.getSize();
var inputPOS = $(currentBox).getCoordinates();
var inputCOOR = $(currentBox).getPosition();
var inputSize = $(currentBox).getSize();
var inputBottomPOS = inputPOS.top + inputSize.y;
var inputBottomPOSAdjust = inputBottomPOS - window.getScrollHeight();
var inputLeftPOS = inputPOS.left + xOffset;
var inputRightPOS = inputPOS.right;
var leftOffset = inputCOOR.x + xOffset;
if(item.getProperty('id').split("_")[2] == 'sub0') {
item.setStyle('top', inputBottomPOS);
if((inputLeftPOS + boxSize.x - WindowX) < 0) { item.setStyle('left', leftOffset - 10); }
else{ item.setStyle('left', (inputPOS.right - boxSize.x) - xOffset + 10); };
} else {
if((inputLeftPOS + boxSize.x + inputSize.x - WindowX) < 0) {
var space = inputLeftPOS - boxSize.x - inputSize.x;
var left = (space > inputSize.x) ? space : inputSize.x;
item.setStyle('left', left);
} else {
var space = WindowX - inputLeftPOS - inputSize.x/2;
var right = (space > inputSize.x) ? space : inputSize.x;
item.setStyle('right', right);
};
}
if(h[i] == null){ h[i] = boxSize.y; };
fx[i].start({
'0':{
'opacity': [0, 1],
'height': [0, h[i]]
}
});
});
});
};
window.addEvent("domready", function(){
$$('ul#menusys_mega li').each(function(li, i){
li.addEvent('mouseleave', function(){li.removeClass('hover');});
li.addEvent('mouseenter', function(){li.addClass('hover');});
});
});
|
/*
*
*/
Ext.define("core.cbf.model.CbfModel",{
extend:"Ext.data.Model",
fields:[
{name:"id",type:"int",srotable:false},
{name:"cbfbm",type:"string",srotable:false},
{name:"cbflx",type:"char",srotable:false},
{name:"cbfmc",type:"string",srotable:false},
{name:"cbfxb",type:"char",srotable:false},
{name:"cbfmz",type:"string",srotable:false},
{name:"cbfzjlx",type:"char",srotable:false},
{name:"cbfzjhm",type:"string",srotable:false},
{name:"cbfdz",type:"string",srotable:false},
{name:"yzbm",type:"string",srotable:false},
{name:"lxdh",type:"string",srotable:false},
{name:"cbfcysl",type:"int",srotable:false},
{name:"cbfdcrq",type:"date",srotable:false},
{name:"cbfdcy",type:"string",srotable:false},
{name:"cbfdcjs",type:"string",srotable:false},
{name:"gsjs",type:"string",srotable:false},
{name:"gsjsr",type:"string",srotable:false},
{name:"gsshrq",type:"string",srotable:false}, //date
{name:"gsshr",type:"string",srotable:false}
]
});
|
require("../mapper").define("priority", "priority-view-model", {
"id": "_id",
name: "name",
order: "order",
colour: "colour"
});
require("../mapper").define("priority-view-model", "priority", {
"_id": "id",
name: "name",
order: "order",
colour: "colour"
});
|
function enter(pi) {
pi.warp(926110401, 0); //next
return(true);
}
|
var searchData=
[
['nullvalue',['nullValue',['../namespaceJson.html#a7d654b75c16a57007925868e38212b4ea7d9899633b4409bd3fc107e6737f8391',1,'Json']]],
['numberofcommentplacement',['numberOfCommentPlacement',['../namespaceJson.html#a4fc417c23905b2ae9e2c47d197a45351abcbd3eb00417335e094e4a03379659b5',1,'Json']]]
];
|
define(
"dojo/cldr/nls/zh-hk/gregorian", //begin v1.x content
{
"months-standAlone-narrow": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12"
],
"quarters-format-wide": [
"第1季",
"第2季",
"第3季",
"第4季"
],
"eraAbbr": [
"西元前",
"西元"
],
"dateFormat-medium": "yyyy/M/d",
"dateFormat-short": "y/M/d",
"timeFormat-full": "zzzzah時mm分ss秒",
"timeFormat-long": "zah時mm分ss秒",
"dateFormatItem-Ed": "d日(E)",
"dateFormatItem-h": "ah時",
"dateFormatItem-H": "H時",
"dateFormatItem-Md": "M/d",
"dateFormatItem-MEd": "M/d(E)",
"dateFormatItem-yM": "y/M",
"dateFormatItem-yMd": "y/M/d",
"dateFormatItem-yMEd": "y/M/d(E)",
"field-era": "年代",
"field-week": "週",
"field-weekday": "週天",
"field-hour": "小時",
"field-minute": "分鐘",
"field-second": "秒",
"field-zone": "時區",
"dateFormatItem-MMdd": "MM/dd",
"field-month-relative+-1": "上個月",
"field-month-relative+1": "下個月",
"field-week-relative+-1": "上週",
"field-week-relative+0": "本週",
"field-week-relative+1": "下週",
"field-day-relative+2": "後天",
"quarters-format-abbr": [
"第1季",
"第2季",
"第3季",
"第4季"
],
"quarters-standAlone-abbr": [
"第1季",
"第2季",
"第3季",
"第4季"
],
"quarters-standAlone-wide": [
"第1季",
"第2季",
"第3季",
"第4季"
],
"eraNames": [
"西元前",
"西元"
],
"eraNarrow": [
"西元前",
"西元"
]
}
//end v1.x content
);
|
require({cache:{
'url:dijit/templates/CheckedMenuItem.html':"<tr class=\"dijitReset dijitMenuItem\" data-dojo-attach-point=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" data-dojo-attach-point=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">✓</span>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" data-dojo-attach-point=\"containerNode,labelNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" data-dojo-attach-point=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\"> </td>\n</tr>\n"}});
define("dijit/CheckedMenuItem", [
"dojo/_base/declare", // declare
"dojo/dom-class", // domClass.toggle
"./MenuItem",
"dojo/text!./templates/CheckedMenuItem.html",
"./hccss"
], function(declare, domClass, MenuItem, template){
// module:
// dijit/CheckedMenuItem
return declare("dijit.CheckedMenuItem", MenuItem, {
// summary:
// A checkbox-like menu item for toggling on and off
templateString: template,
// checked: Boolean
// Our checked state
checked: false,
_setCheckedAttr: function(/*Boolean*/ checked){
// summary:
// Hook so attr('checked', bool) works.
// Sets the class and state for the check box.
domClass.toggle(this.domNode, "dijitCheckedMenuItemChecked", checked);
this.domNode.setAttribute("aria-checked", checked ? "true" : "false");
this._set("checked", checked);
},
iconClass: "", // override dijitNoIcon
onChange: function(/*Boolean*/ /*===== checked =====*/){
// summary:
// User defined function to handle check/uncheck events
// tags:
// callback
},
_onClick: function(evt){
// summary:
// Clicking this item just toggles its state
// tags:
// private
if(!this.disabled){
this.set("checked", !this.checked);
this.onChange(this.checked);
}
this.onClick(evt);
}
});
});
|
import BasisDrawerCloseZone from './_drawer-close-zone.js';
import BasisDrawer from './_drawer.js';
import BasisHamburgerBtn from './_hamburger-btn.js';
import BasisNavbar from './_navbar.js';
import BasisPageEffect from './_page-effect.js';
document.addEventListener(
'DOMContentLoaded',
() => {
new BasisDrawerCloseZone();
new BasisDrawer({drawer: '.c-drawer'});
new BasisDrawer({drawer: '.c-dropdown'});
new BasisHamburgerBtn();
new BasisNavbar();
new BasisPageEffect();
},
false
);
|
FusionCharts.ready(function () {
var salesChart = new FusionCharts({
type: 'bulb',
renderAt: 'chart-container',
id: 'myChart',
width: '200',
height: '200',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Temperature status of deep freezers",
"upperlimit": "-5",
"lowerlimit": "-60",
"captionPadding":"30",
"showshadow":"0",
"showvalue": "1",
"useColorNameAsValue":"1",
"placeValuesInside":"1",
"valueFontSize": "16",
//Cosmetics
"baseFontColor" : "#333333",
"baseFont" : "Helvetica Neue,Arial",
"captionFontSize" : "14",
"showborder": "0",
"bgcolor": "#FFFFFF",
"toolTipColor" : "#ffffff",
"toolTipBorderThickness" : "0",
"toolTipBgColor" : "#000000",
"toolTipBgAlpha" : "80",
"toolTipBorderRadius" : "2",
"toolTipPadding" : "5",
},
"colorrange": {
"color": [
{
"minvalue": "-60",
"maxvalue": "-35",
"label": "Problem detected!",
"code": "#ff0000"
},
{
"minvalue": "-35",
"maxvalue": "-25",
"label": "Alert!",
"code": "#ff9900"
},
{
"minvalue": "-25",
"maxvalue": "-5",
"label": "All well!",
"code": "#00ff00"
}
]
},
"value": "-5"
},
"events":{
"rendered": function(evtObj, argObj){
setInterval(function () {
var num = (Math.floor(Math.random() * 55)*-1) -5;
FusionCharts("myChart").feedData("&value=" + num);
}, 10000);
}
}
});
salesChart.render();
});
|
define(
({
showLayerLabels: "Εμφάνιση των ονομάτων των θεματικών επιπέδων στο widget για χωρο-χρονικά θεματικά επίπεδα."
})
);
|
var nextTick = null;
if (process) {
if ('nextTick' in process) {
nextTick = process.nextTick;
if (typeof module !== 'undefined') {
if ('exports' in module)
module.exports = Array;
}
}
}
if (!nextTick) {
// For support general browser, using setTimeout instead of process.nextTick
nextTick = function(func) {
setTimeout(func, 0);
};
}
var forEachAsync = function(callback, complete) {
var self = this;
function next(index, length) {
var self = this;
if (index >= length) {
if (complete)
complete.apply(this, [ true ]);
return;
}
function _next(stop) {
if (stop === false) {
if (complete)
complete.apply(this, [ false ]);
return;
}
nextTick(function() {
if (ret === false) {
if (complete)
complete.apply(this, [ false ]);
return;
}
next.apply(self, [ index + 1, length ]);
});
}
var ret = callback.apply(self, [ self[index], index, self, _next ]);
if (ret != true)
_next();
}
next.apply(self, [ 0, self.length ]);
};
if (!Array.prototype.forEachAsync)
Object.defineProperty(Array.prototype, 'forEachAsync', { value: forEachAsync });
var parallel = function(workerNumber, callback, complete) {
if (!callback)
return;
var self = this;
var completed = 0;
var total = self.length;
var workerCount = 0;
var currentIndex = 0;
if (total == 0) {
if (complete)
complete();
return;
}
function _complete() {
completed++;
workerCount--;
if (workerCount == 0 && completed >= total) {
if (complete)
complete();
} else {
// Next item
nextTick(function() {
currentIndex++;
_parallel(currentIndex);
});
}
}
function _parallel(index) {
if (index >= total)
return;
if (workerCount < workerNumber) {
workerCount++;
if (workerCount < workerNumber) {
// New worker
nextTick(function() {
currentIndex++;
_parallel(currentIndex);
});
}
// Customized callback function
callback(self[index], index, self, _complete);
} else {
nextTick(function() {
_parallel(index);
});
}
}
_parallel(currentIndex);
}
if (!Array.prototype.parallel)
Object.defineProperty(Array.prototype, 'parallel', { value: parallel });
|
function defined (constant_name) {
// http://kevin.vanzonneveld.net
// + original by: Waldo Malqui Silva
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + revised by: Brett Zamir (http://brett-zamir.me)
// % note 1: Because this function can (albeit only temporarily) overwrite a global variable,
// % note 1: it is not thread-safe (normally not a concern for JavaScript, but would be if used
// % note 1: in a threaded environment, e.g., DOM worker threads)
// * example 1: defined('IMAGINARY_CONSTANT1');
// * returns 1: false
var tmp = this.window[constant_name];
this.window[constant_name] = this.window[constant_name] ? 'changed' + this.window[constant_name].toString() : 'changed';
var returnval = this.window[constant_name] === tmp;
if (!returnval) { // Reset
this.window[constant_name] = tmp;
}
return returnval;
}
|
var http = require('http');
var querystring = require('querystring');
var multipart = require('multipart');
function writeResponse(res, data) {
var total = 0;
for (fruit in data) {
total += Number(data[fruit]);
}
res.writeHead(200, "OK", {
"Content-Type": "text/html",
"Access-Control-Allow-Origin": "http://localhost"});
// res.write('<html><head><meta charset="UTF-8"><title>Sztuk razem</title></head><body>');
res.write("<?xml version='1.0'?>");
res.write("<fruitorder total='" + total + "'>");
for (fruit in data) {
res.write("<item name='" + fruit + "' quantity='" + data[fruit] + "'/>");
total += Number(data[fruit]);
}
res.write("</fruitorder>");
res.end();
}
http.createServer(function(req, res) {
console.log("[200] " + req.method + " to " + req.url);
if (req.method == 'OPTIONS') {
res.writeHead(200, "OK", {
"Access-Control-Allow-Headers": "Content-Type",
"Access-Control-Allow-Methods": "*",
"Access-Control-Allow-Origin": "*"
});
res.end();
} else if (req.url == "/form" && req.method == 'POST') {
var dataObj = new Object();
var contentType = req.headers["content-type"];
var fullBody = '';
if (contentType) {
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
req.on('data', function(chunk) {
fullBody += chunk.toString();
});
req.on('end', function() {
var dBody = querystring.parse(fullBody);
dataObj.bananas = dBody["bananas"];
dataObj.appless = dBody["apples"];
dataObj.cherries = dBody["cherries"];
writeResponse(res, dataObj);
});
} else if (contentType.indexOf("application/json") > -1) {
req.on('data', function(chunk) {
fullBody += chunk.toString();
});
req.on('end', function() {
dataObj = JSON.parse(fullBody);
writeResponse(res, dataObj);
});
} else if (contentType.indexOf("multipart/form-data") > -1) {
var partName;
var partType;
var parser = multipart.parser();
parser.boundary = "--" + req.headers["content-type"].substring(30);
parser.onpartbegin = function(part) {
partName = part.name;
partType = part.contentType
};
parser.ondata = function(data) {
if (partName != "file") {
dataObj[partName] = data;
}
};
req.on('data', function(chunk) {
parser.write(chunk);
});
req.on('end', function() {
writeResponse(res, dataObj);
});
}
}
}
}).listen(8080);
|
'use strict';
module.exports = function (grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required grunt tasks
require('jit-grunt')(grunt, {
lockfile: 'grunt-lock'
});
// Configurable paths
var config = {
sass_dir: 'bundle/Resources/sass/admin',
public_dir: 'bundle/Resources/public/admin'
};
// Define the configuration for all the tasks
grunt.initConfig({
// Project settings
config: config,
//Prevent multiple grunt instances
lockfile: {
grunt: {
path: 'grunt.lock'
}
},
// Watches files for changes and runs tasks based on the changed files
watch: {
gruntfile: {
files: ['Gruntfile.js'],
options: {
reload: true
}
},
sass: {
files: ['<%= config.sass_dir %>/{,*/}*.{scss,sass}'],
tasks: ['sass', 'postcss']
}
},
// Compiles Sass to CSS and generates necessary files if requested
sass: {
options: {
sourceMap: true,
sourceMapEmbed: true,
sourceMapContents: true,
includePaths: ['.']
},
dist: {
files: [{
expand: true,
cwd: '<%= config.sass_dir %>',
src: ['*.{scss,sass}'],
dest: '.tmp/css',
ext: '.css'
}]
}
},
postcss: {
options: {
map: true,
processors: [
// Add vendor prefixed styles
require('autoprefixer')({
browsers: ['> 1%', 'last 3 versions', 'Firefox ESR', 'Opera 12.1']
})
]
},
dist: {
files: [{
expand: true,
cwd: '.tmp/css/',
src: '{,*/}*.css',
dest: '<%= config.public_dir %>/css'
}]
}
}
});
grunt.registerTask('serve', 'Start the server and preview your app', function () {
grunt.task.run([
'lockfile',
'sass:dist',
'postcss',
'watch'
]);
});
grunt.registerTask('default', [
'serve'
]);
};
|
// +------------------------------------------------------------------+
// | ____ _ _ __ __ _ __ |
// | / ___| |__ ___ ___| | __ | \/ | |/ / |
// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
// | | |___| | | | __/ (__| < | | | | . \ |
// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
// | |
// | Copyright Mathias Kettner 2012 mk@mathias-kettner.de |
// +------------------------------------------------------------------+
//
// This file is part of Check_MK.
// The official homepage is at http://mathias-kettner.de/check_mk.
//
// check_mk is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation in version 2. check_mk is distributed
// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
// PARTICULAR PURPOSE. See the GNU General Public License for more de-
// ails. You should have received a copy of the GNU General Public
// License along with GNU Make; see the file COPYING. If not, write
// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
// Boston, MA 02110-1301 USA.
/* Disable data-ajax per default, as it makes problems in most
of our cases */
$(document).ready(function() {
$("a").attr("data-ajax", "false");
$("form").attr("data-ajax", "false");
$("div.error").addClass("ui-shadow");
$("div.success").addClass("ui-shadow");
$("div.really").addClass("ui-shadow");
$("div.warning").addClass("ui-shadow");
});
$(document).bind("mobileinit", function(){
$.mobile.ajaxEnabled = false;
$.mobile.hashListeningEnabled = false;
});
|
(function($) {
$.fn.extend({
stickyMojo: function(options) {
// Exit if there are no elements to avoid errors:
if (this.length === 0) {
return this;
}
var settings = $.extend({
'footerID': '',
'contentID': '',
'orientation': $(this).css('float')
}, options);
var sticky = {
'el': $(this),
'stickyLeft': $(settings.contentID).outerWidth() + $(settings.contentID).offset.left,
'stickyTop2': $(this).offset().top,
'stickyHeight': $(this).outerHeight(true),
'contentHeight': $(settings.contentID).outerHeight(true),
'win': $(window),
'breakPoint': $(this).outerWidth(true) + $(settings.contentID).outerWidth(true),
'marg': parseInt($(this).css('margin-top'), 10)
};
var errors = checkSettings();
cacheElements();
return this.each(function() {
buildSticky();
});
function buildSticky() {
if (!errors.length) {
sticky.el.css('left', sticky.stickyLeft);
sticky.win.bind({
'load': stick,
'scroll': stick,
'resize': function() {
sticky.el.css('left', sticky.stickyLeft);
stick();
}
});
} else {
if (console && console.warn) {
console.warn(errors);
} else {
alert(errors);
}
}
}
// Caches the footer and content elements into jquery objects
function cacheElements() {
settings.footerID = $(settings.footerID);
settings.contentID = $(settings.contentID);
}
// Calcualtes the limits top and bottom limits for the sidebar
function calculateLimits() {
return {
limit: settings.footerID.offset().top - sticky.stickyHeight,
windowTop: sticky.win.scrollTop(),
stickyTop: sticky.stickyTop2 - sticky.marg
}
}
// Sets sidebar to fixed position
function setFixedSidebar() {
sticky.el.css({
position: 'fixed',
top: 0
});
}
// Determines the sidebar orientation and sets margins accordingly
function checkOrientation() {
if (settings.orientation === "left") {
settings.contentID.css('margin-left', sticky.el.outerWidth(true));
} else {
sticky.el.css('margin-left', settings.contentID.outerWidth(true));
}
}
// sets sidebar to a static positioned element
function setStaticSidebar() {
sticky.el.css({
'position': 'static',
'margin-left': '0px'
});
settings.contentID.css('margin-left', '0px');
}
// initiated to stop the sidebar from intersecting the footer
function setLimitedSidebar(diff) {
sticky.el.css({
top: diff
});
}
//determines whether sidebar should stick and applies appropriate settings to make it stick
function stick() {
var tops = calculateLimits();
var hitBreakPoint = tops.stickyTop < tops.windowTop && (sticky.win.width() >= sticky.breakPoint);
if (hitBreakPoint) {
setFixedSidebar();
checkOrientation();
} else {
setStaticSidebar();
}
if (tops.limit < tops.windowTop) {
var diff = tops.limit - tops.windowTop;
setLimitedSidebar(diff);
}
}
// verifies that all settings are correct
function checkSettings() {
var errors = [];
for (var key in settings) {
if (!settings[key]) {
errors.push(settings[key]);
}
}
ieVersion() && errors.push("NO IE 7");
return errors;
}
function ieVersion() {
if(document.querySelector) {
return false;
}
else {
return true;
}
}
}
});
})(jQuery);
|
import { apiUrl } from '../../constants';
export default class DataService {
/** @ngInject */
constructor($http, $q) {
this.$http = $http;
this.$q = $q;
this.dataStore = {
categories: [],
providers: [],
resources: [],
services: [],
stages: [],
currentFilters: {
stages: [],
categories: [],
providers: [],
resources: []
}
};
}
getCategories() {
return getItems.bind(this)('categories');
}
createProvider (provider) {
return createItem.bind(this)(provider, 'providers');
}
deleteProvider (id) {
return deleteItem.bind(this)(id, 'providers');
}
getProvider(id) {
return getItem.bind(this)(id, 'providers');
}
getProviders() {
return getItems.bind(this)('providers');
}
updateProvider (provider) {
return updateItem.bind(this)(provider, 'providers');
}
createResource (resource) {
return createItem.bind(this)(resource, 'resources');
}
deleteResource (id) {
return deleteItem.bind(this)(id, 'resources');
}
getResource(id) {
return getItem.bind(this)(id, 'resources');
}
getResources() {
return getItems.bind(this)('resources');
}
updateResource (resource) {
return updateItem.bind(this)(resource, 'resources');
}
createService (service) {
return createItem.bind(this)(service, 'services');
}
deleteService(id) {
return deleteItem.bind(this)(id, 'services');
}
getService(id) {
return getItem.bind(this)(id, 'services');
}
getServices() {
return getItems.bind(this)('services');
}
updateService (service) {
return updateItem.bind(this)(service, 'services');
}
getStages() {
return getItems.bind(this)('stages');
}
resetCurrentFilters() {
return this.dataStore.currentFilters = {
stages: [],
categories: [],
providers: [],
resources: []
}
}
getNonEmptyFilters() {
const nonEmptyFilters = {};
if (this.dataStore.currentFilters.stages.length) {
nonEmptyFilters.stages = angular.copy(this.dataStore.currentFilters.stages);
}
if (this.dataStore.currentFilters.categories.length) {
nonEmptyFilters.categories = angular.copy(this.dataStore.currentFilters.categories);
}
if (this.dataStore.currentFilters.providers.length) {
nonEmptyFilters.providers = angular.copy(this.dataStore.currentFilters.providers);
}
if (this.dataStore.currentFilters.resources.length) {
nonEmptyFilters.resources = angular.copy(this.dataStore.currentFilters.resources);
}
return nonEmptyFilters;
}
}
function createItem (item, type) {
const deferred = this.$q.defer();
return this.$http.post(`${apiUrl}${type}`, item).then((response) => {
const location = response.headers().location;
const id = location.split(`/${type}/`).pop();
if (this.dataStore[type].length) {
item.id = id;
this.dataStore[type].push(item);
}
deferred.resolve(item.id);
return deferred.promise;
}, error => {
deferred.reject(error);
return deferred.promise;
});
}
function deleteItem (id, type) {
const deferred = this.$q.defer();
return this.$http.delete(`${apiUrl}${type}/${id}`).then(() => {
const index = this.dataStore[type].map((x) => {return x.id; }).indexOf(id);
this.dataStore[type].splice(index, 1);
deferred.resolve();
return deferred.promise;
}, error => {
deferred.reject(error);
return deferred.promise;
});
}
function getItem (id, type) {
const deferred = this.$q.defer();
const item = this.dataStore[type].filter(s => {
return s.id === id;
})[0];
if (item) {
deferred.resolve(item);
return deferred.promise;
}
return this.$http.get(`${apiUrl}${type}/${id}`).then(response => {
deferred.resolve(response.data);
return deferred.promise;
}, error => {
deferred.reject(error);
return deferred.promise;
});
}
function getItems (type) {
const deferred = this.$q.defer();
if (this.dataStore[type].length) {
deferred.resolve();
return deferred.promise;
}
return this.$http.get(`${apiUrl}${type}`).then(response => {
this.dataStore[type] = angular.copy(response.data._embedded[type]);
deferred.resolve();
return deferred.promise;
}, error => {
deferred.reject(error);
return deferred.promise;
});
}
function updateItem (item, type) {
const deferred = this.$q.defer();
return this.$http.put(`${apiUrl}${type}/${item.id}`, item).then(() => {
if (this.dataStore[type].length) {
const index = this.dataStore[type].map((x) => {return x.id; }).indexOf(item.id);
this.dataStore[type][index] = item;
}
deferred.resolve();
return deferred.promise;
}, error => {
deferred.reject(error);
return deferred.promise;
});
}
|
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// 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 Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
goog.setTestOnly();
goog.require('goog.testing.asserts');
// CommonJS-LoadFromFile: google-protobuf
goog.require('jspb.debug');
// CommonJS-LoadFromFile: test_pb
goog.require('proto.jspb.test.HasExtensions');
goog.require('proto.jspb.test.IsExtension');
goog.require('proto.jspb.test.Simple1');
describe('debugTest', function() {
it('testSimple1', function() {
if (COMPILED) {
return;
}
var message = new proto.jspb.test.Simple1();
message.setAString('foo');
assertObjectEquals({
$name: 'proto.jspb.test.Simple1',
'aString': 'foo',
'aRepeatedStringList': []
}, jspb.debug.dump(message));
message.setABoolean(true);
message.setARepeatedStringList(['1', '2']);
assertObjectEquals({
$name: 'proto.jspb.test.Simple1',
'aString': 'foo',
'aRepeatedStringList': ['1', '2'],
'aBoolean': true
}, jspb.debug.dump(message));
message.setAString(undefined);
assertObjectEquals({
$name: 'proto.jspb.test.Simple1',
'aRepeatedStringList': ['1', '2'],
'aBoolean': true
}, jspb.debug.dump(message));
});
it('testExtensions', function() {
if (COMPILED) {
return;
}
var extension = new proto.jspb.test.IsExtension();
extension.setExt1('ext1field');
var extendable = new proto.jspb.test.HasExtensions();
extendable.setStr1('v1');
extendable.setStr2('v2');
extendable.setStr3('v3');
extendable.setExtension(proto.jspb.test.IsExtension.extField, extension);
assertObjectEquals({
'$name': 'proto.jspb.test.HasExtensions',
'str1': 'v1',
'str2': 'v2',
'str3': 'v3',
'$extensions': {
'extField': {
'$name': 'proto.jspb.test.IsExtension',
'ext1': 'ext1field'
},
'repeatedSimpleList': []
}
}, jspb.debug.dump(extendable));
});
});
|
import classnames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
class SidebarItem extends React.Component {
static propTypes = {
baseClassName: PropTypes.string,
children: PropTypes.node,
modifier: PropTypes.string,
};
static defaultProps = {
baseClassName: 'sidebar__item',
};
render() {
const classes = classnames(this.props.baseClassName, {
[`${this.props.baseClassName}--${this.props.modifier}`]: this.props.modifier,
});
return <div className={classes}>{this.props.children}</div>;
}
}
export default SidebarItem;
|
/*
* @package jsDAV
* @subpackage DAV
* @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax DOT org>
* @author Mike de Boer <info AT mikedeboer DOT nl>
* @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
*/
"use strict";
var jsDAV_Ftp_Node = require("./node").jsDAV_Ftp_Node;
var jsDAV_iFile = require("./../iFile").jsDAV_iFile;
var Exc = require("./../exceptions");
var Util = require("./../util");
var Path = require("path");
function jsDAV_Ftp_File(path, ftp) {
this.path = path || "";
this.ftp = ftp;
}
exports.jsDAV_Ftp_File = jsDAV_Ftp_File;
(function() {
this.implement(jsDAV_iFile);
/**
* Creates or updates the data of this node
*
* @param {mixed} data
* @return void
*/
this.put = function(data, type, cbftpput) {
var path = this.path;
var ftp = this.ftp;
var cached = ftp.$cache[path];
if (cached && cached.$stat && cached.$stat.target)
path = Path.resolve(Path.dirname(path), cached.$stat.target);
if (!Buffer.isBuffer(data))
data = new Buffer(data, type || "binary");
ftp.put(path, data, function(err) {
if (err)
return cbftpput(err);
// @todo what about parent node's cache??
delete ftp.$cache[path];
cbftpput();
});
};
/**
* Returns the data
*
* @return Buffer
*/
this.get = function(cbftpfileget) {
var path = this.path;
var cached = this.ftp.$cache[path];
if (cached && cached.$stat && cached.$stat.target)
path = Path.resolve(Path.dirname(path), cached.$stat.target);
this.ftp.get(path, function(err, data) {
cbftpfileget(err, data);
});
};
/**
* Delete the current file
*
* @return void
*/
this["delete"] = function(cbftpfiledel) {
var self = this;
var path = this.path;
this.ftp.raw.dele(path, function(err){
if (err)
return cbftpfiledel(new Exc.jsDAV_Exception_FileNotFound(
"File " + path + " not found"));
delete self.ftp.$cache[path];
cbftpfiledel();
});
};
/**
* Returns the size of the node, in bytes
*
* @return int
*/
this.getSize = function(cbftpgetsize) {
var path = this.path;
var cached = this.ftp.$cache[path];
if (cached && cached.$stat) {
if (cached.$stat.target)
path = Path.resolve(Path.dirname(path), cached.$stat.target);
cbftpgetsize(null, cached.$stat.size);
}
else {
cbftpgetsize("The file '"+ path + "' was not cached and its information couldn't be determined");
}
};
/**
* Returns the ETag for a file
* An ETag is a unique identifier representing the current version of the file.
* If the file changes, the ETag MUST change.
* Return null if the ETag can not effectively be determined
*
* @return mixed
*/
this.getETag = function(cbftpgetetag) {
cbftpgetetag(null, null);
};
/**
* Returns the mime-type for a file
* If null is returned, we'll assume application/octet-stream
*
* @return mixed
*/
this.getContentType = function(cbftpmime) {
return cbftpmime(null, Util.mime.type(this.path));
};
}).call(jsDAV_Ftp_File.prototype = new jsDAV_Ftp_Node());
|
var path = require('path');
console.log(path.join(path.relative('.', __dirname),'include'));
|
WScript.Echo("** The end of copyright notices **");
function quote(arg) {
arg = arg.replace(/"/g, '""');
return '"' + arg + '"';
}
var app = WScript.Arguments(0);
var args = [];
for (var i = 1; i < WScript.Arguments.Count(); ++i) {
args.push(quote(WScript.Arguments(i)));
}
var shell = new ActiveXObject("WScript.Shell");
var cmd = quote(app) + " " + args.join(" ");
shell.run(cmd);
WScript.Sleep(200);
// attempt to activate the app.
// MSDN about Shell.AppActivate:
//
// "In determining which application to activate, the specified
// title is compared to the title string of each running
// application. If no exact match exists, any application whose
// title string begins with title is activated. If an application
// still cannot be found, any application whose title string ends
// with title is activated. If more than one instance of the
// application named by title exists, one instance is arbitrarily
// activated."
// taking a wild guess about the *title* of the window here:
var exename = app.replace(/^.*[\\\/]([^\\\/]+)$/, "$1").replace(/\.[^.]*$/, "");
shell.AppActivate(exename);
|
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'Magento_Ui/js/form/components/fieldset',
'Magento_Catalog/js/components/visible-on-option/strategy'
], function (Fieldset, strategy) {
'use strict';
return Fieldset.extend(strategy).extend(
{
defaults: {
openOnShow: true
},
/**
* Toggle visibility state.
*/
toggleVisibility: function () {
this._super();
if (this.openOnShow) {
this.opened(this.inverseVisibility ? !this.isShown : this.isShown);
}
}
}
);
});
|
module.exports.parse = function ( arr, obj ) {
obj = obj || {};
for ( var i = 0; i < arr.length; ++i ) {
var val = arr[i];
var matches = val.match( /^-(\w+):("?)([^"]+)\2$/ );
if ( matches ) {
obj[matches[1]] = matches[3];
}
}
return obj;
};
|
import filterReducer from "../filters";
describe("store/reducers/ui/filters", () => {
it("should return the initial state", () => {
const state = filterReducer(undefined, { type: "SOME_ACTION" });
expect(state).toEqual({ project: {} });
});
it("should set the project filter correctly", () => {
const action = {
type: "SET_PROJECT_FILTERS",
payload: { published: true }
};
const state = filterReducer({}, action);
expect(state).toEqual({ project: { published: true } });
});
});
|
/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.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.gnu.org/licenses/gpl-3.0.txt
*
* 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.
*/
/**
* brief description of file
*
* @author Tom Murtagh
* @author Kim Jackson
* @author Ian Johnson <ian.johnson@sydney.edu.au>
* @author Stephen White <stephen.white@sydney.edu.au>
* @author Artem Osmakov <artem.osmakov@sydney.edu.au>
* @copyright (C) 2005-2013 University of Sydney
* @link http://Sydney.edu.au/Heurist
* @version 3.1.0
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
javascript:(function(){h='http://heuristscholar.org/h3/';d=document;c=d.contentType;if(c=='text/html'||!c){if(d.getElementById('__heurist_bookmarklet_div'))return Heurist.init();s=d.createElement('script');s.type='text/javascript';s.src=(h+'import/bookmarklet/bookmarkletPopup.php?'+new Date().getTime()).slice(0,-8);d.getElementsByTagName('head')[0].appendChild(s);}else{e=encodeURIComponent;w=open(h+'records/add/addRecordPopup.php?t='+e(d.title)+'&u='+e(location.href));window.setTimeout('w.focus()',200);}})();
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
if (old == CodeMirror.Init) old = false;
if (!old == !val) return;
if (val) setFullscreen(cm);
else setNormal(cm);
});
function setFullscreen(cm) {
var wrap = cm.getWrapperElement();
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
width: wrap.style.width, height: wrap.style.height};
wrap.style.width = "";
wrap.style.height = "auto";
wrap.className += " CodeMirror-fullscreen";
document.documentElement.style.overflow = "hidden";
cm.refresh();
}
function setNormal(cm) {
var wrap = cm.getWrapperElement();
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
document.documentElement.style.overflow = "";
var info = cm.state.fullScreenRestore;
wrap.style.width = info.width; wrap.style.height = info.height;
window.scrollTo(info.scrollLeft, info.scrollTop);
cm.refresh();
}
});
|
(function(){
var languageNav = $('.js-language-nav');
languageNav.on('click', function(){
languageNav.toggleClass('active');
});
//close opened stuff
$(document).on('click', function(e) {
if (!$(e.target).closest('.js-language-nav').length) {
languageNav.removeClass('active');
}
});
})();
|
import {makeInstanceAction} from '#/main/app/store/actions'
import {makeReducer} from '#/main/app/store/reducer'
import {makeFormReducer} from '#/main/app/content/form/store/reducer'
import {RESOURCE_LOAD} from '#/main/core/resource/store/actions'
import {selectors as rssSelectors} from '#/plugin/rss/resources/rss-feed/store/selectors'
import {selectors} from '#/plugin/rss/resources/rss-feed/editor/store/selectors'
const reducer = {
rssFeedForm: makeFormReducer(selectors.FORM_NAME, {}, {
originalData: makeReducer({}, {
[makeInstanceAction(RESOURCE_LOAD, rssSelectors.STORE_NAME)]: (state, action) => action.resourceData.slideshow || state
}),
data: makeReducer({}, {
[makeInstanceAction(RESOURCE_LOAD, rssSelectors.STORE_NAME)]: (state, action) => action.resourceData.slideshow || state
})
})
}
export {
reducer
}
|
/**
GaiaEHR (Electronic Health Records)
Copyright (C) 2013 Certun, LLC.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Ext.define('App.store.patient.AmendmentRequests', {
extend: 'Ext.data.Store',
model: 'App.model.patient.AmendmentRequest'
});
|
var searchData=
[
['map',['Map',['../d7/db0/classMap.html',1,'']]],
['memorystream',['MemoryStream',['../dd/d97/classMemoryStream.html',1,'']]],
['message',['Message',['../d6/d28/classMessage.html',1,'']]],
['module',['module',['../d0/dd3/classmodule.html',1,'']]],
['mongocollection',['MongoCollection',['../d2/d07/classMongoCollection.html',1,'']]],
['mongocursor',['MongoCursor',['../db/d7d/classMongoCursor.html',1,'']]],
['mongodb',['MongoDB',['../d6/d3d/classMongoDB.html',1,'']]],
['mongoid',['MongoID',['../d2/d6d/classMongoID.html',1,'']]],
['mq',['mq',['../d4/d86/classmq.html',1,'']]],
['mysql',['MySQL',['../d3/da8/classMySQL.html',1,'']]]
];
|
if(!window.nabor)
window.nabor={};
window.nabor.importFrom({
nZad:14,
adres:'../zdn/matege2015p/',
name:'matege2015p',
prefix:'',
});
|
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"id": "cordova-plugin-console.console",
"file": "plugins/cordova-plugin-console/www/console-via-logger.js",
"pluginId": "cordova-plugin-console",
"clobbers": [
"console"
]
},
{
"id": "cordova-plugin-console.logger",
"file": "plugins/cordova-plugin-console/www/logger.js",
"pluginId": "cordova-plugin-console",
"clobbers": [
"cordova.logger"
]
},
{
"id": "cordova-plugin-device.device",
"file": "plugins/cordova-plugin-device/www/device.js",
"pluginId": "cordova-plugin-device",
"clobbers": [
"device"
]
},
{
"id": "cordova-plugin-splashscreen.SplashScreen",
"file": "plugins/cordova-plugin-splashscreen/www/splashscreen.js",
"pluginId": "cordova-plugin-splashscreen",
"clobbers": [
"navigator.splashscreen"
]
},
{
"id": "cordova-plugin-statusbar.statusbar",
"file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
"pluginId": "cordova-plugin-statusbar",
"clobbers": [
"window.StatusBar"
]
},
{
"id": "ionic-plugin-keyboard.keyboard",
"file": "plugins/ionic-plugin-keyboard/www/ios/keyboard.js",
"pluginId": "ionic-plugin-keyboard",
"clobbers": [
"cordova.plugins.Keyboard"
],
"runs": true
},
{
"id": "cordova-plugin-geolocation.Coordinates",
"file": "plugins/cordova-plugin-geolocation/www/Coordinates.js",
"pluginId": "cordova-plugin-geolocation",
"clobbers": [
"Coordinates"
]
},
{
"id": "cordova-plugin-geolocation.PositionError",
"file": "plugins/cordova-plugin-geolocation/www/PositionError.js",
"pluginId": "cordova-plugin-geolocation",
"clobbers": [
"PositionError"
]
},
{
"id": "cordova-plugin-geolocation.Position",
"file": "plugins/cordova-plugin-geolocation/www/Position.js",
"pluginId": "cordova-plugin-geolocation",
"clobbers": [
"Position"
]
},
{
"id": "cordova-plugin-geolocation.geolocation",
"file": "plugins/cordova-plugin-geolocation/www/geolocation.js",
"pluginId": "cordova-plugin-geolocation",
"clobbers": [
"navigator.geolocation"
]
},
{
"id": "cordova-sqlite-storage.SQLitePlugin",
"file": "plugins/cordova-sqlite-storage/www/SQLitePlugin.js",
"pluginId": "cordova-sqlite-storage",
"clobbers": [
"SQLitePlugin"
]
}
];
module.exports.metadata =
// TOP OF METADATA
{
"cordova-plugin-console": "1.0.5",
"cordova-plugin-device": "1.1.4",
"cordova-plugin-splashscreen": "4.0.1",
"cordova-plugin-statusbar": "2.2.1",
"cordova-plugin-whitelist": "1.3.1",
"ionic-plugin-keyboard": "2.2.1",
"cordova-plugin-compat": "1.1.0",
"cordova-plugin-geolocation": "2.4.1",
"cordova-sqlite-storage": "2.0.3"
};
// BOTTOM OF METADATA
});
|
/**
* LayoutBase
* A Mithril component Base class for Layouts, e.g. HorizontalLayout and
* CircosLayout.
*/
import {Bounds} from '../../model/Bounds';
export class LayoutBase {
// constructor() - prefer do not use in mithril components
/**
* mithril lifecycle callback
* @param vnode
*/
oninit(vnode) {
this.appState = vnode.attrs.appState;
}
/**
* mithril lifecycle method
* @param vnode
*/
oncreate(vnode) {
// save a reference to this component's dom element
this.el = vnode.dom;
this.bounds = new Bounds(vnode.dom.getBoundingClientRect());
}
/**
* mithril lifecycle method
* @param vnode
*/
onupdate(vnode) {
this.bounds = new Bounds(vnode.dom.getBoundingClientRect());
}
}
|
var config = require('../config').assets,
gulp = require('gulp');
gulp.task('assets', function() {
gulp.src(config.src)
.pipe(gulp.dest(config.dst));
});
|
import BarButton from '../bar-button/bar-button';
import { useRef, useEffect } from 'react';
export default function ConnectionButton() {
const buttonRef = useRef();
const isUserConnected = elementorAdminTopBarConfig.is_user_connected;
useEffect( () => {
if ( ! buttonRef.current || isUserConnected ) {
return;
}
jQuery( buttonRef.current ).elementorConnect();
}, [] );
let tooltipText = __( 'Connect your account to get access to Elementor\'s Template Library & more.', 'elementor' ),
connectUrl = elementorAdminTopBarConfig.connect_url,
buttonText = __( 'Connect Account', 'elementor' ),
targetUrl = '_self';
if ( isUserConnected ) {
tooltipText = '';
connectUrl = 'https://go.elementor.com/wp-dash-admin-bar-account/';
buttonText = __( 'My Elementor', 'elementor' );
targetUrl = '_blank';
}
return (
<BarButton icon="eicon-user-circle-o" buttonRef={buttonRef} dataInfo={tooltipText} href={connectUrl} target={targetUrl}>{ buttonText }</BarButton>
);
}
|
/**
* Run this using node_modules/gulp/bin/gulp.js !!!
* mhm 8.6.2017
*/
'use strict';
import plugins from 'gulp-load-plugins';
//import rename from 'gulp-rename';
import yargs from 'yargs';
import gulp from 'gulp';
import rimraf from 'rimraf';
import yaml from 'js-yaml';
import fs from 'fs';
// Load all Gulp plugins into one variable
const $ = plugins();
// Load settings from config.yml
const { PATHS } = loadConfig();
function loadConfig() {
let ymlFile = fs.readFileSync('config.yml', 'utf8');
return yaml.load(ymlFile);
}
// Build the "dist" folder by running all of the below tasks
gulp.task('build',
gulp.series(clean, copyJS));
// Delete the "dist" folder
// This happens every time a build starts
function clean(done) {
rimraf(PATHS.dist, done);
}
/**
* Copies JavaScript files as-is from e.g. bower_components
* The path is manipulated to simplify the destination path.
*/
function copyJS(done) {
if (PATHS.copyjavascript) {
gulp.src(PATHS.copyjavascript, { base: '.' })
.pipe($.concat('libs.js'))
.pipe(gulp.dest(PATHS.dist + '/assets/js'));
}
if(done){
done();
}
}
|
var searchData=
[
['left',['left',['../struct__bst__node.html#ac33950f6c4a6e2bbe1674d0c7436b30f',1,'_bst_node']]]
];
|
// ** I18N
// Calendar pt-BR language
// Author: Fernando Dourado, <fernando.dourado@ig.com.br>
// Encoding: any
// Distributed under the same terms as the calendar itself.
// For translators: please use UTF-8 if possible. We strongly believe that
// Unicode is the answer to a real internationalized world. Also please
// include your contact information in the header, as can be seen above.
// full day names
Calendar._DN = new Array
("Domingo",
"Segunda",
"Terça",
"Quarta",
"Quinta",
"Sexta",
"Sabádo",
"Domingo");
// Please note that the following array of short day names (and the same goes
// for short month names, _SMN) isn't absolutely necessary. We give it here
// for exemplification on how one can customize the short day names, but if
// they are simply the first N letters of the full name you can simply say:
//
// Calendar._SDN_len = N; // short day name length
// Calendar._SMN_len = N; // short month name length
//
// If N = 3 then this is not needed either since we assume a value of 3 if not
// present, to be compatible with translation files that were written before
// this feature.
// short day names
// [No changes using default values]
// full month names
Calendar._MN = new Array
("Janeiro",
"Fevereiro",
"Março",
"Abril",
"Maio",
"Junho",
"Julho",
"Agosto",
"Setembro",
"Outubro",
"Novembro",
"Dezembro");
// short month names
// [No changes using default values]
// First day of the week. "0" means display Sunday first, "1" means display
// Monday first, etc.
Calendar._FD = 1;
// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = "Sobre o calendário";
Calendar._TT["ABOUT"] =
"DHTML Date/Time Selector\n" +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
"\n\n" +
"Translate to portuguese Brazil (pt-BR) by Fernando Dourado (fernando.dourado@ig.com.br)\n" +
"Tradução para o português Brasil (pt-BR) por Fernando Dourado (fernando.dourado@ig.com.br)" +
"\n\n" +
"Selecionar data:\n" +
"- Use as teclas \xab, \xbb para selecionar o ano\n" +
"- Use as teclas " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mês\n" +
"- Clique e segure com o mouse em qualquer botão para selecionar rapidamente.";
Calendar._TT["ABOUT_TIME"] = "\n\n" +
"Selecionar hora:\n" +
"- Clique em qualquer uma das partes da hora para aumentar\n" +
"- ou Shift-clique para diminuir\n" +
"- ou clique e arraste para selecionar rapidamente.";
Calendar._TT["PREV_YEAR"] = "Ano anterior (clique e segure para menu)";
Calendar._TT["PREV_MONTH"] = "Mês anterior (clique e segure para menu)";
Calendar._TT["GO_TODAY"] = "Ir para a data atual";
Calendar._TT["NEXT_MONTH"] = "Próximo mês (clique e segure para menu)";
Calendar._TT["NEXT_YEAR"] = "Próximo ano (clique e segure para menu)";
Calendar._TT["SEL_DATE"] = "Selecione uma data";
Calendar._TT["DRAG_TO_MOVE"] = "Clique e segure para mover";
Calendar._TT["PART_TODAY"] = " (hoje)";
// the following is to inform that "%s" is to be the first day of week
// %s will be replaced with the day name.
Calendar._TT["DAY_FIRST"] = "Exibir %s primeiro";
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = "Fechar";
Calendar._TT["TODAY"] = "Hoje";
Calendar._TT["TIME_PART"] = "(Shift-)Clique ou arraste para mudar o valor";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
Calendar._TT["TT_DATE_FORMAT"] = "%d de %B de %Y";
Calendar._TT["WK"] = "sem";
Calendar._TT["TIME"] = "Hora:";
|
var searchData=
[
['wizard_2ec',['wizard.c',['../wizard_8c.html',1,'']]],
['wrapper_2ecpp',['wrapper.cpp',['../wrapper_8cpp.html',1,'']]],
['wxforms_2ec',['wxforms.c',['../wxforms_8c.html',1,'']]]
];
|
module.exports = function (str) {
var bytes = [];
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
if (c >= 0xd800 && c <= 0xdbff && i + 1 < str.length) {
var cn = str.charCodeAt(i + 1);
if (cn >= 0xdc00 && cn <= 0xdfff) {
var pt = (c - 0xd800) * 0x400 + cn - 0xdc00 + 0x10000;
bytes.push(
0xf0 + Math.floor(pt / 64 / 64 / 64),
0x80 + Math.floor(pt / 64 / 64) % 64,
0x80 + Math.floor(pt / 64) % 64,
0x80 + pt % 64
);
i += 1;
continue;
}
}
if (c >= 2048) {
bytes.push(
0xe0 + Math.floor(c / 64 / 64),
0x80 + Math.floor(c / 64) % 64,
0x80 + c % 64
);
}
else if (c >= 128) {
bytes.push(0xc0 + Math.floor(c / 64), 0x80 + c % 64);
}
else bytes.push(c);
}
return bytes;
};
|
const _ = require('lodash')
const handleText = (event, next, botfmk) => {
if (event.platform !== 'botfmk' || event.type !== 'text') {
return next()
}
// TODO DEBUG
console.log('REPLIED', event.raw)
const session = event.session
const replied = event.raw
if (_.isArray(replied)) {
replied.forEach(r => session.send(r))
} else {
session.send(replied)
}
return next()
}
module.exports = {
'text': handleText
}
|
import { isArray } from '@ember/array';
import { module, test } from 'qunit';
import RollingArray from 'nomad-ui/utils/classes/rolling-array';
module('Unit | Util | RollingArray', function() {
test('has a maxLength property that gets set in the constructor', function(assert) {
const array = RollingArray(10, 'a', 'b', 'c');
assert.equal(array.maxLength, 10, 'maxLength is set in the constructor');
assert.deepEqual(
array,
['a', 'b', 'c'],
'additional arguments to the constructor become elements'
);
});
test('push works like Array#push', function(assert) {
const array = RollingArray(10);
const pushReturn = array.push('a');
assert.equal(
pushReturn,
array.length,
'the return value from push is equal to the return value of Array#push'
);
assert.equal(array[0], 'a', 'the arguments passed to push are appended to the array');
array.push('b', 'c', 'd');
assert.deepEqual(
array,
['a', 'b', 'c', 'd'],
'the elements already in the array are left in tact and new elements are appended'
);
});
test('when pushing past maxLength, items are removed from the head of the array', function(assert) {
const array = RollingArray(3);
const pushReturn = array.push(1, 2, 3, 4);
assert.deepEqual(
array,
[2, 3, 4],
'The first argument to push is not in the array, but the following three are'
);
assert.equal(
pushReturn,
array.length,
'The return value of push is still the array length despite more arguments than possible were provided to push'
);
});
test('when splicing past maxLength, items are removed from the head of the array', function(assert) {
const array = RollingArray(3, 'a', 'b', 'c');
array.splice(1, 0, 'z');
assert.deepEqual(
array,
['z', 'b', 'c'],
'The new element is inserted as the second element in the array and the first element is removed due to maxLength restrictions'
);
array.splice(0, 0, 'pickme');
assert.deepEqual(
array,
['z', 'b', 'c'],
'The new element never makes it into the array since it was added at the head of the array and immediately removed'
);
array.splice(0, 1, 'pickme');
assert.deepEqual(
array,
['pickme', 'b', 'c'],
'The new element makes it into the array since the previous element at the head of the array is first removed due to the second argument to splice'
);
});
test('unshift throws instead of prepending elements', function(assert) {
const array = RollingArray(5);
assert.throws(
() => {
array.unshift(1);
},
/Cannot unshift/,
'unshift is not supported, but is not undefined'
);
});
test('RollingArray is an instance of Array', function(assert) {
const array = RollingArray(5);
assert.ok(array.constructor === Array, 'The constructor is Array');
assert.ok(array instanceof Array, 'The instanceof check is true');
assert.ok(isArray(array), 'The ember isArray helper works');
});
});
|
initSidebarItems({"mod":[["big5","Big5 and HKSCS."]]});
|
module.exports = { domain:"messages",
locale_data:{ messages:{ "":{ domain:"messages",
plural_forms:"nplurals=2; plural=(n!=1);",
lang:"mk" },
"%(addonName)s %(startSpan)sby %(authorList)s%(endSpan)s":[ "" ],
"Extension Metadata":[ "" ],
Screenshots:[ "" ],
"About this extension":[ "" ],
"Rate your experience":[ "" ],
Category:[ "" ],
"Used by":[ "" ],
Sentiment:[ "" ],
Back:[ "" ],
Submit:[ "" ],
"Please enter some text":[ "" ],
"Write a review":[ "" ],
"Tell the world why you think this extension is fantastic!":[ "" ],
"Privacy policy":[ "" ],
"Legal notices":[ "" ],
"View desktop site":[ "" ],
"Browse in your language":[ "" ],
"Firefox Add-ons":[ "" ],
"How are you enjoying your experience with %(addonName)s?":[ "" ],
"screenshot %(imageNumber)s of %(totalImages)s":[ "" ],
"Average rating: %(rating)s out of 5":[ "" ],
"No ratings":[ "" ],
"%(users)s user":[ "",
"%(users)s users" ],
"Log out":[ "" ],
"Log in/Sign up":[ "" ],
"Add-ons for Firefox":[ "" ],
"What do you want Firefox to do?":[ "" ],
"Block ads":[ "" ],
Screenshot:[ "" ],
"Save stuff":[ "" ],
"Shop online":[ "" ],
"Be social":[ "" ],
"Share stuff":[ "" ],
"Browse all extensions":[ "" ],
"How do you want Firefox to look?":[ "" ],
Wild:[ "" ],
Abstract:[ "" ],
Fashionable:[ "" ],
Scenic:[ "" ],
Sporty:[ "" ],
Mystical:[ "" ],
"Browse all themes":[ "" ],
"Downloading %(name)s.":[ "" ],
"Installing %(name)s.":[ "" ],
"%(name)s is installed and enabled. Click to uninstall.":[ "" ],
"%(name)s is disabled. Click to enable.":[ "" ],
"Uninstalling %(name)s.":[ "" ],
"%(name)s is uninstalled. Click to install.":[ "" ],
"Install state for %(name)s is unknown.":[ "" ],
Previous:[ "" ],
Next:[ "" ],
"Page %(currentPage)s of %(totalPages)s":[ "" ],
"Your search for \"%(query)s\" returned %(count)s result.":[ "",
"Your search for \"%(query)s\" returned %(count)s results." ],
"Searching...":[ "" ],
"No results were found for \"%(query)s\".":[ "" ],
"Please supply a valid search":[ "" ] } },
_momentDefineLocale:function anonymous() {
//! moment.js locale configuration
//! locale : Macedonian [mk]
//! author : Borislav Mickov : https://github.com/B0k0
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var mk = moment.defineLocale('mk', {
months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'D.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY H:mm',
LLLL : 'dddd, D MMMM YYYY H:mm'
},
calendar : {
sameDay : '[Денес во] LT',
nextDay : '[Утре во] LT',
nextWeek : '[Во] dddd [во] LT',
lastDay : '[Вчера во] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[Изминатата] dddd [во] LT';
case 1:
case 2:
case 4:
case 5:
return '[Изминатиот] dddd [во] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'после %s',
past : 'пред %s',
s : 'неколку секунди',
m : 'минута',
mm : '%d минути',
h : 'час',
hh : '%d часа',
d : 'ден',
dd : '%d дена',
M : 'месец',
MM : '%d месеци',
y : 'година',
yy : '%d години'
},
ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
ordinal : function (number) {
var lastDigit = number % 10,
last2Digits = number % 100;
if (number === 0) {
return number + '-ев';
} else if (last2Digits === 0) {
return number + '-ен';
} else if (last2Digits > 10 && last2Digits < 20) {
return number + '-ти';
} else if (lastDigit === 1) {
return number + '-ви';
} else if (lastDigit === 2) {
return number + '-ри';
} else if (lastDigit === 7 || lastDigit === 8) {
return number + '-ми';
} else {
return number + '-ти';
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return mk;
})));
} }
|
import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
export default Helper.extend({
disableInterval: false,
compute(value, { interval }) {
if (this.disableInterval) {
return;
}
this.clearTimer();
if (interval) {
/*
* NOTE: intentionally a setTimeout so tests do not block on it
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
}
},
clearTimer() {
clearTimeout(this.intervalTimer);
},
destroy() {
this.clearTimer();
this._super(...arguments);
},
});
|
var cred = require('./cred');
module.exports = {
'db': {
'host': 'pub-redis-10769.us-east-1-2.4.ec2.garantiadata.com',
'port': 10769,
'auth': cred.auth
}
};
|
// |jit-test| error: StopIteration
// Returning {throw:} from an onPop handler when yielding works and
// does closes the generator-iterator.
load(libdir + "asserts.js");
var g = newGlobal();
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
dbg.onDebuggerStatement = function handleDebugger(frame) {
frame.onPop = function (c) {
return {throw: "fit"};
};
};
g.eval("function g() { for (var i = 0; i < 10; i++) { debugger; yield i; } }");
g.eval("var it = g();");
var rv = gw.executeInGlobal("it.next();");
assertEq(rv.throw, "fit");
dbg.enabled = false;
g.it.next();
|
var Quest = require('../quest'),
Messages = require('../../../../../../network/messages'),
Packets = require('../../../../../../network/packets'),
Utils = require('../../../../../../util/utils');
module.exports = Introduction = Quest.extend({
init: function(player, data) {
var self = this;
self.player = player;
self.data = data;
self.lastNPC = null;
self._super(data.id, data.name, data.description);
self.loadCallbacks();
},
load: function(stage) {
var self = this;
if (!stage)
self.update();
else
self.stage = stage;
if (self.finishedCallback)
self.finishedCallback();
},
loadCallbacks: function() {
var self = this;
self.onFinishedLoading(function() {
if (self.stage > 9999)
return;
if (self.stage < 10)
self.toggleChat();
});
self.player.onReady(function() {
self.updatePointers();
});
self.onNPCTalk(function(npc) {
var conversation = self.getConversation(npc.id);
if (!conversation)
return;
self.lastNPC = npc;
npc.talk(conversation);
self.player.send(new Messages.NPC(Packets.NPCOpcode.Talk, {
id: npc.instance,
text: conversation
}));
if (npc.talkIndex > conversation.length)
self.progress('talk');
});
},
progress: function(type) {
var self = this,
task = self.data.task[self.stage];
if (!task || task !== type)
return;
switch (type) {
case 'talk':
break;
case 'click':
if (self.stage === 1)
self.forceTalk(self.lastNPC, ['Great job! This is your character menu.']);
break;
}
self.stage++;
self.clearPointers();
self.update();
self.updatePointers();
},
update: function() {
this.player.save();
},
updatePointers: function() {
var self = this,
pointer = self.data.pointers[self.stage];
if (!pointer)
return;
var opcode = pointer[0],
x = pointer[1],
y = pointer[2];
self.player.send(new Messages.Pointer(opcode, {
id: Utils.generateRandomId(),
x: x,
y: y
}));
},
clearPointers: function() {
this.player.send(new Messages.Pointer(Packets.PointerOpcode.Remove, {}));
},
toggleChat: function() {
this.player.canTalk = !this.player.canTalk;
},
getConversation: function(id) {
var self = this,
conversation = self.data.conversations[id];
if (!conversation || !conversation[self.stage])
return [''];
var message = conversation[self.stage];
if (self.stage === 3)
message[0] += self.player.username;
return message;
},
setStage: function(stage) {
var self = this;
self._super(stage);
self.update();
self.clearPointers();
},
finish: function() {
var self = this;
self.setStage(9999);
},
forceTalk: function(npc, message) {
var self = this;
/**
* The message must be in an array format.
*/
npc.talkIndex = 0;
self.player.send(new Messages.NPC(Packets.NPCOpcode.Talk, {
id: npc.instance,
text: message
}));
},
hasNPC: function(id) {
var self = this;
for (var i = 0; i < self.data.npcs.length; i++)
if (self.data.npcs[i] === id)
return true;
return false;
},
onFinishedLoading: function(callback) {
this.finishedCallback = callback;
}
});
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// @flow
const { applyMiddleware, createStore, compose } = require("redux");
const { thunk } = require("../shared/redux/middleware/thunk");
const {
waitUntilService
} = require("../shared/redux/middleware/waitUntilService");
const reducer = require("./reducer");
import type { Props, State } from "./types";
function createInitialState(overrides: Object): State {
return {
actors: new Set(),
expandedPaths: new Set(),
focusedItem: null,
loadedProperties: new Map(),
forceUpdated: false,
...overrides
};
}
function enableStateReinitializer(props) {
return next => (innerReducer, initialState, enhancer) => {
function reinitializerEnhancer(state, action) {
if (action.type !== "ROOTS_CHANGED") {
return innerReducer(state, action);
}
if (props.releaseActor && initialState.actors) {
initialState.actors.forEach(props.releaseActor);
}
return {
...action.data,
actors: new Set(),
expandedPaths: new Set(),
loadedProperties: new Map(),
// Indicates to the component that we do want to render on the next
// render cycle.
forceUpdate: true
};
}
return next(reinitializerEnhancer, initialState, enhancer);
};
}
module.exports = (props: Props) => {
const middlewares = [thunk];
if (props.injectWaitService) {
middlewares.push(waitUntilService);
}
return createStore(
reducer,
createInitialState(props),
compose(
applyMiddleware(...middlewares),
enableStateReinitializer(props)
)
);
};
|
'use strict';
import TyphonLoggedEvents from './TyphonLoggedEvents.js';
const eventbus = new TyphonLoggedEvents();
eventbus.setEventbusName('mainEventbus');
/**
* Exports an instance of `TyphonLoggedEvents` which adds asynchronous capabilities to `Backbone.Events` which is used
* as a main eventbus. Note that an instance of `TyphonLoggedEvents` is exported and is also associated to a mapped
* path, `mainEventbus` in the SystemJS extra configuration data loaded by all TyphonJS repos in
* `./config/config-app-paths.js`. By using a mapped path any other module may import the main eventbus via:
* `import eventbus from 'mainEventbus';`
*
* Note the above creation of `const eventbus` is a workaround for an ESDoc bug:
* https://github.com/esdoc/esdoc/issues/166
*
* Normally we can write `export default new TyphonLoggedEvents();`, but this currently breaks ESDoc.
*/
export default eventbus;
|
/**
* Created by leow on 2/12/17.
*/
"use strict";
// Stdlib
const util = require("util")
// Constants
const NON_FATAL_INCONSISTENT = "Inconsistent state - retry!"
const FATAL_CONTENT = "Page does not exist!"
const FATAL_UNKNOWN = "Unknown Error!"
// Libs
const cheerio = require('cheerio')
const tableParser = require('cheerio-tableparser')
function recognize_page_type(page_parsed) {
// console.error("TYPE: " + typeof(page_parsed))
// DEBUG:
// console.error("TITLE IS " + pageParsed('head title').text())
// If title is "PublicViewStatus"; is OK; otherwise ERROR out!!
if (page_parsed('head title').text() == "PublicViewStatus") {
// Aduan Information
// id="dlAduan"
// DEBUG:
// console.error("ADUAN: " + pageParsed('#Table9'))
/*
console.error("====== ADUAN_DATA: =====\n" + util.inspect(
pageParsed('#Table9').parsetable(false, false, true).reduce(
(p, n) => n.map((item, i) => [...(p[i] || []), n[i]]), []
)))
*/
/* NO NEED TRANSPOSE!! :P
const aduanData = pageParsed('#Table9').parsetable(false, false, true).reduce(
(p, n) => n.map((item, i) => [...(p[i] || []), n[i]]), []
)
*/
const aduan_data = page_parsed('#Table9').parsetable(false, false, true)
// DEBUG:
/*
console.error("SIZE: " + aduan_data.length)
aduanData[0].every((element, index, array) => {
console.error("EL: " + util.inspect(element) + " ID: " + index )
})
*/
// Choose the column number; then we can get out the key/value
// aduanData[0] for the label
// aduanData[1] for the value
// DEBUG:
/*
aduan_data[1].forEach((element, index) => {
console.error('a[' + index + '] = ' + element)
})
*/
// console.error("ADUANID: " + aduan_data[1][0])
// Tindakan Table
// id="dsTindakan"
// DEBUG:
// console.error("TINDAKAN: " + pageParsed('#dsTindakan'))
// References:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
// Transpose assumes matrix (same size both end); not suitable
// const transpose = a => a.map((_, c) => a.map(r => r[c]))
// Last solution by @tatomyr works!!
const tindakan_data = page_parsed('#dsTindakan').parsetable(false, false, true).reduce(
(p, n) => n.map((item, i) => [...(p[i] || []), n[i]]), []
)
// DEBUG:
/*
console.error("TINDAKAN_DATA:" + util.inspect(tindakan_data))
console.error("TINDAKAN_LENGTH: " + tindakan_data.length)
*/
if (tindakan_data.length == 1) {
return {
"page_type": "empty",
"aduan_id": aduan_data[1][0]
}
} else {
return {
"page_type": "good",
"aduan_id": aduan_data[1][0]
}
}
} else {
return {
"page_type": "error"
}
}
// Should not get here .. is bad!
return {
"page_type": "unknown"
}
}
function extract_table(loaded_raw_content) {
if (loaded_raw_content === null || loaded_raw_content === undefined) {
return {
"error": FATAL_CONTENT
}
}
const page_parsed = cheerio.load(loaded_raw_content)
// Setup cheerio-tableparser
tableParser(page_parsed)
// Extract out page type and other goodies?
const res = recognize_page_type(page_parsed)
if (res.page_type == "error") {
// Assumes Error Page; but it is loaded correctly ..
return {
"error": null,
"type": "error"
}
} else if (res.page_type == "unknown") {
return {
"error": FATAL_UNKNOWN,
"type": "error"
}
}
// Type: "good" or "empty"
return {
"error": null,
"type": res.page_type,
"aduan_id": res.aduan_id
}
}
module.exports = {
execute: extract_table
}
|
/*
* Copyright (C) 2016 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import $ from 'jquery'
import fakeENV from 'helpers/fakeENV'
import api from 'compiled/api/enrollmentTermsApi'
import 'jquery.ajaxJSON'
const deserializedTerms = [
{
id: '1',
name: 'Fall 2013 - Art',
startAt: new Date('2013-06-03T02:57:42Z'),
endAt: new Date('2013-12-03T02:57:53Z'),
createdAt: new Date('2015-10-27T16:51:41Z'),
gradingPeriodGroupId: '2'
},
{
id: '3',
name: null,
startAt: new Date('2014-01-03T02:58:36Z'),
endAt: new Date('2014-03-03T02:58:42Z'),
createdAt: new Date('2013-06-02T17:29:19Z'),
gradingPeriodGroupId: '2'
},
{
id: '4',
name: null,
startAt: null,
endAt: null,
createdAt: new Date('2014-05-02T17:29:19Z'),
gradingPeriodGroupId: '1'
}
]
const serializedTerms = {
enrollment_terms: [
{
id: 1,
name: 'Fall 2013 - Art',
start_at: '2013-06-03T02:57:42Z',
end_at: '2013-12-03T02:57:53Z',
created_at: '2015-10-27T16:51:41Z',
grading_period_group_id: 2
},
{
id: 3,
name: null,
start_at: '2014-01-03T02:58:36Z',
end_at: '2014-03-03T02:58:42Z',
created_at: '2013-06-02T17:29:19Z',
grading_period_group_id: 2
},
{
id: 4,
name: null,
start_at: null,
end_at: null,
created_at: '2014-05-02T17:29:19Z',
grading_period_group_id: 1
}
]
}
QUnit.module('list', {
setup() {
this.server = sinon.fakeServer.create()
this.fakeHeaders = '<http://some_url?page=1&per_page=10>; rel="last"'
fakeENV.setup()
ENV.ENROLLMENT_TERMS_URL = 'api/enrollment_terms'
},
teardown() {
fakeENV.teardown()
this.server.restore()
}
})
test('calls the resolved endpoint', () => {
sandbox.stub($, 'ajaxJSON')
api.list()
ok($.ajaxJSON.calledWith('api/enrollment_terms'))
})
test('deserializes returned enrollment terms', function(assert) {
const start = assert.async()
this.server.respondWith('GET', /enrollment_terms/, [
200,
{
'Content-Type': 'application/json',
Link: this.fakeHeaders
},
JSON.stringify(serializedTerms)
])
api.list().then(terms => {
deepEqual(terms, deserializedTerms)
start()
})
this.server.respond()
})
test('rejects the promise upon errors', function(assert) {
const start = assert.async()
this.server.respondWith('GET', /enrollment_terms/, [
404,
{'Content-Type': 'application/json'},
'FAIL'
])
api.list().catch(error => {
ok('we got here')
start()
})
this.server.respond()
})
|
'use strict';
/* jshint node: true */
var logger = require('nlogger').logger(module);
var express = require('express');
var _ = require('underscore');
var config = require('./config');
var poller = require('./poller');
var app = module.exports = express.createServer();
var reports = {};
function reapOldReports() {
logger.info('starting reap cycle on reports: ', _.keys(reports).length);
_.each(_.keys(reports), function(key) {
var report = reports[key];
var age = Math.round(((new Date()).getTime() - report.reported)/1000);
if (age >= config.reapAge) {
logger.info('reaping stale report for: {}:{}', report.host, report.port);
delete reports[key];
}
});
}
poller.emitter.on('report', function(report) {
var key = report.host + ':' + report.port;
reports[key] = report;
});
app.configure(function() {
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/pages', { maxAge: 60*60*1000 }));
app.use(express.static(__dirname + '/static', { maxAge: 3*24*60*60*1000 }));
app.use(express.compress());
});
app.configure(function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.get('/reports', function(req, res) {
res.setHeader('Content-Type', 'application/json');
res.setHeader('Cache-Control', 'public, max-age=' + 10);
res.send(JSON.stringify(reports));
res.end();
});
logger.info('starting web UI on port: ', config.httpPort);
app.listen(config.httpPort);
poller.startPollingMasterServer();
setInterval(reapOldReports, config.reapInterval*1000);
|
OC.L10N.register(
"settings",
{
"Delete" : "తొలగించు",
"Server address" : "సేవకి చిరునామా",
"Cancel" : "రద్దుచేయి",
"Email" : "ఈమెయిలు",
"Your email address" : "మీ ఈమెయిలు చిరునామా",
"Password" : "సంకేతపదం",
"New password" : "కొత్త సంకేతపదం",
"Language" : "భాష",
"Name" : "పేరు",
"Username" : "వాడుకరి పేరు",
"Personal" : "వ్యక్తిగతం",
"Error" : "పొరపాటు"
},
"nplurals=2; plural=(n != 1);");
|
/*
* Ext JS Library 2.3.0
* Copyright(c) 2006-2009, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
/**
* @class Ext.form.Label
* @extends Ext.BoxComponent
* Basic Label field.
* @constructor
* Creates a new Label
* @param {Ext.Element/String/Object} config The configuration options. If an element is passed, it is set as the internal
* element and its id used as the component id. If a string is passed, it is assumed to be the id of an existing element
* and is used as the component id. Otherwise, it is assumed to be a standard config object and is applied to the component.
*/
Ext.form.Label = Ext.extend(Ext.BoxComponent, {
/**
* @cfg {String} text The plain text to display within the label (defaults to ''). If you need to include HTML
* tags within the label's innerHTML, use the {@link #html} config instead.
*/
/**
* @cfg {String} forId The id of the input element to which this label will be bound via the standard HTML 'for'
* attribute. If not specified, the attribute will not be added to the label.
*/
/**
* @cfg {String} html An HTML fragment that will be used as the label's innerHTML (defaults to '').
* Note that if {@link #text} is specified it will take precedence and this value will be ignored.
*/
// private
onRender : function(ct, position){
if(!this.el){
this.el = document.createElement('label');
this.el.id = this.getId();
this.el.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || '');
if(this.forId){
this.el.setAttribute('for', this.forId);
}
}
Ext.form.Label.superclass.onRender.call(this, ct, position);
},
/**
* Updates the label's innerHTML with the specified string.
* @param {String} text The new label text
* @param {Boolean} encode (optional) False to skip HTML-encoding the text when rendering it
* to the label (defaults to true which encodes the value). This might be useful if you want to include
* tags in the label's innerHTML rather than rendering them as string literals per the default logic.
* @return {Label} this
*/
setText: function(t, encode){
var e = encode === false;
this[!e ? 'text' : 'html'] = t;
delete this[e ? 'text' : 'html'];
if(this.rendered){
this.el.dom.innerHTML = encode !== false ? Ext.util.Format.htmlEncode(t) : t;
}
return this;
}
});
Ext.reg('label', Ext.form.Label);
|
//// [subtypingWithCallSignaturesA.ts]
declare function foo3(cb: (x: number) => number): typeof cb;
var r5 = foo3((x: number) => ''); // error
//// [subtypingWithCallSignaturesA.js]
var r5 = foo3(function (x) { return ''; });
|
define(function(require, exports, module) {
var $ = require('jquery');
var leftBtn =$('#company-list').find('.left-btn'),
rightBtn = $('#company-list').find('.right-btn'),
show = $('#company-list').find('.show');
module.exports = {
i:0,
// 处理鼠标移入移出事件
onHoverAndOut: function() {
var _this = this;
$('#company-list').on('mouseover', function() {
leftBtn.show();
rightBtn.show();
});
$('#company-list').on('mouseout', function() {
leftBtn.hide();
rightBtn.hide();
});
},
//处理点击事件
onClick: function() {
var _this = this;
leftBtn.on('click', function() {
_this.rightMove();
});
rightBtn.on('click', function() {
_this.leftMove();
});
},
leftMove: function() {
var value = 164;
this.i = this.i + 1;
if (this.i >= 7) {
this.i = 0;
}
value = this.i * value;
this.val = value;
show.animate({
left: "-" + value + "px"
}, 1000);
},
rightMove: function() {
var value = 164;
if (this.i <= 0) {
this.i = 7;
}
value = (this.i - 1) * value;
this.val = value;
show.animate({
left: "-" + value + "px"
}, 1000);
this.i = this.i - 1;
}
}
})
|
import './styles.scss';
import {View} from 'backbone';
import {className} from '../../decorators';
import bem from 'b_';
import $ from 'jquery';
import {defaults} from 'underscore';
export const POSITION = {
'top': function({top, left, width}, {offset}, tipSize) {
return {
top: top - tipSize.height - offset,
left: left + width / 2 - tipSize.width / 2
};
},
'center': function({top, left, height, width}, offsets, tipSize) {
return {
top: top + height / 2,
left: left + width / 2 - tipSize.width / 2
};
},
'right': function({top, left, height, width}, {offset}, tipSize) {
return {
top: top + height / 2 - tipSize.height / 2,
left: left + width + offset
};
},
'left': function({top, left, height}, {offset}, tipSize) {
return {
top: top + height / 2 - tipSize.height / 2,
left: left - offset - tipSize.width
};
},
'bottom': function({top, left, height, width}, {offset}, tipSize) {
return {
top: top + height + offset,
left: left + width / 2 - tipSize.width / 2
};
},
'bottom-left': function({top, left, height, width}, {offset}, tipSize) {
return {
top: top + height + offset,
left: left + width - tipSize.width
};
}
};
@className('tooltip')
class TooltipView extends View {
static container = $(document.body);
initialize(options) {
this.options = options;
defaults(this.options, {offset: 10});
}
render() {
this.constructor.container.append(this.$el);
}
isVisible() {
return this.$el.is(':visible');
}
setContent(text) {
this.$el.html(text);
}
show(text, anchor) {
const {position} = this.options;
this.setContent(text);
this.$el.addClass(bem(this.className, {position}));
this.render();
if(document.dir === 'rtl' && position === 'right'){
this.$el.css(POSITION['left'](
anchor[0].getBoundingClientRect(),
{offset: this.options.offset},
this.$el[0].getBoundingClientRect()));
} else if(document.dir === 'rtl' && position === 'left'){
this.$el.css(POSITION['right'](
anchor[0].getBoundingClientRect(),
{offset: this.options.offset},
this.$el[0].getBoundingClientRect()));
} else {
this.$el.css(POSITION[position](
anchor[0].getBoundingClientRect(),
{offset: this.options.offset},
this.$el[0].getBoundingClientRect()));
}
}
hide() {
this.$el.remove();
}
}
export default TooltipView;
|
const handleError = (message) => {
$("#errorMessage").text(message);
$("#domoMessage").animate({width:'toggle'},350);
}
const sendAjax = (action, data) => {
$.ajax({
cache: false,
type: "POST",
url: action,
data: data,
dataType: "json",
success: (result, status, xhr) => {
$("#domoMessage").animate({width:'hide'},350);
window.location = result.redirect;
},
error: (xhr, status, error) => {
const messageObj = JSON.parse(xhr.responseText);
handleError(messageObj.error);
}
});
}
$(document).ready(() => {
$("#signupForm").on("submit", (e) => {
e.preventDefault();
$("#domoMessage").animate({width:'hide'},350);
if($("#user").val() == '' || $("#pass").val() == '' || $("#pass2").val() == '') {
handleError("RAWR! All fields are required");
return false;
}
if($("#pass").val() !== $("#pass2").val()) {
handleError("RAWR! Passwords do not match");
return false;
}
sendAjax($("#signupForm").attr("action"), $("#signupForm").serialize());
return false;
});
$("#loginForm").on("submit", (e) => {
e.preventDefault();
$("#domoMessage").animate({width:'hide'},350);
if($("#user").val() == '' || $("#pass").val() == '') {
handleError("RAWR! Username or password is empty");
return false;
}
sendAjax($("#loginForm").attr("action"), $("#loginForm").serialize());
return false;
});
$("#domoForm").on("submit", (e) => {
e.preventDefault();
$("#domoMessage").animate({width:'hide'},350);
if($("#domoName").val() == '' || $("#domoAge").val() == '') {
handleError("RAWR! All fields are required");
return false;
}
sendAjax($("#domoForm").attr("action"), $("#domoForm").serialize());
return false;
});
});
|
/// <reference path="../../services/office365/scripts/utility.js" />
/// <reference path="../../services/office365/scripts/o365adal.js" />
/// <reference path="../../services/office365/scripts/exchange.js" />
(function () {
'use strict';
angular.module('app365').controller('calendarDetailCtrl', ['$scope', '$stateParams', '$location', 'app365api', calendarDetailCtrl]);
function calendarDetailCtrl($scope, $stateParams, $location, app365api) {
var vm = this;
// Get event with specified event id.
vm.getEvent = function () {
var outlookClient = app365api.outlookClientObj();
NProgress.start();
outlookClient.me.calendar.events.getEvent($stateParams.id).fetch()
.then(function (event) {
// Get event detail like subject, location, attendees etc.
vm.subject = event.subject;
vm.start = event.start;
vm.end = event.end;
vm.bodypreview = event.bodyPreview;
vm.location = event.location.displayName;
var attendees;
event.attendees.forEach(function (attendee) {
if (typeof attendees == 'undefined') {
attendees = attendee.emailAddress.name
} else {
attendees += "," + attendee.emailAddress.name;
}
});
vm.attendees = attendees;
$scope.$apply();
NProgress.done();
});
};
vm.getEvent();
}
})();
|
Bridge.merge(new System.Globalization.CultureInfo("kn", true), {
englishName: "Kannada",
nativeName: "ಕನ್ನಡ",
numberFormat: Bridge.merge(new System.Globalization.NumberFormatInfo(), {
nanSymbol: "NaN",
negativeSign: "-",
positiveSign: "+",
negativeInfinitySymbol: "-∞",
positiveInfinitySymbol: "∞",
percentSymbol: "%",
percentGroupSizes: [3],
percentDecimalDigits: 2,
percentDecimalSeparator: ".",
percentGroupSeparator: ",",
percentPositivePattern: 1,
percentNegativePattern: 1,
currencySymbol: "₹",
currencyGroupSizes: [3,2],
currencyDecimalDigits: 2,
currencyDecimalSeparator: ".",
currencyGroupSeparator: ",",
currencyNegativePattern: 12,
currencyPositivePattern: 0,
numberGroupSizes: [3],
numberDecimalDigits: 2,
numberDecimalSeparator: ".",
numberGroupSeparator: ",",
numberNegativePattern: 1
}),
dateTimeFormat: Bridge.merge(new System.Globalization.DateTimeFormatInfo(), {
abbreviatedDayNames: ["ಭಾನು.","ಸೋಮ.","ಮಂಗಳ.","ಬುಧ.","ಗುರು.","ಶುಕ್ರ.","ಶನಿ."],
abbreviatedMonthGenitiveNames: ["ಜನವರಿ","ಫೆಬ್ರವರಿ","ಮಾರ್ಚ್","ಎಪ್ರಿಲ್","ಮೇ","ಜೂನ್","ಜುಲೈ","ಆಗಸ್ಟ್","ಸೆಪ್ಟಂಬರ್","ಅಕ್ಟೋಬರ್","ನವೆಂಬರ್","ಡಿಸೆಂಬರ್",""],
abbreviatedMonthNames: ["ಜನವರಿ","ಫೆಬ್ರವರಿ","ಮಾರ್ಚ್","ಎಪ್ರಿಲ್","ಮೇ","ಜೂನ್","ಜುಲೈ","ಆಗಸ್ಟ್","ಸೆಪ್ಟಂಬರ್","ಅಕ್ಟೋಬರ್","ನವೆಂಬರ್","ಡಿಸೆಂಬರ್",""],
amDesignator: "ಪೂರ್ವಾಹ್ನ",
dateSeparator: "-",
dayNames: ["ಭಾನುವಾರ","ಸೋಮವಾರ","ಮಂಗಳವಾರ","ಬುಧವಾರ","ಗುರುವಾರ","ಶುಕ್ರವಾರ","ಶನಿವಾರ"],
firstDayOfWeek: 1,
fullDateTimePattern: "dd MMMM yyyy HH:mm:ss",
longDatePattern: "dd MMMM yyyy",
longTimePattern: "HH:mm:ss",
monthDayPattern: "MMMM d",
monthGenitiveNames: ["ಜನವರಿ","ಫೆಬ್ರವರಿ","ಮಾರ್ಚ್","ಏಪ್ರೀಲ್","ಮೇ","ಜೂನ್","ಜುಲೈ","ಆಗಸ್ಟ್","ಸೆಪ್ಟಂಬರ್","ಅಕ್ಟೋಬರ್","ನವೆಂಬರ್","ಡಿಸೆಂಬರ್",""],
monthNames: ["ಜನವರಿ","ಫೆಬ್ರವರಿ","ಮಾರ್ಚ್","ಏಪ್ರೀಲ್","ಮೇ","ಜೂನ್","ಜುಲೈ","ಆಗಸ್ಟ್","ಸೆಪ್ಟಂಬರ್","ಅಕ್ಟೋಬರ್","ನವೆಂಬರ್","ಡಿಸೆಂಬರ್",""],
pmDesignator: "ಅಪರಾಹ್ನ",
rfc1123: "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
shortDatePattern: "dd-MM-yy",
shortestDayNames: ["ರ","ಸ","ಮ","ಬ","ಗ","ಶ","ಶ"],
shortTimePattern: "HH:mm",
sortableDateTimePattern: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
sortableDateTimePattern1: "yyyy'-'MM'-'dd",
timeSeparator: ":",
universalSortableDateTimePattern: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
yearMonthPattern: "MMMM, yyyy",
roundtripFormat: "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz"
}),
TextInfo: Bridge.merge(new System.Globalization.TextInfo(), {
ANSICodePage: 0,
CultureName: "kn-IN",
EBCDICCodePage: 500,
IsRightToLeft: false,
LCID: 1099,
listSeparator: ",",
MacCodePage: 2,
OEMCodePage: 1,
IsReadOnly: true
})
});
|
'use strict';
innoApp
.controller('HeaderCtrl',["$scope", "AuthService", function ($scope,AuthService) {
// Fetching role name
$scope.role = AuthService.getRole();
//Setting menu for admin and other user dynamic
if($scope.role === "admin"){
$scope.menu = [
{ name: 'user'},
{ name: 'role'}
];
}
}]);
|
var
utils = require('enyo/utils'),
kind = require('enyo/kind');
describe('language', function () {
describe('usage', function () {
describe('Callee', function () {
var dn = '';
var fn = function() {
dn = arguments.callee.displayName;
};
it('should have proper callee', function () {
fn.displayName = "fn";
fn();
expect(dn).to.equal('fn')
});
});
describe('Class', function () {
var AClass;
before(function () {
AClass = kind({
name: "AClass"
});
});
after(function () {
AClass = null;
});
it('should be a function', function () {
expect(AClass).to.be.a('function')
});
});
describe('isString', function () {
var iframe;
before(function () {
var iframeDoc;
// Create alternate window context to write vars from
iframe = document.createElement("iframe"),
document.body.appendChild(iframe);
iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.write("<script>parent.iString = new String('hello');</script>");
iframeDoc.close();
});
after(function () {
document.body.removeChild(iframe);
iframe = null;
});
it('should determine strings properly', function () {
expect(utils.isString("string")).to.be.true;
});
// This will fail:
// - instanceof from another context
// - typeof (b/c it is a string instance)
// https://github.com/enyojs/enyo/issues/2
/* global iString */
it('should determine strings written from other window contexts correctly', function () {
expect(utils.isString(iString)).to.be.true;
});
});
describe('indexOf', function () {
it('should have proper index', function () {
var index = utils.indexOf("foo", [null, null, null, null,"foo"]);
expect(index).to.equal(4)
});
});
describe('indexOf greater than array length', function () {
it('should equal -1', function () {
var index = utils.indexOf("foo", [null, null, null, null,"foo"], 10);
expect(index).to.equal(-1)
});
});
describe('AsyncMethod', function () {
var timesCalled;
before(function () {
timesCalled = 0;
});
it('should be called twice', function (done) {
utils.asyncMethod(function () { timesCalled++; });
utils.asyncMethod(this, function (i) { timesCalled += i; }, 1);
setTimeout(function() {
expect(timesCalled).to.equal(2)
done();
}, 25);
});
});
describe('isObject', function () {
it('should be true that an object is an object', function () {
expect(utils.isObject({})).to.be.true
});
it('should not be true that undefined is an object', function () {
expect(utils.isObject(undefined)).to.be.false
});
it('should not be true that null is an object', function () {
expect(utils.isObject(null)).to.be.false
});
it('should not be true that an array is an object', function () {
expect(utils.isObject([1,2,3])).to.be.false
});
it('should not be true that a number is an object', function () {
expect(utils.isObject(42)).to.be.false
});
it('should not be true that a string is an object', function () {
expect(utils.isObject("forty-two")).to.be.false
});
});
describe('isArray', function () {
it('should not be true that an object is an array', function () {
expect(utils.isArray({})).to.be.false
});
it('should not be true that undefined is an array', function () {
expect(utils.isArray(undefined)).to.be.false
});
it('should not be true that null is an array', function () {
expect(utils.isArray(null)).to.be.false
});
it('should be true that an array is an array', function () {
expect(utils.isArray([1,2,3])).to.be.true
});
it('should not be true that a number is an array', function () {
expect(utils.isArray(42)).to.be.false
});
it('should not be true that a string is an array', function () {
expect(utils.isArray("forty-two")).to.be.false
});
});
});
});
|
/******/ (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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/*!*************************************!*\
!*** ./loaders/css-loader/index.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
it("should handle the css loader correctly", function() {
(__webpack_require__(/*! css!../_css/stylesheet.css */ 1) + "").indexOf(".rule-direct").should.not.be.eql(-1);
(__webpack_require__(/*! css!../_css/stylesheet.css */ 1) + "").indexOf(".rule-import1").should.not.be.eql(-1);
(__webpack_require__(/*! css!../_css/stylesheet.css */ 1) + "").indexOf(".rule-import2").should.not.be.eql(-1);
});
/***/ },
/* 1 */
/*!************************************************************!*\
!*** (webpack)/~/css-loader!./loaders/_css/stylesheet.css ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! (webpack)/~/css-loader/cssToString.js */ 2)();
__webpack_require__(/*! (webpack)/~/css-loader/mergeImport.js */ 3)(exports, __webpack_require__(/*! -!(webpack)/~/css-loader!./folder/stylesheet-import1.css */ 4), "");
exports.push([module.id, "\r\n\r\n.rule-direct {\r\n\tbackground: lightgreen;\r\n}", ""]);
/***/ },
/* 2 */
/*!*********************************************!*\
!*** (webpack)/~/css-loader/cssToString.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = function() {
var list = [];
list.toString = function toString() {
var result = [];
for(var i = 0; i < this.length; i++) {
var item = this[i];
if(item[2]) {
result.push("@media " + item[2] + "{" + item[1] + "}");
} else {
result.push(item[1]);
}
}
return result.join("");
};
return list;
}
/***/ },
/* 3 */
/*!*********************************************!*\
!*** (webpack)/~/css-loader/mergeImport.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = function(list, importedList, media) {
for(var i = 0; i < importedList.length; i++) {
var item = importedList[i];
if(media && !item[2])
item[2] = media;
else if(media) {
item[2] = "(" + item[2] + ") and (" + media + ")";
}
list.push(item);
}
};
/***/ },
/* 4 */
/*!***************************************************************************!*\
!*** (webpack)/~/css-loader!./loaders/_css/folder/stylesheet-import1.css ***!
\***************************************************************************/
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! (webpack)/~/css-loader/cssToString.js */ 2)();
__webpack_require__(/*! (webpack)/~/css-loader/mergeImport.js */ 3)(exports, __webpack_require__(/*! -!(webpack)/~/css-loader!resources-module/stylesheet-import2.css */ 6), "print, screen");
__webpack_require__(/*! (webpack)/~/css-loader/mergeImport.js */ 3)(exports, __webpack_require__(/*! -!(webpack)/~/css-loader!./stylesheet-import3.css */ 5), "print and screen");
exports.push([module.id, "\r\n\r\n\r\n.rule-import1 {\r\n\tbackground: lightgreen;\r\n}\r\n", ""]);
/***/ },
/* 5 */
/*!***************************************************************************!*\
!*** (webpack)/~/css-loader!./loaders/_css/folder/stylesheet-import3.css ***!
\***************************************************************************/
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! (webpack)/~/css-loader/cssToString.js */ 2)();
exports.push([module.id, ".rule-import2 {\r\n\tbackground: red !important;\r\n}", ""]);
/***/ },
/* 6 */
/*!***************************************************************************************!*\
!*** (webpack)/~/css-loader!./loaders/_css/~/resources-module/stylesheet-import2.css ***!
\***************************************************************************************/
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! (webpack)/~/css-loader/cssToString.js */ 2)();
exports.push([module.id, ".rule-import2 {\r\n\tbackground: lightgreen;\r\n}", ""]);
/***/ }
/******/ ])
|
'use strict'
// dependencies
var path = require('path'),
request = require('request'),
// container connections
ccs = [];
// function to get all containers
function GetAllContainers(host, func) {
request({
json: true,
method: 'GET',
uri: host + '/containers/json'
}, function (err, resp, body) {
var containers = [];
if (err) {
return func(err, containers);
}
if (resp.statusCode != 200) {
return func(new Error("Status from server was: " + resp.statusCode), containers);
}
if (body.length <= 0) {
return func(new Error("You have no containers currently.", containers))
}
body.forEach(function(el) {
containers.push(el)
});
return func(err, containers);
});
};
function GetStats(host, containerID, statsCB) {
ccs.map(function(e){
e.destroy();
ccs.pop();
})
ccs.push(request({
json: true,
method: 'GET',
uri: host + '/containers/' + containerID + '/stats'
})
.on('data', function(data){
statsCB(JSON.parse(data))
}))
};
exports.GetAllContainers = GetAllContainers;
exports.GetStats = GetStats;
|
/**
* Convenient Redis Storage mock for testing purposes
*/
var util = require ('util');
function StorageMocked(data){
data = data || {};
this.currentOutage = data.currentOutage;
}
exports = module.exports = StorageMocked;
StorageMocked.prototype.startOutage = function (service, outageData, callback) {
this.currentOutage = outageData;
setImmediate(function(){
callback(null);
});
};
StorageMocked.prototype.getCurrentOutage = function (service, callback) {
var self = this;
setImmediate(function(){
callback(null, self.currentOutage);
});
};
StorageMocked.prototype.saveLatency = function (service, timestamp, latency, callback) {
setImmediate(function(){
callback(null);
});
};
StorageMocked.prototype.archiveCurrentOutageIfExists = function (service, callback) {
var self = this;
setImmediate(function(){
callback(null, self.currentOutage);
});
};
StorageMocked.prototype.flush_database = function (callback){
setImmediate(function(){
callback(null);
});
};
|
/*
* Copyright (C) 2015-2017 NS Solutions Corporation, All Rights Reserved.
*/
(function() {
/**
* @namespace hifive.pitalium.explorer.constant
*/
h5.u.obj.expose('hifive.pitalium.explorer.constant', {});
})();
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
export default [
[
['saa sita za usiku', 'saa sita za mchana', 'alfajiri', 'asubuhi', 'mchana', 'jioni', 'usiku'],
,
],
,
[
'00:00', '12:00', ['04:00', '07:00'], ['07:00', '12:00'], ['12:00', '16:00'],
['16:00', '19:00'], ['19:00', '04:00']
]
];
//# sourceMappingURL=sw-KE.js.map
|
(function () {
module.exports = {
error: function () {
console.error.apply(console,arguments)
}
}
})()
|
var searchData=
[
['revision_20history_20of_20cmsis_2dpack',['Revision History of CMSIS-Pack',['../pack_revisionHistory.html',1,'index']]]
];
|
/**
*
* @authors Your Name (you@example.org)
* @date 2015-11-23 12:01:49
* @version $Id$
*/
/**
*
* @authors Your Name (you@example.org)
* @date 2015-11-06 11:48:36
* @version $$Id$$
*/
var $$ = function(el) {
return new _$$(el);
};
var _$$ = function(el) {
this.el = (el && el.nodeType == 1)? el: document;
};
_$$.prototype = {
constructor: this,
addEvent: function(type, fn, capture) {
var el = this.el;
if (window.addEventListener) {
el.addEventListener(type, fn, capture);
var ev = document.createEvent("HTMLEvents");
//D:\Laboratory\html\mygithub\mylabs\client\jquery\event 这里也有讲解
ev.initEvent(type, capture || false, false);
//event.initEvent(eventType,canBubble,cancelable)
//eventType字符串值。事件的类型。
//canBubble事件是否起泡。
//cancelable是否可以用 preventDefault() 方法取消事件。
// 在元素上存储创建的事件,方便自定义触发
if (!el["ev" + type]) {
el["ev" + type] = ev;
}
} else if (window.attachEvent) {
el.attachEvent("on" + type, fn);
if (isNaN(el["cu" + type])) {
// 自定义属性,触发事件用
el["cu" + type] = 0;
}
var fnEv = function(event) {
if (event.propertyName == "cu" + type) {
fn.call(el);
}
};
el.attachEvent("onpropertychange", fnEv);
// 在元素上存储绑定的propertychange事件,方便删除
if (!el["ev" + type]) {
el["ev" + type] = [fnEv];
} else {
el["ev" + type].push(fnEv);
}
}
return this;
},
fireEvent: function(type) {
var el = this.el;
if (typeof type === "string") {
if (document.dispatchEvent) {
if (el["ev" + type]) {
el.dispatchEvent(el["ev" + type]);
}
} else if (document.attachEvent) {
// 改变对应自定义属性,触发自定义事件
el["cu" + type]++;
}
}
return this;
},
removeEvent: function(type, fn, capture) {
var el = this.el;
if (window.removeEventListener) {
el.removeEventListener(type, fn, capture || false);
} else if (document.attachEvent) {
el.detachEvent("on" + type, fn);
var arrEv = el["ev" + type];
if (arrEv instanceof Array) {
for (var i=0; i<arrEv.length; i+=1) {
// 删除该方法名下所有绑定的propertychange事件
el.detachEvent("onpropertychange", arrEv[i]);
}
}
}
return this;
}
};
var page = document.getElementById("page");
$$(page).addEvent("selectedEvent",function callback(event){
});
// ------------- 以下为测试用脚本------------
// var fnClick = function(e) {
// e = e || window.event;
// var target = e.target || e.srcElement;
// if (target.nodeType === 1) {
// alert("点击类型:" + e.type);
// $$(target).fireEvent("alert");
// }
// }, funAlert1 = function() {
// alert("自定义alert事件弹出!");
// }, funAlert2 = function() {
// alert("自定义alert事件再次弹出!");
// };
// // 测试用的张小姐图片
// var elImage = document.getElementById("image");
// $$(elImage)
// .addEvent("click", fnClick)
// .addEvent("alert", funAlert1)
// .addEvent("alert", funAlert2);
// // 删除自定义事件按钮
// var elButton = document.getElementById("button");
// $$(elButton).addEvent("click", function() {
// $$(elImage)
// .removeEvent("alert", funAlert1)
// .removeEvent("alert", funAlert2);
// alert("清除成功!");
// });
|
module.exports = function(grunt){
var config = {
docs: {
dir: "./test",
target: "./doc/TestPlan.md"
}
};
return config;
};
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
/**
* List of WorkloadItem resources
*/
class WorkloadItemResourceList extends Array {
/**
* Create a WorkloadItemResourceList.
*/
constructor() {
super();
}
/**
* Defines the metadata of WorkloadItemResourceList
*
* @returns {object} metadata of WorkloadItemResourceList
*
*/
mapper() {
return {
required: false,
serializedName: 'WorkloadItemResourceList',
type: {
name: 'Composite',
className: 'WorkloadItemResourceList',
modelProperties: {
nextLink: {
required: false,
serializedName: 'nextLink',
type: {
name: 'String'
}
},
value: {
required: false,
serializedName: '',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'WorkloadItemResourceElementType',
type: {
name: 'Composite',
className: 'WorkloadItemResource'
}
}
}
}
}
}
};
}
}
module.exports = WorkloadItemResourceList;
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var App = require('app');
require('controllers/main/service/info/metric');
var testHelpers = require('test/helpers');
function getController() {
return App.MainServiceInfoMetricsController.create();
}
describe('App.MainServiceInfoMetricsController', function () {
var controller;
beforeEach(function () {
controller = App.MainServiceInfoMetricsController.create();
});
App.TestAliases.testAsComputedOr(getController(), 'showTimeRangeControl', ['!isServiceWithEnhancedWidgets', 'someWidgetGraphExists']);
describe("#getActiveWidgetLayout() for Enhanced Dashboard", function () {
it("make GET call", function () {
controller.reopen({
isServiceWithEnhancedWidgets: true,
content: Em.Object.create({serviceName: 'HDFS'})
});
controller.getActiveWidgetLayout();
expect(testHelpers.findAjaxRequest('name', 'widgets.layouts.active.get')).to.exists;
});
});
describe("#getActiveWidgetLayoutSuccessCallback()", function () {
beforeEach(function () {
sinon.stub( App.widgetLayoutMapper, 'map');
sinon.stub( App.widgetMapper, 'map');
});
afterEach(function () {
App.widgetLayoutMapper.map.restore();
App.widgetMapper.map.restore();
});
it("isWidgetLayoutsLoaded should be set to true", function () {
controller.reopen({
isServiceWithEnhancedWidgets: true,
content: Em.Object.create({serviceName: 'HDFS'})
});
controller.getActiveWidgetLayoutSuccessCallback({items:[{
WidgetLayoutInfo: {}
}]});
expect(controller.get('isWidgetsLoaded')).to.be.true;
});
});
describe("#hideWidgetSuccessCallback()", function () {
beforeEach(function () {
sinon.stub(App.widgetLayoutMapper, 'map');
sinon.stub(controller, 'propertyDidChange');
var params = {
data: {
WidgetLayoutInfo: {
widgets: [
{id: 1}
]
}
}
};
controller.hideWidgetSuccessCallback({}, {}, params);
});
afterEach(function () {
App.widgetLayoutMapper.map.restore();
controller.propertyDidChange.restore();
});
it("mapper is called with valid data", function () {
expect(App.widgetLayoutMapper.map.calledWith({
items: [{
WidgetLayoutInfo: {
widgets: [
{
WidgetInfo: {
id: 1
}
}
]
}
}]
})).to.be.true;
});
it('`widgets` is forced to be recalculated', function () {
expect(controller.propertyDidChange.calledWith('widgets')).to.be.true;
});
});
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
The scope chain is initialised to contain the same objects,
in the same order, as the calling context's scope chain
es5id: 10.4.2_A1.1_T10
description: eval within global execution context
flags: [noStrict]
---*/
var i;
var j;
str1 = '';
str2 = '';
var x = 1;
var y = 2;
for(i in this){
str1+=i;
}
eval('for(j in this){\nstr2+=j;\n}');
if(!(str1 === str2)){
$ERROR("#1: scope chain must contain same objects in the same order as the calling context");
}
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
const models = require('./index');
/**
* A copy activity Netezza source.
*
* @extends models['CopySource']
*/
class NetezzaSource extends models['CopySource'] {
/**
* Create a NetezzaSource.
* @member {object} [query] A query to retrieve data from source. Type:
* string (or Expression with resultType string).
*/
constructor() {
super();
}
/**
* Defines the metadata of NetezzaSource
*
* @returns {object} metadata of NetezzaSource
*
*/
mapper() {
return {
required: false,
serializedName: 'NetezzaSource',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'type',
clientName: 'type'
},
uberParent: 'CopySource',
className: 'NetezzaSource',
modelProperties: {
sourceRetryCount: {
required: false,
serializedName: 'sourceRetryCount',
type: {
name: 'Object'
}
},
sourceRetryWait: {
required: false,
serializedName: 'sourceRetryWait',
type: {
name: 'Object'
}
},
type: {
required: true,
serializedName: 'type',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
query: {
required: false,
serializedName: 'query',
type: {
name: 'Object'
}
}
}
}
};
}
}
module.exports = NetezzaSource;
|
var searchData=
[
['shadow_5fack_5fstatus_5ft',['Shadow_Ack_Status_t',['../aws__iot__shadow__interface_8h.html#ad946163c2ac5df0aa896520949d47956',1,'aws_iot_shadow_interface.h']]],
['shadowactions_5ft',['ShadowActions_t',['../aws__iot__shadow__interface_8h.html#a1fc9e025434023d44d33737f8b7c2a8c',1,'aws_iot_shadow_interface.h']]]
];
|
/*
jjs -Djava.system.class.loader=io.trivium.TriviumLoader -Djava.protocol.handler.pkgs=io.trivium.urlhandler -server -cp bnd-tibco-ems-receiver:tpe-timer:tsk-consoleLogger:bnd-timer:tpe-timerconfig:tsk-excel2table:tpe-error:tpe-timertick:tsk-java-compiler:tpe-logentry:trivium-core:tsk-js-runner:tpe-table:tsk-TimerTick2LogEntryMapper:tsk-log
*/
var args =["-cq","-cs","-ll","fine","-p","/Users/jens/tmp/store","-t","1m"];
var mainType = Java.type("io.trivium.Start");
mainType.main(args);
var Central = Java.type("io.trivium.Central");
var Registry = Java.type('io.trivium.Registry');
var ObjectRef = Java.type('io.trivium.anystore.ObjectRef');
//print("central is running => "+Central.isRunning);
|
/**
* Copyright (c) 2008-2009 The Open Source Geospatial Foundation
*
* Published under the BSD license.
* See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
*/
/** api: example[attribute-form]
* Attribute Form
* --------------
* Create a form with fields from attributes read from a WFS
* DescribeFeatureType response
*/
var form;
Ext.onReady(function() {
Ext.QuickTips.init();
// create attributes store
var attributeStore = new GeoExt.data.AttributeStore({
url: "data/describe_feature_type.xml"
});
form = new Ext.form.FormPanel({
renderTo: document.body,
autoScroll: true,
height: 300,
width: 350,
defaults: {
width: 120,
maxLengthText: "too long",
minLengthText: "too short"
},
plugins: [
new GeoExt.plugins.AttributeForm({
attributeStore: attributeStore,
recordToFieldOptions: {
labelTpl: new Ext.XTemplate(
'{name}{[this.getStar(values)]}', {
compiled: true,
disableFormats: true,
getStar: function(v) {
return v.nillable ? '' : ' *';
}
}
)
}
})
]
});
attributeStore.load();
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.