<commit_before>// parent class
import {RestClient} from "../rest-client.js";

export default class OpenCGAParentClass {

    constructor(config) {
        this._config = config;
        // this.token = null;
    }

    _get(category1, ids1, category2, ids2, action, params, options) {
        // we store the options from the parameter or from the default values in config
        const host = this._config.host;
        const version = this._config.version;
        const rpc = this._config.mode;
        let method = "GET";
        let _options = options;
        if (typeof _options === "undefined") {
            _options = {};
        }

        if (_options.hasOwnProperty("method")) {
            method = _options.method;
        }

        let _params = params;

        if (_params === undefined || _params === null || _params === "") {
            _params = {};
        }

        // Check that sessionId is being given
        if (!_params.hasOwnProperty("sid")) {
            const sid = this._getSessionId();
            if (typeof sid !== "undefined") {
                _options.sid = sid;
                _options.token = sid;
            }
        }

        // If category == users and userId is not given, we try to set it
        if (category1 === "users" && (ids1 === undefined || ids1 === null || ids1 === "")) {
            ids1 = this._getUserId();
        }
        let url = this._createRestUrl(host, version, category1, ids1, category2, ids2, action);
        // if (method === "GET") {
        url = this._addQueryParams(url, _params);
        if (method === "POST") {
            _options.data = _params.body;
            if (action === "upload") {
                _options["post-method"] = "form";
            }
        }
        // console.log(`OpenCGA client calling to ${url}`);
        // if the URL query fails we try with next host
        return RestClient.call(url, _options);

    }

    _post(category1, ids1, category2, ids2, action, body, params = {}, options = {}) {
        const host = this._config.host;
        const version = this._config.version;
        const rpc = this._config.mode;
        const _options = {...options, method: "POST"};
        if (this._config.token) {
            _options.sid = this._config.token;
            _options.token = this._config.token;
        }
        const _params = {...params, body: body}; // body as param?
        let url = this._createRestUrl(host, version, category1, ids1, category2, ids2, action);
        url = this._addQueryParams(url, _params);
        _options.data = _params.body;
        if (action === "upload") {
            _options["post-method"] = "form";
        }
        // console.log(`OpenCGA client calling to ${url}`);
        // if the URL query fails we try with next host
        return RestClient.call(url, _options);

    }

    // recheck
    _delete(category1, ids1, category2, ids2, action, body, params = {}) {
        const host = this._config.host;
        const version = this._config.version;
        const _options = {method: "DELETE"};
        if (this._config.token) {
            // _options.sid = this._config.token;
            _options.token = this._config.token;
        }
        // const _params = {...params, body: body};
        const _params = {...params, ...body};
        let url = this._createRestUrl(host, version, category1, ids1, category2, ids2, action);
        url = this._addQueryParams(url, _params);
        // _options.data = _params.body;
        // _options.body = _params.body;

        return RestClient.call(url, _options);
    }

    _createRestUrl(host, version, category1, ids1, category2, ids2, action) {
        let url = host + `/webservices/rest/${version}/${category1}/`;
        // By default we assume https protocol instead of http
        if (!url.startsWith("https://") && !url.startsWith("http://")) {
            url = `https://${host}/webservices/rest/${version}/${category1}/`;
        }

        // Some web services do not need IDs
        if (typeof ids1 !== "undefined" && ids1 !== null) {
            url += `${ids1}/`;
        }

        // Some web services do not need a second category
        if (typeof category2 !== "undefined" && category2 !== null) {
            url += `${category2}/`;
        }

        // Some web services do not need the second category of ids
        if (typeof ids2 !== "undefined" && ids2 !== null && ids2 !== "") {
            url += `${ids2}/`;
        }

        url += action;

        return url;
    }

    _addQueryParams(url, params) {
        // We add the query params formatted in URL
        const queryParamsUrl = this._createQueryParam(params);
        let _url = url;
        if (typeof queryParamsUrl !== "undefined" && queryParamsUrl !== null && queryParamsUrl !== "") {
            _url += `?${queryParamsUrl}`;
        }
        return _url;
    }

    _createQueryParam(params) {
        // Do not remove the sort! we need to sort the array to ensure that the key of the cache will be correct
        const keyArray = Object.keys(params);
        const keyValueArray = [];
        for (const i in keyArray) {
            // Whatever it is inside body will be sent hidden via POST
            if (keyArray[i] !== "body") {
                keyValueArray.push(`${keyArray[i]}=${encodeURIComponent(params[keyArray[i]])}`);
            }
        }
        return keyValueArray.join("&");
    }

    _getUserId() {
        this._config.userId;
    }

    _getSessionId() {
        return this._config.token;
    }

    setToken(token) {
        // this.token = token;
        this._config.token = token;
    }

    getToken() {
        return this._config.token;
    }

}
<commit_msg>opencga-parent-class.js _getUserId() fixed<commit_after>// parent class
import {RestClient} from "../rest-client.js";

export default class OpenCGAParentClass {

    constructor(config) {
        this._config = config;
        // this.token = null;
    }

    _get(category1, ids1, category2, ids2, action, params, options) {
        // we store the options from the parameter or from the default values in config
        const host = this._config.host;
        const version = this._config.version;
        const rpc = this._config.mode;
        let method = "GET";
        let _options = options;
        if (typeof _options === "undefined") {
            _options = {};
        }

        if (_options.hasOwnProperty("method")) {
            method = _options.method;
        }

        let _params = params;

        if (_params === undefined || _params === null || _params === "") {
            _params = {};
        }

        // Check that sessionId is being given
        if (!_params.hasOwnProperty("sid")) {
            const sid = this._getSessionId();
            if (typeof sid !== "undefined") {
                _options.sid = sid;
                _options.token = sid;
            }
        }

        // If category == users and userId is not given, we try to set it
        if (category1 === "users" && (ids1 === undefined || ids1 === null || ids1 === "")) {
            ids1 = this._getUserId();
        }
        let url = this._createRestUrl(host, version, category1, ids1, category2, ids2, action);
        // if (method === "GET") {
        url = this._addQueryParams(url, _params);
        if (method === "POST") {
            _options.data = _params.body;
            if (action === "upload") {
                _options["post-method"] = "form";
            }
        }
        // console.log(`OpenCGA client calling to ${url}`);
        // if the URL query fails we try with next host
        return RestClient.call(url, _options);

    }

    _post(category1, ids1, category2, ids2, action, body, params = {}, options = {}) {
        const host = this._config.host;
        const version = this._config.version;
        const rpc = this._config.mode;
        const _options = {...options, method: "POST"};
        if (this._config.token) {
            _options.sid = this._config.token;
            _options.token = this._config.token;
        }
        const _params = {...params, body: body}; // body as param?
        let url = this._createRestUrl(host, version, category1, ids1, category2, ids2, action);
        url = this._addQueryParams(url, _params);
        _options.data = _params.body;
        if (action === "upload") {
            _options["post-method"] = "form";
        }
        // console.log(`OpenCGA client calling to ${url}`);
        // if the URL query fails we try with next host
        return RestClient.call(url, _options);

    }

    // recheck
    _delete(category1, ids1, category2, ids2, action, body, params = {}) {
        const host = this._config.host;
        const version = this._config.version;
        const _options = {method: "DELETE"};
        if (this._config.token) {
            // _options.sid = this._config.token;
            _options.token = this._config.token;
        }
        // const _params = {...params, body: body};
        const _params = {...params, ...body};
        let url = this._createRestUrl(host, version, category1, ids1, category2, ids2, action);
        url = this._addQueryParams(url, _params);
        // _options.data = _params.body;
        // _options.body = _params.body;

        return RestClient.call(url, _options);
    }

    _createRestUrl(host, version, category1, ids1, category2, ids2, action) {
        let url = host + `/webservices/rest/${version}/${category1}/`;
        // By default we assume https protocol instead of http
        if (!url.startsWith("https://") && !url.startsWith("http://")) {
            url = `https://${host}/webservices/rest/${version}/${category1}/`;
        }

        // Some web services do not need IDs
        if (typeof ids1 !== "undefined" && ids1 !== null) {
            url += `${ids1}/`;
        }

        // Some web services do not need a second category
        if (typeof category2 !== "undefined" && category2 !== null) {
            url += `${category2}/`;
        }

        // Some web services do not need the second category of ids
        if (typeof ids2 !== "undefined" && ids2 !== null && ids2 !== "") {
            url += `${ids2}/`;
        }

        url += action;

        return url;
    }

    _addQueryParams(url, params) {
        // We add the query params formatted in URL
        const queryParamsUrl = this._createQueryParam(params);
        let _url = url;
        if (typeof queryParamsUrl !== "undefined" && queryParamsUrl !== null && queryParamsUrl !== "") {
            _url += `?${queryParamsUrl}`;
        }
        return _url;
    }

    _createQueryParam(params) {
        // Do not remove the sort! we need to sort the array to ensure that the key of the cache will be correct
        const keyArray = Object.keys(params);
        const keyValueArray = [];
        for (const i in keyArray) {
            // Whatever it is inside body will be sent hidden via POST
            if (keyArray[i] !== "body") {
                keyValueArray.push(`${keyArray[i]}=${encodeURIComponent(params[keyArray[i]])}`);
            }
        }
        return keyValueArray.join("&");
    }

