text:
/**
 * SignalCD
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import ApiClient from '../ApiClient';

/**
 * The PipelineSteps model module.
 * @module model/PipelineSteps
 * @version 0.0.0
 */
class PipelineSteps {
    /**
     * Constructs a new PipelineSteps.
     * @alias module:model/PipelineSteps
     */
    constructor() {

        PipelineSteps.initialize(this);
    }

    /**
     * Initializes the fields of this object.
     * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
     * Only for internal use.
     */
    static initialize(obj) {
    }

    /**
     * Constructs a PipelineSteps from a plain JavaScript object, optionally creating a new instance.
     * Copies all relevant properties from data to obj if supplied or a new instance if not.
     * @param {Object} data The plain JavaScript object bearing properties of interest.
     * @param {module:model/PipelineSteps} obj Optional instance to populate.
     * @return {module:model/PipelineSteps} The populated PipelineSteps instance.
     */
    static constructFromObject(data, obj) {
        if (data) {
            obj = obj || new PipelineSteps();

            if (data.hasOwnProperty('name')) {
                obj['name'] = ApiClient.convertToType(data['name'], 'String');
            }
            if (data.hasOwnProperty('image')) {
                obj['image'] = ApiClient.convertToType(data['image'], 'String');
            }
            if (data.hasOwnProperty('imagePullSecrets')) {
                obj['imagePullSecrets'] = ApiClient.convertToType(data['imagePullSecrets'], ['String']);
            }
            if (data.hasOwnProperty('commands')) {
                obj['commands'] = ApiClient.convertToType(data['commands'], ['String']);
            }
        }
        return obj;
    }

}

/**
 * @member {String} name
 */
PipelineSteps.prototype['name'] = undefined;

/**
 * @member {String} image
 */
PipelineSteps.prototype['image'] = undefined;

/**
 * @member {Array.<String>} imagePullSecrets
 */
PipelineSteps.prototype['imagePullSecrets'] = undefined;

/**
 * @member {Array.<String>} commands
 */
PipelineSteps.prototype['commands'] = undefined;

export default PipelineSteps;


text:
const apiService = require('../api-service');

module.exports =
{
	execute: async (config, discordConfig, service, command, args) =>
	{
        try {
            let param = "";
            if (args.length > 0) {
                param = args[0];
            }

            // prepare the payload for API call
            const payload = {
                accessToken: discordConfig.accessToken,
                salt: discordConfig.salt,
                param: param
            }
            // guard for useless API calls
            if (!payload.accessToken || !payload.salt) {
                service.message.react('👎').catch(err => console.log(err));
                return;
            }
            const endpoint = {
                url: `${config.get('API_URL')}/${command}`,
                authKey: config.get('API_KEY')
            };
            const response = await apiService.get(endpoint, payload);
            if (service.isValid(response.text)) {
                service.message.react('👍').catch(err => console.log(err));
            }
            else {
                service.message.react('🛑').catch(err => console.log(err));
            }
        } catch (err) {
            service.reactWithError(err);
        }
	}
};

domain: javascript


