text
stringlengths 2
6.14k
|
|---|
/**
* myCapitalizeFilter
* note that bootstrap gives us .text-capitalize, use it instead of this filter
* unless you really only want to capitalize the first character of a sentence.
*/
angular.module(PKG.name+'.filters').filter('myCapitalizeFilter',
function myCapitalizeFilter () {
return function(input) {
input = input ? input.toLowerCase() : '';
return input.substr(0,1).toUpperCase() + input.substr(1);
};
});
|
window['dependencies-without-mapping'] = window['dependencies-without-mapping'] || {};
sap.ui.define(['./module2'], function(module2) {
var moduleExport = {
name: 'module1',
module2: module2
};
window['dependencies-without-mapping'].module1 = moduleExport;
return moduleExport;
});
window['dependencies-without-mapping'].afterDefineModule1 = {
module1: sap.ui.require('modules/dependencies-without-mapping/module1'),
module1Global: window['dependencies-without-mapping'].module,
module2: sap.ui.require('modules/dependencies-without-mapping/module2'),
module3: sap.ui.require('modules/dependencies-without-mapping/module3')
};
|
/*
Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
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';
const path = require('path');
const glob = require('glob');
const chai = require('chai');
chai.should();
describe('Perform Node Tests', function() {
const globPattern = path.join(__dirname, 'node-tests', '/') + '*.js';
const testFiles = glob.sync(globPattern);
testFiles.forEach(testFile => {
require(testFile);
});
});
|
import { StyleSheet } from 'react-native';
import variables from './default';
export default StyleSheet.create({
Arrow: {
width: 8,
height: 13,
marginLeft: variables.h_spacing_md,
marginTop: variables.v_spacing_xs,
},
});
|
var foosUtilLib = require('/lib/foos-util');
var foosRetrievalLib = require('/lib/foos-retrieval');
var foosUrlLib = require('/lib/foos-url');
exports.generateGameBasicStats = function (game) {
game.gen = game.gen || {};
game.gen.score = {
winners: 0,
losers: 0
};
var winnerResults = foosUtilLib.toArray(game.data.winners);
winnerResults.forEach(function (playerResult) {
game.gen.score.winners += playerResult.score;
if (playerResult.against) {
game.gen.score.losers += playerResult.against;
}
});
var loserResults = foosUtilLib.toArray(game.data.losers);
loserResults.forEach(function (playerResult) {
game.gen.score.losers += playerResult.score;
if (playerResult.against) {
game.gen.score.winners += playerResult.against;
}
});
};
exports.generateGameStats = function (game) {
exports.generateGameBasicStats(game);
function doGenerateGameStats(playerResult) {
var playerContent = foosRetrievalLib.getContentByKey(playerResult.playerId);
playerResult.gen = {};
playerResult.gen.name = playerContent.displayName;
foosUrlLib.generatePictureUrl(playerContent);
foosUrlLib.generatePageUrl(playerContent);
playerResult.gen.pictureUrl = playerContent.gen.pictureUrl;
playerResult.gen.pageUrl = playerContent.gen.pageUrl;
}
foosUtilLib.toArray(game.data.winners).forEach(doGenerateGameStats);
foosUtilLib.toArray(game.data.losers).forEach(doGenerateGameStats);
};
exports.generateGameComments = function (game) {
game.gen = game.gen || {};
game.gen.comments = foosRetrievalLib.getChildrenByParentKey(game._id);
game.gen.comments.forEach(function (comment) {
var player = foosRetrievalLib.getContentByKey(comment.data.authorId);
comment.gen = {
authorName: player.displayName
};
});
};
|
/**
* @requires SuperMap/Util.js
*/
/**
* Class: SuperMap.Cloud.TransferSolution
* 公交换乘方案类。在一个换乘方案内的所有乘车路线中换乘次数是相同的。
*/
SuperMap.Cloud.TransferSolution = SuperMap.Class({
/**
* APIProperty: transferCount
* {<SuperMap.Cloud.TransferStopInfo>} 换乘方案对应的换乘次数。
*/
transferCount: null,
/**
* APIProperty: start
* {<SuperMap.Cloud.TransferStopInfo>} 换乘方案对应的换乘次数。
*/
start: null,
/**
* APIProperty: end
* {<SuperMap.Cloud.TransferStopInfo>} 换乘方案对应的换乘次数。
*/
end: null,
/**
* APIProperty: linesItems
* {Array(<SuperMap.Cloud.TransferLines>)} 换乘分段数组。
*/
linesItems: null,
/**
* APIProperty: walkInfos
* {Array(<SuperMap.Cloud.TransferLines>)} 换乘分段数组。
*/
walkInfos: null,
/**
* Constructor: SuperMap.Cloud.TransferSolution
* 公交换乘方案类构造函数。
*
* Parameters:
* options - {Object} 参数。
*
* Allowed options properties:
* transferCount - {Number} 换乘方案对应的换乘次数。
* linesItems - {Array(<SuperMap.Cloud.TransferLines>)} 换乘分段数组。
* start - {<SuperMap.Cloud.TransferStopInfo>} 换乘方案对应的换乘次数。
* end - {<SuperMap.Cloud.TransferStopInfo>} 换乘方案对应的换乘次数。
* walkInfos - {Array(<SuperMap.Cloud.TransferLines>)}
*/
initialize: function(options) {
options = options || {};
SuperMap.Util.extend(this, options);
},
/**
* APIMethod: destroy
* 释放资源,将引用资源的属性置空。
*/
destroy: function() {
SuperMap.Util.reset(this);
},
CLASS_NAME: "SuperMap.Cloud.TransferSolution"
});
/**
* Function: SuperMap.Cloud.TransferSolution.fromJson
* 将换乘方案查询的返回结果转化为 CloudTransferSolution 对象。
*
* Parameters:
* jsonObject - {Object} 新换乘方案查询的返回结果。
*
* Returns:
* {<SuperMap.Cloud.TransferSolution>} 转化后的 CloudTransferSolution 对象。
*/
SuperMap.Cloud.TransferSolution.fromJson = function(jsonObject) {
if (!jsonObject) {
return ;
}
var srcLinesItems = jsonObject.linesItems,
srcWalkInfos = jsonObject.walkInfos,
tarLinesItems = [],
tarWalkInfos = [],
len = srcLinesItems ? srcLinesItems.length : 0,
len2 = srcLinesItems ? srcLinesItems.length : 0,
lItem,
wItem;
for(var i=0; i<len; i++) {
lItem = SuperMap.Cloud.TransferLines.fromJson(srcLinesItems[i]);
tarLinesItems.push(lItem);
}
for(var i=0; i<len2; i++) {
wItem = SuperMap.Cloud.TransferWalkInfo.fromJson(srcWalkInfos[i]);
tarWalkInfos.push(wItem);
}
return new SuperMap.Cloud.TransferSolution({
transferCount: jsonObject['transferCount'],
linesItems: tarLinesItems,
walkInfos: tarWalkInfos,
start: SuperMap.Cloud.TransferStopInfo.fromJson(jsonObject['start']),
end: SuperMap.Cloud.TransferStopInfo.fromJson(jsonObject['end'])
});
};
|
define(function () {
'use strict';
return ['$scope', '$i18next', 'localData', 'existingLocals',
function ($scope, $i18next, localData, existingLocals) {
var blankLocal = {
id: "",
name: ""
};
var init = function () {
$scope.newLocal = angular.copy(blankLocal);
$scope.existingLocals = existingLocals;
$scope.$apply();
};
$scope.edit = function (local) {
local.editing = true;
};
$scope.cancelEdit = function (local) {
local.editing = false;
};
$scope.canDelete = function (local) {
local.canDelete = true;
};
$scope.delete = function ($index, local) {
localData.delete(local.id).$then(
function () {
$scope.existingLocals.splice($index, 1);
}, callbackError);
};
$scope.insert = function (local) {
var newLocal = angular.copy(local);
localData.insert(newLocal)
.then(function (response) {
local = angular.copy(blankLocal);
newLocal.id = response.id;
$scope.existingLocals.push(newLocal);
saveSuccess();
},
callbackError);
}
$scope.update = function (local) {
localData.update(local).then(function (response) {
local.editing = false;
saveSuccess();
}, callbackError);
}
var saveSuccess = function () {
toastr.success($i18next("localForm.saveSuccess"));
}
var callbackError = function (result) {
toastr.error(result.data.error);
}
init();
}
];
});
|
// Was a document passed-in for New Workflow?
if ((args.wd) && (args.wd != ""))
{
model.docWorkflow = search.findNode("workspace://SpacesStore/" + args.wd);
}
|
'use strict';
describe('vpcReader', function() {
var service, $http, $scope;
beforeEach(
window.module(
require('./vpc.read.service.js')
)
);
beforeEach(window.inject(function ($httpBackend, $rootScope, _vpcReader_) {
service = _vpcReader_;
$http = $httpBackend;
$scope = $rootScope.$new();
}));
beforeEach(function() {
$http.whenGET('/vpcs').respond(200, [
{ name: 'vpc1', id: 'vpc-1', deprecated: true },
{ name: 'vpc2', id: 'vpc-2', deprecated: false },
{ name: 'vpc3', id: 'vpc-3' },
]);
});
it('adds label to vpc, including (deprecated) if deprecated field is true', function () {
var result = null;
service.listVpcs().then(function(vpcs) { result = vpcs; });
$http.flush();
$scope.$digest();
expect(result[0].label).toBe('vpc1 (deprecated)');
expect(result[0].deprecated).toBe(true);
expect(result[1].label).toBe('vpc2');
expect(result[1].deprecated).toBe(false);
expect(result[2].label).toBe('vpc3');
expect(result[2].deprecated).toBe(false);
});
it('retrieves vpc name - not label - from id', function() {
var result = null;
service.getVpcName('vpc-1').then(function(name) { result = name; });
$http.flush();
$scope.$digest();
expect(result).toBe('vpc1');
service.getVpcName('vpc-2').then(function(name) { result = name; });
$http.flush();
$scope.$digest();
expect(result).toBe('vpc2');
service.getVpcName('vpc-4').then(function(name) { result = name; });
$http.flush();
$scope.$digest();
expect(result).toBe(null);
});
});
|
/*
* Copyright 2015 Teppo Kurki <teppo.kurki@iki.fi>
*
* 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.
*/
var Transform = require('stream').Transform;
function Udp(options) {
Transform.call(this, {
objectMode: false
});
this.options = options;
}
require('util').inherits(Udp, Transform);
Udp.prototype.pipe = function(pipeTo) {
Udp.super_.prototype.pipe.call(this, pipeTo);
var socket = require('dgram').createSocket('udp4');
var self = this;
socket.on('message', function(message, remote) {
self.push(message);
});
socket.bind(this.options.port);
}
Udp.prototype._transform = function(chunk, encoding, done) {
done();
}
module.exports = Udp;
|
var tap = require('../tap');
tap.count(4);
var regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g;
tap.ok((/\x50/).test('P'))
tap.ok((/\u0050/).test('P'))
var regexSeparators = new RegExp("\\x2E|\\u3002|\\uFF0E|\\uFF61", "g");
tap.ok(new RegExp("\\x50").test('P'))
tap.ok(new RegExp("\\u0050").test('P'))
|
const { CronJob } = require("cron");
module.exports = database => {
return new Promise((resolve, reject) => {
new CronJob(
"20 40 03 * * *",
() => {
resolve(database.validatePasses());
},
() => {},
true
);
});
};
|
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './main.js',
output: { path: __dirname, filename: 'bundle.js' },
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: [ 'es2015', 'react' ]
}
}
]
}
};
|
/*
| Copyright 2014 Esri
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
*/
define({
root: ({
map: { // Map, feature layer, and comments table loading and checking
error: "Unable to create map",
layerLoad: "Unable to fully load map",
missingItemsFeatureLayer: "Please configure the application to use a feature layer"
},
sidebar_header: { // Top panel of right-side display; contains social media sign-in, help button, title
menuButtonTooltip: "Show menu",
signInButton: "Sign In",
signInButtonTooltip: "Sign in",
signOutButton: "Sign Out",
signOutButtonTooltip: "Sign out",
helpButtonLabel: "Help",
helpButtonTooltip: "Learn more",
gotoListViewLabel: "List View",
gotoListViewTooltip: "Go to list view", // Go to List view tooltip text
gotoMapViewLabel: "Map View",
gotoMapViewTooltip: "Go to map view" // Tooltip for map-it icon in list header
},
popup_Close: { // Close button for help and social-media-sign-in popup box
closeButtonTooltip: "Close"
},
social_media: { // Social media sign-in/out
signIntoFacebookTooltip: "Sign in with Facebook",
signIntoGooglePlusTooltip: "Sign in with Google+",
signIntoTwitterTooltip: "Sign in with Twitter",
signOutOfFacebookTooltip: "Sign out of Facebook",
signOutOfGooglePlusTooltip: "Sign out of Google+",
signOutOfTwitterTooltip: "Sign out of Twitter"
},
dynamic_form: { // General-purpose form; used to receive comment entry
optionalFormItemFlag: " (optional)",
requiredFormItemFlag: " (required)",
unsettableRequiredField: "A required field is neither initialized nor in the form",
countOfRemainingCharactersTooltip: "Characters remaining",
attachmentsHeading: "Attachments",
addAttachmentTooltip: "Add attachment",
removeAttachmentTooltip: "Remove attachment",
cancelButtonLabel: "Cancel",
submitButtonLabel: "Submit"
},
item_details: { // Detailed information about an item and a list of its comments
likeButtonTooltip: "Vote for this item",
likeButtonInverseTooltip: "Vote counted",
commentButtonTooltip: "Add a comment",
gotoMapViewTooltip: "Go to map view",
galleryButtonTooltip: "See attached files",
commentsListHeading: "Comments",
noCommentsPlaceholder: "No comments"
},
item_list: { // List of feature layer items
linkToMapViewOptionLabel: "Filter list by map",
linkToMapViewOptionTooltip: "List features that are visible in the current map",
likesForThisItemTooltip: "Votes for this item"
}
}),
"ar": 1,
"bs": 1,
"cs": 1,
"da": 1,
"de": 1,
"el": 1,
"es": 1,
"et": 1,
"fi": 1,
"fr": 1,
"he": 1,
"hr": 1,
"id": 1,
"it": 1,
"ja": 1,
"ko": 1,
"lt": 1,
"lv": 1,
"nb": 1,
"nl": 1,
"pl": 1,
"pt-br": 1,
"pt-pt": 1,
"ro": 1,
"ru": 1,
"sr": 1,
"sv": 1,
"th": 1,
"tr": 1,
"vi": 1,
"zh-cn": 1,
"zh-hk": 1,
"zh-tw": 1
});
|
function Controller() {
function initArticles() {
url = "https://getpocket.com/v3/get";
var ajax = Ti.Network.createHTTPClient();
ajax.onerror = function() {
alert("Error");
};
ajax.onload = function() {
var data = this.responseText;
var jdata = JSON.parse(data);
var articles = Alloy.createCollection("Article");
articles.fetch();
articles.map(function(article) {
article.destroy();
});
for (var key in jdata.list) {
var article = Alloy.createModel("Article", {
article_id: key,
url: jdata.list[key].resolved_url,
title: jdata.list[key].resolved_title,
excerpt: jdata.list[key].excerpt
});
article.save();
}
var articles = Alloy.createCollection("Article");
articles.fetch();
var row_data = [];
articles.map(function(article) {
var title = article.get("title");
var url = article.get("url");
var article_data = {
title: title,
url: url
};
var row = Alloy.createController("article_row", article_data).getView();
row_data.push(row);
});
$.table.setData(row_data);
};
ajax.open("POST", url);
ajax.send({
consumer_key: "18945-f60a569d5c48b90f81b3a086",
access_token: "a8e5702d-5a4b-815e-db54-831333"
});
}
require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
this.__controllerPath = "index";
arguments[0] ? arguments[0]["__parentSymbol"] : null;
arguments[0] ? arguments[0]["$model"] : null;
arguments[0] ? arguments[0]["__itemTemplate"] : null;
var $ = this;
var exports = {};
$.__views.listview = Ti.UI.createWindow({
backgroundColor: "white",
id: "listview",
title: "List"
});
$.__views.table = Ti.UI.createTableView({
id: "table"
});
$.__views.listview.add($.__views.table);
$.__views.root = Ti.UI.iOS.createNavigationWindow({
window: $.__views.listview,
id: "root"
});
$.__views.root && $.addTopLevelView($.__views.root);
exports.destroy = function() {};
_.extend($, $.__views);
Alloy.CFG.root = $.root;
initArticles();
$.root.open();
_.extend($, exports);
}
var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._;
module.exports = Controller;
|
/**
* Controller for the Convert screen
*
* @class Controllers.convert
* @uses core
* @uses FileManager
*
* CONFIG.url - remote URL to load
* CONFIG.file - local File to load
* CONFIG.html - HTML String to load
*/
var APP = require("core");
var FileManager = require("FileManager");
var CONFIG = arguments[0] || {};
var modal = CONFIG.modal || false;
/**
* Initializes the controller
*/
$.init = function() {
try {
APP.log("debug", "pdfoptions.init | " + JSON.stringify(CONFIG));
$.NavigationBar.setBackgroundColor(APP.Settings.colors.primary);
//Set the default filename
if (CONFIG.url == undefined) {
$.options.fireEvent("cancel", {
error : "No URL Passed"
});
return;
}
var url = CONFIG.url;
//Remove the query string parameter (if ther is one)
var urlarray1 = url.split("?");
//Check to see if there is a trailing "/"
var i = (urlarray1[0].substr(urlarray1[0].length - 1) == "/") ? 2 : 1;
var urlarray2 = urlarray1[0].split("/");
//extract the filename
var filename = Ti.Network.encodeURIComponent(urlarray2[urlarray2.length - i]);
filename += ".pdf";
filename = filename.toLowerCase();
$.filename.value = filename;
var file = Ti.Filesystem.getFile(Alloy.Globals.directoryPath,filename);
$.filewarning.visible = file.exists();
//Set the paper value from the app properties
switch (Ti.App.Properties.getString("paper","letter")) {
case "a4":
$.a4.hasCheck = true;
$.letter.hasCheck = false;
Ti.App.Properties.setString("paper", "a4");
break;
default:
$.a4.hasCheck = false;
$.letter.hasCheck = true;
Ti.App.Properties.setString("paper", "letter");
break;
}
} catch(err) {
APP.error({
f : 'pdfoptions.init',
err : err
});
}
};
function doTableViewClick(e) {
try {
switch (e.row.id) {
case "a4":
$.a4.hasCheck = true;
$.letter.hasCheck = false;
Ti.App.Properties.setString("paper", "a4");
break;
default:
$.a4.hasCheck = false;
$.letter.hasCheck = true;
Ti.App.Properties.setString("paper", "letter");
break;
}
} catch(err) {
APP.error({
f : 'pdfoptions.doTableViewClick',
err : err
});
}
};
function doSave(e) {
try {
//Check the filename
var filename = $.filename.value;
if (filename.indexOf(".pdf") == -1) {
filename += ".pdf";
}
if ($.a4.hasCheck) {
var paper = "a4";
} else {
var paper = "letter";
}
//Fire the Event
$.options.fireEvent("save", {
filename : filename,
paper : paper
});
} catch(err) {
APP.error({
f : 'pdfoptions.doSave',
err : err
});
}
};
function doCancel(e) {
try {
//Fire the Event
$.options.fireEvent("cancel", {});
return;
} catch(err) {
APP.error({
f : 'pdfoptions.doCancel',
err : err
});
}
};
function doFileCheck(e) {
try {
//Check to see if the file exists
var filename = $.filename.value;
filename = filename.toLowerCase();
var file = Ti.Filesystem.getFile(Alloy.Globals.directoryPath,filename);
$.filewarning.visible = file.exists();
return;
} catch(err) {
APP.error({
f : 'pdfoptions.doCancel',
err : err
});
}
};
$.init();
|
//列操作
var caozuo = function(value, row, index) {
return formatString('<img title="编辑" onclick="customer_editNode(\'{0}\');" src="{1}"/> <img title="删除" onclick="customer_delete(\'{2}\')" src="{3}"/> <img title="查看" onclick="customer_check(\'{4}\');" src="{5}"/>',
row.guid,'./ui/style/images/extjs_icons/pencil.png',
row.guid,'./ui/style/images/extjs_icons/delete.png',
row.guid,'./ui/style/images/extjs_icons/zoom/zoom.png');
};
//刷新
var customer_reload = function(){
$('#customer_datagrid').datagrid('load',{});
};
//快速查找
var customer_search = function(value,name){
if(value != null && value != ''){
var o = new Object();
o[name] = value;
$('#customer_datagrid').datagrid('load',$.parseJSON(JSON.stringify(o)));
o = null;
}else{
customer_reload();
}
};
//修改操作
function customer_editNode(code){
if (code != undefined) {
$('#customer_datagrid').datagrid('selectRecord', code);
}
var node = $('#customer_datagrid').datagrid('getSelected');
var buttons = [ {
text : '保存',
iconCls : 'icon-ok',
handler : function() {
$.messager.progress();
var isValid = $('#customer_addForm').form('validate');
if (!isValid){
$.messager.progress('close');
return;
}
var d = $(this).closest('.window-body');
var data =serializeObject($('#customer_addForm'),true);
var rainbow = new Rainbow();
rainbow.setAttr(data);
rainbow.setService("customerService");
rainbow.setMethod("update");
rainbowAjax.excute(rainbow,new Callback(d,customer_reload));
}
},{
text : '取消',
iconCls : 'icon-cancel',
handler : function() {
$(this).closest('.window-body').dialog('destroy');
}
}];
rainbowDialog.editDialog('./page/sa/jsp/customerForm.jsp',buttons,400,350,true,'编辑信息','customer_addForm',node);
}
//新增操作
function add_customer(){
var buttons = [ {
text : '保存',
iconCls : 'icon-ok',
handler : function() {
if(isValid('customer_addForm') == true){
var d = $(this).closest('.window-body');
var data =serializeObject($('#customer_addForm'),true);
var rainbow = new Rainbow();
rainbow.setAttr(data);
rainbow.setService("customerService");
rainbow.setMethod("insert");
rainbowAjax.excute(rainbow,new Callback(d,customer_reload));
}
}
},{
text : '取消',
iconCls : 'icon-cancel',
handler : function() {
$(this).closest('.window-body').dialog('destroy');
}
}];
rainbowDialog.addDialog('./page/sa/jsp/customerForm.jsp',buttons,400,350,true,'新增信息','customer_addForm');
}
//复制新增操作
var copy_add_customer = function(){
var node = $('#customer_datagrid').datagrid('getSelected');
if(node){
var buttons = [ {
text : '保存',
iconCls : 'icon-ok',
handler : function() {
if(isValid('customer_addForm') == true){
var d = $(this).closest('.window-body');
var data =serializeObject($('#customer_addForm'),true);
var rainbow = new Rainbow();
rainbow.setAttr(data);
rainbow.setService("customerService");
rainbow.setMethod("insert");
rainbowAjax.excute(rainbow,new Callback(d,customer_reload));
}
}
},{
text : '取消',
iconCls : 'icon-cancel',
handler : function() {
$(this).closest('.window-body').dialog('destroy');
}
}];
rainbowDialog.editDialog('./page/sa/jsp/customerForm.jsp',buttons,400,350,true,'编辑信息','customer_addForm',node);
}else{
$.messager.show({title:'提示',msg:'请选择一条记录!'});
}
};
//删除操作
var customer_delete = function(code){
if (code != undefined) {
$('#customer_datagrid').datagrid('selectRecord', code);
}
var node = $('#customer_datagrid').datagrid('getSelected');
$.messager.confirm('询问', '您确定要删除当前【'+node.name+'】记录?', function(b) {
if(b){
$.messager.progress();
var d = $(this).closest('.window-body');
var rainbow = new Rainbow();
rainbow.addRows({"guid":code});
rainbow.setService("customerService");
rainbow.setMethod("delete");
rainbowAjax.excute(rainbow,new Callback(d,customer_reload));
}
});
};
//批量删除操作
var batch_delete_customer = function(){
var nodes = $('#customer_datagrid').datagrid('getChecked');
if(nodes.length > 0){
$.messager.confirm('询问', '您确定要删除所有选择的记录吗?', function(b) {
if(b){
$.messager.progress();
rainbow.setService("customerService");
rainbow.setMethod("delete");
rainbowAjax.excute(rainbow,new Callback(null,customer_reload));
}
});
}else{
$.messager.show({title:'提示',msg:'请选择一条记录!'});
}
};
//查看
function customer_check(code){
if (code != undefined) {
$('#customer_datagrid').datagrid('selectRecord', code);
}
var node = $('#customer_datagrid').datagrid('getSelected');
rainbowDialog.showDialog('./page/sa/jsp/customerForm.jsp',null,400,350,true,'查看信息','customer_addForm',node);
}
//查询过滤
var customer_query = function(){
var datas =serializeObject($('#customer_queryForm'));
$('#customer_datagrid').datagrid('load',datas);
};
//清空查询条件
var customer_query_clear = function(){
$('#customer_queryForm input').val('');
customer_reload();
};
|
import { createStore, compose, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import rootReducer from './reducers';
import rootSaga from './sagas';
const sagaMiddleware = createSagaMiddleware();
const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
rootReducer,
composeEnhancer(
applyMiddleware(sagaMiddleware))
);
sagaMiddleware.run(rootSaga);
export default store;
|
//// [for-of12.ts]
var v: string;
for (v of [0, ""].values()) { }
//// [for-of12.js]
var v;
for (v of [0, ""].values()) { }
|
/* Demo Note: This demo uses a FileProgress class that handles the UI for displaying the file name and percent complete.
The FileProgress class is not part of SWFUpload.
*/
/* **********************
Event Handlers
These are my custom event handlers to make my
web application behave the way I went when SWFUpload
completes different tasks. These aren't part of the SWFUpload
package. They are part of my application. Without these none
of the actions SWFUpload makes will show up in my application.
********************** */
function fileQueued(file) {
try {
this.customSettings.tdFilesQueued.innerHTML = this.getStats().files_queued;
} catch (ex) {
this.debug(ex);
}
}
function fileDialogComplete() {
this.startUpload();
}
function uploadStart(file) {
try {
this.customSettings.progressCount = 0;
updateDisplay.call(this, file);
}
catch (ex) {
this.debug(ex);
}
}
function uploadProgress(file, bytesLoaded, bytesTotal) {
try {
this.customSettings.progressCount++;
updateDisplay.call(this, file);
} catch (ex) {
this.debug(ex);
}
}
function uploadSuccess(file, serverData) {
try {
updateDisplay.call(this, file);
} catch (ex) {
this.debug(ex);
}
}
function uploadComplete(file) {
this.customSettings.tdFilesQueued.innerHTML = this.getStats().files_queued;
this.customSettings.tdFilesUploaded.innerHTML = this.getStats().successful_uploads;
this.customSettings.tdErrors.innerHTML = this.getStats().upload_errors;
}
function updateDisplay(file) {
this.customSettings.tdCurrentSpeed.innerHTML = SWFUpload.speed.formatBPS(file.currentSpeed);
this.customSettings.tdAverageSpeed.innerHTML = SWFUpload.speed.formatBPS(file.averageSpeed);
this.customSettings.tdMovingAverageSpeed.innerHTML = SWFUpload.speed.formatBPS(file.movingAverageSpeed);
this.customSettings.tdTimeRemaining.innerHTML = SWFUpload.speed.formatTime(file.timeRemaining);
this.customSettings.tdTimeElapsed.innerHTML = SWFUpload.speed.formatTime(file.timeElapsed);
this.customSettings.tdPercentUploaded.innerHTML = SWFUpload.speed.formatPercent(file.percentUploaded);
this.customSettings.tdSizeUploaded.innerHTML = SWFUpload.speed.formatBytes(file.sizeUploaded);
this.customSettings.tdProgressEventCount.innerHTML = this.customSettings.progressCount;
}
function uploadError(file, errorCode, message) {
this.customSettings.tdErrorDescription.innerHTML = message;
this.customSettings.tdErrorCode.innerHTML = errorCode;
}
|
/* eslint-disable max-len */
const Parse = require('parse/node');
const { dropDB } = require('parse-server-test-runner');
const { getScheduledPushes } = require('../src/query');
const { addOffsetCounts, markAsComplete } = require('../src/statusHandler');
const { stripTimezone } = require('./util');
describe('statusHandler', () => {
function send(pushTime, inLocalTime=true) {
const pushStatus = new Parse.Object('_PushStatus');
return pushStatus.save({
pushTime: inLocalTime ? stripTimezone(pushTime) : pushTime.toISOString(),
status: 'scheduled',
query: '{}',
payload: '{"alert":"alert!"}',
title: 'title',
expiry: +new Date(pushTime + 5000),
numSent: 0,
source: 'rest',
pushHash: '1328bee6e66a1c8f6fa5d5546812e671',
}, { useMasterKey: true });
}
beforeAll((done) => {
dropDB().then(done).catch(done.fail);
});
describe('addOffsetCounts', () => {
it('should set the success/failure counts to 0 if not previously set', (done) => {
const now = new Date('2017-07-20T12:20:40.730Z');
send(new Date(now + 5000))
.then(getScheduledPushes)
.then(([ pushStatus ]) => {
expect(pushStatus.get('sentPerUTCOffset')).toBeUndefined();
expect(pushStatus.get('failedPerUTCOffset')).toBeUndefined();
return addOffsetCounts(pushStatus, 180);
})
.then(getScheduledPushes)
.then(([ pushStatus ]) => {
expect(pushStatus.get('sentPerUTCOffset')['180']).toBe(0);
expect(pushStatus.get('failedPerUTCOffset')['180']).toBe(0);
})
.then(done)
.catch(done.fail);
});
});
describe('markAsComplete', () => {
const longTimeAgo = new Date(0);
const now = new Date('2017-07-20T12:20:40.730Z');
it('should mark successful absolute time pushes', async () => {
const pushStatus = await send(longTimeAgo, false);
await pushStatus.save({ numSent: 100 }, { useMasterKey: true });
expect(await markAsComplete(pushStatus, now)).toEqual(true);
await pushStatus.fetch({ useMasterKey: true });
expect(pushStatus.get('status')).toEqual('succeeded');
});
it('should mark failed absolute time pushes', async () => {
const pushStatus = await send(longTimeAgo, false);
await pushStatus.save({ numSent: 0 }, { useMasterKey: true });
expect(await markAsComplete(pushStatus, now)).toEqual(true);
await pushStatus.fetch({ useMasterKey: true });
expect(pushStatus.get('status')).toEqual('failed');
});
it('should not mark recently scheduled PushStatus', (done) => {
send(now)
.then((pushStatus) => markAsComplete(pushStatus, now))
.then((result) => expect(result).toBe(false))
.then(done, done.fail);
});
it('should mark failed Push', (done) => {
let pushStatus;
send(longTimeAgo)
.then((p) => pushStatus = p)
.then(() => addOffsetCounts(pushStatus, 180))
.then(() => markAsComplete(pushStatus, now))
.then((result) => expect(result).toBe(true))
.then(() => pushStatus.fetch({ useMasterKey: true }))
.then((pushStatus) => expect(pushStatus.get('status')).toBe('failed'))
.then(done, done.fail);
});
it('should mark successful Push', (done) => {
let pushStatus;
send(longTimeAgo)
.then((p) => pushStatus = p)
.then(() => addOffsetCounts(pushStatus, 180))
.then(() => {
const sentPerUTCOffset = {};
sentPerUTCOffset[180] = 10;
return pushStatus.save({ sentPerUTCOffset }, { useMasterKey: true });
})
.then(() => pushStatus.fetch({ useMasterKey: true }))
.then((pushStatus) => markAsComplete(pushStatus, now))
.then((result) => expect(result).toBe(true))
.then(() => pushStatus.fetch({ useMasterKey: true }))
.then((pushStatus) => expect(pushStatus.get('status')).toBe('succeeded'))
.then(done, done.fail);
});
});
});
|
// cmumps2fhir-demographics-mocha.js
var chai = require('chai');
var expect = chai.expect;
var should = chai.should();
var sinon = require('sinon');
var _ = require('underscore');
var fs = require('fs');
var test = require('./common-test');
var compFactory = require('../components/cmumps2fhir-demographics');
var testFile = __dirname + '/../node_modules/translators/data/fake_cmumps/patient-7/cmumps-patient7.jsonld';
describe('cmumps2fhir-demographics', function() {
it('should exist as a function', function() {
compFactory.should.exist;
compFactory.should.be.a('function');
});
it('should instantiate a noflo component', function() {
var node = test.createComponent(compFactory);
node.should.be.an('object');
node.should.include.keys('nodeName', 'componentName', 'outPorts', 'inPorts', 'vni', 'vnis');
});
describe('#updater', function() {
it('should throw an error if input data is undefined', function() {
expect(compFactory.updater.bind(this, undefined)).to.throw(Error,
/PatientDemographics requires data to translate!/);
});
it('should return empty object if input data is empty', function() {
sinon.stub(console, 'warn');
expect(compFactory.updater({})).to.be.empty;
console.warn.restore();
});
it('should convert patient demographics to fhir', function() {
var data = fs.readFileSync(testFile);
var parsedData = JSON.parse(data); // readfile gives us a json object, so parse it
var translation = compFactory.updater(parsedData);
translation.should.not.be.empty;
translation.should.include.keys('resourceType', 'identifier', 'name', 'gender',
'birthDate', 'address','birthDate');
translation.resourceType.should.equal('Patient');
});
it('should write data to the specified intermediate files', function() {
var data = fs.readFileSync(testFile);
var parsedData = JSON.parse(data); // readfile gives us a json object, so parse it
var cmumpsFile='/tmp/cmumpsDemographics.out';
var fhirFile='/tmp/fhirDemographics.out';
sinon.stub(console, 'log');
var translation = compFactory.updater(parsedData, cmumpsFile, fhirFile);
console.log.restore();
translation.should.not.be.empty;
// Verify the expected 2 files exist
fs.accessSync(cmumpsFile, fs.F_OK);
fs.accessSync(fhirFile, fs.F_OK);
});
});
describe('functional behavior', function() {
it('should convert patient demographics to fhir in a noflo network', function() {
this.timeout(3000);
sinon.stub(console,'log');
return test.createNetwork(
{ node1: 'filesystem/ReadFile',
node2: { getComponent: compFactory }
}).then(function(network) {
return new Promise(function(done, fail) {
// True noflo component - not facade
var node1 = network.processes.node1.component;
var node2 = network.processes.node2.component;
test.onOutPortData(node2, 'output', done);
test.onOutPortData(node2, 'error', fail);
network.graph.addEdge('node1', 'out', 'node2', 'data');
network.graph.addInitial(testFile, 'node1', 'in');
}).then(function(done) {
console.log.restore();
done.should.exist;
done.should.not.be.empty;
done.should.be.an('object');
done.should.have.all.keys('vnid','data','groupLm','lm','stale','error');
done.vnid.should.equal('');
done.data.should.be.an('object');
done.data.should.include.keys('resourceType', 'identifier', 'name', 'gender',
'birthDate', 'address','birthDate');
done.data.resourceType.should.equal('Patient');
expect(done.error).to.be.undefined;
expect(done.stale).to.be.undefined;
done.lm.match(/^LM(\d+)\.(\d+)$/).should.have.length(3);
}, function(fail) {
console.log.restore();
console.log('fail: ',fail);
throw Error(fail);
});
});
});
});
});
|
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
define(function(require) {
/*
This module insert a row with the name of the resource.
The row can be edited and a rename action will be sent
*/
var TemplateEC2Tr = require('hbs!./ec2-tr/html');
var TemplateUtils = require('utils/template-utils');
var Sunstone = require('sunstone');
var Config = require('sunstone-config');
/*
Generate the tr HTML with the name of the resource and an edit icon
@param {String} tabName
@param {String} resourceType Resource type (i.e: Zone, Host, Image...)
@param {String} resourceName Name of the resource
@returns {String} HTML row
*/
var _html = function(resourceType, ec2_attributes) {
this.element = ec2_attributes;
this.valueRegion = ec2_attributes['REGION_NAME']? ec2_attributes['REGION_NAME']: "";
this.valueSecret = ec2_attributes['EC2_SECRET']? ec2_attributes['EC2_SECRET']: "";
this.valueAccess = ec2_attributes['EC2_ACCESS']? ec2_attributes['EC2_ACCESS']: "";
var renameTrHTML = TemplateEC2Tr({
'region_name': ec2_attributes['REGION_NAME'],
'ec2_secret': ec2_attributes['EC2_SECRET'],
'ec2_access': ec2_attributes['EC2_ACCESS']
});
return renameTrHTML;
};
function _setup(resourceType, resourceId,context) {
var that = this;
context.off("click", "#div_edit_region_link");
context.on("click", "#div_edit_region_link", function() {
var valueStr = $(".value_td_region", context).text();
$(".value_td_region", context).html('<input class="input_edit_value_region" id="input_edit_region" type="text" value="' + that.valueRegion + '"/>');
});
context.off("click", "#div_edit_access_link");
context.on("click", "#div_edit_access_link", function() {
var valueStr = $(".value_td_access", context).text();
$(".value_td_access", context).html('<input class="input_edit_value_access" id="input_edit_access" type="text" value="' + that.valueAccess + '"/>');
});
context.off("click", "#div_edit_secret_link");
context.on("click", "#div_edit_secret_link", function() {
var valueStr = $(".input_edit_value_secret", context).text();
$(".value_td_secret", context).html('<input class="input_edit_value_secret" id="input_edit_secret" type="text" value="' + that.valueSecret + '"/>');
});
context.off("change", ".input_edit_value_region");
context.on("change", ".input_edit_value_region", function() {
var valueRegion = $(".input_edit_value_region").val();
that.element["REGION_NAME"] = valueRegion;
Sunstone.runAction(resourceType+".update_template",resourceId, TemplateUtils.templateToString(that.element));
});
context.off("change", ".input_edit_value_access");
context.on("change", ".input_edit_value_access", function() {
var valueAccess = $(".input_edit_value_access").val();
that.element["EC2_ACCESS"] = valueAccess;
Sunstone.runAction(resourceType+".update_template",resourceId, TemplateUtils.templateToString(that.element));
});
context.off("change", ".input_edit_value_secret");
context.on("change", ".input_edit_value_secret", function() {
var valueSecret = $(".input_edit_value_secret").val();
that.element["EC2_SECRET"] = valueSecret;
Sunstone.runAction(resourceType+".update_template",resourceId, TemplateUtils.templateToString(that.element));
});
}
return {
'html': _html,
'setup': _setup
}
});
|
/**
* The Attachment module
* an Attachment class inheriting from KeyValue
* @module attachment
* @copyright CHECKROOM NV 2015
*/
define(['jquery', 'common/attachment'], /** Attachment */ function ($, attachmentHelper) {
var PREVIEWS = ['jpg', 'jpeg', 'png', 'gif', 'pdf'];
var DEFAULTS = {
fileName: '',
fileSize: 0,
isCover: false,
canBeCover: true
};
/**
* @name Attachment
* @class
* @property {ApiDataSource} ds attachments datasource
* @property {bool} isCover is this the cover image of a document
* @property {bool} canBeCover can this attachment be the cover of a document?
* @constructor
*/
var Attachment = function(spec) {
spec = spec || {};
this.ds = spec.ds;
this.raw = null; // the raw json object
this.fileName = spec.fileName || DEFAULTS.fileName;
this.fileSize = spec.fileSize || DEFAULTS.fileSize;
this.value = spec.value || DEFAULTS.value;
this.created = spec.created || DEFAULTS.created;
this.by = spec.by || DEFAULTS.by;
this.isCover = (spec.isCover!=null) ? spec.isCover : DEFAULTS.isCover;
this.canBeCover = (spec.canBeCover!=null) ? spec.canBeCover : DEFAULTS.canBeCover;
this.forKind = spec.forKind;
};
/**
* Gets the url of a thumbnail
* "XS": 32,
* "S": 64,
* "M": 128,
* "L": 256,
* "XL": 512
* "orig": original size
* @name Attachment#getThumbnailUrl
* @method
* @param size
* @returns {string}
*/
Attachment.prototype.getThumbnailUrl = function(size) {
return (this.hasPreview()) ? this.helper.getImageUrl(this.ds, this.value, size || 'S') : "";
};
/**
* Gets the url where the attachment can be downloaded
* @name Attachment#getDownloadUrl
* @method
* @returns {string}
*/
Attachment.prototype.getDownloadUrl = function() {
return this.ds.getBaseUrl() + this.value + '?download=True';
};
/**
* Gets the extension part of a filename
* @name Attachment#getExt
* @method
* @param fileName
* @returns {string}
*/
Attachment.prototype.getExt = function(fileName) {
return attachmentHelper.getExt(fileName || this.fileName);
};
/**
* Gets a friendly file size
* @param {int} size
* @return {string}
*/
Attachment.prototype.getFriendlyFileSize = function(){
var size = this.fileSize;
if (isNaN(size))
size = 0;
if (size < 1024)
return size + ' Bytes';
size /= 1024;
if (size < 1024)
return size.toFixed(2) + ' Kb';
size /= 1024;
if (size < 1024)
return size.toFixed(2) + ' Mb';
size /= 1024;
if (size < 1024)
return size.toFixed(2) + ' Gb';
size /= 1024;
return size.toFixed(2) + ' Tb';
}
/**
* Checks if the attachment is an image
* @name Attachment#isImage
* @method
* @returns {boolean}
*/
Attachment.prototype.isImage = function() {
return attachmentHelper.isImage(this.fileName);
};
/**
* Checks if the attachment has a preview
* @name Attachment#hasPreview
* @method
* @returns {boolean}
*/
Attachment.prototype.hasPreview = function() {
var ext = this.getExt(this.fileName);
return ($.inArray(ext, PREVIEWS) >= 0);
};
/**
* _toJson, makes a dict of the object
* @method
* @param options
* @returns {object}
* @private
*/
Attachment.prototype._toJson = function(options) {
return {
fileName: this.fileName,
fileSize: this.fileSize,
value: this.value,
created: this.created,
by: this.by
};
};
/**
* _fromJson: reads the Attachment object from json
* @method
* @param {object} data the json response
* @param {object} options dict
* @returns promise
* @private
*/
Attachment.prototype._fromJson = function(data, options) {
this.raw = data;
this.fileName = data.fileName || DEFAULTS.fileName;
this.fileSize = data.fileSize || DEFAULTS.fileSize;
this.value = data.value || DEFAULTS.value;
this.created = data.created || DEFAULTS.created;
this.by = data.by || DEFAULTS.by;
return $.Deferred().resolve(data);
};
return Attachment;
});
|
import { S3 } from 'aws-sdk';
import conf from '../../../../../lib/Config';
import getConfig from '../support/config';
import { WebsiteConfigTester } from '../../lib/utility/website-util';
const config = getConfig('default', { signatureVersion: 'v4' });
const s3 = new S3(config);
// Note: To run these tests locally, you may need to edit the machine's
// /etc/hosts file to include the following line:
// `127.0.0.1 bucketwebsitetester.s3-website-us-east-1.amazonaws.com`
const transport = conf.https ? 'https' : 'http';
const bucket = process.env.AWS_ON_AIR ? 'awsbucketwebsitetester' :
'bucketwebsitetester';
const hostname = `${bucket}.s3-website-us-east-1.amazonaws.com`;
const endpoint = process.env.AWS_ON_AIR ? `${transport}://${hostname}` :
`${transport}://${hostname}:8000`;
const aclEquivalent = {
public: ['public-read-write', 'public-read'],
private: ['private', 'authenticated-read'],
};
const headersACL = {
accessDenied: {
status: 403,
expectedHeaders: {
'x-amz-error-code': 'AccessDenied',
'x-amz-error-message': 'Access Denied',
},
},
noSuchKey: {
status: 404,
expectedHeaders: {
'x-amz-error-code': 'NoSuchKey',
'x-amz-error-message': 'The specified key does not exist.',
},
},
index: {
status: 200,
expectedHeaders: {
etag: '"95a589c37a2df74b062fb4d5a6f64197"',
},
},
};
const aclTests = [
{
it: 'should return 403 if private bucket index and error documents',
bucketACL: 'private',
objects: { index: 'private', error: 'private' },
result: 'accessDenied',
},
{
it: 'should return 403 if public bucket - private index - public ' +
'error documents',
bucketACL: 'public',
objects: { index: 'private', error: 'private' },
result: 'accessDenied',
},
{
it: 'should return 200 if private bucket - public index - ' +
'public error documents',
bucketACL: 'private',
objects: { index: 'public-read', error: 'private' },
result: 'index',
},
{
it: 'should return 200 if public bucket - public index - ' +
'private error documents',
bucketACL: 'public',
objects: { index: 'public-read', error: 'private' },
result: 'index',
},
{
it: 'should return 200 if private bucket - public index - ' +
'public error documents',
bucketACL: 'private',
objects: { index: 'public-read', error: 'public-read' },
result: 'index',
},
{
it: 'should return 200 if public bucket - public index - ' +
'public error documents',
bucketACL: 'public',
objects: { index: 'public-read', error: 'public-read' },
result: 'index',
},
{
it: 'should return 403 AccessDenied if private bucket - ' +
'without index - public error documents',
bucketACL: 'private',
objects: { error: 'public-read' },
result: 'accessDenied',
},
{
it: 'should return 404 if public bucket - without index - ' +
'public error documents',
bucketACL: 'public',
objects: { error: 'public-read' },
result: 'noSuchKey',
},
{
it: 'should return 403 if private bucket - without index - ' +
'private error documents',
bucketACL: 'private',
objects: { error: 'private' },
result: 'accessDenied',
},
{
it: 'should return 404 if public bucket - without index - ' +
'private error documents',
bucketACL: 'public',
objects: { error: 'private' },
result: 'noSuchKey',
},
{
it: 'should return 404 if public bucket - without index - ' +
'without error documents',
bucketACL: 'public',
objects: { },
result: 'noSuchKey',
},
{
it: 'should return 403 if private bucket - without index - ' +
'without error documents',
bucketACL: 'private',
objects: { },
result: 'accessDenied',
},
];
describe('Head request on bucket website endpoint with ACL', () => {
aclTests.forEach(test => {
aclEquivalent[test.bucketACL].forEach(bucketACL => {
describe(`with existing bucket with ${bucketACL} acl`, () => {
beforeEach(done => {
WebsiteConfigTester.createPutBucketWebsite(s3, bucket,
bucketACL, test.objects, done);
});
afterEach(done => {
WebsiteConfigTester.deleteObjectsThenBucket(s3, bucket,
test.objects, done);
});
it(`${test.it} with no auth credentials sent`, done => {
const result = test.result;
WebsiteConfigTester.makeHeadRequest(undefined, endpoint,
headersACL[result].status,
headersACL[result].expectedHeaders, done);
});
it(`${test.it} even with invalid auth credentials`, done => {
const result = test.result;
WebsiteConfigTester.makeHeadRequest('invalid credentials',
endpoint, headersACL[result].status,
headersACL[result].expectedHeaders, done);
});
it(`${test.it} even with valid auth credentials`, done => {
const result = test.result;
WebsiteConfigTester.makeHeadRequest('valid credentials',
endpoint, headersACL[result].status,
headersACL[result].expectedHeaders, done);
});
});
});
});
});
|
/**
* Document .
* Project chaussette.
* Created by Rockerz on 29/07/14.
*/
|
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/model/json/JSONModel",
"sap/ui/model/resource/ResourceModel"
], function(UIComponent, JSONModel, ResourceModel) {
"use strict";
return UIComponent.extend("sap.ui.core.internal.samples.composite.xmlcomposite.exTable.Component",
{
metadata:
{
manifest: "json"
},
init: function() {
// call the init function of the parent
UIComponent.prototype.init.apply(this, arguments);
}
});
});
|
var classorg_1_1onosproject_1_1net_1_1meter_1_1MeterOperations =
[
[ "MeterOperations", "classorg_1_1onosproject_1_1net_1_1meter_1_1MeterOperations.html#a4dc6dbb9a9e3d97554cea473cdb6f97c", null ],
[ "operations", "classorg_1_1onosproject_1_1net_1_1meter_1_1MeterOperations.html#ae54d5dfe135a14c3d91979a855af6f98", null ]
];
|
sap.ui.define(['sap/ui/webc/common/thirdparty/base/config/Theme', './v5/home-share', './v4/home-share'], function (Theme, homeShare$2, homeShare$1) { 'use strict';
const pathData = Theme.isThemeFamily("sap_horizon") ? homeShare$1 : homeShare$2;
var homeShare = { pathData };
return homeShare;
});
|
const models = require('../models');
const Portal = models.Portal;
const Folio = models.Folio;
const folioPage = (req, res) => res.render('folio', { csrfToken: req.csrfToken() });
const getPortal = (req, res) => Portal.PortalModel.findById(req.params.id, (err, doc) => {
if (err) {
return res.status(400).json({ error: 'An error occurred' });
}
return res.status(200).json({ portal: doc });
});
const getFolios = (req, res) =>
Folio.FolioModel.findByPortalId(req.params.portalId, (err, docs) => {
if (err) {
return res.status(400).json({ error: 'An error occurred' });
}
return res.status(200).json({ folios: docs });
});
const createFolio = (req, res) => {
const { name, title, skills, email, portfolio, portalId } = req.body;
if (!name || !title || !skills || !email || !portfolio) {
return res.status(400).json({ error: 'All fields are required' });
}
const newFolio = new Folio.FolioModel({ name, title, skills, email, portfolio, portalId });
const promise = newFolio.save();
promise.then(() => res.status(200).json({ message: 'Folio successfully created :)' }));
promise.catch((err) => {
console.log(err);
if (err.code === 11000) {
return res.status(400).json({ error: 'Folio already exists' });
}
return res.status(400).json({ error: 'An error occurred' });
});
return promise;
};
module.exports = {
folioPage,
getPortal,
getFolios,
createFolio,
};
|
/* global $ */
var utils = require('../../utils');
var _ = utils.getLodash();
/**
* A map from prefix to the next numerical suffix to try to
* use as an id in the applab app's DOM.
* @type {Object.<string, number>}
*/
var nextElementIdMap = {};
/**
* @readonly
* @enum {string}
*/
var ElementType = {
BUTTON: 'BUTTON',
LABEL: 'LABEL',
TEXT_INPUT: 'TEXT_INPUT',
CHECKBOX: 'CHECKBOX',
DROPDOWN: 'DROPDOWN',
RADIO_BUTTON: 'RADIO_BUTTON',
TEXT_AREA: 'TEXT_AREA',
IMAGE: 'IMAGE',
CANVAS: 'CANVAS',
SCREEN: 'SCREEN'
};
var elements = {};
elements[ElementType.BUTTON] = require('./button.jsx');
elements[ElementType.LABEL] = require('./label.jsx');
elements[ElementType.TEXT_INPUT] = require('./textInput.jsx');
elements[ElementType.CHECKBOX] = require('./checkbox.jsx');
elements[ElementType.DROPDOWN] = require('./dropdown.jsx');
elements[ElementType.RADIO_BUTTON] = require('./radioButton.jsx');
elements[ElementType.TEXT_AREA] = require('./textarea.jsx');
elements[ElementType.IMAGE] = require('./image.jsx');
elements[ElementType.CANVAS] = require('./canvas.jsx');
elements[ElementType.SCREEN] = require('./screen.jsx');
module.exports = {
ElementType: ElementType,
/**
* Returns an element id with the given prefix which is unused within
* the applab app's DOM.
* @param {string} prefix
* @returns {string}
*/
// TODO (brent) - the following seems a little bit strange to me:
// 1) Add item1, item2, delete item1
// 2) Add another item, it gets id item3
// 3) Reload page, add another item, it gets item1
// Seems a little like we should always get the lowest available (as in step 3)
// or always get the next (as in step 2)
getUnusedElementId: function (prefix) {
var divApplab = $('#divApplab');
var i = nextElementIdMap[prefix] || 1;
while (divApplab.find("#" + prefix + i).length !== 0) {
i++;
}
nextElementIdMap[prefix] = i + 1;
return prefix + i;
},
/**
* Resets the next element id for all prefixes to be 1. Called after clearing
* all design mode elements
*/
resetIds: function () {
nextElementIdMap = {};
},
/**
* Create a new element of the specified type
* @param {ElementType} elementType Type of element to create
* @param {number} left Position from left.
* @param {number} top Position from top.
* @param {boolean} [withoutId] If true, don't generate an id
*/
createElement: function (elementType, left, top, withoutId) {
var elementClass = elements[elementType];
if (!elementClass) {
throw new Error('Unknown elementType: ' + elementType);
}
var element = elementClass.create();
// Stuff that's common across all elements
if (!withoutId) {
element.id = this.getUnusedElementId(elementType.toLowerCase());
}
if (elementType !== ElementType.SCREEN) {
element.style.position = 'absolute';
element.style.left = left + 'px';
element.style.top = top + 'px';
element.style.margin = '0px';
}
return element;
},
getElementPropertyTab: function (elementType) {
return elements[elementType].PropertyTab;
},
getElementEventTab: function(elementType) {
return elements[elementType].EventTab;
},
/**
* @param {HTMLElement} element
* @returns {string} String representing elementType
*/
getElementType: function (element) {
var tagname = element.tagName.toLowerCase();
switch (tagname) {
case 'button':
return ElementType.BUTTON;
case 'label':
return ElementType.LABEL;
case 'select':
return ElementType.DROPDOWN;
case 'div':
if ($(element).hasClass('screen')) {
return ElementType.SCREEN;
}
return ElementType.TEXT_AREA;
case 'img':
return ElementType.IMAGE;
case 'canvas':
return ElementType.CANVAS;
case 'input':
switch (element.getAttribute('type')) {
case 'checkbox':
return ElementType.CHECKBOX;
case 'radio':
return ElementType.RADIO_BUTTON;
default:
return ElementType.TEXT_INPUT;
}
break;
}
throw new Error('unknown element type');
},
/**
* Code to be called after deserializing element, allowing us to attach any
* necessary event handlers.
*/
onDeserialize: function (element, onPropertyChange) {
var elementType = this.getElementType(element);
if (elements[elementType] && elements[elementType].onDeserialize) {
elements[elementType].onDeserialize(element, onPropertyChange);
}
},
/**
* Handle any element specific property changes. Called after designMode gets
* first crack at handling change.
* @returns {boolean} True if we modified the element in such a way that the
* property table needs to be updated.
*/
typeSpecificPropertyChange: function (element, name, value) {
var elementType = this.getElementType(element);
if (elements[elementType].onPropertyChange) {
return elements[elementType].onPropertyChange(element, name, value);
}
return false;
}
};
|
const datas = {
days: {
monday: 'Monday',
tuesday: 'Tuesday',
wednesday: 'Wednesday',
thursday: 'Thursday',
friday: 'Friday',
saturday: 'Saturday',
sunday: 'Sunday',
},
months: {
1: 'January',
2: 'February',
3: 'March',
4: 'April',
5: 'May',
6: 'June',
7: 'July',
8: 'August',
9: 'September',
10: 'October',
11: 'November',
12: 'December',
},
dateSlider: {
untilNow: 'Until now',
endDate: 'End at',
startDate: 'Start at',
},
notify: {
headline: 'New version published at %s',
feedback: 'feedback'
},
footer: {
about: 'ABOUT',
feedback: 'FEEDBACK',
code: 'SOURCE CODE',
gov: 'ICP-17008129-1'
}
}
export default datas
|
//// [derivedClassWithPrivateStaticShadowingProtectedStatic.ts]
class Base {
protected static x: string;
protected static fn(): string {
return '';
}
protected static get a() { return 1; }
protected static set a(v) { }
}
// should be error
class Derived extends Base {
private static x: string;
private static fn(): string {
return '';
}
private static get a() { return 1; }
private static set a(v) { }
}
//// [derivedClassWithPrivateStaticShadowingProtectedStatic.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var Base = /** @class */ (function () {
function Base() {
}
Base.fn = function () {
return '';
};
Object.defineProperty(Base, "a", {
get: function () { return 1; },
set: function (v) { },
enumerable: true,
configurable: true
});
return Base;
}());
// should be error
var Derived = /** @class */ (function (_super) {
__extends(Derived, _super);
function Derived() {
return _super !== null && _super.apply(this, arguments) || this;
}
Derived.fn = function () {
return '';
};
Object.defineProperty(Derived, "a", {
get: function () { return 1; },
set: function (v) { },
enumerable: true,
configurable: true
});
return Derived;
}(Base));
|
import React, { Component } from 'react';
import GardenPlot from '../gardenPlot/GardenPlot';
import PlantSearch from '../plantsearch/PlantSearch';
import GardenBuilderContainer from '../gardenBuilder/GardenBuilderContainer';
import PlantActionSelectContainer from '../plantactionselector/PlantActionSelectContainer';
import GardenActionSelectorContainer from '../gardenactionselector/GardenActionSelectorContainer';
export default class Garden extends Component {
componentDidMount() {
const {id} = this.props.match.params;
if(id) this.props.getGardenById(id);
}
render() {
const { loading, garden, error } = this.props;
// const {id} = this.props.match.params;
if (loading) return <div>Loading...</div>;
return (
<div>
{!this.props.match.params.id && <div><GardenBuilderContainer/></div>}
{error && error.map(err => <pre>{err}</pre>)}
{this.props.match.params.id && (
<div>
<h2>{garden.name}</h2>
<PlantActionSelectContainer {...this.props} />
<PlantSearch />
<GardenPlot { ...this.props } />
<GardenActionSelectorContainer/>
</div>
)}
</div>
);
}
}
|
//首页
note.config(['$stateProvider',function($stateProvider){
$stateProvider.state('home',{
url:'/home',
views:{'content':{templateUrl:templates_path+'/home.html'}}
}).state('welcome',{ //欢迎页
url:'/welcome',
views:{'content':{templateUrl:templates_path+'/welcome.html'}}
}).state('login',{ //登陆
url:'/login',
views:{'content':{templateUrl:templates_path+'/login.html'}}
}).state('register',{ //注册
url:'/register',
views:{'content':{templateUrl:templates_path+'/register.html'}}
});
}]);
|
define(
"dojo/cldr/nls/bs/islamic", //begin v1.x content
{
"dateFormatItem-yM": "MM.y.",
"dateFormatItem-yyyyMMMEd": "E, dd. MMM y. G",
"dateFormatItem-MMMEd": "E, dd. MMM",
"dateFormatItem-hms": "hh:mm:ss a",
"dateFormatItem-MMM": "LLL",
"dateFormatItem-y": "y.",
"dateFormatItem-yyyy": "y. G",
"dateFormatItem-Ed": "E, dd.",
"dateFormatItem-yMMM": "MMM y.",
"eraAbbr": [
"AH"
],
"dateFormat-long": "dd. MMMM y. G",
"dateFormatItem-Hm": "HH:mm",
"dateFormat-medium": "dd.MM.y. G",
"dateFormatItem-Hms": "HH:mm:ss",
"dateFormatItem-ms": "mm:ss",
"dateFormatItem-yyyyMd": "dd.MM.y. G",
"dateFormatItem-yyyyMMMd": "dd. MMM y. G",
"dateFormatItem-yyyyMEd": "E, dd.MM.y. G",
"dateFormatItem-MMMd": "dd. MMM",
"quarters-format-abbr": [
"K1",
"K2",
"K3",
"K4"
],
"days-format-abbr": [
"ned",
"pon",
"uto",
"sri",
"čet",
"pet",
"sub"
],
"dateFormatItem-M": "L",
"dateFormatItem-yyyyQQQ": "y G QQQ",
"dateFormatItem-MEd": "E, dd.MM.",
"dateFormatItem-hm": "hh:mm a",
"dateFormat-short": "dd.MM.y. G",
"dateFormatItem-yyyyM": "MM.y. G",
"dateFormatItem-yMMMEd": "E, dd. MMM y.",
"dateFormat-full": "EEEE, dd. MMMM y. G",
"dateFormatItem-Md": "dd.MM.",
"dateFormatItem-yyyyQ": "y G Q",
"dateFormatItem-yMEd": "E, dd.MM.y.",
"dateFormatItem-yyyyMMM": "MMM y. G",
"dateFormatItem-d": "d",
"quarters-format-wide": [
"Prvi kvartal",
"Drugi kvartal",
"Treći kvartal",
"Četvrti kvartal"
],
"days-format-wide": [
"nedjelja",
"ponedjeljak",
"utorak",
"srijeda",
"četvrtak",
"petak",
"subota"
]
}
//end v1.x content
);
|
'use strict';
/**
* @ngdoc function
* @name openshiftConsole.controller:ErrorController
* @description
* # ErrorController
* Controller of the openshiftConsole
*/
angular.module('openshiftConsole')
.controller('ErrorController', function ($scope, $window) {
var params = URI(window.location.href).query(true);
var error = params.error;
var error_description = params.error_description;
var error_uri = params.error_uri;
switch(error) {
case 'access_denied':
$scope.errorMessage = "Access denied";
break;
case 'not_found':
$scope.errorMessage = "Not found";
break;
case 'invalid_request':
$scope.errorMessage = "Invalid request";
break;
default:
$scope.errorMessage = "An error has occurred";
}
if (params.error_description) {
$scope.errorDetails = params.error_description;
}
$scope.reloadConsole = function() {
$window.location.href = "/";
};
});
|
var uuid = require('uuid');
var supportedEnvironments = require('../../utils/supportedEnvironments');
var testMatrix = [];
var instanceId;
var bindingId;
var resourceGroupName, namespaceName, azureeventhubs;
var environment = process.env['ENVIRONMENT'];
var location = supportedEnvironments[environment]['location'];
instanceId = uuid.v4();
bindingId = uuid.v4();
resourceGroupName = 'cloud-foundry-' + instanceId;
namespaceName = 'cf' + instanceId;
azureeventhubs = {
serviceName: 'azure-eventhubs',
serviceId: '7bade660-32f1-4fd7-b9e6-d416d975170b',
planId: '264ab981-9e37-44ba-b6bb-2d0fe3e80565',
instanceId: instanceId,
bindingId: bindingId,
provisioningParameters: {
'resourceGroup': resourceGroupName,
'namespaceName': namespaceName,
'eventHubName': 'testeh',
'location': location,
'tags': {
'foo': 'bar'
}
},
bindingParameters: {},
credentials: {
'namespace_name': namespaceName,
'event_hub_name': 'testeh',
'shared_access_key_name': '<string>',
'shared_access_key_value': '<string>',
},
e2e: false
};
// The client only supports AzureCloud
if (environment === 'AzureCloud') {
azureeventhubs.e2e = true;
}
testMatrix.push(azureeventhubs);
instanceId = uuid.v4();
bindingId = uuid.v4();
resourceGroupName = 'cloud-foundry-' + instanceId;
namespaceName = 'cf' + instanceId;
azureeventhubs = {
serviceName: 'azure-eventhubs',
serviceId: '7bade660-32f1-4fd7-b9e6-d416d975170b',
planId: '264ab981-9e37-44ba-b6bb-2d0fe3e80565',
instanceId: instanceId,
bindingId: bindingId,
provisioningParameters: {
'resourceGroup': resourceGroupName,
'namespaceName': namespaceName,
'eventHubName': 'testeh',
'location': location,
'eventHubProperties': {
'messageRetentionInDays': 1,
'partitionCount': 2
},
'tags': {
'foo': 'bar'
}
},
bindingParameters: {},
credentials: {
'namespace_name': namespaceName,
'event_hub_name': 'testeh',
'shared_access_key_name': '<string>',
'shared_access_key_value': '<string>',
},
e2e: false
};
// The client only supports AzureCloud
if (environment === 'AzureCloud') {
azureeventhubs.e2e = true;
}
testMatrix.push(azureeventhubs);
module.exports = testMatrix;
|
!function () {
const modules_ready = {};
/*
global events:
'u_login',
'tab_active',
'contacts',// when contacts changed online status
'u_data',// when user data updated, for example user profile photo
'contacts_pending',// when contact request or accept event appears
*/
/**
* @namespace gmtr
*/
DC.fshared.semit = () => {
};
let f_semit;
function f_get_module(obj) {
DC.load({
name: obj.name,
css: obj.css,
data: obj.data,
ready(dc){
if (modules_ready[obj.name]) return;
// gmtr.emit('m_loaded', {
// name: obj.name,
// dc: dc,
// api: api
// });
obj.ready(dc);
modules_ready[obj.name] = true;
}
});
}
function f_load_modules() {
[{
name: 'audio',
css: true,
data: {},
ready(dc) {
gmtr.emit('audio-module-ready', {dc: dc});
f_semit('get_my_audios', {}, res => {
console.log('playlist is', res);
});
}
}].forEach(i => f_get_module(i));
}
DC.fshared.getModule = f_get_module;
// TODO usefull for debugging
// gmtr.on('m_loaded', o => {
// console.log(o);
// });
gmtr.on('u_login', () => {
f_semit = DC.fshared.semit;
if(DC.fshared.user_authorized()) f_load_modules();
});
}();
|
/* @flow */
export { default } from './ButtonGroup';
export * from './themes';
|
/*
Copyright 2016 First People's Cultural Council
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 React, { Component } from 'react'
import PropTypes from 'prop-types'
import Immutable from 'immutable'
// REDUX
import { connect } from 'react-redux'
// REDUX: actions/dispatch/func
import { fetchPortal } from 'reducers/fvPortal'
import { pushWindowPath } from 'reducers/windowPath'
import NavigationHelpers from 'common/NavigationHelpers'
import CategoryList from 'components/CategoryList'
import PromiseWrapper from 'components/PromiseWrapper'
import CategoriesData from 'components/Categories/CategoriesData'
/**
* Categories page for words
*/
const { func, object } = PropTypes
export class WordCategories extends Component {
static propTypes = {
action: func,
routeParams: object.isRequired,
// REDUX: reducers/state
computeCategories: object.isRequired,
computeDialect2: object.isRequired,
properties: object.isRequired,
// REDUX: actions/dispatch/func
fetchPortal: func.isRequired,
pushWindowPath: func.isRequired,
}
constructor(props, context) {
super(props, context)
this.state = {
pathOrId: null,
filteredList: null,
open: false,
categoriesPath: null,
}
// Bind methods to 'this'
;['_onNavigateRequest'].forEach((method) => (this[method] = this[method].bind(this)))
}
fetchData(newProps) {
// const pathOrId = '/' + newProps.properties.domain + '/' + newProps.routeParams.area
const categoriesPath = '/api/v1/path/' + newProps.routeParams.dialect_path + '/Categories/@children'
newProps.fetchPortal(newProps.routeParams.dialect_path + '/Portal')
this.setState({ categoriesPath })
}
// Fetch data on initial render
componentDidMount() {
this.fetchData(this.props)
}
// Refetch data on URL change
componentWillReceiveProps(nextProps) {
if (nextProps.routeParams.area !== this.props.routeParams.area) {
this.fetchData(nextProps)
}
}
_onNavigateRequest(category) {
if (this.props.action) {
this.props.action(category)
} else {
NavigationHelpers.navigate(
'/' +
this.props.routeParams.siteTheme +
this.props.routeParams.dialect_path +
'/learn/words/categories/' +
category.uid,
this.props.pushWindowPath,
true
)
}
}
render() {
const computeEntities = Immutable.fromJS([
{
id: this.state.categoriesPath,
entity: this.props.computeCategories,
},
])
return (
<CategoriesData fetchLatest>
{({ categoriesData }) => {
let categoriesDataLayerToRender = null
if (categoriesData && categoriesData.length > 0) {
categoriesDataLayerToRender = (
<PromiseWrapper renderOnError computeEntities={computeEntities}>
<div className="row">
<div className="col-xs-12">
<CategoryList action={this._onNavigateRequest} items={categoriesData} cols={6} />
</div>
</div>
</PromiseWrapper>
)
}
return categoriesDataLayerToRender
}}
</CategoriesData>
)
}
}
// REDUX: reducers/state
const mapStateToProps = (state /*, ownProps*/) => {
const { fvCategory, fvDialect, navigation } = state
const { properties } = navigation
const { computeCategories } = fvCategory
const { computeDialect2 } = fvDialect
return {
computeCategories,
computeDialect2,
properties,
}
}
// REDUX: actions/dispatch/func
const mapDispatchToProps = {
fetchPortal,
pushWindowPath,
}
export default connect(mapStateToProps, mapDispatchToProps)(WordCategories)
|
var React = require('react');
var TopNavContainer = require('./TopNavContainer');
var MainContainer = React.createClass({
render: function () {
return (
<div id='wrapper'>
<TopNavContainer />
{this.props.children}
</div>
)
}
});
module.exports = MainContainer;
|
/**
* @license Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* 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';
const AxeAudit = require('../../../audits/accessibility/axe-audit');
const assert = require('assert');
/* eslint-env jest */
describe('Accessibility: axe-audit', () => {
describe('audit()', () => {
it('generates audit output using subclass meta', () => {
class FakeA11yAudit extends AxeAudit {
static get meta() {
return {
id: 'fake-aria-fail',
title: 'You have an aria-* issue',
requiredArtifacts: ['Accessibility'],
};
}
}
const artifacts = {
Accessibility: {
violations: [{
id: 'fake-aria-fail',
nodes: [{}],
help: 'http://example.com/',
}],
},
};
const output = FakeA11yAudit.audit(artifacts);
assert.equal(output.rawValue, false);
});
});
});
|
Army = {
makeArmy : function(img)
{
var armyShared = ArmyShared.makeArmyShared(img, null);
var oldAttack = armyShared.attack;
var army = {
moving: function(x, y)
{
var moveMap = this.indexMovement().moveMap;
for(var i = 0; i < moveMap.length; i++)
{
if(moveMap[i].x == x && moveMap[i].y ==y )
{
var armyObj = Field.getArmyObject(x, y);
if(!armyObj)
{
this.moved(x, y, moveMap[i].speed);
Server.sendBroadcast(JSON.stringify({type : "moving", x : x, y : y, id : this.id, speed : this.speed}));
return;
}
}
}
},
attack : function(playerObj)
{
var result = oldAttack.call(this, playerObj);
if(result != null)
{
Server.sendBroadcast(JSON.stringify({type : "attack", id : this.id, idDef : playerObj.id, hurt : result}));
}
}
}
return Object.assign(armyShared, army);
}
}
Army = Object.assign(ArmyShared, Army);
|
// Compiled by ClojureScript 1.10.238 {}
goog.provide('process.env');
goog.require('cljs.core');
/** @define {string} */
goog.define("process.env.NODE_ENV","development");
//# sourceMappingURL=env.js.map?rel=1526826999526
|
var View = function(controler) {
this.divisionSize = 100;
this.playerElement = $('#player');
this.spotLight = $('#spotlight');
$(document).keyup( function(e){
controler.keyCodeProcessor(e);
e.preventDefault();
}).bind(controler);
//stopping scrolling on keydown
$(document).keydown( function(e){
//swallow
e.preventDefault();
});
}
View.prototype.setPlayerLocation = function(location, win) {
var row = parseInt(location[1])
var col = parseInt(location[0])
var leftPosition = (row * this.divisionSize) + 'px';
this.playerElement.css('left', leftPosition);
var topPosition = (col * this.divisionSize) + 'px';
this.playerElement.css('top', topPosition);
if (win == true){
alert("YOU WIN :D !!!!!1!!1") ;
}
if (location == "13"){
this.playerElement.css("background-image", "url(images/octolorde.png)");
}
}
View.prototype.toggleSpotlight = function() {
}
|
/*
Qookery - Declarative UI Building for Qooxdoo
Copyright (c) Ergobyte Informatics S.A., www.ergobyte.gr
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.
*/
/**
* The Qookery ACE plugin allows to use the ACE editor in qookery forms
*
* The main minified ACE source file must be named ace.js and reside in
* <code>${q:external-libraries}/ace/</code>. Additional ACE files may exist
* alongside for additional themes, workers etc. To get the editor working,
* the minimal set is "ace.js" and "theme-eclipse.js".
*
* You will need to download a version of the editor with the required plugins
* yourself. This can be done manually, or via the included ANT task in build.xml.
*
* If you are using the javascript compiler, add the following code to your
* compile.json file:
*
* <pre>
* "include": [
* "qookery.*",
* "qookery.ace.*"
* ...
* ]
* </pre>
*/
|
'use strict';
var parseArgs = require('minimist'),
App = require('./src/app'),
commonConfig = require('./src/common/config'),
logger = require('./src/common/logger'),
utils = require('./src/common/utils'),
Subscription = require('./src/database/subscription'),
// prepare argument parsing
parseOptions = {
string: [
'api.host',
'database.host',
'torrentCommand'
],
boolean: [ // specifying arguments as booleans makes them `false` if unspecified
'production',
'serveStaticFiles'
],
alias: {
h: 'help',
apihost: 'api.host',
apiport: 'api.port',
databasehost: 'database.host',
databaseport: 'database.port',
torrentcommand: 'torrentCommand',
servestaticfiles: 'serveStaticFiles'
},
unknown: function (arg) {
console.log('WARNING: Unknown argument "' + arg + '", ignoring.');
return false;
}
},
removeAliases = function (args) {
delete args._h;
delete args.apihost;
delete args.apiport;
delete args.databasehost;
delete args.databaseport;
delete args.torrentcommand;
delete args.servestaticfiles;
return args;
},
removeNonConfigEntries = function (config) {
delete config._;
delete config.production;
return config;
},
// parse arguments and prepare config
args = removeAliases(parseArgs(process.argv.slice(2), parseOptions)),
baseConfig = args.production ? commonConfig.getProductionConfig() : commonConfig.getDebugConfig(),
config = removeNonConfigEntries(utils.mergeObjects(baseConfig, args)),
log,
app;
if (args.help) {
console.log('Configurable values:');
console.log('\t--production:\t\t\t\tTrue if the production default configuration should be used');
console.log('\t--api.host, --apihost:\t\t\tHost where the API should be running');
console.log('\t--api.port, --apiport:\t\t\tPort on which the API should be running');
console.log('\t--database.host, --databasehost:\tHost of the database');
console.log('\t--database.port, --databaseport:\tPort of the database');
console.log('\t--torrentCommand, --torrentcommand:\tCommand that should be used to start a ' +
'torrent download');
console.log('\t--serveStaticFiles, --servestaticfiles:\tTrue if the server should also serve ' +
'the static files for the web UI');
process.exit();
}
log = logger.createLogger(config.logging).child({component: 'server'});
log.debug('Using configuration', config);
Subscription.initialize(log.child({component: 'database'}), config.database);
app = new App(config, log);
app.listen(function () {
log.info('Started API on %s:%d', this.address().address, this.address().port);
});
|
import templateUrl from './service-details-ansible-modal.html'
export const ServiceDetailsAnsibleModalComponent = {
controller: ComponentController,
controllerAs: 'vm',
bindings: {
resolve: '<',
close: '&',
dismiss: '&'
},
templateUrl
}
/** @ngInject */
function ComponentController () {
const vm = this
angular.extend(vm, {
cancel: cancel
})
function cancel () {
vm.dismiss({$value: 'cancel'})
}
}
|
var $elems = $('html, body');
var delta = 0;
$(document).on('mousemove', function(e) {
var h = $(window).height();
var y = e.clientY - h / 2;
delta = y * 0.1;
});
$(window).on('blur mouseleave', function() {
delta = 0;
});
(function f() {
if(delta) {
$elems.scrollTop(function(i, v) {
return v + delta;
})
}
webkitRequestAnimationFrame(f);
})();
|
/**
* @license Copyright 2021 The Lighthouse 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.
*/
'use strict';
/**
* @param {LH.Gatherer.FRProtocolSession} session
* @return {Promise<LH.Crdp.ServiceWorker.WorkerVersionUpdatedEvent>}
*/
function getServiceWorkerVersions(session) {
return new Promise((resolve, reject) => {
/**
* @param {LH.Crdp.ServiceWorker.WorkerVersionUpdatedEvent} data
*/
const versionUpdatedListener = data => {
// find a service worker with runningStatus that looks like active
// on slow connections the serviceworker might still be installing
const activateCandidates = data.versions.filter(sw => {
return sw.status !== 'redundant';
});
const hasActiveServiceWorker = activateCandidates.find(sw => {
return sw.status === 'activated';
});
if (!activateCandidates.length || hasActiveServiceWorker) {
session.off('ServiceWorker.workerVersionUpdated', versionUpdatedListener);
session.sendCommand('ServiceWorker.disable').then(_ => resolve(data), reject);
}
};
session.on('ServiceWorker.workerVersionUpdated', versionUpdatedListener);
session.sendCommand('ServiceWorker.enable').catch(reject);
});
}
/**
* @param {LH.Gatherer.FRProtocolSession} session
* @return {Promise<LH.Crdp.ServiceWorker.WorkerRegistrationUpdatedEvent>}
*/
function getServiceWorkerRegistrations(session) {
return new Promise((resolve, reject) => {
session.once('ServiceWorker.workerRegistrationUpdated', data => {
session.sendCommand('ServiceWorker.disable').then(_ => resolve(data), reject);
});
session.sendCommand('ServiceWorker.enable').catch(reject);
});
}
module.exports = {getServiceWorkerVersions, getServiceWorkerRegistrations};
|
/*
Copyright 2015 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import reactor from 'app/reactor';
import {filter} from './getters';
import {fetchSiteEvents} from './../sessions/actions';
import { TLPT_STORED_SESSINS_FILTER_SET_RANGE } from './actionTypes';
import Logger from 'app/lib/logger';
const logger = Logger.create('Modules/Sessions');
const actions = {
fetchSiteEventsWithinTimeRange(){
let { start, end } = reactor.evaluate(filter);
return _fetch(start, end);
},
setTimeRange(start, end){
reactor.batch(()=>{
reactor.dispatch(TLPT_STORED_SESSINS_FILTER_SET_RANGE, {start, end});
_fetch(start, end);
});
}
}
function _fetch(start, end){
return fetchSiteEvents(start, end)
.fail(err => {
logger.error('fetching filtered set of sessions', err);
});
}
export default actions;
|
var fs = require('fs');
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var runSequence = require('run-sequence');
var babelify = require('babelify');
var babel = require("gulp-babel");
var mocha = require('gulp-mocha');
// require hook
require("babel/register");
var env = 'dev';
gulp.task('clean:dev', function() {
return del(['.tmp']);
});
gulp.task('clean:dist', function() {
return del(['dist']);
});
gulp.task('create-config', function(cb) {
fs.writeFile('app/config.json', JSON.stringify({
env: env,
}), cb);
});
gulp.task('scripts', function() {
var bundler = browserify('./app/scripts/app.js', {
debug: true,
extensions: ['.js','.jsx']
}).transform(babelify);
return bundler.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest('.tmp/scripts'));
});
gulp.task('compass', function() {
return gulp.src('app/styles/**/*.scss')
.pipe($.plumber())
.pipe($.compass({
css: '.tmp/styles',
sass: 'app/styles'
}));
});
gulp.task('imagemin', function() {
return gulp.src('app/images/*')
.pipe($.imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest('dist/images'));
});
gulp.task('copy', function() {
return gulp.src(['app/*.txt', 'app/*.ico'])
.pipe(gulp.dest('dist'));
});
gulp.task('bundle', function () {
var assets = $.useref.assets({searchPath: '{.tmp,app,vendor}'});
var jsFilter = $.filter(['**/*.js']);
var cssFilter = $.filter(['**/*.css']);
var htmlFilter = $.filter(['*.html']);
return gulp.src('app/*.html')
.pipe(assets)
.pipe(assets.restore())
.pipe($.useref())
.pipe(jsFilter)
.pipe($.uglify())
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe($.autoprefixer({
browsers: ['last 5 versions']
}))
.pipe($.minifyCss())
.pipe(cssFilter.restore())
.pipe(htmlFilter)
.pipe($.htmlmin({collapseWhitespace: true}))
.pipe(htmlFilter.restore())
.pipe(gulp.dest('dist'))
.pipe($.size());
});
gulp.task('webserver', function() {
return gulp.src(['.tmp', 'app', 'vendor'])
.pipe($.webserver({
host: 'localhost', //change to 'localhost' to disable outside connections
livereload: true,
open: true,
port: 1337
}));
});
gulp.task('serve', function() {
runSequence('clean:dev', ['create-config', 'scripts', 'compass'], 'webserver');
gulp.watch('app/*.html');
gulp.watch('app/scripts/**/*.js', ['scripts']);
gulp.watch('app/scripts/**/*.jsx', ['scripts']);
gulp.watch('app/styles/**/*.scss', ['compass']);
});
gulp.task('build', function() {
env = 'prod';
runSequence(['clean:dev', 'clean:dist'],
['create-config', 'scripts', 'compass', 'imagemin', 'copy'],
'bundle');
});
gulp.task('test', function () {
return gulp.src('tests/**/*-test.js')
.pipe(babel())
.pipe(mocha({reporter: 'nyan'}));
});
|
'use strict';
// load files
require('../humans.txt');
require('../manifest.json');
require('../manifest.webapp');
require('../robots.txt');
// load images
require('../i/logo.png');
require('../i/favicon.png');
require('../i/touch/apple-touch-icon.png');
require('../i/touch/chrome-touch-icon-192x192.png');
require('../i/touch/icon-128x128.png');
require('../i/touch/ms-touch-icon-144x144-precomposed.png');
// load less
require('../less/app.less');
var $ = require('jquery');
var AMUI = require('amazeui');
// 使用 NPM 中的模块
var hljs = require('highlight.js');
var $modal = $('<div class="am-modal am-modal-no-btn" id="my-modal">\n ' +
'<div class="am-modal-dialog">\n ' +
'<div class="am-modal-hd">Amaze UI' +
'<a href="javascript: void(0)" class="am-close am-close-spin" ' +
'data-am-modal-close>×</a>\n </div>\n ' +
'<div class="am-modal-bd">\n 你好,世界!<br />你正在使用的 Amaze UI ' +
AMUI.VERSION + '.\n </div>\n </div>\n</div>');
$(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
$(document.body).append($modal);
$modal.modal('open');
console.info('Hello World. This is Amaze UI Starter Kit.');
});
|
var classorg_1_1onosproject_1_1provider_1_1of_1_1packet_1_1impl_1_1OpenFlowCorePacketContext =
[
[ "OpenFlowCorePacketContext", "classorg_1_1onosproject_1_1provider_1_1of_1_1packet_1_1impl_1_1OpenFlowCorePacketContext.html#a0d736fcf641797bfc61bb4fe9dcd4084", null ],
[ "send", "classorg_1_1onosproject_1_1provider_1_1of_1_1packet_1_1impl_1_1OpenFlowCorePacketContext.html#a968252872ea755d52dab6ffcba5d64bb", null ]
];
|
import * as loglevel from 'loglevel'
var level = localStorage.getItem('loglevel:cerberus') || 'INFO'
var log = loglevel.getLogger('cerberus')
log.setLevel(level)
export default log
export function getLogger(name) {
var level = localStorage.getItem(`loglevel:${name}`) || 'INFO'
var log = loglevel.getLogger(name)
log.setLevel(level)
return log
}
|
/** User VO */
var User = function(pId, pFirst, pLast, pLogin, pPass, pMail, pCartItems, pRole, pAddresses) {
this.id = pId;
this.firstName = pFirst;
this.lastName = pLast;
this.login = pLogin;
this.password = pPass;
this.mail = pMail;
this.cart = new Cart(pCartItems);
this.role = pRole;
this.addresses = [];
if (pAddresses) {
for (var index = 0; index < pAddresses.length; index++) {
var addr = pAddresses[index];
this.addresses.push(new Address(addr.firstName, addr.lastName, addr.address, addr.postalCode,
addr.town, addr.isDefault));
}
}
};
|
//// [es5ExportDefaultFunctionDeclaration.ts]
export default function f() { }
//// [es5ExportDefaultFunctionDeclaration.js]
function f() { }
exports.default = f;
//// [es5ExportDefaultFunctionDeclaration.d.ts]
export default function f(): void;
|
//------------------------------------------------------------------------------
// Copyright IBM Corp. 2016
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//------------------------------------------------------------------------------
'use strict';
angular.module('angularApp')
.directive('request', function () {
return {
templateUrl: 'views/directives/request.html'
};
});
|
'use strict';
/**
* Each source object must provide these functions
* (they all return promises):
*
* * onUserInfoSaved(userInfo);
* * onLogin(reqAuthData, userInfo);
*/
exports.sourceMethodNames = [
// This is a special hook for the 'save' function;
// it is not added to the AuthenticationMethodSchema methods.
// onUserInfoSaved
'onLogin'
];
exports.sources = {
local: require('./local')
};
exports.sourceNames = [];
for (var k in exports.sources) {
if (exports.sources.hasOwnProperty(k)) {
exports.sourceNames.push(k);
}
}
|
// File describing all migrations and their upward/downward changes
// for API Usage Information see https://github.com/percolatestudio/meteor-migrations
import {Meteor} from 'meteor/meteor';
import {ImageResources} from '../imports/modules/constants';
/* eslint-disable lodash/prefer-lodash-method */
if(Meteor.isServer) {
Migrations.config({
log: true,
logIfLatest: false
});
Migrations.add({
version: 1,
name: 'Adds profileImage field to every user if not already there. Uses the id `Default/default_<gender-name>`.',
up: () => {
const users = Meteor.users.find().fetch(); //eslint-disable-line
_(users)
.filter((u) => _.isNil(u.profile.profileImage))
.forEach((user) => {
const gender = user.profile.gender;
Meteor.users.update({_id: user._id}, {
$set: {
'profile.profileImage': ImageResources.profile.defaultProfileImageUrl(gender)
}
});
});
},
down: () => Meteor.users.update({}, {$unset: {'profile.profileImage': ""}}, {validate: false, multi: true})
});
Migrations.add({
version: 2,
name: 'Move api details from root user object to a stressApi sub-document',
up: () => {
const users = Meteor.users.find().fetch();
_(users)
.thru((user) => {
user.stressApi = {
apiKey: user.apiAuthKey,
apiAuthType: user.apiAuthType
};
delete user.apiAuthKey;
delete user.apiAuthType;
return user;
}).forEach((user) => Meteor.users.update({_id: user._id}, {
$unset: {
apiAuthKey: "",
apiAuthType: ""
},
$set: {
"stressApi.apiKey": user.stressApi.apiKey,
"stressApi.apiAuthType": user.stressApi.apiKey
}
}, {validate: false, multi: true}));
},
down() {
const users = Meteor.users.find().fetch();
_(users)
.thru((user) => {
user.apiAuthKey = user.stressApi.apiKey;
user.apiAuthType = user.stressApi.apiAuthType;
delete user.stressApi;
return user;
}).forEach((user) => Meteor.users.update({_id: user._id}, {
$unset: {
stressApi: ""
},
$set: {
apiAuthKey: user.apiAuthKey,
apiAuthType: user.apiAuthType
}
}, {validate: false, multi: true}));
}
});
}
/* eslint-enable */
|
var numberOfPagesToOpen = 10;
var url = '';
var system = require('system');
var args = system.args;
var failures = 0;
if (args.length === 1) {
console.log('Usage:\nphantomjs http://url 100\nReturns how long it takes to load url 100 times.');
phantom.exit(0);
} else {
var url = args[1] || 'https://google.com/';
numberOfPagesToOpen = args[2] ? args[2] : 10;
}
var page = require('webpage').create();
var startTime = new Date();
var numberOfPagesOpened = 0;
var getElapsedTime = function(date) {
return date - startTime;
};
var startTest = function() {
startTime = new Date();
console.log('Testing ' + url + ' ' + numberOfPagesToOpen + ' times.');
openPage();
};
var continueTest = function() {
console.log('page ' + numberOfPagesOpened + ': ' + getElapsedTime(new Date()));
numberOfPagesOpened++;
if (numberOfPagesOpened < numberOfPagesToOpen) {
openPage();
} else {
endTest();
}
};
var openPage = function() {
page.open(url, function (status) {
switch (status) {
case 'error':
console.log(url + ' failed to load.');
phantom.exit(1);
break;
case 'fail':
failures++;
default:
break;
}
console.log('Loading page: ' + numberOfPagesOpened + ': ' + new Date() + '\nstatus: ' + status);
page.evaluate(function(data) {
document.addEventListener('DOMContentLoaded', function() {
window.callPhantom('DOMContentLoaded');
}, false);
});
continueTest();
});
page.onCallback = function(data) {
continueTest();
};
};
var getFailureMessage = function(fails) {
if (!fails) {
return;
}
var percentFail = numberOfPagesToOpen / fails * 100;
return 'Failures: ' + fails + ' (' + Math.round(percentFail) + '%)';
};
var endTest = function() {
var endTime = new Date();
var elapsedTime = endTime - startTime;
var failureMessage = '';
console.log('\n\n***************\nLoaded ' + url + ' '
+ numberOfPagesToOpen + ' times\n'
+ '\tElapsed: ' + elapsedTime + 'ms'
+ '\n\t' + getFailureMessage(failures)
+'\n***************');
phantom.exit();
};
// page.onLoadFinished = function(status) {
// console.log('loadFinished');
// continueTest();
// };
startTest();
|
'use strict'
const {
GraphQLInterfaceType,
GraphQLNonNull,
GraphQLID
} = require('graphql');
const {videoType} = require('../')
const nodeInterface = new GraphQLInterfaceType({
name : 'Node',
fields : {
id : {
type : new GraphQLNonNull(GraphQLID)
}
},
resolveType : (obj) =>{
if(obj.title){
return videoType
}
else {
return null
}
}
})
// +})
// name : 'Node',
// fields : {
// id : {
// type : new GraphQLNonNull(GraphQLID),
// }
// },
// resolveType : (obj) =>{
// if(obj.title){
// return videoType
// }
// else {
// return null
// }
// }
// })
module.exports = nodeInterface;
|
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2016 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides class sap.ui.base.Event
sap.ui.define(['jquery.sap.global', './Object'],
function(jQuery, BaseObject) {
"use strict";
/**
* Creates an event with the given <code>sId</code>, linked to the provided <code>oSource</code> and enriched with the <code>mParameters</code>.
*
* @param {string} sId The id of the event
* @param {sap.ui.base.EventProvider} oSource The source of the event
* @param {object} mParameters A map of parameters for this event
*
* @class An Event object consisting of an id, a source and a map of parameters
* @extends sap.ui.base.Object
* @implements sap.ui.base.Poolable
* @author SAP SE
* @version 1.36.11
* @alias sap.ui.base.Event
* @public
*/
var Event = BaseObject.extend("sap.ui.base.Event", /** @lends sap.ui.base.Event.prototype */ {
constructor : function(sId, oSource, mParameters) {
BaseObject.apply(this);
if (arguments.length > 0) {
this.init(sId, oSource, mParameters);
}
}
});
/**
* Init this event with its data.
*
* The <code>init</code> method is called by an object pool when the
* object is (re-)activated for a new caller.
*
* When no <code>mParameters</code> are given, an empty object is used instead.
*
* @param {string} sId The id of the event
* @param {sap.ui.base.EventProvider} oSource The source of the event
* @param {object} [mParameters] The event parameters
*
* @private
*
* @see sap.ui.base.Poolable.prototype#init
*/
Event.prototype.init = function(sId, oSource, mParameters) {
jQuery.sap.assert(typeof sId === "string", "Event.init: sId must be a string");
jQuery.sap.assert(sap.ui.require('sap/ui/base/EventProvider') && oSource instanceof sap.ui.require('sap/ui/base/EventProvider'), "Event.init: oSource must be an EventProvider");
this.sId = sId;
this.oSource = oSource;
this.mParameters = mParameters || {};
this.bCancelBubble = false;
this.bPreventDefault = false;
};
/**
* Reset event data, needed for pooling.
*
* @see sap.ui.base.Poolable.prototype#reset
* @private
*/
Event.prototype.reset = function() {
this.sId = "";
this.oSource = null;
this.mParameters = null;
this.bCancelBubble = false;
this.bPreventDefault = false;
};
/**
* Returns the id of the event.
*
* @return {string} The id of the event
* @public
*/
Event.prototype.getId = function() {
return this.sId;
};
/**
* Returns the event provider on which the event was fired.
*
* @return {sap.ui.base.EventProvider} The source of the event
* @public
*/
Event.prototype.getSource = function() {
return this.oSource;
};
/**
* Returns all parameter values of the event keyed by their names.
* @return {map} All parameters of the event keyed by name
* @public
*/
Event.prototype.getParameters = function() {
return this.mParameters;
};
/**
* Returns the value of the parameter with the given sName.
*
* @param {string} sName The name of the parameter to return
* @return {any} The value for the named parameter
* @public
*/
Event.prototype.getParameter = function(sName) {
jQuery.sap.assert(typeof sName === "string" && sName, "Event.getParameter: sName must be a non-empty string");
return this.mParameters[sName];
};
/**
* Cancel bubbling of the event.
*
* <b>Note:</b> This function only has an effect if the bubbling of the event is supported by the event source.
*
* @public
*/
Event.prototype.cancelBubble = function() {
this.bCancelBubble = true;
};
/**
* Prevent the default action of this event.
*
* <b>Note:</b> This function only has an effect if preventing the default action of the event is supported by the event source.
*
* @public
*/
Event.prototype.preventDefault = function() {
this.bPreventDefault = true;
};
return Event;
});
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-obj-id.case
// - src/dstr-binding/default/let-stmt.template
/*---
description: Rest element containing an object binding pattern (`let` statement)
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
es6id: 13.3.1.4
features: [destructuring-binding]
flags: [generated]
info: |
LexicalBinding : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let value be GetValue(rhs).
3. ReturnIfAbrupt(value).
4. Let env be the running execution context's LexicalEnvironment.
5. Return the result of performing BindingInitialization for BindingPattern
using value and env as the arguments.
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
BindingRestElement : ... BindingPattern
1. Let A be ArrayCreate(0).
[...]
3. Repeat
[...]
b. If iteratorRecord.[[done]] is true, then
i. Return the result of performing BindingInitialization of
BindingPattern with A and environment as the arguments.
[...]
---*/
let [...{ length }] = [1, 2, 3];
assert.sameValue(length, 3);
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
// - src/dstr-binding/default/cls-decl-meth.template
/*---
description: Trailing comma is allowed following BindingPropertyList (class expression method)
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
es6id: 14.5.15
features: [destructuring-binding]
flags: [generated]
info: |
ClassDeclaration : class BindingIdentifier ClassTail
1. Let className be StringValue of BindingIdentifier.
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
argument className.
[...]
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
21. For each ClassElement m in order from methods
a. If IsStatic of m is false, then
i. Let status be the result of performing
PropertyDefinitionEvaluation for m with arguments proto and
false.
[...]
14.3.8 Runtime Semantics: DefineMethod
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
[...]
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
scope, strict). If functionPrototype was passed as a parameter then pass its
value as the functionPrototype optional argument of FunctionCreate.
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
13.3.3 Destructuring Binding Patterns
ObjectBindingPattern[Yield] :
{ }
{ BindingPropertyList[?Yield] }
{ BindingPropertyList[?Yield] , }
---*/
var callCount = 0;
class C {
method({ x: [y], }) {
assert.sameValue(y,45);
callCount = callCount + 1;
}
};
new C().method({ x: [45] });
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
function f() {
return 1;
}
function f() {
return 2;
}
export default f;
|
function receiveMessage(event) {
if (event.data.message == 'fetch-json') {
var opsworksJson = document.getElementById('stack_custom_json').value;
$('#jsoneditoriframe').get(0).contentWindow.postMessage({
jsonFromOpsworks: opsworksJson
}, chrome.extension.getURL(''));
}
if (event.data.message == 'write-json') {
document.getElementById('stack_custom_json').value = event.data.jsonFromEditor;
}
}
addEventListener("message", receiveMessage, false);
function initEditor() {
var iframe = document.createElement('iframe');
iframe.id = 'jsoneditoriframe';
iframe.style.width = '700px';
iframe.style.height = '500px';
iframe.src = chrome.extension.getURL('editor-iframe.html');
var textarea = document.getElementById('stack_custom_json');
if (textarea) {
$(iframe).insertBefore(textarea);
textarea.rows = 10;
textarea.readOnly = true;
textarea.style.height = '100px';
}
}
function DOMModificationHandler() {
$(this).unbind('DOMSubtreeModified');
//This default value seems a bit weird, but the textarea at opsworks has
//a default value of "JSON" until the actual JSON has been loaded.
var val = 'JSON';
if (document.getElementById('stack_custom_json')) {
val = document.getElementById('stack_custom_json').value;
}
if (val != 'JSON') {
initEditor();
} else {
setTimeout(function() {
$('#c').bind('DOMSubtreeModified',
DOMModificationHandler);
}, 100);
}
}
$('#c').bind('DOMSubtreeModified', DOMModificationHandler);
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
// - src/dstr-binding/error/cls-decl-gen-meth.template
/*---
description: Object binding pattern with "nested" array binding pattern taking the `null` value (class expression method)
esid: sec-class-definitions-runtime-semantics-evaluation
es6id: 14.5.16
features: [generators, destructuring-binding]
flags: [generated]
info: |
ClassDeclaration : class BindingIdentifier ClassTail
1. Let className be StringValue of BindingIdentifier.
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
argument className.
[...]
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
21. For each ClassElement m in order from methods
a. If IsStatic of m is false, then
i. Let status be the result of performing
PropertyDefinitionEvaluation for m with arguments proto and
false.
[...]
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
1. Let propKey be the result of evaluating PropertyName.
2. ReturnIfAbrupt(propKey).
3. If the function code for this GeneratorMethod is strict mode code,
let strict be true. Otherwise let strict be false.
4. Let scope be the running execution context's LexicalEnvironment.
5. Let closure be GeneratorFunctionCreate(Method,
StrictFormalParameters, GeneratorBody, scope, strict).
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
[...]
3. If Initializer is present and v is undefined, then
[...]
4. Return the result of performing BindingInitialization for BindingPattern
passing v and environment as arguments.
---*/
class C {
*method({ w: [x, y, z] = [4, 5, 6] }) {}
};
var c = new C();
assert.throws(TypeError, function() {
c.method({ w: null });
});
|
var winston = require('winston');
exports.init = function(conf) {
return new (winston.Logger)({
transports: [
new (winston.transports.Console)({
level: conf.log.level || 'debug',
"colorize": conf.log.colorize || true,
"timestamp": conf.log.timestamp || true
})
],
exitOnError: false
});
};
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
// - src/dstr-binding/default/async-gen-func-expr.template
/*---
description: Rest element (array binding pattern) may not be followed by any element (async generator function expression)
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated, async]
negative:
phase: parse
type: SyntaxError
info: |
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
AsyncGeneratorBody }
[...]
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
AsyncGeneratorBody, scope, strict).
[...]
13.3.3 Destructuring Binding Patterns
ArrayBindingPattern[Yield] :
[ Elisionopt BindingRestElement[?Yield]opt ]
[ BindingElementList[?Yield] ]
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
---*/
throw "Test262: This statement should not be evaluated.";
var callCount = 0;
var f;
f = async function*([...[x], y]) {
callCount = callCount + 1;
};
f([1, 2, 3]).next().then(() => {
assert.sameValue(callCount, 1, 'invoked exactly once');
}).then($DONE, $DONE);
|
var CommentForm = React.createClass({
handleSubmit: function(e) {
e.preventDefault();
var author = this.refs.author.getDOMNode().value.trim();
var text = this.refs.text.getDOMNode().value.trim();
if (!text || !author) {
return;
}
this.props.onCommentSubmit({author: author, text: text});
this.refs.author.getDOMNode().value = '';
this.refs.text.getDOMNode().value = '';
return;
},
render: function() {
return (
<form className="commentForm" onSubmit={this.handleSubmit}>
<input type="text" placeholder="Your name" ref="author" /><br/>
<textarea type="text" placeholder="Say something..." ref="text"></textarea><br/>
<input type="submit" value="Post" />
</form>
);
}
});
|
var Emitter = (function() {
var callbacks = {};
return {
on: function(type, callback) {
if(!!callbacks[type]) {
callbacks[type] = [];
}
callbacks[type].push({action: callback, isActive: true})
},
emit: function(type) {
if(!!callbacks[type]) {
for(var i = 0, length = callbacks[type].length; i < length; i++) {
if(callbacks[type][i].isActive) {
callbacks[type][i]();
}
}
}
}
}
})();
module.exports = Emitter;
|
/*!
* VisualEditor UserInterface TargetToolbar class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* UserInterface target toolbar.
*
* @class
* @extends ve.ui.SurfaceToolbar
*
* @constructor
* @param {ve.init.Target} target Target to control
* @param {ve.ui.Surface} surface Surface to control
* @param {Object} [options] Configuration options
*/
ve.ui.TargetToolbar = function VeUiTargetToolbar( target, surface, options ) {
// Parent constructor
ve.ui.SurfaceToolbar.call( this, surface, options );
// Properties
this.target = target;
};
/* Inheritance */
OO.inheritClass( ve.ui.TargetToolbar, ve.ui.SurfaceToolbar );
/* Methods */
/**
* Gets the target which the toolbar controls.
*
* @returns {ve.init.Target} Target being controlled
*/
ve.ui.TargetToolbar.prototype.getTarget = function () {
return this.target;
};
|
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-empty.case
// - src/dstr-binding/default/gen-method-dflt.template
/*---
description: No iteration occurs for an "empty" array binding pattern (generator method (default parameter))
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
es6id: 14.4.13
features: [generators, destructuring-binding, default-parameters]
flags: [generated]
info: |
GeneratorMethod :
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
1. Let propKey be the result of evaluating PropertyName.
2. ReturnIfAbrupt(propKey).
3. If the function code for this GeneratorMethod is strict mode code,
let strict be true. Otherwise let strict be false.
4. Let scope be the running execution context's LexicalEnvironment.
5. Let closure be GeneratorFunctionCreate(Method,
StrictFormalParameters, GeneratorBody, scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
ArrayBindingPattern : [ ]
1. Return NormalCompletion(empty).
---*/
var iterations = 0;
var iter = function*() {
iterations += 1;
}();
var callCount = 0;
var obj = {
*method([] = iter) {
assert.sameValue(iterations, 0);
callCount = callCount + 1;
}
};
obj.method().next();
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
|
/**
* @fileoverview Build file
* @author nzakas
*/
/* global cp, echo, rm */
/* eslint no-console: 0*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
import "shelljs/make.js";
//------------------------------------------------------------------------------
// Data
//------------------------------------------------------------------------------
const DOCS_DIR = "./docs";
//------------------------------------------------------------------------------
// Tasks
//------------------------------------------------------------------------------
echo("Syncing README.md from root with docs/README.md");
rm("-r", `${DOCS_DIR}/README.md`);
cp("README.md", DOCS_DIR);
echo("Done. ");
|
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.every
es5id: 15.4.4.16-7-c-i-25
description: >
Array.prototype.every - This object is the Arguments object which
implements its own property get method (number of arguments is
less than number of parameters)
---*/
var called = 0;
function callbackfn(val, idx, obj) {
called++;
return val === 11;
}
var func = function(a, b) {
return Array.prototype.every.call(arguments, callbackfn);
};
assert(func(11), 'func(11) !== true');
assert.sameValue(called, 1, 'called');
|
var expect = require('chai').expect;
var assert = require('chai').assert;
var selenium = require('selenium-launcher');
var soda = require('soda');
var browser = null;
var World = function(callback){
this.assert = assert;
this.expect = expect;
if (browser == null) {
selenium(function(err,selenium){
browser = soda.createClient({
host: selenium.host,
port: selenium.port,
url: "http://localhost:9001",
browser: "firefox"
});
this.browser = browser;
callback({browser: this.browser});
process.on('exit', function(){
selenium.kill();
});
});
} else {
this.browser = browser;
callback({browser: this.browser});
}
};
exports.World = World;
|
// This file was procedurally generated from the following sources:
// - src/dstr-assignment/obj-prop-put-prop-ref.case
// - src/dstr-assignment/default/for-of.template
/*---
description: The DestructuringAssignmentTarget of an AssignmentElement may be a PropertyReference. (For..of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( LeftHandSideExpression of AssignmentExpression ) Statement
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
AssignmentExpression, iterate).
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
keyResult, assignment, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. If destructuring is true and if lhsKind is assignment, then
a. Assert: lhs is a LeftHandSideExpression.
b. Let assignmentPattern be the parse of the source text corresponding to
lhs using AssignmentPattern as the goal symbol.
[...]
---*/
var x = {};
var counter = 0;
for ({ xy: x.y } of [{ xy: 4 }]) {
assert.sameValue(x.y, 4);
counter += 1;
}
assert.sameValue(counter, 1);
|
/*!
* VisualEditor InternalListNode class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* ContentEditable internal list node.
*
* @class
* @extends ve.ce.BranchNode
* @constructor
* @param {ve.dm.InternalListNode} model Model to observe
* @param {Object} [config] Configuration options
*/
ve.ce.InternalListNode = function VeCeInternalListNode( model, config ) {
// Parent constructor
ve.ce.BranchNode.call( this, model, config );
// An internal list has no rendering
this.$ = $( [] );
};
/* Inheritance */
OO.inheritClass( ve.ce.InternalListNode, ve.ce.BranchNode );
/* Static Properties */
ve.ce.InternalListNode.static.name = 'internalList';
/* Methods */
/**
* Deliberately empty: don't build an entire CE tree with DOM elements for things that won't render
* @inheritdoc
*/
ve.ce.InternalListNode.prototype.onSplice = function () {
};
/* Registration */
ve.ce.nodeFactory.register( ve.ce.InternalListNode );
|
tabris.load(function() {
var page = tabris.create("Page", {
title: "ProgressBar",
topLevel: true
});
var progressBar = tabris.create("ProgressBar", {
layoutData: {left: 15, right: 15, centerY: 0},
maximum: 300,
selection: 100
}).appendTo(page);
setInterval(function() {
var selection = progressBar.get("selection") + 1;
progressBar.set("selection", selection > 300 ? 0 : selection);
}, 20);
page.open();
});
|
// Copyright (c) 2011 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.
// Simple success test: we want content-script APIs to be available (like
// sendRequest), but other APIs to be undefined.
var success = false;
try {
var foo = chrome.tabs.create;
} catch (e) {
success = e.message.indexOf(
" can only be used in extension processes.") > -1;
}
chrome.extension.sendRequest({success: success});
|
/*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */
/**
* @license
* Copyright (c) 2015 The ExpandJS authors. All rights reserved.
* This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
* The complete set of authors may be found at https://expandjs.github.io/AUTHORS.txt
* The complete set of contributors may be found at https://expandjs.github.io/CONTRIBUTORS.txt
*/
(function () {
"use strict";
var lodash = require('lodash');
/**
* Checks if `value` is instance of `Date`.
*
* ```js
* XP.isDate(new Date());
* // => true
*
* XP.isDate('Mon April 23 2012');
* // => false
* ```
*
* @function isDate
* @param {*} value The value to check.
* @returns {boolean} Returns `true` or `false` accordingly to the check.
*/
module.exports = function isDate(value) {
return lodash.isDate(value);
};
}());
|
/*
A simple slider object that works with jQuery.
Put this in your html :
<div class="lydSlider">
<img src="./img/slider-left.png" alt="left">
<div class="container">
<div class="bar">
<div class='imgBox'><img src='./img/slider1.jpg' alt='slider_img'></div>
<div class='imgBox'><img src='./img/slider2.jpg' alt='slider_img'></div>
<div class='imgBox'><img src='./img/slider3.jpg' alt='slider_img'></div>
</div>
</div>
<img src="./img/slider-right.png" alt="right">
</div>
You can change the wrapper class name : 'lydSlider';
and all the images (left and right arrows include) : './img/slider-left.png', './img/slider-right.png', './img/slider1.jpg', './img/slider2.jpg' and './img/slider3.jpg'
*/
var LydSlider = {
toBelaunched: true, // used for disabling more then one clic on the right or left button
init: function(options){
this.containerClass = '.' + options.containerClass; // can be the class '.lydSlider'
this.barClass = this.containerClass + ' .bar';
this.imgBoxClass = this.containerClass + ' .imgBox';
this.sWidth = options.sWidth;
this.defineArrowHeight();
this.assignCSS(options.sWidth, options.sHeight, options.spaceBeforeArrow);
this.addFunctionMoveToRightArrow();
this.addFunctionStopToRightArrow();
this.addClickListenerToLeftArrow();
this.addClickListenerToRightArrow();
},
defineArrowHeight : function(){
var arrowHeight = $(this.containerClass + ' [alt="right"]').css('height');
arrowHeight = arrowHeight.substring(0, arrowHeight.length - 2);
this.arrowHeight = arrowHeight;
},
assignCSS : function(sWidth, sHeight,spaceBeforeArrow){
var leftArrow = this.containerClass + '>img:first-child';
var rightArrow = this.containerClass + '>img:last-child';
with($(this.containerClass)){
css('position', 'relative');
css('width', sWidth+'px');
css('margin', 'auto');
}
with($(leftArrow)){
css('position', 'absolute');
css('left', '-' + spaceBeforeArrow + 'px');
css('top', 'calc(50% - ' + this.arrowHeight / 2 + 'px)');
}
with($(rightArrow)){
css('position', 'absolute');
css('right', '-' + spaceBeforeArrow + 'px');
css('top', 'calc(50% - ' + this.arrowHeight / 2 + 'px)');
}
$(this.containerClass + ' .container').css({
'position' : 'relative',
'width' : sWidth,
'height' : sHeight,
'font-size' : '0',
'overflow' : 'hidden'
});
$(this.barClass).css({
'position' : 'absolute',
'width' : sWidth * 3 + 'px',
'left' : '0'
});
$(this.imgBoxClass).css({
'display' : 'inline-block',
'width' : sWidth,
'height' : sHeight
});
$(this.imgBoxClass + ' img').css({
'width' : sWidth,
'height' : sHeight
});
$(this.barClass).css('left','-' + this.sWidth + 'px');
},
addFunctionStopToRightArrow : function() {
var $thisLydSlider = this; // we save this in a variable to use it in the following functions
$($thisLydSlider.containerClass + ' [alt="right"]').on('stop', function() {
$thisLydSlider.toBelaunched = false;
});
},
addFunctionMoveToRightArrow : function(){
var $thisLydSlider = this;
$(this.containerClass + ' [alt="right"]').on('move', function(event, param) {
if($thisLydSlider.toBelaunched){
if(param=='right'){
$($thisLydSlider.barClass).animate({'left': '-=' + $thisLydSlider.sWidth + 'px'},1500, function(){
$thisLydSlider.toBelaunched = true;
var left = $($thisLydSlider.barClass).css('left');
if(left == '-' + $thisLydSlider.sWidth * 2 + 'px')$($thisLydSlider.imgBoxClass + ':last-child').after($($thisLydSlider.imgBoxClass + ':first-child'));
$($thisLydSlider.barClass).css('left','-' + $thisLydSlider.sWidth + 'px');
});
}else{
$($thisLydSlider.barClass).animate({'left': '+=' + $thisLydSlider.sWidth + 'px'},1500, function(){
$thisLydSlider.toBelaunched = true;
var left = $($thisLydSlider.barClass).css('left');
if(left == '0px')$($thisLydSlider.imgBoxClass + ':first-child').before($($thisLydSlider.imgBoxClass + ':last-child'));
$($thisLydSlider.barClass).css('left','-' + $thisLydSlider.sWidth + 'px');
});
}
}
});
},
addClickListenerToLeftArrow: function(){
var $thisLydSlider = this;
$(this.containerClass + ' [alt="left"]').click(function() {
$($thisLydSlider.containerClass + ' [alt="right"]').trigger('move', 'left').trigger('stop');
});
},
addClickListenerToRightArrow: function(){
$(this.containerClass + ' [alt="right"]').click(function() {
$(this).trigger('move', 'right').trigger('stop');
});
}
};
|
(function(global, undef) {
var isBrowser = !! (typeof window !== undef && global.navigator && global.document);
var debug;
var basepath;
if (isBrowser) {
debug = (/debug/).test(location.search);
basepath = location.href.slice(0, location.href.lastIndexOf('/'));
}
var mod = {
basepath: debug ? basepath + '/src/': basepath + '/assest/',
alias: {
"markdown": "mods/markdown"
}
};
if (global.define && isBrowser) {
define('config', function() {
return mod;
});
} else {
module.exports = mod;
}
})(this);
|
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
/* eslint-disable import/no-mutable-exports */
// This function will deliver an error message to the browser console when all of the props passed in are undefined (falsey).
import warning from 'warning';
let oneOfComponent = function oneOfComponentFunction() {};
if (process.env.NODE_ENV !== 'production') {
const hasWarned = {};
oneOfComponent = function oneOfComponentFunction(
control,
props,
propName,
allowedComponents,
comment,
specificTest // if this is set, it will be checked instead of props[propName]
) {
const additionalComment = comment ? ` ${comment}` : '';
let componentType;
if (specificTest) {
if (typeof specificTest.type === 'string') {
componentType = specificTest.type;
} else {
componentType = specificTest.type.displayName;
}
} else if (typeof props[propName].type === 'string') {
componentType = props[propName].type;
} else {
componentType = props[propName].type.displayName;
}
const allowedComponentFound = allowedComponents.indexOf(componentType) > -1;
if (!allowedComponentFound && !hasWarned[control]) {
/* eslint-disable max-len */
warning(
false,
`[Design System React] ${control} requires that prop '${propName}' is an instance of one of the following components: ${allowedComponents.join(
', '
)}. An instance of '${componentType}' was given.${additionalComment}`
);
/* eslint-enable max-len */
hasWarned[control] = true;
}
};
}
export default oneOfComponent;
|
import { Application } from './lib/application';
import * as Sentry from 'sentry-expo';
import { SENTRY_DSN, SENTRY_ENABLE_IN_DEV, SENTRY_DEBUG } from 'react-native-dotenv';
Sentry.init({
dsn: SENTRY_DSN,
enableInExpoDevelopment: SENTRY_ENABLE_IN_DEV,
debug: SENTRY_DEBUG
});
export default Application;
|
import { uniqWith, identical, pipe, curryN } from 'ramda';
import lengthLte from './lengthLte';
/**
* Returns true if all items in the list are equivalent using `R.identical` for equality comparisons.
*
* @func allIdentical
* @memberOf RA
* @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
* @category List
* @sig [a] -> Boolean
* @param {Array} list The list of values
* @return {boolean}
* @see {@link https://ramdajs.com/docs/#identical|identical}
* @example
*
* RA.allIdentical([ 1, 2, 3, 4 ]); //=> false
* RA.allIdentical([ 1, 1, 1, 1 ]); //=> true
* RA.allIdentical([]); //=> true
* RA.allIdentical([ {}, {} ]); //=> false
* RA.allIdentical([ () => {}, () => {} ]); //=> false
*/
const allIdentical = curryN(1, pipe(uniqWith(identical), lengthLte(1)));
export default allIdentical;
|
import merge from 'lodash/merge';
export default class {
constructor() {
this.pageSize = 25;
this.translations = {
emptyPlaceholder: 'No data available',
};
}
/**
* Set the default page size
* @param {Number} pageSize the default page size
*/
setPageSize(pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set the translations for the datagrid component
* @param {Object} translations a map of translations
*/
setTranslations(translations) {
this.translations = merge(this.translations, translations);
return this;
}
$get() {
return {
pageSize: this.pageSize,
translations: this.translations,
};
}
}
|
/**
* $Id: editor_plugin_src.js,v 1.1 2006/12/26 22:46:51 tmseidel Exp $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('insertdatetime');
var TinyMCE_InsertDateTimePlugin = {
getInfo : function() {
return {
longname : 'Insert date/time',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_insertdatetime.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
/**
* Returns the HTML contents of the insertdate, inserttime controls.
*/
getControlHTML : function(cn) {
switch (cn) {
case "insertdate":
return tinyMCE.getButtonHTML(cn, 'lang_insertdate_desc', '{$pluginurl}/images/insertdate.gif', 'mceInsertDate');
case "inserttime":
return tinyMCE.getButtonHTML(cn, 'lang_inserttime_desc', '{$pluginurl}/images/inserttime.gif', 'mceInsertTime');
}
return "";
},
/**
* Executes the mceInsertDate command.
*/
execCommand : function(editor_id, element, command, user_interface, value) {
/* Adds zeros infront of value */
function addZeros(value, len) {
value = "" + value;
if (value.length < len) {
for (var i=0; i<(len-value.length); i++)
value = "0" + value;
}
return value;
}
function getDateTime(d, fmt) {
fmt = fmt.replace("%D", "%m/%d/%y");
fmt = fmt.replace("%r", "%I:%M:%S %p");
fmt = fmt.replace("%Y", "" + d.getFullYear());
fmt = fmt.replace("%y", "" + d.getYear());
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
fmt = fmt.replace("%B", "" + tinyMCE.getLang("lang_inserttime_months_long")[d.getMonth()]);
fmt = fmt.replace("%b", "" + tinyMCE.getLang("lang_inserttime_months_short")[d.getMonth()]);
fmt = fmt.replace("%A", "" + tinyMCE.getLang("lang_inserttime_day_long")[d.getDay()]);
fmt = fmt.replace("%a", "" + tinyMCE.getLang("lang_inserttime_day_short")[d.getDay()]);
fmt = fmt.replace("%%", "%");
return fmt;
}
// Handle commands
switch (command) {
case "mceInsertDate":
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_dateFormat", tinyMCE.getLang('lang_insertdate_def_fmt'))));
return true;
case "mceInsertTime":
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_timeFormat", tinyMCE.getLang('lang_inserttime_def_fmt'))));
return true;
}
// Pass to next handler in chain
return false;
}
};
tinyMCE.addPlugin("insertdatetime", TinyMCE_InsertDateTimePlugin);
|
var Backbone = require('backbone');
module.exports = Backbone.View.extend({
events: {
'change': 'handleChange',
},
template: _.template(`<span class='<%= holderClass %>'></span>`),
initialize(opts) {
var opt = opts || {};
var ppfx = opt.ppfx || '';
this.target = opt.target || {};
this.inputClass = ppfx + 'field';
this.inputHolderClass = ppfx + 'input-holder';
this.ppfx = ppfx;
this.listenTo(this.model, 'change:value', this.handleModelChange);
},
/**
* Handled when the view is changed
* 视图更改时处理
*/
handleChange(e) {
e.stopPropagation();
this.setValue(this.getInputEl().value);
},
/**
* Set value to the model
* 将值设置为模型
* @param {string} value
* @param {Object} opts
*/
setValue(value, opts) {
var opt = opts || {};
var model = this.model;
model.set({
value: value || model.get('defaults')
}, opt);
// Generally I get silent when I need to reflect data to view without
// reupdating the target
//一般来说,当我需要反映数据来查看时,我不会更新目标
if(opt.silent) {
this.handleModelChange();
}
},
/**
* Updates the view when the model is changed
* 更改模型时更新视图
* */
handleModelChange() {
this.getInputEl().value = this.model.get('value');
},
/**
* Get the input element
* 获取输入元素
* @return {HTMLElement}
*/
getInputEl() {
if(!this.inputEl) {
this.inputEl = $('<input>', {
type: 'text',
class: this.inputCls,
placeholder: this.model.get('defaults')
});
}
return this.inputEl.get(0);
},
render() {
var el = this.$el;
el.addClass(this.inputClass);
el.html(this.template({
holderClass: this.inputHolderClass,
ppfx: this.ppfx
}));
el.find('.'+ this.inputHolderClass).html(this.getInputEl());
return this;
}
});
|
var parse = require("./message-parser");
var cube = require("cube");
var emitter = cube.emitter("ws://127.0.0.1:1080"); // TODO configure
process.on("SIGINT", function() {
emitter.close();
});
module.exports = function(date, source, dyno, message) {
if (source === "heroku" && dyno === "router") {
message = parse(message);
if (message.at === "info") {
if ("connect" in message) message.connect = +message.connect.slice(0, -2);
if ("service" in message) message.service = +message.service.slice(0, -2);
if ("status" in message) message.status = +message.status;
if ("bytes" in message) message.bytes = +message.bytes;
emitter.send({
type: "heroku_info",
time: date,
data: message
});
}
} else if (source === "app") {
try {
message = JSON.parse(message);
var type = message.type;
if (type) {
delete message.type;
emitter.send({
type: type.replace(/-/g, "_"),
time: date,
data: message
});
}
} catch (ignore) {}
}
};
|
angular.module('RadCalc').directive('isolateForm', [function () {
return {
restrict: 'A',
require: '?form',
link: function (scope, elm, attrs, ctrl) {
if (!ctrl) {
return;
}
// Do a copy of the controller
var ctrlCopy = {};
angular.copy(ctrl, ctrlCopy);
// Get the parent of the form
var parent = elm.parent().controller('form');
// Remove parent link to the controller
parent.$removeControl(ctrl);
// Replace form controller with a "isolated form"
var isolatedFormCtrl = {
$setValidity: function (validationToken, isValid, control) {
ctrlCopy.$setValidity(validationToken, isValid, control);
parent.$setValidity(validationToken, true, ctrl);
},
$setDirty: function () {
elm.removeClass('ng-pristine').addClass('ng-dirty');
ctrl.$dirty = true;
ctrl.$pristine = false;
},
};
angular.extend(ctrl, isolatedFormCtrl);
}
};
}]);
|
$(function(){
//阅读全文按钮
$('.post-permalink .btn').click(function(){
});
//留言版-显示表情包
$tog=true;
$('.face-img').click(function(){
if($tog){
$('.exp-box').show();
}else{
$('.exp-box').hide();
}
$tog=!$tog;
});
//留言板-留言:转换表情
$arr_face=[];
$all_face=[];
$msg_face=[];
for($i=0; $i< $('.exp-box li').length; $i++){
$arr_face.push($('.exp-box li').eq($i).find('img').attr('alt'));
$all_face.push($('.exp-box li').eq($i).find('img').attr('src'));
}
$('.exp-box li').click(function(){
$('#text').val($('#text').val()+'/'+$(this).find('img').attr('alt')+'/');
//记录点击的表情
//$arr_face.push($(this).find('img').attr('src'));
});
//留言板-点击留言按钮
$('.expression button').click(function(){
$msgContent=$('#text').val();
if($msgContent.indexOf(':')){
$msgContent=$msgContent.substring($msgContent.indexOf(':')+1);
}
if($msgContent.indexOf('/')!=-1){
$msg_face=$msgContent.split('/');
$final_array =[];
console.log("-----内容切分之后的数据-----"+$msg_face+"---length----" +$msg_face.length+"-----type----"+ typeof($msg_face) );
$.each($msg_face, function($key, $value){
console.log("-------" +$value+ "=======");
if($value != ""){
$final_array.push(findInArr($value,$arr_face,$all_face));
console.log("-----final_array---"+$final_array);
}
});
$msgContent=$final_array.join('');
}
$.ajax(
{
url:'index.php?r=message/add',
type:'post',
dataType: "json",
data:{
content:$msgContent,
toId :$(":input[name='toId']").val(),
articleId: $(":input[name='articleId']").val(),
},
success:function(str){
if(str.code == 0){
$(":input[name='toId']").val('');
location.reload()
}else{
alert(str.msg);
return false;
}
}
}
);
$('.exp-box').hide();
$tog=false;
$('#text').val('');
});
//留言板-点击回复按钮
$('.reply').click(function(){
//获取回复的用户名
$str=$(this).parent().parent().parent().find('a').eq(0).html();
//截取用户名
if($str.indexOf('<')!=-1){
$str=$str.substring($str.indexOf(';')+1,$str.indexOf('<'));
}else{
$str=$str.substring($str.indexOf(';')+1);
}
$('#text').val('回复'+$str+':');
$("input[name='toId']").val($(this).attr("toid"));
$('#text').focus();
});
//留言板-点击"顶"按钮
$('.acc').click(function(){
$(this).css({
'color':'#f4645f',
'text-decoration':'none'
});
$idData = $(this).attr("messageid");
$_this=$(this);
$.ajax(
{
url:'index.php?r=message/acc',
type:'post',
dataType: "json",
data:{
id:$idData
},
success:function(str){
if(str.code == 0){
//顶值+1
$accNum=$_this.html().replace(/\(\d+\)/,function(str2){
str2=str2.substring(1,str2.length-1);
str2++;
return '('+str2+')';
});
//重新给顶-赋值
$_this.html($accNum);
}else{
return false;
}
}
}
);
});
//留言板-点击“踩”按钮
$('.ref').click(function(){
$(this).css({
'color':'#f4645f',
'text-decoration':'none'
});
$idData = $(this).attr("messageid");
$_this=$(this);
$.ajax(
{
url:'index.php?r=message/ref',
type:'post',
dataType: "json",
data:{
id:$idData
},
success:function(str){
if(str.code == 0){
//顶值+1
$accNum=$_this.html().replace(/\(\d+\)/,function(str2){
str2=str2.substring(1,str2.length-1);
str2++;
return '('+str2+')';
});
//重新给顶-赋值
$_this.html($accNum);
}else{
return false;
}
}
}
);
});
//标签云
$('.tag-cloud a').click(function(){
$(this).addClass('active');
});
$('.tag-cloud a i').click(function(){
$(this).parent().removeClass('active');
return false;
});
});
function findInArr($n,$arr,$arr2){
console.log("---第一个参数-" +$n+ "--第二个参数--"+$arr+"--第三个参数----"+$arr2);
for($i=0 ; $i< $arr.length ; $i++){
console.log("======"+$arr[$i]+"======="+($n==$arr[$i]));
if($n==$arr[$i]){
return '<img src="'+$arr2[$i]+'">';
}
}
return $n;
}
|
var filtergrid = "#materialgrid_gw";
var filtermodal = "#MaterialFilter";
var filtersearch = "MaterialSearch";
var modalShow = function () {
$(filtergrid).find('.filter_button').click(function (e) {
e.preventDefault();
$(filtermodal).modal('show').find('.modal-body').html('<div style="height: 150px; width: 100%; background: url(' + baseUrl + 'images/progress.svg) center center no-repeat; background-size: 20px;"></div>');
$(filtermodal).modal('show').find('.modal-body').load($(this).attr('href'), function () {
SetStyleFilterBehavior();
GetScrollFilter("div.insideforms");
$("div.insideforms").scroll(function () {
SetScrollFilter(this);
});
});
});
};
$(document).ready(function () {
$(document).on('pjax:success', function () {
modalShow();
});
$(document).on("click", filtermodal + "_apply", function () {
if ($("form.gridview-filter-form").find(".has-error").length)
return false;
$(filtermodal)[0].statusform = 1;
$(filtermodal).modal("hide");
$(filtergrid).yiiGridView("applyFilter");
return false;
});
$(document).on('click', filtermodal + "_resetfilter, " + filtermodal + "_reset", function (event) {
bootbox.confirm("Вы уверены, что хотите сбросить дополнительный фильтр?", function (result) {
if (result) {
$(filtermodal).modal("hide");
$(filtermodal)[0].statusform = 0;
$(filtergrid).yiiGridView("applyFilter");
}
});
});
$(document).on('click', filtermodal + "_close", function (event) {
$(filtermodal).modal("hide");
});
$(document).on("beforeFilter", filtergrid, function (event) {
$("div.insideforms input[type='text'].form-control").each(function (key, value) {
$(value).val(($(value).val()).toUpperCase());
});
var formcontain = $("form" + filtermodal + "-form").serialize();
var formgrid = $("form.gridview-filter-form");
var input = $("input[name='" + filtersearch + "[_filter]']");
if ($(filtermodal).length && $(filtermodal)[0].statusform === 1) {
if (!input.length)
formgrid.append($('<input type="hidden" class="form-control" name="' + filtersearch + '[_filter]" />').val(formcontain));
else
input.val(formcontain);
} else if (input.length)
input.remove();
return true;
});
$(document).on("keyup", "input.searchfilterform", function () {
$("div.insideforms").find("div.panelblock").hide();
$("label").each(function (key, value) {
var searchinput = ($("input.searchfilterform").val()).toUpperCase();
var labelinput = $.trim(($(value).text()).toUpperCase());
if ((labelinput).indexOf(searchinput) < 0)
$(value).parent("div").hide();
else {
$(value).parentsUntil("div.insideforms", "div.panelblock").show();
$(value).parent("div").show();
}
})
});
modalShow();
});
|
var ex__put__concat__elem__block_8c =
[
[ "ex_put_concat_elem_block", "ex__put__concat__elem__block_8c.html#a03cff8e6e59a2c6b56cc1f232c2898c8", null ]
];
|
angular.module('os.biospecimen.models.visitnameprinter', ['os.common.models'])
.factory('VisitNamePrinter', function(osModel, $http, Alerts) {
var VisitNamePrinter = osModel('visit-name-printer');
VisitNamePrinter.printNames = function(detail) {
return $http.post(VisitNamePrinter.url(), detail).then(
function(resp) {
Alerts.success("visits.names_print_job_created", {jobId: resp.data.id});
return resp.data;
}
);
};
return VisitNamePrinter;
});
|
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
// Compressed version of core/ckeditor_base.js. See original for instructions.
/*jsl:ignore*/
if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.5.2',revision:'6450',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
/*jsl:end*/
// Uncomment the following line to have a new timestamp generated for each
// request, having clear cache load of the editor code.
// CKEDITOR.timestamp = ( new Date() ).valueOf();
// Set the script name to be loaded by the loader.
CKEDITOR._autoLoad = 'core/ckeditor_basic';
// Include the loader script.
document.write(
'<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
|
import React, { PureComponent } from 'react';
import { I18nManager, Platform, View, ViewPropTypes } from 'react-native';
import PropTypes from 'prop-types';
import PaginationDot from './PaginationDot';
import styles from './Pagination.style';
const IS_IOS = Platform.OS === 'ios';
const IS_RTL = I18nManager.isRTL;
export default class Pagination extends PureComponent {
static propTypes = {
activeDotIndex: PropTypes.number.isRequired,
dotsLength: PropTypes.number.isRequired,
activeOpacity: PropTypes.number,
carouselRef: PropTypes.object,
containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
dotColor: PropTypes.string,
dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
dotElement: PropTypes.element,
dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
inactiveDotColor: PropTypes.string,
inactiveDotElement: PropTypes.element,
inactiveDotOpacity: PropTypes.number,
inactiveDotScale: PropTypes.number,
inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
renderDots: PropTypes.func,
tappableDots: PropTypes.bool,
vertical: PropTypes.bool
};
static defaultProps = {
inactiveDotOpacity: 0.5,
inactiveDotScale: 0.5,
tappableDots: false,
vertical: false
}
constructor (props) {
super(props);
// Warnings
if ((props.dotColor && !props.inactiveDotColor) || (!props.dotColor && props.inactiveDotColor)) {
console.warn(
'react-native-snap-carousel | Pagination: ' +
'You need to specify both `dotColor` and `inactiveDotColor`'
);
}
if ((props.dotElement && !props.inactiveDotElement) || (!props.dotElement && props.inactiveDotElement)) {
console.warn(
'react-native-snap-carousel | Pagination: ' +
'You need to specify both `dotElement` and `inactiveDotElement`'
);
}
if (props.tappableDots && !props.carouselRef) {
console.warn(
'react-native-snap-carousel | Pagination: ' +
'You must specify prop `carouselRef` when setting `tappableDots` to `true`'
);
}
}
_needsRTLAdaptations () {
const { vertical } = this.props;
return IS_RTL && !IS_IOS && !vertical;
}
get _activeDotIndex () {
const { activeDotIndex, dotsLength } = this.props;
return this._needsRTLAdaptations() ? dotsLength - activeDotIndex - 1 : activeDotIndex;
}
get dots () {
const {
activeOpacity,
carouselRef,
dotsLength,
dotColor,
dotContainerStyle,
dotElement,
dotStyle,
inactiveDotColor,
inactiveDotElement,
inactiveDotOpacity,
inactiveDotScale,
inactiveDotStyle,
renderDots,
tappableDots
} = this.props;
if (renderDots) {
return renderDots(this._activeDotIndex, dotsLength, this);
}
const DefaultDot = <PaginationDot
carouselRef={carouselRef}
tappable={tappableDots && typeof carouselRef !== 'undefined'}
activeOpacity={activeOpacity}
color={dotColor}
containerStyle={dotContainerStyle}
style={dotStyle}
inactiveColor={inactiveDotColor}
inactiveOpacity={inactiveDotOpacity}
inactiveScale={inactiveDotScale}
inactiveStyle={inactiveDotStyle}
/>;
let dots = [];
for (let i = 0; i < dotsLength; i++) {
const isActive = i === this._activeDotIndex;
dots.push(React.cloneElement(
(isActive ? dotElement : inactiveDotElement) || DefaultDot,
{
key: `pagination-dot-${i}`,
active: i === this._activeDotIndex,
index: i
}
));
}
return dots;
}
render () {
const { dotsLength, containerStyle, vertical } = this.props;
if (!dotsLength || dotsLength < 2) {
return false;
}
const style = [
styles.sliderPagination,
{ flexDirection: vertical ?
'column' :
(this._needsRTLAdaptations() ? 'row-reverse' : 'row')
},
containerStyle || {}
];
return (
<View pointerEvents={'box-none'} style={style}>
{ this.dots }
</View>
);
}
}
|
"use strict";
var katex = require('katex');
export class LaTeXTransformer {
get mimetype() {
return 'text/latex';
}
transform(latex, doc) {
var el = doc.createElement('div');
el.innerHTML = katex.renderToString(latex);
return el;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.