    _getUserId() {
        return this._config.userId;
    }

    _getSessionId() {
        return this._config.token;
    }

    setToken(token) {
        // this.token = token;
        this._config.token = token;
    }

    getToken() {
        return this._config.token;
    }

}
<|endoftext|>


<commit_before>import React from 'react';
import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session';
import { createContainer } from 'meteor/react-meteor-data';
import Divider from 'material-ui/Divider';
import Drawer from 'material-ui/Drawer';

// api:
import Tenants from '/imports/models/tenants';
import Settings from '/imports/models/settings';
import { Link } from 'react-router-dom';

// components:
import SideNavTop from '/imports/ui/components/header/SideNavTop';
import MenuItem from '/imports/ui/components/shared/MenuItem';

/*
	helpers
*/
const getUsername = (currentUser) => {
	let username = '';
	if (currentUser) {
		if (currentUser.profile && currentUser.profile.name) {
			username = currentUser.profile.name;
		} else {
			username = currentUser.username;
		}
	}
	return username;
};

/*
	BEGIN LeftMenu
*/
const LeftMenu = ({ open, closeLeftMenu, tenant, currentUser, settings }) => (
	<Drawer
		open={open}
		docked={false}
		onRequestChange={closeLeftMenu}
		className="md-sidenav-left"
	>
		<SideNavTop
			currentUser={currentUser}
			username={getUsername(currentUser)}
		/>
		{tenant && !tenant.isAnnotation && Roles.userIsInRole(Meteor.userId(), ['editor', 'admin', 'commenter']) ?

				{tenant && !tenant.isAnnotation && Roles.userIsInRole(Meteor.userId(), ['admin']) ?
					<MenuItem
						href="http://ahcip-admin.chs.harvard.edu"
						target="_blank"
						primaryText="Admin"
						onClick={closeLeftMenu}
					/>
				: ''}
				<Link to="/commentary/create">
					<MenuItem
						primaryText="Add Comment"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/tags/create">
					<MenuItem
						href="/tags/create"
						primaryText="Add Tag"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/textNodes/edit">
					<MenuItem
						primaryText="Add Translation"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/textNodes/edit">
					<MenuItem
						primaryText="Edit Source Text"
						onClick={closeLeftMenu}
					/>
				</Link>

				<Divider />

			:
			'' }
		<MenuItem
			href="/"
			primaryText="Home"
			onClick={closeLeftMenu}
		/>
		{tenant && !tenant.isAnnotation &&

				<Link to="/commentary">
					<MenuItem
						primaryText="Commentary"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/words">
					<MenuItem
						primaryText="Words"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/ideas">
					<MenuItem
						primaryText="Ideas"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/commenters">
					<MenuItem
						primaryText="Commentators"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/referenceWorks">
					<MenuItem
						primaryText="Reference Works"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to={settings && settings.aboutURL ? settings.aboutURL : '/about'}>
					<MenuItem
						primaryText="About"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/#visualizations">
					<MenuItem
						primaryText="Visualizations"
						onClick={closeLeftMenu}
					/>
				</Link>

		}
		<Divider />

		{Meteor.user() ?

				<Link to="/profile">
					<MenuItem
						primaryText="Profile"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/sign-out">
					<MenuItem
						primaryText="Sign out"
						onClick={closeLeftMenu}
					/>
				</Link>

			:

				<Link to="/sign-in">
					<MenuItem
						primaryText="Sign in"
						onClick={closeLeftMenu}
					/>
				</Link>

		}
	</Drawer>
);
LeftMenu.propTypes = {
	open: React.PropTypes.bool.isRequired,
	closeLeftMenu: React.PropTypes.func.isRequired,
	tenant: React.PropTypes.shape({
		isAnnotation: React.PropTypes.bool.isRequired,
	}),
	currentUser: React.PropTypes.shape({
		profile: React.PropTypes.shape({
			avatarUrl: React.PropTypes.string,
			name: React.PropTypes.string,
		}),
		username: React.PropTypes.string,
	}),
};
LeftMenu.defaultProps = {
	tenant: null,
	currentUser: null,
};
/*
	END LeftMenu
*/

export default createContainer(() => {
	const settingsHandle = Meteor.subscribe('settings.tenant', Session.get('tenantId'));
	return {
		settings: Settings.findOne({}),
		currentUser: Meteor.users.findOne({_id: Meteor.userId()}),
		tenant: Tenants.findOne({_id: Session.get('tenantId')})
	};
}, LeftMenu);
<commit_msg>wrap Home url in Link component<commit_after>import React from 'react';
import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session';
import { createContainer } from 'meteor/react-meteor-data';
import Divider from 'material-ui/Divider';
import Drawer from 'material-ui/Drawer';

// api:
import Tenants from '/imports/models/tenants';
import Settings from '/imports/models/settings';
import { Link } from 'react-router-dom';

// components:
import SideNavTop from '/imports/ui/components/header/SideNavTop';
import MenuItem from '/imports/ui/components/shared/MenuItem';

/*
	helpers
*/
const getUsername = (currentUser) => {
	let username = '';
	if (currentUser) {
		if (currentUser.profile && currentUser.profile.name) {
			username = currentUser.profile.name;
		} else {
			username = currentUser.username;
		}
	}
	return username;
};

/*
	BEGIN LeftMenu
*/
const LeftMenu = ({ open, closeLeftMenu, tenant, currentUser, settings }) => (
	<Drawer
		open={open}
		docked={false}
		onRequestChange={closeLeftMenu}
		className="md-sidenav-left"
	>
		<SideNavTop
			currentUser={currentUser}
			username={getUsername(currentUser)}
		/>
		{tenant && !tenant.isAnnotation && Roles.userIsInRole(Meteor.userId(), ['editor', 'admin', 'commenter']) ?

				{tenant && !tenant.isAnnotation && Roles.userIsInRole(Meteor.userId(), ['admin']) ?
					<MenuItem
						href="http://ahcip-admin.chs.harvard.edu"
						target="_blank"
						primaryText="Admin"
						onClick={closeLeftMenu}
					/>
				: ''}
				<Link to="/commentary/create">
					<MenuItem
						primaryText="Add Comment"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/tags/create">
					<MenuItem
						primaryText="Add Tag"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/textNodes/edit">
					<MenuItem
						primaryText="Add Translation"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/textNodes/edit">
					<MenuItem
						primaryText="Edit Source Text"
						onClick={closeLeftMenu}
					/>
				</Link>

				<Divider />

			:
			'' }
		<Link to="/">
			<MenuItem
				primaryText="Home"
				onClick={closeLeftMenu}
			/>
		</Link>
		{tenant && !tenant.isAnnotation &&

				<Link to="/commentary">
					<MenuItem
						primaryText="Commentary"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/words">
					<MenuItem
						primaryText="Words"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/ideas">
					<MenuItem
						primaryText="Ideas"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/commenters">
					<MenuItem
						primaryText="Commentators"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/referenceWorks">
					<MenuItem
						primaryText="Reference Works"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to={settings && settings.aboutURL ? settings.aboutURL : '/about'}>
					<MenuItem
						primaryText="About"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/#visualizations">
					<MenuItem
						primaryText="Visualizations"
						onClick={closeLeftMenu}
					/>
				</Link>

		}
		<Divider />

		{Meteor.user() ?

				<Link to="/profile">
					<MenuItem
						primaryText="Profile"
						onClick={closeLeftMenu}
					/>
				</Link>
				<Link to="/sign-out">
					<MenuItem
						primaryText="Sign out"
						onClick={closeLeftMenu}
					/>
				</Link>

			:

				<Link to="/sign-in">
					<MenuItem
						primaryText="Sign in"
						onClick={closeLeftMenu}
					/>
				</Link>

		}
	</Drawer>
);
LeftMenu.propTypes = {
	open: React.PropTypes.bool.isRequired,
	closeLeftMenu: React.PropTypes.func.isRequired,
	tenant: React.PropTypes.shape({
		isAnnotation: React.PropTypes.bool.isRequired,
	}),
	currentUser: React.PropTypes.shape({
		profile: React.PropTypes.shape({
			avatarUrl: React.PropTypes.string,
			name: React.PropTypes.string,
		}),
		username: React.PropTypes.string,
	}),
};
LeftMenu.defaultProps = {
	tenant: null,
	currentUser: null,
};
/*
	END LeftMenu
*/

export default createContainer(() => {
	const settingsHandle = Meteor.subscribe('settings.tenant', Session.get('tenantId'));
	return {
		settings: Settings.findOne({}),
		currentUser: Meteor.users.findOne({_id: Meteor.userId()}),
		tenant: Tenants.findOne({_id: Session.get('tenantId')})
	};
}, LeftMenu);
<|endoftext|>


<commit_before>var PNG = require("../lib/png").PNG;

var newfile = new PNG({width:10,height:10});

