text
stringlengths
2
6.14k
/* * _ _ _ * | | | | | | * | | __ _| |__ ___ ___ __ _| |_ Labcoat (R) * | |/ _` | '_ \ / __/ _ \ / _` | __| Powerful development environment for Quirrel. * | | (_| | |_) | (_| (_) | (_| | |_ Copyright (C) 2010 - 2013 SlamData, Inc. * |_|\__,_|_.__/ \___\___/ \__,_|\__| All Rights Reserved. * * * This program is free software: you can redistribute it and/or modify it under the terms of the * GNU Affero General Public License as published by the Free Software Foundation, either version * 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License along with this * program. If not, see <http://www.gnu.org/licenses/>. * */ /* File: jstree.sort.js Sorts items alphabetically (or using any other function) */ /* Group: jstree sort plugin */ (function ($) { $.jstree.plugin("sort", { __construct : function () { this.get_container() .bind("load_node.jstree", $.proxy(function (e, data) { var obj = this.get_node(data.rslt.obj); obj = obj === -1 ? this.get_container_ul() : obj.children("ul"); this._sort(obj, true); }, this)) .bind("rename_node.jstree create_node.jstree", $.proxy(function (e, data) { this._sort(data.rslt.obj.parent(), false); }, this)) .bind("move_node.jstree copy_node.jstree", $.proxy(function (e, data) { var m = data.rslt.parent === -1 ? this.get_container_ul() : data.rslt.parent.children('ul'); this._sort(m, false); }, this)); }, defaults : function (a, b) { return this.get_text(a, true) > this.get_text(b, true) ? 1 : -1; }, _fn : { _sort : function (obj, deep) { var s = this.get_settings(true).sort, t = this; obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t))); obj.children('li').each(function () { t.correct_node(this, false); }); if(deep) { obj.find("> li > ul").each(function() { t._sort($(this)); }); t.correct_node(obj.children('li'), true); } } } }); // include the sort plugin by default $.jstree.defaults.plugins.push("sort"); })(jQuery);
<script> /************************************************************************* * * ADOBE CONFIDENTIAL * ___________________ * * Copyright 2012 Adobe Systems Incorporated * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Adobe Systems Incorporated and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Adobe Systems Incorporated and its * suppliers and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Adobe Systems Incorporated. **************************************************************************/ function addEchoSignButton(record_id, parent_module) { // pre 6.5 buttons var tds = document.getElementsByTagName("td"); var last_button = ''; for (i=0; i < tds.length; i++) { if (tds[i].className == "buttons") { last_button = tds[i]; } } var ul = document.getElementById("detail_header_action_menu"); if(ul){ var sugar_action_button = ul.firstChild; var child = sugar_action_button.firstChild; var subnav; while(child){ if(child.className == 'subnav'){ subnav = child; } child = child.nextSibling; } } var input = document.createElement("input"); input.setAttribute("class", "button"); input.setAttribute("type", "submit"); input.setAttribute("name", "button"); input.setAttribute("value", "Create EchoSign Agreement"); input.setAttribute("title", "Create EchoSign Agreement"); if(parent_module == 'Quotes') { // 6.5 if(subnav && subnav.className == 'subnav') input.setAttribute("onclick", "ajaxStatus.flashStatus(\'Creating EchoSign Agreement\', 2000);var _form = document.getElementById('formDetailView'); _form.module.value='echo_Agreements'; _form.action.value='CreateAgreementFromModule';_form.return_module.value='Quotes';_form.return_action.value=document.getElementById('sugarpdf').value;SUGAR.ajaxUI.submitForm(_form);"); } else{ if(subnav && subnav.className == 'subnav') input.setAttribute("onclick", "ajaxStatus.flashStatus(\'Creating EchoSign Agreement\', 2000);var _form = document.getElementById('formDetailView'); _form.module.value='echo_Agreements'; _form.action.value='CreateAgreementFromModule';_form.return_module.value='"+parent_module+"';SUGAR.ajaxUI.submitForm(_form);"); } var new_td = document.createElement("td"); new_td.setAttribute("class", "buttons"); new_td.setAttribute("align", "left"); new_td.appendChild(input); // 6.5 if(subnav && subnav.className == 'subnav'){ var li = document.createElement("li"); li.innerHTML=new_td.innerHTML; subnav.appendChild(li); } // pre 6.5 else if(last_button.parentNode){ new_td = get_pre_65_button(record_id, parent_module); last_button.parentNode.insertBefore(new_td, last_button); } } function get_pre_65_button(record_id, parent_module) { var form = document.createElement("form"); form.setAttribute("action", "index.php"); form.setAttribute("method", "POST"); form.setAttribute("name", "Send4Signature"); form.setAttribute("id", "SendForAgreementForm"); var input1 = document.createElement("input"); input1.setAttribute("type", "hidden"); input1.setAttribute("name", "module"); input1.setAttribute("value", "echo_Agreements"); var input2 = document.createElement("input"); input2.setAttribute("type", "hidden"); input2.setAttribute("name", "record"); input2.setAttribute("value", record_id); var input3 = document.createElement("input"); input3.setAttribute("type", "hidden"); input3.setAttribute("name", "parent_module"); input3.setAttribute("value", parent_module); var input4 = document.createElement("input"); input4.setAttribute("type", "hidden"); input4.setAttribute("name", "action"); input4.setAttribute("value", "CreateAgreementFromModule"); var input5 = document.createElement("input"); input5.setAttribute("class", "button"); input5.setAttribute("type", "submit"); input5.setAttribute("name", "button"); input5.setAttribute("value", "Create EchoSign Agreement"); input5.setAttribute("title", "Create EchoSign Agreement"); if(parent_module == 'Quotes') { input5.setAttribute("onclick", "if(document.getElementById('sugarpdf')){ this.form.custom_sugarpdf.value=document.getElementById('sugarpdf').value; }else if(value=document.getElementById('layout')){ this.form.custom_sugarpdf.value=document.getElementById('layout').value;}"); var input6 = document.createElement("input"); input6.setAttribute("type", "hidden"); input6.setAttribute("name", "custom_sugarpdf"); input6.setAttribute("id", "custom_sugarpdf"); input6.setAttribute("value", ""); } form.appendChild(input1); form.appendChild(input2); form.appendChild(input3); form.appendChild(input4); if(parent_module == 'Quotes') form.appendChild(input6); form.appendChild(input5); var new_td = document.createElement("td"); new_td.setAttribute("class", "buttons"); new_td.setAttribute("align", "left"); new_td.appendChild(form); return new_td; } </script>
/* * LICENCE : CloudUnit is available under the Affero Gnu Public License GPL V3 : https://www.gnu.org/licenses/agpl-3.0.html * but CloudUnit is licensed too under a standard commercial license. * Please contact our sales team if you would like to discuss the specifics of our Enterprise license. * If you are not sure whether the GPL is right for you, * you can always test our software under the GPL and inspect the source code before you contact us * about purchasing a commercial license. * * LEGAL TERMS : "CloudUnit" is a registered trademark of Treeptik and can't be used to endorse * or promote products derived from this project without prior written permission from Treeptik. * Products or services derived from this software may not be called "CloudUnit" * nor may "Treeptik" or similar confusing terms appear in their names without prior written permission. * For any questions, contact us : contact@treeptik.fr */ (function () { 'use strict'; angular.module ( 'webuiApp' ) .factory ( 'ExplorerService', ExplorerService ); ExplorerService.$inject = [ '$resource', '$http' ]; function ExplorerService ( $resource, $http ) { return { buildTree: buildTree, deleteFile: deleteFile, addDirectory: addDirectory, unzipFile: unzipFile, zipFile: zipFile, editFile: editFile, getFile: getFile }; //////////////////////////////////////////////////////////////////// // Liste l'arborescence de fichier d'un container function buildTree ( containerId, path ) { var dir = $resource ( '/file/container/:containerId', { containerId: containerId, path: path } ); return dir.query().$promise; } function unzipFile ( containerId, applicationName, path, item) { var file = $resource ( 'file/unzip/container/:containerId/application/:applicationName', { containerId: containerId, applicationName: applicationName, path: path, fileName: item }, { 'update': { method: 'PUT', transformResponse: function ( data, headers ) { var response = {}; response.data = data; response.headers = headers (); return response; } } }); return file.update ().$promise; } function zipFile ( containerId, applicationName, path, item) { var file = $resource ( 'file/zip/container/:containerId/application/:applicationName', { containerId: containerId, applicationName: applicationName, path: path, fileName: item }, { 'update': { method: 'PUT', transformResponse: function ( data, headers ) { var response = {}; response.data = data; response.headers = headers (); return response; } } }); return file.update ().$promise; } function getFile ( containerId, applicationName, path, fileName ) { var file = $resource ( '/file/content/container/:containerId/application/:applicationName', { containerId: containerId, applicationName: applicationName, fileName: fileName, path: path }, { get: { method: 'GET', transformResponse: function ( data, headers ) { var response = {}; response.data = data; response.headers = headers (); return response; } } } ); return file.get ().$promise; } function editFile ( containerId, applicationName, path, fileName, fileContent ) { var file = $resource ( 'file/content/container/:containerId/application/:applicationName', { containerId: containerId, applicationName: applicationName },{ update: {method:'PUT'} }); return file.update ( { containerId: containerId, applicationName: applicationName }, { filePath: path, fileName: fileName, fileContent: fileContent}).$promise; } function deleteFile ( containerId, applicationName, path ) { var file = $resource ( '/file/container/:containerId/application/:applicationName', { containerId: containerId, applicationName: applicationName, path: path } ); return file.delete().$promise; } function addDirectory ( containerId, applicationName, path ) { var request = $resource ('/file/container/:containerId/application/:applicationName', { containerId: containerId, applicationName: applicationName, path: path } ); return request.save().$promise; } } }) ();
'use strict'; describe('Zeno Controller', function() { var scope, $httpBackend, ctrl, rootScope, location, zenoService; var list = { host : "{@alias}.google.com", envs : [ {alias: "dev", server : "dev.", port: 8080}, {alias: "prod", server: ""} ], desktop : [ {url: "@host/search", name: "search"}, {url: "@host/results", name: "results"}, ], success: 0, failures: 0 }; var results = { desktop : { results: [ { name: "homepage", pourcent: "1.1" }, { name: "about", pourcent: "2.0" } ], date: "2014-07-28T15:17:01.038Z", total: 7, endDate: "2014-07-28T15:17:40.696Z" } }; beforeEach(module('zeno')); beforeEach(inject(function($rootScope, $controller, $location) { location = $location; location.path('desktop'); rootScope = $rootScope; spyOn(rootScope, '$broadcast').andCallThrough(); scope = $rootScope.$new(); scope.list = list; scope.listToCompare = []; scope.results = results; zenoService = { bind: function () {}, compare: function () {} }; ctrl = $controller('ZenoController', {$scope: scope, ZenoService: zenoService}); })); // tests start here // ================== it("should return real index using name", function() { scope.device = 'desktop'; // mock the http request from globalController var index = scope.getRealIndex(''); expect(index).toBe(-1); var google = scope.getRealIndex('search'); expect(google).toBe(0); }); it("should return filtered index using name", function() { scope.filtered = scope.list.desktop; // mock the filtered array from ng-repeat var index = scope.getFilteredIndex(''); expect(index).toBe(-1); var google = scope.getFilteredIndex('search'); expect(google).toBe(0); scope.filtered = scope.filtered.slice(1); var google = scope.getFilteredIndex('results'); expect(google).toBe(0); }); });
/* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> Matthias Butz <matze@odinms.de> Jan Christian Meyer <vimes@odinms.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. You may not use, modify or distribute this program under any other version of the GNU Affero General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Aura * * Adobis's Mission I: Unknown Dead Mine (280010000) * * Zakum PQ NPC (the one and only) */ var status; var selectedType; var scrolls; function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { if (mode == 0 && status == 0) { cm.dispose(); return; } if (mode == 1) status++; else status--; if (status == 0) { cm.sendSimple("...#b\r\n#L0#What am I supposed to do here?#l\r\n#L1#I brought items!#l\r\n#L2#I want to get out!#l"); } else if (status == 1) { selectedType = selection; if (selection == 0) { cm.sendNext("To reveal the power of Zakum, you'll have to recreate its core. Hidden somewhere in this dungeon is a \"Fire Ore\" which is one of the necessary materials for that core. Find it, and bring it to me.\r\n\r\nOh, and could you do me a favour? There's also a number of Paper Documents lying under rocks around here. If you can get 30 of them, I can reward you for your efforts.") cm.dispose(); } else if (selection == 1) { if (!cm.haveItem(4001018)) { //fire ore cm.sendNext("Please bring the Fire Ore with you.") cm.dispose(); } else { if (!cm.haveItem(4001015, 30)) { //documents cm.sendYesNo("So, you brought the fire ore with you? In that case, I can give you and your party a piece of it that should be more than enough to make the core of Zakum. Make sure your whole party has room in their inventory before proceeding."); scrolls = false; } else { cm.sendYesNo("So, you brought the fire ore and the documents with you? In that case, I can give you and your party a piece of it that should be more than enough to make the core of Zakum. As well, since you brought the documents with you, I can also give you a special item which will bring you to the mine's entrance at any time. Make sure your whole party has room in their inventory before proceeding."); scrolls = true; } } } else if (selection == 2) { cm.sendYesNo("Are you sure you want to exit? If you're the party leader, your party will also be removed from the mines.") } } else if (status == 2) { var eim = cm.getChar().getEventInstance(); if (selectedType == 1 && cm.haveItem(4001018)) { var party = eim.getPlayers(); cm.gainItem(4001018, -1); if (scrolls) { cm.gainItem(4001015, -30); } //give items/exp cm.givePartyItems(4031061, 1, party); if (scrolls) { cm.givePartyItems(2030007, 5, party); cm.givePartyExp(20000, party); } else { cm.givePartyExp(12000, party); } //clear PQ eim.finishPQ(); } else if (selectedType == 2) { if (cm.isLeader()) eim.disbandParty(); else eim.leaveParty(cm.getChar()); } cm.dispose(); } } }
describe("Testing Jasmine", function() { it("can run a test", function() { expect(true).toBe(true); }); });
import moment from 'moment'; var DATE_REGEX = /^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/; function dateValidator() { return { restrict: 'A', require: 'ngModel', // TODO don't use scope scope: { minDate: '=', maxDate: '=' }, link: function(scope, element, attrs, ngModelCtrl) { ngModelCtrl.$parsers.push(function(viewValue) { var valid; var modelValue; if (viewValue === null || viewValue === undefined) { valid = true; modelValue = null; } else { modelValue = viewValue.trim(); if (modelValue === '') { valid = true; modelValue = null; } else if (DATE_REGEX.test(modelValue)) { var date = moment(viewValue, 'DD/MM/YYYY'); if (date.isValid()) { valid = true; modelValue = date.format('YYYY-MM-DD'); } else { valid = false; modelValue = null; } } else { valid = false; modelValue = null; } } ngModelCtrl.$setValidity('date', valid); if (scope.minDate && modelValue && moment(modelValue) < moment(scope.minDate)) { ngModelCtrl.$setValidity('minDate', false); modelValue = null; } else { ngModelCtrl.$setValidity('maxDate', true); } if (scope.maxDate && modelValue && moment(modelValue) > moment(scope.maxDate)) { ngModelCtrl.$setValidity('maxDate', false); modelValue = null; } else { ngModelCtrl.$setValidity('maxDate', true); } return modelValue; }); ngModelCtrl.$formatters.push(function(value) { if (value) { return moment(value).format('DD/MM/YYYY'); } else { return ''; } }); } }; } export default dateValidator;
//# sourceMappingURL=generate-unique-number-function.js.map
var clover = new Object(); // JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]} clover.pageData = {"classes":[{"el":97,"id":130525,"methods":[{"el":91,"sc":2,"sl":37},{"el":96,"sc":2,"sl":93}],"name":"M5PLinearRegressionMethod","sl":35}]} // JSON: {test_ID : {"methods": [ID1, ID2, ID3...], "name" : "testXXX() void"}, ...}; clover.testTargets = {} // JSON: { lines : [{tests : [testid1, testid2, testid3, ...]}, ...]}; clover.srcFileLines = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'colorbutton', 'uk', { auto: 'Авто', bgColorTitle: 'Колір фону', colors: { '000': 'Чорний', '800000': 'Бордовий', '8B4513': 'Коричневий', '2F4F4F': 'Темний сіро-зелений', '008080': 'Морської хвилі', '000080': 'Сливовий', '4B0082': 'Індиго', '696969': 'Темносірий', B22222: 'Темночервоний', A52A2A: 'Каштановий', DAA520: 'Бежевий', '006400': 'Темнозелений', '40E0D0': 'Бірюзовий', '0000CD': 'Темносиній', '800080': 'Пурпурний', '808080': 'Сірий', F00: 'Червоний', FF8C00: 'Темнооранжевий', FFD700: 'Жовтий', '008000': 'Зелений', '0FF': 'Синьо-зелений', '00F': 'Синій', EE82EE: 'Фіолетовий', A9A9A9: 'Світлосірий', FFA07A: 'Рожевий', FFA500: 'Оранжевий', FFFF00: 'Яскравожовтий', '00FF00': 'Салатовий', AFEEEE: 'Світлобірюзовий', ADD8E6: 'Блакитний', DDA0DD: 'Світлофіолетовий', D3D3D3: 'Сріблястий', FFF0F5: 'Світлорожевий', FAEBD7: 'Світлооранжевий', FFFFE0: 'Світложовтий', F0FFF0: 'Світлозелений', F0FFFF: 'Світлий синьо-зелений', F0F8FF: 'Світлоблакитний', E6E6FA: 'Лавандовий', FFF: 'Білий', '1ABC9C': 'Strong Cyan', // MISSING '2ECC71': 'Emerald', // MISSING '3498DB': 'Bright Blue', // MISSING '9B59B6': 'Amethyst', // MISSING '4E5F70': 'Grayish Blue', // MISSING 'F1C40F': 'Vivid Yellow', // MISSING '16A085': 'Dark Cyan', // MISSING '27AE60': 'Dark Emerald', // MISSING '2980B9': 'Strong Blue', // MISSING '8E44AD': 'Dark Violet', // MISSING '2C3E50': 'Desaturated Blue', // MISSING 'F39C12': 'Orange', // MISSING 'E67E22': 'Carrot', // MISSING 'E74C3C': 'Pale Red', // MISSING 'ECF0F1': 'Bright Silver', // MISSING '95A5A6': 'Light Grayish Cyan', // MISSING 'DDD': 'Light Gray', // MISSING 'D35400': 'Pumpkin', // MISSING 'C0392B': 'Strong Red', // MISSING 'BDC3C7': 'Silver', // MISSING '7F8C8D': 'Grayish Cyan', // MISSING '999': 'Dark Gray' // MISSING }, more: 'Кольори...', panelTitle: 'Кольори', textColorTitle: 'Колір тексту' } );
angular.module('app.filters').filter('currencySymbol', currencySymbol); currencySymbol.$inject = ['$filter']; function currencySymbol($filter) { var currencySymbols = { 'EUR': '&#8364; ', 'GBP': '&#163; ', 'USD': '&#36; ', 'ZAR': '&#82; ', 'NOR': '&#107;&#114; ', 'DKK': '&#107;&#114; ', 'SEK': '&#107;&#114; ', 'CHF': '&#67;&#72;&#70; ', }; return function(amount, currency, divide = false) { let newAmount = amount; if (divide) { // Divide the amount by 100 so we get the proper amount; newAmount /= 100; } return $filter('currency')(newAmount, currencySymbols[currency]); }; }
angular.module('confjuvapp.filters', []). filter('htmlToPlainText', function() { return function(text) { return String(text).replace(/<[^>]+>/gm, ''); }; }). filter('categoryType', function() { return function(categories, type) { for (var i = 0; i < categories.length; i++) { if (categories[i].type.toLowerCase() == type) { return categories[i].name; } } }; }). filter('tagFilter', function() { return function(text) { return String(text).replace(/#/gm, ''); }; }). filter('etniaFilter', function() { return function(type) { var etnia = {}; etnia[1] = 'Pardo'; etnia[2] = 'Preto'; etnia[3] = 'Branco'; etnia[4] = 'Indígena'; etnia[5] = 'Amarelo'; return etnia[type]; }; }). filter('orientacaoSexualFilter', function() { return function(type) { var orientacao = {}; orientacao[1] = 'Homosexual'; orientacao[2] = 'Heterosexual'; orientacao[3] = 'Bisexual'; orientacao[4] = 'Assexual'; return orientacao[type]; }; }). filter('generoFilter', function() { return function(type) { var genero = {}; genero[1] = 'Masculino'; genero[2] = 'Feminino'; return genero[type]; }; }). filter('membroConselhoFilter', function() { return function(type) { var membro = {}; membro[1] = 'Sim'; membro[2] = 'Não'; return membro[type]; }; });
function polar_draw(ui, context) { machinewidth = 2 * ui.machine.spaces[0].polar_max_r + 2; machineheight = 2 * ui.machine.spaces[0].polar_max_r + 2; center = [0, 0]; outline = function(ui, c) { c.beginPath(); c.arc(0, 0, ui.machine.spaces[0].polar_max_r, 0, 2 * Math.PI, false); c.stroke(); }; return [machinewidth, machineheight, center, outline]; }
$(document).ready(function(){ // JS Array implementation, overlap mode $( '#menu' ).multilevelpushmenu({ menu: arrMenu, containersToPush: [$( '#pushobj' )], // Just for fun also changing the look of the menu wrapperClass: 'mlpm_w', menuInactiveClass: 'mlpm_inactive' }); }); // JS Aray instead HTML Markup var arrMenu = [ { title: 'DashBoards', icon: 'fa fa-reorder', items: [ { name: 'Devices', icon: 'fa fa-laptop', link: '#', items: [ { title: 'Devices', icon: 'fa fa-laptop', items: [ { name: 'Mobile Phones', icon: 'fa fa-phone', link: '#', items: [ { title: 'Mobile Phones', icon: 'fa fa-phone', link: '#', items: [ { name: 'Super Smart Phone', link: '#' }, { name: 'Thin Magic Mobile', link: '#' }, { name: 'Performance Crusher', link: '#' }, { name: 'Futuristic Experience', link: '#' } ] } ] }, { name: 'Televisions', icon: 'fa fa-desktop', link: '#', items: [ { title: 'Televisions', icon: 'fa fa-desktop', link: '#', items: [ { name: 'Flat Super Screen', link: '#' }, { name: 'Gigantic LED', link: '#' }, { name: 'Power Eater', link: '#' }, { name: '3D Experience', link: '#' }, { name: 'Classic Comfort', link: '#' } ] } ] }, { name: 'Cameras', icon: 'fa fa-camera-retro', link: '#', items: [ { title: 'Cameras', icon: 'fa fa-camera-retro', link: '#', items: [ { name: 'Smart Shot', link: '#' }, { name: 'Power Shooter', link: '#' }, { name: 'Easy Photo Maker', link: '#' }, { name: 'Super Pixel', link: '#' } ] } ] } ] } ] }, { name: 'Magazines', icon: 'fa fa-book', link: '#', items: [ { title: 'Magazines', icon: 'fa fa-book', items: [ { name: 'National Geographics', link: '#' }, { name: 'Scientific American', link: '#' }, { name: 'The Spectator', link: '#' }, { name: 'Rambler', link: '#' }, { name: 'Physics World', link: '#' }, { name: 'The New Scientist', link: '#' } ] } ] }, { name: 'Store', icon: 'fa fa-shopping-cart', link: '#', items: [ { title: 'Store', icon: 'fa fa-shopping-cart', items: [ { name: 'Clothes', icon: 'fa fa-tags', link: '#', items: [ { title: 'Clothes', icon: 'fa fa-tags', items: [ { name: 'Women\'s Clothing', icon: 'fa fa-female', link: '#', items: [ { title: 'Women\'s Clothing', icon: 'fa fa-female', items: [ { name: 'Tops', link: '#' }, { name: 'Dresses', link: '#' }, { name: 'Trousers', link: '#' }, { name: 'Shoes', link: '#' }, { name: 'Sale', link: '#' } ] } ] }, { name: 'Men\'s Clothing', icon: 'fa fa-male', link: '#', items: [ { title: 'Men\'s Clothing', icon: 'fa fa-male', items: [ { name: 'Shirts', link: '#' }, { name: 'Trousers', link: '#' }, { name: 'Shoes', link: '#' }, { name: 'Sale', link: '#' } ] } ] } ] } ] }, { name: 'Jewelry', link: '#' }, { name: 'Music', link: '#' }, { name: 'Grocery', link: '#' } ] } ] }, { name: 'Collections', link: '#' }, { name: 'Credits', link: '#' } ] } ];
var class_r_g_b4_x_strip_b = [ [ "RGB4XStripB", "class_r_g_b4_x_strip_b.html#ae1ea6c69ba68999408d841908d3895cc", null ] ];
/**************************************************************************** ** Acilos app: https://github.com/omnibond/acilos ** Copyright (C) 2014 Omnibond Systems LLC. and/or its subsidiary(-ies). ** All rights reserved. ** Omnibond Systems - www.omnibond.com for Acilos.com ** ** This file defines the mainView for the locateMe module ** This is DEPRECATED ** ** $QT_BEGIN_LICENSE:LGPL$ ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** ** If you have questions regarding the use of this file, please contact ** Omnibond Systems - www.omnibond.com ** ** $QT_END_LICENSE$ */ define(['dojo/_base/declare', 'dojo-mama/views/ModuleScrollableView', 'dojo/dom-construct', 'dojo/topic', "dojo/_base/lang", 'dojo/on', 'dojo/dom-geometry', 'app/util/xhrManager', 'app/TitleBar', "app/SelRoundRectList", "dojox/mobile/Button", "dojox/mobile/ListItem", "dojox/mobile/ToolBarButton", "dojox/mobile/EdgeToEdgeCategory", "dojox/mobile/Heading", "dojox/mobile/TextBox" ], function( declare, ModuleScrollableView, domConstruct, topic, lang, on, domGeom, xhrManager, TitleBar, RoundRectList, Button, ListItem, ToolBarButton, EdgeToEdgeCategory, Heading, TextBox ) { return declare([ModuleScrollableView], { buildMap: function(){ this.holder = domConstruct.create('div', {style:"width:500px;height:500px;margin-left:10px;margin-top:10px"}); //Was originally 200px by 200px this.domNode.appendChild(this.holder); this.mapDiv = domConstruct.create('div', {id:"map-canvas", style:"width:100%;height:100%"}); this.holder.appendChild(this.mapDiv); }, buildList: function(){ this.mainList = new RoundRectList({ variableHeight: true, "class": "borderlessListItemClass" }); this.instaListItem = new ListItem({ variableHeight: true, "class": "borderlessListItemClass" }); this.locationListItem = new ListItem({ variableHeight: true, "class": "borderlessListItemClass" }); this.buildInstagramAroundMeButton(); this.buildLocationBox(); this.mainList.addChild(this.instaListItem); this.mainList.addChild(this.locationListItem); this.instaListItem.addChild(this.instaAroundButton); this.locationListItem.addChild(this.locationBox); this.addChild(this.mainList); }, buildInstagramAroundMeButton: function(){ this.instaAroundButton = new ToolBarButton({ label: "Show Instagram users in area", style: "margin-left:10px;margin-top:10px", clickable: true, onClick: lang.hitch(this, function(){ console.log("CLICK"); if(this.locationBox.get("value") == ""){ this.item.set("rightText", "You must enter a location"); }else{ var loc = this.locationBox.get("value"); var location = loc.replace(" ", "+"); //anything that gets put after the function in lang.hitch moves all args down one and puts itself at the begining. //so now obj will be the SECOND param and "Foursquare" will be the first this.getAroundMe("InstagramLocal", location).then(lang.hitch(this, this.populate, "InstagramLocal")); } }) }) }, buildLocationBox: function(){ this.locationBox = new TextBox({ placeHolder: "Enter a location", style: "margin-left:9px" }) }, populate: function(call, obj){ for(var f = 0; f < obj.length; f++){ if(call == "InstagramLocal"){ this.addMarkerWithClick(obj[f]['latlng'], obj[f]['user']['username']); }else if(call == "Foursquare"){ this.addMarkerWithClick(obj[f]['latlng'], obj[f]['name']); } } }, addMarkerWithClick: function(marker, name){ var markerArray = []; var image = { url: 'app/locateUsers/google_earth.png', // This marker is 256 pixels wide by 256 pixels tall. size: new google.maps.Size(24, 24), // The origin for this image is 0,0. origin: new google.maps.Point(0,0), // The anchor for this image is the base of the flagpole at 0,32. anchor: new google.maps.Point(12, 12) }; var shape = { coord: [1, 1, 1, 20, 18, 20, 18 , 1], type: 'poly' }; var arr = marker.split("#"); var latlng = new google.maps.LatLng(arr[0], arr[1]); var marker = new google.maps.Marker({ position: latlng, title: name, //draggable: true, icon: image, animation: google.maps.Animation.DROP }) google.maps.event.addListener(marker, 'click', toggleBounce, function(event){ console.log("clicked", name); }); markerArray.push(marker); marker.setMap(this.map); function toggleBounce(){ if(marker.getAnimation() != null){ marker.setAnimation(null); }else{ marker.setAnimation(google.maps.Animation.BOUNCE); } } }, initialize: function() { var latlng = new google.maps.LatLng(39, -106); var mapOptions = { zoom: 3, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } this.map = new google.maps.Map(this.mapDiv, mapOptions); //google.maps.event.trigger(this.map, "resize"); }, postCreate: function(){ if(this.mainList){ this.mainList.destroyRecursive(); this.mainList = null; this.buildList(); }else{ this.buildList(); } this.buildMap(); this.initialize(); }, activate: function(e){ topic.publish("/dojo-mama/updateSubNav", {back: '/analytics', title: "User Locations"} ); } }) });
export const trimNull = (a) => { const c = a.indexOf("\0"); if (c > -1) { // eslint-disable-next-line unicorn/prefer-string-slice return a.substr(0, c); } return a; };
function completeWriteDocument(ret_obj) { var error = ret_obj['error']; var message = ret_obj['message']; var document_srl = ret_obj['document_srl']; var url; if(!document_srl) { url = current_url.setQuery('act',''); } else { url = current_url.setQuery('document_srl',document_srl).setQuery('act',''); } location.href = url; } function completeWriteReply(ret_obj) { alert(ret_obj['message']); var url = request_uri.setQuery('mid', current_mid).setQuery('document_srl', ret_obj['document_srl']).setQuery('act','dispKinView'); if(typeof(xeVid)!='undefined') url = url.setQuery('vid', xeVid); location.href = url; } function doDeleteDocument(document_srl) { var params = new Array(); params['document_srl'] = document_srl; var url = request_uri.setQuery('mid', current_mid).setQuery('document_srl', '').setQuery('act',''); if(typeof(xeVid)!='undefined') url = url.setQuery('vid', xeVid); exec_xml('kin','procKinDeleteDocument', params, function() { location.href=url; }); } function loadPage(document_srl, page) { var params = {}; params["cpage"] = page; params["document_srl"] = document_srl; params["mid"] = current_mid; exec_xml("board", "getKinCommentPage", params, completeGetPage, ['html','error','message'], params); } function completeGetPage(ret_val) { jQuery("#cl").remove(); jQuery("#clpn").remove(); jQuery("#clb").after(ret_val['html']); } function doDeleteReply(comment_srl) { var params = new Array(); params['comment_srl'] = comment_srl; exec_xml('kin','procKinDeleteReply', params, function() { location.reload(); }); } function doSelectReply(comment_srl) { var params = new Array(); params['comment_srl'] = comment_srl; exec_xml('kin','procKinSelectReply', params, function() { location.reload(); }); } function doGetComments(parent_srl, page) { var o = jQuery('#replies_'+parent_srl); var o = jQuery('#replies_content_'+parent_srl); if(o.css('display')=='block' && typeof(page)=='undefined') o.css('display','none'); else { var params = new Array(); params['mid'] = current_mid; params['parent_srl'] = parent_srl; if(typeof(page)=='undefined') page = 1; params['page'] = page; exec_xml('kin','getKinComments', params, displayComments, new Array('error','message','parent_srl','html')); } } function displayComments(ret_obj) { var parent_srl = ret_obj['parent_srl']; var html = ret_obj['html']; var o = jQuery('#replies_'+parent_srl); var o = jQuery('#replies_content_'+parent_srl); o.html(html).css('display','block'); } function doDeleteComment(parent_srl,reply_srl) { var params = new Array(); params['parent_srl'] = parent_srl; params['reply_srl'] = reply_srl; params['mid'] = current_mid; exec_xml('kin','procKinDeleteComment', params, displayComments, new Array('error','message','parent_srl','html')); }
// ==UserScript== // @author frt.ford153focus // @description switch ua to mobile // @grant none // @homepage http://ford-rt.com // @include https://mail.yandex.ru/* // @include http://www.rbc.ru/* // @name mua // @namespace http://ford-rt.com // @run-at document-start // @updateURL https://github.com/ford153focus/userscripts/raw/master/mobile_user_agent.user.js // @user-agent Mozilla/5.0 (Linux; Android 4.2.2; GT-I9505 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36 // @version 20160807.1515 // ==/UserScript== let a = true;
/* * *************************************************** * * cismet GmbH, Saarbruecken, Germany * * ... and it just works. * * *************************************************** */ angular.module( 'de.cismet.sip-html5-resource-registration.services' ).factory('de.cismet.sip-html5-resource-registration.services.searchService', ['$resource', 'de.cismet.sip-html5-resource-registration.services.Base64', 'AppConfig', function ($resource, Base64, AppConfig) { 'use strict'; var config, authdata, searchResource, searchFunction; config = AppConfig.searchService; authdata = Base64.encode(config.username + ':' + config.password); searchResource = $resource(config.host + '/searches/SWITCHON.de.cismet.cids.custom.switchon.search.server.ResourceContentLocationSearch/results', { limit: 1, offset: 0, omitNullValues: true, deduplicate: true }, { search: { method: 'POST', params: { limit: '@limit', offset: '@offset' }, isArray: false, headers: { 'Authorization': 'Basic ' + authdata } } }); searchFunction = function (url) { var queryObject, searchResult; queryObject = { 'list': [{'key': 'url', 'value': url}] }; // result of the remote search operation (promise) // starting the search! searchResult = searchResource.search( { limit: 1, offset: 0 }, queryObject ); return searchResult; }; return { search: searchFunction }; } ]) .factory('de.cismet.sip-html5-resource-registration.services.Base64', function () { /* jshint ignore:start */ var keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; return { encode: function (input) { var output = ""; var chr1, chr2, chr3 = ""; var enc1, enc2, enc3, enc4 = ""; var i = 0; do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return output; }, decode: function (input) { var output = ""; var chr1, chr2, chr3 = ""; var enc1, enc2, enc3, enc4 = ""; var i = 0; // remove all characters that are not A-Z, a-z, 0-9, +, /, or = var base64test = /[^A-Za-z0-9\+\/\=]/g; if (base64test.exec(input)) { console.error("There were invalid base64 characters in the input text.\n" + "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" + "Expect errors in decoding."); } input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 !== 64) { output = output + String.fromCharCode(chr2); } if (enc4 !== 64) { output = output + String.fromCharCode(chr3); } chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return output; } }; /* jshint ignore:end */ });
const listener = require('./content_scraper') const $ = require('jquery') module.exports = function (request, sender, sendResponse) { listener(request, sender, sendResponse, {$, window, document}) // important so that chrome knows the listener is async return true }
(function () { pipas.define("jquery-ui", [ "bower_components/jquery-ui/themes/flick/jquery-ui.min.css", "bower_components/jquery-ui/jquery-ui.min.js" ]); pipas.define("bootstrap-tagsinput", [ "bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css", "bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js" ]); pipas.define("moment-base", "bower_components/moment/min/moment.min.js"); pipas.define("moment", "bower_components/moment/min/locales.min.js", "moment-base"); pipas.define("eonasdan-bootstrap-datetimepicker", [ "bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css", "bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" ], "moment"); pipas.define("forms-styles", [ "../media/forms-styles.css" ]); pipas.define("bootstrap-filestyle", ["bower_components/bootstrap-filestyle/src/bootstrap-filestyle.min.js"]) })(pipas);
/* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2011 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Daniel Wagner (danielwagner) ************************************************************************ */ /** * @require(qxWeb) * @require(qx.module.Attribute) * @require(qx.module.Traversing) */ qx.Class.define("qx.test.mobile.LocaleSwitch", { extend : qx.test.mobile.MobileTestCase, include : qx.locale.MTranslation, construct : function() { this.base(arguments); var manager = this.manager = qx.locale.Manager.getInstance(); // add dummy translations manager.addTranslation("en_QX", { "test one": "test one", "test two": "test two", "test Hello %1!": "test Hello %1!", "test Jonny": "test Jonny" }); manager.addTranslation("de_QX", { "test one": "Eins", "test two": "Zwei", "test Hello %1!": "Servus %1!", "test Jonny": "Jonathan" }); }, members : { setUp : function() { this.base(arguments); this.manager.setLocale("en_QX"); }, testLabel : function() { var manager = qx.locale.Manager.getInstance(); var label = new qx.ui.mobile.basic.Label(this.tr("test one")); this.getRoot().add(label); this.assertEquals("test one", label.getValue()); manager.setLocale("de_QX"); this.assertEquals("Eins", label.getValue()); manager.setLocale("en_QX"); label.setValue(this.tr("test Hello %1!", this.tr("test Jonny"))); this.assertEquals("test Hello test Jonny!", label.getValue()); manager.setLocale("de_QX"); this.assertEquals("Servus Jonathan!", label.getValue()); // de -> en label.setValue(this.tr("test two")); this.assertEquals("Zwei", label.getValue()); manager.setLocale("en_QX"); this.assertEquals("test two", label.getValue()); label.destroy(); }, testList : function() { var list = new qx.ui.mobile.list.List({ configureItem : function(item, data, row) { item.setTitle(data.title); item.setSubtitle(data.subTitle); } }); var data = [ { title: this.tr("test one"), subTitle: this.tr("test two") }, { title: this.tr("test Hello %1!", this.tr("test Jonny")), subTitle: this.tr("test Jonny") } ]; list.setModel(new qx.data.Array(data)); this.getRoot().add(list); this.__testListEn(); this.manager.setLocale("de_QX"); var title0 = q(".list * .list-item-title").eq(0).getHtml(); this.assertEquals("Eins". title0); var subtitle0 = q(".list * .list-item-subtitle").eq(0).getHtml(); this.assertEquals("Zwei", subtitle0); var title1 = q(".list * .list-item-title").eq(1).getHtml(); this.assertEquals("Servus Jonathan!", title1); var subtitle1 = q(".list * .list-item-subtitle").eq(1).getHtml(); this.assertEquals("Jonathan", subtitle1); this.manager.setLocale("en_QX"); this.__testListEn(); }, __testListEn : function() { //debugger var title0 = q(".list * .list-item-title").eq(0).getHtml(); this.assertEquals("test one". title0); var subtitle0 = q(".list * .list-item-subtitle").eq(0).getHtml(); this.assertEquals("test two", subtitle0); var title1 = q(".list * .list-item-title").eq(1).getHtml(); this.assertEquals("test Hello test Jonny!", title1); var subtitle1 = q(".list * .list-item-subtitle").eq(1).getHtml(); this.assertEquals("test Jonny", subtitle1); }, testFormRendererSingle : function() { var manager = qx.locale.Manager.getInstance(); var title = new qx.ui.mobile.form.Title(this.tr("test one")); var form = new qx.ui.mobile.form.Form(); form.add(new qx.ui.mobile.form.TextField(), this.tr("test two")); this.getRoot().add(title); var renderer = new qx.ui.mobile.form.renderer.Single(form); this.getRoot().add(renderer); this.assertEquals("test one", title.getValue()); this.assertEquals("test two", renderer._labels[0].getValue()); manager.setLocale("de_QX"); this.assertEquals("Eins", title.getValue()); this.assertEquals("Zwei", renderer._labels[0].getValue()); manager.setLocale("en_QX"); title.destroy(); } } });
// Chart Scripts for the stats page $(function () { var curDecimals = 2; if(currency != 'USD'){ curDecimals = 8; } $.each(userIds, function( index, value ) { //alert( index + ": " + value + ' - ' + userNames[index]); var thisId = value; var thisName = userNames[index]; $.getJSON('json/stats.php?userid='+thisId+'&cur='+currency, function (data) { if(data == null){ $('#chart_UserDailyReturns_'+thisId).html('<br><h4>No Data</h4><p>There is currently no history data in your database. Please make sure the hourly cron is running correctly, then wait at least one hour for historical data to load from bitfinex.<br><br><h3><a href="index.php?page=grabHistory&currencyType='+currency+'">To Load Historical Data directly from Bitfinex, check here.</h3>'); } else{ var dataLength = data.length, amtReturn = [], intReturn = [], balReturn = [], // set the allowed units for data grouping groupingUnits = [[ 'week', // unit name [1] // allowed multiples ], [ 'month', [1, 2, 3, 4, 6] ]], i = 0; for (i; i < dataLength; i += 1) { var s=data[i][0]/1e3; s=Math.floor(s)*1e3; amtReturn.push([ s, // the date data[i][1] // return amount ]); intReturn.push([ s, // the date data[i][2] // the percent ]); balReturn.push([ s, // the date data[i][3] // the balance ]); } $('#chart_UserDailyReturns_'+thisId).highcharts('StockChart',{ chart: { // Edit chart spacing spacingLeft: 40, spacingRight: 50 }, rangeSelector: { selected: 1, buttons: [{ type: 'day', count: 7, text: '7d' }, { type: 'day', count: 15, text: '15d' }, { type: 'month', count: 1, text: '1m' }, { type: 'month', count: 3, text: '3m' }, { type: 'month', count: 6, text: '6m' }, { type: 'ytd', text: 'YTD' }, { type: 'year', count: 1, text: '1y' }, { type: 'all', text: 'All' }] }, title: { text: 'Daily '+currency+' Margin Returns for '+thisName }, yAxis: [{ // Primary yAxis title: { text: 'Daily Return '+currency, x: -22, y: 0, style: { color: '#960000' } }, labels: { format: '{value} '+currency, align:'left', x: -25, y: 0, style: { color: '#960000' } }, opposite:false, floor: 0 }, { // Secondary yAxis title: { text: 'Daily Return %', x: 30, y: 0, style: { color: '#052487' } }, labels: { format: '{value}%', align:'right', x: 31, y: -1, style: { color: '#052487' } }, opposite: true, floor: 0 }, { // Terciary yAxis title: { text: 'Balance', x: 20, y: 0, style: { color: '#009600' } }, labels: { format: '{value} '+currency, align:'right', x: 5, y: 11, style: { color: '#009600' } }, opposite: true, floor: 0 }], tooltip: { shared: true }, series: [ { type: 'areaspline', name: currency+' Balance', data: balReturn, yAxis:2, tooltip: { valueDecimals: curDecimals }, dataGrouping:{ enabled:true, groupPixelWidth:2, units:groupingUnits }, color: '#009600', fillColor : { linearGradient : { x1: 0, y1: 0, x2: 0, y2: 1 }, stops : [ [0, '#cbe9cb'], [1, '#ecfeec'] ] } },{ type: 'column', name: currency+' Return', data: amtReturn, tooltip: { valueDecimals: curDecimals }, color: { linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 }, stops: [ [0, '#ca7f7f'], [1, '#e9cbcb'] ] }, dataGrouping:{ enabled:true, groupPixelWidth:2, units:groupingUnits } }, { type: 'spline', name: 'Average Margin %', data: intReturn, yAxis:1, tooltip: { valueDecimals: 4 }, color: '#052487', dataGrouping:{ enabled:true, groupPixelWidth:2, units:groupingUnits } }] }); }; }); }); });
function loadJSON(callback, json_file) { console.log(json_file) var xobj = new XMLHttpRequest(); xobj.overrideMimeType("application/json"); xobj.open('GET', json_file, true); xobj.onreadystatechange = function() { if (xobj.readyState == 4 && xobj.status == "200") { callback(xobj.responseText); } } xobj.send(null); } function myinit(json_file) { console.log(json_file); loadJSON(function(response) { // Parse JSON string into object var actual_JSON = JSON.parse(response); //console.log(actual_JSON) for (var key in actual_JSON) { var value = actual_JSON[key]; // Use `key` and `value` var embedSpec = { mode: "vega-lite", // Instruct Vega-Embed to use the Vega-Lite compiler spec: value, actions: {'export' : false, 'source': false, 'editor' : false} }; vg.embed("#".concat("", key), embedSpec, function(error, result) {}); } }, json_file); componentHandler.upgradeDom(); } function get_language() { var lang = window.location.pathname.split('/')[1].split('_')[0] //console.log(lang) var supported_languages = ['fa', 'en', 'fr', "ru", "zh", "es"] lang_index = supported_languages.indexOf(lang) //console.log(lang_index) if (lang_index == -1) { return 'en' } else { return supported_languages[lang_index] } } function get_data(type, lang) { myinit('data/'.concat(type, '_', lang, '.json')) } function region() { get_data('region', get_language()); } function age() { get_data('age', get_language()); } function experience() { get_data('years', get_language()); }
var searchData= [ ['msg',['Msg',['../_unreal_lib_noise_8h.html#ad2aaaa08982145c87b0c906d23f30e3d',1,'UnrealLibNoise.h']]] ];
var searchData= [ ['emails',['Emails',['../class_catharsis_1_1_domain_1_1_contact.html#ab2973812daa0698724d4e75661f8f754',1,'Catharsis::Domain::Contact']]], ['entity',['Entity',['../class_catharsis_1_1_domain_1_1_entity.html',1,'Catharsis::Domain']]], ['executed',['Executed',['../class_catharsis_1_1_domain_1_1_script.html#a2b866f07f1b3a6a51c8119867addcfa7',1,'Catharsis::Domain::Script']]] ];
var _ = require('underscore') , assert = require('assert') , EventEmitter = require('events').EventEmitter , waatest = require('waatest') , portlets = require('../lib/waa/portlets') , PdObject = require('../lib/core/PdObject') , Pd = require('../index') , pdGlob = require('../lib/global') , utils = require('../lib/core/utils') exports.afterEach = function() { pdGlob.namedObjects.reset() pdGlob.patches = {} pdGlob.library = {} require('../lib').declareObjects(pdGlob.library) Pd.stop() } exports.beforeEach = function() { pdGlob.library['testingmailbox'] = TestingMailBox } exports.expectSamples = function(onStarted, expected, done) { waatest.utils.expectSamples(function(context) { var channelCount = expected.length , audio = new TestAudio(channelCount, context) Pd.start({audio: audio}) onStarted() }, expected, function(err) { Pd.stop() done(err) }) } exports.renderSamples = function(channelCount, frameCount, onStarted, done) { waatest.utils.renderSamples(channelCount, frameCount, function(context) { var audio = new TestAudio(channelCount, context) Pd.start({audio: audio}) onStarted() }, function(err, block) { Pd.stop() done(err, block) }) } exports.assertPreservesTimeTag = function(pdObject, args) { var mailbox = pdObject.patch.createObject('testingmailbox') , timeTag = Math.random() utils.timeTag(args, timeTag) pdObject.o(0).connect(mailbox.i(0)) pdObject.i(0).message(args) assert.equal(mailbox.rawReceived[0].timeTag, timeTag) } var TestingMailBox = exports.TestingMailBox = PdObject.extend({ type: 'TestingMailBox', init: function() { this.received = [] this.rawReceived = [] this.events = new EventEmitter() }, inletDefs: [ portlets.Inlet.extend({ message: function(args) { this.obj.outlets[0].message(args) this.obj.rawReceived.push(args) this.obj.received.push(args.slice(0)) this.obj.events.emit('message') } }) ], outletDefs: [ portlets.Outlet ] }) // Audio engine for testing var TestAudio = function(channelCount, context) { var ch Object.defineProperty(this, 'time', { get: function() { return context.currentTime * 1000 } }) this.context = context this.sampleRate = context.sampleRate this._channelMerger = this.context.createChannelMerger(channelCount) this._channelMerger.connect(this.context.destination) this.channels = [] for (ch = 0; ch < channelCount; ch++) { this.channels.push(this.context.createGain()) this.channels[ch].connect(this._channelMerger, 0, ch) } } TestAudio.prototype.start = function() {} TestAudio.prototype.stop = function() {} var TestClock = exports.TestClock = function() { this.events = [] this.time = 0 } TestClock.prototype.schedule = function(func, time, repetition) { var event = { func: func, timeTag: time, repetition: repetition } this.events.push(event) if (event.timeTag === this.time) event.func(event) return event } TestClock.prototype.unschedule = function(event) { this.events = _.without(this.events, event) } TestClock.prototype.tick = function() { var self = this this.events.forEach(function(e) { if (e.repetition) { if (self.time >= e.timeTag && ((self.time - e.timeTag) % e.repetition) === 0) { var e = _.extend(e, { timeTag: self.time }) e.func(e) } } else if (e.timeTag === self.time) e.func(e) }) }
(function(){var __modFun = function(__require, promiseland){ __modFun = undefined; var classSystem = promiseland.classSystem; if (promiseland._hasModule({ hashStr: "2155bc6dc8372113a022f738f7243400" })){ return promiseland._getModule("2155bc6dc8372113a022f738f7243400"); }; var PL$1 = (function(){ "use strict"; var PL$3/*C2*/; var PL$8/*b*/; var PL$6/*C1*/; var PL$10/*v1*/; /* ---------------------------- */ /* type C2 */ var PL$2/*type:C2*/ = classSystem._createProvisionalClass(); PL$3/*C2*/ = PL$2/*type:C2*/ var PL$4/*C2-constructor*/ = undefined; classSystem.readyPromise(PL$2/*type:C2*/).then(function(parType){ PL$2/*type:C2*/ = parType; PL$4/*C2-constructor*/ = classSystem.getTypeConstructor(PL$2/*type:C2*/); }); /* ---------------------------- */ /* ---------------------------- */ /* type C1 */ var PL$5/*type:C1*/ = classSystem._createProvisionalClass(); PL$6/*C1*/ = PL$5/*type:C1*/ var PL$7/*C1-constructor*/ = undefined; classSystem.readyPromise(PL$5/*type:C1*/).then(function(parType){ PL$5/*type:C1*/ = parType; PL$7/*C1-constructor*/ = classSystem.getTypeConstructor(PL$5/*type:C1*/); }); /* ---------------------------- */ ; classSystem._resolveProvisional(PL$2/*type:C2*/, classSystem.createClass({className: "C2",members: [{"name":"a","type":classSystem.getBuiltinType("var")}], "extends": [], "hasFreePart": true, "hashStr": "2155bc6dc8372113a022f738f7243400", "name": "C2"}, {"a": 2}));PL$3/*C2*/; PL$8/*b*/ = new PL$4/*C2-constructor*/(); PL$8/*b*/[3] = 3; classSystem._resolveProvisional(PL$5/*type:C1*/, classSystem.createClass({className: "C1",members: [{"name":"a","type":PL$2/*type:C2*/},{"name":"constructor","type":(classSystem.createFunctionType({ "return": classSystem.getBuiltinType("var"), arguments: [PL$2/*type:C2*/]}))}], "extends": [], "hasFreePart": true, "hashStr": "2155bc6dc8372113a022f738f7243400", "name": "C1"}, {"a": new PL$4/*C2-constructor*/(), "constructor": (function(PL$9/*par1*/){ ; this[3] = PL$9/*par1*/; ;})}));PL$6/*C1*/; PL$10/*v1*/ = new PL$7/*C1-constructor*/(PL$8/*b*/); if((PL$10/*v1*/[3][3] == 3)){ return { "success": true }; }; ; return { "success": false }; ;})(); ;return PL$1; }; if (typeof exports == "object" && typeof module == "object"){ // CommonJS module.exports = __modFun(function(modulesAr, callback, errBack){ // the require function for CommonJs var args = []; try{ var i = 0; var l = modulesAr.length; for (i; i < l; ++i){ args.push(require(modulesAr[i])); }; }catch(e){ errBack(e); return; }; callback.apply(callback, args); }, require("promiseland")); }else if (typeof define == "function" && define.amd){ // AMD define(["require", "promiseland"], __modFun); }else{ // Plain browser env __modFun(function(){ throw { msg: "require not possible in non loader mode" }; }); }; })();
var searchData= [ ['i2cconstants_2eh',['I2cConstants.h',['../_i2c_constants_8h.html',1,'']]] ];
/** * Give you access to all of you employees. Game entity class. * * @class * @constructor */ function HumanResources() { /** * A callback method you might want to implement. It gets called at the start of each month. * @member {Function} * @example * company.humanResources.hiringProcess = function(applicationProfiles) { * // this gets called once per month and you can use the * // applicationProfiles to hire chefs, waiters and managers. * } */ this.hiringProcess; /** * Returns a list of all employees your company employs. Read-only. * @member {List} */ this.employees; /** * Returns a <a href="List.html">list</a> of employees. This is a subset of all available employees. * * @method * @param {String} jobProfile A job profile to filter for: CHEF, WAITER, MANAGER * @return {List} a filtered set of employees matching your desired job profile */ this.getEmployees = function(jobProfile) { }; /** * Lays off the employee. * * @method * @param {Employee} employee Employee to lay off */ this.layOff = function(employee) { }; /** * Lays off all employees at a certain establishment. * * @method * @param {Establishment} Establishment to lay off all employees */ this.layOffAll = function(establishment) { }; }
/* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2009 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Martin Wittemann (martinwittemann) ************************************************************************ */ /* ************************************************************************ ************************************************************************ */ /** * @ignore(demobrowser.demo.data.store.Flickr) * @ignore(demobrowser.demo.data.store) * @tag databinding * @tag showcase */ qx.Class.define("demobrowser.demo.data.Flickr", { extend : qx.application.Standalone, members : { main: function() { this.base(arguments); // fetch some data from Flickr var store = new demobrowser.demo.data.store.Flickr("qooxdoo"); /* *********************************************** * CONTROLS * ********************************************* */ var search = new qx.ui.form.TextField("qooxdoo"); this.getRoot().add(search, {left: 30, top: 50}); var searchGo = new qx.ui.form.Button("Search"); this.getRoot().add(searchGo, {left: 140, top: 49}); searchGo.addListener("execute", function() { store.searchForTag(search.getValue()); }, this); search.addListener("keydown", function(e) { if (e.getKeyIdentifier() == "Enter") { store.searchForTag(search.getValue()); } }, this); /* *********************************************** * STATUS * ********************************************* */ var status = new qx.ui.basic.Label("loading"); this.getRoot().add(status, {left: 210, top: 52}); store.bind("state", status, "value"); /* *********************************************** * LIST OF PHOTOS * ********************************************* */ var list = new qx.ui.form.List(); list.setWidth(700); list.setHeight(110); list.setOrientation("horizontal"); this.getRoot().add(list, {left: 30, right: 30, top: 80}); var controller = new qx.data.controller.List(null, list); controller.setLabelPath("title"); controller.setDelegate({configureItem : function(item) { item.setShow("icon"); }}); var iconOptions = {converter : function(data, model) { return ("http://farm" + model.getFarm() + ".static.flickr.com/" + model.getServer() + "/" + data + "_" + model.getSecret() + "_s.jpg"); }}; controller.setIconOptions(iconOptions); controller.setIconPath("id"); store.bind("model.photos.photo", controller, "model"); /* *********************************************** * DETAIL VIEW * ********************************************* */ var image = new qx.ui.basic.Image(); this.getRoot().add(image, {left: 30, top: 200}); var detailOptions = {converter : function(data) { if (data) { return ("http://farm" + data.getFarm() + ".static.flickr.com/" + data.getServer() + "/" + data.getId() + "_" + data.getSecret() + ".jpg"); } return ""; }}; controller.bind("selection[0]", image, "source", detailOptions); /* *********************************************** * HEADLINE * ********************************************* */ var headline = new qx.ui.basic.Label(); headline.setRich(true); headline.setWidth(260); headline.setValue( "<span style='font-size: 20px'>Flickr</span>" ); this.getRoot().add(headline, {left: 10, top: 10}); } } }); /* * PLEASE NOTE: * For demonstration purposes the following class is added to the same file as * the application class. For a regular qooxdoo application each class must live * in a file of its own. You may neglect any warnings when generating this demo. */ qx.Class.define("demobrowser.demo.data.store.Flickr", { extend : qx.data.store.Jsonp, construct : function(tag) { this.setCallbackName("jsonFlickrApi"); this.base(arguments, this.__generateUrl(tag)); }, members : { searchForTag: function(tag) { if (tag != "") { this.setUrl(this.__generateUrl(tag)); } }, __generateUrl: function(tag) { if (!tag) { return; } var url = "http://api.flickr.com/services/rest/?tags=" + tag; url += "&method=flickr.photos.search&api_key=63a8042eead205f7e0040f488c02afd9&format=json"; return url; } } });
/* Example config file for example Clusterio plugin Binary will be spawned using child_process.spawn and get input from stdin and text from stdout will be ran as commands in the factorio server. */ var os = require("os"); var binary = "build/clusterioPluginExample_windows"; if(os.platform == "linux") binary = "build/clusterioPluginExample_linux"; if(os.platform == "darwin") binary = "build/clusterioPluginExample_darwin"; module.exports = { // Name of package. For display somewhere I guess. name: "clusterioPluginExample", version: "1.0.0", // Binary entrypoint for plugin. Don't let it crash. Stdout is sent to game as server chat (run /c commands from here for interface) // Make sure its cross platform somehow. binary: binary, description: "Example plugin for Clusterio to show easy interface integration with factorio servers.", // We'll send everything in this file to your stdin. Beware. scriptOutputFileSubscription: "example.txt", }
var dataString ='<chart manageResize="1" palette="2" animation="1" lowerLimit="0" upperLimit="100" showShadow="1" caption="Revenue" colorRangeFillRatio="0,10,80,10" showColorRangeBorder="0" subcaption="US $ (1,000s)" roundRadius="8" plotAsDot="1" numberPrefix="$" numberSuffix="K" showValue="1">\n\ <colorRange>\n\ <color minValue="0" maxValue="30" />\n\ <color minValue="30" maxValue="50" />\n\ <color minValue="50" maxValue="70" />\n\ <color minValue="70" maxValue="100" />\n\ </colorRange>\n\ <value>71.9</value>\n\ <target>80</target>\n\ </chart>';
var webpack = require('webpack'); var plugins = []; if (process.env.NODE_ENV === 'production'){ plugins = [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }) ]; } module.exports = { entry: './src-dev/App.js', output: { filename: 'dist-dev/app.js' }, plugins: plugins, resolve: { alias: { './conf' : __dirname + '/conf-' + process.env.NODE_ENV } }, module: { /*preLoaders: [ { test: /\.js$/, loader: "transform?envify" }, ],*/ loaders:[ //{ test: /jquery\.js$/, loader: 'expose?$' }, //{ test: /jquery\.js$/, loader: 'expose?jQuery' }, { test: /\.js[x]?$/, exclude: /node_modules/, loader: 'babel-loader', query: { plugins: ['transform-runtime'], presets: ['es2015', 'stage-0', 'react'], } }, ] }, devtool: process.env.NODE_ENV !== "production" ? 'source-map' : "#" };
describe('Reset Password', function () { it('password too small', function (client) { client.page.resetPassword().withResetCode("0123456789123456") .waitForElementVisible('.reset-password-view', 5000) .setValue('@passwordInput', 'password') .click('@submit') .waitForElementVisible('.reset-password-error-view', 5000) }); });
var filter = {channel: null, votes: true, spam: true, system: true}; $(function () { $('[name]').each(function () { $(this).addClass($(this).attr('name')); }); var autoscroll = $('.autoscroll').is(':checked'); var $messages = $('#messages') var recent = []; function calculateMessageRate() { var last = recent[recent.length - 1]; recent = recent.filter(function (ts) { return last - ts < 10000; }); var seconds = (last - recent[0]) / 1000; var rate = seconds > 0 ? recent.length / seconds : recent.length; $('.rate').text((Math.floor(rate * 10) / 10) + ' per second'); timeout = setTimeout(calculateMessageRate, 500); } calculateMessageRate(); var options = { steps: 500, onDelay: function (delay) { var m = pad(Math.floor(delay), -2); var s = pad(Math.round((delay - m) * 60), -2); var duration = m + ':' + s; $messages.append('<div class="message">Skipped ' + duration + ' of missing data</div>') }, onMessage: function (message, index, rate) { recent.push(message.timestamp); var $activeChat = $('li.active:contains(' + $(this).text() + ')'); if ($activeChat.text() != message.chat) { $activeChat.removeClass('active'); $('li:contains(' + message.chat + ')').addClass('active'); } $('.seek').val(index); $('.seek').prev().text(new Date(message.timestamp)); $messages.children(':not(.header):lt(-500)').remove(); var $message = createMessage(message, timeline.columns); $messages.append($message); if (autoscroll && $message.is(':visible')) { var parent = $message.parent()[0]; parent.scrollTop = $message[0].offsetTop - parent.offsetTop; } } }; var timeline = new Timeline(messages, options); var timestamps = timeline.checkpoints.map(function (position) { return messages[position].timestamp; }); $('.seek').attr('max', timestamps.length - 1); createMessageHeaders(timeline.columns); fillChannelList(timeline.channels); createMarkers(timeline.history, function () { recent = []; timeline.setPosition(timeline.history[$(this).text()]); $('#messages').children(':not(.header)').remove(); }); timeline.start(); $('.active').change(function () { if ($(this).is(':checked')) timeline.start(); else timeline.pause(); }); $('.autoscroll').change(function () { autoscroll = $(this).is(':checked'); }); $('.speed').on('input', function () { var speed = parseInt($(this).val()); $(this).prev().text(speed + 'x'); timeline.setSpeed(speed); }); function adjustFont(amount) { $messages.css('font-size', (parseInt($messages.css('font-size')) + amount) + 'px'); } $('.fontUp').click(function () { adjustFont(1); }); $('.fontDown').click(function () { adjustFont(-1); }); $('.filter-channel').change(function () { var channel = $(this).children(':selected').text(); filter.channel = channel === '' ? null : channel; if (filter.channel) { var $channels = $('.message .channel:contains("' + channel + '")'); $channels.parent().show(); $('.message:not(.header) .channel').not($channels).parent().hide(); } else { $('.message .channel').parent().show(); } }); $('.filter-votes').change(function () { filter.votes = $(this).is(':checked'); if (filter.votes) { $('.message.vote').show(); } else { $('.message.vote').hide(); } }); $('.filter-spam').change(function () { filter.spam = $(this).is(':checked'); if (filter.spam) { $('.message.spam').show(); } else { $('.message.spam').hide(); } }); $('.seek').on('input', function () { recent = []; var time = new Date(timestamps[parseInt($(this).val())]); $(this).prev().text(time); timeline.setIndex(parseInt($(this).val())); $('#messages').children(':not(.header)').remove(); }); }); function createMessageHeaders(columns) { var headerColumns = { Chat: columns.chat, Time: 8, Channel: columns.channel, User: -columns.user, Message: null } var $header = $('<div class="message header"></div>'); for (var name in headerColumns) { var key = name.toLowerCase(); var length = headerColumns[name]; if (length) name = pad(name, length, ' ') ; $header.append($('<span class="' + key + '">' + name + '</span>')); } $('#messages').append($header); } function createMessage(message, columns) { var $message = $('<div class="message"></div>'); var isVote = message.message.match(/^voted to (GROW|STAY|ABANDON)$/); if (isVote) $message.addClass('vote'); var isSystem = message.user == '[robin]'; if (isSystem) $message.addClass('system') var isSpam = message.message.length > 120; if (isSpam) $message.addClass('spam'); if (filter.channel && message.channel !== filter.channel) $message.hide(); if (!filter.spam && isSpam) $message.hide(); if (!filter.system && isSystem) $message.hide(); if (!filter.votes && isVote) $message.hide(); function addProperty(key, value) { $message.append($('<span class="' + key + '">' + value + '</span>')); } addProperty('chat', pad(message.chat, -columns.chat, ' ')); addProperty('timestamp', formatTs(message.timestamp)); addProperty('channel', pad(('channel' in message) ? message.channel : ''), -columns.channel, ' '); addProperty('user', pad(message.user, -columns.user, ' ')); addProperty('message', message.message); return $message; } function fillChannelList(channels) { var sorted = Object.keys(channels).sort(function (a, b) { return channels[b] - channels[a]; }); var $list = $('.filter-channel'); sorted.forEach(function (channel) { $list.append('<option>' + channel + '</option>'); }); } function createMarkers(history, click) { var sorted = Object.keys(history).sort(function (a, b) { return history[a] - history[b]; }); sorted.forEach(function (channel) { var $item = $('<a href="#">' + channel + '</a>') $item.click(click); $('ul.history').append($item); $item.wrap('<li></li>'); }); }
var local = { get: function(key) { return JSON.parse(localStorage.getItem(key)); }, set: function(key, value) { return localStorage.setItem(key, JSON.stringify(value)); } };
/** * System configuration for Angular 2 samples * Adjust as necessary for your application needs. */ (function(global) { // map tells the System loader where to look for things var map = { 'compiled': 'compiled', // 'dist', '@angular': 'node_modules/@angular', 'rxjs': 'node_modules/rxjs', 'angular2-cookie': 'node_modules/angular2-cookie' }; // packages tells the System loader how to load when no filename and/or no extension var packages = { 'compiled': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' }, 'angular2-cookie': { main: 'core.js', defaultExtension: 'js' }, }; var ngPackageNames = [ 'common', 'compiler', 'core', 'http', 'platform-browser', 'platform-browser-dynamic', 'router', 'router-deprecated', 'upgrade' ]; // Individual files (~300 requests): function packIndex(pkgName) { packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; } // Bundled (~40 requests): function packUmd(pkgName) { packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; }; // Most environments should use UMD; some (Karma) need the individual index files var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; // Add package entries for angular packages ngPackageNames.forEach(setPackageConfig); var config = { map: map, packages: packages } System.config(config); })(this);
describe("chorus.dialogs.CommentDialog", function () { beforeEach(function () { this.dialog = new chorus.dialogs.Comment({ entityType:"note", eventId:1, entityTitle:'note', pageModel:new chorus.models.Workfile() }); spyOn(this.dialog, 'makeEditor'); }); it("does not re-render when the model changes", function () { expect(this.dialog.persistent).toBeTruthy(); }); describe("#setup", function () { it("configures the entity", function () { expect(this.dialog.model.get("entityType")).toBe("note"); expect(this.dialog.model.get("eventId")).toBe(1); }); }); describe("#render", function () { beforeEach(function () { this.dialog.render(); }); it("has the right title", function () { expect(this.dialog.$(".dialog_header h1")).toContainTranslation("comments.new_dialog.title"); }); it("renders the body", function () { this.dialog.model.set({body:"cats"}); this.dialog.render(); expect(this.dialog.$("textarea[name=body]").val()).toBe("cats"); }); it("has the right placeholder", function () { expect(this.dialog.$("textarea[name=body]").attr("placeholder")).toBe(t("comments.placeholder", {commentSubject:"note"})); }); it("makes a cl editor with toolbar", function () { expect(this.dialog.makeEditor).toHaveBeenCalledWith($(this.dialog.el), ".toolbar", "body", { width: 'auto', height:200 }); expect(this.dialog.$('.toolbar')).toExist(); }); }); describe("submit", function () { beforeEach(function () { this.dialog.render(); spyOn(this.dialog.model, "save").andCallThrough(); spyOn(this.dialog, "closeModal"); this.dialog.$("textarea[name=body]").val("The body of a note"); this.dialog.$("form").trigger("submit"); }); it("saves the data", function () { expect(this.dialog.model.get("body")).toBe("The body of a note"); expect(this.dialog.model.save).toHaveBeenCalled(); }); it("closes the dialog box if saved successfully", function () { this.dialog.model.trigger("saved"); expect(this.dialog.closeModal).toHaveBeenCalled(); }); it("doesn't close the dialog box if it not saved successfully", function () { this.dialog.model.trigger("savedFailed"); expect(this.dialog.closeModal).not.toHaveBeenCalled(); }); it("trims the comment", function () { this.dialog.$("textarea[name=body]").val("trim me<div><br></div>"); this.dialog.$("form").trigger("submit"); expect(this.dialog.model.get("body")).toBe("trim me"); }); it("triggers the 'invalidated' event on the model", function () { spyOnEvent(this.dialog.pageModel, 'invalidated'); this.dialog.model.trigger("saved"); expect("invalidated").toHaveBeenTriggeredOn(this.dialog.pageModel); }); it("triggers comment:added", function () { var addedSpy = jasmine.createSpy("comment:added"); chorus.PageEvents.on("comment:added", addedSpy); this.dialog.model.trigger("saved"); expect(addedSpy).toHaveBeenCalled(); }); }); describe("when an empty note is submitted", function() { beforeEach(function () { this.dialog.render(); spyOn(this.dialog.model, "save").andCallThrough(); spyOn(this.dialog, "markInputAsInvalid"); this.dialog.$("textarea[name=body]").val(""); this.dialog.$("form").trigger("submit"); }); it("marks the text input as invalid", function() { expect(this.dialog.markInputAsInvalid).toHaveBeenCalled(); }); }); });
function Config() { return { 'ssid' : 'your ssid', "password" : "your p@$$vv0rD", "security" : "WPA2-ASK", get: function(key) { return this[key]; } } } module.exports = new Config();
'use strict'; function desktopreport($q, $routeParams, $location, common, datacontext, threatmodellocator, electron) { var fsp = require('promise-fs'); /*jshint validthis: true */ var vm = this; var controllerId = 'desktopreport'; var getLogFn = common.logger.getLogFn; var log = getLogFn(controllerId); var logError = getLogFn(controllerId, 'error'); // Bindable properties and functions are placed on vm. vm.title = 'Threat Model Report'; vm.threatModel = {}; vm.error = null; vm.loaded = false; vm.onLoaded = onLoaded; vm.onError = onError; vm.savePDF = savePDF; vm.printPDF = printPDF; activate(); function activate() { common.activateController([getThreatModel()], controllerId) .then(function () { log('Activated Desktop Report Controller'); }); } function getThreatModel(forceReload) { var location = threatModelLocation(); return datacontext.load(location, forceReload).then(onLoad, onError); function onLoad(data) { vm.threatModel = data; return vm.threatModel; } } function onLoaded() { vm.loaded = true; return 'called onLoaded'; } function onError(err) { vm.error = err; logError(err.data.message); } function threatModelLocation() { return threatmodellocator.getModelLocation($routeParams); } function savePDF(done) { electron.currentWindow.webContents.printToPDF(pdfSettings, onPrinted); function pdfSettings() { var option = { landscape: false, marginsType: 0, printBackground: false, printSelectionOnly: false, pageSize: 'A4', }; return option; } function onPrinted(error, data) { if (error) { done(); onError(error); } else { var defaultPath = null; if (datacontext.threatModelLocation) { defaultPath = datacontext.threatModelLocation.replace('.json', '.pdf'); } electron.dialog.savePDF(defaultPath, function (fileName) { fsp.writeFile(fileName, data).then(function() { done(); }); }, function() { log('Cancelled save threat model'); done(); }); } } } function printPDF(done) { //use default print options var printSettings = {}; electron.currentWindow.webContents.print(printSettings, onPrinted); function onPrinted(success) { if (success) { log('Report printed successfully'); done(); } else { // see Electron issue https://github.com/electron/electron/issues/19008 // application will "hang" if the print dialog is cancelled // calling reload instead of done is a temporary workaround // it looks bad but the app keeps working logError('Report printing failed'); electron.currentWindow.webContents.reload(); } } } } module.exports = desktopreport;
/* globals d3 */ /* Inspired a lot from: https://github.com/vicapow/angular-d3-talk/blob/master/slides/demos/lets-make-a-donut-chart-directive */ 'use strict'; /** * @ngdoc directive * @name couchD3App.directive:donutDisplay * @description * # donutDisplay */ angular.module('couchD3App').directive('donutDisplay', function() { var link = function link(scope, element) { if (scope.data === undefined) { return; } // the D3 bits.. var color = d3.scale.category10(); var el = element.find('svg')[0]; var width = el.clientWidth; var height = el.clientHeight; var min = Math.min(width, height); var pie = d3.layout.pie().sort(null); var arc = d3.svg.arc() .outerRadius(min / 2 * 0.9) .innerRadius(min / 2 * 0.5); var svg = d3.select(el) .attr({ width: width, height: height }); svg.on('mousedown', function(d) { // yo angular, the code in this callback might make a change to the scope! // so be sure to apply $watch's and catch errors. console.log(d); scope.$apply(function() { if (scope.onClick) { scope.onClick(); } }); }); function arcTween(a) { // see: http://bl.ocks.org/mbostock/1346410 var i = d3.interpolate(scope._current, a); scope._current = i(0); return function(t) { return arc(i(t)); }; } // add the <path>s for each arc slice // All modification in the arc actually modify the item inside "svg" var arcs = svg.selectAll('path.arc').data(pie(scope.data)) .enter().append('path') .attr('class', 'arc') .style('stroke', 'white') .attr('fill', function(d, i) { return color(i); }) // store the initial angles .each(function(d) { scope._current = d; return; }); // our data changed! update the arcs, adding, updating, or removing // elements as needed scope.$watch('data', function(newData, oldData) { if (newData === undefined) { // if no data return so it wont make an error. return; } var data = newData.slice(0); // copy var duration = 500; var PI = Math.PI; while (data.length < oldData.length) { data.push(0); } arcs = svg.selectAll('.arc').data(pie(data)); arcs.transition().duration(duration).attrTween('d', arcTween); // transition in any new slices arcs.enter().append('path') .style('stroke', 'white') .attr('class', 'arc') .attr('fill', function(d, i) { return color(i); }) .each(function(d) { console.log(d); this._current = { startAngle: 2 * PI - 0.001, endAngle: 2 * PI }; }) .transition().duration(duration).attrTween('d', arcTween); // transition out any slices with size = 0 arcs.filter(function(d) { return d.data === 0; }) .transition() .duration(duration) .each(function(d) { d.startAngle = 2 * PI - 0.001; d.endAngle = 2 * PI; }) .attrTween('d', arcTween).remove(); }); scope.$watch(function() { // If any elemet in the width or height, it will trigger the next function return element[0].clientWidth * element[0].clientHeight; }, function() { // When the width change we need to modify all element associated with that width and height width = element[0].clientWidth; height = element[0].clientHeight; min = Math.min(width, height); arc.outerRadius(min / 2 * 0.9).innerRadius(min / 2 * 0.5); svg.attr({width: width, height: height}); arcs.attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')'); arcs.attr('d', arc); }); }; return { restrict: 'E', link: link, scope: { 'data': '=', 'onClick': '&' }, templateUrl: 'views/graphInfo.html' }; });
Ext.define("app.view.plugin.QQOauthForm", { extend : "Ext.form.Panel", requires : [ "app.view.plugin.OauthPluginController", "app.view.plugin.OauthPluginModel" ], controller : "oauthplugin", viewModel : "oauthplugin", bodyPadding : 5, url : Ext.ctx + "/admin/oauth/qq/update", border : false, frame : false, scrollable : true, layout : "auto", fieldDefaults : { labelAlign : "left", labelWidth : 80 }, defaultType : "textfield", items : [ { xtype : "hiddenfield", name : "id" }, { fieldLabel : "排序号", xtype : "numberfield", allowDecimals : false, name : "sortNo" }, , { fieldLabel : "启用", name : "isEnabled", xtype : "checkbox" } ], listeners : { beforerender : function(form, opts) { var record = form.getRecord(); var attributes = record.get("attributes"); form.insert(1, [ { fieldLabel : "客户端ID", name : "attributes['client_id']", allowBlank : false, value : attributes.client_id }, { fieldLabel : "客户端密钥", name : "attributes['client_secret']", allowBlank : false, value : attributes.client_secret }, { fieldLabel : "图标", name : "attributes['icon']", value : attributes.icon }, { fieldLabel : "描述", xtype : "textareafield", name : "attributes['description']", maxLength : 250, value : attributes.description } ]); } }, buttonAlign : "left", buttons : [ { text : "保存", formBind : true, handler : "onFormSave" } ] });
const PagesMessages = { PageFormCreateDescription: { id: "app.page.form.create.description", defaultMessage: "Create a new form to collect various types of data" }, PageFormCreateTextNamePlaceholder: { id: "app.page.form.create.text.name.placeholder", defaultMessage: "e.g: Newsletters:" }, PageFormCreateTextDescriptionPlaceholder: { id: "app.page.form.create.text.description.placeholder", defaultMessage: "e.g: This is a Newsletters form for my personal website." }, PageFormCreateTextEndpointPlaceholder: { id: "app.page.form.create.text.custom.endpoint.placeholder", defaultMessage: "e.g: newsletters2017" }, PageFormCreateTextRedirectlaceholder: { id: "app.page.form.create.text.custom.redirect.placeholder", defaultMessage: "e.g: http://www.site.com/thankyou" }, PageFormCreateAccordionTitle: { id: "app.page.form.create.accordion.title", defaultMessage: "Advanced Settings" }, PageFormDetailsTitle: { id: "app.page.form.details.title", defaultMessage: "This form has no title" }, PageFormDetailsDescription: { id: "app.page.form.details.description", defaultMessage: "This form has no description" }, PageFormCardActions: { id: "app.page.form.card.action.actions", defaultMessage: "Actions" }, PageFormCardActionsExport: { id: "app.page.form.card.action.export", defaultMessage: "Export to" }, PageContentViewTitle: { id: "app.page.form.content.view.title", defaultMessage: "Content for" }, PageContentViewDescription: { id: "app.page.form.content.view.description", defaultMessage: "Created in" }, PageFormTitle: { id: "app.page.form.title", defaultMessage: "My forms" }, PageFormDescription: { id: "app.page.form.description", defaultMessage: "Create, view and collect data for your applications" }, PageNoMatchTitle: { id: "app.page.nomatch.title", defaultMessage: "Page not found" }, PageNoMatchDescription: { id: "app.page.nomatch.description", defaultMessage: "The page you are trying to find is not available." }, PageNoMatchActionText: { id: "app.page.nomatch.action.text", defaultMessage: "Go back home" }, PageFormSearchPlaceholder: { id: "app.page.form.search.placeholder", defaultMessage: "Search forms" }, PageFormDetailsDisableText: { id: "app.page.form.details.text.disable", defaultMessage: "This form is disabled" } }; export default PagesMessages;
//// [parserSymbolProperty5.ts] class C { [Symbol.isRegExp]: string; } //// [parserSymbolProperty5.js] class C { }
const code = ` Flexio.pipe() .request({ method: 'GET', url: 'https://httpbin.org/get', params: { foo: 'bar', munch: 'rank' } }) .run(function(err, response) { console.log(response.data) })` const fn = (Flexio, callback) => { Flexio.pipe() .request({ method: 'GET', url: 'https://httpbin.org/get', params: { foo: 'bar', munch: 'rank' } }) .run(callback) } export default { title: 'GET request with parameters', code, fn }
var chai = require('chai') chai.Should() chai.use(require('chai-things')) chai.use(require('@signalk/signalk-schema').chaiModule) describe('130577 direction_data sentence without drift', function () { var tree = require('./testMapper').toNested( JSON.parse( '{"timestamp":"2014-08-15-10:01:35.236Z","prio":"3","src":"160","dst":"255","pgn":"130577","description":"Direction Data","fields":{"Data Mode":"Autonomous","COG Reference":"True","SID":"21","COG":"70.1","SOG":"0.01"}}' ) ) it('has correct values', function () { tree.should.have.nested.property('navigation.speedOverGround') tree.should.have.nested.property('navigation.speedOverGround.value', 0.01) tree.should.have.nested.property( 'navigation.courseOverGroundTrue.value', 70.1 ) tree.should.have.nested.property( 'navigation.courseOverGroundTrue.value', 70.1 ) }) it('is valid SignalK', function () { tree.should.be.validSignalKVesselIgnoringIdentity }) }) describe('130577 direction_data sentence with drift', function () { var tree = require('./testMapper').toNested( JSON.parse( '{"timestamp":"2014-08-15-18:00:00.755Z","prio":"3","src":"160","dst":"255","pgn":"130577","description":"Direction Data","fields":{"Data Mode":"Autonomous","COG Reference":"True","SID":"84","COG":"206.9","SOG":"3.51","Set":"58.9","Drift":"0.28"}}' ) ) it('has correct values', function () { tree.should.have.nested.property('navigation.speedOverGround') tree.should.have.nested.property('navigation.speedOverGround.value', 3.51) tree.should.have.nested.property('navigation.courseOverGroundTrue') tree.should.have.nested.property( 'navigation.courseOverGroundTrue.value', 206.9 ) tree.should.have.nested.property('environment.current.value.setTrue', 58.9) tree.should.have.nested.property('environment.current.value.drift', 0.28) }) it('is valid SignalK', function () { tree.should.be.validSignalKVesselIgnoringIdentity }) })
import alt from '../alt'; import DockerUtil from '../utils/DockerUtil'; import ContentRepositoryUtil, {ContentRepository} from '../utils/ContentRepositoryUtil'; class ContentRepositoryActions { launch (id, displayName, controlRepositoryLocation, contentRepositoryPath, preparer, template) { let repo = new ContentRepository( id, displayName, controlRepositoryLocation, contentRepositoryPath, preparer, template ); this.dispatch({repo}); ContentRepositoryUtil.launchServicePod(repo); } edit (id, displayName, controlRepositoryLocation, contentRepositoryPath, preparer, template) { this.dispatch({ id, displayName, controlRepositoryLocation, contentRepositoryPath, preparer, template }); } prepareContent (repo) { ContentRepositoryUtil.launchContentPreparer(repo); this.dispatch({repo}); } prepareControl (repo) { ContentRepositoryUtil.launchControlPreparer(repo); this.dispatch({repo}); } remove (repo) { this.dispatch({repo}); } relaunch (repo) { this.dispatch({repo}); } podLaunched ({repo, contentContainer, presenterContainer}) { this.dispatch({repo, contentContainer, presenterContainer}); } contentPreparerLaunched ({repo, container}) { this.dispatch({repo, container}); } controlPreparerLaunched ({repo, container}) { this.dispatch({repo, container}); } containerCompleted ({container}) { this.dispatch({container}); } error ({repo, error}) { this.dispatch({repo, error}); } } export default alt.createActions(ContentRepositoryActions);
import '../less/blog.less'; import Vue from 'vue' Vue.config.productionTip = false;
OC.L10N.register( "files_trashbin", { "Delete" : "Odstrániť" }, "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;");
//https://github.com/deadlyicon/s.js !function(jQuery, DOCUMENT, undefined){ jQuery.prototype.toSelector = function(){ return S(this.selector); }; S.prototype.get = function(){ return jQuery(this.toSelector()); }; S.prototype.bind = function(types, data, fn){ var index, wrapper; if (typeof data === 'function') fn = data; data = undefined; fn.sjs_wrapper || wrapEventHandler(fn); DOCUMENT.delegate(this, types, data, fn.sjs_wrapper); return this; }; S.prototype.unbind = function(types, fn){ DOCUMENT.undelegate(this, types, fn.sjs_wrapper || fn); return this; }; S.createEventMethods = function(){ $.each(arguments, function(i, event){ S.prototype[event] = function(data, fn) { return this.bind(event, data, fn); }; }); }; S.createEventMethods( "blur", "focus", "focusin", "focusout", "load", "resize", "scroll", "unload", "click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseover", "mouseout", "mouseenter", "mouseleave", "change", "select", "submit", "keydown", "keypress", "keyup", "error" ); $.each(["find", "filter", "closest", "delegate", "undelegate"], function(index, name){ var $super = jQuery.prototype[name]; jQuery.prototype[name] = function(selector){ if (typeof selector === 'function' && 'toSelector' in selector) arguments[0] = selector.toSelector(); return $super.apply(this, arguments); }; }); function wrapEventHandler(fn){ fn.sjs_wrapper = function(){ var args = Array.prototype.slice.apply(arguments); args.unshift(jQuery(this)); fn.apply(this, args); }; fn.sjs_wrapper.wraps = fn; } }(jQuery, jQuery(document));
/** * EasyNotif jQuery Plugin * version: 1.0.0 2016/07/05 * @requires jQuery v1.11.3 or later * Copyright (c) 2016 Amine Karismatik * Project repository: https://github.com/AmineKarismatik/EasyNotif * Dual licensed under the Apache License. */ (function($){ $.fn.easynotif=function(options){ var defaultOptions={ type: "success", content: "démo"}; return this.each(function() { //On crée le div et on l'applique un classe var div =document.createElement("div"); $(div).addClass('easy-notif'); // Si les options ne sont pas fournis on recours aux options par défault var defaultOptions if(typeof options==='undefined') { $(div).addClass(defaultOptions.type); $(div).html(defaultOptions.content); }else { $(div).addClass(options.type); $(div).html(options.content); } // var e=$(this); document.body.appendChild(div); $(div).hide().delay( 800 ).fadeIn( "slow" ); var element=$('body').find('.easy-notif'); element.on('click',function(){ $(this).fadeOut('slow'); }); }); }; }(jQuery))
'use strict'; var path = require('path'); var gulp = require('gulp'); var conf = require('./conf'); var $ = require('gulp-load-plugins')({ pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del'] }); gulp.task('partials', ['clean'], function () { return gulp.src([ path.join(conf.paths.src, '/app/**/*.html'), path.join(conf.paths.tmp, '/serve/app/**/*.html') ]) .pipe($.minifyHtml({ empty: true, spare: true, quotes: true })) .pipe($.angularTemplatecache('templateCacheHtml.js', { module: 'ngDatetimeRangePicker', root: 'app' })) .pipe(gulp.dest(conf.paths.tmp + '/partials/')); }); gulp.task('html', ['inject', 'partials'], function () { var partialsInjectFile = gulp.src(path.join(conf.paths.tmp, '/partials/templateCacheHtml.js'), {read: false}); var partialsInjectOptions = { starttag: '<!-- inject:partials -->', ignorePath: path.join(conf.paths.tmp, '/partials'), addRootSlash: false }; var htmlFilter = $.filter('*.html', {restore: true}); var jsFilter = $.filter('**/*.js', {restore: true}); var cssFilter = $.filter('**/*.css', {restore: true}); var assets; return gulp.src(path.join(conf.paths.tmp, '/serve/*.html')) .pipe($.inject(partialsInjectFile, partialsInjectOptions)) .pipe(assets = $.useref.assets()) //.pipe($.rev()) .pipe(jsFilter) .pipe($.sourcemaps.init()) //.pipe($.uglify({ preserveComments: $.uglifySaveLicense })).on('error', conf.errorHandler('Uglify')) .pipe($.sourcemaps.write('maps')) .pipe(jsFilter.restore) .pipe(cssFilter) .pipe($.sourcemaps.init()) .pipe($.minifyCss({processImport: false})) .pipe($.sourcemaps.write('maps')) .pipe(cssFilter.restore) .pipe(assets.restore()) .pipe($.useref()) .pipe($.revReplace()) .pipe(htmlFilter) .pipe($.minifyHtml({ empty: true, spare: true, quotes: true, conditionals: true })) .pipe(htmlFilter.restore) .pipe(gulp.dest(path.join(conf.paths.dist, '/'))) .pipe($.size({title: path.join(conf.paths.dist, '/'), showFiles: true})); }); // Only applies for fonts from bower dependencies // Custom fonts are handled by the "other" task gulp.task('fonts', function () { return gulp.src($.mainBowerFiles()) .pipe($.filter('**/*.{eot,svg,ttf,woff,woff2}')) .pipe($.flatten()) .pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/'))); }); gulp.task('other', function () { var fileFilter = $.filter(function (file) { return file.stat.isFile(); }); return gulp.src([ path.join(conf.paths.src, '/**/*'), path.join('!' + conf.paths.src, '/**/*.{html,css,js,scss}') ]) .pipe(fileFilter) .pipe(gulp.dest(path.join(conf.paths.dist, '/'))); }); gulp.task('clean', function () { return $.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/**')]); }); gulp.task('build', ['html', 'fonts', 'other']); gulp.task('release', ['build'], function () { return gulp.src([ path.join(conf.paths.dist, '/scripts/**/*.js') ]) .pipe($.sourcemaps.init()) .pipe($.uglify()).on('error', conf.errorHandler('Uglify')) .pipe($.sourcemaps.write('maps')) .pipe(gulp.dest(path.join(conf.paths.dist, '/scripts/min/'))); });
/* @flow */ export * from './text'; export * from './loading'; export * from './buttons';
var gulp = require('gulp'), requireDir = require('require-dir'), runSequence = require('run-sequence'); module.exports = (function(){ requireDir('gulp/tasks', {recurse: true}); function developmentTask (callback) { runSequence( ['clean-all'], ['fonts'], ['build-root', 'js', 'stylus', 'images', 'raw', 'favicons', 'translations'], ['error404'], ['watch'], callback); } function productionTask (callback) { runSequence( ['clean-all'], ['fonts'], ['build-root', 'js', 'stylus', 'images', 'raw', 'favicons', 'translations'], ['error404'], ['optimize'], callback); } return { developmentTask: developmentTask, productionTask: productionTask } })();
// Copyright 2022 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** 'use strict'; function main(name) { // [START privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** * Required. The resource name for this CertificateAuthority google.cloud.security.privateca.v1.CertificateAuthority in the * format `projects/* /locations/* /caPools/* /certificateAuthorities/*`. */ // const name = 'abc123' /** * Optional. An ID to identify requests. Specify a unique request ID so that if you must * retry your request, the server will know to ignore the request if it has * already been completed. The server will guarantee that for at least 60 * minutes since the first request. * For example, consider a situation where you make an initial request and t * he request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). */ // const requestId = 'abc123' // Imports the Privateca library const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; // Instantiates a client const privatecaClient = new CertificateAuthorityServiceClient(); async function callUndeleteCertificateAuthority() { // Construct request const request = { name, }; // Run request const [operation] = await privatecaClient.undeleteCertificateAuthority(request); const [response] = await operation.promise(); console.log(response); } callUndeleteCertificateAuthority(); // [END privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async] } process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; }); main(...process.argv.slice(2));
'use strict'; describe('Factory: TemporalOperatorService', function () { beforeEach(module('sophe.services.temporalOperator')); // Initialize the controller and a mock scope beforeEach(inject(function (_TemporalOperatorService_, _$http_, _$httpBackend_) { this.TemporalOperatorService = _TemporalOperatorService_; this.$http = _$http_; this.$httpBackend = _$httpBackend_; this.temporalOperatorsGet = this.$httpBackend.when('GET', 'data/qdm-temporalOperators.json'); this.temporalOperatorsGet.respond({}); })); describe('load', function() { it('returns a promise', inject(function() { var promise = this.TemporalOperatorService.load(); this.$httpBackend.flush(); expect(promise.then).toNotEqual(null); })); }); describe('processValues', function() { it('processes the operators', inject(function() { this.temporalOperatorsGet.respond({ results: {bindings: [ { id: { type: 'uri', value: 'http://rdf.healthit.gov/qdm/element#sbs' }, context: { type: 'uri', value: 'http://rdf.healthit.gov/qdm/element#qdm' }, temporalOperatorLabel: { type: 'literal', value: 'Start Before Start', datatype: 'http://www.w3.org/2001/XMLSchema#string' }, dataElementName: { type: 'literal', value: 'SBS', datatype: 'http://www.w3.org/2001/XMLSchema#string' } }, { id: { type: 'uri', value: 'http://rdf.healthit.gov/qdm/element#sas' }, context: { type: 'uri', value: 'http://rdf.healthit.gov/qdm/element#qdm' }, temporalOperatorLabel: { type: 'literal', value: 'Start After Start', datatype: 'http://www.w3.org/2001/XMLSchema#string' }, dataElementName: { type: 'literal', value: 'SAS', datatype: 'http://www.w3.org/2001/XMLSchema#string' } } ]} }); var temporalOperators = []; this.TemporalOperatorService.load() .then(this.TemporalOperatorService.processValues) .then(function(operators) { temporalOperators = operators; }); this.$httpBackend.flush(); expect(temporalOperators.length).toEqual(5); expect(temporalOperators[0].name).toEqual('Before'); expect(temporalOperators[0].children.length).toEqual(1); expect(temporalOperators[0].children[0].name).toEqual('Start Before Start'); })); }); describe('convertQDMToSoPhe', function() { it('finds a top level item', inject(function() { var temporalOperators = []; this.TemporalOperatorService.load() .then(this.TemporalOperatorService.processValues) .then(function(operators) { temporalOperators = operators; }); this.$httpBackend.flush(); var item = this.TemporalOperatorService.convertQDMToSoPhe('http://projectphema.org/TemporalOperator#Before', temporalOperators); expect(item.base).toEqual('before'); expect(item.modifier).toEqual(''); })); it('finds a child item', inject(function() { this.temporalOperatorsGet.respond({ results: {bindings: [ { id: { type: 'uri', value: 'http://rdf.healthit.gov/qdm/element#sas' }, context: { type: 'uri', value: 'http://rdf.healthit.gov/qdm/element#qdm' }, temporalOperatorLabel: { type: 'literal', value: 'Starts After Start', datatype: 'http://www.w3.org/2001/XMLSchema#string' }, dataElementName: { type: 'literal', value: 'SAS', datatype: 'http://www.w3.org/2001/XMLSchema#string' } } ]} }); var temporalOperators = []; this.TemporalOperatorService.load() .then(this.TemporalOperatorService.processValues) .then(function(operators) { temporalOperators = operators; }); this.$httpBackend.flush(); var item = this.TemporalOperatorService.convertQDMToSoPhe('http://rdf.healthit.gov/qdm/element#sas', temporalOperators); expect(item.base).toEqual('starts'); expect(item.modifier).toEqual('after start'); })); }); });
/** * @license Apache-2.0 * * Copyright (c) 2020 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var tape = require( 'tape' ); var proxyquire = require( 'proxyquire' ); var IS_BROWSER = require( '@stdlib/assert/is-browser' ); var smidrange = require( './../lib' ); // VARIABLES // var opts = { 'skip': IS_BROWSER }; // TESTS // tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.strictEqual( typeof smidrange, 'function', 'main export is a function' ); t.end(); }); tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { t.strictEqual( typeof smidrange.ndarray, 'function', 'method is a function' ); t.end(); }); tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { var smidrange = proxyquire( './../lib', { '@stdlib/utils/try-require': tryRequire }); t.strictEqual( smidrange, mock, 'returns expected value' ); t.end(); function tryRequire() { return mock; } function mock() { // Mock... } }); tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { var smidrange; var main; main = require( './../lib/smidrange.js' ); smidrange = proxyquire( './../lib', { '@stdlib/utils/try-require': tryRequire }); t.strictEqual( smidrange, main, 'returns expected value' ); t.end(); function tryRequire() { return new Error( 'Cannot find module' ); } });
/** * Copyright JS Foundation and other contributors, http://js.foundation * * 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 express = require("express"); var bodyParser = require("body-parser"); var util = require('util'); var passport = require('passport'); var when = require('when'); var cors = require('cors'); var auth = require("./auth"); var apiUtil = require("./util"); var adminApp; var server; var runtime; var editor; function init(_server,_runtime) { server = _server; runtime = _runtime; var settings = runtime.settings; if (settings.httpAdminRoot !== false) { apiUtil.init(runtime); adminApp = express(); auth.init(runtime); var maxApiRequestSize = settings.apiMaxLength || '5mb'; adminApp.use(bodyParser.json({limit:maxApiRequestSize})); adminApp.use(bodyParser.urlencoded({limit:maxApiRequestSize,extended:true})); adminApp.get("/auth/login",auth.login,apiUtil.errorHandler); if (settings.adminAuth) { if (settings.adminAuth.type === "strategy") { auth.genericStrategy(adminApp,settings.adminAuth.strategy); } else if (settings.adminAuth.type === "credentials") { adminApp.use(passport.initialize()); adminApp.post("/auth/token", auth.ensureClientSecret, auth.authenticateClient, auth.getToken, auth.errorHandler ); } adminApp.post("/auth/revoke",auth.needsPermission(""),auth.revoke,apiUtil.errorHandler); } // Editor if (!settings.disableEditor) { editor = require("./editor"); var editorApp = editor.init(server, runtime); adminApp.use(editorApp); } if (settings.httpAdminCors) { var corsHandler = cors(settings.httpAdminCors); adminApp.use(corsHandler); } var adminApiApp = require("./admin").init(runtime); adminApp.use(adminApiApp); } else { adminApp = null; } } function start() { if (editor) { return editor.start(); } else { return when.resolve(); } } function stop() { if (editor) { editor.stop(); } return when.resolve(); } module.exports = { init: init, start: start, stop: stop, library: { register: function(type) { if (editor) { editor.registerLibrary(type); } } }, auth: { needsPermission: auth.needsPermission }, comms: { publish: function(topic,data,retain) { if (editor) { editor.publish(topic,data,retain); } } }, get adminApp() { return adminApp; }, get server() { return server; } };
/*! * ${copyright} */ sap.ui.define(['jquery.sap.global', './Matcher'], function ($, Matcher) { "use strict"; /** * AggregationLengthEquals - checks if an aggregation contains a specified number of entries. * * @class AggregationLengthEquals - checks if an aggregation contains a specified number of entries. * @param {object} [mSettings] optional map/JSON-object with initial settings for the new AggregationLengthEqualsMatcher * @extends sap.ui.test.matchers.Matcher * @public * @name sap.ui.test.matchers.AggregationLengthEquals * @author SAP SE * @since 1.23 */ return Matcher.extend("sap.ui.test.matchers.AggregationLengthEquals", /** @lends sap.ui.test.matchers.AggregationLengthEquals.prototype */ { metadata : { publicMethods : [ "isMatching" ], properties : { /** * The name of the aggregation that is used for matching. */ name : { type : "string" }, /** * The length that aggregation <code>name</code> should have. */ length : { type : "int" } } }, /** * Checks if the control's aggregation <code>name</code> has length <code>length</code>. * * @param {sap.ui.core.Control} oControl the control that is checked by the matcher * @return {boolean} true if the length of aggregation <code>name</code> is the same as <code>length</code>, false if it is not. * @public */ isMatching : function (oControl) { var sAggregationName = this.getName(), fnAggregation = oControl["get" + $.sap.charToUpperCase(sAggregationName, 0)]; if (!fnAggregation) { this._oLogger.error("Control '" + oControl + "' does not have an aggregation called '" + sAggregationName + "'"); return false; } var vAggregation = fnAggregation.call(oControl); var aAggregation = $.isArray(vAggregation) ? vAggregation : [vAggregation]; var iAggregationLength = aAggregation.length; var iExpectedLength = this.getLength(); var bIsMatch = iAggregationLength === iExpectedLength; if (!bIsMatch) { this._oLogger.debug("Control '" + oControl + "' has " + iAggregationLength + " Objects in the aggregation '" + sAggregationName + "' but it should have " + iExpectedLength); } return bIsMatch; } }); }, /* bExport= */ true);
/** * 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'; /* eslint-env mocha */ const Gather = require('../../driver/gatherers/gather'); const Driver = require('../../driver'); const assert = require('assert'); class TestGatherer extends Gather { constructor() { super(); this.called = false; } get name() { return 'test'; } setup() { this.called = true; } } const fakeDriver = { connect() { return Promise.resolve(); }, disconnect() {}, gotoURL() { return Promise.resolve(); }, beginEmulation() { return Promise.resolve(); }, cleanAndDisableBrowserCaches() {}, forceUpdateServiceWorkers() {}, beginTrace() { return Promise.resolve(); }, endTrace() { return Promise.resolve( require('../fixtures/traces/progressive-app.json') ); }, beginNetworkCollect() {}, endNetworkCollect() { return Promise.resolve(); } }; describe('Driver', function() { it('loads a page', () => { const driver = { gotoURL() { return Promise.resolve(true); } }; return Driver.loadPage(driver, {}, { flags: { loadPage: true } }).then(res => { assert.equal(res, true); }); }); it('reloads a page via about:blank', () => { const expected = [ 'https://example.com', 'about:blank' ]; const driver = { gotoURL(url) { assert(url, expected.pop()); return Promise.resolve(true); } }; return Driver.loadPage(driver, {url: 'https://example.com'}) .then(res => { assert.equal(res, true); }); }); it('sets up the driver to begin emulation when mobile == true', () => { let calledEmulation = false; const driver = { beginEmulation() { calledEmulation = true; }, cleanAndDisableBrowserCaches() {}, forceUpdateServiceWorkers() {} }; return Driver.setupDriver(driver, {}, { flags: { mobile: true } }).then(_ => { assert.equal(calledEmulation, true); }); }); it('does not set up the driver to begin emulation when mobile == false', () => { let calledEmulation = false; const driver = { beginEmulation() { calledEmulation = true; }, cleanAndDisableBrowserCaches() {}, forceUpdateServiceWorkers() {} }; return Driver.setupDriver(driver, {}, { flags: {} }).then(_ => { assert.equal(calledEmulation, false); }); }); it('tells the driver to begin tracing', () => { let calledTrace = false; const driver = { beginTrace() { calledTrace = true; return Promise.resolve(); } }; const config = { trace: true, gatherers: [{ setup() {} }] }; return Driver.setup({driver, config}).then(_ => { assert.equal(calledTrace, true); }); }); it('tells the driver to end tracing', () => { let calledTrace = false; const driver = { endTrace() { calledTrace = true; return Promise.resolve({x: 1}); } }; const config = { trace: true, gatherers: [{ afterPass() {} }] }; return Driver.afterPass({driver, config}).then(vals => { assert.equal(calledTrace, true); assert.deepEqual(vals.traceContents, {x: 1}); }); }); it('tells the driver to begin network collection', () => { let calledNetworkCollect = false; const driver = { beginNetworkCollect() { calledNetworkCollect = true; return Promise.resolve(); } }; const config = { network: true, gatherers: [{ setup() {} }] }; return Driver.setup({driver, config}).then(_ => { assert.equal(calledNetworkCollect, true); }); }); it('tells the driver to end network collection', () => { let calledNetworkCollect = false; const driver = { endNetworkCollect() { calledNetworkCollect = true; return Promise.resolve({x: 1}); } }; const config = { network: true, gatherers: [{ afterPass() {} }] }; return Driver.afterPass({driver, config}).then(vals => { assert.equal(calledNetworkCollect, true); assert.deepEqual(vals.networkRecords, {x: 1}); }); }); it('rejects when not given a URL', () => { return Driver.run({}, {}).then(_ => assert.ok(false), _ => assert.ok(true)); }); it('rejects when given a URL of zero length', () => { return Driver.run({}, {url: ''}).then(_ => assert.ok(false), _ => assert.ok(true)); }); it('does as many passes as are required', () => { const t1 = new TestGatherer(); const t2 = new TestGatherer(); const passes = [{ network: true, trace: true, loadDataName: 'first-pass', loadPage: true, gatherers: [ t1 ] }, { loadPage: true, gatherers: [ t2 ] }]; return Driver.run(passes, {driver: fakeDriver, url: 'https://example.com', flags: {}}) .then(_ => { assert.ok(t1.called); assert.ok(t2.called); }); }); });
exports.execute = function (options) { describe('For determining order of visible foreign key, ', function () { var schemaName = "visible_foreign_keys_schema", tableWithAnnotation = "vfk_table_with_annotation", tableWithoutAnnotation = "vfk_table_without_annotation", schema; beforeAll(function (done) { schema = options.catalog.schemas.get(schemaName); done(); }); // Test Cases: // Helper function to add 'expect' based on test cases and the specified table function runTestCases(table, cases, check_order) { Object.keys(cases).forEach(function (context) { var fk_names = schema.tables.get(table).referredBy._contextualize(context).map( function(fk){ return fk.foreignKey.constraint_names[0][1]; // return the actual constraint_name }); expect(fk_names).toHaveSameItems(cases[context], !check_order, "failed for context: " + context); }); } // Test Cases: it('should use the defined order in anntoations based on its context.', function(){ runTestCases(tableWithAnnotation, { "entry": [], "entry/edit": ["fk_inbound_to_with_annotation"], "*": [] }, true); }); it('should use `entry` context when context is `entry/edit` or `entry/create` and they are not present in annotation.', function () { runTestCases(tableWithAnnotation, { "entry/create": [] }, true); }); it('should use default (`*`) context for any context not matched by a more specific context name.', function () { runTestCases(tableWithAnnotation, { "filter": [] }, true); }); it('should ignore the constraint names that do not correspond to any inbound or outbound foreign key of the table.', function () { runTestCases(tableWithAnnotation, { "record": ["fk_inbound_to_with_annotation"] }, true); }); it('should ignore repetitive constraint names and just consider the first one.', function () { runTestCases(tableWithAnnotation, { "compact": [ "fk_inbound_to_with_annotation" ] }, true); }); it('should use the default order when context not matched by a more specific context name and default (`*`) context is not present.', function () { expect(schema.tables.get(tableWithoutAnnotation).referredBy._contextualize("filter")).toBe(-1); }); }); };
/* * Minio Cloud Storage (C) 2018 Minio, 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. */ export const SET = "alert/SET" export const CLEAR = "alert/CLEAR" export let alertId = 0 export const set = alert => { const id = alertId++ return (dispatch, getState) => { if (alert.type !== "danger" || alert.autoClear) { setTimeout(() => { dispatch({ type: CLEAR, alert: { id } }) }, 5000) } dispatch({ type: SET, alert: Object.assign({}, alert, { id }) }) } } export const clear = () => { return { type: CLEAR } }
import { R, BPromise, log, chalk, promisifyAll } from '../utils'; var GithubApi = require("github"); class Github { constructor(api_key) { this.api_key = api_key; this.api = new GithubApi({ version: '3.0.0', // debug: true }); this.api.authenticate({ type: "basic", username: 'gullitmiranda', password: api_key }); this.client = promisifyAll(this.api); } repoByUrl(url) { var params = this.parseUrl(url); log("Get repository data by url", chalk.green(url)); return BPromise.coroutine(function* () { var repo = yield this.client.repos.getAsync(params); return repo; }.bind(this))(); } issues(params) { var msg_arr = [ " Get issues (and pull_request) to repository", chalk.green(`${params.user}/${params.repo}`) ]; if (params.state) { msg_arr.push("with state", params.state); } log(...msg_arr); return this.client.issues.repoIssuesAsync(params); } getCommentsByIssue(issue, params) { var params_with_issue = R.merge(params, { number: issue.number }); log(" Get comments to issue", chalk.green(`#${issue.number}`), issue.title); return this.client.issues.getCommentsAsync(params_with_issue); } issuesWithCommentsByRepo(repo, params) { return BPromise.coroutine(function* () { var params_with_repo = R.merge({ user: repo.owner.login, repo: repo.name }, params); var issues = yield this.issues(params_with_repo); for (var i = 0; i < issues.length; i++) { issues[i].comments = yield this.getCommentsByIssue(issues[i], params_with_repo); } return issues; }.bind(this))(); } parseUrl(url) { var regex = /^(?:.*\/)?([\w-_.]*)\/([\w-_.]*)$/g; var params = regex.exec(url); if (!params) { throw new Error(`Invalid url to parse: ${url}`); } return { user: params[1], repo: params[2] }; } } module.exports = { __esModule: true, get default () { return Github; }, get Github () { return Github; }, get GithubToPivotal() { return require('./to/pivotal').GithubToPivotal; } };
/* * Copyright 2019 ThoughtWorks, 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 {TestHelper} from "views/pages/spec/test_helper"; describe("Form Helper", () => { const $ = require("jquery"); const m = require('mithril'); const Stream = require('mithril/stream'); const f = require('helpers/form_helper'); const helper = new TestHelper(); afterEach((done) => { helper.unmount(done); }); it("buttonWithTooltip should add a tooltip to the button", () => { const model = Stream(true); helper.mount(() => m(f.buttonWithTooltip, { model, 'tooltipText': "show me on hover", }, "Fancy button with tooltip") ); const buttonWithTooltip = helper.find('button'); expect(buttonWithTooltip).toExist(); const tooltipId = $(buttonWithTooltip).attr("data-tooltip-id"); const tooltip = helper.find(`#${tooltipId}`); expect(tooltip).toExist(); expect(tooltip).toHaveText("show me on hover"); expect(tooltip).not.toBeVisible(); $(buttonWithTooltip).trigger('mouseover'); expect(tooltip).toBeVisible(); $(buttonWithTooltip).trigger('mouseout'); expect(tooltip).not.toBeVisible(); }); it("linkWithTooltip should add a tooltip to the link", () => { const model = Stream(true); helper.mount(() => m(f.linkWithTooltip, { model, 'tooltipText': "show me on hover", }, "Fancy link with tooltip")); const linkWithTooltip = helper.find('a'); expect(linkWithTooltip).toExist(); const tooltipId = $(linkWithTooltip).attr("data-tooltip-id"); const tooltip = helper.find(`#${tooltipId}`); expect(tooltip).toExist(); expect(tooltip).toHaveText("show me on hover"); expect(tooltip).not.toBeVisible(); $(linkWithTooltip).trigger('mouseover'); expect(tooltip).toBeVisible(); $(linkWithTooltip).trigger('mouseout'); expect(tooltip).not.toBeVisible(); }); });
/* * Copyright 2020 Google LLC * * 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 * * https://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. */ /** * External dependencies */ import { render, act, waitFor } from '@testing-library/react'; import { withOverlay } from '@googleforcreators/moveable'; import { MockMoveable } from 'react-moveable'; // eslint-disable-line import/named -- This is a custom Jest mock import PropTypes from 'prop-types'; import { forwardRef } from '@googleforcreators/react'; import { UnitsProvider } from '@googleforcreators/units'; import { TransformProvider } from '@googleforcreators/transform'; /** * Internal dependencies */ import CanvasContext from '../../../app/canvas/context'; import Selection from '../selection'; import StoryContext from '../../../app/story/context'; const pageSize = { width: 100, height: 100 }; const element1 = { id: '1', type: 'text', x: 0, y: 0 }; const element2 = { id: '2', type: 'text', x: 10, y: 10 }; const WrapperWithRef = ({ children }, ref) => ( <div ref={ref}> <TransformProvider> <UnitsProvider pageSize={pageSize}>{children}</UnitsProvider> </TransformProvider> </div> ); const Wrapper = withOverlay(forwardRef(WrapperWithRef)); WrapperWithRef.propTypes = { children: PropTypes.node, }; describe('multiSelectionMoveable', () => { let updateElementsById; let updateSelectedElements; let target1; let target2; let storyContext; let canvasContext; beforeEach(() => { updateElementsById = jest.fn(); updateSelectedElements = jest.fn(); target1 = document.createElement('div'); target2 = document.createElement('div'); storyContext = { state: { selectedElements: [element1, element2], currentPage: { elements: [], }, }, actions: { updateElementsById, updateSelectedElements }, }; canvasContext = { state: { pageSize, nodesById: { 1: target1, 2: target2, }, fullbleedContainer: document.body, }, actions: { handleSelectElement: jest.fn() }, }; }); function arrange() { return render( <StoryContext.Provider value={storyContext}> <CanvasContext.Provider value={canvasContext}> <Selection /> </CanvasContext.Provider> </StoryContext.Provider>, { wrapper: Wrapper } ); } function performRotation(rotateTo) { const moveable = MockMoveable.mock.calls[MockMoveable.mock.calls.length - 1][0]; moveable?.onRotateGroupStart({ events: [{ set: () => {} }] }); moveable?.onRotateGroup({ events: [ { target: target1, beforeRotate: rotateTo, drag: { beforeTranslate: [0, 0] }, }, { target: target2, beforeRotate: rotateTo, drag: { beforeTranslate: [0, 0] }, }, ], }); moveable?.onRotateGroupEnd({ targets: [target1, target2] }); } const rotateCases = [ ['normally', { rotateTo: 45, expectedRotationAngle: 45 }], ['through 360 degrees', { rotateTo: 370, expectedRotationAngle: 10 }], ['through negative', { rotateTo: -370, expectedRotationAngle: 350 }], ]; it.each(rotateCases)( 'should rotate %p', async (_, { rotateTo, expectedRotationAngle }) => { arrange(); // Wait until the component has loaded. await waitFor( () => MockMoveable.mock.calls[MockMoveable.mock.calls.length - 1][0] ); act(() => { performRotation(rotateTo); }); const func = updateElementsById.mock.calls[0][0].properties; expect(func(element1)).toStrictEqual({ x: 0, y: 0, rotationAngle: expectedRotationAngle, }); expect(func(element2)).toStrictEqual({ x: 10, y: 10, rotationAngle: expectedRotationAngle, }); expect(updateElementsById).toHaveBeenCalledTimes(1); } ); });
// https://eslint.org/docs/user-guide/configuring module.exports = { root: true, parser: 'babel-eslint', parserOptions: { sourceType: 'module' }, env: { browser: true, }, // https://github.com/standard/standard/blob/master/docs/RULES-en.md extends: 'standard', plugins: [ // required to lint *.vue files 'html', 'compat' ], // add your custom rules here rules: { // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'compat/compat': 'error' } }
(function () { 'use strict'; app.controller('reportJobsC', reportJobsC); function reportJobsC($scope, $routeParams, $http, reportJobsService, dashboardFactory){ var vm = $scope; vm.report = reportJobsService.report(); vm.report.searchParam.startdate = $routeParams.startdate; vm.report.searchParam.enddate = $routeParams.enddate; if ($routeParams.state) vm.report.searchParam.state = $routeParams.state; if ($routeParams.username) vm.report.searchParam.username = $routeParams.username; if ($routeParams.usertype) vm.report.searchParam.usertype = $routeParams.usertype; if ($routeParams.userid) vm.report.searchParam.userid = $routeParams.userid; vm.activate = function () { vm.report.loadReport(); } vm.activate(); vm.getCssClass = function (state) { return dashboardFactory.getProperWordWithCss(state); } } })();
/** * 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. */ const Audit = require('../../audits/manifest-short-name.js'); const assert = require('assert'); const manifestSrc = JSON.stringify(require('../fixtures/manifest.json')); const manifestParser = require('../../lib/manifest-parser'); const Manifest = manifestParser(manifestSrc); /* global describe, it*/ describe('Manifest: short_name audit', () => { it('fails when no manifest present', () => { return assert.equal(Audit.audit({Manifest: { value: undefined }}).value, false); }); it('fails when an empty manifest is present', () => { return assert.equal(Audit.audit({Manifest: {}}).value, false); }); // Need to disable camelcase check for dealing with short_name. /* eslint-disable camelcase */ it('fails when a manifest contains no short_name and no name', () => { const inputs = JSON.stringify({ name: null, short_name: null }); const Manifest = manifestParser(inputs); return assert.equal(Audit.audit({Manifest}).value, false); }); it('succeeds when a manifest contains no short_name but a name', () => { const inputs = JSON.stringify({ short_name: undefined, name: 'Example App' }); const Manifest = manifestParser(inputs); return assert.equal(Audit.audit({Manifest}).value, true); }); /* eslint-enable camelcase */ it('succeeds when a manifest contains a short_name', () => { return assert.equal(Audit.audit({Manifest}).value, true); }); });
define([ "clientcore", "clientajax" ], function( jQuery ) { // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and crossDomain jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, callback; return { send: function( _, complete ) { script = jQuery("<script>").prop({ async: true, charset: s.scriptCharset, src: s.url }).on( "load error", callback = function( evt ) { script.remove(); callback = null; if ( evt ) { complete( evt.type === "error" ? 404 : 200, evt.type ); } } ); document.head.appendChild( script[ 0 ] ); }, abort: function() { if ( callback ) { callback(); } } }; } }); });
import React from 'react'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import { trimString } from '../../utils/index'; const BestNewList = (props) => ( <ReactCSSTransitionGroup className="top10-item" component="section" transitionName="top10-item" transitionEnterTimeout={1000} transitionLeaveTimeout={1000}> <div key={trimString(props.artists[props.index].album.name)} > <h1 className="item-title"> {props.artists[props.index].album.name} </h1> <h2 className="item-subtitle"> <a href={`/artist/${trimString(props.artists[props.index].artist)}`} target="_blank">"{props.artists[props.index].artist}"</a> </h2> </div> </ReactCSSTransitionGroup> ); export default BestNewList;
function Controller() { function login() { if (null != $.username.value && null != $.senha.value) { Ti.App.fireEvent("app:preload", null); Alloy.Globals.Util.login($.username.value, $.senha.value, processa); } } function processa(e) { Ti.App.fireEvent("app:preload", null); if (null != e) if ("error" != e.type) if (e.projeto.count > 0) { Alloy.Globals.Usuario = e; setProjeto(); } else alert(e.projeto.message); else alert(e.message); } function setProjeto() { Ti.App.fireEvent("app:setLayout", { layout: "sac", title: "SAC", swipe: false }); } require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); this.__controllerPath = "login"; arguments[0] ? arguments[0]["__parentSymbol"] : null; arguments[0] ? arguments[0]["$model"] : null; arguments[0] ? arguments[0]["__itemTemplate"] : null; var $ = this; var exports = {}; $.__views.login = Ti.UI.createView({ layout: "vertical", id: "login" }); $.__views.login && $.addTopLevelView($.__views.login); $.__views.scrollview = Ti.UI.createScrollView({ backgroundColor: "transparent", layout: "vertical", id: "scrollview", scrollingEnabled: "true" }); $.__views.login.add($.__views.scrollview); $.__views.__alloyId94 = Ti.UI.createView({ left: 0, width: "100%", height: "100dp", id: "__alloyId94" }); $.__views.scrollview.add($.__views.__alloyId94); $.__views.__alloyId95 = Ti.UI.createImageView({ image: "/images/outros/header_login.png", height: "60", width: "60", left: "10", id: "__alloyId95" }); $.__views.__alloyId94.add($.__views.__alloyId95); $.__views.__alloyId96 = Ti.UI.createLabel({ left: "90", font: { fontWeight: "bold", fontSize: 18, fontFamily: "DIN-BoldAlternate" }, color: "#115a98", height: "100dp", verticalAlign: Titanium.UI.TEXT_VERTICAL_ALIGNMENT_CENTER, text: "ACOMPANHE O \nANDAMENTO DO SEU \nPROJETO", width: "auto", id: "__alloyId96" }); $.__views.__alloyId94.add($.__views.__alloyId96); $.__views.__alloyId97 = Ti.UI.createView({ height: 26, left: 0, bottom: 2, backgroundColor: "#f5f5f5", id: "__alloyId97" }); $.__views.scrollview.add($.__views.__alloyId97); $.__views.__alloyId98 = Ti.UI.createLabel({ font: { fontSize: 11, fontWeight: "bold" }, left: 5, color: "#8a8a8a", text: "LOGIN", id: "__alloyId98" }); $.__views.__alloyId97.add($.__views.__alloyId98); $.__views.__alloyId99 = Ti.UI.createView({ backgroundColor: "#eeeeee", left: "20", right: "20", top: "20", height: "162", layout: "vertical", id: "__alloyId99" }); $.__views.scrollview.add($.__views.__alloyId99); $.__views.__alloyId100 = Ti.UI.createView({ backgroundColor: "#FFF", layout: "horizontal", left: "10", right: "10", top: "10", height: "45", bottom: "2", id: "__alloyId100" }); $.__views.__alloyId99.add($.__views.__alloyId100); $.__views.__alloyId101 = Ti.UI.createLabel({ font: { fontSize: 14 }, color: "#c9c9c9", left: 5, top: 13, text: "Usuário:", id: "__alloyId101" }); $.__views.__alloyId100.add($.__views.__alloyId101); $.__views.username = Ti.UI.createTextField({ width: 180, top: "0", left: "20", borderWidth: 0, height: "50dp", borderColor: "#FFF", color: "#000", id: "username" }); $.__views.__alloyId100.add($.__views.username); $.__views.__alloyId102 = Ti.UI.createView({ backgroundColor: "#FFF", layout: "horizontal", left: "10", right: "10", height: "45", bottom: "10", id: "__alloyId102" }); $.__views.__alloyId99.add($.__views.__alloyId102); $.__views.__alloyId103 = Ti.UI.createLabel({ font: { fontSize: 14 }, color: "#c9c9c9", left: 5, top: 13, text: "Senha:", id: "__alloyId103" }); $.__views.__alloyId102.add($.__views.__alloyId103); $.__views.senha = Ti.UI.createTextField({ width: 180, top: "0", left: "29", borderWidth: 0, height: "50dp", borderColor: "#FFF", color: "#000", passwordMask: "true", returnKeyType: Ti.UI.RETURNKEY_GO, id: "senha" }); $.__views.__alloyId102.add($.__views.senha); $.__views.entrar = Ti.UI.createButton({ left: 10, bottom: 10, right: 10, height: 40, borderColor: "#2155bb", font: { fontWeight: "bold" }, borderRadius: 0, backgroundColor: "transparent", color: "white", backgroundImage: "/back_button.png", title: "ENTRAR", id: "entrar" }); $.__views.__alloyId99.add($.__views.entrar); exports.destroy = function() {}; _.extend($, $.__views); arguments[0] || {}; $.senha.addEventListener("return", function() { login(); }); $.entrar.addEventListener("click", function() { login(); }); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; module.exports = Controller;
import React from 'react' import { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { reduxForm } from 'redux-form' import { loginUser } from '../../actions/authenticationActions' const formName = 'login-user-form' /** * Component used to authenticate users before to the dashboard. */ export const fields = ['username', 'password'] const isValidEmailRegex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i // define our client side form validation rules const validate = values => { const errors = {} if (! values.username) { errors.username = 'Required' } else if (!isValidEmailRegex.test(values.username)) { errors.username = 'Invalid email address' } if (! values.password) { errors.password = 'Required' } return errors } @connect((state) => { return { isAuthenticating: state.auth.isAuthenticating, statusText: state.auth.statusText, initialValues: { redirectTo: state.routing.locationBeforeTransitions.query.next || '/' } } }) // wire up the redux form @reduxForm( { form: formName, fields: fields, validate } ) export default class LoginUserForm extends Component { static propTypes = { fields: PropTypes.object.isRequired, handleSubmit: PropTypes.func.isRequired, isAuthenticating: PropTypes.bool.isRequired, dispatch: PropTypes.func.isRequired, } render() { const {fields: {username, password}, handleSubmit, isAuthenticating, dispatch} = this.props return ( <form id={formName} onSubmit={handleSubmit( data => { dispatch(loginUser(data.username, data.password)) })}> <div id='email-div' className='ncss-form-group'> <div className={((username.touched && username.error) ? 'ncss-input-container error' : 'ncss-input-container')}> <label className='ncss-label'>Email</label> <input type='text' className='ncss-input pt2-sm pr4-sm pb2-sm pl4-sm' placeholder='Please enter your email address' {...username}/> {username.touched && username.error && <div className='ncss-error-msg'>{username.error}</div>} </div> </div> <div id='pass-div' className='ncss-form-group'> <div className={((password.touched && password.error) ? 'ncss-input-container error' : 'ncss-input-container')}> <label className='ncss-label'>Password</label> <input type='password' className='ncss-input pt2-sm pr4-sm pb2-sm pl4-sm r' placeholder='Please enter your password' {...password}/> {password.touched && password.error && <div className='ncss-error-msg'>{password.error}</div>} </div> </div> <div id='login-form-submit-container'> <div id='fountainG' className={isAuthenticating ? 'show-me' : 'hide-me'}> <div id='fountainG_1' className='fountainG'></div> <div id='fountainG_2' className='fountainG'></div> <div id='fountainG_3' className='fountainG'></div> <div id='fountainG_4' className='fountainG'></div> <div id='fountainG_5' className='fountainG'></div> <div id='fountainG_6' className='fountainG'></div> <div id='fountainG_7' className='fountainG'></div> <div id='fountainG_8' className='fountainG'></div> </div> <div id="login-help"> <a target="_blank" href="/dashboard/help/index.html">Need help?</a> </div> <button id='login-btn' className='ncss-btn-offwhite ncss-brand pt3-sm pr5-sm pb3-sm pl5-sm pt2-lg pb2-lg u-uppercase' disabled={isAuthenticating}>Login</button> </div> </form> ) } }
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; /** * Determine the number of seconds in a year according to the Gregorian calendar. * * @module @stdlib/time/seconds-in-year * * @example * var secondsInYear = require( '@stdlib/time/seconds-in-year' ); * * var num = secondsInYear(); * // returns <number> * * num = secondsInYear( 2016 ); * // returns 31622400 * * num = secondsInYear( 2017 ); * // returns 31536000 */ // MODULES // var secondsInYear = require( './seconds_in_year.js' ); // EXPORTS // module.exports = secondsInYear;
'use strict'; /*globals JSkeleton, _ */ /* jshint unused: false */ JSkeleton.registerHelper('@component', function(params, env, args) { // env.enviroment._app; // env.enviroment.channel; //env.enviroment._view, view-controller // params = params || {}; var componentName = typeof args[0] === 'string' ? args[0] : params.name, ComponentClass, component, viewInstance = env.enviroment._view, componentData; if (!componentName) { throw new Error('You must define a Component Class Name.'); } //omit component factory name componentData = _.omit(params, 'name'); //inject component dependencies componentData = _.extend(componentData, { _app: env.enviroment._app }); component = JSkeleton.factory.new(componentName, componentData); if (!component || typeof component !== 'object') { throw new Error('It is not possible create the component.'); } viewInstance.addComponent(componentName, component); return component.render().$el.get(0); });
var albumPicasso = { title: 'The Colors', artist: 'Pablo Picasso', label: "Cubism", year: '1881', albumArtUrl: 'assets/images/album_covers/01.png', songs: [ {title: 'Blue', duration: 161.71, audioUrl:'assets/music/blue'}, {title: 'Green', duration: 103.96, audioUrl:'assets/music/green'}, {title: 'Red', duration: 268.45, audioUrl: 'assets/music/red'}, {title: 'Pink', duration: 153.14, audioUrl: 'assets/music/pink'} ] }; var albumMacroni = { title: 'The Telephone', artist: 'Guglielmo Marconi', label: "EM", year: '1909', albumArtUrl: 'assets/images/album_covers/20.png', songs: [ {title: 'Hello, Operator?', duration: '1:01'}, {title: 'Ring, ring, ring', duration: '5:01'}, {title: 'Fits in your pocket', duration: '3:21'}, {title: 'Can you hear me now?', duration: '3:14'}, {title: 'Wrong phone number', duration: '2:15'} ] }; var albumGaga = { title: 'Fame Monster', artist: 'Lady Gaga', label: "Haus of Gaga", year: '2010', albumArtUrl: 'assets/images/album_covers/21.png', songs: [ {title: 'Bad Romance', duration: '1:01'}, {title: 'Telephone', duration: '5:01'}, {title: 'Pokerface', duration: '3:21'}, {title: 'Judas', duration: '3:14'}, {title: 'Born This Way', duration: '2:15'} ] };
define([ './ListView', './BaseView', 'underscore' ], function(ListView, BaseView, _) { return BaseView.extend({ tpl: '<a href="#" class="btn btn-link load-more"><h4>Show More</h4></a>', events: { 'click .load-more': 'loadMore' }, className: 'list-group-load-more', ItemView: null, ListView: null, defaultListViewOptions: function () { return { tagName: 'ul', ItemView: this.ItemView, collection: this.collection, itemViewOptions: this.itemViewOptions }; }, initialize: function (options) { BaseView.prototype.initialize.call(this, options); this.initializeListView(); this.listenTo(this.collection, 'sync', this.updateLoadMore); }, initializeListView: function () { var listOptions = this.ListView ? { collection: this.collection } : _.result(this, 'defaultListViewOptions'); var ListViewImpl = this.ListView || ListView; this.listView = new ListViewImpl(listOptions); }, render: function () { this.$el.append(this.listView.render().$el, this.tpl); this.updateLoadMore(); return this; }, loadMore: function (evt) { evt.preventDefault(); this.collection.nextPage().always(_.bind(this.updateLoadMore, this)); }, updateLoadMore: function () { this.$el.children('.load-more')[this.collection.canLoadMore() ? 'show' : 'hide'](); }, remove: function () { this.listView.remove(); return BaseView.prototype.remove.call(this); } }); });
var fs = require('fs'); var async = require('async'); var chalk = require('chalk'); var figures = require('figures'); var path = require('path'); var Log = require('../Log.js'); var Time = require('../Time.js'); var MigratProjectLoader = require('../MigratProjectLoader.js'); module.exports = function(options, callback) { var project, name, plugins; Log.options = options; options.name = options._[3]; if (!options.name) { return callback(new Error('No migration name provided')); } else if (!/^[a-z0-9\-\_]+$/i.test(options.name)) { return callback(new Error('Migration name can only contain letters, numbers, dashes, and underscores.')); } function done(err, callback) { if (err) Log.write(chalk.red(figures.cross) + '\n'); else Log.write(chalk.green(figures.tick) + '\n'); callback(err); } function defaultTemplate(details, callback) { fs.readFile(path.resolve(__dirname, '../Templates/migration.js'), 'utf8', function(err, content) { if (err) return done(err, callback); callback(null, content .replace('{{attribution}}', details.user ? ' by ' + details.user : '') .replace('{{date}}', (new Date(details.timestamp)).toString())); }); } async.series([ function loadConfig(callback) { MigratProjectLoader(options.config, function(err, _project, _plugins) { project = _project; plugins = _plugins; callback(err); }); }, function synchronizeTime(callback) { Time.synchronize(callback); }, function createMigration(callback) { var suffix = ''; var type = options.type; if (options.allNodes) suffix = '.all'; var stamp = Time.stamp(); var extension = 'js'; if (type) { extension = type; templateFetcher = plugins.getTemplateRenderer(type); if (!templateFetcher) { return callback(new Error('No plugin found capable of creating "*.' + type + '" files')); } } else { templateFetcher = project.migrationTemplate || defaultTemplate; } var filename = stamp + '-' + options.name + suffix + '.' + extension; var file = project.migrationsDir + '/' + filename; Log.write('Creating migration: ' + filename + ' '); templateFetcher({ user: process.env.USER, timestamp: stamp, filename: filename }, function(err, content) { if (err) return done(err, callback); fs.writeFile(file, content, 'utf8', function(err) { done(err, callback); }); }); } ], callback); };
/** * */ var dataset=new Array(); var data1=new Array(); var data2=new Array(); for(h=0;h<type.length;h++){ qvalue[h]=qvalue[h]-qavg[h]; var ob={type:type[h],score:qavg[h]}; data1.push(ob); var ob1={type:type[h],score:qvalue[h]}; data2.push(ob1); } var obj1={name:"平均分",exam:data1}; dataset.push(obj1); var obj2={name:"分值",exam:data2}; dataset.push(obj2); if(number!=null){ var width = 700; var height = 600; var svg = d3.select("body").select(".d3").append("svg") .attr("width",width) .attr("height",height) .attr("class","stack"); var stack = d3.layout.stack() .values(function(d){ return d.exam; }) .x(function(d){ return d.type; }) .y(function(d){ return d.score; }); var data = stack(dataset); var padding = { left:50, right:100, top:30, bottom:30 }; var xRangeWidth = width - padding.left - padding.right; var xScale = d3.scale.ordinal() .domain( data[0].exam.map(function(d){ return d.type; })) .rangeBands([0, xRangeWidth],0.3); //(定义域的最大值) var maxscore = d3.max(data[0].exam, function(d){ return d.y0 + d.y; }); //最大高度(值域的最大值) var yRangeWidth = height - padding.top - padding.bottom; var yScale = d3.scale.linear() .domain([0, maxscore*2]) //定义域 .range([0, yRangeWidth]); var color = d3.scale.category10(); //添加分组元素 var groups = svg.selectAll("g") .data(data) .enter() .append("g") .style("fill",function(d,i){ return color(i); }); var rects = groups.selectAll("rect") .data(function(d){ return d.exam; }) .enter() .append("rect") .attr("x",function(d){ return xScale(d.type); }) .attr("y",function(d){ return yRangeWidth - yScale( d.y0 + d.y ); }) .attr("width",function(d){ return xScale.rangeBand(); }) .attr("height",function(d){ return yScale(d.y); }) .attr("transform","translate(" + padding.left + "," + padding.top + ")"); var xAxis = d3.svg.axis() .scale(xScale) .orient("bottom"); yScale.range([yRangeWidth, 0]); var yAxis = d3.svg.axis() .scale(yScale) .orient("left"); svg.append("g") .attr("transform","translate(" + padding.left + "," + (height - padding.bottom) + ")") .call(xAxis) .append("text") .text("题型") .attr('transform', 'translate('+xRangeWidth+', 0)'); svg.append("g") .attr("transform","translate(" + padding.left + "," + (height - padding.bottom - yRangeWidth) + ")") .call(yAxis) .append("text") .text("分数"); var labHeight = 50; var labRadius = 10; var labelCircle = groups.append("circle") .attr("cx",function(d){ return width - padding.right*0.98; }) .attr("cy",function(d,i){ return padding.top * 2 + labHeight * i; }) .attr("r",labRadius); var labelText = groups.append("text") .attr("x",function(d){ return width - padding.right*0.8; }) .attr("y",function(d,i){ return padding.top * 2 + labHeight * i; }) .attr("dy",labRadius/2) .text(function(d){ return d.name; }); }
/** * @license Apache-2.0 * * Copyright (c) 2021 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var resolve = require( 'path' ).resolve; var tryRequire = require( '@stdlib/utils/try-require' ); var bench = require( '@stdlib/bench' ); var uniform = require( '@stdlib/random/base/uniform' ).factory; var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var ndarray = require( '@stdlib/ndarray/ctor' ); var pkg = require( './../package.json' ).name; // VARIABLES // var abs = tryRequire( resolve( __dirname, './../lib/native.js' ) ); var opts = { 'skip': ( abs instanceof Error ) }; var rand = uniform( -100.0, 100.0 ); // FUNCTIONS // /** * Creates a benchmark function. * * @private * @param {PositiveInteger} len - array length * @returns {Function} benchmark function */ function createBenchmark( len ) { var buf; var sh; var st; var x; var i; buf = []; for ( i = 0; i < len*2; i++ ) { buf.push( rand() ); } sh = [ len/2, 2, 1 ]; st = [ 4, 1, 1 ]; x = ndarray( 'generic', buf, sh, st, 0, 'row-major' ); return benchmark; /** * Benchmark function. * * @private * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { var y; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { y = abs( x ); if ( isnan( y.data[ i%len ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); if ( isnan( y.data[ i%len ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); b.end(); } } // MAIN // /** * Main execution sequence. * * @private */ function main() { var len; var min; var max; var f; var i; min = 1; // 10^min max = 6; // 10^max for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); bench( pkg+'::native,ndarray:contiguous=false,ndims=3,dtype=generic,len='+len, opts, f ); } } main();
var detect_rpc_8c = [ [ "MAX_SUBSTRINGS", "detect-rpc_8c.html#a7d9ab03945d9f1a2af62c4bb49206536", null ], [ "PARSE_REGEX", "detect-rpc_8c.html#adcc3158aa6bb4d1bd0ddf953a33f55ec", null ], [ "DetectRpcFree", "detect-rpc_8c.html#acb73d1a55d544fefa4d86d398661e7b8", null ], [ "DetectRpcMatch", "detect-rpc_8c.html#ad98df5a086ab4d0908c751c360d97dd4", null ], [ "DetectRpcParse", "detect-rpc_8c.html#afa191c3feaef5872722d9bed7c161546", null ], [ "DetectRpcRegister", "detect-rpc_8c.html#a159a5e14280d4a8fcf57568852b6cd06", null ], [ "DetectRpcRegisterTests", "detect-rpc_8c.html#a1c5e786f45529cd36498d6a1d44d8c67", null ], [ "DetectRpcSetup", "detect-rpc_8c.html#a5feed329899a35aaa8f7e163f915b7d4", null ] ];
var searchData= [ ['codegen',['CodeGen',['../namespace_visual_entity_designer_tools_1_1_code_gen.html',1,'VisualEntityDesignerTools']]], ['dialogs',['Dialogs',['../namespace_visual_entity_designer_tools_1_1_dialogs.html',1,'VisualEntityDesignerTools']]], ['models',['Models',['../namespace_visual_entity_designer_tools_1_1_models.html',1,'VisualEntityDesignerTools']]], ['visualentitydesignertools',['VisualEntityDesignerTools',['../namespace_visual_entity_designer_tools.html',1,'']]] ];
const assert = require('assert'); const getWorkflowUpdates = require('../../../lib/management/getWorkflowUpdates'); const workflow1 = { workflowId: 'w1', prefix: '/foo', destination: { locations: ['a', 'b', 'c'], }, }; const workflow1Mod = { workflowId: 'w1', prefix: '/foo', destination: { locations: ['a', 'b', 'd'], }, }; const workflow2 = { workflowId: 'w2', prefix: '/bar', destination: { locations: ['d', 'e'], }, }; const workflow2Mod = { workflowId: 'w2', prefix: '/another_prefix', destination: { locations: ['d', 'e'], }, }; const workflow3 = { workflowId: 'w3', prefix: '/qux', destination: { locations: ['f', 'g'], }, }; const workflow4 = { workflowId: 'w4', prefix: '/quz', destination: { locations: ['h', 'i'], }, }; describe('getWorkflowUpdates', () => { it('should detect a new workflow on new config', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow1], }, undefined ), { bucket1: { new: [workflow1], modified: [], deleted: [], }, }); }); it('should detect a new workflow on new bucket', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow1], }, { } ), { bucket1: { new: [workflow1], modified: [], deleted: [], }, }); }); it('should detect a new workflow on existing bucket with workflows', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow1, workflow2], }, { bucket1: { w1: workflow1 }, } ), { bucket1: { new: [workflow2], modified: [], deleted: [], }, }); }); it('should detect a modified workflow', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow1Mod, workflow2], }, { bucket1: { w1: workflow1, w2: workflow2 }, } ), { bucket1: { new: [], modified: [{ previous: workflow1, current: workflow1Mod }], deleted: [], }, }); }); it('should ignore an existing but unmodified workflow', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow1, workflow2], }, { bucket1: { w1: workflow1, w2: workflow2 }, } ), { }); }); it('should detect a deleted workflow on existing bucket', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow2], }, { bucket1: { w1: workflow1, w2: workflow2 }, } ), { bucket1: { new: [], modified: [], deleted: [workflow1], }, }); }); it('should detect deleted workflows on deleted bucket', () => { assert.deepStrictEqual( getWorkflowUpdates( { }, { bucket1: { w1: workflow1, w2: workflow2 }, } ), { bucket1: { new: [], modified: [], deleted: [workflow1, workflow2], }, }); }); it('should be fine with no configured workflow at all', () => { assert.deepStrictEqual( getWorkflowUpdates( undefined, { bucket1: { w1: workflow1, w2: workflow2 }, } ), { bucket1: { new: [], modified: [], deleted: [workflow1, workflow2], }, }); }); it('should detect a set of new, modified and deleted workflows', () => { assert.deepStrictEqual( getWorkflowUpdates( { bucket1: [workflow1Mod], bucket2: [workflow2Mod, workflow4, workflow3], bucket4: [], }, { bucket1: { w1: workflow1 }, bucket2: { w1: workflow1, w2: workflow2, w3: workflow3 }, bucket3: {}, } ), { bucket1: { new: [], modified: [{ previous: workflow1, current: workflow1Mod }], deleted: [], }, bucket2: { new: [workflow4], modified: [{ previous: workflow2, current: workflow2Mod }], deleted: [workflow1], }, }); }); });
/** * @license Apache-2.0 * * Copyright (c) 2020 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; // VARIABLES // var dmediansorted = tryRequire( resolve( __dirname, './../lib/dmediansorted.native.js' ) ); var opts = { 'skip': ( dmediansorted instanceof Error ) }; // FUNCTIONS // /** * Creates a benchmark function. * * @private * @param {PositiveInteger} len - array length * @returns {Function} benchmark function */ function createBenchmark( len ) { var x; var i; x = new Float64Array( len ); for ( i = 0; i < x.length; i++ ) { x[ i ] = i; } return benchmark; function benchmark( b ) { var v; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { v = dmediansorted( x.length, x, 1 ); if ( isnan( v ) ) { b.fail( 'should not return NaN' ); } } b.toc(); if ( isnan( v ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); b.end(); } } // MAIN // /** * Main execution sequence. * * @private */ function main() { var len; var min; var max; var f; var i; min = 1; // 10^min max = 6; // 10^max for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); bench( pkg+'::native:len='+len, opts, f ); } } main();
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = cargo; var _queue = require('./internal/queue'); var _queue2 = _interopRequireDefault(_queue); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {default: obj}; } /** * A cargo of tasks for the worker function to complete. Cargo inherits all of * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}. * @typedef {Object} CargoObject * @memberOf module:ControlFlow * @property {Function} length - A function returning the number of items * waiting to be processed. Invoke like `cargo.length()`. * @property {number} payload - An `integer` for determining how many tasks * should be process per round. This property can be changed after a `cargo` is * created to alter the payload on-the-fly. * @property {Function} push - Adds `task` to the `queue`. The callback is * called once the `worker` has finished processing the task. Instead of a * single task, an array of `tasks` can be submitted. The respective callback is * used for every task in the list. Invoke like `cargo.push(task, [callback])`. * @property {Function} saturated - A callback that is called when the * `queue.length()` hits the concurrency and further tasks will be queued. * @property {Function} empty - A callback that is called when the last item * from the `queue` is given to a `worker`. * @property {Function} drain - A callback that is called when the last item * from the `queue` has returned from the `worker`. * @property {Function} idle - a function returning false if there are items * waiting or being processed, or true if not. Invoke like `cargo.idle()`. * @property {Function} pause - a function that pauses the processing of tasks * until `resume()` is called. Invoke like `cargo.pause()`. * @property {Function} resume - a function that resumes the processing of * queued tasks when the queue is paused. Invoke like `cargo.resume()`. * @property {Function} kill - a function that removes the `drain` callback and * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`. */ /** * Creates a `cargo` object with the specified payload. Tasks added to the * cargo will be processed altogether (up to the `payload` limit). If the * `worker` is in progress, the task is queued until it becomes available. Once * the `worker` has completed some tasks, each callback of those tasks is * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) * for how `cargo` and `queue` work. * * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers * at a time, cargo passes an array of tasks to a single worker, repeating * when the worker is finished. * * @name cargo * @static * @memberOf module:ControlFlow * @method * @see [async.queue]{@link module:ControlFlow.queue} * @category Control Flow * @param {Function} worker - An asynchronous function for processing an array * of queued tasks, which must call its `callback(err)` argument when finished, * with an optional `err` argument. Invoked with `(tasks, callback)`. * @param {number} [payload=Infinity] - An optional `integer` for determining * how many tasks should be processed per round; if omitted, the default is * unlimited. * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can * attached as certain properties to listen for specific events during the * lifecycle of the cargo and inner queue. * @example * * // create a cargo object with payload 2 * var cargo = async.cargo(function(tasks, callback) { * for (var i=0; i<tasks.length; i++) { * console.log('hello ' + tasks[i].name); * } * callback(); * }, 2); * * // add some items * cargo.push({name: 'foo'}, function(err) { * console.log('finished processing foo'); * }); * cargo.push({name: 'bar'}, function(err) { * console.log('finished processing bar'); * }); * cargo.push({name: 'baz'}, function(err) { * console.log('finished processing baz'); * }); */ function cargo(worker, payload) { return (0, _queue2.default)(worker, 1, payload); } module.exports = exports['default'];
sap.ui.define(['sap/ui/webc/common/thirdparty/base/asset-registries/Icons'], function (Icons) { 'use strict'; const name = "heading2"; const pathData = "M0 400V80q0-16 16-16h8q16 0 16 16v144h176V80q0-16 16-16h8q6 0 11 4.5t5 11.5v320q0 7-5 11.5t-11 4.5h-8q-16 0-16-16V256H40v144q0 16-16 16h-8q-16 0-16-16zm341-126q5-7 9.5-13.5T360 249q7-5 14-9.5t14-8.5q9-3 19-5t22-2q26 0 44 9 20 8 29.5 26t9.5 38q0 15-5.5 27.5T492 349q-5 5-11.5 13T464 379l-63 69 111 1v31H352v-32l90-90q14-14 20-23 8-8 11-18 4-7 4-20 0-11-6-20.5T455 261q-11-2-17-3.5t-8-1.5q-20 0-34 8-13 9-27 29z"; const ltr = true; const collection = "SAP-icons"; const packageName = "@ui5/webcomponents-icons"; Icons.registerIcon(name, { pathData, ltr, collection, packageName }); var pathDataV5 = { pathData }; return pathDataV5; });
/** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import Color from 'color'; /** * Adjust a given token's lightness by a specified percentage * Example: token = hsl(10, 10, 10); * adjustLightness(token, 5) === hsl(10, 10, 15); * adjustLightness(token, -5) === hsl(10, 10, 5); * @param {string} token * @param {integer} shift The number of percentage points (positive or negative) by which to shift the lightness of a token. * @returns {string} */ export function adjustLightness(token, shift) { const original = Color(token).hsl().object(); return Color({ ...original, l: (original.l += shift) }) .round() .hex() .toLowerCase(); }
/** * globe.js library - visualizes individual data on an interactive globe * * Based on webgl-globe hosted at the time of this writing at * http://code.google.com/p/webgl-globe/ * * Copyright 2011 Data Arts Team, Google Creative Lab * Copyright 2013 Matthias Gazzari, Annemarie Mattmann, André Wolski * * 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. */ /** * position.js - Define an alterable position described in spherical * coordinates (radius, horizontal angle and vertical angle). * More detailed a target position can be set and iteratively * approximated dependend on predefined speeds. * Additionally the position can be changed by storing a third point * and moving relatively to it. * An error calculation observes the current relative error dependend on * the difference between the current position and the target position. */ var GLOBE = GLOBE || {}; GLOBE.Position = function(options) { // constants var INFINITY = Number.POSITIVE_INFINITY; var ZEROS = new THREE.Vector3(0, 0, 0); var ONES = new THREE.Vector3(1, 1, 1); var MIN = new THREE.Vector3(-INFINITY, -INFINITY, -INFINITY); var MAX = new THREE.Vector3(INFINITY, INFINITY, INFINITY); // position attributes var currentPos; // the current position var targetPos; // the target position var storedPos; // stored position of a former current position var lastTarget; // last stored target position // additional attributes var lowerLimit; // lower limit of the target position var upperLimit; // upper limit of the target position var weights; // the weights // error calculation var difference; // difference between target and current pos /** * Initialize the position object */ function init(obj) { options = options || {}; // set position attributes currentPos = options.currentPos || ZEROS.clone(); targetPos = options.targetPos || ZEROS.clone(); storedPos = currentPos.clone(); lastTarget = targetPos.clone(); // set limits and weights lowerLimit = options.lowerLimit || MIN.clone(); upperLimit = options.upperLimit || MAX.clone(); weights = options.weights || ONES.clone(); for (i = 0; i < 3; i++) { var component = weights.getComponent(i); if (component <= 0 || component > 1) { console.log("The " + i + "th element of initialWeights is not in the interval (0,1]"); weights = ONES.clone(); break; } } // set error difference = new THREE.Vector3(); // clamp target to upper and lower limits clampTarget(); updateDifference(); // make functions outside available obj.adjustTarget = adjustTarget; obj.store = store; obj.adjustTargetRelative = adjustTargetRelative; obj.doStep = doStep; obj.getError = getError; } /** * Return a zoom damp, damping a zoom movement (changing radius) */ function getZoomDamp() { return new THREE.Vector3(1, currentPos.x*currentPos.x, currentPos.x*currentPos.x); } /** * Clamp the target to the defined limits */ function clampTarget() { targetPos.clamp(lowerLimit, upperLimit); } /** * Adjust the target by adding a delta vector and clamp the result * to the upper and lower limits */ function adjustTarget(delta) { //console.log("delta", delta.x, delta.y, delta.z); var zoomDamp = getZoomDamp(); delta.multiply(zoomDamp); targetPos.add(delta); clampTarget(); updateDifference(); } /** * Store the latest target position and the given position (pos) to * be enabled to adjust the target relatively to the given position */ function store(pos) { lastTarget.copy(targetPos); storedPos.copy(pos); } /** * Adjust the target by adding a vector to the stored/last * target position (lastTarget). The vector is calculated by * subtracting the given position (pos) by the previously stored * position (storedPos). * Additionally the result is clamped to the upper and lower limits. */ function adjustTargetRelative(pos, damp) { var damp = damp || 1; var zoomDamp = getZoomDamp(); var vec = new THREE.Vector3(); vec.subVectors(pos, storedPos); vec.multiplyScalar(damp); vec.multiply(zoomDamp); targetPos.addVectors(lastTarget, vec); clampTarget(); updateDifference(); } /** * Increment the current position (make a transition) by adding * a fractional, defined by the weights, of the difference between * the target position and the current position */ function doStep() { //debugVector("currentPos", currentPos); //debugVector("targetPos", targetPos); //debugVector("difference", difference); var intermediate = new THREE.Vector3(); intermediate.multiplyVectors(difference, weights); currentPos.add(intermediate); updateDifference(); return currentPos; } /** * Calculate the relative error of current to target position */ function getError() { //debugVector("currentPos", currentPos); //debugVector("targetPos", targetPos); //debugVector("difference", difference); return difference.length() / (targetPos.length() || 1); } /** * Update the difference between target and current position */ function updateDifference() { difference.subVectors(targetPos, currentPos); } /** * Show a debug message for a vector */ function debugVector(name, vec) { console.log(name, vec.x, vec.y, vec.z, vec.length()); } // init position init(this); };
import React from 'react' import {Router, Route, hashHistory, IndexRoute} from 'react-router' import App from './App' import FreeBillManager from './modules/FreeBillManager/BillManager' import FreeBillProgress from './modules/FreeBillProgress/List' import CostPay from './modules/CostPay/List' import CostForm from './modules/CostForm/List' import CostDefine from './modules/CostDefine/List' import About from './modules/About' import Repos from './modules/Repos' import TestApi from './modules/TestApi' import Chart from './modules/Chart' export default React.createClass({ render() { return ( <Router history={hashHistory}> <Route path="/" component={App}> <IndexRoute component={FreeBillManager}/> <Route path="/repos" component={Repos}/> <Route path="/about" component={About}/> <Route path="/chart" component={Chart}/> <Route path="/testapi" component={TestApi}/> <Route path="/freebillm" component={FreeBillManager}/> <Route path="/costform" component={CostForm}/> <Route path="/costpay" component={CostPay}/> <Route path="/freebillp" component={FreeBillProgress}/> <Route path="/costdefine" component={CostDefine}/> </Route> </Router> ) } })
import fs from 'fs'; import path from 'path'; import { isLocalId, winningRev } from 'pouchdb-utils'; import levelup from 'levelup'; import { obj as through } from 'through2'; import LevelWriteStream from "level-write-stream"; var stores = [ 'document-store', 'by-sequence', 'attach-store', 'attach-binary-store' ]; function formatSeq(n) { return ('0000000000000000' + n).slice(-16); } var UPDATE_SEQ_KEY = '_local_last_update_seq'; var DOC_COUNT_KEY = '_local_doc_count'; var UUID_KEY = '_local_uuid'; var toSublevel = function (name, db, callback) { // local require to prevent crashing if leveldown isn't installed. var leveldown = require("leveldown"); var base = path.resolve(name); function move(store, index, cb) { var storePath = path.join(base, store); var opts; if (index === 3) { opts = { valueEncoding: 'binary' }; } else { opts = { valueEncoding: 'json' }; } var sub = db.sublevel(store, opts); var orig = levelup(storePath, opts); var from = orig.createReadStream(); var writeStream = new LevelWriteStream(sub); var to = writeStream(); from.on('end', function () { orig.close(function (err) { cb(err, storePath); }); }); from.pipe(to); } fs.unlink(base + '.uuid', function (err) { if (err) { return callback(); } var todo = 4; var done = []; stores.forEach(function (store, i) { move(store, i, function (err, storePath) { /* istanbul ignore if */ if (err) { return callback(err); } done.push(storePath); if (!(--todo)) { done.forEach(function (item) { leveldown.destroy(item, function () { if (++todo === done.length) { fs.rmdir(base, callback); } }); }); } }); }); }); }; var localAndMetaStores = function (db, stores, callback) { var batches = []; stores.bySeqStore.get(UUID_KEY, function (err, value) { if (err) { // no uuid key, so don't need to migrate; return callback(); } batches.push({ key: UUID_KEY, value: value, prefix: stores.metaStore, type: 'put', valueEncoding: 'json' }); batches.push({ key: UUID_KEY, prefix: stores.bySeqStore, type: 'del' }); stores.bySeqStore.get(DOC_COUNT_KEY, function (err, value) { if (value) { // if no doc count key, // just skip // we can live with this batches.push({ key: DOC_COUNT_KEY, value: value, prefix: stores.metaStore, type: 'put', valueEncoding: 'json' }); batches.push({ key: DOC_COUNT_KEY, prefix: stores.bySeqStore, type: 'del' }); } stores.bySeqStore.get(UPDATE_SEQ_KEY, function (err, value) { if (value) { // if no UPDATE_SEQ_KEY // just skip // we've gone to far to stop. batches.push({ key: UPDATE_SEQ_KEY, value: value, prefix: stores.metaStore, type: 'put', valueEncoding: 'json' }); batches.push({ key: UPDATE_SEQ_KEY, prefix: stores.bySeqStore, type: 'del' }); } var deletedSeqs = {}; stores.docStore.createReadStream({ startKey: '_', endKey: '_\xFF' }).pipe(through(function (ch, _, next) { if (!isLocalId(ch.key)) { return next(); } batches.push({ key: ch.key, prefix: stores.docStore, type: 'del' }); var winner = winningRev(ch.value); Object.keys(ch.value.rev_map).forEach(function (key) { if (key !== 'winner') { this.push(formatSeq(ch.value.rev_map[key])); } }, this); var winningSeq = ch.value.rev_map[winner]; stores.bySeqStore.get(formatSeq(winningSeq), function (err, value) { if (!err) { batches.push({ key: ch.key, value: value, prefix: stores.localStore, type: 'put', valueEncoding: 'json' }); } next(); }); })).pipe(through(function (seq, _, next) { /* istanbul ignore if */ if (deletedSeqs[seq]) { return next(); } deletedSeqs[seq] = true; stores.bySeqStore.get(seq, function (err, resp) { /* istanbul ignore if */ if (err || !isLocalId(resp._id)) { return next(); } batches.push({ key: seq, prefix: stores.bySeqStore, type: 'del' }); next(); }); }, function () { db.batch(batches, callback); })); }); }); }); }; export default { toSublevel: toSublevel, localAndMetaStores: localAndMetaStores };
var remote = require('remote'); var Menu = remote.require('menu'); var handlers = require('./mainMenuHandlers.js'); var topMenuTemplate = [{ label: 'File', submenu: [{ label: 'Save', accelerator: 'Command+S', click: function(){ handlers.openImages(); } }, { label: 'Save As' }, { label: 'Load' }] },{ label:'Images', submenu: [ {label: 'Load'} ] },{ label: 'View', submenu: [{ label: 'Reload', accelerator: 'Command+R', click: function() { remote.getCurrentWindow().reload(); } }, { label: 'Toggle DevTools', accelerator: 'Alt+Command+I', click: function() { remote.getCurrentWindow().toggleDevTools(); } }] }]; var contextMenuTemplate = [{ label: 'Window', submenu: [{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' }, { label: 'Close', accelerator: 'Command+W', selector: 'performClose:' }, { type: 'separator' }, { label: 'Bring All to Front', selector: 'arrangeInFront:' }] }]; var contextMenu = null; let contextCallbackSet = false; function configureContextMenuCallback(window) { if(contextCallbackSet){ return; } window.addEventListener('contextmenu', function (e) { e.preventDefault(); menuHandler.showContextMenu(); contextCallbackSet = true; }, false); } module.exports = { configureDefaults: function(window){ this.window = window; this.setTopMenu(topMenuTemplate); this.setContextMenu(contextMenuTemplate); configureContextMenuCallback(window); }, setTopMenu: function(topMenuTemplate){ var tt = Menu.buildFromTemplate(topMenuTemplate); Menu.setApplicationMenu(tt); }, setContextMenu: function(contextMenuTemplate){ contextMenu = Menu.buildFromTemplate(contextMenuTemplate); }, showContextMenu: function(){ contextMenu.popup(remote.getCurrentWindow()); } } /* module.exports = { contextMenu: [{ label: 'Window', submenu: [{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' }, { label: 'Close', accelerator: 'Command+W', selector: 'performClose:' }, { type: 'separator' }, { label: 'Bring All to Front', selector: 'arrangeInFront:' }] }], mainMenu: [{ label: 'Electron', submenu: [{ label: 'About Electron', selector: 'orderFrontStandardAboutPanel:' }, { type: 'separator' }, { label: 'Services', submenu: [] }, { type: 'separator' }, { label: 'Hide Electron', accelerator: 'Command+H', selector: 'hide:' }, { label: 'Hide Others', accelerator: 'Command+Shift+H', selector: 'hideOtherApplications:' }, { label: 'Show All', selector: 'unhideAllApplications:' }, { type: 'separator' }, { label: 'Quit', accelerator: 'Command+Q', selector: 'terminate:' }, ] }, { label: 'Edit', submenu: [{ label: 'Undo', accelerator: 'Command+Z', selector: 'undo:' }, { label: 'Redo', accelerator: 'Shift+Command+Z', selector: 'redo:' }, { type: 'separator' }, { label: 'Cut', accelerator: 'Command+X', selector: 'cut:' }, { label: 'Copy', accelerator: 'Command+C', selector: 'copy:' }, { label: 'Paste', accelerator: 'Command+V', selector: 'paste:' }, { label: 'Select All', accelerator: 'Command+A', selector: 'selectAll:' }] }, { label: 'View', submenu: [{ label: 'Reload', accelerator: 'Command+R', click: function() { remote.getCurrentWindow().reload(); } }, { label: 'Toggle DevTools', accelerator: 'Alt+Command+I', click: function() { remote.getCurrentWindow().toggleDevTools(); } }, ] }, { label: 'Window', submenu: [{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' }, { label: 'Close', accelerator: 'Command+W', selector: 'performClose:' }, { type: 'separator' }, { label: 'Bring All to Front', selector: 'arrangeInFront:' }] }, { label: 'Help', submenu: [] }] }*/
/*! * Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com) * Code licensed under the Apache License v2.0. * For details, see http://www.apache.org/licenses/LICENSE-2.0. */ // jQuery for page scrolling feature - requires jQuery Easing plugin $(function() { $('body').on('click', '.page-scroll a', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500, 'easeInOutExpo'); event.preventDefault(); }); }); // Floating label headings for the contact form $(function() { $("body").on("input propertychange", ".floating-label-form-group", function(e) { $(this).toggleClass("floating-label-form-group-with-value", !! $(e.target).val()); }).on("focus", ".floating-label-form-group", function() { $(this).addClass("floating-label-form-group-with-focus"); }).on("blur", ".floating-label-form-group", function() { $(this).removeClass("floating-label-form-group-with-focus"); }); }); // Highlight the top nav as scrolling occurs $('body').scrollspy({ target: '.navbar-fixed-top' }) // Closes the Responsive Menu on Menu Item Click $('.navbar-collapse ul li a').click(function() { $('.navbar-toggle:visible').click(); }); function setLanguagePl() { $.post('index.php',{ language: 'pl'}); } function setLanguageEn() { $.post('index.php',{ language: 'en'}); }
/* * Author: Yves Van Broekhoven & Simon Menke * Created at: 2012-07-05 * * Requirements: * - jQuery * - jQuery UI * - Chosen * * Version: 1.0.0 */ (function($) { $.fn.chosenOrder = function() { var $this = this.filter('.chzn-sortable[multiple]').first(), $chosen = $this.siblings('.chzn-container'); return $($chosen.find('.chzn-choices li[class!="search-field"]').map( function() { if (!this) { return undefined; } return $this.find('option:contains(' + $(this).text() + ')')[0]; })); }; /* * Extend jQuery */ $.fn.chosenSortable = function(){ var $this = this.filter('.chzn-sortable[multiple]'); $this.each(function(){ var $select = $(this); var $chosen = $select.siblings('.chzn-container'); // On mousedown of choice element, // we don't want to display the dropdown list $chosen.find('.chzn-choices').bind('mousedown', function(event){ if ($(event.target).is('span')) { event.stopPropagation(); } }); // Initialize jQuery UI Sortable $chosen.find('.chzn-choices').sortable({ 'placeholder' : 'ui-state-highlight', 'items' : 'li:not(.search-field)', //'update' : _update, 'tolerance' : 'pointer' }); // Intercept form submit & order the chosens $select.closest('form').on('submit', function(){ var $options = $select.chosenOrder(); $select.children().remove(); $select.append($options); }); }); }; }(jQuery));
var ViewManager = { views: [], mapper: {}, dispatcher: null, find: function(name) { var result = null; this.views.forEach(function(v) { if (v.name == name) result = v.view; }); return result; }, // get is an alias of find get: function(name) { return this.find(name); }, addView: function(name, view) { this.views.push({name: name, view: view}); }, showView: function(name, jso) { this.views.forEach(function(v) { if (v.name == name) { v.view.init(jso); v.view.visible(true); } else v.view.visible(false); }); }, doSwitch: function(map, type, jso) { var self = this; map.forEach(function(elem) { if (elem.type == type) self.showView(elem.name, jso); }); }, switchView: function(jso) { var rdf_type = jso.rdf_type.uri_string; if (rdf_type == LDP+'DirectContainer') { var membership_predicate = "ldp_isMemberOfRelation" in jso ? jso.ldp_isMemberOfRelation.uri_string : jso.ldp_hasMemberRelation.uri_string; this.doSwitch(this.mapper.containers, membership_predicate, jso); } else { this.doSwitch(this.mapper.types, rdf_type, jso); } return true; }, init: function(mapper, namespace, segment_ids, Dispatcher) { var self = this; function capitalize(s) { return s[0].toUpperCase() + s.slice(1); } function create_and_bind_viewmodels(map) { map.forEach(function(elem) { var vm_name = capitalize(elem.name) + 'ViewModel'; // use javascript reflection to get viewmodel object and create instance var vm = new window[namespace][vm_name](); ko.applyBindings(vm, document.getElementById('page-' + elem.name)); self.addView(elem.name, vm); }); } function get_resource_and_show_view(resource_url, history_tracker) { ld_util.get(resource_url, function(request){ if (request.status==200) { var jso = APPLICATION_ENVIRON.rdf_converter.make_simple_jso(request); if (ViewManager.switchView(jso)) { // resource accepted history_tracker.accept_url(); } else { // we cannot handle this resource history_tracker.decline_url(); } } else if (request.status==401) { window.name = resource_url; var resource_json = JSON.parse(request.responseText); window.location.href = resource_json['http://ibm.com/ce/ns#login-page']; } else { console.log( request.status ); } }); } // decide if this single-page-app claims a click on an element function claimClick(element) { // precondition: don't claim click with href of #xyz or '' var href = element.getAttribute('href'); if (!href || href === '' || href[0] == '#') return false; var segments = element.pathname.split('/'); var result = false; if (segments.length > 1) { segment_ids.forEach(function(segment_id) { if (segments[1] == segment_id) result = true; }); } return result; } this.mapper = mapper; var ns = window[namespace]; create_and_bind_viewmodels(mapper.containers); create_and_bind_viewmodels(mapper.types); /* var DispatcherFactory = (Dispatcher === undefined) ? misc_util.Dispatcher : Dispatcher; var my_dispatcher = new DispatcherFactory(claimClick, get_resource_and_show_view); my_dispatcher.hook_history_and_links(); */ } };
class ArticleController { /** * * @param $scope * @param Post * @param $stateParams * @param $sce * @ngInject */ constructor($scope, Post, $stateParams, $sce) { //ugly shit to make controllerAs work with ionic wtf ???!!??! $scope.vm = this; this.post = Post.get($stateParams.id); this.post.validContent = $sce.trustAsHtml(this.post.content.rendered); this.Post = Post; } } export { ArticleController };
function strWithName(str) { var arr = str.split(','); console.log("arr"); console.log(arr); var arrName = []; for (str in arr) { console.log(arr[str]) arrName.push(arr[str].split(':')[0]) } console.log("arrName"); console.log(arrName); return arrName; } module.exports = { strWithName: strWithName }
'use strict'; angular.module('raoweb').controller('loginCtrl', ['$scope', 'loginService', '$location', '$rootScope', function ($scope, loginService, $location, $rootScope) { $scope.msgtxt = ''; $scope.login = function (data) { $rootScope.asd = $scope; loginService.login(data, $rootScope.asd); }; }]);
// For iOS7 only, set the window's top to 20 so they start under the status bar. Alloy.Globals.windowTop = (OS_IOS && parseInt(Ti.Platform.version[0], 10) >= 7) ? 20 : 0; function doClick(e) { alert($.label.text); } $.index.open();
'use strict'; /* Controllers */ var app = angular.module('ng-dashboard.controllers.dry', []); app.controller('DryController', ['$scope', 'DryFactory', function ($scope, DryFactory) { DryFactory.query({}, function (data) { $scope.numberOfWarnings = data.numberOfWarnings; $scope.numberOfHighPriorityWarnings = data.numberOfHighPriorityWarnings; $scope.numberOfNormalPriorityWarnings = data.numberOfNormalPriorityWarnings; $scope.numberOfLowPriorityWarnings = data.numberOfLowPriorityWarnings; $scope.numberOfNewWarnings = data.numberOfNewWarnings - data.numberOfFixedWarnings; $scope.diffLow = data.numberOfNewLowPriorityWarnings; $scope.diffNormal = data.numberOfNewNormalPriorityWarnings; $scope.diffHigh = data.numberOfNewHighPriorityWarnings; setupDryChart(data); if((data.numberOfFixedWarnings - data.numberOfNewWarnings) > 0){ $scope.less = true; } else if((data.numberOfFixedWarnings - data.numberOfNewWarnings) < 0) { $scope.more = true; } else { $scope.same = true; } $scope.done = true; fn_computeSize(); }, function (error) { $scope.error = true; }) }]); function setupDryChart(data) { var chartData = [ { value: data.numberOfHighPriorityWarnings, color:"#d9534f" }, { value : data.numberOfNormalPriorityWarnings, color : "#f0ad4e" }, { value : data.numberOfLowPriorityWarnings, color : "#5bc0de" } ] var ctx = document.getElementById("dry-chart").getContext("2d"); var dryChart = new Chart(ctx).Doughnut(chartData); }