text:
/*************************************************************
 *
 *  MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SpacingModLetters.js
 *
 *  Copyright (c) 2009-2020 The MathJax Consortium
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

MathJax.Hub.Insert(
  MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['STIXGeneral'],
  {
    0x2B0: [848,-336,378,7,365],       // MODIFIER LETTER SMALL H
    0x2B1: [848,-336,378,7,365],       // MODIFIER LETTER SMALL H WITH HOOK
    0x2B2: [852,-169,300,44,244],      // MODIFIER LETTER SMALL J
    0x2B3: [681,-336,252,5,252],       // MODIFIER LETTER SMALL R
    0x2B4: [680,-335,277,10,257],      // MODIFIER LETTER SMALL TURNED R
    0x2B5: [680,-168,325,10,338],      // MODIFIER LETTER SMALL TURNED R WITH HOOK
    0x2B6: [680,-335,390,6,379],       // MODIFIER LETTER SMALL CAPITAL INVERTED R
    0x2B7: [680,-331,520,6,512],       // MODIFIER LETTER SMALL W
    0x2B8: [680,-176,370,14,361],      // MODIFIER LETTER SMALL Y
    0x2B9: [684,-421,208,90,257],      // MODIFIER LETTER PRIME
    0x2BA: [684,-421,305,19,324],      // MODIFIER LETTER DOUBLE PRIME
    0x2BB: [686,-443,333,79,218],      // MODIFIER LETTER TURNED COMMA
    0x2BC: [686,-443,333,79,218],      // MODIFIER LETTER APOSTROPHE
    0x2BD: [686,-443,333,79,218],      // MODIFIER LETTER REVERSED COMMA
    0x2BE: [680,-485,198,35,163],      // MODIFIER LETTER RIGHT HALF RING
    0x2BF: [680,-485,198,35,163],      // MODIFIER LETTER LEFT HALF RING
    0x2C0: [690,-295,326,23,303],      // MODIFIER LETTER GLOTTAL STOP
    0x2C1: [690,-295,326,23,303],      // MODIFIER LETTER REVERSED GLOTTAL STOP
    0x2C2: [755,-419,317,33,285],      // MODIFIER LETTER LEFT ARROWHEAD
    0x2C3: [755,-419,317,33,285],      // MODIFIER LETTER RIGHT ARROWHEAD
    0x2C4: [713,-461,317,-9,327],      // MODIFIER LETTER UP ARROWHEAD
    0x2C5: [713,-461,317,-9,327],      // MODIFIER LETTER DOWN ARROWHEAD
    0x2C8: [713,-448,278,119,159],     // MODIFIER LETTER VERTICAL LINE
    0x2CC: [70,195,278,119,159],       // MODIFIER LETTER LOW VERTICAL LINE
    0x2CD: [-104,159,334,11,323],      // MODIFIER LETTER LOW MACRON
    0x2CE: [-21,192,333,25,249],       // MODIFIER LETTER LOW GRAVE ACCENT
    0x2CF: [-21,192,333,84,308],       // MODIFIER LETTER LOW ACUTE ACCENT
    0x2D0: [460,-19,333,89,244],       // MODIFIER LETTER TRIANGULAR COLON
    0x2D1: [460,-299,333,89,244],      // MODIFIER LETTER HALF TRIANGULAR COLON
    0x2D2: [365,-75,333,72,262],       // MODIFIER LETTER CENTRED RIGHT HALF RING
    0x2D3: [365,-75,333,71,261],       // MODIFIER LETTER CENTRED LEFT HALF RING
    0x2D4: [205,-18,333,51,281],       // MODIFIER LETTER UP TACK
    0x2D5: [205,-18,333,51,281],       // MODIFIER LETTER DOWN TACK
    0x2D6: [218,-26,333,71,263],       // MODIFIER LETTER PLUS SIGN
    0x2D7: [144,-100,333,71,263],      // MODIFIER LETTER MINUS SIGN
    0x2DA: [711,-512,333,67,266],      // RING ABOVE
    0x2DB: [0,165,333,64,249],         // OGONEK
    0x2DD: [678,-507,333,-3,376],      // DOUBLE ACUTE ACCENT
    0x2DE: [443,-186,298,0,263],       // MODIFIER LETTER RHOTIC HOOK
    0x2DF: [662,-425,333,48,284],      // MODIFIER LETTER CROSS ACCENT
    0x2E0: [684,-219,378,24,335],      // MODIFIER LETTER SMALL GAMMA
    0x2E1: [848,-336,215,19,197],      // MODIFIER LETTER SMALL L
    0x2E2: [681,-331,291,36,261],      // MODIFIER LETTER SMALL S
    0x2E3: [680,-336,380,5,372],       // MODIFIER LETTER SMALL X
    0x2E4: [850,-336,341,45,319],      // MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
    0x2E5: [662,0,413,48,373],         // MODIFIER LETTER EXTRA-HIGH TONE BAR
    0x2E6: [662,0,405,40,365],         // MODIFIER LETTER HIGH TONE BAR
    0x2E7: [662,0,405,40,365],         // MODIFIER LETTER MID TONE BAR
    0x2E8: [662,0,405,40,365],         // MODIFIER LETTER LOW TONE BAR
    0x2E9: [662,0,405,40,365],         // MODIFIER LETTER EXTRA-LOW TONE BAR
    0x2EC: [70,147,333,21,311],        // MODIFIER LETTER VOICING
    0x2ED: [665,-507,405,10,395],      // MODIFIER LETTER UNASPIRATED
    0x2F7: [-113,219,333,1,331]        // ??
  }
);

MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir + "/General/Regular/SpacingModLetters.js");


text:
(function () {
  const ERRORS = {
    invalidPassword: 'Please enter a valid password.',
    invalidEmail: 'Please enter a valid email',
    invalidUsername: 'Username is not a valid. Specical char, upper, number is required.',
    invalidFirstname: 'Please provide valid firstname.',

    passAndConfirmShouldMatch: 'Password and Confirm password should match.',

    existingEmail: 'That email is already taken.',
    existingUsername: 'That username is not available.'
  };

  function isEmail(email) {
    const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

    return re.test(String(email).toLowerCase());
  }

  function isValidUsername(name) {
    name = String(name);

    if (!name.match(/[\$@#!&*%]/)) {
      return false;
    } else if (!name.match(/[A-Z]/)) {
      return false;
    } else if (!name.match(/[a-z]/)) {
      return false;
    } else if (!name.match(/[0-9]/)) {
      return false;
    }

    return true;
  }

  function renderErrors(formElm, errors) {
    const $errElm = $('');
    const $formElm = $(formElm);

    for (const elm in errors) {
      const $errField = $formElm.find(`[name=${elm}]`);
      const $fieldErr = $errElm.clone();

      $fieldErr.text(ERRORS[elm]);

      $fieldErr.insertAfter($errField);
    }
  }

  function removeErrors(e) {
    const $formElm = $(e.target).closest('form');

    $formElm.children().filter('.error').remove();
  }

  function onRegSubmit(e) {
    e.stopPropagation();
    e.preventDefault();

    removeErrors(e);

    const formData = {};
    const errors = {};
    let hasError = false;

    for (let i of e.target) {
      if (i.type !== 'submit') {
        formData[i.name] = i.value;
      }
    }

    if (formData.password.length === 0) {
      errors.password = 'invalidPassword';
      hasError = true;
    } else if (formData.password !== formData['confirm-password']) {
      errors['confirm-password'] = 'passAndConfirmShouldMatch';
      hasError = true;
    }

    if (!isEmail(formData.email)) {
      errors.email = 'invalidEmail';
      hasError = true;
    }

    if (!isValidUsername(formData.username)) {
      errors.username = 'invalidUsername';
      hasError = true;
    }

    if (formData.firstname.length < 2) {
      errors.firstname = 'invalidFirstname'
      hasError = true;
    }

    // users
    if (hasError) {
      renderErrors(e.target, errors);
    } else {
      ET.showSpinner();
      console.log("formData =-----> ", formData);
      ET_API.createUser(formData).then((logged) => {
        localStorage.setItem('loggedIn', true);
        localStorage.setItem('isAdmin', logged['is-admin'] === 'on');

        ET.navigateTo && ET.navigateTo('Dashboard');
        ET.createSiteNav();
        ET.hideSpinner();
      }).catch(err => {
        renderErrors(e.target, err);
        localStorage.setItem('loggedIn', false);
        ET.createSiteNav();
        ET.hideSpinner();
      });
    }
  }

  function isAdmin() {
    return location.search.indexOf('isAdmin=true') > 0;
  }

  // Add event listeners
  // Reinitialize the listeners
  ET.removeListeners();
  ET.addListeners();

  const $regForm = $('form.user-registration');
  $('[data-reset-error]').keydown(removeErrors);
  $regForm.submit(onRegSubmit);

  if (isAdmin()) {
    const $passField = $regForm.find('#confirm-password');
    const $checkBox = $(`
      Admin:
      <input type="checkbox" name="is-admin" id="is-admin" data-reset-error checked>
    `);

    $checkBox.insertAfter($passField);
  }
})();


text: (function(a){const e=a["ca"]=a["ca"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"","Align center":"Alineació centre","Align left":"Alineació esquerra","Align right":"Alineació dreta","Block quote":"Cita de bloc",Bold:"Negreta",Cancel:"Cancel·lar","Cannot upload file:":"No es pot pujar l'arxiu:","Choose heading":"Escull capçalera",Heading:"Capçalera","Heading 1":"Capçalera 1","Heading 2":"Capçalera 2","Heading 3":"Capçalera 3","Heading 4":"","Heading 5":"","Heading 6":"",Italic:"Cursiva",Justify:"Justificar",Paragraph:"Pàrraf",Save:"Desar","Show more items":"","Text alignment":"Alineació text","Text alignment toolbar":""});e.getPluralForm=function(a){return a!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));


text:
;(function(global, document, $, undefined) {

    function initSearch() {
        var $search = $('.dw-search');
        var $searchInput = $search.find('[type=text]');
        var focusClass = 'active';
        var addFocusLabel = $search.addClass.bind($search, focusClass);
        var requestFocusLabelRemoval = function requestFocusLabelRemoval () {
            if (this.value === '') {
                $search.removeClass(focusClass);
            }
        };
        $searchInput.on('focus', addFocusLabel);
        $searchInput.on('focusout', requestFocusLabelRemoval);
    }

    function addCopyToClipboard() {

        var enableCopyBtn = function enableCopyBtn ($btn) {
            var client = new ZeroClipboard($btn[0]);
            client.on("aftercopy", function( event ) {
                alert('Successfully copied to clipboard!');
                $(event.target).addClass('disabled');
            });
            return $btn;
        };

        var copyModule = function copyModule (code) {
            var $module = $('

');
            var $btn = $('Copy to Clipboard');
            $btn
                .attr('data-clipboard-text', code)
                .on('click', function (evt) {evt.preventDefault();})
                .each(function () { enableCopyBtn($(this)); })
                .appendTo($module);
            return $module;
        };

        var $codeBlocks = $('div.body .highlight');

        $codeBlocks.each(function () {
            var code = $(this).find('pre').text();
            var $copyModule = copyModule(code);
            $(this).prepend($copyModule);
        })

    }

    $(document).ready(function () {
        initSearch();
        addCopyToClipboard();
    })

})(window, document, jQuery);


text:
'use strict';
var should = require('should');
var helper = require("../../helper");
var GarmentInventoryDocumentManager = require("../../../src/managers/inventory-garment/garment-inventory-document-manager");
var garmentInventoryDocumentManager = null;
var garmentInventoryDocumentDataUtil = require("../../data-util/inventory-garment/garment-inventory-document-data-util");
var validate = require("dl-models").validator.inventory.inventoryDocument;

before('#00. connect db', function (done) {
    helper.getDb()
        .then(db => {
            garmentInventoryDocumentManager = new GarmentInventoryDocumentManager(db, {
                username: 'unit-test'
            });
            done();
        })
        .catch(e => {
            done(e);
        })
});

it("#01. should success when create new data using status OUT", function (done) {
    garmentInventoryDocumentDataUtil.getNewData()
        .then((data) => {
            data.type = "OUT";

            return garmentInventoryDocumentManager.create(data)
        })
        .then((id) => {
            id.should.be.Object();
            done();
        })
        .catch((e) => {
            done(e);
        });
});

it("#02. should success when create new data using status ADJ", function (done) {
    garmentInventoryDocumentDataUtil.getNewData()
        .then((data) => {
            data.type = "ADJ";
            return garmentInventoryDocumentManager.create(data)
        })
        .then((id) => {
            id.should.be.Object();
            done();
        })
        .catch((e) => {
            done(e);
        });
});

it("#03. should success when read data", function (done) {
    garmentInventoryDocumentManager.read({ "keyword": "test" })
        .then((data) => {
            done();
        })
        .catch((e) => {
            done(e);
        });
});


text:
import { russia } from '../index';
import { codes, invalid, name, valid, validOnlyByFormat } from './countries_vat_lists/russia.vat';
import { addCharsToString, checkInvalidVat, checkOnlyValidFormatVat, checkValidVat } from './utils';

describe('Russia', () => {
  it('should return "true" result for valid VATs', () => {
    valid.forEach((vat) => checkValidVat(vat, [russia], codes, name));
  });

  it('should return "true" for "isSupportedCountry" and "isValidFormat" fields, but "false" for "isValid" for VATs that match format but still invalid', () => {
    validOnlyByFormat.forEach((vat) => checkOnlyValidFormatVat(vat, [russia], codes, name));
  });

  it('should return "true" result for valid VATs with extra dash characters', () => {
    valid.map((vat) => addCharsToString(vat, '-')).forEach((vat) => checkValidVat(vat, [russia], codes, name));
  });

  it('should return "true" result for valid VATs with extra space characters', () => {
    valid.map((vat) => addCharsToString(vat, ' ')).forEach((vat) => checkValidVat(vat, [russia], codes, name));
  });

  it('should return "false" result for invalid VATs', () => {
    invalid.forEach((vat) => checkInvalidVat(vat, [russia]));
  });
});


text:
import Vue from 'vue'
import App from './App.vue'
import router from "./router";
import store from './store'
import toast from 'components/common/toast'
import FastClick from 'fastclick'
import VueLazyLoad from 'vue-lazyload'

Vue.config.productionTip = false

// 添加事件总线$bus
Vue.prototype.$bus = new Vue()

// 安装toast插件
Vue.use(toast)

// 安装VueLazyLoad插件
Vue.use(VueLazyLoad, {
  loading: require('./assets/img/common/placeholder.png')
})

// 解决移动端的300ms延迟
FastClick.attach(document.body)

new Vue({
  render: h => h(App),
  router,
  store,
}).$mount('#app')


text:
import cleanURL from "../utils/clean-url";

const getCurrentTab = (callback) => {
    const queryInfo = {
      active: true,
      currentWindow: true
    };

    chrome.tabs.query(queryInfo, (tabs) => {
      callback(tabs[0]);
    });
};

const shortenURL = (_url, done) => {
    const url = `https://sahajr.xyz/shorten/?url=${cleanURL(_url)}`;
    const request = new XMLHttpRequest();
    request.open("GET", url, true);
    request.onreadystatechange = () => {
        if (request.readyState === 4) {
            const response = JSON.parse(request.responseText);
            done(response.shortURL);
        }
    };
    request.send();
};

document.addEventListener('DOMContentLoaded', () => {

    const overlay = document.getElementById('overlay');
    const shortenButton = document.getElementById('shorten-button');
    const shortenResult = document.getElementById('shorten-result');
    const shortenCopy = document.getElementById('shorten-copy');
    const generateQR = document.getElementById('generate-qr');
    const goToExtensions = document.getElementById("shortcut-extensions");
    const shortenAndQR = document.getElementById("generate-qr-short-url");

    shortenResult.style.display = 'none';
    shortenCopy.style.display = 'none';
    overlay.style.display = 'none';

    shortenButton.addEventListener('click', () => {
        getCurrentTab((tab) => {
            try {
                overlay.style.display = 'block';
                shortenURL(tab.url, (shortURL) => {
                    shortenResult.style.display = 'block';
                    shortenResult.focus();
                    shortenResult.value = shortURL;
                    shortenResult.select();
                    overlay.style.display = 'none';
                    shortenCopy.style.display = 'block';
                });
            } catch (err) {
                window.alert(err);
            }
        });
    });

    shortenCopy.addEventListener('click', () => {
       try {
           if(document.execCommand('copy')) {
               shortenCopy.style.display = 'none';
               shortenResult.style.display = 'none';
           }
       } catch (err) {
           window.alert(err);
       }
    });

    generateQR.addEventListener('click', () => {
        try {
            getCurrentTab((tab) => {
                chrome.tabs.sendMessage(tab.id, {text: tab.url});
                window.close();
            });
        } catch (err) {
            window.alert(err);
        }
    });

    goToExtensions.addEventListener('click', () => {
        chrome.tabs.create({url: "chrome://extensions"});
    });

    shortenAndQR.addEventListener('click', () => {
        getCurrentTab((tab) => {
            try {
                overlay.style.display = 'block';
                shortenURL(tab.url, (shortURL) => {
                    overlay.style.display = 'none';
                    chrome.tabs.sendMessage(tab.id, {text: shortURL});
                    window.close();
                });
            } catch (err) {
                window.alert(err);
            }
        });
    });

});


text:
import solfege from "solfegejs";
import * as ControllerUtil from "../utils/ControllerUtil";

/**
 * The access points of the Wifi configuration
 */
export default class Wifi
{
    /**
     * Get the Wifi settings
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *getWifi(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS");
        yield ControllerUtil.getMainConfigurationParameters(/^wifi\./, request, response);
    }

    /**
     * Get the Wifi "enabled" setting
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *getWifiEnabled(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, PUT, OPTIONS");
        yield ControllerUtil.getMainConfigurationParameterValue("wifi.enabled", request, response);
    }

    /**
     * Set the Wifi "enabled" setting
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *setWifiEnabled(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, PUT, OPTIONS");
        yield ControllerUtil.setMainConfigurationParameterValue("wifi.enabled", request, response);

        // Display the new value
        yield this.getWifiEnabled(request, response);
    }

    /**
     * Get the Wifi "ssid" setting
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *getWifiSsid(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, PUT, OPTIONS");
        yield ControllerUtil.getMainConfigurationParameterValue("wifi.ssid", request, response);
    }

    /**
     * Set the Wifi "ssid" setting
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *setWifiSsid(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, PUT, OPTIONS");
        yield ControllerUtil.setMainConfigurationParameterValue("wifi.ssid", request, response);

        // Display the new value
        yield this.getWifiSsid(request, response);
    }

    /**
     * Get the Wifi "key" setting
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *getWifiKey(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, PUT, OPTIONS");
        yield ControllerUtil.getMainConfigurationParameterValue("wifi.key", request, response);
    }

    /**
     * Set the Wifi "key" setting
     *
     * @public
     * @param   {solfege.bundle.server.Request}     request     The request
     * @param   {solfege.bundle.server.Response}    response    The response
     */
    *setWifiKey(request, response)
    {
        response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, PUT, OPTIONS");
        yield ControllerUtil.setMainConfigurationParameterValue("wifi.key", request, response);

        // Display the new value
        yield this.getWifiKey(request, response);
    }

}


text:
'use strict';

var _stringify = require('babel-runtime/core-js/json/stringify');

var _stringify2 = _interopRequireDefault(_stringify);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* eslint-env mocha */

var assert = require('assert');
var Fcbuffer = require('evt-fcbuffer');
var schema = require('./schema');