for (var y = 0; y < png.height; y++) {
  for (var x = 0; x < png.width; x++) {
    var idx = (png.width * y + x) << 2;

    var col = x < (png.width >> 1) ^ y < (png.height >> 1) ? 0xe5 : 0xff;

    png.data[idx] = col;
    png.data[idx + 1] = col;
    png.data[idx + 2] = col;
    png.data[idx + 3] = 0xff;
  }
}

newfile.pack()
  .pipe(fs.createWriteStream(__dirname + '/newfile.png'))
  .on('finish', function() {
    console.log('bitmap:', this.data);
    console.log('end !');
  });
<commit_msg>Fix newfile example. Fixes #35<commit_after>var PNG = require("../lib/png").PNG;
var fs = require("fs");

var newfile = new PNG({width:10,height:10});

for (var y = 0; y < newfile.height; y++) {
  for (var x = 0; x < newfile.width; x++) {
    var idx = (newfile.width * y + x) << 2;

    var col = x < (newfile.width >> 1) ^ y < (newfile.height >> 1) ? 0xe5 : 0xff;

    newfile.data[idx] = col;
    newfile.data[idx + 1] = col;
    newfile.data[idx + 2] = col;
    newfile.data[idx + 3] = 0xff;
  }
}

newfile.pack()
  .pipe(fs.createWriteStream(__dirname + '/newfile.png'))
  .on('finish', function() {
    console.log('Written!');
  });
<|endoftext|>


<commit_before>'use strict';

// Add testing server to provide pages for tests
const nodeTestingServer = require('node-testing-server').nodeTestingServer;

module.exports.config = {
    useAllAngular2AppRoots: true,
    directConnect: true,
    // Set to "custom" instead of cucumber
    framework: 'custom',

    // Path relative to the current config file
    frameworkPath: require.resolve('protractor-cucumber-framework'),

    capabilities: {
        browserName: 'chrome',
        chromeOptions: {
            args: [
                // Disable "Chrome is being controlled by automated test software" infobar
                '--disable-infobars'
            ],
            prefs: {
                // Disable Chrome's annoying password manager
                'profile.password_manager_enabled': false,
                'credentials_enable_service': false,
                'password_manager_enabled': false
            }
        }
    },

    // Spec patterns are relative to this directory
    specs: [
        'specs/**/*.feature' // accepts a glob
    ],
    cucumberOpts: {
        // Require step definitions
        require: [
            'step_definitions/**/*.js', // accepts a glob
            '../index.js',
            '../node_modules/.bin/protractor-cucumber-steps/index.js'
        ]
    },
    // Time of retries looking for angular exceeded - timeout in milliseconds
    getPageTimeout: 10000,
    // Before performing any action, Protractor waits until there are no pending
    // asynchronous tasks in your Angular application
    allScriptsTimeout: 120000,

    // Custom parameters can be specified here
    params: {
        // Path to file with all page objects
        pageObjects: require('./page_objects/index.js'),
        // Custom timeout to wait for elements on the page
        customTimeout: 5000,
        // Params for setting browser window width and height - can be also
        // changed via the command line as: --params.browserConfig.width 1024
        browserConfig: {
            width: 1280,
            height: 1024
        }
    },

    plugins: [{
        inline: {
            /*
            * Sets up plugins before tests are run. This is called after the WebDriver
            * session has been started, but before the test framework has been set up.
            *
            * @this {Object} bound to module.exports
            *
            * @throws {*} If this function throws an error, a failed assertion is added to
            *     the test results.
            *
            * @return {q.Promise=} Can return a promise, in which case protractor will wait
            *     for the promise to resolve before continuing.  If the promise is
            *     rejected, a failed assertion is added to the test results.
            */
            setup: function () {
            },
            teardown: function () {
            }
        }
    }],
    /*
    * A callback function called once configs are read but before any
    * environment setup. This will only run once, and before onPrepare.
    *
    * You can specify a file containing code to run by setting beforeLaunch to
    * the filename string.
    *
    * At this point, global variable 'protractor' object will NOT be set up,
    * and globals from the test framework will NOT be available. The main
    * purpose of this function should be to bring up test dependencies.
    */
    beforeLaunch: function () {
        // Settings for node testing server
        nodeTestingServer.config = {
            hostname: 'localhost',
            port: 8001,
            logsEnabled: 0,
            pages: {
                '/test1.html': `
                        Test2 page`,
                '/test2.html': '<title>Test2 Page</title>
Test2 page
'
            }
        }
        // Start node testing server
        return nodeTestingServer.start();
    },
    /*
    * A callback function called once all tests have finished running and
    * the WebDriver instance has been shut down. It is passed the exit code
    * (0 if the tests passed). afterLaunch must return a promise if you want
    * asynchronous code to be executed before the program exits.
    * This is called only once before the program exits (after onCleanUp).
    */
    afterLaunch: function () {
        // Stop node testing server
        return nodeTestingServer.stop();
    },
    /*
    * This is called before the test have been run but after the test framework has
    * been set up.  Analogous to a config file's `onPreare`.
    *
    * Very similar to using `setup`, but allows you to access framework-specific
    * variables/funtions (e.g. `jasmine.getEnv().addReporter()`)
    *
    * @throws {*} If this function throws an error, a failed assertion is added to
    *     the test results.
    *
    * @return {Q.Promise=} Can return a promise, in which case protractor will wait
    *     for the promise to resolve before continuing.  If the promise is
    *     rejected, a failed assertion is added to the test results.
    */
    onPrepare: function () {
        // If you need to navigate to a page which does not use Angular,
        // you can turn off waiting for Angular
        browser.ignoreSynchronization = true;

        // Set custom window size for browser
        browser.driver.manage().window().setSize(
            browser.params.browserConfig.width,
            browser.params.browserConfig.height
        );
    }
};
<commit_msg>Updated test page html<commit_after>'use strict';

// Add testing server to provide pages for tests
const nodeTestingServer = require('node-testing-server').nodeTestingServer;

module.exports.config = {
    useAllAngular2AppRoots: true,
    directConnect: true,
    // Set to "custom" instead of cucumber
    framework: 'custom',

    // Path relative to the current config file
    frameworkPath: require.resolve('protractor-cucumber-framework'),

    capabilities: {
        browserName: 'chrome',
        chromeOptions: {
            args: [
                // Disable "Chrome is being controlled by automated test software" infobar
                '--disable-infobars'
            ],
            prefs: {
                // Disable Chrome's annoying password manager
                'profile.password_manager_enabled': false,
                'credentials_enable_service': false,
                'password_manager_enabled': false
            }
        }
    },

    // Spec patterns are relative to this directory
    specs: [
        'specs/**/*.feature' // accepts a glob
    ],
    cucumberOpts: {
        // Require step definitions
        require: [
            'step_definitions/**/*.js', // accepts a glob
            '../index.js',
            '../node_modules/.bin/protractor-cucumber-steps/index.js'
        ]
    },
    // Time of retries looking for angular exceeded - timeout in milliseconds
    getPageTimeout: 10000,
    // Before performing any action, Protractor waits until there are no pending
    // asynchronous tasks in your Angular application
    allScriptsTimeout: 120000,

    // Custom parameters can be specified here
    params: {
        // Path to file with all page objects
        pageObjects: require('./page_objects/index.js'),
        // Custom timeout to wait for elements on the page
        customTimeout: 5000,
        // Params for setting browser window width and height - can be also
        // changed via the command line as: --params.browserConfig.width 1024
        browserConfig: {
            width: 1280,
            height: 1024
        }
    },

    plugins: [{
        inline: {
            /*
            * Sets up plugins before tests are run. This is called after the WebDriver
            * session has been started, but before the test framework has been set up.
            *
            * @this {Object} bound to module.exports
            *
            * @throws {*} If this function throws an error, a failed assertion is added to
            *     the test results.
            *
            * @return {q.Promise=} Can return a promise, in which case protractor will wait
            *     for the promise to resolve before continuing.  If the promise is
            *     rejected, a failed assertion is added to the test results.
            */
            setup: function () {
            },
            teardown: function () {
            }
        }
    }],
    /*
    * A callback function called once configs are read but before any
    * environment setup. This will only run once, and before onPrepare.
    *
    * You can specify a file containing code to run by setting beforeLaunch to
    * the filename string.
    *
    * At this point, global variable 'protractor' object will NOT be set up,
    * and globals from the test framework will NOT be available. The main
    * purpose of this function should be to bring up test dependencies.
    */
    beforeLaunch: function () {
        // Settings for node testing server
        nodeTestingServer.config = {
            hostname: 'localhost',
            port: 8001,
            logsEnabled: 0,
            pages: {
                '/test1.html': `Test2 page`,
                '/test2.html': '<title>Test2 Page</title>
Test2 page
'
            }
        }
        // Start node testing server
        return nodeTestingServer.start();
    },
    /*
    * A callback function called once all tests have finished running and
    * the WebDriver instance has been shut down. It is passed the exit code
    * (0 if the tests passed). afterLaunch must return a promise if you want
    * asynchronous code to be executed before the program exits.
    * This is called only once before the program exits (after onCleanUp).
    */
    afterLaunch: function () {
        // Stop node testing server
        return nodeTestingServer.stop();
    },
    /*
    * This is called before the test have been run but after the test framework has
    * been set up.  Analogous to a config file's `onPreare`.
    *
    * Very similar to using `setup`, but allows you to access framework-specific
    * variables/funtions (e.g. `jasmine.getEnv().addReporter()`)
    *
    * @throws {*} If this function throws an error, a failed assertion is added to
    *     the test results.
    *
    * @return {Q.Promise=} Can return a promise, in which case protractor will wait
    *     for the promise to resolve before continuing.  If the promise is
    *     rejected, a failed assertion is added to the test results.
    */
    onPrepare: function () {
        // If you need to navigate to a page which does not use Angular,
        // you can turn off waiting for Angular
        browser.ignoreSynchronization = true;

        // Set custom window size for browser
        browser.driver.manage().window().setSize(
            browser.params.browserConfig.width,
            browser.params.browserConfig.height
        );
    }
};
<|endoftext|>


