text
stringlengths 2
6.14k
|
|---|
/**
* jQuery EasyUI 1.2.6
*
* Licensed under the GPL terms
* To use it on other terms please contact us
*
* Copyright(c) 2009-2012 stworthy [ stworthy@gmail.com ]
*
*/
(function($){
var _1=false;
$.fn.resizable=function(_2,_3){
if(typeof _2=="string"){
return $.fn.resizable.methods[_2](this,_3);
}
function _4(e){
var _5=e.data;
var _6=$.data(_5.target,"resizable").options;
if(_5.dir.indexOf("e")!=-1){
var _7=_5.startWidth+e.pageX-_5.startX;
_7=Math.min(Math.max(_7,_6.minWidth),_6.maxWidth);
_5.width=_7;
}
if(_5.dir.indexOf("s")!=-1){
var _8=_5.startHeight+e.pageY-_5.startY;
_8=Math.min(Math.max(_8,_6.minHeight),_6.maxHeight);
_5.height=_8;
}
if(_5.dir.indexOf("w")!=-1){
_5.width=_5.startWidth-e.pageX+_5.startX;
if(_5.width>=_6.minWidth&&_5.width<=_6.maxWidth){
_5.left=_5.startLeft+e.pageX-_5.startX;
}
}
if(_5.dir.indexOf("n")!=-1){
_5.height=_5.startHeight-e.pageY+_5.startY;
if(_5.height>=_6.minHeight&&_5.height<=_6.maxHeight){
_5.top=_5.startTop+e.pageY-_5.startY;
}
}
};
function _9(e){
var _a=e.data;
var _b=_a.target;
if(!$.boxModel&&$.browser.msie){
$(_b).css({width:_a.width,height:_a.height,left:_a.left,top:_a.top});
}else{
$(_b).css({width:_a.width-_a.deltaWidth,height:_a.height-_a.deltaHeight,left:_a.left,top:_a.top});
}
};
function _c(e){
_1=true;
$.data(e.data.target,"resizable").options.onStartResize.call(e.data.target,e);
return false;
};
function _d(e){
_4(e);
if($.data(e.data.target,"resizable").options.onResize.call(e.data.target,e)!=false){
_9(e);
}
return false;
};
function _e(e){
_1=false;
_4(e,true);
_9(e);
$.data(e.data.target,"resizable").options.onStopResize.call(e.data.target,e);
$(document).unbind(".resizable");
$("body").css("cursor","auto");
return false;
};
return this.each(function(){
var _f=null;
var _10=$.data(this,"resizable");
if(_10){
$(this).unbind(".resizable");
_f=$.extend(_10.options,_2||{});
}else{
_f=$.extend({},$.fn.resizable.defaults,_2||{});
$.data(this,"resizable",{options:_f});
}
if(_f.disabled==true){
return;
}
$(this).bind("mousemove.resizable",{target:this},function(e){
if(_1){
return;
}
var dir=_11(e);
if(dir==""){
$(e.data.target).css("cursor","");
}else{
$(e.data.target).css("cursor",dir+"-resize");
}
}).bind("mousedown.resizable",{target:this},function(e){
var dir=_11(e);
if(dir==""){
return;
}
function _12(css){
var val=parseInt($(e.data.target).css(css));
if(isNaN(val)){
return 0;
}else{
return val;
}
};
var _13={target:e.data.target,dir:dir,startLeft:_12("left"),startTop:_12("top"),left:_12("left"),top:_12("top"),startX:e.pageX,startY:e.pageY,startWidth:$(e.data.target).outerWidth(),startHeight:$(e.data.target).outerHeight(),width:$(e.data.target).outerWidth(),height:$(e.data.target).outerHeight(),deltaWidth:$(e.data.target).outerWidth()-$(e.data.target).width(),deltaHeight:$(e.data.target).outerHeight()-$(e.data.target).height()};
$(document).bind("mousedown.resizable",_13,_c);
$(document).bind("mousemove.resizable",_13,_d);
$(document).bind("mouseup.resizable",_13,_e);
$("body").css("cursor",dir+"-resize");
}).bind("mouseleave.resizable",{target:this},function(e){
$(e.data.target).css("cursor","");
});
function _11(e){
var tt=$(e.data.target);
var dir="";
var _14=tt.offset();
var _15=tt.outerWidth();
var _16=tt.outerHeight();
var _17=_f.edge;
if(e.pageY>_14.top&&e.pageY<_14.top+_17){
dir+="n";
}else{
if(e.pageY<_14.top+_16&&e.pageY>_14.top+_16-_17){
dir+="s";
}
}
if(e.pageX>_14.left&&e.pageX<_14.left+_17){
dir+="w";
}else{
if(e.pageX<_14.left+_15&&e.pageX>_14.left+_15-_17){
dir+="e";
}
}
var _18=_f.handles.split(",");
for(var i=0;i<_18.length;i++){
var _19=_18[i].replace(/(^\s*)|(\s*$)/g,"");
if(_19=="all"||_19==dir){
return dir;
}
}
return "";
};
});
};
$.fn.resizable.methods={options:function(jq){
return $.data(jq[0],"resizable").options;
},enable:function(jq){
return jq.each(function(){
$(this).resizable({disabled:false});
});
},disable:function(jq){
return jq.each(function(){
$(this).resizable({disabled:true});
});
}};
$.fn.resizable.defaults={disabled:false,handles:"n, e, s, w, ne, se, sw, nw, all",minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000,edge:5,onStartResize:function(e){
},onResize:function(e){
},onStopResize:function(e){
}};
})(jQuery);
|
"use strict";
tutao.provide('tutao.tutanota.ctrl.ContactCsvHandler');
/**
* @interface
*/
tutao.tutanota.ctrl.ContactCsvHandler = function() {};
/**
* For csv to contact import.
*/
tutao.tutanota.ctrl.ContactCsvHandler.prototype.startContact = function(contact) {};
/**
* For csv to contact import.
*/
tutao.tutanota.ctrl.ContactCsvHandler.prototype.addField = function(contact, name, value) {};
/**
* For csv to contact import.
*/
tutao.tutanota.ctrl.ContactCsvHandler.prototype.finishContact = function(contact) {};
/**
* For contact to csv export.
* @param {function(string,string)):boolean} fieldReceiver Must be called for each field in the contact in the correct order.
*/
tutao.tutanota.ctrl.ContactCsvHandler.prototype.getContactFields = function(contact, fieldReceiver) {};
|
gapi.analytics.ready(function() {
var nDaysAgo = /(\d+)daysAgo/;
var dateFormat = /\d{4}\-\d{2}\-\d{2}/;
/**
* Convert a date acceptable to the Core Reporting API (e.g. `today`,
* `yesterday` or `NdaysAgo`) into the format YYYY-MM-DD. Dates
* already in that format are simply returned.
* @return {string} The formatted date.
*/
function convertDate(str) {
// If str is in the proper format, do nothing.
if (dateFormat.test(str)) return str
var match = nDaysAgo.exec(str);
if (match) {
return daysAgo(+match[1])
} else if (str == 'today') {
return daysAgo(0)
} else if (str == 'yesterday') {
return daysAgo(1)
} else {
throw new Error('Cannot convert date ' + str);
}
}
/**
* Accept a number and return a date formatted as YYYY-MM-DD that
* represents that many days ago.
* @return {string} The formatted date.
*/
function daysAgo(numDays) {
var date = new Date();
date.setDate(date.getDate() - numDays);
var month = String(date.getMonth() + 1);
month = month.length == 1 ? '0' + month: month;
var day = String(date.getDate());
day = day.length == 1 ? '0' + day: day;
return date.getFullYear() + '-' + month + '-' + day;
}
gapi.analytics.createComponent('Datepicker', {
/**
* Initialize the Datepicker instance and render it to the page.
* @return {Datepicker} The instance.
*/
execute: function() {
var options = this.get();
options['start-date'] = options['start-date'] || '7daysAgo';
options['end-date'] = options['end-date'] || 'yesterday';
// Allow container to be a string ID or an HTMLElement.
this.container = typeof options.container == 'string' ?
document.getElementById(options.container) : options.container;
// Allow the template to be overridden.
if (options.template) this.template = options.template
this.container.innerHTML = this.template
var dateInputs = this.container.querySelectorAll('input');
this.startDateInput = dateInputs[0];
this.startDateInput.value = convertDate(options['start-date']);
this.endDateInput = dateInputs[1];
this.endDateInput.value = convertDate(options['end-date']);
this.setValues();
this.setMinMax();
this.container.onchange = this.onChange.bind(this);
return this;
},
/**
* Emit a change event based on the currently selected dates.
* Pass an object containing the start date and end date.
*/
onChange: function(event) {
this.setValues();
this.setMinMax();
this.emit('change', {
'start-date': this['start-date'],
'end-date': this['end-date']
});
},
/**
* Updates the instance properties based on the input values.
*/
setValues: function() {
this['start-date'] = this.startDateInput.value;
this['end-date'] = this.endDateInput.value;
},
/**
* Updates the input min and max attributes so there's no overlap.
*/
setMinMax: function() {
this.startDateInput.max = this.endDateInput.value;
this.endDateInput.min = this.startDateInput.value;
},
/**
* The html structure used to build the component. Developers can
* override this by passing it to the component constructor.
* The only requirement is that the structure contain two inputs, the
* first will be the start date and the second will be the end date.
*/
template:
'<div class="Datepicker">' +
' <div class="Datepicker-item">' +
' <label>Start Date</label> ' +
' <input type="date">' +
' </div>' +
' <div class="Datepicker-item">' +
' <label>End Date</label> ' +
' <input type="date">' +
' </div>' +
'</div>'
});
});
|
module.exports = function (sequelize, DataTypes) {
return sequelize.define("OAuthLogin", {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
}
}, {
charset: "utf8",
collate: "utf8_general_ci",
updatedAt: false
});
};
|
/// Copyright (c) 2009 Microsoft Corporation
///
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// * Neither the name of Microsoft nor the names of its contributors may be used to
/// endorse or promote products derived from this software without specific prior written permission.
///
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ES5Harness.registerTest({
id: "15.4.4.15-8-a-12",
path: "TestCases/chapter15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-12.js",
description: "Array.prototype.lastIndexOf - test that deleting own property causes it not to be visited on an Array",
test: function testcase() {
var arr = [1, 2, 3, 4];
Object.defineProperty(arr, "1", {
get: function () {
return "6.99";
},
configurable: true
});
Object.defineProperty(arr, "3", {
get: function () {
delete arr[1];
return 0;
},
configurable: true
});
return -1 === arr.lastIndexOf("6.99");
},
precondition: function prereq() {
return fnExists(Array.prototype.lastIndexOf) && fnExists(Object.defineProperty);
}
});
|
define(["helper/OutputAudio", "Tone/source/Oscillator", "helper/Offline", "Test", "helper/Meter"],
function (OutputAudio, Oscillator, Offline, Test, Meter) {
return function(Constr, args){
context("Oscillator Tests", function(){
it ("extends Tone.Oscillator", function(){
var instance = new Constr(args);
expect(instance).to.be.an.instanceof(Oscillator);
instance.dispose();
});
it("can be created with an options object", function(){
var instance = new Constr({
"frequency" : 200,
"detune" : -20
});
expect(instance.frequency.value).to.equal(200);
expect(instance.detune.value).to.equal(-20);
instance.dispose();
});
it("can set/set the frequency", function(){
var instance = new Constr(args);
instance.frequency.value = 110;
expect(instance.frequency.value).to.equal(110);
instance.start();
instance.frequency.value = 220;
expect(instance.frequency.value).to.equal(220);
instance.dispose();
});
it("can set/set the detune", function(){
var instance = new Constr(args);
instance.detune.value = -50;
expect(instance.detune.value).to.equal(-50);
instance.start();
instance.detune.value = 92;
expect(instance.detune.value).to.equal(92);
instance.dispose();
});
it("can connect to detune and frequency", function(){
var instance = new Constr(args);
Test.connect(instance.frequency);
Test.connect(instance.detune);
instance.dispose();
});
it ("can get/set the phase", function(){
var osc = new Constr({
"phase" : 180,
});
expect(osc.phase).to.be.closeTo(180, 0.001);
osc.dispose();
});
it ("does not clip in volume", function(done){
var osc;
var meter = new Meter(0.2);
meter.before(function(dest){
osc = new Constr(args).connect(dest).start(0);
});
meter.test(function(level){
if (level > 1){
throw new Error("audio clipped with level "+level);
}
});
meter.after(function(){
osc.dispose();
done();
});
meter.run();
});
});
};
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* The | regular expression operator separates two alternatives.
* The pattern first tries to match the left Alternative (followed by the sequel of the regular expression).
* If it fails, it tries to match the right Disjunction (followed by the sequel of the regular expression)
*
* @path ch15/15.10/15.10.2/15.10.2.3/S15.10.2.3_A1_T6.js
* @description Execute /ab|cd|ef/i.exec("AEKFCD") and check results
*/
__executed = /ab|cd|ef/i.exec("AEKFCD");
__expected = ["CD"];
__expected.index = 4;
__expected.input = "AEKFCD";
//CHECK#1
if (__executed.length !== __expected.length) {
$ERROR('#1: __executed = /ab|cd|ef/i.exec("AEKFCD"); __executed.length === ' + __expected.length + '. Actual: ' + __executed.length);
}
//CHECK#2
if (__executed.index !== __expected.index) {
$ERROR('#2: __executed = /ab|cd|ef/i.exec("AEKFCD"); __executed.index === ' + __expected.index + '. Actual: ' + __executed.index);
}
//CHECK#3
if (__executed.input !== __expected.input) {
$ERROR('#3: __executed = /ab|cd|ef/i.exec("AEKFCD"); __executed.input === ' + __expected.input + '. Actual: ' + __executed.input);
}
//CHECK#4
for(var index=0; index<__expected.length; index++) {
if (__executed[index] !== __expected[index]) {
$ERROR('#4: __executed = /ab|cd|ef/i.exec("AEKFCD"); __executed[' + index + '] === ' + __expected[index] + '. Actual: ' + __executed[index]);
}
}
|
var changeVC=function(){
var req = new Request.HTML({url:'validcode.php',
onComplete: function() {
$('vcImg').setProperty('src','/images/vc.png?'+$time());
}
});
req.send();
}
mooAutoObject.initAdminLogin=function(){
$('autoForm').addEvent('submit',function(e){
var emailPattern=/(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
if(!emailPattern.exec($("email").value.trim())){
showErrorTip('用户格式不正确');
return false;
}else if($('password').value.trim()==''){
showErrorTip('请输入密码');
return false;
}else if($('validCode').value.trim()==''){
showErrorTip('请输入验证码');
return false;
}else if($('validCode').value.length!=4){
showErrorTip('验证码不正确');
changeVC();
return false;
}else{
new Event(e).stop();
$('autoForm').set('send',{encoding:'gbk',urlEncoded:true,onComplete:function(){
if(this.response.text.toInt()>0){
if($('tip')){
$('tip').dispose();
}
window.location.href='index.php'
}else{
switch(this.response.text){
default:
showErrorTip('未知错误'+this.response.text);
break;
case '-1':
case '-2':
showErrorTip('邮箱或密码错误'+this.response.text);
break;
case '-3':
showErrorTip('验证码不正确');
break;
}
}
}}).send();
}
});
}
var syncDiscuzUser=function(){
showDialog(null);
$('dialog').set('html',dialogCloseStr('同步用户')+'<div id="dialogdiv" style="padding:0 10px;margin:0;"><div id="rt" style="margin: 0pt 10px; display: none;"></div>'+$('syncDiscuzUserInput').get('html').replace('autoForm','form')+'</div>');
$('form').addEvent('submit',function(e){
new Event(e).stop();
$('form').setStyle('display','none');
$('rt').setStyle('display','block');
$('rt').set('html','<img src="image/loading.gif" align="absmiddle"></img> 正在同步,别走开……');
$('form').set('send',{encoding:'gbk',urlEncoded:true,onComplete:function(){
$('rt').set('html',this.response.text+' <a href="javascript:void(0)" onclick="syncDiscuzUser()">继续</a>');
setOverlay();
}}).send();
});
setOverlay();
}
var storeDelete=function(id){
var elID='tr'+id;
var url=$(elID).getProperty('rel');
ajaxDelete($(elID),url);
}
var showUserInfoInDialog=function(uid,rootDeep){
showDialog(null);
var url=rootDeep?'../json.php?type=storeUser&uid='+uid:'json.php?type=storeUser&uid='+uid;
var jr = new Request.JSON({url:url, urlEncoded:true, encoding:'gbk', onComplete: function(j){
var users=j.user;
var thisUser=users[0];
$('dialog').set('html',dialogCloseStr('用户')+'<div style="padding:0 10px;margin:0; line-height:160%;">UID:'+uid+'<br>账号:'+thisUser.username+'<br>邮箱:'+thisUser.email+'<br>注册时间:'+thisUser.regTime+'('+thisUser.regIP+' '+thisUser.regAddress+')<br>最后登陆:'+thisUser.lastLoginTime+'('+thisUser.lastLoginIP+' '+thisUser.lastLoginAddress+')</div>');
setOverlay();
}}).get();
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* toString: If radix is an integer from 2 to 36, but not 10,
* the result is a string, the choice of which is implementation-dependent
*
* @path ch15/15.7/15.7.4/15.7.4.2/S15.7.4.2_A2_T15.js
* @description radix is 17
*/
//CHECK#1
if(Number.prototype.toString(17) !== "0"){
$ERROR('#1: Number.prototype.toString(17) === "0"');
}
//CHECK#2
if((new Number()).toString(17) !== "0"){
$ERROR('#2: (new Number()).toString(17) === "0"');
}
//CHECK#3
if((new Number(0)).toString(17) !== "0"){
$ERROR('#3: (new Number(0)).toString(17) === "0"');
}
//CHECK#4
if((new Number(-1)).toString(17) !== "-1"){
$ERROR('#4: (new Number(-1)).toString(17) === "-1"');
}
//CHECK#5
if((new Number(1)).toString(17) !== "1"){
$ERROR('#5: (new Number(1)).toString(17) === "1"');
}
//CHECK#6
if((new Number(Number.NaN)).toString(17) !== "NaN"){
$ERROR('#6: (new Number(Number.NaN)).toString(17) === "NaN"');
}
//CHECK#7
if((new Number(Number.POSITIVE_INFINITY)).toString(17) !== "Infinity"){
$ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(17) === "Infinity"');
}
//CHECK#8
if((new Number(Number.NEGATIVE_INFINITY)).toString(17) !== "-Infinity"){
$ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(17) === "-Infinity"');
}
|
(function() {
var Command, LocalCommand, Protocol,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Command = require('../../command');
Protocol = require('../../protocol');
LocalCommand = (function(_super) {
__extends(LocalCommand, _super);
function LocalCommand() {
return LocalCommand.__super__.constructor.apply(this, arguments);
}
LocalCommand.prototype.execute = function(path) {
this._send(/:/.test(path) ? path : "localfilesystem:" + path);
return this.parser.readAscii(4).then((function(_this) {
return function(reply) {
switch (reply) {
case Protocol.OKAY:
return _this.parser.raw();
case Protocol.FAIL:
return _this.parser.readError();
default:
return _this.parser.unexpected(reply, 'OKAY or FAIL');
}
};
})(this));
};
return LocalCommand;
})(Command);
module.exports = LocalCommand;
}).call(this);
|
CKEDITOR.plugins.setLang("preview","bn",{preview:"প্রিভিউ"});
|
var application = require("application");
var device = (function () {
function device() {
}
Object.defineProperty(device, "language", {
get: function () {
if (!device._language) {
var context = application.android.context,
locale = context.getResources().getConfiguration().locale;
if (locale) {
device._language = locale.toString();
} else {
device._language = java.util.Locale.getDefault().toString();
}
}
return device._language;
},
enumerable: true,
configurable: true
});
Object.defineProperty(device, "userAgent", {
get: function () {
if (!device._userAgent) {
var context = application.android.context;
device._userAgent = new android.webkit.WebView(context).getSettings().getUserAgentString();
}
return device._userAgent;
},
enumerable: true,
configurable: true
});
return device;
})();
exports.device = device;
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
// - src/dstr-binding/default/async-gen-func-decl-dflt.template
/*---
description: SingleNameBinding assigns `name` to "anonymous" classes (async generator function declaration (default parameter))
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
features: [async-iteration]
flags: [generated, async]
info: |
AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
( FormalParameters ) { AsyncGeneratorBody }
[...]
3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
scope, strict).
[...]
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
SingleNameBinding : BindingIdentifier Initializeropt
[...]
6. If Initializer is present and v is undefined, then
[...]
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
i. Let hasNameProperty be HasOwnProperty(v, "name").
ii. ReturnIfAbrupt(hasNameProperty).
iii. If hasNameProperty is false, perform SetFunctionName(v,
bindingId).
---*/
var callCount = 0;
async function* f({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
assert.sameValue(cls.name, 'cls');
assert.notSameValue(xCls.name, 'xCls');
assert.notSameValue(xCls2.name, 'xCls2');
callCount = callCount + 1;
};
f().next().then(() => {
assert.sameValue(callCount, 1, 'invoked exactly once');
}).then($DONE, $DONE);
|
// Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
// limitations under the License.
// See the License for the specific language governing permissions and
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// distributed under the License is distributed on an "AS-IS" BASIS,
// Unless required by applicable law or agreed to in writing, software
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// You may obtain a copy of the License at
// you may not use this file except in compliance with the License.
// Licensed under the Apache License, Version 2.0 (the "License");
//
goog.provide('i18n.input.chrome.inputview.elements.content.EmojiKey');
goog.require('goog.a11y.aria');
goog.require('goog.a11y.aria.State');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist');
goog.require('i18n.input.chrome.inputview.Css');
goog.require('i18n.input.chrome.inputview.elements.content.FunctionalKey');
goog.require('i18n.input.chrome.message.Name');
goog.require('i18n.input.chrome.message.Type');
goog.scope(function() {
var Type = i18n.input.chrome.message.Type;
var Name = i18n.input.chrome.message.Name;
/**
* The emoji key
*
* @param {string} id The id.
* @param {!i18n.input.chrome.inputview.elements.ElementType} type The element
* type.
* @param {string} text The text.
* @param {string} iconCssClass The css class for the icon.
* @param {boolean} isEmoticon Wether it is an emoticon.
* @param {goog.events.EventTarget=} opt_eventTarget The event target.
* @constructor
* @extends {i18n.input.chrome.inputview.elements.content.FunctionalKey}
*/
i18n.input.chrome.inputview.elements.content.EmojiKey = function(id, type,
text, iconCssClass, isEmoticon, opt_eventTarget) {
i18n.input.chrome.inputview.elements.content.EmojiKey.base(
this, 'constructor', id, type, text, '', opt_eventTarget);
/**
* Wether it is an emoticon.
*
* @type {boolean}
*/
this.isEmoticon = isEmoticon;
this.pointerConfig.stopEventPropagation = false;
this.pointerConfig.dblClick = true;
};
goog.inherits(i18n.input.chrome.inputview.elements.content.EmojiKey,
i18n.input.chrome.inputview.elements.content.FunctionalKey);
var EmojiKey = i18n.input.chrome.inputview.elements.content.EmojiKey;
/** @override */
EmojiKey.prototype.createDom = function() {
goog.base(this, 'createDom');
var dom = this.getDomHelper();
var elem = this.getElement();
if (!this.textElem) {
this.textElem = dom.createDom(goog.dom.TagName.DIV,
i18n.input.chrome.inputview.Css.SPECIAL_KEY_NAME, this.text);
dom.appendChild(this.tableCell, this.textElem);
}
goog.dom.classlist.add(elem,
i18n.input.chrome.inputview.Css.EMOJI_KEY);
var emojiName = this.getLocalizedName();
if (emojiName) {
goog.a11y.aria.setState(/** @type {!Element} */ (elem),
goog.a11y.aria.State.LABEL, emojiName);
}
this.updateText(this.text, this.isEmoticon);
};
/**
* Gets the localized name for the emoji.
*
* @return {string} .
*/
EmojiKey.prototype.getLocalizedName = function() {
if (this.isEmoticon) {
return chrome.i18n.getMessage('smiley');
}
var lead = this.text.charCodeAt(0);
if (!lead) {
return '';
}
var trail = this.text.charCodeAt(1);
var msgName = lead.toString(16);
if (!!trail) {
msgName += '_' + trail.toString(16);
}
return chrome.i18n.getMessage(msgName.toLowerCase());
};
/** @override */
EmojiKey.prototype.update = function() {
goog.base(this, 'update');
goog.dom.setTextContent(this.textElem, this.text);
};
/**
* Update the emoji's text
*
* @param {string} text The new text.
* @param {boolean} isEmoticon .
*/
EmojiKey.prototype.updateText = function(text, isEmoticon) {
this.text = text;
this.isEmoticon = isEmoticon;
goog.dom.setTextContent(this.textElem, text);
var elem = this.getElement();
if (isEmoticon) {
goog.dom.classlist.add(elem, i18n.input.chrome.inputview.Css.EMOTICON);
} else {
goog.dom.classlist.remove(elem, i18n.input.chrome.inputview.Css.EMOTICON);
}
};
}); // goog.scope
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
function SetPolyfill() {
this._cache = [];
}
SetPolyfill.prototype.add = function(e) {
if (this._cache.indexOf(e) === -1) {
this._cache.push(e);
}
};
SetPolyfill.prototype.forEach = function(cb) {
this._cache.forEach(cb);
};
module.exports = SetPolyfill;
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.9_A6.2_T7;
* @section: 7.9, 12.6.3;
* @assertion: Check For Statement for automatic semicolon insertion.
* If automatic insertion semicolon would become one of the two semicolons in the header of a For Statement.
* Use one semicolon;
* @description: For header is (false \n semicolon \n);
* @negative
*/
//CHECK#1
for(false
;
) {
break;
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Operator x / y returns ToNumber(x) / ToNumber(y)
es5id: 11.5.2_A3_T1.2
description: Type(x) and Type(y) vary between primitive number and Number object
---*/
//CHECK#1
if (1 / 1 !== 1) {
$ERROR('#1: 1 / 1 === 1. Actual: ' + (1 / 1));
}
//CHECK#2
if (new Number(1) / 1 !== 1) {
$ERROR('#2: new Number(1) / 1 === 1. Actual: ' + (new Number(1) / 1));
}
//CHECK#3
if (1 / new Number(1) !== 1) {
$ERROR('#3: 1 / new Number(1) === 1. Actual: ' + (1 / new Number(1)));
}
//CHECK#4
if (new Number(1) / new Number(1) !== 1) {
$ERROR('#4: new Number(1) / new Number(1) === 1. Actual: ' + (new Number(1) / new Number(1)));
}
|
define({
"_widgetLabel": "Ominaisuustaulu",
"_featureAction_ShowRelatedRecords": "Näytä liittyvät tietueet",
"_featureAction_ViewInTable": "Näytä ominaisuustaulukossa",
"ok": "OK",
"cancel": "Peruuta",
"unsupportQueryWarning": "Karttatason on tuettava kyselytoimintoa, jotta karttatason voi näyttää Ominaisuustietotaulu-pienoisohjelmassa. Varmista, että palvelun kyselyominaisuus on käytössä.",
"exportMessage": "Vie dataa CSV-tiedostoon?",
"exportFiles": "Vie CSV-tiedostoon",
"exportSelected": "Vie valittu kohde CSV-muotoon",
"exportAll": "Vie kaikki CSV-muotoon",
"options": "Valinnat",
"zoomto": "Tarkenna kohteeseen",
"highlight": "Korosta grafiikkaa",
"selectAll": "Valitse tietueita kaikilta sivuilta",
"selectPage": "Valitse tietueita nykyiseltä sivulta",
"clearSelection": "Tyhjennä valinta",
"filter": "Suodata",
"setFilterTip": "Määritä suodatin oikein.",
"noFilterTip": "Jos suodatinlauseketta ei määritetä, kyselytehtävä luetteloi kaikki määritetyn tietolähteen kohteet.",
"filterByExtent": "Suodata kartan laajuuden mukaan",
"showSelectedRecords": "Näytä valitut tietueet",
"showAllRecords": "Näytä kaikki tietueet",
"showRelatedRecords": "Näytä liittyvät tietueet",
"noRelatedRecords": "Liittyviä tietueita ei löytynyt",
"attachmentColumn": "Valokuvat ja tiedostot",
"refresh": "Päivitä",
"features": "kohteet",
"records": "tietueet",
"selected": "valitut",
"transparent": "Läpinäkyvä tila",
"indicate": "Paikanna valinta",
"columns": "Näytä/Piilota sarakkeet",
"selectionSymbol": "Valintasymboli",
"closeMessage": "Piilota taulukko (laajenna se uudelleen alareunasta)",
"dataNotAvailable": "Data ei ole käytettävissä!<br>Yritä uudelleen napsauttamalla [Päivitä]-painiketta.",
"openTableTip": "Avaa ominaisuustietotaulu",
"closeTableTip": "Piilota ominaisuustietotaulukko",
"sortAsc": "Lajittele nousevasti",
"sortDes": "Lajittele laskevasti",
"statistics": "Tilastotiedot",
"attachments": "Liitteet",
"files": "tiedostot"
});
|
var Test =
/*#__PURE__*/
function () {
"use strict";
function Test() {
babelHelpers.classCallCheck(this, Test);
}
babelHelpers.createClass(Test, [{
key: "test",
get: function get() {
return 5 + 5;
},
set: function set(val) {
this._test = val;
}
}]);
return Test;
}();
|
export default {
el: {
colorpicker: {
confirm: 'Қабылдау',
clear: 'Тазалау'
},
datepicker: {
now: 'Қазір',
today: 'Бүгін',
cancel: 'Болдырмау',
clear: 'Тазалау',
confirm: 'Қабылдау',
selectDate: 'Күнді таңдаңыз',
selectTime: 'Сағатты таңдаңыз',
startDate: 'Басталу күні',
startTime: 'Басталу сағаты',
endDate: 'Аяқталу күні',
endTime: 'Аяқталу сағаты',
prevYear: 'Алдыңғы жыл',
nextYear: 'Келесі жыл',
prevMonth: 'Алдыңғы ай',
nextMonth: 'Келесі ай',
year: 'Жыл',
month1: 'Қаңтар',
month2: 'Ақпан',
month3: 'Наурыз',
month4: 'Сәуір',
month5: 'Мамыр',
month6: 'Маусым',
month7: 'Шілде',
month8: 'Тамыз',
month9: 'Қыркүйек',
month10: 'Қазан',
month11: 'Қараша',
month12: 'Желтоқсан',
week: 'Апта',
weeks: {
sun: 'Жек',
mon: 'Дүй',
tue: 'Сей',
wed: 'Сәр',
thu: 'Бей',
fri: 'Жұм',
sat: 'Сен'
},
months: {
jan: 'Қаң',
feb: 'Ақп',
mar: 'Нау',
apr: 'Сәу',
may: 'Мам',
jun: 'Мау',
jul: 'Шіл',
aug: 'Там',
sep: 'Қыр',
oct: 'Қаз',
nov: 'Қар',
dec: 'Жел'
}
},
select: {
loading: 'Жүктелуде',
noMatch: 'Сәйкес деректер жоқ',
noData: 'Деректер жоқ',
placeholder: 'Таңдаңыз'
},
cascader: {
noMatch: 'Сәйкес деректер жоқ',
loading: 'Жүктелуде',
placeholder: 'Таңдаңыз'
},
pagination: {
goto: 'Бару',
pagesize: '/page',
total: 'Барлығы {total}',
pageClassifier: ''
},
messagebox: {
title: 'Хабар',
confirm: 'Қабылдау',
cancel: 'Болдырмау',
error: 'Жарамсыз енгізулер'
},
upload: {
deleteTip: 'Өшіруді басып өшіріңіз',
delete: 'Өшіру',
preview: 'Алдын ала қарау',
continue: 'Жалғастыру'
},
table: {
emptyText: 'Деректер жоқ',
confirmFilter: 'Қабылдау',
resetFilter: 'Қалпына келтіру',
clearFilter: 'Барлығы',
sumText: 'Сомасы'
},
tree: {
emptyText: 'Деректер жоқ'
},
transfer: {
noMatch: 'Сәйкес деректер жоқ',
noData: 'Деректер жоқ',
titles: ['List 1', 'List 2'],
filterPlaceholder: 'Кілт сөзді енгізіңіз',
noCheckedFormat: '{total} элэмэнт',
hasCheckedFormat: '{checked}/{total} құсбелгісі қойылды'
}
}
};
|
/**
* Ruby
*/
module.exports = {
// find document blocks between '=begin' and '=end'
docBlocksRegExp: /\=begin\uffff?(.+?)\uffff?(?:\s*)?\=end/g,
// remove not needed tabs at the beginning
inlineRegExp: /^(\t*)?/gm
};
|
'use strict';
const fs = require('fs');
const path = require('path');
const ts = require('./typescript');
/**
* @param name {string}
* @param source {string}
*/
const DEPRECATED_FEATURES = (function getFeatures() {
let fileName = path.join(
__dirname,
'..',
'packages',
'@ember',
'deprecated-features',
'index.ts'
);
let contents = fs.readFileSync(fileName, 'utf8');
let sourceFile = ts.createSourceFile(fileName, contents, ts.ScriptTarget.ES2017);
let flags = {};
sourceFile.statements.forEach((statement) => {
if (
statement.kind === ts.SyntaxKind.VariableStatement &&
statement.modifiers.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)
) {
handleExportedDeclaration(statement, flags);
}
});
return flags;
})();
/**
* @param d {ts.VariableStatement}
* @param map {{[flag: string]: string}}
*/
function handleExportedDeclaration(d, map) {
let declaration = d.declarationList.declarations[0];
/** @type {ts.StringLiteral} */
let initializer = declaration.initializer;
if (
initializer &&
initializer.kind === ts.SyntaxKind.PrefixUnaryExpression &&
initializer.operand.kind === ts.SyntaxKind.PrefixUnaryExpression &&
initializer.operand.operand.kind === ts.SyntaxKind.StringLiteral
) {
map[declaration.name.text] = initializer.operand.operand.text;
}
}
module.exports = DEPRECATED_FEATURES;
|
/**
* Command to save an image in an active window.
*/
qx.Class.define("skel.Command.Save.CommandSaveImage", {
extend : skel.Command.Command,
type : "singleton",
/**
* Constructor.
*/
construct : function() {
this.base( arguments, "Save...", null );
this.setEnabled( false );
this.m_global = false;
this.m_saveAvailable = false;
this.setToolTipText( "Save the window image.");
var path = skel.widgets.Path.getInstance();
var cmd = path.BASE_PATH + path.DATA_LOADER + path.SEP_COMMAND + "isSecurityRestricted";
var params = "";
this.m_connector.sendCommand( cmd, params, this._updateSaveAccess( this));
},
members : {
doAction : function( vals, undoCB ){
var activeWins = skel.Command.Command.m_activeWins;
if ( activeWins !== null && activeWins.length > 0 ){
//Use the first one in the list that supports this cmd.
for ( var i = 0; i < activeWins.length; i++ ){
if ( activeWins[i].isCmdSupported( this ) ){
qx.event.message.Bus.dispatch(new qx.event.message.Message(
"showFileSaver", activeWins[i]));
break;
}
}
}
},
/**
* Returns whether or not save is supported based on both the application security
* and the window that is selected.
* @return {boolean} - true is save is supported; false otherwise.
*/
_isCmdSupported : function(){
var supported = this.m_saveAvailable;
if ( supported ){
supported = arguments.callee.base.apply( this, arguments );
}
return supported;
},
/**
* Returns whether or not the user is allowed to save images.
* @return {boolean} - true if images can be saved; false otherwise.
*/
isSaveAvailable : function(){
return this.m_saveAvailable;
},
/**
* Reset whether save functionality should be available to the
* user based on information from the server.
* @param anObject {String} - this save command.
*/
_updateSaveAccess : function( anObject ){
return function( val ){
if ( val === "true"){
if ( anObject.m_saveAvailable ){
anObject.m_saveAvailable = false;
}
}
else {
if ( !anObject.m_saveAvailable ){
anObject.m_saveAvailable = true;
}
}
};
},
m_saveAvailable : null
}
});
|
/**
* A gesture recognizer for swipe events
*/
Ext.define('Ext.event.gesture.Swipe', {
extend: 'Ext.event.gesture.SingleTouch',
priority: 500,
handledEvents: ['swipestart', 'swipe', 'swipecancel'],
/**
* @member Ext.dom.Element
* @event swipe
* Fires when there is a swipe
* When listening to this, ensure you know about the {@link Ext.event.Event#direction} property in the `event` object.
* @param {Ext.event.Event} event The {@link Ext.event.Event} event encapsulating the DOM event.
* @param {HTMLElement} node The target of the event.
* @param {Object} options The options object passed to Ext.mixin.Observable.addListener.
*/
/**
* @property {Number} direction
* The direction of the swipe. Available options are:
*
* - up
* - down
* - left
* - right
*
* **This is only available when the event type is `swipe`**
* @member Ext.event.Event
*/
/**
* @property {Number} duration
* The duration of the swipe.
*
* **This is only available when the event type is `swipe`**
* @member Ext.event.Event
*/
inheritableStatics: {
MAX_OFFSET_EXCEEDED: 'Max Offset Exceeded',
MAX_DURATION_EXCEEDED: 'Max Duration Exceeded',
DISTANCE_NOT_ENOUGH: 'Distance Not Enough'
},
config: {
minDistance: 80,
maxOffset: 35,
maxDuration: 1000
},
onTouchStart: function(e) {
if (this.callParent(arguments) === false) {
return false;
}
var touch = e.changedTouches[0];
this.startTime = e.time;
this.isHorizontal = true;
this.isVertical = true;
this.startX = touch.pageX;
this.startY = touch.pageY;
},
onTouchMove: function(e) {
var touch = e.changedTouches[0],
x = touch.pageX,
y = touch.pageY,
deltaX = x - this.startX,
deltaY = y - this.startY,
absDeltaX = Math.abs(x - this.startX),
absDeltaY = Math.abs(y - this.startY),
duration = e.time - this.startTime,
minDistance = this.getMinDistance(),
time = e.time,
direction, distance;
if (time - this.startTime > this.getMaxDuration()) {
return this.fail(this.self.MAX_DURATION_EXCEEDED);
}
if (this.isHorizontal && absDeltaY > this.getMaxOffset()) {
this.isHorizontal = false;
}
if (this.isVertical && absDeltaX > this.getMaxOffset()) {
this.isVertical = false;
}
if (!this.isVertical || !this.isHorizontal) {
if (this.isHorizontal && absDeltaX < minDistance) {
direction = (deltaX < 0) ? 'left' : 'right';
distance = absDeltaX;
}
else if (this.isVertical && absDeltaY < minDistance) {
direction = (deltaY < 0) ? 'up' : 'down';
distance = absDeltaY;
}
}
if (direction && !this.started) {
this.started = true;
this.fire('swipestart', e, {
touch: touch,
direction: direction,
distance: distance,
duration: duration
});
}
if (!this.isHorizontal && !this.isVertical) {
return this.fail(this.self.MAX_OFFSET_EXCEEDED);
}
},
onTouchEnd: function(e) {
if (this.onTouchMove(e) === false) {
return false;
}
var touch = e.changedTouches[0],
x = touch.pageX,
y = touch.pageY,
deltaX = x - this.startX,
deltaY = y - this.startY,
absDeltaX = Math.abs(deltaX),
absDeltaY = Math.abs(deltaY),
minDistance = this.getMinDistance(),
duration = e.time - this.startTime,
direction, distance;
if (this.isVertical && absDeltaY < minDistance) {
this.isVertical = false;
}
if (this.isHorizontal && absDeltaX < minDistance) {
this.isHorizontal = false;
}
if (this.isHorizontal) {
direction = (deltaX < 0) ? 'left' : 'right';
distance = absDeltaX;
}
else if (this.isVertical) {
direction = (deltaY < 0) ? 'up' : 'down';
distance = absDeltaY;
}
else {
return this.fail(this.self.DISTANCE_NOT_ENOUGH);
}
this.started = false;
this.fire('swipe', e, {
touch: touch,
direction: direction,
distance: distance,
duration: duration
});
},
onTouchCancel: function(e) {
this.fire('swipecancel', e);
return false;
},
reset: function() {
var me = this;
me.startTime = me.isHorizontal = me.isVertical = me.startX = me.startY = null;
}
}, function(Swipe) {
var gestures = Ext.manifest.gestures;
Swipe.instance = new Swipe(gestures && gestures.swipe);
});
|
for (var i = 0; i < 90; ++i) {
y = {x: 1};
}
Object.defineProperty(Object.prototype, "zz", {set: (v) => 1 });
function f() {
for (var i=0; i<1500; i++) {
y[0] = 0;
if (i > 1400)
y.zz = 3;
}
}
f();
|
//// [comparisonOperatorWithSubtypeObjectOnIndexSignature.ts]
class Base {
public a: string;
}
class Derived extends Base {
public b: string;
}
var a1: { [a: string]: string };
var b1: { [b: string]: string };
var a2: { [index: string]: Base };
var b2: { [index: string]: Derived };
var a3: { [index: number]: string };
var b3: { [index: number]: string };
var a4: { [index: number]: Base };
var b4: { [index: string]: Derived };
// operator <
var r1a1 = a1 < b1;
var r1a1 = a2 < b2;
var r1a1 = a3 < b3;
var r1a1 = a4 < b4;
var r1b1 = b1 < a1;
var r1b1 = b2 < a2;
var r1b1 = b3 < a3;
var r1b1 = b4 < a4;
// operator >
var r2a1 = a1 > b1;
var r2a1 = a2 > b2;
var r2a1 = a3 > b3;
var r2a1 = a4 > b4;
var r2b1 = b1 > a1;
var r2b1 = b2 > a2;
var r2b1 = b3 > a3;
var r2b1 = b4 > a4;
// operator <=
var r3a1 = a1 <= b1;
var r3a1 = a2 <= b2;
var r3a1 = a3 <= b3;
var r3a1 = a4 <= b4;
var r3b1 = b1 <= a1;
var r3b1 = b2 <= a2;
var r3b1 = b3 <= a3;
var r3b1 = b4 <= a4;
// operator >=
var r4a1 = a1 >= b1;
var r4a1 = a2 >= b2;
var r4a1 = a3 >= b3;
var r4a1 = a4 >= b4;
var r4b1 = b1 >= a1;
var r4b1 = b2 >= a2;
var r4b1 = b3 >= a3;
var r4b1 = b4 >= a4;
// operator ==
var r5a1 = a1 == b1;
var r5a1 = a2 == b2;
var r5a1 = a3 == b3;
var r5a1 = a4 == b4;
var r5b1 = b1 == a1;
var r5b1 = b2 == a2;
var r5b1 = b3 == a3;
var r5b1 = b4 == a4;
// operator !=
var r6a1 = a1 != b1;
var r6a1 = a2 != b2;
var r6a1 = a3 != b3;
var r6a1 = a4 != b4;
var r6b1 = b1 != a1;
var r6b1 = b2 != a2;
var r6b1 = b3 != a3;
var r6b1 = b4 != a4;
// operator ===
var r7a1 = a1 === b1;
var r7a1 = a2 === b2;
var r7a1 = a3 === b3;
var r7a1 = a4 === b4;
var r7b1 = b1 === a1;
var r7b1 = b2 === a2;
var r7b1 = b3 === a3;
var r7b1 = b4 === a4;
// operator !==
var r8a1 = a1 !== b1;
var r8a1 = a2 !== b2;
var r8a1 = a3 !== b3;
var r8a1 = a4 !== b4;
var r8b1 = b1 !== a1;
var r8b1 = b2 !== a2;
var r8b1 = b3 !== a3;
var r8b1 = b4 !== a4;
//// [comparisonOperatorWithSubtypeObjectOnIndexSignature.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var Base = /** @class */ (function () {
function Base() {
}
return Base;
}());
var Derived = /** @class */ (function (_super) {
__extends(Derived, _super);
function Derived() {
return _super !== null && _super.apply(this, arguments) || this;
}
return Derived;
}(Base));
var a1;
var b1;
var a2;
var b2;
var a3;
var b3;
var a4;
var b4;
// operator <
var r1a1 = a1 < b1;
var r1a1 = a2 < b2;
var r1a1 = a3 < b3;
var r1a1 = a4 < b4;
var r1b1 = b1 < a1;
var r1b1 = b2 < a2;
var r1b1 = b3 < a3;
var r1b1 = b4 < a4;
// operator >
var r2a1 = a1 > b1;
var r2a1 = a2 > b2;
var r2a1 = a3 > b3;
var r2a1 = a4 > b4;
var r2b1 = b1 > a1;
var r2b1 = b2 > a2;
var r2b1 = b3 > a3;
var r2b1 = b4 > a4;
// operator <=
var r3a1 = a1 <= b1;
var r3a1 = a2 <= b2;
var r3a1 = a3 <= b3;
var r3a1 = a4 <= b4;
var r3b1 = b1 <= a1;
var r3b1 = b2 <= a2;
var r3b1 = b3 <= a3;
var r3b1 = b4 <= a4;
// operator >=
var r4a1 = a1 >= b1;
var r4a1 = a2 >= b2;
var r4a1 = a3 >= b3;
var r4a1 = a4 >= b4;
var r4b1 = b1 >= a1;
var r4b1 = b2 >= a2;
var r4b1 = b3 >= a3;
var r4b1 = b4 >= a4;
// operator ==
var r5a1 = a1 == b1;
var r5a1 = a2 == b2;
var r5a1 = a3 == b3;
var r5a1 = a4 == b4;
var r5b1 = b1 == a1;
var r5b1 = b2 == a2;
var r5b1 = b3 == a3;
var r5b1 = b4 == a4;
// operator !=
var r6a1 = a1 != b1;
var r6a1 = a2 != b2;
var r6a1 = a3 != b3;
var r6a1 = a4 != b4;
var r6b1 = b1 != a1;
var r6b1 = b2 != a2;
var r6b1 = b3 != a3;
var r6b1 = b4 != a4;
// operator ===
var r7a1 = a1 === b1;
var r7a1 = a2 === b2;
var r7a1 = a3 === b3;
var r7a1 = a4 === b4;
var r7b1 = b1 === a1;
var r7b1 = b2 === a2;
var r7b1 = b3 === a3;
var r7b1 = b4 === a4;
// operator !==
var r8a1 = a1 !== b1;
var r8a1 = a2 !== b2;
var r8a1 = a3 !== b3;
var r8a1 = a4 !== b4;
var r8b1 = b1 !== a1;
var r8b1 = b2 !== a2;
var r8b1 = b3 !== a3;
var r8b1 = b4 !== a4;
|
use
dashboarddb
db.createUser(
{
user: "dashboarduser",
pwd: "1qazxSw2",
roles: [
{role: "readWrite", db: "dashboard"}
]
})
db.dummmyCollection.insert({x: 1});
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'showblocks', 'hi', {
toolbar: 'ब्लॉक दिखायें'
} );
|
/**
* Copyright (c) 2015 Samsung Electronics, Inc.,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
"use strict";
var moment = require('moment');
var log = require('../util/logging');
var _ = require('lodash');
exports.getCurrentTimeString = function () {
var now = moment().format();
return now.replace(/\..+/, '').replace(/\-/g, '').replace(/\:/g, '').replace(/T/, '-').substr(0,15);
};
/* refer to : http://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js */
exports.getLocalIPAddress = function(){
var interfaces = require('os').networkInterfaces();
for (var devName in interfaces) {
var iface = interfaces[devName];
for (var i = 0; i < iface.length; i++) {
var alias = iface[i];
if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal)
return alias.address;
}
}
return '0.0.0.0';
};
exports.getCliOptions = function() {
var options = {};
_(process.argv).forEach(function(item){
var option = item.split('=');
if(isValidCliOption(option)){
option[0] = _.trim(option[0])
var key = option[0].substr(1, (option[0].length-1));
options[key] = _.trim(option[1]);
}
}).value();
return {
options: options,
getValue: function (key, defaultValue){
if(!key || _.trim(key).length === 0){
return undefined;
}
var _key = _.trim(key);
if(this.options[_key]){
return this.options[_key];
} else if(defaultValue){
this.options[_key] = defaultValue;
return defaultValue;
} else {
return undefined;
}
}
};
};
function isValidCliOption(option){
if(_.isArray(option) === false || option.length !== 2) return false;
var key = _.trim(option[0]);
var value = _.trim(option[1]);
if(key.length < 2) return false;
if(value.length < 1) return false;
return key.startsWith('-');
}
|
tinyMCE.addI18n('ro.advimage_dlg',{
tab_general:"General",
tab_appearance:"Afi\u015Fare",
tab_advanced:"Avansat",
general:"General",
title:"Titlu",
preview:"Previzualizare",
constrain_proportions:"Men\u0163ine propor\u0163ii",
langdir:"Direc\u0163ie limb\u0103",
langcode:"Cod limb\u0103",
long_desc:"Link descriere",
style:"Stil",
classes:"Clase",
ltr:"De la st\u00E2nga la dreapta",
rtl:"De la dreapta la st\u00E2nga",
id:"Id",
map:"Hart\u0103 imagine",
swap_image:"Schimb\u0103 imagini",
alt_image:"Imagine alternativ\u0103",
mouseover:"Pentru mouse peste",
mouseout:"Normal",
misc:"Diverse",
example_img:"Imagine mic\u0103",
missing_alt:"Sigur dori\u0163i s\u0103 continua\u0163i f\u0103r\u0103 a introduce o descriere a imaginii?",
dialog_title:"Insereaz\u0103/Editeaz\u0103 imagine",
src:"URL imagine",
alt:"Descriere imagine",
list:"List\u0103 imagini",
border:"Bordur\u0103",
dimensions:"Dimensiuni",
vspace:"Spa\u0163iu vertical",
hspace:"Spa\u0163iu orizontal",
align:"Aliniere",
align_baseline:"Baseline",
align_top:"Sus",
align_middle:"La mijloc",
align_bottom:"Jos",
align_texttop:"Textul sus",
align_textbottom:"Textul jos",
align_left:"St\u00E2nga",
align_right:"Dreapta",
image_list:"List\u0103 de imagini"
});
|
'use strict';
// Load modules
// Declare internals
var internals = {};
exports.method = function (value) {
return value;
};
|
; (function() {
window.require(["ace/snippets/eiffel"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
|
"use strict";
var ASSERT = require("./assert");
function arrayMove(src, srcIndex, dst, dstIndex, len) {
for (var j = 0; j < len; ++j) {
dst[j + dstIndex] = src[j + srcIndex];
src[j + srcIndex] = void 0;
}
}
function Queue(capacity) {
this._capacity = capacity;
this._length = 0;
this._front = 0;
}
Queue.prototype._willBeOverCapacity = function (size) {
return this._capacity < size;
};
Queue.prototype._pushOne = function (arg) {
var length = this.length();
this._checkCapacity(length + 1);
var i = (this._front + length) & (this._capacity - 1);
this[i] = arg;
this._length = length + 1;
};
Queue.prototype._unshiftOne = function(value) {
var capacity = this._capacity;
this._checkCapacity(this.length() + 1);
var front = this._front;
var i = (((( front - 1 ) &
( capacity - 1) ) ^ capacity ) - capacity );
this[i] = value;
this._front = i;
this._length = this.length() + 1;
};
Queue.prototype.unshift = function(fn, receiver, arg) {
this._unshiftOne(arg);
this._unshiftOne(receiver);
this._unshiftOne(fn);
};
Queue.prototype.push = function (fn, receiver, arg) {
ASSERT(arguments.length === 3);
ASSERT(typeof fn === "function");
var length = this.length() + 3;
if (this._willBeOverCapacity(length)) {
//The fast array copies expect the
//underlying array to be filled completely
this._pushOne(fn);
this._pushOne(receiver);
this._pushOne(arg);
return;
}
var j = this._front + length - 3;
this._checkCapacity(length);
var wrapMask = this._capacity - 1;
this[(j + 0) & wrapMask] = fn;
this[(j + 1) & wrapMask] = receiver;
this[(j + 2) & wrapMask] = arg;
this._length = length;
};
Queue.prototype.shift = function () {
ASSERT(this.length() > 0);
var front = this._front,
ret = this[front];
this[front] = undefined;
this._front = (front + 1) & (this._capacity - 1);
this._length--;
return ret;
};
Queue.prototype.length = function () {
return this._length;
};
Queue.prototype._checkCapacity = function (size) {
if (this._capacity < size) {
this._resizeTo(this._capacity << 1);
}
};
Queue.prototype._resizeTo = function (capacity) {
var oldCapacity = this._capacity;
this._capacity = capacity;
var front = this._front;
var length = this._length;
var moveItemsCount = (front + length) & (oldCapacity - 1);
arrayMove(this, 0, this, oldCapacity, moveItemsCount);
};
module.exports = Queue;
|
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const tls = require('tls');
const stream = require('stream');
const delay = new stream.Duplex({
read: function read() {
},
write: function write(data, enc, cb) {
console.log('pending');
setImmediate(function() {
console.log('done');
cb();
});
}
});
const secure = tls.connect({
socket: delay
});
setImmediate(function() {
secure.destroy();
});
|
/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial
Software License Agreement provided with the Software or, alternatively, in accordance with the
terms contained in a written agreement between you and Sencha.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-09-18 17:18:59 (940c324ac822b840618a3a8b2b4b873f83a1a9b1)
*/
/**
* Represents a 2D point with x and y properties, useful for comparison and instantiation
* from an event:
*
* var point = Ext.util.Point.fromEvent(e);
*
*/
Ext.define('Ext.util.Point', {
/* Begin Definitions */
extend: 'Ext.util.Region',
statics: {
/**
* Returns a new instance of Ext.util.Point base on the pageX / pageY values of the given event
* @static
* @param {Ext.EventObject/Event} e The event
* @return {Ext.util.Point}
*/
fromEvent: function(e) {
e = e.browserEvent || e;
e = (e.changedTouches && e.changedTouches.length > 0) ? e.changedTouches[0] : e;
return new this(e.pageX, e.pageY);
}
},
/* End Definitions */
/**
* Creates a point from two coordinates.
* @param {Number} x X coordinate.
* @param {Number} y Y coordinate.
*/
constructor: function(x, y) {
this.callParent([y, x, y, x]);
},
/**
* Returns a human-eye-friendly string that represents this point,
* useful for debugging
* @return {String}
*/
toString: function() {
return "Point[" + this.x + "," + this.y + "]";
},
/**
* Compare this point and another point
* @param {Ext.util.Point/Object} p The point to compare with, either an instance
* of Ext.util.Point or an object with left and top properties
* @return {Boolean} Returns whether they are equivalent
*/
equals: function(p) {
return (this.x == p.x && this.y == p.y);
},
/**
* Whether the given point is not away from this point within the given threshold amount.
* @param {Ext.util.Point/Object} p The point to check with, either an instance
* of Ext.util.Point or an object with left and top properties
* @param {Object/Number} threshold Can be either an object with x and y properties or a number
* @return {Boolean}
*/
isWithin: function(p, threshold) {
if (!Ext.isObject(threshold)) {
threshold = {
x: threshold,
y: threshold
};
}
return (this.x <= p.x + threshold.x && this.x >= p.x - threshold.x &&
this.y <= p.y + threshold.y && this.y >= p.y - threshold.y);
},
/**
* Determins whether this Point contained by the passed Region, Component or element.
* @param {Ext.util.Region/Ext.Component/Ext.dom.Element/HTMLElement} region
* The rectangle to check that this Point is within.
* @return {Boolean}
*/
isContainedBy: function(region) {
if (!(region instanceof Ext.util.Region)) {
region = Ext.get(region.el || region).getRegion();
}
return region.contains(this);
},
/**
* Compare this point with another point when the x and y values of both points are rounded. E.g:
* [100.3,199.8] will equals to [100, 200]
* @param {Ext.util.Point/Object} p The point to compare with, either an instance
* of Ext.util.Point or an object with x and y properties
* @return {Boolean}
*/
roundedEquals: function(p) {
return (Math.round(this.x) == Math.round(p.x) && Math.round(this.y) == Math.round(p.y));
}
}, function() {
/**
* @method
* Alias for {@link #translateBy}
* @inheritdoc Ext.util.Region#translateBy
*/
this.prototype.translate = Ext.util.Region.prototype.translateBy;
});
|
/*global angular*/
"use strict";
var lookAroundApp = angular.module("lookAroundApp", [
"lookAroundApp.services",
"lookAroundApp.controllers",
"lookAroundApp.filters",
"lookAroundApp.directives",
"ui.bootstrap"
]);
lookAroundApp.config(function ($routeProvider) {
$routeProvider
.when("/",
{
controller: "ZipCodeFrmCtrl",
templateUrl: "partials/zipcode.html"
})
.when("/search/:zipcode/:place",
{
controller: "SearchCtrl",
templateUrl: "partials/search.html"
})
.otherwise({ redirectTo: "/" });
});
|
import createCaseFirst from './_createCaseFirst';
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
export default upperFirst;
|
chorus.models.TaskReport = chorus.models.Base.extend({
urlTemplate: "task/{{id}}"
});
|
/**
* This Controller handles initialization requests for the Ext Direct API
* shared by different examples; in itself it is an example of dynamic
* API manipulation.
*
* The primary reason to have a global Controller handling Ext Direct
* is to keep Direct configuration centralized for the application,
* as well as avoid binding transient ViewControlles to Provider
* instances unless necessary.
*/
Ext.define('KitchenSink.controller.Direct', {
extend: 'Ext.app.Controller',
requires: [
'Ext.direct.RemotingProvider',
'Ext.direct.Manager',
'Ext.app.domain.Direct'
],
config: {
/**
* @cfg {String} apiUrl
* Default URL to use for Ext.Direct service discovery requests.
*/
apiUrl: 'resources/direct/api.php',
/**
* @cfg {String} [varName=Ext.app.REMOTING_API]
* Default variable name to use for Ext.Direct API declaration.
*/
varName: 'Ext.app.REMOTING_API',
listen: {
controller: {
// We're listening to these events from any Controller.
// That includes ViewControllers, too.
'*': {
directconnect: 'onDirectConnect',
directdisconnect: 'onDirectDisconnect',
directgetprovider: 'onDirectGetProvider'
}
}
}
},
init: function() {
this.providers = {};
},
destroy: function() {
var providers = this.providers,
url;
for (url in providers) {
providers[url].disconnect();
providers[url] = null;
}
this.callParent();
},
/**
* Request remote API from the server, and create a new Direct provider
* when API declaration is received; alternatively create a new provider
* if the caller provided a configuration blob for it.
*
* @param {Object} options Options to configure Provider request, and to
* return to the caller in synchronous fashion.
*/
onDirectConnect: function(options) {
var me = this,
providerCfg = options.providerCfg,
url, provider, request;
url = (providerCfg && providerCfg.url) || options.apiUrl || me.getApiUrl();
// The provider at that URI may have been initialized already
provider = me.providers[url];
// ViewController may not have specific API URL defined in its
// configuration, which means we need to return the URL used.
options.url = url;
if (provider) {
provider.connect();
options.success = true;
return;
}
request = Ext.apply({
url: url,
varName: options.varName || me.getVarName()
}, providerCfg);
// We may be passed a provider configuration object that contains
// sufficient information to create a Provider instance. In that
// case, loadProvider will add it and fire the callback immediately.
Ext.direct.Manager.loadProvider(request, me.providerCallback, me);
},
/**
* Request to disconnect a Direct provider. This event is fired
* by ViewControllers being destroyed, to notify Direct controller
* that they no longer need the specified provider.
*
* @param {String} url Service URL for a provider
*/
onDirectDisconnect: function(url) {
var provider = this.providers[url];
if (provider) {
provider.disconnect();
}
},
/**
* Return a provider by its URL to the caller.
*/
onDirectGetProvider: function(options) {
options.provider = this.providers[options.url];
},
providerCallback: function(apiUrl, provider) {
var me = this;
// Error message can be returned instead of provider
if (Ext.isString(provider)) {
me.fireEvent('providerfail', apiUrl, provider);
return;
}
// We don't need to connect the provider as it was
// connected automatically by the Direct Manager
me.providers[apiUrl] = provider;
me.fireEvent('providerinit', apiUrl);
}
});
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'stylescombo', 'mk', {
label: 'Styles',
panelTitle: 'Formatting Styles', // MISSING
panelTitle1: 'Block Styles', // MISSING
panelTitle2: 'Inline Styles', // MISSING
panelTitle3: 'Object Styles' // MISSING
} );
|
Ext.define('KitchenSink.store.Browsers', {
extend: 'Ext.data.Store',
alias: 'store.browsers',
fields: ['month', 'data1', 'data2', 'data3', 'data4', 'other'],
data: [
{ month: 'Jan', data1: 20, data2: 37, data3: 35, data4: 4, other: 4 },
{ month: 'Feb', data1: 20, data2: 37, data3: 36, data4: 5, other: 2 },
{ month: 'Mar', data1: 19, data2: 36, data3: 37, data4: 4, other: 4 },
{ month: 'Apr', data1: 18, data2: 36, data3: 38, data4: 5, other: 3 },
{ month: 'May', data1: 18, data2: 35, data3: 39, data4: 4, other: 4 },
{ month: 'Jun', data1: 17, data2: 34, data3: 42, data4: 4, other: 3 },
{ month: 'Jul', data1: 16, data2: 34, data3: 43, data4: 4, other: 3 },
{ month: 'Aug', data1: 16, data2: 33, data3: 44, data4: 4, other: 3 },
{ month: 'Sep', data1: 16, data2: 32, data3: 44, data4: 4, other: 4 },
{ month: 'Oct', data1: 16, data2: 32, data3: 45, data4: 4, other: 3 },
{ month: 'Nov', data1: 15, data2: 31, data3: 46, data4: 4, other: 4 },
{ month: 'Dec', data1: 15, data2: 31, data3: 47, data4: 4, other: 3 }
]
});
|
//// [constantOverloadFunctionNoSubtypeError.ts]
class Base { foo() { } }
class Derived1 extends Base { bar() { } }
class Derived2 extends Base { baz() { } }
class Derived3 extends Base { biz() { } }
function foo(tagName: 'canvas'): Derived3;
function foo(tagName: 'div'): Derived2;
function foo(tagName: 'span'): Derived1;
function foo(tagName: number): Base;
function foo(tagName: any): Base {
return null;
}
//// [constantOverloadFunctionNoSubtypeError.js]
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var Base = (function () {
function Base() {
}
Base.prototype.foo = function () {
};
return Base;
})();
var Derived1 = (function (_super) {
__extends(Derived1, _super);
function Derived1() {
_super.apply(this, arguments);
}
Derived1.prototype.bar = function () {
};
return Derived1;
})(Base);
var Derived2 = (function (_super) {
__extends(Derived2, _super);
function Derived2() {
_super.apply(this, arguments);
}
Derived2.prototype.baz = function () {
};
return Derived2;
})(Base);
var Derived3 = (function (_super) {
__extends(Derived3, _super);
function Derived3() {
_super.apply(this, arguments);
}
Derived3.prototype.biz = function () {
};
return Derived3;
})(Base);
function foo(tagName) {
return null;
}
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { areIterablesEqual, isListLikeIterable } from '../facade/collection';
import { isPrimitive, looseIdentical } from '../facade/lang';
export { looseIdentical } from '../facade/lang';
export var UNINITIALIZED = {
toString: function () { return 'CD_INIT_VALUE'; }
};
export function devModeEqual(a, b) {
if (isListLikeIterable(a) && isListLikeIterable(b)) {
return areIterablesEqual(a, b, devModeEqual);
}
else if (!isListLikeIterable(a) && !isPrimitive(a) && !isListLikeIterable(b) && !isPrimitive(b)) {
return true;
}
else {
return looseIdentical(a, b);
}
}
/**
* Indicates that the result of a {@link PipeMetadata} transformation has changed even though the
* reference
* has not changed.
*
* The wrapped value will be unwrapped by change detection, and the unwrapped value will be stored.
*
* Example:
*
* ```
* if (this._latestValue === this._latestReturnedValue) {
* return this._latestReturnedValue;
* } else {
* this._latestReturnedValue = this._latestValue;
* return WrappedValue.wrap(this._latestValue); // this will force update
* }
* ```
* @stable
*/
export var WrappedValue = (function () {
function WrappedValue(wrapped) {
this.wrapped = wrapped;
}
WrappedValue.wrap = function (value) { return new WrappedValue(value); };
return WrappedValue;
}());
/**
* Helper class for unwrapping WrappedValue s
*/
export var ValueUnwrapper = (function () {
function ValueUnwrapper() {
this.hasWrappedValue = false;
}
ValueUnwrapper.prototype.unwrap = function (value) {
if (value instanceof WrappedValue) {
this.hasWrappedValue = true;
return value.wrapped;
}
return value;
};
ValueUnwrapper.prototype.reset = function () { this.hasWrappedValue = false; };
return ValueUnwrapper;
}());
/**
* Represents a basic change from a previous to a new value.
* @stable
*/
export var SimpleChange = (function () {
function SimpleChange(previousValue, currentValue) {
this.previousValue = previousValue;
this.currentValue = currentValue;
}
/**
* Check whether the new value is the first value assigned.
*/
SimpleChange.prototype.isFirstChange = function () { return this.previousValue === UNINITIALIZED; };
return SimpleChange;
}());
//# sourceMappingURL=change_detection_util.js.map
|
define(
({
buttonOk: "OK",
buttonCancel: "Abbrechen",
buttonSave: "Speichern",
itemClose: "Schließen"
})
);
|
// Copyright 2019 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.
// A worker that imports "empty.js" and also accepts a URL parameter like
// "?import=script.js" and imports "script.js".
const url = new URL(self.location);
const import_url = url.searchParams.get('import');
importScripts('empty.js');
importScripts(import_url);
|
version https://git-lfs.github.com/spec/v1
oid sha256:8b9c0dee70ba4f792284eb0d9cf2f76ea7a528452581d0c4c5e321c401d4c6c3
size 22604
|
var faker = require('faker');
var props = require('json-api-mock-server/lib/store/props');
var attr = props.attr;
var many = props.many;
var one = props.one;
var between = require('json-api-mock-server/lib/utils/between');
module.exports = {
name: attr('string', { defaultValue: function() { return faker.lorem.words(between(3, 7)); }}),
description: attr('string', { defaultValue: function() { return faker.lorem.sentences(between(3, 7)); }}),
baz: one('baz', { inverse: 'complex', defaultValue: true }),
foos: many('foo', { inverse: 'complex', defaultValue: 5 })
};
|
/* Shorthand */
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./components/messages/messages"));
|
'use strict';
var React = require('react/addons');
var PureRenderMixin = React.addons.PureRenderMixin;
var SvgIcon = require('../../svg-icon');
var DeviceBrightnessHigh = React.createClass({
displayName: 'DeviceBrightnessHigh',
mixins: [PureRenderMixin],
render: function render() {
return React.createElement(
SvgIcon,
this.props,
React.createElement('path', { d: 'M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zm0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z' })
);
}
});
module.exports = DeviceBrightnessHigh;
|
import { Template } from "meteor/templating";
import { Reaction, i18next } from "/client/api";
import { Shops } from "/lib/collections";
Template.paymentSettings.helpers({
checked(enabled) {
if (enabled === true) {
return "checked";
}
return "";
},
shown(enabled) {
if (enabled !== true) {
return "hidden";
}
return "";
},
paymentMethodOptions() {
const paymentMethods = Reaction.Apps({ provides: "paymentMethod" });
const options = [{
label: i18next.t("app.auto"),
value: "none"
}];
if (paymentMethods && _.isArray(paymentMethods)) {
for (const method of paymentMethods) {
if (method.enabled === true) {
options.push({
label: i18next.t(method.i18nKeyLabel),
value: method.settingsKey
});
}
}
}
return options;
},
shop() {
return Shops.findOne(Reaction.getShopId());
}
});
// toggle payment methods visibility
Template.paymentSettings.events({
"change input[name=enabled]": (event) => {
event.preventDefault();
const settingsKey = event.target.getAttribute("data-key");
const packageId = event.target.getAttribute("data-id");
const fields = [{
property: "enabled",
value: event.target.checked
}];
// update package registry
if (packageId) {
Meteor.call("registry/update", packageId, settingsKey, fields);
Meteor.call("shop/togglePackage", packageId, !event.target.checked);
}
}
});
AutoForm.hooks({
shopEditPaymentMethodsForm: {
onSuccess: function () {
return Alerts.toast(i18next.t("shopSettings.shopPaymentMethodsSaved"),
"success");
},
onError: function (operation, error) {
return Alerts.toast(
`${i18next.t("shopSettings.shopPaymentMethodsFailed")} ${error}`, "error"
);
}
}
});
|
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** @fileoverview Definitions of logging methods for transforms and linting. */
/** @typedef {{variadic: boolean, messageArgPos: number}} */
let LogMethodMetadataDef;
const definitionFile = 'src/log.js';
/** Functions exposed as singleton getters for `Log`. */
const singletonFunctions = ['dev', 'user'];
const assertAliases = singletonFunctions.map((prefix) => `${prefix}Assert`);
/**
* Known transformable logging methods.
* @type {!Object<string, LogMethodMetadataDef>}
*/
const transformableMethods = {
assert: {variadic: true, extractMessages: true, messageArgPos: 1},
assertString: {variadic: false, extractMessages: true, messageArgPos: 1},
assertNumber: {variadic: false, extractMessages: true, messageArgPos: 1},
assertBoolean: {variadic: false, extractMessages: true, messageArgPos: 1},
assertEnumValue: {variadic: false, extractMessages: false, messageArgPos: 2},
assertElement: {variadic: false, extractMessages: true, messageArgPos: 1},
fine: {variadic: true, extractMessages: true, messageArgPos: 1},
info: {variadic: true, extractMessages: true, messageArgPos: 1},
warn: {variadic: true, extractMessages: true, messageArgPos: 1},
error: {variadic: true, extractMessages: true, messageArgPos: 1},
createExpectedError: {
variadic: true,
extractMessages: true,
messageArgPos: 0,
},
expectedError: {variadic: true, extractMessages: true, messageArgPos: 1},
createError: {variadic: true, extractMessages: true, messageArgPos: 0},
};
module.exports = {
assertAliases,
definitionFile,
singletonFunctions,
transformableMethods,
};
|
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {CSS} from '../../../../build/amp-subscriptions-0.1.css';
import {Dialog} from '../dialog';
import {Services} from '../../../../src/services';
import {createElementWithAttributes} from '../../../../src/dom';
import {installStylesForDoc} from '../../../../src/style-installer';
describes.realWin('AmpSubscriptions Dialog', {amp: true}, (env) => {
let win, doc, ampdoc;
let dialog;
let content;
let vsync, viewport;
let addToFixedLayerSpy, updatePaddingSpy;
beforeEach(() => {
win = env.win;
doc = win.document;
doc.body.parentNode.setAttribute('amp-version', '1');
ampdoc = env.ampdoc;
installStylesForDoc(ampdoc, CSS, () => {}, false, 'amp-subscriptions');
vsync = Services.vsyncFor(ampdoc.win);
viewport = Services.viewportForDoc(ampdoc);
addToFixedLayerSpy = env.sandbox.stub(viewport, 'addToFixedLayer');
updatePaddingSpy = env.sandbox.stub(viewport, 'updatePaddingBottom');
dialog = new Dialog(ampdoc);
content = createElementWithAttributes(doc, 'div', {
style: 'height:17px',
});
});
it('should construct correctly', () => {
expect(dialog.getRoot().tagName.toLowerCase()).to.equal(
'amp-subscriptions-dialog'
);
expect(dialog.getRoot().getAttribute('role')).to.equal('dialog');
expect(dialog.getRoot().parentNode).to.equal(doc.body);
expect(dialog.closeButton_).to.have.display('none');
expect(dialog.getRoot()).to.have.display('none');
const styles = getComputedStyle(dialog.getRoot());
expect(styles.position).to.equal('fixed');
});
it('should open content when invisible', async () => {
let styles;
const promise = dialog.open(content, false);
expect(dialog.getRoot()).to.have.display('none');
await vsync.mutatePromise(() => {});
// First vsync displays the dialog.
expect(content.parentNode).to.equal(dialog.getRoot());
expect(dialog.isVisible()).to.be.true;
expect(dialog.getRoot()).to.have.display('block');
styles = getComputedStyle(dialog.getRoot());
expect(styles.transform).to.contain('17');
await promise;
await vsync.mutatePromise(() => {});
expect(dialog.getRoot()).to.have.display('block');
styles = getComputedStyle(dialog.getRoot());
expect(styles.transform).to.not.contain('17');
expect(dialog.closeButton_).to.have.display('none');
expect(updatePaddingSpy).to.be.calledOnce.calledWith(17);
expect(addToFixedLayerSpy).to.be.calledOnce.calledWith(dialog.getRoot());
expect(dialog.isVisible()).to.be.true;
});
it('should re-open content when visible', async () => {
const content2 = createElementWithAttributes(doc, 'div', {
style: 'height:21px',
});
const promise = dialog.open(content2, false);
await vsync.mutatePromise(() => {});
expect(content2.parentNode).to.equal(dialog.getRoot());
await promise;
expect(content2.parentNode).to.equal(dialog.getRoot());
expect(content.parentNode).to.be.null;
expect(dialog.getRoot()).to.have.display('block');
const styles = getComputedStyle(dialog.getRoot());
expect(styles.transform).to.not.contain('21');
});
it('should close', async () => {
await dialog.open(content, false);
expect(content.parentNode).to.equal(dialog.getRoot());
expect(dialog.getRoot()).to.have.display('block');
await dialog.close();
expect(dialog.getRoot()).to.have.display('none');
expect(dialog.isVisible()).to.be.false;
expect(content.parentNode).to.equal(dialog.getRoot());
expect(dialog.getRoot().parentNode).to.equal(doc.body);
});
it('should re-open after close', async () => {
await dialog.open(content, false);
expect(dialog.isVisible()).to.be.true;
await dialog.close();
expect(dialog.isVisible()).to.be.false;
await dialog.open(content, false);
expect(dialog.isVisible()).to.be.true;
});
it('should show close button', async () => {
doc.body.classList.add('i-amphtml-subs-grant-yes');
await dialog.open(content, true);
expect(dialog.closeButton_).to.have.display('block');
});
it('should not show close button if content is not granted', async () => {
doc.body.classList.remove('i-amphtml-subs-grant-yes');
await dialog.open(content, true);
expect(dialog.closeButton_).to.have.display('none');
});
});
|
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
* @path ch08/8.12/8.12.1/8.12.1-1_43.js
* @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited setter property)
*/
function testcase() {
var base = {};
Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true});
var o = Object.create(base);
return o.hasOwnProperty("foo")===false;
}
runTestCase(testcase);
|
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _react = require('react');
exports['default'] = _react.PropTypes.oneOfType([
// [Number, Number]
_react.PropTypes.arrayOf(_react.PropTypes.number),
// {lat: Number, lng: Number}
_react.PropTypes.shape({
lat: _react.PropTypes.number,
lng: _react.PropTypes.number
}),
// {lat: Number, lon: Number}
_react.PropTypes.shape({
lat: _react.PropTypes.number,
lon: _react.PropTypes.number
})]);
module.exports = exports['default'];
|
'use strict';
angular.module('copayApp.controllers').controller('glideraController',
function($scope, $timeout, $ionicModal, $log, storageService, glideraService, ongoingProcess, platformInfo, externalLinkService, popupService, lodash) {
$scope.openExternalLink = function(url) {
externalLinkService.open(url);
};
var init = function() {
ongoingProcess.set('connectingGlidera', true);
glideraService.init(function(err, data) {
ongoingProcess.set('connectingGlidera', false);
if (err) {
popupService.showAlert('Error connecting Glidera', err + '. Please re-connect to Glidera');
return;
}
if (!data || (data && !data.token)) return;
$scope.account['token'] = data.token;
$scope.account['status'] = data.status;
$scope.account['txs'] = data.txs;
$timeout(function() {
$scope.$digest();
$scope.update();
});
});
};
$scope.update = function(opts) {
$log.debug('Updating Glidera...');
glideraService.updateStatus($scope.account);
};
$scope.getAuthenticateUrl = function() {
return glideraService.getOauthCodeUrl();
};
$scope.submitOauthCode = function(code) {
ongoingProcess.set('connectingGlidera', true);
glideraService.authorize(code, function(err, data) {
ongoingProcess.set('connectingGlidera', false);
if (err) {
popupService.showAlert('Authorisation error', err);
return;
}
$scope.account['token'] = data.token;
$scope.account['status'] = data.status;
init();
});
};
$scope.openTxModal = function(tx) {
$scope.tx = tx;
glideraService.getTransaction($scope.account.token, tx.transactionUuid, function(err, tx) {
if (err) {
popupService.showAlert('Error getting transaction', 'Could not get transactions');
return;
}
$scope.tx = tx;
});
$ionicModal.fromTemplateUrl('views/modals/glidera-tx-details.html', {
scope: $scope,
backdropClickToClose: false,
hardwareBackButtonClose: false,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.glideraTxDetailsModal = modal;
$scope.glideraTxDetailsModal.show();
});
};
$scope.openAuthenticateWindow = function() {
$scope.openExternalLink($scope.getAuthenticateUrl());
$scope.showOauthForm = true
}
$scope.openLoginWindow = function() {
var glideraUrl = ($scope.network === 'testnet') ? 'https://sandbox.glidera.io/login' : 'https://glidera.io/login';
$scope.openExternalLink(glideraUrl);
}
$scope.openSupportWindow = function() {
var url = glideraService.getSupportUrl();
var optIn = true;
var title = 'Glidera Support';
var message = 'You can email glidera at support@glidera.io for direct support, or you can contact Glidera on Twitter.';
var okText = 'Tweet @GlideraInc';
var cancelText = 'Go Back';
externalLinkService.open(url, optIn, title, message, okText, cancelText);
}
$scope.toggleOauthForm = function() {
$scope.showOauthForm = !$scope.showOauthForm;
}
$scope.$on("$ionicView.afterEnter", function(event, data) {
$scope.network = glideraService.getNetwork();
$scope.currency = glideraService.getCurrency();
$scope.showOauthForm = false;
$scope.account = {};
if (data.stateParams && data.stateParams.code) {
$scope.submitOauthCode(data.stateParams.code);
} else {
init();
}
});
});
|
module.exports = {
pkcs1: require('./pkcs1'),
pkcs1_oaep: require('./oaep'),
pss: require('./pss'),
/**
* Check if scheme has padding methods
* @param scheme {string}
* @returns {Boolean}
*/
isEncryption: function (scheme) {
return module.exports[scheme] && module.exports[scheme].isEncryption;
},
/**
* Check if scheme has sign/verify methods
* @param scheme {string}
* @returns {Boolean}
*/
isSignature: function (scheme) {
return module.exports[scheme] && module.exports[scheme].isSignature;
}
};
|
import { Injectable } from '@angular/core';
/**
* Configuration service for the NgbCarousel component.
* You can inject this service, typically in your root component, and customize the values of its properties in
* order to provide default values for all the carousels used in the application.
*/
export var NgbCarouselConfig = (function () {
function NgbCarouselConfig() {
this.interval = 5000;
this.wrap = true;
this.keyboard = true;
}
NgbCarouselConfig.decorators = [
{ type: Injectable },
];
/** @nocollapse */
NgbCarouselConfig.ctorParameters = function () { return []; };
return NgbCarouselConfig;
}());
//# sourceMappingURL=carousel-config.js.map
|
/**
* Default property values of interactive objects
* Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties
*
* @private
* @name interactiveTarget
* @memberof PIXI.interaction
* @example
* function MyObject() {}
*
* Object.assign(
* core.DisplayObject.prototype,
* PIXI.interaction.interactiveTarget
* );
*/
export default {
/**
* Enable interaction events for the DisplayObject. Touch, pointer and mouse
* events will not be emitted unless `interactive` is set to `true`.
*
* @example
* const sprite = new PIXI.Sprite(texture);
* sprite.interactive = true;
* sprite.on('tap', (event) => {
* //handle event
* });
* @member {boolean}
* @memberof PIXI.DisplayObject#
*/
interactive: false,
/**
* Determines if the children to the displayObject can be clicked/touched
* Setting this to false allows PixiJS to bypass a recursive `hitTest` function
*
* @member {boolean}
* @memberof PIXI.Container#
*/
interactiveChildren: true,
/**
* Interaction shape. Children will be hit first, then this shape will be checked.
* Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
*
* @example
* const sprite = new PIXI.Sprite(texture);
* sprite.interactive = true;
* sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
* @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}
* @memberof PIXI.DisplayObject#
*/
hitArea: null,
/**
* If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
* Setting this changes the 'cursor' property to `'pointer'`.
*
* @example
* const sprite = new PIXI.Sprite(texture);
* sprite.interactive = true;
* sprite.buttonMode = true;
* @member {boolean}
* @memberof PIXI.DisplayObject#
*/
get buttonMode()
{
return this.cursor === 'pointer';
},
set buttonMode(value)
{
if (value)
{
this.cursor = 'pointer';
}
else if (this.cursor === 'pointer')
{
this.cursor = null;
}
},
/**
* This defines what cursor mode is used when the mouse cursor
* is hovered over the displayObject.
*
* @example
* const sprite = new PIXI.Sprite(texture);
* sprite.interactive = true;
* sprite.cursor = 'wait';
* @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
*
* @member {string}
* @memberof PIXI.DisplayObject#
*/
cursor: null,
/**
* Internal set of all active pointers, by identifier
*
* @member {Map<number, InteractionTrackingData>}
* @memberof PIXI.DisplayObject#
* @private
*/
get trackedPointers()
{
if (this._trackedPointers === undefined) this._trackedPointers = {};
return this._trackedPointers;
},
/**
* Map of all tracked pointers, by identifier. Use trackedPointers to access.
*
* @private
* @type {Map<number, InteractionTrackingData>}
*/
_trackedPointers: undefined,
};
|
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'link', 'nb', {
acccessKey: 'Aksessknapp',
advanced: 'Avansert',
advisoryContentType: 'Type',
advisoryTitle: 'Tittel',
anchor: {
toolbar: 'Sett inn/Rediger anker',
menu: 'Egenskaper for anker',
title: 'Egenskaper for anker',
name: 'Ankernavn',
errorName: 'Vennligst skriv inn ankernavnet',
remove: 'Fjern anker'
},
anchorId: 'Element etter ID',
anchorName: 'Anker etter navn',
charset: 'Lenket tegnsett',
cssClasses: 'Stilarkklasser',
emailAddress: 'E-postadresse',
emailBody: 'Melding',
emailSubject: 'Meldingsemne',
id: 'Id',
info: 'Lenkeinfo',
langCode: 'Språkkode',
langDir: 'Språkretning',
langDirLTR: 'Venstre til høyre (VTH)',
langDirRTL: 'Høyre til venstre (HTV)',
menu: 'Rediger lenke',
name: 'Navn',
noAnchors: '(Ingen anker i dokumentet)',
noEmail: 'Vennligst skriv inn e-postadressen',
noUrl: 'Vennligst skriv inn lenkens URL',
other: '<annen>',
popupDependent: 'Avhenging (Netscape)',
popupFeatures: 'Egenskaper for popup-vindu',
popupFullScreen: 'Fullskjerm (IE)',
popupLeft: 'Venstre posisjon',
popupLocationBar: 'Adresselinje',
popupMenuBar: 'Menylinje',
popupResizable: 'Skalerbar',
popupScrollBars: 'Scrollbar',
popupStatusBar: 'Statuslinje',
popupToolbar: 'Verktøylinje',
popupTop: 'Topp-posisjon',
rel: 'Relasjon (rel)',
selectAnchor: 'Velg et anker',
styles: 'Stil',
tabIndex: 'Tabindeks',
target: 'Mål',
targetFrame: '<ramme>',
targetFrameName: 'Målramme',
targetPopup: '<popup-vindu>',
targetPopupName: 'Navn på popup-vindu',
title: 'Lenke',
toAnchor: 'Lenke til anker i teksten',
toEmail: 'E-post',
toUrl: 'URL',
toolbar: 'Sett inn/Rediger lenke',
type: 'Lenketype',
unlink: 'Fjern lenke',
upload: 'Last opp'
} );
|
/*!
* @depends ../core/AudioletNode.js
*/
/**
* Exponential lag for smoothing signals.
*
* **Inputs**
*
* - Value
* - Lag time
*
* **Outputs**
*
* - Lagged value
*
* **Parameters**
*
* - value The value to lag. Linked to input 0.
* - lag The 60dB lag time. Linked to input 1.
*
* @constructor
* @extends AudioletNode
* @param {Audiolet} audiolet The audiolet object.
* @param {Number} [value=0] The initial value.
* @param {Number} [lagTime=1] The initial lag time.
*/
var Lag = function(audiolet, value, lagTime) {
AudioletNode.call(this, audiolet, 2, 1);
this.value = new AudioletParameter(this, 0, value || 0);
this.lag = new AudioletParameter(this, 1, lagTime || 1);
this.lastValue = 0;
this.log001 = Math.log(0.001);
};
extend(Lag, AudioletNode);
/**
* Process samples
*/
Lag.prototype.generate = function() {
var input = this.inputs[0];
var output = this.outputs[0];
var sampleRate = this.audiolet.device.sampleRate;
var value = this.value.getValue();
var lag = this.lag.getValue();
var coefficient = Math.exp(this.log001 / (lag * sampleRate));
var outputValue = ((1 - coefficient) * value) +
(coefficient * this.lastValue);
output.samples[0] = outputValue;
this.lastValue = outputValue;
};
/**
* toString
*
* @return {String} String representation.
*/
Lag.prototype.toString = function() {
return 'Lag';
};
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This action prints log lines for a defined duration.
// The output is throttled by a defined delay between two log lines
// in order to keep the log size small and to stay within the log size limit.
function getArg(value, defaultValue) {
return value ? value : defaultValue;
}
// input: { duration: <duration in millis>, delay: <delay in millis> }, e.g.
// main( { delay: 100, duration: 10000 } );
function main(args) {
durationMillis = getArg(args.duration, 120000);
delayMillis = getArg(args.delay, 100);
logLines = 0;
startMillis = new Date();
timeout = setInterval(function() {
console.log(`[${ ++logLines }] The quick brown fox jumps over the lazy dog.`);
}, delayMillis);
return new Promise(function(resolve, reject) {
setTimeout(function() {
clearInterval(timeout);
message = `hello, I'm back after ${new Date() - startMillis} ms and printed ${logLines} log lines`
console.log(message)
resolve({ message: message });
}, durationMillis);
});
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
var gadgets = gadgets || {};
gadgets.i18n = gadgets.i18n || {};
gadgets.i18n.DateTimeConstants = {
ERAS:["\u516c\u5143\u524d","\u516c\u5143"],
ERANAMES:["\u516c\u5143\u524d","\u516c\u5143"],
NARROWMONTHS:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],
MONTHS:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],
STANDALONEMONTHS:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],
SHORTMONTHS:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],
STANDALONESHORTMONTHS:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],
WEEKDAYS:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],
SHORTWEEKDAYS:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],
NARROWWEEKDAYS:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],
SHORTQUARTERS:["1\u5b63","2\u5b63","3\u5b63","4\u5b63"],
QUARTERS:["\u7b2c1\u5b63\u5ea6","\u7b2c2\u5b63\u5ea6","\u7b2c3\u5b63\u5ea6","\u7b2c4\u5b63\u5ea6"],
AMPMS:["\u4e0a\u5348","\u4e0b\u5348"],
DATEFORMATS:["y\u5e74M\u6708d\u65e5EEEE","y\u5e74M\u6708d\u65e5","yyyy-M-d","dd/MM/yy"],
TIMEFORMATS:["zzzzah\u65f6mm\u5206ss\u79d2","ahh:mm:ssz","ahh:mm:ss","ahh:mm"],
FIRSTDAYOFWEEK: 6,
WEEKENDRANGE: [5, 6],
FIRSTWEEKCUTOFFDAY: 2
};
gadgets.i18n.DateTimeConstants.STANDALONENARROWMONTHS = gadgets.i18n.DateTimeConstants.NARROWMONTHS;
gadgets.i18n.DateTimeConstants.STANDALONEWEEKDAYS = gadgets.i18n.DateTimeConstants.WEEKDAYS;
gadgets.i18n.DateTimeConstants.STANDALONESHORTWEEKDAYS = gadgets.i18n.DateTimeConstants.SHORTWEEKDAYS;
gadgets.i18n.DateTimeConstants.STANDALONENARROWWEEKDAYS = gadgets.i18n.DateTimeConstants.NARROWWEEKDAYS;
|
/** @jsx React.DOM */
'use strict';
var React = require('react');
var ReactCanvas = require('react-canvas');
var Group = ReactCanvas.Group;
var Image = ReactCanvas.Image;
var Text = ReactCanvas.Text;
var FontFace = ReactCanvas.FontFace;
var measureText = ReactCanvas.measureText;
var CONTENT_INSET = 14;
var TEXT_SCROLL_SPEED_MULTIPLIER = 0.6;
var TEXT_ALPHA_SPEED_OUT_MULTIPLIER = 1.25;
var TEXT_ALPHA_SPEED_IN_MULTIPLIER = 2.6;
var IMAGE_LAYER_INDEX = 2;
var TEXT_LAYER_INDEX = 1;
var Page = React.createClass({
propTypes: {
width: React.PropTypes.number.isRequired,
height: React.PropTypes.number.isRequired,
article: React.PropTypes.object.isRequired,
scrollTop: React.PropTypes.number.isRequired
},
componentWillMount: function () {
// Pre-compute headline/excerpt text dimensions.
var article = this.props.article;
var maxWidth = this.props.width - 2 * CONTENT_INSET;
var titleStyle = this.getTitleStyle();
var excerptStyle = this.getExcerptStyle();
this.titleMetrics = measureText(article.title, maxWidth, titleStyle.fontFace, titleStyle.fontSize, titleStyle.lineHeight);
this.excerptMetrics = measureText(article.excerpt, maxWidth, excerptStyle.fontFace, excerptStyle.fontSize, excerptStyle.lineHeight);
},
render: function () {
var groupStyle = this.getGroupStyle();
var imageStyle = this.getImageStyle();
var titleStyle = this.getTitleStyle();
var excerptStyle = this.getExcerptStyle();
// Layout title and excerpt below image.
titleStyle.height = this.titleMetrics.height;
excerptStyle.top = titleStyle.top + titleStyle.height + CONTENT_INSET;
excerptStyle.height = this.props.height - excerptStyle.top - CONTENT_INSET;
return (
<Group style={groupStyle}>
<Image style={imageStyle} src={this.props.article.imageUrl} fadeIn={true} useBackingStore={true} />
<Group style={this.getTextGroupStyle()} useBackingStore={true}>
<Text style={titleStyle}>{this.props.article.title}</Text>
<Text style={excerptStyle}>{this.props.article.excerpt}</Text>
</Group>
</Group>
);
},
// Styles
// ======
getGroupStyle: function () {
return {
top: 0,
left: 0,
width: this.props.width,
height: this.props.height,
};
},
getImageHeight: function () {
return Math.round(this.props.height * 0.5);
},
getImageStyle: function () {
return {
top: 0,
left: 0,
width: this.props.width,
height: this.getImageHeight(),
backgroundColor: '#eee',
zIndex: IMAGE_LAYER_INDEX
};
},
getTitleStyle: function () {
return {
top: this.getImageHeight() + CONTENT_INSET,
left: CONTENT_INSET,
width: this.props.width - 2 * CONTENT_INSET,
fontSize: 20,
lineHeight: 30,
fontFace: FontFace('Avenir Next Condensed, Helvetica, sans-serif', null, {weight: 500})
};
},
getExcerptStyle: function () {
return {
left: CONTENT_INSET,
width: this.props.width - 2 * CONTENT_INSET,
fontFace: FontFace('Georgia, serif'),
fontSize: 12,
lineHeight: 23
};
},
getTextGroupStyle: function () {
var imageHeight = this.getImageHeight();
var translateY = 0;
var alphaMultiplier = (this.props.scrollTop <= 0) ? -TEXT_ALPHA_SPEED_OUT_MULTIPLIER : TEXT_ALPHA_SPEED_IN_MULTIPLIER;
var alpha = 1 - (this.props.scrollTop / this.props.height) * alphaMultiplier;
alpha = Math.min(Math.max(alpha, 0), 1);
translateY = -this.props.scrollTop * TEXT_SCROLL_SPEED_MULTIPLIER;
return {
width: this.props.width,
height: this.props.height - imageHeight,
top: imageHeight,
left: 0,
alpha: alpha,
translateY: translateY,
zIndex: TEXT_LAYER_INDEX
};
}
});
module.exports = Page;
|
function initAngular() {
'use strict';
angular.bootstrap(document, ["motech-dashboard"]);
}
function loadModule(url, angularModules) {
'use strict';
$('#module-content').load(url, function() {
if (angularModules) {
angular.bootstrap(document, angularModules);
} else {
initAngular();
}
});
}
|
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length,
lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
export default insertWrapDetails;
|
Meteor.startup(function() {
RocketChat.settings.addGroup('Livechat');
RocketChat.settings.add('Livechat_title' , 'Rocket.Chat', { type: 'string', group: 'Livechat', public: true });
RocketChat.settings.add('Livechat_title_color' , '#C1272D', { type: 'string', group: 'Livechat', public: true });
});
|
(function () {
// Eagerly require cached-run-in-this-context to prevent a circular require
// when using `NativeCompileCache` for the first time.
require('cached-run-in-this-context')
const electron = require('electron')
const path = require('path')
const Module = require('module')
const getWindowLoadSettings = require('../src/get-window-load-settings')
const entryPointDirPath = __dirname
let blobStore = null
let useSnapshot = false
window.onload = function () {
try {
const startTime = Date.now()
process.on('unhandledRejection', function (error, promise) {
console.error('Unhandled promise rejection %o with error: %o', promise, error)
})
// Normalize to make sure drive letter case is consistent on Windows
process.resourcesPath = path.normalize(process.resourcesPath)
setupAtomHome()
const devMode = getWindowLoadSettings().devMode || !getWindowLoadSettings().resourcePath.startsWith(process.resourcesPath + path.sep)
useSnapshot = !devMode && typeof snapshotResult !== 'undefined'
if (devMode) {
const metadata = require('../package.json')
if (!metadata._deprecatedPackages) {
try {
metadata._deprecatedPackages = require('../script/deprecated-packages.json')
} catch (requireError) {
console.error('Failed to setup deprecated packages list', requireError.stack)
}
}
} else if (useSnapshot) {
Module.prototype.require = function (module) {
const absoluteFilePath = Module._resolveFilename(module, this, false)
let relativeFilePath = path.relative(entryPointDirPath, absoluteFilePath)
if (process.platform === 'win32') {
relativeFilePath = relativeFilePath.replace(/\\/g, '/')
}
let cachedModule = snapshotResult.customRequire.cache[relativeFilePath]
if (!cachedModule) {
cachedModule = {exports: Module._load(module, this, false)}
snapshotResult.customRequire.cache[relativeFilePath] = cachedModule
}
return cachedModule.exports
}
snapshotResult.setGlobals(global, process, window, document, console, require)
}
const FileSystemBlobStore = useSnapshot ? snapshotResult.customRequire('../src/file-system-blob-store.js') : require('../src/file-system-blob-store')
blobStore = FileSystemBlobStore.load(path.join(process.env.ATOM_HOME, 'blob-store'))
const NativeCompileCache = useSnapshot ? snapshotResult.customRequire('../src/native-compile-cache.js') : require('../src/native-compile-cache')
NativeCompileCache.setCacheStore(blobStore)
NativeCompileCache.setV8Version(process.versions.v8)
NativeCompileCache.install()
if (getWindowLoadSettings().profileStartup) {
profileStartup(Date.now() - startTime)
} else {
setupWindow()
setLoadTime(Date.now() - startTime)
}
} catch (error) {
handleSetupError(error)
}
}
function setLoadTime (loadTime) {
if (global.atom) {
global.atom.loadTime = loadTime
}
}
function handleSetupError (error) {
const currentWindow = electron.remote.getCurrentWindow()
currentWindow.setSize(800, 600)
currentWindow.center()
currentWindow.show()
currentWindow.openDevTools()
console.error(error.stack || error)
}
function setupWindow () {
const CompileCache = useSnapshot ? snapshotResult.customRequire('../src/compile-cache.js') : require('../src/compile-cache')
CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME)
CompileCache.install(process.resourcesPath, require)
const ModuleCache = useSnapshot ? snapshotResult.customRequire('../src/module-cache.js') : require('../src/module-cache')
ModuleCache.register(getWindowLoadSettings())
const startCrashReporter = useSnapshot ? snapshotResult.customRequire('../src/crash-reporter-start.js') : require('../src/crash-reporter-start')
startCrashReporter({_version: getWindowLoadSettings().appVersion})
const CSON = useSnapshot ? snapshotResult.customRequire('../node_modules/season/lib/cson.js') : require('season')
CSON.setCacheDir(path.join(CompileCache.getCacheDirectory(), 'cson'))
const initScriptPath = path.relative(entryPointDirPath, getWindowLoadSettings().windowInitializationScript)
const initialize = useSnapshot ? snapshotResult.customRequire(initScriptPath) : require(initScriptPath)
return initialize({blobStore: blobStore}).then(function () {
electron.ipcRenderer.send('window-command', 'window:loaded')
})
}
function profileStartup (initialTime) {
function profile () {
console.profile('startup')
const startTime = Date.now()
setupWindow().then(function () {
setLoadTime(Date.now() - startTime + initialTime)
console.profileEnd('startup')
console.log('Switch to the Profiles tab to view the created startup profile')
})
}
const webContents = electron.remote.getCurrentWindow().webContents
if (webContents.devToolsWebContents) {
profile()
} else {
webContents.once('devtools-opened', () => { setTimeout(profile, 1000) })
webContents.openDevTools()
}
}
function setupAtomHome () {
if (process.env.ATOM_HOME) {
return
}
// Ensure ATOM_HOME is always set before anything else is required
// This is because of a difference in Linux not inherited between browser and render processes
// https://github.com/atom/atom/issues/5412
if (getWindowLoadSettings() && getWindowLoadSettings().atomHome) {
process.env.ATOM_HOME = getWindowLoadSettings().atomHome
}
}
})()
|
var _ = require('lodash');
var valueFactory = require('../factory/value.js');
var Base = require('./Base');
/**
* Object expression token (e.g. `{ a: "foo"}`)
* @class
* @param {Object} node AST ObjectExpression token
*/
var ObjectExpression = module.exports = Base.extend({
constructor: function (node) {
this.type = 'ObjectExpression';
this.node = node;
},
/**
* Get a key value object or create a blank placeholder
* @param {String} name key name
* @return {Object} value
*/
key: function (name) {
var node = _.filter(this.node.properties, function (prop) {
return prop.key.name === name || prop.key.raw === name;
})[0];
// If key doesn't exist, create one
if (!node) {
node = {
type: 'Property',
key: { type: 'Identifier', name: name },
value: { type: 'ObjectExpression', properties: [] },
kind: 'init',
TEMP: true
};
Object.defineProperty(node.value, 'TEMP', {
get: function () {
return true;
},
set: function () {
delete node.TEMP;
}
});
this.node.properties.push(node);
}
return valueFactory.wrap(node.value);
},
/**
* Replace node with new value
* @param {String} value
* @return {Object} New value object
*/
value: function (value) {
var val = valueFactory.create(value);
// As we don't keep reference to the parent, just update properties so the object stay
// the same reference.
delete this.node.property;
delete this.node.type;
this.node.TEMP = false;
_.extend(this.node, val);
return valueFactory.wrap(this.node);
}
});
|
(function (angular, $, _) {
angular.module('crmCxn', CRM.angRequires('crmCxn'));
angular.module('crmCxn').config([
'$routeProvider',
function ($routeProvider) {
$routeProvider.when('/cxn', {
templateUrl: '~/crmCxn/ManageCtrl.html',
controller: 'CrmCxnManageCtrl',
resolve: {
apiCalls: function(crmApi){
var reqs = {};
reqs.cxns = ['Cxn', 'get', {sequential: 1}];
reqs.appMetas = ['CxnApp', 'get', {sequential: 1, return: ['id', 'title', 'desc', 'appId', 'appUrl', 'links', 'perm']}];
reqs.cfg = ['Cxn', 'getcfg', {}];
reqs.sysCheck = ['System', 'check', {}]; // FIXME: filter on checkCxnOverrides
return crmApi(reqs);
}
}
});
}
]);
})(angular, CRM.$, CRM._);
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gTestfile = 'regress-474769.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 474769;
var summary = 'TM: nested for each type-unstable loops';
var actual = '';
var expect = '';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
expect = 1;
jit(true);
for each (b in [1, 1, 1, 1.5, 1, 1]) {
(function() { for each (let h in [0, 0, 1.4, ""]) {} })();
}
actual = b;
jit(false);
reportCompare(expect, actual, summary);
exitFunc ('test');
}
|
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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/. */
gTestfile = '11.2.2.js';
START("11.2.2 - Function Calls");
rectangle = <rectangle>
<x>50</x>
<y>75</y>
<length>20</length>
<width>30</width>
</rectangle>;
TEST(1, 1, rectangle.length());
TEST(2, <length>20</length>, rectangle.length);
shipto = <shipto>
<name>Fred Jones</name>
<street>123 Foobar Ave.</street>
<citystatezip>Redmond, WA, 98008</citystatezip>
</shipto>;
upperName = shipto.name.toUpperCase();
TEST(3, "FRED JONES", upperName);
upperName = shipto.name.toString().toUpperCase();
TEST(4, "FRED JONES", upperName);
upperName = shipto.name.toUpperCase();
TEST(5, "FRED JONES", upperName);
citystatezip = shipto.citystatezip.split(", ");
state = citystatezip[1];
TEST(6, "WA", state);
zip = citystatezip[2];
TEST(7, "98008", zip);
citystatezip = shipto.citystatezip.toString().split(", ");
state = citystatezip[1];
TEST(8, "WA", state);
zip = citystatezip[2];
TEST(9, "98008", zip);
// Test method name/element name conflicts
x =
<alpha>
<name>Foo</name>
<length>Bar</length>
</alpha>;
TEST(10, <name>Foo</name>, x.name);
TEST(11, QName("alpha"), x.name());
TEST(12, <length>Bar</length>, x.length);
TEST(13, 1, x.length());
TEST(14, x, x.(name == "Foo"));
x.name = "foobar";
TEST(15, <name>foobar</name>, x.name);
TEST(16, QName("alpha"), x.name());
END();
|
document.on('click', 'div.date_picker', function(e, element) {
var field = element.down('input')
var label = element.down('span')
var parentDiv = element.up('div')
var date_picker = DatePicker.initialize(field, label, parentDiv);
if (element.hasClassName("show_urgent")) {
DatePicker.add_urgent_box(date_picker, element, field, label, parentDiv);
}
});
DatePicker = {
initialize: function(field, label, parentDiv) {
return(new CalendarDateSelect(field, {
buttons: true,
time: false,
year_range: 10,
embedded: false,
close_on_click: true,
popup_by: parentDiv,
onchange: function() {
selected_date = this.calendar_date_select.selected_date
if ( /[\d]{4}-[\d]{1,2}-[\d]{1,2}\s[\d]{1,2}:[\d]{1,2}/.test(this.value) == true ) {
localized_format = I18n.translations.time.formats.long
localized_time = selected_date.strftime(localized_format)
} else if ( /[\d]{4}-[\d]{1,2}-[\d]{1,2}/.test(this.value) == true ) {
localized_format = I18n.translations.date.formats.long
localized_time = selected_date.strftime(localized_format)
} else {
localized_time = this.value
}
label.update(localized_time || I18n.translations.date_picker.no_date_assigned);
}
}));
},
add_urgent_box: function(date_picker, element, field, label, parentDiv) {
// Render custom urgent box on calendar's top DIV
var urgent_field = field.parentNode.down("input.urgent");
var html = Mustache.to_html(Templates.tasks.calendar_date_select_urgent_header, {
task_id: element.id.split("_")[1]
});
date_picker.top_div.update(html);
// Link toggler for help info
date_picker.top_div.down(".show-help").observe("click", function(event) {
date_picker.top_div.down(".help").toggle();
event.stop();
});
// On urgent checkbox changes update task[urgent] and show/hide sections accordingly
var update_urgent_box = function (date_picker, input_urgent, user_action) {
urgent_field.value = input_urgent.checked ? "1" : "0";
urgent_field.removeAttribute("disabled");
if (input_urgent.checked) {
label.update(I18n.translations.date_picker.urgent.short);
} else if (user_action) {
date_picker.clearDate();
date_picker.callback("onchange");
label.update(I18n.translations.date_picker.no_date_assigned);
}
if (user_action && input_urgent.checked) {
date_picker.close();
} else {
date_picker.calendar_div.select("> div").each(function(div) {
if (!div.hasClassName("cds_top")) {
div[input_urgent.checked ? "hide" : "show"]();
}
});
}
date_picker.positionCalendarDiv();
}
var input_urgent = date_picker.top_div.down("input.urgent")
input_urgent.checked = (urgent_field.value == "1");
update_urgent_box(date_picker, input_urgent, false);
input_urgent.observe("click", function() {
update_urgent_box(date_picker, this, true);
});
}
}
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'fa', {
anchor: 'لنگر',
flash: 'انیمشن فلش',
hiddenfield: 'فیلد پنهان',
iframe: 'IFrame',
unknown: 'شیء ناشناخته'
} );
|
/**
* Copyright 2016 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Observable} from '../src/observable';
import {map} from '../src/utils/object';
import {
listen,
serializeMessage,
deserializeMessage,
} from '../src/3p-frame-messaging';
import {getData} from '../src/event-helper';
import {getMode} from '../src/mode';
import {dev} from '../src/log';
export class IframeMessagingClient {
/**
* @param {!Window} win A window object.
*/
constructor(win) {
/** @private {!Window} */
this.win_ = win;
/** @private {?string} */
this.rtvVersion_ = getMode().rtvVersion || null;
/** @private {!Window} */
this.hostWindow_ = win.parent;
/** @private {?string} */
this.sentinel_ = null;
/**
* Map messageType keys to observables to be fired when messages of that
* type are received.
* @private {!Object}
*/
this.observableFor_ = map();
this.setupEventListener_();
}
/**
* Make an event listening request to the host window.
*
* @param {string} requestType The type of the request message.
* @param {string} responseType The type of the response message.
* @param {function(Object)} callback The callback function to call
* when a message with type responseType is received.
*/
makeRequest(requestType, responseType, callback) {
const unlisten = this.registerCallback(responseType, callback);
this.sendMessage(requestType);
return unlisten;
}
/**
* Make a one time event listening request to the host window.
* Will unlisten after response is received
*
* @param {string} requestType The type of the request message.
* @param {string} responseType The type of the response message.
* @param {function(Object)} callback The callback function to call
* when a message with type responseType is received.
*/
requestOnce(requestType, responseType, callback) {
const unlisten = this.registerCallback(responseType, event => {
unlisten();
callback(event);
});
this.sendMessage(requestType);
return unlisten;
}
/**
* Register callback function for message with type messageType.
* As it stands right now, only one callback can exist at a time.
* All future calls will overwrite any previously registered
* callbacks.
* @param {string} messageType The type of the message.
* @param {function(?JsonObject)} callback The callback function to call
* when a message with type messageType is received.
*/
registerCallback(messageType, callback) {
// NOTE : no validation done here. any callback can be register
// for any callback, and then if that message is received, this
// class *will execute* that callback
return this.getOrCreateObservableFor_(messageType).add(callback);
}
/**
* Send a postMessage to Host Window
* @param {string} type The type of message to send.
* @param {JsonObject=} opt_payload The payload of message to send.
*/
sendMessage(type, opt_payload) {
this.hostWindow_.postMessage/*OK*/(
serializeMessage(
type, dev().assertString(this.sentinel_),
opt_payload, this.rtvVersion_),
'*');
}
/**
* Sets up event listener for post messages of the desired type.
* The actual implementation only uses a single event listener for all of
* the different messages, and simply diverts the message to be handled
* by different callbacks.
* To add new messages to listen for, call registerCallback with the
* messageType to listen for, and the callback function.
* @private
*/
setupEventListener_() {
listen(this.win_, 'message', event => {
// Does it look a message from AMP?
if (event.source != this.hostWindow_) {
return;
}
const message = deserializeMessage(getData(event));
if (!message || message['sentinel'] != this.sentinel_) {
return;
}
this.fireObservable_(message['type'], message);
});
}
/**
* @param {!Window} win
*/
setHostWindow(win) {
this.hostWindow_ = win;
}
/**
* @param {string} sentinel
*/
setSentinel(sentinel) {
this.sentinel_ = sentinel;
}
/**
* @param {string} messageType
* @return {!Observable<?JsonObject>}
*/
getOrCreateObservableFor_(messageType) {
if (!(messageType in this.observableFor_)) {
this.observableFor_[messageType] = new Observable();
}
return this.observableFor_[messageType];
}
/**
* @param {string} messageType
* @param {Object} message
*/
fireObservable_(messageType, message) {
if (messageType in this.observableFor_) {
this.observableFor_[messageType].fire(message);
}
}
}
|
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('element/locale/hy-AM', ['module', 'exports'], factory);
} else if (typeof exports !== "undefined") {
factory(module, exports);
} else {
var mod = {
exports: {}
};
factory(mod, mod.exports);
global.ELEMENT.lang = global.ELEMENT.lang || {};
global.ELEMENT.lang.hyAM = mod.exports;
}
})(this, function (module, exports) {
'use strict';
exports.__esModule = true;
exports.default = {
el: {
colorpicker: {
confirm: 'Լաւ',
clear: 'Մաքրել'
},
datepicker: {
now: 'Հիմա',
today: 'Այսօր',
cancel: 'Չեղարկել',
clear: 'Մաքրել',
confirm: 'Լաւ',
selectDate: 'Ընտրեք ամսաթիւը',
selectTime: 'Ընտրեք ժամանակը',
startDate: 'Սկզբ. ամսաթիւը',
startTime: 'Սկզբ. ժամանակը',
endDate: 'Վերջ. ամսաթիվը',
endTime: 'Վերջ. ժամանակը',
prevYear: 'Նախորդ տարի',
nextYear: 'Յաջորդ տարի',
prevMonth: 'Նախորդ ամիս',
nextMonth: 'Յաջորդ ամիս',
year: 'Տարի',
month1: 'Յունուար',
month2: 'Փետրուար',
month3: 'Մարտ',
month4: 'Ապրիլ',
month5: 'Մայիս',
month6: 'Յունիս',
month7: 'Յուլիս',
month8: 'Օգոստոս',
month9: 'Սեպտեմբեր',
month10: 'Յոկտեմբեր',
month11: 'Նոյեմբեր',
month12: 'Դեկտեմբեր',
week: 'Շաբաթ',
weeks: {
sun: 'Կիր',
mon: 'Երկ',
tue: 'Եր',
wed: 'Չոր',
thu: 'Հինգ',
fri: 'Ուրբ',
sat: 'Շաբ'
},
months: {
jan: 'Յունվ',
feb: 'Փետ',
mar: 'Մար',
apr: 'Ապր',
may: 'Մայ',
jun: 'Յուն',
jul: 'Յուլ',
aug: 'Օգ',
sep: 'Սեպտ',
oct: 'Յոկ',
nov: 'Նոյ',
dec: 'Դեկ'
}
},
select: {
loading: 'Բեռնում',
noMatch: 'Համապատասխան տուեալներ չկան',
noData: 'Տվյալներ չկան',
placeholder: 'Ընտրել'
},
cascader: {
noMatch: 'Համապատասխան տուեալներ չկան',
loading: 'Բեռնում',
placeholder: 'Ընտրել'
},
pagination: {
goto: 'Անցնել',
pagesize: ' էջում',
total: 'Ընդամենը {total}',
pageClassifier: ''
},
messagebox: {
title: 'Հաղորդագրութիւն',
confirm: 'Լաւ',
cancel: 'Չեղարկել',
error: 'Անվաւեր տուեալների մուտք'
},
upload: {
deleteTip: 'Սեղմեք [Ջնջել] ջնջելու համար',
delete: 'Ջնջել',
preview: 'Նախադիտում',
continue: 'Շարունակել'
},
table: {
emptyText: 'Տուեալներ չկան',
confirmFilter: 'Յաստատել',
resetFilter: 'Վերագործարկել',
clearFilter: 'Բոլորը',
sumText: 'Գումարը'
},
tree: {
emptyText: 'Տուեալներ չկան'
},
transfer: {
noMatch: 'Համապատասխան տուեալներ չկան',
noData: 'Տուեալներ չկան',
titles: ['Ցուցակ 1', 'Ցուցակ 2'],
filterPlaceholder: 'Մուտքագրեք բանալի բառ',
noCheckedFormat: '{total} միաւոր',
hasCheckedFormat: '{checked}/{total} ընտրուած է'
},
image: {
error: 'FAILED' // to be translated
}
}
};
module.exports = exports['default'];
});
|
import Vue from 'vue'
import { UA } from 'core/util/env'
import testObjectOption from '../../../helpers/test-object-option'
describe('Options components', () => {
testObjectOption('components')
it('should accept plain object', () => {
const vm = new Vue({
template: '<test></test>',
components: {
test: {
template: '<div>hi</div>'
}
}
}).$mount()
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('should accept extended constructor', () => {
const Test = Vue.extend({
template: '<div>hi</div>'
})
const vm = new Vue({
template: '<test></test>',
components: {
test: Test
}
}).$mount()
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('should accept camelCase', () => {
const myComp = {
template: '<div>hi</div>'
}
const vm = new Vue({
template: '<my-comp></my-comp>',
components: {
myComp
}
}).$mount()
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('should accept PascalCase', () => {
const MyComp = {
template: '<div>hi</div>'
}
const vm = new Vue({
template: '<my-comp></my-comp>',
components: {
MyComp
}
}).$mount()
expect(vm.$el.tagName).toBe('DIV')
expect(vm.$el.textContent).toBe('hi')
})
it('should warn native HTML elements', () => {
new Vue({
components: {
div: { template: '<div></div>' }
}
})
expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
})
it('should warn built-in elements', () => {
new Vue({
components: {
component: { template: '<div></div>' }
}
})
expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
})
// the HTMLUnknownElement check doesn't work in Android 4.2
// but since it doesn't support custom elements nor will any dev use it
// as their primary debugging browser, it doesn't really matter.
if (!(UA && /android 4\.2/.test(UA))) {
it('warn non-existent', () => {
new Vue({
template: '<test></test>'
}).$mount()
expect('Unknown custom element: <test>').toHaveBeenWarned()
})
}
})
|
var utils = require("../lib/utils.js");
exports.server2_proxy_test = {
setUp: function(done) {
// setup here if necessary
done();
},
proxy_options_test: function(test) {
test.expect(10);
var proxies = utils.proxies();
test.equal(proxies.length, 6, 'should return six valid proxies');
test.notEqual(proxies[0].server, null, 'server should be configured');
test.equal(proxies[0].config.context, '/defaults', 'should have context set from config');
test.equal(proxies[0].config.host, 'www.defaults.com', 'should have host set from config');
test.equal(proxies[5].config.context, '/', 'should have context set from config');
test.equal(proxies[5].config.host, 'www.server2.com', 'should have host set from config');
test.equal(proxies[0].config.port, 80, 'should have default port 80');
test.equal(proxies[0].config.https, false, 'should have default http');
test.equal(proxies[0].config.ws, false, 'should have default ws to false');
test.equal(proxies[0].config.rules.length, 0, 'rules array should have zero items');
test.done();
}
}
|
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'pt-br', {
button: 'Configure o Idioma',
remove: 'Remover Idioma'
} );
|
/*global jQuery */
/*jshint browser:true */
/*!
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
*/
(function( $ ){
"use strict";
$.fn.fitVids = function( options ) {
var settings = {
customSelector: null,
ignore: null,
};
if(!document.getElementById('fit-vids-style')) {
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
var head = document.head || document.getElementsByTagName('head')[0];
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
var div = document.createElement('div');
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
head.appendChild(div.childNodes[1]);
}
if ( options ) {
$.extend( settings, options );
}
return this.each(function(){
var selectors = [
"iframe[src*='player.vimeo.com']",
"iframe[src*='youtube.com']",
"iframe[src*='youtube-nocookie.com']",
"iframe[src*='kickstarter.com'][src*='video.html']",
"object",
"embed"
];
if (settings.customSelector) {
selectors.push(settings.customSelector);
}
var ignoreList = '.fitvidsignore';
if(settings.ignore) {
ignoreList = ignoreList + ', ' + settings.ignore;
}
var $allVideos = $(this).find(selectors.join(','));
$allVideos = $allVideos.not("object object"); // SwfObj conflict patch
$allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
$allVideos.each(function(){
var $this = $(this);
if($this.parents(ignoreList).length > 0) {
return; // Disable FitVids on this video.
}
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
{
$this.attr('height', 9);
$this.attr('width', 16);
}
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
aspectRatio = height / width;
if(!$this.attr('id')){
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
$this.attr('id', videoID);
}
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
$this.removeAttr('height').removeAttr('width');
});
});
};
// Works with either jQuery or Zepto
})( window.jQuery || window.Zepto );
|
/**
* Copyright (c) 2015, Arthur Schiwon <blizzz@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
OCA = OCA || {};
(function() {
/**
* @classdesc a Port Detector. It executes the auto-detection of the port
* by the ownCloud server, if requirements are met.
*
* @constructor
*/
var WizardDetectorTestConfiguration = OCA.LDAP.Wizard.WizardDetectorTestAbstract.subClass({
/** @inheritdoc */
init: function() {
// given, it is not a configuration key
this.setTargetKey('ldap_action_test_connection');
this.testName = 'TestConfiguration';
this.isLegacy = true;
this.legacyDestination = 'testConfiguration.php';
this.runsOnRequest = true;
}
});
OCA.LDAP.Wizard.WizardDetectorTestConfiguration = WizardDetectorTestConfiguration;
})();
|
/* Copyright 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.
*/
/**
* @fileoverview
* The sandbox isn't allowed to make XHRs, so they have to be proxied to the
* main process. The XMLHttpRequestProxy class is API-compatible with the
* XMLHttpRequest class, but forwards the requests to the main process where
* they can be serviced. The forwarding of XHRs and responses is handled by
* the WcsSandboxContent class; this class is just a thin wrapper to hook XHR
* creations by JS running in the sandbox.
*
* Because XMLHttpRequest is implemented natively, and because the intent is
* to replace its functionality entirely, prototype linking is not a suitable
* approach here, so much of the interface definition is duplicated from the
* w3c specification: http://www.w3.org/TR/XMLHttpRequest
*/
'use strict';
/** @suppress {duplicate} */
var remoting = remoting || {};
/**
* @constructor
* @extends {XMLHttpRequest}
*/
remoting.XMLHttpRequestProxy = function() {
/**
* @type {{headers: Object}}
*/
this.sandbox_ipc = {
headers: {}
};
/**
* @type {number}
* @private
*/
this.xhr_id_ = -1;
};
remoting.XMLHttpRequestProxy.prototype.open = function(
method, url, async, user, password) {
if (!async) {
console.warn('Synchronous XHRs are not supported.');
}
this.sandbox_ipc.method = method;
this.sandbox_ipc.url = url.toString();
this.sandbox_ipc.user = user;
this.sandbox_ipc.password = password;
};
remoting.XMLHttpRequestProxy.prototype.send = function(data) {
if (remoting.sandboxContent) {
this.sandbox_ipc.data = data;
this.xhr_id_ = remoting.sandboxContent.sendXhr(this);
}
};
remoting.XMLHttpRequestProxy.prototype.setRequestHeader = function(
header, value) {
this.sandbox_ipc.headers[header] = value;
};
remoting.XMLHttpRequestProxy.prototype.abort = function() {
if (this.xhr_id_ != -1) {
remoting.sandboxContent.abortXhr(this.xhr_id_);
}
};
remoting.XMLHttpRequestProxy.prototype.getResponseHeader = function(header) {
console.error('Sandbox: unproxied getResponseHeader(' + header + ') called.');
};
remoting.XMLHttpRequestProxy.prototype.getAllResponseHeaders = function() {
console.error('Sandbox: unproxied getAllResponseHeaders called.');
};
remoting.XMLHttpRequestProxy.prototype.overrideMimeType = function() {
console.error('Sandbox: unproxied overrideMimeType called.');
};
remoting.XMLHttpRequestProxy.prototype.UNSENT = 0;
remoting.XMLHttpRequestProxy.prototype.OPENED = 1;
remoting.XMLHttpRequestProxy.prototype.HEADERS_RECEIVED = 2;
remoting.XMLHttpRequestProxy.prototype.LOADING = 3;
remoting.XMLHttpRequestProxy.prototype.DONE = 4;
// Since the WCS driver code constructs XHRs directly, the only mechanism for
// proxying them is to replace the XMLHttpRequest constructor.
//XMLHttpRequest = remoting.XMLHttpRequestProxy;
|
var ToDoDemo = window.ToDoDemo || {}
ToDoDemo.Model = {
getAll: function(fnSuccess, fnFail) {
$.ajax({
url: ToDoDemo.serverRoot + "/items",
type:'GET',
success: function(oData, strStatus, jqXHR) {
var oParsed = JSON.parse(oData);
fnSuccess(oParsed);
},
error: function(jqXHR, strStatus, strErrorThrown) {
fnFail(strErrorThrown);
}
});
},
addItem: function(oItem, fnSuccess, fnFail) {
$.ajax({
url: ToDoDemo.serverRoot + "/items",
type:'POST',
contentType: 'application/json',
dataType:"json",
data: JSON.stringify(oItem),
success: function() {
fnSuccess();
},
error: function(jqXHR, strStatus, strErrorThrown) {
fnFail(strErrorThrown);
}
});
},
deleteItem: function(numId, fnSuccess, fnFail) {
$.ajax({
url: ToDoDemo.serverRoot + "/items/" + numId,
type:'DELETE',
success: function(oData, strStatus, jqXHR) {
fnSuccess();
},
error: function(jqXHR, strStatus, strErrorThrown) {
fnFail(strErrorThrown);
}
});
},
updateItem: function(oItem, fnSuccess, fnFail) {
$.ajax({
url: ToDoDemo.serverRoot + "/items",
type:'PUT',
contentType: 'application/json',
dataType:"json",
data: JSON.stringify(oItem),
success: function() {
fnSuccess();
},
error: function(jqXHR, strStatus, strErrorThrown) {
fnFail(strErrorThrown);
}
});
}
}
|
// # Bad request error
// Custom error class with status code and type prefilled.
function BadRequestError(message) {
this.message = message;
this.stack = new Error().stack;
this.code = 400;
this.type = this.name;
}
BadRequestError.prototype = Object.create(Error.prototype);
BadRequestError.prototype.name = "BadRequestError";
module.exports = BadRequestError;
|
var i18n = $.extend({}, i18n || {}, {
datepicker: {
dateformat: {
"fulldayvalue": "yyyy-M-d",
"separator": "-",
"year_index": 0,
"month_index": 1,
"day_index": 2,
"sun": "日",
"mon": "一",
"tue": "二",
"wed": "三",
"thu": "四",
"fri": "五",
"sat": "六",
"jan": "一",
"feb": "二",
"mar": "三",
"apr": "四",
"may": "五",
"jun": "六",
"jul": "七",
"aug": "八",
"sep": "九",
"oct": "十",
"nov": "十一",
"dec": "十二",
"postfix":"月"
},
ok: " 確定 ",
cancel: " 取消 ",
today: "今天",
prev_month_title:"上一月",
next_month_title:"下一月"
}
});
|
"use strict";
var user = require('../../user'),
meta = require('../../meta');
var usersController = {};
usersController.search = function(req, res, next) {
res.render('admin/manage/users', {
search_display: '',
loadmore_display: 'hide',
users: []
});
};
usersController.sortByPosts = function(req, res, next) {
getUsers('users:postcount', req, res, next);
};
usersController.sortByReputation = function(req, res, next) {
getUsers('users:reputation', req, res, next);
};
usersController.sortByJoinDate = function(req, res, next) {
getUsers('users:joindate', req, res, next);
};
usersController.banned = function(req, res, next) {
getUsers('users:banned', req, res, next);
};
function getUsers(set, req, res, next) {
user.getUsersFromSet(set, req.uid, 0, 49, function(err, users) {
if (err) {
return next(err);
}
users = users.filter(function(user) {
return user && parseInt(user.uid, 10);
});
res.render('admin/manage/users', {
search_display: 'hidden',
loadmore_display: 'block',
users: users,
yourid: req.uid,
requireEmailConfirmation: parseInt(meta.config.requireEmailConfirmation, 10) === 1
});
});
}
usersController.getCSV = function(req, res, next) {
user.getUsersCSV(function(err, data) {
if (err) {
return next(err);
}
res.attachment('users.csv');
res.setHeader('Content-Type', 'text/csv');
res.end(data);
});
};
module.exports = usersController;
|
//// [collisionThisExpressionAndModuleInGlobal.ts]
module _this { //Error
class c {
}
}
var f = () => this;
//// [collisionThisExpressionAndModuleInGlobal.js]
var _this_1 = this;
var _this;
(function (_this) {
var c = /** @class */ (function () {
function c() {
}
return c;
}());
})(_this || (_this = {}));
var f = function () { return _this_1; };
|
//// [tests/cases/compiler/es6ImportEqualsDeclaration.ts] ////
//// [server.ts]
var a = 10;
export = a;
//// [client.ts]
import a = require("server");
//// [server.js]
var a = 10;
//// [client.js]
|
'use strict';
var $ = require('jquery');
var ko = require('knockout');
require('knockout.validation');
var $osf = require('./osfHelpers');
var citations = require('./citations');
var bootbox = require('bootbox');
var oop = require('js/oop');
var makeClient = require('js/clipboard');
var BASE_URL = '/static/vendor/bower_components/styles/';
var STYLES = {
apa: 'apa.csl',
mla: 'modern-language-association.csl',
chicago: 'chicago-author-date.csl'
};
var ctx = window.contextVars;
var formatCitation = function(style, data, format) {
var citeproc = citations.makeCiteproc(style, data, format);
return citeproc.makeBibliography()[1];
};
var ViewModel = oop.defclass({
constructor: function() {
var self = this;
self.loading = ko.observable(true);
self.customCitation = ko.observable('');
self.initialCustomCitation = ko.observable();
self.apa = ko.observable();
self.mla = ko.observable();
self.chicago = ko.observable();
self.showEdit = ko.observable(false);
self.page = ko.computed(function () {
if(self.loading()){
return 'loading';
} else if(self.showEdit()) {
return 'edit';
} else if(self.customCitation() === '') {
return 'standard';
} else {
return 'custom';
}
});
self.nodeType = ko.computed(function () {
return ctx.node.isRegistration ? 'registrations' : 'nodes';
});
self.disableRemove = ko.computed(function () {
return self.initialCustomCitation() === '';
});
self.disableSave = ko.computed(function () {
return self.customCitation() === '' || self.initialCustomCitation() === self.customCitation();
});
makeClient($('#custom-citation-copy-button')[0]);
},
showEditBox: function() {
var self = this;
self.showEdit(true);
self.initialCustomCitation(self.customCitation());
},
cancelCitation: function() {
var self = this;
self.showEdit(false);
self.customCitation(self.initialCustomCitation());
},
saveCitation: function() {
var self = this;
self.loading(true);
self.updateCustomCitation();
},
clearCitation: function() {
var self = this;
if(self.customCitation() !== '') {
self.customCitation('');
self.loading(true);
self.updateCustomCitation();
} else {
self.showEdit(false);
}
},
updateCustomCitation: function() {
var self = this;
var payload = {
'data': {
'id' : ctx.node.id,
'type' : self.nodeType(),
'attributes' : {
'custom_citation': self.customCitation()
}
}
};
self.showEdit(false);
$osf.ajaxJSON(
'PATCH',
ctx.apiV2Prefix + self.nodeType() + '/' + ctx.node.id + '/',
{
isCors: true,
data: payload
}
).done(function(data) {
if (!self.customCitation()) {
self.fetch();
}
}).fail(function() {
$osf.growl('Error', 'Your custom citation not updated. Please refresh the page and try ' +
'again or contact ' + $osf.osfSupportLink() + ' if the problem persists.', 'danger');
}).always(function() {
self.loading(false);
});
},
fetch: function() {
var self = this;
$osf.ajaxJSON(
'GET',
ctx.apiV2Prefix + self.nodeType() + '/' + ctx.node.id + '/',
{isCors: true}
).done(function(data) {
self.customCitation($osf.htmlDecode(data.data.attributes.custom_citation));
if(!self.customCitation()) {
var citationRequest = $.ajax(ctx.node.urls.api + 'citation/');
var styleRequests = [
$.ajax(BASE_URL + STYLES.apa),
$.ajax(BASE_URL + STYLES.mla),
$.ajax(BASE_URL + STYLES.chicago)
];
var requests = [citationRequest].concat(styleRequests);
$.when.apply(self, requests).done(function(data, apa, mla, chicago) {
self.apa(formatCitation(apa[0], data[0], 'text'));
self.mla(formatCitation(mla[0], data[0], 'text'));
self.chicago(formatCitation(chicago[0], data[0], 'text'));
});
}
}).fail(function() {
console.log('Could not load citations');
}).always(function() {
self.loading(false);
});
}
});
var CitationList = function(selector) {
this.viewModel = new ViewModel();
$osf.applyBindings(this.viewModel, selector);
this.viewModel.fetch();
};
module.exports = CitationList;
|
/*---
{
"custom": true
}
---*/
/*===
string [object String]
object [object String]
buffer [object Buffer]
object [object Buffer]
pointer [object Pointer]
object [object Pointer]
===*/
function test() {
var plain_str = 'foo'; // string is for comparison
var obj_str = new String(plain_str);
var plain_buf = Duktape.dec('hex', '666f6f');
var obj_buf = new Duktape.Buffer(plain_buf);
var plain_ptr = Duktape.Pointer('foo'); // dummy ptr
var obj_ptr = new Duktape.Pointer(plain_ptr);
function f(v) {
print(typeof v, Object.prototype.toString.call(v));
}
f(plain_str);
f(obj_str);
f(plain_buf);
f(obj_buf);
f(plain_ptr);
f(obj_ptr);
}
try {
test();
} catch (e) {
print(e.stack || e);
}
|
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define("my custom module name", ["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
} else {
var mod = {
exports: {}
};
factory(mod.exports);
global.foo = global.foo || {};
global.foo.bar = mod.exports;
}
})(this, function (exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = 42;
});
|
/*
* jQuery UI Effects Fold 1.8.6
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Fold
*
* Depends:
* jquery.effects.core.js
*/
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100*
f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
|
import { Meteor } from "meteor/meteor";
import { Roles } from "meteor/alanning:roles";
import { expect } from "meteor/practicalmeteor:chai";
import { sinon } from "meteor/practicalmeteor:sinon";
import { Discounts } from "/imports/plugins/core/discounts/lib/collections";
const code = {
discount: 12,
label: "Discount 5",
description: "Discount by 5%",
discountMethod: "code",
code: "promocode"
};
before(function () {
this.timeout(10000);
Meteor._sleepForMs(7000);
});
describe("discount code methods", function () {
let sandbox;
beforeEach(function () {
sandbox = sinon.sandbox.create();
});
afterEach(function () {
sandbox.restore();
});
describe("discounts/addCode", function () {
it("should throw 403 error with discounts permission", function (done) {
sandbox.stub(Roles, "userIsInRole", () => false);
// this should actually trigger a whole lot of things
expect(() => Meteor.call("discounts/addCode", code)).to.throw(Meteor.Error, /Access Denied/);
return done();
});
// admin user
it("should add code when user has role", function (done) {
sandbox.stub(Roles, "userIsInRole", () => true);
const discountInsertSpy = sandbox.spy(Discounts, "insert");
const discountId = Meteor.call("discounts/addCode", code);
expect(discountInsertSpy).to.have.been.called;
Meteor._sleepForMs(500);
const discountCount = Discounts.find(discountId).count();
expect(discountCount).to.equal(1);
return done();
});
});
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* The production x *= y is the same as the production x = x * y
*
* @path ch11/11.13/11.13.2/S11.13.2_A4.1_T1.3.js
* @description Type(x) and Type(y) vary between primitive string and String object
*/
//CHECK#1
x = "1";
x *= "1";
if (x !== 1) {
$ERROR('#1: x = "1"; x *= "1"; x === 1. Actual: ' + (x));
}
//CHECK#2
x = new String("1");
x *= "1";
if (x !== 1) {
$ERROR('#2: x = new String("1"); x *= "1"; x === 1. Actual: ' + (x));
}
//CHECK#3
x = "1";
x *= new String("1");
if (x !== 1) {
$ERROR('#3: x = "1"; x *= new String("1"); x === 1. Actual: ' + (x));
}
//CHECK#4
x = new String("1");
x *= new String("1");
if (x !== 1) {
$ERROR('#4: x = new String("1"); x *= new String("1"); x === 1. Actual: ' + (x));
}
//CHECK#5
x = "x";
x *= "1";
if (isNaN(x) !== true) {
$ERROR('#5: x = "x"; x *= "1"; x === Not-a-Number. Actual: ' + (x));
}
//CHECK#6
x = "1";
x *= "x";
if (isNaN(x) !== true) {
$ERROR('#6: x = "1"; x *= "x"; x === Not-a-Number. Actual: ' + (x));
}
|
// for a legacy code and future fixes
module.exports = function(){
return Function.call.apply(Array.prototype.reverse, arguments);
};
|
(function () {
function createJsConsole(selector) {
var self = this;
//var consoleElement = document.querySelector(selector);
var consoleElement = document.getElementById(selector)
if (consoleElement.className) {
consoleElement.className = consoleElement.className + " js-console";
}
else {
consoleElement.className = "js-console";
}
var textArea = document.createElement("p");
consoleElement.appendChild(textArea);
self.write = function jsConsoleWrite(text) {
var textLine = document.createElement("span");
if (text !== "" && text !== undefined) {
var toWrite = text.toString();
textLine.innerHTML = toWrite;
textArea.appendChild(textLine);
consoleElement.scrollTop = consoleElement.scrollHeight;
}
}
self.writeLine = function jsConsoleWriteLine(text) {
self.write(text);
textArea.appendChild(document.createElement("br"));
}
self.read = function readText(inputSelector) {
var element = document.querySelector(inputSelector);
if (element.innerHTML) {
return element.innerHTML;
}
else {
return element.value;
}
}
self.readInteger = function readInteger(inputSelector) {
var text = self.read(inputSelector);
return parseInt(text);
}
self.readFloat = function readFloat(inputSelector) {
var text = self.read(inputSelector);
return parseFloat(text);
}
return self;
}
jsConsole = new createJsConsole("js-console");
}).call(this);
|
version https://git-lfs.github.com/spec/v1
oid sha256:0530c3cb2bb70db32d47af467c6199b0bc58856d286bdbb6f18eb02b66aa0d25
size 3383
|
function integration(name, lifecycle) {
module("Integration: " + name, {
setup: function() {
sinon.stub(Discourse.ScrollingDOMMethods, "bindOnScroll");
sinon.stub(Discourse.ScrollingDOMMethods, "unbindOnScroll");
Ember.run(Discourse, Discourse.advanceReadiness);
if (lifecycle && lifecycle.setup) {
lifecycle.setup.call(this);
}
},
teardown: function() {
if (lifecycle && lifecycle.teardown) {
lifecycle.teardown.call(this);
}
Discourse.reset();
Discourse.ScrollingDOMMethods.bindOnScroll.restore();
Discourse.ScrollingDOMMethods.unbindOnScroll.restore();
}
});
}
function testController(klass, model) {
return klass.create({model: model, container: Discourse.__container__});
}
function controllerFor(controller, model) {
var controller = Discourse.__container__.lookup('controller:' + controller);
if (model) { controller.set('model', model ); }
return controller;
}
function asyncTestDiscourse(text, func) {
asyncTest(text, function () {
var self = this;
Ember.run(function () {
func.call(self);
});
});
}
function fixture(selector) {
if (selector) {
return $("#qunit-fixture").find(selector);
}
return $("#qunit-fixture");
}
|
"use strict"
const ruleMessages = require("../../utils/ruleMessages")
const validateOptions = require("../../utils/validateOptions")
const whitespaceChecker = require("../../utils/whitespaceChecker")
const functionCommaSpaceChecker = require("../functionCommaSpaceChecker")
const ruleName = "function-comma-newline-after"
const messages = ruleMessages(ruleName, {
expectedAfter: () => "Expected newline after \",\"",
expectedAfterMultiLine: () => "Expected newline after \",\" in a multi-line function",
rejectedAfterMultiLine: () => "Unexpected whitespace after \",\" in a multi-line function",
})
const rule = function (expectation) {
const checker = whitespaceChecker("newline", expectation, messages)
return (root, result) => {
const validOptions = validateOptions(result, ruleName, {
actual: expectation,
possible: [
"always",
"always-multi-line",
"never-multi-line",
],
})
if (!validOptions) {
return
}
functionCommaSpaceChecker({
root,
result,
locationChecker: checker.afterOneOnly,
checkedRuleName: ruleName,
})
}
}
rule.ruleName = ruleName
rule.messages = messages
module.exports = rule
|
//// [thisInLambda.ts]
class Foo {
x = "hello";
bar() {
this.x; // 'this' is type 'Foo'
var f = () => this.x; // 'this' should be type 'Foo' as well
}
}
function myFn(a:any) { }
class myCls {
constructor () {
myFn(() => {
myFn(() => {
var x = this;
});
});
}
}
//// [thisInLambda.js]
var Foo = /** @class */ (function () {
function Foo() {
this.x = "hello";
}
Foo.prototype.bar = function () {
var _this = this;
this.x; // 'this' is type 'Foo'
var f = function () { return _this.x; }; // 'this' should be type 'Foo' as well
};
return Foo;
}());
function myFn(a) { }
var myCls = /** @class */ (function () {
function myCls() {
var _this = this;
myFn(function () {
myFn(function () {
var x = _this;
});
});
}
return myCls;
}());
|
function WPATH(s) {
var index = s.lastIndexOf("/");
var path = -1 === index ? "starrating/" + s : s.substring(0, index) + "/starrating/" + s.substring(index + 1);
return path;
}
module.exports = [ {
isApi: true,
priority: 1000.0001,
key: "TableViewRow",
style: {
color: "black",
height: "50dp"
}
}, {
isApi: true,
priority: 1000.9001999999999,
key: "TableViewRow",
style: {
color: "blue"
}
}, {
isClass: true,
priority: 10000.0003,
key: "star",
style: {
height: "24dp",
width: "24dp",
left: "5dp"
}
}, {
isClass: true,
priority: 10000.9004,
key: "star",
style: {
height: "32dp",
width: "10dp",
left: "8dp"
}
} ];
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.