text
stringlengths
2
6.14k
const defaults = { 'debug': false, 'positionClass': 'toast-top-right', 'onclick': null, 'fadeIn': 300, 'fadeOut': 100, 'timeOut': 3000, 'extendedTimeOut': 1000 }; function showToaster(message) { // eslint-disable-line no-unused-vars toastr.options = defaults; // eslint-disable-line no-undef toastr.success(message); // eslint-disable-line no-undef }
/** * @author Greg Rozmarynowycz <greg@thunderlab.net> */ const MDT = require('../mallet/mallet.dependency-tree').MDT; const IOEvent = require('pulsar-lib').EventTypes.IOEvent; const MatchEvent = require('pulsar-lib').EventTypes.MatchEvent; module.exports = {clientFactory, resolve: ADT => [ ADT.network.Connection, ADT.ng.$rootScope, ADT.network.AsyncInitializer, MDT.Log, clientFactory]}; function clientFactory(Connection, $rootScope, AsyncInitializer, Log) { class Client extends AsyncInitializer { constructor() { super(); this.user = null; this.connection = Connection; const forward = this.forwardClientEvent.bind(this); [ // Forward Client Events IOEvent.joinedRoom, IOEvent.leftRoom, MatchEvent.matchStarted, MatchEvent.matchEnded, ].forEach(e => $rootScope.$on(e, forward)); } getUser() { return this.user; } emit(name, data) { this.connection.getSocket().get().emit(name, data); } forwardClientEvent(evt, args) { Log.out('client recieved evt ', evt.name); Log.out(args); if ((args.user && args.user === this.user) || args.clientEvent === true) { const e = new Event(evt.name); Object.assign(e, args); this.dispatchEvent(e); } } authenticate(credentials) { return Connection.authenticate(credentials).then((user) => { this.user = user; this.emit(IOEvent.joinServer); return user; }); } } return new Client(); }
/* * This file is part of MystudiesMyteaching application. * * MystudiesMyteaching application is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MystudiesMyteaching application 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MystudiesMyteaching application. If not, see <http://www.gnu.org/licenses/>. */ 'use strict'; angular.module('directives.addFreeText', ['services.freeTextContent', 'profileAnalytics']) .directive('addFreeTextContent', function (FreeTextContentService, FreeTextContentFactory, AnalyticsService) { return { restrict: 'E', replace: true, scope: {}, templateUrl: 'app/directives/freeTextContent/addFreeTextContent.html', link: function (scope) { scope.insertFreeTextContent = function () { var entry = FreeTextContentFactory.defaultFreeTextContent({}); AnalyticsService.trackEvent( AnalyticsService.ec.FREE_TEXT_CONTENT, AnalyticsService.ea.ADD ); FreeTextContentService .insertFreeTextContent(entry, {}); }; } }; });
function addhidden(hidname, hidvalue){ var newinput = document.createElement("input"); newinput.setAttribute("type", "hidden"); newinput.setAttribute("name", hidname); newinput.setAttribute("value", hidvalue); document.forms[0].appendChild(newinput); } function onload(){ // sendxhr("action=onloadxhraction"); new frmxform("default"); } var times=0; function sendxhr(data){ var rq = new XMLHttpRequest(); rq.open('POST','xhrindex.php', true); rq.onreadystatechange = function(aEvt){ if (rq.readyState == 4 && rq.status == 200) { if (rq.responseText != '') alert('getting response:('+ rq.responseText +')'); } //rq.responseText contiene la respuesta. } /* ------ METODO POST ------ Para los nuevos Firefox var data = new FormData(); data.append('Nombre','Domingo'); data.append('Apellidos', 'Melián Cárdenes'); ------ Para los antiguos */ times++; var post = encodeURI("sessionno=" + document.getElementsByName('sessionno')[0].value + "&installationid=" + document.getElementsByName('installationid')[0].value + "&sequenceno=" + document.getElementsByName('sequenceno')[0].value + "&times=" + times + "&" + data ); rq.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // rq.setRequestHeader("Content-length", post.length); // rq.setRequestHeader("Connection", "close"); rq.send(post); }
exports.lowercaseUrl = lowercaseUrl; exports.addTrailingSlash = addTrailingSlash; function lowercaseUrl(req, res, next) { var originalUrl = req.originalUrl; if (/[A-Z]/.test(originalUrl)) { var newUrl = originalUrl.toLowerCase(); console.log("301 to " + newUrl); //return res.send("redirect to " + newUrl); return res.redirect(301, newUrl); } else { console.log("No uppercase chars in " + originalUrl); return next(); } } function addTrailingSlash(req, res, next) { var originalUrl = req.originalUrl; console.log("addTrailingSlash for" + originalUrl); if (!originalUrl.endsWith("/")) { var newUrl = originalUrl + "/"; console.log("301 to " + newUrl); //return res.send("redirect to " + newUrl); return res.redirect(301, newUrl); } else { console.log("Already ends with '/' " + originalUrl); return next(); } }
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'docprops', 'gu', { bgColor: 'બૅકગ્રાઉન્ડ રંગ', bgFixed: 'સ્ક્રોલ ન થાય તેવું બૅકગ્રાઉન્ડ', bgImage: 'બૅકગ્રાઉન્ડ ચિત્ર URL', charset: 'કેરેક્ટર સેટ એન્કોડિંગ', charsetASCII: 'ASCII', charsetCE: 'મધ્ય યુરોપિઅન (Central European)', charsetCR: 'સિરીલિક (Cyrillic)', charsetCT: 'ચાઇનીઝ (Chinese Traditional Big5)', charsetGR: 'ગ્રીક (Greek)', charsetJP: 'જાપાનિઝ (Japanese)', charsetKR: 'કોરીયન (Korean)', charsetOther: 'અન્ય કેરેક્ટર સેટ એન્કોડિંગ', charsetTR: 'ટર્કિ (Turkish)', charsetUN: 'યૂનિકોડ (UTF-8)', charsetWE: 'પશ્ચિમ યુરોપિઅન (Western European)', chooseColor: 'વિકલ્પ', design: 'ડીસા', docTitle: 'પેજ મથાળું/ટાઇટલ', docType: 'ડૉક્યુમન્ટ પ્રકાર શીર્ષક', docTypeOther: 'અન્ય ડૉક્યુમન્ટ પ્રકાર શીર્ષક', label: 'ડૉક્યુમન્ટ ગુણ/પ્રૉપર્ટિઝ', margin: 'પેજ માર્જિન', marginBottom: 'નીચે', marginLeft: 'ડાબી', marginRight: 'જમણી', marginTop: 'ઉપર', meta: 'મેટાડૅટા', metaAuthor: 'લેખક', metaCopyright: 'કૉપિરાઇટ', metaDescription: 'ડૉક્યુમન્ટ વર્ણન', metaKeywords: 'ડૉક્યુમન્ટ ઇન્ડેક્સ સંકેતશબ્દ (અલ્પવિરામ (,) થી અલગ કરો)', other: '<other>', previewHtml: '<p>આ એક <strong>સેમ્પલ ટેક્ષ્ત્</strong> છે. તમે <a href="javascript:void(0)">CKEditor</a> વાપરો છો.</p>', title: 'ડૉક્યુમન્ટ ગુણ/પ્રૉપર્ટિઝ', txtColor: 'શબ્દનો રંગ', xhtmlDec: 'XHTML સૂચના સમાવિષ્ટ કરવી' } );
module.exports = function (grunt) { return { "nodeWithNativesTest": { command: "node --allow-natives-syntax <%=env.TEST_DIR%>/src/optimisation-test-runner.js", options: { stdout: true, stderr: true, failOnError: true, execOptions: { cwd: "<%=env.PROJECT_DIR%>" } } }, "projectz": { command: "projectz --path <%=env.PROJECT_DIR%> compile", options: { stdout: true, stderr: true, failOnError: true, execOptions: { cwd: "<%=env.PROJECT_DIR%>/node_modules/.bin" } } } }; };
var _n_b_link_possibility_matrix_8h = [ [ "NBLinkPossibilityMatrix", "dd/d0a/_n_b_link_possibility_matrix_8h.html#a7df6c20963bc86ad74fb32796ed1b831", null ] ];
/* eslint max-len: 0 */ import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let NumericBox3 = (props) => ( <SvgIcon {...props}> <path d="M15,10.5A1.5,1.5 0 0,1 13.5,12C14.34,12 15,12.67 15,13.5V15C15,16.11 14.11,17 13,17H9V15H13V13H11V11H13V9H9V7H13C14.11,7 15,7.89 15,9M19,3H5C3.91,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19C20.11,21 21,20.1 21,19V5A2,2 0 0,0 19,3Z" /> </SvgIcon> ); NumericBox3 = pure(NumericBox3); NumericBox3.displayName = 'NumericBox3'; export default NumericBox3;
'use strict'; /* eslint-env es6 */ const test = require('tap').test; const extend = require('lodash.assign'); const get_url_object = require('../modules/get_url_object'); test('get_url_object is a function', (assert) => { // Get typeof string const expected = get_url_object && {}.toString.call(get_url_object); assert.isEqual(expected, '[object Function]', 'get_url_object is a function'); assert.end(); }); // TODO: Test void 0 and '' filepath test('get_url_object returns values as expected', (assert) => { const options = { spaces: [ { space_path: 'nxdoc', space_name: 'Developer Documentation Center', }, { space_path: 'userdoc', space_name: 'Nuxeo Platform User Documentation', }, { space_path: 'admindoc', space_name: 'Nuxeo Installation and Administration', }, ], version_path: '', version_label: 'FT', default_space: 'main', }; const string_tests = [ { test: 'index.md', expected: { full: '/', original_filepath: 'index.md', new_filepath: 'index.md', key: { full: 'main/index', is_space_index: true, slug: 'index', space: 'main', space_path: '', version: '', }, }, }, { test: 'main-page.md', expected: { full: '/main-page/', original_filepath: 'main-page.md', new_filepath: 'main-page.md', key: { full: 'main/main-page', slug: 'main-page', space: 'main', space_path: '', version: '', }, }, }, { test: 'nxdoc/index.md', expected: { full: '/nxdoc/', original_filepath: 'nxdoc/index.md', new_filepath: 'nxdoc/index.md', key: { full: 'nxdoc/index', is_space_index: true, slug: 'index', space: 'nxdoc', space_name: 'Developer Documentation Center', space_path: 'nxdoc', version: '', }, }, }, { test: 'nxdoc/client-sdks.md', expected: { full: '/nxdoc/client-sdks/', original_filepath: 'nxdoc/client-sdks.md', new_filepath: 'nxdoc/client-sdks.md', key: { full: 'nxdoc/client-sdks', slug: 'client-sdks', space: 'nxdoc', space_name: 'Developer Documentation Center', space_path: 'nxdoc', version: '', }, }, }, { test: 'nxdoc/tutorials/pages/acls.md', expected: { full: '/nxdoc/acls/', original_filepath: 'nxdoc/tutorials/pages/acls.md', new_filepath: 'nxdoc/acls.md', key: { full: 'nxdoc/acls', slug: 'acls', space: 'nxdoc', space_name: 'Developer Documentation Center', space_path: 'nxdoc', version: '', }, }, }, { /* eslint no-invalid-this: 0 */ test: 'nxdoc/tutorials/pages/acls.md', message: `path "${this.test}" processed correctly with version`, expected: { full: '/nxdoc/710/acls/', original_filepath: 'nxdoc/tutorials/pages/acls.md', new_filepath: 'nxdoc/710/acls.md', key: { full: 'nxdoc/710/acls', slug: 'acls', space: 'nxdoc', space_name: 'Developer Documentation Center', space_path: 'nxdoc/710', version: '710', version_label: 'LTS 2015', }, }, options: extend({}, options, { version_path: '710', version_label: 'LTS 2015', }), }, ]; string_tests.forEach((string_test) => { const actual = get_url_object( string_test.test, string_test.options || options ); assert.deepEqual( actual, string_test.expected, string_test.message || `path "${string_test.test}" processed correctly` ); }); assert.end(); });
/** * Created by Drew Lemmy, 2016 * * This file is part of Krist. * * Krist is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Krist 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Krist. If not, see <http://www.gnu.org/licenses/>. * * For more project information, see <https://github.com/Lemmmy/Krist>. */ const addr = require("./../controllers/addresses.js"); module.exports = function(websockets) { /** * @api {ws} //ws:"type":"address" Get an address * @apiName WSGetAddress * @apiGroup WebsocketGroup * @apiVersion 2.0.4 * * @apiParam (WebsocketParameter) {Number} id * @apiParam (WebsocketParameter) {String="login"} type * @apiParam (WebsocketParameter) {String} address * * @apiUse Address */ websockets.addMessageHandler("address", function(ws, message) { return new Promise(function(resolve, reject) { addr.getAddress(message.address).then(function(address) { resolve({ ok: true, address: addr.addressToJSON(address) }); }).catch(reject); }); }); };
module.exports = { url : 'mongodb://sa:sa@ds036638.mongolab.com:36638/ticketresale' } /* //local test module.exports = { url : 'mongodb://localhost/ticketresale' } */
var should = require('should'); var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/weblogtests'); var user = require('../lib/user'); var schemas = require('../lib/schemas'); var User = mongoose.model('User', schemas.user); var hash = require('sha256'); describe('user', function() { describe('isValidKey', function() { var goodKey = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjsocgIBvqLS6lz+745qCT/E/GSpKPJ21Igxe6LYq55HhPqsIQ/mC0eFhTxZsctX5/Ze2vxlNd/sKD/pk/DUU3QBs6JbW91xqbr8jFuuTuo5rxOQ6wNrZ6aM7oVcz/yDk3a3FKkn0WO1mT9RoBnSMui4zjQmccf+IhJjXMNb4oycz4JfMQo41xe3P+ly/qI0ZKo/afPojMotc1i4saeXcczB679KgyIMh6fdSvq1PlqIpJWzrx2VxsZDYfY36kHQD9d4/DAMDBp/qChRNKG9T3iFsYGzb/X4WdFAt0CWHzXpnSfZAw9EXwWV31VzEmx5/Z+haIHwTiEx7T8pn8eRF/ hashbang@macbook.local'; var badKey = ' \n'; var goodCheck = user.isValidKey(goodKey); var badCheck = user.isValidKey(badKey); it('should return true if good key', function() { goodCheck.should.equal(true); }); it('should return false if bad key', function() { badCheck.should.equal(false); }); }); describe('isValidUsername', function() { var goodUsername = 'goodie123'; var tooShortUsername = 'a'; var tooLongUsername = 'abcdefghijklm'; var specialCharUsername = 'bad-123'; var goodCheck = user.isValidUsername(goodUsername); var shortCheck = user.isValidUsername(tooShortUsername); var longCheck = user.isValidUsername(tooLongUsername); var specialCheck = user.isValidUsername(specialCharUsername); it('should return true if /^[a-z0-9]{2,12}$/', function() { goodCheck.should.equal(true); }); it('should return false if too short', function() { shortCheck.should.equal(false); }); it('should return false if too long', function() { longCheck.should.equal(false); }); it('should return false if has special', function() { specialCheck.should.equal(false); }); }); describe('isValidPassword', function() { var goodPassword = 'secret password @!#'; var badPassword = ''; var goodCheck = user.isValidPassword(goodPassword); var badCheck = user.isValidPassword(badPassword); it('should return true if good', function() { goodCheck.should.equal(true); }); it('should return false if bad', function() { badCheck.should.equal(false); }); }); var newUser; describe('create', function() { var username = 'batman'; var key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjsocgIBvqLS6lz+745qCT/E/GSpKPJ21Igxe6LYq55HhPqsIQ/mC0eFhTxZsctX5/Ze2vxlNd/sKD/pk/DUU3QBs6JbW91xqbr8jFuuTuo5rxOQ6wNrZ6aM7oVcz/yDk3a3FKkn0WO1mT9RoBnSMui4zjQmccf+IhJjXMNb4oycz4JfMQo41xe3P+ly/qI0ZKo/afPojMotc1i4saeXcczB679KgyIMh6fdSvq1PlqIpJWzrx2VxsZDYfY36kHQD9d4/DAMDBp/qChRNKG9T3iFsYGzb/X4WdFAt0CWHzXpnSfZAw9EXwWV31VzEmx5/Z+haIHwTiEx7T8pn8eRF/ hashbang@macbook.local'; var invalidUsername = 'bat-mun'; var invalidKey = ' \n'; it('should create a user', function(done) { user.create({ username: username, key: key, onSave: function(){ done(); } }); }); it('should be found when queried', function() { User.findOne({username: username}, function(err, user){ newUser = user; should.exist(newUser); }); }); it('should err if existing', function(done) { user.create({ username: username, key: key, onUsernameTaken: function(){ done(); } }); }); it('should err if invalid username', function(done) { user.create({ username: invalidUsername, key: key, onBadUsername: function(){ done(); } }); }); it('should err if invalid key', function(done) { user.create({ username: username, key: invalidKey, onBadKey: function(){ done(); } }); }); }); describe('rekey', function(done) { it('should change the set publicKey', function() { var newKey = 'NEWKEY'; var existingUser = newUser; user.rekey({ user: existingUser, key: newKey, onSuccess: function(user){ user.publicKey.should.be.equal(newKey); } }); }); it('should err if missing user', function(done) { user.rekey({ key: 'NEWKEY', onError: function(msg){ done() } }); }); it('should err if missing key', function(done) { user.rekey({ user: newUser, onError: function(msg){ done() } }); }); it('should err if bad key', function(done) { user.rekey({ user: newUser, key: ' \n', onBadKey: function(msg){ done() } }); }); }); describe('password', function() { it('should change the set password', function() { var newPassword = 'SECRET SECRET'; var existingUser = newUser; user.password({ user: existingUser, password: newPassword, onSuccess: function(user){ user.hash.should.be.equal(hash(newPassword + user.salt)); } }); }); it('should err if bad password', function(done) { var existingUser = newUser; user.password({ user: existingUser, password: '', onBadPassword: function(){ done(); } }); }); it('should err if user unset', function(done) { var existingUser = newUser; user.password({ user: existingUser, password: '', onBadPassword: function(){ done(); } }); }); }); User.remove({}, function(){}); });
(function() { 'use strict'; angular .module('weatheropendataApp') .factory('errorHandlerInterceptor', errorHandlerInterceptor); errorHandlerInterceptor.$inject = ['$q', '$rootScope']; function errorHandlerInterceptor ($q, $rootScope) { var service = { responseError: responseError }; return service; function responseError (response) { if (!(response.status === 401 && (response.data === '' || (response.data.path && response.data.path.indexOf('/api/account') === 0 )))) { $rootScope.$emit('weatheropendataApp.httpError', response); } return $q.reject(response); } } })();
/*global $*/ var default_nodes = { "dhcp" : {"x": 20, "y": 20, "type": "dhcp", "start_ip": "", "end_ip": ""}, "internet" : {"x": 20, "y": 20, "type": "internet"}, "router": {"x": 20, "y": 20, "type": "router"}, "captive": {"x": 20, "y": 20, "type": "captive"}, "radius" : {"x": 20, "y": 20, "type": "radius", "password": ""}, "switch" : {"x": 20, "y": 20, "type": "switch"}, "wireless-link": {"x": 20, "y": 20, "type": "wireless-link", "tx-pow(dBm)": 1, "gain": 10, "sens": -70, "zone": ""}, "ap": {"x": 20, "y": 20, "type": "ap", "essid": "", "zone": "", "security": "", "password": ""}, "vap": {"x": 20, "y": 20, "type": "vap", "essid": "", "zone": "", "security": "", "password": ""}, "_aux_": {"x": 20, "y": 20, "type": "_aux_"} } function newNode(type){ /*var pattern_node_arr = default_nodes.filter (function (n){return n.type == type}); var pattern_node = pattern_node_arr[0];*/ var new_node = {}; $.extend(new_node, default_nodes[type]); return new_node; }
import React from 'react'; import './Input.css'; const Input = ({ type = 'text', inputRef = null, value = '', placeholder, onChange, children, className, ...props }) => { return ( <div className="Input__wrap"> {children && <label className={`Input__label`}>{children}</label>} <input type={type} ref={inputRef} className={`Input ${className}`} placeholder={placeholder} value={value} onChange={onChange} data-cy={props['data-cy'] || ''} aria-label={placeholder} tabIndex="0" /> </div> ); }; export default Input;
"use strict"; import Controller from 'gp-module-base/Controller'; import DomModel from 'gp-module-base/DomModel'; export default Controller.extend({ modelConstructor: DomModel.extend({ session: { checked: { type: 'boolean', required: true } } }), bindings: { 'model.checked': { type: 'booleanClass', name: 'js-checked' } }, events: { 'change input': onChange }, initialize: function() { Controller.prototype.initialize.apply(this, arguments); console.log('test'); } }); function onChange(e) { this.model.checked = e.target.checked; }
var OrderModel = require('./OrderModel'); function Order(order) { this.name = order.name; this.sex = order.sex; this.age = order.age; this.mobile = order.mobile; this.price = order.price; this.userId = order.userId; this.activityId = order.activityId; this.activityTitle = order.activityTitle; this.activityPic = order.activityPic; this.activityTime = order.activityTime; this.state = order.state; this.orderTime = order.orderTime; this.createTime = order.createTime; this.updateTime = order.updateTime; } module.exports = Order; Order.prototype.save = function(callback) { var order = { name: this.name, sex: this.sex, age: this.age, mobile: this.mobile, orderNo: new Date().getTime(), price: this.price, userId: this.userId, activityId: this.activityId, activityTitle: this.activityTitle, activityPic: this.activityPic, activityTime: this.activityTime, state: this.state, orderTime: new Date(), createTime: new Date(), updateTime: new Date() }; var newOrder = new OrderModel(order); newOrder.save(function (err, order) { if(err) { return callback(err); } callback(err, order); }); }; Order.getAll = function(skip, limit, callback) { OrderModel.count(function(err, count) { OrderModel.find({}, null, {skip: skip, limit: limit},function (err, orders) { if(err) { return callback(err); } callback(err, orders, count); }); }); }; Order.getByUserId = function(skip, limit, userId, callback) { OrderModel.count(function(err, count) { OrderModel.find({userId: userId}, null, {skip: skip, limit: limit},function (err, orders) { if(err) { return callback(err); } callback(err, orders, count); }); }); };
var express = require('express'); var app = express(); app.set('view engine', 'pug'); app.use(express.static('public')); app.get('/', function(req, res){ res.render('index', { title: 'Jobby'} ); }) app.get('/signup', function(req, res){ res.render('index', { title: 'Jobby - Signup' } ); }) app.get('/signin', function(req, res){ res.render('index', { title: 'Jobby - Signin '}); }) app.listen(3000, function(err){ if(err) return console.log('Hubo error!'), process.exit(1); console.log('Escuchando en el puerto 3000!'); })
/* eslint-disable react/prop-types */ // disable prop type validation since hocs consume different props then component import React from 'react'; import PropTypes from 'prop-types'; import { compose, onlyUpdateForKeys, withHandlers, setPropTypes } from 'recompose'; import { translate } from 'instances/i18n'; import { getAppItemUrl } from 'helpers/openApp'; import Analytics from 'instances/analytics'; const isAndroid = window.BrowserDetect.device === 'android'; const enhance = compose( onlyUpdateForKeys(['itemId']), setPropTypes({ itemId: PropTypes.string.isRequired, openItemInAndroid: PropTypes.func.isRequired, analytics: PropTypes.object.isRequired, }), withHandlers({ trackOpen: ({ analytics }) => () => Analytics.track('Open Native Client', analytics), }), ); function OpenInAppButton({ itemId, openItemInAndroid, trackOpen }) { const buttonText = translate('open_in_app'); if (isAndroid) { return ( <button onClick={() => { trackOpen(); openItemInAndroid(itemId); }} className={CSS.appStoreLink} > {buttonText} </button> ); } return ( <a href={getAppItemUrl(itemId)} target="_blank" className={CSS.appStoreLink} onClick={trackOpen} data-ignoreclickhandler > {buttonText} </a> ); } export default enhance(OpenInAppButton); // WEBPACK FOOTER // // ./src/js/app/modules/item/components/MobileStickySharing/OpenInAppButton.js
$(document).ready(() => { const href = window.location.href; const last = href.substr(href.lastIndexOf('/') + 1); if (last == '' || last == 'index') { loadImageSlider(); } else if (last == 'signup' || last == 'admin-signup') { // Validation and state population $(".error").hide(); $("#submit").on("click", validateEvent); $("#country").on("change", populateStates); } else if (last.startsWith("post")) { renderFullPost(); // Make our REST call to get similar posts getSimilars(); } // Event for when the login form gets submitted. $("#login-form").on("submit", (event) => { event.preventDefault(); $("#err").fadeOut().text(""); $.ajax({ method: "POST", url: '/api/login-form', dataType: "json", data: $('#login-form').serialize(), success: (data) => { if (!data.status || data.status == "Bad") { $("#err").fadeIn().text("Unknown email or incorrect password."); } else if (data.status == "OK"){ window.location.href = "/profile"; } else if (data.status == "Attempts") { $("#err").fadeIn().text("You've tried to use this too many times. Try again after 30 seconds."); } else { $("#err").fadeIn().text("This account is " + data.status + "."); } }, error: (err) => { console.log(err); } }); }); // Event for when reset password gets clicked. $("#reset-pass").on("click", (event) => { event.preventDefault(); $("#err").fadeOut().text(""); $.ajax({ method: "POST", url: '/api/reset-pass', dataType: "json", data: $('#login-form').serialize(), success: (data) => { if (data.status == "Bad") { $("#err").fadeIn().text("Unknown email or inactivated account."); } else if (data.status == "OK"){ $("#err").fadeIn().text("Check the email address for a new password."); } else if (data.status == "Attempts") { $("#err").fadeIn().text("You've tried to use this too many times. Try again after 30 seconds."); } }, error: (err) => { console.log(err); } }); }); // Admin function. $("#repopulate").on("click", (event) => { $.ajax({ method: "GET", url: '/api/repopulate', dataType: "json", data: {}, success: (data) => { if (data.status){ // Database is gone, reload window.location.href = "/"; } else { console.log("There was an error."); } }, error: (err) => { console.log(err); } }); }); });
'use strict'; module.exports = function(grunt) { // Configuración del proyecto grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), docco: { debug: { src: ['*.js', './api/models/*.js', './api/controllers/*.js', './test/*.js'], options: { output: 'docs/' } } } }); // Carga el plugin de grunt para hacer esto grunt.loadNpmTasks('grunt-docco'); // Tarea por omisión: generar la documentación grunt.registerTask('default', ['docco']); };
angular.module('sg.app.view.admin').controller('AdminController', function () { });
var mongoose = require('mongoose'); module.exports.init = function(app){ app.use(function(req, res, next){ next(); }); }
/** * Copyright Intermesh * * This file is part of Group-Office. You should have received a copy of the * Group-Office license along with Group-Office. See the file /LICENSE.TXT * * If you have questions write an e-mail to info@intermesh.nl * * @version $Id: Stores.js 22502 2017-08-30 08:33:43Z mschering $ * @copyright Copyright Intermesh * @author Michiel Schmidt <michiel@intermesh.nl> * @author Merijn Schering <mschering@intermesh.nl> */ GO.tickets.writableTypesStore = new GO.data.JsonStore({ url:GO.url('tickets/type/store'), baseParams:{ permissionLevel:GO.permissionLevels.write }, fields:['id','name','description','user_name','acl_id','permission_level','group_name','customfields'] }); GO.tickets.readableTypesStore = new Ext.data.GroupingStore({ url:GO.url("tickets/type/store"), /* The controller is sorting multiSortInfo: { sorters: [ { field: 'group_name', direction: "ASC" }, { field: 'name', direction: "ASC" } ], direction: 'ASC' }, sortInfo:{ field: 'name', direction: "ASC" },*/ id : 'id', reader: new Ext.data.JsonReader({ root: 'results', totalProperty: 'total', id: 'id', fields:['id','name','description','acl_id','checked','group_name'] }), baseParams:{ limit:0 // With this option all the types will be loaded without a limit. (Because the grid doesn't have pagination) }, groupField:'group_name', remoteSort:true, remoteGroup:true }) /* GO.tickets.readableTypesStore = new GO.data.JsonStore({ url:GO.url('tickets/type/store'), baseParams:{ limit:0 // With this option all the types will be loaded without a limit. (Because the grid doesn't have pagination) }, fields:['id','name','description','acl_id','checked'] });*/ GO.tickets.statusesStore = new GO.data.JsonStore({ url:GO.url('tickets/status/store'), fields:['id','name','checked','name_clean'], baseParams: { showTicketCount: true, showOpenClosed: true, sort: 'name' } }); GO.tickets.agentsStore = new GO.data.JsonStore({ url:GO.url('tickets/ticket/agents'), fields:['id','name'] }); GO.tickets.templatesStore = new GO.data.JsonStore({ url:GO.url("tickets/template/store"), fields:['id','name'] }); GO.tickets.ratesStore = new GO.data.JsonStore({ url : GO.url('tickets/rate/store'), fields:['id','name','amount','company_id','cost_code'], baseParams: { include_global_rates: true } }); GO.tickets.companyRatesStore = new GO.data.JsonStore({ url : GO.url('tickets/rate/store'), fields:['id','name','amount','cost_code'] });
var searchData= [ ['image',['Image',['../structutil_1_1_image.html',1,'util']]] ];
/* Copyright (C) 2017 Omri Abend, The Rachel and Selim Benin School of Computer Science and Engineering, The Hebrew University. */ (function () { 'use strict'; angular.module('zAdmin.pages.edit.sources') .service('editSourcesService', editSourcesService); /** @ngInject */ function editSourcesService(apiService, Core) { /*apiService.sources.getSourceTableData().then(function (res){ angular.copy(res.data.results, service.tableData); });*/ var service = { tableData:[], getEditTableStructure: function(){ return apiService.edit.sources.getEditSourceTableStructure().then(function (res){return res.data}); }, getSourceData: function(sourceId){ var _service = this; return apiService.edit.sources.getSourceData(sourceId).then(function (res){ _service.initData(res.data); return res.data }); }, saveSourceDetails: function(smartTableStructure){ var bodyData = Core.extractDataFromStructure(smartTableStructure); service.clearData(); return !bodyData.id ? apiService.edit.sources.postSourceData(bodyData).then(function (res){return res.data}) : apiService.edit.sources.putSourceData(bodyData).then(function (res){return res.data}); }, initData:function(data){ service.Data = data; }, get:function(key){ return this.Data[key]; }, clearData: function(){ service.Data = { id : "", name : "", text : "", created_by : "", created_at : "", updated_at : "", is_active : true }; } } return service; } })();
import gql from 'graphql-tag'; export const getTodayActivities = variables => ({ query: gql` query TodayActivities ($token: String!) { todayActivities( token: $token ) { id loggedAt description kind { id color description tags } } } `, variables, });
/*global Ext*/ //<debug> console.log(new Date().toLocaleTimeString() + ": Log: Load: WPAKT.view.core.toolbar.Username"); //</debug> Ext.define("WPAKT.view.core.toolbar.Username", { extend: "Ext.button.Button" , alias: "widget.coretoolbarusername" , text: "" , scale: "large" , cls: "top-user-name" , iconCls:"x-fa fa-user" });
/******************************************************************************* AToMPM - A Tool for Multi-Paradigm Modelling Copyright (c) 2011 Raphael Mannadiar (raphael.mannadiar@mail.mcgill.ca) This file is part of AToMPM. AToMPM is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. AToMPM 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with AToMPM. If not, see <http://www.gnu.org/licenses/>. *******************************************************************************/ var styleinfo = { 'diamond-black:arrowHead':10, 'arrow-black:arrowHead':8, 'triangle-white:arrowHead':10, 'diamond-white:arrowHead':10, 'circle-black:arrowHead':10, 'diamond-white-large:arrowHead':20, 'diamond-black-large:arrowHead':20, 'circle-white-large:arrowHead':20, 'arrow-empty-large:arrowHead':16, 'arrow-empty:arrowHead':8, 'triangle-black:arrowHead':8, 'triangle-black-large:arrowHead':20, 'circle-black-large:arrowHead':20, 'circle-white:arrowHead':10, 'arrow-black-large:arrowHead':16, 'triangle-white-large:arrowHead':20, 'diamond-black:arrowTail':10, 'arrow-black:arrowTail':8, 'triangle-white:arrowTail':10, 'diamond-white:arrowTail':10, 'circle-black:arrowTail':10, 'diamond-white-large:arrowTail':20, 'diamond-black-large:arrowTail':20, 'circle-white-large:arrowTail':20, 'arrow-empty-large:arrowTail':16, 'arrow-empty:arrowTail':8, 'triangle-black:arrowTail':8, 'triangle-black-large:arrowTail':20, 'circle-black-large:arrowTail':20, 'circle-white:arrowTail':10, 'arrow-black-large:arrowTail':16, 'triangle-white-large:arrowTail':20, }; var exports = exports || {}; exports['diamond-black:arrowHead'] = 10; exports['arrow-black:arrowHead'] = 8; exports['triangle-white:arrowHead'] = 10; exports['diamond-white:arrowHead'] = 10; exports['circle-black:arrowHead'] = 10; exports['diamond-white-large:arrowHead'] = 20; exports['diamond-black-large:arrowHead'] = 20; exports['circle-white-large:arrowHead'] = 20; exports['arrow-empty-large:arrowHead'] = 16; exports['arrow-empty:arrowHead'] = 8; exports['triangle-black:arrowHead'] = 8; exports['triangle-black-large:arrowHead'] = 20; exports['circle-black-large:arrowHead'] = 20; exports['circle-white:arrowHead'] = 10; exports['arrow-black-large:arrowHead'] = 16; exports['triangle-white-large:arrowHead'] = 20; exports['diamond-black:arrowTail'] = 10; exports['arrow-black:arrowTail'] = 8; exports['triangle-white:arrowTail'] = 10; exports['diamond-white:arrowTail'] = 10; exports['circle-black:arrowTail'] = 10; exports['diamond-white-large:arrowTail'] = 20; exports['diamond-black-large:arrowTail'] = 20; exports['circle-white-large:arrowTail'] = 20; exports['arrow-empty-large:arrowTail'] = 16; exports['arrow-empty:arrowTail'] = 8; exports['triangle-black:arrowTail'] = 8; exports['triangle-black-large:arrowTail'] = 20; exports['circle-black-large:arrowTail'] = 20; exports['circle-white:arrowTail'] = 10; exports['arrow-black-large:arrowTail'] = 16; exports['triangle-white-large:arrowTail'] = 20;
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. // http://docs.cksource.com/CKEditor_3.x/Developers_Guide // http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html config.enterMode = CKEDITOR.ENTER_BR; config.resize_enabled = false; //config.resize_maxHeight = 3000; //config.resize_maxWidth = 3000; //config.height = '300px'; //config.resize_dir = 'vertical'; // horizontal, vertical, both config.removePlugins = 'elementspath,save'; // config.removePlugins = 'elementspath,save,font'; config.removeDialogTabs = 'flash:advanced'; // config.removeDialogTabs = 'flash:advanced;image:Link'; config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // Prevent PHP Code to be formatted //config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea' //config.language = 'de'; //config.defaultLanguage = 'en'; //config.contentsLanguage = 'fr'; config.fullPage = false; // Not a full html page string, just part of it config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)'; //config.contentsCss = '/css/mysitestyles.css'; config.image_previewText=' '; config.toolbar_Full = [ ['Source','-','Save','NewPage','Preview','-','Templates'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'], '/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['BidiLtr', 'BidiRtl'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'], '/', ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Maximize', 'ShowBlocks','-','About'] ]; config.toolbar_dolibarr_mailings = [ ['Source','Maximize'], ['Cut','Copy','Paste','-','SpellChecker'], ['Undo','Redo','-','Find','Replace'], ['Font','FontSize'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_notes = [ ['Source'], ['Cut','Copy','Paste','-','SpellChecker'], ['Undo','Redo','-','Find','Replace'], ['Font','FontSize'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_details = [ ['Source','Maximize'], ['Cut','Copy','Paste','-','SpellChecker'], ['Font','FontSize'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['SpecialChar'] ]; // Used for mailing fields config.toolbar_dolibarr_readonly = [ ['Source','Maximize'], ['Find'] ]; };
/** * Copyright 2016-present Telldus Technologies AB. * * This file is part of the Telldus Live! app. * * Telldus Live! app is free : you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Telldus Live! app 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Telldus Live! app. If not, see <http://www.gnu.org/licenses/>. * */ // @flow 'use strict'; import { utils } from 'live-shared-data'; const { scheduleUtils } = utils; import isEqual from 'lodash/isEqual'; let dayjs = require('dayjs'); let utc = require('dayjs/plugin/utc'); let _timezone = require('dayjs/plugin/timezone'); dayjs.extend(utc); dayjs.extend(_timezone); import i18n from '../Translations/common'; import capitalize from './capitalize'; import { getSelectedDays, getWeekdays, getWeekends, getTranslatableDays, } from './getDays'; const getRepeatTime = (type: string, {intl}: Object): string => { let { formatMessage } = intl; if (type === 'sunrise') { return formatMessage(i18n.sunrise); } else if (type === 'sunset') { return formatMessage(i18n.sunset); } return formatMessage(i18n.time); }; const getRepeatDescription = ({ type, weekdays, intl, }: Object): string => { const { formatMessage, formatDate } = intl; const selectedDays: string[] = getSelectedDays(weekdays, formatDate); const repeatTime: string = (type === 'time') ? '' : getRepeatTime(type, { intl, }); const DAYS = getTranslatableDays(formatDate); let repeatDays: string = ''; if (selectedDays.length === DAYS.length) { repeatDays = formatMessage(i18n.repeatDays, { value: repeatTime }); } else if (isEqual(selectedDays, getWeekdays(formatDate))) { repeatDays = formatMessage(i18n.repeatWeekday, { value: repeatTime }); } else if (isEqual(selectedDays, getWeekends(formatDate))) { repeatDays = formatMessage(i18n.repeatWeekend, { value: repeatTime }); } else { for (let day of selectedDays) { repeatDays += `${day.slice(0, 3).toLowerCase()}, `; } repeatDays = capitalize(repeatDays.slice(0, -2)); } return repeatDays.trim(); }; const getTempDay = (job: Object, gateway: Object): Object => { const { timezone, sunrise, sunset } = gateway; let tempDay; if (job.type === 'sunrise') { const sunriseInMs = sunrise * 1000; const offsetInMs = job.offset * 60 * 1000; tempDay = dayjs(sunriseInMs + offsetInMs).tz(timezone); } else if (job.type === 'sunset') { const sunsetInMs = sunset * 1000; const offsetInMs = job.offset * 60 * 1000; tempDay = dayjs(sunsetInMs + offsetInMs).tz(timezone); } else { tempDay = dayjs(); tempDay = tempDay.hour(job.hour); tempDay = tempDay.minute(job.minute); } return tempDay; }; module.exports = { ...scheduleUtils, getRepeatTime, getRepeatDescription, getTempDay, };
'use strict'; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } const telegram = appRequire('plugins/telegram/index').telegram; const knex = appRequire('init/knex').knex; const log4js = require('log4js'); const logger = log4js.getLogger('telegram'); const setManager = (() => { var _ref = _asyncToGenerator(function* (message) { try { const manager = yield knex('telegram').select(['value']).where({ key: 'manager' }); if (manager.length === 0) { yield knex('telegram').insert({ key: 'manager', value: message.message.from.id }); telegram.emit('send', message, 'Authorize success.'); } else if (+manager[0].value === message.message.from.id) { telegram.emit('send', message, 'This user is already a manager.'); } else { telegram.emit('send', message, 'Authorize fail.'); } return; } catch (err) { logger.error(err); return Promise.reject(err); } }); return function setManager(_x) { return _ref.apply(this, arguments); }; })(); const isManager = (() => { var _ref2 = _asyncToGenerator(function* (message) { try { const manager = yield knex('telegram').select(['value']).where({ key: 'manager' }); if (manager.length === 0) { telegram.emit('send', message, 'Send \'auth\' to become manager.'); } else if (manager.length > 0 && manager[0].value === message.message.from.id + '') { telegram.emit('manager', message); } } catch (err) { logger.error(err); return Promise.reject(err); } }); return function isManager(_x2) { return _ref2.apply(this, arguments); }; })(); telegram.on('message', message => { if (message.message.text === 'auth') { setManager(message); } else { isManager(message); } });
QUnit.module('execute'); QUnit.test("Object deletion", function(assert) { assert.ok(true, "this test is fine"); }); QUnit.test("Object creation", function(assert) { assert.ok(true, "this test is fine"); });
function disable_futile_labels() { $('label').each(function () { var label = $(this); label.toggleClass('for_disabled', ! (label.nextAll('input:enabled, select:enabled').length > 0)); }); } function enable_table_sorting(table, alter_url) { var sort_headings = table.find('th.sortable'); var table_body = table.find('tbody').first(); var last_sorted_by = null; var sort_direction = -1; var apply_sort_column = (function (sort_key) { var arr = []; var i; last_sorted_by = sort_key; table_body.children('tr').each(function () { arr.push({row: this, value: $(this).data('sortinfo')[sort_key]}); }); arr.sort(function (a, b) { if (a.value === b.value) { return 0; } if (a.value === null && b.value !== null) { return 1; } if (b.value === null && a.value !== null) { return -1; } return (sort_direction * (a.value < b.value ? -1 : 1)); }); for (i in arr) { table_body.append($(arr[i].row).detach()); } sort_direction = - sort_direction; sort_headings.removeClass('sorted_asc').addClass('sortable'); sort_headings.removeClass('sorted_desc').addClass('sortable'); sort_headings.each(function () { var heading = $(this); if (heading.data('sortkey') === sort_key) { heading.removeClass('sortable').addClass((sort_direction < 0 ) ? 'sorted_asc' : 'sorted_desc'); } }); }); var enable_sort_column = (function (heading) { var sort_key = heading.data('sortkey'); var default_sort_order = 1; var sort_total = false; if (heading.hasClass('sortreverse')) { default_sort_order = -1; } if (heading.hasClass('sortedalready')) { last_sorted_by = sort_key; } if (heading.hasClass('sorttotal')) { sort_total = true; } heading.click(function () { if (sort_key !== last_sorted_by) { sort_direction = default_sort_order; } apply_sort_column(sort_key); if (alter_url) { var params = new URLSearchParams(); if (! sort_total) { var prevparams = new URLSearchParams(window.location.search); prevparams.forEach(function (value, key) { if (value !== sort_key) { params.append(key, value); } }); } params.append((sort_direction < 0 ? 'sortasc' : 'sortdesc'), sort_key); window.history.replaceState( null, 'Sort by ' + sort_key + (sort_direction < 0 ? ' ascending' : ' descending)'), window.location.pathname + '?' + params.toString()); } }); }); sort_headings.each(function () { enable_sort_column($(this)); }); if (alter_url) { var params = new URLSearchParams(window.location.search); params.forEach(function (value, key) { if (key === 'sortasc') { sort_direction = 1; apply_sort_column(value); } else if (key === 'sortdesc') { sort_direction = -1; apply_sort_column(value); } }); } } function enable_table_col_sorting(table) { var sort_headings = table.find('th.col_sortable'); var last_sorted_by = null; var sort_direction = -1; var enable_sort_column = (function (heading) { var sort_key = heading.data('col_sortkey'); var default_sort_order = 1; if (heading.hasClass('col_sortreverse')) { default_sort_order = -1; } if (heading.hasClass('col_sortedalready')) { last_sorted_by = sort_key; } heading.click(function () { if (sort_key !== last_sorted_by) { last_sorted_by = sort_key; sort_direction = default_sort_order; } var arr = []; var unsorted = []; var i = 0; table.find('tr').first().children().each(function (i) { var col = $(this); var sort_info = col.data('col_sortinfo'); if (sort_info !== undefined) { arr.push({col: i, value: sort_info[sort_key]}); } else if (arr.length == 0) { unsorted.push(i); } }); arr.sort(function (a, b) { if (a.value === b.value) { return 0; } if (a.value === null && b.value !== null) { return 1; } if (b.value === null && a.value !== null) { return -1; } return (sort_direction * (a.value < b.value ? -1 : 1)); }); table.find('tr').each(function () { var row = $(this); var cells = row.children(); var sorted = []; for (i in unsorted) { sorted.push(cells.eq(unsorted[i]).detach()); } for (i in arr) { sorted.push(cells.eq(arr[i].col).detach()); } row.prepend(sorted); }); sort_direction = - sort_direction; sort_headings.removeClass('col_sorted_asc').addClass('col_sortable'); sort_headings.removeClass('col_sorted_desc').addClass('col_sortable'); heading.removeClass('col_sortable').addClass((sort_direction < 0 ) ? 'col_sorted_asc' : 'col_sorted_desc'); }); }); sort_headings.each(function () { enable_sort_column($(this)); }); }
Ext.define('MusicTube.util.Link', { extend: 'Ext.Component', id: 'linkUtil', /** * 新規windowで開く */ openWindow: function(target) { var a = document.createElement("a"); a.href = target; a.setAttribute("target", "_blank"); document.body.appendChild(a); var e = document.createEvent("MouseEvents"); e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); a.dispatchEvent(e); document.body.removeChild(a); } }); Ext.create('MusicTube.util.Link');
/** 订单列表 **/ var OrderRow = React.createClass({ getInitialState: function() { return {value: 'Hello!'}; }, componentDidMount: function() { asyn_img(); }, render: function() { var divStyle1 = {'textAlign':'left',width:'60%',float:'left'}; var divStyle2 = {'textAlign':'right',width:'40%',float:'right'}; var img_url="resources/images/empty.jpg"; img_url="product-img-"+this.props.data.orderProduct.productId+".action"; var product_url="ajax/order-"+this.props.data.id+".html"; return (<tr> <td> <img src="resources/images/empty.jpg" className="product-img" value={img_url} alt="产品图片"></img> </td> <td> <ul className="list-unstyled"> <li> <a className="ajax-link" href={product_url} data={this.props.data.id}>{this.props.data.orderProduct.title}</a> </li> <li> <small> {this.props.data.orderProduct.attr_value} </small> </li> <li> <div style={divStyle1}> <s>¥{this.props.data.orderProduct.price_normal}</s>&nbsp; <span className="product-price"> ¥{this.props.data.price}</span> </div> <div style={divStyle2}> <span className="label label-primary">{this.formatOrderStatus( this.props.data.orderStatus )}</span> </div> </li> </ul> </td> </tr>); }, formatOrderStatus:function(status){ var msg=''; if(status=='cancel'){ msg='过期取消'; }else if(status=='nopay'){ msg='未支付'; }else if(status=='pay'){ msg='支付完成'; }else if(status=='packonline'){ msg='已发货'; }else if(status=='packarrive'){ msg='签收'; }else if(status=='reqback'){ msg='退货/退款'; }else if(status=='backdone'){ msg='退货完成'; }else if(status=='backcancel'){ msg='退货取消'; }else if(status=='confirmdeal'){ msg='确认收货'; }else if(status=='dealdone'){ msg='交易完成'; } return msg; } }); var OrdersTable = React.createClass({ getInitialState: function() { return { status:0, page:1, limit:15, rows:[] }; }, componentWillReceiveProps: function(nextProps) { if (nextProps.status != this.props.status) { this.loadData(1,this.state.limit,nextProps.status); } }, componentDidMount: function() { this.loadData(1,this.state.limit,0); var me=this; var tabs=$(React.findDOMNode(this.refs.myTab)).children('li'); tabs.click(function(v){ tabs.removeClass('active'); $(this).addClass("active"); me.setState({status:$(this).attr('data')}); me.loadData(1,me.state.limit,me.state.status); }); }, loadData: function(page,limit,status) { $.get('orders.json', { page: page, limit: limit,status:status } ).done(function(data) { console.log("Received data"); if(page > 1){ this.setState({ rows: this.state.rows.concat(data.rows) , count: data.count }); }else{ this.setState({ rows: data.rows , count: data.count }); } if(data.rows.length==limit){ $('.pager-more').show(); }else{ $('.pager-more').hide(); } }.bind(this)) .fail(function(error, a, b) { console.log("Error loading JSON"); }); }, handler_click_more:function(event){ this.loadData(this.state.page+1,this.state.limit,this.state.status); this.setState({page:this.state.page+1}); }, render: function() { var rows = []; this.state.rows.forEach(function(item) { rows.push(<OrderRow data={item} />); }); return ( <div> <div className="row"> <div className="col-xs-12"> <ul ref="myTab" className="nav nav-pills" role="tablist"> <li role="presentation" className="active" data="0"><a href="#" role="tab">未完成</a></li> <li role="presentation" className="" data="9"><a href="#" role="tab" >完成</a></li> <li role="presentation" className="" data="100"><a href="#" role="tab" >全部</a></li> </ul> </div> </div> <div className="row"> <div className="col-xs-12 fit-size"> <table className="products-table"> {rows} <tfoot> <tr > <td colSpan="2" className="pager-more"><a href="#" onClick={this.handler_click_more}>点击加载更多</a></td> </tr> </tfoot> </table> </div> </div> </div> ); } }); React.render(<OrdersTable />, document.getElementById("orders_placehold"));
'use strict'; var async = require('async'); var nconf = require('nconf'); var validator = require('validator'); var db = require('./../database'); var meta = require('../meta'); var emailer = require('../emailer'); var translator = require('../translator'); var utils = require('../utils'); module.exports = function (User) { User.getInvites = function (uid, callback) { async.waterfall([ function (next) { db.getSetMembers('invitation:uid:' + uid, next); }, function (emails, next) { emails = emails.map(function (email) { return validator.escape(String(email)); }); next(null, emails); }, ], callback); }; User.getInvitesNumber = function (uid, callback) { db.setCount('invitation:uid:' + uid, callback); }; User.getInvitingUsers = function (callback) { db.getSetMembers('invitation:uids', callback); }; User.getAllInvites = function (callback) { var uids; async.waterfall([ User.getInvitingUsers, function (_uids, next) { uids = _uids; async.map(uids, User.getInvites, next); }, function (invitations, next) { invitations = invitations.map(function (invites, index) { return { uid: uids[index], invitations: invites, }; }); next(null, invitations); }, ], callback); }; User.sendInvitationEmail = function (uid, email, callback) { callback = callback || function () {}; var token = utils.generateUUID(); var registerLink = nconf.get('url') + '/register?token=' + token + '&email=' + encodeURIComponent(email); var expireIn = (parseInt(meta.config.inviteExpiration, 10) || 1) * 86400000; async.waterfall([ function (next) { User.getUidByEmail(email, next); }, function (exists, next) { if (exists) { return next(new Error('[[error:email-taken]]')); } db.setAdd('invitation:uid:' + uid, email, next); }, function (next) { db.setAdd('invitation:uids', uid, next); }, function (next) { db.set('invitation:email:' + email, token, next); }, function (next) { db.pexpireAt('invitation:email:' + email, Date.now() + expireIn, next); }, function (next) { User.getUserField(uid, 'username', next); }, function (username, next) { var title = meta.config.title || meta.config.browserTitle || 'NodeBB'; translator.translate('[[email:invite, ' + title + ']]', meta.config.defaultLang, function (subject) { var data = { site_title: title, registerLink: registerLink, subject: subject, username: username, template: 'invitation', }; // Append default data to this email payload data = Object.assign({}, emailer._defaultPayload, data); emailer.sendToEmail('invitation', email, meta.config.defaultLang, data, next); }); }, ], callback); }; User.verifyInvitation = function (query, callback) { if (!query.token || !query.email) { return callback(new Error('[[error:invalid-data]]')); } async.waterfall([ function (next) { db.get('invitation:email:' + query.email, next); }, function (token, next) { if (!token || token !== query.token) { return next(new Error('[[error:invalid-token]]')); } next(); }, ], callback); }; User.deleteInvitation = function (invitedBy, email, callback) { callback = callback || function () {}; async.waterfall([ function getInvitedByUid(next) { User.getUidByUsername(invitedBy, next); }, function deleteRegistries(invitedByUid, next) { if (!invitedByUid) { return next(new Error('[[error:invalid-username]]')); } async.parallel([ function (next) { deleteFromReferenceList(invitedByUid, email, next); }, function (next) { db.delete('invitation:email:' + email, next); }, ], function (err) { next(err); }); }, ], callback); }; User.deleteInvitationKey = function (email, callback) { callback = callback || function () {}; async.waterfall([ function (next) { User.getInvitingUsers(next); }, function (uids, next) { async.each(uids, function (uid, next) { deleteFromReferenceList(uid, email, next); }, next); }, function (next) { db.delete('invitation:email:' + email, next); }, ], callback); }; function deleteFromReferenceList(uid, email, callback) { async.waterfall([ function (next) { db.setRemove('invitation:uid:' + uid, email, next); }, function (next) { db.setCount('invitation:uid:' + uid, next); }, function (count, next) { if (count === 0) { return db.setRemove('invitation:uids', uid, next); } setImmediate(next); }, ], callback); } };
/* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang("uicolor","zh-cn",{title:"用户界面颜色选择器",options:"颜色选项",highlight:"高亮",selected:"已选颜色",predefined:"预定义颜色集",config:"粘贴此字符串到您的 config.js 文件"});
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'selectall', 'sr-latn', { toolbar: 'Označi sve' } );
var Bookshelf = require('bookshelf').DB; var Packet = require('./Packet').model , Subject = require('./Subject').model; exports.model = Bookshelf.Model.extend({ tableName: "Tossups", packet: function() { return this.belongsTo(Packet, "PacketId"); }, subject: function() { return this.belongsTo(Subject, "SubjectId"); } }); exports.collection = Bookshelf.Collection.extend({ model: exports.model });
import React from 'react'; import Snackbar from 'material-ui/Snackbar'; import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert'; import IconMenu from 'material-ui/IconMenu'; import RaisedButton from 'material-ui/RaisedButton'; import Paper from 'material-ui/Paper'; import Menu from 'material-ui/Menu'; import MenuItem from 'material-ui/MenuItem'; import AppBar from 'material-ui/AppBar'; import Divider from 'material-ui/Divider'; import TextField from 'material-ui/TextField'; import SelectField from 'material-ui/SelectField'; import {Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn} from 'material-ui/Table'; import {List, Drawer, ListItem, Dialog, FlatButton} from 'material-ui'; import {deepOrange500} from 'material-ui/styles/colors' import IconButton from 'material-ui/IconButton'; import ActionDeleteForever from 'material-ui/svg-icons/action/delete'; import ActionsSettingsApplications from 'material-ui/svg-icons/action/settings-applications'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import ContentAdd from 'material-ui/svg-icons/content/add'; import CreatePaymentForm from './create_payment'; import ShowPaymentsForm from './show_detailed_payments'; const showCheckB = false; import {grey400, grey900, blueGrey50, darkBlack, lightBlack, blue50, cyan200, blue900} from 'material-ui/styles/colors'; const divTableStyle = { padding:'5%', background:blue50 }; const headerTableStyle = { color:blue900, textAlign:'center' }; const columnTableStyle ={textAlign:'center'}; class Show_Payments extends React.Component { constructor(props){ super(props); this.state = {open: false, addOpen: false} this.handleClick = this.handleClick.bind(this); this.componentWillMount = this.componentWillMount.bind(this); this.handleAddOpen = this.handleAddOpen.bind(this); this.update = this.update.bind(this); this.handleShowPayments = this.handleShowPayments.bind(this); this.iconButtonElement = ( <IconButton touch={true} tooltip="more" tooltipPosition="bottom-left"> <MoreVertIcon color={grey400} /></IconButton> ); } update(){ this.forceUpdate(); } handleAddOpen() { this.setState({addOpen: true}); this.refs['create_payment'].setState({cedula: -1}); this.refs['create_payment'].handleAddOpen(); } componentWillMount() { } handleShowPayments() { } handleClick(){ return true; } render() { /* console.log("render mostrar pagos");*/ let guests = this.props.guests; let payments = this.props.payments; let guest_payment = new Array(); for(let i = 0; i < guests.length; i++) { guest_payment[guests[i].cedula] = 0; } for(let i = 0; i < guests.length; i++) { for(let j = 0; j < payments.length; j++) { if (guests[i]["cedula"]=== payments[j]["cedula"]) { if (payments[j].pagado === false) { guest_payment[guests[i].cedula] += payments[j].valor; } } } }; const actions = [ <FlatButton label="Cancelar" primary={true} onTouchTap={null} />, <FlatButton label="Aceptar" primary={true} onTouchTap={null} />, ]; return ( <div> <CreatePaymentForm ref="create_payment" guests={this.props.guests} payments={this.props.payments} update={this.update}/> <div style={divTableStyle}> <Table onRowSelection={this.onRowSelection}> <TableHeader> <TableRow> <TableHeaderColumn colSpan="1" style={{textAlign: 'center'}}> <span style={{color: darkBlack}}><h2>Pagos</h2></span> </TableHeaderColumn> <TableHeaderColumn colSpan="1" tooltip="Agregar Pago" style={{textAlign: 'center'}}> <span ><FloatingActionButton mini={true} onTouchTap={this.handleAddOpen}> <ContentAdd /> </FloatingActionButton> </span> </TableHeaderColumn> </TableRow> <TableRow> <TableHeaderColumn >Cliente</TableHeaderColumn> <TableHeaderColumn >Identificacion</TableHeaderColumn> <TableHeaderColumn >Pagos a realizar</TableHeaderColumn> <TableHeaderColumn >Mostrar desglose de Pagos</TableHeaderColumn> </TableRow> </TableHeader> <TableBody> {this.props.guests.map(function (guest,i) { return ( <TableRow key={i}> <TableRowColumn key={i}>{guest.nombre}</TableRowColumn> <TableRowColumn key={i} >{guest.cedula}</TableRowColumn> <TableRowColumn key={i} >{guest_payment[guest.cedula]}</TableRowColumn> <TableRowColumn><span> <ShowPaymentsForm payments ={this.props.payments} cedula = {guest["cedula"]} nombre_guest ={guest["nombre"]} /> </span></TableRowColumn> </TableRow> ); },this)} </TableBody> </Table> </div> <Snackbar open={false} message={null} autoHideDuration={1500} onRequestClose={null} /> </div> ); } }; export default Show_Payments;
"use strict"; var ComponentsService = (function () { function ComponentsService() { this.body = { title: '', content: '' }; } ComponentsService.setBody = function (i) { if (null == i || !(i >= 0)) { this.instance.body = { title: '', content: '' }; return; } this.instance.body = { title: ((null != componentsData()[i][0]) ? componentsData()[i][0] : ''), content: ((null != componentsData()[i][1]) ? componentsData()[i][1] : '') }; }; ComponentsService.getInstance = function () { return this.instance; }; return ComponentsService; }()); ComponentsService.instance = new ComponentsService(); exports.ComponentsService = ComponentsService; //# sourceMappingURL=components.service.js.map
function Folder(folder_data) { this.name = folder_data.name; this.date = folder_data.date; this.title = folder_data.title; this.description = folder_data.description; this._id = folder_data._id; } Folder.prototype._id = null; Folder.prototype.name = null; Folder.prototype.date = null; Folder.prototype.title = null; Folder.prototype.description = null; Folder.prototype.GetJson = function () { return { id: this._id, name: this.name, date: this.date, title: this.title, description: this.description }; };
#!/usr/bin/env node /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var shell = require('shelljs'), path = require('path'), ROOT = path.join(__dirname, '..', '..'); /* * Cleans the project using ant */ module.exports.run = function () { var cmd = 'ant clean -f ' + path.join(ROOT, 'build.xml'); var result = shell.exec(cmd, {silent: false, async: false}); if (result.code > 0) { console.error('ERROR: Failed to clean android project.'); console.error(result.output); process.exit(2); } } module.exports.help = function () { console.log('Usage: ' + path.relative(process.cwd(), process.argv[1])); console.log('Cleans the project directory.'); process.exit(0); }
import testId from 'api/routes/tests/utils/testId'; import chai, { expect } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import setup from 'api/routes/tests/utils/setup'; import * as routes from 'lib/constants/routes'; import createOrgToken from 'api/routes/tests/utils/tokens/createOrgToken'; import getPersonaService from 'lib/connections/personaService'; chai.use(chaiAsPromised); describe('personaController deletePersona', () => { const apiApp = setup(); let token; const personaService = getPersonaService(); beforeEach(async () => { await personaService.clearService(); token = await createOrgToken(); }); after(async () => { await personaService.clearService(); }); it('should delete a persona', async () => { const { persona } = await personaService.createPersona({ organisation: testId, name: 'Dave' }); await apiApp.delete(routes.PERSONA_ID.replace(/:personaId/, persona.id)) .set('Authorization', `Bearer ${token}`) .expect(200); const getPersona = personaService.getPersona({ organisation: testId, personaId: persona.id }); return expect(getPersona).to.eventually.be.rejected; }); });
"use strict"; exports.data = [ { test: "Test" } ];
Ext.namespace('Portal.cart'); Portal.cart.BaseInjector = Ext.extend(Object, { constructor: function(config) { Portal.cart.BaseInjector.superclass.constructor.call(this, Ext.apply(this, config)); }, getInjectionJson: function(dataCollection) { return { uuid: dataCollection.getUuid(), title: dataCollection.getTitle(), dataFilters: this._getDataFilterEntry(dataCollection), linkedFiles: this._getMetadataLinks(dataCollection), pointOfTruthLink: this._getPointOfTruthLink(dataCollection), downloadStatus: dataCollection.downloadStatus }; }, _getMetadataLinks: function(dataCollection) { return dataCollection.getLinksByProtocol(Portal.app.appConfig.portal.metadataProtocols.dataFile); }, _getDataFilterEntry: function(dataCollection) { return ""; }, _getPointOfTruthLink: function(dataCollection) { return dataCollection.getLinksByProtocol(Portal.app.appConfig.portal.metadataProtocols.metadataRecord); }, _hideButton: function(uuid) { var elementId = OpenLayers.i18n('downloadButtonId', {id: uuid}); if (Ext.get(elementId)) { Ext.fly(elementId).update(""); } }, downloadWithConfirmation: function(dataCollection, generateUrlCallback, params) { return function() { this.downloadConfirmation.call( this.downloadConfirmationScope, dataCollection, this, generateUrlCallback, params ); }; } });
import { Meteor } from "meteor/meteor"; import { Roles } from "meteor/alanning:roles"; import { Accounts, Shops, SellerShops } from "/lib/collections"; // Export Reaction using commonJS style for common libraries to use Reaction easily // https://docs.meteor.com/packages/modules.html#CommonJS let Core; // TODO: Decide how we want to approach this problem - duplicate content on both client // and server, or detecting client/server and DRYing up the code. if (Meteor.isServer) { Core = require("/server/api"); } else { Core = require("/client/api"); } /** * Check if package is enabled * @param {String} name - Package name * @return {Boolean} True if the package is enabled */ function isPackageEnabled(name) { const settings = this.getPackageSettings(name); return !!settings.enabled; } function getSeller(shopId) { let sellerShopId; if (!shopId) { const currentUser = Meteor.user(); if (currentUser) { sellerShopId = Roles.getGroupsForUser(currentUser.id, "admin")[0]; } } else { sellerShopId = shopId; } return Accounts.findOne({ shopId: sellerShopId }); } /** * getSellerShopId * @summary Get a seller's shopId or default to parent shopId * @param {String|Object} user - An optional user hash or userId to find a shop for * @param {Boolean} [noFallback=false] - Optional.If set to true doesn't fallback to owner shopId * when user doesn't have a shop. * @returns {String|Boolean} - The shopId belonging to userId, or loggedIn seller, or the parent shopId */ function getSellerShopId(user, noFallback = false) { let seller = user; if (Meteor.isClient && !seller) { seller = Meteor.user(); } if (seller) { const group = Roles.getGroupsForUser(seller, "admin")[0]; if (group) { return group; } } if (noFallback) { return false; } return Core.Reaction.getShopId(); } /** * getSellerShop * @summary Get a seller's shop or default to parent shop * @param {String|Object} user - An optional user hash or userId to find a shop for * @param {Boolean} [noFallback=false] - Optional.If set to true doesn't fallback to owner shop * when user doesn't have a shop. * @returns {String|Boolean} - The shop hash belonging to userId, or loggedIn seller, or the parent shop */ function getSellerShop(user, noFallback = false) { const _id = getSellerShopId(user, noFallback); if (!_id) { return false; } if (Meteor.isClient && _id !== Core.Reaction.getShopId()) { return SellerShops.findOne({ _id }); } return Shops.findOne({ _id }); } const Reaction = Object.assign(Core.Reaction, { isPackageEnabled, getSeller, getSellerShopId, getSellerShop }); export { Reaction };
'use strict'; angular.module('risevision.editorApp.controllers') .controller('PlaylistItemModalController', ['$scope', 'placeholderPlaylistFactory', 'widgetModalFactory', 'gadgetFactory', '$modalInstance', 'placeholderFactory', 'item', 'editorFactory', 'userState', 'RVA_URL', function ($scope, placeholderPlaylistFactory, widgetModalFactory, gadgetFactory, $modalInstance, placeholderFactory, item, editorFactory, userState, RVA_URL) { $scope.PREVIOUS_EDITOR_URL = RVA_URL + '/#/PRESENTATION_MANAGE' + (( editorFactory.presentation.id) ? '/id=' + editorFactory.presentation .id : '') + '?cid=' + userState.getSelectedCompanyId(); $scope.widgetModalFactory = widgetModalFactory; $scope.item = angular.copy(item); if (!item.objectReference && item.settingsUrl) { $scope.widgetName = item.name; } else { if (item.objectReference && (item.type === 'widget' || item.type === 'gadget')) { gadgetFactory.getGadget(item.objectReference).then(function (gadget) { $scope.widgetName = gadget.name; }); } } $scope.save = function () { angular.copy($scope.item, item); placeholderPlaylistFactory.updateItem(item); placeholderFactory.updateSubscriptionStatus(); $scope.dismiss(); }; $scope.dismiss = function () { $modalInstance.dismiss(); }; } ]); //ctr
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'forms', 'ja', { button: { title: 'ボタン プロパティ', text: 'テキスト (値)', type: 'タイプ', typeBtn: 'ボタン', typeSbm: '送信', typeRst: 'リセット' }, checkboxAndRadio: { checkboxTitle: 'チェックボックスのプロパティ', radioTitle: 'ラジオボタンのプロパティ', value: '値', selected: '選択済み', required: 'Required' // MISSING }, form: { title: 'フォームのプロパティ', menu: 'フォームのプロパティ', action: 'アクション (action)', method: 'メソッド (method)', encoding: 'エンコード方式 (encoding)' }, hidden: { title: '不可視フィールド プロパティ', name: '名前 (name)', value: '値 (value)' }, select: { title: '選択フィールドのプロパティ', selectInfo: '情報', opAvail: '利用可能なオプション', value: '選択項目値', size: 'サイズ', lines: '行', chkMulti: '複数選択を許可', required: 'Required', // MISSING opText: '選択項目名', opValue: '値', btnAdd: '追加', btnModify: '編集', btnUp: '上へ', btnDown: '下へ', btnSetValue: '選択した値を設定', btnDelete: '削除' }, textarea: { title: 'テキストエリア プロパティ', cols: '列', rows: '行' }, textfield: { title: '1行テキスト プロパティ', name: '名前', value: '値', charWidth: 'サイズ', maxChars: '最大長', required: 'Required', // MISSING type: 'タイプ', typeText: 'テキスト', typePass: 'パスワード入力', typeEmail: 'メール', typeSearch: '検索', typeTel: '電話番号', typeUrl: 'URL' } } );
'use strict' angular.module('ctfEvents').run(['Menus', function (Menus) { Menus.addMenuItem('topbar', { title: 'Events', state: 'ctfEvents.upcoming', roles: ['*'] }) Menus.addSubMenuItem('topbar', 'admin', { title: 'Manage Events', state: 'ctfEvents.list', }) } ])
import { decodeShopOpaqueId } from "@reactioncommerce/reaction-graphql-xforms/shop"; /** * @name "Query.shop" * @method * @memberof Shop/GraphQL * @summary query the Shops collection and return shop data * @param {Object} _ - unused * @param {Object} args - an object of all arguments that were sent by the client * @param {String} args.id - ID of shop to query * @param {Object} context - an object containing the per-request state * @return {Promise<Object>} user account object */ export default async function shop(_, { id }, context) { const dbShopId = decodeShopOpaqueId(id); return context.queries.shopById(context, dbShopId); }
import React from "react"; import renderer from "react-test-renderer"; import SvgIcon from "../components/SvgIcon"; test( "the SvgIcon matches the snapshot", () => { const component = renderer.create( <SvgIcon icon="edit" color="black" size="32px" className="my-icon" /> ); const tree = component.toJSON(); expect( tree ).toMatchSnapshot(); } ); test( "throws a warning when a non-existing icon is passed", () => { console.warn = jest.fn(); renderer.create( <SvgIcon icon="fake-icon" color="black" size="32px" className="my-icon" /> ); expect( console.warn ).toHaveBeenCalledTimes( 1 ); } );
/** * Copyright (C) 2011 Jacob Beard * Released under GNU GPL, read the file 'COPYING' for more information **/ define( function(){ function addPathRefToSegment(path,seg){ seg.pathRef = path; } return { mixin : function (from,to){ for(var p in from){ if(from.hasOwnProperty(p)) to[p] = from[p]; } }, removeFromList : function (element,list){ return list.splice(list.indexOf(element),1); }, propNumtoPropString : function (propNum){ var propStr = propNum || ""; var propX = "x" + propStr; var propY = "y" + propStr; return { x : propX, y : propY }; }, getStartSegFromPath : function(path){ var segList = path.pathSegList; var numItems = segList.numberOfItems; var startSeg = segList.getItem(0); return startSeg; }, getEndSegFromPath : function(path){ var segList = path.pathSegList; var numItems = segList.numberOfItems; var endSeg = segList.getItem(numItems-1); return endSeg; }, addPathRefToSegment : addPathRefToSegment, addPathRefToEachSegment : function(path){ var segList = path.pathSegList; var numItems = segList.numberOfItems; for(var i = 0; i < numItems; i++){ var seg = segList.getItem(i); addPathRefToSegment(path,seg); } }, unique : function(l){ return l.reduce(function(a,b){return a.indexOf(b) === -1 ? a.concat(b) : a;},[]); } }; } );
/** * M7 Socket IO Listener * * This library is used to handle messages received from the socket.io server running * on the M7 testing director. Right now communications are one way. The web client * receives notifications and updates the interface accordingly. */ function M7Client(server) { this.secret = 'gsh9a875qnva7ontv75sn5it3qcae'; this.proto = 'http'; // Popup alert this.alert_box_count = 1; this.alert_box = alert_box; function alert_box(type, msg) { switch(type) { case 'fatal': $("#alert_box_container").prepend("<div class='alert_box' id='alert_" + this.alert_box_count + "'><div class='alert_box_msg'><div class='alert_box_fatal'>Fatal:</div>" + msg + "</div></div>"); break; case 'error': $("#alert_box_container").prepend("<div class='alert_box' id='alert_" + this.alert_box_count + "'><div class='alert_box_msg'><div class='alert_box_error'>Error:</div>" + msg + "</div></div>"); break; case 'warn': $("#alert_box_container").prepend("<div class='alert_box' id='alert_" + this.alert_box_count + "'><div class='alert_box_msg'><div class='alert_box_warn'>Warn:</div>" + msg + "</div></div>"); break; case 'info': $("#alert_box_container").prepend("<div class='alert_box' id='alert_" + this.alert_box_count + "'><div class='alert_box_msg'><div class='alert_box_info'>Info:</div>" + msg + "</div></div>"); break; default: $("#alert_box_container").prepend("<div class='alert_box' id='alert_" + this.alert_box_count + "'>" + type + ": " + qmsg + "</div>"); break; } $("#alert_" + this.alert_box_count).delay(4000).fadeOut("fast"); this.alert_box_count++; } // Initialize connection this.io_connect = io_connect; function io_connect(server) { if (this.proto == 'https') { io_connection = io.connect(this.proto + '://' + server, {secure: true, query: 'secret=' + this.secret}); } else { io_connection = io.connect(this.proto + '://' + server, {query: 'secret=' + this.secret}); } io_connection.on('error', function(e) { alert_box('error', 'Unhandled socket.io connection issue: ' + e); return null; }); io_connection.on('connect_failed', function(e) { alert_box('error', 'Failed to connect to socket.io server: ' + e); return null; }); io_connection.emit('join', { room: 'web-client' }); return io_connection; } // Constructor this.io_client = this.io_connect(server); this.script_container = '#m7_auto_script'; // Icon pulse animation this.icon_pulse = icon_pulse; function icon_pulse(elem) { elem.animate({opacity:1}, 1000, 'swing', function() { elem.animate({opacity:0.5}, 1000, 'swing', function() { icon_pulse(elem); }); }); }; // Update system statistics this.sysstat_update = sysstat_update(); function sysstat_update(host, stats) { } // Update server/socket status this.service_update = service_update; function service_update(elem, status) { $('#' + elem).replaceWith('<div class="m7_server_status_right ' + status + '" id="' + elem + '">' + status + '</div>'); } // Testing animations this.test_animate = test_animate; function test_animate(action, host) { // Script block and map host icon ID var script_id = 'map_host_' + host + '_pulse'; var icon_id = 'map_host_' + host; switch(action) { // Start testing animation case 'start': var start_test_js = "<script id='" + script_id + "'>m7.icon_pulse($('#" + icon_id + "'));</script>"; $(this.script_container).append(start_test_js); break; // Stop testing animation case 'stop': var stop_test_js = "<script id='" + script_id + "'>$('#" + icon_id + "').stop(); $('#" + icon_id + "').css('opacity', '0.7');</script>"; $('#' + script_id).replaceWith(stop_test_js); break; // Invalid animation action default: console.log('Invalid test animation action: ' + action); } }; // Render initial page state this.render_page = render_page; function render_page(json) { this.service_update('scheduler', json.cluster.scheduler.status); this.service_update('socketio', json.cluster.socketio.status); for (var node in json.cluster.nodes) { var node_plans = json.cluster.nodes[node].plans; var node_tag = node.replace('-','_'); for (var plan_id in node_plans) { if (node_plans[plan_id].status == 'active') { this.test_animate('start', node_tag); } if (node_plans[plan_id].status == 'idle') { this.test_animate('stop', node_tag); } } } }; }; // Initialize the object var m7 = new M7Client('110.34.221.34:61000'); // Render the initial page state m7.render_page(cluster_status); // Handle incoming socket.io connections m7.io_client.on('connect', function() { m7.io_client.on('web_receive', function(json_string) { console.log(json_string); var json = $.parseJSON(json_string); console.log(json); // Process base on the event switch(json.event) { // Alert message case 'alert': m7.alert_box(json.type, json.msg); break; // Test execution started case 'test-start': m7.test_animate('start', json.host); break; // Update service status case 'service-update': m7.service_update(json.service, json.status); break; // System status case 'sysstat': m7.sysstat_update(json.host, json.stats); break; // Test execution stopped case 'test-stop': m7.test_animate('stop', json.host); break; // Invalid event received default: console.log('Received invalid event: ' + json.event); } }); });
Ext.define('Omni.view.rms_inventories.Inspector',{ extend : 'Buildit.ux.inspector.Panel', alias : 'widget.omni-rms_inventories-Inspector', initComponent:function(){ var me = this; // INSPECTOR INIT (Start) ============================================================== Ext.applyIf(this, { associativeFilter : { property : 'id', value : this.record.get('id') }, associativeSearch : { with: { id : { equal_to : this.record.get('id') } } } }); // INSPECTOR INIT (End) // CARDS (Start) ======================================================================= Ext.apply(this, { cards : [ { title : 'Profile', xtype : 'omni-rms_inventories-Form' } ] }); // CARDS (End) // TITLES (Start) ====================================================================== Ext.applyIf(this, { title : 'Rms Inventory', subtitle : this.record.get('display_as') }); // TITLES (End) this.callParent(); } });
/* * Copyright (C) Zing contributors. * * This file is a part of the Zing project. It is distributed under the GPL3 * or later license. See the LICENSE file for a copy of the license and the * AUTHORS file for copyright and authorship information. */ import React from 'react'; import { showModal } from './Modal'; import { t, tct } from 'utils/i18n'; import './AboutDialog.css'; export function showAboutDialog() { showModal({ title: t('About this translation server...'), children: <AboutDialogContent />, className: 'about-dialog-component', }); } const AboutDialogContent = React.createClass({ render() { return ( <div> <div className="side-column"> <img src={s('images/logo.svg')} /> </div> <div className="main-content"> <h1>Zing</h1> <p> {tct( 'This server is powered by %(zing)s — ' + 'online translation software developed by %(evernoteLink)s ' + 'and based on open-source %(pootleLink)s project.', { zing: <strong>Zing</strong>, evernoteLink: <a href="https://evernote.com/">Evernote</a>, pootleLink: <a href="http://pootle.translatehouse.org/">Pootle</a>, } )} </p> <p> {tct('Source code and bug tracker: %(githubLink)s', { githubLink: <a href="https://github.com/evernote/zing">GitHub</a>, })} </p> <p className="copyright"> {t('© %(year)s Zing Contributors', { year: 2016 })} <br /> {t('© 2016 Pootle Contributors')} </p> </div> </div> ); }, });
var _ = require("underscore"); var html = require("../html"); exports.topLevelElement = topLevelElement; exports.elements = elements; exports.element = element; function topLevelElement(tagName, attributes) { return elements([element(tagName, attributes, { fresh: true })]); } function elements(elementStyles) { return new HtmlPath(elementStyles.map(function (elementStyle) { if (_.isString(elementStyle)) { return element(elementStyle); } else { return elementStyle; } })); } function HtmlPath(elements) { this._elements = elements; } HtmlPath.prototype.wrap = function wrap(children) { var result = children(); for (var index = this._elements.length - 1; index >= 0; index--) { result = this._elements[index].wrapNodes(result); } return result; }; function element(tagName, attributes, options) { options = options || {}; return new Element(tagName, attributes, options); } function Element(tagName, attributes, options) { var tagNames = {}; if (_.isArray(tagName)) { tagName.forEach(function (tagName) { tagNames[tagName] = true; }); tagName = tagName[0]; } else { tagNames[tagName] = true; } this.tagName = tagName; this.tagNames = tagNames; this.attributes = attributes || {}; this.fresh = options.fresh; this.separator = options.separator; } Element.prototype.matchesElement = function (element) { return this.tagNames[element.tagName] && _.isEqual(this.attributes || {}, element.attributes || {}); }; Element.prototype.wrap = function wrap(generateNodes) { return this.wrapNodes(generateNodes()); }; Element.prototype.wrapNodes = function wrapNodes(nodes) { return [html.elementWithTag(this, nodes)]; }; exports.empty = elements([]); exports.ignore = { wrap: function wrap() { return []; } };
/* Copyright - 2016 - Christian Guyette - Contact: http//www.ouaie.be/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* --- Utilities.js file ------------------------------------------------------------------------------------------------- This file contains: - the getUtilities function - the module.exports implementation Changes: - v1.0.0: - created Doc reviewed 20161223 Tests to do... ------------------------------------------------------------------------------------------------------------------------ */ (function() { 'use strict'; /* --- Utilities object -------------------------------------------------------------------------------------- Various helper methods Patterns : Closure ------------------------------------------------------------------------------------------------------------------------ */ /* --- getUtilities function ---------------------------------------------------------------------------------------------- This function returns the one and only one Utilities object ------------------------------------------------------------------------------------------------------------------------ */ var getUtilities = function ( ) { /* --- getUUID function -------------------------------------------------------------------------------------------------- This function returns an unique identifier like UUID Adapted from stackoverflow.com :-) ------------------------------------------------------------------------------------------------------------------------ */ var getUUID = function ( ) { function Random4 ( ) { return Math.floor ( ( 1 + Math.random ( ) ) * 0x10000 ).toString ( 16 ).substring ( 1 ); } return Random4 ( ) + Random4 ( ) + '-' + Random4 ( ) + '-' + Random4 ( ) + '-' +Random4 ( ) + '-' + Random4 ( ) + Random4 ( ) + Random4 ( ) ; }; /* --- End of getUUID function --- */ var _pageId = getUUID ( ); // The one and omly one PageId. This is used to communicate with the pin's page through the storage. return { /* --- UUID getter -------------------------------------------------------------------------------------------------------- */ get UUID ( ) { return getUUID ( ); }, /* --- pageId getter ------------------------------------------------------------------------------------------------------ */ get pageId ( ) { return _pageId; }, /* --- storageAvailable function ------------------------------------------------------------------------------------------ This function test if the storage API is available ( the API can be deactived by user....) Adapted from MDN :-) ------------------------------------------------------------------------------------------------------------------------ */ storageAvailable: function ( type ) { try { var storage = window [ type ]; var x = '__storage_test__'; storage.setItem ( x, x ); storage.removeItem ( x ); return true; } catch ( e ) { return false; } }, /* --- End of storageAvailable function --- */ fileAPIAvailable : function ( ) { try { // FF... var testFileData = new File ( [ 'testdata' ], { type: 'text/plain' } ); return true; } catch ( Error ) { if (window.navigator.msSaveOrOpenBlob ) { //edge IE 11... return true; } else { return false; } } }, saveFile : function ( filename, text, type ) { if ( ! type ) { type = 'text/plain'; } if ( window.navigator.msSaveOrOpenBlob ) { //https://msdn.microsoft.com/en-us/library/hh779016(v=vs.85).aspx //edge IE 11... try { window.navigator.msSaveOrOpenBlob ( new Blob ( [ text ] ), filename ); } catch ( Error ) { } } else { // FF... // http://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server try { var mapFile = window.URL.createObjectURL ( new File ( [ text ], { type: type } ) ); var element = document.createElement ( 'a' ); element.setAttribute( 'href', mapFile ); element.setAttribute( 'download', filename ); element.style.display = 'none'; document.body.appendChild ( element ); element.click ( ); document.body.removeChild ( element ); window.URL.revokeObjectURL ( mapFile ); } catch ( Error ) { } } } }; }; /* --- End of getUtilities function --- */ /* --- Exports ------------------------------------------------------------------------------------------------------------ */ if ( typeof module !== 'undefined' && module.exports ) { module.exports = getUtilities ( ); } } ) ( ); /* --- End of Utilities.js file --- */
/** * Custom script that builds a SELECT drop-down with all menu links. * * Selects are great since they support CSS3 * */ jQuery(document).ready(function(){ jQuery('ul:first').attr("id", "primary-menu"); jQuery("ul#primary-menu > li:has(ul)").addClass("hasChildren"); jQuery("ul#primary-menu > li:has(ul) > ul > li > a").addClass("isChild"); }); jQuery(function() { jQuery("<select id='rl-navMenu' />").appendTo("#masthead"); jQuery("#rl-navMenu").wrap('<div class="rl-styled-select"></div>'); jQuery("<option />", { "selected": "selected", "value" : "", "text" : "Menu", }).appendTo("#masthead select"); jQuery("nav a").each(function() { var el = jQuery(this); jQuery("<option />", { "value" : el.attr("href"), "text" : el.text(), "class" : el.attr("class") }).appendTo("#masthead select"); }); jQuery("nav select").change(function() { window.location = jQuery(this).find("option:selected").val(); }); }); jQuery(document).ready(function() { jQuery("#masthead select option").each(function() { var el = jQuery(this); if(el.hasClass("isChild")){ jQuery(el.prepend("- ")) } }); });
app.constant("productListActiveClass", "btn-primary") .controller("productListCtrl", function ($scope, $filter, productListActiveClass) { var selectedCategory = null; $scope.selectCategory = function(newCategory) { selectedCategory = newCategory; }; $scope.categoryFilterFn = function (product) { return selectedCategory == null || product.category == selectedCategory; }; $scope.getCategoryClass = function(category) { return selectedCategory == category ? productListActiveClass : ""; }; });
'use strict' var Q = require('q') var typeforce = require('typeforce') var tradle = require('@tradle/engine') var protocol = tradle.protocol var tradleUtils = tradle.utils var constants = tradle.constants var extend = require('xtend/mutable') var clone = require('xtend') var utils = require('./utils') var ROOT_HASH = constants.ROOT_HASH var CUR_HASH = constants.CUR_HASH var TYPE = constants.TYPE var types = require('./types') // var mutexify = require('mutexify') // var locks = {} // var COUNTER = 0 module.exports = RequestState function RequestState (opts, objWrapper) { // customer state let author = (opts || objWrapper).author if (typeof author === 'string') author = { permalink: author } if (!author) throw new Error('expected author') this.state = opts && opts.state if (!objWrapper && opts.object) { objWrapper = tradleUtils.addLinks({ object: opts.object.object }) const type = objWrapper.object[TYPE] if (type === 'tradle.SelfIntroduction' || type === types.IDENTITY_PUBLISH_REQUEST) { objWrapper.author = author } } // tradleUtils.addLinks(objWrapper) this.message = opts this.payload = objWrapper if (opts) { this.context = opts.context || (opts && opts.object && opts.object.context) } let application Object.defineProperty(this, 'application', { set: val => application = val, get: () => { if (!application) { if (this.state && this.context) { application = utils.getApplication(this.state, this.context) } } return application } }) Object.defineProperty(this, 'product', { get: () => { if (this.state && this.context) { return utils.getProduct(this.state, this.context) } } }) // for (var w in this.wrappers) { // var wrapper = this.wrappers[w] // if (wrapper) { // wrapper[CUR_HASH] = wrapper.link // wrapper[ROOT_HASH] = wrapper.permalink // } // } // this.parsed = opts.parsed || { // data: objWrapper.object // } // var data = this.parsed.data this.app = null this.msg = opts this[TYPE] = this.type = objWrapper && objWrapper.object[TYPE] this.from = author this.customerIdentityInfo = author this.resp = null this.promises = [] this.customer = this.from.permalink // if (objWrapper) { // this[CUR_HASH] = objWrapper.link // this[ROOT_HASH] = objWrapper.permalink // } else { // this[CUR_HASH] = protocol.linkString(data) // this[ROOT_HASH] = data[ROOT_HASH] || this[CUR_HASH] // } } // RequestState.prototype.start = function () { // return this._startPromise // } RequestState.prototype.promise = function (promise) { // if (this._startPromise.inspect().state !== 'fulfilled') { // throw new Error('not ready!') // } this.promises.push(promise) } RequestState.prototype.end = function () { return Q.all(this.promises) }
import { css } from 'styled-components'; export function animation({ animation, duration = 1000, func = 'ease', delay = 0 } = {}) { return css`${animation} ${duration}ms ${func} ${delay}ms forwards`; }
/* eslint-env jasmine */ /* global inject, module */ describe("calendar service", function() { var $compile; var $rootScope; beforeEach(module("materialCalendar")); beforeEach(inject(function(_$compile_, _$rootScope_){ $compile = _$compile_; $rootScope = _$rootScope_; })); xit("should be tested", function() { $compile("<calendar-md></calendar-md>")($rootScope); $rootScope.$digest(); }); });
export async function login(driver, server, t) { let userEndpointCalled = 0; let bugEndpointCalled = 0; server.get("/rest/user/:email", function(req, res) { userEndpointCalled++; t.is(req.params.email, "bugzilla@example.com"); res.json({ users: [{ "can_login" : true, "email" : "bugzilla@example.com", "groups" : [ { "description" : "Can confirm a bug.", "id" : 7, "name" : "canconfirm", }, { "description" : "Can edit all aspects of any bug.", "id" : 6, "name" : "editbugs", }, ], "id" : 65095, "name" : "bugzilla@example.com", "real_name" : "Example Tester", "saved_reports" : [], "saved_searches" : [], }], }); }); server.get("/rest/bug", function(req, res) { bugEndpointCalled++; t.is(req.query.assigned_to, "bugzilla@example.com"); t.is(req.query.api_key, "valid_api_key"); res.json({ bugs: [], }); }); server.use("*", () => t.fail("Unexpected API call")); let username = await driver.elementById("usernameInput"); let password = await driver.elementById("apiKeyInput"); let button = await driver.elementById("submitButton"); await username.setImmediateValue("bugzilla@example.com"); await password.setImmediateValue("valid_api_key"); await button.click(); await driver.waitForElementById("menuButton"); t.is(userEndpointCalled, 2); t.is(bugEndpointCalled, 1); server._router.stack.splice(-3, 3); } export async function logout(driver, server, t) { let menuButton = await driver.elementById("menuButton"); menuButton.click(); let settingsButton = await driver.waitForElementById("settingsButton"); t.true(await settingsButton.isDisplayed()); settingsButton.click(); let logoutButton = await driver.waitForElementById("logoutButton"); logoutButton.click(); let username = await driver.waitForElementById("Username"); t.true(await username.isDisplayed()); }
var _templateRendererSetup = function() { // Mustache doesn't need any setup }; var _templateRendererImpl = function(template, view, output) { // Can't use streaming mode, however nicely it fits in with the push-to-output method we use, because // it removes line endings from the values which means <textarea>s can't have multiple lines. // Use the standard templates as partials. output.push(Mustache.to_html(template, view, standardTemplates)); };
/* Video's aren't really an uploaded item...we just turn youtube/vimeo links into embeds */ var systemvision = P(Element, function(_, super_) { _.helpText = "<<systemvision>>\nEmbed a SystemVision file. Enter the node id (click 'embed' in SystemVision and in the embed code, look for the 'systemvision.com/node/NODE_ID' url, where NODE_ID is a number you enter here."; _.klass = ['import_video']; _.innerHtml = function() { return '<div class="' + css_prefix + 'top ' + css_prefix + 'focusableItems" data-id="0">' + focusableHTML('CodeBlock', 'SystemVision') + '&nbsp;node:&nbsp;' + focusableHTML('CommandBlock', 'video_url') + '&nbsp;' + helpBlock() + '<BR>' + answerSpan() + '</div>'; } _.postInsertHandler = function() { super_.postInsertHandler.call(this); var _this = this; this.codeBlock = registerFocusable(CodeBlock,this, 'SystemVision', { }); this.block = registerFocusable(CommandBlock, this, 'video_url', { editable: true, border: true, handlers: {blur: function(el) { _this.processUrl(el.toString()); } } }); this.focusableItems = [[this.codeBlock,this.block]]; this.leftJQ.append('<span class="fa fa-upload"></span>'); return this; } _.processUrl = function(text) { if(text.trim() == '') return this.outputBox.clearState().collapse(); var pattern = /^[0-9]+$/; if(pattern.test(text)) { var id = text; } else { // No matching provider this.outputBox.expand(); this.outputBox.setError("Invalid Node ID. Please copy in the node id (click 'embed' in SystemVision and in the embed code, look for the 'systemvision.com/node/NODE_ID' url, where NODE_ID is a number you enter here."); return; } // Success: Delete this block and replace with the video var stream = !this.worksheet.trackingStream; if(stream) this.worksheet.startUndoStream(); systemvisionBlock().insertAfter(this).setDocument(id).show(); this.remove(); if(stream) this.worksheet.endUndoStream(); this.worksheet.save(); } _.toString = function() { return '{systemvision}{{' + this.argumentList().join('}{') + '}}'; } }); var systemvisionBlock = P(Element, function(_, super_) { _.klass = ['systemvision']; _.savedProperties = ['document_id']; _.document_id = false; _.innerHtml = function() { return '<div class="' + css_prefix + 'top ' + css_prefix + 'focusableItems" data-id="0"><table style="width:100%;"><tbody><tr><td>' + focusableHTML('CodeBlock', '') + '</td><td class="' + css_prefix + 'insert"></td></tr></tbody></table></div>' } _.postInsertHandler = function() { super_.postInsertHandler.call(this); this.codeBlock = registerFocusable(CodeBlock, this, '', { }); this.focusableItems = [[this.codeBlock]]; return this; } _.empty = function() { return false; } _.setDocument = function(document_id) { this.document_id = document_id; var html = '<iframe allowfullscreen="true" frameborder="0" width="100%" height="500" scrolling="no" src="https://systemvision.com/node/' + this.document_id + '" title="SystemVision Cloud"></iframe>'; this.insertJQ.html(''); this.insertJQ.append(html); return this; } _.toString = function() { return '{systemvisionBlock}{{' + this.argumentList().join('}{') + '}}'; } _.parseSavedProperties = function(args) { super_.parseSavedProperties.call(this, args); this.setDocument(this.document_id); return this; } _.mouseClick = function() { this.codeBlock.focus(L); return false; } });
// Copyright 2013 Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. var nfs = require('nfs'); var common = require('./common'); ///-- API function symlink(req, res, next) { req.log.debug('symlink(%s, %s): entered', req.where.dir, req.where.name); res.error(nfs.NFS3ERR_NOTSUPP); next(false); } ///--- Exports module.exports = function chain() { return ([ symlink ]); };
'use strict'; module.exports = function(grunt){ var path = require('path'); var config = require('build-facets')(__dirname) .loadRules('./config/server-facets.js') .loadConfiguration('./config/build-config.js') .loadConfiguration('./config/deploy-config.js'); config = config.loadConfiguration(config.resolve('namespace-dir', 'basic-info')); var themeFile = config.get('theme'); var platformCode = config.buildVariant['namespace']; var distDir = path.resolve(config.resolve('project-dir', 'dist-relative'), platformCode), assetsDir = path.join(distDir, config.get('assets-relative')), assembleDir = assetsDir; var browserifyFiles = {}; // should use '<%=dist.build%>' // the rest of the modules will be lazily discovered. browserifyFiles[path.join(__dirname, '/public/app.min.js')] = ['client/lib/entry/*.js']; var stylusFiles = {}; stylusFiles[path.join(__dirname, '/public/style.css')] = [themeFile]; grunt.initConfig({ dist: { build: 'build', assemble: assembleDir, // this is really hard to change. dir: distDir, assets: assetsDir, theme: themeFile }, jshint: { options: { jshintrc: '.jshintrc' }, client: ['client/**/*.js', 'lib/**/*.js'], server: ['lib/**/*.js', 'test/**/*.js', 'servers/**/*.js'], project: ['**/*.js', '!client/**/*.js', '!lib/**/*.js', '!test/*/**.js'] }, node_tap: { short_tests: { options: { outputType: 'failures', // tap, failures, stats outputTo: 'console' // or file //outputFilePath: '/tmp/out.log' // path for output file, only makes sense with outputTo 'file' }, files: { 'tests': ['./test/test-*.js', './client/test/test-*.js'] } } }, browserify: { dist: { files: browserifyFiles }, options: { debug: true } }, stylus: { compile: { paths: ['client/style'], files: stylusFiles } }, clean: { options: { force: true, // we need this to be able to clean the dist directory outside of this dir. }, client: { force: true, src: [ '<%=dist.dir%>' ] } }, copy: { client: { files: [ { flatten: false, expand: true, cwd: 'resources', src: config.get('resources-common'), dest: '<%=dist.assets%>' }, { flatten: false, expand: true, cwd: 'resources', src: config.get('resources-specific'), dest: '<%=dist.assets%>' }, //{ flatten: true, expand: true, src: ['node_modules/x-tag-core/dist/x-tag-core.js'], dest: '<%=dist.dir%>' }, ] }, server: { files: [ ] } }, concurrent: { dev: { options: { logConcurrentOutput: true }, tasks: ['watch', 'nodemon:dev'] } }, nodemon: { dev: { script: './lib/app.js', watch: ['lib/**', 'servers/**', 'views/**'] } }, watch: { options: { interrupt: true }, client: { files: [ '<%= jshint.client %>', 'client/**/*.html', 'client/**/*.styl', 'views/**/*.html', ], tasks: ['build-client'] }, server: { files: [ '<%= jshint.server %>', 'lib/**/*.js', 'test/**/*.js', 'views/*.html', ], tasks: ['build-server'] }, project: { files: [ 'Gruntfile.js', 'config/*.js', ], tasks: ['build-project'] }, }, shell: { runNative: { command: config.get('run-command'), options: { execOptions: { cwd: config.resolve('project-dir') } } } }, manifest: { generate: { options: { basePath: 'build', cache: [], //network: ['http://*', 'https://*'], //fallback: ['/ /offline.html'], //exclude: ['js/jquery.min.js'], preferOnline: false, verbose: true, timestamp: true, hash: true, master: ['index.html'] }, src: [ '*.html', '*.js', '*.css' ], dest: '<%=dist.assets%>/manifest.appcache' } }, connect: { server: { options: { port: 9001, hostname: "*", base: '<%=dist.dir%>' } } }, }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-stylus'); grunt.loadNpmTasks('grunt-node-tap'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-manifest'); grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-nodemon'); grunt.loadNpmTasks('grunt-concurrent'); grunt.registerTask('_build-extras', config.get('extra-build-tasks')); grunt.registerTask('default',[ 'build-project', 'concurrent' ]); grunt.registerTask('build-client',[ 'jshint:client', 'clean:client', 'browserify', 'stylus', 'copy:client', '_build-extras' ]); grunt.registerTask('build-server', [ 'jshint:server', 'copy:server', ]); grunt.registerTask('build-project', [ 'build-client', 'build-server' ]); // deprecated? grunt.registerTask('server', [ 'connect:server:keepalive' ]); grunt.registerTask('test',[ 'jshint', 'node_tap' ]); grunt.registerTask('run-native',[ 'shell:runNative' ]); };
/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ /* * Initialization specific to Form Autofill mochitest-chrome tests. * * This file is loaded by "loader.js". */ /* import-globals-from loader.js */ "use strict"; // The testing framework is fully initialized at this point, you can add // mochitest-chrome specific test initialization here. If you need shared // functions or initialization that are not specific to mochitest-chrome, // consider adding them to "head_common.js" in the parent folder instead.
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; const { Loader } = require("sdk/test/loader"); const hiddenFrames = require("sdk/frame/hidden-frame"); const { HiddenFrame } = hiddenFrames; exports["test Frame"] = function(assert, done) { let url = "data:text/html;charset=utf-8,<!DOCTYPE%20html>"; let hiddenFrame = hiddenFrames.add(HiddenFrame({ onReady: function () { assert.equal(this.element.contentWindow.location, "about:blank", "HiddenFrame loads about:blank by default."); function onDOMReady() { hiddenFrame.element.removeEventListener("DOMContentLoaded", onDOMReady); assert.equal(hiddenFrame.element.contentWindow.location, url, "HiddenFrame loads the specified content."); done(); } this.element.addEventListener("DOMContentLoaded", onDOMReady); this.element.setAttribute("src", url); } })); }; exports["test frame removed properly"] = function(assert, done) { let url = "data:text/html;charset=utf-8,<!DOCTYPE%20html>"; let hiddenFrame = hiddenFrames.add(HiddenFrame({ onReady: function () { let frame = this.element; assert.ok(frame.parentNode, "frame has a parent node"); hiddenFrames.remove(hiddenFrame); assert.ok(!frame.parentNode, "frame no longer has a parent node"); done(); } })); }; exports["test unload detaches panels"] = function(assert, done) { let loader = Loader(module); let { add, remove, HiddenFrame } = loader.require("sdk/frame/hidden-frame"); let frames = [] function ready() { frames.push(this.element); if (frames.length === 2) complete(); } add(HiddenFrame({ onReady: ready })); add(HiddenFrame({ onReady: ready })); function complete() { frames.forEach(function(frame) { assert.ok(frame.parentNode, "frame is in the document"); }) loader.unload(); frames.forEach(function(frame) { assert.ok(!frame.parentNode, "frame isn't in the document'"); }); done(); } }; require("sdk/test").run(exports);
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ module.exports = function (grunt) { grunt.config('copy', { build: { files: [{ cwd: '<%= yeoman.tmp %>/scripts', dest: '<%= yeoman.dist %>/scripts', expand: true, src: ['**/*.js'] }] }, dist: { files: [ { cwd: '<%= yeoman.app %>', dest: '<%= yeoman.dist %>', dot: true, // static resources. expand: true, src: [ '*.{ico,png,txt}', '.htaccess', 'images/{,*/}*.{webp,gif,svg,jpg,jpeg,png}', 'styles/fonts/{,*/}*.*', 'fonts/**/*.{woff,eot,ttf,svg,ofl}', 'i18n/{,*/}{,*/}*.*' ] }, { cwd: '<%= yeoman.app %>/bower_components/jquery-ui', dest: '<%= yeoman.dist %>/bower_components/jquery-ui', // jquery ui expand: true, src: ['**/*.js'] }, { cwd: '<%= yeoman.app %>/bower_components/fxa-password-strength-checker/build/', dest: '<%= yeoman.dist %>/bower_components/fxa-password-strength-checker/build/', // password strength checker expand: true, src: ['*.js'] }, { cwd: '<%= yeoman.app %>/bower_components/fxa-checkbox/', dest: '<%= yeoman.dist %>/bower_components/fxa-checkbox/', // fxa-checkbox expand: true, src: ['*.js'] }, { cwd: '<%= yeoman.tmp %>/concat/scripts', dest: '<%= yeoman.dist %>/scripts', // head scripts expand: true, src: ['**/*.js'] } ] }, error_pages: { //eslint-disable-line camelcase files: [{ cwd: '<%= yeoman.page_template_dist %>', dest: '<%= yeoman.app %>', dot: true, expand: true, flatten: true, src: 'en/{500,502,503}.html' }] }, // copy normalize.css to .tmp during build, this library is required by grunt-usemin to be in .tmp normalize: { dest: '<%= yeoman.tmp %>/bower_components/normalize-css/normalize.css', src: 'app/bower_components/normalize-css/normalize.css' }, strings: { files: [ { cwd: '<%= yeoman.strings_src %>', dest: '<%= yeoman.strings_dist %>', expand: true, src: ['**/*.po'] }, { cwd: '<%= yeoman.strings_src %>/sv_SE', dest: '<%= yeoman.strings_dist %>/sv', // Copy strings from sv_SE to sv expand: true, src: ['**/*.po'] }, { cwd: '<%= yeoman.strings_src %>/hi_IN', dest: '<%= yeoman.strings_dist %>/hi', // Copy strings from hi_IN to hi expand: true, src: ['**/*.po'] } ] }, styles: { cwd: '<%= yeoman.app %>/styles', dest: '<%= yeoman.tmp %>/styles/', dot: true, expand: true, src: '{,*/}*.css' }, tos_pp: { //eslint-disable-line camelcase // The legal repo use es-ES but we (in accordance with Verbatim) use es, // so copy es-ES templates to es files: [ { expand: true, cwd: '<%= yeoman.tos_html_dest %>', dest: '<%= yeoman.tos_html_dest %>', src: 'es_ES.html', rename: function (dest) { return dest + '/es.html'; } }, { expand: true, cwd: '<%= yeoman.pp_html_dest %>', dest: '<%= yeoman.pp_html_dest %>', src: 'es_ES.html', rename: function (dest) { return dest + '/es.html'; } } ] } }); };
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ // Check that variables view handles special names like "<return>" // properly for ordinary displays. "use strict"; const TEST_URI = "data:text/html;charset=utf8,<p>test for bug 1084430"; add_task(function* () { yield loadTab(TEST_URI); let hud = yield openConsole(); ok(hud, "web console opened"); hud.setFilterState("log", false); registerCleanupFunction(() => hud.setFilterState("log", true)); hud.jsterm.execute("inspect({ '<return>': 47, '<exception>': 91 })"); let varView = yield hud.jsterm.once("variablesview-fetched"); ok(varView, "variables view object"); let props = yield findVariableViewProperties(varView, [ { name: "<return>", value: 47 }, { name: "<exception>", value: 91 }, ], { webconsole: hud }); for (let prop of props) { ok(!prop.matchedProp._internalItem, prop.name + " is not marked internal"); let target = prop.matchedProp._target; ok(!target.hasAttribute("pseudo-item"), prop.name + " is not a pseudo-item"); } });
var app = angular.module('CircusSite', ['ngMaterial', 'ngRoute', 'ngAnimate']); app.config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/', { templateUrl: 'circus-main/circus-main.html' }). when('/artists', { templateUrl: 'circus-artists/circus-artists.html' }). when('/contact', { templateUrl: 'circus-contact/circus-contact.html' }). when('/hire', { templateUrl: 'circus-hire/circus-hire.html' }). when('/login', { templateUrl: 'circus-login/circus-login.html' }). when('/join', { templateUrl: 'circus-join/circus-join.html' }). otherwise({ redirectTo: '/' }); } ]); app.controller("TabNav", ['$scope', '$location', '$route', function ($scope, $location, $route) { $scope.tabs = [ {title: 'Home', location: '/'}, {title: 'Hire', location: '/hire'}, {title: 'Artists', location: '/artists'}, {title: 'Contact', location: '/contact'} ]; /* When we initialize the tab bar, we need to set the selectedIndex to one that matches the path we have in the location. Doing so ensures that we stay on the same page over refreshes and so on. We fail-through to homepage though, because it's index 0. */ $scope.selectedIndex = 0; $scope.setlocation = function(selected){ $location.path(selected.location); set_by_location() }; set_by_location = function() { $scope.selectedIndex = -1; for (i = 0; i < $scope.tabs.length; i++) { if ($scope.tabs[i]["location"] == $location.path()) { $scope.selectedIndex = i; } } }; set_by_location(); $scope.$on('$routeChangeSuccess', function(event, data) { set_by_location() }) }]);
/* 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 as published by the Free Software Foundation 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/>. */ /** * @author Moogra (BubblesDev) * @purpose Warps to the second drill hall */ function enter(pi) { var maps = [108000600, 108000601, 108000602]; if(pi.isQuestStarted(20201) || pi.isQuestStarted(20202) || pi.isQuestStarted(20203) || pi.isQuestStarted(20204) || pi.isQuestStarted(20205)) { pi.removeAll(4032096); pi.removeAll(4032097); pi.removeAll(4032098); pi.removeAll(4032099); pi.removeAll(4032100); var rand = Math.floor(Math.random() * maps.length); pi.playPortalSound(); pi.warp(maps[rand], 0); return true; } else { return false; } }
/* 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 as published by the Free Software Foundation 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/>. */ var status = 0; var price = 1000000; var skin = Array(0, 1, 2, 3, 4); function start() { status = -1; action(1, 0, 0); } function action(mode, type, selection) { if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc cm.dispose(); } else { if (mode == 1) status++; else status--; if (status == 0) { cm.sendSimple("Oh, hello! Welcome to the Ludibrium Skin-Care! Are you interested in getting tanned and looking sexy? How about a beautiful, snow-white skin? If you have #b#t5153002##k, you can let us take care of the rest and have the kind of skin you've always dreamed of!\r\n#L2#Skin Care: #i5153002##t5153002##l"); } else if (status == 1) { if (selection == 2) { cm.sendStyle("With our specialized machine, you can see the way you'll look after the treatment PRIOR to the procedure. What kind of a look are you looking for? Go ahead and choose the style of your liking~!", skin); } } else if (status == 2){ cm.dispose(); if (cm.haveItem(5153002) == true){ cm.gainItem(5153002, -1); cm.setSkin(skin[selection]); cm.sendOk("Enjoy your new and improved skin!"); } else { cm.sendOk("Um...you don't have the skin-care coupon you need to receive the treatment. Sorry, but I am afraid we can't do it for you..."); } } } }
import PropTypes from 'prop-types' import React, { Component } from 'react' import { connect } from 'react-redux' import { Link } from 'react-router-dom' import { cachedResource } from '../services/resources' import { createResource } from '../actions/resources' import { ResourceForm } from '../forms' import { translate } from '../../../common/services/i18n' class ResourcesNew extends Component { static propTypes = { createResource: PropTypes.func.isRequired, errorMessage: PropTypes.string.isRequired, isLoading: PropTypes.bool.isRequired, nextRandomId: PropTypes.string.isRequired, } onSubmit(values) { const flash = { text: translate('flash.createResourceSuccess'), } this.props.createResource( 'resources', this.props.nextRandomId, values, flash, '/resources' ) } render() { return ( <section> <h1>{ translate('views.resources.createNewTitle') }</h1> <Link className="button" to="/resources"> { translate('common.backToOverview') } </Link> <hr /> <ResourceForm errorMessage={this.props.errorMessage} isLoading={this.props.isLoading} onSubmit={this.onSubmit} /> </section> ) } constructor(props) { super(props) this.onSubmit = this.onSubmit.bind(this) } } function mapStateToProps(state) { const { errorMessage, nextRandomId } = state.resources const { isLoading } = cachedResource('resources', nextRandomId, true) return { errorMessage, isLoading, nextRandomId, } } export default connect( mapStateToProps, { createResource, } )(ResourcesNew)
'use strict'; const collectionIncludes = require('lodash').includes; const DOM_PREFIXES = ['971', '972', '973', '974', '975']; const INVALID_PREFIXES = ['96', '98', '99', '00', '20']; module.exports = function parseInseeCode(inseeCode) { if (inseeCode.length !== 5) throw new Error('INSEE code must have 5 characters'); inseeCode = inseeCode.toUpperCase(); let prefix = inseeCode.substr(0, 2); let suffix = inseeCode.substr(2, 3); // Vérifie que le suffixe (3 derniers caractères) ne contient bien que des chiffres if (! suffix.match(/[0-9]{3}/)) throw new Error('Invalid INSEE code'); // Corse if (prefix === '2A' || prefix === '2B') { return { code_dep: prefix, code_com: suffix }; } // Vérifie que le préfixe (2 premiers caractères) ne contient bien que des chiffres (Corse exclus) if (! prefix.match(/[0-9]{2}/)) throw new Error('Invalid INSEE code'); // DOM if (prefix === '97') { prefix = inseeCode.substr(0, 3); suffix = inseeCode.substr(3, 2); if (! collectionIncludes(DOM_PREFIXES, prefix)) throw new Error('Invalid INSEE code'); return { code_dep: prefix, code_com: suffix }; } if (collectionIncludes(INVALID_PREFIXES, prefix)) throw new Error('Invalid INSEE code'); return { code_dep: prefix, code_com: suffix }; };
'use strict'; var client = require('../http-client'); var extend = require('extend'); var http = require('http'); module.exports = function(dependencies) { var graceperiod = dependencies('graceperiod'); var logger = dependencies('logger'); return function(req, res, options) { var target = options.endpoint + '/' + options.path + req.url; var delay = options.graceperiod; var context = { user: req.user._id }; function forwardRequest(callback) { var requestOptions = { method: req.method, url: target, headers: extend({}, req.headers, { ESNToken: req.token.token }) }; if (options.json) { requestOptions.json = options.json; } if (req.body && req.method !== 'DELETE') { requestOptions.body = req.body; } client(requestOptions, function(err, response, body) { if (err) { logger.error('Error while sending request', err); if (options.onError) { return options.onError(response, body, req, res, callback.bind(null, new Error('Error while sending request'))); } return callback(new Error('Error while sending request')); } logger.info('Response from remote service: HTTP %s', response.statusCode); var error; if (response.statusCode >= 200 && response.statusCode < 300) { if (options.onSuccess) { return options.onSuccess(response, body, req, res, callback.bind(null, null, response)); } } else { error = {error: {code: response.statusCode, message: http.STATUS_CODES[response.statusCode], details: response.statusMessage}}; logger.error('Error from remote service : ', response.body); if (options.onError) { return options.onError(response, body, req, res, callback.bind(null, error, response)); } } callback(error, response); }); } function onComplete(err, result) { logger.debug('Task has been completed'); if (err) { logger.error('Error while sending request to remote service', err); } if (result) { logger.info('Remote service response status code', result.statusCode); } } function onCancel() { logger.info('Task has been aborted'); } graceperiod.create(forwardRequest, delay, context, onComplete, onCancel).then(function(task) { logger.info('Grace Task %s has been created for %s', task.id, target); res.set('X-ESN-Task-Id', task.id); return res.status(202).json({id: task.id}); }, function(err) { logger.error('Error while creating deferred task', err); return res.status(500).json({error: {code: 500, message: 'Server Error', details: 'Can not get create deferred task'}}); }); }; };
/*! * Math Expressions Builder * https://project-jste.github.io/ * * Copyright 2018 Jste Team * Released under the GNU AGPLv3 license * https://project-jste.github.io/license * * Date: 2018-02-06 */ import getTranslations from "core/getTranslations"; import { create, all } from "mathjs"; const config = {}; const math = create(all, config); export default function parseMathExp(expression) { expression = expression .replace(/(square root|جذر)/g, "sqrt") .replace(/(multiplied by|ضرب)/g, "*") .replace(/(divided by|فى|على)/g, "/") .replace(/(plus|زائد)/g, "+") .replace(/(minus|ناقص)/g, "-") .replace(/جا/g, "sin") .replace(/جتا/g, "cos") .replace(/ظا/g, "tan") .replace(/سم/g, "cm") .replace(/مم/g, "mm") .replace(/÷/g, "/") .replace(/%/g, "/100") .replace(/(×|x)/g, "*") .replace(new RegExp(getTranslations("centimeters"), "gmi"), "cm") .replace(new RegExp(getTranslations("millimeters"), "gmi"), "mm") .replace(new RegExp(getTranslations("inches"), "gmi"), "in") .replace(new RegExp(getTranslations("pixels"), "gmi"), "px") .replace(new RegExp(getTranslations("points"), "gmi"), "pt") .replace(new RegExp(getTranslations("picas"), "gmi"), "pc") .replace(new RegExp(getTranslations("centimeter"), "gmi"), "cm") .replace(new RegExp(getTranslations("millimeter"), "gmi"), "mm") .replace(new RegExp(getTranslations("inch"), "gmi"), "in") .replace(new RegExp(getTranslations("pixel"), "gmi"), "px") .replace(new RegExp(getTranslations("point"), "gmi"), "pt") .replace(new RegExp(getTranslations("pica"), "gmi"), "pc"); var openingBracketsNo = (expression.match(/\(/g) || []).length; var closingBracketsNo = (expression.match(/\)/g) || []).length; for (var i = 0; i < openingBracketsNo - closingBracketsNo; i++) { expression += ")"; } return math.eval(expression); }
/* This is where are handled "live" events of the application. */ var events = require('events') , URL = require('url') , io = require('socket.io') , extend = require('nodetk/utils').extend , error = require('./utils').error ; var emitter = exports.emitter = new events.EventEmitter(); emitter.on('CREATE:Geek', function(geek) { websocket_listener.broadcast({event: "NewGeek", data: geek.json()}); }); emitter.on('UPDATE:Geek', function(ids, data_) { var data = extend({}, data_); ids.forEach(function(id) { data.id = id; websocket_listener.broadcast({event: "UpdateGeek", data: data}); }); }); // TODO: events to deletion of geeks // ---------------------------------- emitter.on('DELETE:Geek', function(ids) { var data = {ids: ids}; websocket_listener.broadcast({event: "DeleteGeek", data: data}); }); emitter.on('REMOVE:Geek', function() { }); // ---------------------------------- var websocket_listener; var listen = exports.listen = function(server) { /* Plug web-socket on given server to send events to clients. */ websocket_listener = io.listen(server, { resource: "socket.io" , transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling'] }); }; // ----------------------------------- // Connect middleware to handle events post: var post_event = function(req, res) { /* POST /events */ req.form.complete(function(err, fields) { if(err) return error(res, err); var event_name = fields['event'] , event_data = fields['data'] ; if(!event_name || !event_data) { res.writeHead(400, {}); res.end(); return; } data = JSON.parse(event_data); res.writeHead(200, {}); res.end(); websocket_listener.broadcast({event: event_name, data: data}); }); }; exports.connector = function(req, res, next) { var url = URL.parse(req.url); if (req.method == "POST" && url.pathname == "/events") post_event(req, res); else next(); };
/*global describe, should, it, beforeEach, afterEach, curl, sinon, $, Backbone*/ (function() { "use strict"; describe('Bookcase.AddedBooks view', function () { var sandbox; beforeEach(function () { // create a sandbox sandbox = sinon.sandbox.create(); }); afterEach(function () { // restore the environment as it was before sandbox.restore(); }); describe('instance', function () { it('should render 1 book cover if 1 book added', function (done) { curl(['model/book', 'view/bookcase/added-books'], function (BookModel, AddedBooksView) { // Given a addedBooks view and 1 book var addedBooksView = new AddedBooksView(); var books = [ new BookModel({ title: "mybook", path: "/books/mybook.epub", coverUrl: "samples/cover.jpeg" }) ]; // When the view is rendered addedBooksView.render(books); // The book cover should be visible addedBooksView.$el.find("img").attr("src").should.equals("samples/cover.jpeg"); done(); }); }); it('should render only 3 books if 5 added', function (done) { curl(['model/book', 'view/bookcase/added-books'], function (BookModel, AddedBooksView) { // Given a addedBooks view and 5 books var addedBooksView = new AddedBooksView(); var books = []; books.push(new BookModel({ title: "mybook1", path: "/books/mybook1.epub", coverUrl: "samples/cover.jpeg" })); books.push(new BookModel({ title: "mybook2", path: "/books/mybook2.epub", coverUrl: "samples/cover.jpeg" })); books.push(new BookModel({ title: "mybook3", path: "/books/mybook3.epub", coverUrl: "samples/cover.jpeg" })); books.push(new BookModel({ title: "mybook4", path: "/books/mybook4.epub", coverUrl: "samples/cover.jpeg" })); books.push(new BookModel({ title: "mybook5", path: "/books/mybook5.epub", coverUrl: "samples/cover.jpeg" })); // When the view is rendered addedBooksView.render(books); // Only 3 covers should be visible addedBooksView.$el.find("img").should.have.length(3); done(); }); }); it('should not render if no book added', function (done) { curl(['view/bookcase/added-books'], function (AddedBooksView) { // Given a addedBooks view var addedBooksView = new AddedBooksView(); // When the view is rendered addedBooksView.render(); // The book cover should be visible addedBooksView.$el.find("img").should.have.length(0); done(); }); }); }); }); }());
(function () { 'use strict'; angular .module('tasks') .controller('TasksController', TasksController); TasksController.$inject = ['$scope', 'taskResolve', 'Authentication']; function TasksController($scope, task, Authentication) { var vm = this; vm.task = task; vm.step = task.cultivationPlan.steps[task.step]; vm.authentication = Authentication; vm.error = null; $scope.confirmTask = function() { console.log('confirm task: ' + task); task.$confirm(); }; } }());
angular.module('Directory.csvImports.filters', ['Directory.csvImports.models']) .filter('type', ['Schema', function(Schema) { return function (inputs, cond) { if (typeof cond == 'undefined' || cond == null || cond == '' || cond == '*') { return inputs; } var things = []; angular.forEach(inputs, function (thing) { var type; if (type = Schema.types.get(thing.typeId)) { if (type.name == cond) { things.push(thing); } } else { things.push(thing); } }); return things; }; }]) .filter('schemaMapped', ['Schema', function(Schema) { return function (columns, mapping) { var things = []; angular.forEach(columns, function(column) { if (Schema.isMapped(column, mapping)) { things.push(column); } }); return things; } }]) .filter('isExtraField', ['Schema', function(Schema) { return function isExtraField (headers, mapping) { if (mapping) { var things = []; angular.forEach(mapping, function (mapping, index) { var match = false; angular.forEach(Schema.columns, function (column) { if (column.name == mapping.column) match = true; }) if (!match) things.push(headers[index]); }); return things; } else { return headers; } } }]) .filter('sortByImportState', function() { function getIntVal(state) { switch(state) { case 'error': return 0; case 'new': return 1; case 'analyzed': return 2; case 'analyzing': return 3; case 'importing': return 4; case 'queued_analyze': return 5; case 'queud_import': return 6; case 'imported': return 7; case 'cancelled': return 8; default: return 9; } } return function sortByImportState (imports) { if (imports) return imports.sort(function (a, b) { return getIntVal(a.state) - getIntVal(b.state); }) } });
/** * conjoon * (c) 2007-2015 conjoon.org * licensing@conjoon.org * * conjoon * Copyright (C) 2014 Thorsten Suckow-Homberg/conjoon.org * * 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/>. * * $Author$ * $Id$ * $Date$ * $Revision$ * $LastChangedDate$ * $LastChangedBy$ * $URL$ */ Ext.namespace('com.conjoon.groupware.email.form.ui'); /** * * @author Thorsten Suckow-Homberg <tsuckow@conjoon.org> * * @class com.conjoon.cudgets.grid.ui.DefaultFilePanelUi */ com.conjoon.groupware.email.form.ui.AttachmentPanelUi = Ext.extend(com.conjoon.cudgets.grid.ui.DefaultFilePanelUi, { /** * * @protected */ buildPanel : function() { com.conjoon.groupware.email.form.ui.AttachmentPanelUi.superclass .buildPanel.call(this); Ext.apply(this.panel, { split : true, region : 'east', width : 200, hideHeaders : true, hidden : true, title : com.conjoon.Gettext.gettext("Attachments:"), viewConfig : { forceFit : true, markDirty : false, getRowClass : function(record, index) { return 'attachmentRow'; } } }); } });
'use strict'; const Twitter = require('twit'), q = require('q'); module.exports = { getDirectMessages, getMentions }; ///// function getMentions(config, options) { return q.ninvoke(new Twitter(config), 'get', '/statuses/mentions_timeline', options).then(data => _formatTweets(data[0])); } function getDirectMessages(config, options) { return q.ninvoke(new Twitter(config), 'get', '/direct_messages', options).then(data => _formatTweets(data[0])); } function _formatTwitterUser(object) { if (object) { return { id: object.id, displayName: object.name, avatar: object.profile_image_url_https, screenName: '@' + object.screen_name }; } } function _formatTweets(tweets) { return tweets.map(tweet => ({ id: tweet.id, author: _formatTwitterUser(tweet.user || tweet.sender), rcpt: _formatTwitterUser(tweet.recipient), date: new Date(tweet.created_at), text: tweet.text })); }
'use strict'; angular.module('op.live-conference') .factory('attendeeColorsService', ['MAX_ATTENDEES', function(MAX_ATTENDEES) { var colors = [ '#EF5350', '#5C6BC0', '#26A69A', '#FFEE58', '#FF7043', '#00B0FF', '#9CCC65', '#BDBDBD', '#FFA726' ]; function getColorForAttendeeAtIndex(index) { return colors[index % MAX_ATTENDEES]; } return { getColorForAttendeeAtIndex: getColorForAttendeeAtIndex }; }]);
/* 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 as published by the Free Software Foundation 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/>. */ /*Author : Raz * * LMPQ Maze - Reactor - Spawn Monster */ function act(){ rm.spawnMonster(9400211, 2); rm.spawnMonster(9400212, 2); rm.mapMessage(5, "Some monsters are summoned."); }
'use strict'; /* * atkeeper is used to kill Source Keeper (melee version) * * Attacks source keeper, move away when hits below 'threshold' * If no source keeper is available move to position where the next will spawn */ roles.atkeepermelee = {}; roles.atkeepermelee.boostActions = ['fatigue', 'attack', 'heal', 'damage']; roles.atkeepermelee.settings = { layoutString: 'MAH', amount: [25, 19, 6], fillTough: true, }; roles.atkeepermelee.action = function(creep) { // TODO Untested creep.spawnReplacement(); creep.setNextSpawn(); const getNextSourceKeeper = function(creep) { const sourceKeeper = creep.room.findPropertyFilter(FIND_STRUCTURES, 'structureType', [STRUCTURE_KEEPER_LAIR]); const sourceKeeperNext = _.sortBy(sourceKeeper, (object) => object.ticksToSpawn); return sourceKeeperNext[0]; }; const heal = function(creep) { creep.say('heal'); let target = creep.findClosestSourceKeeper(); if (target === null) { target = getNextSourceKeeper(creep); creep.log('heal: ' + JSON.stringify(target)); } const range = creep.pos.getRangeTo(target); if (range > 1) { if (range > 7) { const sourcers = creep.pos.findInRangePropertyFilter(FIND_MY_CREEPS, 3, 'memory.role', ['sourcer'], false, { filter: (target) => target.hits < target.hitsMax, }); if (sourcers.length > 0) { creep.heal(sourcers[0]); return true; } } creep.heal(creep); if (creep.hits === creep.hitsMax || range > 5 || range < 5) { const returnCode = creep.moveTo(target); if (returnCode !== OK) { creep.log(`heal.move returnCode: ${returnCode}`); } } return true; } return false; }; const attack = function(creep) { creep.say('attack'); let target = creep.findClosestSourceKeeper(); if (target === null) { target = getNextSourceKeeper(creep); } if (creep.pos.getRangeTo(target.pos) > 1) { creep.moveTo(target); } creep.attack(target); return true; }; if (heal(creep)) { return true; } if (attack(creep)) { return true; } creep.heal(creep); return true; }; roles.atkeepermelee.execute = function(creep) { creep.log('Execute!!!'); };
tinyMCE.addI18n("en.advhr_dlg",{width:"Width",size:"Height",noshade:"No shadow"});
import Component from "@ember/component"; import { computed } from "@ember/object"; import { reads } from "@ember/object/computed"; import { inject as service } from "@ember/service"; import { task, timeout } from "ember-concurrency"; import moment from "moment"; /** * Component for a tooltip showing the progress of a task or project * * @class ProgressTooltipComponent * @extends Ember.Component * @public */ const ProgressTooltipComponent = Component.extend({ /** * No tag name, since we attach the tooltip to a given target * * @property {String} tagName * @public */ tagName: "", /** * Init hook, check the required params * * @method init * @public */ init(...args) { this._super(...args); /* istanbul ignore next */ if (!this.get("model")) { throw new Error("A model must be given"); } /* istanbul ignore next */ if (!this.get("target")) { throw new Error("A target for the tooltip must be given"); } }, /** * The delay between becoming 'visible' and fetching the data * * @property {Number} delay * @public */ delay: 300, /** * Metadata fetcher service * * @property {MetadataFetcherService} metadataFetcher * @public */ metadataFetcher: service("metadata-fetcher"), /** * The estimated time * * @property {moment.duration} estimated * @public */ estimated: reads("model.estimatedTime"), /** * The spent time * * @property {moment.duration} spent * @public */ spent: moment.duration(), /** * The current progress * * @property {Number} progress * @public */ progress: computed("estimated", "spent", function() { return this.get("estimated") && this.get("estimated").asHours() ? this.get("spent") / this.get("estimated") : 0; }), /** * The color of the badge and progress bar * * @property {String} color * @public */ color: computed("progress", function() { if (this.get("progress") > 1) { return "danger"; } else if (this.get("progress") >= 0.9) { return "warning"; } return "success"; }), /** * Whether the tooltip is visible or not * * @property {EmberConcurrency.Task} tooltipVisible * @public */ tooltipVisible: computed("visible", function() { const task = this.get("_computeTooltipVisible"); task.perform(this.get("visible")); return task; }), /** * Task to toggle the visibility and fetch the needed data * * @method _computeTooltipVisible * @param {Boolean} visible Whether the tooltip needs to become visible * @return {Boolean} Whether the tooltip is now visible * @public */ _computeTooltipVisible: task(function*(visible) { if (visible) { yield timeout(this.get("delay")); const { spentTime, spentBillable } = yield this.get( "metadataFetcher.fetchSingleRecordMetadata" ) .linked() .perform(this.get("model.constructor.modelName"), this.get("model.id")); this.setProperties({ spent: spentTime, billable: spentBillable }); } return visible; }).restartable() }); export default ProgressTooltipComponent;
/** * Helpers to manipulate a reactive var for the purpose of more readable dan shorter code * * @class reactiveVarHelpers * @memberof Partup.client */ Partup.client.reactiveVarHelpers = { /** * Helper to increment a reactive number variable * * @memberof Partup.client.reactiveVarHelpers * @param {ReactiveVar} reactive variable to increment * @param {Number} ammount to increment */ incrementNumber: function(reactiveNumber, ammount) { var number = reactiveNumber.get(); number = number + ammount; reactiveNumber.set(number); } };
module.exports = { 'Manuscripts title is correct': function (test) { test .open('http://134.76.21.92:8080/archaeo18/') .click('#linkhandschriften') .assert.title().is('Archaeo 18: Handschriften', 'It has title') .screenshot('screenshots/Manuscripts.png') .done(); } };
/* * Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U * * This file is part of lightweightM2M-iotagent * * lightweightM2M-iotagent 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. * * lightweightM2M-iotagent 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 lightweightM2M-iotagent. * If not, seehttp://www.gnu.org/licenses/. * * For those usages not covered by the GNU Affero General Public License * please contact with::[contacto@tid.es] */ 'use strict'; var iotAgentLib = require('iotagent-node-lib'), lwm2mLib = require('lwm2m-node-lib').server, omaInverseRegistry = require('../../../omaRegistryInverseMap'), lwm2mUtils = require('../../lwm2mUtils'), logger = require('logops'), async = require('async'), apply = async.apply, commons = require('../../commons'), context = { op: 'IOTAgent.LWM2MHandlers' }; /** * Handle incoming information from an active attribute of the LWM2M device in the southbound. * * @param {Object} registeredDevice LWM2M Device sending the information. * @param {String} name Name of the attribute to update. * @param {String} type Type of the attribute to update. * @param {String} value New value for the attribute. */ function activeDataHandler(registeredDevice, name, type, value) { var attributes = [ { name: name, type: type, value: value } ]; logger.debug(context, 'Handling data from device [%s]', registeredDevice.id); iotAgentLib.update( registeredDevice.name, registeredDevice.type, '', attributes, registeredDevice, function handleUpdateEntity(error) { if (error) { logger.error(context, 'Unknown error connecting with the Context Broker: ' + error); } else { logger.debug(context, 'Data handled successfully'); } } ); } /** * Given a registered device and a text payload indicating a list of the OMA Objects supported by a client, creates an * observer for each active resource associated with that kind of device. * * @param {String} payload Text representation of the list of objects supported by the client. * @param {Object} registeredDevice Object representing the LWM2M device data. */ function observeActiveAttributes(payload, registeredDevice, callback) { var objects = lwm2mUtils.parseObjectUriList(payload), activeAttributes = [], observationList = []; if (registeredDevice.active) { activeAttributes = registeredDevice.active; } else if (commons.getConfig().ngsi.types[registeredDevice.type]) { activeAttributes = commons.getConfig().ngsi.types[registeredDevice.type].active; } for (var i = 0; i < activeAttributes.length; i++) { var lwm2mMapping = {}; if (registeredDevice.internalAttributes && registeredDevice.internalAttributes.lwm2mResourceMapping && registeredDevice.internalAttributes.lwm2mResourceMapping[activeAttributes[i].name]) { lwm2mMapping = registeredDevice.internalAttributes.lwm2mResourceMapping[activeAttributes[i].name]; } else if (commons.getConfig().ngsi.types[registeredDevice.type]) { lwm2mMapping = commons.getConfig() .ngsi .types[registeredDevice.type] .lwm2mResourceMapping[activeAttributes[i].name]; } else if (omaInverseRegistry[activeAttributes[i].name]) { lwm2mMapping = omaInverseRegistry[activeAttributes[i].name]; if (!lwm2mMapping.objectInstance) { lwm2mMapping.objectInstance = 0; } } else { callback('Couldn\'t find any way to map the active attribute: ' + activeAttributes[i].name); return; } if (lwm2mMapping) { var mappedUri = '/' + lwm2mMapping.objectType + '/' + lwm2mMapping.objectInstance; for (var j = 0; j < objects.length; j++) { if (mappedUri === objects[j]) { observationList.push(apply(lwm2mLib.observe, registeredDevice.internalId, lwm2mMapping.objectType, lwm2mMapping.objectInstance, lwm2mMapping.objectResource, apply(activeDataHandler, registeredDevice, activeAttributes[i].name, activeAttributes[i].type) )); } } } } setImmediate(function() { async.series(observationList, function(error) { if (error) { logger.error('Could not complete the observer creation processes due to the following error: ' + error); } else { logger.debug('Observers created successfully.'); } }); }); callback(null); } exports.observeActiveAttributes = observeActiveAttributes;
var searchData= [ ['csvtosdconverter',['CsvToSdConverter',['../classCsvToSdConverter.xhtml',1,'']]], ['cutrender_5finfo',['CutRender_info',['../structUtils_1_1CutRender__info.xhtml',1,'Utils']]] ];
export const authStatus = state => { state.status }
import { combineReducers } from 'redux'; import { GROUP_LIST_UPDATED, GROUP_SELECTED, GROUP_REMOVED, GROUP_UPDATED, GROUP_CREATED, EDIT_GROUP, CREATE_GROUP, FINISH_EDIT_GROUP, } from './actions'; import { getGroupsView } from '../selectors'; export const groups = (state = [], action) => { switch (action.type) { case GROUP_LIST_UPDATED: return [...action.payload.groups]; case GROUP_REMOVED: return state.filter(({ id }) => id !== action.payload.groupId); case GROUP_UPDATED: return state.map(group => (group.id === action.payload.group.id ? action.payload.group : group), ); case GROUP_CREATED: return [...state, action.payload.group]; default : return state; } }; export const selected = (state = 'unassigned', action) => { switch (action.type) { case GROUP_SELECTED: return action.payload.groupId; case GROUP_REMOVED: return 'unassigned'; default : return state; } }; export const isEditing = (state = false, action) => { switch (action.type) { case CREATE_GROUP: return true; case EDIT_GROUP: return true; case FINISH_EDIT_GROUP: return false; default : return state; } }; export const isCreating = (state = false, action) => { switch (action.type) { case CREATE_GROUP: return true; case FINISH_EDIT_GROUP: return false; default : return state; } }; export default combineReducers({ groups, selected, isEditing, isCreating, }); export const getIsEditActive = state => getGroupsView(state).isEditing; export const getIsCreating = state => getGroupsView(state).isCreating; export const getGroups = state => getGroupsView(state).groups; export const getSelectedGroupId = state => getGroupsView(state).selected; export const getSelectedGroup = state => { const groupList = getGroupsView(state).groups; const selectedId = getGroupsView(state).selected; return groupList.find(({ id }) => selectedId === id); };
var Promise = require('bluebird'); var _ = require('lodash') var assignGroupMemberships = function (groups, memberships, callback) { var flatMemberships = _.flatten(memberships); return Promise.map(groups, function(group) { var newGroup = _.clone(group); newGroup['memberships'] = _.filter(flatMemberships, function(membership) { return membership.group['@id'] === group['@id'] }) return newGroup }).nodeify(callback); } module.exports = Promise.promisify(assignGroupMemberships)
define(["../..", "./Read"], function(dojo) { // module: // dojo/data/api/Identity // summary: // TODOC dojo.declare("dojo.data.api.Identity", dojo.data.api.Read, { // summary: // This is an abstract API that data provider implementations conform to. // This file defines methods signatures and intentionally leaves all the // methods unimplemented. getFeatures: function(){ // summary: // See dojo.data.api.Read.getFeatures() return { 'dojo.data.api.Read': true, 'dojo.data.api.Identity': true }; }, getIdentity: function(/* item */ item){ // summary: // Returns a unique identifier for an item. The return value will be // either a string or something that has a toString() method (such as, // for example, a dojox.uuid.Uuid object). // item: // The item from the store from which to obtain its identifier. // exceptions: // Conforming implementations may throw an exception or return null if // item is not an item. // example: // | var itemId = store.getIdentity(kermit); // | assert(kermit === store.findByIdentity(store.getIdentity(kermit))); throw new Error('Unimplemented API: dojo.data.api.Identity.getIdentity'); }, getIdentityAttributes: function(/* item */ item){ // summary: // Returns an array of attribute names that are used to generate the identity. // For most stores, this is a single attribute, but for some complex stores // such as RDB backed stores that use compound (multi-attribute) identifiers // it can be more than one. If the identity is not composed of attributes // on the item, it will return null. This function is intended to identify // the attributes that comprise the identity so that so that during a render // of all attributes, the UI can hide the the identity information if it // chooses. // item: // The item from the store from which to obtain the array of public attributes that // compose the identifier, if any. // example: // | var itemId = store.getIdentity(kermit); // | var identifiers = store.getIdentityAttributes(itemId); // | assert(typeof identifiers === "array" || identifiers === null); throw new Error('Unimplemented API: dojo.data.api.Identity.getIdentityAttributes'); }, fetchItemByIdentity: function(/* object */ keywordArgs){ // summary: // Given the identity of an item, this method returns the item that has // that identity through the onItem callback. Conforming implementations // should return null if there is no item with the given identity. // Implementations of fetchItemByIdentity() may sometimes return an item // from a local cache and may sometimes fetch an item from a remote server, // // keywordArgs: // An anonymous object that defines the item to locate and callbacks to invoke when the // item has been located and load has completed. The format of the object is as follows: // { // identity: string|object, // onItem: Function, // onError: Function, // scope: object // } // The *identity* parameter. // The identity parameter is the identity of the item you wish to locate and load // This attribute is required. It should be a string or an object that toString() // can be called on. // // The *onItem* parameter. // Function(item) // The onItem parameter is the callback to invoke when the item has been loaded. It takes only one // parameter, the item located, or null if none found. // // The *onError* parameter. // Function(error) // The onError parameter is the callback to invoke when the item load encountered an error. It takes only one // parameter, the error object // // The *scope* parameter. // If a scope object is provided, all of the callback functions (onItem, // onError, etc) will be invoked in the context of the scope object. // In the body of the callback function, the value of the "this" // keyword will be the scope object. If no scope object is provided, // the callback functions will be called in the context of dojo.global. // For example, onItem.call(scope, item, request) vs. // onItem.call(dojo.global, item, request) if(!this.isItemLoaded(keywordArgs.item)){ throw new Error('Unimplemented API: dojo.data.api.Identity.fetchItemByIdentity'); } } }); return dojo.data.api.Identity; });