<commit_before>// Import modules
const querystring = require('querystring');

const app = require('../app');
const httpsRequest = require('../libs/HttpsRequest');

// API things
// const clientID = process.env.CLIENT_ID;
// const clientSecret = process.env.CLIENT_SECRET;
// const accessToken = process.env.INSTAGRAM_ACCESS_TOKEN;
const slackAccessToken = process.env.SLACK_ACCESS_TOKEN;

app.get('/public-channels', (_, res) => {
  // JSON Object of POST data
  const getSelfJSON = {
    token: slackAccessToken,
    exclude_members: true,
    exclude_archived: true,
  };

  // Stringify JSON and set header options
  const getSelfString = querystring.stringify(getSelfJSON);
  const options = {
    hostname: 'slack.com',
    path: `/api/channels.list?${getSelfString}`,
    method: 'GET',
  };

  const callback = (json) => {
    res.send(json);
  };

  // Send request
  httpsRequest(options, getSelfString, callback);
});

app.get('/list-channels', (_, res) => {
  // JSON Object of POST data
  const getSelfJSON = {
    token: slackAccessToken,
  };

  // Stringify JSON and set header options
  const getSelfString = querystring.stringify(getSelfJSON);
  const options = {
    hostname: 'slack.com',
    path: `/api/users.list?${getSelfString}`,
    method: 'GET',
  };

  const callback = (json) => {
    res.send(json);
  };

  // Send request
  httpsRequest(options, getSelfString, callback);
});
<commit_msg>refactor(endpoint): renamed endpoint<commit_after>// Import modules
const querystring = require('querystring');

const app = require('../app');
const httpsRequest = require('../libs/HttpsRequest');

// API things
// const clientID = process.env.CLIENT_ID;
// const clientSecret = process.env.CLIENT_SECRET;
// const accessToken = process.env.INSTAGRAM_ACCESS_TOKEN;
const slackAccessToken = process.env.SLACK_ACCESS_TOKEN;

app.get('/list-channels', (_, res) => {
  // JSON Object of POST data
  const getSelfJSON = {
    token: slackAccessToken,
    exclude_members: true,
    exclude_archived: true,
  };

  // Stringify JSON and set header options
  const getSelfString = querystring.stringify(getSelfJSON);
  const options = {
    hostname: 'slack.com',
    path: `/api/channels.list?${getSelfString}`,
    method: 'GET',
  };

  const callback = (json) => {
    res.send(json);
  };

  // Send request
  httpsRequest(options, getSelfString, callback);
});

app.get('/list-users', (_, res) => {
  // JSON Object of POST data
  const getSelfJSON = {
    token: slackAccessToken,
  };

  // Stringify JSON and set header options
  const getSelfString = querystring.stringify(getSelfJSON);
  const options = {
    hostname: 'slack.com',
    path: `/api/users.list?${getSelfString}`,
    method: 'GET',
  };

  const callback = (json) => {
    res.send(json);
  };

  // Send request
  httpsRequest(options, getSelfString, callback);
});
<|endoftext|>


