text
stringlengths
2
6.14k
/*global document, window, gdn, jQuery*/ jQuery(($) => { // Check if an element's top is visible in the viewport. function inview(target) { target = $(target); return target.length && target.offset().top > window.pageYOffset; } // Find the previous comment of the mentioned user in this discussion. function get(mention) { // Extract the CommentID or DiscussionID from the parent item. const commentID = mention.closest('.Item')[0].id.replace(/\D+/, ''); // Extract the name of the mentioned user. const username = mention[0].innerHTML.replace(/^@"?(.*?)"?$/, '$1'); return $.getJSON(gdn.url( 'plugin/quotemention' + '/' + gdn.definition('DiscussionID') + '/' + commentID + '/' + encodeURIComponent(username) )); } // mouseenter handler: Show a tooltip and/or highlight a post. function show({currentTarget}) { const mention = $(currentTarget) // Keep track of the hover state manually for the "done" callback. .data('mouseOver', '1'); const loaded = mention.data('quoteMention'); const showProgress = gdn.definition('quoteMention.showProgress', true); let target; if (loaded !== undefined) { target = $(loaded).addClass('mentionHighlight'); } else { get(mention) .done((data) => { // If the mouse is still over the element, highlight the referenced post. if (mention.data('mouseOver')) { target = $(data.target).addClass('mentionHighlight'); // Hide the tooltip if the target post is visible. mention.tooltipster(inview(target) ? 'hide' : 'show'); } mention // Replace the content with the actual post. .tooltipster('content', data.html) // Save the target for highlighting. .data('quoteMention', data.target); }) .fail(() => { // No post found or request failed: Remove the tooltip. mention .tooltipster('disable') // Prevent further requests. .data('quoteMention', false); }); } // Show the tooltip if it is loading or if the post is not fully visible. if ((!loaded && showProgress) || (loaded && !inview(target))) { mention.tooltipster('show'); } } // mouseleave handler: Hide a tooltip. function hide({currentTarget}) { const mention = $(currentTarget) .tooltipster('hide') .data('mouseOver', ''); $(mention.data('quoteMention')).removeClass('mentionHighlight'); } // Register event handlers for all mentions on the page. function init() { const maxWidth = gdn.definition('quoteMention.maxWidth', 350); const position = gdn.definition('quoteMention.position', 'bottom'); // Initialized mentions get the "quoteMention" class. $('.ItemComment .Message a:not(.quoteMention)') // Only grab links that start with an @. .filter((ignore, {innerHTML}) => innerHTML.substring(0, 1) === '@') .addClass('quoteMention') // Initialize the tooltip with the progress animation. .tooltipster({ content: '<span class="Progress"/>', contentAsHTML: true, trigger: 'custom', position, speed: 0, updateAnimation: false, theme: 'tooltipster-vanilla', maxWidth }) .hover(show, hide); } // Search for new mentions when comments are added or changed. $(document).on('CommentAdded CommentEditingComplete CommentPagingComplete', init); init(); });
/** * Created by dlouvard_imac on 26/12/2016. */ (function () { var laravel = { initialize: function () { this.methodLinks = $('a[data-method]'); this.registerEvents(); }, registerEvents: function () { this.methodLinks.on('click', this.handleMethod); }, handleMethod: function (e) { var link = $(this); var httpMethod = link.data('method').toUpperCase(); var form; // If the data-method attribute is not PUT or DELETE, // then we don't know what to do. Just ignore. if ($.inArray(httpMethod, ['PUT', 'DELETE', 'POST']) === -1) { return; } // Allow user to optionally provide data-confirm="Are you sure?" if (link.data('confirm')) { $.SmartMessageBox({ //: "Confirmation ?", title: link.data('confirm'), buttons: '[No][Yes]' }, function (ButtonPressed) { if (ButtonPressed === "Yes") { form = laravel.createForm(link); form.submit(); } if (ButtonPressed === "No") { return false } }); } else { form = laravel.createForm(link); form.submit(); } e.preventDefault(); }, createForm: function (link) { var form = $('<form>', { 'method': 'POST', 'action': link.attr('href') }); var token = $('<input>', { 'type': 'hidden', 'name': '_token', 'value': $('meta[name=csrf_token]').attr('content') }); var hiddenInput = $('<input>', { 'name': '_method', 'type': 'hidden', 'value': link.data('method') }); return form.append(token, hiddenInput) .appendTo('body'); } }; laravel.initialize(); })();
~function (global) { // status var PENDING = 0, FULFILLED = 1, REJECTED = 2; var Promise = function (fun) { var me = this, resolve = function (val) { me.resolve(val); }, reject = function (val) { me.reject(val); }; me._status = PENDING; me._onFulfilled = null; me._onRejected = null; (typeof fun === 'function') && fun(resolve, reject); }; var fn = Promise.prototype; fn.then = function (resolve, reject) { var pms = new Promise(); this._onFulfilled = function (val) { var ret = resolve ? resolve(val) : val; if (Promise.isPromise(ret)) { ret.then(function (val) { pms.resolve(val); }); } else{ pms.resolve(ret); } }; this._onRejected = function (val) { var ret = reject ? reject(val) : val; pms.reject(ret); }; return pms; } fn.catch = function (reject) { return this.then(null, reject); } fn.resolve = function (val) { if (this._status === PENDING) { this._status = FULFILLED; this._onFulfilled && this._onFulfilled(val); } } fn.reject = function (val) { if (this._status === PENDING) { this._status = REJECTED; this._onRejected && this._onRejected(val); } } fn.all = function (arr) { var pms = new Promise(); var len = arr.length, i = -1, count = 0, results = []; while (++i < len) { ~function (i) { arr[i].then( function (val) { results[i] = val; if (++count === len) { pms.resolve(results); } }, function (val) { pms.reject(val); } ); }(i); } return pms; } fn.resolve = function (obj) { var ret; if (!Promise.isPromise(obj)) { ret = obj; obj = new Promise(); } setTimeout(function () { obj.resolve(ret); }); return obj; } fn.reject = function (obj) { var ret; if (!Promise.isPromise(obj)) { ret = obj; obj = new Promise(); } setTimeout(function () { obj.reject(ret); }); return obj; } fn.isPromise = function (obj) { return obj instanceof Promise; } global.Promise = Promise; try{ module.exports = Promise; } catch (e){} }(this);
jQuery( document ).ready(function() { jQuery( '.pane-bundle-widget-sketch span' ).click(function() { jQuery( '.pane-bundle-widget-sketch .container' ).toggle( 'slide' ); }); });
Ext.define('Rd.view.i18n.winPhpAdd', { extend: 'Ext.window.Window', alias : 'widget.winPhpAdd', title : i18n('sAdd_Msgid'), layout: 'fit', autoShow: true, width: 300, iconCls: 'add', glyph: Rd.config.icnAdd, initComponent: function() { var me = this; me.items = [ { xtype: 'form', border: false, layout: 'anchor', width: '100%', flex: 1, defaults: { anchor: '100%' }, fieldDefaults: { msgTarget: 'under', labelClsExtra: 'lblRd', labelAlign: 'top', labelSeparator: '', margin: 15 }, defaultType: 'textfield', items: [ { xtype: 'textfield', fieldLabel: i18n('sMsgid'), name : "msgid", allowBlank:false, blankText: i18n('sSpecify_a_valid_name_please') }, { xtype: 'textfield', fieldLabel: i18n('sMsgstr'), name : "msgstr", allowBlank:true }, { xtype : 'textfield', name : "comment", fieldLabel: i18n('sOptional_Comment') }], buttons: [ { itemId: 'save', text: i18n('sOK'), scale: 'large', iconCls: 'b-btn_ok', glyph: Rd.config.icnYes, formBind: true, margin: '0 20 40 0' } ] } ]; me.callParent(arguments); } });
// // Draws the player object if he is mongoman // var createPlayerMongoman = function() { return { id:"mongoman", group:"player", tileset:"mongoman", killed:false, scorecombo:1, time:-1, initialize: function() { // Sets up the objects, properties on our 2D map toys.topview.initialize(this,{ colh:gbox.getTiles(this.tileset).tileh, colw:gbox.getTiles(this.tileset).tilew, staticspeed:4, nodiagonals:true, noreset:true, frames:{ still:{ speed:2, frames:[0] }, hit:{speed:1,frames:[0,1,0,1]}, standup:{ speed:1, frames:[0] }, standdown:{ speed:1, frames:[0] }, standleft:{ speed:1, frames:[0] }, standright:{ speed:1, frames:[0] }, movingup:{speed:3,frames:[0,2,1,2] }, movingdown:{speed:3,frames:[0,4,3,4] }, movingleft:{speed:3,frames:[0,6,5,6] }, movingright:{speed:3,frames:[0,6,5,6] } } }); }, first: function() { // Ensure we are showing the current correct frame out of 10 possible this.counter = (this.counter+1) % 10; // If capman is still alive and the game is not "hold" (level changing fadein/fadeouts etc.) and the "bullet timer" is not stopping the game. if(!this.killed && !maingame.gameIsHold() && !maingame.bullettimer) { // First of all, let's move. // A little trick: capman cannot change direction, if hits a wall, so we backup capman's status here. Will restored if capman hits the wall. var olddata = help.createModel(this,["x","y","accx","accy","xpushing","ypushing","facing"]); // Set up the control keys for the player toys.topview.controlKeys(this,{left:"left",right:"right",up:"up",down:"down"}); // Apply forces to the model toys.topview.applyForces(this); // Handle collisions with the map, accuracy and tolerance controls how precise the collision detection is toys.topview.tileCollision(this, maze, "map", null, {tolerance: 0, approximation: 1}); // The nuber of ticks the ghost i in danger if(this.time > 0) { this.time--; } else if(this.time == 0) { // Fire eat a powerpill message client.dispatchCommand({type:'powerpill', value:false}); this.time = -1; } // If we have a collision if(this.touchedup || this.toucheddown || this.touchedleft || this.touchedright) { help.copyModel(this, olddata); toys.topview.applyForces(this); toys.topview.tileCollision(this, maze, "map", null, {tolerance:0,approximation:1}); // Build the object and send it to the server serialized updateObject = {x:this.x, y:this.y, accx:this.accx, accy:this.accy, xpushing:this.xpushing, ypushing:this.ypushing, facing:this.facing}; } else { if(olddata.x != this.x || olddata.y != this.y || olddata.accx != this.accx || olddata.accy != this.accy || olddata.xpushing != this.xpushing || olddata.ypushing != this.ypushing || olddata.facing != this.facing) { // Build the object and send it to the server serialized updateObject = {x:this.x, y:this.y, accx:this.accx, accy:this.accy, xpushing:this.xpushing, ypushing:this.ypushing, facing:this.facing}; } else { updateObject = null; } } // The side warp. If capman reach one of the left or right side of the maze, is spawn on the other side,in the same direction if ((this.x<0) && (this.facing == toys.FACE_LEFT)) { this.x = maze.w - this.w; } else if ((this.x > (maze.w - this.w)) && (this.facing == toys.FACE_RIGHT)) { this.x = 0; } // setFrame sets the right frame checking the facing and the defined animations in "initialize" toys.topview.setFrame(this); // Grab the current tile in the map object var inmouth = help.getTileInMap(this.x + this.hw, this.y + this.hh, maze, 0); // Handle pills if(inmouth>7) { if(inmouth == 9) { this.scorecombo = 1; if(sound) SoundJS.play("powerpill"); if(gbox.getObject("ghosts","ghost1")) gbox.getObject("ghosts","ghost1").makeeatable(); if(gbox.getObject("ghosts","ghost2")) gbox.getObject("ghosts","ghost2").makeeatable(); if(gbox.getObject("ghosts","ghost3")) gbox.getObject("ghosts","ghost3").makeeatable(); if(gbox.getObject("ghosts","ghost4")) gbox.getObject("ghosts","ghost4").makeeatable(); if(gbox.getObject("player", "playerghost")) gbox.getObject("player","playerghost").makeeatable(); // Fire eat a powerpill message client.dispatchCommand({type:'powerpill', value:true}); // Set count down time this.time = 150; } else { if(sound) SoundJS.play("eat"); maingame.hud.addValue("score","value",10); } var mouthx = help.xPixelToTileX(maze,this.x + this.hw); var mouthy = help.yPixelToTileY(maze,this.y + this.hh); help.setTileInMap(gbox.getCanvasContext("mazecanvas"), maze, mouthx, mouthy, null); maingame.pillscount--; } } }, blit:function() { if (!this.killed) { gbox.blitTile(gbox.getBufferContext(), {tileset:this.tileset, tile:this.frame, dx:this.x, dy:this.y, fliph:this.fliph, flipv:this.flipv, camera:this.camera, alpha:1}); } }, // And now, a custom method. This one will kill the player and will be called by ghosts, when colliding with capman. kill:function() { if(!this.killed) { // // Fire off I'm dead message // client.dispatchCommand({type:'dead', score:maingame.hud.getNumberValue("score","value")}); // Animate death this.killed = true; if(sound) SoundJS.play("die"); maingame.playerDied({wait:50}); toys.generate.sparks.simple(this,"sparks",null,{tileset:this.tileset,frames:{speed:4,frames:[6,5,7,8,9,9,9,9]}}); } } } }
// Full high scores view define([ "jquery", "underscore", "backbone", "dispatcher", "config", "views/score-table-cells" ], function ($, _, Backbone, dispatcher, config, TableCells) { var AllScoresView = Backbone.View.extend({ el: '#all-scores', headingTemplate: _.template($('#all-scores-heading').html()), events: { "click #all-scores-variant0" : "selectVariant0Scores", "click #all-scores-variant1" : "selectVariant1Scores", "click #all-scores-variant2" : "selectVariant2Scores", "click #all-scores-user" : "selectUserScores", "click #all-scores-daily" : "selectDailyScores", "click #all-scores-all" : "selectAllScores" }, initialize: function() { this.listenTo(this.model, "add", this.render); this.listenTo(this.model, "change", this.render); this.grid = new Backgrid.Grid({ columns: [ { name: "username", label: "User name", cell: "string", sortable: false, editable: false }, { name: "prettyDate", label: "Date", cell: "string", sortable: true, editable: false }, { name: "prettyVariant", label: "Version", cell: "string", sortable: true, editable: false }, { name: "score", label: "Score", cell: "integer", sortable: true, editable: false }, { name: "level", label: "Level", cell: TableCells.levelCell, sortable: true, editable: false }, { name: "seed", label: "Seed", cell: "string", sortable: true, editable: false }, { name: "description", label: "Message", cell: "string", sortable: false, editable: false }, { name: "recording", label: "Recording", cell: TableCells.watchGameUriCell, sortable: false, editable: false }], collection: this.model }); this.paginator = new Backgrid.Extension.Paginator({ collection: this.model }); this.setVariantNoScores(0); this.refresh(); }, render: function() { this.$el.html(this.headingTemplate({ username: this.model.username })); $("#all-scores-grid").append(this.grid.render().$el); $("#all-scores-paginator").append(this.paginator.render().$el); return this; }, refresh: function() { this.model.fetch(); }, login: function(userName) { this.model.setUserName(userName); this.render(); }, logout: function() { this.model.clearUserName(); this.render(); }, activate: function() { //Model may be in an old-state, so refresh this.setVariantNoScores(0); this.refresh(); }, quit: function() { this.refresh(); }, selectUserScores: function(event) { event.preventDefault(); this.model.setUserTopScores(); this.refresh(); }, selectDailyScores: function(event) { event.preventDefault(); this.model.setDailyTopScores(); this.refresh(); }, selectVariant0Scores: function(event) { event.preventDefault(); this.setVariantNoScores(0); this.refresh(); }, setVariantNoScores: function(variantNo) { this.model.setVariantTopScores(config.variants[variantNo].code); }, selectVariant1Scores: function(event) { event.preventDefault(); this.setVariantNoScores(1); this.refresh(); }, selectVariant2Scores: function(event) { event.preventDefault(); this.setVariantNoScores(2); this.refresh(); } }); return AllScoresView; });
var searchData= [ ['ime_5faddr_5fmax',['IME_ADDR_MAX',['../_a_p_i_8h.html#a6d369ee1e214daea8bf939aa817b5d00',1,'API.h']]], ['input',['INPUT',['../_a_p_i_8h.html#a1bb283bd7893b9855e2f23013891fc82',1,'API.h']]], ['input_5fanalog',['INPUT_ANALOG',['../_a_p_i_8h.html#a877f7490feac007f3a904ece06afe87a',1,'API.h']]], ['input_5ffloating',['INPUT_FLOATING',['../_a_p_i_8h.html#ac31084f7ffdfd4325b3703718fce74ea',1,'API.h']]], ['interrupt_5fedge_5fboth',['INTERRUPT_EDGE_BOTH',['../_a_p_i_8h.html#ab0ce5d2283faeb80389f8b54a925a15b',1,'API.h']]], ['interrupt_5fedge_5ffalling',['INTERRUPT_EDGE_FALLING',['../_a_p_i_8h.html#a5d01e5bd9626ca29af3e1e9385e58427',1,'API.h']]], ['interrupt_5fedge_5frising',['INTERRUPT_EDGE_RISING',['../_a_p_i_8h.html#a8bd8f2fe1b638ebff63e702d14880b12',1,'API.h']]] ];
(function ($, scope, undefined) { function NextendSmartSlider() { this.sliders = {}; this.readys = {}; this._resetCounters = []; } NextendSmartSlider.prototype.makeReady = function (id, slider) { this.sliders[id] = slider; if (typeof this.readys[id] !== 'undefined') { for (var i = 0; i < this.readys[id].length; i++) { this.readys[id][i].call(slider, slider, slider.sliderElement); } } }; NextendSmartSlider.prototype.ready = function (id, callback) { if (typeof this.sliders[id] !== 'undefined') { callback.call(this.sliders[id], this.sliders[id], this.sliders[id].sliderElement); } else { if (typeof this.readys[id] == 'undefined') { this.readys[id] = []; } this.readys[id].push(callback); } }; NextendSmartSlider.prototype.trigger = function (el, event) { var $el = n2(el), split = event.split(','), slide = $el.closest('.n2-ss-slide,.n2-ss-static-slide'); if (split.length > 1) { if ($.inArray(el, this._resetCounters) == -1) { this._resetCounters.push(el); slide.on('layerAnimationSetStart.resetCounter', function () { $el.data('eventCounter', 0); }); } var counter = $el.data('eventCounter') || 0 event = split[counter]; counter++; if (counter > split.length - 1) { counter = 0; } $el.data('eventCounter', counter); } slide.triggerHandler(event); }; NextendSmartSlider.prototype.applyAction = function (el, action) { var ss = n2(el).closest('.n2-ss-slider').data('ss'); ss[action].apply(ss, Array.prototype.slice.call(arguments, 2)); }; window.n2ss = new NextendSmartSlider(); })(n2, window);
var Backbone = require('backbone'); module.exports = Backbone.Model.extend({ defaults: { "name": "", "email": "", "phone": "" }, url: '/users' });
describe('Testing JavaScript types', function() { // we will use jQuery to manipulate HTML for testing... beforeEach(function() { // empty for now... }); describe('Testing JavaScript numbers', function() { /** * parseInt is used to parse a string to an integer. */ it('string, integer and parseInt', function() { var aString = '123'; expect(aString).toBe('123'); expect(aString).not.toBe(123); var theNumber = parseInt(aString); expect(theNumber).toBe(123); expect(theNumber).not.toBe('123'); }); /** * test modulus operator for numbers. */ it('modulus opterator for numbers', function() { var x = 5; var a = 4; var b = 0; var y = 2; expect(x % y).toBe(1); expect(a % y).toBe(0); expect(b % y).toBe(0); }); /** * test the divide */ it('Pagination calculation', function() { var total = 13; var perPage = 10; // ceil will return the smallest integer // greater then or equal to the givan number. var totalPages = Math.ceil(total / perPage); expect(totalPages).toBe(2); // case for the exact page! total = 60; perPage = 5; totalPages = Math.ceil(total/perPage); expect(totalPages).toBe(12); // case for less than one page. total = 8; perPage = 10; totalPages = Math.ceil(total/perPage); expect(totalPages).toBe(1); }); }); describe('Testing JavaScript JSON format', function() { /** * try to define an array by using JSON format. */ it('define a simple array', function() { // simple array with strings. var aArray = ['a', 'b']; // Array in JavaScript is an object type. expect(typeof aArray).toBe('object'); // the function isArray will check the given object // is an array or not! expect(Array.isArray(aArray)).toBe(true); // JavasScript array allow mix data type for each item aArray = ['a', 'b', 1, 3, {a: '123'}]; // this array has string as its first value. expect(typeof aArray[0]).toBe('string'); expect(typeof aArray[2]).toBe('number'); expect(typeof aArray[4]).toBe('object'); }); /** * try to define an object by using JSON format. */ it('define a simple object', function() { // simple object. var anObject = { a: 'abc', b: 123, // the ending item should NOT have separator. c: 'cde' }; // type should be an object. expect(typeof anObject).toBe('object'); // inspect the values. expect(anObject.a).toBe('abc'); expect(anObject.b).toBe(123); // get keys of the object. expect(Object.keys(anObject)).toEqual(['a', 'b', 'c']); }); }); });
//= require jquery //= require jquery_ujs //= require_tree . $(function() { // --- Using the default options: $(".expand").toggler(); }); (function ($) { // Log all jQuery AJAX requests to Google Analytics $(document).ajaxSend(function(event, xhr, settings){ if (typeof _gaq !== "undefined" && _gaq !== null) { _gaq.push(['_trackPageview', settings.url]); } }); })(jQuery); // paginate with AJAX $(function() { $("a.paginator-link").on("click", function(){ $.getScript(this.href); return false; }); }); // bitcoin address qr codes $(document).ready(function() { bitcoinaddress.init({ // jQuery selector defining bitcon addresses on the page // needing the boost selector: ".bitcoin-address", // Id of the DOM template element we use to decorate the addresses. // This must contain placefolder .bitcoin-address template: "bitcoin-address-template", // Passed directly to QRCode.js // https://github.com/davidshimjs/qrcodejs qr : { width: 128, height: 128, colorDark : "#000000", colorLight : "#ffffff" } }); });
/* * Kendo UI v2015.2.805 (http://www.telerik.com/kendo-ui) * Copyright 2015 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ (function(f, define){ define([], f); })(function(){ (function( window, undefined ) { var kendo = window.kendo || (window.kendo = { cultures: {} }); kendo.cultures["ur"] = { name: "ur", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n %","n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["$n-","$n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "Rs" } }, calendars: { standard: { days: { names: ["اتوار","پير","منگل","بدھ","جمعرات","جمعه","هفته"], namesAbbr: ["اتوار","پير","منگل","بدھ","جمعرات","جمعه","هفته"], namesShort: ["ا","پ","م","ب","ج","ج","ه"] }, months: { names: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"], namesAbbr: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"] }, AM: ["AM","am","AM"], PM: ["PM","pm","PM"], patterns: { d: "dd/MM/yyyy", D: "dd MMMM, yyyy", F: "dd MMMM, yyyy h:mm:ss tt", g: "dd/MM/yyyy h:mm tt", G: "dd/MM/yyyy h:mm:ss tt", m: "dd MMMM", M: "dd MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "h:mm tt", T: "h:mm:ss tt", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM, yyyy", Y: "MMMM, yyyy" }, "/": "/", ":": ":", firstDay: 1 } } } })(this); return window.kendo; }, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
// set event handlers and intialize date var utils = new MedialUtilities(); var week = 0; window.addEventListener('load',function() { document.getElementById('appointment').addEventListener('click', overlayCalendar); document.getElementById('calendar-close').addEventListener('click', closeCalendar); document.getElementById('go-back') && document.getElementById('go-back').addEventListener('click', back); document.getElementById('go-next') && document.getElementById('go-next').addEventListener('click', next); document.getElementById('go-next-cal').addEventListener('click', nextcal); document.getElementById('go-back-cal').addEventListener('click', backcal); }); function overlayCalendar() { newdiv = document.createElement('div'); newdiv.id = 'calendarOverlay'; newdiv.style.width = window.screen.width + 'px'; newdiv.style.height = window.screen.height + 'px'; newdiv.style.position = 'fixed'; newdiv.style.display = 'block'; newdiv.style.background = 'rgba(0,0,0,0.8)'; newdiv.style.zIndex = 9999; newdiv.style.top = 0; document.getElementsByTagName('body')[0].appendChild(newdiv); document.getElementById('calendar').style.zIndex = 99999; document.getElementById('calendar').style.position = 'relative'; document.getElementById('calendar').style.background = 'rgba(255,255,255,1)'; document.getElementById('calendar-close').style.display = 'block'; } function closeCalendar() { document.getElementById('calendarOverlay').remove(); document.getElementById('calendar').style.background = '#F4F7FB'; document.getElementById('calendar-close').style.display = 'none'; } function back(){if (week == 0) {return false;} else { week -= 1; } if (week >= 0) {getCalendar();}} function next(){if (week == eamax) {return false;} else {week += 1;} if (week <= eamax) {getCalendar();}} function getCalendar() { var params = 'info[user]=' + eauser + '&info[service]=' + easervice + '&info[week]=' + week + '&' + eatoken; var url = earoot + 'index.php?option=com_easyappointment&task=json.getCalendar&tmpl=component'; utils.makeAjaxCall(url,'POST',params,function(msg) { var response = JSON.parse(msg); if (!response.error) { document.getElementById('calendar-table').innerHTML = response.value; } }); } function nextcal() { document.getElementById('calendar-table').scrollLeft+= parseInt(document.getElementById('calendar').clientWidth/3); } function backcal() { document.getElementById('calendar-table').scrollLeft -= parseInt(document.getElementById('calendar').clientWidth/3); }
var assert = require('should'); var GameStats = require('../static/js/gamestats.js'); describe('gamestats', function(){ describe('#accuracy', function(){ it('should be updated after keypress', function () { var gm = new GameStats(); gm.keypress(); gm.keypress(); gm.accuracy.should.equal(1); gm.accuracy.should.not.equal(0); }); it('accuracy should be updated after keybackspacepress', function () { var gm = new GameStats(); gm.keypress(); gm.backspacepress(); gm.accuracy.should.equal(0.5); }); it('accuracy calculations', function () { var gm = new GameStats(); gm.keypress(); gm.backspacepress(); gm.backspacepress(); gm.accuracy.should.equal(1/3); }); }); });
jQuery( document ).ready(function($) { /* $( ".show-button" ).each(function() { var id=jQuery(this).attr("id"); console.log('#copy-'+id); $('#copy-'+id).zclip({ path:Drupal.settings.zclipcopy.moviepath, copy:function(){ conslode.log($('#copy-'+id).text()); return $('#copy-'+id).text(); }, afterCopy:function(){ //alert('hello'); $( "span" ).each(function(){ $('.show-text').hide(); $('.show-code').show(); var span_id=$(this).attr("id"); $('#'+span_id).html( 'Copy code'); }); $('#'+id).html( 'Code copied..'); var afl_url = $.trim($('#url-'+id).html()); if( Drupal.settings.zclipcopy.coupon_same_page_redirection == 'on'){ setTimeout(function() { window.location.href = afl_url; }, 5000); } if( Drupal.settings.zclipcopy.coupon_new_page_redirection == 'on'){ window.open(afl_url,'_blank'); } } }); }); */ $('span#node-copy-button').zclip({ path:Drupal.settings.zclipcopy.moviepath, copy:function(){ return $.trim($('#node-coupon-code').text()); }, afterCopy:function(){ $('#node-copy-button').html( 'Code copied'); var afl_url = $.trim($('#url-'+id).html()); if( Drupal.settings.zclipcopy.coupon_same_page_redirection == 'on'){ setTimeout(function() { window.location.href = afl_url;}, Drupal.settings.zclipcopy.redirect_delay); } if( Drupal.settings.zclipcopy.coupon_new_page_redirection == 'on'){ window.open(afl_url,'_blank'); } } }); /* $(".coup-title").on("click", function () { var id = jQuery(this).attr("id"); var afl_url = $.trim($('#url-coupon-' + id).html()); if (Drupal.settings.zclipcopy.coupon_same_page_redirection == 'on') { setTimeout(function () { window.location.href = afl_url; }, Drupal.settings.zclipcopy.redirect_delay); } if (Drupal.settings.zclipcopy.coupon_new_page_redirection == 'on') { window.open(afl_url, '_blank'); } }); */ });
/** * The file lifecycle.js.js Create with WebStorm * @Author gaosi * @Email angus_gaosi@163.com * @Date 2014/10/13 15:49:00 * To change this template use File | Setting |File Template */ var pomelo = require('pomelo'); var logger = require('pomelo/node_modules/pomelo-logger').getLogger('lifecycle', __filename); var utils = require('./../../tools/utils'); module.exports.beforeStartup = function (app, cb) { logger = require('pomelo/node_modules/pomelo-logger').getLogger(pomelo.app.getServerId(), __filename); logger.fatal('beforeStartup.'); cb(); }; module.exports.afterStartup = function (app, cb) { logger.fatal('afterStartup.'); utils.waitingForRpc('dbcache', true, function () { var main = require('../../js/main'); main.InitServer() .then(function () { utils.waitingForRpc('connector', true, function () { utils.notifyStatus('connector', true, cb); }); }); }); }; module.exports.beforeShutdown = function (app, cb) { logger.fatal('beforeShutdown.'); var main = require('../../pvp/main'); var playerManager = require('../../js/player/playerManager'); var utils = require('../../tools/utils'); utils.waitingForRpc('ps', false, function () { playerManager.Down(new Date(), function () { return cb(); }); }); /* utils.waitingFor(function () { return !playerManager.GetNumPlayer(1, 0).length; }, function () { logger.fatal('beforeShutdown no players on this js, shutdown.'); cb(); });*/ }; module.exports.afterStartAll = function (app) { logger.fatal('afterStartAll.'); };
var express = require('express'); var request = require('request'); // Constants var PORT = 8080; // App var app = express(); app.get('/', function (req, res) { res.send('A prototype of a micro-service hosting service. An example can be retrieved from https://funcist.ns.mg/7c9600b9d2a5f3b991ab\n'); }); app.get('/:gist_id', function (req, res) { request({ url: 'https://api.github.com/gists/' + req.params.gist_id, headers: { 'User-Agent': 'request' } }, function(error, response, body) { var files = JSON.parse(body).files; var filename = Object.keys(files)[0]; var content = files[filename].content; var m = new module.constructor(); m._compile(content, filename); res.send(m.exports); }); }); app.listen(PORT); console.log('Running on http://localhost:' + PORT);
function Queue(capacity) { this.q = new Array(capacity); this.next = 0; this.size = 0; this.isFull = function() { return this.size >= this.q.length; } this.isEmpty = function() { return this.size <= 0; } this.push = function(elt) { if (this.isFull()) { throw new Error("Can't push on a full queue!"); } this.q[(this.next + this.size++) % this.q.length] = elt; } this.pop = function() { if (this.isEmpty()) { throw new Error("Can't pop from an empty queue!"); } var ret = this.q[this.next]; this.next = (this.next + 1) % this.q.length; --this.size; return ret; } this.peek = function() { if (this.isEmpty()) { throw new Error("Can't peek at an empty queue!"); } return this.q[this.next]; } this.clear = function() { this.next = this.size = 0; } return this; }
(function () { describe('CustomEvent tests - future rule?', function () { context('ignores safe patterns', function () { context(null, function () { var good = 'var a = "CustomEvent";'; it(good, function () { chai.expect(ScanJS.scan(acorn.parse(good, {locations: true}), "/tests/")).to.be.empty; }); }); context(null, function () { var good = 'good.CustomEvent = "CustomEvent";'; it(good, function () { chai.expect(ScanJS.scan(acorn.parse(good, {locations: true}), "/tests/")).to.be.empty; }); }); }); context('detects dangerous patterns', function () { context(null, function () { var bad = 'obj.addEventListener("cat", function(e) { process(e.detail) }); var event = new CustomEvent("cat", {"detail":{"hazcheeseburger":true}}); obj.dispatchEvent(event);'; it.skip(bad, function () { chai.expect(ScanJS.scan(acorn.parse(bad, {locations: true}), "/tests/")).not.to.be.empty; }); }); }); }); })();
var doxygen = require("../lib/nodeDoxygen"); var rimraf = require("rimraf"); var exec = require("child_process").execSync; /*describe("Download:", function () { beforeEach(function (done) { rimraf("dist", function (error) { if (error) { throw error; } else { done(); } }); }); it("FTP", function (done) { doxygen.downloadVersion() .then(function () { done(); }, function (error) { done(); done.fail(error); }); }, 360000); it("HTTP", function (done) { doxygen.downloadVersion(null, "http").then(function () { done(); }, function (error) { done(); done.fail(error); }); }, 360000); });*/ describe("Generates the config:", function () { it("From a task, with the default config location", function () { var userOptions = { OUTPUT_DIRECTORY: "testResults/Docs", INPUT: "./", RECURSIVE: "YES", FILE_PATTERNS: ["*.js", "*.md"], EXTENSION_MAPPING: "js=Javascript", GENERATE_LATEX: "NO", EXCLUDE_PATTERNS: ["*/node_modules/*", "*/filters/*"], PROJECT_NAME: "Node-Doxygen", USE_MDFILE_AS_MAINPAGE: "README.md" }; doxygen.createConfig(userOptions); }); it("From a task, with a custom config location", function () { var userOptions = { OUTPUT_DIRECTORY: "testResults/Docs", INPUT: "./", RECURSIVE: "YES", FILE_PATTERNS: ["*.js", "*.md"], EXTENSION_MAPPING: "js=Javascript", GENERATE_LATEX: "NO", EXCLUDE_PATTERNS: ["*/node_modules/*", "*/filters/*"], PROJECT_NAME: "Node-Doxygen", USE_MDFILE_AS_MAINPAGE: "README.md" }; doxygen.createConfig(userOptions, "testResults/config"); }); it("From CLI, with the default config location", function () { var userOptions = { OUTPUT_DIRECTORY: "testResults/Docs", INPUT: "./", RECURSIVE: "YES", FILE_PATTERNS: ["*.js", "*.md"], EXTENSION_MAPPING: "js=Javascript", GENERATE_LATEX: "NO", EXCLUDE_PATTERNS: ["*/node_modules/*", "*/filters/*"], PROJECT_NAME: "Node-Doxygen", USE_MDFILE_AS_MAINPAGE: "README.md" }; exec("node ./bin/nodeDoxygen.js --config --jsonParams=" + JSON.stringify(JSON.stringify(userOptions)), { stdio: ["pipe", process.stdout, "pipe"] }); }); it("From CLI, with a custom config location", function () { var userOptions = { OUTPUT_DIRECTORY: "testResults/Docs", INPUT: "./", RECURSIVE: "YES", FILE_PATTERNS: ["*.js", "*.md"], EXTENSION_MAPPING: "js=Javascript", GENERATE_LATEX: "NO", EXCLUDE_PATTERNS: ["*/node_modules/*", "*/filters/*"], PROJECT_NAME: "Node-Doxygen", USE_MDFILE_AS_MAINPAGE: "README.md" }; exec("node ./bin/nodeDoxygen.js --config --configPath=testResults/config --jsonParams=" + JSON.stringify(JSON.stringify(userOptions)), { stdio: ["pipe", process.stdout, "pipe"] }); }); }); describe("Generates the docs:", function () { beforeAll(function (done) { doxygen.downloadVersion() .then(function () { done(); }, function (error) { throw error; }); }, 360000); beforeEach(function (done) { rimraf("testResults/Docs", function (error) { if (error) { throw error; } else { done(); } }); }); it("From a task, with a custom config location", function () { doxygen.run("testResults/config"); }); it("From a task, with the default config location", function () { doxygen.run(); }); it("From CLI, with a custom config location", function () { exec("node ./bin/nodeDoxygen.js --docs --configPath=testResults/config", { stdio: ["pipe", process.stdout, "pipe"] }); }); it("From CLI, with the default config location", function () { exec("node ./bin/nodeDoxygen.js --docs", { stdio: ["pipe", process.stdout, "pipe"] }); }); });
define(['libs/jquery.dataTables.min'], function () { /* Custom sort on date in title - created for NAV */ jQuery.extend(jQuery.fn.dataTableExt.oSort, { "title-date-pre": function (a) { if (/Never/.test(a)) { return 2; } else if (/title="(.*?)"/.test(a)) { var timestamp = a.match(/title="(.*?)"/)[1]; if ($.trim(timestamp) != '') { var splits = $.trim(timestamp).split(' '); var dates = splits[0].split('-'); var times = splits[1].split(':'); return (dates[0] + dates[1] + dates[2] + times[0] + times[1]) * 1; } } return 1; }, "title-date-asc": function (a, b) { return b - a; }, "title-date-desc": function (a, b) { return a - b; } }); });
'use strict'; import v1 from './v1' import v2 from './v2' import v3 from './v3' import v4 from './v4' import ugc from './ugc' import bos from './bos' import eus from './eus' import admin from './admin' import payapi from './payapi' import statis from './statis' import member from './member' import shopping from './shopping' import promotion from './promotion' export default app => { // app.get('/', (req, res, next) => { // res.redirect('/'); // }); app.use('/v1', v1); app.use('/v2', v2); app.use('/v3', v3); app.use('/v4', v4); app.use('/ugc', ugc); app.use('/bos', bos); app.use('/eus', eus); app.use('/admin', admin); app.use('/payapi', payapi); app.use('/member', member); app.use('/statis', statis); app.use('/shopping', shopping); app.use('/promotion', promotion); }
/*! * jQuery UI Effects Transfer 1.11.1 * http://jqueryui.com * * Copyright 2014 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/transfer-effect/ */ !function(a){"function"==typeof define&&define.amd?define(["jquery","./effect"],a):a(jQuery)}(function(a){return a.effects.effect.transfer=function(b,c){var d=a(this),e=a(b.to),f="fixed"===e.css("position"),g=a("body"),h=f?g.scrollTop():0,i=f?g.scrollLeft():0,j=e.offset(),k={top:j.top-h,left:j.left-i,height:e.innerHeight(),width:e.innerWidth()},l=d.offset(),m=a("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(b.className).css({top:l.top-h,left:l.left-i,height:d.innerHeight(),width:d.innerWidth(),position:f?"fixed":"absolute"}).animate(k,b.duration,b.easing,function(){m.remove(),c()})}});
(function () { 'use strict'; /** * All of the code for your admin-facing JavaScript source * should reside in this file. * * Note: It has been assumed you will write jQuery code here, so the * $ function reference has been prepared for usage within the scope * of this function. * * This enables you to define handlers, for when the DOM is ready: * * $(function() { * * }); * * When the window is loaded: * * $( window ).load(function() { * * }); * * ...and/or other possibilities. * * Ideally, it is not considered best practise to attach more than a * single DOM-ready or window-load handler for a particular page. * Although scripts in the WordPress core, Plugins and Themes may be * practising this, we should strive to set a better example in our own work. */ })(jQuery); jQuery(document).ready(function () { // validate signup form on keyup and submit jQuery("#pns_os_setting").validate({ rules: { pns_upload_ios_certi: "required", pns_push_to_ios: "required", pns_send_to_ios: "required" }, messages: { pns_upload_ios_certi: "Please Upload Valid file", pns_push_to_ios: "Please Select Option", pns_send_to_ios: "Please Select option for send notifications to ios devices" }, errorPlacement: function (error, element) { jQuery(element).closest('tr').next().find('.error_label').html(error); } }); // Uploading pem file var file_frame; jQuery('#pns_upload_image_button').on('click', function (event) { event.preventDefault(); // If the media frame already exists, reopen it. if (file_frame) { file_frame.open(); return; } // Create the media frame. file_frame = wp.media.frames.file_frame = wp.media({ title: jQuery(this).data('uploader_title'), button: { text: jQuery(this).data('uploader_button_text') }, multiple: false // Set to true to allow multiple files to be selected }); // When an image is selected, run a callback. file_frame.on('select', function () { var attachment = file_frame.state().get('selection').first().toJSON(); jQuery('#pns_upload_ios_certi').val(attachment.url); jQuery('#pns_upload_ios_certi_name').val(attachment.filename); }); // Finally, open the modal file_frame.open(); }); });
function xdiff_file_patch (file, patch, dest, flags) { // http://kevin.vanzonneveld.net // + original by: Brett Zamir (http://brett-zamir.me) // % note 1: Depends on file_put_contents which is not yet implemented // - depends on: xdiff_string_patch // - depends on: file_get_contents // - depends on: file_put_contents file = this.file_get_contents(file); patch = this.file_get_contents(patch); return this.file_put_contents(dest, this.xdiff_string_patch(file, patch, flags)); }
/* This file is generated and updated by Sencha Cmd. You can edit this file as needed for your application, but these edits will have to be merged by Sencha Cmd when it performs code generation tasks such as generating new models, controllers or views and when running "sencha app upgrade". Ideally changes to this file would be limited and most work would be done in other places (such as Controllers). If Sencha Cmd cannot merge your changes and its generated code, it will produce a "merge conflict" that you will need to resolve manually. */ Ext.application({ name: 'SenchaBDD', requires: [ 'Ext.MessageBox' ], controllers: [ 'Login', 'Main' ], views: [ 'ColorsList', 'Login', 'Main', ], stores: [ 'Colors' ], icon: { '57': 'resources/icons/Icon.png', '72': 'resources/icons/Icon~ipad.png', '114': 'resources/icons/Icon@2x.png', '144': 'resources/icons/Icon~ipad@2x.png' }, isIconPrecomposed: true, startupImage: { '320x460': 'resources/startup/320x460.jpg', '640x920': 'resources/startup/640x920.png', '768x1004': 'resources/startup/768x1004.png', '748x1024': 'resources/startup/748x1024.png', '1536x2008': 'resources/startup/1536x2008.png', '1496x2048': 'resources/startup/1496x2048.png' }, launch: function() { // Destroy the #appLoadingIndicator element Ext.fly('appLoadingIndicator').destroy(); // Initialize the login view Ext.Viewport.add(Ext.create('SenchaBDD.view.Login')); }, onUpdated: function() { Ext.Msg.confirm( "Application Update", "This application has just successfully been updated to the latest version. Reload now?", function(buttonId) { if (buttonId === 'yes') { window.location.reload(); } } ); } });
// // Created on: <18-Nov-2004 10:54:01 bh> // // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ## // SOFTWARE NAME: eZ Publish // SOFTWARE RELEASE: 4.1.x // COPYRIGHT NOTICE: Copyright (C) 1999-2011 eZ Systems AS // SOFTWARE LICENSE: GNU General Public License v2.0 // NOTICE: > // This program is free software; you can redistribute it and/or // modify it under the terms of version 2.0 of the GNU General // Public License as published by the Free Software Foundation. // // 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 version 2.0 of the GNU General // Public License along with this program; if not, write to the Free // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ## // /*! \file eziepngfix.js */ /*! Forces use of DirectX transparency filter for image tags with "transparent-png-icon" as class. The result: correct alpha blending for normal (32x32) PNG icons in Internet Explorer. */ function useDirectXAlphaBlender() { var images = document.getElementsByTagName( "img" ); for( var i=0; i<images.length; i++ ) { var image = images[i]; if( image.className == "transparent-png-icon" ) { image.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + image.src + "', sizingMethod='scale')"; if( image.width == 16 ) { image.src = emptyIcon16; } else { image.src = emptyIcon32; } image.className = "transparent-png-icon-fixed"; } } } window.attachEvent( "onload", useDirectXAlphaBlender );
var searchData= [ ['packedaccessrecord',['PackedAccessRecord',['../structPackedAccessRecord.html',1,'']]], ['partinfo',['PartInfo',['../structPartInfo.html',1,'']]], ['partitioner',['Partitioner',['../classPartitioner.html',1,'']]], ['partitionevent',['PartitionEvent',['../classPartitioner_1_1PartitionEvent.html',1,'Partitioner']]], ['partitionmonitor',['PartitionMonitor',['../classPartitionMonitor.html',1,'']]], ['partmapper',['PartMapper',['../classPartMapper.html',1,'']]], ['partreplpolicy',['PartReplPolicy',['../classPartReplPolicy.html',1,'']]], ['pincmd',['PinCmd',['../classPinCmd.html',1,'']]], ['portvirtualizer',['PortVirtualizer',['../classPortVirtualizer.html',1,'']]], ['postpatchargs',['PostPatchArgs',['../structPostPatchArgs.html',1,'']]], ['powervalue',['powerValue',['../structMemControllerBase_1_1powerValue.html',1,'MemControllerBase']]], ['prepatchargs',['PrePatchArgs',['../structPrePatchArgs.html',1,'']]], ['printexpr',['PrintExpr',['../classPrintExpr.html',1,'']]], ['prioqueue',['PrioQueue',['../classPrioQueue.html',1,'']]], ['prioqueue_3c_20timingevent_2c_20pq_5fblocks_20_3e',['PrioQueue&lt; TimingEvent, PQ_BLOCKS &gt;',['../classPrioQueue.html',1,'']]], ['processcounter',['ProcessCounter',['../classProcStats_1_1ProcessCounter.html',1,'ProcStats']]], ['processgrouppartmapper',['ProcessGroupPartMapper',['../classProcessGroupPartMapper.html',1,'']]], ['processpartmapper',['ProcessPartMapper',['../classProcessPartMapper.html',1,'']]], ['processstats',['ProcessStats',['../classProcessStats.html',1,'']]], ['processtreenode',['ProcessTreeNode',['../classProcessTreeNode.html',1,'']]], ['processvectorcounter',['ProcessVectorCounter',['../classProcStats_1_1ProcessVectorCounter.html',1,'ProcStats']]], ['procinfo',['ProcInfo',['../structProcInfo.html',1,'']]], ['procstats',['ProcStats',['../classProcStats.html',1,'']]], ['profviolreplpolicy',['ProfViolReplPolicy',['../classProfViolReplPolicy.html',1,'']]], ['proxyfuncstat',['ProxyFuncStat',['../classProxyFuncStat.html',1,'']]], ['proxystat',['ProxyStat',['../classProxyStat.html',1,'']]] ];
"use strict"; $(function() { $(document).ajaxError((event, xhr) => { console.error(xhr.responseJSON.error_message); }); }); function basename(str) { let base; base = str.substring(str.lastIndexOf("\/") + 1); base = str.substring(str.lastIndexOf("\\") + 1); return base; } function go_home() { window.location.replace("/"); } function update_upload_text() { let upload_filename = basename($("#file-upload").val()); $("#file-upload-text").val(upload_filename); } function show_file_contents(element) { window.location.replace(window.location.pathname + "/" + $(element).text()); } function analyze(element) { let filename = $(element).prev().text(); $.when($.ajax(`analyze/${filename}`)).then(data => { console.log(data); }); }
// Inspired by an answer found at http://stackoverflow.com/questions/11523331/passing-variables-through-handlebars-partial module.exports = function partialParams(partialName, options) { if (!partialName) { console.error('No partial name given.'); return ''; } var partial = Handlebars.partials[partialName]; if (!partial) { console.error('Couldnt find the compiled partial: ' + partialName); return ''; } // return new Handlebars.SafeString( partial(options.hash) ); return partial(options.hash); };
/** * External dependencies */ import camelCase from 'lodash/string/camelCase'; import merge from 'lodash/object/merge'; /** * Internal dependencies */ import i18n from 'lib/mixins/i18n'; import sortProducts from 'lib/products-values/sort'; function createPurchaseObject( purchase ) { const object = { id: Number( purchase.ID ), active: Boolean( purchase.active ), amount: Number( purchase.amount ), attachedToPurchaseId: Number( purchase.attached_to_purchase_id ), canDisableAutoRenew: Boolean( purchase.can_disable_auto_renew ), currencyCode: purchase.currency_code, currencySymbol: purchase.currency_symbol, domain: purchase.domain, error: null, expiryDate: purchase.expiry_date, expiryMoment: purchase.expiry_date ? i18n.moment( purchase.expiry_date ) : null, expiryStatus: camelCase( purchase.expiry_status ), hasPrivateRegistration: Boolean( purchase.has_private_registration ), includedDomain: purchase.included_domain, isCancelable: Boolean( purchase.is_cancelable ), isDomainRegistration: Boolean( purchase.is_domain_registration ), isRedeemable: Boolean( purchase.is_redeemable ), isRefundable: Boolean( purchase.is_refundable ), isRenewable: Boolean( purchase.is_renewable ), meta: purchase.meta, priceText: `${ purchase.currency_symbol }${ purchase.amount } ${ purchase.currency_code }`, payment: { name: purchase.payment_name, type: purchase.payment_type, countryCode: purchase.payment_country_code, countryName: purchase.payment_country_name }, productId: Number( purchase.product_id ), productName: purchase.product_name, productSlug: purchase.product_slug, refundPeriodInDays: purchase.refund_period_in_days, renewDate: purchase.renew_date, // only generate a moment if `renewDate` is present and positive renewMoment: purchase.renew_date && purchase.renew_date > '0' ? i18n.moment( purchase.renew_date ) : null, siteId: Number( purchase.blog_id ), siteName: purchase.blogname, subscribedDate: purchase.subscribed_date, subscriptionStatus: purchase.subscription_status, tagLine: purchase.tag_line, userId: Number( purchase.user_id ) }; if ( 'credit_card' === purchase.payment_type ) { return merge( {}, object, { payment: { creditCard: { id: Number( purchase.payment_card_id ), type: purchase.payment_card_type, number: Number( purchase.payment_details ), expiryDate: purchase.payment_expiry, expiryMoment: purchase.payment_expiry ? i18n.moment( purchase.payment_expiry, 'MM/YY' ) : null } } } ); } return object; } function createPurchasesArray( dataTransferObject ) { if ( ! Array.isArray( dataTransferObject ) ) { return []; } return sortProducts( dataTransferObject.map( createPurchaseObject ) ); } export default { createPurchaseObject, createPurchasesArray };
USETEXTLINKS = 1 STARTALLOPEN = 0 WRAPTEXT = 1 PRESERVESTATE = 0 HIGHLIGHT = 1 ICONPATH = 'file:////Users/eric/github/popgenDB/sims_for_structure_paper/2PopDNAnorec_0.5_1000/' //change if the gif's folder is a subfolder, for example: 'images/' foldersTree = gFld("<i>ARLEQUIN RESULTS (2PopDNAnorec_1_76.arp)</i>", "") insDoc(foldersTree, gLnk("R", "Arlequin log file", "Arlequin_log.txt")) aux1 = insFld(foldersTree, gFld("Run of 31/07/18 at 17:02:31", "2PopDNAnorec_1_76.xml#31_07_18at17_02_31")) insDoc(aux1, gLnk("R", "Settings", "2PopDNAnorec_1_76.xml#31_07_18at17_02_31_run_information")) aux2 = insFld(aux1, gFld("Genetic structure (samp=pop)", "2PopDNAnorec_1_76.xml#31_07_18at17_02_31_pop_gen_struct")) insDoc(aux2, gLnk("R", "AMOVA", "2PopDNAnorec_1_76.xml#31_07_18at17_02_31_pop_amova")) insDoc(aux2, gLnk("R", "Pairwise distances", "2PopDNAnorec_1_76.xml#31_07_18at17_02_31_pop_pairw_diff"))
// Most of it was made by xPaw: https://gist.github.com/xPaw/73f8ae2031b4e528abf7 // Add following lines into manifest.json under content_scripts section (and tweak or remove date below): // { // "js": [ "js/autojoinSteamQueue.js" ], // "matches": [ "*://store.steampowered.com/*" ] // } const summer2018 = new Date(2018, 6, 6); if (Date.now() < summer2018) { // I will update extension after the sale and remove this injection but.. in case I die you're not stuck with useless button :) // We have to inject it like this to access global functions and variables const scriptToInject = `var DiscoveryQueueModal, GenerateQueue = function(queueNumber) { DiscoveryQueueModal = ShowBlockingWaitDialog('Exploring queue...', 'Generating new discovery queue #' + ++queueNumber); jQuery.post('//store.steampowered.com/explore/generatenewdiscoveryqueue', { sessionid: g_sessionID, queuetype: 0 }).done(function(data) { var requests = [], done = 0, errorShown; for (var i = 0; i < data.queue.length; i++) { var request = jQuery.post('//store.steampowered.com/app/10', { appid_to_clear_from_queue: data.queue[i], sessionid: g_sessionID }); request.done(function() { if (errorShown) { return; } DiscoveryQueueModal.Dismiss(); DiscoveryQueueModal = ShowBlockingWaitDialog('Exploring the queue...', 'Request ' + ++done + ' of ' + data.queue.length); }); request.fail(function() { errorShown = true; DiscoveryQueueModal.Dismiss(); DiscoveryQueueModal = ShowConfirmDialog('Error', 'Failed to clear queue item #' + ++done, 'Try again').done(function() { GenerateQueue(queueNumber - 1); }); }); requests.push(request); } jQuery.when.apply(jQuery, requests).done(function() { DiscoveryQueueModal.Dismiss(); if (queueNumber < 3) { GenerateQueue(queueNumber); } else { DiscoveryQueueModal = ShowConfirmDialog('Done', 'Queue has been explored ' + queueNumber + ' times', 'Reload the page').done(function() { ShowBlockingWaitDialog('Reloading the page'); window.location.reload(); }); } }); }).fail(function() { DiscoveryQueueModal.Dismiss(); DiscoveryQueueModal = ShowConfirmDialog('Error', 'Failed to generate new queue #' + queueNumber, 'Try again').done(function() { GenerateQueue(queueNumber - 1); }); }); };`; const script = document.createElement('script'); script.innerHTML = scriptToInject; document.body.appendChild(script); document.querySelector('.supernav_container') .insertAdjacentHTML('beforeend', '<a class="menuitem supernav" style="cursor: pointer; color: #FFD700" title="This button will be removed after the sale. Visit AutoJoin Steam group for more details." onclick="GenerateQueue(0)">AutoJoin Queue</a>'); }
'use strict'; /** * Load all public assets, e.g js, css, images */ exports.register = function (server, options, next) { server.route({ method: 'GET', path: '/public/{params*}', config: { description: 'load assets', auth: false, handler: { directory: { path: 'public' } } } }); return next(); }; exports.register.attributes = { name: 'Assets' };
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'image', 'ja', { alertUrl: 'イメージのURLを入力してください。', alt: '代替テキスト', border: 'ボーダー', btnUpload: 'サーバーに送信', button2Img: '選択したボタンを画像に置き換えますか?', hSpace: '横間隔', img2Button: '選択した画像をボタンに置き換えますか?', infoTab: 'イメージ 情報', linkTab: 'リンク', lockRatio: 'ロック比率', menu: 'イメージ プロパティ', resetSize: 'サイズリセット', title: 'イメージ プロパティ', titleButton: '画像ボタン プロパティ', upload: 'アップロード', urlMissing: 'イメージのURLを入力してください。', vSpace: '縦間隔', validateBorder: 'ボーダーは数値で入力してください。', validateHSpace: '横間隔は数値で入力してください。', validateVSpace: '縦間隔は数値で入力してください。' });
import {COMMENT_REPLY} from './../bundles/comment/actions' import { COMMENTS_RECEIVE } from './../bundles/thread/actions' function comments(state = {}, action) { switch (action.type) { case COMMENTS_RECEIVE: return { ...state, ...action.list } // case COMMENT_REPLY: // return { // ...state, // [action.id]: { // ...state[action.id], // _reply: !state[action.id]['_reply'] // } // } default: return state } } export default comments
/* * This file is part of Invenio. * Copyright (C) 2015 CERN. * * Invenio 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 2 of the * License, or (at your option) any later version. * * Invenio 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 Invenio; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ define( [ 'jquery', 'js/other/awesomplete' ], function($) { $('.circ_id_complete').each(function(i, element) { var awesomplete = new Awesomplete(element, {list: []}); var entity = $(element).data('entity'); var last_input = null; function success(data) { data = JSON.parse(data); var res = []; $(data).each(function(i, val) { res.push({label: val.value, value: val.id}); }); awesomplete.list = res; awesomplete.evaluate(); } $(element).on('input', function(event) { var search = {entity: entity, search: event.target.value}; var ajax_query = { type: "POST", url: "/circulation/api/entity/search_autocomplete", data: JSON.stringify(JSON.stringify(search)), success: success, contentType: 'application/json', }; function run() { var now = new Date(); if (now - last_input > 800) { $.ajax(ajax_query); } } last_input = new Date(); setTimeout(run, 1000); }); }); });
//Menu teaser (function(){ jQuery(document).ready(function(){ if ( jQuery('header.header').hasClass("teaser-menu") ) { missTheme.options.header.params.teaser = 13; } jQuery('header.header.teaser-menu').find("nav > ul li a").each( function () { if ( jQuery(this).attr('title') ) { jQuery( '<small class="teaser">' + jQuery(this).attr('title') + '</small>' ).appendTo(this).animate({opacity: '1'},800); } } ); }); })();
var svg = d3.select("svg.header") .append("g") .translate((window.innerWidth-620)/2, 120) var radius = d3.scale.linear() .domain([0, 5]) .range([50, 10]) var theta = function(d){ switch(d){ case 0: return 102; case 1: return 173; case 2: return 232; case 3: return 278; case 4: return 315; case 5: return 340; } } svg.selectAll("circle") .data(d3.range(6)) .enter() .append("circle") .attr("r", radius) .attr("transform", function(d){ return "translate(90, 0) rotate("+theta(d)+",-90,0)"}) .attr("class", function(d){ return ["x", "y"][Math.floor(d/3)]+((d%3)+1) }) svg = d3.select("svg.footer") .append("g") .translate(620/2, 10) var x = d3.scale.linear() .domain([0, 5]) .range([-50, 50]) svg.selectAll("circle") .data(d3.range(6)) .enter() .append("circle") .attr("r", 7) .translate(function(d){ return [x(d), 0] }) .attr("class", function(d){ return ["x", "y"][Math.floor(d/3)]+((d%3)+1) })
Template.comment.helpers({ submittedText: function() { var date = new Date(this.submitted); console.log("vote =====>", this); var d=date.getDate(); var m=date.getMonth()+1; var y=date.getFullYear(); return m + " - " + d + " - " + y; }, postID : function(postID){ this.postID = postID; return postID; }, up: function(){ var userId = Meteor.userId(); if (userId && _.include(this.upvoters, userId)) { return true; } else{ return false; } }, down: function(){ var userId = Meteor.userId(); if (userId && _.include(this.downvoters, userId)) { return true; }else{ return false; } }, // we will have to edit this function upvotedClass: function() { var userId = Meteor.userId(); if (userId && ( !_.include(this.upvoters, userId) || _.include(this.downvoters, userId) ) ) { return 'upvotable'; } else { return 'disabled'; } }, downvotedClass: function() { var userId = Meteor.userId(); if (userId && ( !_.include(this.downvoters, userId) || _.include(this.upvoters, userId) ) ) { return 'downvotable'; } else { return 'disabled'; } }, }); Template.comment.events({ 'click .upvotable': function(e) { e.preventDefault(); console.log("e =====>", e); var postID = this.postID; Meteor.call('upvoteComment', this._id, postID); }, 'click .downvotable': function(e) { e.preventDefault(); console.log("e =====>", e); var postID = this.postID; Meteor.call('downvoteComment', this._id, postID); }, 'click .translatable': function(e,t) { var curTarget = $(e.currentTarget), srcTxt = this.body, srcLang = 'en', tarLang = 'de'; Meteor.call('getTranslation', srcTxt, srcLang, tarLang, function(err, res){ if (res.error) {console.log("err", res.message); curTarget.closest('div.row').find('.translated-text').text('(' + "sorry, something went wrong" + ')');} else curTarget.closest('div.row').find('.translated-text').text('(' + res.message + ')'); }); } });
/* global _, angular */ angular.module('bidos') .controller('Subdomains', Subdomains); function Subdomains(Resources, $scope, $state) { Resources.get().then(function(data) { $scope.subdomains = _.filter(data.subdomains, {domain_id: parseInt($state.params.domainId)}); }); $scope.select = function (subdomain) { $state.go('bidos.domains.subdomains.items', {subdomainId: parseInt(subdomain.id)}); }; }
/** * @file * A JavaScript file for the theme. * * In order for this JavaScript to be loaded on pages, see the instructions in * the README.txt next to this file. */ // JavaScript should be made compatible with libraries other than jQuery by // wrapping it with an "anonymous closure". See: // - http://drupal.org/node/1446420 // - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth (function($, Drupal, window, document, undefined) { $(document).ready( function(){ if($("#block-nice-menus-1").length > 0){ $('#block-nice-menus-1').meanmenu({ meanMenuContainer: '.region-header', meanScreenWidth: "1100", meanRemoveAttrs: true, meanDisplay: "table", meanMenuOpen: "<span></span><span></span><span></span>", meanRevealPosition: "left", meanMenuClose: "<span></span><span></span><span></span>" }); jQuery("#block-block-10 .social-icon .search").click(function(event){ event.preventDefault(); jQuery("#block-search-form").fadeToggle("fast"); }); } jQuery('#toggle-text').click(function () { if(jQuery('#content-text').hasClass('.open')){ jQuery('#content-text').hide('slow').removeClass('.open'); jQuery('#toggle-text').html('Read More'); }else{ jQuery('#content-text').addClass('.open').show('slow'); jQuery('#toggle-text').html('Read Less'); } }); }); // Place your code here. })(jQuery, Drupal, this, this.document);
function loadCashier(){ var data = 'action=loadCashier'; data += '&' + $('#osForm').serialize(); $.ajax({ url: 'OverShortCashierPage.php', data: data, success: function(response){ $('#display').html(response); $('#countSCA').focus(); } }); $('#date').val(''); $('#empno').val(''); } function resumSheet(){ var countTotal = 0; var osTotal = 0; var posTotal = 0; $('.tenderCode').each(function(){ var c = 0; var code = $(this).val(); if (code != 'CK') c = Number($('#count'+code).val()); else c = Number($('#countCK').html()); var p = Number($('#pos'+code).html()); var os = Math.round( (c - p)*100 ) / 100; if (code == 'CA'){ var sca = Number($('#countSCA').val()); posTotal += sca; os = Math.round( (c - p - sca)*100 ) / 100; } osTotal += os; countTotal += c; posTotal += p; $('#os'+code).html(os); }); $('#posT').html(Math.round(posTotal*100)/100); $('#countT').html(Math.round(countTotal*100)/100); $('#osT').html(Math.round(osTotal*100)/100); } function resumChecks(){ var checks = $('#checklisting').val(); var tmp = checks.split("\n"); var sum = 0; for (var i = 0; i < tmp.length; i++){ sum += Number(tmp[i]); } $('#countCK').html(Math.round(sum*100)/100); resumSheet(); } function save(){ var tenders = saveTenders(); var checks = saveChecks(); var notes = escape($('#notes').val()); var empno = $('#current_empno').val(); var tdate = $('#current_date').val(); var args = 'action=save&empno='+empno+'&date='+tdate+'&tenders='+tenders+'&checks='+checks+'&notes='+notes; $.ajax({ url: 'OverShortCashierPage.php', type: 'post', data: args, success: function(data){ alert(data); } }); } function saveTenders(){ var ret = ''; var sca = $('#countSCA').val(); ret += "SCA:"+sca; $('.tenderCode').each(function(){ var code = $(this).val(); ret += "|"+code+":"; if (code != 'CK') ret += $('#count'+code).val(); else ret += $('#count'+code).html(); }); return ret; } function saveChecks(){ var ret = ''; var checks = $('#checklisting').val(); var tmp = checks.split("\n") for (var i=0; i<tmp.length;i++){ ret += tmp[i]+","; } ret = ret.substring(0,ret.length - 1); return ret; } function sumCashCounter() { var entry = $('#cash-counter').val(); var regexp = /[0-9\.]+/g; var numbers = entry.match(regexp); var sum = 0.0; for (var i=0; i<numbers.length; i++) { sum += Number(numbers[i]); } if (sum > 0) { $('#countCA').val(sum); } }
spellEffects[ 'junglecreatures' ] = function( args ) { var self = this, _ccd = Component.bugcraft.currentCharacterObject.characterData, _moveFrames = {}, _tc = args.targetCharacter, _tcd = _tc.characterData, _changeFrameFunctionPointer = null, _currentIndex = 1, _maxFrames = 1, _backgroundSound = null; this.ID = spellEffects.layer[0].push( this ) - 1; this.characterSpellEffectID = _tc._internal.spellEffects.push( this ) - 1; this.offsetX = 20; this.offsetY = 20; this.rotation = _tcd.character_rotation; this.deleteRange = 40; this.previousX = _tcd.character_zone_x - this.offsetX; this.previousY = _tcd.character_zone_y - this.offsetY; // initialize var _soundLoop = function() { _backgroundSound = Application.sound.playExclusive({ url: '/components/bugcraft/resources/public/component.bugcraft.spellEffects/sounds/junglecreatures/junglecreatures.mp3', volume: spellEffects.volumeByRangeVoice( _ccd.character_zone_x, _ccd.character_zone_y, _tcd.character_zone_x, _tcd.character_zone_y, spellEffects.volumeRangeLong ), onFinish: function() { _soundLoop(); } }); } // for(var i=1;i<=_maxFrames;i++) // { // _moveFrames[ i ] = { image: new Image(), alpha: 0 }; // _moveFrames[ i ].image.src = '/components/bugcraft/resources/public/component.bugcraft.spellEffects/images/junglecreatures/junglecreatures' + i + '.png'; // } //draw the bombardierBeetleDeath spatter this.draw = function() { // Map.ctx.save(); // Map.ctx.translate( self.previousX + self.offsetX + Map.viewPortX, self.previousY + self.offsetY + Map.viewPortY ); // Map.ctx.rotate( ( self.rotation - 90 ) * Math.PI / 180 ); // Map.ctx.shadowColor = 'rgba(0, 0, 0, 0.7)'; // Map.ctx.shadowOffsetX = 3; // Map.ctx.shadowOffsetY = 3; // Map.ctx.drawImage( // _moveFrames[ _currentIndex ].image, // - self.offsetX, // - self.offsetY // ); // Map.ctx.restore(); // Map.ctx.globalAlpha = 1; } //remove the deathDecay this.remove = function() { clearTimeout( _changeFrameFunctionPointer ); if( _backgroundSound ) { _backgroundSound.stop(); } spellEffects.layerCleaner.push( this ); spellEffects.layer[0][ this.ID ] = null; delete _tc._internal.spellEffects[ this.characterSpellEffectID ]; } var _changeFrameFunction = function() { _currentIndex++; if( _currentIndex > _maxFrames ) { _currentIndex = 1; setTimeout( _changeFrameFunction, 2000 + Math.random() * 5000 ); return; } _changeFrameFunctionPointer = setTimeout( _changeFrameFunction, 100 ); } _soundLoop(); // _changeFrameFunction(); } //end bombardierBeetleDeath
define([ "helpers/contract", "helpers/types", "components/content/views/content/single/view", "components/content/views/content/multi/view" ], function(contract, types, SingleView, MultiView) { function getView(options) { contract(options, "object_type"); var type = types.baseObjectType(options.object_type); // if this is a singular wordpress type, return the SingleView. // otherwise, its a MultiView by default. // To override this behavior, specify or register a custom view factory. if (type === "post" || type === "page") return SingleView; else return MultiView; } return { getView: getView }; });
'use strict'; var Offers = require('./OffersService'); module.exports.offerinfo = function offerinfo (req, res, next) { Offers.offerinfo(req.swagger.params, res, next); }; module.exports.offerlink = function offerlink (req, res, next) { Offers.offerlink(req.swagger.params, res, next); }; module.exports.offernew = function offernew (req, res, next) { Offers.offernew(req.swagger.params, res, next); }; module.exports.offerupdate = function offerupdate (req, res, next) { Offers.offerupdate(req.swagger.params, res, next); };
/** * PhilaeCMS * Copyright (C) 2014 Daniel Budick * * 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 2 * 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 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * These functions check privileges of the user. * Privileges: * - isRoot: User is a godlike individual and can write, view and update everything * - isAdmin: User can write, view and update almost everything * - isEditor: User can change content (Plaintext and HTML) * - isDesigner: User can change css * - canUpload: User can upload data * - isBackendUser: User can visit the backend * - isUserManager: User can write, view and update user-data. Even Admin cannot do this. Important for countries with high privacy standards. * - isIntern: Interns should not be able to destroy anything. They can create content, but cannot write HTML */ Privilege = { /** * @param privilege is the name of the privilege, that is to check * @param user is the Userobject which permission is to check * @returns {boolean} false: the user has not the permission. true, the user has the permission. */ checkPrivilege: function (privilege, user) { if (user === null || user === undefined) return false; if (user.profile === undefined) { throwError('User has no profile. This should not happen.'); return false; } if (user.profile.privileges === undefined) { throwError('User has no privileges. This should not happen.'); return false; } if (user.profile.privileges.isRoot === true) return true; //overwrites everything. This user has godlike powers! if (user.profile.privileges[privilege] === undefined) return false; if (user.profile.privileges[privilege] === true) return true; return false; //the user has not the sufficient permission }, /** * isAdmin: User can write, view and update almost everything * @param user is the Userobject which permission is to check * @returns {boolean} false: the user is not an admin. */ isAdmin: function (user) { return this.checkPrivilege('isAdmin', user); }, /** * isEditor: User can change content (Plaintext and HTML) * @param user is the Userobject which permission is to check * @returns {boolean} false: the user cannot change content */ isEditor: function (user) { return this.checkPrivilege('isEditor', user); }, /** * isDesigner: User can change CSS * @param user is the Userobject which permission is to check * @returns {boolean} false: the user cannot change CSS */ isDesigner: function (user) { return this.checkPrivilege('isDesigner', user); }, /** * canUpload: User can upload data * @param user is the Userobject which permission is to check * @returns {boolean} false: the user cannot upload data */ canUpload: function (user) { return this.checkPrivilege('canUpload', user); }, /** * isBackendUser: User can visit the backend * @param user is the Userobject which permission is to check * @returns {boolean} false: the user cannot access the backend */ isBackendUser: function (user) { return this.checkPrivilege('isBackendUser', user); }, /** * isUserManager: User can write, view and update user-data. Even Admin cannot do this. Important for countries with high privacy standards. * @param user is the Userobject which permission is to check * @returns {boolean} false: the user is not an UserManager */ isUserManager: function (user) { return this.checkPrivilege('isUserManager', user); }, /** * isIntern: Interns should not be able to destroy anything. They can create content, but cannot write HTML * @param user is the Userobject which permission is to check * @returns {boolean} false: the user is not an intern */ isIntern: function (user) { return this.checkPrivilege('isIntern', user); } };
'use strict'; angular.module('agileimApp') .factory('authExpiredInterceptor', function ($rootScope, $q, $injector, localStorageService) { return { responseError: function(response) { // If we have an unauthorized request we redirect to the login page // Don't do this check on the account API to avoid infinite loop if (response.status == 401 && response.data.path !== undefined && response.data.path.indexOf("/api/account") == -1){ var Auth = $injector.get('Auth'); var $state = $injector.get('$state'); var to = $rootScope.toState; var params = $rootScope.toStateParams; Auth.logout(); $rootScope.previousStateName = to; $rootScope.previousStateNameParams = params; $state.go('login'); } return $q.reject(response); } }; });
showWord(["n. ","branch medikal ki espesyalize nan trete granmoun ki avanse nan laj.<br>"])
/* jslint node: true */ var FILENAME = 'modules/empathy.js', ALL_JAVASCRIPT_FILES = ['Gruntfile.js', '*/*.js', 'public/javascripts/*.js']; module.exports = function(grunt) { 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { options: { jshintrc:true }, all: ALL_JAVASCRIPT_FILES }, clean: { // Clean any pre-commit hooks in .git/hooks directory hooks: ['.git/hooks/pre-commit'] }, // Run shell commands shell: { hooks: { // Copy the project's pre-commit hook into .git/hooks command: 'cp git-hooks/pre-commit .git/hooks/pre-commit' }, rmclogs: { // Run the script command: 'bash pre-build/script.bash' } }, watch: { scripts: { files: ALL_JAVASCRIPT_FILES, tasks: ['jshint'], options: { spawn: false }, }, } }); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); // Clean the .git/hooks/pre-commit file then copy in the latest version grunt.registerTask('hookmeup', ['clean:hooks', 'shell:hooks']); //build task grunt.registerTask('build', ['hookmeup']); grunt.event.on('watch', function(action, filepath) { grunt.log.writeln(filepath + ' has ' + action); }); };
/** * @version $Id: gantry-totop.js 58623 2012-12-15 22:01:32Z btowles $ * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3.0(\'j\',1(){2 a=f.d(\'c-9\');8(a){2 b=6 5.4(3);a.7(\'g\',\'h\').0(\'i\',1(e){e.k();b.l()})}});',22,22,'addEvent|function|var|window|Scroll|Fx|new|setStyle|if|totop|||gantry|id||document|outline|none|click|domready|stop|toTop'.split('|'),0,{}))
tinyMCE.addI18n('ja.emojiau',{ desc:"au\u7d75\u6587\u5b57", title:"au\u7d75\u6587\u5b57" });
var allTestCases = [ { world: "small", utterance: "take an object", interpretations: [["holding(e)", "holding(f)", "holding(g)", "holding(k)", "holding(l)", "holding(m)"]] }, { world: "small", utterance: "take a blue object", interpretations: [["holding(g)", "holding(m)"]] }, { world: "small", utterance: "take a box", interpretations: [["holding(k)", "holding(l)", "holding(m)"]] }, { world: "small", utterance: "put a ball in a box", interpretations: [["inside(e,k)", "inside(e,l)", "inside(f,k)", "inside(f,l)", "inside(f,m)"]] }, { world: "small", utterance: "put a ball on a table", interpretations: [] }, { world: "small", utterance: "put a ball above a table", interpretations: [["above(e,g)", "above(f,g)"]] }, { world: "small", utterance: "put a big ball in a small box", interpretations: [] }, { world: "small", utterance: "put a ball left of a ball", interpretations: [["leftof(e,f)", "leftof(f,e)"]] }, { world: "small", utterance: "take a white object beside a blue object", interpretations: [["holding(e)"]] }, { world: "small", utterance: "put a white object beside a blue object", interpretations: [["beside(e,g) | beside(e,m)"]] }, { world: "small", utterance: "put a ball in a box on the floor", interpretations: [["inside(e,k)", "inside(f,k)"], ["ontop(f,floor)"]] }, { world: "small", utterance: "put a white ball in a box on the floor", interpretations: [["inside(e,k)"]] }, { world: "small", utterance: "put a black ball in a box on the floor", interpretations: [["inside(f,k)"], ["ontop(f,floor)"]] }, // Under { world: "small", utterance: "put the yellow box below the blue box", interpretations: [["under(k,m)"]] }, { world: "small", utterance: "put the yellow box on the floor beside the blue box", interpretations: [["beside(k,m)"]] }, { world: "small", utterance: "take a ball in a box right of a table", interpretations: [["holding(f)"], ["holding(f)"]] }, { world: "small", utterance: "take the floor", interpretations: [] }, { world: "small", utterance: "take a ball left of a table", interpretations: [["holding(e)"]] }, { world: "small", utterance: "take a ball right of a table", interpretations: [["holding(f)"]] }, { world: "small", utterance: "put a ball below the floor", interpretations: [] }, { world: "small", utterance: "take a ball below the floor", interpretations: [] }, { world: "small", utterance: "take a ball beside a table beside a box", interpretations: [["holding(e)"]] }, { world: "small", utterance: "put a box beside the floor", interpretations: [] }, { world: "small", utterance: "put a ball on a floor under the table", interpretations: [] }, { world: "small", utterance: "put a ball on the red floor", interpretations: [] }, { world: "small", utterance: "drop it on the floor", interpretations: [["ontop(a,floor)"]] }, ]; // /* Simple test cases for the ALL quantifier, uncomment if you want */ // allTestCases.push( // {world: "small", // utterance: "put all balls on the floor", // interpretations: [["ontop(e,floor) & ontop(f,floor)"]] // }, // {world: "small", // utterance: "put every ball to the right of all blue things", // interpretations: [["rightof(e,g) & rightof(e,m) & rightof(f,g) & rightof(f,m)"]] // }, // {world: "small", // utterance: "put all balls left of a box on the floor", // interpretations: [["leftof(e,k) & leftof(f,k)"], ["ontop(e,floor)"]] // } // ); // /* More dubious examples for the ALL quantifier */ // /* (i.e., it's not clear that these interpretations are the best) */ // allTestCases.push( // {world: "small", // utterance: "put a ball in every large box", // interpretations: [["inside(e,k) & inside(f,k)", "inside(e,l) & inside(f,k)", // "inside(e,k) & inside(f,l)", "inside(e,l) & inside(f,l)"]] // }, // {world: "small", // utterance: "put every ball in a box", // interpretations: [["inside(e,k) & inside(f,k)", "inside(e,l) & inside(f,k)", // "inside(e,k) & inside(f,l)", "inside(e,l) & inside(f,l)", // "inside(e,k) & inside(f,m)", "inside(e,l) & inside(f,m)"]] // } // ); //# sourceMappingURL=InterpreterTestCases.js.map
import mockContext from "/imports/test-utils/helpers/mockContext"; import groupQuery from "./group"; const fakeShopId = "FAKE_SHOP_ID"; const fakeGroup = { _id: "FAKE_GROUP_ID", name: "fake", shopId: fakeShopId }; const fakeAccount = { _id: "FAKE_ACCOUNT_ID", groups: ["group1", "group2"] }; beforeEach(() => { jest.resetAllMocks(); }); test("throws not-found if the group does not exist", async () => { mockContext.collections.Groups.findOne.mockReturnValueOnce(undefined); const result = groupQuery(mockContext, fakeGroup._id); return expect(result).rejects.toThrowErrorMatchingSnapshot(); }); test("returns the group if userHasPermission returns true", async () => { mockContext.collections.Groups.findOne.mockReturnValueOnce(fakeGroup); mockContext.userHasPermission.mockReturnValueOnce(true); const result = await groupQuery(mockContext, fakeGroup._id); expect(mockContext.collections.Groups.findOne).toHaveBeenCalledWith({ _id: fakeGroup._id }); expect(mockContext.userHasPermission).toHaveBeenCalledWith(["owner", "admin", "reaction-accounts"], fakeGroup.shopId); expect(result).toEqual(fakeGroup); }); test("returns the group if userHasPermission returns false but the current user is in the group", async () => { mockContext.collections.Groups.findOne.mockReturnValueOnce(fakeGroup); mockContext.userHasPermission.mockReturnValueOnce(false); mockContext.collections.Accounts.findOne.mockReturnValueOnce(fakeAccount); const result = await groupQuery(mockContext, fakeGroup._id); expect(mockContext.collections.Groups.findOne).toHaveBeenCalledWith({ _id: fakeGroup._id }); expect(mockContext.userHasPermission).toHaveBeenCalledWith(["owner", "admin", "reaction-accounts"], fakeGroup.shopId); expect(mockContext.collections.Accounts.findOne).toHaveBeenCalledWith({ _id: mockContext.userId, groups: fakeGroup._id }, { projection: { _id: 1 } }); expect(result).toEqual(fakeGroup); }); test("throws access-denied if not allowed", async () => { mockContext.collections.Groups.findOne.mockReturnValueOnce(fakeGroup); mockContext.userHasPermission.mockReturnValueOnce(false); mockContext.collections.Accounts.findOne.mockReturnValueOnce(undefined); const result = groupQuery(mockContext, fakeGroup._id); return expect(result).rejects.toThrowErrorMatchingSnapshot(); });
var stream = require('getstream'); // Instantiate a new client (server side) client = stream.connect('9jtyb249ejzp', 'jnbe82eryq4qvquj4wn5dc8nh85bry33jpbmu84jn58xc3uk4y697xke4rcz9kyk', '24985'); // Instantiate a new client (client side) //client = stream.connect('9jtyb249ejzp', null, '24985'); var p1 = client.feed('project_aggregated', 'd0bbf3d8-c6da-460e-b7cf-ab99b79e9986'); // Read 'timeline' for jack - the post by chris will show up: p1.get({ limit: 10 }).then(function(results) { var activityData = results; console.log('Activity data:', activityData); // Read the next page, using id filtering for optimal performance: p1.get({ limit: 10, id_lte: activityData[activityData.length-1].id }).then(function(results) { var nextActivityData = results; console.log('Activity data:', activityData); }); });
var class_passed_message = [ [ "direction_t", "class_passed_message.html#a11c83e74aa007c495b32ec3ed4953a50", [ [ "INCOMING", "class_passed_message.html#a11c83e74aa007c495b32ec3ed4953a50a43c42d4afa45cd04736e0d59167260a4", null ], [ "OUTGOING", "class_passed_message.html#a11c83e74aa007c495b32ec3ed4953a50a862e80d4bad52c451a413eef983c16ae", null ] ] ], [ "gates_t", "class_passed_message.html#a7738b6f08855f784d1012de87fbfd9e6", [ [ "UPPER_DATA", "class_passed_message.html#a7738b6f08855f784d1012de87fbfd9e6adf76d3ca7bb9a62bed70965639d59859", null ], [ "UPPER_CONTROL", "class_passed_message.html#a7738b6f08855f784d1012de87fbfd9e6aea991e99dac6c91c9e3e89f902f1075d", null ], [ "LOWER_DATA", "class_passed_message.html#a7738b6f08855f784d1012de87fbfd9e6a97265ac51f333c88508670c5d3f5ded9", null ], [ "LOWER_CONTROL", "class_passed_message.html#a7738b6f08855f784d1012de87fbfd9e6afb379d2a15495f1ef2f290dc9ac97299", null ] ] ], [ "direction", "class_passed_message.html#af55219a6ed1e656af091cb7583467f5b", null ], [ "fromModule", "class_passed_message.html#a6c340595cb29a4e8a4c55ea0503dffad", null ], [ "gateType", "class_passed_message.html#a41f11b3139f3552cf2de3bb648c1ff55", null ], [ "kind", "class_passed_message.html#ab4e2bf6d2317196af7e9c98ed2c406a6", null ], [ "name", "class_passed_message.html#a8a4eb44ad1e43205d1881fec0c00a6d7", null ] ];
describe('Home Page', () => { it('Should load correctly', () => { cy.visit('/') cy.get('div.marketing-content') .should('contain', 'Real-time Retrospectives') }); it('Should login and write a post', () => { cy.get('.MuiButton-root').click(); cy.get('.MuiTabs-flexContainer > [tabindex="-1"]').click(); cy.get('.MuiInput-input').focus().type('Zelensky'); cy.get('.MuiDialogContent-root .MuiButton-root').click(); // Home page should display the user name cy.get('#content').should('contain', 'Welcome, Zelensky'); // And then allow creating a new session cy.get('button').contains('Create a new session').click(); // And write a post cy.get('input[placeholder*="What went well"]').focus().type('Slava Ukraini!{enter}'); // Reload the page cy.reload(); // The post should still be there cy.get('#content').should('contain', 'Slava Ukraini!'); }); });
/*jshint unused: vars */ /* define(['angular', 'angular-mocks', 'app'], function(angular, mocks, app) { 'use strict'; describe('Directive: progressBar', function () { // load the directive's module beforeEach(module('oslerApp.directives.ProgressBar')); var element, scope; beforeEach(inject(function ($rootScope) { scope = $rootScope.$new(); })); it('should make hidden element visible', inject(function ($compile) { element = angular.element('<progress-bar></progress-bar>'); element = $compile(element)(scope); expect(element.text()).toBe('this is the progressBar directive'); })); }); }); */
import { LOAD_MORE_MESSAGES, requestMessages, getNextOffset } from '../modules/message'; const loadMoreHandler = ({ store, action }) => { if (action.type !== LOAD_MORE_MESSAGES) { return; } const { type, key } = action.payload; const collectionState = store.getState().message.messagesCollections[type][key]; const offset = getNextOffset(collectionState); const { params = {} } = collectionState.request; store.dispatch(requestMessages(type, key, { ...params, offset })); }; export default store => next => (action) => { const result = next(action); loadMoreHandler({ store, action }); return result; };
'use strict' // const foo = (msg) => { // Função anónima... MAS o this tem outro significado // const foo = function(msg) { // Função anónima function foo(msg) { // if(msg == undefined) return console.log('Empty msg') if(!msg) return console.log('Empty msg') let str = '' for(let i = 0; i < arguments.length; i++){ str += arguments[i] + ', ' } console.log('this = ' + this + '; ' + msg + ' (args = ' + str + ')') } foo() foo('ola mundo') foo(3,4,4,5) foo.apply(null, [3,4,4,5]) foo.call(null, 'ola', 87364, 22, 'abc', 2, 3) const d = new foo(89) // !!!!!! NÃO FAZER const g = foo g('Calling foo through g') new g(76) // !!!!!! NÃO FAZER const obj = {} // <=> new Object() obj.xpto = foo obj.xpto(345) // this = obj obj.xpto.call(d, 6328) // this = d /* Cenas malucas !!!! foo.bar = foo foo.bar(6666) */
module.exports = { "extends": "airbnb-base", "plugins": [ "import" ], "env": { "browser": true, "mocha": true, "protractor": true, "node": true }, "globals": { "expect": true }, "rules": { "semi": ["error", "never"], "quotes": ["error", "double"], "indent": ["error", "tab"], "no-console": 0, "no-param-reassign": ["error", { "props": true, "ignorePropertyModificationsFor": [ "newParent", "parent", "child" ] }], "no-tabs": 0 } };
describe('Targets can be searched', function() { var store_records, store_operation, store_success; beforeEach(function() { this.application = Ext.create('Ext.app.Application', { name:'LSP', appFolder:'./app', requires:['LDA.helper.LDAConstants'], // Define all the controllers that should initialize at boot up of your application controllers:[ // 'LDAParserController', // 'Users', 'grids.DynamicGrid', // 'grids.PharmaGridInf', // 'Grid', 'NavigationTree', // 'Queryform', 'SimSearchForm', 'CmpdByNameForm', 'TargetByNameForm', 'PharmByTargetNameForm', 'PharmByCmpdNameForm', 'PharmByEnzymeFamily', // 'SummeryForm', 'Settings', // 'pmidTextMiningHitsForm', // 'pathwayByCompoundForm', // 'pathwayByProteinForm', // 'PharmByTargetNameFormInf', 'CW.controller.ConceptWikiLookup' ], // autoCreateViewport:true, launch:function () { //include the tests in the test.html head //jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); //jasmine.getEnv().execute(); } }); }); it('and results can be paginated', function() { var store = Ext.create('LDA.store.TargetPharmacologyPaginatedStore',{}); store.uri = 'http://www.conceptwiki.org/concept/b932a1ed-b6c3-4291-a98a-e195668eda49'; store.load(function(records, operation, success) { store_records = records; store_operation = operation; store_success = operation.success; }); waitsFor( function(){ return !store.isLoading(); }, "load never completed", 4000 ); runs(function() { expect(store_success).toEqual(true); }); }); it('and results can be filtered for activities', function() { var store = Ext.create('LDA.store.TargetPharmacologyPaginatedStore',{}); store.uri = 'http://www.conceptwiki.org/concept/b932a1ed-b6c3-4291-a98a-e195668eda49'; store.setActivityType('IC50'); store.setActivityValue('10000'); store.setActivityCondition('<'); store.load(function(records, operation, success) { store_records = records; store_operation = operation; store_success = operation.success; }); waitsFor( function(){ return !store.isLoading(); }, "load never completed", 4000 ); runs(function() { expect(store_success).toEqual(true); }); }); it('and specific pages can be requested', function() { var store = Ext.create('LDA.store.TargetPharmacologyPaginatedStore',{}); store.uri = 'http://www.conceptwiki.org/concept/b932a1ed-b6c3-4291-a98a-e195668eda49'; store.page = 10; store.setActivityType('IC50'); store.setActivityValue('10000'); store.setActivityCondition('<'); store.load(function(records, operation, success) { store_records = records; store_operation = operation; store_success = operation.success; }); waitsFor( function(){ return !store.isLoading(); }, "load never completed", 4000 ); runs(function() { expect(store_success).toEqual(true); }); }); });
var mongoose = require("mongoose"); // definicion del esquema var Schema = mongoose.Schema; var LibroSchema = new Schema({ titulo: String, autor: String, campos_biblioteca: { ejemplares: Number, ultima_reserva: Date } }) var ReservaSchema = new Schema({}); module.exports = { Libro: mongoose.model("Libro", LibroSchema), Reserva: mongoose.model("Libro", LibroSchema) }
'use strict'; var app = angular.module('exemplo', []).controller('clienteController', function($scope, $http){ $scope.mensagem_erro = ''; $scope.resultado = ''; $scope.novoCliente = {}; $scope.carregarClientes = function() { var url = 'http://localhost:8080/clientes/'; $http.get(url) .success(function(data) { $scope.clientes = data; }) .error(function (exception) { $scope.mensagem_erro = 'Ocorreu um erro ao tentar recuperar os clientes.' + exception; }); }; $scope.excluirCliente = function(_cliente) { var url = 'http://localhost:8080/cliente/'; $http.delete(url + _cliente.id + '/excluir') .success(function(data, status) { console.log(data); console.log('status: ' + status); $scope.carregarClientes(); }) .error(function (exception) { $scope.mensagem_erro = 'Ocorreu um erro ao tentar excluir o cliente ' + _cliente.id + ': ' + exception; }); }; $scope.carregarDadosCliente = function(_id) { var url = 'http://localhost:8080/cliente/'; $http.get(url + _id) .success(function(data) { $scope.cliente = data; }) .error(function (exception) { $scope.mensagem_erro = 'Ocorreu um erro ao tentar recuperar os dados do cliente ' + _id + ': ' + exception; }); }; $scope.atualizarCadastroCliente = function(_cliente) { var url = 'http://localhost:8080/cliente/'; $http.put(url + _cliente.id, _cliente) .success(function(data, status) { console.log(data); console.log('status: ' + status); $scope.resultado = data; if (status == 201) { $scope.resultado = 'Cliente alterado com sucesso!'; }; }) .error(function (exception, status) { console.log('status: ' + status); console.log("error: "+exception); $scope.resultado = 'Ocorreu um erro ao tentar alterar os dados do cliente ' + _cliente.id + ': ' + exception; }); }; $scope.cadastrarNovoCliente = function(_novoCliente) { var url = 'http://localhost:8080/clientes/cadastrar'; $http.post(url, _novoCliente) .success(function(data, status) { console.log(data); console.log('status: ' + status); $scope.resultado = data; if (status == 201) { $scope.resultado_sucesso = 'Cliente cadastrado com sucesso!'; $scope.resultado_erro = ''; }; }) .error(function (exception) { console.log("error: "+exception); $scope.resultado_erro = ''; $scope.resultado_erro = 'Ocorreu um erro ao tentar cadastrar um novo cliente: ' + exception; }); }; $scope.carregarClientes(); // $scope.carregarDadosCliente(7); }); app.directive('ngConfirmClick', [ function(){ return { link: function (scope, element, attr) { var msg = attr.ngConfirmClick || "Are you sure?"; var clickAction = attr.confirmedClick; element.bind('click',function (event) { if ( window.confirm(msg) ) { scope.$eval(clickAction) } }); } }; }])
(function ($) { "use strict"; /** * Constructor * @constructor */ $.MicaTimeline = function (dtoParser, popupIdFormatter, useBootstrapTooltip) { this.parser = dtoParser; this.popupIdFormatter = popupIdFormatter; this.useBootstrapTooltip = useBootstrapTooltip; }; /** * Class method definition * @type {{create: create}} */ $.MicaTimeline.prototype = { create: function (selectee, studyDto) { if (this.parser === null || studyDto === null) return; var timelineData = this.parser.parse(studyDto); if (timelineData) createTimeline(this, timelineData, selectee, studyDto); return this; }, addLegend: function () { if (!this.timelineData || !this.timelineData.hasOwnProperty('data') || this.timelineData.data.length === 0) return; var ul = $("<ul id='legend' class='timeline-legend'>"); $(this.selectee).after(ul); var processedPopulations = {}; $.each(this.timelineData.data, function(i, item) { if (!processedPopulations.hasOwnProperty(item.population.title)) { processedPopulations[item.population.title] = true; var li = $(createLegendRow(item.population.color, item.population.title)); ul.append(li); } }); return this; }, reset: function() { $(this.selectee).empty(); $('.timeline-legend').remove(); return this; } }; function createTimeline(timeline, timelineData, selectee, studyDto) { var width = $(selectee).width(); var chart = d3.timeline() .startYear(timelineData.start) .beginning(timelineData.min) .ending(timelineData.max) .width(width) .stack() .tickFormat({ format: d3.format("d"), tickTime: 1, tickNumber: 1, tickSize: 10 }) .margin({left: 15, right: 15, top: 0, bottom: 20}) .rotateTicks(timelineData.max > $.MicaTimeline.defaultOptions.maxMonths ? 45 : 0) .click(function (d, i, datum) { if (timeline.popupIdFormatter) { var popup = $(timeline.popupIdFormatter(studyDto, datum.population, d)); if (popup.length > 0) popup.modal(); } }); d3.select(selectee).append("svg").attr("width", width).datum(timelineData.data).call(chart); if (timeline.useBootstrapTooltip === true) { d3.select(selectee).selectAll('#line-path') .attr('data-placement', 'top') .attr('data-toggle', 'tooltip') .attr('data-original-title', function(d){ return d.title; }) .selectAll('title').remove(); // remove default tooltip } timeline.timelineData = timelineData; timeline.selectee = selectee; } /** * @param color * @param title * @returns {*|HTMLElement} */ function createLegendRow(color, title) { var rect ="<rect width='20' height='20' x='2' y='2' rx='5' ry='5' style='fill:COLOR;'>".replace(/COLOR/, color); return $("<li><svg width='25' height='25'>"+rect+"</svg>"+title+"</li>"); } /** * Default options * @type {{maxMonths: number}} */ $.MicaTimeline.defaultOptions = { maxMonths: 300 }; }(jQuery));
import {Ternary} from "./ternary"; import {cast} from "./cast"; export const F = Object.assign(new Ternary("F", false), { and() { return this; }, xor(b) { return cast(b); } }); Ternary.F = F;
import mongoose, { Schema } from 'mongoose' import auditingSchema from '../../core/base.model' import mongoosePaginate from 'mongoose-paginate' import uniqueValidator from 'mongoose-unique-validator' const ClassifiedReleaseOrderSchema = new auditingSchema({ publicationId: { type: Schema.ObjectId, ref: 'Publication', required: true, }, releaseOrderNumber: { type: String, required: true, unique: true, }, specialInstructions: { type: String, }, dateOfCreation: { type: Date, }, }) ClassifiedReleaseOrderSchema.pre('validate', function(next) { next() }) ClassifiedReleaseOrderSchema.methods = { /* Model Instance Methods come here */ } /* Plug-ins */ ClassifiedReleaseOrderSchema.plugin(mongoosePaginate) ClassifiedReleaseOrderSchema.plugin(uniqueValidator, { message: 'Classified Release Order : "{VALUE}" already exists in system', }) export default mongoose.model( 'ClassifiedReleaseOrder', ClassifiedReleaseOrderSchema )
import React from "react"; import { composeWithTracker } from "@reactioncommerce/reaction-components"; import { Template } from "meteor/templating"; import { Roles } from "meteor/alanning:roles"; import { Reaction } from "/client/api"; /** * Push package into action view navigation stack * @param {SyntheticEvent} event Original event * @param {Object} app Package data * @return {undefined} No return value * @private */ function handleShowPackage(event, app) { Reaction.pushActionView(app); } /** * Open full dashbaord menu * @return {undefined} No return value * @private */ function handleShowDashboard() { Reaction.hideActionViewDetail(); Reaction.showActionView({ i18nKeyTitle: "dashboard.coreTitle", title: "Dashboard", template: "dashboardPackages" }); } /** * Push dashbaord & package into action view navigation stack * @param {SyntheticEvent} event Original event * @param {Object} app Package data * @return {undefined} No return value * @private */ function handleOpenShortcut(event, app) { Reaction.hideActionViewDetail(); Reaction.showActionView(app); } function composer(props, onData) { const audience = Roles.getRolesForUser(Reaction.getUserId(), Reaction.getShopId()); const settings = Reaction.Apps({ provides: "settings", enabled: true, audience }) || []; const dashboard = Reaction.Apps({ provides: "dashboard", enabled: true, audience }) .filter((d) => typeof Template[d.template] !== "undefined") || []; onData(null, { currentView: Reaction.getActionView(), groupedPackages: { actions: { title: "Actions", i18nKeyTitle: "admin.dashboard.packageGroupActionsLabel", packages: dashboard }, settings: { title: "Settings", i18nKeyTitle: "admin.dashboard.packageGroupSettingsLabel", packages: settings } }, // Callbacks handleShowPackage, handleShowDashboard, handleOpenShortcut }); } export default function PackageListContainer(Comp) { function CompositeComponent(props) { return ( <Comp {...props} /> ); } return composeWithTracker(composer)(CompositeComponent); }
define({ "sourceSetting": "Pretraži postavke izvora", "instruction": "Dodaj i konfiguriši servise za geokodiranje ili slojeve geoobjekata kao izvore pretrage. Ovi navedeni izvori određuju šta može da se pretražuje unutar trake za pretragu.", "add": "Dodaj izvor pretrage", "addGeocoder": "Dodaj geokoder", "geocoder": "Geokoder", "setLayerSource": "Postavi izvor sloja", "setGeocoderURL": "Postavi URL adresu geokôdera", "searchableLayer": "Sloj geoobjekata", "name": "Naziv", "countryCode": "Kôd(ovi) zemlje ili regiona", "countryCodeEg": "npr. ", "countryCodeHint": "Ako ova vrednost ostane prazna, pretražuju se sve zemlje i regioni", "generalSetting": "Opšte postavke", "allPlaceholder": "Tekst čuvara mesta za pretragu svega: ", "showInfoWindowOnSelect": "Prikaži iskačući prozor za pronađeni geoobjekat ili lokaciju", "searchInCurrentMapExtent": "Pretraži samo u trenutnom obuhvatu mape", "zoomScale": "Skala zumiranja", "locatorUrl": "URL adresa geokodera", "locatorName": "Ime geokodera", "locatorExample": "Primer", "locatorWarning": "Ova verzija servisa geokôdiranja nije podržana. Vidžet podržava samo servis geokôdiranja 10.1 i novije.", "locatorTips": "Predlozi nisu dostupni jer servis geokôdiranja ne podržava predloženu mogućnost.", "layerSource": "Izvor sloja", "searchLayerTips": "Predlozi nisu dostupni jer servis geoobjekata ne podržava mogućnost paginacije.", "placeholder": "Tekst čuvara mesta", "searchFields": "Polja za pretragu", "displayField": "Prikaži polje", "exactMatch": "Potpuno podudaranje", "maxSuggestions": "Maksimalno predloga", "maxResults": "Maksimalno rezultata", "enableLocalSearch": "Omogući lokalnu pretragu", "minScale": "Min. razmera", "minScaleHint": "Kada je razmera mape veća od ove razmere, primenjuje se lokalna pretraga", "radius": "Poluprečnik", "radiusHint": "Definiše poluprečnik oblasti oko trenutnog centra mape koja se koristi za poboljšavanje rangiranja kandidata za geokodiranje kako bi se prvo vraćali kandidati najbliži lokaciji", "meters": "Metri", "setSearchFields": "Postavi polja pretrage", "set": "Postavi", "fieldSearchable": "pretraživo", "fieldName": "Naziv", "fieldAlias": "Alias", "ok": "U redu", "cancel": "Otkaži", "invalidUrlTip": "URL adresa ${URL} nije validna ili nije dostupna." });
import epics from './src/metricsEpics'; import { reducer } from './src/metricsReducer'; import * as selector from './src/metricsSelectors'; import * as constants from './src/metricsConstants'; import Metrics from './src/metricsPage'; import { MetricsMenu } from './src/metricsMenu'; export default { name: 'Metrics', page: Metrics, menu: MetricsMenu, store: { name: 'metrics', epics, reducer, selector, constants } };
export class Timer { /** * diff 2 `Date` in Millisecond * @param {Date} since * @param {Date} until */ static diff(since, until) { return (until.getTime() - since.getTime()); } constructor() { /** time elapsed in millisecond */ this.sum = 0; this.running = false; this.begin = new Date(0); } set(millisecond) { this.sum = Math.trunc(millisecond); if (this.running) { this.begin = new Date(); } } offset(offset) { const target = this.get() + Math.trunc(offset); this.set(target); } get() { if (!this.running) return this.sum; return this.sum + Timer.diff(this.begin, new Date()); } start() { if (!this.running) { this.running = true; this.begin = new Date(); } } stop() { if (this.running) { this.running = false; this.sum += Timer.diff(this.begin, new Date()); } } /** clear elapsed time, then start */ clear() { this.sum = 0; this.running = true; this.begin = new Date(); } /** clear elapsed time, but do __NOT__ start */ reset() { this.sum = 0; this.running = false; this.begin = new Date(0); } }
'use strict'; module.exports = function(grunt) { grunt.config('clean', { all: '<%= settings.build.dst %>' }); }
// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, angularCli: { environment: 'dev' }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], customLaunchers: { Chrome_travis_ci: { base: 'Chrome', flags: ['--no-sandbox'] } }, singleRun: false }); };
var a00116 = [ [ "Advertising Data Encoder", "a00118.html", null ], [ "Debug Assert Handler", "a00119.html", null ], [ "BLE Device Manager", "a00126.html", [ [ "Initialization", "a00126.html#lib_device_manaegerit", [ [ "Associated Events", "a00126.html#lib_device_manager_init_evt", null ], [ "Associated Configuration Parameters", "a00126.html#lib_device_manager_init_cnfg_param", null ] ] ], [ "Registration", "a00126.html#lib_device_manager_register", [ [ "Associated Events", "a00126.html#lib_cnxn_register_evt", null ], [ "Associated Configuration Parameters", "a00126.html#lib_cnxn_register_cnfg_param", null ] ] ] ] ], [ "Connection Parameters Negotiation", "a00120.html", [ [ "Overview", "a00120.html#Overview", null ], [ "Initialization and Set-up", "a00120.html#lib_ble_conn_params_init", null ], [ "Shutdown", "a00120.html#lib_ble_conn_params_stop", null ], [ "Change/Update Connection Parameters Negotiated", "a00120.html#lib_ble_conn_params_change_conn_params", null ] ] ], [ "DTM - Direct Test Mode", "a00121.html", null ], [ "Error Log", "a00122.html", null ], [ "Record Access Control Point", "a00123.html", null ], [ "Radio Notification Event Handler", "a00124.html", null ], [ "Sensor Data Simulator", "a00125.html", null ] ];
import StorageAdapter from 'ui-web/snf/adapters/storage'; export default StorageAdapter.extend({ findQuery: function(store, type, query) { var object_id = store.get('object_id'); delete store.object_id; return this.ajax(this.buildURL(type.typeKey, object_id), 'GET', { data: query }); }, });
import 'bootstrap'; import '../imports/startup/client/index.js';
class Color { constructor () { this.r = Color.value(); this.g = Color.value(); this.b = Color.value(); this.style = "rgba(" + this.r + "," + this.g + "," + this.b + ",1)"; //this.style = "rgba(233,72,152,1)"; } static value () { return Math.floor(Math.random() * 255); } } class Dot { constructor (parent) { this.parent = parent; this.x = Math.random() * this.parent.parent.width; this.y = Math.random() * this.parent.parent.height; // Speed of Dots (+- 0.5) this.vx = Math.random() - 0.5; this.vy = Math.random() - 0.5; this.radius = Math.random() * 2; this.color = new Color(); } draw () { this.parent.context.beginPath(); this.parent.context.fillStyle = this.color.style; this.parent.context.arc(this.x, this.y, this.radius, 0, 2 * Math.PI, false); this.parent.context.fill(); } } class ConnectDots { constructor(parent) { let interval = 70; let nb_num = 250; let radius_num = 60; this.interval = interval; this.nb_num = nb_num; this.radius_num = radius_num; this.parent = parent; this.updateSize(); this.connectArea = { x: 50 * this.parent.width / 100, y: 50 * this.parent.height / 100 }; this.dots = { nb: this.nb_num, distMax: 100, //connectAreaRadius: canvas.width/4, connectAreaRadius: this.radius_num, array: [] }; $(window).resize(this.updateSize()); $(this.parent).on ("mousemove", (e) => { this.connectArea.x = e.pageX; this.connectArea.y = e.pageY; }); } static mixComponents(comp1, comp2, weight1, weight2) { return (comp1 * weight1 + comp2 * weight2) / (weight1 + weight2); } updateSize () { this.parent.width = Math.min ($(this.parent).parent().width(), window.innerWidth); this.parent.height = Math.min ($(this.parent).parent().height(), window.innerHeight); this.parent.style.display = 'block'; this.context = this.parent.getContext("2d"); this.context.lineWidth = 0.2; } gradient(dot1, dot2, midColor) { let grad = this.context.createLinearGradient( Math.floor(dot1.x), Math.floor(dot1.y), Math.floor(dot2.x), Math.floor(dot2.y)); grad.addColorStop(0, dot1.color.style); grad.addColorStop(Math.floor(dot1.radius / (dot1.radius / dot2.radius)), midColor); grad.addColorStop(1, dot2.color.style); return grad; } lineStyle(dot1, dot2) { let r = ConnectDots.mixComponents(dot1.color.r, dot2.color.r, dot1.radius, dot2.radius); let g = ConnectDots.mixComponents(dot1.color.g, dot2.color.g, dot1.radius, dot2.radius); let b = ConnectDots.mixComponents(dot1.color.b, dot2.color.b, dot1.radius, dot2.radius); let midColor = 'rgba(' + Math.floor(r) + ',' + Math.floor(g) + ',' + Math.floor(b) + ', 0.8)'; r = g = b = null; return this.gradient(dot1, dot2, midColor); } moveDots() { for (let i = 0; i < this.dots.nb; i++) { let dot = this.dots.array[i]; if (dot.y < 0 || dot.y > this.parent.height) dot.vy = -dot.vy; else if (dot.x < 0 || dot.x > this.parent.width) dot.vx = -dot.vx; dot.x += dot.vx; dot.y += dot.vy; dot = null; } } connectDots() { for (let i = 0; i < this.dots.nb; i++) { for (let j = 0; j < this.dots.nb; j++) { if (i === j) continue; let dot1 = this.dots.array[i]; let dot2 = this.dots.array[j]; let xDiff = dot1.x - dot2.x; let yDiff = dot1.y - dot2.y; let xCoreDiff = dot1.x - this.connectArea.x; let yCoreDiff = dot1.y - this.connectArea.y; if ((xDiff < this.dots.distMax && xDiff > -this.dots.distMax) && (yDiff < this.dots.distMax && yDiff > -this.dots.distMax) && (xCoreDiff < this.dots.connectAreaRadius && xCoreDiff > -this.dots.connectAreaRadius) && (yCoreDiff < this.dots.connectAreaRadius && yCoreDiff > -this.dots.connectAreaRadius)) { this.context.beginPath(); this.context.strokeStyle = this.lineStyle(dot1, dot2); this.context.moveTo(dot1.x, dot1.y); this.context.lineTo(dot2.x, dot2.y); this.context.stroke(); this.context.closePath(); } dot1 = null; dot2 = null; xDiff = null; yDiff = null; xCoreDiff = null; yCoreDiff = null; } } } createDots() { for (let i = 0; i < this.dots.nb; i++) this.dots.array.push(new Dot(this)); } drawDots() { for (let i = 0; i < this.dots.nb; i++) this.dots.array[i].draw(); } animateDots() { this.context.clearRect(0, 0, this.parent.width, this.parent.height); this.moveDots(); this.connectDots(); this.drawDots(); requestAnimationFrame(() => {this.animateDots ()}); } run () { this.createDots(); this.animateDots(); } }
importScripts('../js/examples.js', './solutions.js', '../js/Puzzle.js'); onmessage = function (event) { if (event.data === 'start') { runTests(); } }; function runTests() { var count = 1; for (var name in solutions) { testCase(count, name); count++; } postMessage({ type: 'finished' }); } function append_text(text) { postMessage({ type: 'append', text: text }); } function testCase(count, name) { append_text("<h2> " + count + ". " + examples[name].width + " x " + examples[name].height + " " + name + " </h2>"); append_text("<p>Solving . . .</p>"); var start = new Date().getTime(); var puzzle = new Puzzle(examples[name]); puzzle.solve(void 0); var duration = (new Date().getTime() - start) / 1000; append_text("<p>Took " + duration + " seconds</p>"); var passed = true; if (puzzle.solutions.length !== solutions[name].length) { append_text("<p>Number of solutions are not equal (" + solutions[name].length + " should be " + puzzle.solutions.length + ")</p>"); passed = false; } else { for (var i = 0; i < puzzle.solutions.length; i++) { var solution_passed = false; for (var j = 0; j < solutions[name].length; j++) { if (compare_states(puzzle.solutions[i], solutions[name].solutions[j])) solution_passed = true; } if (solution_passed) { append_text("<p>Solution " + (i + 1) + " passed.</p>"); } else { append_text("<p>Solution " + (i + 1) + " did not pass.</p>"); passed = false; } } } if (passed) { append_text('<p style="font-weight: bold; color: green;">Testcase passed!</p>'); } else { append_text('<p style="font-weight: bold; color: red;">Testcase did not pass!</p>'); } postMessage({ type: 'statistics', passed: passed }); append_text('<hr>'); } function compare_states(state1, state2) { if (state1.length !== state2.length) return false; for (var i = 0; i < state1.length; i++) { if (state1[i].length !== state2[i].length) return false; for (var j = 0; j < state1[i].length; j++) { if (state1[i][j] !== state2[i][j]) return false; } } return true; }
(function() { 'use strict'; angular .module('anelclothesApp') .config(stateConfig); stateConfig.$inject = ['$stateProvider']; function stateConfig($stateProvider) { $stateProvider.state('gateway', { parent: 'admin', url: '/gateway', data: { authorities: ['ROLE_ADMIN'], pageTitle: 'gateway.title' }, views: { 'content@': { templateUrl: 'app/admin/gateway/gateway.html', controller: 'GatewayController', controllerAs: 'vm' } }, resolve: { translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { $translatePartialLoader.addPart('gateway'); return $translate.refresh(); }] } }); } })();
var class_n_b_frame = [ [ "checkOptions", "dc/d86/class_n_b_frame.html#a1d586add0fd5236f91a41673552cbb03", null ], [ "fillOptions", "dc/d86/class_n_b_frame.html#af1901022d54dc5509e070f68e8101217", null ] ];
import AbstractRepository from "./abstract_repository" export default class ProfileRepository extends AbstractRepository { constructor(db) { super(db); } tableName() { return "profiles"; } initialColumns() { return [ // Note the specific ordering, this is critical for the sql // queries to work. ["email", "VARCHAR(100)"], ["zip_code", "VARCHAR(20)"], ["race_of_bees", "TEXT"], ["full_name", "TEXT"] ]; }; migratedColumns() { return []; }; }
import { moduleFor, test } from 'ember-qunit'; moduleFor('service:canvas', { // Specify the other units that are required for this test. // needs: ['service:foo'] }); // Replace this with your real tests. test('it exists', function(assert) { var service = this.subject(); assert.ok(service); });
'use strict'; const Q = require('q'); function getPromise(){ let deferred = Q.defer(); //Resolve the promise after a second setTimeout(() => { deferred.resolve('final value'); }, 1000); return deferred.promise; } let promise = getPromise(); promise.then((val) => { console.log('done with:', val); });
(function() { 'use strict'; angular .module('otusjs.player.core.phase') .service('otusjs.player.core.phase.SaveActionService', Service); Service.$inject = [ 'otusjs.player.core.phase.ActionPipeService', 'otusjs.player.core.phase.PreSaveActionService', 'otusjs.player.core.phase.ExecutionSaveActionService', 'otusjs.player.core.phase.PostSaveActionService' ]; function Service(ActionPipeService, PreSaveActionService, ExecutionSaveActionService, PostSaveActionService) { var self = this; /* Public methods */ self.PreSaveActionService = PreSaveActionService; self.ExecutionSaveActionService = ExecutionSaveActionService; self.PostSaveActionService = PostSaveActionService; self.execute = execute; function execute() { var phaseData = PreSaveActionService.execute(ActionPipeService.flowData); phaseData = ExecutionSaveActionService.execute(phaseData); phaseData = PostSaveActionService.execute(phaseData); } } })();
// Representa um ação que pode ser desfeita e refeita // A ação é associada a uma aba aberta // Nas funções redo e undo, this se refere à aba associada à ação function Acao(nome, redo, undo) { var aba = Interface.abaFoco this.id = String(Math.random()) this.nome = nome this.redo = redo this.undo = undo if (aba.posHistorico < aba.historico.length) aba.historico = aba.historico.slice(0, aba.posHistorico) aba.historico.push(this) aba.posHistorico = aba.historico.length redo.call(aba) aba.livro.modificado = true InterfaceEdicao.atualizarDesfazer() } // Retorna o nome da ação a ser desfeita na aba ativa (null caso nada possa ser desfeito) Acao.getDesfazer = function () { var aba, acao aba = Interface.abaFoco acao = aba.historico[aba.posHistorico-1] if (aba.posHistorico > 0 && acao.undo) return acao.nome return null } // Retorna o nome da ação a ser refeita na aba ativa (null caso nada possa ser refeito) Acao.getRefazer = function () { var aba, acao aba = Interface.abaFoco acao = aba.historico[aba.posHistorico] if (aba.posHistorico < aba.historico.length && acao.redo) return acao.nome return null } // Desfaz a última ação na aba Acao.desfazer = function (aba) { var acao if (aba.posHistorico > 0) { acao = aba.historico[aba.posHistorico-1] if (acao.undo) { acao.undo.call(aba) aba.posHistorico-- if ((aba.posHistorico && aba.historico[aba.posHistorico-1].id!=aba.idAcaoSalvo) || (!aba.posHistorico && aba.idAcaoSalvo!="")) aba.livro.modificado = true else aba.livro.modificado = false } } } // Refaz a ação na aba Acao.refazer = function (aba) { var acao if (aba.posHistorico < aba.historico.length) { acao = aba.historico[aba.posHistorico] if (acao.redo) { acao.redo.call(aba) aba.posHistorico++ if ((aba.posHistorico && aba.historico[aba.posHistorico-1].id!=aba.idAcaoSalvo) || (!aba.posHistorico && aba.idAcaoSalvo!="")) aba.livro.modificado = true else aba.livro.modificado = false } } }
'use strict'; angular.module('myApp.home', ['ngRoute']) // Declared route .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/home', { templateUrl: 'views/home/home.html', controller: 'HomeCtrl' }); }]) // Home controller .controller('HomeCtrl', [function() { }]);
'use strict'; /* globals app, ajaxify, define, socket */ define('forum/topic/events', ['forum/topic/browsing', 'forum/topic/postTools', 'forum/topic/threadTools'], function(browsing, postTools, threadTools) { var Events = {}; var events = { 'event:update_users_in_room': browsing.onUpdateUsersInRoom, 'user.isOnline': browsing.onUserOnline, 'event:voted': updatePostVotesAndUserReputation, 'event:favourited': updateFavouriteCount, 'event:topic_deleted': toggleTopicDeleteState, 'event:topic_restored': toggleTopicDeleteState, 'event:topic_locked': toggleTopicLockedState, 'event:topic_unlocked': toggleTopicLockedState, 'event:topic_pinned': toggleTopicPinnedState, 'event:topic_unpinned': toggleTopicPinnedState, 'event:topic_moved': onTopicMoved, 'event:post_edited': onPostEdited, 'event:post_deleted': togglePostDeleteState, 'event:post_restored': togglePostDeleteState, 'posts.favourite': togglePostFavourite, 'posts.unfavourite': togglePostFavourite, 'posts.upvote': togglePostVote, 'posts.downvote': togglePostVote, 'posts.unvote': togglePostVote, 'event:topic.toggleReply': toggleReply, }; Events.init = function() { for(var eventName in events) { if (events.hasOwnProperty(eventName)) { socket.on(eventName, events[eventName]); } } }; Events.removeListeners = function() { for(var eventName in events) { if (events.hasOwnProperty(eventName)) { socket.removeListener(eventName, events[eventName]); } } }; function updatePostVotesAndUserReputation(data) { var votes = $('li[data-pid="' + data.post.pid + '"] .votes'), reputationElements = $('.reputation[data-uid="' + data.post.uid + '"]'); votes.html(data.post.votes).attr('data-votes', data.post.votes); reputationElements.html(data.user.reputation).attr('data-reputation', data.user.reputation); } function updateFavouriteCount(data) { $('li[data-pid="' + data.post.pid + '"] .favouriteCount').html(data.post.reputation).attr('data-favourites', data.post.reputation); } function toggleTopicDeleteState(data) { threadTools.setLockedState(data); threadTools.setDeleteState(data); } function toggleTopicLockedState(data) { threadTools.setLockedState(data); app.alertSuccess(data.isLocked ? '[[topic:topic_lock_success]]' : '[[topic:topic_unlock_success]]'); } function toggleTopicPinnedState(data) { threadTools.setPinnedState(data); app.alertSuccess(data.isPinned ? '[[topic:topic_pin_success]]' : '[[topic:topic_unpin_success]]'); } function onTopicMoved(data) { if (data && data.tid > 0) { ajaxify.go('topic/' + data.tid); } } function onPostEdited(data) { var editedPostEl = $('#content_' + data.pid), editedPostTitle = $('#topic_title_' + data.pid); if (editedPostTitle.length) { editedPostTitle.fadeOut(250, function() { editedPostTitle.html(data.title); editedPostTitle.fadeIn(250); }); } editedPostEl.fadeOut(250, function() { editedPostEl.html(data.content); editedPostEl.find('img').addClass('img-responsive'); editedPostEl.fadeIn(250); }); } function togglePostDeleteState(data) { var postEl = $('#post-container li[data-pid="' + data.pid + '"]'); if (postEl.length) { postEl.toggleClass('deleted'); var isDeleted = postEl.hasClass('deleted'); postTools.toggle(data.pid, isDeleted); if (!app.isAdmin && parseInt(data.uid, 10) !== parseInt(app.uid, 10)) { if (isDeleted) { translator.translate('[[topic:post_is_deleted]]', function(translated) { postEl.find('.post-content').html(translated); }); } else { postEl.find('.post-content').html(data.content); } } postTools.updatePostCount(); } } function togglePostFavourite(data) { var favBtn = $('li[data-pid="' + data.post.pid + '"] .favourite'); if (favBtn.length) { favBtn.addClass('btn-warning') .attr('data-favourited', data.isFavourited); var icon = favBtn.find('i'); var className = icon.attr('class'); if (data.isFavourited ? className.indexOf('-o') !== -1 : className.indexOf('-o') === -1) { icon.attr('class', data.isFavourited ? className.replace('-o', '') : className + '-o'); } } } function togglePostVote(data) { var post = $('li[data-pid="' + data.post.pid + '"]'); post.find('.upvote').toggleClass('btn-primary upvoted', data.upvote); post.find('.downvote').toggleClass('btn-primary downvoted', data.downvote); } function toggleReply(data) { $('.thread_active_users [data-uid="' + data.uid + '"]').toggleClass('replying', data.isReplying); } return Events; });
/** * Created by trebollo on 6/2/16. */ var express = require('express'); var router = express.Router(); // Check auth on every resource router.get('*', function(req, res, next) { //console.log('Checking AUTH permissions for request ' + req.method + ' - ' + req.baseUrl); next(); }); module.exports = router;
var eio = require('engine.io'), HashMap = require('hashmap').HashMap; function Server() { var self = this; self.endpoint = { port: 44444, host: 'localhost' }; self.server = eio.listen(self.endpoint.port, self.endpoint.host); self.server.on('connection', function(socket){ console.log('Server :: Connection from socket: ' + socket.id); socket.on('message', function(msg){ console.log('Server :: Message event from socket: ' + socket.id + ', with message: ' + msg); // echo message back socket.send('echoed back: ' + msg); }); socket.on('close', function(){ console.log('Server :: Close event from socket: ' + socket.id); }); socket.on('disconnect', function(){ console.log('Server :: Disconnect event from socket: ' + socket.id); }); }); } var server = new Server();
Ext.define('Onlineshopping.onlineshopping.shared.shop.viewmodel.retail.PaymentProcessingViewModel', { 'extend': 'Ext.app.ViewModel', 'alias': 'viewmodel.PaymentProcessingViewModel', 'model': 'PaymentProcessingModel' });
/* 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( 'save', 'no', { toolbar: 'Lagre' } );
import React from 'react'; import PermitSearchResultsByAddress from './PermitSearchResultsByAddress' function PermitSearchResultsAddress(props) { if (props.data === null) { return <p>No results found</p>; } if (!props.data.length) { return <p>No results found</p>; } const addressList = props.data.map((result, index) => { const addressButtonStyle = (parseInt(result.civic_address_id) === parseInt(props.showPermitsForID)) ? 'active' : ''; return ( <li key={index}> <button type="button" title={`View permits for ${result.address}`} data-address={result.civic_address_id} className={`list-group-item list-group-item-action ${addressButtonStyle}`} onClick={props.handleAddressSelection} > {result.address}, {result.zipcode} (ID: {result.civic_address_id}) </button> {parseInt(result.civic_address_id) === parseInt(props.showPermitsForID) && <PermitSearchResultsByAddress key={index} civicAddressID={result.civic_address_id} /> } </li> ); }) return addressList; }; export default PermitSearchResultsAddress;
/*global Ext, i18n*/ //<debug> console.log(new Date().toLocaleTimeString() + ": Log: Load: WPAKD.view.desktop.icons.SystemConfiguration"); //</debug> Ext.define("WPAKD.view.desktop.icons.SystemConfiguration", { extend: "Ext.Container", alias: "widget.desktopiconssystemconfiguration", draggable: true, floating: true, layout: {type: "vbox", align: "center"}, width: 80, defaults: {frame: true}, items: [{ xtype: "container", height: 10 }, { xtype: "container" , html: "<center><i class=\"fa fa-cog\"></i></center>" , style: "font-size: 3em;" , height: 40 , width: 40 }, { xtype: "container", style: {"text-align": "center", color: "#FFFFFF"}, html: i18n.gettext("System <br />Configuration") }], initComponent: function() { var me = this; Ext.applyIf(me, { listeners: { el: { dblclick: function() {me.fireEvent("WPAKD.controller.desktop.icons.Icons.iconDbClick", this, "WEB_CFG_SYSTEM");} , click: function() {me.fireEvent("WPAKD.controller.desktop.icons.Icons.iconClick", this, "WEB_CFG_SYSTEM");} } } }); me.callParent(arguments); } });
var fs = require('fs'), path = require('path'); var uaList = fs.readFileSync(path.join(__dirname, 'ua.txt')); uaList = uaList.toString().split('\n'); var OSs = {}; var browsers = {}; var browserVersions = {}; var unknown = []; var osMatch = { ios: /iOS|iPhone OS/i, android: /Android/i, linux: /Linux/i, win: /Windows/i, osx: /Mac|OS X/i, blackberry: /BlackBerry|BB10/i, series60: /Series 60|Series60/i, series40: /Series 40|Series40/i, j2me: /J2ME|MIDP/i }; var browserMatch = { opera: /opera/i, ie: /msie|trident\//i, chrome: /chrome/i, chromium: /chromium/i, safari: /safari|AppleWebKit/i, firefox: /firefox/i, blackberry: /BlackBerry/i }; var featureMatch = { ipad: /ipad/i, opera_mobile: /opera mini|opera mobi/i, opera_mini: /opera mini/i, blackberry: /blackberry/i }; uaList.forEach(function (uaName) { var os = 'unknown'; for (var curOs in osMatch) { if (uaName.match(osMatch[curOs])) { os = curOs; break; } } var browser = 'unknown'; for (var curBrowser in browserMatch) { if (uaName.match(browserMatch[curBrowser])) { browser = curBrowser; break; } } var version = ( uaName.match(/MSIE ([\d.]+)/) || uaName.match( /.+(?:me|ox|on|rv|it|era|opr|ie)[\/: ]([\d.]+)/) || [0,'0'] )[1]; if (!OSs[os]) { OSs[os] = 1; } else { OSs[os]++; } if (!browsers[os + ' ' + browser]) { browsers[os + ' ' + browser] = 1; } else { browsers[os + ' ' + browser]++; } if (os == 'unknown' || browser == 'unknown') { unknown.push(uaName); } if (!browserVersions[os + ' ' + browser + ' ' + version]) { browserVersions[os + ' ' + browser + ' ' + version] = 1; } else { browserVersions[os + ' ' + browser + ' ' + version]++; } }) console.log(OSs); console.log(browsers); console.log(browserVersions); // console.log(unknown);
/** * $Id: mxCompositeLayout.js,v 1.11 2010-01-02 09:45:15 gaudenz Exp $ * Copyright (c) 2006-2010, JGraph Ltd */ /** * Class: mxCompositeLayout * * Allows to compose multiple layouts into a single layout. The master layout * is the layout that handles move operations if another layout than the first * element in <layouts> should be used. The <master> layout is not executed as * the code assumes that it is part of <layouts>. * * Example: * (code) * var first = new mxFastOrganicLayout(graph); * var second = new mxParallelEdgeLayout(graph); * var layout = new mxCompositeLayout(graph, [first, second], first); * layout.execute(graph.getDefaultParent()); * (end) * * Constructor: mxCompositeLayout * * Constructs a new layout using the given layouts. The graph instance is * required for creating the transaction that contains all layouts. * * Arguments: * * graph - Reference to the enclosing <mxGraph>. * layouts - Array of <mxGraphLayouts>. * master - Optional layout that handles moves. If no layout is given then * the first layout of the above array is used to handle moves. */ function mxCompositeLayout(graph, layouts, master) { mxGraphLayout.call(this, graph); this.layouts = layouts; this.master = master; }; /** * Extends mxGraphLayout. */ mxCompositeLayout.prototype = new mxGraphLayout(); mxCompositeLayout.prototype.constructor = mxCompositeLayout; /** * Variable: layouts * * Holds the array of <mxGraphLayouts> that this layout contains. */ mxCompositeLayout.prototype.layouts = null; /** * Variable: layouts * * Reference to the <mxGraphLayouts> that handles moves. If this is null * then the first layout in <layouts> is used. */ mxCompositeLayout.prototype.master = null; /** * Function: moveCell * * Implements <mxGraphLayout.moveCell> by calling move on <master> or the first * layout in <layouts>. */ mxCompositeLayout.prototype.moveCell = function(cell, x, y) { if (this.master != null) { this.master.move.apply(this.master, arguments); } else { this.layouts[0].move.apply(this.layouts[0], arguments); } }; /** * Function: execute * * Implements <mxGraphLayout.execute> by executing all <layouts> in a * single transaction. */ mxCompositeLayout.prototype.execute = function(parent) { var model = this.graph.getModel(); model.beginUpdate(); try { for (var i = 0; i < this.layouts.length; i++) { this.layouts[i].execute.apply(this.layouts[i], arguments); } } finally { model.endUpdate(); } };
import Client from '../../../api'; import { AsyncActionStatus } from '../../../const/AsyncActionStatus'; import { getCurrency, getNobtName, getPersonNames } from './selectors'; export const UPDATE_CREATE_NOBT_STATUS = 'NewNobt.UPDATE_CREATE_NOBT_STATUS'; export const SELECT_CURRENCY = 'NewNobt.SELECT_CURRENCY'; export const CHANGE_NOBT_NAME = 'NewNobt.CHANGE_NOBT_NAME'; export const ADD_PERSON = 'NewNobt.ADD_PERSON'; export const REMOVE_PERSON = 'NewNobt.REMOVE_PERSON'; export const UPDATE_NAME_OF_PERSON_TO_ADD = 'NewNobt.UPDATE_NAME_OF_PERSON_TO_ADD'; function createNobtStarted() { return { type: UPDATE_CREATE_NOBT_STATUS, payload: { status: AsyncActionStatus.IN_PROGRESS, }, }; } function createNobtSucceeded(response) { return { type: UPDATE_CREATE_NOBT_STATUS, payload: { id: response.data.id, status: AsyncActionStatus.SUCCESSFUL, }, }; } function createNobtFailed(error) { return { type: UPDATE_CREATE_NOBT_STATUS, payload: { error, status: AsyncActionStatus.FAILED, }, }; } export function createNobt() { return (dispatch, getState) => { dispatch(createNobtStarted()); let nobtToCreate = { nobtName: getNobtName(getState()), currency: getCurrency(getState()), explicitParticipants: getPersonNames(getState()), }; Client.createNobt(nobtToCreate).then( response => { dispatch(createNobtSucceeded(response)); }, error => dispatch(createNobtFailed(error)) ); }; } export function selectCurrency(newCurrency) { return { type: SELECT_CURRENCY, payload: { newCurrency, }, }; } export function changeNobtName(newName) { return { type: CHANGE_NOBT_NAME, payload: { newName, }, }; } export function addCurrentNameAsPerson() { return { type: ADD_PERSON, }; } export function removePerson(name) { return { type: REMOVE_PERSON, payload: { name, }, }; } export function updateNameOfPersonToAdd(name) { return { type: UPDATE_NAME_OF_PERSON_TO_ADD, payload: { name, }, }; }
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*- ******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the Cobweb Project. * * Cobweb is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * Cobweb 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with Cobweb. If not, see <http://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ define ([ "jquery", "cobweb/Fields", "cobweb/Basic/X3DFieldDefinition", "cobweb/Basic/FieldDefinitionArray", "cobweb/Components/Rendering/X3DComposedGeometryNode", "cobweb/Bits/X3DConstants", ], function ($, Fields, X3DFieldDefinition, FieldDefinitionArray, X3DComposedGeometryNode, X3DConstants) { "use strict"; function IndexedTriangleStripSet (executionContext) { X3DComposedGeometryNode .call (this, executionContext); this .addType (X3DConstants .IndexedTriangleStripSet); this .triangleIndex = [ ]; } IndexedTriangleStripSet .prototype = $.extend (Object .create (X3DComposedGeometryNode .prototype), { constructor: IndexedTriangleStripSet, fieldDefinitions: new FieldDefinitionArray ([ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()), new X3DFieldDefinition (X3DConstants .initializeOnly, "solid", new Fields .SFBool (true)), new X3DFieldDefinition (X3DConstants .initializeOnly, "ccw", new Fields .SFBool (true)), new X3DFieldDefinition (X3DConstants .initializeOnly, "colorPerVertex", new Fields .SFBool (true)), new X3DFieldDefinition (X3DConstants .initializeOnly, "normalPerVertex", new Fields .SFBool (true)), new X3DFieldDefinition (X3DConstants .initializeOnly, "index", new Fields .MFInt32 ()), new X3DFieldDefinition (X3DConstants .inputOutput, "attrib", new Fields .MFNode ()), new X3DFieldDefinition (X3DConstants .inputOutput, "fogCoord", new Fields .SFNode ()), new X3DFieldDefinition (X3DConstants .inputOutput, "color", new Fields .SFNode ()), new X3DFieldDefinition (X3DConstants .inputOutput, "texCoord", new Fields .SFNode ()), new X3DFieldDefinition (X3DConstants .inputOutput, "normal", new Fields .SFNode ()), new X3DFieldDefinition (X3DConstants .inputOutput, "coord", new Fields .SFNode ()), ]), getTypeName: function () { return "IndexedTriangleStripSet"; }, getComponentName: function () { return "Rendering"; }, getContainerField: function () { return "geometry"; }, initialize: function () { X3DComposedGeometryNode .prototype .initialize .call (this); this .index_ .addInterest ("set_index__", this); this .set_index__ (); }, set_index__: function () { // Build coordIndex var index = this .index_ .getValue (), triangleIndex = this .triangleIndex; triangleIndex .length = 0; // Build coordIndex for (var i = 0, length = index .length; i < length; ++ i) { var first = index [i] .getValue (); if (first < 0) continue; if (++ i < length) { var second = index [i] .getValue (); if (second < 0) continue; ++ i; for (var face = 0; i < length; ++ i, ++ face) { var third = index [i] .getValue (); if (third < 0) break; triangleIndex .push (first, second, third); if (face & 1) second = third; else first = third; } } } }, getPolygonIndex: function (index) { return this .triangleIndex [index]; }, build: function () { X3DComposedGeometryNode .prototype .build .call (this, 3, this .triangleIndex .length, 3, this .triangleIndex .length); }, }); return IndexedTriangleStripSet; });
(function(){ function isValid($, eventName){ var valid = true; $.each(function(i, el){ valid = valid && el.dispatchEvent(new Event(eventName)); }); return valid; } function setHandler(els){ els.each(function(i, el){ if(!(el instanceof HTMLInputElement || el instanceof HTMLFormElement)) return; var $Input, $Form; function formHnd(e){ var valid = $Form[0].checkValidity() && $Form[0].querySelectorAll("input[w-equal-to]").length == $Form[0].querySelectorAll("input[w-equal-to][w-is-equal]").length; valid = isValid($Form, valid ? "validdata" : "invaliddata") && valid; if(!valid && e.type == "submit") e.preventDefault(); } function inputHnd(e){ if(e.type == "invalid") return e.target.dispatchEvent(new Event("invaliddata")); try { var curretPos = e.target.selectionStart; e.target.value = e.target.value; curretPos = curretPos > e.target.value.length ? e.target.value.length : curretPos; e.target.setSelectionRange(curretPos,curretPos); } catch(e) {} var isEqual = true; if(e.target.getAttribute("w-equal-to") != null) if(e.target.value == document.querySelector(e.target.getAttribute("w-equal-to")).value) e.target.getAttribute("w-is-equal") = ""; else { isEqual = false; e.target.removeAttribute("w-is-equal"); } e.target.dispatchEvent(new Event(e.target.checkValidity() && isEqual ? "validdata" : "invaliddata")); }; if(el instanceof HTMLFormElement){ $Form = $(el).on("submit keyup",formHnd); $Input = $(el).find("input, textarea").on("input invalid",inputHnd); } else if(el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement){ $Input = $(el).on("input invalid",inputHnd); $Form = $(el.form).on("submit keyup",formHnd); } }); }; $.fn.onvalid = function(handler){ setHandler(this); this.on("validdata",handler); return this; }; $.fn.oninvalid = function(handler){ setHandler(this); this.on("invaliddata",handler); return this; }; })(); function setThankCount() { $.post("/api", { action: "thanksCount"}, function(data) { $("[gt-count]").html(data.count); }); } $(function(){ localStorage.clear(); $("form input").oninvalid(function(e){ $(e.target).parent().addClass("invalid"); }).onvalid(function(e){ $(e.target).parent().removeClass("invalid"); }); $("form").submit(function(){ if ($(this).find(".invalid").length) return false; }); setThankCount(); setInterval(setThankCount, 5000); });
var DI = require('../'); function A(options) { this.name = 'A'; this.options = options; } function B(options) { if (! (this instanceof B)) { return new B(options); } this.name = 'B'; this.options = options; } var di = new DI(); function S(msg) { console.log(msg); } di.addConfig({ A: A, B: B, S: S }); di.addConfig({ "my": { "configData": { "key1": "val1", "static": { '@static': '&S' } }, "a": { "@class": "&A", "test": "test1", "data": "&my.configData" }, "b": { "@factory": "&B", "a": "&my.a", "c": { "d": ["1", 2] }, "f": { "@class": "&A", "test": "test3" }, "test": "test2" } } }); var c = di.getContainer(); var b = c.get('my.a'); console.log(b.options);