text
stringlengths
2
6.14k
/** Select # What? # Part of my "Responsive Menu Concepts" article on CSS-Tricks http://css-tricks.com/responsive-menu-concepts # 2012 by Tim Pietrusky # timpietrusky.com **/
(function ($) { function getCsrfTokenForFullShotImage(callback) { $ .get(Drupal.url('rest/session/token')) .done(function (data) { var csrfToken = data; callback(csrfToken); }); } function patchImageFullShot(csrfToken, file, fid) { //document.getElementById('msg-up').innerHTML = 'Image marked as fullshot ....'; $.ajax({ url: Drupal.url('file/' + fid + '?_format=hal_json'), method: 'PATCH', headers: { 'Content-Type': 'application/hal+json', 'X-CSRF-Token': csrfToken }, data: JSON.stringify(file), success: function (file) { //console.log(node); //document.getElementById('msg-up').innerHTML = 'Image Fullshot started!'; swal({ title: "Full Shot", text: "Image has been selected as full shot. Scan next ID", type: "success", showCancelButton: false, confirmButtonColor: "#DD6B55", confirmButtonText: "OK", closeOnConfirm: true }); }, error: function(){ swal({ title: "Full Shot", text: "There was an error, please try again.", type: "error", showCancelButton: false, confirmButtonColor: "#DD6B55", confirmButtonText: "OK", closeOnConfirm: true }); } }); // setTimeout(function(){ // document.getElementById('msg-up').innerHTML = ''; // }, 3300); } /* * tag value 1 means tag * tag value 0 means undo tag * */ function update_image_fullshot(tag,fidinput) { var nid = fidinput; var Node_imgs = { _links: { type: { href: Drupal.url.toAbsolute(drupalSettings.path.baseUrl + 'rest/type/file/image') } }, // type: { // target_id: 'products' // }, field_full_shoot: { value:tag } }; getCsrfTokenForFullShotImage(function (csrfToken) { if (nid) { patchImageFullShot(csrfToken, Node_imgs, nid); }else{ alert('Node product found, pls refresh the page.'); } }); } $(".studio-img-fullshot").click(function () { var id = $(this).parents('span').attr('id'); console.log('fullshot'); update_image_fullshot(1,id); }); $(document).on("click",".studio-img-fullshot",function(){ var id = $(this).parents('span').attr('id'); console.log('fullshot'); update_image_fullshot(1,id); }); })(jQuery);
showWord(["v. ","vin jòn.<br>"])
document.addEventListener("DOMContentLoaded", function (event) { 'use strict'; var paragraph, url, proxy; paragraph = document.querySelectorAll('p.error_text'); chrome.tabs.query({ currentWindow: true, active: true }, function (tabs) { url = tabs[0].url; if (url.indexOf('chrome://') == 0) { paragraph[0].innerHTML = 'Sorry, you can\'t activate Browse Google Cache on a page with a "chrome://" URL.'; } else if (url.indexOf('https://chrome.google.com/webstore') == 0) { paragraph[0].innerHTML = 'Sorry, you can\'t activate Browse Google Cache on the Chrome Web Store.'; } else { chrome.tabs.query({ currentWindow: true, active: true }, function (tabs) { chrome.runtime.sendMessage({ action : 'extensionButtonClicked', 'tab': tabs[0] }); window.close(); }); } }); });
showWord(["","Wayòm ki te nan pati Sidwès peyi Ispayola. Se Boyekyo ki te chèf endyen nan wayòm sa a. Kapital wayòm sa a te Lagwana, kounye a yo rele l Leogàn." ])
showWord(["np. ","Avoka, politisyen. Madanm prezidan Jean Bertrand Aristide." ])
$('.attach_detach').on('click', function(){ var device_id = $(this).attr('device_id'); $('#device_id').val(device_id); }); $('.detach_customer').on('click', function(){ //get the attached customer name var customer_name = $(this).attr('cust_name'); if(confirm('Are you sure you want to detach('+customer_name+') from the device?')){ return true; }else{ return false; } });
var gulp = require('gulp') var mocha = require('gulp-mocha') var nodemon = require('gulp-nodemon') var env = require('gulp-env'); gulp.task('API-Server', (cb) => { let started = false env({ vars: { httpPort: 8080 } }); return nodemon({ script: 'index.js' }) .on('start', () => { if (!started) { started = true return cb() } }) .on('restart', () => { console.log('restarting') }) }) gulp.task('test', ['API-Server'], function() { return gulp.src('./test/index.js') .pipe(mocha()) .once('error', function() { process.exit(1) }) .once('end', function() { process.exit() }) })
Ext.define('Omni.view.sizes.Explorer', { extend: 'Buildit.ux.explorer.Panel', alias: 'widget.omni-sizes-Explorer', initComponent: function() { var me = this; // EXPLORER INIT (Start) =============================================================== Ext.apply(this, { allowFind: true, store: Ext.create('Omni.store.Size'), contextMenuConfig: { xtype: 'omni-app-ExplorerContextMenu' }, newForms: [{ xtype: 'omni-sizes-Form', windowConfig: {} }], inspectorConfig: { xtype: 'omni-sizes-Inspector' } }); // EXPLORER INIT (End) // LABELS (Start) ====================================================================== Ext.applyIf(this, { size_nbrLabel: Omni.i18n.model.Size.size_nbr, size_typeLabel: Omni.i18n.model.Size.size_type, displayLabel: Omni.i18n.model.Size.display, concatenated_nameLabel: Omni.i18n.model.Size.concatenated_name, dimension_1Label: Omni.i18n.model.Size.dimension_1, dimension_2Label: Omni.i18n.model.Size.dimension_2, is_enabledLabel: Omni.i18n.model.Size.is_enabled }); // LABELS (End) // COLUMNS (Start) ===================================================================== Ext.apply(this, { columns: [{ header: this.displayLabel, dataIndex: 'display', flex: 1, sortable: false }, { header: this.concatenated_nameLabel, dataIndex: 'concatenated_name', flex: 1, sortable: false }, { header: this.dimension_1Label, dataIndex: 'dimension_1', flex: 1, sortable: false }, { header: this.dimension_2Label, dataIndex: 'dimension_2', flex: 1, sortable: false }, { header: this.size_typeLabel, dataIndex: 'size_type', flex: 1, sortable: false, renderer: Buildit.util.Format.lookupRenderer('SIZE_TYPE') }, { header: this.size_nbrLabel, dataIndex: 'size_nbr', flex: 1, sortable: false }, { header: this.is_enabledLabel, dataIndex: 'is_enabled', flex: 1, sortable: false }, ] }); // COLUMNS (End) // TITLES (Start) ====================================================================== Ext.apply(this, { title: 'Size', subtitle: 'All Product Sizes that are valid in the system' }); // TITLES (End) this.callParent(); } });
/* * 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/>. */ define(['Core', 'Core/Renderer', 'BackBone'], function (Core, Renderer, Backbone) { 'use strict'; var HiddenView = Backbone.View.extend({ initialize: function (template, formTag, element) { this.el = formTag; this.template = template; this.element = element; this.bindEvents(); }, bindEvents: function () { var self = this; Core.Mediator.subscribe('before:form:submit', function (form) { if (form.attr('id') === self.el) { var element = form.find('.element_' + self.element.getKey()), input = element.find('input[name="' + self.element.getKey() + '"]'), span = element.find('span.updated'), oldValue = self.element.value; if (input.val() !== oldValue) { span.text('updated'); } else { span.text(''); } } }); }, /** * Render the template into the DOM with the Renderer * @returns {String} html */ render: function () { return Renderer.render(this.template, {element: this.element}); } }); return HiddenView; });
var _i_x_n_annotation_format_8h = [ [ "IXNAnnotationFormat", "_i_x_n_annotation_format_8h.html#a607464fe85fc01c26df0c51826fd4841", [ [ "IXNAnnotationFormatPlainString", "_i_x_n_annotation_format_8h.html#a607464fe85fc01c26df0c51826fd4841a7b4fb91d85f0776a7abe6e0623f6b0fc", null ], [ "IXNAnnotationFormatJson", "_i_x_n_annotation_format_8h.html#a607464fe85fc01c26df0c51826fd4841a91b8ae8f1bcb5c68a714026c4674231d", null ], [ "IXNAnnotationFormatOsc", "_i_x_n_annotation_format_8h.html#a607464fe85fc01c26df0c51826fd4841a611da1ac0a3eccbea277aad5ca3d57f1", null ] ] ] ];
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: http://www.espocrm.com * * EspoCRM 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. * * EspoCRM 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 EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Views.EmailAccount.Record.Edit', ['Views.Record.Edit', 'Views.EmailAccount.Record.Detail'], function (Dep, Detail) { return Dep.extend({ afterRender: function () { Dep.prototype.afterRender.call(this); Detail.prototype.initSslFieldListening.call(this); }, }); });
var Connection = require("./db/db-connection").Connection; var Tables = require("./db/tables"); const R = require("ramda"); var QUERY_MATCHES = { $or: [ {percent_name: {$gt: 0.9}}, { distance: {$lt: 1} }, { percent_name: {$gt: 0.8}, distance: {$lt: 30} }, { percent_name: {$gt: 0.8}, percent_address_phonetic: 1, distance: {$lt: 50} } ] }; var connection = new Connection(); connection.connect() .then(connection.collection.bind(connection, Tables.FUZZY_MATCHES_FB)) .then(coll=> { return coll.find(QUERY_MATCHES).toArray() }) .then(matches=> { var promises = matches.map(match=> { return Promise.resolve(R.filter(item=>(item.id_p1 == match.id_p1 || item.id_p2 == match.id_p1), matches)).then(response=> { return { id: match.id_p1.toString(), name: match.name_p1, response: R.compose( R.sortBy(R.identity), R.uniq, R.flatten, R.map(place=> { return [place.id_p1.toString(), place.id_p2.toString()] }) )(response) } }) }); return Promise.all(promises); }) .then(matches=> { matches = R.groupBy(item=>item.id, matches); matches = Object.keys(matches).map((key)=> { var get_ids = R.compose( R.reduce((prev, id)=> { prev.id_facebook.push(id); return prev; }, {id_facebook: [], id_google: [], id_opendata: [], id_imprese: []}), R.sortBy(R.identity), R.uniq, R.flatten , R.map(R.prop("response")) ); var ids = get_ids(matches[key]); return Object.assign({ name: matches[key][0].name }, ids) }); var uniq_matches = []; for (var i = 0; i < matches.length; i++) { var match = matches[i]; var found = R.find(nm=> { var has_fb = match.id_facebook.filter(id=>nm.id_facebook.includes(id)).length; return has_fb; })(uniq_matches); if (!found) { uniq_matches.push(match); }else { found.id_facebook=R.uniq(found.id_facebook.concat(match.id_facebook)); } } var fuzzyMatchColl = connection.db.collection(Tables.FUZZY_MATCHES_FB_ONE_TO_MANY); return fuzzyMatchColl.drop().then(_=>{ return fuzzyMatchColl.insertMany(uniq_matches); }) }) .then(_=> { connection.db.close(); console.log("DONE"); process.exit(0); }) .catch(_=> { console.log(_); connection.db.close(); process.exit(1); });
require('dotenv').config({ silent: true }); var Express = require('express'); var path = require('path'); var fs = require('fs'); var merge = require('lodash/merge'); var proxy = require('proxy-middleware'); var ejs = require('ejs'); var config = require('./config'); var server = new Express(); server.set('port', config.PORT); server.engine('html', require('ejs').renderFile); server.set('view engine', 'ejs'); server.set('views', path.resolve(__dirname, '../www')); server.locals.CONFIG = escape(JSON.stringify(config)); server.use(config.API_PROXY_PATH, proxy(config.API_ENDPOINT)); server.get('/', function (req, res) { res.render('index.html'); }); server.use(Express.static(path.resolve(__dirname, '../www'))); server.get('/404', function (req, res) { res.render('404.html'); }); server.listen(server.get('port'), function (err) { if (err) { console.log('error while starting server', err); } console.log('Gandalf is started to listen at localhost:' + server.get('port')); });
import moment from 'moment'; import PublicationsController from './controller/publications.controller.js'; import AuthorsController from './controller/authors.controller.js'; import PublishersController from './controller/publishers.controller.js'; /* * Application routing */ function routing($routeProvider) { $routeProvider .when('/publications', { template: require('./view/publications.html'), controller: PublicationsController, controllerAs: 'vm' }) .when('/authors', { template: require('./view/authors.html'), controller: AuthorsController, controllerAs: 'vm' }) .when('/publishers', { template: require('./view/publishers.html'), controller: PublishersController, controllerAs: 'vm' }) .otherwise({ redirectTo: '/publications' }); } routing.$inject = ['$routeProvider']; /* * Theming configuration for Material AngularJS */ function theming($mdThemingProvider) { $mdThemingProvider .theme('default') .primaryPalette('indigo') .accentPalette('red'); } theming.$inject = ['$mdThemingProvider']; /* * Date localization configuration */ function dateLocalization($mdDateLocaleProvider) { const dateFmt = 'YYYY-MM-DD'; $mdDateLocaleProvider.formatDate = (date) => { return moment(date).format(dateFmt); }; $mdDateLocaleProvider.parseDate = (str) => { const m = moment(str, dateFmt); return m.isValid() ? m.toDate() : new Date(NaN); }; } dateLocalization.$inject = ['$mdDateLocaleProvider']; export { routing, theming, dateLocalization };
import { moduleForComponent, test } from 'ember-qunit'; moduleForComponent('hq-category', { // Specify the other units that are required for this test // needs: ['component:foo', 'helper:bar'] }); test('it renders', function(assert) { assert.expect(2); // Creates the component instance var component = this.subject(); assert.equal(component._state, 'preRender'); // Renders the component to the page this.render(); assert.equal(component._state, 'inDOM'); });
class Block { constructor(x, y, width, colour) { this.x = x; this.y = y; this.width = width; this.colour = colour; this.occupied = false; } draw() { fill(this.colour); rect(this.x, this.y, this.width, this.width); } }
define(['backbone', 'underscore'], function (Backbone, _) { return Backbone.Model.extend({ idAttribute: 'username', defaults: { persona: { personaPnombre: '', personaSnombre: '', personaApaterno: '', personaAmaterno: '', dni: '' } }, validate: function (attrs, options) { console.log('persona', attrs.persona); if (_.isUndefined(attrs.persona)) { return { field: 'persona', error: 'Debe definir una persona' }; } if (_.isUndefined(attrs.persona.personaDni) || _.isEmpty(attrs.persona.personaDni.trim()) || attrs.persona.personaDni.trim().length != 8) { return { field: 'persona-personaDni', error: 'El dni es un campo obligatorio y debe tener 8 caracteres.' }; } if (_.isUndefined(attrs.persona.personaPnombre) || _.isEmpty(attrs.persona.personaPnombre.trim())) { return { field: 'persona-personaPnombre', error: 'El primer nombre es un campo obligatorio.' }; } if (_.isUndefined(attrs.persona.personaApaterno) || _.isEmpty(attrs.persona.personaApaterno.trim())) { return { field: 'persona-personaApaterno', error: 'El apellido paterno es un campo obligatorio.' }; } if (_.isUndefined(attrs.persona.personaAmaterno) || _.isEmpty(attrs.persona.personaAmaterno.trim())) { return { field: 'persona-personaAmaterno', error: 'El apellido materno es un campo obligatorio.' }; } } }); });
// Copyright 2015, 2016 Ethcore (UK) Ltd. // This file is part of Parity. // Parity 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. // Parity 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 Parity. If not, see <http://www.gnu.org/licenses/>. import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; class ParityBackground extends Component { static propTypes = { style: PropTypes.object.isRequired, children: PropTypes.node, className: PropTypes.string, onClick: PropTypes.func }; render () { const { children, className, style, onClick } = this.props; return ( <div className={ className } style={ style } onTouchTap={ onClick }> { children } </div> ); } } function mapStateToProps (_, initProps) { const { gradient, seed, muiTheme } = initProps; let _seed = seed; let _props = { style: muiTheme.parity.getBackgroundStyle(gradient, seed) }; return (state, props) => { const { backgroundSeed } = state.settings; const { seed } = props; const newSeed = seed || backgroundSeed; if (newSeed === _seed) { return _props; } _seed = newSeed; _props = { style: muiTheme.parity.getBackgroundStyle(gradient, newSeed) }; return _props; }; } export default connect( mapStateToProps )(ParityBackground);
(function() { var app = angular.module('article-directive', ['ui.bootstrap.contextMenu']); app.config(function($sceProvider) { // Completely disable SCE. For demonstration purposes only! // Do not use in new projects. $sceProvider.enabled(false); }); app.directive('article', function () { var controller = function () { var vm = this; }; var getSelectionText = function() { if(window.getSelection) { return window.getSelection().toString(); } if(document.selection && document.selection.type != "Control") { return document.selection.createRange().text; } return ""; }; var link = function link(scope, element, attrs) { scope.toggleComments = function () { scope.$broadcast("event:toggle"); } scope.menuOptions = [['Copy', function ($itemScope) { }], null, // Dividier ['Comment', function ($itemScope) { scope.toggleComments(); }]]; }; return { restrict: 'EA', //Default for 1.3+ scope: { text: '@text', url: '@url' }, controller: controller, link: link, controllerAs: 'vm', bindToController: true, //required in 1.3+ with controllerAs templateUrl: '/article/article.html' }; }); }());
/* Copyright (C) 2014 PencilBlue, LLC This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * Interface for managing topics */ function ManageTopics() {} //inheritance util.inherits(ManageTopics, pb.BaseController); var SUB_NAV_KEY = 'manage_topics'; ManageTopics.prototype.render = function(cb) { var self = this; var dao = new pb.DAO(); dao.query('topic', pb.DAO.ANYWHERE, pb.DAO.PROJECT_ALL).then(function(topics) { if (util.isError(topics)) { //TODO handle this } //none to manage if(topics.length === 0) { self.redirect('/admin/content/topics/new', cb); return; } //currently, mongo cannot do case-insensitive sorts. We do it manually //until a solution for https://jira.mongodb.org/browse/SERVER-90 is merged. topics.sort(function(a, b) { var x = a.name.toLowerCase(); var y = b.name.toLowerCase(); return ((x < y) ? -1 : ((x > y) ? 1 : 0)); }); var angularObjects = pb.js.getAngularObjects( { navigation: pb.AdminNavigation.get(self.session, ['content', 'topics'], self.ls), pills: pb.AdminSubnavService.get(SUB_NAV_KEY, self.ls, SUB_NAV_KEY), topics: topics }); self.setPageName(self.ls.get('MANAGE_TOPICS')); self.ts.registerLocal('angular_objects', new pb.TemplateValue(angularObjects, false)); self.ts.load('admin/content/topics/manage_topics', function(err, data) { var result = '' + data; cb({content: result}); }); }); }; ManageTopics.getSubNavItems = function(key, ls, data) { return [{ name: SUB_NAV_KEY, title: ls.get('MANAGE_TOPICS'), icon: 'refresh', href: '/admin/content/topics' }, { name: 'import_topics', title: '', icon: 'upload', href: '/admin/content/topics/import' }, { name: 'new_topic', title: '', icon: 'plus', href: '/admin/content/topics/new' }]; }; //register admin sub-nav pb.AdminSubnavService.registerFor(SUB_NAV_KEY, ManageTopics.getSubNavItems); //exports module.exports = ManageTopics;
function print_last_modif_date(v) { document.write("Last updated " + v.substr(7, 19)); }
import { defineMessages } from 'react-intl'; export default defineMessages({ save: { id: 'cboard.components.FormDialog.save', defaultMessage: 'Save' }, cancel: { id: 'cboard.components.FormDialog.cancel', defaultMessage: 'Cancel' } });
const { nativeImage } = require('electron') const { resolve } = require('path') exports.size16 = nativeImage.createFromPath(resolve(__dirname, '../icon16.png')) exports.size16.setTemplateImage(true)
document.addEventListener("DOMContentLoaded", function(event) { if (/android|blackberry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === false) { var linkDescrs = document.querySelectorAll('.link-descr'); Array.prototype.forEach.call(linkDescrs, function(el, i) { el.parentNode.addEventListener('mouseenter', animateTypeText); el.parentNode.addEventListener('mouseleave', destroyTypeText); }); } else { var linkDescrs = document.querySelectorAll('.link-descr'); Array.prototype.forEach.call(linkDescrs, function(el, i) { removeClass(el, 'link-descr'); }); } }); var addClass = function(elem, add_class) { elem.setAttribute("class", elem.getAttribute("class") + ' ' + add_class); }; var removeClass = function(elem, rem_class) { var origClass = elem.getAttribute("class"); var remClassRegex = new Regexp("(\\s*)"+rem_class+"(\\s*)"); var classMatch = origClass.match(remClassRegex); var replaceString = ''; if (classMatch[1].length > 0 || classMatch[2].length > 0) { replaceString = ' '; } var newClass = origClass.replace(remClassRegex, replaceString); elem.setAttribute("class", newClass); }; var animateTypeText = function() { var elem = this; var typeArea = document.createElement("span"); typeArea.setAttribute("class", "link-subtext"); elem.insertBefore(typeArea, elem.querySelector("span:last-of-type")); setTimeout(addLetter(elem), 40); }; var addLetter = function(elem) { // if (elem.parentElement.querySelector(":hover") === elem) { var subtextSpan = elem.querySelector(".link-subtext"); var descrText = elem.querySelector(".link-descr").textContent; if (subtextSpan === null) { return; } var currentText = subtextSpan.textContent.slice(0,-1); var currentPos = currentText.length; subtextSpan.textContent = currentText + descrText.slice(currentPos, currentPos+1) + "\u258B"; if (currentText.length < descrText.length) { setTimeout(function(){addLetter(elem)}, 40); } // } }; var destroyTypeText = function() { var elem = this; elem.removeChild(elem.querySelector('.link-subtext')); };
var gulp = require('gulp'); var browserSync = require('browser-sync'); var jshint = require('gulp-jshint'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var rename = require('gulp-rename'); // 静态服务器 gulp.task('browser-sync', function() { browserSync.init({ files: "src/**", server: { baseDir: "src/" } }); }); // js语法检查 gulp.task('jshint', function() { return gulp.src('src/js/*.js') .on('error') .pipe(jshint()) .pipe(jshint.reporter('default')); }); // js文件合并及压缩 gulp.task('minifyjs', function() { return gulp.src('src/js/*.js') .pipe(concat('all.js')) .pipe(gulp.dest('dist/js')) .pipe(uglify()) .pipe(rename({ suffix: '.min' })) .pipe(gulp.dest('dist/js')); }); // 事件监听 gulp.task('watch', function() { gulp.watch('src/js/*.js', ['jshint','minifyjs']); }); gulp.task('default',['browser-sync','watch']);
// mailer.js var nodemailer = require('nodemailer'); var smtpTransport = nodemailer.createTransport("SMTP", { service: "Mandrill", debug: true, auth: { user: "evanroman1@gmail.com", pass: "k-AdDVcsNJ9oj8QYATVNGQ" } }); exports.sendEmailConfirmation = function(emailaddress, username, firstname, expiremoment, token){ var mailOptions = { from: "confirm@ativinos.com", // sender address to: emailaddress, // list of receivers subject: "Confirm email and start Ativinos", // Subject line text: 'Hi ' +firstname+ ', your account, ' +username+ ', will be enabled after you confirm your email. Your account will be deleted by ' + expiremoment + ' if you do not verify email before then. To verify your email, visit http://www.ativinos.com/emailverify?token=' + token + '&username=' + username, html: 'Hi ' +firstname+ ', your account, ' +username+ ', will be enabled after you confirm your email. Your account will be deleted by ' + expiremoment + ' if you do not verify email before then. To verify your email, visit <a href="http://www.ativinos.com/emailverify?token=' + token + '&username=' + username + '">http://www.ativinos.com/emailverify?token=' + token + '&username=' + username + '</a>', } smtpTransport.sendMail(mailOptions, function(error, response){ if(error){ console.log(error); } }) }
$(function(){ $('#telefone').mask('(99)9999-9999'); $('.editar').on({ click : function(){ var url = URI+"sistema/editar/"+$(this).attr('data-item'); window.location.href = url; } }); $('.deletar').on({ click : function(){ var $selecionados = get_selecionados(); if($selecionados.length > 0) { var $url = URI+"sistema/remover/"; if (window.confirm("deseja apagar os ("+$selecionados.length+") itens selecionados? ")) { $.post($url, { 'selecionados': $selecionados}, function(data){ pop_up(data, setTimeout(function(){location.reload()}, 100)); }); } } else { pop_up('nenhum item selecionado'); } } }); $('#description').on('keyup',function(){ var alvo = $("#char-digitado"); var max = 140; var digitados = $(this).val().length; var restante = max - digitados; if(digitados > max) { var val = $(this).val(); $(this).val(val.substr(0, max)); restante = 0; } alvo.html(restante); }); });
$(function() { $("#childGrid").jqGrid( { url : "TBCcnsizePrm.html?getGridData",datatype : "json",mtype : "GET",colNames : [ 'Conn Id',getLocalMessage('water.connsize.frmDt'), getLocalMessage('water.connsize.toDt'), getLocalMessage('water.connsize.frm'),getLocalMessage('water.connsize.to'), getLocalMessage('edit.msg'), getLocalMessage('master.view')], colModel : [ {name : "cnsId",width : 10,sortable : false,searchoptions: { "sopt": [ "eq"] }}, {name : "cnsFrmdt",width : 20,sortable : true,searchoptions: { "sopt": ["bw", "eq"] },formatter : dateTemplate}, {name : "cnsTodt",width : 20,sortable : true, searchoptions: { "sopt": ["bw", "eq"] },formatter : dateTemplate}, {name : "cnsFrom",width : 20,sortable : false,searchoptions: { "sopt": [ "eq"] }}, {name : "cnsTo",width : 20,sortable : false,searchoptions: { "sopt": [ "eq"] }}, {name : 'cnsId',index : 'cnsId',width : 20,align : 'center',formatter : returnEditUrl,editoptions : {value : "Yes:No"},formatoptions : {disabled : false},search:false }, {name : 'cnsId',index : 'cnsId',width : 20,align : 'center',formatter : returnViewUrl,editoptions : {value : "Yes:No"},formatoptions : {disabled : false},search:false} ], pager : "#pagered", rowNum : 30, rowList : [ 5, 10, 20, 30 ], sortname : "dsgid", sortorder : "desc", height : 'auto', viewrecords : true, gridview : true, loadonce : true, jsonReader : { root : "rows", page : "page", total : "total", records : "records", repeatitems : false, }, autoencode : true, caption : getLocalMessage('water.connsize.gridTtl') }); jQuery("#grid").jqGrid('navGrid','#pagered',{edit:false,add:false,del:false,search:true,refresh:false}); $("#pagered_left").css("width", ""); }); function returnEditUrl(cellValue, options, rowdata, action) { return "<a href='#' return false; class='editClass' value='"+rowdata.cnsId+"' ><img src='css/images/edit.png' width='20px' alt='Edit Charge Master' title='Edit Scrutiny Data' /></a>"; } function returnViewUrl(cellValue, options, rowdata, action) { return "<a href='#' return false; class='viewConnectionClass' value='"+rowdata.cnsId+"'><img src='css/images/grid/view-icon.png' width='20px' alt='View Master' title='View Master' /></a>"; } function returnisdeletedUrl(cellValue, options, rowdata, action) { if (rowdata.isdeleted == '0') { return "<a href='#' class='fa fa-check-circle fa-2x green ' value='"+rowdata.isdeleted+"' alt='Designation is Active' title='Designation is Active'></a>"; } else { return "<a href='#' class='fa fa-times-circle fa-2x red ' value='"+rowdata.isdeleted+"' alt='Designation is INActive' title='Designation is InActive'></a>"; } } $(function() { $(document) .on('click','.addConnectionClass',function() { var $link = $(this); var cnsId = $link.closest('tr').find('td:eq(0)').text(); var url = "TBCcnsizePrm.html?formForUpdate"; var requestData = "cnsId=" + cnsId + "&MODE1=" + "EDIT"; var returnData =__doAjaxRequest(url,'post',requestData,false); $('.content').html(returnData); prepareDateTag(); }); }); $(function() { $(document).on('click', '.editClass', function() { var $link = $(this); var cnsId = $link.closest('tr').find('td:eq(0)').text(); var url = "TBCcnsizePrm.html?formForUpdate"; var requestData = "cnsId=" + cnsId + "&MODE1=" + "EDIT"; var returnData =__doAjaxRequest(url,'post',requestData,false); $('.content').html(returnData); prepareDateTag(); }); }); $(function() { $(document).on('click', '.viewConnectionClass', function() { var $link = $(this); var cnsId = $link.closest('tr').find('td:eq(0)').text(); var url = "TBCcnsizePrm.html?formForUpdate"; var requestData = "cnsId=" + cnsId + "&MODE1=" + "VIEW"; var returnData =__doAjaxRequest(url,'post',requestData,false); $('.content').html(returnData); prepareDateTag(); }); }); /*ADD Form*/ function saveConnectionSizeDetails(obj){ return saveOrUpdateForm(obj, 'Saved Successfully', 'TBCcnsizePrm.html', 'create'); } function updateConnectionSizeDetails(obj){ return saveOrUpdateForm(obj, 'Saved Successfully', 'TBCcnsizePrm.html', 'update'); } function showConfirmBox(){ var errMsgDiv = '.msg-dialog-box'; var message=''; var cls = 'Yes'; message +='<p>Record Saved Successfully..</p>'; message +='<p style=\'text-align:center;margin: 5px;\'>'+ '<br/><input type=\'button\' value=\''+cls+'\' id=\'btnNo\' class=\'css_btn \' '+ ' onclick="ShowView()"/>'+ '</p>'; $(errMsgDiv).addClass('ok-msg').removeClass('warn-msg'); $(errMsgDiv).html(message); $(errMsgDiv).show(); $('#btnNo').focus(); showModalBox(errMsgDiv); } function ShowView(){ window.location.href='TBCcnsizePrm.html'; } $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true }); $(".warning-div ul").each(function () { var lines = $(this).html().split("<br>"); $(this).html('<li>' + lines.join("</li><li><i class='fa fa-exclamation-circle'></i>&nbsp;") + '</li>'); }); $('html,body').animate({ scrollTop: 0 }, 'slow');
/** * @file Map places of interest * @author Tom Jenkins tom@itsravenous.com */ module.exports = { castle: { title: 'Rowton Castle', lat: 52.708739, lng: -2.9228567, icon: 'pin_castle.png', main: true, description: 'Where it all happens! Rowton Castle is a small castle manor house roughly halfway between Shrewsbury and Welshpool.', link: 'https://rowtoncastle.com' }, barns: { title: 'Rowton Barns', lat: 52.709265, lng: -2.9255, icon: 'pin_hotel.png', description: 'Just a <del>drunken stumble</del> <ins>short stroll</ins> from the castle, Rowton Barns offers rooms in their beautifully converted farm buildings.', link: 'http://www.rowtonbarns.co.uk/' }, wollaston: { title: 'Wollaston Lodge', lat: 52.7036, lng: -2.9943, icon: 'pin_hotel.png', description: 'A boutique bed and breakfast with individually themed rooms.', link: 'http://www.wollastonlodge.co.uk/' }, travelodge: { title: 'Shrewsbury Travelodge', lat: 52.6817939, lng: -2.7645268, icon: 'pin_hotel.png', description: 'On Bayston Hill services, with free parking.', link: 'https://www.travelodge.co.uk/hotels/175/Shrewsbury-Bayston-Hill-hotel' } };
var struct_create_packets_1_1__2 = [ [ "angle", "struct_create_packets_1_1__2.html#a425d33bd27790066ff7edb4a608a8149", null ], [ "buttons", "struct_create_packets_1_1__2.html#a6b7d2d6c0a3a063f873420c010063b33", null ], [ "distance", "struct_create_packets_1_1__2.html#afb30de28ec41190d0cb278640d4782ab", null ], [ "ir", "struct_create_packets_1_1__2.html#ac834057741105e898b3d4613b96c6eb1", null ] ];
!function(namespace) { 'use strict'; function Modal(elem, params) { this.$element = jQuery(elem); this.params = params || {}; this.cssReadyElement = this.params.cssReadyElement || 'JS-Modal-ready'; this.cssActiveElement = this.params.cssActiveElement || 'JS-Modal-active'; this.__construct(); } Modal.prototype.__construct = function __construct() { this.$box = this.$element.find('.JS-Modal-Box'); this.$close = this.$element.find('.JS-Modal-Close'); this.$title = this.$element.find('.JS-Modal-Title'); this.$container = this.$element.find('.JS-Modal-Container'); this._init(); }; Modal.prototype._init = function _init() { var _this = this; this.$close.on('click.JS-Modal', function() { _this._close.apply(_this, []); }); $('body').on("keyup", function(e) { if ((e.keyCode == 27)) { _this._close.apply(_this, []); } }); $('.JS-Gannt-Modal').click(function() { if (_this.$element.hasClass('JS-Modal-active')) _this._close.apply(_this, []); }); $('.JS-Modal-Box').click(function(event){ event.stopPropagation(); }); /* API. Events */ this.$element.on('modal:setContent', function(e, data) { _this.setContent.apply(_this, [data]); }); this.$element.on('modal:open', function() { _this.open.apply(_this, []); }); this.$element.on('modal:close', function() { _this.close.apply(_this, []); }); this.$element.on('modal:clear', function() { _this.clear.apply(_this, []); }); this._ready(); } ; Modal.prototype._ready = function _ready() { this.$element .addClass(this.cssReadyElement) .addClass('JS-Modal-ready'); }; Modal.prototype._setContent = function _setContent(content) { this.$container.html(content); }; Modal.prototype._open = function _open() { if (!this.$element.hasClass('JS-Modal-active')) { this.$element .addClass(this.cssActiveElement) .addClass('JS-Modal-active') } }; Modal.prototype._close = function _close() { if (this.$element.hasClass('JS-Modal-active')) { this.$element .removeClass(this.cssActiveElement) .removeClass('JS-Modal-active'); } }; Modal.prototype._clear = function _clear() { }; /* API. Methods */ Modal.prototype.setContent = function setContent(content) { if (!arguments.length) { return false; } this._setContent(content); }; Modal.prototype.open = function open() { this._open(); }; Modal.prototype.close = function close() { this._close(); }; Modal.prototype.clear = function clear() { this._clear(); }; namespace.Modal = Modal; }(this);
var __v=[ { "Id": 3568, "Panel": 1763, "Name": "紋理動畫", "Sort": 0, "Str": "" }, { "Id": 3569, "Panel": 1763, "Name": "相關API", "Sort": 0, "Str": "" }, { "Id": 3570, "Panel": 1763, "Name": "Example", "Sort": 0, "Str": "" } ]
var events = require('events'), koanize = require('koanizer'), util = require('util'); koanize(this); // Standard and RFC set these values var REFERENCE_CLOCK_FREQUENCY = 90000; // RTP packet constants and masks var RTP_HEADER_SIZE = 12; var RTP_FRAGMENTATION_HEADER_SIZE = 4; var SAMPLES_PER_FRAME = 1152; // ISO 11172-3 var SAMPLING_FREQUENCY = 44100; var TIMESTAMP_DELTA = Math.floor(SAMPLES_PER_FRAME * REFERENCE_CLOCK_FREQUENCY / SAMPLING_FREQUENCY); var SECONDS_PER_FRAME = SAMPLES_PER_FRAME / SAMPLING_FREQUENCY; var RTPProtocol = function(){ events.EventEmitter.call(this); this.setMarker = false; this.ssrc = Math.floor(Math.random() * 100000); this.seqNum = Math.floor(Math.random() * 1000); this.timestamp = Math.floor(Math.random() * 1000); }; util.inherits(RTPProtocol, events.EventEmitter); RTPProtocol.prototype.pack = function(payload){ ++this.seqNum; // RFC3550 says it must increase by the number of samples // sent in a block in case of CBR audio streaming this.timestamp += TIMESTAMP_DELTA; if (!payload) { // Tried to send a packet, but packet was not ready. // Timestamp and Sequence Number should be increased // anyway 'cause interval callback was called and // that's like sending silence this.setMarker = true; return; } var RTPPacket = new Buffer(RTP_HEADER_SIZE + RTP_FRAGMENTATION_HEADER_SIZE + payload.length); // version = 2: 10 // padding = 0: 0 // extension = 0: 0 // CRSCCount = 0: 0000 /* KOAN #1 should write Version, Padding, Extension and Count */ RTPPacket.writeUInt8(128, 0); // Marker = 0: 0 // RFC 1890: RTP Profile for Audio and Video Conferences with Minimal Control // Payload = 14: (MPEG Audio Only) 0001110 RTPPacket.writeUInt8(this.setMarker? 142 : 14, 1); this.setMarker = false; // SequenceNumber /* KOAN #2 should write Sequence Number */ RTPPacket.writeUInt16BE(this.seqNum, 2); // Timestamp /* KOAN #3 should write Timestamp... */ RTPPacket.writeUInt32BE(this.timestamp, 4); // SSRC /* KOAN #3 ...SSRC and... */ RTPPacket.writeUInt32BE(this.ssrc, 8); // RFC 2250: RTP Payload Format for MPEG1/MPEG2 Video // 3.5 MPEG Audio-specific header /* KOAN #3 ...payload Format */ RTPPacket.writeUInt32BE(0, 12); payload.copy(RTPPacket, 16); this.emit('packet', RTPPacket); //return RTPPacket; }; module.exports = exports.RTPProtocol = RTPProtocol;
var __v=[ { "Id": 2046, "Chapter": 630, "Name": "c++", "Sort": 0 } ]
import React from 'react'; import { mount } from 'enzyme'; import { Link, HashRouter as Router } from 'react-router-dom'; import { Button } from 'react-bootstrap'; import BackHomeButton from '../BackHomeButton'; describe('<BackHomeButton/>', () => { it('<BackHomeButton /> should render <Router/>', () => { const component = mount(<BackHomeButton />); expect(component.find(Router)).toHaveLength(1); }); it('<BackHomeButton /> should render <Link/> with correct props', () => { const component = mount(<BackHomeButton />); expect(component.find(Router)).toHaveLength(1); expect(component.find(Link)).toHaveLength(1); const props = component.find(Link).props(); expect(props).toEqual({ to: '/', children: expect.anything() }); expect(component.find(Link)).toHaveLength(1); }); it('<BackHomeButton /> should render <Button/> with correct props', () => { const component = mount(<BackHomeButton />); expect(component.find(Router)).toHaveLength(1); expect(component.find(Link)).toHaveLength(1); expect(component.find(Button)).toHaveLength(1); const ButtonProps = component.find(Button).props(); expect(ButtonProps).toEqual({ variant: 'primary', children: 'Back Home', active: false, disabled: false, type: 'button', }); }); });
'use strict'; var Ose = require('ose'); var M = Ose.class(module, './index'); /** Docs {{{1 * @submodule bb.pagelet */ /** * @caption Dashboard pagelet * * @readme * Pagelet for creating dashboard content. * * @class bb.lib.pagelet.dashboard * @type class * @extends bb.lib.pagelet */ // Public {{{1 exports.loadData = function(cb) { // {{{2 /** * Has a new list widget created and appends it to the main pagelet * element. It also calls the "Ose.ui.dashboard()" * method. "Ose.ui.dashboard()" governs what is diaplayed on the * dashboard. * * @method loadData */ if (cb) { this.doAfterDisplay = cb; } this.$('header').html('Dashboard'); this.$() .empty() .append(this.newWidget('list', 'list')) ; if (Ose.ui.configData.dashboard) { this.addContents(Ose.ui.configData.dashboard); } if (Ose.ui.dashboard) { Ose.ui.dashboard(this, this.afterDisplay.bind(this)); } else { this.afterDisplay(); } }; exports.addContent = function(caption, stateObj) { // {{{2 /** * Adds an item to the dashboard. * * @param caption {String} Text to be displayed * @param stateObj {Object} State object that should be displayed when the user taps on this item. */ return this.addItem(caption, Ose.ui.bindContent(stateObj)); }; exports.addContents = function(data) { // {{{2 /** * Adds items to the dashboard. * * @param data {Array} Array of items */ for (var i = 0; i < data.length; i++) { var item = data[i]; this.addContent(item.caption, item.data); } }; exports.addItem = function(caption, onTap) { // {{{2 /** * Adds an item to the dashboard. * * @param caption {String} Text to be displayed * @param onTap {Function} Function to be called when the user taps on this item. */ return this.$('list > ul').append( this.newWidget('listItem', null, { tap: onTap, caption: caption }) ); }; exports.addPagelet = function(params, cb) { // {{{2 /** * Adds an item to the dashboardk. * * @param caption {String} Text to be displayed * @param cb {Function} Function to be called when the user taps on this item. */ var result = this.newPagelet(params); $('<li>') .append(result.html()) .appendTo(this.$('list > ul')) ; result.loadData(); cb(); // TODO Send "cb" to loadData. return result; }; exports.verifyStateObj = function(data) { // {{{2 /** * Verifies that data correspond to the displayed pagelet. * * @param data {Object} State object to be compared * * @returns {Boolean} Whether data correspond to the displayed pagelet * @method verifyStateObj */ return data.pagelet === 'dashboard'; }; // }}}1
var express = require('express'), router = express.Router(), adminModel = require('../models/adminModel'), moment = require('moment'), helperFun = require('../lib/helperFunc'), md5 = require('md5'); router .get('',function (request,response){ adminModel.find({},{"__v" : 0, "password" : 0, "emailCode" : 0},function (err,result){ if(err){ return response.status(500).send({"message" : "Internal Server Error" , "err" : err}).end(); } response.status(200).send(result).end(); }) }) .post('/login',function (request,response){ var username = request.body.username; var password = md5(request.body.password); if((username == null || '') || (password == '' || null)){ return response.status(400).send({'message' : 'Parameters are missing'}).end(); } adminModel.findOne({ $and:[ {'username':username}, {'password':password}]}, function (err,admin){ if(err){ return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end(); } if(admin == null){ return response.status(400).send({'message' : 'Invalid Username OR Password'}).end(); } response.status(200).send(admin).end(); }) }) .post('/update',function (request,response){ var adminObj = request.body.admin; if(adminObj == null){ return response.status(400).send({'message' : 'Parameters are missing'}).end(); } adminModel.findOne({"_id" : adminObj._id,'password' : md5(adminObj.password)},function (err,admin){ if(err){ return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end(); } if(admin == null){ return response.status(400).send({'message' : 'Invalid Password'}).end(); } admin.password = md5(adminObj.password); admin.username = adminObj.username; admin.firstName = adminObj.firstName; admin.lastName = adminObj.lastName; admin.email = adminObj.email; admin.save(function (error,adminNew){ if(error){ return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end(); } response.status(200).send(adminNew).end(); }) }) }) .post('/addAdmin', function (request,response){ var admin = request.body.admin; if(admin == null || ''){ return response.status(400).send({'message' : 'Parameters are missing'}).end(); } admin.password = md5(admin.password); // admin.createdOn = moment().format('MM-DD-YYYY hh:mm a'); var newAdmin = new adminModel(admin); newAdmin.save(function (err,result){ if(err){ return response.status(500).send({'message' : 'Internal Server error. Please try again later','err' :err}).end(); } response.status(200).send(result).end(); }); }) module.exports = router;
Ember.Handlebars.helper('headTitle', function(title) { Ember.$('head').find('title').text(title); }, 'title');
/** * JSONDB - JSON Database Manager * * Manage JSON files as databases with JSONDB Query Language (JQL) * * This content is released under the GPL License (GPL-3.0) * * Copyright (c) 2016, Centers Technologies * * @package JSONDB * @author Nana Axel * @copyright Copyright (c) 2016, Centers Technologies * @license http://spdx.org/licenses/GPL-3.0 GPL License * @filesource */ /** * Class Cache * * @package Database * @subpackage Utilities * @category Cache * @author Nana Axel */ var Cache = (function () { function Cache() { } /** * Cache array * @access private * @static {object} */ Cache.cache = {}; /** * Gets cached data * @param {object|string} path The path to the table * @return {object|*} */ Cache.prototype.get = function (path) { if (typeof path === "object") { var results = []; for (var id in path) { results.push(this.get(id)); } return results; } if (!Cache.cache.hasOwnProperty(path)) { var Util = new (require('./Util'))(); Cache.cache[path] = Util.getTableData(path); } return Cache.cache[path]; }; /** * Updates the cached data for a table * @param {string} path The path to the table * @param {object|null} data The data to cache * @return {object} */ Cache.prototype.update = function (path, data) { data = data || null; if (null !== data) { Cache.cache[path] = data; } else { var Util = new (require('./Util'))(); Cache.cache[path] = Util.getTableData(path); } }; /** * Resets the cache * @return Cache */ Cache.prototype.reset = function () { Cache.cache = {}; return this; }; return Cache; })(); // Exports the module module.exports = new Cache();
// port.js class SingleData { constructor (port, order, type, value) { this.port = port this.order = order this.type = type this.value = value } } export let inputVariables = [] export let countVariables = [] // Add a new port export function Add (countInputPort) { countInputPort++ inputVariables[countInputPort] = [] countVariables[countInputPort] = 0 $('div#inputPortList').append( `<div class="list-group-item list-group-item-action" data-toggle="modal" data-target="#addNewModal${countInputPort}" id="inputPort${countInputPort}"> Port ${countInputPort}</div>` ) $(`#inputPort${countInputPort}`).click(function () { portDetail(countInputPort) }) return true } // Show Details of Port export function portDetail (countInputPort) { let container = '' let order = countVariables[countInputPort] // Show exist variables for (let variable of inputVariables[countInputPort]) { container += `<li class="list-group-item list-group-item-action"> <p class="mb-1 float-left text-primary">${variable.order + 1}&nbsp;&nbsp;&nbsp;&nbsp;</p> <p class="mb-1 float-left variable-type"><label class="variable-type" order="${variable.order}"> ${variable.type}</label>&nbsp;&nbsp;&nbsp;&nbsp;</p> <p class="mb-1 float-left"> <input type="text" class="form-control variable-value" order="${variable.order}" value="${variable.value}"> </p> </li>` } // Show variables list $('div#modalArea').html( `<div class="modal fade" id="addNewModal${countInputPort}" tabindex="-1" role="dialog" aria-labelledby="addNewModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="addNewModalLabel">Port ${countInputPort}</h5> <button class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <div class="form-row" id="globalDt"> <select class="form-control col-md-7 mx-sm-3 mb-3" id="dt"> <option value="Numeric">Numeric</option> <option value="Character">Character</option> <option value="Enumeration">Enumeration</option> <option value="Boolean">Boolean</option> <option value="Set">Set</option> <option value="Sequence">Sequence</option> <option value="String">String</option> <option value="Composite">Composite</option> <option value="Product">Product</option> <option value="Map">Map</option> <option value="Union">Union</option> <option value="Class">Class</option> </select> <button class="btn btn-outline-primary col-md-4 mb-3" id="addVariable">Add</button> </div> <!-- list of data types --> <div> <ul class="list-group" id="variables"> ${container} </ul> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" id="savePort">Save changes</button> <button class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div>` ) // Add a new variables $('button#addVariable').click(function () { let selectedValue = $('select#dt').val() console.log(order) $('ul#variables').append( `<li class="list-group-item list-group-item-action"> <p class="mb-1 float-left text-primary">${order + 1}&nbsp;&nbsp;&nbsp;&nbsp;</p> <p class="mb-1 float-left variable-type"><label class="variable-type" order=${order}> ${selectedValue}</label>&nbsp;&nbsp;&nbsp;&nbsp;</p> <p class="mb-1 float-left"> <input type="text" class="form-control variable-value" order="${order}" placeholder="${selectedValue}"> </p> </li>` ) order++ }) // Save port $('button#savePort').click(function () { let i for (i = 0; i < order; i++) { let type = $(`label.variable-type[order$="${i}"]`).text() let value = $(`input.variable-value[order$="${i}"]`).val() // console.log(type + '\n' + value) inputVariables[countInputPort][i] = new SingleData(countInputPort, i, type, value) console.log(`saved: port: ${countInputPort} order: ${i} type: ${type} value: ${value}`) } countVariables[countInputPort] = i console.log('total: ' + countVariables[countInputPort]) }) } export function Update (id, value) { let editId = 'div#' + id $(editId).text(value) }
function createDownloadLink(data,filename,componentId){ let a = document.createElement('a'); a.href = 'data:' + data; a.download = filename; a.innerHTML = 'Export'; a.class = 'btn' let container = document.getElementById(componentId); container.appendChild(a); } function closest(array, num) { let i = 0; let minDiff = 1000; let ans; for (i in array) { let m = Math.abs(num - array[i]); if (m < minDiff) { minDiff = m; ans = array[i]; } } return ans; } export {createDownloadLink, closest}
/* * Copyright (C) 2015 Max Planck Institute for Psycholinguistics * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ function init_cmdi() { $("a.toggle").click(function () { $(this).parent().parent().toggleClass('collapsed'); $(this).parent().parent().toggleClass('expanded'); }); } function expand_highlighted_cmdi() { $(".searchword").parents('.IMDI_group.cmdi').removeClass('collapsed'); $(".searchword").parents('.IMDI_group.cmdi').addClass('expanded'); } $(document).ready(init_cmdi);
jQuery(document).ready(function(){ if( $('.cd-stretchy-nav').length > 0 ) { var stretchyNavs = $('.cd-stretchy-nav'); stretchyNavs.each(function(){ var stretchyNav = $(this), stretchyNavTrigger = stretchyNav.find('.cd-nav-trigger'); stretchyNavTrigger.on('click', function(event){ event.preventDefault(); stretchyNav.toggleClass('nav-is-visible'); }); }); $(document).on('click', function(event){ ( !$(event.target).is('.cd-nav-trigger') && !$(event.target).is('.cd-nav-trigger span') ) && stretchyNavs.removeClass('nav-is-visible'); }); }; ///toggle en contenido $(".toggle-view li").on('click', function(e){ e.currentTarget.classList.toggle("active"); }); });
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = versionTransform; var _path2 = require('path'); var _path3 = _interopRequireDefault(_path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var packagePath = _path3.default.resolve(process.cwd(), './package.json'); var _require = require(packagePath); var version = _require.version; function versionTransform() { return { visitor: { Identifier: function Identifier(path) { if (path.node.name === 'VERSION') { path.replaceWithSourceString('"' + version + '"'); } } } }; };
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'image', 'eo', { alertUrl: 'Bonvolu tajpi la retadreson de la bildo', alt: 'Anstataŭiga Teksto', border: 'Bordero', btnUpload: 'Sendu al Servilo', button2Img: 'Ĉu vi volas transformi la selektitan bildbutonon en simplan bildon?', hSpace: 'Horizontala Spaco', img2Button: 'Ĉu vi volas transformi la selektitan bildon en bildbutonon?', infoTab: 'Informoj pri Bildo', linkTab: 'Ligilo', lockRatio: 'Konservi Proporcion', menu: 'Atributoj de Bildo', resetSize: 'Origina Grando', title: 'Atributoj de Bildo', titleButton: 'Bildbutonaj Atributoj', upload: 'Alŝuti', urlMissing: 'La fontretadreso de la bildo mankas.', vSpace: 'Vertikala Spaco', validateBorder: 'La bordero devas esti entjera nombro.', validateHSpace: 'La horizontala spaco devas esti entjera nombro.', validateVSpace: 'La vertikala spaco devas esti entjera nombro.' });
function drawChart(len){ var box = document.createElement('div'); box.setAttribute('style','width:500px;height:500px;border:1px solid black;display:flex;flex-direction:column'); for(var i=0; i<len; i++){ var row = document.createElement('div'); if(i<len-1){ row.setAttribute('style','border-bottom:1px solid black;display:flex;box-sizing: border-box; flex: 1;'); } else{ row.setAttribute('style','display:flex;box-sizing: border-box; flex: 1;'); } for(var j=0; j<len; j++){ var col = document.createElement('div'); if(i%2===0){ if(j%2===0){ col.setAttribute('style','background-color:white; flex: 1;'); } else{ col.setAttribute('style','background-color:black; flex: 1;'); } }else{ if(j%2===0){ col.setAttribute('style','background-color:black; flex: 1;'); } else{ col.setAttribute('style','background-color:white; flex: 1;'); } } row.appendChild(col); } box.appendChild(row); } document.body.appendChild(box); } drawChart(5);
var path = require('path') module.exports = { // Webpack aliases aliases: { quasar: path.resolve(__dirname, '../node_modules/quasar-framework/'), src: path.resolve(__dirname, '../src'), assets: path.resolve(__dirname, '../src/assets'), components: path.resolve(__dirname, '../src/components') }, // Progress Bar Webpack plugin format // https://github.com/clessg/progress-bar-webpack-plugin#options progressFormat: ' [:bar] ' + ':percent'.bold + ' (:msg)', // Default theme to build with ('ios' or 'mat') defaultTheme: 'mat', build: { env: require('./prod.env'), index: path.resolve(__dirname, '../dist/index.html'), publicPath: '', productionSourceMap: false, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'] }, dev: { env: require('./dev.env'), cssSourceMap: true, // auto open browser or not openBrowser: true, publicPath: '/', port: 8081, // If for example you are using Quasar Play // to generate a QR code then on each dev (re)compilation // you need to avoid clearing out the console, so set this // to "false", otherwise you can set it to "true" to always // have only the messages regarding your last (re)compilation. clearConsoleOnRebuild: false, // Proxy your API if using any. // Also see /build/script.dev.js and search for "proxy api requests" // https://github.com/chimurai/http-proxy-middleware proxyTable: {} } } /* * proxyTable example: * proxyTable: { // proxy all requests starting with /api '/api': { target: 'https://some.address.com/api', changeOrigin: true, pathRewrite: { '^/api': '' } } } */
// Copyright (c) 2012-2014 Lotaris SA // // This file is part of ROX Center. // // ROX Center 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. // // ROX Center 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 ROX Center. If not, see <http://www.gnu.org/licenses/>. App.autoModule('globalSettings', function() { var Settings = Backbone.Model.extend({ url: LegacyApiPath.builder('settings') }); var SettingsForm = Marionette.ItemView.extend({ template: 'globalSettings', ui: { ticketingSystemUrl: '#settings_ticketing_system_url', reportsCacheSize: '#settings_reports_cache_size', tagCloudSize: '#settings_tag_cloud_size', testOutdatedDays: '#settings_test_outdated_days', testPayloadsLifespan: '#settings_test_payloads_lifespan', testRunsLifespan: '#settings_test_runs_lifespan', fields: 'form :input', saveButton: 'form button', formControls: 'form .form-controls' }, events: { 'submit form': 'save' }, modelEvents: { 'change': 'refresh' }, appEvents: { 'maintenance:changed': 'updateControls' }, model: new Settings(), initialize: function() { App.bindEvents(this); }, onRender: function() { this.$el.button(); this.model.fetch(this.requestOptions()); this.updateControls(); }, setBusy: function(busy) { this.busy = busy; this.updateControls(); }, updateControls: function() { this.ui.saveButton.attr('disabled', this.busy || !!App.maintenance); this.ui.fields.attr('disabled', !!App.maintenance); }, refresh: function() { this.ui.ticketingSystemUrl.val(this.model.get('ticketing_system_url')); this.ui.reportsCacheSize.val(this.model.get('reports_cache_size')); this.ui.tagCloudSize.val(this.model.get('tag_cloud_size')); this.ui.testOutdatedDays.val(this.model.get('test_outdated_days')); this.ui.testPayloadsLifespan.val(this.model.get('test_payloads_lifespan')); this.ui.testRunsLifespan.val(this.model.get('test_runs_lifespan')); }, save: function(e) { e.preventDefault(); this.setNotice(false); this.setBusy(true); var options = this.requestOptions(); options.type = 'PUT'; options.success = _.bind(this.onSaved, this, 'success'); options.error = _.bind(this.onSaved, this, 'error'); this.model.save({ ticketing_system_url: this.ui.ticketingSystemUrl.val(), reports_cache_size: this.ui.reportsCacheSize.val(), tag_cloud_size: this.ui.tagCloudSize.val(), test_outdated_days: this.ui.testOutdatedDays.val(), test_payloads_lifespan: this.ui.testPayloadsLifespan.val(), test_runs_lifespan: this.ui.testRunsLifespan.val() }, options).always(_.bind(this.setBusy, this, false)); }, onSaved: function(result) { this.setNotice(result); if (result == 'success') { this.refresh(); } }, setNotice: function(type) { this.ui.saveButton.next('.text-success,.text-danger').remove(); if (type == 'success') { $('<span class="text-success" />').text(I18n.t('jst.globalSettings.success')).insertAfter(this.ui.saveButton).hide().fadeIn('fast'); } else if (type == 'error') { $('<span class="text-danger" />').text(I18n.t('jst.globalSettings.error')).insertAfter(this.ui.saveButton).hide().fadeIn('fast'); } }, requestOptions: function() { return { dataType: 'json', accepts: { json: 'application/json' } }; } }); this.addAutoInitializer(function(options) { options.region.show(new SettingsForm()); }); });
"use strict"; /* Copyright (C) 2013-2017 Bryan Hughes <bryan@nebri.us> Aquarium Control 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. Aquarium Control 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 Aquarium Control. If not, see <http://www.gnu.org/licenses/>. */ Object.defineProperty(exports, "__esModule", { value: true }); // Force to "any" type, otherwise TypeScript thinks the type is too strict exports.cleaningValidationSchema = { type: 'object', properties: { time: { required: true, type: 'number' }, bioFilterReplaced: { required: true, type: 'boolean' }, mechanicalFilterReplaced: { required: true, type: 'boolean' }, spongeReplaced: { required: true, type: 'boolean' } } }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSUNsZWFuaW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbW1vbi9zcmMvSUNsZWFuaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7Ozs7O0VBZUU7O0FBYUYsMEVBQTBFO0FBQzdELFFBQUEsd0JBQXdCLEdBQVE7SUFDM0MsSUFBSSxFQUFFLFFBQVE7SUFDZCxVQUFVLEVBQUU7UUFDVixJQUFJLEVBQUU7WUFDSixRQUFRLEVBQUUsSUFBSTtZQUNkLElBQUksRUFBRSxRQUFRO1NBQ2Y7UUFDRCxpQkFBaUIsRUFBRTtZQUNqQixRQUFRLEVBQUUsSUFBSTtZQUNkLElBQUksRUFBRSxTQUFTO1NBQ2hCO1FBQ0Qsd0JBQXdCLEVBQUU7WUFDeEIsUUFBUSxFQUFFLElBQUk7WUFDZCxJQUFJLEVBQUUsU0FBUztTQUNoQjtRQUNELGNBQWMsRUFBRTtZQUNkLFFBQVEsRUFBRSxJQUFJO1lBQ2QsSUFBSSxFQUFFLFNBQVM7U0FDaEI7S0FDRjtDQUNGLENBQUMifQ==
var Util = require( 'findhit-util' ); // ----------------------------------------------------------------------------- // Data handles wizard data into session function Data ( route ) { var session = route.req[ route.router.options.reqSessionKey ]; // If there isn't a `wiz` object on session, just add it if( ! session.wiz ) { session.wiz = {}; } // Save route on this instance this.route = route; // Gather session from session, or just create a new one this.session = session.wiz[ route.id ] || ( session.wiz[ route.id ] = {} ); // Add a control variable for changed state this.changed = false; return this; }; // Export Data module.exports = Data; /* instance methods */ Data.prototype.currentStep = function ( step ) { // If there is no `step` provided, it means that we wan't to get! // Otherwise, lets set it! }; /* Data.prototype.save = function () { }; Data.prototype.destroy = function () { }; */ Data.prototype.getFromStep = function ( step ) { };
IWitness.ErrorsView = Ember.View.extend({ classNames: ["error-bubble"], classNameBindings: ["isError"], isError: function() { return !!this.get("error"); }.property("error") });
#!/usr/bin/env node /*jshint -W100*/ 'use strict'; /** * ニコニコ動画ログインサンプル * * 以下のusernameとpasswordを書き換えてから実行してください */ var username = 'hogehoge'; var password = 'fugafuga'; var client = require('../index'); console.info('ニコニコTOPページにアクセスします'); client.fetch('http://nicovideo.jp/') .then(function (result) { console.info('ログインリンクをクリックします'); return result.$('#sideNav .loginBtn').click(); }) .then(function (result) { console.info('ログインフォームを送信します'); return result.$('#login_form').submit({ mail_tel: username, password: password }); }) .then(function (result) { console.info('ログイン可否をチェックします'); if (! result.response.headers['x-niconico-id']) { throw new Error('login failed'); } console.info('クッキー', result.response.cookies); console.info('マイページに移動します'); return client.fetch('http://www.nicovideo.jp/my/top'); }) .then(function (result) { console.info('マイページに表示されるアカウント名を取得します'); console.info(result.$('#siteHeaderUserNickNameContainer').text()); }) .catch(function (err) { console.error('エラーが発生しました', err.message); }) .finally(function () { console.info('終了します'); });
Ext.define("Voyant.notebook.util.Embed", { transferable: ['embed'], embed: function() { // this is for instances embed.apply(this, arguments); }, constructor: function(config) { var me = this; }, statics: { i18n: {}, api: { embeddedParameters: undefined, embeddedConfig: undefined }, embed: function(cmp, config) { if (this.then) { this.then(function(embedded) { embed.call(embedded, cmp, config) }) } else if (Ext.isArray(cmp)) { Voyant.notebook.util.Show.SINGLE_LINE_MODE=true; show("<table><tr>"); cmp.forEach(function(embeddable) { show("<td>"); if (Ext.isArray(embeddable)) { if (embeddable[0].embeddable) { embeddable[0].embed.apply(embeddable[0], embeddable.slice(1)) } else { embed.apply(this, embeddable) } } else { embed.apply(this, embeddable); } show("</td>") }) // for (var i=0; i<arguments.length; i++) { // var unit = arguments[i]; // show("<td>") // unit[0].embed.call(unit[0], unit[1], unit[2]); // show("</td>") // } show("</tr></table>") Voyant.notebook.util.Show.SINGLE_LINE_MODE=false; return } else { // use the default (first) embeddable panel if no panel is specified if (this.embeddable && (!cmp || Ext.isObject(cmp))) { // if the first argument is an object, use it as config instead if (Ext.isObject(cmp)) {config = cmp;} cmp = this.embeddable[0]; } if (Ext.isString(cmp)) { cmp = Ext.ClassManager.getByAlias('widget.'+cmp.toLowerCase()) || Ext.ClassManager.get(cmp); } var isEmbedded = false; if (Ext.isFunction(cmp)) { var name = cmp.getName(); if (this.embeddable && Ext.Array.each(this.embeddable, function(item) { if (item==name) { config = config || {}; var embeddedParams = {}; for (key in Ext.ClassManager.get(Ext.getClassName(cmp)).api) { if (key in config) { embeddedParams[key] = config[key] } } if (!embeddedParams.corpus) { if (Ext.getClassName(this)=='Voyant.data.model.Corpus') { embeddedParams.corpus = this.getId(); } else if (this.getCorpus) { var corpus = this.getCorpus(); if (corpus) { embeddedParams.corpus = this.getCorpus().getId(); } } } Ext.applyIf(config, { style: 'width: '+(config.width || '90%') + (Ext.isNumber(config.width) ? 'px' : '')+ '; height: '+(config.height || '400px') + (Ext.isNumber(config.height) ? 'px' : '') }); delete config.width; delete config.height; var corpus = embeddedParams.corpus; delete embeddedParams.corpus; Ext.applyIf(embeddedParams, Voyant.application.getModifiedApiParams()); var embeddedConfigParamEncodded = Ext.encode(embeddedParams); var embeddedConfigParam = encodeURIComponent(embeddedConfigParamEncodded); var iframeId = Ext.id(); var url = Voyant.application.getBaseUrlFull()+"tool/"+name.substring(name.lastIndexOf(".")+1)+'/?'; if (true || embeddedConfigParam.length>1800) { show('<iframe style="'+config.style+'" id="'+iframeId+'" name="'+iframeId+'"></iframe>'); var dfd = Voyant.application.getDeferred(this); Ext.Ajax.request({ url: Voyant.application.getTromboneUrl(), params: { tool: 'resource.StoredResource', storeResource: embeddedConfigParam } }).then(function(response) { var json = Ext.util.JSON.decode(response.responseText); var params = { minimal: true, embeddedApiId: json.storedResource.id } if (corpus) { params.corpus = corpus; } Ext.applyIf(params, Voyant.application.getModifiedApiParams()); document.getElementById(iframeId).setAttribute("src",url+Ext.Object.toQueryString(params)); dfd.resolve(); }).otherwise(function(response) { showError(response); dfd.reject(); }) } else { show('<iframe src="'+url+embeddedConfigParam+'" style="'+config.style+'" id="'+iframeId+'" name="'+iframeId+'"></iframe>'); } isEmbedded = true; return false; } }, this)===true) { Voyant.notebook.util.Embed.showWidgetNotRecognized.call(this); } if (!isEmbedded) { var embedded = Ext.create(cmp, config); embedded.embed(config); isEmbedded = true; } } if (!isEmbedded) { Voyant.notebook.util.Embed.showWidgetNotRecognized.call(this); } } }, showWidgetNotRecognized: function() { var msg = Voyant.notebook.util.Embed.i18n.widgetNotRecognized; if (this.embeddable) { msg += Voyant.notebook.util.Embed.i18n.tryWidget+'<ul>'+this.embeddable.map(function(cmp) { var widget = cmp.substring(cmp.lastIndexOf(".")+1).toLowerCase() return "\"<a href='../../docs/#!/guide/"+widget+"' target='voyantdocs'>"+widget+"</a>\"" }).join(", ")+"</ul>" } showError(msg) } } }) embed = Voyant.notebook.util.Embed.embed
var Base = require("./../plugin"); module.exports = class extends Base { isDisableSelfAttackPriority(self, rival) { return true; } isDisableEnemyAttackPriority(self, rival) { return true; } }
/** * Module dependencies. */ var express = require('express') , http = require('http') , path = require('path') , mongo = require('mongodb') , format = require('util').format; var app = express(); // all environments app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(path.join(__dirname, 'public'))); // development only if ('development' == app.get('env')) { app.use(express.errorHandler()); } var server = new mongo.Server("localhost", 27017, {auto_reconnect: true}); var dbManager = new mongo.Db("applique-web", server, {safe:true}); dbManager.open(function(err, db) { require('./routes/index')(app, db); app.listen(app.get('port'), function(){ console.log('Express server listening on port ' + app.get('port')); }); });
"use strict"; module.exports = function registerDefaultRoutes( baseUrl, app, opts ){ var controller = opts.controller; var listRouter = app.route( baseUrl ); if( opts.all ){ listRouter = listRouter.all( opts.all ); } if( opts.list ){ listRouter.get( opts.list ); } if( opts.create ){ listRouter.post( opts.create ); } listRouter.get( controller.list ) .post( controller.create ); var resourceRouter = app.route( baseUrl + "/:_id" ); if( opts.all ){ resourceRouter.all( opts.all ); } if( opts.retrieve ){ resourceRouter.get(opts.retrieve); } if(opts.update){ resourceRouter.patch(opts.update); } if(opts.remove){ resourceRouter.delete(opts.remove); } resourceRouter.get( controller.retrieve ) .patch( controller.update ) .delete( controller.remove ); return { list: listRouter, resources: resourceRouter }; };
/*** * Copyright (c) 2013 John Krauss. * * This file is part of Crashmapper. * * Crashmapper 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. * * Crashmapper 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 Crashmapper. If not, see <http://www.gnu.org/licenses/>. * ***/ /*jslint browser: true, nomen: true, sloppy: true*/ /*globals Backbone, Crashmapper */ /** * @param {Object} options * @constructor * @extends Backbone.View */ Crashmapper.AppView = Backbone.View.extend({ id: 'app', /** * @this {Crashmapper.AppView} */ initialize: function () { this.about = new Crashmapper.AboutView({}).render(); this.about.$el.appendTo(this.$el).hide(); this.map = new Crashmapper.MapView({}); this.map.$el.appendTo(this.$el); }, /** * @this {Crashmapper.AppView} */ render: function () { return this; } });
import altConnect from 'higher-order-components/altConnect'; import { STATUS_OK } from 'app-constants'; import ItemStore from 'stores/ItemStore'; import ProgressBar from '../components/ProgressBar'; const mapStateToProps = ({ itemState }) => ({ progress: itemState.readingPercentage, hidden: itemState.status !== STATUS_OK, }); mapStateToProps.stores = { ItemStore }; export default altConnect(mapStateToProps)(ProgressBar); // WEBPACK FOOTER // // ./src/js/app/modules/item/containers/ProgressBarContainer.js
/// 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.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js * @description Strict Mode - SyntaxError is not thrown if a function is created using a Function constructor that has two identical parameters, which are separated by a unique parameter name and there is no explicit 'use strict' in the function constructor's body * @onlyStrict */ function testcase() { "use strict"; var foo = new Function("baz", "qux", "baz", "return 0;"); return true; } runTestCase(testcase);
function createCategorySlider(selector) { $(document).ready(function(){ var checkforloadedcats = []; var firstImage = $(selector).find('img').filter(':first'); if(firstImage.length > 0){ checkforloadedcats[selector] = setInterval(function() { var image = firstImage.get(0); if (image.complete || image.readyState == 'complete' || image.readyState == 4) { clearInterval(checkforloadedcats[selector]); $(selector).flexslider({ namespace: "", animation: "slide", easing: "easeInQuart", slideshow: false, animationLoop: false, animationSpeed: 700, pauseOnHover: true, controlNav: false, itemWidth: 238, minItems: flexmin, maxItems: flexmax, move: 0 }); } }, 20); } $(window).resize(function() { try { $(selector).flexslider(0); if($('#center_column').width()<=280){ $(selector).data('flexslider').setOpts({minItems: 1, maxItems: 1}); } else if($('#center_column').width()<=440){ $(selector).data('flexslider').setOpts({minItems: grid_size_ms, maxItems: grid_size_ms});} else if($('#center_column').width()<963){ $(selector).data('flexslider').setOpts({minItems: grid_size_sm, maxItems: grid_size_sm});} else if($('#center_column').width()>=1240){ $(selector).data('flexslider').setOpts({minItems: grid_size_lg, maxItems: grid_size_lg});} else if($('#center_column').width()>=963){ $(selector).data('flexslider').setOpts({minItems: grid_size_md, maxItems: grid_size_md});} } catch(e) { // handle all your exceptions here } }); }); }
(function (angular) { 'use strict'; var config = { githubApiUrl: 'https://api.github.com/', }; angular.module('myGithubApp').constant('config', config); })(angular);
'use strict'; angular.module('aurea') .directive('d3Bars', function ($window, $timeout, d3Service) { return { restrict: 'EA', scope: { data: '=', onClick: '&' }, link: function (scope, ele, attrs) { d3Service.d3().then(function (d3) { var margin = parseInt(attrs.margin) || 20, barHeight = parseInt(attrs.barHeight) || 20, barPadding = parseInt(attrs.barPadding) || 5; var svg = d3.select(ele[0]) .append('svg') .style('width', '100%'); // Browser onresize event window.onresize = function () { scope.$apply(); }; // Watch for resize event scope.$watch(function () { return angular.element($window)[0].innerWidth; }, function () { scope.render(scope.data); }); scope.$watch('data', function (newData) { scope.render(newData); }, true); scope.render = function (data) { // remove all previous items before render svg.selectAll('*').remove(); // If we don't pass any data, return out of the element if (!data) return; // setup variables var width = d3.select(ele[0]).node().offsetWidth - margin, // calculate the height height = scope.data.length * (barHeight + barPadding), // Use the category20() scale function for multicolor support color = d3.scale.category20(), // our xScale xScale = d3.scale.linear() .domain([0, 31]) .range([0, width]); // set the height based on the calculations above svg.attr('height', height); //create the rectangles for the bar chart svg.selectAll('rect') .data(data).enter() .append('rect') .attr('height', barHeight) .attr('width', 140) .attr('x', 110) .attr('y', function (d, i) { return i * (barHeight + barPadding); }) .attr('fill', function (d) { return color(d.value); }) .attr('width', function (d) { return xScale(d.value); }); var baseSelection = svg.selectAll('text'); baseSelection .data(data) .enter() .append('text') .attr('font-family', 'monospace') .attr('fill', '#000') .attr('y', function (d, i) { return i * (barHeight + barPadding) + 15; }) .attr('x', 15) .text(function (d) { return d.name; }); baseSelection .data(data) .enter() .append('text') .attr('font-family', 'monospace') .attr('fill', '#fff') .attr('y', function (d, i) { return i * (barHeight + barPadding) + 15; }) .attr('x', 114) .text(function (d) { return d.value > 0 ? d.value : ''; }); }; }); } }; });
define(['Scripts/App/CommentsScraper'], function(CommentsScraper) { describe('myFilter', function() { var failTest = function(error) { expect(error).toBeUndefined(); }; beforeEach(function(){ jasmine.addMatchers({ toBeEqualComment: function() { return { compare: function (actual, expected) { return { pass: actual.author === expected.author && actual.commentType === expected.commentType && actual.link === expected.link && actual.x === expected.x && actual.y === expected.y }; } }; } }); jasmine.getFixtures().fixturesPath = 'base/Tests/Fixtures/'; loadFixtures('sampleComments.html'); }); it('should give correct comment object when given correct comment html', function () { var expected = { author: 'Vaniver', commentType: 'Parent', link: 'http://lesswrong.com/lw/n93/open_thread_feb_01_feb_07_2016/d2us', x: 1454336014000, y: 2 }; //var employee = CommentsScraper.getCommentObj($('.comment')[0].outerHTML); //expect(employee.author).toBeEqualComment('ScottL'); }); // Our first test!!!! it('about greeting says "This is the about message2!"', function () { //console.log(CommentsScraper); //CommentsScraper.getCommentData($('.comment')[0].outerHTML).then(function(data) { // console.log(data); //}); }); }); });
const actions = { // Video ended ended({dispatch,commit}, video) { video.isPlaying = false; dispatch('next', video); commit('PLAYING',video); }, // Add video to queue addToQueue({state, dispatch, commit }, obj) { var index = _.findIndex(state.queue, function(o) { return o.videoId == obj.videoId; }); if (index == -1) commit('ADD_TO_QUEUE', obj); }, // Play a video playVideo({ state, dispatch, commit }, video) { if (!state.playing || state.playing.videoId != video.videoId) { state.player.loadVideoById({ videoId: video.videoId, suggestedQuality: 'small' }); } else { state.player.playVideo(); } video.isPlaying = true; commit('PLAYING',video); dispatch('addToQueue', video); }, // Puase a video pauseVideo({ state, dispatch, commit }, video) { video.isPlaying = false; state.player.pauseVideo(); commit('PLAYING',video); }, // Play next song next({ state, dispatch, commit }) { if (state.queue && state.playing) { var index = _.findIndex(state.queue, function(o) { return o.videoId == state.playing.videoId; }); if (index != -1 && state.queue[index + 1]) { dispatch('playVideo', state.queue[index + 1]); } } }, // Play previous song previous({ state, dispatch, commit }) { if (state.queue && state.playing) { var index = _.findIndex(state.queue, function(o) { return o.videoId == state.playing.videoId; }); if (index && state.queue[index - 1]) { dispatch('playVideo', state.queue[index - 1]); } } }, addToFav({state,commit},video){ var index = _.findIndex(state.favs,function(o){ return o.videoId == video.videoId; }); // Add to favs if not exists if(index == -1) { commit('ADD_TO_FAVS',video); state.localStorage.setItem("favs", state.favs); } else if(index >= 0) { commit('REMOVE_FROM_FAVS',index); state.localStorage.setItem("favs", state.favs); } }, // Add localforge to state and load data from localStorage loadLocalStorage({state,commit},localStorage){ commit('LOAD_LOCAL_STORAGE',localStorage); state.localStorage.getItem('favs').then(function(list) { if(list) commit('ADD_TO_FAVS',list); }).catch(function(err) { console.log(err); }); } } export default actions;
// core import React from 'react'; import PropTypes from 'react'; // components import Loading from '../../components/loading/Loading'; // styles var style = require('./_index.scss'); // data var Timeline = require('react-twitter-widgets').Timeline; var Twitter = React.createClass({ getInitialState: function(){ return { isLoading: true } }, componentWillMount: function(){ this.setState({ isLoading: true }) }, componentDidMount: function(){ this.setState({ isLoading: false }) }, render: function(){ if(this.state.isLoading === true){ return ( <Loading /> ) } else { return ( <div className='twitter-container'> <Timeline className='twitter-component' dataSource={{ sourceType: 'widget', widgetId: '844245316706566144' }} /> </div> ) } } }); export default Twitter;
function Greeter(person) { return "Hello, " + person; } var RandomGuy = "Random Dude"; alert(Greeter(RandomGuy)); //# sourceMappingURL=HelloWorld.js.map
HostCMS 6.7 = 9fdd2118a94f53ca1c411a7629edf565
var chai = require('chai') , sinon = require('sinon') , sinonChai = require('sinon-chai') , expect = chai.expect , Promise = require('es6-promise').Promise , UpdateTemplatesController = require('../../../platypi-cli/controllers/cli/updatetemplates.controller'); chai.use(sinonChai); describe('TemplateUpdate controller', function () { it('should return a new controller', function (done) { try { var controller = new UpdateTemplatesController({ viewStuff: 'fakeview' }); expect(controller).to.be.an.object; expect(controller.model).to.be.an.object; expect(controller.view).to.be.an.object; expect(controller.view.model).to.equal(controller.model); done(); } catch (e) { done(e); } }); describe('getResponseView method', function () { var sandbox, controller, updateFunc; beforeEach(function (done) { sandbox = sinon.sandbox.create(); controller = new UpdateTemplatesController({ viewStuff: 'fakeview' }); updateFunc = sandbox.stub(controller.__provider, 'update'); done(); }); afterEach(function (done) { sandbox.restore(); done(); }); it('should call the clean method and return the view', function (done) { updateFunc.returns(Promise.resolve('')); controller.getResponseView().then(function (view) { try { expect(updateFunc).to.have.been.called; expect(controller.model.successMessage).not.to.equal(''); expect(view).to.exist; done(); } catch (e) { done(e); } }, function (err) { done(err); }); }); it('should call the update method and throw an error', function (done) { updateFunc.returns(Promise.reject('Err')); controller.getResponseView().then(function (view) { try { expect(updateFunc).to.have.been.called; expect(controller.model.errorMessage).not.to.equal(''); expect(view).to.exist; done(); } catch (e) { done(e); } }, function (err) { done(err); }); }); }); });
var path = require('path'); var Q = require('q'); var fs = require('fs'); var mv = require('mv'); var Upload = require('./upload.model'); exports.upload = function (req, res) { var tmpPath = req.files[0].path; var newFileName = Math.random().toString(36).substring(7)+path.extname(tmpPath); var targetPath = path.resolve(process.env.UPLOAD_PATH, newFileName); var defer = Q.defer(); mv(tmpPath, targetPath, function (err) { if (err) { return nextIteration.reject(err); } targetPath = targetPath.substring(targetPath.indexOf('upload')); Upload.createUpload(targetPath).then(function(upload) { defer.resolve(upload); }, function(err) { defer.reject(err); }); }); defer.promise.then(function (upload) { res.json({ status: true, data: upload._id }); }, function(err) { console.log(err); res.json({ status: false, reason: err.toString() }); }); };
// Karma configuration // Generated on Thu Jul 24 2014 18:11:41 GMT-0700 (PDT) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'bower_components/angular-resource/angular-resource.js', 'src/*.js', 'test/*.js' ], // list of files to exclude exclude: [ ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: [], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false }); };
/*global require,module,console,angular */ require("angular/angular"); require("angular-route/angular-route"); angular.module("RegistrationApp", ["ngRoute"]); angular.module("RegistrationApp").controller("RegistrationCtrl", require("./components/registration/controller")); angular.module("RegistrationApp").directive("myRegistration", require("./components/registration/directive")); angular.module("MainApp", [ "RegistrationApp" ]); angular.module("MainApp").config(["$routeProvider", "$locationProvider", require("./app.routes")]);
'use strict'; var ParameterDef = function(object) { this.id = object.id; this.summary = object.summary; this.description = object.description; this.type = object.type; this.mandatory = object.mandatory; this.defaultValue = object.defaultValue; }; module.exports = ParameterDef;
Fox.define('views/email/fields/from-email-address', 'views/fields/link', function (Dep) { return Dep.extend({ listTemplate: 'email/fields/from-email-address/detail', detailTemplate: 'email/fields/from-email-address/detail', }); });
export function Bounds(width, height) { this.width = width; this.height = height; } Bounds.prototype.equals = function(o) { return ((o != null) && (this.width == o.width) && (this.height == o.height)); };
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue'; import BootstrapVue from 'bootstrap-vue'; import 'bootstrap-vue/dist/bootstrap-vue.css'; import 'bootstrap/dist/css/bootstrap.css'; import { mapActions } from 'vuex'; import App from './App'; import websock from './websock'; import * as mtype from './store/mutation-types'; import store from './store'; Vue.config.productionTip = false; Vue.use(BootstrapVue); /* eslint-disable no-new */ new Vue({ el: '#app', template: '<App/>', store, components: { App }, created() { websock.connect(message => this.newMessage(message)); setInterval(() => { store.commit(mtype.UPDATE_CALLS_DUR); }, 1000); }, methods: mapActions(['newMessage']), });
/** * Created by caimiao on 15-6-14. */ define(function(require, exports, module) { exports.hello= function (echo) { alert(echo); }; })
'use strict' // untuk status uploader const STATUS_INITIAL = 0 const STATUS_SAVING = 1 const STATUS_SUCCESS = 2 const STATUS_FAILED = 3 // base url api const BASE_URL = 'http://localhost:3000' const app = new Vue({ el: '#app', data: { message: 'Hello', currentStatus: null, uploadError: null, uploadFieldName: 'image', uploadedFiles: [], files:[] }, computed: { isInitial() { return this.currentStatus === STATUS_INITIAL; }, isSaving() { return this.currentStatus === STATUS_SAVING; }, isSuccess() { return this.currentStatus === STATUS_SUCCESS; }, isFailed() { return this.currentStatus === STATUS_FAILED; } }, // computed methods: { // reset form to initial state getAllFile () { let self = this axios.get(`${BASE_URL}/files`) .then(response => { self.files = response.data }) }, // getAllFile() deleteFile (id) { axios.delete(`${BASE_URL}/files/${id}`) .then(r => { this.files.splice(id, 1) }) }, reset() { this.currentStatus = STATUS_INITIAL; this.uploadedFiles = []; this.uploadError = null; }, // reset() // upload data to the server save(formData) { console.log('save') console.log('form data', formData) this.currentStatus = STATUS_SAVING; axios.post(`${BASE_URL}/files/add`, formData) .then(up => { // console.log('up', up) this.uploadedFiles = [].concat(up) this.currentStatus = STATUS_SUCCESS }) .catch(e => { console.log(e.response.data) this.currentStatus = STATUS_FAILED }) }, // save() filesChange(fieldName, fileList) { // handle file changes const formData = new FormData(); formData.append('image', fileList[0]) console.log(formData) this.save(formData); } // filesChange() }, // methods mounted () { this.reset() }, created () { this.getAllFile() } })
sap.ui.jsview(ui5nameSpace, { // define the (default) controller type for this View getControllerName: function() { return "my.own.controller"; }, // defines the UI of this View createContent: function(oController) { // button text is bound to Model, "press" action is bound to Controller's event handler return; } });
#pragma strict var playerFinalScore: int; var Users: List.< GameObject >; var userData: GameObject[]; var maxPlayers: int; var gameManager: GameObject; var currentPlayer: int; var currentName: String; function Awake () { //var users :GameObject = GameObject.Find("_UserControllerFB"); userData = GameObject.FindGameObjectsWithTag("Player"); } function Start() { gameManager = GameObject.Find("__GameManager"); NotificationCenter.DefaultCenter().AddObserver(this, "PlayerChanger"); } function Update () { if(Users.Count>0) playerFinalScore = Users[0].GetComponent(_GameManager).playerFinalScore; } function PlayerChanger() { currentPlayer++; for(var i: int; i<Users.Count; i++) { if(i!=currentPlayer)Users[i].SetActive(false); else Users[i].SetActive(true); } print("Change Player"); if(currentPlayer>maxPlayers) currentPlayer=0; } function OnLevelWasLoaded(level: int) { maxPlayers = userData.Length; gameManager = GameObject.Find("__GameManager"); for(var i: int; i< userData.Length; i++) { if(i!=0)Users[i].SetActive(false); Users[i].name = userData[i].name; currentName = Users[0].name; Users[i].transform.parent = gameManager.transform; } }
/*jshint expr:true */ describe("Services: Core System Messages", function() { beforeEach(module("risevision.core.systemmessages")); beforeEach(module(function ($provide) { //stub services $provide.service("$q", function() {return Q;}); $provide.value("userState", { isRiseVisionUser: function () {return true; } }); })); it("should exist", function() { inject(function(getCoreSystemMessages) { expect(getCoreSystemMessages).be.defined; }); }); });
// Copyright 2015, 2016 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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. // Parity 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 Parity. If not, see <http://www.gnu.org/licenses/>. import React, { Component, PropTypes } from 'react'; import { observer } from 'mobx-react'; import { Button, GasPriceEditor } from '~/ui'; import TransactionMainDetails from '../TransactionMainDetails'; import TransactionPendingForm from '../TransactionPendingForm'; import styles from './transactionPending.css'; import * as tUtil from '../util/transaction'; @observer export default class TransactionPending extends Component { static contextTypes = { api: PropTypes.object.isRequired }; static propTypes = { className: PropTypes.string, date: PropTypes.instanceOf(Date).isRequired, focus: PropTypes.bool, gasLimit: PropTypes.object, id: PropTypes.object.isRequired, isSending: PropTypes.bool.isRequired, isTest: PropTypes.bool.isRequired, nonce: PropTypes.number, onConfirm: PropTypes.func.isRequired, onReject: PropTypes.func.isRequired, store: PropTypes.object.isRequired, transaction: PropTypes.shape({ data: PropTypes.string, from: PropTypes.string.isRequired, gas: PropTypes.object.isRequired, gasPrice: PropTypes.object.isRequired, to: PropTypes.string, value: PropTypes.object.isRequired }).isRequired }; static defaultProps = { focus: false }; gasStore = new GasPriceEditor.Store(this.context.api, { gas: this.props.transaction.gas.toFixed(), gasLimit: this.props.gasLimit, gasPrice: this.props.transaction.gasPrice.toFixed() }); componentWillMount () { const { store, transaction } = this.props; const { from, gas, gasPrice, to, value } = transaction; const fee = tUtil.getFee(gas, gasPrice); // BigNumber object const gasPriceEthmDisplay = tUtil.getEthmFromWeiDisplay(gasPrice); const gasToDisplay = tUtil.getGasDisplay(gas); const totalValue = tUtil.getTotalValue(fee, value); this.setState({ gasPriceEthmDisplay, totalValue, gasToDisplay }); this.gasStore.setEthValue(value); store.fetchBalances([from, to]); } render () { return this.gasStore.isEditing ? this.renderGasEditor() : this.renderTransaction(); } renderTransaction () { const { className, focus, id, isSending, isTest, store, transaction } = this.props; const { totalValue } = this.state; const { from, value } = transaction; const fromBalance = store.balances[from]; return ( <div className={ `${styles.container} ${className}` }> <TransactionMainDetails className={ styles.transactionDetails } from={ from } fromBalance={ fromBalance } gasStore={ this.gasStore } id={ id } isTest={ isTest } totalValue={ totalValue } transaction={ transaction } value={ value } /> <TransactionPendingForm address={ from } focus={ focus } isSending={ isSending } onConfirm={ this.onConfirm } onReject={ this.onReject } /> </div> ); } renderGasEditor () { const { className } = this.props; return ( <div className={ `${styles.container} ${className}` }> <GasPriceEditor store={ this.gasStore }> <Button label='view transaction' onClick={ this.toggleGasEditor } /> </GasPriceEditor> </div> ); } onConfirm = (data) => { const { id, transaction } = this.props; const { password, wallet } = data; const { gas, gasPrice } = this.gasStore.overrideTransaction(transaction); this.props.onConfirm({ gas, gasPrice, id, password, wallet }); } onReject = () => { this.props.onReject(this.props.id); } toggleGasEditor = () => { this.gasStore.setEditing(false); } }
var _ = require("lodash"); module.exports = { // ensure client accepts json json_request: function(req, res, next){ if(req.accepts("application/json")) return next(); res.stash.code = 406; _.last(req.route.stack).handle(req, res, next); }, // init response init_response: function(req, res, next){ res.stash = {}; res.response_start = new Date(); return next(); }, // respond to client handle_response: function(req, res, next){ res.setHeader("X-Navigator-Response-Time", new Date() - res.response_start); res.stash = _.defaults(res.stash, { code: 404 }); if(_.has(res.stash, "body")) res.status(res.stash.code).json(res.stash.body); else res.sendStatus(res.stash.code); } }
var struct_m_s_vehicle_1_1_lane_q = [ [ "allowsContinuation", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#a1491a03d3e914ce9f78fe892c6f8594b", null ], [ "bestContinuations", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#a2fc7b1df76210eff08026dbd53c13312", null ], [ "bestLaneOffset", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#aa7f926a77c7d33c071c620ae7e9d0ac1", null ], [ "lane", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#a3df6bd9b94a7e3e4795547feddf68bf2", null ], [ "length", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#a637a05a2b120bacaf781181febc5b3bb", null ], [ "nextOccupation", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#acf8243e1febeb75b139a8b10bb679107", null ], [ "occupation", "d3/d89/struct_m_s_vehicle_1_1_lane_q.html#a51e793a9c0bfda3e315c62f579089f82", null ] ];
jQuery(document).ready(function($) { $('#slide-left').flexslider({ animation: "slide", controlNav: "thumbnails", start: function(slider) { $('ol.flex-control-thumbs li img.flex-active').parent('li').addClass('active'); } }); }); jQuery(document).ready(function($) { $('#slide').flexslider({ animation: "slide", controlNav: false, directionNav: true }); });
// NOTE: nbApp is defined in app.js nbApp.directive("languageContainerDirective", function() { return { restrict : 'E', templateUrl : 'js/templates/language-container.html', scope: { color: "@", language: "@", reading: "@", writing: "@", listening: "@", speaking: "@", flag: "@", }, link: function(scope, element, attrs) { scope.color = attrs.color; scope.language = attrs.language; scope.reading = attrs.reading; scope.writing = attrs.writing; scope.listening = attrs.listening; scope.speaking = attrs.speaking; scope.flag = attrs.flag; scope.$watch('language', function(nV, oV) { if(nV){ RadarChart.defaultConfig.color = function() {}; RadarChart.defaultConfig.radius = 3; RadarChart.defaultConfig.w = 250; RadarChart.defaultConfig.h = 250; /* * 0 - No Practical Proficiency * 1 - Elementary Proficiency * 2 - Limited Working Proficiency * 3 - Minimum Professional Proficiency * 4 - Full Professional Proficiency * 5 - Native or Bilingual Proficiency Read: the ability to read and understand texts written in the language Write: the ability to formulate written texts in the language Listen: the ability to follow and understand speech in the language Speak: the ability to produce speech in the language and be understood by its speakers. */ var data = [ { className: attrs.language, // optional can be used for styling axes: [ {axis: "Reading", value: attrs.reading}, {axis: "Writing", value: attrs.writing}, {axis: "Listening", value: attrs.listening}, {axis: "Speaking", value: attrs.speaking}, ] }, ]; function mapData() { return data.map(function(d) { return { className: d.className, axes: d.axes.map(function(axis) { return {axis: axis.axis, value: axis.value}; }) }; }); } // chart.config.w; // chart.config.h; // chart.config.axisText = true; // chart.config.levels = 5; // chart.config.maxValue = 5; // chart.config.circles = true; // chart.config.actorLegend = 1; var chart = RadarChart.chart(); var cfg = chart.config(); // retrieve default config cfg = chart.config({axisText: true, levels: 5, maxValue: 5, circles: true}); // retrieve default config var svg = d3.select('.' + attrs.language).append('svg') .attr('width', 250) .attr('height', 270); svg.append('g').classed('single', 1).datum(mapData()).call(chart); console.log('Rendering new language Radar Viz! --> ' + attrs.language); } }) } }; });
// app.photoGrid var Backbone = require("backbone"); // var _ = require("underscore"); var $ = require("jquery"); var ImageGridFuncs = require("./photo_grid_functions"); var ImageCollection = require("../models/photo_grid_image_collection"); var ImageView = require("./photo_grid_image"); module.exports = Backbone.View.extend({ el: '#photo-grid', initialize: function () { "use strict"; if (this.$el.length === 1) { var gridJSON = this.$(".hid"); if (gridJSON.length === 1) { this.funcs = new ImageGridFuncs(); this.template = this.funcs.slideTemplate(); // there is only one allowed div.hid gridJSON = JSON.parse(gridJSON[0].innerHTML); if (gridJSON.spacer_URL && gridJSON.image_URL) { this.model.set({ parentModel: this.model, // pass as reference spacerURL: gridJSON.spacer_URL, imageURL: gridJSON.image_URL, spacers: gridJSON.spacers, images: gridJSON.images, // shuffle image order: imagesShuffled: this.funcs.shuffleArray(gridJSON.images), }); this.setupGrid(); } this.model.on({ 'change:currentSlide': this.modelChange }, this); app.mindbodyModel.on({ 'change:popoverVisible': this.killSlides }, this); } } }, setupGrid: function () { "use strict"; var that = this, spacers = this.model.get("spacers"), randomInt, imageCollection = new ImageCollection(), i; for (i = 0; i < this.model.get("images").length; i += 1) { randomInt = that.funcs.getRandomInt(0, spacers.length); imageCollection.add({ // push some info to individual views: parentModel: this.model, order: i, spacerURL: this.model.get("spacerURL"), spacer: spacers[randomInt], imageURL: this.model.get("imageURL"), image: this.model.get("imagesShuffled")[i], }); } imageCollection.each(this.imageView, this); }, imageView: function (imageModel) { "use strict"; var imageView = new ImageView({model: imageModel}); this.$el.append(imageView.render().el); }, modelChange: function () { "use strict"; var currSlide = this.model.get("currentSlide"), allImages = this.model.get("imageURL"), imageInfo, imageViewer, imgWidth, slideDiv; if (currSlide !== false) { if (app.mindbodyModel.get("popoverVisible") !== true) { app.mindbodyModel.set({popoverVisible : true}); } // retrieve cached DOM object: imageViewer = app.mbBackGroundShader.openPopUp("imageViewer"); // set the stage: imageViewer.html(this.template(this.model.toJSON())); // select div.slide, the ugly way: slideDiv = imageViewer[0].getElementsByClassName("slide")[0]; // pull the array of info about the image: imageInfo = this.model.get("images")[currSlide]; // calculate the size of the image when it fits the slideshow: imgWidth = this.funcs.findSlideSize(imageInfo, slideDiv.offsetWidth, slideDiv.offsetHeight); slideDiv.innerHTML = '<img src="' + allImages + imageInfo.filename + '" style="width: ' + imgWidth + 'px;" />'; } }, killSlides: function () { "use strict"; if (app.mindbodyModel.get("popoverVisible") === false) { // popover is gone. No more slideshow. this.model.set({currentSlide : false}); } }, });
// Remove the particular item function removeArr(arr , removeItem){ if(arr.indexOf(removeItem) > -1){ arr.splice(arr.indexOf(removeItem),1); } return arr; }
const gal=[//731-62 '1@001/b4avsq1y2i', '1@002/50uvpeo7tb', '1@002/0ypu4wgjxm', '1@002/b61d80e9pf', '1@002/f1kb57t4ul', '1@002/swq38v49nz', '1@002/zeak367fw1', '1@003/nx1ld4j9pe', '1@003/yh0ub5rank', '1@004/j29uftobmh', '1@005/0asu1qo75n', '1@005/4c7bn1q5mx', '1@005/le3vrzbwfs', '1@006/ek0tq9wvny', '1@006/ax21m8tjos', '1@006/w2e3104dp6', '1@007/bsukxlv9j7', '1@007/w5cpl0uvy6', '1@007/l04q3wrucj', '2@007/s2hr6jv7nc', '2@009/31yrxp8waj', '2@009/8josfrbgwi', '2@009/rt4jie1fg8', '2@009/p0va85n4gf', '2@010/i9thzxn50q', '3@010/a6w84ltj02', '3@010/mfyevin3so', '3@010/wdy5qzflnv', '3@011/06wim8bjdp', '3@011/avtd46k9cx', '3@011/80915y2exz', '3@011/vkt4dalwhb', '3@011/znudscat9h', '3@012/18xg4h9s3i', '3@012/120sub86vt', '3@012/5gxj7u0om8', '3@012/95gzec2rsm', '3@012/dihoerqp40', '3@012/nif7secp8l', '3@012/q8awn1iplo', '3@012/ubzfcjte63', '3@013/b9atnq1les', '3@013/zof4tprh73', '3@013/lvdyctgefs', '4@013/c7fgqbsxkn', '4@013/ci9vg76yj5', '4@013/y3v8tjreas', '4@014/75krn9ifbp', '4@014/9tf7n5iexy', '4@014/boz3y1wauf', '4@014/ihqxma938n', '4@014/suxj4yv5w6', '4@014/o19tbsqjxe', '4@014/wy8tx24g0c', '4@015/302u7cs5nx', '4@015/4bo9c8053u', '4@015/8clxnh6eao', '4@015/hbi1d9grwz', '4@015/w8vmtnod7z', '5@016/0yeinjua6h', '5@016/rgpcwv4nym', '5@016/scxjm7ofar'];
QUnit.test( "testGetIbanCheckDigits", function( assert ) { assert.equal(getIBANCheckDigits( 'GB00WEST12345698765432' ), '82', 'Get check digits of an IBAN' ); assert.equal(getIBANCheckDigits( '1234567890' ), '', 'If string isn\'t an IBAN, returns empty' ); assert.equal(getIBANCheckDigits( '' ), '', 'If string is empty, returns empty' ); } ); QUnit.test( "testGetGlobalIdentifier", function( assert ) { assert.equal(getGlobalIdentifier( 'G28667152', 'ES', '' ), 'ES55000G28667152', 'Obtain a global Id' ); } ); QUnit.test( "testReplaceCharactersNotInPattern", function( assert ) { assert.equal(replaceCharactersNotInPattern( 'ABC123-?:', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', '0' ), 'ABC123000', 'Remove unwanted characters' ); assert.equal(replaceCharactersNotInPattern( '12345', '0123456789', '0' ), '12345', 'If the string didn\'t have unwanted characters, returns it' ); } ); QUnit.test( "testReplaceLetterWithDigits", function( assert ) { assert.equal(replaceLetterWithDigits( '510007547061BE00' ), '510007547061111400', 'Replaces letters with digits' ); assert.equal(replaceLetterWithDigits( '1234567890' ), '1234567890', 'If we only receive digits, we return them' ); assert.equal(replaceLetterWithDigits( '' ), '', 'If we receive empty, we return empty' ); } ); QUnit.test( "testGetAccountLength", function( assert ) { assert.equal(getAccountLength( 'GB' ), 22, 'Returns tohe string th a SEPA country' ); assert.equal(getAccountLength( 'US' ), 0, 'If string isn\'t a SEPA country code, returns empty' ); assert.equal(getAccountLength( '' ), 0, 'If string is empty, returns empty' ); } ); QUnit.test( "testIsSepaCountry", function( assert ) { assert.equal(isSepaCountry( 'ES' ) , 1, 'Detects SEPA countries' ); assert.equal(isSepaCountry( 'US' ), 0, 'Rejects non SEPA countries' ); assert.equal(isSepaCountry( '' ) , 0, 'If string is empty, returns empty' ); } ); QUnit.test( "testIsValidIban", function( assert ) { assert.equal(isValidIBAN( 'GB82WEST12345698765432' ), 1, 'Accepts a good IBAN' ); assert.equal(isValidIBAN( 'GB00WEST12345698765432' ) , 0, 'Rejects a wrong IBAN' ); assert.equal(isValidIBAN( '' ), 0, 'Rejects empty strings' ); } );
Bitrix 16.5 Business Demo = bf14f0c5bad016e66d0ed2d224b15630
function HistoryAssistant() { } HistoryAssistant.prototype.setup = function() { this.appMenuModel = { visible: true, items: [ { label: $L("About"), command: 'about' }, { label: $L("Help"), command: 'tutorial' }, ] }; this.controller.setupWidget(Mojo.Menu.appMenu, {omitDefaultItems: true}, this.appMenuModel); var attributes = {}; this.model = { //backgroundImage : 'images/glacier.png', background: 'black', onLeftFunction : this.wentLeft.bind(this), onRightFunction : this.wentRight.bind(this) } this.controller.setupWidget('historydiv', attributes, this.model); this.myPhotoDivElement = $('historydiv'); this.timestamp = new Date().getTime(); var env = Mojo.Environment.DeviceInfo; if (env.screenHeight <= 400) this.myPhotoDivElement.style.height = "372px"; } HistoryAssistant.prototype.wentLeft = function(event){ this.timestamp = this.timestamp - (1000*60*60*24); var timenow = new Date(this.timestamp); var timenowstring = ""; var Ayear = timenow.getUTCFullYear(); var Amonth = timenow.getUTCMonth()+1; if(Amonth.toString().length < 2) Amonth = "0" + Amonth; var Aday = timenow.getUTCDate(); if(Aday.toString().length < 2) Aday = "0" + Aday; /*var Ahours = timenow.getUTCHours(); if(Ahours.toString().length < 2) Ahours = "0" + Ahours;*/ Ahours = "00"; if (this.timestamp > 1276146000000) { if (this.timestamp > 1276146000000 + (1000 * 60 * 60 * 24)) { this.myPhotoDivElement.mojo.leftUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday - 1) + Ahours + ".png"); } this.myPhotoDivElement.mojo.centerUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday) + Ahours + ".png"); this.myPhotoDivElement.mojo.rightUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday + 1) + Ahours + ".png"); } $('text').innerHTML = "<center>Histoy Of Pixels&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" + Ayear + " / " + Amonth + " / " + Aday + "</center>"; } HistoryAssistant.prototype.wentRight = function(event){ this.timestamp = this.timestamp + (1000*60*60*24); var timenow = new Date(this.timestamp); var timenowstring = ""; var Ayear = timenow.getUTCFullYear(); var Amonth = timenow.getUTCMonth()+1; if(Amonth.toString().length < 2) Amonth = "0" + Amonth; var Aday = timenow.getUTCDate(); if(Aday.toString().length < 2) Aday = "0" + Aday; /*var Ahours = timenow.getUTCHours(); if(Ahours.toString().length < 2) Ahours = "0" + Ahours;*/ Ahours = "00"; if (this.timestamp < new Date().getTime()) { this.myPhotoDivElement.mojo.leftUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday - 1) + Ahours + ".png"); this.myPhotoDivElement.mojo.centerUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday) + Ahours + ".png"); if (this.timestamp + (1000*60*60*24) < new Date().getTime()) { this.myPhotoDivElement.mojo.rightUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday + 1) + Ahours + ".png"); } } $('text').innerHTML = "<center>Histoy Of Pixels&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" + Ayear + " / " + Amonth + " / " + Aday + "</center>"; } HistoryAssistant.prototype.activate = function(event) { var timenow = new Date(this.timestamp); var timenowstring = ""; var Ayear = timenow.getUTCFullYear(); var Amonth = timenow.getUTCMonth()+1; if(Amonth.toString().length < 2) Amonth = "0" + Amonth; var Aday = timenow.getUTCDate(); if(Aday.toString().length < 2) Aday = "0" + Aday; /*var Ahours = timenow.getUTCHours(); if(Ahours.toString().length < 2) Ahours = "0" + Ahours;*/ Ahours = "00"; this.myPhotoDivElement.mojo.leftUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday-1) + Ahours + ".png"); this.myPhotoDivElement.mojo.centerUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday) + Ahours + ".png"); //this.myPhotoDivElement.mojo.rightUrlProvided("http://100ps.omoco.de/100pixels/history/" + Ayear + Amonth + (Aday+1) + Ahours + ".png"); $('text').innerHTML = "<center>Histoy Of Pixels&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" + Ayear + " / " + Amonth + " / " + Aday + "</center>"; } HistoryAssistant.prototype.deactivate = function(event) { } HistoryAssistant.prototype.cleanup = function(event) { } HistoryAssistant.prototype.handleCommand = function(event){ if(event.type == Mojo.Event.command) { switch (event.command) { case 'about': Mojo.Controller.stageController.pushScene("about"); break; case 'tutorial': this.controller.showAlertDialog({ onChoose: function(value) {}, title:"Help", message:"This is the history of all pixels user have every created. Every night there is made a new snapshot.<br><br>Flip the image left or right to go through the history. Zoom into the image for more details.", allowHTMLMessage: true, choices:[ {label:'OK', value:'OK', type:'color'} ] }); break; } } }
/* Copyright 2016 Devon Call, Zeke Hunter-Green, Paige Ormiston, Joe Renner, Jesse Sliter This file is part of Myrge. Myrge 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. Myrge 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 Myrge. If not, see <http://www.gnu.org/licenses/>. */ app.controller('NavCtrl', [ '$scope', '$state', 'auth', function($scope, $state, auth){ $scope.isLoggedIn = auth.isLoggedIn; $scope.currentUser = auth.currentUser; $scope.logOut = auth.logOut; $scope.loggedin = auth.isLoggedIn(); if($scope.loggedin){ auth.validate(auth.getToken()).success(function(data){ if(!data.valid){ auth.logOut(); $state.go("login"); } }); } }]);
'use strict'; angular.module('ldrWebApp') /** * @name pageSkipper * @param config * @param pages * @type element * @description Skip to page directive * @requires $scope */ .directive('pageSkipper', function () { return { restrict: 'E', templateUrl: 'components/page-skipper/page-skipper.template.html', scope: {'config': '=', 'pages': '='}, controller: function ($scope) { /** * @name pageSkipper#generateArray * @param {Number} start * @param {Number} end * @description generate an array in form {start} to {end} * @returns {Array} */ function generateArray(start, end) { var list = []; for (var i = start; i <= end; i++) { list.push(i); } return list; } /** * @name pageSkipper#skipToPage * @param {Number} item * @description get the desired page * @return {Undefined} */ $scope.skipToPage = function (item) { $scope.config.page = (item === undefined) ? 1 : item; }; $scope.selectedPage = 1; $scope.pagesList = generateArray(1, $scope.pages); } }; });
/* This file is part of the OdinMS Maple Story Server Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> Matthias Butz <matze@odinms.de> Jan Christian Meyer <vimes@odinms.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation. You may not use, modify or distribute this program under any other version of the GNU Affero General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** -- Odin JavaScript -------------------------------------------------------------------------------- Konpei - Showa Town(801000000) -- By --------------------------------------------------------------------------------------------- Information -- Version Info ----------------------------------------------------------------------------------- 1.1 - Fixed by Moogra 1.0 - First Version by Information --------------------------------------------------------------------------------------------------- **/ function start() { cm.sendSimple ("What do you want from me?\r #L0##bGather up some information on the hideout.#l\r\n#L1#Take me to the hideout#l\r\n#L2#Nothing#l#k"); } function action(mode, type, selection) { if (mode < 1) { cm.dispose(); } else { status++; if (status == 1) { if (selection == 0) { cm.sendNext("I can take you to the hideout, but the place is infested with thugs looking for trouble. You'll need to be both incredibly strong and brave to enter the premise. At the hideaway, you'll find the Boss that controls all the other bosses around this area. It's easy to get to the hideout, but the room on the top floor of the place can only be entered ONCE a day. The Boss's Room is not a place to mess around. I suggest you don't stay there for too long; you'll need to swiftly take care of the business once inside. The boss himself is a difficult foe, but you'll run into some incredibly powerful enemies on you way to meeting the boss! It ain't going to be easy."); cm.dispose(); } else if (selection == 1) cm.sendNext("Oh, the brave one. I've been awaiting your arrival. If these\r\nthugs are left unchecked, there's no telling what going to\r\nhappen in this neighborhood. Before that happens, I hope\r\nyou take care of all them and beat the boss, who resides\r\non the 5th floor. You'll need to be on alert at all times, since\r\nthe boss is too tough for even wisemen to handle.\r\nLooking at your eyes, however, I can see that eye of the\r\ntiger, the eyes that tell me you can do this. Let's go!"); else { cm.sendOk("I'm a busy person! Leave me alone if that's all you need!"); cm.dispose(); } } else { cm.warp(801040000); cm.dispose(); } } }
"use strict"; add_task(setupPrefsAndRecentWindowBehavior); let testcases = [ /** * A portal is detected when there's no browser window, * then a browser window is opened, and the portal is logged into * and redirects to a different page. The portal tab should be added * and focused when the window is opened, and left open after login * since it redirected. */ function* test_detectedWithNoBrowserWindow_Redirect() { yield portalDetected(); let win = yield focusWindowAndWaitForPortalUI(); let browser = win.gBrowser.selectedTab.linkedBrowser; let loadPromise = BrowserTestUtils.browserLoaded(browser, false, CANONICAL_URL_REDIRECTED); BrowserTestUtils.loadURI(browser, CANONICAL_URL_REDIRECTED); yield loadPromise; yield freePortal(true); ensurePortalTab(win); ensureNoPortalNotification(win); yield closeWindowAndWaitForXulWindowVisible(win); }, /** * Test the various expected behaviors of the "Show Login Page" button * in the captive portal notification. The button should be visible for * all tabs except the captive portal tab, and when clicked, should * ensure a captive portal tab is open and select it. */ function* test_showLoginPageButton() { let win = yield openWindowAndWaitForFocus(); yield portalDetected(); let notification = ensurePortalNotification(win); testShowLoginPageButtonVisibility(notification, "visible"); function testPortalTabSelectedAndButtonNotVisible() { is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected."); testShowLoginPageButtonVisibility(notification, "hidden"); } let button = notification.querySelector("button.notification-button"); function* clickButtonAndExpectNewPortalTab() { let p = BrowserTestUtils.waitForNewTab(win.gBrowser, CANONICAL_URL); button.click(); let tab = yield p; is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected."); return tab; } // Simulate clicking the button. The portal tab should be opened and // selected and the button should hide. let tab = yield clickButtonAndExpectNewPortalTab(); testPortalTabSelectedAndButtonNotVisible(); // Close the tab. The button should become visible. yield BrowserTestUtils.removeTab(tab); ensureNoPortalTab(win); testShowLoginPageButtonVisibility(notification, "visible"); // When the button is clicked, a new portal tab should be opened and // selected. tab = yield clickButtonAndExpectNewPortalTab(); // Open another arbitrary tab. The button should become visible. When it's clicked, // the portal tab should be selected. let anotherTab = yield BrowserTestUtils.openNewForegroundTab(win.gBrowser); testShowLoginPageButtonVisibility(notification, "visible"); button.click(); is(win.gBrowser.selectedTab, tab, "The captive portal tab should be selected."); // Close the portal tab and select the arbitrary tab. The button should become // visible and when it's clicked, a new portal tab should be opened. yield BrowserTestUtils.removeTab(tab); win.gBrowser.selectedTab = anotherTab; testShowLoginPageButtonVisibility(notification, "visible"); tab = yield clickButtonAndExpectNewPortalTab(); yield BrowserTestUtils.removeTab(anotherTab); yield freePortal(true); ensureNoPortalTab(win); ensureNoPortalNotification(win); yield closeWindowAndWaitForXulWindowVisible(win); }, ]; for (let testcase of testcases) { add_task(testcase); }
/** * m59peacemaker's memoize * * See https://github.com/m59peacemaker/angular-pmkr-components/tree/master/src/memoize * Released under the MIT license */ angular.module('syncthing.core') .factory('pmkr.memoize', [ function() { function service() { return memoizeFactory.apply(this, arguments); } function memoizeFactory(fn) { var cache = {}; function memoized() { var args = [].slice.call(arguments); var key = JSON.stringify(args); if (cache.hasOwnProperty(key)) { return cache[key]; } cache[key] = fn.apply(this, arguments); return cache[key]; } return memoized; } return service; } ]);
const html = require('choo/html'); module.exports = function(name, url) { const dialog = function(state, emit, close) { return html` <send-share-dialog class="flex flex-col items-center text-center p-4 max-w-sm m-auto" > <h1 class="text-3xl font-bold my-4"> ${state.translate('notifyUploadEncryptDone')} </h1> <p class="font-normal leading-normal text-grey-80 dark:text-grey-40"> ${state.translate('shareLinkDescription')}<br /> <span class="word-break-all">${name}</span> </p> <input type="text" id="share-url" class="w-full my-4 border rounded-lg leading-loose h-12 px-2 py-1 dark:bg-grey-80" value="${url}" readonly="true" /> <button class="btn rounded-lg w-full flex-shrink-0 focus:outline" onclick="${share}" title="${state.translate('shareLinkButton')}" > ${state.translate('shareLinkButton')} </button> <button class="link-blue my-4 font-medium cursor-pointer focus:outline" onclick="${close}" title="${state.translate('okButton')}" > ${state.translate('okButton')} </button> </send-share-dialog> `; async function share(event) { event.stopPropagation(); try { await navigator.share({ title: state.translate('-send-brand'), text: state.translate('shareMessage', { name }), url }); } catch (e) { if (e.code === e.ABORT_ERR) { return; } console.error(e); } close(); } }; dialog.type = 'share'; return dialog; };
import { Mongo } from 'meteor/mongo'; const SurveyCaches = new Mongo.Collection('SurveyCaches'); SimpleSchema.debug = true; SurveyCaches.schema = new SimpleSchema({ title: { type: String, }, version: { type: Number, optional: true, autoValue() { return 2; }, }, createdAt: { type: Date, label: 'Created At', optional: true, autoValue() { let val; if (this.isInsert) { val = new Date(); } else if (this.isUpsert) { val = { $setOnInsert: new Date() }; } else { this.unset(); // Prevent user from supplying their own value } return val; }, }, updatedAt: { type: Date, label: 'Updated At', optional: true, autoValue() { let val; if (this.isUpdate) { val = new Date(); } return val; }, }, }); SurveyCaches.attachSchema(SurveyCaches.schema); export default SurveyCaches;
/*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.dropdown = { name : 'dropdown', version : '4.3.2', settings : { activeClass: 'open', is_hover: false, opened: function(){}, closed: function(){} }, init : function (scope, method, options) { this.scope = scope || this.scope; Foundation.inherit(this, 'throttle scrollLeft data_options'); if (typeof method === 'object') { $.extend(true, this.settings, method); } if (typeof method !== 'string') { if (!this.settings.init) { this.events(); } return this.settings.init; } else { return this[method].call(this, options); } }, events : function () { var self = this; $(this.scope) .on('click.fndtn.dropdown', '[data-dropdown]', function (e) { var settings = $.extend({}, self.settings, self.data_options($(this))); e.preventDefault(); if (!settings.is_hover) self.toggle($(this)); }) .on('mouseenter', '[data-dropdown]', function (e) { var settings = $.extend({}, self.settings, self.data_options($(this))); if (settings.is_hover) self.toggle($(this)); }) .on('mouseleave', '[data-dropdown-content]', function (e) { var target = $('[data-dropdown="' + $(this).attr('id') + '"]'), settings = $.extend({}, self.settings, self.data_options(target)); if (settings.is_hover) self.close.call(self, $(this)); }) .on('opened.fndtn.dropdown', '[data-dropdown-content]', this.settings.opened) .on('closed.fndtn.dropdown', '[data-dropdown-content]', this.settings.closed); $(document).on('click.fndtn.dropdown touchstart.fndtn.dropdown', function (e) { var parent = $(e.target).closest('[data-dropdown-content]'); if ($(e.target).data('dropdown') || $(e.target).parent().data('dropdown')) { return; } if (!($(e.target).data('revealId')) && (parent.length > 0 && ($(e.target).is('[data-dropdown-content]') || $.contains(parent.first()[0], e.target)))) { e.stopPropagation(); return; } self.close.call(self, $('[data-dropdown-content]')); }); $(window).on('resize.fndtn.dropdown', self.throttle(function () { self.resize.call(self); }, 50)).trigger('resize'); this.settings.init = true; }, close: function (dropdown) { var self = this; dropdown.each(function () { if ($(this).hasClass(self.settings.activeClass)) { $(this) .css(Foundation.rtl ? 'right':'left', '-99999px') .removeClass(self.settings.activeClass) .prev('[data-dropdown]') .removeClass(self.settings.activeClass); $(this).trigger('closed'); } }); }, open: function (dropdown, target) { this .css(dropdown .addClass(this.settings.activeClass), target); dropdown.prev('[data-dropdown]').addClass(this.settings.activeClass); dropdown.trigger('opened'); }, toggle : function (target) { var dropdown = $('#' + target.data('dropdown')); if (dropdown.length === 0) { // No dropdown found, not continuing return; } this.close.call(this, $('[data-dropdown-content]').not(dropdown)); if (dropdown.hasClass(this.settings.activeClass)) { this.close.call(this, dropdown); } else { this.close.call(this, $('[data-dropdown-content]')) this.open.call(this, dropdown, target); } }, resize : function () { var dropdown = $('[data-dropdown-content].open'), target = $("[data-dropdown='" + dropdown.attr('id') + "']"); if (dropdown.length && target.length) { this.css(dropdown, target); } }, css : function (dropdown, target) { var offset_parent = dropdown.offsetParent(); // if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) { var position = target.offset(); position.top -= offset_parent.offset().top; position.left -= offset_parent.offset().left; // } else { // var position = target.position(); // } if (this.small()) { dropdown.css({ position : 'absolute', width: '95%', 'max-width': 'none', top: position.top + this.outerHeight(target) }); dropdown.css(Foundation.rtl ? 'right':'left', '2.5%'); } else { if (!Foundation.rtl && $(window).width() > this.outerWidth(dropdown) + target.offset().left && !this.data_options(target).align_right) { var left = position.left; if (dropdown.hasClass('right')) { dropdown.removeClass('right'); } } else { if (!dropdown.hasClass('right')) { dropdown.addClass('right'); } var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target)); } dropdown.attr('style', '').css({ position : 'absolute', top: position.top + this.outerHeight(target), left: left }); } return dropdown; }, small : function () { return $(window).width() < 768 || $('html').hasClass('lt-ie9'); }, off: function () { $(this.scope).off('.fndtn.dropdown'); $('html, body').off('.fndtn.dropdown'); $(window).off('.fndtn.dropdown'); $('[data-dropdown-content]').off('.fndtn.dropdown'); this.settings.init = false; }, reflow : function () {} }; }(Foundation.zj, this, this.document));