describe('schema', function () {
  it('parses', function () {
    var fcbuffer = Fcbuffer(schema);
    var errors = (0, _stringify2.default)(fcbuffer.errors, null, 4);
    assert.equal(errors, '[]');
  });
});


text:
import React from "react";
import PropTypes from  "prop-types";

function LightContentA(props) {
  return (

          <h2 className={`text-xs text-${props.theme}-500 tracking-widest font-medium title-font mb-1`}>
            ROOF PARTY POLAROID

            Master Cleanse Reliac Heirloom

            Whatever cardigan tote bag tumblr hexagon brooklyn asymmetrical
            gentrify, subway tile poke farm-to-table. Franzen you probably
            haven't heard of them man bun deep jianbing selfies heirloom
            prism food truck ugh squid celiac humblebrag.

              Shooting Stars

              Fingerstache flexitarian street art 8-bit waistcoat. Distillery
              hexagon disrupt edison bulbche.

            <a href className={`text-${props.theme}-500 inline-flex items-center`}>
              Learn More
              <svg
                fill="none"
                stroke="currentColor"
                strokeLinecap="round"
                strokeLinejoin="round"
                strokeWidth="2"
                className="w-4 h-4 ml-2"
                viewBox="0 0 24 24"
              >
                <path d="M5 12h14M12 5l7 7-7 7" />
              </svg>

              The Catalyzer

              Fingerstache flexitarian street art 8-bit waistcoat. Distillery
              hexagon disrupt edison bulbche.

            <a href className={`text-${props.theme}-500 inline-flex items-center`}>
              Learn More
              <svg
                fill="none"
                stroke="currentColor"
                strokeLinecap="round"
                strokeLinejoin="round"
                strokeWidth="2"
                className="w-4 h-4 ml-2"
                viewBox="0 0 24 24"
              >
                <path d="M5 12h14M12 5l7 7-7 7" />
              </svg>

              Neptune

              Fingerstache flexitarian street art 8-bit waistcoat. Distillery
              hexagon disrupt edison bulbche.

            <a href className={`text-${props.theme}-500 inline-flex items-center`}>
              Learn More
              <svg
                fill="none"
                stroke="currentColor"
                strokeLinecap="round"
                strokeLinejoin="round"
                strokeWidth="2"
                className="w-4 h-4 ml-2"
                viewBox="0 0 24 24"
              >
                <path d="M5 12h14M12 5l7 7-7 7" />
              </svg>

              Melanchole

              Fingerstache flexitarian street art 8-bit waistcoat. Distillery
              hexagon disrupt edison bulbche.

            <a href className={`text-${props.theme}-500 inline-flex items-center`}>
              Learn More
              <svg
                fill="none"
                stroke="currentColor"
                strokeLinecap="round"
                strokeLinejoin="round"
                strokeWidth="2"
                className="w-4 h-4 ml-2"
                viewBox="0 0 24 24"
              >
                <path d="M5 12h14M12 5l7 7-7 7" />
              </svg>

        <button className={`flex mx-auto mt-16 text-white bg-${props.theme}-500 border-0 py-2 px-8 focus:outline-none hover:bg-${props.theme}-600 rounded text-lg`}>
          Button
        </button>

  );
}

LightContentA.defaultProps = {
  theme: 'indigo'
};

LightContentA.propTypes = {
  theme: PropTypes.string.isRequired
};

export default LightContentA;


text:
import { alias } from '@ember/object/computed';
import Controller from '@ember/controller';
import { computed } from '@ember/object';

export default Controller.extend({
  network: alias('model.resources.networks.firstObject'),
  ports: computed('network.reservedPorts.[]', 'network.dynamicPorts.[]', function() {
    return (this.get('network.reservedPorts') || [])
      .map(port => ({
        name: port.Label,
        port: port.Value,
        isDynamic: false,
      }))
      .concat(
        (this.get('network.dynamicPorts') || []).map(port => ({
          name: port.Label,
          port: port.Value,
          isDynamic: true,
        }))
      )
      .sortBy('name');
  }),
});


text:
const defaults = {
  title: null,
  message: '',
  type: '',
  iconClass: '',
  showInput: false,
  showClose: true,
  modalFade: true,
  lockScroll: true,
  closeOnClickModal: true,
  closeOnPressEscape: true,
  closeOnHashChange: true,
  inputValue: null,
  inputPlaceholder: '',
  inputType: 'text',
  inputPattern: null,
  inputValidator: null,
  inputErrorMessage: '',
  showConfirmButton: true,
  showCancelButton: false,
  confirmButtonPosition: 'right',
  confirmButtonHighlight: false,
  cancelButtonHighlight: false,
  confirmButtonText: '',
  cancelButtonText: '',
  confirmButtonClass: '',
  cancelButtonClass: '',
  customClass: '',
  beforeClose: null,
  dangerouslyUseHTMLString: false,
  center: false,
  roundButton: false,
  distinguishCancelAndClose: false
};

import Vue from 'vue';
import msgboxVue from './main.vue';
import merge from 'element-ui/src/utils/merge';
import { isVNode } from 'element-ui/src/utils/vdom';

const MessageBoxConstructor = Vue.extend(msgboxVue);

let currentMsg, instance;
let msgQueue = [];

const defaultCallback = action => {
  if (currentMsg) {
    let callback = currentMsg.callback;
    if (typeof callback === 'function') {
      if (instance.showInput) {
        callback(instance.inputValue, action);
      } else {
        callback(action);
      }
    }
    if (currentMsg.resolve) {
      if (action === 'confirm') {
        if (instance.showInput) {
          currentMsg.resolve({ value: instance.inputValue, action });
        } else {
          currentMsg.resolve(action);
        }
      } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
        currentMsg.reject(action);
      }
    }
  }
};

const initInstance = () => {
  instance = new MessageBoxConstructor({
    el: document.createElement('div')
  });

  instance.callback = defaultCallback;
};

const showNextMsg = () => {
  if (!instance) {
    initInstance();
  }
  instance.action = '';

  if (!instance.visible || instance.closeTimer) {
    if (msgQueue.length > 0) {
      currentMsg = msgQueue.shift();

      let options = currentMsg.options;
      for (let prop in options) {
        if (options.hasOwnProperty(prop)) {
          instance[prop] = options[prop];
        }
      }
      if (options.callback === undefined) {
        instance.callback = defaultCallback;
      }

      let oldCb = instance.callback;
      instance.callback = (action, instance) => {
        oldCb(action, instance);
        showNextMsg();
      };
      if (isVNode(instance.message)) {
        instance.$slots.default = [instance.message];
        instance.message = null;
      } else {
        delete instance.$slots.default;
      }
      ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(prop => {
        if (instance[prop] === undefined) {
          instance[prop] = true;
        }
      });
      document.body.appendChild(instance.$el);

      Vue.nextTick(() => {
        instance.visible = true;
      });
    }
  }
};
/**
MessageBox为什么能返回一个promise？
这是一个返回promise的函数，把reject，resolve传递给构造函数的option,内部去处理调用

实测，MessageBox跟loading service一样都是单例的
 */
const MessageBox = function(options, callback) {
  if (Vue.prototype.$isServer) return;
  if (typeof options === 'string' || isVNode(options)) {
    options = {
      message: options
    };
    if (typeof arguments[1] === 'string') {
      options.title = arguments[1];
    }
  } else if (options.callback && !callback) {
    callback = options.callback;
  }

  if (typeof Promise !== 'undefined') {
    return new Promise((resolve, reject) => { // eslint-disable-line
      msgQueue.push({
        options: merge({}, defaults, MessageBox.defaults, options),
        callback: callback,
        resolve: resolve,
        reject: reject
      });

      showNextMsg();
    });
  } else {
    msgQueue.push({
      options: merge({}, defaults, MessageBox.defaults, options),
      callback: callback
    });

    showNextMsg();
  }
};

MessageBox.setDefaults = defaults => {
  MessageBox.defaults = defaults;
};

MessageBox.alert = (message, title, options) => {
  if (typeof title === 'object') {
    options = title;
    title = '';
  } else if (title === undefined) {
    title = '';
  }
  return MessageBox(merge({
    title: title,
    message: message,
    $type: 'alert',
    closeOnPressEscape: false,
    closeOnClickModal: false
  }, options));
};

MessageBox.confirm = (message, title, options) => {
  if (typeof title === 'object') {
    options = title;
    title = '';
  } else if (title === undefined) {
    title = '';
  }
  return MessageBox(merge({
    title: title,
    message: message,
    $type: 'confirm',
    showCancelButton: true
  }, options));
};

MessageBox.prompt = (message, title, options) => {
  if (typeof title === 'object') {
    options = title;
    title = '';
  } else if (title === undefined) {
    title = '';
  }
  return MessageBox(merge({
    title: title,
    message: message,
    showCancelButton: true,
    showInput: true,
    $type: 'prompt'
  }, options));
};

MessageBox.close = () => {
  instance.doClose();
  instance.visible = false;
  msgQueue = [];
  currentMsg = null;
};

export default MessageBox;
export { MessageBox };


text:
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is DOM Range tests.
 *
 * The Initial Developer of the Original Code is
 * Alexander J. Vincent <ajvincent@gmail.com>.
 * Portions created by the Initial Developer are Copyright (C) 2007
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

const C_i = Components.interfaces;
const C_r = Components.results;

const UNORDERED_TYPE = C_i.nsIDOMXPathResult.ANY_UNORDERED_NODE_TYPE;

const INVALID_STATE_ERR = 0x8053000b;     // NS_ERROR_DOM_INVALID_STATE_ERR
const INDEX_SIZE_ERR = 0x80530001;        // NS_ERROR_DOM_INDEX_SIZE_ERR
const INVALID_NODE_TYPE_ERR = 0x805c0002; // NS_ERROR_DOM_INVALID_NODE_TYPE_ERR
const NOT_OBJECT_ERR = 0x805303eb;        // NS_ERROR_DOM_NOT_OBJECT_ERR
const SECURITY_ERR = 0x805303e8;          // NS_ERROR_DOM_SECURITY_ERR

/**
 * Determine if the data node has only ignorable white-space.
 *
 * @return nsIDOMNodeFilter.FILTER_SKIP if it does.
 * @return nsIDOMNodeFilter.FILTER_ACCEPT otherwise.
 */
function isWhitespace(aNode) {
  return ((/\S/).test(aNode.nodeValue)) ?
         C_i.nsIDOMNodeFilter.FILTER_SKIP :
         C_i.nsIDOMNodeFilter.FILTER_ACCEPT;
}

/**
 * Create a DocumentFragment with cloned children equaling a node's children.
 *
 * @param aNode The node to copy from.
 *
 * @return DocumentFragment node.
 */
function getFragment(aNode) {
  var frag = aNode.ownerDocument.createDocumentFragment();
  do_check_true(frag instanceof C_i.nsIDOM3Node);
  for (var i = 0; i < aNode.childNodes.length; i++) {
    frag.appendChild(aNode.childNodes.item(i).cloneNode(true));
  }
  return frag;
}

// Goodies from head_content.js
const serializer = new DOMSerializer();
const parser = new DOMParser();

/**
 * Dump the contents of a document fragment to the console.
 *
 * @param aFragment The fragment to serialize.
 */
function dumpFragment(aFragment) {
  dump(serializer.serializeToString(aFragment) + "\n\n");
}

