text
stringlengths
2
6.14k
'use strict'; Editor.polymerElement({ });
class A { static get #x() {} get #x() {} }
const fs = require('fs'); const fse = require('fs-extra'); const path = require('path'); module.exports = function (params) { const unpackFile = path.join( params.appOutDir, '*NAMECASENOSPACE*.app/Contents/Resources/app.asar.unpacked' ); fse.removeSync(unpackFile); };
var WINDOW = { ms_Width: 0, ms_Height: 0, ms_Callbacks: { 70: "WINDOW.toggleFullScreen()" // Toggle fullscreen }, initialize: function initialize() { this.updateSize(); // Create callbacks from keyboard $(document).keydown(function(inEvent) { WINDOW.callAction(inEvent.keyCode); }) ; $(window).resize(function(inEvent) { WINDOW.updateSize(); WINDOW.resizeCallback(WINDOW.ms_Width, WINDOW.ms_Height); }); }, updateSize: function updateSize() { this.ms_Width = $(window).width(); this.ms_Height = $(window).height() - 4; }, callAction: function callAction(inId) { if(inId in this.ms_Callbacks) { eval(this.ms_Callbacks[inId]); return false ; } }, toggleFullScreen: function toggleFullScreen() { if(!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) { if(document.documentElement.requestFullscreen) document.documentElement.requestFullscreen(); else if(document.documentElement.mozRequestFullScreen) document.documentElement.mozRequestFullScreen(); else if(document.documentElement.webkitRequestFullscreen) document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } else { if(document.cancelFullScreen) document.cancelFullScreen(); else if(document.mozCancelFullScreen) document.mozCancelFullScreen(); else if (document.webkitCancelFullScreen) document.webkitCancelFullScreen(); } }, resizeCallback: function resizeCallback(inWidth, inHeight) {} };
// Converted from: ../../examples/obj/torus/Torus.obj // vertices: 576 // faces: 576 // materials: 1 // // Generated with OBJ -> Three.js converter // http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py var model = { "version" : 1, "materials": [ { "DbgColor" : 15658734, "DbgIndex" : 0, "DbgName" : "(null)" }], "buffers": "Torus_bin.bin" }; postMessage( model ); close();
/*! * Module dependencies. */ 'use strict'; const MongooseError = require('./'); /** * Schema validator error * * @param {Object} properties * @inherits MongooseError * @api private */ function ValidatorError(properties) { let msg = properties.message; if (!msg) { msg = MongooseError.messages.general.default; } const message = this.formatMessage(msg, properties); MongooseError.call(this, message); properties = Object.assign({}, properties, { message: message }); this.name = 'ValidatorError'; if (Error.captureStackTrace) { Error.captureStackTrace(this); } else { this.stack = new Error().stack; } this.properties = properties; this.kind = properties.type; this.path = properties.path; this.value = properties.value; this.reason = properties.reason; } /*! * Inherits from MongooseError */ ValidatorError.prototype = Object.create(MongooseError.prototype); ValidatorError.prototype.constructor = MongooseError; /*! * The object used to define this validator. Not enumerable to hide * it from `require('util').inspect()` output re: gh-3925 */ Object.defineProperty(ValidatorError.prototype, 'properties', { enumerable: false, writable: true, value: null }); /*! * Formats error messages */ ValidatorError.prototype.formatMessage = function(msg, properties) { if (typeof msg === 'function') { return msg(properties); } const propertyNames = Object.keys(properties); for (let i = 0; i < propertyNames.length; ++i) { const propertyName = propertyNames[i]; if (propertyName === 'message') { continue; } msg = msg.replace('{' + propertyName.toUpperCase() + '}', properties[propertyName]); } return msg; }; /*! * toString helper */ ValidatorError.prototype.toString = function() { return this.message; }; /*! * exports */ module.exports = ValidatorError;
/* @Name: Horizontal multilevel menu @Author: Muffin Group @WWW: www.muffingroup.com @Version: 1.5.2 */ (function($){ $.fn.extend({ muffingroup_menu: function(options) { var menu = $(this); var defaults = { delay : 100, hoverClass : 'hover', arrows : true, animation : 'fade', addLast : true }; options = $.extend(defaults, options); // add class if menu item has sumbenu menu.find("li:has(ul)") .addClass("submenu") .append("<span class='menu-toggle'>") // responsive menu toggle .append("<span class='menu-arr-bottom'></span><span class='menu-arr-top'></span>") // border arrows ; // add class if submanu item has another sumbenu if( options.arrows ) { menu.find( "li ul li:has(ul) > a" ).append( "<span class='menu-arrow'><i class='icon-chevron-right'></i></span>" ); } // add bullets in each top-level menu item menu.children( "li:not(:last)" ).append( "<em>&#8226;</em>" ); // hover menu.find("li").hover(function() { $(this).addClass(options.hoverClass); if (options.animation === "fade") { $(this).children("ul").fadeIn(options.delay); } else if (options.animation === "toggle") { $(this).children("ul").stop(true,true).slideDown(options.delay); } }, function(){ $(this).removeClass(options.hoverClass); if (options.animation === "fade") { $(this).children("ul").fadeOut(options.delay); } else if (options.animation === "toggle") { $(this).children("ul").stop(true,true).slideUp(options.delay); } }); // add class .last-item to last sumbenu item $(".submenu ul li:last-child", menu).addClass("last-item"); // addLast if(options.addLast) { $("> li:last-child", menu) .addClass("last") .prev() .addClass("last"); } } }); })(jQuery);
import Moment from 'moment'; import { functions, has, includes } from 'lodash'; export default function(dateString, context) { const date = Moment(dateString); if (has(context.hash, 'type') && includes(functions(date), context.hash.type)) { return date[context.hash.type](); } return date.calendar(); }
define([ // '../../../../src/utils/event', // '../../../../src/utils/objectCreate' ], function( // Event, // objectCreate ){ var objectCreate = hello.utils.objectCreate; var utils = hello.utils; // // Events // describe('utils / event', function(){ var hello, arbitary_data, event_name; beforeEach(function(){ // Pass an arbitary piece of data around arbitary_data = {boom:true}; event_name = 'custom'; hello = { utils : utils }; utils.Event.call(hello); }); it('should bind events by name and be able to trigger them by name', function(){ // Make request var spy = sinon.spy(function( data, type ){ expect( event_name ).to.be( type ); expect( arbitary_data ).to.be( data ); }); hello.on( event_name, spy ); hello.emit( event_name, arbitary_data ); expect( spy.called ).to.be.ok(); }); it('should listen to any event by using a "*"', function(){ // Make request var spy = sinon.spy(function( data, type ){ expect( event_name ).to.be( type ); expect( arbitary_data ).to.be( data ); }); hello.on( '*', spy ); hello.emit( event_name, arbitary_data ); expect( spy.called ).to.be.ok(); }); it('should unbind an event by name and callback', function(){ // Listeners var spy = sinon.spy(function(){ // should not be called. }); var spy2 = sinon.spy(function(){ // should not be called. }); // Bind hello.on( event_name, spy ); hello.on( event_name, spy2 ); // Remove hello.off( event_name, spy ); // Trigger hello.emit( event_name ); // Test spies expect( !spy.called ).to.be.ok(); expect( spy2.called ).to.be.ok(); }); it('should unbind all events by name', function(){ // Listeners var spy = sinon.spy(function(){ // should not be called. }); var spy2 = sinon.spy(function(){ // should not be called. }); // Bind hello.on( event_name, spy ); hello.on( event_name, spy2 ); // Remove hello.off( event_name ); // Trigger hello.emit( event_name ); // Test spies expect( !spy.called ).to.be.ok(); expect( !spy2.called ).to.be.ok(); }); it('should trigger events on its proto (predecessor in chain)', function(){ // PROTO // Listeners var spy = sinon.spy(function(){ // should not be called. }); // Bind hello.on( event_name, spy ); // PROTO var child = objectCreate(hello); var spy2 = sinon.spy(function(){ // should not be called. }); hello.on( event_name, spy2 ); // Trigger hello.emit( event_name ); // Test spies expect( spy.called ).to.be.ok(); expect( spy2.called ).to.be.ok(); }); }); });
import collapsibleFactory from '../common/collapsible'; import collapsibleGroupFactory from '../common/collapsible-group'; const PLUGIN_KEY = 'menu'; /* * Manage the behaviour of a menu * @param {jQuery} $menu */ class Menu { constructor($menu) { this.$menu = $menu; this.$body = $('body'); this.hasMaxMenuDisplayDepth = this.$body.find('.navPages-list').hasClass('navPages-list-depth-max'); // Init collapsible this.collapsibles = collapsibleFactory('[data-collapsible]', { $context: this.$menu }); this.collapsibleGroups = collapsibleGroupFactory($menu); // Auto-bind this.onMenuClick = this.onMenuClick.bind(this); this.onDocumentClick = this.onDocumentClick.bind(this); // Listen this.bindEvents(); } collapseAll() { this.collapsibles.forEach(collapsible => collapsible.close()); this.collapsibleGroups.forEach(group => group.close()); } collapseNeighbors($neighbors) { const $collapsibles = collapsibleFactory('[data-collapsible]', { $context: $neighbors }); $collapsibles.forEach($collapsible => $collapsible.close()); } bindEvents() { this.$menu.on('click', this.onMenuClick); this.$body.on('click', this.onDocumentClick); } unbindEvents() { this.$menu.off('click', this.onMenuClick); this.$body.off('click', this.onDocumentClick); } onMenuClick(event) { event.stopPropagation(); if (this.hasMaxMenuDisplayDepth) { const $neighbors = $(event.target).parent().siblings(); this.collapseNeighbors($neighbors); } } onDocumentClick() { this.collapseAll(); } } /* * Create a new Menu instance * @param {string} [selector] * @return {Menu} */ export default function menuFactory(selector = `[data-${PLUGIN_KEY}]`) { const $menu = $(selector).eq(0); const instanceKey = `${PLUGIN_KEY}Instance`; const cachedMenu = $menu.data(instanceKey); if (cachedMenu instanceof Menu) { return cachedMenu; } const menu = new Menu($menu); $menu.data(instanceKey, menu); return menu; }
'use strict'; var users = require('../../app/controllers/users'), speakers = require('../../app/controllers/speakers'); module.exports = function(app) { // Speakers Routes app.route('/speakers') .get(speakers.list) .post(users.requiresLogin, speakers.create); app.route('/speakers/:speakerId') .get(speakers.read) .put(users.requiresLogin, speakers.hasAuthorization, speakers.update) .delete(users.requiresLogin, speakers.hasAuthorization, speakers.delete); // Finish by binding the Speaker middleware app.param('speakerId', speakers.speakerByID); };
import * as React from 'react'; import ApiPage from 'docs/src/modules/components/ApiPage'; import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; import jsonPageContent from './avatar.json'; export default function Page(props) { const { descriptions, pageContent } = props; return <ApiPage descriptions={descriptions} pageContent={pageContent} />; } Page.getInitialProps = () => { const req = require.context('docs/translations/api-docs/avatar', false, /avatar.*.json$/); const descriptions = mapApiPageTranslations(req); return { descriptions, pageContent: jsonPageContent, }; };
var webpack = require('webpack'); var path = require('path'); module.exports = { entry: './src/main.ts', output: { filename: './bundle.js' }, resolve: { root: [ path.join(__dirname, 'src') ], extensions: ['', '.ts', '.js'] }, module: { loaders: [ { test: /\.ts$/, loader: 'ts-loader' } ] } };
(function($) { $.Redactor.prototype.source = function() { return { init: function() { var button = this.button.addFirst('html', 'HTML'); this.button.setIcon(button, '<i class="re-icon-html"></i>'); this.button.addCallback(button, this.source.toggle); var style = { 'width': '100%', 'margin': '0', 'background': '#1d1d1d', 'box-sizing': 'border-box', 'color': '#ccc', 'font-size': '15px', 'outline': 'none', 'padding': '20px', 'line-height': '24px', 'font-family': 'Consolas, Menlo, Monaco, "Courier New", monospace' }; this.source.$textarea = $('<textarea />'); this.source.$textarea.css(style).hide(); if (this.opts.type === 'textarea') { this.core.box().append(this.source.$textarea); } else { this.core.box().after(this.source.$textarea); } this.core.element().on('destroy.callback.redactor', $.proxy(function() { this.source.$textarea.remove(); }, this)); }, toggle: function() { return (this.source.$textarea.hasClass('open')) ? this.source.hide() : this.source.show(); }, setCaretOnShow: function() { this.source.offset = this.offset.get(); var scroll = $(window).scrollTop(); var width = this.core.editor().innerWidth(); var height = this.core.editor().innerHeight(); // caret position sync this.source.start = 0; this.source.end = 0; var $editorDiv = $("<div/>").append($.parseHTML(this.core.editor().html(), document, true)); var $selectionMarkers = $editorDiv.find("span.redactor-selection-marker"); if ($selectionMarkers.length > 0) { var editorHtml = $editorDiv.html().replace(/&amp;/g, '&'); if ($selectionMarkers.length === 1) { this.source.start = this.utils.strpos(editorHtml, $editorDiv.find("#selection-marker-1").prop("outerHTML")); this.source.end = this.source.start; } else if ($selectionMarkers.length === 2) { this.source.start = this.utils.strpos(editorHtml, $editorDiv.find("#selection-marker-1").prop("outerHTML")); this.source.end = this.utils.strpos(editorHtml, $editorDiv.find("#selection-marker-2").prop("outerHTML")) - $editorDiv.find("#selection-marker-1").prop("outerHTML").toString().length; } } }, setCaretOnHide: function(html) { this.source.start = this.source.$textarea.get(0).selectionStart; this.source.end = this.source.$textarea.get(0).selectionEnd; // if selection starts from end if (this.source.start > this.source.end && this.source.end > 0) { var tempStart = this.source.end; var tempEnd = this.source.start; this.source.start = tempStart; this.source.end = tempEnd; } this.source.start = this.source.enlargeOffset(html, this.source.start); this.source.end = this.source.enlargeOffset(html, this.source.end); html = html.substr(0, this.source.start) + this.marker.html(1) + html.substr(this.source.start); if (this.source.end > this.source.start) { var markerLength = this.marker.html(1).toString().length; html = html.substr(0, this.source.end + markerLength) + this.marker.html(2) + html.substr(this.source.end + markerLength); } return html; }, hide: function() { this.source.$textarea.removeClass('open').hide(); this.source.$textarea.off('.redactor-source'); var code = this.source.$textarea.val(); code = this.paragraphize.load(code); code = this.source.setCaretOnHide(code); this.code.start(code); this.button.enableAll(); this.core.editor().show().focus(); this.selection.restore(); this.placeholder.enable(); this.core.callback('visual'); }, show: function() { this.selection.save(); this.source.setCaretOnShow(); var height = this.core.editor().height(); var code = this.code.get(); // callback code = this.core.callback('source', code); this.core.editor().hide(); this.button.disableAll('html'); this.source.$textarea.val(code).height(height).addClass('open').show(); this.source.$textarea.on('keyup.redactor-source', $.proxy(function() { if (this.opts.type === 'textarea') { this.core.textarea().val(this.source.$textarea.val()); } }, this)); this.marker.remove(); $(window).scrollTop(scroll); if (this.source.$textarea[0].setSelectionRange) { this.source.$textarea[0].setSelectionRange(this.source.start, this.source.end); } this.source.$textarea[0].scrollTop = 0; setTimeout($.proxy(function() { this.source.$textarea.focus(); }, this), 0); }, enlargeOffset: function(html, offset) { var htmlLength = html.length; var c = 0; if (html[offset] === '>') { c++; } else { for(var i = offset; i <= htmlLength; i++) { c++; if (html[i] === '>') { break; } else if (html[i] === '<' || i === htmlLength) { c = 0; break; } } } return offset + c; } }; }; })(jQuery);
(function () { 'use strict'; angular .module('crowdsource.config', ['angular-loading-bar']) .config(config); config.$inject = ['$httpProvider', '$locationProvider', '$mdThemingProvider', 'cfpLoadingBarProvider']; /** * @name config * @desc Enable HTML5 routing */ function config($httpProvider, $locationProvider, $mdThemingProvider, cfpLoadingBarProvider) { $httpProvider.interceptors.push('AuthHttpResponseInterceptor'); $locationProvider.html5Mode(true); $locationProvider.hashPrefix('!'); cfpLoadingBarProvider.includeSpinner = false; // Extend palettes var customBlue = $mdThemingProvider.extendPalette('indigo', { "50":"#e8e9f2","100":"#babdd8","200":"#8d91bf", "300":"#666ca9","400":"#404893","500":"#1a237e", "600":"#171f6e","700":"#141a5f","800":"#10164f", "900":"#0d123f","A100":"#babdd8","A200":"#8d91bf", "A400":"#404893","A700":"#141a5f" }); var customYellow = $mdThemingProvider.extendPalette('yellow', { "50": "#fffef3", "100": "#fffbdb", "200": "#fff9c4", "300": "#fff6b0", "400": "#fff49c", "500": "#fff288", "600": "#dfd477", "700": "#bfb666", "800": "#9f9755", "900": "#807944", "A100": "#fffbdb", "A200": "#fff9c4", "A400": "#fff49c", "A700": "#bfb666" }); var customGrey = $mdThemingProvider.extendPalette('grey', { "50":"#ffffff","100":"#ffffff","200":"#ffffff", "300":"#ffffff","400":"#ffffff","500":"#ffffff", "600":"#dfdfdf","700":"#bfbfbf","800":"#9f9f9f", "900":"#808080","A100":"#ffffff","A200":"#ffffff", "A400":"#ffffff","A700":"#bfbfbf" }); // Register the new color palette map with the name <code>neonRed</code> $mdThemingProvider.definePalette('customBlue', customBlue); $mdThemingProvider.definePalette('customYellow', customYellow); $mdThemingProvider.definePalette('customGrey', customGrey); $mdThemingProvider.theme('default') .primaryPalette('customBlue') .accentPalette('customYellow') .warnPalette('red') .backgroundPalette('customGrey'); $mdThemingProvider.theme('alternate') .primaryPalette('indigo') .accentPalette('orange') .warnPalette('red') .backgroundPalette('grey'); $mdThemingProvider.setDefaultTheme('default'); // $mdThemingProvider.alwaysWatchTheme(true); //testing /*OAuthProvider.configure({ baseUrl: 'http://localhost:8000', clientId: 'client_id', clientSecret: 'client_secret', grantPath : '/api/oauth2-ng/token' }); OAuthTokenProvider.configure({ name: 'token', options: { secure: false //TODO this has to be changed to True } });*/ } })();
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > If the eval function is called with some argument, then use a first argument es5id: 15.1.2.1_A1.2_T1 description: eval("x = 1", "x = 2"), x equal 1, not 2 ---*/ //CHECK#1 var x; eval("x = 1", "x = 2"); if (x !== 1) { $ERROR('#1: eval("x = 1", "x = 2"); x === 1. Actual: ' + (x)); }
module.exports = [ require('./ngdoc'), require('./name'), require('./area'), require('./module'), require('./id'), require('./restrict'), require('./eventType'), require('./example'), require('./element'), require('./fullName'), require('./priority'), require('./title'), require('./parent'), require('./packageName'), require('./scope') ];
Astro.createValidator({ name: 'array', validate: _.isArray, events: { validationerror: function(e) { var fieldName = e.data.field; e.data.message = 'The "' + fieldName + '" field\'s value has to be an array'; } } });
/* * ##### Sasson - advanced drupal theming. ##### * * SITENAME scripts. * */ (function($) { // DUPLICATE AND UNCOMMENT // Drupal.behaviors.behaviorName = { // attach: function(context) { // // Do some magic... // } // }; })(jQuery);
/* * jQuery The Final Countdown plugin v1.0.0 beta * http://github.com/hilios/jquery.countdown * * Copyright (c) 2011 Edson Hilios * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function($) { $.fn.countdown = function(toDate, callback) { var handlers = ['seconds', 'minutes', 'hours', 'days', 'weeks', 'daysLeft']; function delegate(scope, method) { return function() { return method.call(scope) } } return this.each(function() { // Convert var $this = $(this), values = {}, lasting = {}, interval = $this.data('countdownInterval'), secondsLeft = Math.floor((toDate - upcoming_data.c_time) ); function triggerEvents() { secondsLeft--; if(secondsLeft < 0) { secondsLeft = 0; } lasting = { seconds : secondsLeft % 60, minutes : Math.floor(secondsLeft / 60) % 60, hours : Math.floor(secondsLeft / 60 / 60) % 24, days : Math.floor(secondsLeft / 60 / 60 / 24), weeks : Math.floor(secondsLeft / 60 / 60 / 24 / 7), daysLeft: Math.floor(secondsLeft / 60 / 60 / 24) % 7 } for(var i=0; i<handlers.length; i++) { var eventName = handlers[i]; if(values[eventName] != lasting[eventName]) { values[eventName] = lasting[eventName]; dispatchEvent(eventName); } } if(secondsLeft == 0) { stop(); dispatchEvent('finished'); } } triggerEvents(); function dispatchEvent(eventName) { var event = $.Event(eventName); event.date = new Date(new Date().valueOf() + secondsLeft); event.value = values[eventName] || "0"; event.toDate = toDate; event.lasting = lasting; switch(eventName) { case "seconds": case "minutes": case "hours": event.value = event.value < 10 ? '0'+event.value.toString() : event.value.toString(); break; default: if(event.value) { event.value = event.value.toString(); } break; } callback.call($this, event); } $this.bind('remove', function() { stop(); // If the selector is removed clear the interval for memory sake! dispatchEvent('removed'); }); function stop() { clearInterval(interval); } function start() { $this.data('countdownInterval', setInterval(delegate($this, triggerEvents), 1000)); interval = $this.data('countdownInterval'); } if(interval) stop(); start(); }); } // Wrap the remove method to trigger an event when called var removeEvent = new $.Event('remove'), removeFunction = $.fn.remove; $.fn.remove = function() { $(this).trigger(removeEvent); return removeFunction.apply(this, arguments); } })(jQuery);
var findPosts; (function($){ findPosts = { open : function(af_name, af_val) { var st = document.documentElement.scrollTop || $(document).scrollTop(); if ( af_name && af_val ) { $('#affected').attr('name', af_name).val(af_val); } $('#find-posts').show().draggable({ handle: '#find-posts-head' }).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-250px'}); $('#find-posts-input').focus().keyup(function(e){ if (e.which == 27) { findPosts.close(); } // close on Escape }); return false; }, close : function() { $('#find-posts-response').html(''); $('#find-posts').draggable('destroy').hide(); }, send : function() { var post = { ps: $('#find-posts-input').val(), action: 'find_posts', _ajax_nonce: $('#_ajax_nonce').val(), post_type: $('input[name="find-posts-what"]:checked').val() }; $.ajax({ type : 'POST', url : ajaxurl, data : post, success : function(x) { findPosts.show(x); }, error : function(r) { findPosts.error(r); } }); }, show : function(x) { if ( typeof(x) == 'string' ) { this.error({'responseText': x}); return; } var r = wpAjax.parseAjaxResponse(x); if ( r.errors ) { this.error({'responseText': wpAjax.broken}); } r = r.responses[0]; $('#find-posts-response').html(r.data); }, error : function(r) { var er = r.statusText; if ( r.responseText ) { er = r.responseText.replace( /<.[^<>]*?>/g, '' ); } if ( er ) { $('#find-posts-response').html(er); } } }; $(document).ready(function() { $('#find-posts-submit').click(function(e) { if ( '' == $('#find-posts-response').html() ) e.preventDefault(); }); $( '#find-posts .find-box-search :input' ).keypress( function( event ) { if ( 13 == event.which ) { findPosts.send(); return false; } } ); $( '#find-posts-search' ).click( findPosts.send ); $( '#find-posts-close' ).click( findPosts.close ); $('#doaction, #doaction2').click(function(e){ $('select[name^="action"]').each(function(){ if ( $(this).val() == 'attach' ) { e.preventDefault(); findPosts.open(); } }); }); }); })(jQuery);
/***** Ajax login script ******/ var $ = jQuery; $(document).ready(function(){ $('#king-form>.btn-login').click(function(){ $('#king-form p.status').show().text(ajax_user_object.loadingmessage); $.ajax({ url: ajax_user_object.ajaxurl, data: $('#king-form').serialize(), type: 'POST', dataType: 'json', success: function(response){ $('#king-form p.status').show().text(response.message); if (response.loggedin == true){ document.location.href = ajax_user_object.redirecturl; } } }); }); $('#king-form>.btn-resetpwd').click(function(){ $('#king-form p.status').show().text(ajax_user_object.loadingmessage); $.ajax({ url: ajax_user_object.ajaxurl, data: $('#king-form').serialize(), type: 'POST', dataType: 'json', success: function(response){ $('#king-form p.status').show().text(response.message); if(response.status){ $('input[name="email"]').val(''); } } }); }); $('#king_form>.btn-register').click(function(){ $('#king_form p.status').show().text(ajax_user_object.loadingmessage); $.ajax({ url: ajax_user_object.ajaxurl, data: $('#king_form').serialize(), type: 'POST', dataType: 'json', success: function(response){ $('#king_form p.status').show().text(response.message); if (response.loggedin == true){ document.location.href = ajax_user_object.redirecturl; } } }); }); });
/** @constructor */ function RecordSet(f) { /** @function */ this.write = f; } /* [ { symbols: [ { doc: { tags: [] }, returns: [], type: "", properties: [], isa: "CONSTRUCTOR", desc: "", alias: "RecordSet", memberof: "", params: [ { title: "param", desc: "", type: "", name: "f", isOptional: false } ], methods: [ { name: "write", alias: "RecordSet.write" } ], name: "RecordSet" }, { doc: { tags: [] }, returns: [], type: "", properties: [], isa: "FUNCTION", desc: "", alias: "RecordSet.write", memberof: "RecordSet", params: [], methods: [], name: "write" } ], overview: { doc: { tags: [] }, returns: [], type: "", properties: [], isa: "FILE", desc: "No overview provided.", alias: "examples/data/properties_methods1.js", memberof: "", params: [], methods: [], name: "examples/data/properties_methods1.js" } } ] */
var namespace_a_e_mmailer = [ [ "AEMMailer", "d5/d12/class_a_e_mmailer_1_1_a_e_m_mailer.html", "d5/d12/class_a_e_mmailer_1_1_a_e_m_mailer" ], [ "Error", "dc/d02/class_a_e_mmailer_1_1_error.html", null ], [ "MissingEmailAccountsException", "d9/d2a/class_a_e_mmailer_1_1_missing_email_accounts_exception.html", null ], [ "NoPasswordException", "d1/d47/class_a_e_mmailer_1_1_no_password_exception.html", null ] ];
var EA_keys = {8:"Retour arriere",9:"Tabulation",12:"Milieu (pave numerique)",13:"Entrer",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Verr Maj",27:"Esc",32:"Espace",33:"Page up",34:"Page down",35:"End",36:"Begin",37:"Fleche gauche",38:"Fleche haut",39:"Fleche droite",40:"Fleche bas",44:"Impr ecran",45:"Inser",46:"Suppr",91:"Menu Demarrer Windows / touche pomme Mac",92:"Menu Demarrer Windows",93:"Menu contextuel Windows",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Verr Num",145:"Arret defil"}; function keyDown(e){ if(!e){ // if IE e=event; } // send the event to the plugins for(var i in editArea.plugins){ if(typeof(editArea.plugins[i].onkeydown)=="function"){ if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging if(editArea.nav['isIE']) e.keyCode=0; return false; } } } var target_id=(e.target || e.srcElement).id; var use=false; if (EA_keys[e.keyCode]) letter=EA_keys[e.keyCode]; else letter=String.fromCharCode(e.keyCode); var low_letter= letter.toLowerCase(); if(letter=="Page up" && !editArea.nav['isOpera']){ editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)}); use=true; }else if(letter=="Page down" && !editArea.nav['isOpera']){ editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)}); use=true; }else if(editArea.is_editable==false){ // do nothing but also do nothing else (allow to navigate with page up and page down) return true; }else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){ if(ShiftPressed(e)) editArea.execCommand("invert_tab_selection"); else editArea.execCommand("tab_selection"); use=true; if(editArea.nav['isOpera'] || (editArea.nav['isFirefox'] && editArea.nav['isMacOS']) ) // opera && firefox mac can't cancel tabulation events... setTimeout("editArea.execCommand('focus');", 1); }else if(letter=="Entrer" && target_id=="textarea"){ if(editArea.press_enter()) use=true; }else if(letter=="Entrer" && target_id=="area_search"){ editArea.execCommand("area_search"); use=true; }else if(letter=="Esc"){ editArea.execCommand("close_all_inline_popup", e); use=true; }else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){ switch(low_letter){ case "f": editArea.execCommand("area_search"); use=true; break; case "r": editArea.execCommand("area_replace"); use=true; break; case "q": editArea.execCommand("close_all_inline_popup", e); use=true; break; case "h": editArea.execCommand("change_highlight"); use=true; break; case "g": setTimeout("editArea.execCommand('go_to_line');", 5); // the prompt stop the return false otherwise use=true; break; case "e": editArea.execCommand("show_help"); use=true; break; case "z": use=true; editArea.execCommand("undo"); break; case "y": use=true; editArea.execCommand("redo"); break; default: break; } } // check to disable the redo possibility if the textarea content change if(editArea.next.length > 0){ setTimeout("editArea.check_redo();", 10); } setTimeout("editArea.check_file_changes();", 10); if(use){ // in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action if(editArea.nav['isIE']) e.keyCode=0; return false; } //alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e)); return true; }; // return true if Alt key is pressed function AltPressed(e) { if (window.event) { return (window.event.altKey); } else { if(e.modifiers) return (e.altKey || (e.modifiers % 2)); else return e.altKey; } }; // return true if Ctrl key is pressed function CtrlPressed(e) { if (window.event) { return (window.event.ctrlKey); } else { return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5)); } }; // return true if Shift key is pressed function ShiftPressed(e) { if (window.event) { return (window.event.shiftKey); } else { return (e.shiftKey || (e.modifiers>3)); } };
'use strict'; var async = require('async'); var validator = require('validator'); var _ = require('underscore'); var db = require('../database'); var topics = require('../topics'); var user = require('../user'); var privileges = require('../privileges'); var plugins = require('../plugins'); var cache = require('./cache'); var pubsub = require('../pubsub'); var utils = require('../../public/src/utils'); module.exports = function (Posts) { pubsub.on('post:edit', function (pid) { cache.del(pid); }); Posts.edit = function (data, callback) { var postData; var results; async.waterfall([ function (next) { privileges.posts.canEdit(data.pid, data.uid, next); }, function (canEdit, next) { if (!canEdit.flag) { return next(new Error(canEdit.message)); } Posts.getPostData(data.pid, next); }, function (_postData, next) { if (!_postData) { return next(new Error('[[error:no-post]]')); } postData = _postData; postData.content = data.content; postData.edited = Date.now(); postData.editor = data.uid; if (data.handle) { postData.handle = data.handle; } plugins.fireHook('filter:post.edit', {req: data.req, post: postData, data: data, uid: data.uid}, next); }, function (result, next) { postData = result.post; Posts.setPostFields(data.pid, postData, next); }, function (next) { async.parallel({ editor: function (next) { user.getUserFields(data.uid, ['username', 'userslug'], next); }, topic: function (next) { editMainPost(data, postData, next); } }, next); }, function (_results, next) { results = _results; postData.cid = results.topic.cid; postData.topic = results.topic; plugins.fireHook('action:post.edit', _.clone(postData)); cache.del(String(postData.pid)); pubsub.publish('post:edit', String(postData.pid)); Posts.parsePost(postData, next); }, function (postData, next) { results.post = postData; next(null, results); } ], callback); }; function editMainPost(data, postData, callback) { var tid = postData.tid; var title = data.title ? data.title.trim() : ''; async.parallel({ topic: function (next) { topics.getTopicFields(tid, ['cid', 'title'], next); }, isMain: function (next) { Posts.isMain(data.pid, next); } }, function (err, results) { if (err) { return callback(err); } if (!results.isMain) { return callback(null, { tid: tid, cid: results.topic.cid, isMainPost: false, renamed: false }); } var topicData = { tid: tid, cid: results.topic.cid, uid: postData.uid, mainPid: data.pid }; if (title) { topicData.title = title; topicData.slug = tid + '/' + (utils.slugify(title) || 'topic'); } topicData.thumb = data.thumb || ''; data.tags = data.tags || []; async.waterfall([ function (next) { plugins.fireHook('filter:topic.edit', {req: data.req, topic: topicData, data: data}, next); }, function (results, next) { db.setObject('topic:' + tid, results.topic, next); }, function (next) { topics.updateTags(tid, data.tags, next); }, function (next) { topics.getTopicTagsObjects(tid, next); }, function (tags, next) { topicData.tags = data.tags; topicData.oldTitle = results.topic.title; plugins.fireHook('action:topic.edit', topicData); next(null, { tid: tid, cid: results.topic.cid, uid: postData.uid, title: validator.escape(String(title)), oldTitle: results.topic.title, slug: topicData.slug, isMainPost: true, renamed: title !== results.topic.title, tags: tags }); } ], callback); }); } };
/* * Copyright (c) 2011-2013 Lp digital system * * This file is part of BackBee. * * BackBee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * BackBee 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 BackBee. If not, see <http://www.gnu.org/licenses/>. */ require.config({ paths: { 'app.content': 'src/tb/apps/content', //Controllers 'content.main.controller': 'src/tb/apps/content/controllers/main.controller', //Routing 'content.routes': 'src/tb/apps/content/routes', //Repositories 'content.repository': 'src/tb/apps/content/repository/content.repository', 'revision.repository': 'src/tb/apps/content/repository/revision.repository', 'resource.repository': 'src/tb/apps/content/repository/resource.repository', 'keyword.repository': 'src/tb/apps/content/repository/keyword.repository', 'crop.repository': 'src/tb/apps/content/repository/crop.repository', //DataStore 'media.datastore': 'src/tb/component/medialibrary/datastore/media.datastore', //Components 'content.manager': 'src/tb/apps/content/components/ContentManager', 'content.dnd.manager': 'src/tb/apps/content/components/DndManager', 'content.mouseevent.manager': 'src/tb/apps/content/components/MouseEventManager', 'content.save.manager': 'src/tb/apps/content/components/SaveManager', 'content.container': 'src/tb/apps/content/components/ContentContainer', 'definition.manager': 'src/tb/apps/content/components/DefinitionManager', 'content.breadcrumb': 'src/tb/apps/content/components/Breadcrumb', 'content.pluginmanager': 'src/tb/apps/content/components/PluginManager', //Widgets 'content.widget.DialogContentsList': 'src/tb/apps/content/widgets/DialogContentsList', 'content.widget.Breadcrumb': 'src/tb/apps/content/widgets/Breadcrumb', 'content.widget.Edition': 'src/tb/apps/content/widgets/Edition', 'content.widget.DialogAddToMediaLibrary': 'src/tb/apps/content/widgets/DialogAddToMediaLibrary', //Models 'content.models.AbstractContent': 'src/tb/apps/content/models/AbstractContent', 'content.models.Content': 'src/tb/apps/content/models/Content', 'content.models.ContentSet': 'src/tb/apps/content/models/ContentSet', 'content.models.ContentRevision': 'src/tb/apps/content/models/ContentRevision', //Templates 'content/tpl/button': 'src/tb/apps/content/templates/button.twig', 'content/tpl/content_breadcrumb': 'src/tb/apps/content/templates/content-breadcrumb.twig', 'content/tpl/contribution/index': 'src/tb/apps/content/templates/contribution.index.twig', 'content/tpl/edit/contribution/index': 'src/tb/apps/content/templates/edit-contribution.index.twig', 'content/tpl/carousel_blocks': 'src/tb/apps/content/templates/carousel-blocks.twig', 'content/tpl/block_display': 'src/tb/apps/content/templates/block-display.twig', 'content/tpl/dropzone': 'src/tb/apps/content/templates/dropzone.twig', 'content/tpl/content-action': 'src/tb/apps/content/templates/content-action.twig', 'content/tpl/breadcrumb': 'src/tb/apps/content/templates/breadcrumb.twig', 'content/tpl/scrollzone': 'src/tb/apps/content/templates/scrollzone.twig', 'content/tpl/block_description': 'src/tb/apps/content/templates/block-description.twig', 'content/tpl/block_informations': 'src/tb/apps/content/templates/block-informations.twig', 'content/tpl/rollback_items': 'src/tb/apps/content/plugins/rollback/templates/items.twig', //Views 'content.view.contribution.index': 'src/tb/apps/content/views/content.view.contribution.index', 'content.view.edit.contribution.index': 'src/tb/apps/content/views/content.view.edit_contribution.index' } }); define("app.content", ['Core', 'content.pluginmanager'], function (Core) { 'use strict'; Core.ApplicationManager.registerApplication('content', { onInit: function () { Core.ApplicationManager.launchApplication('contribution'); } }); });
// Copyright (C) 2015 Leslie Zhai <xiang.zhai@i-soft.com.cn> .pragma library var v2 = false; var isAway = false; var isRobot = false; var uin = ""; var sid = ""; var skey = ""; var ticket = ""; var deviceId = ""; var loginUserName = ""; var loginNickName = ""; var initSyncKey; var syncKey; var initContactList; var wxView; var chatView; function monitorNewMsg() { if (typeof(wxView) != 'undefined') wxView.doNewMsg(); if (typeof(chatView) != 'undefined' && typeof(chatView.doNewMsg) == 'function') chatView.doNewMsg(); }
import register from '../../utils/register' import routeHelperConfig from './route-helper.provider' import routeHelper from './route-helper.factory' let registerApp = new register('blocks.router', [ 'ngRoute' ]) registerApp .provider('routeHelperConfig', routeHelperConfig) .factory('routeHelper', routeHelper)
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ (function(Mozilla){ 'use strict'; function onLoad() { var browserHelpContent = document.getElementById('browser-help'); var browserHelpIcon = document.getElementById('icon-browser-help'); var installerHelpContent = document.getElementById('installer-help'); var installerHelpIcon = document.querySelectorAll('.icon-installer-help'); function showHelpModal(modalContent, modalTitle, eventLabel) { Mzp.Modal.createModal(this, modalContent, { title: modalTitle, className: 'help-modal' }); window.dataLayer.push({ 'event': 'in-page-interaction', 'eAction': 'link click', 'eLabel': eventLabel }); } Mozilla.FirefoxDownloader.init(); // Browser help modal. browserHelpIcon.addEventListener('click', function(e) { e.preventDefault(); showHelpModal.call(this, browserHelpContent, browserHelpIcon.textContent, 'Get Browser Help'); }, false); // Installer help modal. for (var i = 0; i < installerHelpIcon.length; i++) { installerHelpIcon[i].addEventListener('click', function(e) { e.preventDefault(); showHelpModal.call(this, installerHelpContent, e.target.textContent, 'Get Installer Help'); }, false); } } Mozilla.run(onLoad); })(window.Mozilla);
import Route from '@ember/routing/route'; export default Route.extend({ beforeModel: function(transition) { if (transition.targetName === this.routeName) { transition.abort(); return this.replaceWith('vault.cluster.settings.mount-secret-backend'); } }, });
define(['jquery', 'uri', 'base/ui', 'masonry', 'base/login', 'analytics', 'localized', 'jquery-ui.autocomplete'], function ($, URI, UI, Masonry, webmakerAuth, analytics, localized) { var query = $('.search-poster').attr('data-query'), queryKeys = URI.parse(window.location.href).queryKey, $searchPoster = $('.search-poster'), $searchButton = $('.search-btn'), $searchField = $('#search-field'), $searchFilter = $('#search-type'), $forkBtns = $('.make-fork-btn'), $userNameLinks = $('.user-link'), mainGallery = $('.main-gallery')[0], tagSuggestionEnabled = false, searchType = 'all', totalHits, LIMIT, masonry, page; function onKeyDown() { $('html, body').animate({ scrollTop: 0 }, 200); $searchPoster.addClass('focus'); $searchField.off('keydown', onKeyDown); } $searchField.click(function () { $searchField.select(); }); $searchButton.click(function () { var searchInputVal = encodeURIComponent($searchField.val()); analytics.event('Search ' + searchType + ' Clicked', { label: searchInputVal }); }); // Show the big green UI if ($searchPoster.hasClass('focus') && query) { $searchField.val(query.replace(/,/g, ', ')); onKeyDown(); } else { $searchField.on('keydown', onKeyDown); } $searchField.autocomplete({ source: function (request, response) { var term = request.term; if (term === '#') { return response(); } term = term.replace(/(^#)/, ''); var searchUrl = '/api/20130724/make/tags?t=' + term; $.getJSON($('meta[name=\'make-endpoint\']').attr('content') + searchUrl, function (data) { response(data.tags.map(function (item) { return item.term; })); }); }, minLength: 1, delay: 200, select: function (e, ui) { $searchField.val(ui.item.value); $('.search-wrapper').submit(); } }); function likeClickCallback(e) { e.preventDefault(); e.stopPropagation(); var $this = $(this), makeID = $this.data('make-id'), method; if ($this.hasClass('fa-heart')) { method = '/unlike'; } else { method = '/like'; } $.post(method, { makeID: makeID, _csrf: $('meta[name=\'csrf-token\']').attr('content') }, function (res) { var newLen = res.likes.length, $count = $this.parent().parent().find('.like-count'), $text = $this.parent().parent().find('.like-text'); $this.toggleClass('fa-heart fa-heart-o'); $count.html(newLen); if (newLen === 0) { $text.html(localized.get('Like-0')); } else if (newLen === 1) { $text.html(localized.get('Like-1')); } else { $text.html(localized.get('Like-n')); } }).fail(function (res) { if (res.status === 401) { webmakerAuth.login(); } else { // already like/unliked, update UI to reflect. $this.toggleClass('fa-heart fa-heart-o'); } }); } $('.make-like-toggle') .off('click') .on('click', likeClickCallback); function enableTagSuggestion() { $searchField.autocomplete('enable'); tagSuggestionEnabled = true; } function disableTagSuggestion() { $searchField.autocomplete('disable'); tagSuggestionEnabled = false; } if ($searchFilter.find('[name=type]').val() === 'tags') { enableTagSuggestion(); } else { disableTagSuggestion(); } // Setup masonry masonry = new Masonry(mainGallery, { itemSelector: 'div.make', gutter: '.gutter-sizer', transitionDuration: '0.2' }); // Change what kind of search $searchFilter.find('li').click(function () { var $this = $(this); searchType = $this.attr('data-value'); $searchFilter.find('[name=type]').val(searchType); $searchFilter.attr('class', 'search-filter icon-' + searchType); $searchFilter.find('.ui-on').removeClass('ui-on'); $this.addClass('ui-on'); if (!tagSuggestionEnabled && searchType === 'tags') { enableTagSuggestion(); } else if (tagSuggestionEnabled) { disableTagSuggestion(); } }); $forkBtns.click(function (e) { e.stopPropagation(); }); $userNameLinks.click(function (e) { e.stopPropagation(); queryKeys.page = 1; queryKeys.type = 'user'; queryKeys.q = this.getAttribute('data-username'); window.location.search = $.param(queryKeys); }); page = queryKeys.page ? parseInt(queryKeys.page, 10) : 1; if (mainGallery) { totalHits = mainGallery.getAttribute('data-total-hits'); LIMIT = mainGallery.getAttribute('data-limit'); UI.pagination(page, totalHits, LIMIT, function (page) { queryKeys.page = page; if (queryKeys.q) { queryKeys.q = decodeURIComponent(queryKeys.q); } window.location.search = $.param(queryKeys); }); } });
import validateComponentConfig from '../validation/validateComponentConfig'; import normalizeComponentConfig from '../helper/normalizeComponentConfig'; import createFactory from '../helper/createFactory'; import printError from '../helper/printError'; export default function adaptDefineComponentFunction({ createComponentType, createElement, Adapter }) { function defineComponent(config) { const error = validateComponentConfig(config); if (error) { const errorMsg = prettifyErrorMsg(error.message, config); printError(errorMsg); throw new TypeError(errorMsg); } const normalizedConfig = normalizeComponentConfig(config), componentType = createComponentType(normalizedConfig), factory = createFactory(componentType, normalizedConfig, Adapter); return factory; } defineComponent._jsx = createElement; defineComponent._jsxFrag = null; return defineComponent; } function prettifyErrorMsg(errorMsg, config) { return config && typeof config === 'object' && typeof config.displayName === 'string' && config.displayName.trim().length > 0 ? '[defineComponent] Invalid configuration for component ' + `"${config.displayName}": ${errorMsg} ` : `[defineComponent] Invalid component configuration: ${errorMsg}`; }
import dt from 'datatables.net-bs'; import 'datatables.net-bs/css/dataTables.bootstrap.css'; import $ from 'jquery'; import { d3format, fixDataTableBodyHeight } from '../javascripts/modules/utils'; import './pivot_table.css'; dt(window, $); module.exports = function (slice, payload) { const container = slice.container; const fd = slice.formData; const height = container.height(); let cols = payload.data.columns; if (Array.isArray(cols[0])) { cols = cols.map(col => col[0]); } // payload data is a string of html with a single table element container.html(payload.data.html); // jQuery hack to set verbose names in headers const replaceCell = function () { const s = $(this)[0].textContent; $(this)[0].textContent = slice.datasource.verbose_map[s] || s; }; slice.container.find('thead tr:first th').each(replaceCell); slice.container.find('thead tr th:first-child').each(replaceCell); // jQuery hack to format number slice.container.find('tbody tr').each(function () { $(this).find('td').each(function (i) { const metric = cols[i]; const format = slice.datasource.column_formats[metric] || fd.number_format || '.3s'; const tdText = $(this)[0].textContent; if (!isNaN(tdText) && tdText !== '') { $(this)[0].textContent = d3format(format, tdText); } }); }); if (fd.groupby.length === 1) { // When there is only 1 group by column, // we use the DataTable plugin to make the header fixed. // The plugin takes care of the scrolling so we don't need // overflow: 'auto' on the table. container.css('overflow', 'hidden'); const table = container.find('table').DataTable({ paging: false, searching: false, bInfo: false, scrollY: `${height}px`, scrollCollapse: true, scrollX: true, }); table.column('-1').order('desc').draw(); fixDataTableBodyHeight(container.find('.dataTables_wrapper'), height); } else { // When there is more than 1 group by column we just render the table, without using // the DataTable plugin, so we need to handle the scrolling ourselves. // In this case the header is not fixed. container.css('overflow', 'auto'); container.css('height', `${height + 10}px`); } };
var FormFileUpload = function () { return { //main function to initiate the module init: function () { // Initialize the jQuery File Upload widget: $('#fileupload').fileupload({ disableImageResize: false, autoUpload: false, disableImageResize: /Android(?!.*Chrome)|Opera/.test(window.navigator.userAgent), maxFileSize: 5000000, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, }); // Enable iframe cross-domain access via redirect option: $('#fileupload').fileupload( 'option', 'redirect', window.location.href.replace( /\/[^\/]*$/, '/cors/result.html?%s' ) ); // Upload server status check for browsers with CORS support: if ($.support.cors) { $.ajax({ type: 'HEAD' }).fail(function () { $('<div class="alert alert-danger"/>') .text('Upload server currently unavailable - ' + new Date()) .appendTo('#fileupload'); }); } // Load & display existing files: $('#fileupload').addClass('fileupload-processing'); $.ajax({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: $('#fileupload').fileupload('option', 'url'), dataType: 'json', context: $('#fileupload')[0] }).always(function () { $(this).removeClass('fileupload-processing'); }).done(function (result) { $(this).fileupload('option', 'done') .call(this, $.Event('done'), {result: result}); }); } }; }();
/** enyo.ScrollStrategy is a helper kind which implements a default scrolling strategy for an <a href="#enyo.Scroller">enyo.Scroller</a>. enyo.ScrollStrategy is not typically created in application code. */ enyo.kind({ name: "enyo.ScrollStrategy", noDom: true, events: { onScroll: "doScroll" }, published: { /** Specifies how to horizontally scroll. Acceptable values are: * "scroll": always shows a scrollbar; sets overflow: scroll * "auto": scrolls only if needed; sets overflow: auto * "hidden": never scrolls; sets overflow: hidden * "default": same as auto. */ vertical: "default", /** Specifies how to vertically scroll. Acceptable values are: * "scroll": always shows a scrollbar; sets overflow: scroll * "auto": scrolls only if needed; sets overflow: auto * "hidden": never scrolls; sets overflow: hidden * "default": same as auto. */ horizontal: "default", scrollLeft: 0, scrollTop: 0 }, //* @protected handlers: { onscroll: "scroll", ondown: "down", onmove: "move" }, create: function() { this.inherited(arguments); this.horizontalChanged(); this.verticalChanged(); this.container.setAttribute("onscroll", enyo.bubbler); }, rendered: function() { this.inherited(arguments); this.scrollNode = this.calcScrollNode(); }, teardownRender: function() { this.inherited(arguments); this.scrollNode = null; }, calcScrollNode: function() { return this.container.hasNode(); }, horizontalChanged: function() { this.container.applyStyle("overflow-x", this.horizontal == "default" ? "auto" : this.horizontal); }, verticalChanged: function() { this.container.applyStyle("overflow-y", this.vertical == "default" ? "auto" : this.vertical); }, scroll: function(inSender, e) { return this.doScroll(e); }, scrollTo: function(inX, inY) { if (this.scrollNode) { this.setScrollLeft(inX); this.setScrollTop(inY); } }, scrollIntoView: function(inControl, inAlignWithTop) { if (inControl.hasNode()) { inControl.node.scrollIntoView(inAlignWithTop); } }, setScrollTop: function(inTop) { this.scrollTop = inTop; if (this.scrollNode) { this.scrollNode.scrollTop = this.scrollTop; } }, setScrollLeft: function(inLeft) { this.scrollLeft = inLeft; if (this.scrollNode) { this.scrollNode.scrollLeft = this.scrollLeft; } }, getScrollLeft: function() { return this.scrollNode ? this.scrollNode.scrollLeft : this.scrollLeft; }, getScrollTop: function() { return this.scrollNode ? this.scrollNode.scrollTop : this.scrollTop; }, getScrollBounds: function() { var n = this.scrollNode; var b = { left: this.getScrollLeft(), top: this.getScrollTop(), height: n ? n.scrollHeight : 0, width: n ? n.scrollWidth : 0 }; b.maxLeft = Math.max(0, b.width - n.clientWidth); b.maxTop = Math.max(0, b.height - n.clientHeight); return b; }, // NOTE: down, move handlers are needed only for native touch scrollers // avoid allowing scroll when starting at a vertical boundary to prevent ios from window scrolling. down: function(inSender, inEvent) { // if we start on a boundary, need to check direction of first move var y = this.getScrollTop(); this.atTopEdge = (y == 0); var sb = this.getScrollBounds(); this.atBottomEdge = y == sb.maxTop; this.downY = inEvent.pageY; this.downX = inEvent.pageX; this.canVertical = sb.maxTop > 0 && this.vertical != "hidden"; this.canHorizontal = sb.maxLeft > 0 && this.horizontal != "hidden"; }, // NOTE: mobile native scrollers need touchmove. Indicate this by // setting the requireTouchmove property to true (must do this in move event // because must respond to first move or native action fails). move: function(inSender, inEvent) { var dy = inEvent.pageY - this.downY; var dx = inEvent.pageX - this.downX; var v = this.canVertical, h = this.canHorizontal; // check to see if it is dragging vertically which would trigger window scrolling var isV = (Math.abs(dy) > 10) && (Math.abs(dy) > Math.abs(dx)); // abort scroll if dragging oob from vertical edge if (isV && (v || h) && (this.atTopEdge || this.atBottomEdge)) { var oob = (this.atTopEdge && (dy >= 0) || this.atBottomEdge && (dy <= 0)); // we only need to abort 1 event to prevent window native scrolling, but we // perform oob check around a small radius because a small in bounds move may // not trigger scrolling for this scroller meaning the window might still scroll. if (Math.abs(dy) > 25) { this.atTopEdge = this.atBottomEdge = false; } if (oob) { return; } } inEvent.requireTouchmove = (v || h); } });
/* @licstart The following is the entire license notice for the JavaScript code in this file. Copyright (C) 1997-2019 by Dimitri van Heesch This program is free software; you can redistribute it and/or modify it under the terms of version 2 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 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. @licend The above is the entire license notice for the JavaScript code in this file */ var menudata={children:[ {text:"Introduction",url:"index.html"}, {text:"Tutorial",url:"quick_guide.html"}, {text:"Guides",url:"pages.html"}, {text:"Reference",url:"modules.html"}, {text:"Files",url:"files.html"}]}
/* * @license * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ CLASS({ name: 'ErrorDAO', package: 'foam.core.dao', extends: 'AbstractDAO', methods: { put: function(obj, sink) { sink && sink.error && sink.error('put', obj); }, remove: function(obj, sink) { sink && sink.error && sink.error('remove', obj); } } });
import Ember from 'ember'; import Sortable from 'ui/mixins/sortable'; export default Ember.Controller.extend(Sortable, { sortBy: 'name', sorts: { state: ['stateSort','name','id'], name: ['name','id'], ip: ['displayIp','name','id'], image: ['imageUuid','id'], }, });
/* * Copyright 2013 The Polymer Authors. All rights reserved. * Use of this source code is goverened by a BSD-style * license that can be found in the LICENSE file. */ suite('HTMLShadowElement', function() { var unwrap = ShadowDOMPolyfill.unwrap; test('olderShadowRoot', function() { var host = document.createElement('div'); host.innerHTML = '<a>a</a><b>b</b>'; var a = host.firstChild; var b = host.lastChild; var sr = host.createShadowRoot(); sr.innerHTML = 'a<shadow>b</shadow>c'; var shadow = sr.firstElementChild; host.offsetWidth; assert.isTrue(shadow instanceof HTMLShadowElement); assert.isNull(shadow.olderShadowRoot); var sr2 = host.createShadowRoot(); sr2.innerHTML = 'd<shadow>e</shadow>f'; var shadow2 = sr2.firstElementChild; host.offsetWidth; assert.isTrue(shadow instanceof HTMLShadowElement); assert.isNull(shadow.olderShadowRoot); assert.isTrue(shadow2 instanceof HTMLShadowElement); assert.equal(shadow2.olderShadowRoot, sr); assert.equal(unwrap(host).innerHTML, 'dabcf'); }); });
function infostart_rate(ob_id, vote) { $.get("/bitrix/components/infostart/objects_new.list/ajax_rate.php", {ID:ob_id, TYPE:vote}, function(answer) { alert(answer); }); }
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { CKEDITOR.dialog.add( 'pastetext', function( editor ) { return { title : editor.lang.pasteText.title, minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 368 : 350, minHeight : 240, onShow : function(){ this.setupContent(); }, onOk : function(){ this.commitContent(); }, contents : [ { label : editor.lang.common.generalTab, id : 'general', elements : [ { type : 'html', id : 'pasteMsg', html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.pasteMsg + '</div>' }, { type : 'textarea', id : 'content', className : 'cke_pastetext', onLoad : function() { var label = this.getDialog().getContentElement( 'general', 'pasteMsg' ).getElement(), input = this.getElement().getElementsByTag( 'textarea' ).getItem( 0 ); input.setAttribute( 'aria-labelledby', label.$.id ); input.setStyle( 'direction', editor.config.contentsLangDirection ); }, focus : function() { this.getElement().focus(); }, setup : function() { this.setValue( '' ); }, commit : function() { var value = this.getValue(); setTimeout( function() { editor.fire( 'paste', { 'text' : value } ); }, 0 ); } } ] } ] }; }); })();
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.13-2-5 description: Object.isExtensible returns true for all built-in objects (String) ---*/ var e = Object.isExtensible(String); assert.sameValue(e, true, 'e');
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.12-3-8 description: Object.isFrozen returns false for all built-in objects (String) ---*/ var b = Object.isFrozen(String); assert.sameValue(b, false, 'b');
// Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-string.prototype.valueof description: > String.prototype.valueOf.length is 0. info: | String.prototype.valueOf ( ) 17 ECMAScript Standard Built-in Objects: Every built-in Function object, including constructors, has a length property whose value is an integer. Unless otherwise specified, this value is equal to the largest number of named arguments shown in the subclause headings for the function description, including optional parameters. However, rest parameters shown using the form “...name” are not included in the default argument count. Unless otherwise specified, the length property of a built-in Function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. includes: [propertyHelper.js] ---*/ verifyProperty(String.prototype.valueOf, 'length', { value: 0, writable: false, enumerable: false, configurable: true, });
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.6-4-542 description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is true, [[Configurable]] is false) is undeletable includes: [propertyHelper.js] ---*/ var obj = {}; var getFunc = function() { return 1001; }; var verifySetFunc = "data"; var setFunc = function(value) { verifySetFunc = value; }; Object.defineProperty(obj, "prop", { get: getFunc, set: setFunc, enumerable: true, configurable: false }); assert(obj.hasOwnProperty("prop")); verifyNotConfigurable(obj, "prop");
// Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the license found in the LICENSE file. /*--- esid: sec-atomics.islockfree description: Testing descriptor property of Atomics.add includes: [propertyHelper.js] features: [Atomics] ---*/ verifyProperty(Atomics, 'add', { enumerable: false, writable: true, configurable: true, });
function setupTest( target, event, dataToPaste, externalPassCondition ){ var logNode=document.getElementsByTagName('p')[0].firstChild; logNode.data=''; if( typeof target==='string' ){ if( target.indexOf('.')>-1 ){ // for example "myElementID.firstChild" var tmp=target.split('.'); target=document.getElementById(tmp[0])[tmp[1]]; }else{ target=document.getElementById(target); } } /* */ if( target.addEventListener ){ target.addEventListener(event, intermediateListener, false); }else if(target.attachEvent){ target.attachEvent('on'+event, intermediateListener); } if( dataToPaste || event==='paste' ){ logNode.data+='Please place the following text on the clipboard before continuing the test: "'+(dataToPaste || 'clipboard text' )+'"\n'; logNode.parentNode.style.whiteSpace='pre'; if(dataToPaste.indexOf('{')==0){ // sorry about the content sniffing, this is likely a JSON string with alternate clipboard formats if(dataToPaste.indexOf('text/html')>-1){ logNode.parentNode.appendChild(document.createElement('br')); logNode.parentNode.appendChild(document.createTextNode('Note: copy all body text from ')); var tmp=logNode.parentNode.appendChild(document.createElement('a')); tmp.href='support/html_file.htm'; tmp.appendChild(document.createTextNode('this support file')); logNode.parentNode.appendChild(document.createTextNode(' for this test.')); } } } if(typeof triggerTestManually==='function'){ logNode.parentNode.appendChild(document.createTextNode(' ')); var btn=logNode.parentNode.appendChild(document.createElement('button')) btn.type='button'; btn.onclick=function(){ triggerTestManually(); btn.parentNode.removeChild(btn); } btn.appendChild(document.createTextNode(' Click here to run test: ')); }else{ logNode.data+='Test in progress, waiting for '+event+' event'; } if(typeof onTestSetupReady==='function'){ onTestSetupReady(event); } function intermediateListener(e){ e=e||window.event; if(!e.target)e.target=e.srcElement; if(typeof window.clipboardData != 'undefined' && typeof e.clipboardData=='undefined' )e.clipboardData=window.clipboardData; try{ var testResult=test(e); result(testResult); }catch(e){ result('exception: '+e); } } /* if @autofocus isn't supported.. */ if( document.getElementsByTagName('input').length >1 && document.activeElement == document.body ){ for(var inp, i=0, inputs=document.getElementsByTagName('input');inp=inputs[i];i++){ if(inp.hasAttribute('autofocus'))inp.focus(); } } } function result(testResult, msg){ var logNode=document.getElementsByTagName('p')[0].firstChild; if( testResult === true || testResult === false ){ logNode.data= testResult ? 'PASSED' : 'FAILED'; }else if( typeof testResult ==='string' ){ logNode.data=testResult; }else if( typeof externalPassCondition==='string' ){ logNode.data='\nThis test passes if this text is now on the system clipboard: "'+externalPassCondition+'"'; } if( msg )logNode.data+='\n'+msg; /* another return value - or no return - from test() indicates that it is asyncronous and will call testResult() from a timeout or something */ }
var n = require('./nodejs'); n.a; n.b.c; exports.a2 = n.a; exports.b2 = n.b; exports.c2 = n.b.c;
//When change in default attribute: // Make code revision and check all values working with the default HTML attribute name 'gridindex' and or the variable `attribute` var navigationItem, attribute; var navigationActive = false; var gridindex = "1-2"; var backupGridindex = "1-2"; var lastGridindex_col = {}; var attributes = ["nav-gridindex"] function getElem(col, row) { if (attribute == undefined) { return document.querySelector("[gridindex='" + String(col) + "-" + String(row) + "']"); } else { return document.querySelector("[" + attribute + "='" + String(col) + "-" + String(row) + "']"); } } function getAttribute(elem) { var i; for (i in attributes) { if (elem.getAttribute(attributes[i]) != null) { attribute = attributes[i]; break } else { attribute = undefined; } i += 1; } if (attribute == undefined) { gridindex = String(elem.getAttribute("gridindex")); console.log("%cFocus event: Calling element with id: " + gridindex, "color:orange;"); } else { gridindex = String(elem.getAttribute(attribute)); } } function getIndex(elem) { if (attribute == undefined) { gridindex = String(elem.getAttribute("gridindex")); if (gridindex == "null") { getAttribute(elem); } else { console.log("%cFocus event: Calling element with id: " + gridindex, "color:orange;"); } } else { getAttribute(elem); } } function down() { var elem, col, row; var navelem = false; var tmp = gridindex.split("-"); col = parseInt(tmp[0]); row = parseInt(tmp[1]); row += 1; while (true) { elem = getElem(col, row); console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;"); if (elem != undefined) { if (elem.parentNode.parentNode.className.indexOf("nav-children") > -1 ) { elem.parentNode.parentNode.style.display = "block"; navigationItem = elem.parentNode.parentNode; navelem = true; } else { if (navigationItem != undefined) { navigationItem.style = ""; } } if (elem.offsetHeight > 0 || navelem) { elem.focus(); gridindex = String(col) + "-" + String(row); navelem = false; break; } else { row += 1; } } else { lastGridindex_col[String(col)] = String(row); col += 1; if (getElem(col, 1) != null) { gridindex = String(col) + "-0"; down(); } break; } } } function up() { var elem, col, row; var tmp = gridindex.split("-"); col = parseInt(tmp[0]); row = parseInt(tmp[1]); row -= 1; while (true) { elem = getElem(col, row); console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;"); if (elem != undefined) { if (elem.parentNode.parentNode.className.indexOf("nav-children") > -1 ) { elem.parentNode.parentNode.style.display = "block"; navigationItem = elem.parentNode.parentNode; navelem = true; } else { if (navigationItem != undefined) { navigationItem.style = ""; } } if (elem.offsetHeight > 0) { elem.focus(); gridindex = String(col) + "-" + String(row); break; } else { row -= 1; } } else { if (getElem(col-1, 1) != null) { if (lastGridindex_col[String(col-1)] == undefined) { lastGridindex_col[String(col-1)] = "1"; } gridindex = String(col-1) + "-" + lastGridindex_col[String(col-1)]; if (lastGridindex_col[String(col-1)] == 1) { gridindex = String(col-1) + "-" + String(parseInt(lastGridindex_col[String(col-1)])+1); } up(); } break; } } } function left() { var elem, col, row; var tmp = gridindex.split("-"); col = parseInt(tmp[0]); row = parseInt(tmp[1]); col -= 1; while (true) { elem = getElem(col, row); console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;"); if (elem != undefined) { if (elem.offsetHeight > 0) { elem.focus(); gridindex = String(col) + "-" + String(row); break; } else { col -= 1; } } else { col += 1; break; } } } function right() { var elem, col, row; var tmp = gridindex.split("-"); col = parseInt(tmp[0]); row = parseInt(tmp[1]); col += 1; while (true) { elem = getElem(col, row); console.log("%cCalling element with id: " + String(col) + "-" + String(row), "color:darkblue;"); if (elem != undefined) { if (elem.offsetHeight > 0) { elem.focus(); gridindex = String(col) + "-" + String(row); break; } else { col += 1; } } else { col -= 1; break; } } } document.body.addEventListener("keydown", function(event) { var key = event.keyCode || event.which; if (event.altKey) { var col, row; if (key == 78) { // key 'n' // activate/deactivate navigation (toggling) if (navigationActive) { // deactivate navigation attribute = undefined; navigationActive = false; gridindex = backupGridindex; row = gridindex.split("-"); col = parseInt(row[0]); row = parseInt(row[1]); getElem(col, row).focus(); } else { // activate navigation attribute = "nav-gridindex"; navigationActive = true; backupGridindex = gridindex; gridindex = "1-1"; row = gridindex.split("-"); col = parseInt(row[0]); row = parseInt(row[1]); getElem(col, row).focus(); } } else if (key == 27) { // escape // escape key attribute = undefined; navigationActive = false; gridindex = backupGridindex; row = gridindex.split("-"); col = parseInt(row[0]); row = parseInt(row[1]); getElem(col, row).focus(); } } else { if (key == 38 || key == 121) { // arrow up, F10 up(); event.preventDefault(); } else if (key == 40 || key == 120) { // arrow down, F9 down(); event.preventDefault(); } else if (key == 37 || key == 122) { // arrow left, F11 left(); event.preventDefault(); } else if (key == 39 || key == 123) { // arrow right, F12 right(); event.preventDefault(); } } }) getElem(1, 2).focus();
angular.module('ui.bootstrap.alert', []) .controller('UibAlertController', ['$scope', '$attrs', '$timeout', function($scope, $attrs, $timeout) { $scope.closeable = !!$attrs.close; if (angular.isDefined($attrs.dismissOnTimeout)) { $timeout(function() { $scope.close(); }, parseInt($attrs.dismissOnTimeout, 10)); } }]) .directive('uibAlert', function() { return { controller: 'UibAlertController', controllerAs: 'alert', templateUrl: function(element, attrs) { return attrs.templateUrl || 'template/alert/alert.html'; }, transclude: true, replace: true, scope: { type: '@', close: '&' } }; }); /* Deprecated alert below */ angular.module('ui.bootstrap.alert') .value('$alertSuppressWarning', false) .controller('AlertController', ['$scope', '$attrs', '$controller', '$log', '$alertSuppressWarning', function($scope, $attrs, $controller, $log, $alertSuppressWarning) { if (!$alertSuppressWarning) { $log.warn('AlertController is now deprecated. Use UibAlertController instead.'); } angular.extend(this, $controller('UibAlertController', { $scope: $scope, $attrs: $attrs })); }]) .directive('alert', ['$log', '$alertSuppressWarning', function($log, $alertSuppressWarning) { return { controller: 'AlertController', controllerAs: 'alert', templateUrl: function(element, attrs) { return attrs.templateUrl || 'template/alert/alert.html'; }, transclude: true, replace: true, scope: { type: '@', close: '&' }, link: function() { if (!$alertSuppressWarning) { $log.warn('alert is now deprecated. Use uib-alert instead.'); } } }; }]);
/* * This file contains generic tests that are run against every rule. Early on, * we found some common rule patterns that would cause errors under certain * conditions. Instead of tracking them down individually, this file runs * the same tests on every defined rule to track down these patterns. * * When run in addition to the other tests, this causes the Rhino CLI test * to fail due to Java stack overflow. This must be run separate from other tests. */ (function() { "use strict"; var Assert = YUITest.Assert, suite = new YUITest.TestSuite("General Tests for all Rules"), rules = CSSLint.getRules(), len = rules.length, i; function testAll(i, rules) { suite.add(new YUITest.TestCase({ name: "General Tests for " + rules[i].id, setUp: function() { this.options = {}; this.options[rules[i].id] = 1; }, "Using @viewport should not result in an error": function() { var result = CSSLint.verify("@viewport { width: auto; }", this.options); Assert.areEqual(0, result.messages.length); }, "Using @keyframes should not result in an error": function() { var result = CSSLint.verify("@keyframes resize { 0% {padding: 0;} 50% {padding: 0;} 100% {padding: 0;}}", this.options); Assert.areEqual(0, result.messages.length); }, "Using @page should not result in an error": function() { var result = CSSLint.verify("@page { width: 100px; }", this.options); Assert.areEqual(0, result.messages.length); }, "Using @page @top-left should not result in an error": function() { var result = CSSLint.verify("@page { @top-left { content: ''; } }", this.options); Assert.areEqual(0, result.messages.length); }, "Using a regular rule should not result in an error": function() { var result = CSSLint.verify("body { margin: 0; }", this.options); Assert.areEqual(0, result.messages.length); } })); } for (i = 0; i < len; i++) { testAll(i, rules); } YUITest.TestRunner.add(suite); })();
// from https://gist.github.com/mathewbyrne/1280286 slugify = function(text){ return text.toString().toLowerCase() .replace(/\s+/g, '-') // Replace spaces with - .replace(/[^\w\-]+/g, '') // Remove all non-word chars .replace(/\-\-+/g, '-') // Replace multiple - with single - .replace(/^-+/, '') // Trim - from start of text .replace(/-+$/, ''); // Trim - from end of text } var render = function(data) { var data = data.data; var out = '* [' + data.title + '](https://github.com/git-tips/tips#' + slugify(data.title) + ')\n'; return out; }; module.exports = render;
define(function() { "use strict"; function RangeFilter(columnKey, isMinEnabled, minValue, isMaxEnabled, maxValue) { InputValidator.validateNotNull("columnKey", columnKey); InputValidator.validateNotNull("isMinEnabled", isMinEnabled); InputValidator.validateNotNull("minValue", minValue); InputValidator.validateNotNull("isMaxEnabled", isMaxEnabled); InputValidator.validateNotNull("maxValue", maxValue); this.columnKey = function() { return columnKey; }; this.isMinEnabled = function() { return isMinEnabled; }; this.minValue = function() { return minValue; }; this.isMaxEnabled = function() { return isMaxEnabled; }; this.maxValue = function() { return maxValue; }; this.passes = function(data) { InputValidator.validateNotNull("data", data); var value = data[columnKey]; return (!isMinEnabled || minValue <= value) && (!isMaxEnabled || value <= maxValue); }; this.toObject = function() { return ( { type: "RangeFilter", columnKey: columnKey, isMinEnabled: isMinEnabled, minValue: minValue, isMaxEnabled: isMaxEnabled, maxValue: maxValue, }); }; this.toString = function() { return "RangeFilter (" + isMinEnabled + " " + minValue + "\u2264" + columnKey + "\u2264" + isMaxEnabled + " " + maxValue + ")"; }; } RangeFilter.fromObject = function(object) { InputValidator.validateNotNull("object", object); var columnKey = object.columnKey; var isMinEnabled = object.isMinEnabled; var minValue = object.minValue; var isMaxEnabled = object.isMaxEnabled; var maxValue = object.maxValue; return new RangeFilter(columnKey, isMinEnabled, minValue, isMaxEnabled, maxValue); }; return RangeFilter; });
const debug = require('ghost-ignition').debug('api:canary:utils:serializers:input:authors'); const slugFilterOrder = require('./utils/slug-filter-order'); const utils = require('../../index'); function setDefaultOrder(frame) { if (!frame.options.order && frame.options.filter) { frame.options.autoOrder = slugFilterOrder('users', frame.options.filter); } if (!frame.options.order && !frame.options.autoOrder) { frame.options.order = 'name asc'; } } module.exports = { browse(apiConfig, frame) { debug('browse'); if (utils.isContentAPI(frame)) { setDefaultOrder(frame); } }, read(apiConfig, frame) { debug('read'); if (utils.isContentAPI(frame)) { setDefaultOrder(frame); } } };
(function() { 'use strict'; /* * This feature allows you to specify a grid over a portion or the entire chart area. * * @name grid */ d4.feature('grid', function(name) { var xAxis = d3.svg.axis(); var yAxis = d3.svg.axis(); return { accessors: { formatXAxis: function(xAxis) { return xAxis.orient('bottom'); }, formatYAxis: function(yAxis) { return yAxis.orient('left'); } }, proxies: [{ target: xAxis, prefix: 'x' }, { target: yAxis, prefix: 'y' }], render: function(scope, data, selection) { xAxis.scale(this.x); yAxis.scale(this.y); var formattedXAxis = d4.functor(scope.accessors.formatXAxis).bind(this)(xAxis); var formattedYAxis = d4.functor(scope.accessors.formatYAxis).bind(this)(yAxis); var grid = d4.appendOnce(selection, 'g.grid.border.' + name); var gridBg = d4.appendOnce(grid, 'rect'); var gridX = d4.appendOnce(grid, 'g.x.grid.' + name); var gridY = d4.appendOnce(grid, 'g.y.grid.' + name); gridBg .attr('transform', 'translate(0,0)') .attr('x', 0) .attr('y', 0) .attr('width', this.width) .attr('height', this.height); gridX .attr('transform', 'translate(0,' + this.height + ')') .call(formattedXAxis .tickSize(-this.height, 0, 0) .tickFormat('')); gridY .attr('transform', 'translate(0,0)') .call(formattedYAxis .tickSize(-this.width, 0, 0) .tickFormat('')); return grid; } }; }); }).call(this);
var searchData= [ ['get_5fmodel_5fhandle',['GET_MODEL_HANDLE',['../serializer_8h.html#a887590f4b40f78bf359c8e56f03c56fe',1,'serializer.h']]] ];
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _pure = require('recompose/pure'); var _pure2 = _interopRequireDefault(_pure); var _SvgIcon = require('../../SvgIcon'); var _SvgIcon2 = _interopRequireDefault(_SvgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ContentLowPriority = function ContentLowPriority(props) { return _react2.default.createElement( _SvgIcon2.default, props, _react2.default.createElement('path', { d: 'M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z' }) ); }; ContentLowPriority = (0, _pure2.default)(ContentLowPriority); ContentLowPriority.displayName = 'ContentLowPriority'; exports.default = ContentLowPriority;
import { Mesh, OrthographicCamera, PerspectiveCamera, PlaneGeometry, Scene, ShaderMaterial, UniformsUtils, WebGLRenderTarget } from 'three'; import { BokehShader } from '../shaders/BokehShader2.js'; import { BokehDepthShader } from '../shaders/BokehShader2.js'; class CinematicCamera extends PerspectiveCamera { constructor( fov, aspect, near, far ) { super( fov, aspect, near, far ); this.type = 'CinematicCamera'; this.postprocessing = { enabled: true }; this.shaderSettings = { rings: 3, samples: 4 }; const depthShader = BokehDepthShader; this.materialDepth = new ShaderMaterial( { uniforms: depthShader.uniforms, vertexShader: depthShader.vertexShader, fragmentShader: depthShader.fragmentShader } ); this.materialDepth.uniforms[ 'mNear' ].value = near; this.materialDepth.uniforms[ 'mFar' ].value = far; // In case of cinematicCamera, having a default lens set is important this.setLens(); this.initPostProcessing(); } // providing fnumber and coc(Circle of Confusion) as extra arguments // In case of cinematicCamera, having a default lens set is important // if fnumber and coc are not provided, cinematicCamera tries to act as a basic PerspectiveCamera setLens( focalLength = 35, filmGauge = 35, fNumber = 8, coc = 0.019 ) { this.filmGauge = filmGauge; this.setFocalLength( focalLength ); this.fNumber = fNumber; this.coc = coc; // fNumber is focalLength by aperture this.aperture = focalLength / this.fNumber; // hyperFocal is required to calculate depthOfField when a lens tries to focus at a distance with given fNumber and focalLength this.hyperFocal = ( focalLength * focalLength ) / ( this.aperture * this.coc ); } linearize( depth ) { const zfar = this.far; const znear = this.near; return - zfar * znear / ( depth * ( zfar - znear ) - zfar ); } smoothstep( near, far, depth ) { const x = this.saturate( ( depth - near ) / ( far - near ) ); return x * x * ( 3 - 2 * x ); } saturate( x ) { return Math.max( 0, Math.min( 1, x ) ); } // function for focusing at a distance from the camera focusAt( focusDistance = 20 ) { const focalLength = this.getFocalLength(); // distance from the camera (normal to frustrum) to focus on this.focus = focusDistance; // the nearest point from the camera which is in focus (unused) this.nearPoint = ( this.hyperFocal * this.focus ) / ( this.hyperFocal + ( this.focus - focalLength ) ); // the farthest point from the camera which is in focus (unused) this.farPoint = ( this.hyperFocal * this.focus ) / ( this.hyperFocal - ( this.focus - focalLength ) ); // the gap or width of the space in which is everything is in focus (unused) this.depthOfField = this.farPoint - this.nearPoint; // Considering minimum distance of focus for a standard lens (unused) if ( this.depthOfField < 0 ) this.depthOfField = 0; this.sdistance = this.smoothstep( this.near, this.far, this.focus ); this.ldistance = this.linearize( 1 - this.sdistance ); this.postprocessing.bokeh_uniforms[ 'focalDepth' ].value = this.ldistance; } initPostProcessing() { if ( this.postprocessing.enabled ) { this.postprocessing.scene = new Scene(); this.postprocessing.camera = new OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, - 10000, 10000 ); this.postprocessing.scene.add( this.postprocessing.camera ); this.postprocessing.rtTextureDepth = new WebGLRenderTarget( window.innerWidth, window.innerHeight ); this.postprocessing.rtTextureColor = new WebGLRenderTarget( window.innerWidth, window.innerHeight ); const bokeh_shader = BokehShader; this.postprocessing.bokeh_uniforms = UniformsUtils.clone( bokeh_shader.uniforms ); this.postprocessing.bokeh_uniforms[ 'tColor' ].value = this.postprocessing.rtTextureColor.texture; this.postprocessing.bokeh_uniforms[ 'tDepth' ].value = this.postprocessing.rtTextureDepth.texture; this.postprocessing.bokeh_uniforms[ 'manualdof' ].value = 0; this.postprocessing.bokeh_uniforms[ 'shaderFocus' ].value = 0; this.postprocessing.bokeh_uniforms[ 'fstop' ].value = 2.8; this.postprocessing.bokeh_uniforms[ 'showFocus' ].value = 1; this.postprocessing.bokeh_uniforms[ 'focalDepth' ].value = 0.1; //console.log( this.postprocessing.bokeh_uniforms[ "focalDepth" ].value ); this.postprocessing.bokeh_uniforms[ 'znear' ].value = this.near; this.postprocessing.bokeh_uniforms[ 'zfar' ].value = this.near; this.postprocessing.bokeh_uniforms[ 'textureWidth' ].value = window.innerWidth; this.postprocessing.bokeh_uniforms[ 'textureHeight' ].value = window.innerHeight; this.postprocessing.materialBokeh = new ShaderMaterial( { uniforms: this.postprocessing.bokeh_uniforms, vertexShader: bokeh_shader.vertexShader, fragmentShader: bokeh_shader.fragmentShader, defines: { RINGS: this.shaderSettings.rings, SAMPLES: this.shaderSettings.samples, DEPTH_PACKING: 1 } } ); this.postprocessing.quad = new Mesh( new PlaneGeometry( window.innerWidth, window.innerHeight ), this.postprocessing.materialBokeh ); this.postprocessing.quad.position.z = - 500; this.postprocessing.scene.add( this.postprocessing.quad ); } } renderCinematic( scene, renderer ) { if ( this.postprocessing.enabled ) { const currentRenderTarget = renderer.getRenderTarget(); renderer.clear(); // Render scene into texture scene.overrideMaterial = null; renderer.setRenderTarget( this.postprocessing.rtTextureColor ); renderer.clear(); renderer.render( scene, this ); // Render depth into texture scene.overrideMaterial = this.materialDepth; renderer.setRenderTarget( this.postprocessing.rtTextureDepth ); renderer.clear(); renderer.render( scene, this ); // Render bokeh composite renderer.setRenderTarget( null ); renderer.render( this.postprocessing.scene, this.postprocessing.camera ); renderer.setRenderTarget( currentRenderTarget ); } } } export { CinematicCamera };
import Social from './Social' export default Social
/* Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'colorbutton', 'ja', { auto: '自動', bgColorTitle: '背景色', colors: { '000': 'Black', '800000': 'Maroon', '8B4513': 'Saddle Brown', '2F4F4F': 'Dark Slate Gray', '008080': 'Teal', '000080': 'Navy', '4B0082': 'Indigo', '696969': 'Dark Gray', B22222: 'Fire Brick', A52A2A: 'Brown', DAA520: 'Golden Rod', '006400': 'Dark Green', '40E0D0': 'Turquoise', '0000CD': 'Medium Blue', '800080': 'Purple', '808080': 'Gray', F00: 'Red', FF8C00: 'Dark Orange', FFD700: 'Gold', '008000': 'Green', '0FF': 'Cyan', '00F': 'Blue', EE82EE: 'Violet', A9A9A9: 'Dim Gray', FFA07A: 'Light Salmon', FFA500: 'Orange', FFFF00: 'Yellow', '00FF00': 'Lime', AFEEEE: 'Pale Turquoise', ADD8E6: 'Light Blue', DDA0DD: 'Plum', D3D3D3: 'Light Grey', FFF0F5: 'Lavender Blush', FAEBD7: 'Antique White', FFFFE0: 'Light Yellow', F0FFF0: 'Honeydew', F0FFFF: 'Azure', F0F8FF: 'Alice Blue', E6E6FA: 'Lavender', FFF: 'White', '1ABC9C': 'Strong Cyan', '2ECC71': 'Emerald', '3498DB': 'Bright Blue', '9B59B6': 'Amethyst', '4E5F70': 'Grayish Blue', 'F1C40F': 'Vivid Yellow', '16A085': 'Dark Cyan', '27AE60': 'Dark Emerald', '2980B9': 'Strong Blue', '8E44AD': 'Dark Violet', '2C3E50': 'Desaturated Blue', 'F39C12': 'Orange', 'E67E22': 'Carrot', 'E74C3C': 'Pale Red', 'ECF0F1': 'Bright Silver', '95A5A6': 'Light Grayish Cyan', 'DDD': 'Light Gray', 'D35400': 'Pumpkin', 'C0392B': 'Strong Red', 'BDC3C7': 'Silver', '7F8C8D': 'Grayish Cyan', '999': 'Dark Gray' }, more: 'その他の色...', panelTitle: '色', textColorTitle: '文字色' } );
var parent = require('../../actual/array-buffer'); module.exports = parent;
const React = require('react') module.exports = () => <div>test2</div>
var _ = require('lodash'), Promise = require('bluebird'), models = require('../../../../models'), utils = require('../../../../utils'), SubscribersImporter = require('./subscribers'), PostsImporter = require('./posts'), TagsImporter = require('./tags'), SettingsImporter = require('./settings'), UsersImporter = require('./users'), RolesImporter = require('./roles'), importers = {}, DataImporter; DataImporter = { type: 'data', preProcess: function preProcess(importData) { importData.preProcessedByData = true; return importData; }, init: function init(importData) { importers.roles = new RolesImporter(importData.data); importers.tags = new TagsImporter(importData.data); importers.users = new UsersImporter(importData.data); importers.subscribers = new SubscribersImporter(importData.data); importers.posts = new PostsImporter(importData.data); importers.settings = new SettingsImporter(importData.data); return importData; }, doImport: function doImport(importData) { var ops = [], errors = [], results = [], options = { importing: true, context: { internal: true } }; this.init(importData); return models.Base.transaction(function (transacting) { options.transacting = transacting; _.each(importers, function (importer) { ops.push(function doModelImport() { return importer.beforeImport(options) .then(function () { return importer.doImport(options) .then(function (_results) { results = results.concat(_results); }); }); }); }); _.each(importers, function (importer) { ops.push(function afterImport() { return importer.afterImport(options); }); }); utils.sequence(ops) .then(function () { results.forEach(function (promise) { if (!promise.isFulfilled()) { errors = errors.concat(promise.reason()); } }); if (errors.length === 0) { transacting.commit(); } else { transacting.rollback(errors); } }); }).then(function () { /** * data: imported data * originalData: data from the json file * problems: warnings */ var toReturn = { data: {}, originalData: importData.data, problems: [] }; _.each(importers, function (importer) { toReturn.problems = toReturn.problems.concat(importer.problems); toReturn.data[importer.dataKeyToImport] = importer.importedData; }); return toReturn; }).catch(function (errors) { return Promise.reject(errors); }); } }; module.exports = DataImporter;
var utils = require('../../../utils'); module.exports = function CodeType(config) { var self = { selector: '.field-type-code[for="' + config.fieldName + '"]', elements: { label: '.FormLabel', lineNumber: '.CodeMirror-linenumber', codeMirror: '.CodeMirror-container', }, commands: [{ assertUI: function() { this .expect.element('@label').to.be.visible; this .expect.element('@label').text.to.equal(utils.titlecase(config.fieldName)); this .expect.element('@lineNumber').to.be.visible; this .expect.element('@lineNumber').text.to.equal('1'); this .expect.element('@codeMirror').to.be.visible; return this; }, fillInput: function(input) { this.api .execute(function (selector, input) { var x = document.querySelector(selector); var y = x.getElementsByClassName('CodeMirror')[0]; y.CodeMirror.setValue(input.value); }, [self.selector, input]); return this; }, assertInput: function(input) { this.api .execute(function (selector) { var x = document.querySelector(selector); var y = x.getElementsByClassName('CodeMirror')[0]; return y.CodeMirror.getValue(); }, [self.selector], function (result) { this.assert.equal(result.value, input.value); }); return this; }, }], }; return self; };
// Run if you want to monitor unresolved promises (in properly working // application there should be no promises that are never resolved) 'use strict'; var max = Math.max , callable = require('es5-ext/lib/Object/valid-callable') , isCallable = require('es5-ext/lib/Object/is-callable') , toUint = require('es5-ext/lib/Number/to-uint') , deferred = require('./deferred'); exports = module.exports = function (timeout, cb) { if (timeout === false) { // Cancel monitor delete deferred._monitor; delete exports.timeout; delete exports.callback; return; } exports.timeout = timeout = max(toUint(timeout) || 5000, 50); if (cb == null) { if ((typeof console !== 'undefined') && console && isCallable(console.error)) { cb = function (e) { console.error(((e.stack && e.stack.toString()) || "Unresolved promise: no stack available")); }; } } else { callable(cb); } exports.callback = cb; deferred._monitor = function () { var e = new Error("Unresolved promise"); return setTimeout(function () { if (cb) cb(e); }, timeout); }; };
Clazz.declarePackage ("org.eclipse.osgi.framework.internal.core"); Clazz.load (["org.eclipse.osgi.framework.internal.core.BundleLoader"], "org.eclipse.osgi.framework.internal.core.SystemBundleLoader", null, function () { c$ = Clazz.decorateAsClass (function () { this.classLoader = null; Clazz.instantialize (this, arguments); }, org.eclipse.osgi.framework.internal.core, "SystemBundleLoader", org.eclipse.osgi.framework.internal.core.BundleLoader); Clazz.makeConstructor (c$, function (bundle, proxy) { Clazz.superConstructor (this, org.eclipse.osgi.framework.internal.core.SystemBundleLoader, [bundle, proxy]); this.classLoader = this.getClass ().getClassLoader (); }, "org.eclipse.osgi.framework.internal.core.BundleHost,org.eclipse.osgi.framework.internal.core.BundleLoaderProxy"); Clazz.defineMethod (c$, "findClass", function (name) { return this.classLoader.loadClass (name); }, "~S"); Clazz.overrideMethod (c$, "findLibrary", function (name) { return null; }, "~S"); Clazz.overrideMethod (c$, "findLocalClass", function (name) { var clazz = null; try { clazz = this.classLoader.loadClass (name); } catch (e) { if (Clazz.instanceOf (e, ClassNotFoundException)) { } else { throw e; } } return clazz; }, "~S"); Clazz.overrideMethod (c$, "findLocalResource", function (name) { return this.classLoader.getResource (name); }, "~S"); Clazz.overrideMethod (c$, "findLocalResources", function (name) { try { return this.classLoader.getResources (name); } catch (e) { if (Clazz.instanceOf (e, java.io.IOException)) { return null; } else { throw e; } } }, "~S"); Clazz.defineMethod (c$, "findResource", function (name) { return this.classLoader.getResource (name); }, "~S"); Clazz.overrideMethod (c$, "findResources", function (name) { return this.classLoader.getResources (name); }, "~S"); Clazz.overrideMethod (c$, "close", function () { }); });
package test0657; public class X {} class A {}
package test0438; import test0438_a.W; class D { }
public class X { void bar() { for (final int i; 0 < (i = 1); i = i + 1) { } } } //public class X { // public static void main(String[] args) { // final int i; // for ( ; ; i = 1) // break; // i = 1; // } //} //public class X { // final int blank; // { // while ((null == null || true)) { // blank = 1; // break; // } // } // X(){ // } // public static void main(String[] argv){ // System.out.println("SUCCESS"); // } //} // should fail //class X { // // public static void main(String[] args) { // final boolean b; // do // break; // while ((b = true) && false); // b = true; // } //} // ? //class X { // // public static void main(String[] args) { // final boolean b; // do // break; // while ((b = true) && false); // b = true; // } //}
define([], function () { function processForgotPasswordResult(result) { if (result.Success) { var msg = Globalize.translate('MessagePasswordResetForUsers'); msg += '<br/>'; msg += '<br/>'; msg += result.UsersReset.join('<br/>'); Dashboard.alert({ message: msg, title: Globalize.translate('HeaderPasswordReset'), callback: function () { window.location.href = 'login.html'; } }); return; } Dashboard.alert({ message: Globalize.translate('MessageInvalidForgotPasswordPin'), title: Globalize.translate('HeaderPasswordReset') }); return; } return function (view, params) { function onSubmit(e) { ApiClient.ajax({ type: 'POST', url: ApiClient.getUrl('Users/ForgotPassword/Pin'), dataType: 'json', data: { Pin: view.querySelector('#txtPin').value } }).then(processForgotPasswordResult); e.preventDefault(); return false; } view.querySelector('form').addEventListener('submit', onSubmit); }; });
/* Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'toolbar', 'en', { toolbarCollapse: 'Collapse Toolbar', toolbarExpand: 'Expand Toolbar', toolbarGroups: { document: 'Document', clipboard: 'Clipboard/Undo', editing: 'Editing', forms: 'Forms', basicstyles: 'Basic Styles', paragraph: 'Paragraph', links: 'Links', insert: 'Insert', styles: 'Styles', colors: 'Colors', tools: 'Tools' }, toolbars: 'Editor toolbars' } );
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { Cordova, Plugin } from './plugin'; /** * @name Device Motion * @description * Requires Cordova plugin: `cordova-plugin-device-motion`. For more info, please see the [Device Motion docs](https://github.com/apache/cordova-plugin-device-motion). * * @usage * ```typescript * import { DeviceMotion } from 'ionic-native'; * * * // Get the device current acceleration * DeviceMotion.getCurrentAcceleration().then( * (acceleration: AccelerationData) => console.log(acceleration), * (error: any) => console.log(error) * ); * * // Watch device acceleration * var subscription = DeviceMotion.watchAcceleration().subscribe((acceleration: AccelerationData) => { * console.log(acceleration); * }); * * // Stop watch * subscription.unsubscribe(); * * ``` */ export var DeviceMotion = (function () { function DeviceMotion() { } /** * Get the current acceleration along the x, y, and z axes. * @returns {Promise<AccelerationData>} Returns object with x, y, z, and timestamp properties */ DeviceMotion.getCurrentAcceleration = function () { return; }; /** * Watch the device acceleration. Clear the watch by unsubscribing from the observable. * @param {AccelerometerOptions} options list of options for the accelerometer. * @returns {Observable<AccelerationData>} Observable returns an observable that you can subscribe to */ DeviceMotion.watchAcceleration = function (options) { return; }; __decorate([ Cordova() ], DeviceMotion, "getCurrentAcceleration", null); __decorate([ Cordova({ callbackOrder: 'reverse', observable: true, clearFunction: 'clearWatch' }) ], DeviceMotion, "watchAcceleration", null); DeviceMotion = __decorate([ Plugin({ pluginName: 'DeviceMotion', plugin: 'cordova-plugin-device-motion', pluginRef: 'navigator.accelerometer', repo: 'https://github.com/apache/cordova-plugin-device-motion' }) ], DeviceMotion); return DeviceMotion; }()); //# sourceMappingURL=devicemotion.js.map
(function () { // Get values from the substitution engine. // We can't just pull these from the document context // because this script is intended to be transcluded into // another document, and we want the GET values used to request it, // not the values for the including document // XXX these are unencoded, so there's an unavoidable // injection vulnerability in constructing this file... // need to upgrade the template engine. var reportField = "{{GET[reportField]}}"; var reportValue = "{{GET[reportValue]}}"; var reportExists = "{{GET[reportExists]}}"; var noCookies = "{{GET[noCookies]}}"; var reportCookieName = "{{GET[reportCookieName]}}" var testName = "{{GET[testName]}}" var cookiePresent = "{{GET[cookiePresent]}}" var reportCount = "{{GET[reportCount]}}" var location = window.location; if (reportCookieName == "") { // fallback on test file name if cookie name not specified reportCookieName = location.pathname.split('/')[location.pathname.split('/').length - 1].split('.')[0]; } var reportID = "{{GET[reportID]}}"; if (reportID == "") { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookieName = cookies[i].split('=')[0].trim(); var cookieValue = cookies[i].split('=')[1].trim(); if (cookieName == reportCookieName) { reportID = cookieValue; var cookieToDelete = cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=" + document.location.pathname.substring(0, document.location.pathname.lastIndexOf('/') + 1); document.cookie = cookieToDelete; break; } } } // There is no real way to test (in this particular layer) that a CSP report // has *not* been sent, at least not without some major reworks and // involvement from all the platform participants. So the current "solution" // is to wait for some reasonable amount of time and if no report has been // received to conclude that no report has been generated. These timeouts must // not exceed the test timeouts set by vendors otherwise the test would fail. var timeout = document.querySelector("meta[name=timeout][content=long]") ? 20 : 3; var reportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=retrieve_report&timeout=" + timeout + "&reportID=" + reportID; if (testName == "") testName = "Violation report status OK."; var reportTest = async_test(testName); function assert_field_value(field, value, field_name) { assert_true(field.indexOf(value.split(" ")[0]) != -1, field_name + " value of \"" + field + "\" did not match " + value.split(" ")[0] + "."); } reportTest.step(function () { var report = new XMLHttpRequest(); report.onload = reportTest.step_func(function () { var data = JSON.parse(report.responseText); if (data.error) { assert_equals("false", reportExists, data.error); } else { if(reportExists != "" && reportExists == "false" && data["csp-report"]) { assert_unreached("CSP report sent, but not expecting one: " + JSON.stringify(data["csp-report"])); } // Firefox expands 'self' or origins in a policy to the actual origin value // so "www.example.com" becomes "http://www.example.com:80". // Accomodate this by just testing that the correct directive name // is reported, not the details... if(data["csp-report"] != undefined && data["csp-report"][reportField] != undefined) { assert_field_value(data["csp-report"][reportField], reportValue, reportField); } else if (data[0] != undefined && data[0]["body"] != undefined && data[0]["body"][reportField] != undefined) { assert_field_value(data[0]["body"][reportField], reportValue, reportField); } else { assert_equals("", reportField, "Expected report field could not be found in report"); } } reportTest.done(); }); report.open("GET", reportLocation, true); report.send(); }); if (noCookies || cookiePresent) { var cookieTest = async_test("Test report cookies."); var cookieReport = new XMLHttpRequest(); cookieReport.onload = cookieTest.step_func(function () { var data = JSON.parse(cookieReport.responseText); if (noCookies) { assert_equals(data.reportCookies, "None", "Report should not contain any cookies"); } if (cookiePresent) { assert_true(data.reportCookies.hasOwnProperty(cookiePresent), "Report should contain cookie: " + cookiePresent); } cookieTest.done(); }); var cReportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=retrieve_cookies&timeout=" + timeout + "&reportID=" + reportID; cookieReport.open("GET", cReportLocation, true); cookieReport.send(); } if (reportCount != "") { var reportCountTest = async_test("Test number of sent reports."); var reportCountReport = new XMLHttpRequest(); reportCountReport.onload = reportCountTest.step_func(function () { var data = JSON.parse(reportCountReport.responseText); assert_equals(data.report_count, reportCount, "Report count was not what was expected."); reportCountTest.done(); }); var cReportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=retrieve_count&timeout=" + timeout + "&reportID=" + reportID; reportCountReport.open("GET", cReportLocation, true); reportCountReport.send(); } })();
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX-Web/Size1/Regular/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXMathJax_Size1 = { directory: "Size1/Regular", family: "STIXMathJax_Size1", testString: "\u00A0\u02C6\u02C7\u02DC\u02F7\u0302\u0303\u0305\u030C\u0330\u0332\u0338\u203E\u20D0\u20D1", 32: [0, 0, 250, 0, 0], 40: [1066, 164, 468, 139, 382], 41: [1066, 164, 468, 86, 329], 47: [1066, 164, 579, 25, 552], 91: [1066, 164, 383, 180, 363], 92: [1066, 164, 579, 27, 552], 93: [1066, 164, 383, 20, 203], 123: [1066, 164, 575, 114, 466], 125: [1066, 164, 575, 109, 461], 160: [0, 0, 250, 0, 0], 710: [767, -554, 560, 0, 560], 711: [767, -554, 560, 0, 560], 732: [750, -598, 558, -2, 558], 759: [-117, 269, 558, -2, 558], 770: [767, -554, 560, 0, 560], 771: [750, -598, 560, 0, 560], 773: [820, -770, 1000, 0, 1000], 780: [767, -554, 560, 0, 560], 816: [-117, 269, 560, 0, 560], 818: [-127, 177, 1000, 0, 1000], 824: [532, 21, 0, -720, -157], 8254: [820, -770, 1000, 0, 1000], 8400: [749, -584, 870, 0, 871], 8401: [749, -584, 871, 0, 871], 8406: [735, -482, 871, 0, 872], 8407: [736, -482, 871, 0, 872], 8428: [-123, 288, 871, 0, 871], 8429: [-123, 288, 871, 0, 871], 8430: [-26, 279, 871, 0, 872], 8431: [-25, 279, 871, 0, 872], 8512: [1500, -50, 1259, 55, 1204], 8719: [1500, -49, 1355, 50, 1305], 8720: [1500, -49, 1355, 50, 1305], 8721: [1499, -49, 1292, 90, 1202], 8730: [1552, 295, 1057, 112, 1089], 8731: [1552, 295, 1057, 112, 1089], 8732: [1552, 295, 1057, 112, 1089], 8747: [2000, 269, 585, 56, 1035], 8748: [2000, 269, 895, 56, 1345], 8749: [2000, 269, 1205, 56, 1655], 8750: [2000, 269, 635, 56, 1035], 8751: [2000, 269, 945, 56, 1345], 8752: [2000, 269, 1255, 56, 1655], 8753: [2000, 269, 635, 56, 1035], 8754: [2000, 269, 635, 56, 1035], 8755: [2000, 269, 635, 56, 1035], 8896: [1500, -49, 1265, 60, 1205], 8897: [1500, -49, 1265, 60, 1205], 8898: [1510, -49, 1265, 118, 1147], 8899: [1500, -39, 1265, 118, 1147], 8968: [1066, 164, 453, 180, 426], 8969: [1066, 164, 453, 25, 273], 8970: [1066, 164, 453, 180, 428], 8971: [1066, 164, 453, 27, 273], 9140: [766, -544, 1063, 69, 994], 9141: [139, 83, 1063, 68, 993], 9168: [676, 14, 200, 67, 133], 9180: [60, 153, 926, 0, 926], 9181: [777, -564, 926, 0, 926], 9182: [136, 89, 926, 0, 925], 9183: [789, -564, 926, 0, 925], 9184: [66, 212, 1460, 0, 1460], 9185: [842, -564, 1460, 0, 1460], 10098: [1066, 164, 566, 205, 539], 10099: [1066, 164, 566, 27, 361], 10214: [1066, 164, 515, 180, 486], 10215: [1066, 164, 515, 29, 335], 10216: [1066, 164, 578, 116, 462], 10217: [1066, 164, 578, 116, 462], 10218: [1066, 164, 798, 116, 670], 10219: [1066, 164, 798, 128, 682], 10627: [1066, 164, 712, 114, 587], 10628: [1066, 164, 712, 114, 587], 10629: [1066, 164, 632, 135, 546], 10630: [1066, 164, 632, 86, 497], 10744: [1566, 279, 806, 25, 781], 10745: [1566, 279, 806, 25, 781], 10752: [1500, -49, 1555, 52, 1503], 10753: [1500, -49, 1555, 52, 1503], 10754: [1500, -49, 1555, 52, 1503], 10755: [1500, -39, 1265, 118, 1147], 10756: [1500, -39, 1265, 118, 1147], 10757: [1500, -49, 1153, 82, 1071], 10758: [1500, -49, 1153, 82, 1071], 10759: [1500, -49, 1530, 60, 1470], 10760: [1500, -49, 1530, 60, 1470], 10761: [1500, -49, 1482, 60, 1422], 10762: [1500, -50, 1292, 90, 1202], 10763: [2000, 269, 914, 56, 1035], 10764: [2000, 269, 1515, 56, 1965], 10765: [2000, 269, 635, 56, 1035], 10766: [2000, 269, 635, 56, 1035], 10767: [2000, 269, 635, 56, 1035], 10768: [2000, 269, 635, 56, 1035], 10769: [2000, 269, 635, 56, 1035], 10770: [2000, 269, 735, 56, 1035], 10771: [2000, 269, 635, 56, 1035], 10772: [2000, 269, 844, 56, 1054], 10773: [2000, 269, 635, 56, 1035], 10774: [2000, 269, 735, 56, 1035], 10775: [2000, 269, 819, 24, 1039], 10776: [2000, 269, 635, 56, 1035], 10777: [2000, 269, 735, 56, 1035], 10778: [2000, 269, 735, 56, 1035], 10779: [2157, 269, 636, 56, 1036], 10780: [2000, 426, 585, 56, 1035], 11004: [867, 363, 690, 133, 557], 11007: [867, 363, 410, 100, 310] }; MathJax.Callback.Queue( ["initFont", MathJax.OutputJax["HTML-CSS"], "STIXMathJax_Size1"], ["loadComplete", MathJax.Ajax, MathJax.OutputJax["HTML-CSS"].fontDir + "/Size1/Regular/Main.js"] );
var APIInstall = ServiceCaller.extend( { key_name: 'Install', className: 'APIInstall', getLicense: function() { return this.argumentsHandler( this.className, 'getLicense', arguments ); }, getRequirements: function() { return this.argumentsHandler( this.className, 'getRequirements', arguments ); }, getDatabaseTypeArray: function() { return this.argumentsHandler( this.className, 'getDatabaseTypeArray', arguments ); }, getDatabaseConfig: function() { return this.argumentsHandler( this.className, 'getDatabaseConfig', arguments ); }, createDatabase: function() { return this.argumentsHandler( this.className, 'createDatabase', arguments ); }, getDatabaseSchema: function() { return this.argumentsHandler( this.className, 'getDatabaseSchema', arguments ); }, setDatabaseSchema: function() { return this.argumentsHandler( this.className, 'setDatabaseSchema', arguments ); }, postUpgrade: function() { return this.argumentsHandler( this.className, 'postUpgrade', arguments ); }, installDone: function() { return this.argumentsHandler( this.className, 'installDone', arguments ); }, getSystemSettings: function() { return this.argumentsHandler( this.className, 'getSystemSettings', arguments ); }, setSystemSettings: function() { return this.argumentsHandler( this.className, 'setSystemSettings', arguments ); }, getCompany: function() { return this.argumentsHandler( this.className, 'getCompany', arguments ); }, setCompany: function() { return this.argumentsHandler( this.className, 'setCompany', arguments ); }, getUser: function() { return this.argumentsHandler( this.className, 'getUser', arguments ); }, setUser: function() { return this.argumentsHandler( this.className, 'setUser', arguments ); }, getProvinceOptions: function() { return this.argumentsHandler( this.className, 'getProvinceOptions', arguments ); }, getMaintenanceJobs: function() { return this.argumentsHandler( this.className, 'getMaintenanceJobs', arguments ); }, testConnection: function() { return this.argumentsHandler( this.className, 'testConnection', arguments ); } } );
(function () { var oLoginViewModel, oSettingsViewModel ; AfterLogicApi.addPluginHook('view-model-defined', function (sViewModelName, oViewModel) { if (oViewModel && ('CLoginViewModel' === sViewModelName)) { oLoginViewModel = oViewModel; } if (oViewModel && ('CSettingsViewModel' === sViewModelName)) { oSettingsViewModel = oViewModel; if (!AfterLogicApi.getAppDataItem('User').CanLoginWithPassword) { oSettingsViewModel.getViewModel('two_factor_authentication').visible(false); } } }); AfterLogicApi.addPluginHook('api-mail-on-password-specified-success', function () { oSettingsViewModel.getViewModel('two_factor_authentication').visible(true); }); AfterLogicApi.addPluginHook('ajax-default-request', function (sAction, oParameters) { if (('SystemLogin' === sAction)) { this.oParams = oParameters; } }); AfterLogicApi.addPluginHook('ajax-default-response', function (sAction, oData) { if (('SystemLogin' === sAction && oData.Result != false && oData.ContinueAuth != true)) { oData['StopExecuteResponse'] = true; AfterLogicApi.showPopup(VerifyTokenPopup, [this.oParams.Email, oLoginViewModel]); } }); }());
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'blockquote', 'is', { toolbar: 'Inndráttur' } );
define( ({ _widgetLabel: "속성 테이블", ok: "확인", cancel: "취소", unsupportQueryWarning: "속성 테이블 위젯에 표시하려면 레이어가 쿼리 작업을 지원해야 합니다. 서비스에 쿼리 기능이 켜져 있는지 확인하세요.", exportMessage: "데이터를 CSV 파일로 내보내시겠습니까?", exportFiles: "CSV로 내보내기", exportSelected: "선택한 항목을 CSV로 내보내기", exportAll: "모든 항목을 CSV로 내보내기", options: "옵션", zoomto: "확대", highlight: "그래픽 강조", selectAll: "모든 페이지의 레코드 선택", selectPage: "현재 페이지의 레코드 선택", clearSelection: "선택 항목 지우기", filter: "필터", setFilterTip: "필터를 올바르게 설정하세요.", noFilterTip: "필터 식이 정의되지 않으면 이 쿼리 작업은 지정된 데이터 원본의 모든 피처를 나열합니다.", filterByExtent: "맵 범위로 필터링", showSelectedRecords: "선택한 레코드 표시", showAllRecords: "모든 레코드 보기", showRelatedRecords: "릴레이트된 레코드 표시", noRelatedRecords: "릴레이트된 레코드 없음", refresh: "새로고침", features: "피처", selected: "선택함", transparent: "투명 모드", indicate: "선택 항목 찾기", columns: "열 표시/숨기기", selectionSymbol: "선택 심볼", closeMessage: "테이블 숨기기(하단에서 다시 확장)", dataNotAvailable: "데이터를 사용할 수 없습니다.<br>[새로 고침] 버튼을 클릭하여 다시 시도하세요.", openTableTip: "속성 테이블 열기", closeTableTip: "속성 테이블 숨기기" }) );
var hotspots = (function () { var exports = {}; exports.show = function (hotspot_list) { $('.hotspot').hide(); for (var i = 0; i < hotspot_list.length; i += 1) { $("#hotspot_".concat(hotspot_list[i])).show(); } }; exports.initialize = function () { exports.show(page_params.hotspots); }; function mark_hotspot_as_read(hotspot) { channel.post({ url: '/json/users/me/hotspots', data: {hotspot: JSON.stringify(hotspot)}, }); } $(function () { $("#hotspot_welcome").on('click', function (e) { mark_hotspot_as_read("welcome"); e.preventDefault(); e.stopPropagation(); }); $("#hotspot_streams").on('click', function (e) { mark_hotspot_as_read("streams"); e.preventDefault(); e.stopPropagation(); }); $("#hotspot_topics").on('click', function (e) { mark_hotspot_as_read("topics"); e.preventDefault(); e.stopPropagation(); }); $("#hotspot_narrowing").on('click', function (e) { mark_hotspot_as_read("narrowing"); e.preventDefault(); e.stopPropagation(); }); $("#hotspot_replying").on('click', function (e) { mark_hotspot_as_read("replying"); e.preventDefault(); e.stopPropagation(); }); $("#hotspot_get_started").on('click', function (e) { mark_hotspot_as_read("get_started"); e.preventDefault(); e.stopPropagation(); }); }); return exports; }()); if (typeof module !== 'undefined') { module.exports = hotspots; }
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-195.js * @description Object.defineProperty - 'writable' property in 'Attributes' is the Math object (8.10.5 step 6.b) */ function testcase() { var obj = {}; Object.defineProperty(obj, "property", { writable: Math }); var beforeWrite = obj.hasOwnProperty("property"); obj.property = "isWritable"; var afterWrite = (obj.property === "isWritable"); return beforeWrite === true && afterWrite === true; } runTestCase(testcase);
/** * Visual Blocks Editor * * Copyright 2012 Google Inc. * http://blockly.googlecode.com/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Colour blocks for Blockly. * @author fraser@google.com (Neil Fraser) */ 'use strict'; goog.provide('Blockly.Blocks.colour'); goog.require('Blockly.Blocks'); Blockly.Blocks['colour_picker'] = { // Colour picker. init: function() { this.setHelpUrl(Blockly.Msg.COLOUR_PICKER_HELPURL); this.setColour(20); this.appendDummyInput() .appendField(new Blockly.FieldColour('#ff0000'), 'COLOUR'); this.setOutput(true, 'Colour'); this.setTooltip(Blockly.Msg.COLOUR_PICKER_TOOLTIP); } }; Blockly.Blocks['colour_random'] = { // Random colour. init: function() { this.setHelpUrl(Blockly.Msg.COLOUR_RANDOM_HELPURL); this.setColour(20); this.appendDummyInput() .appendField(Blockly.Msg.COLOUR_RANDOM_TITLE); this.setOutput(true, 'Colour'); this.setTooltip(Blockly.Msg.COLOUR_RANDOM_TOOLTIP); } }; Blockly.Blocks['colour_rgb'] = { // Compose a colour from RGB components. init: function() { this.setHelpUrl(Blockly.Msg.COLOUR_RGB_HELPURL); this.setColour(20); this.appendValueInput('RED') .setCheck('Number') .setAlign(Blockly.ALIGN_RIGHT) .appendField(Blockly.Msg.COLOUR_RGB_TITLE) .appendField(Blockly.Msg.COLOUR_RGB_RED); this.appendValueInput('GREEN') .setCheck('Number') .setAlign(Blockly.ALIGN_RIGHT) .appendField(Blockly.Msg.COLOUR_RGB_GREEN); this.appendValueInput('BLUE') .setCheck('Number') .setAlign(Blockly.ALIGN_RIGHT) .appendField(Blockly.Msg.COLOUR_RGB_BLUE); this.setOutput(true, 'Colour'); this.setTooltip(Blockly.Msg.COLOUR_RGB_TOOLTIP); } }; Blockly.Blocks['colour_blend'] = { // Blend two colours together. init: function() { this.setHelpUrl(Blockly.Msg.COLOUR_BLEND_HELPURL); this.setColour(20); this.appendValueInput('COLOUR1') .setCheck('Colour') .setAlign(Blockly.ALIGN_RIGHT) .appendField(Blockly.Msg.COLOUR_BLEND_TITLE) .appendField(Blockly.Msg.COLOUR_BLEND_COLOUR1); this.appendValueInput('COLOUR2') .setCheck('Colour') .setAlign(Blockly.ALIGN_RIGHT) .appendField(Blockly.Msg.COLOUR_BLEND_COLOUR2); this.appendValueInput('RATIO') .setCheck('Number') .setAlign(Blockly.ALIGN_RIGHT) .appendField(Blockly.Msg.COLOUR_BLEND_RATIO); this.setOutput(true, 'Colour'); this.setTooltip(Blockly.Msg.COLOUR_BLEND_TOOLTIP); } };
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-141-1.js * @description Object.defineProperty - 'Attributes' is a String object that uses Object's [[Get]] method to access the 'value' property of prototype object (8.10.5 step 5.a) */ function testcase() { var obj = {}; try { String.prototype.value = "String"; var strObj = new String("abc"); Object.defineProperty(obj, "property", strObj); return obj.property === "String"; } finally { delete String.prototype.value; } } runTestCase(testcase);
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: let P be the empty string if pattern is undefined es5id: 15.10.4.1_A3_T2 description: RegExp is new RegExp(void 0) ---*/ var __re = new RegExp(void 0); //CHECK#2 if (__re.multiline !== false) { $ERROR('#2: __re = new RegExp(void 0); __re.multiline === false. Actual: ' + (__re.multiline)); } //CHECK#3 if (__re.global !== false) { $ERROR('#3: __re = new RegExp(void 0); __re.global === false. Actual: ' + (__re.global)); } //CHECK#4 if (__re.ignoreCase !== false) { $ERROR('#4: __re = new RegExp(void 0); __re.ignoreCase === false. Actual: ' + (__re.ignoreCase)); }
/** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule RelayDefaultNetworkLayer * @typechecks * @flow */ 'use strict'; import type RelayMutationRequest from 'RelayMutationRequest'; import type RelayQueryRequest from 'RelayQueryRequest'; const fetch = require('fetch'); const fetchWithRetries = require('fetchWithRetries'); import type {InitWithRetries} from 'fetchWithRetries'; type GraphQLError = { message: string; locations: Array<GraphQLErrorLocation>; }; type GraphQLErrorLocation = { column: number; line: number; }; class RelayDefaultNetworkLayer { _uri: string; _init: $FlowIssue; // InitWithRetries constructor(uri: string, init?: ?InitWithRetries) { this._uri = uri; this._init = {...init}; // Bind instance methods to facilitate reuse when creating custom network // layers. var self: any = this; self.sendMutation = this.sendMutation.bind(this); self.sendQueries = this.sendQueries.bind(this); self.supports = this.supports.bind(this); } sendMutation(request: RelayMutationRequest): Promise { return this._sendMutation(request).then( result => result.json() ).then(payload => { if (payload.hasOwnProperty('errors')) { var error = new Error( 'Server request for mutation `' + request.getDebugName() + '` ' + 'failed for the following reasons:\n\n' + formatRequestErrors(request, payload.errors) ); (error: any).source = payload; request.reject(error); } else { request.resolve({response: payload.data}); } }).catch( error => request.reject(error) ); } sendQueries(requests: Array<RelayQueryRequest>): Promise { return Promise.all(requests.map(request => ( this._sendQuery(request).then( result => result.json() ).then(payload => { if (payload.hasOwnProperty('errors')) { var error = new Error( 'Server request for query `' + request.getDebugName() + '` ' + 'failed for the following reasons:\n\n' + formatRequestErrors(request, payload.errors) ); (error: any).source = payload; request.reject(error); } else if (!payload.hasOwnProperty('data')) { request.reject(new Error( 'Server response was missing for query `' + request.getDebugName() + '`.' )); } else { request.resolve({response: payload.data}); } }).catch( error => request.reject(error) ) ))); } supports(...options: Array<string>): boolean { // Does not support the only defined option, "defer". return false; } /** * Sends a POST request with optional files. */ _sendMutation(request: RelayMutationRequest): Promise { var init; var files = request.getFiles(); if (files) { if (!global.FormData) { throw new Error('Uploading files without `FormData` not supported.'); } var formData = new FormData(); formData.append('query', request.getQueryString()); formData.append('variables', JSON.stringify(request.getVariables())); for (var filename in files) { if (files.hasOwnProperty(filename)) { formData.append(filename, files[filename]); } } init = { ...this._init, body: formData, method: 'POST', }; } else { init = { ...this._init, body: JSON.stringify({ query: request.getQueryString(), variables: request.getVariables(), }), headers: { ...this._init.headers, 'Accept': '*/*', 'Content-Type': 'application/json', }, method: 'POST', }; } return fetch(this._uri, init).then(throwOnServerError); } /** * Sends a POST request and retries if the request fails or times out. */ _sendQuery(request: RelayQueryRequest): Promise { return fetchWithRetries(this._uri, { ...this._init, body: JSON.stringify({ query: request.getQueryString(), variables: request.getVariables(), }), headers: { ...this._init.headers, 'Accept': '*/*', 'Content-Type': 'application/json', }, method: 'POST', }); } } /** * Rejects HTTP responses with a status code that is not >= 200 and < 300. * This is done to follow the internal behavior of `fetchWithRetries`. */ function throwOnServerError(response: any): any { if (response.status >= 200 && response.status < 300) { return response; } else { throw response; } } /** * Formats an error response from GraphQL server request. */ function formatRequestErrors( request: RelayMutationRequest | RelayQueryRequest, errors: Array<GraphQLError> ): string { var CONTEXT_BEFORE = 20; var CONTEXT_LENGTH = 60; var queryLines = request.getQueryString().split('\n'); return errors.map(({locations, message}, ii) => { var prefix = (ii + 1) + '. '; var indent = ' '.repeat(prefix.length); //custom errors thrown in graphql-server may not have locations var locationMessage = locations ? ('\n' + locations.map(({column, line}) => { var queryLine = queryLines[line - 1]; var offset = Math.min(column - 1, CONTEXT_BEFORE); return [ queryLine.substr(column - 1 - offset, CONTEXT_LENGTH), ' '.repeat(offset) + '^^^', ].map(messageLine => indent + messageLine).join('\n'); }).join('\n')) : ''; return prefix + message + locationMessage; }).join('\n'); } module.exports = RelayDefaultNetworkLayer;
vde.App.controller('DataCtrl', function($scope, $rootScope, $http, timeline, Vis, vg, d3) { $scope.dMdl = { src: {}, formats: ['json', 'csv', 'tsv'], parsings: ['string', 'number', 'boolean', 'date'] }; $scope.finishedLoading = function() { var src = $scope.dMdl.src; src.format.parse = {}; if(vg.isArray(src.values)) { for(var k in src.values[0]) src.format.parse[k] = vg.isNumber(src.values[0][k]) ? 'number' : 'string'; } $scope.dMdl.isLoading = false; $scope.dMdl.hasLoaded = true; $scope.dMdl.isObj = !vg.isArray(src.values); $scope.dMdl.properties = vg.keys(src.values); }; $scope.loadValues = function() { var src = $scope.dMdl.src, req = vg.duplicate(src); if($scope.dMdl.from == 'url') { req.url = 'proxy.php?url=' + encodeURIComponent(req.url); $scope.dMdl.isLoading = true; var dataModel = vg.parse.data([req], function() { $scope.$apply(function() { src.values = dataModel.load[src.name]; $scope.finishedLoading(); }); }); } else { var type = $scope.dMdl.src.format.type; if(type == 'json') { $scope.dMdl.src.values = JSON.parse($scope.dMdl.values); $scope.finishedLoading(); } else { $scope.dMdl.src.values = d3[type].parse($scope.dMdl.values); $scope.finishedLoading(); } } }; $scope.add = function() { var src = $scope.dMdl.src; for(var p in src.format.parse) if(src.format.parse[p] == 'string') delete src.format.parse[p]; Vis._data[src.name] = vg.duplicate(src); delete Vis._data[src.name].$$hashKey; // AngularJS pollution $rootScope.activePipeline.source = src.name; $scope.dMdl.src = {}; $rootScope.newData = false; timeline.save(); }; $scope.cancel = function() { $rootScope.newData = false; $scope.dMdl.src = {}; $scope.dMdl.isLoading = false; $scope.dMdl.hasLoaded = false; }; });
// Generated by CoffeeScript 1.9.3 var Block, Layout, SpecialString, fn, i, len, object, prop, ref, terminalWidth; Block = require('./layout/Block'); object = require('utila').object; SpecialString = require('./layout/SpecialString'); terminalWidth = require('./tools').getCols(); module.exports = Layout = (function() { var self; self = Layout; Layout._rootBlockDefaultConfig = { linePrependor: { options: { amount: 0 } }, lineAppendor: { options: { amount: 0 } }, blockPrependor: { options: { amount: 0 } }, blockAppendor: { options: { amount: 0 } } }; Layout._defaultConfig = { terminalWidth: terminalWidth }; function Layout(config, rootBlockConfig) { var rootConfig; if (config == null) { config = {}; } if (rootBlockConfig == null) { rootBlockConfig = {}; } this._written = []; this._activeBlock = null; this._config = object.append(self._defaultConfig, config); rootConfig = object.append(self._rootBlockDefaultConfig, rootBlockConfig); this._root = new Block(this, null, rootConfig, '__root'); this._root._open(); } Layout.prototype.getRootBlock = function() { return this._root; }; Layout.prototype._append = function(text) { return this._written.push(text); }; Layout.prototype._appendLine = function(text) { var s; this._append(text); s = SpecialString(text); if (s.length < this._config.terminalWidth) { this._append('<none>\n</none>'); } return this; }; Layout.prototype.get = function() { this._ensureClosed(); if (this._written[this._written.length - 1] === '<none>\n</none>') { this._written.pop(); } return this._written.join(""); }; Layout.prototype._ensureClosed = function() { if (this._activeBlock !== this._root) { throw Error("Not all the blocks have been closed. Please call block.close() on all open blocks."); } if (this._root.isOpen()) { this._root.close(); } }; return Layout; })(); ref = ['openBlock', 'write']; fn = function() { var method; method = prop; return Layout.prototype[method] = function() { return this._root[method].apply(this._root, arguments); }; }; for (i = 0, len = ref.length; i < len; i++) { prop = ref[i]; fn(); }
; (function() { var app = angular.module('dashboardApp', [ 'ngRoute', 'dashboard' ]); var dashboard = angular.module('dashboard', []); dashboard.run(function($rootScope, invocationUtils, stringUtils, api, urls) { $rootScope.invocationUtils = invocationUtils; $rootScope.stringUtils = stringUtils; $rootScope._api = api; $rootScope._urls = urls; }); // this is a basis for some perf improvements // for things that only needs to bind, well, once. app.directive('bindOnce', function () { return { scope: true, link: function($scope, $element) { setTimeout(function () { $scope.$destroy(); $element.removeClass('ng-binding ng-scope'); }, 0); } }; }); dashboard.factory('$exceptionHandler', function() { return function(exception, cause) { exception.message += ' (caused by "' + cause + '")'; console.log(["CATCH", exception, cause]); throw exception; }; }); app.config(['$routeProvider', function ($routeProvider) { var defaultHomePage = '/jobs'; //or /functions if not in Azure Web Sites $routeProvider. when('/', { redirectTo: defaultHomePage }). when('/jobs', { templateUrl: 'app/views/JobsList.html', controller: 'JobsListController' }). when('/jobs/triggered/:jobName', { templateUrl: 'app/views/TriggeredJob.html', controller: 'TriggeredJobController' }). when('/jobs/continuous/:jobName', { templateUrl: 'app/views/ContinuousJob.html', controller: 'ContinuousJobController' }). when('/jobs/triggered/:jobName/runs/:runId', { templateUrl: 'app/views/TriggeredJobRun.html', controller: 'TriggeredJobRunController' }). when('/functions', { templateUrl: 'app/views/FunctionsHome.html', controller: 'FunctionsHomeController' }). when('/functions/definitions/:functionId', { templateUrl: 'app/views/Function.html', controller: 'FunctionController' }). when('/functions/invocations/:invocationId', { templateUrl: 'app/views/FunctionInvocation.html', controller: 'FunctionInvocationController' }). when('/about', { templateUrl: 'app/views/AboutHome.html', controller: 'AboutController' }). when('/diagnostics/indexerLogEntry/:entryId', { templateUrl: 'app/views/IndexerLogEntry.html', controller: 'IndexerLogEntryController' }). otherwise({ redirectTo: '/' }); }]); // simple paging support app.filter('startFrom', function() { return function(input, start) { start = +start; // ensure int return input.slice(start); }; }); app.run(function ($rootScope) { // Initialize errors / warnings $rootScope.errors = []; $rootScope.warnings = []; }); })();
/** * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> * Build: `lodash modularize exports="amd" -o ./compat/` * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <http://lodash.com/license> */ define(['../internals/baseIndexOf', './sortedIndex'], function(baseIndexOf, sortedIndex) { /* Native method shortcuts for methods with the same name as other `lodash` methods */ var nativeMax = Math.max; /** * Gets the index at which the first occurrence of `value` is found using * strict equality for comparisons, i.e. `===`. If the array is already sorted * providing `true` for `fromIndex` will run a faster binary search. * * @static * @memberOf _ * @category Arrays * @param {Array} array The array to search. * @param {*} value The value to search for. * @param {boolean|number} [fromIndex=0] The index to search from or `true` * to perform a binary search on a sorted array. * @returns {number} Returns the index of the matched value or `-1`. * @example * * _.indexOf([1, 2, 3, 1, 2, 3], 2); * // => 1 * * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); * // => 4 * * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); * // => 2 */ function indexOf(array, value, fromIndex) { if (typeof fromIndex == 'number') { var length = array ? array.length : 0; fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); } else if (fromIndex) { var index = sortedIndex(array, value); return array[index] === value ? index : -1; } return baseIndexOf(array, value, fromIndex); } return indexOf; });
version https://git-lfs.github.com/spec/v1 oid sha256:44bac44ffbed21920407278ce3bc7678e40959a50ea1544d0cb61289445b900e size 3181
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ module.exports = { id: 'windows', bootstrap:function() { var cordova = require('cordova'), exec = require('cordova/exec'), channel = cordova.require('cordova/channel'), modulemapper = require('cordova/modulemapper'); modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy'); channel.onNativeReady.fire(); var onWinJSReady = function () { var app = WinJS.Application; var checkpointHandler = function checkpointHandler() { cordova.fireDocumentEvent('pause',null,true); }; var resumingHandler = function resumingHandler() { cordova.fireDocumentEvent('resume',null,true); }; app.addEventListener("checkpoint", checkpointHandler); Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false); app.start(); }; if (!window.WinJS) { var scriptElem = document.createElement("script"); if (navigator.appVersion.indexOf('MSAppHost/3.0') !== -1) { // Windows 10 UWP scriptElem.src = '/WinJS/js/base.js'; } else if (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1) { // windows phone 8.1 + Mobile IE 11 scriptElem.src = "//Microsoft.Phone.WinJS.2.1/js/base.js"; } else if (navigator.appVersion.indexOf("MSAppHost/2.0;") !== -1) { // windows 8.1 + IE 11 scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js"; } scriptElem.addEventListener("load", onWinJSReady); document.head.appendChild(scriptElem); } else { onWinJSReady(); } } };
describe('zoom normal animation', function() { var prefixes = { '-webkit-transform': true, '-moz-transform': true, '-o-transform': true, 'transform': true }; var transform; beforeEach(module('ngAnimate')); beforeEach(module('ngAnimateMock')); beforeEach(module('fx.animations')); it("should zoom-normal in", function(done) { inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) { var element = $compile('<div class="fx-zoom-normal">zoom-normal</div>')($rootScope); $rootElement.append(element); angular.element($document[0].body).append($rootElement); $rootScope.$digest(); $animate.enabled(true); $animate.enter(element, $rootElement); $rootScope.$digest(); $timeout.flush(); $window.setTimeout(function(){ angular.forEach(prefixes, function(bool, prefix){ if(element.css(prefix)){ transform = prefix; } }); expect(element.css('opacity')).to.be('1'); expect(element.css(transform)).to.be('matrix(1, 0, 0, 1, 0, 0)'); done(); },500); }); }); it('should zoom-normal out', function(done){ inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) { var element = $compile('<div class="fx-zoom-normal">zoom-normal</div>')($rootScope); $rootElement.append(element); angular.element($document[0].body).append($rootElement); $rootScope.$digest(); $animate.enabled(true); $animate.leave(element); $rootScope.$digest(); $timeout.flush(); $window.setTimeout(function(){ expect(element.css('opacity')).to.be('0'); done(); },500); }); }); it('should zoom-normal move', function(done){ inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) { var element = $compile('<div class="fx-zoom-normal">zoom-normal</div>')($rootScope); $rootElement.append(element); angular.element($document[0].body).append($rootElement); $rootScope.$digest(); $animate.enabled(true); $animate.move(element, $rootElement); $rootScope.$digest(); $timeout.flush(); $window.setTimeout(function(){ angular.forEach(prefixes, function(bool, prefix){ if(element.css(prefix)){ transform = prefix; } }); expect(element.css('opacity')).to.be('1'); expect(element.css(transform)).to.be('matrix(1, 0, 0, 1, 0, 0)'); done(); },500); }); }); xit('should zoom-normal removeClass', function(done){ inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) { var element = $compile('<div class="fx-zoom-normal ng-hide">zoom-normal</div>')($rootScope); $rootElement.append(element); angular.element($document[0].body).append($rootElement); $rootScope.$digest(); $animate.enabled(true); $animate.removeClass(element, 'ng-hide'); $rootScope.$digest(); $window.setTimeout(function(){ angular.forEach(prefixes, function(bool, prefix){ if(element.css(prefix)){ transform = prefix; } }); expect(element.css('opacity')).to.be('1'); expect(element.css(transform)).to.be('matrix(1, 0, 0, 1, 0, 0)'); done(); },500); }); }); xit('should zoom-normal addClass', function(done){ inject(function($animate, $compile, $document, $rootScope, $rootElement, $window, $timeout) { var element = $compile('<div class="fx-zoom-normal">zoom-normal</div>')($rootScope); $rootElement.append(element); angular.element($document[0].body).append($rootElement); $rootScope.$digest(); $animate.enabled(true); $animate.addClass(element, 'ng-hide'); $rootScope.$digest(); $window.setTimeout(function(){ expect(element.css('opacity')).to.be('0'); done(); },500); }); }); });
/** * Original shader from http://glsl.heroku.com/e#4122.10 * Tweaked, uniforms added and converted to Phaser/PIXI by Richard Davey */ Phaser.Filter.LightBeam = function (game) { Phaser.Filter.call(this, game); this.uniforms.alpha = { type: '1f', value: 1 }; this.uniforms.thickness = { type: '1f', value: 70.0 }; this.uniforms.speed = { type: '1f', value: 1.0 }; this.uniforms.red = { type: '1f', value: 2.0 }; this.uniforms.green = { type: '1f', value: 1.0 }; this.uniforms.blue = { type: '1f', value: 1.0 }; this.fragmentSrc = [ "precision mediump float;", "uniform vec2 resolution;", "uniform float time;", "uniform float alpha;", "uniform float thickness;", "uniform float speed;", "uniform float red;", "uniform float green;", "uniform float blue;", "void main(void) {", "vec2 uPos = (gl_FragCoord.xy / resolution.xy);", "uPos.y -= 0.50;", "float vertColor = 0.0;", "for (float i = 0.0; i < 1.0; i++)", "{", "float t = time * (i + speed);", "uPos.y += sin(uPos.x + t) * 0.2;", "float fTemp = abs(1.0 / uPos.y / thickness);", "vertColor += fTemp;", "}", "vec4 color = vec4(vertColor * red, vertColor * green, vertColor * blue, alpha);", "gl_FragColor = color;", "}" ]; }; Phaser.Filter.LightBeam.prototype = Object.create(Phaser.Filter.prototype); Phaser.Filter.LightBeam.prototype.constructor = Phaser.Filter.LightBeam; Phaser.Filter.LightBeam.prototype.init = function (width, height) { this.setResolution(width, height); }; Object.defineProperty(Phaser.Filter.LightBeam.prototype, 'alpha', { get: function() { return this.uniforms.alpha.value; }, set: function(value) { this.uniforms.alpha.value = value; } }); Object.defineProperty(Phaser.Filter.LightBeam.prototype, 'red', { get: function() { return this.uniforms.red.value; }, set: function(value) { this.uniforms.red.value = value; } }); Object.defineProperty(Phaser.Filter.LightBeam.prototype, 'green', { get: function() { return this.uniforms.green.value; }, set: function(value) { this.uniforms.green.value = value; } }); Object.defineProperty(Phaser.Filter.LightBeam.prototype, 'blue', { get: function() { return this.uniforms.blue.value; }, set: function(value) { this.uniforms.blue.value = value; } }); Object.defineProperty(Phaser.Filter.LightBeam.prototype, 'thickness', { get: function() { return this.uniforms.thickness.value; }, set: function(value) { this.uniforms.thickness.value = value; } }); Object.defineProperty(Phaser.Filter.LightBeam.prototype, 'speed', { get: function() { return this.uniforms.speed.value; }, set: function(value) { this.uniforms.speed.value = value; } });
/** @ngdoc directive @name umbraco.directives.directive:umbIcon @restrict E @scope @description Use this directive to show an render an umbraco backoffice svg icon. All svg icons used by this directive should use the following naming convention to keep things consistent: icon-[name of icon]. For example <pre>icon-alert.svg</pre> <h3>Markup example</h3> Simple icon <pre> <umb-icon icon="icon-alert"></umb-icon> </pre> Icon with additional attribute. It can be treated like any other dom element <pre> <umb-icon icon="icon-alert" class="another-class"></umb-icon> </pre> @example **/ (function () { "use strict"; function UmbIconDirective(iconHelper) { var directive = { replace: true, transclude: true, templateUrl: "views/components/umb-icon.html", scope: { icon: "@", svgString: "=?" }, link: function (scope, element) { if (scope.svgString === undefined && scope.svgString !== null && scope.icon !== undefined && scope.icon !== null) { const observer = new IntersectionObserver(_lazyRequestIcon, {rootMargin: "100px"}); const iconEl = element[0]; observer.observe(iconEl); // make sure to disconnect the observer when the scope is destroyed scope.$on('$destroy', function () { observer.disconnect(); }); } scope.$watch("icon", function (newValue, oldValue) { if (newValue && oldValue) { var newicon = newValue.split(" ")[0]; var oldicon = oldValue.split(" ")[0]; if (newicon !== oldicon) { _requestIcon(newicon); } } }); function _lazyRequestIcon(entries, observer) { entries.forEach(entry => { if (entry.isIntersecting === true) { observer.disconnect(); var icon = scope.icon.split(" ")[0]; // Ensure that only the first part of the icon is used as sometimes the color is added too, e.g. see umbeditorheader.directive scope.openIconPicker _requestIcon(icon); } }); } function _requestIcon(icon) { // Reset svg string before requesting new icon. scope.svgString = null; iconHelper.getIcon(icon) .then(data => { if (data && data.svgString) { // Watch source SVG string scope.svgString = data.svgString; } }); } } }; return directive; } angular.module("umbraco.directives").directive("umbIcon", UmbIconDirective); })();
function ProductoUtil() { var URL_BASE = "/productos"; this.agregar = function(p, callback) { $.ajax(URL_BASE, { type: "post", data: JSON.stringify(p), contentType: "application/json" }).done(callback) .fail(function() { window.alert("Error al agregar"); }); }; this.modificar = function(p, callback) { $.ajax(URL_BASE + "/" + p.id, { type: "put", data: JSON.stringify(p), contentType: "application/json" }).done(callback) }; this.eliminar = function(id, callback) { $.ajax(URL_BASE + "/" + id, { type: "delete" }).done(callback); }; this.obtener = function(id, callback) { $.ajax(URL_BASE + "/" + id, { type: "get", dataType: "json" }).done(callback); }; this.obtenerTodos = function(callback) { $.ajax(URL_BASE, { type: "get", dataType: "json" }).done(function(respuesta) { callback(respuesta); }); }; }
'use strict'; var _ = require('lodash'); var Request = function(opts) { opts = opts || {}; this.method = opts.method || this.ANY; this.url = opts.url || this.ANY; this.auth = opts.auth || this.ANY; this.params = opts.params || this.ANY; this.data = opts.data || this.ANY; this.headers = opts.headers || this.ANY; }; Request.prototype.ANY = '*'; Request.prototype.attributeEqual = function(lhs, rhs) { if (lhs === this.ANY || rhs === this.ANY) { return true; } lhs = lhs || undefined; rhs = rhs || undefined; return _.isEqual(lhs, rhs); }; Request.prototype.isEqual = function(other) { return (this.attributeEqual(this.method, other.method) && this.attributeEqual(this.url, other.url) && this.attributeEqual(this.auth, other.auth) && this.attributeEqual(this.params, other.params) && this.attributeEqual(this.data, other.data) && this.attributeEqual(this.headers, other.headers)); }; Request.prototype.toString = function() { var auth = ''; if (this.auth && this.auth !== this.ANY) { auth = this.auth + ' '; } var params = ''; if (this.params && this.params !== this.ANY) { params = '?' + _.join(_.chain(_.keys(this.params)) .map(function(key) { return key + '=' + this.params[key]; }.bind(this)) .value(), '&'); } var data = ''; if (this.data && this.data !== this.ANY) { if (this.method === 'GET') { data = '\n -G'; } data = data + '\n' + _.join( _.map(this.data, function(value, key) { return ' -d ' + key + '=' + value; }), '\n'); } var headers = ''; if (this.headers && this.headers !== this.ANY) { headers = '\n' + _.join( _.map(this.headers, function(value, key) { return ' -H ' + key + '=' + value; }), '\n'); } return auth + this.method + ' ' + this.url + params + data + headers; }; module.exports = Request;
/* globals describe, beforeEach, $fixture, qq, assert, it, qqtest, helpme, purl */ if (qq.supportedFeatures.imagePreviews && qqtest.canDownloadFileAsBlob) { describe("identify.js", function() { "use strict"; function testPreviewability(expectedToBePreviewable, key, expectedMime, done) { qqtest.downloadFileAsBlob(key, expectedMime).then(function(blob) { new qq.Identify(blob, function() {}).isPreviewable().then(function(mime) { !expectedToBePreviewable && assert.fail(); assert.equal(mime, expectedMime); done(); }, function() { expectedToBePreviewable && assert.fail(); assert.ok(true); done(); }); }, function() { assert.fail("Problem downloading test file"); }); } it("classifies gif as previewable", function(done) { testPreviewability(true, "drop-background.gif", "image/gif", done); }); it("classifies jpeg as previewable", function(done) { testPreviewability(true, "fearless.jpeg", "image/jpeg", done); }); it("classifies bmp as previewable", function(done) { testPreviewability(true, "g04.bmp", "image/bmp", done); }); it("classifies png as previewable", function(done) { testPreviewability(true, "not-available_l.png", "image/png", done); }); it("classifies tiff as previewable", function(done) { testPreviewability(qq.supportedFeatures.tiffPreviews, "sample.tif", "image/tiff", done); }); it("marks a non-image as not previewable", function(done) { testPreviewability(false, "simpletext.txt", null, done); }); }); }
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and /// the following disclaimer in the documentation and/or other materials provided with the distribution. /// * Neither the name of Microsoft nor the names of its contributors may be used to /// endorse or promote products derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR /// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS /// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT /// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS /// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ES5Harness.registerTest({ id: "15.4.4.15-5-20", path: "TestCases/chapter15/15.4/15.4.4/15.4.4.15/15.4.4.15-5-20.js", description: "Array.prototype.lastIndexOf when value of 'fromIndex' which is a string containing a number with leading zeros", test: function testcase() { var targetObj = {}; return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10") === 2 && [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10") === -1; }, precondition: function prereq() { return fnExists(Array.prototype.lastIndexOf); } });
/* Copyright JS Foundation and other contributors, http://js.foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // tests for ECMA-262 v6 12.4.3 var tests = [ // IdentifierReference 'var obj = {a : 10, ret : function(params) {return a++ = 42;}}', 'var obj = {a : 10, ret : function(params) {return a-- = 42;}}', // NullLiteral 'var a = null; a++ = 42', 'var a = null; a-- = 42', // BooleanLiteral 'var a = true; a++ = 42', 'var a = false; a++ = 42', 'var a = true; a-- = 42', 'var a = false; a-- = 42', // DecimalLiteral 'var a = 5; a++ = 42', 'var a = 1.23e4; a++ = 42', 'var a = 5; a-- = 42', 'var a = 1.23e4; a-- = 42', // BinaryIntegerLiteral 'var a = 0b11; a++ = 42', 'var a = 0B11; a++ = 42', 'var a = 0b11; a-- = 42', 'var a = 0B11; a-- = 42', // OctalIntegerLiteral 'var a = 0o66; a++ = 42', 'var a = 0O66; a++ = 42', 'var a = 0o66; a-- = 42', 'var a = 0O66; a-- = 42', // HexIntegerLiteral 'var a = 0xFF; a++ = 42', 'var a = 0xFF; a++ = 42', 'var a = 0xFF; a-- = 42', 'var a = 0xFF; a-- = 42', // StringLiteral 'var a = "foo"; a++ = 42', 'var a = "\\n"; a++ = 42', 'var a = "\\uFFFF"; a++ = 42', 'var a ="\\u{F}"; a++ = 42', 'var a = "foo"; a-- = 42', 'var a = "\\n"; a-- = 42', 'var a = "\\uFFFF"; a-- = 42', 'var a ="\\u{F}"; a-- = 42', // ArrayLiteral 'var a = []; a++ = 42', 'var a = [1,a=5]; a++ = 42', 'var a = []; a-- = 42', 'var a = [1,a=5]; a-- = 42', // ObjectLiteral 'var a = {}; a++ = 42', 'var a = {"foo" : 5}; a++ = 42', 'var a = {5 : 5}; a++ = 42', 'var a = {a : 5}; a++ = 42', 'var a = {[key] : 5}; a++ = 42', 'var a = {func(){}}; a++ = 42', 'var a = {get(){}}; a++ = 42', 'var a = {set(prop){}}; a++ = 42', 'var a = {*func(){}}; a++ = 42', 'var a = {}; a-- = 42', 'var a = {"foo" : 5}; a-- = 42', 'var a = {5 : 5}; a-- = 42', 'var a = {a : 5}; a-- = 42', 'var a = {[key] : 5}; a-- = 42', 'var a = {func(){}}; a-- = 42', 'var a = {get(){}}; a-- = 42', 'var a = {set(prop){}}; a-- = 42', 'var a = {*func(){}}; a-- = 42', // ClassExpression 'class a {}; a++ = 42', 'class a {}; class b extends a {}; b++ = 42', 'class a {function(){}}; a++ = 42', 'class a {}; a-- = 42', 'class a {}; class b extends a {}; b-- = 42', 'class a {function(){}}; a-- = 42', // GeneratorExpression 'function *a (){}; a++ = 42', 'function *a (){}; a-- = 42', // RegularExpressionLiteral 'var a = /(?:)/; a++ = 42', 'var a = /a/; a++ = 42', 'var a = /[a]/; a++ = 42', 'var a = /a/g; a++ = 42', 'var a = /(?:)/; a-- = 42', 'var a = /a/; a-- = 42', 'var a = /[a]/; a-- = 42', 'var a = /a/g; a-- = 42', // TemplateLiteral 'var a = ``; a++ = 42', 'a = 5; var b = (`${a}`); b++ = 42', 'var a = `foo`; a++ = 42', 'var a = `\\uFFFF`; a++ = 42', 'var a = ``; a-- = 42', 'a = 5; var b = (`${a}`); b-- = 42', 'var a = `foo`; a-- = 42', 'var a = `\\uFFFF`; a-- = 42', // MemberExpression 'var a = [1,2,3]; a[0]++ = 42', 'var a = {0:12}; a[0]++ = 42', 'var a = {"foo":12}; a.foo++ = 42', 'var a = {func: function(){}}; a.func++ = 42', 'var a = [1,2,3]; a[0]-- = 42', 'var a = {0:12}; a[0]-- = 42', 'var a = {"foo":12}; a.foo-- = 42', 'var a = {func: function(){}}; a.func-- = 42', // SuperProperty 'class a {constructor() {Object.defineProperty(this, \'foo\', {configurable:true, writable:true, value:1}); }} ' + 'class b extends a {constructor() {super();} foo() {super.foo++ = 42;}}', 'class a {constructor() {Object.defineProperty(this, \'foo\', {configurable:true, writable:true, value:1}); }} ' + 'class b extends a {constructor() {super();} foo() {super.foo-- = 42;}}', // NewExpression 'function a() {}; var b = new a(); b++ = 42', 'function a() {}; var b = new a(); b-- = 42', 'class g {constructor() {Object.defineProperty(this, \'foo\', {configurable:true, writable:true, value:1}); }}; ' + 'var a = new g(); a++ = 42', 'class g {constructor() {Object.defineProperty(this, \'foo\', {configurable:true, writable:true, value:1}); }}; ' + 'var a = new g(); a-- = 42', 'class a {}; var n = new a(); a++ = 42', 'class a {}; var n = new a(); a-- = 42', // CallExpression 'function a(prop){return prop}; var b = a(12); b++ = 42', 'function a(prop){return prop}; var b = a(12); b-- = 42', ]; for (var i = 0; i < tests.length; i++) { try { eval(tests[i]); assert(false); } catch (e) { assert(e instanceof SyntaxError); } }
var helper = require("../../specRuntime/testHelper"), Browser = require("zombie"); describe("A redirect page", () => { helper.startServerBeforeAll(__filename, [ "./TemporaryRedirectPage", "./TemporaryRedirectWithDocumentPage", "./PermanentRedirectPage", "./PermanentRedirectWithDocumentPage", "./FinalPage", ]); helper.stopServerAfterAll(); describe("redirects temporarily to the right page", () => { helper.testWithDocument("/temporaryRedirect", (document) => { expect(document.location.pathname).toMatch("/final"); }); }); describe("contains the correct HTML after temp redirect", () => { helper.testWithDocument("/temporaryRedirect", (document) => { expect(document.querySelector("#main").innerHTML).toMatch("FinalPage"); expect(document.querySelector("body").innerHTML).not.toMatch(/TemporaryRedirectPage/); }); }); it("gets the right status code for a temp redirect", (done) => { var browser = new Browser(); browser.silent = true; browser.on("redirect", (request, response, redirectRequest) => { //eslint-disable-line no-unused-vars expect(response.status).toBe(302); done(); }); browser.visit(`http://localhost:${helper.getPort()}/temporaryRedirect`); }); it("gets the right body for a temp redirect", done => { (new Browser).on("redirect", (req, res) => { res.text().then(text => { expect(text).toMatch('<p>Found. Redirecting to <a href="/final">/final</a></p>'); expect(text).not.toMatch('TemporaryRedirectPage'); done(); }); }) .visit(`http://localhost:${helper.getPort()}/temporaryRedirect`); }); it("gets the right body for a temp redirect with document", done => { (new Browser).on("redirect", (req, res) => { res.text().then(text => { expect(text).not.toMatch('<p>Found. Redirecting to <a href="/final">/final</a></p>'); expect(text).toMatch('TemporaryRedirectWithDocumentPage'); done(); }); }) .visit(`http://localhost:${helper.getPort()}/temporaryRedirectWithDocument`); }); describe("redirects temporarily to the right page with document", () => { helper.testWithDocument("/temporaryRedirectWithDocument", (document) => { expect(document.location.pathname).toMatch("/final"); }); }); describe("redirects permanently to the right page", () => { helper.testWithDocument("/permanentRedirect", (document) => { expect(document.location.pathname).toMatch("/final"); }); }); describe("contains the correct HTML after permanent redirect", () => { helper.testWithDocument("/permanentRedirect", (document) => { expect(document.querySelector("#main").innerHTML).toMatch("FinalPage"); expect(document.querySelector("body").innerHTML).not.toMatch(/PermanentRedirectPage/); }); }); it("gets the right status code for a permanent redirect", (done) => { var browser = new Browser(); browser.silent = true; browser.on("redirect", (request, response, redirectRequest) => { //eslint-disable-line no-unused-vars expect(response.status).toBe(301); done(); }); browser.visit(`http://localhost:${helper.getPort()}/permanentRedirect`); }); it("gets the right body for a permanent redirect", done => { (new Browser).on("redirect", (req, res) => { res.text().then(text => { expect(text).toMatch('<p>Moved Permanently. Redirecting to <a href="/final">/final</a></p>'); expect(text).not.toMatch('PermanentRedirectPage'); done(); }); }) .visit(`http://localhost:${helper.getPort()}/permanentRedirect`); }); it("gets the right body for a permanent redirect with document", done => { (new Browser).on("redirect", (req, res) => { res.text().then(text => { expect(text).not.toMatch('<p>Moved Permanently. Redirecting to <a href="/final">/final</a></p>'); expect(text).toMatch('PermanentRedirectWithDocumentPage'); done(); }); }) .visit(`http://localhost:${helper.getPort()}/permanentRedirectWithDocument`); }); describe("redirects permanently to the right page with document", () => { helper.testWithDocument("/permanentRedirectWithDocument", (document) => { expect(document.location.pathname).toMatch("/final"); }); }); }); describe("A forward page", () => { helper.startServerBeforeAll(__filename, [ "./FinalPage", "./ForwardPage", ]); helper.stopServerAfterAll(); describe("does NOT change its URL", () => { helper.testWithDocument("/forward", (document) => { expect(document.location.pathname).toMatch("/forward"); }); }); describe("contains the correct HTML after forward", () => { helper.testWithDocument("/forward", (document) => { expect(document.querySelector("#main").innerHTML).toMatch("FinalPage"); expect(document.querySelector("body").innerHTML).not.toMatch(/ForwardPage/); }); }); it ("gets a 200 status code and doesn't redirect", (done) => { var browser = new Browser(); browser.silent = true; browser.on("redirect", (request, response, redirectRequest) => { //eslint-disable-line no-unused-vars fail("Forward page redirected when it shouldn't have."); done(); }); browser.visit(`http://localhost:${helper.getPort()}/forward`).then(() => { expect(browser.resources[0].response.status).toBe(200); done(); }); }); });