<commit_before>require.config({
	baseUrl : "./",
	paths : {
		goo : "../src/goo",
		'goo/lib' : '../lib'
	}
});
require([
	'goo/entities/components/MeshDataComponent',
	'goo/entities/components/MeshRendererComponent',
	'goo/renderer/Material',
	'goo/entities/GooRunner',
	'goo/entities/components/ScriptComponent',
	'goo/shapes/ShapeCreator',
	'goo/renderer/Texture',
	'goo/renderer/Camera',
	'goo/entities/components/CameraComponent',
	'goo/math/Vector3',
	'goo/math/Vector2',
	'goo/scripts/BasicControlScript',
	'goo/math/Ray',
	'goo/entities/systems/PickingSystem',
	'goo/renderer/shaders/ShaderLib',
	'goo/picking/PrimitivePickLogic'
], function (
	MeshDataComponent,
	MeshRendererComponent,
	Material,
	GooRunner,
	ScriptComponent,
	ShapeCreator,
	Texture,
	Camera,
	CameraComponent,
	Vector3,
	Vector2,
	BasicControlScript,
	Ray,
	PickingSystem,
	ShaderLib,
	PrimitivePickLogic
) {
	"use strict";

	var material;
	var picked = null;

	function init() {
		// Create typical goo application
		var goo = new GooRunner({
			showStats : true
		});
		goo.renderer.domElement.id = 'goo';
		document.body.appendChild(goo.renderer.domElement);

		material = Material.createMaterial(ShaderLib.textured);
		var colorInfo = new Uint8Array([255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, 255, 255, 255, 255]);
		var texture = new Texture(colorInfo, null, 2, 2);
		texture.minFilter = 'NearestNeighborNoMipMaps';
		texture.magFilter = 'NearestNeighbor';
		texture.generateMipmaps = false;
		material.textures.push(texture);

		createShapes(goo);

		// Add camera
		var camera = new Camera(45, 1, 1, 1000);
		var cameraEntity = goo.world.createEntity("CameraEntity");
		cameraEntity.transformComponent.transform.translation.set(0, 0, 10);
		cameraEntity.transformComponent.transform.lookAt(new Vector3(0, 0, 0), Vector3.UNIT_Y);
		cameraEntity.setComponent(new CameraComponent(camera));
		cameraEntity.addToWorld();

		// Add PickingSystem
		var picking = new PickingSystem({
			pickLogic: new PrimitivePickLogic()
		});
		goo.world.setSystem(picking);
		picking.onPick = function(pickedList) {
			if (pickedList && pickedList.length) {
				picked = pickedList[0].entity;
			} else {
				picked = null;
			}
		};

		goo.callbacks.push(function(tpf) {
			if (picked) {
				var val = Math.abs(Math.sin(goo.world.time)) + 0.5;
				picked.transformComponent.transform.scale.set(val, val, val);
				picked.transformComponent.setUpdated(true);
			}
		});

		document.addEventListener('mousedown', function(event) {
			event.preventDefault();
			event.stopPropagation();

			var mouseDownX = event.pageX;
			var mouseDownY = event.pageY;

			var worldPos = new Vector3();
			var screenPos = new Vector2();

			camera.getWorldCoordinates(mouseDownX, mouseDownY, goo.renderer.viewportWidth, goo.renderer.viewportHeight, 0, worldPos);
			console.log('z=0, screen coords: ' + mouseDownX + ',' + mouseDownY);
			console.log('z=0, world coords: ' + worldPos.x + ',' + worldPos.y + ',' + worldPos.z);
			camera.getScreenCoordinates(worldPos, goo.renderer.viewportWidth, goo.renderer.viewportHeight, screenPos);
			console.log('z=0, calculated screen coords: ' + screenPos.x + ',' + screenPos.y);

			camera.getWorldCoordinates(mouseDownX, mouseDownY, goo.renderer.viewportWidth, goo.renderer.viewportHeight, 1, worldPos);
			console.log('z=1, screen coords: ' + mouseDownX + ',' + mouseDownY);
			console.log('z=1, world coords: ' + worldPos.x + ',' + worldPos.y + ',' + worldPos.z);
			camera.getScreenCoordinates(worldPos, goo.renderer.viewportWidth, goo.renderer.viewportHeight, screenPos);
			console.log('z=1, calculated screen coords: ' + screenPos.x + ',' + screenPos.y);

			var ray = new Ray();
			camera.getPickRay(mouseDownX, mouseDownY, goo.renderer.viewportWidth, goo.renderer.viewportHeight, ray);
			console.log('Ray: origin = ' + ray.origin.x + ',' + ray.origin.y + ',' + ray.origin.z + ' direction = ' + ray.direction.x + ','
				+ ray.direction.y + ',' + ray.direction.z);

			// Ask all appropriate world entities if they've been picked
			picking.pickRay = ray;
			picking._process();
		}, false);
	}

	// Create simple quad
	function createShapes(goo) {
		createMesh(goo, ShapeCreator.createSphere(16, 16, 2), -10, 0, -30);
		createMesh(goo, ShapeCreator.createBox(3, 3, 3), -10, 10, -30);
		createMesh(goo, ShapeCreator.createQuad(3, 3), 0, -7, -20);
		createMesh(goo, ShapeCreator.createTorus(16, 16, 1, 3), 0, 0, -30);
	}

	function createMesh(goo, meshData, x, y, z) {
		var world = goo.world;

		// Create entity
		var entity = world.createEntity();

		entity.transformComponent.transform.translation.set(x, y, z);

		// Create meshdata component using above data
		var meshDataComponent = new MeshDataComponent(meshData);
		entity.setComponent(meshDataComponent);

		// Create meshrenderer component with material and shader
		var meshRendererComponent = new MeshRendererComponent();
		meshRendererComponent.materials.push(material);
		entity.setComponent(meshRendererComponent);

		// entity.setComponent(new ScriptComponent(new BasicControlScript()));

		entity.addToWorld();
	}

	init();
});
<commit_msg>Clear "execute" flag that happened to be set on picking.js<commit_after>require.config({
	baseUrl : "./",
	paths : {
		goo : "../src/goo",
		'goo/lib' : '../lib'
	}
});
require([
	'goo/entities/components/MeshDataComponent',
	'goo/entities/components/MeshRendererComponent',
	'goo/renderer/Material',
	'goo/entities/GooRunner',
	'goo/entities/components/ScriptComponent',
	'goo/shapes/ShapeCreator',
	'goo/renderer/Texture',
	'goo/renderer/Camera',
	'goo/entities/components/CameraComponent',
	'goo/math/Vector3',
	'goo/math/Vector2',
	'goo/scripts/BasicControlScript',
	'goo/math/Ray',
	'goo/entities/systems/PickingSystem',
	'goo/renderer/shaders/ShaderLib',
	'goo/picking/PrimitivePickLogic'
], function (
	MeshDataComponent,
	MeshRendererComponent,
	Material,
	GooRunner,
	ScriptComponent,
	ShapeCreator,
	Texture,
	Camera,
	CameraComponent,
	Vector3,
	Vector2,
	BasicControlScript,
	Ray,
	PickingSystem,
	ShaderLib,
	PrimitivePickLogic
) {
	"use strict";

	var material;
	var picked = null;

	function init() {
		// Create typical goo application
		var goo = new GooRunner({
			showStats : true
		});
		goo.renderer.domElement.id = 'goo';
		document.body.appendChild(goo.renderer.domElement);

		material = Material.createMaterial(ShaderLib.textured);
		var colorInfo = new Uint8Array([255, 255, 255, 255, 0, 0, 0, 255, 0, 0, 0, 255, 255, 255, 255, 255]);
		var texture = new Texture(colorInfo, null, 2, 2);
		texture.minFilter = 'NearestNeighborNoMipMaps';
		texture.magFilter = 'NearestNeighbor';
		texture.generateMipmaps = false;
		material.textures.push(texture);

		createShapes(goo);

		// Add camera
		var camera = new Camera(45, 1, 1, 1000);
		var cameraEntity = goo.world.createEntity("CameraEntity");
		cameraEntity.transformComponent.transform.translation.set(0, 0, 10);
		cameraEntity.transformComponent.transform.lookAt(new Vector3(0, 0, 0), Vector3.UNIT_Y);
		cameraEntity.setComponent(new CameraComponent(camera));
		cameraEntity.addToWorld();

		// Add PickingSystem
		var picking = new PickingSystem({
			pickLogic: new PrimitivePickLogic()
		});
		goo.world.setSystem(picking);
		picking.onPick = function(pickedList) {
			if (pickedList && pickedList.length) {
				picked = pickedList[0].entity;
			} else {
				picked = null;
			}
		};

		goo.callbacks.push(function(tpf) {
			if (picked) {
				var val = Math.abs(Math.sin(goo.world.time)) + 0.5;
				picked.transformComponent.transform.scale.set(val, val, val);
				picked.transformComponent.setUpdated(true);
			}
		});

		document.addEventListener('mousedown', function(event) {
			event.preventDefault();
			event.stopPropagation();

			var mouseDownX = event.pageX;
			var mouseDownY = event.pageY;

			var worldPos = new Vector3();
			var screenPos = new Vector2();

			camera.getWorldCoordinates(mouseDownX, mouseDownY, goo.renderer.viewportWidth, goo.renderer.viewportHeight, 0, worldPos);
			console.log('z=0, screen coords: ' + mouseDownX + ',' + mouseDownY);
			console.log('z=0, world coords: ' + worldPos.x + ',' + worldPos.y + ',' + worldPos.z);
			camera.getScreenCoordinates(worldPos, goo.renderer.viewportWidth, goo.renderer.viewportHeight, screenPos);
			console.log('z=0, calculated screen coords: ' + screenPos.x + ',' + screenPos.y);

			camera.getWorldCoordinates(mouseDownX, mouseDownY, goo.renderer.viewportWidth, goo.renderer.viewportHeight, 1, worldPos);
			console.log('z=1, screen coords: ' + mouseDownX + ',' + mouseDownY);
			console.log('z=1, world coords: ' + worldPos.x + ',' + worldPos.y + ',' + worldPos.z);
			camera.getScreenCoordinates(worldPos, goo.renderer.viewportWidth, goo.renderer.viewportHeight, screenPos);
			console.log('z=1, calculated screen coords: ' + screenPos.x + ',' + screenPos.y);

			var ray = new Ray();
			camera.getPickRay(mouseDownX, mouseDownY, goo.renderer.viewportWidth, goo.renderer.viewportHeight, ray);
			console.log('Ray: origin = ' + ray.origin.x + ',' + ray.origin.y + ',' + ray.origin.z + ' direction = ' + ray.direction.x + ','
				+ ray.direction.y + ',' + ray.direction.z);

			// Ask all appropriate world entities if they've been picked
			picking.pickRay = ray;
			picking._process();
		}, false);
	}

	// Create simple quad
	function createShapes(goo) {
		createMesh(goo, ShapeCreator.createSphere(16, 16, 2), -10, 0, -30);
		createMesh(goo, ShapeCreator.createBox(3, 3, 3), -10, 10, -30);
		createMesh(goo, ShapeCreator.createQuad(3, 3), 0, -7, -20);
		createMesh(goo, ShapeCreator.createTorus(16, 16, 1, 3), 0, 0, -30);
	}

	function createMesh(goo, meshData, x, y, z) {
		var world = goo.world;

		// Create entity
		var entity = world.createEntity();

		entity.transformComponent.transform.translation.set(x, y, z);

		// Create meshdata component using above data
		var meshDataComponent = new MeshDataComponent(meshData);
		entity.setComponent(meshDataComponent);

		// Create meshrenderer component with material and shader
		var meshRendererComponent = new MeshRendererComponent();
		meshRendererComponent.materials.push(material);
		entity.setComponent(meshRendererComponent);

		// entity.setComponent(new ScriptComponent(new BasicControlScript()));

		entity.addToWorld();
	}

	init();
});
<|endoftext|>


<commit_before>// Copyright 2019, University of Colorado Boulder
/* eslint-disable bad-sim-text */

/**
 * Lint detector for invalid text.
 * Lint is disabled for this file so the bad texts aren't themselves flagged.
 *
 * @author Sam Reid (PhET Interactive Simulations)
 * @author Michael Kauzmann (PhET Interactive Simulations)
 */

'use strict';