/**
 * Translate an XPath to a DOM node. This method uses a document
 * fragment as context node.
 *
 * @param aContextNode The context node to apply the XPath to.
 * @param aPath        The XPath to use.
 *
 * @return nsIDOMNode  The target node retrieved from the XPath.
 */
function evalXPathInDocumentFragment(aContextNode, aPath) {
  do_check_true(aContextNode instanceof C_i.nsIDOMDocumentFragment);
  do_check_true(aContextNode.childNodes.length > 0);
  if (aPath == ".") {
    return aContextNode;
  }

  // Separate the fragment's xpath lookup from the rest.
  var firstSlash = aPath.indexOf("/");
  if (firstSlash == -1) {
    firstSlash = aPath.length;
  }
  var prefix = aPath.substr(0, firstSlash);
  var realPath = aPath.substr(firstSlash + 1);
  if (!realPath) {
    realPath = ".";
  }

  // Set up a special node filter to look among the fragment's child nodes.
  var childIndex = 1;
  var bracketIndex = prefix.indexOf("[");
  if (bracketIndex != -1) {
    childIndex = Number(prefix.substring(bracketIndex + 1, prefix.indexOf("]")));
    do_check_true(childIndex > 0);
    prefix = prefix.substr(0, bracketIndex);
  }

  var targetType = C_i.nsIDOMNodeFilter.SHOW_ELEMENT;
  var targetNodeName = prefix;
  if (prefix.indexOf("processing-instruction(") == 0) {
    targetType = C_i.nsIDOMNodeFilter.SHOW_PROCESSING_INSTRUCTION;
    targetNodeName = prefix.substring(prefix.indexOf("(") + 2, prefix.indexOf(")") - 1);
  }
  switch (prefix) {
    case "text()":
      targetType = C_i.nsIDOMNodeFilter.SHOW_TEXT |
                   C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION;
      targetNodeName = null;
      break;
    case "comment()":
      targetType = C_i.nsIDOMNodeFilter.SHOW_COMMENT;
      targetNodeName = null;
      break;
    case "node()":
      targetType = C_i.nsIDOMNodeFilter.SHOW_ALL;
      targetNodeName = null;
  }

  var filter = {
    count: 0,

    // nsIDOMNodeFilter
    acceptNode: function acceptNode(aNode) {
      if (aNode.parentNode != aContextNode) {
        // Don't bother looking at kids either.
        return C_i.nsIDOMNodeFilter.FILTER_REJECT;
      }

      if (targetNodeName && targetNodeName != aNode.nodeName) {
        return C_i.nsIDOMNodeFilter.FILTER_SKIP;
      }

      this.count++;
      if (this.count != childIndex) {
        return C_i.nsIDOMNodeFilter.FILTER_SKIP;
      }

      return C_i.nsIDOMNodeFilter.FILTER_ACCEPT;
    }
  };

  // Look for the node matching the step from the document fragment.
  var walker = aContextNode.ownerDocument.createTreeWalker(
                 aContextNode,
                 targetType,
                 filter,
                 true);
  var targetNode = walker.nextNode();
  do_check_neq(targetNode, null);

  // Apply our remaining xpath to the found node.
  var expr = aContextNode.ownerDocument.createExpression(realPath, null);
  var result = expr.evaluate(targetNode, UNORDERED_TYPE, null);
  do_check_true(result instanceof C_i.nsIDOMXPathResult);
  return result.singleNodeValue;
}

/**
 * Get a DOM range corresponding to the test's source node.
 *
 * @param aSourceNode <source/> element with range information.
 * @param aFragment   DocumentFragment generated with getFragment().
 *
 * @return Range object.
 */
function getRange(aSourceNode, aFragment) {
  do_check_true(aSourceNode instanceof C_i.nsIDOMElement);
  do_check_true(aFragment instanceof C_i.nsIDOMDocumentFragment);
  var doc = aSourceNode.ownerDocument;

  var containerPath = aSourceNode.getAttribute("startContainer");
  var startContainer = evalXPathInDocumentFragment(aFragment, containerPath);
  var startOffset = Number(aSourceNode.getAttribute("startOffset"));

  containerPath = aSourceNode.getAttribute("endContainer");
  var endContainer = evalXPathInDocumentFragment(aFragment, containerPath);
  var endOffset = Number(aSourceNode.getAttribute("endOffset"));

  var range = doc.createRange();
  range.setStart(startContainer, startOffset);
  range.setEnd(endContainer, endOffset);
  return range;
}

/**
 * Get the document for a given path, and clean it up for our tests.
 *
 * @param aPath The path to the local document.
 */
function getParsedDocument(aPath) {
  var doc = do_parse_document(aPath, "application/xml");
  do_check_true(doc.documentElement.localName != "parsererror");
  do_check_true(doc instanceof C_i.nsIDOMDocumentTraversal);
  do_check_true(doc instanceof C_i.nsIDOMXPathEvaluator);
  do_check_true(doc instanceof C_i.nsIDOMDocumentRange);

  // Clean out whitespace.
  var walker = doc.createTreeWalker(doc,
                                    C_i.nsIDOMNodeFilter.SHOW_TEXT |
                                    C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION,
                                    isWhitespace,
                                    false);
  while (walker.nextNode()) {
    var parent = walker.currentNode.parentNode;
    parent.removeChild(walker.currentNode);
    walker.currentNode = parent;
  }

  // Clean out mandatory splits between nodes.
  var splits = doc.getElementsByTagName("split");
  var i;
  for (i = splits.length - 1; i >= 0; i--) {
    var node = splits.item(i);
    node.parentNode.removeChild(node);
  }
  splits = null;

  // Replace empty CDATA sections.
  var emptyData = doc.getElementsByTagName("empty-cdata");
  for (i = emptyData.length - 1; i >= 0; i--) {
    var node = emptyData.item(i);
    var cdata = doc.createCDATASection("");
    node.parentNode.replaceChild(cdata, node);
  }

  return doc;
}

/**
 * Run the extraction tests.
 */
function run_extract_test() {
  var filePath = "test_delete_range.xml";
  var doc = getParsedDocument(filePath);
  var tests = doc.getElementsByTagName("test");

  // Run our deletion, extraction tests.
  for (var i = 0; i < tests.length; i++) {
    dump("Configuring for test " + i + "\n");
    var currentTest = tests.item(i);

    // Validate the test is properly formatted for what this harness expects.
    var baseSource = currentTest.firstChild;
    do_check_eq(baseSource.nodeName, "source");
    var baseResult = baseSource.nextSibling;
    do_check_eq(baseResult.nodeName, "result");
    var baseExtract = baseResult.nextSibling;
    do_check_eq(baseExtract.nodeName, "extract");
    do_check_eq(baseExtract.nextSibling, null);

    /* We do all our tests on DOM document fragments, derived from the test
       element's children.  This lets us rip the various fragments to shreds,
       while preserving the original elements so we can make more copies of
       them.

       After the range's extraction or deletion is done, we use
       nsIDOM3Node.isEqualNode() between the altered source fragment and the
       result fragment.  We also run isEqualNode() between the extracted
       fragment and the fragment from the baseExtract node.  If they are not
       equal, we have failed a test.

       We also have to ensure the original nodes on the end points of the
       range are still in the source fragment.  This is bug 332148.  The nodes
       may not be replaced with equal but separate nodes.  The range extraction
       may alter these nodes - in the case of text containers, they will - but
       the nodes must stay there, to preserve references such as user data,
       event listeners, etc.

       First, an extraction test.
     */

    var resultFrag = getFragment(baseResult);
    var extractFrag = getFragment(baseExtract);

    dump("Extract contents test " + i + "\n\n");
    var baseFrag = getFragment(baseSource);
    var baseRange = getRange(baseSource, baseFrag);
    var startContainer = baseRange.startContainer;
    var endContainer = baseRange.endContainer;

    var cutFragment = baseRange.extractContents();
    dump("cutFragment: " + cutFragment + "\n");
    if (cutFragment) {
      do_check_true(extractFrag.isEqualNode(cutFragment));
    } else {
      do_check_eq(extractFrag.firstChild, null);
    }
    do_check_true(baseFrag.isEqualNode(resultFrag));

    dump("Ensure the original nodes weren't extracted - test " + i + "\n\n");
    var walker = doc.createTreeWalker(baseFrag,
				      C_i.nsIDOMNodeFilter.SHOW_ALL,
				      null,
				      false);
    var foundStart = false;
    var foundEnd = false;
    do {
      do_check_true(walker.currentNode instanceof C_i.nsIDOM3Node);

      if (walker.currentNode.isSameNode(startContainer)) {
        foundStart = true;
      }

      if (walker.currentNode.isSameNode(endContainer)) {
        // An end container node should not come before the start container node.
        do_check_true(foundStart);
        foundEnd = true;
        break;
      }
    } while (walker.nextNode())
    do_check_true(foundEnd);

    /* Now, we reset our test for the deleteContents case.  This one differs
       from the extractContents case only in that there is no extracted document
       fragment to compare against.  So we merely compare the starting fragment,
       minus the extracted content, against the result fragment.
     */
    dump("Delete contents test " + i + "\n\n");
    baseFrag = getFragment(baseSource);
    baseRange = getRange(baseSource, baseFrag);
    var startContainer = baseRange.startContainer;
    var endContainer = baseRange.endContainer;
    baseRange.deleteContents();
    do_check_true(baseFrag.isEqualNode(resultFrag));

    dump("Ensure the original nodes weren't deleted - test " + i + "\n\n");
    walker = doc.createTreeWalker(baseFrag,
                                  C_i.nsIDOMNodeFilter.SHOW_ALL,
                                  null,
                                  false);
    foundStart = false;
    foundEnd = false;
    do {
      do_check_true(walker.currentNode instanceof C_i.nsIDOM3Node);

      if (walker.currentNode.isSameNode(startContainer)) {
        foundStart = true;
      }

      if (walker.currentNode.isSameNode(endContainer)) {
        // An end container node should not come before the start container node.
        do_check_true(foundStart);
        foundEnd = true;
        break;
      }
    } while (walker.nextNode())
    do_check_true(foundEnd);

    // Clean up after ourselves.
    walker = null;

    /* Whenever a DOM range is detached, we cannot use any methods on
       it - including extracting its contents or deleting its contents.  It
       should throw a NS_ERROR_DOM_INVALID_STATE_ERR exception.
    */
    dump("Detached range test\n");
    var compareFrag = getFragment(baseSource);
    baseFrag = getFragment(baseSource);
    baseRange = getRange(baseSource, baseFrag);
    baseRange.detach();
    try {
      var cutFragment = baseRange.extractContents();
      do_throw("Should have thrown INVALID_STATE_ERR!");
    } catch (e if (e instanceof C_i.nsIException &&
                   e.result == INVALID_STATE_ERR)) {
      // do nothing
    }
    do_check_true(compareFrag.isEqualNode(baseFrag));

    try {
      baseRange.deleteContents();
      do_throw("Should have thrown INVALID_STATE_ERR!");
    } catch (e if (e instanceof C_i.nsIException &&
                   e.result == INVALID_STATE_ERR)) {
      // do nothing
    }
    do_check_true(compareFrag.isEqualNode(baseFrag));
  }
}

/**
 * Miscellaneous tests not covered above.
 */
