text
stringlengths 2
6.14k
|
|---|
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails react-core
*/
'use strict';
describe('onlyChild', () => {
var React;
var onlyChild;
var WrapComponent;
beforeEach(() => {
React = require('react');
onlyChild = require('onlyChild');
WrapComponent = class extends React.Component {
render() {
return (
<div>
{onlyChild(this.props.children, this.props.mapFn, this)}
</div>
);
}
};
});
it('should fail when passed two children', () => {
expect(function() {
var instance = (
<WrapComponent>
<div />
<span />
</WrapComponent>
);
onlyChild(instance.props.children);
}).toThrow();
});
it('should fail when passed nully values', () => {
expect(function() {
var instance = (
<WrapComponent>
{null}
</WrapComponent>
);
onlyChild(instance.props.children);
}).toThrow();
expect(function() {
var instance = (
<WrapComponent>
{undefined}
</WrapComponent>
);
onlyChild(instance.props.children);
}).toThrow();
});
it('should fail when key/value objects', () => {
expect(function() {
var instance = (
<WrapComponent>
{[<span key="abc" />]}
</WrapComponent>
);
onlyChild(instance.props.children);
}).toThrow();
});
it('should not fail when passed interpolated single child', () => {
expect(function() {
var instance = (
<WrapComponent>
{<span />}
</WrapComponent>
);
onlyChild(instance.props.children);
}).not.toThrow();
});
it('should return the only child', () => {
var instance = (
<WrapComponent>
<span />
</WrapComponent>
);
expect(onlyChild(instance.props.children)).toEqual(<span />);
});
});
|
import { LitElement, html } from 'lit-element';
class MyElement extends LitElement {
render(){
return html`
<div>
<slot name="one"></slot>
<slot name="two"></slot>
</div>
`;
}
}
customElements.define('my-element', MyElement);
|
$(function() {
/* open modal
----------------------------------------------------------- */
$('.smartforms-modal-trigger').on('click', function(event){
event.preventDefault();
$('.smartforms-modal').addClass('smartforms-modal-visible');
$('body').addClass('smartforms-modal-scroll');
});
/* close modal
------------------------------------------------------------ */
$('.smartforms-modal').on('click', function(event){
if( $(event.target).is('.smartforms-modal-close') || $(event.target).is('.smartforms-modal')) {
event.preventDefault();
$(this).removeClass('smartforms-modal-visible');
$('body').removeClass('smartforms-modal-scroll');
}
});
/* close modal when clicking the esc keyboard button
------------------------------------------------------------ */
$(document).keyup(function(event){
if(event.which=='27'){
$('.smartforms-modal').removeClass('smartforms-modal-visible');
$('body').removeClass('smartforms-modal-scroll');
}
});
function reloadCaptcha(){ $("#captchax").attr("src","php/captcha/captcha.php?r=" + Math.random()); }
$('.captcode').click(function(e){
e.preventDefault();
reloadCaptcha();
});
function swapButton(){
var txtswap = $(".smartforms-modal-footer button[type='submit']");
if (txtswap.text() == txtswap.data("btntext-sending")) {
txtswap.text(txtswap.data("btntext-original"));
} else {
txtswap.data("btntext-original", txtswap.text());
txtswap.text(txtswap.data("btntext-sending"));
}
}
$( "#smart-form" ).validate({
/* @validation states + elements
------------------------------------------- */
errorClass: "state-error",
validClass: "state-success",
errorElement: "em",
onkeyup: false,
onclick: false,
/* @validation rules
------------------------------------------ */
rules: {
sendername: {
required: true,
minlength: 2
},
emailaddress: {
required: true,
email: true
},
sendersubject: {
required: true,
minlength: 4
},
sendermessage: {
required: true,
minlength: 10
},
captcha:{
required:true,
remote:'php/captcha/process.php'
}
},
messages:{
sendername: {
required: 'Enter your name',
minlength: 'Name must be at least 2 characters'
},
emailaddress: {
required: 'Enter your email address',
email: 'Enter a VALID email address'
},
sendersubject: {
required: 'Subject is important',
minlength: 'Subject must be at least 4 characters'
},
sendermessage: {
required: 'Oops you forgot your message',
minlength: 'Message must be at least 10 characters'
},
captcha:{
required: 'You must enter the captcha code',
remote:'Captcha code is incorrect'
}
},
/* @validation highlighting + error placement
---------------------------------------------------- */
highlight: function(element, errorClass, validClass) {
$(element).closest('.field').addClass(errorClass).removeClass(validClass);
},
unhighlight: function(element, errorClass, validClass) {
$(element).closest('.field').removeClass(errorClass).addClass(validClass);
},
errorPlacement: function(error, element) {
if (element.is(":radio") || element.is(":checkbox")) {
element.closest('.option-group').after(error);
} else {
error.insertAfter(element.parent());
}
},
/* @ajax form submition
---------------------------------------------------- */
submitHandler:function(form) {
$(form).ajaxSubmit({
target:'.result',
beforeSubmit:function(){
swapButton();
$('.smartforms-modal-footer').addClass('progress');
},
error:function(){
swapButton();
$('.smartforms-modal-footer').removeClass('progress');
},
success:function(){
swapButton();
$('.smartforms-modal-footer').removeClass('progress');
$('.alert-success').show().delay(7000).fadeOut();
$('.field').removeClass("state-error, state-success");
if( $('.alert-error').length == 0){
$('#smart-form').resetForm();
reloadCaptcha();
setTimeout(function () {
$('.smartforms-modal').removeClass('smartforms-modal-visible');
$('body').removeClass('smartforms-modal-scroll');
}, 7500);
}
}
});
}
});
});
|
'use strict';
angular.module('myApp.test', ['ngRoute','firebase'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/test', {
templateUrl: 'test/test.html',
controller: 'TestCtrl'
});
}])
.controller('TestCtrl', ['$scope',function($scope) {
var login={};
$scope.test = function(){
login.loading = true;
}
$scope.login=login;
}])
.directive('uiLadda', [
function() {
return {
link: function(scope, element, attrs) {
var Ladda = window.Ladda;
var ladda = Ladda.create(element[0]);
// Watching login.loading for change
scope.$watch(attrs.uiLadda, function(newVal, oldVal) {
// if true show loading indicator
if (newVal) {
ladda.start();
} else {
ladda.stop();
}
});
}
};
}
]);
|
var test = require('tap').test
var torrents = require('../')
var fs = require('fs')
var path = require('path')
var fixture = torrents(fs.readFileSync(path.join(__dirname, 'data', 'star.torrent')), {
dht: false,
tracker: false
})
fixture.listen(10000)
var engine = function () {
var e = torrents('magnet:?xt=urn:btih:ef330b39f4801d25b4245212e75a38634bfc856e', {
dht: false,
tracker: false
})
e.connect('127.0.0.1:10000')
return e
}
test('fixture should be ready', function (t) {
t.plan(1)
fixture.on('ready', t.ok.bind(t, true, 'should be ready'))
})
test('destroy engine after ready', function (t) {
t.plan(1)
var e = engine()
e.on('ready', function () {
e.destroy(t.ok.bind(t, true, 'should be destroyed'))
})
})
test('destroy engine right away', function (t) {
t.plan(1)
var e = engine()
e.destroy(t.ok.bind(t, true, 'should be destroyed'))
})
test('remove fixture and all content', function (t) {
t.plan(1)
fixture.destroy(function () {
fixture.remove(function () {
t.ok(!fs.existsSync(fixture.path))
})
})
})
|
var RGBtoHEX = function (rgb) {
rgb.r = Math.floor(rgb.r);
rgb.g = Math.floor(rgb.g);
rgb.b = Math.floor(rgb.b);
var hex = "#" +
((rgb.r < 16 ? "0" : "") + rgb.r.toString(16)) +
((rgb.g < 16 ? "0" : "") + rgb.g.toString(16)) +
((rgb.b < 16 ? "0" : "") + rgb.b.toString(16));
return hex;
}
anything.prototype.RGBtoHEX = RGBtoHEX;
|
/**
* @private
* use the val2 when val1 is undefined
* @param {*} val1
* @param {*} val2
* @returns {*}
*/
export default function ifUndefined(val1, val2) {
return (val1 === undefined) ? val2 : val1;
}
|
import Node from '../Node.js';
import spread, { isArguments } from '../../utils/spread.js';
export default class ArrayExpression extends Node {
initialise ( transforms ) {
if ( transforms.spreadRest && this.elements.length ) {
const lexicalBoundary = this.findLexicalBoundary();
let i = this.elements.length;
while ( i-- ) {
const element = this.elements[i];
if ( element && element.type === 'SpreadElement' && isArguments( element.argument ) ) {
this.argumentsArrayAlias = lexicalBoundary.getArgumentsArrayAlias();
}
}
}
super.initialise( transforms );
}
transpile ( code, transforms ) {
if ( transforms.spreadRest ) {
// erase trailing comma after last array element if not an array hole
if ( this.elements.length ) {
let lastElement = this.elements[ this.elements.length - 1 ];
if ( lastElement && /\s*,/.test( code.original.slice( lastElement.end, this.end ) ) ) {
code.overwrite( lastElement.end, this.end - 1, ' ' );
}
}
if ( this.elements.length === 1 ) {
const element = this.elements[0];
if ( element && element.type === 'SpreadElement' ) {
// special case – [ ...arguments ]
if ( isArguments( element.argument ) ) {
code.overwrite( this.start, this.end, `[].concat( ${this.argumentsArrayAlias} )` ); // TODO if this is the only use of argsArray, don't bother concating
} else {
code.overwrite( this.start, element.argument.start, '[].concat( ' );
code.overwrite( element.end, this.end, ' )' );
}
}
}
else {
const hasSpreadElements = spread( code, this.elements, this.start, this.argumentsArrayAlias );
if ( hasSpreadElements ) {
code.overwrite( this.end - 1, this.end, ')' );
}
}
}
super.transpile( code, transforms );
}
}
|
/*
*/
'use strict';
var models = require('./index');
var util = require('util');
/**
* @class
* Initializes a new instance of the StorageAccount class.
* @constructor
* The storage account.
* @member {object} [properties]
*
* @member {string} [properties.provisioningState] Gets the status of the
* storage account at the time the operation was called. Possible values
* include: 'Creating', 'ResolvingDNS', 'Succeeded'
*
* @member {string} [properties.accountType] Gets the type of the storage
* account. Possible values include: 'Standard_LRS', 'Standard_ZRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS'
*
* @member {object} [properties.primaryEndpoints] Gets the URLs that are used
* to perform a retrieval of a public blob, queue or table object.Note that
* StandardZRS and PremiumLRS accounts only return the blob endpoint.
*
* @member {string} [properties.primaryEndpoints.blob] Gets the blob endpoint.
*
* @member {string} [properties.primaryEndpoints.queue] Gets the queue
* endpoint.
*
* @member {string} [properties.primaryEndpoints.table] Gets the table
* endpoint.
*
* @member {string} [properties.primaryEndpoints.file] Gets the file endpoint.
*
* @member {string} [properties.primaryLocation] Gets the location of the
* primary for the storage account.
*
* @member {string} [properties.statusOfPrimary] Gets the status indicating
* whether the primary location of the storage account is available or
* unavailable. Possible values include: 'Available', 'Unavailable'
*
* @member {date} [properties.lastGeoFailoverTime] Gets the timestamp of the
* most recent instance of a failover to the secondary location. Only the
* most recent timestamp is retained. This element is not returned if there
* has never been a failover instance. Only available if the accountType is
* StandardGRS or StandardRAGRS.
*
* @member {string} [properties.secondaryLocation] Gets the location of the
* geo replicated secondary for the storage account. Only available if the
* accountType is StandardGRS or StandardRAGRS.
*
* @member {string} [properties.statusOfSecondary] Gets the status indicating
* whether the secondary location of the storage account is available or
* unavailable. Only available if the accountType is StandardGRS or
* StandardRAGRS. Possible values include: 'Available', 'Unavailable'
*
* @member {date} [properties.creationTime] Gets the creation date and time of
* the storage account in UTC.
*
* @member {object} [properties.customDomain] Gets the user assigned custom
* domain assigned to this storage account.
*
* @member {string} [properties.customDomain.name] Gets or sets the custom
* domain name. Name is the CNAME source.
*
* @member {boolean} [properties.customDomain.useSubDomain] Indicates whether
* indirect CName validation is enabled. Default value is false. This should
* only be set on updates
*
* @member {object} [properties.secondaryEndpoints] Gets the URLs that are
* used to perform a retrieval of a public blob, queue or table object from
* the secondary location of the storage account. Only available if the
* accountType is StandardRAGRS.
*
* @member {string} [properties.secondaryEndpoints.blob] Gets the blob
* endpoint.
*
* @member {string} [properties.secondaryEndpoints.queue] Gets the queue
* endpoint.
*
* @member {string} [properties.secondaryEndpoints.table] Gets the table
* endpoint.
*
* @member {string} [properties.secondaryEndpoints.file] Gets the file
* endpoint.
*
*/
function StorageAccount() {
StorageAccount['super_'].call(this);
}
util.inherits(StorageAccount, models['Resource']);
/**
* Defines the metadata of StorageAccount
*
* @returns {object} metadata of StorageAccount
*
*/
StorageAccount.prototype.mapper = function () {
return {
required: false,
serializedName: 'StorageAccount',
type: {
name: 'Composite',
className: 'StorageAccount',
modelProperties: {
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
type: {
required: false,
readOnly: true,
serializedName: 'type',
type: {
name: 'String'
}
},
location: {
required: false,
serializedName: 'location',
type: {
name: 'String'
}
},
tags: {
required: false,
serializedName: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
},
properties: {
required: false,
serializedName: 'properties',
type: {
name: 'Composite',
className: 'StorageAccountProperties'
}
}
}
}
};
};
module.exports = StorageAccount;
|
/**
* 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($){
function _1(_2){
var _3=$.data(_2,"splitbutton").options;
var _4=$(_2);
_4.removeClass("s-btn-active s-btn-plain-active").addClass("s-btn");
_4.linkbutton($.extend({},_3,{text:_3.text+"<span class=\"s-btn-downarrow\"> </span>"}));
if(_3.menu){
$(_3.menu).menu({onShow:function(){
_4.addClass((_3.plain==true)?"s-btn-plain-active":"s-btn-active");
},onHide:function(){
_4.removeClass((_3.plain==true)?"s-btn-plain-active":"s-btn-active");
}});
}
_5(_2,_3.disabled);
};
function _5(_6,_7){
var _8=$.data(_6,"splitbutton").options;
_8.disabled=_7;
var _9=$(_6);
var _a=_9.find(".s-btn-downarrow");
if(_7){
_9.linkbutton("disable");
_a.unbind(".splitbutton");
}else{
_9.linkbutton("enable");
_a.unbind(".splitbutton");
_a.bind("click.splitbutton",function(){
_b();
return false;
});
var _c=null;
_a.bind("mouseenter.splitbutton",function(){
_c=setTimeout(function(){
_b();
},_8.duration);
return false;
}).bind("mouseleave.splitbutton",function(){
if(_c){
clearTimeout(_c);
}
});
}
function _b(){
if(!_8.menu){
return;
}
var _d=_9.offset().left;
if(_d+$(_8.menu).outerWidth()+5>$(window).width()){
_d=$(window).width()-$(_8.menu).outerWidth()-5;
}
$("body>div.menu-top").menu("hide");
$(_8.menu).menu("show",{left:_d,top:_9.offset().top+_9.outerHeight()});
_9.blur();
};
};
$.fn.splitbutton=function(_e,_f){
if(typeof _e=="string"){
return $.fn.splitbutton.methods[_e](this,_f);
}
_e=_e||{};
return this.each(function(){
var _10=$.data(this,"splitbutton");
if(_10){
$.extend(_10.options,_e);
}else{
$.data(this,"splitbutton",{options:$.extend({},$.fn.splitbutton.defaults,$.fn.splitbutton.parseOptions(this),_e)});
$(this).removeAttr("disabled");
}
_1(this);
});
};
$.fn.splitbutton.methods={options:function(jq){
return $.data(jq[0],"splitbutton").options;
},enable:function(jq){
return jq.each(function(){
_5(this,false);
});
},disable:function(jq){
return jq.each(function(){
_5(this,true);
});
},destroy:function(jq){
return jq.each(function(){
var _11=$(this).splitbutton("options");
if(_11.menu){
$(_11.menu).menu("destroy");
}
$(this).remove();
});
}};
$.fn.splitbutton.parseOptions=function(_12){
var t=$(_12);
return $.extend({},$.fn.linkbutton.parseOptions(_12),{menu:t.attr("menu"),duration:t.attr("duration")});
};
$.fn.splitbutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,menu:null,duration:100});
})(jQuery);
|
/**
* @private
*/
IonicModule
.factory('$ionicBind', ['$parse', '$interpolate', function($parse, $interpolate) {
var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/;
return function(scope, attrs, bindDefinition) {
angular.forEach(bindDefinition || {}, function (definition, scopeName) {
//Adapted from angular.js $compile
var match = definition.match(LOCAL_REGEXP) || [],
attrName = match[3] || scopeName,
mode = match[1], // @, =, or &
parentGet,
unwatch;
switch(mode) {
case '@':
if (!attrs[attrName]) {
return;
}
attrs.$observe(attrName, function(value) {
scope[scopeName] = value;
});
// we trigger an interpolation to ensure
// the value is there for use immediately
if (attrs[attrName]) {
scope[scopeName] = $interpolate(attrs[attrName])(scope);
}
break;
case '=':
if (!attrs[attrName]) {
return;
}
unwatch = scope.$watch(attrs[attrName], function(value) {
scope[scopeName] = value;
});
//Destroy parent scope watcher when this scope is destroyed
scope.$on('$destroy', unwatch);
break;
case '&':
/* jshint -W044 */
if (attrs[attrName] && attrs[attrName].match(RegExp(scopeName + '\(.*?\)'))) {
throw new Error('& expression binding "' + scopeName + '" looks like it will recursively call "' +
attrs[attrName] + '" and cause a stack overflow! Please choose a different scopeName.');
}
parentGet = $parse(attrs[attrName]);
scope[scopeName] = function(locals) {
return parentGet(scope, locals);
};
break;
}
});
};
}]);
|
// getVariable sees variables in function scopes added by non-strict direct eval.
var g = newGlobal('new-compartment');
var dbg = Debugger(g);
var v;
dbg.onDebuggerStatement = function (frame) {
v = frame.environment.getVariable("x");
};
g.eval("function f(s) { eval(s); debugger; }");
g.f("var x = 'Q';");
assertEq(v, 'Q');
|
/*
* Copyright (C) 2009 Google 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.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
WebInspector.AuditResultView = function(categoryResults)
{
WebInspector.View.call(this);
this.element.className = "audit-result-view";
for (var i = 0; i < categoryResults.length; ++i)
this.element.appendChild(new WebInspector.AuditCategoryResultPane(categoryResults[i]).element);
}
WebInspector.AuditResultView.prototype.__proto__ = WebInspector.View.prototype;
WebInspector.AuditCategoryResultPane = function(categoryResult)
{
WebInspector.SidebarPane.call(this, categoryResult.title);
var treeOutlineElement = document.createElement("ol");
this.bodyElement.addStyleClass("audit-result-tree");
this.bodyElement.appendChild(treeOutlineElement);
this._treeOutline = new TreeOutline(treeOutlineElement);
this._treeOutline.expandTreeElementsWhenArrowing = true;
for (var i = 0; i < categoryResult.ruleResults.length; ++i) {
var ruleResult = categoryResult.ruleResults[i];
var treeElement = this._appendResult(this._treeOutline, ruleResult);
treeElement.listItemElement.addStyleClass("audit-result");
if (ruleResult.severity) {
var severityElement = document.createElement("img");
severityElement.className = "severity-" + ruleResult.severity;
treeElement.listItemElement.appendChild(severityElement);
}
}
this.expand();
}
WebInspector.AuditCategoryResultPane.prototype = {
_appendResult: function(parentTreeElement, result)
{
var title = result.value;
if (result.violationCount)
title = String.sprintf("%s (%d)", title, result.violationCount);
var treeElement = new TreeElement(title, null, !!result.children);
parentTreeElement.appendChild(treeElement);
if (result.className)
treeElement.listItemElement.addStyleClass(result.className);
if (result.children) {
for (var i = 0; i < result.children.length; ++i)
this._appendResult(treeElement, result.children[i]);
}
if (result.expanded) {
treeElement.listItemElement.removeStyleClass("parent");
treeElement.listItemElement.addStyleClass("parent-expanded");
treeElement.expand();
}
return treeElement;
}
}
WebInspector.AuditCategoryResultPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
|
var exec = require('cordova/exec');
/**
navigator.alipay.pay({"seller":"007slm@163.com",subject":"x51","body":"x5企业版","price":"0.01","tradeNo":"123456","timeout":"30m","notifyUrl":"wwww.justep.com"},function(msgCode){alert(msgCode)},function(msg){alert(msg)})
**/
module.exports = {
pay: function(orderInfo,onSuccess,onError){
exec(onSuccess, onError, "Alipay", "pay", [orderInfo]);
}
};
|
chorus.alerts.DeleteNoteConfirmAlert = chorus.alerts.ModelDelete.extend({
constructorName: "DeleteNoteConfirmAlert",
makeModel: function() {
this._super("makeModel", arguments);
var commentId = this.options.commentId;
if (commentId) {
this.model = new chorus.models.Comment({
id: commentId
});
this.setComment();
} else {
var activity = this.options.activity;
this.model = activity.toNote();
this.model.unset('body');
if (activity.isInsight()) {
this.setInsight();
} else {
this.setNote();
}
}
},
setComment: function() {
this.text = t("comments.delete.alert.text");
this.title = t("comments.delete.alert.title");
this.ok = t("comments.delete.alert.ok");
this.deleteMessage = "comments.delete.alert.delete_message.toast";
},
setNote: function() {
this.text = t("notes.delete.alert.text");
this.title = t("notes.delete.alert.title");
this.ok = t("notes.delete.alert.ok");
this.deleteMessage = "notes.delete.alert.delete_message.toast";
},
setInsight: function() {
this.text = t("insight.delete.alert.text");
this.title = t("insight.delete.alert.title");
this.ok = t("insight.delete.alert.ok");
this.deleteMessage = "insight.delete.alert.delete_message.toast";
}
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* String.prototype.replace (searchValue, replaceValue)
*
* @path ch15/15.5/15.5.4/15.5.4.11/S15.5.4.11_A1_T5.js
* @description Call replace (searchValue, replaceValue) function with null and Function() arguments of function object
*/
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (function(){return "gnulluna"}().replace(null, Function()) !== "gundefineduna") {
$ERROR('#1: function(){return "gnulluna"}().replace(null, Function()) === "gundefineduna". Actual: '+function(){return "gnulluna"}().replace(null, Function()) );
}
//
//////////////////////////////////////////////////////////////////////////////
|
/*
* Copyright 2008 Closure Compiler Authors
*
* 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 for Gecko's custom CSS properties. Copied from:
* http://mxr.mozilla.org/mozilla2.0/source/dom/interfaces/css/nsIDOMCSS2Properties.idl
*
* @externs
* @author nicksantos@google.com (Nick Santos)
*/
/** @type {string} */ CSSProperties.prototype.MozAppearance;
/** @type {string} */ CSSProperties.prototype.MozBackfaceVisibility;
/** @type {string} */ CSSProperties.prototype.MozBackgroundClip;
/** @type {string} */ CSSProperties.prototype.MozBackgroundInlinePolicy;
/** @type {string} */ CSSProperties.prototype.MozBackgroundOrigin;
/** @type {string} */ CSSProperties.prototype.MozBinding;
/** @type {string} */ CSSProperties.prototype.MozBorderBottomColors;
/** @type {string} */ CSSProperties.prototype.MozBorderEnd;
/** @type {string} */ CSSProperties.prototype.MozBorderEndColor;
/** @type {string} */ CSSProperties.prototype.MozBorderEndStyle;
/** @type {string} */ CSSProperties.prototype.MozBorderEndWidth;
/** @type {string} */ CSSProperties.prototype.MozBorderImage;
/** @type {string} */ CSSProperties.prototype.MozBorderLeftColors;
/** @type {string} */ CSSProperties.prototype.MozBorderRadius;
/** @type {string} */ CSSProperties.prototype.MozBorderRadiusTopleft;
/** @type {string} */ CSSProperties.prototype.MozBorderRadiusTopright;
/** @type {string} */ CSSProperties.prototype.MozBorderRadiusBottomleft;
/** @type {string} */ CSSProperties.prototype.MozBorderRadiusBottomright;
/** @type {string} */ CSSProperties.prototype.MozBorderRightColors;
/** @type {string} */ CSSProperties.prototype.MozBorderStart;
/** @type {string} */ CSSProperties.prototype.MozBorderStartColor;
/** @type {string} */ CSSProperties.prototype.MozBorderStartStyle;
/** @type {string} */ CSSProperties.prototype.MozBorderStartWidth;
/** @type {string} */ CSSProperties.prototype.MozBorderTopColors;
/** @type {string} */ CSSProperties.prototype.MozBoxAlign;
/** @type {string} */ CSSProperties.prototype.MozBoxDirection;
/** @type {string} */ CSSProperties.prototype.MozBoxFlex;
/** @type {string} */ CSSProperties.prototype.MozBoxOrdinalGroup;
/** @type {string} */ CSSProperties.prototype.MozBoxOrient;
/** @type {string} */ CSSProperties.prototype.MozBoxPack;
/** @type {string} */ CSSProperties.prototype.MozBoxSizing;
/** @type {string} */ CSSProperties.prototype.MozColumnCount;
/** @type {string} */ CSSProperties.prototype.MozColumnGap;
/** @type {string} */ CSSProperties.prototype.MozColumnRule;
/** @type {string} */ CSSProperties.prototype.MozColumnRuleColor;
/** @type {string} */ CSSProperties.prototype.MozColumnRuleStyle;
/** @type {string} */ CSSProperties.prototype.MozColumnRuleWidth;
/** @type {string} */ CSSProperties.prototype.MozColumnWidth;
/** @type {string} */ CSSProperties.prototype.MozFloatEdge;
/** @type {string} */ CSSProperties.prototype.MozFontFeatureSettings;
/** @type {string} */ CSSProperties.prototype.MozFontLanguageOverride;
/** @type {string} */ CSSProperties.prototype.MozForceBrokenImageIcon;
/** @type {string} */ CSSProperties.prototype.MozImageRegion;
/** @type {string} */ CSSProperties.prototype.MozMarginEnd;
/** @type {string} */ CSSProperties.prototype.MozMarginStart;
/** @type {number|string} */ CSSProperties.prototype.MozOpacity;
/** @type {string} */ CSSProperties.prototype.MozOutline;
/** @type {string} */ CSSProperties.prototype.MozOutlineColor;
/** @type {string} */ CSSProperties.prototype.MozOutlineOffset;
/** @type {string} */ CSSProperties.prototype.MozOutlineRadius;
/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusBottomleft;
/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusBottomright;
/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusTopleft;
/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusTopright;
/** @type {string} */ CSSProperties.prototype.MozOutlineStyle;
/** @type {string} */ CSSProperties.prototype.MozOutlineWidth;
/** @type {string} */ CSSProperties.prototype.MozPaddingEnd;
/** @type {string} */ CSSProperties.prototype.MozPaddingStart;
/** @type {string} */ CSSProperties.prototype.MozPerspective;
/** @type {string} */ CSSProperties.prototype.MozStackSizing;
/** @type {string} */ CSSProperties.prototype.MozTabSize;
/** @type {string} */ CSSProperties.prototype.MozTransform;
/** @type {string} */ CSSProperties.prototype.MozTransformOrigin;
/** @type {string} */ CSSProperties.prototype.MozTransition;
/** @type {string} */ CSSProperties.prototype.MozTransitionDelay;
/** @type {string} */ CSSProperties.prototype.MozTransitionDuration;
/** @type {string} */ CSSProperties.prototype.MozTransitionProperty;
/** @type {string} */ CSSProperties.prototype.MozTransitionTimingFunction;
/** @type {string} */ CSSProperties.prototype.MozUserFocus;
/** @type {string} */ CSSProperties.prototype.MozUserInput;
/** @type {string} */ CSSProperties.prototype.MozUserModify;
/** @type {string} */ CSSProperties.prototype.MozUserSelect;
/** @type {string} */ CSSProperties.prototype.MozWindowShadow;
// These are non-standard Gecko CSSOM properties on Window.prototype.screen.
/**
* @type {number}
* @see https://developer.mozilla.org/En/DOM/window.screen.availTop
*/
Screen.prototype.availTop;
/**
* @type {number}
* @see https://developer.mozilla.org/En/DOM/window.screen.availLeft
*/
Screen.prototype.availLeft;
/**
* @type {number}
* @see https://developer.mozilla.org/En/DOM/window.screen.left
*/
Screen.prototype.left;
/**
* @type {number}
* @see https://developer.mozilla.org/En/DOM/window.screen.top
*/
Screen.prototype.top;
|
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckevents.js
* FCKEvents Class: used to handle events is a advanced way.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKEvents ;
FCKEvents = function( eventsOwner )
{
this.Owner = eventsOwner ;
this.RegisteredEvents = new Object() ;
}
FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
{
var aTargets ;
if ( !( aTargets = this.RegisteredEvents[ eventName ] ) )
this.RegisteredEvents[ eventName ] = [ functionPointer ] ;
else
aTargets.push( functionPointer ) ;
}
FCKEvents.prototype.FireEvent = function( eventName, params )
{
var bReturnValue = true ;
var oCalls = this.RegisteredEvents[ eventName ] ;
if ( oCalls )
{
for ( var i = 0 ; i < oCalls.length ; i++ )
bReturnValue = ( oCalls[ i ]( this.Owner, params ) && bReturnValue ) ;
}
return bReturnValue ;
}
|
// Copyright 2011 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @path ch15/15.3/15.3.4/15.3.4.2/S15.3.4.2_A13.js
* @description The toString function is not generic; it throws a TypeError exception if its this value is not a Function object.
* @negative TypeError
*/
Function.prototype.toString.call(null);
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Custom binding for the Media Gallery API.
var binding = require('binding').Binding.create('mediaGalleries');
var mediaGalleriesNatives = requireNative('mediaGalleries');
var mediaGalleriesMetadata = {};
binding.registerCustomHook(function(bindingsAPI, extensionId) {
var apiFunctions = bindingsAPI.apiFunctions;
// getMediaFileSystems uses a custom callback so that it can instantiate and
// return an array of file system objects.
apiFunctions.setCustomCallback('getMediaFileSystems',
function(name, request, response) {
var result = null;
mediaGalleriesMetadata = {}; // Clear any previous metadata.
if (response) {
result = [];
for (var i = 0; i < response.length; i++) {
var filesystem = mediaGalleriesNatives.GetMediaFileSystemObject(
response[i].fsid);
result.push(filesystem);
var metadata = response[i];
delete metadata.fsid;
mediaGalleriesMetadata[filesystem.name] = metadata;
}
}
if (request.callback)
request.callback(result);
request.callback = null;
});
apiFunctions.setHandleRequest('getMediaFileSystemMetadata',
function(filesystem) {
if (filesystem && filesystem.name &&
mediaGalleriesMetadata[filesystem.name]) {
return mediaGalleriesMetadata[filesystem.name];
}
return {};
});
});
exports.binding = binding.generate();
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* When Number is called as part of a new expression it is
* a constructor: it initialises the newly created object
*
* @path ch15/15.7/15.7.2/S15.7.2.1_A1.js
* @description Checking type of the newly created object and it value
*/
//CHECK#1
if (typeof new Number() !== "object") {
$ERROR("#1: typeof new Number() === 'object'");
}
//CHECK#2
if (new Number() === undefined) {
$ERROR("#2: new Number() should not be undefined");
}
//CHECK#3
var x3 = new Number();
if(typeof x3 !== "object"){
$ERROR("#3: typeof new Number() === 'object'");
}
//CHECK#4
var x4 = new Number();
if(x4 === undefined){
$ERROR("#4: new Number() should not be undefined");
}
//CHECK#5
if (typeof new Number(10) !== "object") {
$ERROR("#5: typeof new Number(10) === 'object'");
}
//CHECK#6
if (new Number(10) === undefined) {
$ERROR("#6: new Number(10) should not be undefined");
}
//CHECK#7
var x7 = new Number(10);
if(typeof x7 !== "object"){
$ERROR("#7: typeof new Number(10) === 'object'");
}
//CHECK#8
var x8 = new Number(10);
if(x8 === undefined){
$ERROR("#8: new Number(10) should not be undefined");
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Include test fixture.
GEN_INCLUDE(['chromevox_e2e_test_base.js']);
/**
* Base test fixture for ChromeVox Next end to end tests.
*
* These tests are identical to ChromeVoxE2ETests except for performing the
* necessary setup to run ChromeVox Next.
* @constructor
* @extends {ChromeVoxE2ETest}
*/
function ChromeVoxNextE2ETest() {
ChromeVoxE2ETest.call(this);
}
ChromeVoxNextE2ETest.prototype = {
__proto__: ChromeVoxE2ETest.prototype,
/**
* Launches a new tab with the given document, and runs callback when a load
* complete fires.
* @param {function() : void} doc Snippet wrapped inside of a function.
* @param {function()} opt_callback Called once the document is ready.
*/
runWithLoadedTree: function(doc, callback) {
callback = this.newCallback(callback);
chrome.automation.getDesktop(function(r) {
var listener = function(evt) {
if (!evt.target.docUrl ||
evt.target.docUrl.indexOf('test') == -1)
return;
r.removeEventListener(listener);
callback && callback(evt.target);
callback = null;
};
r.addEventListener('loadComplete', listener, true);
this.runWithTab(doc);
}.bind(this));
}
};
|
Object.defineProperty
|
import React from 'react'
import { Breadcrumb } from 'semantic-ui-react'
const BreadcrumbExampleMiniSize = () => (
<Breadcrumb size='mini'>
<Breadcrumb.Section link>Home</Breadcrumb.Section>
<Breadcrumb.Divider icon='right chevron' />
<Breadcrumb.Section link>Registration</Breadcrumb.Section>
<Breadcrumb.Divider icon='right chevron' />
<Breadcrumb.Section active>Personal Information</Breadcrumb.Section>
</Breadcrumb>
)
export default BreadcrumbExampleMiniSize
|
/*global define, zed*/
define(function(require, exports, module) {
"use strict";
exports.parse = function(path) {
var parts = path.split(':');
if (parts.length === 1) {
return parts;
} else if (parts.length > 2 && !parts[1]) { // zed::bla
return [path];
} else {
return [parts[0], parts.slice(1).join(":")];
}
};
exports.jump = function(locator, selectionRange, selectedItem) {
var edit = zed.getService("editor").getActiveEditor();
if (locator[0] === "/" || locator[0] === "|") {
var caseSensitive = locator[0] === "/";
edit.find(locator.substring(1), {
start: selectionRange || edit.getSelectionRange(),
wrap: true,
caseSensitive: caseSensitive,
wholeWord: false
});
} else if (locator[0] === '@' && selectedItem) {
var parts = selectedItem.split(":");
return exports.jump(parts[1], selectionRange);
} else {
var lineNo = parseInt(locator, 10);
if (!isNaN(lineNo)) {
edit.gotoLine(lineNo);
}
}
};
});
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Delete unary operator can't delete object to be referenced
es5id: 8.7_A5_T2
description: Delete referenced object, __ref = obj
flags: [noStrict]
---*/
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (typeof(__ref) !== "undefined"){
$ERROR('#1: typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
//
//////////////////////////////////////////////////////////////////////////////
var obj = new Object();
__ref = obj;
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (typeof(__ref) === "undefined"){
$ERROR('#2: obj = new Object(); __ref = obj; typeof(__ref) !== "undefined"');
};
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (delete __ref !== true){
$ERROR('#3: obj = new Object(); __ref = obj; delete __ref === true. Actual: ' + (delete __ref));
};
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#4
if (typeof(__ref) !== "undefined"){
$ERROR('#4: obj = new Object(); __ref = obj; delete __ref; typeof(__ref) === "undefined". Actual: ' + (typeof(__ref)));
};
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#5
if (typeof(obj) !== "object"){
$ERROR('#5: obj = new Object(); __ref = obj; delete __ref; typeof(obj) === "object". Actual: ' + (typeof(obj)));
};
//
//////////////////////////////////////////////////////////////////////////////
|
var assert = require("assert");
var recast = require("..");
var types = require("../lib/types");
var n = types.namedTypes;
var b = types.builders;
var patcherModule = require("../lib/patcher");
var getReprinter = patcherModule.getReprinter;
var Patcher = patcherModule.Patcher;
var fromString = require("../lib/lines").fromString;
var parse = require("../lib/parser").parse;
var FastPath = require("../lib/fast-path");
var code = [
"// file comment",
"exports.foo({",
" // some comment",
" bar: 42,",
" baz: this",
"});"
];
function loc(sl, sc, el, ec) {
return {
start: { line: sl, column: sc },
end: { line: el, column: ec }
};
}
describe("patcher", function() {
it("Patcher", function() {
var lines = fromString(code.join("\n")),
patcher = new Patcher(lines),
selfLoc = loc(5, 9, 5, 13);
assert.strictEqual(patcher.get(selfLoc).toString(), "this");
patcher.replace(selfLoc, "self");
assert.strictEqual(patcher.get(selfLoc).toString(), "self");
var got = patcher.get().toString();
assert.strictEqual(got, code.join("\n").replace("this", "self"));
// Make sure comments are preserved.
assert.ok(got.indexOf("// some") >= 0);
var oyezLoc = loc(2, 12, 6, 1),
beforeOyez = patcher.get(oyezLoc).toString();
assert.strictEqual(beforeOyez.indexOf("exports"), -1);
assert.ok(beforeOyez.indexOf("comment") >= 0);
patcher.replace(oyezLoc, "oyez");
assert.strictEqual(patcher.get().toString(), [
"// file comment",
"exports.foo(oyez);"
].join("\n"));
// "Reset" the patcher.
patcher = new Patcher(lines);
patcher.replace(oyezLoc, "oyez");
patcher.replace(selfLoc, "self");
assert.strictEqual(patcher.get().toString(), [
"// file comment",
"exports.foo(oyez);"
].join("\n"));
});
var trickyCode = [
" function",
" foo(bar,",
" baz) {",
" qux();",
" }"
].join("\n");
it("GetIndent", function() {
function check(indent) {
var lines = fromString(trickyCode).indent(indent);
var file = parse(lines.toString());
var reprinter = FastPath.from(file).call(function(bodyPath) {
return getReprinter(bodyPath);
}, "program", "body", 0, "body");
var reprintedLines = reprinter(function(path) {
assert.ok(false, "should not have called print function");
});
assert.strictEqual(reprintedLines.length, 3);
assert.strictEqual(reprintedLines.getIndentAt(1), 0);
assert.strictEqual(reprintedLines.getIndentAt(2), 4);
assert.strictEqual(reprintedLines.getIndentAt(3), 0);
assert.strictEqual(reprintedLines.toString(), [
"{",
" qux();",
"}"
].join("\n"));
}
for (var indent = -4; indent <= 4; ++indent) {
check(indent);
}
});
it("should patch return/throw/etc. arguments correctly", function() {
var strAST = parse('return"foo"');
var returnStmt = strAST.program.body[0];
n.ReturnStatement.assert(returnStmt);
assert.strictEqual(
recast.print(strAST).code,
'return"foo"'
);
returnStmt.argument = b.literal(null);
assert.strictEqual(
recast.print(strAST).code,
"return null" // Instead of returnnull.
);
var arrAST = parse("throw[1,2,3]");
var throwStmt = arrAST.program.body[0];
n.ThrowStatement.assert(throwStmt);
assert.strictEqual(
recast.print(arrAST).code,
"throw[1,2,3]"
);
throwStmt.argument = b.literal(false);
assert.strictEqual(
recast.print(arrAST).code,
"throw false" // Instead of throwfalse.
);
var inAST = parse('"foo"in bar');
var inExpr = inAST.program.body[0].expression;
n.BinaryExpression.assert(inExpr);
assert.strictEqual(inExpr.operator, "in");
n.Literal.assert(inExpr.left);
assert.strictEqual(inExpr.left.value, "foo");
assert.strictEqual(
recast.print(inAST).code,
'"foo"in bar'
);
inExpr.left = b.identifier("x");
assert.strictEqual(
recast.print(inAST).code,
"x in bar" // Instead of xin bar.
);
});
it("should not add spaces to the beginnings of lines", function() {
var twoLineCode = [
"return", // Because of ASI rules, these two lines will
'"use strict"' // parse as separate statements.
].join("\n");
var twoLineAST = parse(twoLineCode);
assert.strictEqual(twoLineAST.program.body.length, 2);
var useStrict = twoLineAST.program.body[1];
n.ExpressionStatement.assert(useStrict);
n.Literal.assert(useStrict.expression);
assert.strictEqual(useStrict.expression.value, "use strict");
assert.strictEqual(
recast.print(twoLineAST).code,
twoLineCode
);
useStrict.expression = b.identifier("sloppy");
var withSloppyIdentifier = recast.print(twoLineAST).code;
assert.strictEqual(withSloppyIdentifier, [
"return",
"sloppy" // The key is that no space should be added to the
// beginning of this line.
].join("\n"));
twoLineAST.program.body[1] = b.expressionStatement(
b.callExpression(b.identifier("foo"), [])
);
var withFooCall = recast.print(twoLineAST).code;
assert.strictEqual(withFooCall, [
"return",
"foo()"
].join("\n"));
});
});
|
var vows = require('vows')
, assert = require('assert')
, printTestResult = require('../printTestResult.js')
, schema = require('../../index.js')
// Create a Test Suite
vows.describe('Validation Boolean with errors').addBatch({
'Boolean': {
topic: function() {
return {
invalid_inputs: [0, -1, 1, 'false', 'true', 'whatever', NaN, [], {}, /dwa/]
}
},
'invalid input -> [0,-1,1,"false","true","whatever",NaN, [],{},/dwa/]': function(topic) {
topic.invalid_inputs.forEach(function(input) {
var result = schema(Boolean).errors(input);
assert(/(.*) is not Boolean/.test(result), 'Errors should throw : ' + input + ' is not Boolean')
assert(/(.*) is not Boolean/.test(result), 'Errors should throw : ' + input + ' is not Boolean')
})
}
}
}).export(module)
|
"use strict";
const declarationValueIndex = require("../utils/declarationValueIndex");
const isStandardSyntaxDeclaration = require("../utils/isStandardSyntaxDeclaration");
const report = require("../utils/report");
module.exports = function(opts) {
opts.root.walkDecls(decl => {
if (!isStandardSyntaxDeclaration(decl)) {
return;
}
// Get the raw prop, and only the prop
const endOfPropIndex =
declarationValueIndex(decl) + (decl.raws.between || "").length - 1;
// The extra characters tacked onto the end ensure that there is a character to check
// after the colon. Otherwise, with `background:pink` the character after the
const propPlusColon = decl.toString().slice(0, endOfPropIndex) + "xxx";
for (let i = 0, l = propPlusColon.length; i < l; i++) {
if (propPlusColon[i] !== ":") {
continue;
}
opts.locationChecker({
source: propPlusColon,
index: i,
lineCheckStr: decl.value,
err: m => {
report({
message: m,
node: decl,
index: decl.prop.toString().length + 1,
result: opts.result,
ruleName: opts.checkedRuleName
});
}
});
break;
}
});
};
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'fas';
var iconName = 'text-width';
var width = 448;
var height = 512;
var ligatures = [];
var unicode = 'f035';
var svgPathData = 'M16 32h416c8.837 0 16 7.163 16 16v96c0 8.837-7.163 16-16 16h-35.496c-8.837 0-16-7.163-16-16V96H261.743v128H296c8.837 0 16 7.163 16 16v32c0 8.837-7.163 16-16 16H152c-8.837 0-16-7.163-16-16v-32c0-8.837 7.163-16 16-16h34.257V96H67.496v48c0 8.837-7.163 16-16 16H16c-8.837 0-16-7.163-16-16V48c0-8.837 7.163-16 16-16zm427.315 340.682l-80.001-79.995C353.991 283.365 336 288.362 336 304v48H112v-47.99c0-14.307-17.307-21.319-27.314-11.313L4.685 372.692c-6.245 6.245-6.247 16.379 0 22.626l80.001 79.995C94.009 484.635 112 479.638 112 464v-48h224v47.99c0 14.307 17.307 21.319 27.314 11.313l80.001-79.995c6.245-6.245 6.248-16.379 0-22.626z';
exports.definition = {
prefix: prefix,
iconName: iconName,
icon: [
width,
height,
ligatures,
unicode,
svgPathData
]};
exports.faTextWidth = exports.definition;
exports.prefix = prefix;
exports.iconName = iconName;
exports.width = width;
exports.height = height;
exports.ligatures = ligatures;
exports.unicode = unicode;
exports.svgPathData = svgPathData;
|
// English lang variables for WP2.5
tinyMCE.addI18n({en:{
IEFY:{
desc : 'Iframe Embed For Youtube'
}}});
|
// escape html text before displaying on input text
function gdlr_esc_attr(text) {
return text
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
function gdlr_css_name_check(name) {
return name.replace(/[^a-z0-9\-\_]/g, function(s) {
var c = s.charCodeAt(0);
if (c == 32) return '-';
if (c >= 65 && c <= 90) return '';
return '';
});
}
|
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'specialchar', 'el', {
euro: 'Σύμβολο Ευρώ',
lsquo: 'Αριστερός χαρακτήρας μονού εισαγωγικού',
rsquo: 'Δεξιός χαρακτήρας μονού εισαγωγικού',
ldquo: 'Αριστερός χαρακτήρας ευθύγραμμων εισαγωγικών',
rdquo: 'Δεξιός χαρακτήρας ευθύγραμμων εισαγωγικών',
ndash: 'Παύλα en',
mdash: 'Παύλα em',
iexcl: 'Ανάποδο θαυμαστικό',
cent: 'Σύμβολο σεντ',
pound: 'Σύμβολο λίρας',
curren: 'Σύμβολο συναλλαγματικής μονάδας',
yen: 'Σύμβολο Γιεν',
brvbar: 'Σπασμένη μπάρα',
sect: 'Σύμβολο τμήματος',
uml: 'Διαίρεση',
copy: 'Σύμβολο πνευματικών δικαιωμάτων',
ordf: 'Θηλυκός τακτικός δείκτης',
laquo: 'Γωνιώδη εισαγωγικά αριστερής κατάδειξης',
not: 'Σύμβολο άρνησης',
reg: 'Σύμβολο σημάτων κατατεθέν',
macr: 'Μακρόν',
deg: 'Σύμβολο βαθμού',
sup2: 'Εκτεθειμένο δύο',
sup3: 'Εκτεθειμένο τρία',
acute: 'Οξεία',
micro: 'Σύμβολο μικρού',
para: 'Σύμβολο παραγράφου',
middot: 'Μέση τελεία',
cedil: 'Υπογεγραμμένη',
sup1: 'Εκτεθειμένο ένα',
ordm: 'Αρσενικός τακτικός δείκτης',
raquo: 'Γωνιώδη εισαγωγικά δεξιάς κατάδειξης',
frac14: 'Γνήσιο κλάσμα ενός τετάρτου',
frac12: 'Γνήσιο κλάσμα ενός δεύτερου',
frac34: 'Γνήσιο κλάσμα τριών τετάρτων',
iquest: 'Ανάποδο θαυμαστικό',
Agrave: 'Λατινικό κεφαλαίο γράμμα A με βαρεία',
Aacute: 'Λατινικό κεφαλαίο γράμμα A με οξεία',
Acirc: 'Λατινικό κεφαλαίο γράμμα A με περισπωμένη',
Atilde: 'Λατινικό κεφαλαίο γράμμα A με περισπωμένη',
Auml: 'Λατινικό κεφαλαίο γράμμα A με διαλυτικά',
Aring: 'Λατινικό κεφαλαίο γράμμα A με δακτύλιο επάνω',
AElig: 'Λατινικό κεφαλαίο γράμμα Æ',
Ccedil: 'Λατινικό κεφαλαίο γράμμα C με υπογεγραμμένη',
Egrave: 'Λατινικό κεφαλαίο γράμμα E με βαρεία',
Eacute: 'Λατινικό κεφαλαίο γράμμα E με οξεία',
Ecirc: 'Λατινικό κεφαλαίο γράμμα Ε με περισπωμένη ',
Euml: 'Λατινικό κεφαλαίο γράμμα Ε με διαλυτικά',
Igrave: 'Λατινικό κεφαλαίο γράμμα I με βαρεία',
Iacute: 'Λατινικό κεφαλαίο γράμμα I με οξεία',
Icirc: 'Λατινικό κεφαλαίο γράμμα I με περισπωμένη',
Iuml: 'Λατινικό κεφαλαίο γράμμα I με διαλυτικά ',
ETH: 'Λατινικό κεφαλαίο γράμμα Eth',
Ntilde: 'Λατινικό κεφαλαίο γράμμα N με περισπωμένη',
Ograve: 'Λατινικό κεφαλαίο γράμμα O με βαρεία',
Oacute: 'Λατινικό κεφαλαίο γράμμα O με οξεία',
Ocirc: 'Λατινικό κεφαλαίο γράμμα O με περισπωμένη ',
Otilde: 'Λατινικό κεφαλαίο γράμμα O με περισπωμένη',
Ouml: 'Λατινικό κεφαλαίο γράμμα O με διαλυτικά',
times: 'Σύμβολο πολλαπλασιασμού',
Oslash: 'Λατινικό κεφαλαίο γράμμα O με μολυβιά',
Ugrave: 'Λατινικό κεφαλαίο γράμμα U με βαρεία',
Uacute: 'Λατινικό κεφαλαίο γράμμα U με οξεία',
Ucirc: 'Λατινικό κεφαλαίο γράμμα U με περισπωμένη',
Uuml: 'Λατινικό κεφαλαίο γράμμα U με διαλυτικά',
Yacute: 'Λατινικό κεφαλαίο γράμμα Y με οξεία',
THORN: 'Λατινικό κεφαλαίο γράμμα Thorn',
szlig: 'Λατινικό μικρό γράμμα απότομο s',
agrave: 'Λατινικό μικρό γράμμα a με βαρεία',
aacute: 'Λατινικό μικρό γράμμα a με οξεία',
acirc: 'Λατινικό μικρό γράμμα a με περισπωμένη',
atilde: 'Λατινικό μικρό γράμμα a με περισπωμένη',
auml: 'Λατινικό μικρό γράμμα a με διαλυτικά',
aring: 'Λατινικό μικρό γράμμα a με δακτύλιο πάνω',
aelig: 'Λατινικό μικρό γράμμα æ',
ccedil: 'Λατινικό μικρό γράμμα c με υπογεγραμμένη',
egrave: 'Λατινικό μικρό γράμμα ε με βαρεία',
eacute: 'Λατινικό μικρό γράμμα e με οξεία',
ecirc: 'Λατινικό μικρό γράμμα e με περισπωμένη',
euml: 'Λατινικό μικρό γράμμα e με διαλυτικά',
igrave: 'Λατινικό μικρό γράμμα i με βαρεία',
iacute: 'Λατινικό μικρό γράμμα i με οξεία',
icirc: 'Λατινικό μικρό γράμμα i με περισπωμένη',
iuml: 'Λατινικό μικρό γράμμα i με διαλυτικά',
eth: 'Λατινικό μικρό γράμμα eth',
ntilde: 'Λατινικό μικρό γράμμα n με περισπωμένη',
ograve: 'Λατινικό μικρό γράμμα o με βαρεία',
oacute: 'Λατινικό μικρό γράμμα o με οξεία ',
ocirc: 'Λατινικό πεζό γράμμα o με περισπωμένη',
otilde: 'Λατινικό μικρό γράμμα o με περισπωμένη ',
ouml: 'Λατινικό μικρό γράμμα o με διαλυτικά',
divide: 'Σύμβολο διαίρεσης',
oslash: 'Λατινικό μικρό γράμμα o με περισπωμένη',
ugrave: 'Λατινικό μικρό γράμμα u με βαρεία',
uacute: 'Λατινικό μικρό γράμμα u με οξεία',
ucirc: 'Λατινικό μικρό γράμμα u με περισπωμένη',
uuml: 'Λατινικό μικρό γράμμα u με διαλυτικά',
yacute: 'Λατινικό μικρό γράμμα y με οξεία',
thorn: 'Λατινικό μικρό γράμμα thorn',
yuml: 'Λατινικό μικρό γράμμα y με διαλυτικά',
OElig: 'Λατινικό κεφαλαίο σύμπλεγμα ΟΕ',
oelig: 'Λατινικό μικρό σύμπλεγμα oe',
'372': 'Λατινικό κεφαλαίο γράμμα W με περισπωμένη',
'374': 'Λατινικό κεφαλαίο γράμμα Y με περισπωμένη',
'373': 'Λατινικό μικρό γράμμα w με περισπωμένη',
'375': 'Λατινικό μικρό γράμμα y με περισπωμένη',
sbquo: 'Ενιαίο χαμηλο -9 εισαγωγικό ',
'8219': 'Ενιαίο υψηλο ανεστραμμένο-9 εισαγωγικό ',
bdquo: 'Διπλό χαμηλό-9 εισαγωγικό ',
hellip: 'Οριζόντια αποσιωπητικά',
trade: 'Σύμβολο εμπορικού κατατεθέν',
'9658': 'Μαύρος δείκτης που δείχνει προς τα δεξιά',
bull: 'Κουκκίδα',
rarr: 'Δεξί βελάκι',
rArr: 'Διπλό δεξί βελάκι',
hArr: 'Διπλό βελάκι αριστερά-δεξιά',
diams: 'Μαύρο διαμάντι',
asymp: 'Σχεδόν ίσο με'
} );
|
chorus.views.PrimaryActionPanel = chorus.views.Base.include(
chorus.Mixins.ActionPanel
).extend({
constructorName: "PrimaryActionPanel",
templateName: "primary_action_panel",
setup: function (options) {
this.actions = this.options.actions || [];
this.events = this.eventBindings(options.actions);
},
additionalContext: function () {
return { actions: _.map(this.actions, this.templateValues) };
}
});
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 11.13.2-19-s
description: >
ReferenceError isn't thrown if the LeftHandSideExpression of a Compound
Assignment operator(+=) evaluates to a resolvable reference
---*/
var _11_13_2_19 = -1
_11_13_2_19 += 10;
assert.sameValue(_11_13_2_19, 9, '_11_13_2_19');
|
/**
* @fileoverview Require or disallow newline at the end of files
* @author Nodeca Team <https://github.com/nodeca>
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "layout",
docs: {
description: "require or disallow newline at the end of files",
recommended: false,
url: "https://eslint.org/docs/rules/eol-last"
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never", "unix", "windows"]
}
],
messages: {
missing: "Newline required at end of file but not found.",
unexpected: "Newline not allowed at end of file."
}
},
create(context) {
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program: function checkBadEOF(node) {
const sourceCode = context.getSourceCode(),
src = sourceCode.getText(),
lastLine = sourceCode.lines[sourceCode.lines.length - 1],
location = {
column: lastLine.length,
line: sourceCode.lines.length
},
LF = "\n",
CRLF = `\r${LF}`,
endsWithNewline = src.endsWith(LF);
/*
* Empty source is always valid: No content in file so we don't
* need to lint for a newline on the last line of content.
*/
if (!src.length) {
return;
}
let mode = context.options[0] || "always",
appendCRLF = false;
if (mode === "unix") {
// `"unix"` should behave exactly as `"always"`
mode = "always";
}
if (mode === "windows") {
// `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility
mode = "always";
appendCRLF = true;
}
if (mode === "always" && !endsWithNewline) {
// File is not newline-terminated, but should be
context.report({
node,
loc: location,
messageId: "missing",
fix(fixer) {
return fixer.insertTextAfterRange([0, src.length], appendCRLF ? CRLF : LF);
}
});
} else if (mode === "never" && endsWithNewline) {
const secondLastLine = sourceCode.lines[sourceCode.lines.length - 2];
// File is newline-terminated, but shouldn't be
context.report({
node,
loc: {
start: { line: sourceCode.lines.length - 1, column: secondLastLine.length },
end: { line: sourceCode.lines.length, column: 0 }
},
messageId: "unexpected",
fix(fixer) {
const finalEOLs = /(?:\r?\n)+$/u,
match = finalEOLs.exec(sourceCode.text),
start = match.index,
end = sourceCode.text.length;
return fixer.replaceTextRange([start, end], "");
}
});
}
}
};
}
};
|
"use strict";
var Visitor = require("./visitor")["default"];
function print(ast) {
return new PrintVisitor().accept(ast);
}
exports.print = print;function PrintVisitor() {
this.padding = 0;
}
exports.PrintVisitor = PrintVisitor;PrintVisitor.prototype = new Visitor();
PrintVisitor.prototype.pad = function(string, newline) {
var out = "";
for(var i=0,l=this.padding; i<l; i++) {
out = out + " ";
}
out = out + string;
if(newline !== false) { out = out + "\n"; }
return out;
};
PrintVisitor.prototype.program = function(program) {
var out = "",
statements = program.statements,
i, l;
for(i=0, l=statements.length; i<l; i++) {
out = out + this.accept(statements[i]);
}
this.padding--;
return out;
};
PrintVisitor.prototype.block = function(block) {
var out = "";
out = out + this.pad("BLOCK:");
this.padding++;
out = out + this.accept(block.mustache);
if (block.program) {
out = out + this.pad("PROGRAM:");
this.padding++;
out = out + this.accept(block.program);
this.padding--;
}
if (block.inverse) {
if (block.program) { this.padding++; }
out = out + this.pad("{{^}}");
this.padding++;
out = out + this.accept(block.inverse);
this.padding--;
if (block.program) { this.padding--; }
}
this.padding--;
return out;
};
PrintVisitor.prototype.sexpr = function(sexpr) {
var params = sexpr.params, paramStrings = [], hash;
for(var i=0, l=params.length; i<l; i++) {
paramStrings.push(this.accept(params[i]));
}
params = "[" + paramStrings.join(", ") + "]";
hash = sexpr.hash ? " " + this.accept(sexpr.hash) : "";
return this.accept(sexpr.id) + " " + params + hash;
};
PrintVisitor.prototype.mustache = function(mustache) {
return this.pad("{{ " + this.accept(mustache.sexpr) + " }}");
};
PrintVisitor.prototype.partial = function(partial) {
var content = this.accept(partial.partialName);
if(partial.context) { content = content + " " + this.accept(partial.context); }
return this.pad("{{> " + content + " }}");
};
PrintVisitor.prototype.hash = function(hash) {
var pairs = hash.pairs;
var joinedPairs = [], left, right;
for(var i=0, l=pairs.length; i<l; i++) {
left = pairs[i][0];
right = this.accept(pairs[i][1]);
joinedPairs.push( left + "=" + right );
}
return "HASH{" + joinedPairs.join(", ") + "}";
};
PrintVisitor.prototype.STRING = function(string) {
return '"' + string.string + '"';
};
PrintVisitor.prototype.INTEGER = function(integer) {
return "INTEGER{" + integer.integer + "}";
};
PrintVisitor.prototype.BOOLEAN = function(bool) {
return "BOOLEAN{" + bool.bool + "}";
};
PrintVisitor.prototype.ID = function(id) {
var path = id.parts.join("/");
if(id.parts.length > 1) {
return "PATH:" + path;
} else {
return "ID:" + path;
}
};
PrintVisitor.prototype.PARTIAL_NAME = function(partialName) {
return "PARTIAL:" + partialName.name;
};
PrintVisitor.prototype.DATA = function(data) {
return "@" + this.accept(data.id);
};
PrintVisitor.prototype.content = function(content) {
return this.pad("CONTENT[ '" + content.string + "' ]");
};
PrintVisitor.prototype.comment = function(comment) {
return this.pad("{{! '" + comment.comment + "' }}");
};
|
var gulp = require('gulp');
// include plug-ins
var concat = require('gulp-concat'),
stripDebug = require('gulp-strip-debug'),
uglify = require('gulp-uglify'),
autoprefix = require('gulp-autoprefixer'),
minifyCSS = require('gulp-minify-css'),
filesize = require('gulp-filesize'),
rename = require('gulp-rename'),
less = require('gulp-less'),
del = require('del'),
livereload = require('gulp-livereload'),
notify = require("gulp-notify"),
clasticNamespace = require('./vendor/clastic/core-bundle/Resources/scripts/Clastic.js');
clasticNamespace();
var paths = {
'styles': {
'app': [
'web/vendor/multiselect/css/multi-select.css',
'vendor/clastic/*/Resources/public/styles/**.less',
'vendor/clastic/*/Resources/public/styles/*/*.less'
],
'main': 'vendor/clastic/*/Resources/public/styles/style.less'
},
'scripts': {
'vendor': [
'vendor/clastic/*/Resources/public/scripts/**.config.js',
'http://getbootstrap.com/assets/js/ie10-viewport-bug-workaround.js'
],
'app': [
'vendor/clastic/*/Resources/public/scripts/**.js'
]
},
'templates': 'src/**/*.twig',
'build': 'web/build/'
};
var clastic = new Clastic.Clastic();
var rootDir = __dirname + '/vendor/clastic';
paths = clastic.resolvePaths(paths, rootDir);
var errorHandler = notify.onError(function (err) {
return "Error: " + err.message;
});
gulp.task('default', ['clean', 'build', 'watch']);
gulp.task('clean', function (cb) {
del([
paths.build + '/**'
], cb);
});
gulp.task('build', ['scripts', 'styles']);
gulp.task('watch', function() {
gulp.watch(paths.scripts.vendor, ['scripts:vendor']);
gulp.watch(paths.scripts.app, ['scripts:app']);
gulp.watch(paths.styles.vendor, ['styles:vendor']);
gulp.watch(paths.styles.app, ['styles:app']);
livereload.listen();
gulp.watch([paths.build + '**', paths.templates])
.on('change', livereload.changed);
});
gulp.task('scripts', ['scripts:vendor', 'scripts:app']);
gulp.task('scripts:vendor', function() {
gulp.src(paths.scripts.vendor)
.pipe(concat('vendor.js'))
.pipe(stripDebug())
.pipe(uglify())
.pipe(rename('vendor.min.js'))
.pipe(gulp.dest(paths.build))
.pipe(filesize());
});
gulp.task('scripts:app', function() {
gulp.src(paths.scripts.app)
.pipe(concat('app.js'))
.pipe(stripDebug())
.pipe(uglify())
.on('error', errorHandler)
.pipe(rename('app.min.js'))
.pipe(gulp.dest(paths.build))
.pipe(filesize());
});
// CSS concat, auto-prefix and minify
gulp.task('styles', ['styles:app']);
gulp.task('styles:app', function() {
gulp.src(paths.styles.main)
.pipe(less())
.on('error', errorHandler)
.pipe(concat('app.css'))
.pipe(autoprefix('last 1 versions'))
.pipe(minifyCSS({
keepSpecialComments: 0
}))
.pipe(rename('app.min.css'))
.pipe(gulp.dest(paths.build))
.pipe(filesize());
});
|
var parent = require('../../stable/reflect/get');
module.exports = parent;
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("stream");
const fsStat = require("@nodelib/fs.stat");
const fsWalk = require("@nodelib/fs.walk");
const reader_1 = require("./reader");
class ReaderStream extends reader_1.default {
constructor() {
super(...arguments);
this._walkStream = fsWalk.walkStream;
this._stat = fsStat.stat;
}
dynamic(root, options) {
return this._walkStream(root, options);
}
static(patterns, options) {
const filepaths = patterns.map(this._getFullEntryPath, this);
const stream = new stream_1.PassThrough({ objectMode: true });
stream._write = (index, _enc, done) => {
return this._getEntry(filepaths[index], patterns[index], options)
.then((entry) => {
if (entry !== null && options.entryFilter(entry)) {
stream.push(entry);
}
if (index === filepaths.length - 1) {
stream.end();
}
done();
})
.catch(done);
};
for (let i = 0; i < filepaths.length; i++) {
stream.write(i);
}
return stream;
}
_getEntry(filepath, pattern, options) {
return this._getStat(filepath)
.then((stats) => this._makeEntry(stats, pattern))
.catch((error) => {
if (options.errorFilter(error)) {
return null;
}
throw error;
});
}
_getStat(filepath) {
return new Promise((resolve, reject) => {
this._stat(filepath, this._fsStatSettings, (error, stats) => {
return error === null ? resolve(stats) : reject(error);
});
});
}
}
exports.default = ReaderStream;
|
CKEDITOR.plugins.setLang("imagebase","ro",{captionPlaceholder:"Introduceți titlul imaginii"});
|
/// 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.12.3-5-b-i-1",
path: "TestCases/chapter15/15.12/15.12.3/15.12.3-5-b-i-1.js",
description: "JSON.stringify converts String wrapper object space aruguments to String values",
test: function testcase() {
var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'};
return JSON.stringify(obj,null, new String('xxx'))=== JSON.stringify(obj,null, 'xxx');
},
precondition: function preq () {
return JSON && fnExists(JSON.stringify);
}
} );
|
/**
* 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 {Services} from '../../../src/services';
import {assertHttpsUrl} from '../../../src/url';
import {dev, devAssert, userAssert} from '../../../src/log';
import {dict} from '../../../src/utils/object';
import {getMode} from '../../../src/mode';
/** @const {string} */
const TAG = 'amp-access-client';
/** @const {number} */
const DEFAULT_AUTHORIZATION_TIMEOUT = 3000;
/** @implements {./amp-access-source.AccessTypeAdapterDef} */
export class AccessClientAdapter {
/**
* @param {!../../../src/service/ampdoc-impl.AmpDoc} ampdoc
* @param {!JsonObject} configJson
* @param {!./amp-access-source.AccessTypeAdapterContextDef} context
*/
constructor(ampdoc, configJson, context) {
/** @const */
this.ampdoc = ampdoc;
/** @const @private {!./amp-access-source.AccessTypeAdapterContextDef} */
this.context_ = context;
/** @const @private {string} */
this.authorizationUrl_ = userAssert(
configJson['authorization'],
'"authorization" URL must be specified'
);
assertHttpsUrl(this.authorizationUrl_, '"authorization"');
/** @const @private {boolean} */
this.isPingbackEnabled_ = !configJson['noPingback'];
/** @const @private {string} */
this.pingbackUrl_ = configJson['pingback'];
if (this.isPingbackEnabled_) {
userAssert(this.pingbackUrl_, '"pingback" URL must be specified');
assertHttpsUrl(this.pingbackUrl_, '"pingback"');
}
/** @const @private {number} */
this.authorizationTimeout_ = this.buildConfigAuthorizationTimeout_(
configJson
);
/** @const @private {!../../../src/service/xhr-impl.Xhr} */
this.xhr_ = Services.xhrFor(ampdoc.win);
/** @const @private {!../../../src/service/timer-impl.Timer} */
this.timer_ = Services.timerFor(ampdoc.win);
}
/**
* @param {!JsonObject} configJson
* @return {number}
*/
buildConfigAuthorizationTimeout_(configJson) {
if (!configJson['authorizationTimeout']) {
return DEFAULT_AUTHORIZATION_TIMEOUT;
}
let timeout = configJson['authorizationTimeout'];
userAssert(
typeof timeout == 'number',
'"authorizationTimeout" must be a number'
);
if (!(getMode().localDev || getMode().development)) {
timeout = Math.min(timeout, DEFAULT_AUTHORIZATION_TIMEOUT);
}
return timeout;
}
/** @override */
getConfig() {
return {
'authorizationUrl': this.authorizationUrl_,
'pingbackEnabled': this.isPingbackEnabled_,
'pingbackUrl': this.pingbackUrl_,
'authorizationTimeout': this.authorizationTimeout_,
};
}
/**
* @return {string}
*/
getAuthorizationUrl() {
return this.authorizationUrl_;
}
/** @override */
isAuthorizationEnabled() {
return true;
}
/**
* @return {number}
*/
getAuthorizationTimeout() {
return this.authorizationTimeout_;
}
/** @override */
authorize() {
dev().fine(TAG, 'Start authorization via ', this.authorizationUrl_);
const urlPromise = this.context_.buildUrl(
this.authorizationUrl_,
/* useAuthData */ false
);
return urlPromise.then((url) => {
dev().fine(TAG, 'Authorization URL: ', url);
return this.timer_
.timeoutPromise(
this.authorizationTimeout_,
this.xhr_.fetchJson(url, {
credentials: 'include',
})
)
.then((res) => res.json());
});
}
/** @override */
isPingbackEnabled() {
return this.isPingbackEnabled_;
}
/** @override */
pingback() {
const promise = this.context_.buildUrl(
devAssert(this.pingbackUrl_),
/* useAuthData */ true
);
return promise.then((url) => {
dev().fine(TAG, 'Pingback URL: ', url);
return this.xhr_.sendSignal(url, {
method: 'POST',
credentials: 'include',
headers: dict({
'Content-Type': 'application/x-www-form-urlencoded',
}),
body: '',
});
});
}
/** @override */
postAction() {
// Nothing to do.
}
}
|
/*
* 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.
*/
import 'mocha';
import {assert} from 'chai';
import {spy} from 'sinon';
import {ListEditableAddItemButton as Ctrl} from './component';
suite('list-editable-add-item-button component', () => {
test.skip('has addItem method with correct locals', () => {
const i = new Ctrl();
i._listEditable = {
ngModel: {
editListItem: spy()
}
};
i._listEditable.ngModel.editListItem.bind = spy(() => i._listEditable.ngModel.editListItem);
i._addItem = spy();
i.addItem();
assert.isOk(i._addItem.calledOnce);
assert.deepEqual(i._addItem.lastCall.args[0], {
$edit: i._listEditable.ngModel.editListItem
});
});
test('inserts button after list-editable', () => {
Ctrl.hasItemsTemplate = 'tpl';
const $scope = {};
const clone = {
insertAfter: spy()
};
const $transclude = spy((scope, attach) => attach(clone));
const $compile = spy(() => $transclude);
const i = new Ctrl($compile, $scope);
i._listEditable = {
ngModel: {
editListItem: spy(),
$element: {}
}
};
i.$postLink();
assert.isOk($compile.calledOnce);
assert.equal($compile.lastCall.args[0], Ctrl.hasItemsTemplate);
assert.equal($transclude.lastCall.args[0], $scope);
assert.equal(clone.insertAfter.lastCall.args[0], i._listEditable.$element);
});
test('exposes hasItems getter', () => {
const i = new Ctrl();
i._listEditable = {
ngModel: {
$isEmpty: spy((v) => !v.length),
$viewValue: [1, 2, 3]
}
};
assert.isOk(i.hasItems);
i._listEditable.ngModel.$viewValue = [];
assert.isNotOk(i.hasItems);
});
});
|
/*
* Copyright 2012 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
|
'use strict';
var React = require('react/addons');
var PureRenderMixin = React.addons.PureRenderMixin;
var SvgIcon = require('../../svg-icon');
var AvAlbum = React.createClass({
displayName: 'AvAlbum',
mixins: [PureRenderMixin],
render: function render() {
return React.createElement(
SvgIcon,
this.props,
React.createElement('path', { d: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 14.5c-2.49 0-4.5-2.01-4.5-4.5S9.51 7.5 12 7.5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-5.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z' })
);
}
});
module.exports = AvAlbum;
|
require('../../modules/es.array.iterator');
require('../../modules/es.object.to-string');
require('../../modules/es.string.iterator');
require('../../modules/es.symbol.iterator');
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
module.exports = WrappedWellKnownSymbolModule.f('iterator');
|
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'basicstyles', 'it', {
bold: 'Grassetto',
italic: 'Corsivo',
strike: 'Barrato',
subscript: 'Pedice',
superscript: 'Apice',
underline: 'Sottolineato'
});
|
import {logSettings as ActionTypes} from "../constants/actionTypes";
import ApplicationService from "../services/applicationService";
const logSettingsActions = {
getKeepMostRecentOptions(callback) {
return (dispatch) => {
ApplicationService.getKeepMostRecentOptions(data => {
dispatch({
type: ActionTypes.RETRIEVED_KEEPMOSTRECENT_OPTIONS,
data: {
keepMostRecent: data.Results
}
});
if (callback) {
callback(data);
}
});
};
},
getOccurrenceOptions(callback) {
return (dispatch) => {
ApplicationService.getOccurrenceOptions(data => {
dispatch({
type: ActionTypes.RETRIEVED_OCCURRENCE_OPTIONS,
data: {
thresholds: data.Results.Thresholds,
notificationTimes: data.Results.NotificationTimes,
notificationTimeTypes: data.Results.NotificationTimeTypes
}
});
if (callback) {
callback(data);
}
});
};
},
getLogSettings(callback) {
return (dispatch) => {
ApplicationService.getLogSettings(data => {
dispatch({
type: ActionTypes.RETRIEVED_LOGSETTING_LIST,
data: {
logSettingList: data.Results
}
});
if (callback) {
callback(data);
}
});
};
},
getLogSettingById(parameters, callback) {
return (dispatch) => {
ApplicationService.getLogSettingById(parameters, data => {
dispatch({
type: ActionTypes.RETRIEVED_LOGSETTING_BY_ID,
data: {
logSettingDetail: data
}
});
if (callback) {
callback(data);
}
});
};
},
updateLogSetting(payload, callback, failureCallback) {
return (dispatch) => {
ApplicationService.updateLogSetting(payload, data => {
dispatch({
type: ActionTypes.UPDATED_LOGSETTING,
data: {
logSettingDetail: data
}
});
if (callback) {
callback(data);
}
}, data => {
if (failureCallback) {
failureCallback(data);
}
});
};
},
addLogSetting(payload, callback, failureCallback) {
return (dispatch) => {
ApplicationService.addLogSetting(payload, data => {
dispatch({
type: ActionTypes.ADDED_LOGSETTING,
data: {
logSettingDetail: data
}
});
if (callback) {
callback(data);
}
}, data => {
if (failureCallback) {
failureCallback(data);
}
});
};
},
deleteLogSetting(payload, callback, failureCallback) {
return (dispatch) => {
ApplicationService.deleteLogSetting(payload, data => {
dispatch({
type: ActionTypes.DELETED_LOGSETTING,
data: {
Success: data.Success,
LogSettingId: data.LogSettingId
}
});
if (callback) {
callback(data);
}
}, data => {
if (failureCallback) {
failureCallback(data);
}
});
};
}
};
export default logSettingsActions;
|
'use strict';
var React = require('react/addons');
var PureRenderMixin = React.addons.PureRenderMixin;
var SvgIcon = require('../../svg-icon');
var ToggleStarBorder = React.createClass({
displayName: 'ToggleStarBorder',
mixins: [PureRenderMixin],
render: function render() {
return React.createElement(
SvgIcon,
this.props,
React.createElement('path', { d: 'M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z' })
);
}
});
module.exports = ToggleStarBorder;
|
'use strict';
const expect = require('../../chai').expect;
const map = require('ember-cli-lodash-subset').map;
const commandOptions = require('../../factories/command-options');
const NewCommand = require('../../../lib/commands/new');
const Blueprint = require('../../../lib/models/blueprint');
const Command = require('../../../lib/models/command');
const Task = require('../../../lib/models/task');
const td = require('testdouble');
describe('new command', function () {
let command;
beforeEach(function () {
let options = commandOptions({
project: {
isEmberCLIProject() {
return false;
},
blueprintLookupPaths() {
return [];
},
},
});
command = new NewCommand(options);
td.replace(Blueprint, 'lookup', td.function());
});
afterEach(function () {
td.reset();
});
it("doesn't allow to create an application named `test`", async function () {
let { message } = await expect(command.validateAndRun(['test'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `test`.');
});
it("doesn't allow to create an application named `ember`", async function () {
let { message } = await expect(command.validateAndRun(['ember'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `ember`.');
});
it("doesn't allow to create an application named `Ember`", async function () {
let { message } = await expect(command.validateAndRun(['Ember'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `Ember`.');
});
it("doesn't allow to create an application named `ember-cli`", async function () {
let { message } = await expect(command.validateAndRun(['ember-cli'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `ember-cli`.');
});
it("doesn't allow to create an application named `vendor`", async function () {
let { message } = await expect(command.validateAndRun(['vendor'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `vendor`.');
});
it("doesn't allow to create an application with a period in the name", async function () {
let { message } = await expect(command.validateAndRun(['zomg.awesome'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `zomg.awesome`.');
});
it("doesn't allow to create an application with a name beginning with a number", async function () {
let { message } = await expect(command.validateAndRun(['123-my-bagel'])).to.be.rejected;
expect(message).to.equal('We currently do not support a name of `123-my-bagel`.');
});
it('shows a suggestion messages when the application name is a period', async function () {
let { message } = await expect(command.validateAndRun(['.'])).to.be.rejected;
expect(message).to.equal(
`Trying to generate an application structure in this directory? Use \`ember init\` instead.`
);
});
it('registers blueprint options in beforeRun', function () {
td.when(Blueprint.lookup('app'), { ignoreExtraArgs: true }).thenReturn({
availableOptions: [{ name: 'custom-blueprint-option', type: String }],
});
command.beforeRun(['app']);
expect(map(command.availableOptions, 'name')).to.contain('custom-blueprint-option');
});
it('passes command options through to init command', async function () {
command.tasks.CreateAndStepIntoDirectory = Task.extend({
run() {
return Promise.resolve();
},
});
command.commands.Init = Command.extend({
run(commandOptions) {
expect(commandOptions).to.contain.keys('customOption');
expect(commandOptions.customOption).to.equal('customValue');
return Promise.resolve('Called run');
},
});
td.when(Blueprint.lookup('app'), { ignoreExtraArgs: true }).thenReturn({
availableOptions: [{ name: 'custom-blueprint-option', type: String }],
});
let reason = await command.validateAndRun(['foo', '--custom-option=customValue']);
expect(reason).to.equal('Called run');
});
});
|
{
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
def(target, key, src[key]);
}
}
|
/*=============================================================
************ Hide/show Toolbar/Navbar on scroll ************
=============================================================*/
app.initScrollToolbars = function (pageContainer) {
pageContainer = $(pageContainer);
var scrollContent = pageContainer.find('.page-content');
if (scrollContent.length === 0) return;
var hideNavbar = app.params.hideNavbarOnPageScroll || scrollContent.hasClass('hide-navbar-on-scroll') || scrollContent.hasClass('hide-bars-on-scroll');
var hideToolbar = app.params.hideToolbarOnPageScroll || scrollContent.hasClass('hide-toolbar-on-scroll') || scrollContent.hasClass('hide-bars-on-scroll');
var hideTabbar = app.params.hideTabbarOnPageScroll || scrollContent.hasClass('hide-tabbar-on-scroll');
if (!(hideNavbar || hideToolbar || hideTabbar)) return;
var viewContainer = scrollContent.parents('.' + app.params.viewClass);
if (viewContainer.length === 0) return;
var navbar = viewContainer.find('.navbar'),
toolbar = viewContainer.find('.toolbar'),
tabbar;
if (hideTabbar) {
tabbar = viewContainer.find('.tabbar');
if (tabbar.length === 0) tabbar = viewContainer.parents('.' + app.params.viewsClass).find('.tabbar');
}
var hasNavbar = navbar.length > 0,
hasToolbar = toolbar.length > 0,
hasTabbar = tabbar && tabbar.length > 0;
var previousScroll, currentScroll;
previousScroll = currentScroll = scrollContent[0].scrollTop;
var scrollHeight, offsetHeight, reachEnd, action, navbarHidden, toolbarHidden, tabbarHidden;
var toolbarHeight = (hasToolbar && hideToolbar) ? toolbar[0].offsetHeight : 0;
var tabbarHeight = (hasTabbar && hideTabbar) ? tabbar[0].offsetHeight : 0;
var bottomBarHeight = tabbarHeight || toolbarHeight;
function handleScroll(e) {
if (pageContainer.hasClass('page-on-left')) return;
currentScroll = scrollContent[0].scrollTop;
scrollHeight = scrollContent[0].scrollHeight;
offsetHeight = scrollContent[0].offsetHeight;
reachEnd = app.params.showBarsOnPageScrollEnd && (currentScroll + offsetHeight >= scrollHeight - bottomBarHeight);
navbarHidden = navbar.hasClass('navbar-hidden');
toolbarHidden = toolbar.hasClass('toolbar-hidden');
tabbarHidden = tabbar && tabbar.hasClass('toolbar-hidden');
if (previousScroll > currentScroll || reachEnd) {
action = 'show';
}
else {
if (currentScroll > 44) {
action = 'hide';
}
else {
action = 'show';
}
}
if (action === 'show') {
if (hasNavbar && hideNavbar && navbarHidden) {
app.showNavbar(navbar);
pageContainer.removeClass('no-navbar-by-scroll');
navbarHidden = false;
}
if (hasToolbar && hideToolbar && toolbarHidden) {
app.showToolbar(toolbar);
pageContainer.removeClass('no-toolbar-by-scroll');
toolbarHidden = false;
}
if (hasTabbar && hideTabbar && tabbarHidden) {
app.showToolbar(tabbar);
pageContainer.removeClass('no-tabbar-by-scroll');
tabbarHidden = false;
}
}
else {
if (hasNavbar && hideNavbar && !navbarHidden) {
app.hideNavbar(navbar);
pageContainer.addClass('no-navbar-by-scroll');
navbarHidden = true;
}
if (hasToolbar && hideToolbar && !toolbarHidden) {
app.hideToolbar(toolbar);
pageContainer.addClass('no-toolbar-by-scroll');
toolbarHidden = true;
}
if (hasTabbar && hideTabbar && !tabbarHidden) {
app.hideToolbar(tabbar);
pageContainer.addClass('no-tabbar-by-scroll');
tabbarHidden = true;
}
}
previousScroll = currentScroll;
}
scrollContent.on('scroll', handleScroll);
scrollContent[0].f7ScrollToolbarsHandler = handleScroll;
};
app.destroyScrollToolbars = function (pageContainer) {
pageContainer = $(pageContainer);
var scrollContent = pageContainer.find('.page-content');
if (scrollContent.length === 0) return;
var handler = scrollContent[0].f7ScrollToolbarsHandler;
if (!handler) return;
scrollContent.off('scroll', scrollContent[0].f7ScrollToolbarsHandler);
};
|
/*
* @package jsDAV
* @subpackage CardDAV
* @copyright Copyright(c) 2013 Mike de Boer. <info AT mikedeboer DOT nl>
* @author Mike de Boer <info AT mikedeboer DOT nl>
* @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
*/
"use strict";
var jsDAV_iCollection = require("./../../DAV/interfaces/iCollection");
var Exc = require("./../../shared/exceptions");
/**
* Calendar interface
*
* Implement this interface to allow a node to be recognized as a Calendar
*/
var jsCalDAV_iCalendar = module.exports = jsDAV_iCollection.extend({
/**
* Performs a calendar-query on the contents of this calendar.
*
* The calendar-query is defined in RFC4791 : CalDAV. Using the
* calendar-query it is possible for a client to request a specific set of
* object, based on contents of iCalendar properties, date-ranges and
* iCalendar component types (VTODO, VEVENT).
*
* This method should just return a list of (relative) urls that match this
* query.
*
* The list of filters are specified as an array. The exact array is
* documented by jsCalDAV_CalendarQueryParser.
*
* @param {Array} filters
* @return array
*/
calendarQuery: function(filters, callback) {
callback(Exc.notImplementedYet("iCalendar.calendarQuery is not implemented"));
}
});
|
require.config({
baseUrl: '/static/javascripts/',
paths: {
'jquery': 'libs/jquery-2.1.3.min',
'sweetAlert': 'libs/sweet-alert.min',
'select2': 'libs/select2.min',
'mousetrap': 'libs/mousetrap.min',
'listItems': 'libs/effeckt/list-items',
},
shim: {
}
});
require(['login', 'keyboard'], function(Login, Keyboard){
var login = Login();
Keyboard(login);
});
|
/*
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)
*/
Ext.define('Ext.rtl.selection.CellModel', {
override: 'Ext.selection.CellModel',
doMove: function(direction, e) {
if (this.view.getHierarchyState().rtl) {
if (direction == 'left') {
direction = 'right';
} else if (direction == 'right') {
direction = 'left';
}
}
this.callParent([direction, e]);
}
})
|
(function(){
// module factory: start
var moduleFactory = function($) {
// module body: start
var module = this;
$.require()
.script("mvc/dom.cookie","mvc/model.list")
.done(function() {
var exports = function() {
/**
* @class jQuery.Model.List.Local
* @plugin jquery/model/list/local
* @download http://jmvcsite.heroku.com/pluginify?plugins[]=jquery/model/list/local/local.js
* @parent jQuery.Model.List
* Works exactly the same as [jQuery.Model.List.Cookie] except uses
* a local store instead of cookies.
*/
$.Model.List($.globalNamespace + ".Model.List.Local",
{
retrieve : function(name){
// each also needs what they are referencd by ?
var props = window.localStorage[ name ] || "[]",
instances = [],
Class = props.type ? $.String.getObject(props.type) : null;
for(var i =0; i < props.ids.length;i++){
var identity = props.ids[i],
instanceData = window.localStorage[ identity ];
instances.push( new Class(instanceData) )
}
this.push.apply(this,instances);
return this;
},
store : function(name){
// go through and listen to instance updating
var ids = [], days = this.days;
this.each(function(i, inst){
window.localStorage[inst.identity()] = instance.attrs();
ids.push(inst.identity());
});
window.localStorage[name] = {
type: this[0] && this[0].constructor.fullName,
ids: ids
};
return this;
}
});
};
exports();
module.resolveWith(exports);
});
// module body: end
};
// module factory: end
dispatch("mvc/model.list.local")
.containing(moduleFactory)
.to("Foundry/2.1 Modules");
}());
|
define(['jath'], function(Jath){
Jath.resolver = function( prefix ) {
var mappings = {
def: "http://www.idpf.org/2007/opf",
dc: "http://purl.org/dc/elements/1.1/"
};
return mappings[ prefix ];
}
var jathTemplate = {
metadata: {
id: "//def:metadata/dc:identifier",
epub_version: "//def:package/@version",
title: "//def:metadata/dc:title",
author: "//def:metadata/dc:creator",
publisher: "//def:metadata/dc:publisher",
description: "//def:metadata/dc:description",
rights: "//def:metadata/dc:rights",
language: "//def:metadata/dc:language",
pubdate: "//def:metadata/dc:date",
modified_date: "//def:metadata/def:meta[@property='dcterms:modified']",
layout: "//def:metadata/def:meta[@property='rendition:layout']",
spread: "//def:metadata/def:meta[@property='rendition:spread']",
orientation: "//def:metadata/def:meta[@property='rendition:orientation']",
ncx: "//def:spine/@toc",
page_prog_dir: "//def:spine/@page-progression-direction",
active_class: "//def:metadata/def:meta[@property='media:active-class']"
},
manifest: [ "//def:item", {
id: "@id",
href: "@href",
media_type: "@media-type",
properties: "@properties",
media_overlay: "@media-overlay"
} ],
spine: [ "//def:itemref", { idref: "@idref", properties: "@properties", linear: "@linear" } ],
bindings: ["//def:bindings/def:mediaType", {
handler: "@handler",
media_type: "@media-type"
} ]
};
PackageParser = {
parsePackageDom : function(data){
var jsonObj = Jath.parse(jathTemplate, data);
jsonObj = jsonObj.metadata;
jsonObj.coverHref = PackageParser.getCoverHref(data);
return jsonObj;
},
getCoverHref : function(dom) {
var manifest; var $imageNode;
manifest = dom.getElementsByTagName('manifest')[0];
// epub3 spec for a cover image is like this:
/*<item properties="cover-image" id="ci" href="cover.svg" media-type="image/svg+xml" />*/
$imageNode = $('item[properties~="cover-image"]', manifest);
if($imageNode.length === 1 && $imageNode.attr("href") ) {
return $imageNode.attr("href");
}
// some epub2's cover image is like this:
/*<meta name="cover" content="cover-image-item-id" />*/
// PragProg ebooks have two cover entries in meta, both
// referencing the same cover id from items; metaNode.length
// does not have to be just 1
var metaNode = $('meta[name="cover"]', dom);
var contentAttr = metaNode.attr("content");
if(metaNode.length >= 1 && contentAttr) {
$imageNode = $('item[id="'+contentAttr+'"]', manifest);
if($imageNode.length === 1 && $imageNode.attr("href")) {
return $imageNode.attr("href");
}
}
// that didn't seem to work so, it think epub2 just uses item with id=cover
$imageNode = $('#cover', manifest);
if($imageNode.length === 1 && $imageNode.attr("href")) {
return $imageNode.attr("href");
}
// seems like there isn't one, thats ok...
return null;
},
}
return PackageParser;
})
|
/*
Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dijit.Toolbar"]){
dojo._hasResource["dijit.Toolbar"]=true;
dojo.provide("dijit.Toolbar");
dojo.require("dijit._Widget");
dojo.require("dijit._KeyNavContainer");
dojo.require("dijit._Templated");
dojo.declare("dijit.Toolbar",[dijit._Widget,dijit._Templated,dijit._KeyNavContainer],{templateString:"<div class=\"dijit dijitToolbar\" waiRole=\"toolbar\" tabIndex=\"${tabIndex}\" dojoAttachPoint=\"containerNode\">"+"</div>",postCreate:function(){
this.connectKeyNavHandlers(this.isLeftToRight()?[dojo.keys.LEFT_ARROW]:[dojo.keys.RIGHT_ARROW],this.isLeftToRight()?[dojo.keys.RIGHT_ARROW]:[dojo.keys.LEFT_ARROW]);
},startup:function(){
if(this._started){
return;
}
this.startupKeyNavChildren();
this.inherited(arguments);
}});
dojo.require("dijit.ToolbarSeparator");
}
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rule = require('../rule/');
var _rule2 = _interopRequireDefault(_rule);
var _util = require('../util');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ENUM = 'enum';
/**
* Validates an enumerable list.
*
* @param rule The validation rule.
* @param value The value of the field on the source object.
* @param callback The callback function.
* @param source The source object being validated.
* @param options The validation options.
* @param options.messages The validation messages.
*/
function enumerable(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((0, _util.isEmptyValue)(value) && !rule.required) {
return callback();
}
_rule2['default'].required(rule, value, source, errors, options);
if (value) {
_rule2['default'][ENUM](rule, value, source, errors, options);
}
}
callback(errors);
}
exports['default'] = enumerable;
module.exports = exports['default'];
|
import Component from 'ember-component';
import computed, {alias, readOnly} from 'ember-computed';
import run from 'ember-runloop';
import ValidationState from 'ghost-admin/mixins/validation-state';
import SortableItem from 'ember-sortable/mixins/sortable-item';
export default Component.extend(ValidationState, SortableItem, {
classNames: 'gh-blognav-item',
classNameBindings: ['errorClass', 'navItem.isNew::gh-blognav-item--sortable'],
new: false,
handle: '.gh-blognav-grab',
model: alias('navItem'),
errors: readOnly('navItem.errors'),
errorClass: computed('hasError', function () {
if (this.get('hasError')) {
return 'gh-blognav-item--error';
}
}),
keyPress(event) {
// enter key
if (event.keyCode === 13 && this.get('navItem.isNew')) {
event.preventDefault();
run.scheduleOnce('actions', this, function () {
this.send('addItem');
});
}
},
actions: {
addItem() {
this.sendAction('addItem');
},
deleteItem(item) {
this.sendAction('deleteItem', item);
},
updateUrl(value) {
this.sendAction('updateUrl', value, this.get('navItem'));
},
clearLabelErrors() {
this.get('navItem.errors').remove('label');
},
clearUrlErrors() {
this.get('navItem.errors').remove('url');
}
}
});
|
'use strict';
var babelHelpers = require('./util/babelHelpers.js');
exports.__esModule = true;
/**
* document.activeElement
*/
exports['default'] = activeElement;
var _ownerDocument = require('./ownerDocument');
var _ownerDocument2 = babelHelpers.interopRequireDefault(_ownerDocument);
function activeElement() {
var doc = arguments[0] === undefined ? document : arguments[0];
try {
return doc.activeElement;
} catch (e) {}
}
module.exports = exports['default'];
|
import {Observable} from '#core/data-structures/observable';
/**
* @typedef {{
* form: !HTMLFormElement,
* actionXhrMutator: function(string)
* }}
*/
export let FormSubmitEventDef;
export class FormSubmitService {
/**
* Global service used to register callbacks we wish to execute when an
* amp-form is submitted.
*/
constructor() {
this.observable_ = new Observable();
}
/**
* Used to register callbacks.
* @param {function(!FormSubmitEventDef)} cb
* @return {!UnlistenDef}
*/
beforeSubmit(cb) {
return this.observable_.add(cb);
}
/**
* Fired when form is submitted.
* @param {!FormSubmitEventDef} event
*/
fire(event) {
this.observable_.fire(event);
}
}
|
$(function () {
'use strict';
var $image = $(window.createCropperImage());
$image.cropper({
built: function () {
var cropper = $image.data('cropper'),
options = cropper.options;
$image.cropper('disable');
QUnit.test('methods.disable', function (assert) {
assert.ok(cropper.disabled);
assert.ok(cropper.$cropper.hasClass('cropper-disabled'));
});
QUnit.test('methods.disable: setAspectRatio', function (assert) {
$image.cropper('setAspectRatio', 1.618);
assert.ok(isNaN(options.aspectRatio));
assert.notEqual(options.aspectRatio, 1.618);
});
QUnit.test('methods.disable: move', function (assert) {
var imageData = $image.cropper('getImageData');
$image.cropper('move', 10, 10);
assert.deepEqual($image.cropper('getImageData'), imageData);
});
QUnit.test('methods.disable: zoom', function (assert) {
var ratio = cropper.image.ratio;
$image.cropper('zoom', 0.5);
assert.equal(cropper.image.ratio, ratio);
});
QUnit.test('methods.disable: rotate', function (assert) {
var rotate = cropper.image.rotate;
$image.cropper('rotate', 15);
assert.equal(cropper.image.rotate, rotate);
});
QUnit.test('methods.disable: setImageData', function (assert) {
var imageData = $image.cropper('getImageData');
$image.cropper('setImageData', {
width: imageData.width - 160
});
assert.deepEqual($image.cropper('getImageData'), imageData);
});
QUnit.test('methods.disable: setCropBoxData', function (assert) {
var cropBoxData = $image.cropper('getCropBoxData');
$image.cropper('setCropBoxData', {
height: cropBoxData.height - 90
});
assert.deepEqual($image.cropper('getCropBoxData'), cropBoxData);
});
}
});
});
|
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require admin/spree_backend
//= require_tree .
|
function Feature(keyword, name, description, uri, line) {
var Cucumber = require('../../cucumber');
var background;
var featureElements = Cucumber.Type.Collection();
var tags = [];
var self = {
getKeyword: function getKeyword() {
return keyword;
},
getName: function getName() {
return name;
},
getDescription: function getDescription() {
return description;
},
getUri: function getUri() {
return uri;
},
getLine: function getLine() {
return line;
},
setBackground: function setBackground(newBackground) {
background = newBackground;
},
getBackground: function getBackground() {
return background;
},
hasBackground: function hasBackground() {
return (typeof(background) !== 'undefined');
},
addFeatureElement: function addFeatureElement(featureElement) {
var background = self.getBackground();
featureElement.setBackground(background);
featureElements.add(featureElement);
},
insertFeatureElement: function insertFeatureElement(index, featureElement) {
var background = self.getBackground();
featureElement.setBackground(background);
featureElements.insert(index, featureElement);
},
convertScenarioOutlinesToScenarios: function convertScenarioOutlinesToScenarios() {
featureElements.syncForEach(function (featureElement) {
if (featureElement.isScenarioOutline()) {
self.convertScenarioOutlineToScenarios(featureElement);
}
});
},
convertScenarioOutlineToScenarios: function convertScenarioOutlineToScenarios(scenarioOutline) {
var scenarios = scenarioOutline.buildScenarios();
var scenarioOutlineIndex = featureElements.indexOf(scenarioOutline);
featureElements.removeAtIndex(scenarioOutlineIndex);
var scenarioOutlineTags = scenarioOutline.getTags();
scenarios.syncForEach(function (scenario, index) {
scenario.addTags(scenarioOutlineTags);
self.insertFeatureElement(scenarioOutlineIndex + index, scenario);
});
},
getFeatureElements: function getFeatureElements() {
return featureElements;
},
getLastFeatureElement: function getLastFeatureElement() {
return featureElements.getLast();
},
hasFeatureElements: function hasFeatureElements() {
return featureElements.length() > 0;
},
addTags: function setTags(newTags) {
tags = tags.concat(newTags);
},
getTags: function getTags() {
return tags;
},
acceptVisitor: function acceptVisitor(visitor, callback) {
self.instructVisitorToVisitBackground(visitor, function () {
self.instructVisitorToVisitScenarios(visitor, callback);
});
},
instructVisitorToVisitBackground: function instructVisitorToVisitBackground(visitor, callback) {
if (self.hasBackground()) {
var background = self.getBackground();
visitor.visitBackground(background, callback);
} else {
callback();
}
},
instructVisitorToVisitScenarios: function instructVisitorToVisitScenarios(visitor, callback) {
featureElements.forEach(function (scenario, iterate) {
visitor.visitScenario(scenario, iterate);
}, callback);
}
};
return self;
}
module.exports = Feature;
|
/**
* UI addition to enhance the inport source switcher
*/
if (Drupal.jsEnabled) {
$(document).ready(function() {
$('#data_source').addClass('filtered');
$('#source_selector').change(
/*
When the select changes, we change the class of the containing fieldset.
This then uses css to hide the unwanted form elements.
*/
function(){
var methods = new Array('none', 'upload-file', 'url', 'service');
for(var m in methods) {
$('#data_source').removeClass(methods[m]);
}
$('#data_source').addClass(this.value)
.animate({opacity:.5}, 200)
.animate({opacity:1}, 200)
}
);
// Trigger the filter to update the current display
$('#source_selector').trigger('change');
})
}
|
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'pastetext', 'zh', {
button: '貼成純文字',
title: '貼成純文字'
} );
|
'use strict';
var translations = {};
translations["default"] = {
successTitle :"Your account has been activated!",
successDescription : "Go back to your app and sign in to start enjoying XXX.",
failureTitle : "Ops, something went wrong!",
failureDescription : "Try resending the activation email. Make sure you use the activation link in the email right away.",
resendFailureDescription : "We are not able to send you are new activation email. Open you app and try to register once more. ",
resendSuccessTitle : "We have sent you a new email!",
resendSuccessDescription : "Go to your inbox and look for the activation email."
};
translations["sv"] = {
successTitle : "Ditt konto har aktiverats!",
successDescription :"Öppna din app och logga in för att börja använda XXX.",
failureTitle : "Ops, något gick fel!",
failureDescription : "Försöka skicka om ditt aktiverings mejl. Använd aktiveringslänken i mejlet omgående.",
resendFailureDescription : "Vi kunde inte skicka ett nytt mejl. Öppna appen och registrar dig på nytt.",
resendSuccessTitle : "Vi har skickat ett nytt mejl",
resendSuccessDescription : "Gå till din inbox och leda efter aktiverings mejlet."
};
function HideServerResponseTextPanels() {
$('#success').addClass('hidden');
$('#failure').addClass('hidden');
}
function DisplaySuccess(jqXHR, textStatus, errorThrown, language) {
var title = translate("successTitle", language);
var description = translate("successDescription", language);
$('#success-title').html(title);
$('#success-description').html(description);
$('#success').removeClass('hidden');
}
function translate(token, language) {
var languageTranslations = translations[language];
if (!languageTranslations) {
languageTranslations = translations["default"];
}
return languageTranslations[token];
}
function DisplayFailure(jqXHR, textStatus, errorThrown, language) {
var title = translate("failureTitle", language);
var description = translate("failureDescription", language);
$('#failure-title').html(title);
$('#failure-description').html(description);
$('#failure').removeClass('hidden');
}
function DisplayResendSuccess(jqXHR, textStatus, errorThrown, language) {
var title = translate("resendTitle", language);
var description = translate("resendDescription", language);
$('#failure-title').html(title);
$('#failure-description').html(description);
$('#failure').removeClass('hidden');
}
function DisplayResendFailure(jqXHR, textStatus, errorThrown, language) {
var title = translate("failureTitle", language);
var description = translate("resendFailureDescription", language);
$('#failure-title').html(title);
$('#failure-description').html(description);
$('#resend-button').attr("disabled", "disabled");
}
function ResendConfirmationAsync(language) {
// let's see what we got from query string
var idFromQS = $.getQueryString("id");
var backendServiceURL = "/api/user/" + idFromQS + "/account/resend";
$.ajax({
type: "POST",
url: backendServiceURL
}).done(function (data, textStatus, jqXHR) {
DisplayResendSuccess(data, textStatus, jqXHR, language);
}).fail(function (jqXHR, textStatus, errorThrown) {
DisplayResendFailure(jqXHR, textStatus, errorThrown, language);
}).always(function () {
//
});
}
function VerifyAccountAsync() {
// let's see what we got from query string
var idFromQS = $.getQueryString("id");
var tokenFromQS = $.getQueryString("token");
var languageFromQS = $.getQueryString("language");
var backendServiceURL = "/api/user/" + idFromQS + "/account/confirm";
var jsonData = JSON.stringify({ "token" : tokenFromQS });
$.ajax({
type: "POST",
url: backendServiceURL,
contentType: 'application/json; charset=utf-8',
data: jsonData,
dataType: 'json'
}).done(function (data, textStatus, jqXHR) {
DisplaySuccess(data, textStatus, jqXHR, languageFromQS);
}).fail(function (jqXHR, textStatus, errorThrown) {
DisplayFailure(jqXHR, textStatus, errorThrown, languageFromQS);
}).always(function () {
//
});
}
$('#resend-button').on('click', function () {
ResendConfirmationAsync();
});
$(function () {
//Okay, we have loaded DOM
VerifyAccountAsync();
});
|
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'selectall', 'lv', {
toolbar: 'Iezīmēt visu'
} );
|
import { useBackend } from '../backend';
import { Box, Button, LabeledList, ProgressBar, Section } from '../components';
import { LabeledListItem } from '../components/LabeledList';
import { Window } from '../layouts';
export const SatelliteControl = (props, context) => {
const { act, data } = useBackend(context);
const satellites = data.satellites || [];
return (
<Window
width={400}
height={305}>
<Window.Content>
{data.meteor_shield && (
<Section>
<LabeledList>
<LabeledListItem label="Coverage">
<ProgressBar
value={data.meteor_shield_coverage
/ data.meteor_shield_coverage_max}
content={100 * data.meteor_shield_coverage
/ data.meteor_shield_coverage_max + '%'}
ranges={{
good: [1, Infinity],
average: [0.30, 1],
bad: [-Infinity, 0.30],
}} />
</LabeledListItem>
</LabeledList>
</Section>
)}
<Section title="Satellite Controls">
<Box mr={-1}>
{satellites.map(satellite => (
<Button.Checkbox
key={satellite.id}
checked={satellite.active}
content={"#" + satellite.id + " " + satellite.mode}
onClick={() => act('toggle', {
id: satellite.id,
})}
/>
))}
</Box>
</Section>
</Window.Content>
</Window>
);
};
|
module.exports = angular.module('trafficOps.table.locations', [])
.controller('TableLocationsController', require('./TableLocationsController'));
|
/*
* Copyright 2013 Amadeus s.a.s.
* 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.
*/
Aria.classDefinition({
$classpath : "test.aria.widgets.form.select.downArrowKey.SelectTestCase",
$extends : "aria.jsunit.TemplateTestCase",
$dependencies : ["aria.popups.PopupManager", "aria.core.Timer"],
$destructor : function () {
this.select = null;
this.$TemplateTestCase.$destructor.call(this);
},
$prototype : {
runTemplateTest : function () {
this.select = this.getWidgetInstance("mySelect").getSelectField();
this.synEvent.click(this.select, {
fn : this._selectClicked,
scope : this
});
},
_selectClicked : function () {
aria.core.Timer.addCallback({
fn : this._afterDelay,
scope : this,
delay : 500
});
},
_afterDelay : function () {
this.synEvent.type(this.select, "[down][enter]", {
fn : this._afterEnter,
scope : this
});
},
_afterEnter : function () {
this.assertTrue(this.templateCtxt.data.value == "opt2");
this.notifyTemplateTestEnd();
}
}
});
|
(function(){
var localStorageWrapper = function(name) {
this.name = name;
}
localStorageWrapper.prototype.get = function(n) {
if (localStorage.getItem(this.name)) {
if (n === undefined) {
return JSON.parse(localStorage.getItem(this.name));
} else {
var data = JSON.parse(localStorage.getItem(this.name));
return data[n];
}
} else {
return [];
}
}
localStorageWrapper.prototype.search = function(searchTerm) {
var wholeArray = JSON.parse(localStorage.getItem(this.name));
for(var i in wholeArray) {
if(wholeArray[i][searchTerm]) {
return wholeArray[i][searchTerm];
}
}
return null;
}
localStorageWrapper.prototype.set = function(data) {
if (!localStorage.getItem(this.name)) {
localStorage.setItem(this.name, "[]");
}
return localStorage.setItem(this.name, JSON.stringify(data));
}
localStorageWrapper.prototype.add = function(obj) {
var data = this.get();
if(data) {
data.push(obj);
return this.set(data);
}
}
localStorageWrapper.prototype.remove = function(n) {
var data = this.get();
data.splice(n,n);
return this.set(data);
}
localStorageWrapper.prototype.destroy = function() {
delete localStorage[this.name]
}
cdb.admin.localStorage = localStorageWrapper;
}())
|
// Compares two CSSStyleValues to check if they're the same type
// and have the same attributes.
function assert_style_value_equals(a, b) {
if (a == null || b == null) {
assert_equals(a, b);
return;
}
assert_equals(a.constructor.name, b.constructor.name);
const className = a.constructor.name;
switch (className) {
case 'CSSKeywordValue':
assert_equals(a.value, b.value);
break;
case 'CSSUnitValue':
assert_approx_equals(a.value, b.value, 1e-6);
assert_equals(a.unit, b.unit);
break;
case 'CSSMathSum':
case 'CSSMathProduct':
case 'CSSMathMin':
case 'CSSMathMax':
assert_style_value_array_equals(a.values, b.values);
break;
case 'CSSMathInvert':
case 'CSSMathNegate':
assert_style_value_equals(a.value, b.value);
break;
case 'CSSUnparsedValue':
assert_style_value_array_equals(a, b);
break;
case 'CSSVariableReferenceValue':
assert_equals(a.variable, b.variable);
assert_style_value_equals(a.fallback, b.fallback);
break;
case 'CSSPositionValue':
assert_style_value_equals(a.x, b.x);
assert_style_value_equals(a.y, b.y);
break;
case 'CSSTransformValue':
assert_style_value_array_equals(a, b);
break;
case 'CSSRotate':
assert_style_value_equals(a.angle, b.angle);
// fallthrough
case 'CSSTranslate':
case 'CSSScale':
assert_style_value_equals(a.x, b.x);
assert_style_value_equals(a.y, b.y);
assert_style_value_equals(a.z, b.z);
assert_style_value_equals(a.is2D, b.is2D);
break;
case 'CSSSkew':
assert_style_value_equals(a.ax, b.ax);
assert_style_value_equals(a.ay, b.ay);
break;
case 'CSSPerspective':
assert_style_value_equals(a.length, b.length);
break;
case 'CSSMatrixComponent':
assert_matrix_approx_equals(a.matrix, b.matrix, 1e-6);
break;
case 'CSSURLImageValue':
assert_equals(a.instrinsicWidth, b.instrinsicWidth);
assert_equals(a.instrinsicHeight, b.instrinsicHeight);
assert_equals(a.instrinsicRatio, b.instrinsicRatio);
assert_equals(a.url, b.url);
break;
default:
assert_equals(a, b);
break;
}
}
// Compares two arrays of CSSStyleValues to check if every element is equal
function assert_style_value_array_equals(a, b) {
assert_equals(a.length, b.length);
for (let i = 0; i < a.length; i++) {
assert_style_value_equals(a[i], b[i]);
}
}
const gValidUnits = [
'number', 'percent', 'em', 'ex', 'ch',
'ic', 'rem', 'lh', 'rlh', 'vw',
'vh', 'vi', 'vb', 'vmin', 'vmax',
'cm', 'mm', 'Q', 'in', 'pt',
'pc', 'px', 'deg', 'grad', 'rad',
'turn', 's', 'ms', 'Hz', 'kHz',
'dpi', 'dpcm', 'dppx', 'fr',
];
// Creates a new div element with specified inline style |cssText|.
// The created element is deleted during test cleanup.
function createDivWithStyle(test, cssText) {
let element = document.createElement('div');
element.style = cssText || '';
document.body.appendChild(element);
test.add_cleanup(() => {
element.remove();
});
return element;
}
// Creates a new div element with inline style |cssText| and returns
// its inline style property map.
function createInlineStyleMap(test, cssText) {
return createDivWithStyle(test, cssText).attributeStyleMap;
}
// Creates a new div element with inline style |cssText| and returns
// its computed style property map.
function createComputedStyleMap(test, cssText) {
return createDivWithStyle(test, cssText).computedStyleMap();
}
// Creates a new style element with a rule |cssText| and returns
// its declared style property map.
function createDeclaredStyleMap(test, cssText) {
const style = document.createElement('style');
document.head.appendChild(style);
const rule = style.sheet.cssRules[style.sheet.insertRule('#test { ' + cssText + '}')];
test.add_cleanup(() => {
style.remove();
});
return rule.styleMap;
}
// Creates a new element with background image set to |imageValue|
// and returns a new Image element that can be used to attach
// event listeners regarding the image.
function loadImageResource(test, imageValue) {
// Set a CSSURLImageValue on an element so it can be loaded.
let styleMap = createInlineStyleMap(test, '');
styleMap.set('background-image', imageValue);
// add a new Image element to know if the image resource has been loaded
let image = new Image();
image.src = imageValue.url;
return image;
}
|
__resources__["/equipment.js"] = {meta: {mimetype: "application/javascript"}, data: function(exports, require, module, __filename, __dirname) {
/**
* Module dependencies
*/
var Entity = require('entity');
var EntityType = require('consts').EntityType;
/**
* Initialize a new 'Equipment' with the given 'opts'.
* Equipment inherits Entity
*
* @param {Object} opts
* @api public
*/
var Equipment = function (opts) {
this.type = EntityType.EQUIPMENT;
this.name = opts.name;
this.kind = opts.kind;
this.attackValue = opts.attackValue;
this.defenceValue = opts.defenceValue;
this.price = opts.price;
this.color = opts.color;
this.heroLevel = opts.heroLevel;
this.playerId = opts.playerId;
this.imgId = opts.imgId;
Entity.call(this, opts);
};
Equipment.prototype = Object.create(Entity.prototype);
/**
* Expose 'Equipment' constructor.
*/
module.exports = Equipment;
}};
|
'use strict';
module.exports = function (t, a) {
a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }),
{ aa: 1, ab: 2, ba: 3, bb: 4 });
};
|
//// [tests/cases/compiler/cacheResolutions.ts] ////
//// [app.ts]
export let x = 1;
//// [lib1.ts]
export let x = 1;
//// [lib2.ts]
export let x = 1;
//// [app.js]
define(["require", "exports"], function (require, exports) {
"use strict";
exports.__esModule = true;
exports.x = 1;
});
//// [lib1.js]
define(["require", "exports"], function (require, exports) {
"use strict";
exports.__esModule = true;
exports.x = 1;
});
//// [lib2.js]
define(["require", "exports"], function (require, exports) {
"use strict";
exports.__esModule = true;
exports.x = 1;
});
|
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* All rights reserved.
*
* @emails oncall+javascript_foundation
*/
'use strict';
const path = require('path');
const findPodTargetLine = require('../../pods/findPodTargetLine');
const readPodfile = require('../../pods/readPodfile');
const PODFILES_PATH = path.join(__dirname, '../../__fixtures__/pods');
describe('pods::findPodTargetLine', () => {
it('returns null if file is not Podfile', () => {
const podfile = readPodfile(path.join(PODFILES_PATH, '../Info.plist'));
expect(findPodTargetLine(podfile, 'name')).toBeNull();
});
it('returns null if there is not matching project name', () => {
const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileSimple'));
expect(findPodTargetLine(podfile, 'invalidName')).toBeNull();
});
it('returns null if there is not matching project name', () => {
const podfile = readPodfile(path.join(PODFILES_PATH, 'PodfileSimple'));
expect(findPodTargetLine(podfile, 'Testing')).toBe(4);
});
});
|
var SessionTokenCache = require('../src/LiveQuery/SessionTokenCache').SessionTokenCache;
describe('SessionTokenCache', function() {
beforeEach(function(done) {
var Parse = require('parse/node');
// Mock parse
var mockUser = {
become: jasmine.createSpy('become').and.returnValue(Parse.Promise.as({
id: 'userId'
}))
}
jasmine.mockLibrary('parse/node', 'User', mockUser);
done();
});
it('can get undefined userId', function(done) {
var sessionTokenCache = new SessionTokenCache();
sessionTokenCache.getUserId(undefined).then((userIdFromCache) => {
}, (error) => {
expect(error).not.toBeNull();
done();
});
});
it('can get existing userId', function(done) {
var sessionTokenCache = new SessionTokenCache();
var sessionToken = 'sessionToken';
var userId = 'userId'
sessionTokenCache.cache.set(sessionToken, userId);
sessionTokenCache.getUserId(sessionToken).then((userIdFromCache) => {
expect(userIdFromCache).toBe(userId);
done();
});
});
it('can get new userId', function(done) {
var sessionTokenCache = new SessionTokenCache();
sessionTokenCache.getUserId('sessionToken').then((userIdFromCache) => {
expect(userIdFromCache).toBe('userId');
expect(sessionTokenCache.cache.length).toBe(1);
done();
});
});
afterEach(function() {
jasmine.restoreLibrary('parse/node', 'User');
});
});
|
var RequireDir = require('require-dir');
global.inProduction = process.env.NODE_ENV === 'production';
RequireDir('./gulp');
|
jQuery(document).ready(function() {
apply_activity_ajax_methods();
});
function apply_activity_ajax_methods(){
setup_comment_submit();
hide_comment_boxes();
apply_comment_hover();
apply_activity_hover();
jQuery('.activity-no-comments').hide();
jQuery('.activity-has-comments').find('textarea').click(function(){
show_comment_box(this);
});
jQuery('.activity-has-comments').find('textarea').blur(function(){
textarea = jQuery(this);
if (textarea.val() == ''){
hide_comment_boxes();
}
});
jQuery(".make-comment").unbind();
jQuery('.make-comment').click(function(){
var id = this.id.replace('make_comment_activity_', '');
var comment_box = jQuery('#comment_activity_' + id);
comment_box.find('textarea').removeClass('min');
comment_box.find('textarea').addClass('max');
comment_box.show();
comment_box.find('textarea').get(0).focus();
comment_box.find('textarea').blur(function(){
if (jQuery(this).val() == ''){
jQuery(this).closest('.activity-comment').hide();
}
});
return false;
});
}
function setup_comment_submit(){
jQuery(".comment-submit").unbind();
jQuery(".comment-submit").click(function() {
jQuery(this).hide();
jQuery(this).parents('.comment-form-wrapper').siblings('.actor-icon').hide();
jQuery(this).siblings('textarea').hide();
jQuery(this).parent().append('<p class="comment-loading"><img src="/images/spinner.gif" alt="loading..." /> ' + ADD_COMMENT_MESSAGE + '</p>');
var form = jQuery(this).parents('form');
jQuery.post(form.attr('action'), form.serialize() + '&format=json',
function(data){
var json = eval('(' + data + ')');
if(!json.success){
jQuery.jGrowl.info(json.message);
} else {
jQuery('.comment-loading').remove();
jQuery('.activity-has-comments').find('textarea').show();
var comment_box = jQuery('#comment_activity_' + json.parent_id);
comment_box.before(json.html);
comment_box.removeClass('activity-no-comments');
comment_box.addClass('activity-has-comments');
comment_box.find('textarea').show();
apply_activity_ajax_methods();
}
});
return false;
});
}
function hide_comment_boxes(){
jQuery('.activity-has-comments').children('.actor-icon').hide();
jQuery('.activity-has-comments').find('.button').hide();
jQuery('.activity-has-comments').find('textarea').val(COMMENT_PROMPT);
jQuery('.activity-has-comments').find('textarea').addClass('min');
}
function show_comment_box(obj){
textarea = jQuery(obj);
textarea.addClass('max');
textarea.removeClass('min');
textarea.closest('.comment-form-wrapper').siblings('.actor-icon').show();
textarea.siblings('.button').show();
if (textarea.val() == COMMENT_PROMPT) {
textarea.val('');
}
}
function get_latest_activity_id(){
var activities = jQuery('#activity-feed-content').children('.activity');
if(activities.length > 0){
return activities[0].id.replace('activity_', '');
} else {
return '';
}
}
function update_feed(request){
jQuery('#activity-feed-content').prepend(request);
}
function apply_activity_hover(){
jQuery('.activity-content').hover(
function () { jQuery(this).addClass('activity-hover'); },
function () { jQuery(this).removeClass('activity-hover'); } );
}
function apply_comment_hover(){
jQuery('.activity-comment').hover(
function () { jQuery(this).addClass('comment-hover'); },
function () { jQuery(this).removeClass('comment-hover'); } );
}
|
/* globals jQuery, soWidgetsAdmin */
jQuery( function( $ ){
$('.so-widget-toggle-active button').click( function(){
var $$ = $(this),
s = $$.data('status'),
$w = $$.closest('.so-widget');
if(s) {
$w.addClass('so-widget-is-active').removeClass('so-widget-is-inactive');
}
else {
$w.removeClass('so-widget-is-active').addClass('so-widget-is-inactive');
}
// Lets send an ajax request.
$.post(
soWidgetsAdmin.toggleUrl,
{
'widget' : $w.data('id'),
'active' : s
},
function(data){
// $sw.find('.dashicons-yes').clearQueue().fadeIn('fast').delay(750).fadeOut('fast');
}
);
} );
// Fill in the missing header images
$('.so-widget-banner').each( function(){
var $$ = $(this),
$img = $$.find('img');
if( !$img.length ) {
// Create an SVG image as a placeholder icon
var pattern = Trianglify({
width: 128,
height: 128,
variance : 1,
cell_size: 32,
seed: $$.data('seed')
});
$$.append( pattern.svg() );
}
else {
if( $img.width() > 128 ) {
// Deal with wide banner images
$img.css('margin-left', -($img.width()-128)/2 );
}
}
} );
// Lets implement the search
var widgetSearch = function(){
var q = $(this).val().toLowerCase();
if( q === '' ) {
$('.so-widget-wrap').show();
}
else {
$('.so-widget').each( function(){
var $$ = $(this);
if( $$.find('h3').html().toLowerCase().indexOf(q) > -1 ) {
$$.parent().show();
}
else {
$$.parent().hide();
}
} );
}
};
$('#sow-widget-search input').on( {
keyup: widgetSearch,
search: widgetSearch
});
$(window).resize(function() {
var $descriptions = $('.so-widget-text').css('height', 'auto');
var largestHeight = 0;
$descriptions.each(function () {
largestHeight = Math.max(largestHeight, $(this).height() );
});
$descriptions.each(function () {
$(this).css('height', largestHeight);
});
}).resize();
// Handle the tabs
$('#sow-widgets-page .page-nav a').click(function(e){
e.preventDefault();
var $$ = $(this);
var href = $$.attr('href');
var $li = $$.closest('li');
$('#sow-widgets-page .page-nav li').not($li).removeClass('active');
$li.addClass('active');
switch( href ) {
case '#all' :
$('.so-widget-wrap').show();
break;
case '#enabled' :
$('.so-widget-wrap').hide();
$('.so-widget-wrap .so-widget-is-active').each(function(){ $(this).closest('.so-widget-wrap').show(); });
$('.so-widget-wrap .so-widget-is-inactive').each(function(){ $(this).closest('.so-widget-wrap').hide(); });
break;
case '#disabled' :
$('.so-widget-wrap .so-widget-is-active').each(function(){ $(this).closest('.so-widget-wrap').hide(); });
$('.so-widget-wrap .so-widget-is-inactive').each(function(){ $(this).closest('.so-widget-wrap').show(); });
break;
}
$(window).resize();
});
// Enable css3 animations on the widgets list
$('#widgets-list').addClass('so-animated');
// Handle the dialog
var dialog = $('#sow-settings-dialog');
$( '#widgets-list .so-widget-settings' ).click( function( e ){
var $$ = $(this);
e.preventDefault();
dialog.find('.so-content')
.empty()
.addClass('so-loading')
.load( $$.data('form-url'), function(){
$(this).removeClass('so-loading');
} );
dialog.show();
} );
dialog.find('.so-close').click( function( e ){
e.preventDefault();
dialog.hide();
} );
dialog.find('.so-save').click( function( e ){
e.preventDefault();
var $$ = $(this);
$$.prop('disabled', true);
$( '#widgets-list .so-widget-settings' ).prop('disabled', true);
dialog.find( 'form' ).submit( function( ){
$$.prop('disabled', false);
dialog.hide();
} ).submit();
} );
// Enable all widget settings button after the save iframe has loaded.
$('#so-widget-settings-save').load( function(){
$( '#widgets-list .so-widget-settings' ).prop('disabled', false);
} );
} );
|
/*
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dojox.math.round"]){
dojo._hasResource["dojox.math.round"]=true;
dojo.provide("dojox.math.round");
dojo.experimental("dojox.math.round");
dojox.math.round=function(_1,_2,_3){
var _4=Math.log(Math.abs(_1))/Math.log(10);
var _5=10/(_3||10);
var _6=Math.pow(10,-15+_4);
return (_5*(+_1+(_1>0?_6:-_6))).toFixed(_2)/_5;
};
if((0.9).toFixed()==0){
(function(){
var _7=dojox.math.round;
dojox.math.round=function(v,p,m){
var d=Math.pow(10,-p||0),a=Math.abs(v);
if(!v||a>=d||a*Math.pow(10,p+1)<5){
d=0;
}
return _7(v,p,m)+(v>0?d:-d);
};
})();
}
}
|
fn.bind(context);
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'forms', 'fa', {
button: {
title: 'ویژگیهای دکمه',
text: 'متن (مقدار)',
type: 'نوع',
typeBtn: 'دکمه',
typeSbm: 'ثبت',
typeRst: 'بازنشانی (Reset)'
},
checkboxAndRadio: {
checkboxTitle: 'ویژگیهای خانهٴ گزینهای',
radioTitle: 'ویژگیهای دکمهٴ رادیویی',
value: 'مقدار',
selected: 'برگزیده',
required: 'Required' // MISSING
},
form: {
title: 'ویژگیهای فرم',
menu: 'ویژگیهای فرم',
action: 'رویداد',
method: 'متد',
encoding: 'رمزنگاری'
},
hidden: {
title: 'ویژگیهای فیلد پنهان',
name: 'نام',
value: 'مقدار'
},
select: {
title: 'ویژگیهای فیلد چندگزینهای',
selectInfo: 'اطلاعات',
opAvail: 'گزینههای دردسترس',
value: 'مقدار',
size: 'اندازه',
lines: 'خطوط',
chkMulti: 'گزینش چندگانه فراهم باشد',
required: 'Required', // MISSING
opText: 'متن',
opValue: 'مقدار',
btnAdd: 'افزودن',
btnModify: 'ویرایش',
btnUp: 'بالا',
btnDown: 'پائین',
btnSetValue: 'تنظیم به عنوان مقدار برگزیده',
btnDelete: 'پاککردن'
},
textarea: {
title: 'ویژگیهای ناحیهٴ متنی',
cols: 'ستونها',
rows: 'سطرها'
},
textfield: {
title: 'ویژگیهای فیلد متنی',
name: 'نام',
value: 'مقدار',
charWidth: 'پهنای نویسه',
maxChars: 'بیشینهٴ نویسهها',
required: 'Required', // MISSING
type: 'نوع',
typeText: 'متن',
typePass: 'گذرواژه',
typeEmail: 'ایمیل',
typeSearch: 'جستجو',
typeTel: 'شماره تلفن',
typeUrl: 'URL'
}
} );
|
define([
'dojo/_base/declare'
/*=====, 'dstore/Store'=====*/
], function (declare /*=====, Store=====*/) {
return declare(null, {
constructor: function () {
this.root = this;
},
mayHaveChildren: function (object) {
// summary:
// Check if an object may have children
// description:
// This method is useful for eliminating the possibility that an object may have children,
// allowing collection consumers to determine things like whether to render UI for child-expansion
// and whether a query is necessary to retrieve an object's children.
// object:
// The potential parent
// returns: boolean
return 'hasChildren' in object ? object.hasChildren : true;
},
getRootCollection: function () {
// summary:
// Get the collection of objects with no parents
// returns: dstore/Store.Collection
return this.root.filter({ parent: null });
},
getChildren: function (object) {
// summary:
// Get a collection of the children of the provided parent object
// object:
// The parent object
// returns: dstore/Store.Collection
return this.root.filter({ parent: this.getIdentity(object) });
}
});
});
|
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Varien
* @package js
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
var paymentForm = Class.create();
paymentForm.prototype = {
initialize: function(formId){
this.formId = formId;
this.validator = new Validation(this.formId);
var elements = Form.getElements(formId);
var method = null;
for (var i=0; i<elements.length; i++) {
if (elements[i].name=='payment[method]') {
if (elements[i].checked) {
method = elements[i].value;
}
} else {
if((elements[i].type) && ('submit' != elements[i].type.toLowerCase())) {
elements[i].disabled = true;
}
}
elements[i].setAttribute('autocomplete','off');
}
if (method) this.switchMethod(method);
},
switchMethod: function(method){
if (this.currentMethod && $('payment_form_'+this.currentMethod)) {
var form = $('payment_form_'+this.currentMethod);
form.style.display = 'none';
var elements = form.getElementsByTagName('input');
for (var i=0; i<elements.length; i++) elements[i].disabled = true;
var elements = form.getElementsByTagName('select');
for (var i=0; i<elements.length; i++) elements[i].disabled = true;
}
if ($('payment_form_'+method)){
var form = $('payment_form_'+method);
form.style.display = '';
var elements = form.getElementsByTagName('input');
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
var elements = form.getElementsByTagName('select');
for (var i=0; i<elements.length; i++) elements[i].disabled = false;
this.currentMethod = method;
}
}
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* Check examples for automatic semicolon insertion from the Standart
*
* @path ch07/7.9/7.9.2/S7.9.2_A1_T6.js
* @description if(a>b) \n else c=d is not a valid sentence in the ECMAScript grammar
* @negative
*/
//CHECK#1
var a=1,b=2,c=3,d;
if(a>b)
else c=d
|
var w = 960,
h = 500,
color = d3.scale.category20c();
var treemap = d3.layout.treemap()
.padding(4)
.size([w, h])
.value(function(d) { return d.size; });
var svg = d3.select("body").append("svg")
.attr("width", w)
.attr("height", h)
.append("g")
.attr("transform", "translate(-.5,-.5)");
d3.json("../data/flare.json", function(json) {
var cell = svg.data([json]).selectAll("g")
.data(treemap)
.enter().append("g")
.attr("class", "cell")
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
cell.append("rect")
.attr("width", function(d) { return d.dx; })
.attr("height", function(d) { return d.dy; })
.style("fill", function(d) { return d.children ? color(d.data.name) : null; });
cell.append("text")
.attr("x", function(d) { return d.dx / 2; })
.attr("y", function(d) { return d.dy / 2; })
.attr("dy", ".35em")
.attr("text-anchor", "middle")
.text(function(d) { return d.children ? null : d.data.name; });
});
|
/*
Copyright © 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, European Research Consortium
for Informatics and Mathematics, Keio University). All
Rights Reserved. This work is distributed under the W3C® Software License [1] in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
*/
/**
* Gets URI that identifies the test.
* @return uri identifier of test
*/
function getTargetURI() {
return "http://www.w3.org/2001/DOM-Test-Suite/level1/html/HTMLElement118";
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "element");
if (docsLoaded == 1) {
setUpPageStatus = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPageStatus = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
}
}
/**
*
The className attribute specifies the class attribute of the element.
Retrieve the class attribute of the SUB element and examine its value.
* @author NIST
* @author Mary Brady
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-95362176
*/
function HTMLElement118() {
var success;
if(checkInitialization(builder, "HTMLElement118") != null) return;
var nodeList;
var testNode;
var vclassname;
var doc;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "element");
nodeList = doc.getElementsByTagName("sub");
assertSize("Asize",1,nodeList);
testNode = nodeList.item(0);
vclassname = testNode.className;
assertEquals("classNameLink","SUB-class",vclassname);
}
function runTest() {
HTMLElement118();
}
|
(function($) {
function print_array(obj, opts) {
var result = [];
for (var i = 0; i < Math.min(opts.max_array, obj.length); i++)
result.push($.print(obj[i], $.extend({}, opts, { max_array: 3, max_string: 40 })));
if (obj.length > opts.max_array)
result.push((obj.length - opts.max_array) + ' more...');
if (result.length == 0) return "[]"
return "[ " + result.join(", ") + " ]";
}
function print_element(obj) {
if (obj.nodeType == 1) {
var result = [];
var properties = [ 'className', 'id' ];
var extra = {
'input': ['type', 'name', 'value'],
'a': ['href', 'target'],
'form': ['method', 'action'],
'script': ['src'],
'link': ['href'],
'img': ['src']
};
$.each(properties.concat(extra[obj.tagName.toLowerCase()] || []), function(){
if (obj[this])
result.push(' ' + this.replace('className', 'class') + "=" + $.print(obj[this]))
});
return "<" + obj.tagName.toLowerCase()
+ result.join('') + ">";
}
}
function print_object(obj, opts) {
var seen = opts.seen || [ obj ];
var result = [], key, value;
for (var k in obj) {
if (obj.hasOwnProperty(k) && $.inArray(obj[k], seen) < 0) {
seen.push(obj[k]);
value = $.print(obj[k], $.extend({}, opts, { max_array: 6, max_string: 40, seen: seen }));
} else
value = "...";
result.push(k + ": " + value);
}
if (result.length == 0) return "{}";
return "{ " + result.join(", ") + " }";
}
function print_string(value, opts) {
var character_substitutions = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
};
var r = /["\\\x00-\x1f\x7f-\x9f]/g;
var str = r.test(value)
? '"' + value.replace(r, function (a) {
var c = character_substitutions[a];
if (c) return c;
c = a.charCodeAt();
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
}) + '"'
: '"' + value + '"';
if (str.length > opts.max_string)
return str.slice(0, opts.max_string + 1) + '..."';
else
return str;
}
$.print = function(obj, options) {
var opts = $.extend({}, { max_array: 10, max_string: 100 }, options);
if (typeof obj == 'undefined')
return "undefined";
else if (typeof obj == 'boolean')
return obj.toString();
else if (typeof obj == 'number')
return obj.toString();
else if (!obj)
return "null";
else if (typeof obj == 'string')
return print_string(obj, opts);
else if (obj instanceof RegExp)
return obj.toString();
else if (obj instanceof Array || obj.callee || obj.item)
return print_array(obj, opts);
else if (typeof obj == 'function' || obj instanceof Function)
return obj.toString().match(/^([^)]*\))/)[1];
else if (obj.nodeType)
return print_element(obj);
else if (obj instanceof jQuery)
return "$(" + $.print(obj.get()) + ")";
else if (obj instanceof Error)
return print_object(obj, $.extend({}, options, { max_string: 200 }));
else if (obj instanceof Object)
return print_object(obj, opts);
else
return obj.toString().replace(/\n\s*/g, '');
}
})(jQuery);
|
/// 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.22-10-3",
path: "TestCases/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-10-3.js",
description: "Array.prototype.reduceRight - subclassed array with length 1",
test: function testcase() {
foo.prototype = [1];
function foo() {}
var f = new foo();
function cb(){}
if(f.reduceRight(cb) === 1)
return true;
},
precondition: function prereq() {
return fnExists(Array.prototype.reduceRight);
}
});
|
function Features() {
var Cucumber = require('../../cucumber');
var features = Cucumber.Type.Collection();
var self = {
addFeature: function addFeature(feature) {
features.add(feature);
},
getFeatures: function getFeatures() {
return features;
},
getLastFeature: function getLastFeature() {
return features.getLast();
},
acceptVisitor: function acceptVisitor(visitor, callback) {
features.forEach(function (feature, iterate) {
visitor.visitFeature(feature, iterate);
}, callback);
}
};
return self;
}
module.exports = Features;
|
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'magicline', 'en', {
title: 'Insert paragraph here'
} );
|
var assert = require('assert');
var expect = require('chai').expect;
var Phase = require('../').Phase;
describe('Phase', function() {
describe('phase.run(ctx, cb)', function() {
it('should execute phase handlers', function (done) {
var phase = new Phase();
var called = false;
phase.use(function(ctx, cb) {
called = true;
cb();
});
phase.run(function() {
assert(called === true);
done();
});
});
it('should set the context for handlers', function (done) {
var phase = new Phase();
phase.use(function(ctx, cb) {
expect(ctx).to.have.property('foo', 'bar');
cb();
});
phase.run({foo: 'bar'}, done);
});
describe('execution order', function() {
var called;
var mockHandler;
beforeEach(function() {
called = [];
mockHandler = function(name) {
return function(ctx, cb) {
called.push(name);
process.nextTick(function() {
called.push(name + '_done');
cb();
});
};
};
});
it('should execute phase handlers in parallel', function(done) {
var phase = new Phase({parallel: true});
phase.before(mockHandler('b1'))
.before(mockHandler('b2'))
.use(mockHandler('h1'))
.after(mockHandler('a1'))
.after(mockHandler('a2'))
.use(mockHandler('h2'));
phase.run(function() {
var orders = {};
called.forEach(function(h, index) {
orders[h] = index;
});
expect(called).to.eql(['b1', 'b2', 'b1_done', 'b2_done',
'h1', 'h2', 'h1_done', 'h2_done',
'a1', 'a2', 'a1_done', 'a2_done']);
done();
});
});
it('should execute phase handlers in serial', function(done) {
var phase = new Phase('x');
phase.before(mockHandler('b1'))
.before(mockHandler('b2'))
.use(mockHandler('h1'))
.after(mockHandler('a1'))
.after(mockHandler('a2'))
.use(mockHandler('h2'));
phase.run(function() {
expect(called).to.eql(['b1', 'b1_done', 'b2', 'b2_done',
'h1', 'h1_done', 'h2', 'h2_done',
'a1', 'a1_done', 'a2', 'a2_done']);
done();
});
});
});
});
describe('phase.use(handler)', function() {
it('should add a handler that is invoked during a phase', function (done) {
var phase = new Phase();
var invoked = false;
phase.use(function(ctx, cb) {
invoked = true;
cb();
});
phase.run(function() {
expect(invoked).to.equal(true);
done();
});
});
});
describe('phase.after(handler)', function() {
it('should add a handler that is invoked after a phase', function (done) {
var phase = new Phase('test');
phase
.use(function(ctx, cb) {
ctx.foo = 'ba';
cb();
})
.use(function(ctx, cb) {
ctx.foo = ctx.foo + 'r';
cb();
});
phase.after(function(ctx, cb) {
assert(ctx.foo === 'bar');
cb();
});
phase.run(done);
});
});
});
|
//// [voidOperatorWithBooleanType.ts]
// void operator on boolean type
var BOOLEAN: boolean;
function foo(): boolean { return true; }
class A {
public a: boolean;
static foo() { return false; }
}
module M {
export var n: boolean;
}
var objA = new A();
// boolean type var
var ResultIsAny1 = void BOOLEAN;
// boolean type literal
var ResultIsAny2 = void true;
var ResultIsAny3 = void { x: true, y: false };
// boolean type expressions
var ResultIsAny4 = void objA.a;
var ResultIsAny5 = void M.n;
var ResultIsAny6 = void foo();
var ResultIsAny7 = void A.foo();
// multiple void operator
var ResultIsAny8 = void void BOOLEAN;
// miss assignment operators
void true;
void BOOLEAN;
void foo();
void true, false;
void objA.a;
void M.n;
//// [voidOperatorWithBooleanType.js]
// void operator on boolean type
var BOOLEAN;
function foo() { return true; }
var A = /** @class */ (function () {
function A() {
}
A.foo = function () { return false; };
return A;
}());
var M;
(function (M) {
})(M || (M = {}));
var objA = new A();
// boolean type var
var ResultIsAny1 = void BOOLEAN;
// boolean type literal
var ResultIsAny2 = void true;
var ResultIsAny3 = void { x: true, y: false };
// boolean type expressions
var ResultIsAny4 = void objA.a;
var ResultIsAny5 = void M.n;
var ResultIsAny6 = void foo();
var ResultIsAny7 = void A.foo();
// multiple void operator
var ResultIsAny8 = void void BOOLEAN;
// miss assignment operators
void true;
void BOOLEAN;
void foo();
void true, false;
void objA.a;
void M.n;
|
//// [decoratorOnClassMethod2.ts]
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
class C {
@dec public method() {}
}
//// [decoratorOnClassMethod2.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var C = /** @class */ (function () {
function C() {
}
C.prototype.method = function () { };
__decorate([
dec
], C.prototype, "method", null);
return C;
}());
|
/*
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dojox.widget.rotator.Controller"]){
dojo._hasResource["dojox.widget.rotator.Controller"]=true;
dojo.provide("dojox.widget.rotator.Controller");
(function(d){
var _1="dojoxRotator",_2=_1+"Play",_3=_1+"Pause",_4=_1+"Number",_5=_1+"Tab",_6=_1+"Selected";
d.declare("dojox.widget.rotator.Controller",null,{rotator:null,commands:"prev,play/pause,info,next",constructor:function(_7,_8){
d.mixin(this,_7);
var r=this.rotator;
if(r){
while(_8.firstChild){
_8.removeChild(_8.firstChild);
}
var ul=this._domNode=d.create("ul",null,_8),_9=" "+_1+"Icon",cb=function(_a,_b,_c){
d.create("li",{className:_b,innerHTML:"<a href=\"#\"><span>"+_a+"</span></a>",onclick:function(e){
d.stopEvent(e);
if(r){
r.control.apply(r,_c);
}
}},ul);
};
d.forEach(this.commands.split(","),function(b,i){
switch(b){
case "prev":
cb("Prev",_1+"Prev"+_9,["prev"]);
break;
case "play/pause":
cb("Play",_2+_9,["play"]);
cb("Pause",_3+_9,["pause"]);
break;
case "info":
this._info=d.create("li",{className:_1+"Info",innerHTML:this._buildInfo(r)},ul);
break;
case "next":
cb("Next",_1+"Next"+_9,["next"]);
break;
case "#":
case "titles":
for(var j=0;j<r.panes.length;j++){
cb(b=="#"?j+1:r.panes[j].title||"Tab "+(j+1),(b=="#"?_4:_5)+" "+(j==r.idx?_6:"")+" "+_1+"Pane"+j,["go",j]);
}
break;
}
},this);
d.query("li:first-child",ul).addClass(_1+"First");
d.query("li:last-child",ul).addClass(_1+"Last");
this._togglePlay();
this._con=d.connect(r,"onUpdate",this,"_onUpdate");
}
},destroy:function(){
d.disconnect(this._con);
d.destroy(this._domNode);
},_togglePlay:function(_d){
var p=this.rotator.playing;
d.query("."+_2,this._domNode).style("display",p?"none":"");
d.query("."+_3,this._domNode).style("display",p?"":"none");
},_buildInfo:function(r){
return "<span>"+(r.idx+1)+" / "+r.panes.length+"</span>";
},_onUpdate:function(_e){
var r=this.rotator;
switch(_e){
case "play":
case "pause":
this._togglePlay();
break;
case "onAfterTransition":
if(this._info){
this._info.innerHTML=this._buildInfo(r);
}
var s=function(n){
if(r.idx<n.length){
d.addClass(n[r.idx],_6);
}
};
s(d.query("."+_4,this._domNode).removeClass(_6));
s(d.query("."+_5,this._domNode).removeClass(_6));
break;
}
}});
})(dojo);
}
|
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.fillRect.basic
// Description:fillRect works
// Note:
importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
var t = async_test("fillRect works");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
throw reason;
});
t.step(function() {
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
t.done();
});
done();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.