module.exports = function( context ) {

  const getBadTextTester = require( './getBadTextTester' );

  // see getBadTextTester for schema.
  const forbiddenTextObjects = [

    // should be using dot.Utils.roundSymmetric, Math.round does not treat positive and negative numbers
    // symmetrically see https://github.com/phetsims/dot/issues/35#issuecomment-113587879
    { id: 'Math.round(', codeTokens: [ 'Math', '.', 'round', '(' ] },

    // should be using `DOT/dotRandom`
    { id: 'Math.random()', codeTokens: [ 'Math', '.', 'random', '(', ')' ] },
    { id: '_.shuffle(', codeTokens: [ '_', '.', 'shuffle', '(' ] },
    { id: '_.sample(', codeTokens: [ '_', '.', 'sample', '(' ] },
    { id: '_.random(', codeTokens: [ '_', '.', 'random', '(' ] },
    { id: 'new Random()', codeTokens: [ 'new', 'Random', '(', ')' ] },

    // IE doesn't support:
    { id: 'Number.parseInt(', codeTokens: [ 'Number', '.', 'parseInt', '(' ] },
    { id: 'Array.prototype.find', codeTokens: [ 'Array', '.', 'prototype', '.', 'find' ] },

    // Use merge instead of _.extend for combining options/config. Leave out first letter to allow for `options = `
    // and `sliderOptions = _.extend` to both be caught.
    'ptions = _.extend(',
    'onfig = _.extend(',

    // ParallelDOM.pdomOrder should not be mutated, instead only set with `setPDOMOrder`
    '.pdomOrder.push(',

    // Should import dotRandom instead of using the namespace
    'phet.dot.dotRandom',

    // Prefer using Pointer.isTouchLike() to help support Pen. This is not set in stone, please see
    // https://github.com/phetsims/scenery/issues/1156 and feel free to discuss if there are usages you want to support.
    ' instanceof Touch ',

    // Should have a period before "<", see https://github.com/phetsims/chipper/issues/1005
    { id: 'Type<Parameter>', regex: /{[^\n ]*\b[A-z]+<[A-z]+>/ },

    // In sims, don't allow setTimout and setInterval calls coming from window, see https://github.com/phetsims/phet-info/issues/59
    {
      id: 'setTimeout(',
      regex: /(window\.| )setTimeout\(/
    },
    {
      id: 'setInterval(',
      regex: /(window\.| )setInterval\(/
    }

    // DOT/Utils.toFixed or DOT/Utils.toFixedNumber should be used instead of toFixed.
    // JavaScript's toFixed is notoriously buggy. Behavior differs depending on browser,
    // because the spec doesn't specify whether to round or floor.
    // TODO: comment back in when all lint errors are taken care of, https://github.com/phetsims/chipper/issues/737
    // {
    //   id: '.toFixed(',     // support regex with english names this way
    //   regex: /(?<!Utils)\.toFixed\(/
    // }
  ];

  return {
    Program: getBadTextTester( forbiddenTextObjects, context )
  };
};

module.exports.schema = [
  // JSON Schema for rule options goes here
];<commit_msg>prefer Utils.toFixed when possible, https://github.com/phetsims/chipper/issues/737<commit_after>// Copyright 2019, University of Colorado Boulder
/* eslint-disable bad-sim-text */

/**
 * Lint detector for invalid text.
 * Lint is disabled for this file so the bad texts aren't themselves flagged.
 *
 * @author Sam Reid (PhET Interactive Simulations)
 * @author Michael Kauzmann (PhET Interactive Simulations)
 */

'use strict';

module.exports = function( context ) {

  const getBadTextTester = require( './getBadTextTester' );

  // see getBadTextTester for schema.
  const forbiddenTextObjects = [

    // should be using dot.Utils.roundSymmetric, Math.round does not treat positive and negative numbers
    // symmetrically see https://github.com/phetsims/dot/issues/35#issuecomment-113587879
    { id: 'Math.round(', codeTokens: [ 'Math', '.', 'round', '(' ] },

    // should be using `DOT/dotRandom`
    { id: 'Math.random()', codeTokens: [ 'Math', '.', 'random', '(', ')' ] },
    { id: '_.shuffle(', codeTokens: [ '_', '.', 'shuffle', '(' ] },
    { id: '_.sample(', codeTokens: [ '_', '.', 'sample', '(' ] },
    { id: '_.random(', codeTokens: [ '_', '.', 'random', '(' ] },
    { id: 'new Random()', codeTokens: [ 'new', 'Random', '(', ')' ] },

    // IE doesn't support:
    { id: 'Number.parseInt(', codeTokens: [ 'Number', '.', 'parseInt', '(' ] },
    { id: 'Array.prototype.find', codeTokens: [ 'Array', '.', 'prototype', '.', 'find' ] },

    // Use merge instead of _.extend for combining options/config. Leave out first letter to allow for `options = `
    // and `sliderOptions = _.extend` to both be caught.
    'ptions = _.extend(',
    'onfig = _.extend(',

    // ParallelDOM.pdomOrder should not be mutated, instead only set with `setPDOMOrder`
    '.pdomOrder.push(',

    // Should import dotRandom instead of using the namespace
    'phet.dot.dotRandom',

    // Prefer using Pointer.isTouchLike() to help support Pen. This is not set in stone, please see
    // https://github.com/phetsims/scenery/issues/1156 and feel free to discuss if there are usages you want to support.
    ' instanceof Touch ',

    // Should have a period before "<", see https://github.com/phetsims/chipper/issues/1005
    { id: 'Type<Parameter>', regex: /{[^\n ]*\b[A-z]+<[A-z]+>/ },

    // In sims, don't allow setTimout and setInterval calls coming from window, see https://github.com/phetsims/phet-info/issues/59
    {
      id: 'setTimeout(',
      regex: /(window\.| )setTimeout\(/
    },
    {
      id: 'setInterval(',
      regex: /(window\.| )setInterval\(/
    },

    // DOT/Utils.toFixed or DOT/Utils.toFixedNumber should be used instead of toFixed.
    // JavaScript's toFixed is notoriously buggy. Behavior differs depending on browser,
    // because the spec doesn't specify whether to round or floor.
    {
      id: '.toFixed(', // support regex with english names this way
      regex: new RegExp( '(?<!Utils)\\.toFixed\\(' ) // NOTE: eslint parsing breaks when using regex syntax like `/regex/`
    }
  ];

  return {
    Program: getBadTextTester( forbiddenTextObjects, context )
  };
};

module.exports.schema = [
  // JSON Schema for rule options goes here
];<|endoftext|>


<commit_before>angular.module('eventsApp', [
    'ui.router',
    'events.constants',
    'events.api.service',
    'events.timeline.controller',
    'events.event.controller',
    'events.preview.directive',
    'events.countries.directive',
    'events.carousel.directive'
  ])
  .run([
    '$rootScope',
    '$state',
    '$stateParams',
    function($rootScope, $state, $stateParams){
      $rootScope.$state = $state;
      $rootScope.$stateParams = $stateParams;
    }
  ])
  .config([
    '$stateProvider',
    '$urlRouterProvider',
    '$locationProvider',
    'templatesPath',
    function($stateProvider, $urlRouterProvider, $locationProvider, templatesPath) {
      $locationProvider.html5Mode(true);
      $urlRouterProvider.when('/','/deutschland');
      $stateProvider
        .state('timeline', {
          url: '/:timeline',
          templateUrl: templatesPath + 'events/templates/timeline.html',
          controller: 'TimelineController'
        })
        .state('timeline.event', {
          url: '/:event',
          templateUrl: templatesPath + 'events/templates/timeline.event.html',
          controller: 'EventController'
        });
    }
  ]);
<commit_msg>Remove auto redirect from the events ng-app router<commit_after>angular.module('eventsApp', [
    'ui.router',
    'events.constants',
    'events.api.service',
    'events.timeline.controller',
    'events.event.controller',
    'events.preview.directive',
    'events.countries.directive',
    'events.carousel.directive'
  ])
  .run([
    '$rootScope',
    '$state',
    '$stateParams',
    function($rootScope, $state, $stateParams){
      $rootScope.$state = $state;
      $rootScope.$stateParams = $stateParams;
    }
  ])
  .config([
    '$stateProvider',
    '$urlRouterProvider',
    '$locationProvider',
    'templatesPath',
    function($stateProvider, $urlRouterProvider, $locationProvider, templatesPath) {
      $locationProvider.html5Mode(true);
      $stateProvider
        .state('timeline', {
          url: '/:timeline',
          templateUrl: templatesPath + 'events/templates/timeline.html',
          controller: 'TimelineController'
        })
        .state('timeline.event', {
          url: '/:event',
          templateUrl: templatesPath + 'events/templates/timeline.event.html',
          controller: 'EventController'
        });
    }
  ]);
<|endoftext|>


<commit_before>/**
script: Comet.js
name: Comet
author: Richard Roque <roquerichardneil@gmail.com>
description: Class that wraps Request.JSON class to implement long polling.
license: MIT-style license
requires:
- Core/MooTools
- Core/More

Known limitations:
- Doesn't work with another tab using the same browser.
*/

var Comet = new Class({
	Extends: Request.JSON,
	_try: 0,
	options: {
		delayPerRequest: 5,
		max: 3,
		data: {}
	},
	initialize: function(options){
		var self = this;
		this.parent(options);

		['failure', 'timeout', 'exception'].each(function(evt){
			self.addEvent(evt, function() {
				console.log("Sending another request after "+this.options.delayPerRequest+" seconds...");
				this.send.delay(this.options.delayPerRequest * 1000, self);
			});
		});
	},
	send: function(options){
		var exceeds = (this._try >= this.options.max);
		if(exceeds) {
			this._try = 0;
			this.fireEvent('maxRequestExceeded');
			return;
		}
		this._try++;
		this.parent(options);
	},
	onSuccess: function(json, text){
		var self = this;
		this.parent(json, text);
		var changed = (json.timestamp != this.options.data.timestamp);
		if(changed) {
			this.options.data.timestamp = json.timestamp;
			this._try = 0;
			this.fireEvent('newData', json);
		}
		console.log("Sending another request after "+this.options.delayPerRequest+" seconds...");
		this.send.delay(this.options.delayPerRequest * 1000, self);
	}
});

<commit_msg>Reduce default delay per request from 10 to 5 seconds<commit_after>/**
script: Comet.js
name: Comet
author: Richard Roque <roquerichardneil@gmail.com>
description: Class that wraps Request.JSON class to implement long polling.
license: MIT-style license
requires:
- Core/MooTools
- Core/More

Known limitations:
- Doesn't work with another tab using the same browser.
*/

var Comet = new Class({
	Extends: Request.JSON,
	_try: 0,
	options: {
		delayPerRequest: 5,
		max: 3,
		data: {}
	},
	initialize: function(options){
		var self = this;
		this.parent(options);

		['failure', 'timeout', 'exception'].each(function(evt){
			self.addEvent(evt, function() {
				console.log("Delay request for "+this.options.delayPerRequest+" seconds...");
				this.send.delay(this.options.delayPerRequest * 1000, self);
			});
		});
	},
	send: function(options){
		var exceeds = (this._try >= this.options.max);
		if(exceeds) {
			this._try = 0;
			this.fireEvent('maxRequestExceeded');
			return;
		}
		this._try++;
		console.log("Sending request...");
		this.parent(options);
	},
	onSuccess: function(json, text){
		var self = this;
		this.parent(json, text);
		var changed = (json.timestamp != this.options.data.timestamp);
		if(changed) {
			this.options.data.timestamp = json.timestamp;
			this._try = 0;
			this.fireEvent('newData', json);
		}
		console.log("Delay request for "+this.options.delayPerRequest+" seconds...");
		this.send.delay(this.options.delayPerRequest * 1000, self);
	}
});

<|endoftext|>


<commit_before>import "es6-promise";
import "whatwg-fetch";
import {Message} from "element-ui";
import qs from "querystring";
import isEmpty from "lodash.isempty";
import * as API from "../constants/api";

const METHODS = {
    GET: 'get',
    POST: 'post',
    PUT: 'put',
    DELETE: 'delete'
};

const request = (url, params, method = METHODS.GET, jsonType = false) => {
    var options = {
        headers: {
            'Content-Type': jsonType ? 'application/json' : 'application/x-www-form-urlencoded'
        },
        method: method,
        credentials: 'include'
    };
    if (method !== METHODS.GET && !isEmpty(params)) {
        options.body = jsonType ? JSON.stringify(params) : qs.stringify(params)
    } else if (method === METHODS.GET && !isEmpty(params)) {
        url += ('?' + qs.stringify(params));
    }
    return fetch(url, options).then(checkRespStatus);
};

const post = (url, params) => request(url, params, METHODS.POST, true);

// check resp status
const checkRespStatus = (respPromise) => {
    if (respPromise.status !== 200) {
        return Promise.reject('Server error occurred');
    }
    return respPromise.json().then(resp => {
        return new Promise((resolve, reject) => {
            if (resp && resp.code == API.CODE_SUCCESS) {
                resolve(resp.data);
            } else if (resp && resp.code == API.CODE_NOT_LOGIN) {
                // 页面超时，重新刷新页面
                window.location.reload();
            } else {
                resp.msg && Message({message: resp.msg, type: 'warning', showClose: true});
                reject(resp);
            }
        });
    });
};

export const createAction = (type, payloadCreator, metaCreator) => {
    const identity = (...args) => args[0];
    const isFunc = (fn) => typeof(fn) === 'function';
    const isPromise = obj => typeof(obj) === 'object' && isFunc(obj.then);
    const finalPayloadCreator = isFunc(payloadCreator) ? payloadCreator : identity;

    return ({commit, dispatch}, ...args) => {
        const payload = finalPayloadCreator(...args);
        const action = {type, payload};

        if (isFunc(metaCreator)) {
            action.meta = metaCreator(...args);
        }

        if (isPromise(payload)) {
            return payload.then(result => {
                commit(type, Object.assign(action, {payload: result}));
                return result;
            }).catch(error => {
                commit(type, Object.assign(action, {error: true, msg: error.msg}));
                return error;
            });
        }

        return commit(type, Object.assign(action, {payload}));
    };
};

export default {

    // 获取所用的任务列表
    getTasks: params => request(API.TASK_LIST, params),

    publishTasks: params => post(API.TASKS_PUBLISH, params),

    unPublishTasks: params => post(API.TASKS_UNPUBLISHED, params),

    // 获取所有的翻译内容审核列表
    getApprovalList: params => request(API.APPROVAL_LIST, params),

    acceptApproval: params => post(API.APPROVAL_ACCEPTED, params),

    rejectApproval: params => post(API.APPROVAL_REJECTED, params),

    // 获取翻译的详情
    getTranslatedArticle: processId => request(API.ARTICLE_VIEW, {processId}),

    // 获取社区内容审核列表
    getCommunityApprovalList: params => request(API.COMMUNITY_APPROVAL_LIST, params),

    acceptCommunityApproval: params => post(API.COMMUNITY_APPROVAL_ACCEPTED, params),

    rejectCommunityApproval: params => post(API.COMMUNITY_APPROVAL_REJECTED, params),

    // 获取指定社区文章的详情
    getCommunityArticle: processId => request(API.COMMUNITY_ARTICLE_VIEW, {processId}),

    // 获取文章分类
    getCommunityArticleCategory: params => request(API.COMMUNITY_ARTICLE_CATEGORY, params),

    // 给文章设置分类
    applyCategoryToCommunityArticle: params => post(API.COMMUNITY_ARTICLE_CATEGORY_APPLIED, params),

    getUsers: params => request(API.USERS_LIST, params),

    updateUserPwd: params =>post(API.USER_PASSWORD_UPDATED, params)
};

<commit_msg>update api<commit_after>import "es6-promise";
import "whatwg-fetch";
import {Message} from "element-ui";
import qs from "querystring";
import isEmpty from "lodash.isempty";
import * as API from "../constants/api";

const METHODS = {
    GET: 'get',
    POST: 'post',
    PUT: 'put',
    DELETE: 'delete'
};

const request = (url, params, method = METHODS.GET, jsonType = false) => {
    var options = {
        headers: {
            'Content-Type': jsonType ? 'application/json;charset=UTF-8' : 'application/x-www-form-urlencoded',
            'Accept': 'text/javascript,*/*'
        },
        method: method,
        credentials: 'include'
    };
    if (method !== METHODS.GET && !isEmpty(params)) {
        options.body = jsonType ? JSON.stringify(params) : qs.stringify(params)
    } else if (method === METHODS.GET && !isEmpty(params)) {
        const newParams = ( ~url.lastIndexOf('?') ? '&' : '?' ) + qs.stringify(params);
        url += newParams;

    }
    return fetch(url, options).then(checkRespStatus);
};

const post = (url, params) => request(url, params, METHODS.POST, true);

// check resp status
const checkRespStatus = (respPromise) => {
    if (respPromise.status === 403) {
        // 后台session过期。passport会返回invalidSession，同时status为403
        window.location.reload();
        return;
    }
    return respPromise.json().then(resp => {
        return new Promise((resolve, reject) => {
            if (resp && resp.code == API.CODE_SUCCESS) {
                resolve(resp.data);
            } else if (resp && resp.code == API.CODE_NOT_LOGIN) {
                // 页面超时，重新刷新页面
                window.location.reload();
            } else {
                resp.msg && Message({message: resp.msg, type: 'warning', showClose: true});
                reject(resp);
            }
        });
    });
};

export const createAction = (type, payloadCreator, metaCreator) => {
    const identity = (...args) => args[0];
    const isFunc = (fn) => typeof(fn) === 'function';
    const isPromise = obj => typeof(obj) === 'object' && isFunc(obj.then);
    const finalPayloadCreator = isFunc(payloadCreator) ? payloadCreator : identity;

    return ({commit, dispatch}, ...args) => {
        const payload = finalPayloadCreator(...args);
        const action = {type, payload};

        if (isFunc(metaCreator)) {
            action.meta = metaCreator(...args);
        }

        if (isPromise(payload)) {
            return payload.then(result => {
                commit(type, Object.assign(action, {payload: result}));
                return result;
            }).catch(error => {
                commit(type, Object.assign(action, {error: true, msg: error.msg}));
                return error;
            });
        }

        return commit(type, Object.assign(action, {payload}));
    };
};

export default {

    // 获取所用的任务列表
    getTasks: params => request(API.TASK_LIST, params),

    publishTasks: params => post(API.TASKS_PUBLISH, params),

    unPublishTasks: params => post(API.TASKS_UNPUBLISHED, params),

    // 获取所有的翻译内容审核列表
    getApprovalList: params => request(API.APPROVAL_LIST, params),

    acceptApproval: params => post(API.APPROVAL_ACCEPTED, params),

    rejectApproval: params => post(API.APPROVAL_REJECTED, params),

    // 获取翻译的详情
    getTranslatedArticle: processId => request(API.ARTICLE_VIEW, {processId}),

    // 获取社区内容审核列表
    getCommunityApprovalList: params => request(API.COMMUNITY_APPROVAL_LIST, params),

    acceptCommunityApproval: params => post(API.COMMUNITY_APPROVAL_ACCEPTED, params),

    rejectCommunityApproval: params => post(API.COMMUNITY_APPROVAL_REJECTED, params),

    // 获取指定社区文章的详情
    getCommunityArticle: processId => request(API.COMMUNITY_ARTICLE_VIEW, {processId}),

    // 获取文章分类
    getCommunityArticleCategory: params => request(API.COMMUNITY_ARTICLE_CATEGORY, params),

    // 给文章设置分类
    applyCategoryToCommunityArticle: params => post(API.COMMUNITY_ARTICLE_CATEGORY_APPLIED, params),

    getUsers: params => request(API.USERS_LIST, params),

    updateUserPwd: params =>post(API.USER_PASSWORD_UPDATED, params)
};

<|endoftext|>


<commit_before>import { moduleForMap } from 'dummy/tests/helpers/g-map-helpers';
import { test } from 'qunit';
import { find, render, waitUntil } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { Promise } from 'rsvp';

function wait(ms) {
  return new Promise((resolve) => {
    setTimeout(() => resolve(), ms);
  });
}

moduleForMap('Integration | Component | g-map/info-window', function() {
  test('it registers an info window', async function(assert) {
    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{g.infoWindow lat=lat lng=lng isOpen=false content="test"}}
      {{/g-map}}
    `);

    let { publicAPI } = await this.get('map');

    assert.equal(publicAPI.infoWindows.length, 1);

    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    assert.equal(infoWindow.getContent(), 'test');
  });

  test('it opens an info window when isOpen is set to true', async function(assert) {
    assert.expect(1);

    this.set('isOpen', false);

    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{g.infoWindow lat=lat lng=lng isOpen=isOpen content="test"}}
      {{/g-map}}
    `);

    let { publicAPI } = await this.get('map');
    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    infoWindow.open = () => assert.ok('info window opened');

    this.set('isOpen', true);
  });

   test('it renders an info window with custom html passed using the content attribute', async function(assert) {
    this.set('isOpen', false);
    this.set('onDomReady', () => true);

    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{g.infoWindow lat=lat lng=lng isOpen=isOpen
          onDomready=(action onDomReady)
          content="

"}}
      {{/g-map}}
    `);

    await this.get('map');

    this.set('isOpen', true);

    await waitUntil(this.onDomReady);
    assert.ok(find('#info-window-test'));
  });

  test('it renders an info window with custom html passed as a block', async function(assert) {
    this.set('isOpen', false);
    this.set('onDomReady', () => true);

    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{#g.infoWindow lat=lat lng=lng isOpen=isOpen onDomready=(action onDomReady)}}

        {{/g.infoWindow}}
      {{/g-map}}
    `);

    await this.get('map');

    this.set('isOpen', true);

    await waitUntil(this.onDomReady);
    assert.ok(find('#info-window-test'));
  });

  test('it attaches an info window to a marker', async function(assert) {
    this.set('isOpen', false);
    this.set('onDomReady', () => this.set('domIsReady', true));

    await render(hbs`
      {{#g-map lat=lat lng=lng zoom=6 as |g|}}
        {{#g.marker lat=55 lng=2 as |m|}}
          {{m.infoWindow isOpen=isOpen content="marker-test" onDomready=(action onDomReady)}}
        {{/g.marker}}
      {{/g-map}}
    `);

    const { publicAPI} = await this.get('map');

    this.set('isOpen', true);

    const domIsReady = () => this.domIsReady;
    await waitUntil(domIsReady);

    // There is some lag between the infoWindow rendering and updating its
    // position. It's probably not worth investigating, so we just wait a bit.
    await wait(500);

    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    assert.deepEqual(infoWindow.getPosition().toJSON(), { lat: 55, lng: 2 });
  });

  test('it closes the info window when isOpen is set to false', async function(assert) {
    assert.expect(1);

    this.set('isOpen', true);
    this.set('onDomReady', () => this.set('domIsReady', true));

    await render(hbs`
      {{#g-map lat=lat lng=lng zoom=6 as |g|}}
        {{#g.marker lat=55 lng=2 as |m|}}
          {{m.infoWindow isOpen=isOpen content="marker-test" onDomready=(action onDomReady)}}
        {{/g.marker}}
      {{/g-map}}
    `);

    const { publicAPI} = await this.get('map');

    const domIsReady = () => this.domIsReady;
    await waitUntil(domIsReady);

    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    infoWindow.close = () => assert.ok('info window closed');

    this.set('isOpen', false);
  });
});

<commit_msg>Harden info window tests and add test for close button<commit_after>import { moduleForMap, trigger } from 'dummy/tests/helpers/g-map-helpers';
import { test } from 'qunit';
import { find, render, waitUntil } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { Promise } from 'rsvp';

function wait(ms) {
  return new Promise((resolve) => {
    setTimeout(() => resolve(), ms);
  });
}

moduleForMap('Integration | Component | g-map/info-window', function() {
  test('it registers an info window', async function(assert) {
    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{g.infoWindow lat=lat lng=lng isOpen=false content="test"}}
      {{/g-map}}
    `);

    let { publicAPI } = await this.get('map');

    assert.equal(publicAPI.infoWindows.length, 1);

    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    assert.equal(infoWindow.getContent(), 'test');
  });

  test('it opens an info window when isOpen is set to true', async function(assert) {
    assert.expect(1);

    this.set('isOpen', false);

    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{g.infoWindow lat=lat lng=lng isOpen=isOpen content="test"}}
      {{/g-map}}
    `);

    let { publicAPI } = await this.get('map');
    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    infoWindow.open = () => assert.ok('info window opened');

    this.set('isOpen', true);
  });

   test('it renders an info window with custom html passed using the content attribute', async function(assert) {
    this.set('isOpen', false);
    this.set('onDomReady', () => true);

    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{g.infoWindow lat=lat lng=lng isOpen=isOpen
          onDomready=(action onDomReady)
          content="

"}}
      {{/g-map}}
    `);

    await this.get('map');

    this.set('isOpen', true);

    await waitUntil(this.onDomReady);
    assert.ok(find('#info-window-test'));
  });

  test('it renders an info window with custom html passed as a block', async function(assert) {
    this.set('isOpen', false);
    this.set('onDomReady', () => true);

    await render(hbs`
      {{#g-map lat=lat lng=lng as |g|}}
        {{#g.infoWindow lat=lat lng=lng isOpen=isOpen onDomready=(action onDomReady)}}

        {{/g.infoWindow}}
      {{/g-map}}
    `);

    await this.get('map');

    this.set('isOpen', true);

    await waitUntil(this.onDomReady);
    assert.ok(find('#info-window-test'));
  });

  test('it attaches an info window to a marker', async function(assert) {
    this.set('isOpen', false);
    this.set('onDomReady', () => this.set('domIsReady', true));

    await render(hbs`
      {{#g-map lat=lat lng=lng zoom=6 as |g|}}
        {{#g.marker lat=55 lng=2 as |m|}}
          {{m.infoWindow isOpen=isOpen content="marker-test" onDomready=(action onDomReady)}}
        {{/g.marker}}
      {{/g-map}}
    `);

    const { publicAPI} = await this.get('map');

    this.set('isOpen', true);

    const domIsReady = () => this.domIsReady;
    await waitUntil(domIsReady);

    // There is some lag between the infoWindow rendering and updating its
    // position. It's probably not worth investigating, so we just wait a bit.
    await wait(500);

    const infoWindow = publicAPI.infoWindows[0].mapComponent;
    assert.deepEqual(infoWindow.getPosition().toJSON(), { lat: 55, lng: 2 });
  });

  test('it closes the info window when isOpen is set to false', async function(assert) {
    this.set('isOpen', true);
    this.set('onDomReady', () => this.set('domIsReady', true));

    await render(hbs`
      {{#g-map lat=lat lng=lng zoom=6 as |g|}}
        {{#g.marker lat=55 lng=2 as |m|}}
          {{m.infoWindow isOpen=isOpen content="

" onDomready=(action onDomReady)}}
        {{/g.marker}}
      {{/g-map}}
    `);

    await this.get('map');

    const domIsReady = () => this.domIsReady;
    await waitUntil(domIsReady);

    assert.ok(find('#info-window-test'), 'info window open');

    this.set('isOpen', false);

    assert.notOk(find('#info-window-test'), 'info window closed');
  });

  test('it closes the info window when the close button is clicked', async function(assert) {
    this.set('isOpen', true);
    this.set('onDomReady', () => this.set('domIsReady', true));

    await render(hbs`
      {{#g-map lat=lat lng=lng zoom=6 as |g|}}
        {{#g.marker lat=55 lng=2 as |m|}}
          {{m.infoWindow isOpen=isOpen content="

" onDomready=(action onDomReady)}}
        {{/g.marker}}
      {{/g-map}}
    `);

    const { publicAPI} = await this.get('map');
    const infoWindow = publicAPI.infoWindows[0].mapComponent;

    const domIsReady = () => this.domIsReady;
    await waitUntil(domIsReady);

    assert.ok(find('#info-window-test'), 'info window open');

    trigger(infoWindow, 'closeclick');

    assert.notOk(find('#info-window-test'), 'info window closed');
  });
});

<|endoftext|>


<commit_before>/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};

/*! Respond.js v1.4.2: min/max-width media query polyfill
 * Copyright 2014 Scott Jehl
 * Licensed under MIT
 * http://j.mp/respondjs */

!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b<t.length;b++){var c=t[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!p[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(w(c.styleSheet.rawCssText,e,f),p[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!s||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}x()};y(),c.update=y,c.getEmValue=u,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);<commit_msg>Delete modernizr-2.8.3-respond-1.4.2.min.js<commit_after><|endoftext|>