function run_miscellaneous_tests() {
  var filePath = "test_delete_range.xml";
  var doc = getParsedDocument(filePath);
  var tests = doc.getElementsByTagName("test");

  // Let's try some invalid inputs to our DOM range and see what happens.
  var currentTest = tests.item(0);
  var baseSource = currentTest.firstChild;
  var baseResult = baseSource.nextSibling;
  var baseExtract = baseResult.nextSibling;

  var baseFrag = getFragment(baseSource);

  var baseRange = getRange(baseSource, baseFrag);
  var startContainer = baseRange.startContainer;
  var endContainer = baseRange.endContainer;
  var startOffset = baseRange.startOffset;
  var endOffset = baseRange.endOffset;

  // Text range manipulation.
  if ((endOffset > startOffset) &&
      (startContainer == endContainer) &&
      (startContainer instanceof C_i.nsIDOMText)) {
    // Invalid start node
    try {
      baseRange.setStart(null, 0);
      do_throw("Should have thrown NOT_OBJECT_ERR!");
    } catch (e if (e instanceof C_i.nsIException &&
                   e.result == NOT_OBJECT_ERR)) {
      // do nothing
    }

    // Invalid start node
    try {
      baseRange.setStart({}, 0);
      do_throw("Should have thrown SECURITY_ERR!");
    } catch (e if (e instanceof C_i.nsIException &&
                   e.result == SECURITY_ERR)) {
      // do nothing
    }

    // Invalid index
    try {
      baseRange.setStart(startContainer, -1);
      do_throw("Should have thrown INVALID_STATE_ERR!");
    } catch (e if (e instanceof C_i.nsIException &&
                   e.result == INDEX_SIZE_ERR)) {
      // do nothing
    }

    // Invalid index
    var newOffset = startContainer instanceof C_i.nsIDOMText ?
                      startContainer.nodeValue.length + 1 :
                      startContainer.childNodes.length + 1;
    try {
      baseRange.setStart(startContainer, newOffset);
      do_throw("Should have thrown INVALID_STATE_ERR!");
    } catch (e if (e instanceof C_i.nsIException &&
                   e.result == INDEX_SIZE_ERR)) {
      // do nothing
    }

    newOffset--;
    // Valid index
    baseRange.setStart(startContainer, newOffset);
    do_check_eq(baseRange.startContainer, baseRange.endContainer);
    do_check_eq(baseRange.startOffset, newOffset);
    do_check_true(baseRange.collapsed);

    // Valid index
    baseRange.setEnd(startContainer, 0);
    do_check_eq(baseRange.startContainer, baseRange.endContainer);
    do_check_eq(baseRange.startOffset, 0);
    do_check_true(baseRange.collapsed);
  } else {
    do_throw("The first test should be a text-only range test.  Test is invalid.")
  }

  /* See what happens when a range has a startContainer in one fragment, and an
     endContainer in another.  According to the DOM spec, section 2.4, the range
     should collapse to the new container and offset. */
  baseRange = getRange(baseSource, baseFrag);
  startContainer = baseRange.startContainer;
  var startOffset = baseRange.startOffset;
  endContainer = baseRange.endContainer;
  var endOffset = baseRange.endOffset;

  dump("External fragment test\n\n");

  var externalTest = tests.item(1);
  var externalSource = externalTest.firstChild;
  var externalFrag = getFragment(externalSource);
  var externalRange = getRange(externalSource, externalFrag);

  baseRange.setEnd(externalRange.endContainer, 0);
  do_check_eq(baseRange.startContainer, externalRange.endContainer);
  do_check_eq(baseRange.startOffset, 0);
  do_check_true(baseRange.collapsed);

  /*
  // XXX ajvincent if rv == WRONG_DOCUMENT_ERR, return false?
  do_check_true(baseRange instanceof C_i.nsIDOMNSRange);
  do_check_false(baseRange.isPointInRange(startContainer, startOffset));
  do_check_false(baseRange.isPointInRange(startContainer, startOffset + 1));
  do_check_false(baseRange.isPointInRange(endContainer, endOffset));
  */

  // Requested by smaug:  A range involving a comment as a document child.
  doc = parser.parseFromString("<!-- foo --><foo/>", "application/xml");
  do_check_true(doc instanceof C_i.nsIDOMDocumentRange);
  do_check_eq(doc.childNodes.length, 2);
  baseRange = doc.createRange();
  baseRange.setStart(doc.firstChild, 1);
  baseRange.setEnd(doc.firstChild, 2);
  var frag = baseRange.extractContents();
  do_check_eq(frag.childNodes.length, 1);
  do_check_true(frag.firstChild instanceof C_i.nsIDOMComment);
  do_check_eq(frag.firstChild.nodeValue, "f");

  /* smaug also requested attribute tests.  Sadly, those are not yet supported
     in ranges - see https://bugzilla.mozilla.org/show_bug.cgi?id=302775.
   */
}

function run_test() {
  run_extract_test();
  run_miscellaneous_tests();
}


text:
const Post = require('../../models/forums/Post');
const ObjectId = require('mongoose').Types.ObjectId;

const { formatDate } = require('../utils');

let regexp = '\\[quotes=#?([a-z0-9]+)\\]';

let format = async(content, viewer, post) => {
    let reg = new RegExp(regexp, 'gi');

    while (true) {
        let match = reg.exec(content);
        if (!match) break;

        let postId = match[1];
        if (!ObjectId.isValid(postId)) {
            content = content.replace(reg, createQuoteErrorElement('Invalid post ID'));
            continue;
        }

        let quotePost = await Post.findById(postId);
        if (quotePost._id.equals(post._id)) {
            content = content.replace(reg, createQuoteErrorElement('You cannot quote your own post'));
            continue;
        }
        if (!quotePost) {
            content = content.replace(reg, createQuoteErrorElement('Post not found'));
            continue;
        }

        content = content.replace(reg, createQuoteElement(quotePost));
    }
    return content;

};

function createQuoteElement(post) {
    return `

                    Quote by

${post.content}

`;
}

function createQuoteErrorElement(message) {
    return `

Error

${message}

`;
}

module.exports = { regexp, format };


text:
import React from 'react';
import cx from 'classnames';
import { connect } from 'react-redux';

import BungieImage from 'src/components/BungieImage';

import s from './styles.styl';

const NO_ICON = '/img/misc/missing_icon_d2.png';

function Item({ item, className, instance }) {
  const icon = (item && item.displayProperties.icon) || NO_ICON;

  return (

      <BungieImage className={s.icon} src={icon} />

{item && item.displayProperties.name}

          {instance.quantity === 1
            ? item.itemTypeDisplayName
            : instance.quantity}

  );
}

const mapStateToProps = (state, ownProps) => {
  return {
    item:
      state.definitions.DestinyInventoryItemDefinition &&
      state.definitions.DestinyInventoryItemDefinition[ownProps.hash]
  };
};

export default connect(mapStateToProps)(Item);


