text
stringlengths 2
6.14k
|
|---|
/**
* Nooku Platform - http://www.nooku.org/platform
*
* @copyright Copyright (C) 2011 - 2014 Johan Janssens and Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link https://github.com/nooku/nooku-platform for the canonical source repository
*/
if(!Attachments) var Attachments = {};
Attachments.List = new Class({
element : null,
initialize: function(options) {
this.element = document.id(options.container);
this.url = options.action;
this.token = options.token;
this.coordinates = '';
this.trueSize = '';
if(!this.element) {
return;
}
this.addCrop();
var that = this;
this.element.getElements('a[data-action]').each(function(a) {
if(a.get('data-action'))
{
a.addEvent('click', function(e) {
e.stop();
that.execute(this.get('data-action'), this.get('data-id'), this.get('data-row'));
});
}
});
},
addCrop: function()
{
var target = jQuery('#target');
var img = new Image(), self = this;
img.onload = function() {
self.trueSize = [this.width, this.height];
if (target.length) {
target.Jcrop({
boxWidth: 600,
boxHeight: 600,
trueSize: self.trueSize,
aspectRatio: 4 / 3,
minSize: [200, 150],
setSelect: [0, 0, 200, 150],
onSelect: self.setCoordinates.bind(self),
onChange: self.setCoordinates.bind(self)
});
}
};
var source = target.attr("src");
if (source) {
img.src = source;
}
},
setCoordinates: function(c)
{
this.coordinates = c;
},
execute: function(action, id, row)
{
var method = '_action' + action.capitalize();
if($type(this[method]) == 'function')
{
this.action = action;
var uri = new URI(this.url);
uri.setData('id', id);
this[method].call(this, uri);
}
},
_actionDelete: function(uri)
{
var form = new Kodekit.Form({
method: 'post',
url: uri.toString(),
params: {
_action: 'delete',
csrf_token: this.token
}
});
form.submit();
},
_actionCrop: function(uri)
{
jQuery.ajax({
url: uri.toString(),
dataType: 'json',
method: 'post',
data: {
_action: 'edit',
csrf_token: this.token,
x1: this.coordinates.x,
y1: this.coordinates.y,
x2: this.coordinates.x2,
y2: this.coordinates.y2
}
}).then(function(data, textStatus, xhr) {
if (xhr.status === 204) {
jQuery.ajax({
url: uri.toString(),
dataType: 'json',
method: 'get'
}).then(function(data, textStatus, xhr) {
if (xhr.status === 200 && typeof data.item === 'object') {
var thumbnail = data.item.thumbnail,
element = window.parent.jQuery('.thumbnail[data-id="'+data.item.id+'"] img'),
source = element.attr('src');
thumbnail = source.substring(0, source.lastIndexOf('/'))+'/'+thumbnail;
element.attr('src', thumbnail);
if (window.parent.SqueezeBox) {
window.parent.SqueezeBox.close();
}
}
});
} else {
alert('Unable to crop thumbnail');
}
});
}
});
|
/*! JointJS v3.4.1 (2021-08-18) - JavaScript diagramming library
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/.
*/
this.joint = this.joint || {};
this.joint.shapes = this.joint.shapes || {};
(function (exports, basic_mjs, Element_mjs, Link_mjs) {
'use strict';
var State = basic_mjs.Circle.define('fsa.State', {
attrs: {
circle: { 'stroke-width': 3 },
text: { 'font-weight': '800' }
}
});
var StartState = Element_mjs.Element.define('fsa.StartState', {
size: { width: 20, height: 20 },
attrs: {
circle: {
transform: 'translate(10, 10)',
r: 10,
fill: '#000000'
}
}
}, {
markup: '<g class="rotatable"><g class="scalable"><circle/></g></g>',
});
var EndState = Element_mjs.Element.define('fsa.EndState', {
size: { width: 20, height: 20 },
attrs: {
'.outer': {
transform: 'translate(10, 10)',
r: 10,
fill: '#ffffff',
stroke: '#000000'
},
'.inner': {
transform: 'translate(10, 10)',
r: 6,
fill: '#000000'
}
}
}, {
markup: '<g class="rotatable"><g class="scalable"><circle class="outer"/><circle class="inner"/></g></g>',
});
var Arrow = Link_mjs.Link.define('fsa.Arrow', {
attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }},
smooth: true
});
exports.Arrow = Arrow;
exports.EndState = EndState;
exports.StartState = StartState;
exports.State = State;
}(this.joint.shapes.fsa = this.joint.shapes.fsa || {}, joint.shapes.basic, joint.dia, joint.dia));
|
/* 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/. */
import { createStore, applyMiddleware } from 'redux';
import threadDispatcher from '../../common/thread-middleware';
import handleMessages from '../../common/message-handler';
import messages from './messages-worker';
import reducers from './reducers';
import thunk from 'redux-thunk';
const store = createStore(
// Reducers:
reducers,
// Initial State:
{},
// Enhancers:
applyMiddleware(
...[
thunk,
threadDispatcher(self, 'toContent'),
].filter(fn => fn)
)
);
handleMessages(self, store, messages);
|
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//-----------------------------------------------------------------------------
var BUGNUMBER = 474935;
var summary = 'Do not assert: !ti->typeMap.matches(ti_other->typeMap)';
var actual = '';
var expect = '';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
var a = ["", 0, 0, 0, 0, 0, "", "", 0, "", 0, ""];
var i = 0;
var g = 0;
for each (let e in a) {
"" + [e];
if (i == 3 || i == 7) {
for each (g in [1]) {
}
}
++i;
}
reportCompare(expect, actual, summary);
exitFunc ('test');
}
|
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import IconButton from './icon_button';
import DropdownMenu from './dropdown_menu';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
const messages = defineMessages({
delete: { id: 'status.delete', defaultMessage: 'Delete' },
mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' },
mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },
block: { id: 'account.block', defaultMessage: 'Block @{name}' },
reply: { id: 'status.reply', defaultMessage: 'Reply' },
replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
open: { id: 'status.open', defaultMessage: 'Expand this status' },
report: { id: 'status.report', defaultMessage: 'Report @{name}' },
muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },
unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },
});
@injectIntl
export default class StatusActionBar extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
status: ImmutablePropTypes.map.isRequired,
onReply: PropTypes.func,
onFavourite: PropTypes.func,
onReblog: PropTypes.func,
onDelete: PropTypes.func,
onMention: PropTypes.func,
onMute: PropTypes.func,
onBlock: PropTypes.func,
onReport: PropTypes.func,
onMuteConversation: PropTypes.func,
me: PropTypes.number.isRequired,
withDismiss: PropTypes.bool,
intl: PropTypes.object.isRequired,
};
// Avoid checking props that are functions (and whose equality will always
// evaluate to false. See react-immutable-pure-component for usage.
updateOnProps = [
'status',
'me',
'withDismiss',
]
handleReplyClick = () => {
this.props.onReply(this.props.status, this.context.router.history);
}
handleFavouriteClick = () => {
this.props.onFavourite(this.props.status);
}
handleReblogClick = (e) => {
this.props.onReblog(this.props.status, e);
}
handleDeleteClick = () => {
this.props.onDelete(this.props.status);
}
handleMentionClick = () => {
this.props.onMention(this.props.status.get('account'), this.context.router.history);
}
handleMuteClick = () => {
this.props.onMute(this.props.status.get('account'));
}
handleBlockClick = () => {
this.props.onBlock(this.props.status.get('account'));
}
handleOpen = () => {
this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);
}
handleReport = () => {
this.props.onReport(this.props.status);
}
handleConversationMuteClick = () => {
this.props.onMuteConversation(this.props.status);
}
render () {
const { status, me, intl, withDismiss } = this.props;
const reblogDisabled = status.get('visibility') === 'private' || status.get('visibility') === 'direct';
const mutingConversation = status.get('muted');
let menu = [];
let reblogIcon = 'retweet';
let replyIcon;
let replyTitle;
menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen });
menu.push(null);
if (withDismiss) {
menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });
menu.push(null);
}
if (status.getIn(['account', 'id']) === me) {
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
} else {
menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });
menu.push(null);
menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });
menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });
menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });
}
if (status.get('visibility') === 'direct') {
reblogIcon = 'envelope';
} else if (status.get('visibility') === 'private') {
reblogIcon = 'lock';
}
if (status.get('in_reply_to_id', null) === null) {
replyIcon = 'reply';
replyTitle = intl.formatMessage(messages.reply);
} else {
replyIcon = 'reply-all';
replyTitle = intl.formatMessage(messages.replyAll);
}
return (
<div className='status__action-bar'>
<IconButton className='status__action-bar-button' title={replyTitle} icon={replyIcon} onClick={this.handleReplyClick} />
<IconButton className='status__action-bar-button' disabled={reblogDisabled} active={status.get('reblogged')} title={reblogDisabled ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)} icon={reblogIcon} onClick={this.handleReblogClick} />
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} />
<div className='status__action-bar-dropdown'>
<DropdownMenu items={menu} icon='ellipsis-h' size={18} direction='right' ariaLabel='More' />
</div>
</div>
);
}
}
|
import ITEM_QUALITIES from '../ITEM_QUALITIES';
export default {
// Shared legendaries
SOUL_OF_THE_SHADOWBLADE: {
id: 150936,
name: 'Soul of the Shadowblade',
icon: 'inv_jewelry_ring_56',
quality: ITEM_QUALITIES.LEGENDARY,
},
MANTLE_OF_THE_MASTER_ASSASSIN: {
id: 144236,
name: 'Mantle of the Master Assassin',
icon: 'inv_shoulder_leather_raidrogue_k_01',
quality: ITEM_QUALITIES.LEGENDARY,
},
INSIGNIA_OF_RAVENHOLDT: {
id: 137049,
name: 'Insignia of Ravenholdt',
icon: 'inv_misc_epicring_a2',
quality: ITEM_QUALITIES.LEGENDARY,
},
WILL_OF_VALEERA: {
id: 137069,
name: 'Will of Valeera',
icon: 'inv_pants_cloth_02',
quality: ITEM_QUALITIES.LEGENDARY,
},
THE_DREADLORDS_DECEIT: {
id: 137021,
name: 'The Dreadlord\'s Deceit',
icon: 'inv_cape_pandaria_d_03',
quality: ITEM_QUALITIES.LEGENDARY,
},
// Assassination legendaries
DUSKWALKERS_FOOTPADS: {
id: 137030,
name: 'Duskwalker\'s Footpads',
icon: 'inv_boots_leather_8',
quality: ITEM_QUALITIES.LEGENDARY,
},
ZOLDYCK_FAMILY_TRAINING_SHACKLES: {
id: 137098,
name: 'Zoldyck Family Training Shackles',
icon: 'inv_bracer_leather_raiddruid_i_01',
quality: ITEM_QUALITIES.LEGENDARY,
},
THE_EMPTY_CROWN: {
id: 151815,
name: 'The Empty Crown',
icon: 'inv_crown_02',
quality: ITEM_QUALITIES.LEGENDARY,
},
// Outlaw legendaries
THRAXIS_TRICKSY_TREADS: {
id: 137031,
name: 'Thraxi\'s Tricksy Treads',
icon: 'inv_boots_leather_03a',
quality: ITEM_QUALITIES.LEGENDARY,
},
GREENSKINS_WATERLOGGED_WRISTCUFFS: {
id: 137099,
name: 'Greenskin\'s Waterlogged Wristcuffs',
icon: 'inv_bracer_leather_raidrogue_k_01',
quality: ITEM_QUALITIES.LEGENDARY,
},
SHIVARRAN_SYMMETRY: {
id: 141321,
name: 'Shivarran Symmetry',
icon: 'inv_gauntlets_83',
quality: ITEM_QUALITIES.LEGENDARY,
},
THE_CURSE_OF_RESTLESSNESS: {
id: 151817,
name: 'The Curse of Restlessness',
icon: 'inv_qiraj_draperegal',
quality: ITEM_QUALITIES.LEGENDARY,
},
// Subtlety legendaries
SHADOW_SATYRS_WALK: {
id: 137032,
name: 'Shadow Satyr\'s Walk',
icon: 'inv_boots_mail_dungeonmail_c_04',
quality: ITEM_QUALITIES.LEGENDARY,
},
DENIAL_OF_THE_HALF_GIANTS: {
id: 137100,
name: 'Denial of the Half-Giants',
icon: 'inv_bracer_leather_panda_b_02_crimson',
quality: ITEM_QUALITIES.LEGENDARY,
},
THE_FIRST_OF_THE_DEAD: {
id: 151818,
name: 'The First of the Dead',
icon: 'inv_glove_cloth_raidwarlockmythic_q_01',
quality: ITEM_QUALITIES.LEGENDARY,
},
};
|
const LdapStrategy = require('./LdapStrategy');
const MoodleStrategy = require('./MoodleStrategy');
const IservStrategy = require('./IservStrategy');
const TSPStrategy = require('./TSPStrategy');
const ApiKeyStrategy = require('./ApiKeyStrategy');
module.exports = {
LdapStrategy,
MoodleStrategy,
IservStrategy,
TSPStrategy,
ApiKeyStrategy,
};
|
// Generated by CoffeeScript 1.10.0
var api, baseOVHKonnector, connector, name, slug;
baseOVHKonnector = require('../lib/base_ovh_konnector');
name = 'Kimsufi EU';
slug = 'kimsufi_eu';
api = {
endpoint: 'kimsufi-eu',
appKey: '',
appSecret: ''
};
connector = module.exports = baseOVHKonnector.createNew(api, name, slug);
|
/* Taken from a very informative blogpost by Eldar Djafarov:
* http://eldar.djafarov.com/2013/11/reactjs-mixing-with-backbone/
*/
(function() {
'use strict';
module.exports = {
/* Forces an update when the underlying Backbone model instance has
* changed. Users will have to implement getBackboneModels().
* Also requires that React is loaded with addons.
*/
__syncedModels: [],
componentDidMount: function() {
// Whenever there may be a change in the Backbone data, trigger a reconcile.
this.getBackboneModels().forEach(this.injectModel, this);
},
componentWillUnmount: function() {
// Ensure that we clean up any dangling references when the component is
// destroyed.
this.__syncedModels.forEach(function(model) {
model.off(null, model.__updater, this);
}, this);
},
injectModel: function(model){
if(!~this.__syncedModels.indexOf(model)){
var updater = function() {
try {
this.forceUpdate();
} catch(e) {
// This means the component is already being updated somewhere
// else, so we just silently go on with our business.
// This is most likely due to some AJAX callback that already
// updated the model at the same time or slightly earlier.
}
}.bind(this, null);
model.__updater = updater;
model.on('add change remove', updater, this);
}
},
bindTo: function(model, key){
/* Allows for two-way databinding for Backbone models.
* Use by passing it as a 'valueLink' property, e.g.:
* valueLink={this.bindTo(model, attribute)} */
return {
value: model.get(key),
requestChange: function(value){
model.set(key, value);
}.bind(this)
};
}
};
})();
|
/*@author Jvlaple
*Crystal of Roots
*/
var status = 0;
var PQItems = Array(4001087, 4001088, 4001089, 4001090, 4001091, 4001092, 4001093);
importPackage(net.sf.odinms.client);
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (status >= 0 && mode == 0) {
cm.sendOk("Ok, keep preservering!");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0 ) {
cm.sendYesNo("Hello I'm the Dungeon Exit NPC. Do you wish to go out from here?");
} else if (status == 1) {
var eim = cm.getPlayer().getEventInstance();
cm.warp(100000000, 0);
if (eim != null) {
eim.unregisterPlayer(cm.getPlayer());
}cm.dispose();
}
}
}
|
// Generated by CoffeeScript 1.10.0
var Bill, baseKonnector, filterExisting, linkBankOperation, ovhFetcher, saveDataAndFile;
ovhFetcher = require('../lib/ovh_fetcher');
filterExisting = require('../lib/filter_existing');
saveDataAndFile = require('../lib/save_data_and_file');
linkBankOperation = require('../lib/link_bank_operation');
baseKonnector = require('../lib/base_konnector');
Bill = require('../models/bill');
module.exports = {
createNew: function(ovhApi, name, slug) {
var connector, fetchBills, fileOptions, logger, ovhFetcherInstance;
fileOptions = {
vendor: slug,
dateFormat: 'YYYYMMDD'
};
logger = require('printit')({
prefix: name,
date: true
});
ovhFetcherInstance = ovhFetcher["new"](ovhApi, slug, logger);
fetchBills = function(requiredFields, entries, body, next) {
return ovhFetcherInstance.fetchBills(requiredFields, entries, body, next);
};
return connector = baseKonnector.createNew({
name: name,
fields: {
loginUrl: "link",
token: "hidden",
folderPath: "folder"
},
models: [Bill],
fetchOperations: [
fetchBills, filterExisting(logger, Bill), saveDataAndFile(logger, Bill, fileOptions, ['bill']), linkBankOperation({
log: logger,
model: Bill,
identifier: slug,
dateDelta: 4,
amountDelta: 0.1
})
]
});
}
};
|
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import VueBootstrap from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(VueBootstrap)
// HTTP Client we use.
import Axios from 'axios'
// TODO: Set these during build time.
Axios.defaults.baseURL = 'http://localhost:8080'
Axios.defaults.headers['Content-Type'] = 'application/json; charset=UTF-8'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
template: '<App/>',
components: { App }
})
|
namespace("JSTools.Event");
/// <class>
/// Provides an interface for attaching and detaching Observer objects. Any number of
/// Observer objects may observe a subject.
/// </class>
JSTools.Event.Subject = function()
{
//------------------------------------------------------------------------
// Declarations
//------------------------------------------------------------------------
this.InitType(arguments, "JSTools.Event.Subject");
var _this = this;
var _observers = null;
//------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------
/// <constructor>
/// Creates a new JSTools.Event.Subject instance.
/// </constructor>
function Init()
{
_this.Clear();
}
//------------------------------------------------------------------------
// Methods
//------------------------------------------------------------------------
/// <method>
/// Removes all registered observer object.
/// </method>
function Clear()
{
_observers = [ ];
}
this.Clear = Clear;
/// <method>
/// Attaches the given observer function to this subject.
/// </method>
/// <param name="objIObserver" type="JSTools.Event.IObserver">Observer to attach.</param>
/// <returns type="Integer">Returns the index, at which the observer object has been added.
/// Returns -1 if the given observer object is invalid and not added.</returns>
function Attach(objIObserver)
{
if (objIObserver
&& typeof(objIObserver) == 'object'
&& objIObserver.IsTypeOf(JSTools.Event.IObserver))
{
_observers.Add(objIObserver);
return _observers.length - 1;
}
return -1;
}
this.Attach = Attach;
/// <method>
/// Detaches the given observer object from this subject.
/// </method>
/// <param name="objIObserverToDetach" type="JSTools.Event.IObserver">Observer to detach.</param>
function Detach(objIObserverToDetach)
{
_observers.Remove(objIObserverToDetach);
}
this.Detach = Detach;
/// <method>
/// Detaches an observer at the given index from this subject.
/// </method>
/// <param name="intIndex" type="Integer">Index to detach.</param>
function DetachByIndex(intIndex)
{
_observers.RemoveAt(intIndex);
}
this.DetachByIndex = DetachByIndex;
/// <method>
/// Notifies the observer about an update.
/// </method>
/// <param name="objEvent" type="Object">An object instance, which represents the event argument.</param>
function Notify(objEvent)
{
for (var i = 0; i < _observers.length; ++i)
{
_observers[i].Update(objEvent);
}
}
this.Notify = Notify;
Init();
}
|
var searchData=
[
['own_5faddress',['own_address',['../classRiots__BabyRadio.html#a0e4c8a64bf259ce380431879871bf872',1,'Riots_BabyRadio::own_address()'],['../classRiots__MamaRadio.html#ae1e3a65b5c9768df2a514fb984fe6a8c',1,'Riots_MamaRadio::own_address()']]],
['own_5fconfig_5fmessage',['own_config_message',['../classRiots__MamaRadio.html#a513d856339fc044e1ba21da1227be711',1,'Riots_MamaRadio']]],
['own_5fring_5fevent_5fongoing',['own_ring_event_ongoing',['../classRiots__BabyRadio.html#a20d65ad231afd698d7fd9440cf89d84b',1,'Riots_BabyRadio']]]
];
|
br.test.GwtTestRunner.initialize();
describe("Dashboard App", function() {
fixtures("brjs.dashboard.app.testing.DashboardFixtureFactory");
it("displays the screens that are visible", function() {
given("dash.loaded = true");
and("dash.model.appsScreen.visible = true");
and("dash.model.appDetailScreen.visible = true");
and("dash.model.releaseNoteScreen.visible = true");
then("dash.view.(#appsScreen).isVisible = true");
and("dash.view.(#appDetailScreen).isVisible = true");
and("dash.view.(#releaseNoteScreen).isVisible = true");
});
it("hides the screens that are not visible", function() {
given("dash.loaded = true");
and("dash.model.appsScreen.visible = false");
and("dash.model.appDetailScreen.visible = false");
and("dash.model.releaseNoteScreen.visible = false");
then("dash.view.(#appsScreen).isVisible = false");
and("dash.view.(#appDetailScreen).isVisible = false");
and("dash.view.(#releaseNoteScreen).isVisible = false");
});
});
|
var searchData=
[
['keep_5fhistory_2ecpp',['keep_history.cpp',['../keep__history_8cpp.html',1,'']]],
['keep_5fhistory_5fpass_2ecpp',['keep_history_pass.cpp',['../keep__history__pass_8cpp.html',1,'']]],
['keep_5fhistory_5fpass_2eh',['keep_history_pass.h',['../keep__history__pass_8h.html',1,'']]]
];
|
/**
* 基于jquery.select2扩展的select插件,基本使用请参考select2相关文档
* 默认是多选模式,并提供了input模式下的初始化方法,对应的数据格式是{ id: 1, text: "Hello" }
* 这里的参数只对扩展的部分作介绍
* filter、includes、excludes、query四个参数是互斥的,理论只能有其一个参数
* @method ibosSelect
* @param option.filter
* @param {Function} option.filter 用于过滤源数据的函数
* @param {Array} option.includes 用于过滤源数据的数据,有效数据的id组
* @param {Array} option.excludes 用于过滤源数据的数据,无效数据的id组
* @param {Boolean} option.pinyin 启用拼音搜索,需要pinyinEngine组件
* @return {jQuery}
*/
$.fn.ibosSelect = (function(){
var _process = function(datum, collection, filter){
var group, attr;
datum = datum[0];
if (datum.children) {
group = {};
for (attr in datum) {
if (datum.hasOwnProperty(attr)) group[attr] = datum[attr];
}
group.children = [];
$(datum.children).each2(function(i, childDatum) {
_process(childDatum, group.children, filter);
});
if (group.children.length) {
collection.push(group);
}
} else {
if(filter && !filter(datum)) {
return false;
}
collection.push(datum);
}
}
// 使用带有filter过滤源数据的query函数,其实质就是在query函数执行之前,用filter函数先过滤一次数据
var _queryWithFilter = function(query, filter){
var t = query.term, filtered = { results: [] }, data = [];
$(this.data).each2(function(i, datum) {
_process(datum, data, filter);
});
if (t === "") {
query.callback({ results: data });
return;
}
$(data).each2(function(i, datum) {
_process(datum, filtered.results, function(d){
return query.matcher(t, d.text + "");
})
});
query.callback(filtered);
}
// 根据ID从data数组中获取对应的文本, 主要用于val设置
var _getTextById = function(id, data){
// debugger;
var ret;
for(var i = 0; i < data.length; i++){
if(data[i].children){
ret = _getTextById(id, data[i].children);
if(typeof ret !== "undefined"){
break;
}
} else {
if(data[i].id + "" === id) {
ret = data[i].text;
break;
}
}
}
return ret;
}
var defaults = {
multiple: true,
pinyin: true,
formatResultCssClass: function(data){
return data.cls;
},
formatNoMatches: function(){ return U.lang("S2.NO_MATCHES"); },
formatSelectionTooBig: function (limit) { return U.lang("S2.SELECTION_TO_BIG", { count: limit}); },
formatSearching: function () { return U.lang("S2.SEARCHING"); },
formatInputTooShort: function (input, min) { return U.lang("S2.INPUT_TO_SHORT", { count: min - input.length}); },
formatLoadMore: function (pageNumber) { return U.lang("S2.LOADING_MORE"); },
initSelection: function(elem, callback){
var ins = elem.data("select2"),
data = ins.opts.data,
results;
if(ins.opts.multiple) {
results = [];
$.each(elem.val().split(','), function(index, val){
results.push({id: val, text: _getTextById(val, data)});
})
} else {
results = {
id: elem.val(),
text: _getTextById(elem.val(), data)
}
}
callback(results);
}
}
var select2 = function(option){
if(typeof option !== "string") {
option = $.extend({}, defaults, option);
// 注意: filter | query | includes | excludes 四个属性是互斥的
// filter基于query, 而includes、excludes基于filter
// 优先度 includes > excludes > filter > query
// includes是一个数组,指定源数据中有效数据的ID值,将过滤ID不在此数组中的数据
if(option.includes && $.isArray(option.includes)){
option.filter = function(datum){
return $.inArray(datum.id, option.includes) !== -1;
}
// includes是一个数组,指定源数据中无效数据的ID值,将过滤ID在此数组中的数据
} else if(option.excludes && $.isArray(option.excludes)) {
option.filter = function(datum){
return $.inArray(datum.id, option.excludes) === -1;
}
}
// 当有filter属性时,将使用自定义的query方法替代原来的query方法,filter用于从源数据层面上过滤不需要出现的数据
if(option.filter){
option.query = function(query) {
_queryWithFilter(query, option.filter);
}
}
// 使用pinyin搜索引擎
if(option.pinyin) {
var _customMatcher = option.matcher;
option.matcher = function(term){
if(term === ""){
return true;
}
return Ibos.matchSpell.apply(this, arguments) &&
(_customMatcher ? _customMatcher.apply(this, arguments) : true);
}
}
// 使用 select 元素时,要去掉一部分默认项
if($(this).is("select")) {
delete option.multiple;
delete option.initSelection;
}
return $.fn.select2.call(this, option)
}
return $.fn.select2.apply(this, arguments)
}
return select2;
})();
|
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
function Square(props) {
return (
<button className="square" onClick={props.onClick}>
{props.value}
</button>
);
}
class Board extends React.Component {
renderSquare(i) {
return (
<Square
value={this.props.squares[i]}
onClick={() => this.props.onClick(i)}
/>
);
}
render() {
return (
<div>
<div className="board-row">
{this.renderSquare(0)}
{this.renderSquare(1)}
{this.renderSquare(2)}
</div>
<div className="board-row">
{this.renderSquare(3)}
{this.renderSquare(4)}
{this.renderSquare(5)}
</div>
<div className="board-row">
{this.renderSquare(6)}
{this.renderSquare(7)}
{this.renderSquare(8)}
</div>
</div>
);
}
}
class Game extends React.Component {
constructor(props) {
super(props);
this.state = {
history: [{
squares: Array(9).fill(null)
}],
xIsNext: true
};
}
handleClick(i) {
const history = this.state.history;
const current = history[history.length - 1];
const squares = current.squares.slice();
if (calculateWinner(squares) || squares[i]) {
return;
}
squares[i] = this.state.xIsNext ? 'X' : 'O';
this.setState({
history: history.concat([{
squares: squares
}]),
xIsNext: !this.state.xIsNext,
});
}
render() {
const history = this.state.history;
const current = history[history.length - 1];
const winner = calculateWinner(current.squares);
let status;
if (winner) {
status = 'Winner: ' + winner;
} else {
status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
}
return (
<div className="game">
<div className="game-board">
<Board
squares={current.squares}
onClick={(i) => this.handleClick(i)}
/>
</div>
<div className="game-info">
<div>{status}</div>
<ol>{/* TODO */}</ol>
</div>
</div>
);
}
}
// ========================================
ReactDOM.render(
<Game />,
document.getElementById('root')
);
function calculateWinner(squares) {
const lines = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6],
];
for (let i = 0; i < lines.length; i++) {
const [a, b, c] = lines[i];
if (squares[a] && squares[a] === squares[b] && squares[a] === squares[c]) {
return squares[a];
}
}
return null;
}
|
/*!
* ${copyright}
*/
// Provides class sap.ui.rta.plugin.Combine.
sap.ui.define([
'sap/ui/rta/plugin/Plugin',
'sap/ui/dt/Selection',
'sap/ui/dt/OverlayRegistry',
'sap/ui/rta/Utils'
], function(
Plugin,
Selection,
OverlayRegistry,
Utils
) {
"use strict";
/**
* Constructor for a new Combine Plugin.
*
* @class
* @extends sap.ui.rta.plugin.Plugin
* @author SAP SE
* @version ${version}
* @constructor
* @private
* @since 1.46
* @alias sap.ui.rta.plugin.Combine
* @experimental Since 1.46. This class is experimental and provides only limited functionality. Also the API might be changed in future.
*/
var Combine = Plugin.extend("sap.ui.rta.plugin.Combine", /** @lends sap.ui.rta.plugin.Combine.prototype */
{
metadata: {
// ---- object ----
// ---- control specific ----
library: "sap.ui.rta",
properties: {},
associations: {},
events: {}
}
});
/**
* check if the given overlay is editable
* @param {sap.ui.dt.ElementOverlay} oOverlay - overlay to be checked for editable
* @returns {boolean} whether it is editable or not
* @private
*/
Combine.prototype._isEditable = function(oOverlay) {
var oCombineAction = this.getAction(oOverlay);
if (oCombineAction && oCombineAction.changeType && oCombineAction.changeOnRelevantContainer) {
return this.hasChangeHandler(oCombineAction.changeType, oOverlay.getRelevantContainer()) && this.hasStableId(oOverlay);
} else {
return false;
}
};
Combine.prototype._checkForSameRelevantContainer = function(aSelectedOverlays) {
var aRelevantContainer = [];
for (var i = 0, n = aSelectedOverlays.length; i < n; i++) {
aRelevantContainer[i] = aSelectedOverlays[i].getRelevantContainer();
var oCombineAction = this.getAction(aSelectedOverlays[i]);
if (!oCombineAction || !oCombineAction.changeType){
return false;
}
if (i > 0) {
if ((aRelevantContainer[0] !== aRelevantContainer[i])
|| (this.getAction(aSelectedOverlays[0]).changeType !== oCombineAction.changeType)) {
return false;
}
}
}
return true;
};
/**
* Checks if Combine is available for oOverlay
*
* @param {sap.ui.dt.Overlay} oOverlay overlay object
* @return {boolean} true if available
* @public
*/
Combine.prototype.isAvailable = function(oOverlay) {
var aSelectedOverlays = this.getDesignTime().getSelection();
if (aSelectedOverlays.length <= 1) {
return false;
}
return (this._isEditableByPlugin(oOverlay) && this._checkForSameRelevantContainer(aSelectedOverlays));
};
/**
* Checks if Combine is enabled for oOverlay
*
* @param {sap.ui.dt.Overlay} oOverlay overlay object
* @return {boolean} true if enabled
* @public
*/
Combine.prototype.isEnabled = function(oOverlay) {
var aSelectedOverlays = this.getDesignTime().getSelection();
// check that at least 2 fields can be combined
if (!this.isAvailable(oOverlay) || aSelectedOverlays.length <= 1) {
return false;
}
var aSelectedControls = aSelectedOverlays.map(function (oSelectedOverlay) {
return oSelectedOverlay.getElementInstance();
});
// check that each selected element has an enabled action
var bActionCheck = aSelectedOverlays.every(function(oSelectedOverlay) {
var oAction = this.getAction(oSelectedOverlay);
if (!oAction) {
return false;
}
// when isEnabled is not defined the default is true
if (typeof oAction.isEnabled !== "undefined") {
if (typeof oAction.isEnabled === "function") {
return oAction.isEnabled(aSelectedControls);
} else {
return oAction.isEnabled;
}
}
return true;
}, this);
return bActionCheck;
};
/**
* @param {any} oCombineElement selected element
*/
Combine.prototype.handleCombine = function(oCombineElement) {
var oElementOverlay = OverlayRegistry.getOverlay(oCombineElement);
var oDesignTimeMetadata = oElementOverlay.getDesignTimeMetadata();
var aToCombineElements = [];
var aSelectedOverlays = this.getDesignTime().getSelection();
for (var i = 0; i < aSelectedOverlays.length; i++) {
var oSelectedElement = aSelectedOverlays[i].getElementInstance();
aToCombineElements.push(oSelectedElement);
}
var oCombineAction = this.getAction(oElementOverlay);
var sVariantManagementReference = this.getVariantManagementReference(oElementOverlay, oCombineAction);
var oCombineCommand = this.getCommandFactory().getCommandFor(oCombineElement, "combine", {
source : oCombineElement,
combineFields : aToCombineElements
}, oDesignTimeMetadata, sVariantManagementReference);
this.fireElementModified({
"command" : oCombineCommand
});
};
/**
* Retrieve the context menu item for the action.
* @param {sap.ui.dt.ElementOverlay} oOverlay Overlay for which the context menu was opened
* @return {object[]} Returns array containing the items with required data
*/
Combine.prototype.getMenuItems = function(oOverlay){
return this._getMenuItems(oOverlay, {pluginId : "CTX_GROUP_FIELDS", rank : 90});
};
/**
* Get the name of the action related to this plugin.
* @return {string} Returns the action name
*/
Combine.prototype.getActionName = function(){
return "combine";
};
/**
* Trigger the plugin execution.
* @param {sap.ui.dt.ElementOverlay[]} aOverlays Selected overlays; targets of the action
* @param {any} oEventItem ContextMenu item which triggers the event
* @param {any} oContextElement Element where the action is triggered
*/
Combine.prototype.handler = function(aOverlays, mPropertyBag){
//TODO: Handle "Stop Cut & Paste" depending on alignment with Dietrich!
this.handleCombine(mPropertyBag.contextElement);
};
return Combine;
}, /* bExport= */true);
|
"use strict";
describe("Brisket server", function() {
var Brisket = require("../../lib/brisket");
var MockBrisketApp = require("../mock/MockBrisketApp");
var nock = require("nock");
var supertest = require("supertest");
var brisketServer;
beforeEach(function() {
MockBrisketApp.initialize();
nock("http://api.example.com")
.get("/fetch200")
.reply(200, { ok: true })
.get("/fetch404")
.reply(404, { ok: false })
.get("/fetch500")
.reply(500, { ok: false })
.get("/fetch410")
.reply(410, { ok: false });
brisketServer = Brisket.createServer({
apis: {
"api": {
host: "http://api.example.com",
proxy: null
}
}
});
});
afterEach(function() {
MockBrisketApp.cleanup();
nock.cleanAll();
});
it("returns 200 when route is working", function(done) {
supertest(brisketServer)
.get("/working")
.expect(200, mocha(done));
});
it("returns 500 when route is failing", function(done) {
supertest(brisketServer)
.get("/failing")
.expect(500, mocha(done));
});
it("returns 302 when route is redirecting", function(done) {
supertest(brisketServer)
.get("/redirecting")
.expect(302, mocha(done));
});
it("returns status from route when route sets status", function(done) {
supertest(brisketServer)
.get("/setsStatus")
.expect(206, mocha(done));
});
it("returns 200 when data fetch is 200 AND route code doesn't error", function(done) {
supertest(brisketServer)
.get("/fetch200")
.expect(200, mocha(done));
});
it("returns 500 when data fetch is 200 BUT route code errors", function(done) {
supertest(brisketServer)
.get("/fetch200ButRouteFails")
.expect(500, mocha(done));
});
it("returns 302 when data fetch is 200 BUT route code redirects", function(done) {
supertest(brisketServer)
.get("/fetch200ButRouteRedirects")
.expect(302, mocha(done));
});
it("returns status from route when data fetch is 200 BUT route sets status", function(done) {
supertest(brisketServer)
.get("/fetch200ButRouteSetsStatus")
.expect(206, mocha(done));
});
it("returns 404 when route does NOT exist", function(done) {
supertest(brisketServer)
.get("/doesntexist")
.expect(404, mocha(done));
});
it("returns 404 when data fetch is 404", function(done) {
supertest(brisketServer)
.get("/fetch404")
.expect(404, mocha(done));
});
it("returns 500 when data fetch is 500", function(done) {
supertest(brisketServer)
.get("/fetch500")
.expect(500, mocha(done));
});
it("returns 500 when data fetch is unexpected error code", function(done) {
supertest(brisketServer)
.get("/fetch410")
.expect(500, mocha(done));
});
function mocha(done) {
return function(err) {
if (err) {
done.fail(err);
} else {
done();
}
};
}
});
|
'use strict';
angular.module('publisherApp')
.config(function ($stateProvider) {
$stateProvider
.state('settings', {
parent: 'account',
url: '/settings',
data: {
roles: ['ROLE_USER'],
pageTitle: 'global.menu.account.settings'
},
views: {
'container@': {
templateUrl: 'scripts/app/account/settings/settings.html',
controller: 'SettingsController'
}
},
resolve: {
translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) {
$translatePartialLoader.addPart('settings');
return $translate.refresh();
}]
}
});
});
|
/**
* @author caspar - chengzhihang
* @contact 279397942@qq.com
* @date 2016/12/29
* @file admin/view-partial/main/order/widget/form/value-widget/TpNameText
*/
define([
'zh/widget/text/ValidationTextBox',
'admin/services/enums/OrderPropertyEnum',
"dojo/_base/declare"
], function (TextBox, OrderPropertyEnum, declare) {
return declare('admin/view-partial/main/order/widget/form/value-widget/TpNameText', [TextBox], {
label: OrderPropertyEnum.TpName.text,
name: OrderPropertyEnum.TpName.id,
placeHolder: OrderPropertyEnum.TpName.text,
});
});
|
import {boolean, number, object, text, withKnobs} from '@storybook/addon-knobs';
import {
BentoAccordion,
BentoAccordionContent,
BentoAccordionHeader,
BentoAccordionSection,
} from '#bento/components/bento-accordion/1.0/component';
import {BentoVideo} from '#bento/components/bento-video/1.0/component';
import * as Preact from '#preact';
import '#bento/components/bento-video/1.0/component.jss';
export default {
title: 'Video',
component: BentoVideo,
decorators: [withKnobs],
};
const VideoTagPlayer = ({i}) => {
const group = `Player ${i + 1}`;
const width = text('width', '640px', group);
const height = text('height', '360px', group);
const ariaLabel = text('aria-label', 'Video Player', group);
const autoplay = boolean('autoplay', true, group);
const controls = boolean('controls', true, group);
const mediasession = boolean('mediasession', true, group);
const noaudio = boolean('noaudio', false, group);
const loop = boolean('loop', false, group);
const poster = text(
'poster',
'https://amp.dev/static/inline-examples/images/kitten-playing.png',
group
);
const artist = text('artist', '', group);
const album = text('album', '', group);
const artwork = text('artwork', '', group);
const title = text('title', '', group);
const sources = object(
'sources',
[
{
src: 'https://amp.dev/static/inline-examples/videos/kitten-playing.webm',
type: 'video/webm',
},
{
src: 'https://amp.dev/static/inline-examples/videos/kitten-playing.mp4',
type: 'video/mp4',
},
],
group
);
return (
<BentoVideo
component="video"
aria-label={ariaLabel}
autoplay={autoplay}
controls={controls}
mediasession={mediasession}
noaudio={noaudio}
loop={loop}
poster={poster}
artist={artist}
album={album}
artwork={artwork}
title={title}
style={{width, height}}
sources={sources.map((props) => (
<source {...props}></source>
))}
/>
);
};
const Spacer = ({height}) => {
return (
<div
style={{
height,
background: `linear-gradient(to bottom, #bbb, #bbb 10%, #fff 10%, #fff)`,
backgroundSize: '100% 10px',
}}
></div>
);
};
export const Default = () => {
const amount = number('Amount', 1, {}, 'Page');
const spacerHeight = text('Space', '80vh', 'Page');
const spaceAbove = boolean('Space above', false, 'Page');
const spaceBelow = boolean('Space below', false, 'Page');
const players = [];
for (let i = 0; i < amount; i++) {
players.push(<VideoTagPlayer key={i} i={i} />);
if (i < amount - 1) {
players.push(<Spacer height={spacerHeight} />);
}
}
return (
<>
{spaceAbove && <Spacer height={spacerHeight} />}
{players}
{spaceBelow && <Spacer height={spacerHeight} />}
</>
);
};
export const InsideAccordion = () => {
const width = text('width', '320px');
const height = text('height', '180px');
return (
<BentoAccordion expandSingleSection>
<BentoAccordionSection key={1} expanded>
<BentoAccordionHeader>
<h2>Controls</h2>
</BentoAccordionHeader>
<BentoAccordionContent>
<BentoVideo
component="video"
controls={true}
loop={true}
style={{width, height}}
src="https://amp.dev/static/inline-examples/videos/kitten-playing.mp4"
poster="https://amp.dev/static/inline-examples/images/kitten-playing.png"
/>
</BentoAccordionContent>
</BentoAccordionSection>
<BentoAccordionSection key={2}>
<BentoAccordionHeader>
<h2>Autoplay</h2>
</BentoAccordionHeader>
<BentoAccordionContent>
<BentoVideo
component="video"
autoplay={true}
loop={true}
style={{width, height}}
src="https://amp.dev/static/inline-examples/videos/kitten-playing.mp4"
poster="https://amp.dev/static/inline-examples/images/kitten-playing.png"
sources={[
<source
type="video/mp4"
src="https://amp.dev/static/inline-examples/videos/kitten-playing.mp4"
/>,
]}
/>
</BentoAccordionContent>
</BentoAccordionSection>
</BentoAccordion>
);
};
|
/*
* 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';
/**
* @class
* Initializes a new instance of the USqlExternalDataSourceList class.
* @constructor
* A Data Lake Analytics catalog U-SQL external datasource item list.
*
*/
class USqlExternalDataSourceList extends Array {
constructor() {
super();
}
/**
* Defines the metadata of USqlExternalDataSourceList
*
* @returns {object} metadata of USqlExternalDataSourceList
*
*/
mapper() {
return {
required: false,
serializedName: 'USqlExternalDataSourceList',
type: {
name: 'Composite',
className: 'USqlExternalDataSourceList',
modelProperties: {
nextLink: {
required: false,
serializedName: 'nextLink',
type: {
name: 'String'
}
},
value: {
required: false,
readOnly: true,
serializedName: '',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'USqlExternalDataSourceElementType',
type: {
name: 'Composite',
className: 'USqlExternalDataSource'
}
}
}
}
}
}
};
}
}
module.exports = USqlExternalDataSourceList;
|
/**
* @license
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
CLASS({
name: 'LogEntryView',
package: 'foam.flow',
extends: 'foam.flow.Element',
constants: { ELEMENT_NAME: 'log-entry' },
properties: [
{
name: 'data',
// type: 'foam.flow.LogEntry'
}
],
templates: [
function toInnerHTML() {/*
<num>{{this.data.id}}</num><{{{this.data.mode}}}>{{this.data.contents}}</{{{this.data.mode}}}>
*/},
function CSS() {/*
log-entry {
display: flex;
}
log-entry > num {
min-width: 35px;
max-width: 35px;
display: inline-block;
text-align: right;
padding-right: 13px;
font-weight: bold;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background: #E0E0E0;
}
log-entry > log, log-entry > warn, log-entry > error {
padding-left: 4px;
white-space: pre-wrap;
}
log-entry > log {
color: #333;
}
log-entry > warn {
color: #CC9900;
}
log-entry > error {
color: #C00;
}
*/}
]
});
|
(function() {
function LandingCtrl() {
this.heroTitle = "Turn the Music Up!";
}
angular
.module('blocJams')
.controller('LandingCtrl', LandingCtrl);
})();
|
/*
* Copyright (c) 2014 DataTorrent, Inc. ALL Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
angular.module('ui.widgets')
.directive('wtNvd3LineChart', function ($filter) {
return {
restrict: 'A',
replace: true,
templateUrl: 'template/widgets/nvd3LineChart/nvd3LineChart.html',
scope: {
data: '=data',
showLegend: '@',
showTimeRange: '=?',
timeAxisFormat: '=?'
},
controller: function ($scope) {
var filter = $filter('date');
var numberFilter = $filter('number');
$scope.xAxisTickFormatFunction = function () {
return function (d) {
return filter(d, $scope.timeAxisFormat);
};
};
$scope.yAxisTickFormatFunction = function () {
return function (d) {
if (d > 999) {
var value;
var scale;
if (d < 999999) {
value = Math.round(d/1000);
scale = 'k';
} else {
value = Math.round(d/1000000);
scale = 'm';
}
return numberFilter(value) + scale;
} else {
return numberFilter(d);
}
};
};
$scope.xFunction = function () {
return function (d) {
return d.timestamp;
};
};
$scope.yFunction = function () {
return function (d) {
return d.value;
};
};
},
link: function postLink(scope, element, attrs) {
if (!_.has(attrs, 'showTimeRange')) {
scope.showTimeRange = true;
}
scope.timeAxisFormat = scope.timeAxisFormat || 'HH:mm';
scope.$watch('data', function (data) {
if (data && data[0] && data[0].values && (data[0].values.length > 1)) {
var timeseries = _.sortBy(data[0].values, function (item) {
return item.timestamp;
});
var start = timeseries[0].timestamp;
var end = timeseries[timeseries.length - 1].timestamp;
scope.start = start;
scope.end = end;
}
});
}
};
});
|
/**
* vue app
* Created by HC on 2016/7/19.
*/
var header = Vue.extend({
template: '#header'
});
// 全局注册组件
Vue.component('my-header', header);
var footer = Vue.extend({
template: '#footer'
});
// 全局注册组件
Vue.component('my-footer', footer);
var index = Vue.extend({
template: '#index'
});
var App = Vue.extend({});
var router = new VueRouter();
router.map({
'/': {
component: index
},
'/bar': {
component: footer
}
});
// Now we can start the app!
// The router will create an instance of App and mount to
// the element matching the selector #app.
router.start(App, '#app');
|
'use strict';
/* global describe, it */
var fs = require('fs');
var expect = require('chai').expect;
var bigrig = require('../');
describe('Big Rig', function () {
it ('throws if no processes are found', function () {
expect(function () {
bigrig.analyze(null);
}).to.throw('Zero processes (tabs) found.');
});
it ('throws if given invalid input data is given', function () {
expect(function () {
bigrig.analyze('wobble');
}).to.throw('Invalid trace contents; not JSON');
});
it ('throws if given a trace with extensions and strict mode is enabled',
function (done) {
fs.readFile('./test/data/load-extensions.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var error = 'Extensions running during capture; ' +
'see http://bit.ly/bigrig-extensions';
expect(function () {
bigrig.analyze(data, {
strict: true
});
}).to.throw(error);
done();
});
});
// TODO(paullewis) Add multiprocess test.
it ('returns JSON for a file with a single process', function (done) {
fs.readFile('./test/data/load.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData).to.be.an('array');
expect(jsonData[0]).to.be.an('object');
done();
});
});
it ('generates valid JSON', function (done) {
fs.readFile('./test/data/load.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
jsonData = JSON.parse(JSON.stringify(jsonData));
expect(jsonData).to.be.an('array');
done();
});
});
it ('supports timed ranges', function (done) {
fs.readFile('./test/data/animation.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData[0]).to.be.an('object');
expect(jsonData[0].title).to.equal('sideNavAnimation');
expect(jsonData[0].start).to.be.above(0);
expect(jsonData[0].end).to.be.within(1179, 1180);
done();
});
});
it ('correctly applies RAIL type when time range is specified',
function (done) {
fs.readFile('./test/data/animation.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data, {
types: {
'sideNavAnimation': bigrig.ANIMATION
}
});
expect(jsonData[0].type).to.equal(bigrig.ANIMATION);
done();
});
});
it ('correctly infers RAIL Load when time range not specified',
function (done) {
fs.readFile('./test/data/load.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData[0].type).to.equal(bigrig.LOAD);
expect(jsonData[0].title).to.equal('Load');
done();
});
});
it ('correctly infers RAIL Response when time range not specified',
function (done) {
fs.readFile('./test/data/response.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData[0].type).to.equal(bigrig.RESPONSE);
expect(jsonData[0].title).to.equal('sideNavResponse');
done();
});
});
it ('correctly infers RAIL Animation when time range not specified',
function (done) {
fs.readFile('./test/data/animation.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData[0].type).to.equal(bigrig.ANIMATION);
expect(jsonData[0].title).to.equal('sideNavAnimation');
done();
});
});
it ('correctly infers multiple RAIL regions', function (done) {
fs.readFile('./test/data/response-animation.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData.length).to.equal(2);
expect(jsonData[0].type).to.equal(bigrig.RESPONSE);
expect(jsonData[0].title).to.equal('sideNavResponse');
expect(jsonData[1].type).to.equal(bigrig.ANIMATION);
expect(jsonData[1].title).to.equal('sideNavAnimation');
done();
});
});
it ('returns the correct fps for animations', function (done) {
fs.readFile('./test/data/animation.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(jsonData[0].fps).to.be.within(59, 61);
done();
});
});
it ('returns the correct JS breakdown', function (done) {
fs.readFile('./test/data/load.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(
jsonData[0].extendedInfo.javaScript['localhost:11080']
).to.be.within(245, 246);
expect(
jsonData[0].extendedInfo.javaScript['www.google-analytics.com']
).to.be.within(59, 60);
done();
});
});
it ('correctly captures forced layouts and recalcs', function (done) {
fs.readFile('./test/data/forced-recalc-layout.json', 'utf8',
function (err, data) {
if (err) {
throw err;
}
var jsonData = bigrig.analyze(data);
expect(
jsonData[0].extendedInfo.forcedRecalcs
).to.equal(1);
expect(
jsonData[0].extendedInfo.forcedLayouts
).to.equal(1);
done();
});
});
});
|
function TorneoGolfWindow(Window) {
window1 = Titanium.UI.createWindow({
tabBarHidden : true,
backgroundColor : "white",
width : '100%',
height : '100%',
layout : 'vertical'
});
table = Ti.UI.createTableView({
width : '90%',
height : '100%'
});
scrollView_1 = Titanium.UI.createView({
id : "scrollView_1",
backgroundImage : '/images/background.png',
height : '100%',
width : '100%',
layout : 'vertical'
});
scrollView_1.add(table);
imageViewBar = Titanium.UI.createView({
id : "imageViewBar",
backgroundColor : Ti.App.Properties.getString('viewcolor'),
height : 80,
left : 0,
top : 0,
width : '100%',
layout : 'horizontal'
});
imageView = Titanium.UI.createImageView({
id : "imageView",
image : "/images/icongolf.png",
width : 60,
height : 60,
top : 7,
right : 3
});
imageViewBar.add(imageView);
labelTitulo = Titanium.UI.createLabel({
id : "labelTitulo",
height : 'auto',
width : '70%',
text : L('golf'),
font : {
fontSize : '22dp'
},
color : 'white',
textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER
});
imageViewBar.add(labelTitulo);
buttonClose = Titanium.UI.createImageView({
id : "buttonClose",
image : "/images/close.png",
width : 30,
height : 30,
top : 25
});
imageViewBar.add(buttonClose);
window1.add(imageViewBar);
window1.add(scrollView_1);
function populateTable() {
var data = [];
var row = Titanium.UI.createTableViewRow({
id : 2,
title : 'Horarios',
leftImage : '/images/horarios.png',
isparent : true,
opened : false,
hasChild : false,
font : {
fontSize : '22dp'
},
color : 'black'
});
data.push(row);
var row = Titanium.UI.createTableViewRow({
id : 3,
title : 'Mapa',
leftImage : '/images/mapa.png',
isparent : true,
opened : false,
hasChild : false,
font : {
fontSize : '22dp'
},
color : 'black'
});
data.push(row);
table.setData(data);
}
populateTable();
table.addEventListener('click', function(e) {
if (e.rowData.id == 2) {
var Window;
var mainWindow = require("ui/handheld/golf/HorariosWindow");
new mainWindow(Window).open();
} else if (e.rowData.id == 3) {
var Window;
var mainWindow = require("ui/handheld/mapa/MapaWindow");
new mainWindow(Window).open();
}
});
buttonClose.addEventListener('click', function(e) {
Ti.Media.vibrate();
var Window;
var mainWindow = require("ui/handheld/MainWindow");
new mainWindow(Window).open();
});
window1.addEventListener('android:back', function(e) {
Ti.Media.vibrate();
var Window;
var mainWindow = require("ui/handheld/MainWindow");
new mainWindow(Window).open();
});
return window1;
}
module.exports = TorneoGolfWindow;
|
const NamingMixin = {
_name: null,
getName() {
return this._name;
},
_shortName: null,
getShortName() {
return this._shortName || this.getName();
},
_abbreviation: null,
getAbbreviation() {
return this._abbreviation || this.getShortName();
},
};
export default NamingMixin;
|
var searchData=
[
['value',['value',['../structguac__pool__int.html#af76ff5f21c6e0f69d95cdd1385ea24a4',1,'guac_pool_int']]],
['vguac_5fclient_5fabort',['vguac_client_abort',['../client_8h.html#a4c0eccd7d0ed3dbf3e7941ce297e0224',1,'client.h']]],
['vguac_5fclient_5flog',['vguac_client_log',['../client_8h.html#a37a0fa9cfc4c02236085e3852972f494',1,'client.h']]],
['vguac_5fprotocol_5fsend_5flog',['vguac_protocol_send_log',['../protocol_8h.html#a3a783d771e1727ba2a82b2298acf4ee4',1,'protocol.h']]],
['video_5fmimetypes',['video_mimetypes',['../structguac__client__info.html#aa58dc4ee1e3b8801e9b0abbf9135d8b6',1,'guac_client_info']]]
];
|
/*
* 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';
/**
* @class
* Initializes a new instance of the DataSourceListResult class.
* @constructor
* The list data source by workspace operation response.
*
* @member {string} [nextLink] The link (url) to the next page of datasources.
*
*/
class DataSourceListResult extends Array {
constructor() {
super();
}
/**
* Defines the metadata of DataSourceListResult
*
* @returns {object} metadata of DataSourceListResult
*
*/
mapper() {
return {
required: false,
serializedName: 'DataSourceListResult',
type: {
name: 'Composite',
className: 'DataSourceListResult',
modelProperties: {
value: {
required: false,
serializedName: '',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'DataSourceElementType',
type: {
name: 'Composite',
className: 'DataSource'
}
}
}
},
nextLink: {
required: false,
serializedName: 'nextLink',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = DataSourceListResult;
|
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2016 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides control sap.m.PageAccessibleLandmarkInfo.
sap.ui.define(['sap/ui/core/Element', './library'],
function(Element, library) {
"use strict";
/**
* Constructor for a new <code>sap.m.PageAccessibleLandmarkInfo</code> element.
*
* @param {string} [sId] Id for the new element, generated automatically if no id is given
* @param {object} [mSettings] Initial settings for the new element
*
* @class
* Settings for accessible landmarks which can be applied to the container elements of a <code>sap.m.Page</code> control.
* These landmarks are e.g. used by assistive technologies (like screenreaders) to provide a meaningful page overview.
* @extends sap.ui.core.Element
*
* @author SAP SE
* @version 1.42.8
*
* @constructor
* @public
* @alias sap.m.PageAccessibleLandmarkInfo
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
*/
var PageAccessibleLandmarkInfo = Element.extend("sap.m.PageAccessibleLandmarkInfo", /** @lends sap.m.PageAccessibleLandmarkInfo.prototype */ { metadata : {
library : "sap.m",
properties : {
/**
* Landmark role of the root container of the corresponding <code>sap.m.Page</code> control.
*
* If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container.
*/
rootRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Region"},
/**
* Texts which describes the landmark of the root container of the corresponding <code>sap.m.Page</code> control.
*
* If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text
* is used.
*/
rootLabel : {type : "string", defaultValue : null},
/**
* Landmark role of the content container of the corresponding <code>sap.m.Page</code> control.
*
* If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container.
*/
contentRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Main"},
/**
* Texts which describes the landmark of the content container of the corresponding <code>sap.m.Page</code> control.
*
* If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text
* is used.
*/
contentLabel : {type : "string", defaultValue : null},
/**
* Landmark role of the header container of the corresponding <code>sap.m.Page</code> control.
*
* If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container.
*/
headerRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Region"},
/**
* Texts which describes the landmark of the header container of the corresponding <code>sap.m.Page</code> control.
*
* If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text
* is used.
*/
headerLabel : {type : "string", defaultValue : null},
/**
* Landmark role of the subheader container of the corresponding <code>sap.m.Page</code> control.
*
* If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container.
*/
subHeaderRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : null},
/**
* Texts which describes the landmark of the subheader container of the corresponding <code>sap.m.Page</code> control.
*
* If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text
* is used.
*/
subHeaderLabel : {type : "string", defaultValue : null},
/**
* Landmark role of the footer container of the corresponding <code>sap.m.Page</code> control.
*
* If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container.
*/
footerRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Region"},
/**
* Texts which describes the landmark of the header container of the corresponding <code>sap.m.Page</code> control.
*
* If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text
* is used.
*/
footerLabel : {type : "string", defaultValue : null}
}
}});
/**
* Returns the landmark information of the given <code>sap.m.PageAccessibleLandmarkInfo</code> instance
* of the given area (e.g. <code>"root"</code>).
*
* Must only be used with the <code>sap.m.Page</code> control!
*
* @private
*/
PageAccessibleLandmarkInfo._getLandmarkInfo = function(oInstance, sArea) {
if (!oInstance) {
return null;
}
var sRole = null;
var sText = null;
var oPropertyInfo = oInstance.getMetadata().getProperty(sArea + "Role");
if (oPropertyInfo) {
sRole = oInstance[oPropertyInfo._sGetter]();
}
if (!sRole) {
return null;
}
oPropertyInfo = oInstance.getMetadata().getProperty(sArea + "Label");
if (oPropertyInfo) {
sText = oInstance[oPropertyInfo._sGetter]();
}
return [sRole.toLowerCase(), sText];
};
/**
* Writes the landmark information of the given page and area (e.g. <code>"root"</code>).
*
* Must only be used with the <code>sap.m.Page</code> control!
*
* @private
*/
PageAccessibleLandmarkInfo._writeLandmarkInfo = function(oRm, oPage, sArea) {
if (!sap.ui.getCore().getConfiguration().getAccessibility()) {
return;
}
var oInfo = PageAccessibleLandmarkInfo._getLandmarkInfo(oPage.getLandmarkInfo(), sArea);
if (!oInfo) {
return;
}
var oLandMarks = {
role: oInfo[0]
};
if (oInfo[1]) {
oLandMarks["label"] = oInfo[1];
}
oRm.writeAccessibilityState(oPage, oLandMarks);
};
return PageAccessibleLandmarkInfo;
});
|
/**
* File: app/project/ProjOpen.js
* Author: liusha
*/
Ext.define('xdfn.project.ProjOpen', {
extend: 'xdfn.project.ui.ProjOpen',
grid: null,
initComponent: function() {
var me = this;
me.openStore = Ext.create('xdfn.project.store.ProjOpenJsonStore');
me.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
errorSummary: false
});
me.callParent(arguments);
me.down('button[text="增加记录"]').on('click', me.OnAddProjOpenBtnClick, me);
me.down('button[text="删除记录"]').on('click', me.OnDeleteProjOpenBtnClick, me);
me.down('button[text="导出"]').on('click', me.OnExportProjOpenBtnClick, me);
me.rowEditing.on('edit', me.OnGridEdit, me);
me.rowEditing.on('beforeedit', me.OnGridBeforeEdit, me);
},
OnGridBeforeEdit: function(editor, e, epts) {
xdfn.user.Rights.noRights('XMGL-XMZL-31', function() {
editor.cancelEdit();
});
},
OnGridEdit: function(editor, e) {
var me = this;
if (!e.record.dirty) return;
var url = './proExec.do?method=modifyKbjl';
if (Ext.isEmpty(e.record.get('ID_VIEW'))) {
var rows = me.grid.getSelectionModel().getSelection();
e.record.set('ID_VIEW', rows[0].get('ID_VIEW'));
url = './proExec.do?method=addProKbjl';
}
e.record.commit();
Ext.Ajax.request({
url: url,
method: 'post',
params: {
ID: e.record.get('ID_VIEW'),
V_MANU: e.record.get('V_MANU_VIEW'),
V_MACHINE: e.record.get('V_MACHINE_VIEW'),
N_CAP: e.record.get('N_CAP_VIEW'),
N_SUM_NUM: e.record.get('N_SUM_NUM_VIEW'),
N_SUM_MONEY: e.record.get('N_SUM_MONEY_VIEW'),
V_MEMO: e.record.get('V_MEMO_VIEW')
},
success: function(response, opts) {
var result = Ext.JSON.decode(response.responseText); //服务端返回新建ID
e.record.set(result.data);
e.record.commit();
},
failure: function(response, opts) {
Ext.Msg.alert('提示','提交失败!');
}
});
},
OnAddProjOpenBtnClick: function(self, e, options) {
var me = this,
sm = me.grid.getSelectionModel(),
rows = sm.getSelection();
xdfn.user.Rights.hasRights('XMGL-XMZL-30', function() {
if (rows.length > 0) {
me.rowEditing.cancelEdit();
me.openStore.insert(0, {});
me.rowEditing.startEdit(0, 0);
} else {
Ext.Msg.alert('提示','请先选择相应的项目!');
}
});
},
OnDeleteProjOpenBtnClick: function(self, e, options) {
var me = this,
grid = self.up('gridpanel'),
store = grid.getStore(),
sm = grid.getSelectionModel(),
rows = sm.getSelection();
xdfn.user.Rights.hasRights('XMGL-XMZL-32', function() {
if (rows.length > 0) {
if (Ext.isEmpty(rows[0].get('ID_VIEW'))) {
me.rowEditing.cancelEdit();
var i = store.indexOf(rows[0]);
store.remove(rows);
var count = store.getCount();
if (count > 0) {
sm.select((i == count)? --i : i);
}
return;
}
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function(id) {
if (id == 'yes') {
//TODO 删除记录
Ext.Ajax.request({
url: './proExec.do?method=deleteKbjl', //改为实际的删除请求url
method: 'get',
params: {
ID: rows[0].get('ID_VIEW')
},
success: function(response, opts) {
me.rowEditing.cancelEdit();
var i = store.indexOf(rows[0]);
store.remove(rows);
var count = store.getCount();
if (count > 0) {
sm.select((i == count)? --i : i);
}
},
failure: function(response, opts) {
Ext.Msg.alert('提示','删除失败!');
}
});
}
});
} else {
Ext.Msg.alert('提示','请选择要删除的记录!');
}
});
},
OnExportProjOpenBtnClick: function(self, e, options) {
var me = this;
//导出为excel文件
xdfn.user.Rights.hasRights('XMGL-XMZL-33', function() {
me.openStore.load({
limit: me.openStore.getTotalCount(),
scope: this,
callback: function(records, operation, success) {
var excelXml = Ext.ux.exporter.Exporter.exportGrid(self.up('gridpanel'), 'excel', {title: '项目开标记录'});
document.location = 'data:application/vnd.ms-excel;base64,' + Ext.ux.exporter.Base64.encode(excelXml);
}
});
});
}
});
|
/**
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
define(['lodash', 'log', 'event_channel', './abstract-source-gen-visitor', './connector-action-visitor',
'./variable-declaration-visitor', './connector-declaration-visitor', './statement-visitor-factory'],
function(_, log, EventChannel, AbstractSourceGenVisitor, ConnectorActionVisitor,
VariableDeclarationVisitor, ConnectorDeclarationVisitor, StatementVisitorFactory) {
/**
* @param {ASTVisitor} parent - parent visitor
* @constructor
*/
var ConnectorDefinitionVisitor = function (parent) {
AbstractSourceGenVisitor.call(this, parent);
};
ConnectorDefinitionVisitor.prototype = Object.create(AbstractSourceGenVisitor.prototype);
ConnectorDefinitionVisitor.prototype.constructor = ConnectorDefinitionVisitor;
ConnectorDefinitionVisitor.prototype.canVisitConnectorDefinition = function(connectorDefinition){
return true;
};
/**
* Begin the visit and generate the source
* @param {ConnectorDefinition} connectorDefinition - Connector Definition
*/
ConnectorDefinitionVisitor.prototype.beginVisitConnectorDefinition = function(connectorDefinition){
/**
* set the configuration start for the connector definition language construct
* If we need to add additional parameters which are dynamically added to the configuration start
* that particular source generation has to be constructed here
*/
var self = this;
var argumentsSrc = "";
_.forEach(connectorDefinition.getAnnotations(), function(annotation) {
if (!_.isEmpty(annotation.value)) {
var constructedPathAnnotation;
if (annotation.key.indexOf(":") === -1) {
constructedPathAnnotation = '@' + annotation.key + '("' + annotation.value + '")\n';
} else {
constructedPathAnnotation = '@' + annotation.key.split(":")[0] + '(' + annotation.key.split(":")[1] +
' = "' + annotation.value + '")\n';
}
self.appendSource(constructedPathAnnotation);
}
});
_.forEach(connectorDefinition.getArguments(), function(argument, index){
argumentsSrc += argument.type + " ";
argumentsSrc += argument.identifier;
if (connectorDefinition.getArguments().length - 1 != index) {
argumentsSrc += ", ";
}
});
var constructedSourceSegment = 'connector ' + connectorDefinition.getConnectorName() +
' (' + argumentsSrc + ')' + ' {\n';
this.appendSource(constructedSourceSegment);
log.debug('Begin Visit Connector Definition');
};
ConnectorDefinitionVisitor.prototype.visitConnectorDefinition = function(connectorDefinition){
log.debug('Visit Connector Definition');
};
/**
* End visiting the connector definition
* @param {ConnectorDefinition} connectorDefinition - Connector Definition
*/
ConnectorDefinitionVisitor.prototype.endVisitConnectorDefinition = function(connectorDefinition){
this.appendSource("}\n");
this.getParent().appendSource(this.getGeneratedSource());
log.debug('End Visit Connector Definition');
};
/**
* Visit Connector Action
* @param {ConnectorAction} connectorAction
*/
ConnectorDefinitionVisitor.prototype.visitConnectorAction = function(connectorAction){
var connectorActionVisitor = new ConnectorActionVisitor(this);
connectorAction.accept(connectorActionVisitor);
};
/**
* Visit Connector Declaration
* @param {ConnectorDeclaration} connectorDeclaration
*/
ConnectorDefinitionVisitor.prototype.visitConnectorDeclaration = function(connectorDeclaration){
var connectorDeclarationVisitor = new ConnectorDeclarationVisitor(this);
connectorDeclaration.accept(connectorDeclarationVisitor);
};
/**
* Visit Variable Declaration
* @param {VariableDeclaration} variableDeclaration
*/
ConnectorDefinitionVisitor.prototype.visitVariableDeclaration = function(variableDeclaration){
var variableDeclarationVisitor = new VariableDeclarationVisitor(this);
variableDeclaration.accept(variableDeclarationVisitor);
};
/**
* Visit Statements
* @param {Statement} statement
*/
ConnectorDefinitionVisitor.prototype.visitStatement = function (statement) {
var statementVisitorFactory = new StatementVisitorFactory();
var statementVisitor = statementVisitorFactory.getStatementVisitor(statement, this);
statement.accept(statementVisitor);
};
return ConnectorDefinitionVisitor;
});
|
function __processArg(obj, key) {
var arg = null;
if (obj) {
arg = obj[key] || null;
delete obj[key];
}
return arg;
}
function Controller() {
function goSlide(event) {
var index = event.source.mod;
var arrViews = $.scrollableView.getViews();
switch (index) {
case "0":
$.lbl1.backgroundColor = "#453363";
$.lbl1.color = "#AA9DB6";
$.lbl2.backgroundColor = "#E6E7E9";
$.lbl2.color = "#4CC4D2";
$.lbl3.backgroundColor = "#E6E7E9";
$.lbl3.color = "#4CC4D2";
break;
case "1":
$.lbl1.backgroundColor = "#E6E7E9";
$.lbl1.color = "#4CC4D2";
$.lbl2.backgroundColor = "#453363";
$.lbl2.color = "#AA9DB6";
$.lbl3.backgroundColor = "#E6E7E9";
$.lbl3.color = "#4CC4D2";
break;
case "2":
$.lbl1.backgroundColor = "#E6E7E9";
$.lbl1.color = "#4CC4D2";
$.lbl2.backgroundColor = "#E6E7E9";
$.lbl2.color = "#4CC4D2";
$.lbl3.backgroundColor = "#453363";
$.lbl3.color = "#AA9DB6";
}
$.scrollableView.scrollToView(arrViews[index]);
}
require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
this.__controllerPath = "contact";
if (arguments[0]) {
var __parentSymbol = __processArg(arguments[0], "__parentSymbol");
{
__processArg(arguments[0], "$model");
}
{
__processArg(arguments[0], "__itemTemplate");
}
}
var $ = this;
var exports = {};
var __defers = {};
$.__views.win = Ti.UI.createView({
layout: "vertical",
id: "win",
backgroundColor: "white"
});
$.__views.win && $.addTopLevelView($.__views.win);
$.__views.__alloyId87 = Alloy.createController("_header", {
id: "__alloyId87",
__parentSymbol: $.__views.win
});
$.__views.__alloyId87.setParent($.__views.win);
$.__views.__alloyId88 = Ti.UI.createView({
height: "20%",
backgroundColor: "#836EAF",
id: "__alloyId88"
});
$.__views.win.add($.__views.__alloyId88);
$.__views.__alloyId89 = Ti.UI.createLabel({
text: "Contact us",
left: "10",
top: "10",
color: "white",
id: "__alloyId89"
});
$.__views.__alloyId88.add($.__views.__alloyId89);
$.__views.menu = Ti.UI.createView({
id: "menu",
layout: "horizontal",
height: "50",
width: "100%"
});
$.__views.win.add($.__views.menu);
$.__views.lbl1 = Ti.UI.createLabel({
text: "Our Offices",
id: "lbl1",
mod: "0",
height: "100%",
width: "33%",
textAlign: "center",
backgroundColor: "#453363",
color: "#AA9DB6"
});
$.__views.menu.add($.__views.lbl1);
goSlide ? $.__views.lbl1.addEventListener("touchend", goSlide) : __defers["$.__views.lbl1!touchend!goSlide"] = true;
$.__views.__alloyId90 = Ti.UI.createView({
backgroundColor: "#4CC4D2",
height: "100%",
width: "0.45%",
id: "__alloyId90"
});
$.__views.menu.add($.__views.__alloyId90);
$.__views.lbl2 = Ti.UI.createLabel({
text: "Care Center",
id: "lbl2",
mod: "1",
height: "100%",
width: "33%",
textAlign: "center",
backgroundColor: "#E6E7E9",
color: "#4CC4D2"
});
$.__views.menu.add($.__views.lbl2);
goSlide ? $.__views.lbl2.addEventListener("touchend", goSlide) : __defers["$.__views.lbl2!touchend!goSlide"] = true;
$.__views.__alloyId91 = Ti.UI.createView({
backgroundColor: "#4CC4D2",
height: "100%",
width: "0.45%",
id: "__alloyId91"
});
$.__views.menu.add($.__views.__alloyId91);
$.__views.lbl3 = Ti.UI.createLabel({
text: "XOX Dealers",
id: "lbl3",
mod: "2",
height: "100%",
width: "33%",
textAlign: "center",
backgroundColor: "#E6E7E9",
color: "#4CC4D2"
});
$.__views.menu.add($.__views.lbl3);
goSlide ? $.__views.lbl3.addEventListener("touchend", goSlide) : __defers["$.__views.lbl3!touchend!goSlide"] = true;
var __alloyId92 = [];
$.__views.__alloyId93 = Alloy.createController("contact1", {
id: "__alloyId93",
__parentSymbol: __parentSymbol
});
__alloyId92.push($.__views.__alloyId93.getViewEx({
recurse: true
}));
$.__views.__alloyId94 = Alloy.createController("contact2", {
id: "__alloyId94",
__parentSymbol: __parentSymbol
});
__alloyId92.push($.__views.__alloyId94.getViewEx({
recurse: true
}));
$.__views.__alloyId95 = Alloy.createController("contact3", {
id: "__alloyId95",
__parentSymbol: __parentSymbol
});
__alloyId92.push($.__views.__alloyId95.getViewEx({
recurse: true
}));
$.__views.scrollableView = Ti.UI.createScrollableView({
views: __alloyId92,
id: "scrollableView",
showPagingControl: "false",
scrollingEnabled: "false"
});
$.__views.win.add($.__views.scrollableView);
exports.destroy = function() {};
_.extend($, $.__views);
var storeModel = Alloy.createCollection("storeLocator");
var details = storeModel.getStoreList();
console.log(details);
__defers["$.__views.lbl1!touchend!goSlide"] && $.__views.lbl1.addEventListener("touchend", goSlide);
__defers["$.__views.lbl2!touchend!goSlide"] && $.__views.lbl2.addEventListener("touchend", goSlide);
__defers["$.__views.lbl3!touchend!goSlide"] && $.__views.lbl3.addEventListener("touchend", goSlide);
_.extend($, exports);
}
var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._;
module.exports = Controller;
|
/**
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
goog.provide('audioCat.audio.record.RecordingJobCreatedEvent');
goog.require('audioCat.audio.record.Event');
goog.require('audioCat.utility.Event');
/**
* An event marking the creation of a new recording job.
* @param {!audioCat.audio.record.RecordingJob} recordingJob The newly created
* job recording.
* @constructor
* @extends {audioCat.utility.Event}
*/
audioCat.audio.record.RecordingJobCreatedEvent = function(recordingJob) {
goog.base(this, audioCat.audio.record.Event.DEFAULT_RECORDING_JOB_CREATED);
/**
* The newly made recording job.
* @type {!audioCat.audio.record.RecordingJob}
*/
this.recordingJob = recordingJob;
};
goog.inherits(
audioCat.audio.record.RecordingJobCreatedEvent, audioCat.utility.Event);
|
var spawn = require('child_process').spawn
var port = exports.port = 1337
exports.registry = "http://localhost:" + port
exports.run = run
function run (cmd, t, opts, cb) {
if (!opts)
opts = {}
if (!Array.isArray(cmd))
throw new Error("cmd must be an Array")
if (!t || !t.end)
throw new Error("node-tap instance is missing")
var stdout = ""
, stderr = ""
, node = process.execPath
, child = spawn(node, cmd, opts)
child.stderr.on("data", function (chunk) {
stderr += chunk
})
child.stdout.on("data", function (chunk) {
stdout += chunk
})
child.on("close", function (code) {
if (cb)
cb(t, stdout, stderr, code, { cmd: cmd, opts: opts })
else
t.end()
})
}
|
(function() {
var head = document.head || document.getElementsByTagName('head')[0];
var style = null;
var mobileScreenWidth = 768;
// Make sure this value is equal to the width of .wy-nav-content in overrides.css.
var initialContentWidth = 960;
// Make sure this value is equal to the width of .wy-nav-side in theme.css.
var sideWidth = 300;
// Keeps the current width of .wy-nav-content.
var contentWidth = initialContentWidth;
// Centers the page content dynamically.
function centerPage() {
if (style) {
head.removeChild(style);
style = null;
}
var windowWidth = window.innerWidth;
if (windowWidth <= mobileScreenWidth) {
return;
}
var leftMargin = Math.max(0, (windowWidth - sideWidth - contentWidth) / 2);
var scrollbarWidth = document.body ? windowWidth - document.body.clientWidth : 0;
var css = '';
css += '.wy-nav-side { left: ' + leftMargin + 'px; }';
css += "\n";
css += '.wy-nav-content-wrap { margin-left: ' + (sideWidth + leftMargin) + 'px; }';
css += "\n";
css += '.github-fork-ribbon { margin-right: ' + (leftMargin - scrollbarWidth) + 'px; }';
css += "\n";
var newStyle = document.createElement('style');
newStyle.type = 'text/css';
if (newStyle.styleSheet) {
newStyle.styleSheet.cssText = css;
} else {
newStyle.appendChild(document.createTextNode(css));
}
head.appendChild(newStyle);
style = newStyle;
}
centerPage();
window.addEventListener('resize', centerPage);
// Adjust the position of the 'fork me at GitHub' ribbon after document.body is available,
// so that we can calculate the width of the scroll bar correctly.
window.addEventListener('DOMContentLoaded', centerPage);
// Allow a user to drag the left or right edge of the content to resize the content.
if (interact) {
interact('.wy-nav-content').resizable({
edges: {left: true, right: true, bottom: false, top: false},
modifiers: [
interact.modifiers.restrictEdges({
outer: 'parent',
endOnly: true
}),
interact.modifiers.restrictSize({
min: {
width: initialContentWidth,
height: 0
}
})
]
}).on('resizemove', function (event) {
var style = event.target.style;
// Double the amount of change because the page is centered.
contentWidth += event.deltaRect.width * 2;
style.maxWidth = contentWidth + 'px';
centerPage();
});
}
})();
|
export const FILLPATTERN = {
none: '',
crossHatched: 'Crosshatched',
hatched: 'Hatched',
solid: 'Solid'
};
export const STROKEPATTERN = {
none: '',
dashed: 'Dashed',
dotted: 'Dotted',
solid: 'Solid'
};
export const ALTITUDEMODE = {
NONE: '',
ABSOLUTE: 'Absolute',
RELATIVE_TO_GROUND: 'Relative to ground',
CLAMP_TO_GROUND: 'Clamp to ground'
};
export const ICONSIZE = {
none: '',
verySmall: 'Very Small',
small: 'Small',
medium: 'Medium',
large: 'Large',
extraLarge: 'Extra Large'
};
export const ACMATTRIBUTES = {
innerRadius: 'Inner Radius',
leftAzimuth: 'Left Azimuth',
rightAzimuth: 'Right Azimuth',
minAlt: 'Minimum Altitude',
maxAlt: 'Maximum Altitude',
leftWidth: 'Left Width',
rightWidth: 'Right Width',
radius: 'Radius',
turn: 'Turn',
width: 'Width'
};
export const WMSVERSION = {
WMS: 'none',
WMS1_1: '1.0',
WMS1_1_1: '1.1.1',
WMS1_3_0: '1.3.0'
};
export const WMTSVERSION = {
WMTS: 'none',
WMTS1_0_0: '1.0.0'
};
|
/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
goog.provide('shaka.ui.FastForwardButton');
goog.require('shaka.ui.Controls');
goog.require('shaka.ui.Element');
goog.require('shaka.ui.Enums');
goog.require('shaka.ui.Locales');
goog.require('shaka.ui.Localization');
goog.require('shaka.util.Dom');
/**
* @extends {shaka.ui.Element}
* @final
* @export
*/
shaka.ui.FastForwardButton = class extends shaka.ui.Element {
/**
* @param {!HTMLElement} parent
* @param {!shaka.ui.Controls} controls
*/
constructor(parent, controls) {
super(parent, controls);
/** @private {!HTMLButtonElement} */
this.button_ = shaka.util.Dom.createButton();
this.button_.classList.add('material-icons-round');
this.button_.classList.add('shaka-fast-forward-button');
this.button_.classList.add('shaka-tooltip-status');
this.button_.setAttribute('shaka-status', '1x');
this.button_.textContent =
shaka.ui.Enums.MaterialDesignIcons.FAST_FORWARD;
this.parent.appendChild(this.button_);
this.updateAriaLabel_();
/** @private {!Array.<number>} */
this.fastForwardRates_ = this.controls.getConfig().fastForwardRates;
this.eventManager.listen(
this.localization, shaka.ui.Localization.LOCALE_UPDATED, () => {
this.updateAriaLabel_();
});
this.eventManager.listen(
this.localization, shaka.ui.Localization.LOCALE_CHANGED, () => {
this.updateAriaLabel_();
});
this.eventManager.listen(this.button_, 'click', () => {
this.fastForward_();
});
}
/**
* @private
*/
updateAriaLabel_() {
this.button_.ariaLabel =
this.localization.resolve(shaka.ui.Locales.Ids.FAST_FORWARD);
}
/**
* Cycles trick play rate between the selected fast forward rates.
* @private
*/
fastForward_() {
if (!this.video.duration) {
return;
}
const trickPlayRate = this.player.getPlaybackRate();
const newRateIndex = this.fastForwardRates_.indexOf(trickPlayRate) + 1;
// When the button is clicked, the next rate in this.fastForwardRates_ is
// selected. If no more rates are available, the first one is set.
const newRate = (newRateIndex != this.fastForwardRates_.length) ?
this.fastForwardRates_[newRateIndex] : this.fastForwardRates_[0];
this.player.trickPlay(newRate);
this.button_.setAttribute('shaka-status', newRate + 'x');
}
};
/**
* @implements {shaka.extern.IUIElement.Factory}
* @final
*/
shaka.ui.FastForwardButton.Factory = class {
/** @override */
create(rootElement, controls) {
return new shaka.ui.FastForwardButton(rootElement, controls);
}
};
shaka.ui.Controls.registerElement(
'fast_forward', new shaka.ui.FastForwardButton.Factory());
|
'use strict';
var nconf = require('nconf');
var path = require('path');
/**
* Handle the configuration management.
*
* @constructor
*/
function Config() {
nconf.argv().env("_");
var environment = nconf.get("NODE:ENV") || "development";
nconf.file(environment, {file: path.resolve(__dirname, '../config/' + environment + '.json')});
nconf.file('default', {file: path.resolve(__dirname, '../config/default.json')});
}
/**
* Return the value of the provided key from the configuration object.
*
* @param {string} key - Key from the configuration object.
*/
Config.prototype.get = function (key) {
return nconf.get(key);
};
module.exports = new Config();
|
/**
* Wraps the
*
* @param text
* {string} haystack to search through
* @param search
* {string} needle to search for
* @param [caseSensitive]
* {boolean} optional boolean to use case-sensitive searching
*/
angular.module('ui.highlight', []).filter('highlight', function(highlight) {
return function(text, search, caseSensitive) {
if (search || angular.isNumber(search)) {
var ltext = text.toString();
var lsearch = search.toString();
if (caseSensitive) {
return ltext.split(lsearch).join('<span class="ui-match">' + lsearch + '</span>');
} else {
return ltext.replace(new RegExp(lsearch, 'gi'), '<span class="ui-match">$&</span>');
}
} else {
return text;
}
};
});
|
module.exports = {
"env": {
"es6": true,
"node": true
},
"globals": {
"expect": true,
"it": true,
"describe": true,
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"no-unused-vars": 2,
"react/jsx-uses-vars": 2,
"react/jsx-uses-react": 2,
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
};
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Extension ID of Files.app.
* @type {string}
* @const
*/
var FILE_MANAGER_EXTENSIONS_ID = 'hhaomjibdihmijegdhdafkllkbggdgoj';
/**
* Calls a remote test util in Files.app's extension. See: test_util.js.
*
* @param {string} func Function name.
* @param {?string} appId Target window's App ID or null for functions
* not requiring a window.
* @param {Array.<*>} args Array of arguments.
* @param {function(*)} callback Callback handling the function's result.
*/
function callRemoteTestUtil(func, appId, args, callback) {
chrome.runtime.sendMessage(
FILE_MANAGER_EXTENSIONS_ID, {
func: func,
appId: appId,
args: args
},
callback);
}
chrome.test.runTests([
// Waits for the C++ code to send a string identifying a test, then runs that
// test.
function testRunner() {
var command = chrome.extension.inIncognitoContext ? 'which test guest' :
'which test non-guest';
chrome.test.sendMessage(command, function(testCaseName) {
// Run one of the test cases defined in the testcase namespace, in
// test_cases.js. The test case name is passed via StartTest call in
// file_manager_browsertest.cc.
if (testcase[testCaseName])
testcase[testCaseName]();
else
chrome.test.fail('Bogus test name passed to testRunner()');
});
}
]);
|
import { Type } from 'angular2/src/facade/lang';
import { CanActivate } from './lifecycle_annotations_impl';
import { reflector } from 'angular2/src/core/reflection/reflection';
export function hasLifecycleHook(e, type) {
if (!(type instanceof Type))
return false;
return e.name in type.prototype;
}
export function getCanActivateHook(type) {
var annotations = reflector.annotations(type);
for (let i = 0; i < annotations.length; i += 1) {
let annotation = annotations[i];
if (annotation instanceof CanActivate) {
return annotation.fn;
}
}
return null;
}
//# sourceMappingURL=route_lifecycle_reflector.js.map
|
/**
* libjass
*
* https://github.com/Arnavion/libjass
*
* Copyright 2013 Arnav Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(["intern!tdd", "require", "tests/support/test-page"], function (tdd, require, TestPage) {
tdd.suite("Outlines", function () {
tdd.test("Basic", function () {
var testPage = new TestPage(this.remote, require.toUrl("tests/support/browser-test-page.html"), "/tests/functional/outlines/outlines.ass", 1280, 720);
return testPage
.prepare()
.then(function (testPage) { return testPage.seekAndCompareScreenshot(0.5, require.toUrl("./outlines-1.png")); })
.then(function (testPage) { return testPage.seekAndCompareScreenshot(1.5, require.toUrl("./outlines-2.png")); })
.then(function (testPage) { return testPage.seekAndCompareScreenshot(2.5, require.toUrl("./outlines-3.png")); })
.then(function (testPage) { return testPage.seekAndCompareScreenshot(3.5, require.toUrl("./outlines-4.png")); })
.then(function (testPage) { return testPage.done(); });
});
});
});
|
/*
* Copyright (c) 2001-2007, TIBCO Software Inc.
* Use, modification, and distribution subject to terms of license.
*/
jsx3.require("jsx3.chart.Axis");jsx3.Class.defineClass("jsx3.chart.CategoryAxis",jsx3.chart.Axis,null,function(c,p){var
ub={d:"h6",a:"aligned",c:"av",f:"gn",b:"between",e:"tickAlignment"};c.TICKS_ALIGNED=ub.a;c.TICKS_BETWEEN=ub.b;c.MAX_TICKS=200;c.BG={aligned:1,between:1};p.init=function(i,r,q){this.jsxsuper(i,r,q);this.tickAlignment=ub.b;this.categoryField=null;this.paddingLow=null;this.paddingHigh=null;this.Ho(ub.c,0);this.Ho(ub.d,0);};p.getTickAlignment=function(){return this.tickAlignment;};p.setTickAlignment=function(l){if(c.BG[l]){this.tickAlignment=l;}else throw new
jsx3.IllegalArgumentException(ub.e,l);};p.getCategoryField=function(){return this.categoryField;};p.setCategoryField=function(m){this.categoryField=m;};p.getPaddingLow=function(){return this.paddingLow!=null?this.paddingLow:0;};p.setPaddingLow=function(h){this.paddingLow=h;};p.getPaddingHigh=function(){return this.paddingHigh!=null?this.paddingHigh:0;};p.setPaddingHigh=function(r){this.paddingHigh=r;};p.fl=function(){this.Ll(ub.f);var
da=this.getChart();if(da==null){this.Ho(ub.c,0);this.Ho(ub.d,0);}else{var
tb=da.pe(this,true);var
ib=da.bh();this.Ho(ub.d,tb.length);this.Ho(ub.c,ib!=null?ib.length:0);}};p.Hf=function(){var
nb=this.pj(ub.f);if(nb!=null)return nb;var
B=this.pj(ub.c);nb=[];if(B<1)return nb;var
ga=this.getPaddingLow();var
Va=this.getPaddingHigh();var
x=this.tickAlignment==ub.b?B+1:B;var
La=x-1;var
fb=La+ga+Va;var
pb=this.length/fb;var
C=ga*pb;for(var
Qa=0;Qa<x&&Qa<c.MAX_TICKS;Qa++)nb.push(Math.round(C+Qa*pb));this.Ho(ub.f,nb);return nb;};p.se=function(){var
B=this.pj(ub.c);if(this.tickAlignment==ub.b){var
Ab=this.Hf();var
Xa=[];for(var
va=0;va<B;va++)Xa[va]=Math.round((Ab[va]+Ab[va+1])/2);return Xa;}else return this.Hf();};p.Xj=function(b){var
Pa=b;var
z=this.getChart();if(this.categoryField&&z!=null){var
ab=z.bh();if(ab!=null){var
ga=ab[b];if(ga!=null)Pa=ga.getAttribute([this.categoryField]);}}return Pa;};p.mo=function(){return false;};p.getRangeForCategory=function(j){var
_=this.Hf();if(this.tickAlignment==ub.b){if(j<0||j>=_.length-1)return null;else return [_[j],_[j+1]];}else{if(j<0||j>=_.length||_.length<2)return null;var
Xa=j==0?_[1]-_[0]:_[j]-_[j-1];return [Math.round(_[j]-Xa/2),Math.round(_[j]+Xa/2)];}};p.getPointForCategory=function(n){var
Aa=this.Hf();if(this.tickAlignment==ub.b){if(n<0||n>=Aa.length-1)return null;else return Math.round((Aa[n]+Aa[n+1])/2);}else return Aa[n];};c.getVersion=function(){return jsx3.chart.si;};});
|
/*
* Kendo UI Web v2014.1.318 (http://kendoui.com)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-web
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public License (GPL) version 3.
* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
*/
(function(f, define){
define([], f);
})(function(){
(function( window, undefined ) {
var kendo = window.kendo || (window.kendo = { cultures: {} });
kendo.cultures["nn"] = {
name: "nn",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": " ",
".": ",",
groupSize: [3],
percent: {
pattern: ["-n %","n %"],
decimals: 2,
",": " ",
".": ",",
groupSize: [3],
symbol: "%"
},
currency: {
pattern: ["$ -n","$ n"],
decimals: 2,
",": " ",
".": ",",
groupSize: [3],
symbol: "kr"
}
},
calendars: {
standard: {
days: {
names: ["søndag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"],
namesAbbr: ["sø","må","ty","on","to","fr","la"],
namesShort: ["sø","må","ty","on","to","fr","la"]
},
months: {
names: ["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],
namesAbbr: ["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""]
},
AM: [""],
PM: [""],
patterns: {
d: "dd.MM.yyyy",
D: "d. MMMM yyyy",
F: "d. MMMM yyyy HH:mm:ss",
g: "dd.MM.yyyy HH:mm",
G: "dd.MM.yyyy HH:mm:ss",
m: "d. MMMM",
M: "d. MMMM",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "HH:mm",
T: "HH:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM yyyy",
Y: "MMMM yyyy"
},
"/": ".",
":": ":",
firstDay: 1
}
}
}
})(this);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
|
// Copyright 2017, Dell EMC, Inc.
/* jshint node:true */
'use strict';
describe(require('path').basename(__filename), function () {
var base = require('./base-task-data-spec');
base.before(function (context) {
context.taskdefinition = helper.require(
'/lib/task-data/base-tasks/dell-wsman-reset-components.js'
);
});
describe('task-data', function () {
base.examples();
});
});
|
/*
* Kendo UI Web v2014.1.318 (http://kendoui.com)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-web
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public License (GPL) version 3.
* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
*/
(function(f, define){
define([], f);
})(function(){
(function( window, undefined ) {
var kendo = window.kendo || (window.kendo = { cultures: {} });
kendo.cultures["he"] = {
name: "he",
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n%","n%"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
pattern: ["$-n","$ n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "₪"
}
},
calendars: {
standard: {
days: {
names: ["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","שבת"],
namesAbbr: ["יום א","יום ב","יום ג","יום ד","יום ה","יום ו","שבת"],
namesShort: ["א","ב","ג","ד","ה","ו","ש"]
},
months: {
names: ["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר",""],
namesAbbr: ["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ",""]
},
AM: ["AM","am","AM"],
PM: ["PM","pm","PM"],
patterns: {
d: "dd/MM/yyyy",
D: "dddd dd MMMM yyyy",
F: "dddd dd MMMM yyyy HH:mm:ss",
g: "dd/MM/yyyy HH:mm",
G: "dd/MM/yyyy HH:mm:ss",
m: "dd MMMM",
M: "dd MMMM",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "HH:mm",
T: "HH:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM yyyy",
Y: "MMMM yyyy"
},
"/": "/",
":": ":",
firstDay: 0
}
}
}
})(this);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
|
var express = require( 'express' ),
router = require( './router' );
var app = express();
app.set('port', (process.env.PORT || 3000));
router.define( app );
// Set up port
// ========================================================
app.listen(app.get('port'), function() {
console.log("Node app is running at localhost:" + app.get('port'));
});
|
import backgroundImages from '@const/background-images';
import * as actions from './actions.js';
import Background from './class.js';
// const getObj = (indexString) => {
/*
const [type, index] = indexString.split('-')
if (typeof index === 'undefined') return {}
return store.getState().bgimgState.list[type][index]
*/
// }
const getListInitial = (type) => {
let list = [];
if (type === 'default') {
list = backgroundImages.map(
(filename, index) => new Background(filename, type + '-' + index)
);
}
/*
const dir = type == 'custom' ? thePath.bgimgs_custom : thePath.bgimgs
const parseData = (name) => {
return {
name: name
}
}
if (self.nw) {
const fs = require('fs')
const path = require('path')
const getList = (dir) => {
return fs.readdirSync(dir)
.filter(function (file) {
return !fs.lstatSync(path.join(dir, file)).isDirectory()
})
.map(function (filename) {
return {
name: filename,
time: fs.statSync(path.join(dir, filename)).mtime.getTime()
};
})
.sort(function (a, b) { return b.time - a.time; })
.map(function (o) { return o.name; })
}
getList(dir)
.forEach(function (name) {
list.push(parseData(
name,
type === 'default'
))
})
} else {
}
*/
return list;
};
export const initList = (currentIndex = 'default-0') => {
const listDefault = getListInitial('default');
const listCustom = getListInitial('custom');
const [type, index] = currentIndex.split('-');
const current = eval(
'list' + type.substr(0, 1).toUpperCase() + type.substr(1)
)[index];
// const currentPath = current ? {
// original: current.getPath(),
// blured: current.getPath('blured')
// } : {}
return (dispatch) => {
dispatch(
actions.init({
list: {
default: listDefault,
custom: listCustom,
},
current, //,
// currentIndex,
// currentPath
})
);
};
};
export const add = (/*filename*/) => {};
export const remove = (/*indexCustom*/) => {};
export const change = (obj) => {
return (dispatch) => {
dispatch(actions.change(obj));
};
};
export const mainImgLoaded = () => (dispatch) => dispatch(actions.mainLoaded());
|
function CredentialTypesStrings (BaseString) {
BaseString.call(this, 'credential_types');
let t = this.t;
let ns = this.credential_types;
ns.deleteCredentialType = {
CREDENTIAL_TYPE_IN_USE: t.s('This credential type is currently being used by one or more credentials. Credentials that use this credential type must be deleted before the credential type can be deleted.')
};
}
CredentialTypesStrings.$inject = ['BaseStringService'];
export default CredentialTypesStrings;
|
const ng = require('angular');
ng.module('porybox.static', ['ngRoute']).config(['$routeProvider', $routeProvider => {
[
'about',
'donate',
'extracting-pokemon-files',
'faq',
'how-to-pk6-1-bvs',
'how-to-pk6-2-homebrew',
'how-to-pk6-3-4-save-files',
'how-to-pk6-6-decrypted-powersaves',
'how-to-pk7-1-bvs',
'how-to-pk7-2-homebrew',
'how-to-pk7-3-digital-save-files',
'how-to-pk7-4-tea',
'markdown',
'privacy-policy',
'tos'
].forEach(pageName => {
$routeProvider.when(`/${pageName}`, {templateUrl: `/static/${pageName}.html`});
});
$routeProvider.when('/extracting-pk6-files', {redirectTo: '/extracting-pokemon-files'});
}]);
|
function(modal) {
function ajaxifyLinks (context) {
$('a.address-choice', context).click(function() {
modal.loadUrl(this.href);
return false;
});
$('.pagination a', context).click(function() {
var page = this.getAttribute("data-page");
setPage(page);
return false;
});
};
var searchUrl = $('form.address-search', modal.body).attr('action')
function search() {
$.ajax({
url: searchUrl,
data: {q: $('#id_q').val()},
success: function(data, status) {
$('#search-results').html(data);
ajaxifyLinks($('#search-results'));
}
});
return false;
};
function setPage(page) {
if($('#id_q').val().length){
dataObj = {q: $('#id_q').val(), p: page};
}
else {
dataObj = {p: page};
}
$.ajax({
url: searchUrl,
data: dataObj,
success: function(data, status) {
$('#search-results').html(data);
ajaxifyLinks($('#search-results'));
}
});
return false;
}
ajaxifyLinks(modal.body);
function submitForm() {
var formdata = new FormData(this);
$.ajax({
url: this.action,
data: formdata,
processData: false,
contentType: false,
type: 'POST',
dataType: 'text',
success: function(response){
modal.loadResponseText(response);
}
});
return false;
}
$('form.address-create', modal.body).submit(submitForm);
$('form.address-edit', modal.body).submit(submitForm);
$('form.address-search', modal.body).submit(search);
$('#id_q').on('input', function() {
clearTimeout($.data(this, 'timer'));
var wait = setTimeout(search, 50);
$(this).data('timer', wait);
});
{% url 'wagtailadmin_tag_autocomplete' as autocomplete_url %}
$('#id_tags', modal.body).tagit({
autocomplete: {source: "{{ autocomplete_url|addslashes }}"}
});
function detectErrors() {
var errorSections = {};
// First count up all the errors
$('form.address-create .error-message').each(function(){
var parentSection = $(this).closest('section');
if(!errorSections[parentSection.attr('id')]){
errorSections[parentSection.attr('id')] = 0;
}
errorSections[parentSection.attr('id')] = errorSections[parentSection.attr('id')]+1;
});
// Now identify them on each tab
for(var index in errorSections) {
$('.tab-nav a[href=#'+ index +']').addClass('errors').attr('data-count', errorSections[index]);
}
}
detectErrors();
}
|
import React from 'react';
import { shallow } from 'enzyme';
import sinon from 'sinon';
import AddComment from './AddComment';
const USER = {
user: {
user: 'RSwanson',
username: 'Ron_Swanson',
imageURL: '',
users: [
{
name: 'April Ludwig',
url: 'aprilL@parksdept.com',
display: 'April',
},
],
},
};
describe('<AddComment>', () => {
it('calls submitComment function', () => {
const submitCommentFn = sinon.spy();
const wrapper = shallow(
<AddComment {...USER} submitComment={submitCommentFn} />,
);
const event = {
preventDefault: sinon.spy(),
};
wrapper.find('button').simulate('onClick', event);
expect(submitCommentFn.calledOnce).toBeTruthy;
});
});
|
'use strict';
angular.module('shopnxApp')
.config(function ($stateProvider) {
$stateProvider
.state('checkout', {
title: 'Checkout with the items you selected',
url: '/checkout',
templateUrl: 'app/checkout/checkout.html',
controller: 'CheckoutCtrl',
authenticate: true
});
});
|
import PromiseRouter from '../PromiseRouter';
import * as middleware from "../middlewares";
import { Parse } from "parse/node";
export class PushRouter extends PromiseRouter {
mountRoutes() {
this.route("POST", "/push", middleware.promiseEnforceMasterKeyAccess, PushRouter.handlePOST);
}
static handlePOST(req) {
const pushController = req.config.pushController;
if (!pushController) {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED, 'Push controller is not set');
}
let where = PushRouter.getQueryCondition(req);
pushController.sendPush(req.body, where, req.config, req.auth);
return Promise.resolve({
response: {
'result': true
}
});
}
/**
* Get query condition from the request body.
* @param {Object} req A request object
* @returns {Object} The query condition, the where field in a query api call
*/
static getQueryCondition(req) {
let body = req.body || {};
let hasWhere = typeof body.where !== 'undefined';
let hasChannels = typeof body.channels !== 'undefined';
let where;
if (hasWhere && hasChannels) {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
'Channels and query can not be set at the same time.');
} else if (hasWhere) {
where = body.where;
} else if (hasChannels) {
where = {
"channels": {
"$in": body.channels
}
}
} else {
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
'Channels and query should be set at least one.');
}
return where;
}
}
export default PushRouter;
|
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails oncall+jsinfra
*/
'use strict';
jest.unmock('everyObject');
var everyObject = require('everyObject');
describe('everyObject', function() {
var mockObject;
var mockCallback;
beforeEach(() => {
mockObject = {foo: 1, bar: 2, baz: 3};
mockCallback = jest.fn();
});
it('handles null', () => {
everyObject(null, mockCallback);
expect(mockCallback).not.toBeCalled();
});
it('returns true if all properties pass the test', () => {
mockCallback.mockImplementation(() => true);
var result = everyObject(mockObject, mockCallback);
expect(result).toBeTruthy();
expect(mockCallback.mock.calls).toEqual([
[1, 'foo', mockObject],
[2, 'bar', mockObject],
[3, 'baz', mockObject]
]);
});
it('returns false if any of the properties fail the test', () => {
mockCallback.mockImplementation(() => false);
var result = everyObject(mockObject, mockCallback);
expect(result).toBeFalsy();
expect(mockCallback).toBeCalled();
});
it('returns immediately upon finding a property that fails the test', () => {
mockCallback.mockImplementation(() => false);
var result = everyObject(mockObject, mockCallback);
expect(result).toBeFalsy();
expect(mockCallback.mock.calls.length).toEqual(1);
});
});
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
jest.disableAutomock();
const React = require('React');
const ReactTestRenderer = require('react-test-renderer');
const VirtualizedList = require('VirtualizedList');
describe('VirtualizedList', () => {
it('renders simple list', () => {
const component = ReactTestRenderer.create(
<VirtualizedList
data={[{key: 'i1'}, {key: 'i2'}, {key: 'i3'}]}
renderItem={({item}) => <item value={item.key} />}
/>
);
expect(component).toMatchSnapshot();
});
it('renders empty list', () => {
const component = ReactTestRenderer.create(
<VirtualizedList
data={[]}
renderItem={({item}) => <item value={item.key} />}
/>
);
expect(component).toMatchSnapshot();
});
it('renders null list', () => {
const component = ReactTestRenderer.create(
<VirtualizedList
data={undefined}
renderItem={({item}) => <item value={item.key} />}
/>
);
expect(component).toMatchSnapshot();
});
it('renders all the bells and whistles', () => {
const component = ReactTestRenderer.create(
<VirtualizedList
ItemSeparatorComponent={() => <separator />}
ListFooterComponent={() => <footer />}
ListHeaderComponent={() => <header />}
data={new Array(5).fill().map((_, ii) => ({id: String(ii)}))}
keyExtractor={(item, index) => item.id}
getItemLayout={({index}) => ({length: 50, offset: index * 50})}
numColumns={2}
refreshing={false}
onRefresh={jest.fn()}
renderItem={({item}) => <item value={item.id} />}
/>
);
expect(component).toMatchSnapshot();
});
it('test getItem functionality where data is not an Array', () => {
const component = ReactTestRenderer.create(
<VirtualizedList
data={new Map([['id_0', {key: 'item_0'}]])}
getItem={(data, index) => data.get('id_' + index)}
getItemCount={(data: Map) => data.size}
renderItem={({item}) => <item value={item.key} />}
/>
);
expect(component).toMatchSnapshot();
});
});
|
define(["require"], function (require) {
function boot(ev) {
ev.target.removeEventListener("click", boot);
require(["demos/water/water"]);
}
const start = document.querySelector(".code-demo.water [data-trigger='water.start']");
start.addEventListener("click", boot);
start.disabled = false;
});
|
'use strict';
angular.module("ngLocale", [], ["$provide", function ($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"ERANAMES": [
"Before Christ",
"Anno Domini"
],
"ERAS": [
"BC",
"AD"
],
"FIRSTDAYOFWEEK": 6,
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"STANDALONEMONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "d/M/yy h:mm a",
"shortDate": "d/M/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-\u00a4",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-jm",
"localeID": "en_JM",
"pluralCat": function (n, opt_precision) {
var i = n | 0;
var vf = getVF(n, opt_precision);
if (i == 1 && vf.v == 0) {
return PLURAL_CATEGORY.ONE;
}
return PLURAL_CATEGORY.OTHER;
}
});
}]);
|
function* f() {
var x;
try {
x = yield 1;
} catch (ex) {
yield ex;
}
return 2;
}
var g = f();
expect(g.next()).toEqual({value: 1, done: false});
expect(g.next()).toEqual({value: 2, done: true});
g = f();
expect(g.next()).toEqual({value: 1, done: false});
expect(g.throw(3)).toEqual({value: 3, done: false});
expect(g.next()).toEqual({value: 2, done: true});
|
/*
* 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');
/**
* Properties of an artifact source.
*
* @extends models['Resource']
*/
class ArtifactSource extends models['Resource'] {
/**
* Create a ArtifactSource.
* @member {string} [displayName] The artifact source's display name.
* @member {string} [uri] The artifact source's URI.
* @member {string} [sourceType] The artifact source's type. Possible values
* include: 'VsoGit', 'GitHub'
* @member {string} [folderPath] The folder containing artifacts.
* @member {string} [armTemplateFolderPath] The folder containing Azure
* Resource Manager templates.
* @member {string} [branchRef] The artifact source's branch reference.
* @member {string} [securityToken] The security token to authenticate to the
* artifact source.
* @member {string} [status] Indicates if the artifact source is enabled
* (values: Enabled, Disabled). Possible values include: 'Enabled',
* 'Disabled'
* @member {date} [createdDate] The artifact source's creation date.
* @member {string} [provisioningState] The provisioning status of the
* resource.
* @member {string} [uniqueIdentifier] The unique immutable identifier of a
* resource (Guid).
*/
constructor() {
super();
}
/**
* Defines the metadata of ArtifactSource
*
* @returns {object} metadata of ArtifactSource
*
*/
mapper() {
return {
required: false,
serializedName: 'ArtifactSource',
type: {
name: 'Composite',
className: 'ArtifactSource',
modelProperties: {
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
location: {
required: false,
serializedName: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serializedName: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
displayName: {
required: false,
serializedName: 'properties.displayName',
type: {
name: 'String'
}
},
uri: {
required: false,
serializedName: 'properties.uri',
type: {
name: 'String'
}
},
sourceType: {
required: false,
serializedName: 'properties.sourceType',
type: {
name: 'String'
}
},
folderPath: {
required: false,
serializedName: 'properties.folderPath',
type: {
name: 'String'
}
},
armTemplateFolderPath: {
required: false,
serializedName: 'properties.armTemplateFolderPath',
type: {
name: 'String'
}
},
branchRef: {
required: false,
serializedName: 'properties.branchRef',
type: {
name: 'String'
}
},
securityToken: {
required: false,
serializedName: 'properties.securityToken',
type: {
name: 'String'
}
},
status: {
required: false,
serializedName: 'properties.status',
type: {
name: 'String'
}
},
createdDate: {
required: false,
readOnly: true,
serializedName: 'properties.createdDate',
type: {
name: 'DateTime'
}
},
provisioningState: {
required: false,
serializedName: 'properties.provisioningState',
type: {
name: 'String'
}
},
uniqueIdentifier: {
required: false,
serializedName: 'properties.uniqueIdentifier',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = ArtifactSource;
|
/**
* Bootstrap
* (sails.config.bootstrap)
*
* An asynchronous bootstrap function that runs before your Sails app gets lifted.
* This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
*
* For more information on bootstrapping your app, check out:
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.bootstrap.html
*/
module.exports.bootstrap = function(cb) {
// It's very important to trigger this callback method when you are finished
// with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap)
sails.services.passport.loadStrategies();
// CRON JOBS FOR INFLUENCERS, HASHTAGS, MENTIONS
// Runs every 15 minutes
const TIMEZONE = 'America/Los_Angeles';
var CronJob = require('cron').CronJob;
var cronJobs = Object.keys(sails.config.cron);
cronJobs.forEach(function(key) {
var value = sails.config.cron[key];
new CronJob(key, value, null, true, TIMEZONE);
})
sails.config.twitterstream();
// new CronJob('00 * * * * *', function() {
// console.log(new Date(), 'You will see this message every minute.');
// }, null, true, TIMEZONE);
cb();
};
|
const latestIncome = require('./latestIncome')
const latestSpending = require('./latestSpending')
function aggFinances(search) {
return {
latestIncome: () => latestIncome(search),
latestSpending: () => latestSpending(search),
}
}
module.exports = aggFinances
|
define(function(require, exports, module) {
var Notify = require('common/bootstrap-notify');
var FileChooser = require('../widget/file/file-chooser3');
exports.run = function() {
var $form = $("#course-material-form");
var materialChooser = new FileChooser({
element: '#material-file-chooser'
});
materialChooser.on('change', function(item) {
$form.find('[name="fileId"]').val(item.id);
});
$form.on('click', '.delete-btn', function(){
var $btn = $(this);
if (!confirm(Translator.trans('真的要删除该资料吗?'))) {
return ;
}
$.post($btn.data('url'), function(){
$btn.parents('.list-group-item').remove();
Notify.success(Translator.trans('资料已删除'));
});
});
$form.on('submit', function(){
if ($form.find('[name="fileId"]').val().length == 0) {
Notify.danger(Translator.trans('请先上传文件或添加资料网络链接!'));
return false;
}
$.post($form.attr('action'), $form.serialize(), function(html){
Notify.success(Translator.trans('资料添加成功!'));
$("#material-list").append(html).show();
$form.find('.text-warning').hide();
$form.find('[name="fileId"]').val('');
$form.find('[name="link"]').val('');
$form.find('[name="description"]').val('');
materialChooser.open();
}).fail(function(){
Notify.success(Translator.trans('资料添加失败,请重试!'));
});
return false;
});
$('.modal').on('hidden.bs.modal', function(){
window.location.reload();
});
};
});
|
var JobsList = React.createClass({displayName: "JobsList",
render: function() {
return (
React.createElement(JobItem, {title: "Trabalho Python", desc: "Descricao aqui"})
);
}
});
var JobItem = React.createClass({displayName: "JobItem",
render: function() {
React.createElement("div", {className: "panel panel-default"},
React.createElement("div", {className: "panel-heading"}, this.params.job.title),
React.createElement("div", {className: "panel-body"},
this.params.job.desc
)
)
}
})
|
'@fixture click';
'@page http://example.com';
'@test'['Take a screenshot'] = {
'1.Click on non-existing element': function () {
act.screenshot();
},
};
'@test'['Screenshot on test code error'] = {
'1.Click on non-existing element': function () {
throw new Error('STOP');
},
};
|
game.LoadProfile = me.ScreenObject.extend({
/**
* action to perform on state change
*/
onResetEvent: function() {
me.game.world.addChild(new me.Sprite(0, 0, me.loader.getImage('load-screen')), -10);
//puts load screen in when game starts
document.getElementById("input").style.visibility = "visible";
document.getElementById("load").style.visibility = "visible";
me.input.unbindKey(me.input.KEY.B);
me.input.unbindKey(me.input.KEY.I);
me.input.unbindKey(me.input.KEY.O);
me.input.unbindKey(me.input.KEY.P);
me.input.unbindKey(me.input.KEY.SPACE);
//unbinds keys
var exp1cost = ((game.data.exp1 + 1) * 10);
var exp2cost = ((game.data.exp2 + 1) * 10);
var exp3cost = ((game.data.exp3 + 1) * 10);
var exp4cost = ((game.data.exp4 + 1) * 10);
me.game.world.addChild(new (me.Renderable.extend({
init: function() {
this._super(me.Renderable, 'init', [10, 10, 300, 50]);
this.font = new me.Font("Arial", 26, "white");
},
draw: function(renderer) {
this.font.draw(renderer.getContext(), "Enter Username & Password", this.pos.x, this.pos.y);
}
})));
},
/**
* action to perform when leaving this screen (state change)
*/
onDestroyEvent: function() {
document.getElementById("input").style.visibility = "hidden";
document.getElementById("load").style.visibility = "hidden";
}
});
|
Template.HostList.events({
});
Template.HostList.helpers({
// Get list of Hosts sorted by the sort field.
hosts: function () {
return Hosts.find({}, {sort: {sort: 1}});
}
});
Template.HostList.rendered = function () {
// Make rows sortable/draggable using Jquery-UI.
this.$('#sortable').sortable({
stop: function (event, ui) {
// Define target row items.
target = ui.item.get(0);
before = ui.item.prev().get(0);
after = ui.item.next().get(0);
// Change the sort value dependnig on target location.
// If target is now first, subtract 1 from sort value.
if (!before) {
newSort = Blaze.getData(after).sort - 1;
// If target is now last, add 1 to sort value.
} else if (!after) {
newSort = Blaze.getData(before).sort + 1;
// Get value of prev and next elements
// to determine new target sort value.
} else {
newSort = (Blaze.getData(after).sort +
Blaze.getData(before).sort) / 2;
}
// Update the database with new sort value.
Hosts.update({_id: Blaze.getData(target)._id}, {
$set: {
sort: newSort
}
});
}
});
};
|
import Helper, { states } from './_helper';
import { module, test } from 'qunit';
module('Integration | ORM | Has Many | Named Reflexive | association #set', function(hooks) {
hooks.beforeEach(function() {
this.helper = new Helper();
});
/*
The model can update its association via parent, for all states
*/
states.forEach((state) => {
test(`a ${state} can update its association to a list of saved children`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
let savedTag = this.helper.savedChild();
tag.labels = [ savedTag ];
assert.ok(tag.labels.includes(savedTag));
assert.equal(tag.labelIds[0], savedTag.id);
assert.ok(savedTag.labels.includes(tag), 'the inverse was set');
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
test(`a ${state} can update its association to a new parent`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
let newTag = this.helper.newChild();
tag.labels = [ newTag ];
assert.ok(tag.labels.includes(newTag));
assert.equal(tag.labelIds[0], undefined);
assert.ok(newTag.labels.includes(tag), 'the inverse was set');
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
test(`a ${state} can clear its association via an empty list`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
tag.labels = [ ];
assert.deepEqual(tag.labelIds, [ ]);
assert.equal(tag.labels.models.length, 0);
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
test(`a ${state} can clear its association via an empty list`, function(assert) {
let [ tag, originalTags ] = this.helper[state]();
tag.labels = null;
assert.deepEqual(tag.labelIds, [ ]);
assert.equal(tag.labels.models.length, 0);
tag.save();
originalTags.forEach(originalTag => {
originalTag.reload();
assert.notOk(originalTag.labels.includes(tag), 'old inverses were cleared');
});
});
});
});
|
/* describe, it, afterEach, beforeEach */
import './snoocore-mocha';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
let expect = chai.expect;
import config from '../config';
import util from './util';
import ResponseError from '../../src/ResponseError';
import Endpoint from '../../src/Endpoint';
describe(__filename, function () {
this.timeout(config.testTimeout);
it('should get a proper response error', function() {
var message = 'oh hello there';
var response = { _status: 200, _body: 'a response body' };
var userConfig = util.getScriptUserConfig();
var endpoint = new Endpoint(userConfig,
userConfig.serverOAuth,
'get',
'/some/path',
{}, // headers
{ some: 'args' });
var responseError = new ResponseError(message,
response,
endpoint);
expect(responseError instanceof ResponseError);
expect(responseError.status).to.eql(200);
expect(responseError.url).to.eql('https://oauth.reddit.com/some/path');
expect(responseError.args).to.eql({ some: 'args', api_type: 'json' });
expect(responseError.message.indexOf('oh hello there')).to.not.eql(-1);
expect(responseError.message.indexOf('Response Status')).to.not.eql(-1);
expect(responseError.message.indexOf('Endpoint URL')).to.not.eql(-1);
expect(responseError.message.indexOf('Arguments')).to.not.eql(-1);
expect(responseError.message.indexOf('Response Body')).to.not.eql(-1);
});
});
|
function someFunctionWithAVeryLongName(firstParameter='something',
secondParameter='booooo',
third=null, fourthParameter=false,
fifthParameter=123.12,
sixthParam=true
){
}
function someFunctionWithAVeryLongName2(
firstParameter='something',
secondParameter='booooo',
) {
}
function blah() {
}
function blah()
{
}
var object =
{
someFunctionWithAVeryLongName: function(
firstParameter='something',
secondParameter='booooo',
third=null,
fourthParameter=false,
fifthParameter=123.12,
sixthParam=true
) /** w00t */ {
}
someFunctionWithAVeryLongName2: function (firstParameter='something',
secondParameter='booooo',
third=null
) {
}
someFunctionWithAVeryLongName3: function (
firstParameter, secondParameter, third=null
) {
}
someFunctionWithAVeryLongName4: function (
firstParameter, secondParameter
) {
}
someFunctionWithAVeryLongName5: function (
firstParameter,
secondParameter=array(1,2,3),
third=null
) {
}
}
var a = Function('return 1+1');
|
#!/usr/bin/env node
require("babel/register")({
"stage": 1
});
var fs = require("fs");
GLOBAL.WALLACEVERSION = "Err";
GLOBAL.PLUGIN_CONTRIBUTORS = [];
try {
var p = JSON.parse(fs.readFileSync(__dirname+"/package.json"));
GLOBAL.WALLACEVERSION = p.version;
}
catch(e) {}
var Core = require("./core/Core.js");
process.on('uncaughtException', function (err) {
console.error(err);
});
GLOBAL.core = new Core();
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
/*global cEngine */
/*eslint no-console:0*/
(function (cEngine) {
cEngine.extend('__name__', {
create: function create(config) {
config = config || {};
var __name__ = {
cEnginePlugin: {
name: '__name__',
version: '0.0.1'
},
init: function init(engine) {
console.log('init', engine);
},
start: function start() {
console.log('start');
},
stop: function stop() {
console.log('stop');
},
preStep: function preStep(context, width, height, dt) {
console.log('preStep', context, width, height, dt);
},
postStep: function postStep(context, width, height, dt) {
console.log('postStep', context, width, height, dt);
},
destroy: function destroy() {
console.log('destroy');
}
};
return __name__;
}
});
})(cEngine);
},{}]},{},[1])
|
#!/usr/bin/env node
/**
* Release this package.
*/
"use strict";
process.chdir(__dirname + '/..');
const apeTasking = require('ape-tasking'),
apeReleasing = require('ape-releasing');
apeTasking.runTasks('release', [
(callback) => {
apeReleasing.releasePackage({
beforeRelease: [
'./ci/build.js',
'./ci/test.js'
]
}, callback);
}
], true);
|
/*global d3 */
// asynchronously load data from the Lagotto API
queue()
.defer(d3.json, encodeURI("/api/agents/"))
.await(function(error, a) {
if (error) { return console.warn(error); }
agentsViz(a.agents);
});
// add data to page
function agentsViz(data) {
for (var i=0; i<data.length; i++) {
var agent = data[i];
// responses tab
d3.select("#response_count_" + agent.id)
.text(numberWithDelimiter(agent.responses.count));
d3.select("#average_count_" + agent.id)
.text(numberWithDelimiter(agent.responses.average));
}
}
|
var test = require("tape").test
var level = require("level-test")()
var testdb = level("test-versionstream")
var version = require("../")
var db = version(testdb)
var lastVersion
test("stuff some datas", function (t) {
t.plan(2)
db.put("pet", "fluffy", {version: 0})
db.put("pet", "spot", {version: 1})
db.put("pet", "scratch", {version: 334})
db.put("watch", "calculator", {version: 11})
db.put("watch", "casio", {version: 14})
db.put("pet", "sparky", function (err, version) {
t.notOk(err, "no error")
t.ok(version > Date.now() - 1000, "Default version is a recent timestamp")
lastVersion = version
})
})
test("versionstream pets", function (t) {
t.plan(5)
var versions = []
db.createVersionStream("pet")
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [lastVersion, 334, 1, 0], "Versions came out in the correct order")
})
})
test("versionstream pets version no min", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {maxVersion: 500, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [334], "Versions came out in the correct order")
})
})
test("versionstream pets version reverse no min", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {maxVersion: 500, limit: 1, reverse: true})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [0], "Versions came out in the correct order")
})
})
test("versionstream pets version range no max", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {minVersion: 10, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [lastVersion], "Versions came out in the correct order")
})
})
test("versionstream pets version range", function (t) {
t.plan(2)
var versions = []
db.createVersionStream("pet", {minVersion: 10, maxVersion: 500, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [334], "Versions came out in the correct order")
})
})
test("versionstream watches", function (t) {
t.plan(3)
var versions = []
db.createVersionStream("watch")
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [14, 11], "Versions came out in the correct order")
})
})
test("alias", function (t) {
var versions = []
db.versionStream("pet")
.on("data", function (record) {
t.ok(record.version != null, "record has a version")
versions.push(record.version)
})
.on("end", function () {
t.deepEqual(versions, [lastVersion, 334, 1, 0], "Versions came out in the correct order")
t.end()
})
})
|
"use strict";
const lua = require("../src/lua.js");
const lauxlib = require("../src/lauxlib.js");
const {to_luastring} = require("../src/fengaricore.js");
const toByteCode = function(luaCode) {
let L = lauxlib.luaL_newstate();
if (!L) throw Error("failed to create lua state");
if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) !== lua.LUA_OK)
throw Error(lua.lua_tojsstring(L, -1));
let b = [];
if (lua.lua_dump(L, function(L, b, size, B) {
B.push(...b.slice(0, size));
return 0;
}, b, false) !== 0)
throw Error("unable to dump given function");
return Uint8Array.from(b);
};
module.exports.toByteCode = toByteCode;
|
/* Get Programming with JavaScript
* Listing 4.01
* Displaying an object's properties on the console
*/
var movie1;
movie1 = {
title: "Inside Out",
actors: "Amy Poehler, Bill Hader",
directors: "Pete Doctor, Ronaldo Del Carmen"
};
console.log("Movie information for " + movie1.title);
console.log("------------------------------");
console.log("Actors: " + movie1.actors);
console.log("Directors: " + movie1.directors);
console.log("------------------------------");
/* Further Adventures
*
* 1) Add a second movie and display the same info for it.
*
* 2) Create an object to represent a blog post.
*
* 3) Write code to display info about the blog post.
*
*/
|
(function () {
'use strict';
angular.module('common')
.directive('svLumxUsersDropdown', function () {
return {
templateUrl: 'scripts/common/directives/sv-lumx-users-dropdown.html',
scope: {
btnTitle: '@',
actionCounter: '@',
userAvatar: '@',
userName: '@',
userFirstName: '@',
userLastName: '@',
iconType: '@',
iconName: '@'
},
link: function ($scope, el, attrs) {
}
};
});
})();
|
/*
* Copyright (c) 2015 by Rafael Angel Aznar Aparici (rafaaznar at gmail dot com)
*
* sisane: The stunning micro-library that helps you to develop easily
* AJAX web applications by using Angular.js 1.x & sisane-server
* sisane is distributed under the MIT License (MIT)
* Sources at https://github.com/rafaelaznar/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
'use strict';
moduloEpisodio.controller('EpisodioViewpopController', ['$scope', '$routeParams', 'serverService', 'episodioService', '$location', '$uibModalInstance', 'id',
function ($scope, $routeParams, serverService, episodioService, $location, $uibModalInstance, id) {
$scope.fields = episodioService.getFields();
$scope.obtitle = episodioService.getObTitle();
$scope.icon = episodioService.getIcon();
$scope.ob = episodioService.getTitle();
$scope.title = "Vista de " + $scope.obtitle;
$scope.id = id;
$scope.status = null;
$scope.debugging = serverService.debugging();
serverService.promise_getOne($scope.ob, $scope.id).then(function (response) {
if (response.status == 200) {
if (response.data.status == 200) {
$scope.status = null;
$scope.bean = response.data.message;
var filter = "and,id_medico,equa," + $scope.bean.obj_medico.id;
serverService.promise_getPage("usuario", 1, 1, filter).then(function (data) {
if (data.data.message.length > 0)
$scope.medico = data.data.message[0];
});
} else {
$scope.status = "Error en la recepción de datos del servidor";
}
} else {
$scope.status = "Error en la recepción de datos del servidor";
}
}).catch(function (data) {
$scope.status = "Error en la recepción de datos del servidor";
});
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
}
}]);
|
'use strict';
var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');
var browserSync = require('browser-sync');
function isOnlyChange(event) {
return event.type === 'changed';
}
gulp.task('watch', ['inject'], function () {
gulp.watch([path.join(conf.paths.src, '/*.html'), 'bower.json'], ['inject']);
gulp.watch([
path.join(conf.paths.src, '/assets/styles/css/**/*.css'),
path.join(conf.paths.src, '/assets/styles/less/**/*.less')
], function(event) {
if(isOnlyChange(event)) {
gulp.start('own-styles');
} else {
gulp.start('inject');
}
});
gulp.watch([
path.join(conf.paths.src, '/app/**/*.css'),
path.join(conf.paths.src, '/app/**/*.less')
], function(event) {
if(isOnlyChange(event)) {
gulp.start('styles');
} else {
gulp.start('inject');
}
});
gulp.watch(path.join(conf.paths.src, '/app/**/*.js'), function(event) {
if(isOnlyChange(event)) {
gulp.start('scripts');
} else {
gulp.start('inject');
}
});
gulp.watch(path.join(conf.paths.src, '/app/**/*.html'), function(event) {
browserSync.reload(event.path);
});
});
|
var assert = require('assert');
var _ = require('@sailshq/lodash');
var SchemaBuilder = require('../lib/waterline-schema');
describe('Has Many Through :: ', function() {
describe('Junction Tables', function() {
var schema;
before(function() {
var fixtures = [
{
identity: 'user',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
cars: {
collection: 'car',
through: 'drive',
via: 'user'
}
}
},
{
identity: 'drive',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
car: {
model: 'car'
},
user: {
model: 'user'
}
}
},
{
identity: 'car',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
drivers: {
collection: 'user',
through: 'drive',
via: 'car'
}
}
}
];
var collections = _.map(fixtures, function(obj) {
var collection = function() {};
collection.prototype = obj;
return collection;
});
// Build the schema
schema = SchemaBuilder(collections);
});
it('should flag the "through" table and not mark it as a junction table', function() {
assert(schema.drive);
assert(!schema.drive.junctionTable);
assert(schema.drive.throughTable);
});
});
describe('Reference Mapping', function() {
var schema;
before(function() {
var fixtures = [
{
identity: 'foo',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
bars: {
collection: 'bar',
through: 'foobar',
via: 'foo'
}
}
},
{
identity: 'foobar',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
type: {
type: 'string'
},
foo: {
model: 'foo',
columnName: 'foo_id'
},
bar: {
model: 'bar',
columnName: 'bar_id'
}
}
},
{
identity: 'bar',
primaryKey: 'id',
attributes: {
id: {
type: 'number'
},
foo: {
collection: 'foo',
through: 'foobar',
via: 'bar'
}
}
}
];
var collections = _.map(fixtures, function(obj) {
var collection = function() {};
collection.prototype = obj;
return collection;
});
// Build the schema
schema = SchemaBuilder(collections);
});
it('should update the parent collection to point to the join table', function() {
assert.equal(schema.foo.schema.bars.references, 'foobar');
assert.equal(schema.foo.schema.bars.on, 'foo_id');
});
});
});
|
module('lively.ide.DirectoryWatcher').requires('lively.Network').toRun(function() {
// depends on the DirectoryWatcherServer
Object.extend(lively.ide.DirectoryWatcher, {
watchServerURL: new URL(Config.nodeJSURL+'/DirectoryWatchServer/'),
dirs: {},
reset: function() {
// lively.ide.DirectoryWatcher.reset()
this.dirs = {};
this.watchServerURL.withFilename('reset').asWebResource().post();
},
request: function(url, thenDo) {
return url.asWebResource().beAsync().withJSONWhenDone(function(json, status) {
thenDo(!json || json.error, json); }).get();
},
getFiles: function(dir, thenDo) {
this.request(this.watchServerURL.withFilename('files').withQuery({dir: dir}), thenDo);
},
getChanges: function(dir, since, startWatchTime, thenDo) {
this.request(this.watchServerURL.withFilename('changes').withQuery({
startWatchTime: startWatchTime, since: since, dir: dir}), thenDo);
},
withFilesOfDir: function(dir, doFunc) {
// Retrieves efficiently the files of dir. Uses a server side watcher that
// sends infos about file changes, deletions, creations.
// This methods synchs those with the cached state held in this object
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// dir = lively.shell.exec('pwd', {sync:true}).resultString()
// lively.ide.DirectoryWatcher.dirs
// lively.ide.DirectoryWatcher.withFilesOfDir(dir, function(files) { show(Object.keys(files).length); })
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
var watchState = this.dirs[dir] || (this.dirs[dir] = {updateInProgress: false, callbacks: []});
doFunc && watchState.callbacks.push(doFunc);
if (watchState.updateInProgress) { return; }
watchState.updateInProgress = true;
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
if (!watchState.files) { // first time called
this.getFiles(dir, function(err, result) {
if (err) show("dir watch error: %s", err);
result.files && Properties.forEachOwn(result.files, function(path, stat) { extend(stat); })
Object.extend(watchState, {
files: result.files,
lastUpdated: result.startTime,
startTime: result.startTime
});
whenDone();
});
return;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
var timeSinceLastUpdate = Date.now() - (watchState.lastUpdated || 0);
if (timeSinceLastUpdate < 10 * 1000) { whenDone(); } // recently updated
// get updates
this.getChanges(dir, watchState.lastUpdated, watchState.startTime, function(err, result) {
if (!result.changes || result.changes.length === 0) { whenDone(); return; }
watchState.lastUpdated = result.changes[0].time;
console.log('%s files changed in %s: %s', result.changes.length, dir, result.changes.pluck('path').join('\n'));
result.changes.forEach(function(change) {
switch (change.type) {
case 'removal': delete watchState.files[change.path]; break;
case 'creation': case 'change': watchState.files[change.path] = extend(change.stat); break;
}
});
whenDone();
});
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function whenDone() {
watchState.updateInProgress = false;
var cb;
while ((cb = watchState.callbacks.shift())) cb(watchState.files);
}
function extend(statObj) { // convert date string into a date object
if (!statObj) statObj = {};
statObj.isDirectory = !!(statObj.mode & 0x4000);
['atime', 'mtime', 'ctime'].forEach(function(field) {
if (statObj[field]) statObj[field] = new Date(statObj[field]); });
return statObj;
}
}
});
}) // end of module
|
// Generated by CoffeeScript 1.3.1
|
'use strict';
require('../common');
// This test ensures that zlib throws a RangeError if the final buffer needs to
// be larger than kMaxLength and concatenation fails.
// https://github.com/nodejs/node/pull/1811
const assert = require('assert');
// Change kMaxLength for zlib to trigger the error without having to allocate
// large Buffers.
const buffer = require('buffer');
const oldkMaxLength = buffer.kMaxLength;
buffer.kMaxLength = 64;
const zlib = require('zlib');
buffer.kMaxLength = oldkMaxLength;
const encoded = Buffer.from('G38A+CXCIrFAIAM=', 'base64');
// Async
zlib.brotliDecompress(encoded, function(err) {
assert.ok(err instanceof RangeError);
});
// Sync
assert.throws(function() {
zlib.brotliDecompressSync(encoded);
}, RangeError);
|
const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('posts_meta', 'email_only', {
type: 'bool',
nullable: false,
defaultTo: false
});
|
//currently commented out as TokenTester is causing a OOG error due to the Factory being too big
//Not fully needed as factory & separate tests cover token creation.
/*contract("TokenTester", function(accounts) {
it("creates 10000 initial tokens", function(done) {
var tester = TokenTester.at(TokenTester.deployed_address);
tester.tokenContractAddress.call()
.then(function(tokenContractAddr) {
var tokenContract = HumanStandardToken.at(tokenContractAddr);
return tokenContract.balanceOf.call(TokenTester.deployed_address);
}).then(function (result) {
assert.strictEqual(result.toNumber(), 10000); // 10000 as specified in TokenTester.sol
done();
}).catch(done);
});
//todo:add test on retrieving addresses
});*/
|
module.exports = {
"extends": "airbnb",
"parser": "babel-eslint",
"plugins": [
"react"
],
"rules": {
"react/prop-types": 0,
"react/jsx-boolean-value": 0,
"consistent-return": 0,
"guard-for-in": 0,
"no-use-before-define": 0,
"space-before-function-paren": [2, { "anonymous": "never", "named": "always" }]
}
};
|
//>>built
define("clipart/SpinInput",["dojo/_base/declare","clipart/_clipart"],function(_1,_2){
return _1("clipart.SpinInput",[_2],{});
});
|
module.exports = {
getMeta: function(meta) {
var d = meta.metaDescription || meta.description || meta.Description;
if (d && d instanceof Array) {
d = d[0];
}
return {
description: d
}
}
};
|
!((document, $) => {
var clip = new Clipboard('.copy-button');
clip.on('success', function(e) {
$('.copied').show();
$('.copied').fadeOut(2000);
});
})(document, jQuery);
|
var binary = require('node-pre-gyp');
var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
var binding = require(binding_path);
var Stream = require('stream').Stream,
inherits = require('util').inherits;
function Snapshot() {}
Snapshot.prototype.getHeader = function() {
return {
typeId: this.typeId,
uid: this.uid,
title: this.title
}
}
/**
* @param {Snapshot} other
* @returns {Object}
*/
Snapshot.prototype.compare = function(other) {
var selfHist = nodesHist(this),
otherHist = nodesHist(other),
keys = Object.keys(selfHist).concat(Object.keys(otherHist)),
diff = {};
keys.forEach(function(key) {
if (key in diff) return;
var selfCount = selfHist[key] || 0,
otherCount = otherHist[key] || 0;
diff[key] = otherCount - selfCount;
});
return diff;
};
function ExportStream() {
Stream.Transform.call(this);
this._transform = function noTransform(chunk, encoding, done) {
done(null, chunk);
}
}
inherits(ExportStream, Stream.Transform);
/**
* @param {Stream.Writable|function} dataReceiver
* @returns {Stream|undefined}
*/
Snapshot.prototype.export = function(dataReceiver) {
dataReceiver = dataReceiver || new ExportStream();
var toStream = dataReceiver instanceof Stream,
chunks = toStream ? null : [];
function onChunk(chunk, len) {
if (toStream) dataReceiver.write(chunk);
else chunks.push(chunk);
}
function onDone() {
if (toStream) dataReceiver.end();
else dataReceiver(null, chunks.join(''));
}
this.serialize(onChunk, onDone);
return toStream ? dataReceiver : undefined;
};
function nodes(snapshot) {
var n = snapshot.nodesCount, i, nodes = [];
for (i = 0; i < n; i++) {
nodes[i] = snapshot.getNode(i);
}
return nodes;
};
function nodesHist(snapshot) {
var objects = {};
nodes(snapshot).forEach(function(node){
var key = node.type === "Object" ? node.name : node.type;
objects[key] = objects[node.name] || 0;
objects[key]++;
});
return objects;
};
function CpuProfile() {}
CpuProfile.prototype.getHeader = function() {
return {
typeId: this.typeId,
uid: this.uid,
title: this.title
}
}
CpuProfile.prototype.export = function(dataReceiver) {
dataReceiver = dataReceiver || new ExportStream();
var toStream = dataReceiver instanceof Stream;
var error, result;
try {
result = JSON.stringify(this);
} catch (err) {
error = err;
}
process.nextTick(function() {
if (toStream) {
if (error) {
dataReceiver.emit('error', error);
}
dataReceiver.end(result);
} else {
dataReceiver(error, result);
}
});
return toStream ? dataReceiver : undefined;
};
var startTime, endTime;
var activeProfiles = [];
var profiler = {
/*HEAP PROFILER API*/
get snapshots() { return binding.heap.snapshots; },
takeSnapshot: function(name, control) {
var snapshot = binding.heap.takeSnapshot.apply(null, arguments);
snapshot.__proto__ = Snapshot.prototype;
snapshot.title = name;
return snapshot;
},
getSnapshot: function(index) {
var snapshot = binding.heap.snapshots[index];
if (!snapshot) return;
snapshot.__proto__ = Snapshot.prototype;
return snapshot;
},
findSnapshot: function(uid) {
var snapshot = binding.heap.snapshots.filter(function(snapshot) {
return snapshot.uid == uid;
})[0];
if (!snapshot) return;
snapshot.__proto__ = Snapshot.prototype;
return snapshot;
},
deleteAllSnapshots: function () {
binding.heap.snapshots.forEach(function(snapshot) {
snapshot.delete();
});
},
startTrackingHeapObjects: binding.heap.startTrackingHeapObjects,
stopTrackingHeapObjects: binding.heap.stopTrackingHeapObjects,
getHeapStats: binding.heap.getHeapStats,
getObjectByHeapObjectId: binding.heap.getObjectByHeapObjectId,
/*CPU PROFILER API*/
get profiles() { return binding.cpu.profiles; },
startProfiling: function(name, recsamples) {
if (activeProfiles.length == 0 && typeof process._startProfilerIdleNotifier == "function")
process._startProfilerIdleNotifier();
name = name || "";
if (activeProfiles.indexOf(name) < 0)
activeProfiles.push(name)
startTime = Date.now();
binding.cpu.startProfiling(name, recsamples);
},
stopProfiling: function(name) {
var index = activeProfiles.indexOf(name);
if (name && index < 0)
return;
var profile = binding.cpu.stopProfiling(name);
endTime = Date.now();
profile.__proto__ = CpuProfile.prototype;
if (!profile.startTime) profile.startTime = startTime;
if (!profile.endTime) profile.endTime = endTime;
if (name)
activeProfiles.splice(index, 1);
else
activeProfiles.length = activeProfiles.length - 1;
if (activeProfiles.length == 0 && typeof process._stopProfilerIdleNotifier == "function")
process._stopProfilerIdleNotifier();
return profile;
},
getProfile: function(index) {
return binding.cpu.profiles[index];
},
findProfile: function(uid) {
var profile = binding.cpu.profiles.filter(function(profile) {
return profile.uid == uid;
})[0];
return profile;
},
deleteAllProfiles: function() {
binding.cpu.profiles.forEach(function(profile) {
profile.delete();
});
}
};
module.exports = profiler;
process.profiler = profiler;
|
/**
* webdriverio
* https://github.com/Camme/webdriverio
*
* A WebDriver module for nodejs. Either use the super easy help commands or use the base
* Webdriver wire protocol commands. Its totally inspired by jellyfishs webdriver, but the
* goal is to make all the webdriver protocol items available, as near the original as possible.
*
* Copyright (c) 2013 Camilo Tapia <camilo.tapia@gmail.com>
* Licensed under the MIT license.
*
* Contributors:
* Dan Jenkins <dan.jenkins@holidayextras.com>
* Christian Bromann <mail@christian-bromann.com>
* Vincent Voyer <vincent@zeroload.net>
*/
import WebdriverIO from './lib/webdriverio'
import Multibrowser from './lib/multibrowser'
import ErrorHandler from './lib/utils/ErrorHandler'
import getImplementedCommands from './lib/helpers/getImplementedCommands'
import pkg from './package.json'
const IMPLEMENTED_COMMANDS = getImplementedCommands()
const VERSION = pkg.version
let remote = function (options = {}, modifier) {
/**
* initialise monad
*/
let wdio = WebdriverIO(options, modifier)
/**
* build prototype: commands
*/
for (let commandName of Object.keys(IMPLEMENTED_COMMANDS)) {
wdio.lift(commandName, IMPLEMENTED_COMMANDS[commandName])
}
let prototype = wdio()
prototype.defer.resolve()
return prototype
}
let multiremote = function (options) {
let multibrowser = new Multibrowser()
for (let browserName of Object.keys(options)) {
multibrowser.addInstance(
browserName,
remote(options[browserName], multibrowser.getInstanceModifier())
)
}
return remote(options, multibrowser.getModifier())
}
export { remote, multiremote, VERSION, ErrorHandler }
|
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import * as React from 'react';
import PropTypes from 'prop-types';
import { Transition } from 'react-transition-group';
import useTheme from '../styles/useTheme';
import { reflow, getTransitionProps } from '../transitions/utils';
import useForkRef from '../utils/useForkRef';
function getScale(value) {
return `scale(${value}, ${value ** 2})`;
}
const styles = {
entering: {
opacity: 1,
transform: getScale(1)
},
entered: {
opacity: 1,
transform: 'none'
}
};
/**
* The Grow transition is used by the [Tooltip](/components/tooltips/) and
* [Popover](/components/popover/) components.
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
*/
const Grow = React.forwardRef(function Grow(props, ref) {
const {
children,
in: inProp,
onEnter,
onExit,
style,
timeout = 'auto'
} = props,
other = _objectWithoutPropertiesLoose(props, ["children", "in", "onEnter", "onExit", "style", "timeout"]);
const timer = React.useRef();
const autoTimeout = React.useRef();
const handleRef = useForkRef(children.ref, ref);
const theme = useTheme();
const handleEnter = (node, isAppearing) => {
reflow(node); // So the animation always start from the start.
const {
duration: transitionDuration,
delay
} = getTransitionProps({
style,
timeout
}, {
mode: 'enter'
});
let duration;
if (timeout === 'auto') {
duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
autoTimeout.current = duration;
} else {
duration = transitionDuration;
}
node.style.transition = [theme.transitions.create('opacity', {
duration,
delay
}), theme.transitions.create('transform', {
duration: duration * 0.666,
delay
})].join(',');
if (onEnter) {
onEnter(node, isAppearing);
}
};
const handleExit = node => {
const {
duration: transitionDuration,
delay
} = getTransitionProps({
style,
timeout
}, {
mode: 'exit'
});
let duration;
if (timeout === 'auto') {
duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
autoTimeout.current = duration;
} else {
duration = transitionDuration;
}
node.style.transition = [theme.transitions.create('opacity', {
duration,
delay
}), theme.transitions.create('transform', {
duration: duration * 0.666,
delay: delay || duration * 0.333
})].join(',');
node.style.opacity = '0';
node.style.transform = getScale(0.75);
if (onExit) {
onExit(node);
}
};
const addEndListener = (_, next) => {
if (timeout === 'auto') {
timer.current = setTimeout(next, autoTimeout.current || 0);
}
};
React.useEffect(() => {
return () => {
clearTimeout(timer.current);
};
}, []);
return /*#__PURE__*/React.createElement(Transition, _extends({
appear: true,
in: inProp,
onEnter: handleEnter,
onExit: handleExit,
addEndListener: addEndListener,
timeout: timeout === 'auto' ? null : timeout
}, other), (state, childProps) => {
return React.cloneElement(children, _extends({
style: _extends({
opacity: 0,
transform: getScale(0.75),
visibility: state === 'exited' && !inProp ? 'hidden' : undefined
}, styles[state], {}, style, {}, children.props.style),
ref: handleRef
}, childProps));
});
});
process.env.NODE_ENV !== "production" ? Grow.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* A single child content element.
*/
children: PropTypes.element,
/**
* If `true`, show the component; triggers the enter or exit animation.
*/
in: PropTypes.bool,
/**
* @ignore
*/
onEnter: PropTypes.func,
/**
* @ignore
*/
onExit: PropTypes.func,
/**
* @ignore
*/
style: PropTypes.object,
/**
* The duration for the transition, in milliseconds.
* You may specify a single timeout for all transitions, or individually with an object.
*
* Set to 'auto' to automatically calculate transition time based on height.
*/
timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({
appear: PropTypes.number,
enter: PropTypes.number,
exit: PropTypes.number
})])
} : void 0;
Grow.muiSupportAuto = true;
export default Grow;
|
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'basicstyles', 'en-gb', {
bold: 'Bold',
italic: 'Italic',
strike: 'Strike Through',
subscript: 'Subscript',
superscript: 'Superscript',
underline: 'Underline'
} );
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.