text:
///////////////////////////////////////////////////////////////////////////
// Copyright © Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
/*global define */
/*jslint browser:true,sloppy:true,nomen:true,unparam:true,plusplus:true,indent:4 */
define([
  "dojo/_base/declare",
  "dojo/text!./summarySetting.html",
  "dijit/_WidgetBase",
  "dijit/_TemplatedMixin",
  "dijit/_WidgetsInTemplateMixin",
  "dojo/dom-class",
  "dojo/dom-construct",
  "dojo/_base/lang",
  "dojo/on",
  "dojo/dom-attr",
  'dijit/Editor',
  'dojo/_base/html',
  "jimu/dijit/Message",
  "dijit/_editor/plugins/TextColor"
], function (
  declare,
  summarySetting,
  _WidgetBase,
  _TemplatedMixin,
  _WidgetsInTemplateMixin,
  domClass,
  domConstruct,
  lang,
  on,
  domAttr,
  Editor,
  html,
  Message
) {
  return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
    templateString: summarySetting,
    _selectedOutputParameter: null, // to store selected output parameter
    _inputOutputSelect: null, // to store input parameter control
    _operatorSelect: null, // to store operator parameter control
    _fieldSelect: null, // to store field parameter control
    _inputOutputParamArray: [], // to store input output parameter Array
    _selectedInput: null, // to store input option object evt
    _selectedOutput: null, // to store output option object evt
    _selectedField: null, // to store feild option object evt
    _selectedOperator: null, // to store operator option object evt
    _summaryExpressionEditor: null, // to store object of summary expression editor
    _editorObj: null, // to store editor object
    _outputLayerSettingsArr: [], // to store settings of output configuration
    _selectedOutputGeometryType: null, // to store geometry type of selected output

    postCreate: function () {
      this._initEditor();
      this.inherited(arguments);
    },

    startup: function () {
      this.inherited(arguments);
    },

    /**
     * This function is used to init dojo editor
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     **/
    _initEditor: function () {
      if (!this._editorObj) {
        this._editorObj = new Editor({
          plugins: [
            "bold", "italic", "underline", "|", "foreColor"
          ]
        }, this.editorContainer);
        html.setStyle(this._editorObj.domNode, {
          "width": '100%',
          "height": '100%'
        });
        this.own(on(this._editorObj, "focus", lang.hitch(this,
          function () {
            domClass.remove(this.verifySummaryExpression,
              "jimu-state-disabled");
          })));
        this.own(on(this._editorObj, "blur", lang.hitch(this,
          function () {
            var editorText, regExp;
            editorText = this._editorObj.focusNode.innerHTML;
            editorText = editorText.replace(/ /g, '');
            regExp = new RegExp("

", 'g');
            editorText = editorText.replace(regExp, "");
            regExp = new RegExp("

", 'g');
            editorText = editorText.replace(regExp, "");
            regExp = new RegExp("

", 'g');
            editorText = editorText.replace(regExp, "");
            editorText = editorText.replace(/
/g, "");
            editorText = lang.trim(editorText);

            if ((editorText === null) || (editorText === "")) {
              this._editorObj.set("value", "");
              domClass.add(this.verifySummaryExpression,
                "jimu-state-disabled");
            } else {
              domClass.remove(this.verifySummaryExpression,
                "jimu-state-disabled");
            }
          })));

        this._editorObj.onLoadDeferred.then(lang.hitch(this, function () {
          if ((this._editorObj) && (this._editorObj.hasOwnProperty(
              'editNode'))) {
            if ("title" in this._editorObj.editNode) {
              if (this._editorObj.editNode.title === null ||
                this._editorObj.editNode.title === "") {
                this._editorObj.editNode.title = this.nls.summaryTab
                  .summaryEditorText;
              }
            }
          }
        }));

        this._editorObj.startup();
      }
    },

    /**
     * This function is used to display input & output parameter
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     **/
    displayInputOutputParameters: function () {
      domConstruct.empty(this.inputOutputParameterPanel);
      this._displayInputOutputPanelParameters();
      this._regainExistingConfigurationData();
    },

    /**
     * This function is used to regain existing configuration settings.
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     **/
    _regainExistingConfigurationData: function () {
      if (this.config.summaryExpression) {
        this._editorObj.focus();
        this._editorObj.set("value", this.config.summaryExpression.summaryExpressionValue);
        if (this.config.summaryExpression.summaryExpressionValue ===
          null || this.config.summaryExpression.summaryExpressionValue ===
          "") {
          domClass.add(this.verifySummaryExpression,
            "jimu-state-disabled");
        } else {
          domClass.remove(this.verifySummaryExpression,
            "jimu-state-disabled");
        }
      }
    },

    /**
     * This function used to add parameter in input output panel
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _displayInputOutputPanelParameters: function () {
      var inputOption, i;
      this._inputOutputParamArray = [];
      this._inputOutputSelect = domConstruct.create("select", {
        "class": "esriCTPanelSelect",
        "size": 2
      }, this.inputOutputParameterPanel);
      for (i = 0; i < this.inputParametersArray.length; i++) {
        inputOption = domConstruct.create("option", {});
        inputOption.innerHTML = this.inputParametersArray[i].name;
        inputOption.value = this.inputParametersArray[i].name;
        inputOption.title = this.inputParametersArray[i].name;
        domAttr.set(inputOption, "Type", "Input");
        this._inputOutputSelect.appendChild(inputOption);
        domClass.add(inputOption, "esriCTInputOutputOptions");
        this._inputOutputParamArray.push(this.inputParametersArray[i]);
      }
      for (i = 0; i < this.outputParametersArray.length; i++) {
        inputOption = domConstruct.create("option", {});
        inputOption.innerHTML = this.outputParametersArray[i].name;
        inputOption.value = this.outputParametersArray[i].name;
        inputOption.title = this.outputParametersArray[i].name;
        domAttr.set(inputOption, "Type", "Output");
        if (this.outputParametersArray[i] && this.outputParametersArray[
            i].defaultValue && this.outputParametersArray[i].defaultValue
          .geometryType) {
          domAttr.set(inputOption, "GeometryType", this.outputParametersArray[
            i].defaultValue.geometryType);
        } else {
          domAttr.set(inputOption, "GeometryType", null);
        }
        this._inputOutputSelect.appendChild(inputOption);
        domClass.add(inputOption, "esriCTInputOutputOptions");
        this._inputOutputParamArray.push(this.outputParametersArray[i]);
      }
      domAttr.set(this._inputOutputSelect, "size", this._inputOutputParamArray
        .length);
      this._onInputOutputClick();
      this._insertBlankSelectInFieldPanel();
      this._insertBlankSelectInOperatorPanel();
      this._allocateEqualSizeToPanels();
    },

    /**
     * This function is used to insert blank options in field panel
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _insertBlankSelectInFieldPanel: function () {
      var fieldOption;
      this._fieldSelect = domConstruct.create("select", {
        "class": "esriCTFieldPanelSelect",
        "size": 2
      }, this.fieldPanel);
      fieldOption = domConstruct.create("option", {});
      fieldOption.innerHTML = "";
      domAttr.set(fieldOption, "disabled", true);
      this._fieldSelect.appendChild(fieldOption);
      domClass.add(fieldOption, "esriCTBlankOptions");
    },

    /**
     * This function is used to insert blank options in field panel
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _insertBlankSelectInOperatorPanel: function () {
      var operatorOption;
      this._operatorSelect = domConstruct.create("select", {
        "class": "esriCTOperatorPanelSelect",
        "size": 2
      }, this.operatorPanel);
      operatorOption = domConstruct.create("option", {});
      operatorOption.innerHTML = "";
      domAttr.set(operatorOption, "disabled", true);
      this._operatorSelect.appendChild(operatorOption);
      domClass.add(operatorOption, "esriCTBlankOptions");
    },

    /**
     * This function is used to empty field panel
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _emptyFieldPanel: function () {
      domConstruct.empty(this.fieldPanel);
      this._fieldSelect = null;
    },

    /**
     * This function is used to empty operator panel
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _emptyOperatorPanel: function () {
      domConstruct.empty(this.operatorPanel);
      this._operatorSelect = null;
    },

    /**
     * This function is used to display input/output operators
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _onInputOutputClick: function () {
      var type;
      this.own(on(this._inputOutputSelect, "click", lang.hitch(this,
        function (evt) {
          type = domAttr.get(evt.currentTarget[evt.currentTarget
            .selectedIndex], "Type");
          if (type === "Input") {
            domClass.add(this.addSummaryExpression,
              "jimu-state-disabled");
            this._selectedInput = this._selectedOutput = this._selectedField =
              this._selectedOperator = null;
            this._selectedInput = evt.currentTarget[evt.currentTarget
              .selectedIndex];
            this._emptyFieldPanel();
            this._emptyOperatorPanel();
            this._insertBlankSelectInFieldPanel();
            this._displayOperators(true, false, false, false);
            domClass.remove(this.operatorPanel, "esriCTHidden");
          } else if (type === "Output") {
            this._selectedOutputGeometryType = domAttr.get(evt.currentTarget[
              evt.currentTarget
              .selectedIndex], "GeometryType");
            this._selectedInput = this._selectedOutput = this._selectedField =
              this._selectedOperator = null;
            this._selectedOutput = evt.currentTarget[evt.currentTarget
              .selectedIndex];
            this._selectedOutputParameter = evt;
            this._emptyFieldPanel();
            this._emptyOperatorPanel();
            this._displayOutputFields();
            this._fetchAndDisplayOutputOperators();
          }
        })));
    },

    /**
     * This function is used to fetch & display output operators
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _fetchAndDisplayOutputOperators: function () {
      domClass.add(this.addSummaryExpression,
        "jimu-state-disabled");
      this._displayOperators(false, true, false, false);
      this._fieldSelect.selectedIndex = "-1";
    },

    /**
     * This function is used to display fields
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _displayOutputFields: function () {
      var fieldOption, i, fieldOptionArray = [];
      domConstruct.empty(this.fieldPanel);
      fieldOptionArray = this._inputOutputParamArray[this._selectedOutputParameter
        .currentTarget.selectedIndex].defaultValue.fields;
      this._fieldSelect = domConstruct.create("select", {
        "class": "esriCTFieldPanelSelect"
      }, this.fieldPanel);
      for (i = 0; i < fieldOptionArray.length; i++) {
        if (fieldOptionArray[i].type === "esriFieldTypeDouble" ||
          fieldOptionArray[i].type === "esriFieldTypeSmallInteger" ||
          fieldOptionArray[i].type === "esriFieldTypeInteger") {
          fieldOption = domConstruct.create("option", {});
          fieldOption.innerHTML = fieldOptionArray[i].name;
          fieldOption.value = fieldOptionArray[i].name;
          fieldOption.title = fieldOptionArray[i].name;
          this._fieldSelect.appendChild(fieldOption);
          domClass.add(fieldOption, "esriCTInputOutputOptions");
        }
      }
      this._onFieldClick();
      this._allocateEqualSizeToPanels();
    },

    /**
     * This function is used to display fields operator
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _onFieldClick: function () {
      this.own(on(this._fieldSelect, "click", lang.hitch(this,
        function (evt) {
          domClass.add(this.addSummaryExpression,
            "jimu-state-disabled");
          this._selectedField = null;
          this._selectedField = evt.currentTarget[evt.currentTarget
            .selectedIndex];
          this._displayOperators(false, false, true, false);
          this._allocateEqualSizeToPanels();
        })));
    },

    /**
     * This function is used to display input/output/field operator
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _displayOperators: function (inputOperator, outputOperator,
      fieldOperator, displayOutputSkipCountOption) {
      var operatorOption, i, operatorParameterArray;
      operatorParameterArray = [];
      domConstruct.empty(this.operatorPanel);
      if (inputOperator) {
        operatorParameterArray.push(this.nls.summaryTab.inputOperatorCountOption);
      } else if (outputOperator) {
        operatorParameterArray.push(this.nls.summaryTab.outputOperatorCountOption);
        if (displayOutputSkipCountOption) {
          operatorParameterArray.push(this.nls.summaryTab.outputOperatorSkipCountOption);
        }
      } else if (fieldOperator) {
        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorSumOption);
        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorMinOption);
        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorMaxOption);
        operatorParameterArray.push(this.nls.summaryTab.fieldOperatorMeanOption);
      }
      this._operatorSelect = domConstruct.create("select", {
        "class": "esriCTPanelSelect",
        "size": 2
      }, this.operatorPanel);
      for (i = 0; i < operatorParameterArray.length; i++) {
        operatorOption = domConstruct.create("option", {});
        operatorOption.innerHTML = operatorParameterArray[i];
        operatorOption.value = operatorParameterArray[i];
        operatorOption.title = operatorParameterArray[i];
        this._operatorSelect.appendChild(operatorOption);
        domClass.add(operatorOption, "esriCTInputOutputOptions");
      }
      this._selectOperator();
      this._allocateEqualSizeToPanels();
    },

    /**
     * This function is used to refresh operator list
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    refreshOperator: function () {
      if (!this._selectedField) {
        if (this._selectedOutput) {
          this._fetchAndDisplayOutputOperators();
          if (this._selectedOperator && (this._selectedOperator.value ===
              this.nls.summaryTab.outputOperatorCountOption)) {
            if (this._operatorSelect) {
              this._operatorSelect.selectedIndex = 0;
              domClass.remove(this.addSummaryExpression,
                "jimu-state-disabled");
            }
          }
        }
      }
    },

    /**
     * This function is used to select operator
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _selectOperator: function () {
      this.own(on(this._operatorSelect, "click", lang.hitch(this,
        function (evt) {
          this._selectedOperator = null;
          this._selectedOperator = evt.currentTarget[evt.currentTarget
            .selectedIndex];
          if ((this._selectedInput !== null || this._selectedOutput !==
              null) && this._selectedOperator !== null) {
            domClass.remove(this.addSummaryExpression,
              "jimu-state-disabled");
          }
        })));
    },

    /**
     * This function is used to get max length of parameters of inputOutput/field/operator parameters
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _allocateEqualSizeToPanels: function () {
      var inputOutputPanelLength, fieldPanelLength,
        operatorPanelLength, selectSize;
      inputOutputPanelLength = 0;
      fieldPanelLength = 0;
      operatorPanelLength = 0;
      if (this._inputOutputSelect && this._inputOutputSelect.length >
        0) {
        inputOutputPanelLength = this._inputOutputSelect.length;
      }
      if (this._fieldSelect && this._fieldSelect.length > 0) {
        fieldPanelLength = this._fieldSelect.length;
      }
      if (this._operatorSelect && this._operatorSelect.length > 0) {
        operatorPanelLength = this._operatorSelect.length;
      }
      selectSize = Math.max(inputOutputPanelLength, fieldPanelLength,
        operatorPanelLength);
      if (this._inputOutputSelect) {
        domAttr.set(this._inputOutputSelect, "size", selectSize);
      }
      if (this._fieldSelect) {
        domAttr.set(this._fieldSelect, "size", selectSize);
      }
      if (this._operatorSelect) {
        domAttr.set(this._operatorSelect, "size", selectSize);
      }
      this._removeClassFromChildNodes();
      if (this._inputOutputSelect && (this._inputOutputSelect.length ===
          selectSize)) {
        domClass.add(this._inputOutputSelect.childNodes[selectSize -
          1], "esriCTInputOutputOptionsBorderNone");
      }
      if (this._fieldSelect && (this._fieldSelect.length ===
          selectSize)) {
        domClass.add(this._fieldSelect.childNodes[selectSize - 1],
          "esriCTInputOutputOptionsBorderNone");
      }
      if (this._operatorSelect && (this._operatorSelect.length ===
          selectSize)) {
        domClass.add(this._operatorSelect.childNodes[selectSize - 1],
          "esriCTInputOutputOptionsBorderNone");
      }
    },

    /**
     * This function is used to remove class from childnodes.
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _removeClassFromChildNodes: function () {
      var i;
      if (this._inputOutputSelect) {
        for (i = 0; i < this._inputOutputSelect.childNodes.length; i++) {
          domClass.remove(this._inputOutputSelect.childNodes[i],
            "esriCTInputOutputOptionsBorderNone");
        }
      }
      if (this._fieldSelect) {
        for (i = 0; i < this._fieldSelect.childNodes.length; i++) {
          domClass.remove(this._fieldSelect.childNodes[i],
            "esriCTInputOutputOptionsBorderNone");
        }
      }
      if (this._operatorSelect) {
        for (i = 0; i < this._operatorSelect.childNodes.length; i++) {
          domClass.remove(this._operatorSelect.childNodes[i],
            "esriCTInputOutputOptionsBorderNone");
        }
      }
    },

    /**
     * This function is used to add expression in textarea
     * @memberOf widgets/NetworkTrace/settings/summarySettings
     */
    _onClickAddExpressionBtn: function () {
      if (!(domClass.contains(this.addSummaryExpression,


text:
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'find', 'sk', {
	find: 'Vyhľadať',
	findOptions: 'Možnosti vyhľadávania',
	findWhat: 'Čo hľadať:',
	matchCase: 'Rozlišovať malé a veľké písmená',
	matchCyclic: 'Po dosiahnutí konca pokračovať od začiatku',
	matchWord: 'Len celé slová',
	notFoundMsg: 'Hľadaný text nebol nájdený.',
	replace: 'Nahradiť',
	replaceAll: 'Nahradiť všetko',
	replaceSuccessMsg: '%1 výskyt(ov) nahradených.',
	replaceWith: 'Čím nahradiť:',
	title: 'Vyhľadať a nahradiť'
} );


text:
'use strict'

module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.sequelize.transaction((t) =>
      queryInterface
        .addColumn(
          'case',
          'initial_ruling_date',
          {
            type: Sequelize.DATE,
            allowNull: true,
          },
          { transaction: t },
        )
        .then(() =>
          queryInterface.sequelize.query(
            'WITH RECURSIVE initialRuling AS(\
              SELECT\
                id AS id,\
                ruling_date AS ruling_date,\
                NULL :: uuid AS parent_case_id,\
                NULL :: timestamp with time zone AS initial_ruling_date\
              FROM "case"\
              WHERE\
                parent_case_id IS NULL\
              UNION\
              SELECT\
                c.id AS id,\
                c.ruling_date AS ruling_date,\
                c.parent_case_id AS parent_case_id,\
                coalesce(i.initial_ruling_date, i.ruling_date) AS initial_ruling_date\
              FROM "case" c\
                INNER JOIN initialRuling i ON i.id = c.parent_case_id\
            )\
            Update "case" u\
            set initial_ruling_date = initialRuling.initial_ruling_date\
            from initialRuling\
            where initialRuling.id = u.id;\
            ',
            { transaction: t },
          ),
        ),
    )
  },

  down: (queryInterface) => {
    return queryInterface.sequelize.transaction((t) =>
      queryInterface.removeColumn('case', 'initial_ruling_date', {
        transaction: t,
      }),
    )
  },
}


text:
/**
 * tab组件
 * @module Tab
 * @author liweitao
 */

PP.define('tab', function () {
  'use strict';

  /**
   * @class
   * @alias module:tab
   */
  var Tab = _.Class.extend({
    /**
     * tab.
     * @constructor
     * @param {Object} options
     * @param {String|HTMLElement|Zepto} options.container - 指定tab容器
     * @param {String|HTMLElement|Zepto} [options.head] - tab的头部
     * @param {String|HTMLElement|Zepto} [options.content] - tab的内容
     * @param {Number|String} [options.startAt] - 起始Tab页
     * @param {Boolean} [options.hash] - 是否启用hash标记tab
     * @param {Function} [options.onBeforeSwitch] - Tab切换前触发的操作
     * @param {Function} [options.onAfterSwitch] - Tab切换后触发的操作
     * @param {Function} [opts.onFirstShow] - Tab首次show出来的时候触发的操作
     */
    construct: function (options) {
      this.conf = $.extend({
        container: null,
        head: null,
        content: null,
        startAt: 0,
        hash: false,
        onBeforeSwitch: function () {},
        onAfterSwitch: function () {},
        onFirstShow: function () {}
      }, options);

      this.index = undefined;
      var conf = this.conf;
      this.$el = $(conf.container);
      this.$head = conf.head ? $(conf.head) : this.$el.children('.tab_head, .j_tab_head');
      this.$headItems = this.$head.children('.tab_head_item, .j_tab_head_item');
      this.$content = conf.content ? $(conf.content) : this.$el.children('.tab_content, .j_tab_content');
      this.$contentItems = this.$content.children('.tab_content_item, .j_tab_content_item');

      this.tabLength = this.$headItems.length;

      for (var i = 0, l = this.$headItems.length; i < l; i++) {
        this.$headItems[i].hasShown = false;
      }

      this.init();
    },

    /**
     * @description 一些初始化操作
     */
    init: function () {
      var conf = this.conf;
      var index = -1;
      var hash = window.location.hash;
      // 优先通过hash来定位Tab
      if (conf.hash && hash.length > 1) {
        this.switchTo(hash);
      } else {
        // 如果为string则认为是个选择器
        if (typeof conf.startAt === 'string') {
          this.$active = this.$headItems.filter(conf.startAt);
          if (this.$active.length) {
            index = this.$active.index();
          } else {
            index = 0;
          }
        } else if (typeof conf.startAt === 'number') {
          index = conf.startAt;
        } else {
          index = 0;
        }
        this.switchTo(index);
      }
      this.initEvent();

    },

    /**
     * @description 初始化事件绑定
     */
    initEvent: function () {
      var _this = this;
      var conf = _this.conf;
      this.$head.on('click', '.tab_head_item, .j_tab_head_item', function () {
        var index = $(this).index();
        _this.switchTo(index);
        return false;
      });
    },

    /**
     * @description 切换tab
     * @param {Number|String} index - 可为tab的索引或是hash
     * @return {Object} this - 实例本身，方便链式调用
     */
    switchTo: function (index) {
      var conf = this.conf;
      if (conf.hash) {
        var hash;
        if (typeof index === 'string') {
          hash = index.replace('#', '');
          this.$active = this.$headItems.filter('[data-hash$=' + hash + ']');
          index = this.$active.index();
        }
        if (typeof index === 'number'){
          hash = this.$headItems.eq(index).attr('data-hash');
        }

        if (index === -1) {
          return -1;
        }
        window.location.hash = hash;
      }
      index = parseInt(index, 10);
      if (index === this.index) {
        return;
      }

      this.index = index;

      if (typeof conf.onBeforeSwitch === 'function') {
        conf.onBeforeSwitch.call(this, index, this);
      }

      this.$headItems.removeClass('active').eq(index).addClass('active');
      this.$contentItems.hide().eq(index).show();

      if (typeof conf.onAfterSwitch === 'function') {
        conf.onAfterSwitch.call(this, index, this);
      }

      if (! this.$headItems[index].hasShown && typeof conf.onFirstShow === 'function') {
        conf.onFirstShow.call(this, index, this);
        this.$headItems[index].hasShown = true;
      }
      return this;
    },

    /**
     * @description 切换到下一tab
     * @return {Object} this - 实例本身，方便链式调用
     */
    switchToNext: function () {
      var index = this.index + 1;
      if (index >= this.tabLength) {
        index = 0;
      }
      this.switchTo(index);
      return this;
    },

    /**
     * @description 切换到上一tab
     * @return {Object} this - 实例本身，方便链式调用
     */
    switchToPrev: function () {
      var index = this.index + 1;
      if (index <= 0) {
        index = 0;
      }
      this.switchTo(index);
      return this;
    },

    /**
     * @description 销毁组件
     */
    destroy: function () {
      this.unbind();
      this.$el.remove();
    },

    /**
     * @description 解绑事件
     * @return {Object} this - 实例本身，方便链式调用
     */
    unbind: function () {
      this.$head.off();
      return this;
    },

    /**
     * @description 设置参数
     * @return {Object} this - 实例本身，方便链式调用
     */
    setOptions: function (options) {
      $.extend(this.conf, options);
      return this;
    }
  });

  return Tab;
});


text:
//webtorrent
var client = new WebTorrent();
//firebase
firebase.initializeApp({
    apiKey: "AIzaSyAFlH1OEvxWRGSwzYSEj8VL4oLqLPQtQtU",
    authDomain: "groovetorrent-a937a.firebaseapp.com",
    databaseURL: "https://groovetorrent-a937a.firebaseio.com",
    storageBucket: "groovetorrent-a937a.appspot.com",
});
var songsRef = firebase.database().ref("rooms/test/songs");
var player;

var vue = new Vue({
    el: '#app',
    data: {
        songs: [],
        currentSong: null,
        isPlaying: false
    },
    methods: {
        onFileSelect: function (file) {
            var self = this;
            var p = client.seed(file, function (torrent) {
                var song = {
                    name: file.name,
                    torrent: torrent,
                    link: torrent.magnetURI,
                    state: "seeding",
                    download: "0",
                    upload: "0",
                    percentage: "0",
                    peers: "0",
                    duration: "0",
                    currentTime: "0"
                }
                self.songs.push(song);
                songsRef.push({
                    name: song.name,
                    link: song.link
                })
            })
        },
        play: function (song) {
            var self = this;
            if (song.state !== "seeding") {
                return console.error("The song is imcomplete, can not play.")
            }
            song.torrent.files[0].getBuffer(function (err, data) {
                if (player) {
                    player.stop();
                }
                player = AV.Player.fromBuffer(data);
                player.play();
                self.currentSong = song;
                self.isPlaying = true;
            })
        },
        sync: function (newMeta) {
            var self = this;
            var meta = newMeta;
            var dul = self.songs.filter(function (song) { return song.link === meta.link });
            if (dul.length > 0) {
                return;
            }
            var song = {
                name: meta.name,
                link: meta.link,
                state: "init",
                download: "0",
                upload: "0",
                percentage: "0",
                peers: "0",
                duration: "0",
                currentTime: "0"
            }
            self.songs.push(song);
            client.add(meta.link, function (torrent) {
                var file = torrent.files[0]
                song.torrent = torrent;
                song.state = "syncing";
                torrent.on('done', function () {
                    song.state = "seeding"
                })
            });
        }
    },
    ready: function () {
        var self = this;
        setInterval(function () {
            self.songs.forEach(function (song) {
                if (song.torrent) {
                    song.download = prettyBytes(song.torrent.downloadSpeed);
                    song.upload = prettyBytes(song.torrent.uploadSpeed);
                    song.percentage = Math.round(song.torrent.progress * 100 * 100) / 100;
                    song.peers = song.torrent.numPeers;
                }
            });

        }, 2000);

        songsRef.on('child_added', function (data) {
            self.sync(data.val());
        });

        setInterval(function () {
            if (player && self.currentSong) {
                self.currentSong.currentTime = millisecondsToTime(player.currentTime);
                self.currentSong.duration = millisecondsToTime(player.duration);
                self.isPlaying = player.playing;
            }
        }, 1000);

    }
})

function millisecondsToTime(milli) {
    var milliseconds = milli % 1000;
    var seconds = Math.floor((milli / 1000) % 60);
    var minutes = Math.floor((milli / (60 * 1000)) % 60);
    seconds = seconds > 9 ? seconds : "0" + seconds;
    minutes = minutes > 9 ? minutes : "0" + minutes;

    return minutes + ":" + seconds;
}

function prettyBytes(num) {
    var exponent, unit, neg = num < 0, units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
    if (neg) num = -num
    if (num < 1) return (neg ? '-' : '') + num + ' B'
    exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1)
    num = Number((num / Math.pow(1000, exponent)).toFixed(2))
    unit = units[exponent]
    return (neg ? '-' : '') + num + ' ' + unit
}


text:
/*
Copyright Â© 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, European Research Consortium
for Informatics and Mathematics, Keio University). All
Rights Reserved. This work is distributed under the W3CÂ® Software License [1] 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.

[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
*/

   /**
    *  Gets URI that identifies the test.
    *  @return uri identifier of test
    */
function getTargetURI() {
      return "http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLFrameElement02";
   }

var docsLoaded = -1000000;
var builder = null;

//
//   This function is called by the testing framework before
//      running the test suite.
//
//   If there are no configuration exceptions, asynchronous
//        document loading is started.  Otherwise, the status
//        is set to complete and the exception is immediately
//        raised when entering the body of the test.
//
function setUpPage() {
   setUpPageStatus = 'running';
   try {
     //
     //   creates test document builder, may throw exception
     //
     builder = createConfiguredBuilder();

      docsLoaded = 0;

      var docRef = null;
      if (typeof(this.doc) != 'undefined') {
        docRef = this.doc;
      }
      docsLoaded += preload(docRef, "doc", "frame");

       if (docsLoaded == 1) {
          setUpPageStatus = 'complete';
       }
    } catch(ex) {
        catchInitializationError(builder, ex);
        setUpPageStatus = 'complete';
    }
}

//
//   This method is called on the completion of
//      each asychronous load started in setUpTests.
//
//   When every synchronous loaded document has completed,
//      the page status is changed which allows the
//      body of the test to be executed.
function loadComplete() {
    if (++docsLoaded == 1) {
        setUpPageStatus = 'complete';
    }
}

/**
*
    The longDesc attribute specifies a URI designating a long description
    of this image or frame.

    Retrieve the longDesc attribute of the first FRAME element and examine
    its value.

* @author NIST
* @author Rick Rivello
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-7836998
*/
function HTMLFrameElement02() {
   var success;
    if(checkInitialization(builder, "HTMLFrameElement02") != null) return;
    var nodeList;
      var testNode;
      var vlongdesc;
      var doc;

      var docRef = null;
      if (typeof(this.doc) != 'undefined') {
        docRef = this.doc;
      }
      doc = load(docRef, "doc", "frame");
      nodeList = doc.getElementsByTagName("frame");
      assertSize("Asize",2,nodeList);
testNode = nodeList.item(0);
      vlongdesc = testNode.longDesc;

      assertEquals("longdescLink","about:blank",vlongdesc);

}

function runTest() {
   HTMLFrameElement02();
}


text:
var markerLayer,map;
$(document).ready(function(){

	markerLayer =  L.markerClusterGroup();// L.featureGroup();
	 map = L.map('map').setView([39.134172, -98.628082], 4);
	 	L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
		attribution: '© OpenStreetMap contributors'
	}).addTo(map);

			//activate on open
			$("#wrapper").toggleClass("toggled");
			$("#wrapper2").toggleClass("toggled");

			//easybutton search
			L.easyButton('fa-search', function () {
				$("#wrapper").toggleClass("toggled");
				$("#wrapper2").toggleClass("toggled");
				}).addTo(map);

			// easybutton home
			L.easyButton('fa-home', function () {
				map.setView([39.134172, -98.628082], 4.488);
				var divs = document.getElementsByClassName('search1');
				var divs2 = document.getElementsByClassName('search2');
				// //alert(divs[0].innerHTML.indexOf(x));
				for (var i = 0; i < divs.length; i++) {
					$("#" + divs[i].id).css({
						'display': 'block'
					});
				}
				for (var i = 0; i < divs2.length; i++) {
					$("#" + divs2[i].id).css({
						'display': 'block'
					});
				}
				//   	return false;

			}).addTo(map);
			// setup a marker group
            markerLayer.addTo(map);

			map.attributionControl.setPrefix('Licensed MIT');

	loadData(-1); // by default -1 so that it will load all data

});

function loadData(ye){
	markerLayer.clearLayers();
	var uu = "php/getData.php";
	var dd = 0;
	if (ye != -1){
		uu = "php/getData.php?year="+ye;
		dd = ye;
	}

	$.ajax({
		type: "GET",
		url: uu,
		yy : dd,
		success: function(msg) {

			$('.search1').remove();
			$('.search2').remove();
			var allData = JSON.parse(msg);
			var SchData = allData;
			//ordered list of all colleges
			sortByKey(SchData, 'col_nm');
			var previousdiv = document.getElementById('College-list');
			//produces all of markers
			var markerL = [];
			for (var i = 0; i <= SchData.length - 1; i++) {
				var nextcollege = SchData[i];
				var marker = new L.marker([nextcollege.lat,nextcollege.lng], {/*riseOnHover: true*/});
				/*
				marker.on('mouseover', function (e) {
					this.openPopup();
				});
				marker.on('mouseout', function (e) {
					this.closePopup();
				});
				*/

				markerL.push(marker);

				//add text
				var markertext = L.popup({
					closeButton: false,
					offset: L.point(0, 0),

				})
						.setContent("");

				var str = "";
				// if (undefined == nextcollege.students){
					//College do not have students for the respectiveyear
					// continue;
				// }
				// nextcollege.students.sort();

				markertext.setContent("
"
							+ " "+  nextcollege.col_nm + "
Enrolled (" + nextcollege.enrolled + ")
Accepted (" + nextcollege.accepted + ")

" /*+ str */);
				var collegeIcon = L.icon({
					iconUrl: "dataimgs/college/"+nextcollege.col_lg,
					iconSize:     [50, 50], // size of the icon
					className : "LIcon"
				});

				marker.setIcon(collegeIcon);
				marker.addTo(markerLayer );
				marker.bindPopup(markertext);
				//creates HTML div for each element in list
				var htmlrest = document.createElement('newdiv');
				htmlrest.setAttribute("divid", 0);
				previousdiv.appendChild(htmlrest);
				htmlrest.innerHTML = nextcollege.col_nm;
				htmlrest.setAttribute("markerindex", i);
				htmlrest.setAttribute("class", "search2");
				htmlrest.setAttribute("id", i);
				//creates mouselistener from list to marker
				htmlrest.addEventListener("click", function (e) {

					var index = e.target.getAttribute("markerindex");
					map.setView(markerL[index].getLatLng(), 12);
					markerL[index].fire('click');
					//$("#wrapper").toggleClass("toggled");
				});

			}

			//ordered list of all students
			var allstudents = [];
			allstudents = [2012,2013,2014,2015,2016,2017,2018];
			var previousdiv2 = document.getElementById('Student-list');

			allstudents.sort();

			for (var i = 0; i <= allstudents.length - 1; i++) {
				var htmlrest = document.createElement('div');
				htmlrest.setAttribute("divid", "div_"+allstudents[i]);
				previousdiv2.appendChild(htmlrest);
				htmlrest.innerHTML = allstudents[i];//allstudents[i][0].st_nm;

				htmlrest.setAttribute("yearVal", allstudents[i]);
				htmlrest.setAttribute("class", "search1");
				htmlrest.setAttribute("id", "div_"+allstudents[i]);
				//create stuff
				htmlrest.addEventListener("click", function (e) {
					var yearVal = e.target.getAttribute("yearVal");
					loadData(yearVal);
				});
			}
			$(".search1").css("background-color", "#f7f7f7");//resetting color
			if (this.yy>0){
				//do nothing
				$("#div_"+this.yy).css("background-color", "beige");
			}else{
				//first time only
				$("#div_2012").click();
				$("#div_2012").css("background-color", "beige");
			}
		},
		error: function(data) {
			console.log("Error");
		},
		complete: function(data) {

			//A function to be called when the request finishes
			// (after success and error callbacks are executed).
		}
	});

}

function sortByKey(array, key) {
	return array.sort(function (a, b) {
		var x = a[key].toLowerCase();
		var y = b[key].toLowerCase();
		return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	});
}

//function run by form to search
function find() {

	var x = document.getElementById('search').value.toLowerCase();
	//var y = document.getElementbyId('smh').innerHTML.indexOf(x) != -1
	var divs = document.getElementsByClassName('search1');
	//alert(divs[0].innerHTML.indexOf(x));
	if (x == "") {
		for (var i = 0; i < divs.length; i++) {
			$("#" + divs[i].id).css({
				'display': 'block'
			});
		}
		return false;
	}
	if (x.length == 1) {
		for (var i = 0; i < divs.length; i++) {
			if (divs[i].innerHTML.charAt(0).toLowerCase().indexOf(x) == -1) {
				//$("#"+divs[i].id).toggleClass("toggled");

				$("#" + divs[i].id).css({
					'display': 'none'
				});
			} else {
				$("#" + divs[i].id).css({
					'display': 'block'
				});
			}
		}
		return false;
	}

	if (x.length < 4) {
		for (var i = 0; i < divs.length; i++) {
			firstlast = divs[i].innerHTML.toString().split(" ");

			if (firstlast[0].substring(0, x.length).toLowerCase().indexOf(x) == -1 && firstlast[1].substring(0, x.length).toLowerCase().indexOf(x) == -1) {
				//$("#"+divs[i].id).toggleClass("toggled");

				$("#" + divs[i].id).css({
					'display': 'none'
				});
			} else {
				$("#" + divs[i].id).css({
					'display': 'block'
				});
			}
		}
		return false;
	}

	for (var i = 0; i < divs.length; i++) {
		//str = divs[i].innerHTML.toLowerCase();

		if (divs[i].innerHTML.toLowerCase().indexOf(x) == -1) {
			//$("#"+divs[i].id).toggleClass("toggled");

			$("#" + divs[i].id).css({
				'display': 'none'
			});
		} else {
			$("#" + divs[i].id).css({
				'display': 'block'
			});
		}
	}

	return false;
}

function find2() {

	var x = document.getElementById('searchB').value.toLowerCase();
	//var y = document.getElementbyId('smh').innerHTML.indexOf(x) != -1
	var divs = document.getElementsByClassName('search2');
	//alert(divs[0].innerHTML.indexOf(x));
	if (x == "") {
		for (var i = 0; i < divs.length; i++) {
			$("#" + divs[i].id).css({
				'display': 'block'
			});
		}
		return false;
	}
	if (x.length == 1) {
		for (var i = 0; i < divs.length; i++) {
			if (divs[i].innerHTML.charAt(0).toLowerCase().indexOf(x) == -1) {
				//$("#"+divs[i].id).toggleClass("toggled");

				$("#" + divs[i].id).css({
					'display': 'none'
				});
			} else {
				$("#" + divs[i].id).css({
					'display': 'block'
				});
			}
		}
		return false;
	}

	for (var i = 0; i < divs.length; i++) {
		//str = divs[i].innerHTML.toLowerCase();

		if (divs[i].innerHTML.toLowerCase().indexOf(x) == -1) {
			//$("#"+divs[i].id).toggleClass("toggled");

			$("#" + divs[i].id).css({
				'display': 'none'
			});
		} else {
			$("#" + divs[i].id).css({
				'display': 'block'
			});
		}
	}

	return false;
}