<commit_before>// Karma configuration
// Generated on Fri Jul 07 2017 16:49:19 GMT+0200 (CEST)

const browsers = {
    // Chrome (Windows)
    win_chrome_latest: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'Windows 8',
        version: 'latest'
    },
    win_chrome_latest_1: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'Windows 8',
        version: 'latest-1'
    },

    // Firefox (Windows)
    win_firefox_latest: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'Windows 10',
        version: 'latest'
    },
    win_firefox_latest_1: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'Windows 10',
        version: 'latest-1'
    },

    // Edge
    win_edge_latest: {
        base: 'SauceLabs',
        browserName: 'MicrosoftEdge',
        platform: 'Windows 10',
        version: 'latest'
    },
    // Edge "latest-1" is not supported

    // IE 11
    win_ie11: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 10',
        version: '11.103'
    },

    // IE 10
    win_ie10: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 8',
        version: '10.0'
    },

    // Chrome (macOS)
    mac_chrome_latest: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'macOS 10.12',
        version: 'latest'
    },
    mac_chrome_latest_1: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'macOS 10.12',
        version: 'latest-1'
    },

    // Firefox (Windows)
    mac_firefox_latest: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'macOS 10.12',
        version: 'latest'
    },
    mac_firefox_latest_1: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'macOS 10.12',
        version: 'latest-1'
    },

    // Safari
    mac_safari_latest: {
        base: 'SauceLabs',
        browserName: 'safari',
        platform: 'macOS 10.12',
        version: 'latest'
    },
    // Safari "latest-1" is not supported

    // Safari (iOS)
    ios_safari_latest: {
        base: 'SauceLabs',
        browserName: 'Safari',
        appiumVersion: '1.6.5',
        deviceName: 'iPhone Simulator',
        deviceOrientation: 'portrait',
        platformVersion: 'latest',
        platformName: 'iOS',
    },

    // Chrome (Android)
    android_chrome_latest: {
        base: 'SauceLabs',
        browserName: 'Chrome',
        appiumVersion: '1.6.5',
        deviceName: 'Android Emulator',
        deviceOrientation: 'portrait',
        platformVersion: 'latest',
        platformName: 'Android',
    },
};

module.exports = function (config) {
    config.set({
        frameworks: ['qunit'],
        files: [
            'tests/dist/complete-library-build.js',
            'tests/dist/all-tests.js'
        ],
        preprocessors: {},
        reporters: ['dots', 'saucelabs'],
        port: 9876,

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: true,

        // Concurrency level
        // how many browser should be started simultaneous
        concurrency: Infinity,

        // use high timeout to better handle long running iOS tasks
        captureTimeout: 180000,

        // SauceLabs specific config
        sauceLabs: {
            testName: 'mojave',
            connectOptions: {
                verbose: true,
                verboseDebugging: true,
            },

            recordScreenshots: true,
        },

        // Browser config
        customLaunchers: browsers,
        browsers: Object.keys(browsers),
    });
};
<commit_msg>Update browsers list<commit_after>// Karma configuration
// Generated on Fri Jul 07 2017 16:49:19 GMT+0200 (CEST)

const browsers = {
    // Chrome (Windows)
    win_chrome_latest: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'Windows 8',
        version: 'latest'
    },
    win_chrome_latest_1: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'Windows 8',
        version: 'latest-1'
    },

    // Firefox (Windows)
    win_firefox_latest: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'Windows 10',
        version: 'latest'
    },
    win_firefox_latest_1: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'Windows 10',
        version: 'latest-1'
    },

    // Edge
    win_edge_latest: {
        base: 'SauceLabs',
        browserName: 'MicrosoftEdge',
        platform: 'Windows 10',
        version: 'latest'
    },
    // Edge "latest-1" is not supported

    // IE 11
    win_ie11: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 10',
        version: '11.103'
    },

    // IE 10
    win_ie10: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 8',
        version: '10.0'
    },

    // Chrome (macOS)
    mac_chrome_latest: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'macOS 10.12',
        version: 'latest'
    },
    mac_chrome_latest_1: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'macOS 10.12',
        version: 'latest-1'
    },

    // Firefox (Windows)
    mac_firefox_latest: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'macOS 10.12',
        version: 'latest'
    },
    mac_firefox_latest_1: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'macOS 10.12',
        version: 'latest-1'
    },

    // Safari
    mac_safari_latest: {
        base: 'SauceLabs',
        browserName: 'safari',
        platform: 'macOS 10.12',
        version: '10.0', // "latest" randomly fails on some tests
    },
    // Safari "latest-1" is not supported

    // Safari (iOS)
    ios_safari_latest: {
        base: 'SauceLabs',
        browserName: 'Safari',
        appiumVersion: '1.6.4',
        deviceName: 'iPhone 7 Plus Simulator',
        deviceOrientation: 'portrait',
        platformVersion: '10.3', // "latest" randomly fails on some tests
        platformName: 'iOS',
    },

    // Chrome (Android)
    android_chrome_latest: {
        base: 'SauceLabs',
        browserName: 'Chrome',
        appiumVersion: '1.6.5',
        deviceName: 'Android Emulator',
        deviceOrientation: 'portrait',
        platformVersion: 'latest',
        platformName: 'Android',
    },
};

module.exports = function (config) {
    config.set({
        frameworks: ['qunit'],
        files: [
            'tests/dist/complete-library-build.js',
            'tests/dist/all-tests.js'
        ],
        preprocessors: {},
        reporters: ['dots', 'saucelabs'],
        port: 9876,

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: true,

        // Concurrency level
        // how many browser should be started simultaneous
        concurrency: Infinity,

        // use high timeout to better handle long running iOS tasks
        captureTimeout: 180000,

        // SauceLabs specific config
        sauceLabs: {
            testName: 'mojave',
            connectOptions: {
                verbose: true,
                verboseDebugging: true,
            },

            recordScreenshots: true,
        },

        // Browser config
        customLaunchers: browsers,
        browsers: Object.keys(browsers),
    });
};
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Sun Jun 07 2015 18:38:27 GMT-0300 (ART)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
        'node_modules/underscore/underscore.js',
        'node_modules/backbone/backbone.js',
        'node_modules/backbone.radio/build/backbone.radio.js',
        'tests/Flux.js',
        'dist/backbone.prism.js',
        'tests/*.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome', 'ChromeCanary'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  });
};
<commit_msg>try without chrome-canary<commit_after>// Karma configuration
// Generated on Sun Jun 07 2015 18:38:27 GMT-0300 (ART)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
        'node_modules/underscore/underscore.js',
        'node_modules/backbone/backbone.js',
        'node_modules/backbone.radio/build/backbone.radio.js',
        'tests/Flux.js',
        'dist/backbone.prism.js',
        'tests/*.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  });
};
<|endoftext|>


<commit_before>const path = require("path");
const parts = require("./webpack.parts");

module.exports = config => {
  const tests = "tests/*.test.js";

  config.set({
    frameworks: ["mocha"],

    files: [
      {
        pattern: tests,
      },
    ],

    // Preprocess through webpack
    preprocessors: {
      [tests]: ["webpack"],
    },

    webpack: parts.loadJavaScript(),

    singleRun: true,

    browsers: ["PhantomJS"],
  });
};
<commit_msg>chore: Drop a comment<commit_after>const path = require("path");
const parts = require("./webpack.parts");

module.exports = config => {
  const tests = "tests/*.test.js";

  config.set({
    frameworks: ["mocha"],

    files: [
      {
        pattern: tests,
      },
    ],

    preprocessors: {
      [tests]: ["webpack"],
    },

    webpack: parts.loadJavaScript(),

    singleRun: true,

    browsers: ["PhantomJS"],
  });
};
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Thu Aug 18 2016 08:59:14 GMT+0200 (CEST)

module.exports = function (config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      'node_modules/babel-polyfill/dist/polyfill.js',
      'dist/zetapush.min.js',
      'test/**/*.spec.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS_CI'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity,

    // Custom Launchers
    // configure custom launchers
    customLaunchers: {
      PhantomJS_CI: {
        base: 'PhantomJS',
        flags: ['--ignore-ssl-errors=true']
      }
    }
  })
}
<commit_msg>feat(test) Remove ignore ssl error and add debug flag<commit_after>// Karma configuration
// Generated on Thu Aug 18 2016 08:59:14 GMT+0200 (CEST)

module.exports = function (config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      'node_modules/babel-polyfill/dist/polyfill.js',
      'dist/zetapush.min.js',
      'test/**/*.spec.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS_CI'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity,

    // Custom Launchers
    // configure custom launchers
    customLaunchers: {
      PhantomJS_CI: {
        base: 'PhantomJS',
        flags: ['--debug=true']
      }
    }
  })
}
<|endoftext|>


<commit_before>module.exports = function(config) {
  config.set({
    frameworks: ['mocha'],

    files: [
      './.tmp/test/**/*.js'
    ],

    autoWatch: false,

    browsers: [
      'PhantomJS'
    ],

    singleRun: true,

    reporters: [
      'progress'
    ],

    webpackMiddleware: {
      quiet: true
    },

    preprocessors: {
      './.tmp/test/**/*.js': ['webpack']
    }
  });
};
<commit_msg>remove karma config.files<commit_after>module.exports = function(config) {
  config.set({
    frameworks: ['mocha'],

    files: [], // use gulp.src (gulp-karma)

    autoWatch: false,

    browsers: [
      'PhantomJS'
    ],

    singleRun: true,

    reporters: [
      'progress'
    ],

    webpackMiddleware: {
      quiet: true
    },

    preprocessors: {
      './.tmp/test/**/*.js': ['webpack']
    }
  });
};
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Thu Mar 05 2015 11:02:25 GMT+0000 (GMT)

module.exports = function(config) {

  if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
    console.log('Need to set SAUCE_USERNAME and SAUCE_ACCESS_KEY');
    process.exit(1);
  }

  var customLaunchers = {
    'SL_Chrome': {
      base: 'SauceLabs',
      browserName: 'chrome',
      platform: 'Windows 7',
      version: '35'
    }
  };

  var conf = {
    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: [
      'mocha',
      'browserify'
    ],

    // list of files / patterns to load in the browser
    files: [
      'test/*.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      'test/*.js': ['browserify']
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    //reporters: ['progress'],
    //reporters: ['spec'],
    reporters: ['spec', 'saucelabs'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    sauceLabs: {
      testName: 'browser test test testing...',
      recordScreenshots: false,
      connectOptions: {
        port: 5757,
        logfile: 'sauce_connect.log'
      }
    },

    // FIXME
    //if (process.env.OSTYPE.match(/^darwin[0-9.]+/)) {
      //// local
      //browsers: ['PhantomJS'],
    //} else {
      //// Assume sauce labs
      //// Increase timeout in case CI connection is slow
      //captureTimeout: 120000,
      //customLaunchers: customLaunchers,
      //browsers: Object.keys(customLaunchers),
    //}
    //captureTimeout: 120000,
    //customLaunchers: customLaunchers,
    //browsers: Object.keys(customLaunchers),

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    //browsers: ['PhantomJS', 'Chrome'],
    //browsers: ['PhantomJS'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true
  };

  // FIXME!
  if (process.env.ORCHESTRATION_HOME) {
    conf.browsers = ['PhantomJS'];
  } else {
    conf.captureTimeout = 120000;
    conf.customLaunchers = customLaunchers;
    conf.browsers = Object.keys(customLaunchers);
  }

  config.set(conf);
};
<commit_msg>testing an idea<commit_after>// Karma configuration
// Originally generated on Thu Mar 05 2015 11:02:25 GMT+0000 (GMT)
// Will run against SauceLabs browsers from Travis CI, or against PhantomJS when
// run locally :)

  var customLaunchers = {
    'SL_Chrome': {
      base: 'SauceLabs',
      browserName: 'chrome',
      platform: 'Windows 7',
      version: '35'
    }
  };
module.exports = function(config) {

  if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
    console.log('Need to set SAUCE_USERNAME and SAUCE_ACCESS_KEY');
    process.exit(1);
  }

  // Define SauceLabs browser matrix here
  //var customLaunchers = {
    //'SL_Chrome': {
      //base: 'SauceLabs',
      //browserName: 'chrome',
      //platform: 'Windows 7',
      //version: '35'
    //}
  //};

  var conf = {
    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: [
      'mocha',
      'browserify'
    ],

    // list of files / patterns to load in the browser
    files: [
      'test/*.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      'test/*.js': ['browserify']
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    //reporters: ['progress'],
    //reporters: ['spec'],
    reporters: ['spec', 'saucelabs'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    sauceLabs: {
      testName: 'browser test test testing...',
      recordScreenshots: false,
      connectOptions: {
        port: 5757,
        logfile: 'sauce_connect.log'
      }
    },

    // FIXME
    //if (process.env.OSTYPE.match(/^darwin[0-9.]+/)) {
      //// local
      //browsers: ['PhantomJS'],
    //} else {
      //// Assume sauce labs
      //// Increase timeout in case CI connection is slow
      //captureTimeout: 120000,
      //customLaunchers: customLaunchers,
      //browsers: Object.keys(customLaunchers),
    //}
    //captureTimeout: 120000,
    //customLaunchers: customLaunchers,
    //browsers: Object.keys(customLaunchers),

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    //browsers: ['PhantomJS', 'Chrome'],
    //browsers: ['PhantomJS'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true
  };

  // FIXME!
  if (process.env.ORCHESTRATION_HOME) {
    conf.browsers = ['PhantomJS'];
  } else {
    conf.captureTimeout = 120000;
    conf.customLaunchers = customLaunchers;
    conf.browsers = Object.keys(customLaunchers);
  }

  config.set(conf);
};
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Sun Apr 10 2016 12:06:14 GMT+0200 (Central European Daylight Time)

module.exports = function (config) {
    if (process.env.TRAVIS && (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY)) {
        console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
        process.exit(1);
    }

    var customLaunchers = new CustomLaunchers();

    customLaunchers
        .addChrome('36', '42', '43', '44', '45')('Windows 8')
        .addEdge('13.10586')('Windows 10')
        .addIE('9.0', '10.0', '11.0')('Windows 7')
        .addIE('10.0')('Windows 8')
        .addIE('11.0')('Windows 8.1')
        .addSafari('7.0')('OS X 10.9')
        .addSafari('8.0')('OS X 10.10')
        .addSafari('9.0')('OS X 10.11')
        .addFirefox('6.0', '33', '34', '38', '39')('Windows 8')
        .addFirefox('6.0', '33', '34', '38', '39')();

    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '',

        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['systemjs', 'jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'tests/*-spec.ts',
            'tests/*-specs.ts'
        ],

        // list of files to exclude
        exclude: [],

        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {},

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: process.env.TRAVIS ? ['dots', 'saucelabs'] : ['progress'],

        // web server port
        port: 9876,

        // enable / disable colors in the output (reporters and logs)
        colors: true,

        // level of logging
        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_INFO,

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: true,

        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        browsers: process.env.TRAVIS
            ? Object.keys(customLaunchers).filter(function(key) { return !key.startsWith('add'); })
            :['Chrome'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: process.env.TRAVIS ? true : false,

        // Concurrency level
        // how many browser should be started simultaneous
        concurrency: 4,

        systemjs: {
            configFile: 'config.js',
            config: {
                paths: {
                    "typescript": "node_modules/typescript/lib/typescript.js",
                    "systemjs": "node_modules/systemjs/dist/system.js",
                    'system-polyfills': 'node_modules/systemjs/dist/system-polyfills.js',
                    'es6-module-loader': 'node_modules/es6-module-loader/dist/es6-module-loader.js'
                },
                packages: {
                    'tests': {
                        defaultExtension: 'ts'
                    },
                    'src': {
                        defaultExtension: 'ts'
                    }
                },
                transpiler: 'typescript'
            },
            serveFiles: [
                'src/**/*.ts',
                'tests/**/*.ts',
                'jspm_packages/**/*'
            ]
        },

        customLaunchers: JSON.parse(JSON.stringify(customLaunchers)),

        sauceLabs: {
            testName: 'Web App Unit Tests'
        }
    })
};

function CustomLaunchers() {
    var self = this;

    this.addChrome = addBrowser('chrome');
    this.addEdge = addBrowser('MicrosoftEdge');
    this.addOpera = addBrowser('opera');
    this.addSafari = addBrowser('safari');
    this.addFirefox = addBrowser('firefox');
    this.addIE = addBrowser('internet explorer');

    function addBrowser(browser) {
        var browserName = browser.replace(' ', '_');

        return function () {
            var versions = Array.from(arguments);
            return function (system) {
                var systemName = (system || 'linux').replace(' ', '_');

                versions.forEach(function (version) {
                    var seleniumKey = browserName + '_' + version + '_' + systemName;

                    self[seleniumKey] = {
                        base: 'SauceLabs',
                        seleniumKey: browser,
                        version: version
                    };

                    if (system) {
                        self[seleniumKey].platform = system;
                    }
                });

                self[browserName + '_latest_' + systemName] = {
                    base: 'SauceLabs',
                    seleniumKey: browser
                };

                return self;
            };
        };
    }
}
<commit_msg>adding latest browsers fixed<commit_after>// Karma configuration
// Generated on Sun Apr 10 2016 12:06:14 GMT+0200 (Central European Daylight Time)

module.exports = function (config) {
    if (process.env.TRAVIS && (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY)) {
        console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
        process.exit(1);
    }

    var customLaunchers = new CustomLaunchers();

    customLaunchers
        .addChrome('36', '42', '43', '44', '45')('Windows 8')
        .addEdge('13.10586')('Windows 10')
        .addIE('9.0', '10.0', '11.0')('Windows 7')
        .addIE('10.0')('Windows 8')
        .addIE('11.0')('Windows 8.1')
        .addSafari('7.0')('OS X 10.9')
        .addSafari('8.0')('OS X 10.10')
        .addSafari('9.0')('OS X 10.11')
        .addFirefox('6.0', '33', '34', '38', '39')('Windows 8')
        .addFirefox('6.0', '33', '34', '38', '39')()
        .addLatest('chrome', 'OS X 10.11')
        .addLatest('chrome', 'Windows 8')
        .addLatest('chrome', 'linux')
        .addLatest('firefox', 'linux')
        .addLatest('firefox', 'Windows 10')
        .addLatest('firefox', 'OS X 10.11')
        .addLatest('MicrosoftEdge', 'Windows 10');

    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '',

        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['systemjs', 'jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'tests/*-spec.ts',
            'tests/*-specs.ts'
        ],

        // list of files to exclude
        exclude: [],

        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {},

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: process.env.TRAVIS ? ['dots', 'saucelabs'] : ['progress'],

        // web server port
        port: 9876,

        // enable / disable colors in the output (reporters and logs)
        colors: true,

        // level of logging
        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_INFO,

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: true,

        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        browsers: process.env.TRAVIS
            ? Object.keys(customLaunchers).filter(function(key) { return !key.startsWith('add'); })
            :['Chrome'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: process.env.TRAVIS ? true : false,

        // Concurrency level
        // how many browser should be started simultaneous
        concurrency: 4,

        systemjs: {
            configFile: 'config.js',
            config: {
                paths: {
                    "typescript": "node_modules/typescript/lib/typescript.js",
                    "systemjs": "node_modules/systemjs/dist/system.js",
                    'system-polyfills': 'node_modules/systemjs/dist/system-polyfills.js',
                    'es6-module-loader': 'node_modules/es6-module-loader/dist/es6-module-loader.js'
                },
                packages: {
                    'tests': {
                        defaultExtension: 'ts'
                    },
                    'src': {
                        defaultExtension: 'ts'
                    }
                },
                transpiler: 'typescript'
            },
            serveFiles: [
                'src/**/*.ts',
                'tests/**/*.ts',
                'jspm_packages/**/*'
            ]
        },

        customLaunchers: JSON.parse(JSON.stringify(customLaunchers)),

        sauceLabs: {
            testName: 'Web App Unit Tests'
        }
    })
};

function CustomLaunchers() {
    var self = this;

    this.addChrome = addBrowser('chrome');
    this.addEdge = addBrowser('MicrosoftEdge');
    this.addOpera = addBrowser('opera');
    this.addSafari = addBrowser('safari');
    this.addFirefox = addBrowser('firefox');
    this.addIE = addBrowser('internet explorer');

    function addLatest(browser, system) {
        var browserName = browser.replace(' ', '_');
        var systemName = system.replace(' ', '_');

        self[browserName + '_latest_' + systemName] = {
            base: 'SauceLabs',
            seleniumKey: browser
        };
    }

    function addBrowser(browser) {
        var browserName = browser.replace(' ', '_');

        return function () {
            var versions = Array.from(arguments);
            return function (system) {
                var systemName = (system || 'linux').replace(' ', '_');

                versions.forEach(function (version) {
                    var seleniumKey = browserName + '_' + version + '_' + systemName;

                    self[seleniumKey] = {
                        base: 'SauceLabs',
                        seleniumKey: browser,
                        version: version
                    };

                    if (system) {
                        self[seleniumKey].platform = system;
                    }
                });

                return self;
            };
        };
    }
}
<|endoftext|>


<commit_before>'use strict';
import React from 'react';
import { connect } from 'react-redux';
import Preloader from '../../components/Preloader{{#if sectionNames}}/Preloader{{/if}}';
import {setReady, setProgress} from './actions';
import TransitionGroup from 'react-transition-group-plus';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.onResize = this.onResize.bind(this);
    this.state = {
      width: 960,
      height: 570
    };
  }
  onResize() {
    this.setState({
      width: window.innerWidth,
      height: window.innerHeight
    });
  }
  componentWillMount() {
    window.addEventListener('resize',this.onResize);
    this.onResize();
  }
  componentWillUnmount() {
    window.removeEventListener('resize',this.onResize);
  }
  getContent() {
    if (this.props.ready) {
      return React.cloneElement(this.props.children, { key: this.props.section+'-'+Math.random(), width: this.state.width, height: this.state.height});
    } else {
      return <Preloader
        onProgress={this.props.onProgress}
        onReady={this.props.onReady}
        assets={this.props.assets}
        width={this.state.width}
        height={this.state.height}
      />
    }
  }
  render() {
    return <TransitionGroup id="app" component="div" transitionMode="out-in">
      {this.getContent()}
    </TransitionGroup>;
  }
};

const mapStateToProps = (state, ownProps) => {
  let section = ownProps.location.pathname.split('/')[0] || 'landing';
  return {
    progress: state.progress,
    ready: state.ready,
    assets: state.assets,
    section: section
  }
};

const mapDispatchToProps = (dispatch) => {
  return {
    onProgress: function(val) {
      dispatch(setProgress(val));
    },
    onReady: function(val) {
      dispatch(setReady(val));
    }
  }
};

App.defaultProps = {
  assets: [],
  progress: 0,
  ready: false
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(App);
<commit_msg>Fixed react section name<commit_after>'use strict';
import React from 'react';
import { connect } from 'react-redux';
import Preloader from '../../components/Preloader{{#if sectionNames}}/Preloader{{/if}}';
import {setReady, setProgress} from './actions';
import TransitionGroup from 'react-transition-group-plus';

class App extends React.Component {
  constructor(props) {
    super(props);
    this.onResize = this.onResize.bind(this);
    this.state = {
      width: 960,
      height: 570
    };
  }
  onResize() {
    this.setState({
      width: window.innerWidth,
      height: window.innerHeight
    });
  }
  componentWillMount() {
    window.addEventListener('resize',this.onResize);
    this.onResize();
  }
  componentWillUnmount() {
    window.removeEventListener('resize',this.onResize);
  }
  getContent() {
    if (this.props.ready) {
      return React.cloneElement(this.props.children, { key: this.props.section+'-'+Math.random(), width: this.state.width, height: this.state.height});
    } else {
      return <Preloader
        onProgress={this.props.onProgress}
        onReady={this.props.onReady}
        assets={this.props.assets}
        width={this.state.width}
        height={this.state.height}
      />
    }
  }
  render() {
    return <TransitionGroup id="app" component="div" transitionMode="out-in">
      {this.getContent()}
    </TransitionGroup>;
  }
};

const mapStateToProps = (state, ownProps) => {
  let section = ownProps.location.pathname.split('/')[1] || 'landing';
  return {
    progress: state.progress,
    ready: state.ready,
    assets: state.assets,
    section: section
  }
};

const mapDispatchToProps = (dispatch) => {
  return {
    onProgress: function(val) {
      dispatch(setProgress(val));
    },
    onReady: function(val) {
      dispatch(setReady(val));
    }
  }
};

App.defaultProps = {
  assets: [],
  progress: 0,
  ready: false
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(App);
<|endoftext|>


<commit_before>module.exports = function (config) {

	config.set({
		basePath: './dist',
		frameworks: [
			'jspm',
			'mocha',
			'sinon',
			'should',
		],
		plugins: [
			'karma-chrome-launcher',
			'karma-firefox-launcher',
			'karma-opera-launcher',
			//'karma-safari-launcher',
			'karma-mocha',
			'karma-sinon',
			'karma-should',
			'karma-jspm',
	    ],
		browsers: [
			'Chrome',
			'ChromeCanary',
			'Firefox',
			'Opera',
			//'Safari',
			'FirefoxEnableWebComponents',
		],
		customLaunchers: {
		    FirefoxEnableWebComponents: {
		        base: 'Firefox',
		        prefs: {
		            'dom.webcomponents.enabled': true
		        }
		    },
			Chrome_travis_ci: {
	          base: 'Chrome',
	          flags: ['--no-sandbox']
		  },
		},
		files: [{
	        pattern: '**/*.js.map',
	        included: false
		}],
		/*
		client: {
			mocha: {
				opts: 'test/mocha.opts' // update to karma-mocha 1.3.0
			},
		},
		*/
		jspm: {

			browser: "jspm.browser.js",
			config: "jspm.config.js",

		    loadFiles: [
				'jspm_packages/npm/babel-polyfill@6.16.0/dist/polyfill.js',

				'test/decorators/*spec.js',
				'test/libs/*spec.js',
				'test/helpers/*spec.js',
				'test/imports/*.js',
				'test/mocks/*.js',
			],
			serveFiles: [
				// internal libs/files
				'src/bootstrap.js',
				'src/index.js',
				'src/decorators/*.js',
				'src/libs/*.js',
				'src/helpers/*.js',
				'src/configs/*.js',
				'src/apps/*.js',
				'src/datas/*.js',
				// external libs/files
				'jspm_packages/npm/regenerator-runtime@0.9.6/**/*.js',
				'jspm_packages/npm/babel-runtime@6.18.0/**/*.js',
				'jspm_packages/npm/core-js@2.4.1/**/*.js',

				'node_modules/core-js/**/*.js',
				'node_modules/handlebars/dist/**/*.js',
				'node_modules/webcomponents.js/webcomponents-lite.js',
				'node_modules/named-js-regexp/lib/named-js-regexp.js',
			]
		},
		autoWatch: true,
		singleRun: false,
		port: 9876,
	    colors: true,
	    logLevel: config.LOG_INFO,
	});

	if(process.env.TRAVIS){
        config.browsers = ['Chrome_travis_ci'];
    }

};
<commit_msg>karma.conf.js: add npm module extend to serveFiles<commit_after>module.exports = function (config) {

	config.set({
		basePath: './dist',
		frameworks: [
			'jspm',
			'mocha',
			'sinon',
			'should',
		],
		plugins: [
			'karma-chrome-launcher',
			'karma-firefox-launcher',
			'karma-opera-launcher',
			//'karma-safari-launcher',
			'karma-mocha',
			'karma-sinon',
			'karma-should',
			'karma-jspm',
	    ],
		browsers: [
			'Chrome',
			'ChromeCanary',
			'Firefox',
			'Opera',
			//'Safari',
			'FirefoxEnableWebComponents',
		],
		customLaunchers: {
		    FirefoxEnableWebComponents: {
		        base: 'Firefox',
		        prefs: {
		            'dom.webcomponents.enabled': true
		        }
		    },
			Chrome_travis_ci: {
	          base: 'Chrome',
	          flags: ['--no-sandbox']
		  },
		},
		files: [{
	        pattern: '**/*.js.map',
	        included: false
		}],
		/*
		client: {
			mocha: {
				opts: 'test/mocha.opts' // update to karma-mocha 1.3.0
			},
		},
		*/
		jspm: {

			browser: "jspm.browser.js",
			config: "jspm.config.js",

		    loadFiles: [
				'jspm_packages/npm/babel-polyfill@6.16.0/dist/polyfill.js',

				'test/decorators/*spec.js',
				'test/libs/*spec.js',
				'test/helpers/*spec.js',
				'test/imports/*.js',
				'test/mocks/*.js',
			],
			serveFiles: [
				// internal libs/files
				'src/bootstrap.js',
				'src/index.js',
				'src/decorators/*.js',
				'src/libs/*.js',
				'src/helpers/*.js',
				'src/configs/*.js',
				'src/apps/*.js',
				'src/datas/*.js',
				// external libs/files
				'jspm_packages/npm/regenerator-runtime@0.9.6/**/*.js',
				'jspm_packages/npm/babel-runtime@6.18.0/**/*.js',
				'jspm_packages/npm/core-js@2.4.1/**/*.js',

				'node_modules/core-js/**/*.js',
				'node_modules/handlebars/dist/**/*.js',
				'node_modules/webcomponents.js/webcomponents-lite.js',
				'node_modules/named-js-regexp/lib/named-js-regexp.js',
				'node_modules/extend/index.js',
			]
		},
		autoWatch: true,
		singleRun: false,
		port: 9876,
	    colors: true,
	    logLevel: config.LOG_INFO,
	});

	if(process.env.TRAVIS){
        config.browsers = ['Chrome_travis_ci'];
    }

};
<|endoftext|>


<commit_before>// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

module.exports = function (config) {
    config.set({
        // testing framework to use (jasmine/mocha/qunit/...)
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'bower_components/angular/angular.js',
            'bower_components/angular-mocks/angular-mocks.js',
            'bower_components/leaflet/dist/leaflet.js',
            'bower_components/redux/index.js',

            'modules/shared/shared.module.js',

            'modules/header/header.module.js',
            'modules/detail/detail.module.js',
            'modules/layer-selection/layer-selection.module.js',
            'modules/map/map.module.js',
            'modules/page/page.module.js',
            'modules/search-results/search-results.module.js',
            'modules/straatbeeld/straatbeeld.module.js',

            'modules/atlas/atlas.module.js',

            'modules/**/*.js',

            './*.js'
        ],

        plugins: [
            'karma-jasmine',
            'karma-mocha-reporter',
            'karma-coverage',
            'karma-phantomjs-launcher'
        ],

        // level of logging
        // possible values: OFF, ERROR, WARN, INFO, DEBUG
        logLevel: 'ERROR',

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: false,

        // Reporters
        // - dots
        // - progress
        // - junit
        // - growl
        // - coverage
        reporters: ['coverage'],

        preprocessors: {
            // source files, that you wanna generate coverage for
            // do not include tests or libraries
            // (these files will be instrumented by Istanbul)
            'modules/**/!(*.test).js': ['coverage']
        },

        // optionally, configure the reporter
        // type can also be 'cobertura' which should be understand by Jenkins
        coverageReporter: {
            type: 'html',
            dir: 'reports/coverage/',
            check: {
                global: {
                    statements: 95,
                    branches: 95,
                    functions: 95,
                    lines: 95
                }
            },
            watermarks: {
                statements: [95, 100],
                functions: [95, 100],
                branches: [95, 100],
                lines: [95, 100]
            }
        },

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera
        // - Safari (only Mac)
        // - PhantomJS
        // - IE (only Windows)
        browsers: ['PhantomJS'],

        // Continuous Integration mode
        // if true, it capture browsers, run tests and exit
        singleRun: true
    });
};
<commit_msg>removed watermarks<commit_after>// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

module.exports = function (config) {
    config.set({
        // testing framework to use (jasmine/mocha/qunit/...)
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'bower_components/angular/angular.js',
            'bower_components/angular-mocks/angular-mocks.js',
            'bower_components/leaflet/dist/leaflet.js',
            'bower_components/redux/index.js',

            'modules/shared/shared.module.js',

            'modules/header/header.module.js',
            'modules/detail/detail.module.js',
            'modules/layer-selection/layer-selection.module.js',
            'modules/map/map.module.js',
            'modules/page/page.module.js',
            'modules/search-results/search-results.module.js',
            'modules/straatbeeld/straatbeeld.module.js',

            'modules/atlas/atlas.module.js',

            'modules/**/*.js',

            './*.js'
        ],

        plugins: [
            'karma-jasmine',
            'karma-mocha-reporter',
            'karma-coverage',
            'karma-phantomjs-launcher'
        ],

        // level of logging
        // possible values: OFF, ERROR, WARN, INFO, DEBUG
        logLevel: 'ERROR',

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: false,

        // Reporters
        // - dots
        // - progress
        // - junit
        // - growl
        // - coverage
        reporters: ['coverage'],

        preprocessors: {
            // source files, that you wanna generate coverage for
            // do not include tests or libraries
            // (these files will be instrumented by Istanbul)
            'modules/**/!(*.test).js': ['coverage']
        },

        // optionally, configure the reporter
        // type can also be 'cobertura' which should be understand by Jenkins
        coverageReporter: {
            type: 'html',
            dir: 'reports/coverage/',
            check: {
                global: {
                    statements: 95,
                    branches: 95,
                    functions: 95,
                    lines: 95
                }
            }
        },

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera
        // - Safari (only Mac)
        // - PhantomJS
        // - IE (only Windows)
        browsers: ['PhantomJS'],

        // Continuous Integration mode
        // if true, it capture browsers, run tests and exit
        singleRun: true
    });
};
<|endoftext|>


<commit_before>'use strict';

var webpackConfig = require('./webpack/webpack.test.js');
require('phantomjs-polyfill');
webpackConfig.entry = {};

module.exports = function (config) {
    config.set({
        basePath: '',
        frameworks: ['jasmine'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: false,
        browsers: ["PhantomJS2"],
        plugins: [
            'karma-jasmine',
            'karma-coverage',
            'karma-spec-reporter',
            'karma-webpack',
            'karma-phantomjs2-launcher'
        ],
        singleRun: true,
        autoWatchBatchDelay: 300,
        files: [
            './node_modules/phantomjs-polyfill/bind-polyfill.js',
            './src/test.ts'
        ],
        babelPreprocessor: {
            options: {
                presets: ['es2015']
            }
        },
        preprocessors: {
            'src/test.ts': ['webpack'],
            'src/**/!(*.spec)+(.js)': ['coverage']
        },
        webpackMiddleware: {
            stats: {
                chunkModules: false,
                colors: true
            }
        },
        webpack: webpackConfig,
        reporters: [
            'dots',
            'spec',
            'coverage'
        ],
        coverageReporter: {
            reporters: [
                {
                    dir: 'reports/coverage/',
                    subdir: '.',
                    type: 'html'
                }, {
                    dir: 'reports/coverage/',
                    subdir: '.',
                    type: 'lcov'
                }
            ]
        }
    });
};
<commit_msg>Fixed path for coverage reports<commit_after>'use strict';

var webpackConfig = require('./webpack/webpack.test.js');
require('phantomjs-polyfill');
webpackConfig.entry = {};

module.exports = function (config) {
    config.set({
        basePath: '',
        frameworks: ['jasmine'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: false,
        browsers: ["PhantomJS2"],
        plugins: [
            'karma-jasmine',
            'karma-coverage',
            'karma-spec-reporter',
            'karma-webpack',
            'karma-phantomjs2-launcher'
        ],
        singleRun: true,
        autoWatchBatchDelay: 300,
        files: [
            './node_modules/phantomjs-polyfill/bind-polyfill.js',
            './src/test.ts'
        ],
        babelPreprocessor: {
            options: {
                presets: ['es2015']
            }
        },
        preprocessors: {
            'src/test.ts': ['webpack'],
            'src/**/!(*.spec)+(.js)': ['coverage']
        },
        webpackMiddleware: {
            stats: {
                chunkModules: false,
                colors: true
            }
        },
        webpack: webpackConfig,
        reporters: [
            'dots',
            'spec',
            'coverage'
        ],
        coverageReporter: {
            reporters: [
                {
                    dir: 'reports/coverage/html-report',
                    subdir: '.',
                    type: 'html'
                }, {
                    dir: 'reports/coverage/lcov-report',
                    subdir: '.',
                    type: 'lcov'
                }
            ]
        }
    });
};
<|endoftext|>


<commit_before>/**********************
* @license
* The MIT License (MIT)
*
* Copyright (c) 2014 David Arvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**********************/
!function(e,t){var n;if("undefined"!=typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&"object"==typeof define.amd)define(t);else{try{n=Function("return this")()||(42,eval)("this")}catch(i){n=window}n[e]=t()}}("AnimationLoop",function(){"use strict";function e(e,t){return t==={}.toString.call(e).slice(8,-1)}function t(t,n){return!e(t,n)}function n(t){var n=[];return t.forEach(function(t){if(e(t,"Array")){var i=n.length,a=t.length,r=-1;for(n.length+=a;++r<a;)n[i++]=t[r]}else n.push(t)}),n}var i=function(e){return Array.isArray(e)?e:Array.from(e)},a=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}(),s=function(){return window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame}(),o=function(){function t(e){if(!(this instanceof t))return new t(e);this.canceled=!1,this.completed=!1,this.paused=!1,this.autonomous=!1,this.startTime=null;for(var n in e)e.hasOwnProperty(n)&&(this[n]=e[n]);this.autonomous&&(this.rafId=null),this.paused||this.start()}return a(t,null,{cancelRAF:{value:function(){s(this.rafId),this.rafId=null},writable:!0,enumerable:!0,configurable:!0},start:{value:function(){return this.completed||this.canceled?this:(this.autonomous&&(this.cancelRAF(),this.rafId=r(this.burnFrame.bind(this))),this.paused=!1,this)},writable:!0,enumerable:!0,configurable:!0},burnFrame:{value:function(e){this.updateState(e),this.rafId=r(this.cycle.bind(this))},writable:!0,enumerable:!0,configurable:!0},pause:{value:function(){return this.completed||this.canceled?this:(this.autonomous&&this.cancelRAF(),this.paused=!0,this)},writable:!0,enumerable:!0,configurable:!0},cancel:{value:function(){return this.autonomous&&this.cancelRAF(),this.canceled=!0,this.completed=!0,this._oncomplete(),this},writable:!0,enumerable:!0,configurable:!0},complete:{value:function(){if(this.autonomous&&this.cancelRAF(),e(this.done,"Function")){var t,n=this.args||[];(t=this).done.apply(t,i(n))}return this.completed=!0,this._oncomplete(),this},writable:!0,enumerable:!0,configurable:!0},updateState:{value:function(e){var t=this.previousState;return t?(t=this.previousState=this.state,void(this.state={now:e,lastNow:t.now,deltaT:e-t.now,runningTime:t.runningTime,progress:t.progress})):(this.startTime=e,t={},t.now=e,t.lastNow=e,t.runningTime=0,t.deltaT=0,t.progress=0,void(this.state=this.previousState=t))},writable:!0,enumerable:!0,configurable:!0},updateProgress:{value:function(){var e=this.state;e.runningTime+=e.deltaT,this.duration&&(e.progress=Math.max(0,Math.min(1,e.runningTime/this.duration)))},writable:!0,enumerable:!0,configurable:!0},cycle:{value:function(t){var n;if(this.autonomous){var a=this.args||[],s=this.state,o=t-this.lastNow;if(this.pauseThreshold&&o>=this.pauseThreshold)return void(this.rafId=r(this.burnFrame.bind(this)));if(this.rafId=r(this.cycle.bind(this)),this.updateState(t),this.updateProgress(),e(this.before,"Function")){var u;(u=this).before.apply(u,i(a))}this.paused||this.canceled||this.completed||((n=this).render.apply(n,i(a)),this.paused||this.canceled||this.completed||1===s.progress&&this.complete())}},writable:!0,enumerable:!0,configurable:!0}}),t}(),u=["before","render","done","args","duration","paused","pauseThreshold","autonomous"],l=function(){function l(t){return this instanceof l?(t=t||{},this.animations=[],this.remaining=0,this.completed=!1,this.registry={},this.autonomous=t.autonomous||!1,this.autonomous||(this.paused=!1,this.rafId=null),void(this.pauseThreshold=e(t.pauseThreshold,"Undefined")?!1:t.pauseThreshold)):new l(t)}return a(l,null,{createAnimations:{value:function(){for(var e=this,t=arguments.length,i=Array(t),a=0;t>a;a++)i[a]=arguments[a];return 0===i.length?[]:(i=n(i),i.map(function(t){return t=e.getScrubbedOptions(t),t.autonomous=t.autonomous||e.autonomous,t.pauseThreshold=t.pauseThreshold||e.pauseThreshold,t._oncomplete=e._animationComplete.bind(e),new o(t)}))},writable:!0,enumerable:!0,configurable:!0},getScrubbedOptions:{value:function(n){var i={};if(n=e(n,"Object")?n:e(n,"Function")?{render:n}:null,e(n,"Null"))throw new Error("Options to AnimationLoop are not of a supported type.");if(t(n.render,"Function"))throw new Error("There was no render function supplied to the AnimationLoop.");return u.forEach(function(e){n.hasOwnProperty(e)&&t(n[e],"Undefined")&&(i[e]=n[e])}),i},writable:!0,enumerable:!0,configurable:!0},cancelRAF:{value:function(){s(this.rafId),this.rafId=null},writable:!0,enumerable:!0,configurable:!0},start:{value:function(){return this.animations.forEach(function(e){return e.start()}),this.autonomous||(this.cancelRAF(),this.rafId=r(this.burnFrame.bind(this)),this.paused=!1),this},writable:!0,enumerable:!0,configurable:!0},burnFrame:{value:function(e){this.autonomous||0===this.remaining||(this.updateState(e),this.animations.forEach(function(t){t.autonomous||t.paused||t.completed||t.canceled||t.updateState(e)}),this.rafId=r(this.cycle.bind(this)))},writable:!0,enumerable:!0,configurable:!0},pause:{value:function(){return this.animations.forEach(function(e){return e.pause()}),this.autonomous||(this.cancelRAF(),this.paused=!0),this},writable:!0,enumerable:!0,configurable:!0},cancel:{value:function(){return this.animations.forEach(function(e){return e.cancel()}),this.autonomous&&this.cancelRAF(),this},writable:!0,enumerable:!0,configurable:!0},_animationComplete:{value:function(){this.remaining--,0===this.remaining&&(this.completed=!0,this.autonomous||this.cancelRAF(),e(this.oncomplete,"Function")&&this.oncomplete())},writable:!0,enumerable:!0,configurable:!0},add:{value:function(){for(var e,t=arguments.length,n=Array(t),a=0;t>a;a++)n[a]=arguments[a];this.autonomous||this.paused||0!==this.remaining||this.start();var r=(e=this).createAnimations.apply(e,i(n));return this.animations=this.animations.concat(r),this.remaining+=r.length,this.completed=0===this.remaining?this.completed:!1,r},writable:!0,enumerable:!0,configurable:!0},clearCompleted:{value:function(){for(var e=this.animations,t=[],n=e.length-1;n>=0;--n){var i=e[n];(i.completed||i.canceled)&&(t=t.concat(e.splice(n,1)))}return t.reverse(),t},writable:!0,enumerable:!0,configurable:!0},addEventListener:{value:function(e,t,n){var i=this.registry[e]||(this.registry[e]=[]);i.push([t,n])},writable:!0,enumerable:!0,configurable:!0},removeEventListener:{value:function(e,t,n){var i,a=arguments.length;if(1===a)return void delete this.registry[e];i=this.registry[e]||[];for(var r=i.length-1;r>=0;--r){var s=i[r][0],o=i[r][1];s===t&&(2===a||o===n)&&i.splice(r,1)}},writable:!0,enumerable:!0,configurable:!0},trigger:{value:function(e){var t=this.registry[e]||[];t.forEach(function(e){var t=e[0],n=e[1];t.call(n)})},writable:!0,enumerable:!0,configurable:!0},oncomplete:{value:function(){this.trigger("complete")},writable:!0,enumerable:!0,configurable:!0},updateState:{value:function(e){this._lastNow=this._lastNow||e,this._deltaT=e-this._lastNow,this._lastNow=e},writable:!0,enumerable:!0,configurable:!0},cycle:{value:function(t){if(!this.autonomous&&0!==this.remaining){var n=t-this._lastNow,a=this.animations;if(this.pauseThreshold&&n>=this.pauseThreshold)return void(this.rafId=r(this.burnFrame.bind(this)));this.rafId=r(this.cycle.bind(this)),this.updateState(t),a=a.filter(function(n){if(n.autonomous||n.paused||n.canceled||n.completed)return!1;var a=n.args||[];return n.updateState(t),n.updateProgress(),e(n.before,"Function")&&n.before.apply(n,i(a)),n.autonomous||n.paused||n.canceled||n.completed?!1:!0}),a.forEach(function(e){var t=e.args||[];e.render.apply(e,i(t)),e.paused||e.canceled||e.completed||1===e.state.progress&&e.complete()})}},writable:!0,enumerable:!0,configurable:!0}}),l}();return l});<commit_msg>Update build<commit_after>/**********************
* @license
* The MIT License (MIT)
*
* Copyright (c) 2014 David Arvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**********************/
!function(e,t){var n;if("undefined"!=typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&"object"==typeof define.amd)define(t);else{try{n=Function("return this")()||(42,eval)("this")}catch(i){n=window}n[e]=t()}}("AnimationLoop",function(){"use strict";function e(e,t){return t==={}.toString.call(e).slice(8,-1)}function t(t,n){return!e(t,n)}function n(t){var n=[];return t.forEach(function(t){if(e(t,"Array")){var i=n.length,a=t.length,r=-1;for(n.length+=a;++r<a;)n[i++]=t[r]}else n.push(t)}),n}var i=function(e){return Array.isArray(e)?e:Array.from(e)},a=function(e,t,n){t&&Object.defineProperties(e,t),n&&Object.defineProperties(e.prototype,n)},r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}(),s=function(){return window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame}(),o=function(){function t(e){if(!(this instanceof t))return new t(e);this.canceled=!1,this.completed=!1,this.paused=!1,this.autonomous=!1,this.startTime=null;for(var n in e)e.hasOwnProperty(n)&&(this[n]=e[n]);this.autonomous&&(this.rafId=null),this.paused||this.start()}return a(t,null,{cancelRAF:{value:function(){s(this.rafId),this.rafId=null},writable:!0,enumerable:!0,configurable:!0},start:{value:function(){return this.completed||this.canceled?this:(this.autonomous&&(this.cancelRAF(),this.rafId=r(this.burnFrame.bind(this))),this.paused=!1,this)},writable:!0,enumerable:!0,configurable:!0},burnFrame:{value:function(e){this.updateState(e),this.rafId=r(this.cycle.bind(this))},writable:!0,enumerable:!0,configurable:!0},pause:{value:function(){return this.completed||this.canceled?this:(this.autonomous&&this.cancelRAF(),this.paused=!0,this)},writable:!0,enumerable:!0,configurable:!0},cancel:{value:function(){return this.autonomous&&this.cancelRAF(),this.canceled=!0,this.completed=!0,this._oncomplete(),this},writable:!0,enumerable:!0,configurable:!0},complete:{value:function(){if(this.autonomous&&this.cancelRAF(),e(this.done,"Function")){var t,n=this.args||[];(t=this).done.apply(t,i(n))}return this.completed=!0,this._oncomplete(),this},writable:!0,enumerable:!0,configurable:!0},updateState:{value:function(e){var t=this.previousState;return t?(t=this.previousState=this.state,void(this.state={now:e,lastNow:t.now,deltaT:e-t.now,runningTime:t.runningTime,progress:t.progress})):(this.startTime=e,t={},t.now=e,t.lastNow=e,t.runningTime=0,t.deltaT=0,t.progress=0,void(this.state=this.previousState=t))},writable:!0,enumerable:!0,configurable:!0},updateProgress:{value:function(){var e=this.state;e.runningTime+=e.deltaT,this.duration&&(e.progress=Math.max(0,Math.min(1,e.runningTime/this.duration)))},writable:!0,enumerable:!0,configurable:!0},cycle:{value:function(t){var n;if(this.autonomous){var a=this.args||[],s=this.state,o=t-this.lastNow;if(this.pauseThreshold&&o>=this.pauseThreshold)return void(this.rafId=r(this.burnFrame.bind(this)));if(this.rafId=r(this.cycle.bind(this)),this.updateState(t),this.updateProgress(),e(this.before,"Function")){var u;(u=this).before.apply(u,i(a))}this.paused||this.canceled||this.completed||((n=this).render.apply(n,i(a)),this.paused||this.canceled||this.completed||1===s.progress&&this.complete())}},writable:!0,enumerable:!0,configurable:!0}}),t}(),u=["before","render","done","args","duration","paused","pauseThreshold","autonomous"],l=function(){function l(t){return this instanceof l?(t=t||{},this.animations=[],this.remaining=0,this.completed=!1,this.registry={},this.autonomous=t.autonomous||!1,this.autonomous||(this.paused=!1,this.rafId=null),void(this.pauseThreshold=e(t.pauseThreshold,"Undefined")?!1:t.pauseThreshold)):new l(t)}return a(l,null,{createAnimations:{value:function(){for(var e=this,t=arguments.length,i=Array(t),a=0;t>a;a++)i[a]=arguments[a];return 0===i.length?[]:(i=n(i),i.map(function(t){return t=e.getScrubbedOptions(t),t.autonomous=t.autonomous||e.autonomous,t.pauseThreshold=t.pauseThreshold||e.pauseThreshold,t._oncomplete=e._animationComplete.bind(e),new o(t)}))},writable:!0,enumerable:!0,configurable:!0},getScrubbedOptions:{value:function(n){var i={};if(n=e(n,"Object")?n:e(n,"Function")?{render:n}:null,e(n,"Null"))throw new Error("Options to AnimationLoop are not of a supported type.");if(t(n.render,"Function"))throw new Error("There was no render function supplied to the AnimationLoop.");return u.forEach(function(e){n.hasOwnProperty(e)&&t(n[e],"Undefined")&&(i[e]=n[e])}),i.args&&t(i.args,"Array")&&(i.args=[i.args]),i},writable:!0,enumerable:!0,configurable:!0},cancelRAF:{value:function(){s(this.rafId),this.rafId=null},writable:!0,enumerable:!0,configurable:!0},start:{value:function(){return this.animations.forEach(function(e){return e.start()}),this.autonomous||(this.cancelRAF(),this.rafId=r(this.burnFrame.bind(this)),this.paused=!1),this},writable:!0,enumerable:!0,configurable:!0},burnFrame:{value:function(e){this.autonomous||0===this.remaining||(this.updateState(e),this.animations.forEach(function(t){t.autonomous||t.paused||t.completed||t.canceled||t.updateState(e)}),this.rafId=r(this.cycle.bind(this)))},writable:!0,enumerable:!0,configurable:!0},pause:{value:function(){return this.animations.forEach(function(e){return e.pause()}),this.autonomous||(this.cancelRAF(),this.paused=!0),this},writable:!0,enumerable:!0,configurable:!0},cancel:{value:function(){return this.animations.forEach(function(e){return e.cancel()}),this.autonomous&&this.cancelRAF(),this},writable:!0,enumerable:!0,configurable:!0},_animationComplete:{value:function(){this.remaining--,0===this.remaining&&(this.completed=!0,this.autonomous||this.cancelRAF(),e(this.oncomplete,"Function")&&this.oncomplete())},writable:!0,enumerable:!0,configurable:!0},add:{value:function(){for(var e,t=arguments.length,n=Array(t),a=0;t>a;a++)n[a]=arguments[a];this.autonomous||this.paused||0!==this.remaining||this.start();var r=(e=this).createAnimations.apply(e,i(n));return this.animations=this.animations.concat(r),this.remaining+=r.length,this.completed=0===this.remaining?this.completed:!1,r},writable:!0,enumerable:!0,configurable:!0},clearCompleted:{value:function(){for(var e=this.animations,t=[],n=e.length-1;n>=0;--n){var i=e[n];(i.completed||i.canceled)&&(t=t.concat(e.splice(n,1)))}return t.reverse(),t},writable:!0,enumerable:!0,configurable:!0},addEventListener:{value:function(e,t,n){var i=this.registry[e]||(this.registry[e]=[]);i.push([t,n])},writable:!0,enumerable:!0,configurable:!0},removeEventListener:{value:function(e,t,n){var i,a=arguments.length;if(1===a)return void delete this.registry[e];i=this.registry[e]||[];for(var r=i.length-1;r>=0;--r){var s=i[r][0],o=i[r][1];s===t&&(2===a||o===n)&&i.splice(r,1)}},writable:!0,enumerable:!0,configurable:!0},trigger:{value:function(e){var t=this.registry[e]||[];t.forEach(function(e){var t=e[0],n=e[1];t.call(n)})},writable:!0,enumerable:!0,configurable:!0},oncomplete:{value:function(){this.trigger("complete")},writable:!0,enumerable:!0,configurable:!0},updateState:{value:function(e){this._lastNow=this._lastNow||e,this._deltaT=e-this._lastNow,this._lastNow=e},writable:!0,enumerable:!0,configurable:!0},cycle:{value:function(t){if(!this.autonomous&&0!==this.remaining){var n=t-this._lastNow,a=this.animations;if(this.pauseThreshold&&n>=this.pauseThreshold)return void(this.rafId=r(this.burnFrame.bind(this)));this.rafId=r(this.cycle.bind(this)),this.updateState(t),a=a.filter(function(n){if(n.autonomous||n.paused||n.canceled||n.completed)return!1;var a=n.args||[];return n.updateState(t),n.updateProgress(),e(n.before,"Function")&&n.before.apply(n,i(a)),n.autonomous||n.paused||n.canceled||n.completed?!1:!0}),a.forEach(function(e){var t=e.args||[];e.render.apply(e,i(t)),e.paused||e.canceled||e.completed||1===e.state.progress&&e.complete()})}},writable:!0,enumerable:!0,configurable:!0}}),l}();return l});<|endoftext|>


<commit_before>/**
 * Created by Wayne on 16/3/16.
 */

'use strict';

var tender = require('../controllers/tender'),
  tenderDriver = require('../controllers/tender_driver'),
  tenderPayment = require('../controllers/tender_payment'),
  userFilter = require('../../../libraries/filters/user'),
  tenderFileter = require('../../../libraries/filters/tender'),
  cardFileter = require('../../../libraries/filters/card'),
  truckFileter = require('../../../libraries/filters/truck'),

  driverFilter = require('../../../libraries/filters/driver');

module.exports = function (app) {
  app.route('/tender/create').post(userFilter.requireUser, tender.create);
  app.route('/tender/driver/getUnStartedListByDriver').post(driverFilter.requireDriver, tenderDriver.getUnStartedListByDriver);
  app.route('/tender/driver/grab').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.grab);
  app.route('/tender/driver/getStartedListByDriver').post(driverFilter.requireDriver, tenderDriver.getStartedListByDriver);
  app.route('/tender/driver/assginDriver').post(driverFilter.requireDriver, cardFileter.requireById, truckFileter.requireById, tenderFileter.requireById, tenderDriver.assginDriver);
  app.route('/tender/driver/transportevent').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.getEventByTender);
  app.route('/tender/driver/dashboard').post(driverFilter.requireDriver, tenderDriver.getDashboardData);
  app.route('/tender/driver/compare').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.compare);

  app.route('/tender/driver/updateDriverProfile').post(driverFilter.requireDriver, tenderDriver.updateDriverProfile);
  app.route('/tender/driver/getDriverProfile').post(driverFilter.requireDriver, tenderDriver.getDriverProfile);
  app.route('/tender/driver/getTenderByTenderId').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.getTenderByTenderId);

  app.route('/tender/driver/searchDrivers').post(driverFilter.requireDriver, tenderDriver.searchDrivers);
  app.route('/tender/driver/addDriversToOwner').post(driverFilter.requireDriver, driverFilter.requireDriverById, tenderDriver.addDriversToOwner);
  app.route('/tender/driver/addNewDriver').post(driverFilter.requireDriver, tenderDriver.addNewDriver);
  app.route('/tender/driver/removeDriver').post(driverFilter.requireDriver, driverFilter.requireDriverById, tenderDriver.removeDriver);

  app.route('/tender/user/getAllDrivers').post(userFilter.requireUser, tenderDriver.getAllDrivers);
  app.route('/tender/driver/updatePassword').post(driverFilter.requireDriver, tenderDriver.updatePassword);

  app.route('/tender/user/verifyDriver').post(driverFilter.requireDriverById, tenderDriver.verifyDriver);

  app.route('/tender/user/payment').post(userFilter.requireUser, tenderFileter.requireById, tenderPayment.payment);
  app.route('/tender/user/examine').post(userFilter.requireUser, tenderFileter.requireById, tenderPayment.examine);

  app.route('/tender/user/getPaymentTenderList').post(tenderPayment.getPaymentTenderList);
  app.route('/tender/user/getTenderByTenderId').post(tenderFileter.requireById, tenderDriver.getTenderByTenderId);

  app.route('/tender/user/newPayment').post(tenderFileter.requireById, tenderPayment.payment);

  app.route('/tender/user/get/list').post(userFilter.requireUser, tender.getListByUser);
  app.route('/tender/user/get/one').get(userFilter.requireUser, tender.getOneByUser);
  app.route('/tender/user/delete').get(userFilter.requireUser, tender.deleteByUser);

  app.route('/tender/record/quote/top').get(userFilter.requireUser, tender.getTopQuotedRecord);
  app.route('/tender/record/list').get(userFilter.requireUser, tender.getAllBidRecord);
  app.route('/tender/record/winner').get(userFilter.requireUser, tender.getWinnerRecord);
  app.route('/tender/apply/bidder').post(userFilter.requireUser, tender.applyBidder);
  app.route('/tender/export_tenders').get(userFilter.requireUser, tender.exportTenders);

};
<commit_msg>Clear code<commit_after>/**
 * Created by Wayne on 16/3/16.
 */

'use strict';

var tender = require('../controllers/tender'),
  tenderDriver = require('../controllers/tender_driver'),
  tenderPayment = require('../controllers/tender_payment'),
  userFilter = require('../../../libraries/filters/user'),
  tenderFileter = require('../../../libraries/filters/tender'),
  cardFileter = require('../../../libraries/filters/card'),
  truckFileter = require('../../../libraries/filters/truck'),

  driverFilter = require('../../../libraries/filters/driver');

module.exports = function (app) {
  app.route('/tender/create').post(userFilter.requireUser, tender.create);
  app.route('/tender/driver/getUnStartedListByDriver').post(driverFilter.requireDriver, tenderDriver.getUnStartedListByDriver);
  app.route('/tender/driver/grab').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.grab);
  app.route('/tender/driver/getStartedListByDriver').post(driverFilter.requireDriver, tenderDriver.getStartedListByDriver);
  app.route('/tender/driver/assginDriver').post(driverFilter.requireDriver, cardFileter.requireById, truckFileter.requireById, tenderFileter.requireById, tenderDriver.assginDriver);
  app.route('/tender/driver/transportevent').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.getEventByTender);
  app.route('/tender/driver/dashboard').post(driverFilter.requireDriver, tenderDriver.getDashboardData);
  app.route('/tender/driver/compare').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.compare);

  app.route('/tender/driver/updateDriverProfile').post(driverFilter.requireDriver, tenderDriver.updateDriverProfile);
  app.route('/tender/driver/getDriverProfile').post(driverFilter.requireDriver, tenderDriver.getDriverProfile);
  app.route('/tender/driver/getTenderByTenderId').post(driverFilter.requireDriver, tenderFileter.requireById, tenderDriver.getTenderByTenderId);

  app.route('/tender/driver/searchDrivers').post(driverFilter.requireDriver, tenderDriver.searchDrivers);
  app.route('/tender/driver/addDriversToOwner').post(driverFilter.requireDriver, driverFilter.requireDriverById, tenderDriver.addDriversToOwner);
  app.route('/tender/driver/addNewDriver').post(driverFilter.requireDriver, tenderDriver.addNewDriver);
  app.route('/tender/driver/removeDriver').post(driverFilter.requireDriver, driverFilter.requireDriverById, tenderDriver.removeDriver);
  app.route('/tender/user/getAllDrivers').post(userFilter.requireUser, tenderDriver.getAllDrivers);
  app.route('/tender/driver/updatePassword').post(driverFilter.requireDriver, tenderDriver.updatePassword);
  app.route('/tender/user/verifyDriver').post(driverFilter.requireDriverById, tenderDriver.verifyDriver);
  app.route('/tender/user/payment').post(userFilter.requireUser, tenderFileter.requireById, tenderPayment.payment);
  app.route('/tender/user/examine').post(userFilter.requireUser, tenderFileter.requireById, tenderPayment.examine);

  app.route('/tender/user/getPaymentTenderList').post(tenderPayment.getPaymentTenderList);
  app.route('/tender/user/getTenderByTenderId').post(tenderFileter.requireById, tenderDriver.getTenderByTenderId);

  app.route('/tender/user/newPayment').post(tenderFileter.requireById, tenderPayment.payment);

  app.route('/tender/user/get/list').post(userFilter.requireUser, tender.getListByUser);
  app.route('/tender/user/get/one').get(userFilter.requireUser, tender.getOneByUser);
  app.route('/tender/user/delete').get(userFilter.requireUser, tender.deleteByUser);

  app.route('/tender/record/quote/top').get(userFilter.requireUser, tender.getTopQuotedRecord);
  app.route('/tender/record/list').get(userFilter.requireUser, tender.getAllBidRecord);
  app.route('/tender/record/winner').get(userFilter.requireUser, tender.getWinnerRecord);
  app.route('/tender/apply/bidder').post(userFilter.requireUser, tender.applyBidder);
  app.route('/tender/export_tenders').get(userFilter.requireUser, tender.exportTenders);

};
<|endoftext|>


<commit_before>/*
* rwdImageMaps AngularJS Directive v1.0
*
* Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize
*
* Original Copyright (c) 2013 Matt Stow
* https://github.com/stowball/jQuery-rwdImageMaps
* http://mattstow.com
* Licensed under the MIT license
*
* angular-rwdImageMaps.js (by Philip Saa)
* https://github.com/cowglow/
* @cowglow
*/

angular.module('rwdImageMaps',[])
	.directive('rwdimgmap', function($window){
		return{
			restrict: 'CA',
			link:function(scope, element, attrs){
				var w = $(element).attr('width'),
					h = $(element).attr('height');

				function resize(){
					if (!w || !h) {
						var temp = new Image();
						temp.src = $(element).attr('src');
						if (!w)
							w = temp.width;
						if (!h)
							h = temp.height;
					}

					var wPercent = $(element).width()/100,
						hPercent = $(element).height()/100,
						map = attrs.usemap.replace('#', ''),
						c = 'coords';

					angular.element('map[name="' + map + '"]').find('area').each(function(){
						var $this = $(this);

						if (!$this.data(c)){
							$this.data(c, $this.attr(c));
						}

						var coords = $this.data(c).split(','),
							coordsPercent = new Array(coords.length);

						for (var i = 0; i<coordsPercent.length; ++i){
							if (i % 2 === 0){
								coordsPercent[i] = parseInt(((coords[i]/w)*100)*wPercent);
							} else {
								coordsPercent[i] = parseInt(((coords[i]/h)*100)*hPercent);
							};
						};
						$this.attr(c, coordsPercent.toString());
					});
				}
				angular.element($window).resize(resize).trigger('resize');
			}
		};
	});<commit_msg>Added bind to image load event so that the directive waits for the image to load before applying changes.<commit_after>/*
* rwdImageMaps AngularJS Directive v1.0
*
* Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize
*
* Original Copyright (c) 2013 Matt Stow
* https://github.com/stowball/jQuery-rwdImageMaps
* http://mattstow.com
* Licensed under the MIT license
*
* angular-rwdImageMaps.js (by Philip Saa)
* https://github.com/cowglow/
* @cowglow
*/

angular.module('rwdImageMaps',[])
	.directive('rwdimgmap', function($window){
		return{
			restrict: 'CA',
			link:function(scope, element, attrs){
				element.bind('load', function() {

					var w = $(element).attr('width'),
						h = $(element).attr('height');

					function resize(){
						if (!w || !h) {
							var temp = new Image();
							temp.src = $(element).attr('src');
							if(temp.src == undefined)
								temp.src = $(element).attr('ng-src');

							if (!w)
								w = temp.width;
							if (!h)
								h = temp.height;
						}

						var wPercent = $(element).width()/100,
							hPercent = $(element).height()/100,
							map = attrs.usemap.replace('#', ''),
							c = 'coords';

						angular.element('map[name="' + map + '"]').find('area').each(function(){
							var $this = $(this);

							if (!$this.data(c)){
								$this.data(c, $this.attr(c));
							}

							var coords = $this.data(c).split(','),
								coordsPercent = new Array(coords.length);

							for (var i = 0; i<coordsPercent.length; ++i){
								if (i % 2 === 0){
									coordsPercent[i] = parseInt(((coords[i]/w)*100)*wPercent);
								} else {
									coordsPercent[i] = parseInt(((coords[i]/h)*100)*hPercent);
								};
							};
							$this.attr(c, coordsPercent.toString());
						});
					}
					angular.element($window).resize(resize).trigger('resize');
				});
			}
		};
	});<|endoftext|>


<commit_before>"use strict";

angular.module("zj.namedRoutes", [])
    // as a non standard way to fix html5Mode
    // set this to something like :
    // .constant("NamedRoutesPrefix", "#!")
    .constant("NamedRoutesPrefix", "")
    .factory("$NamedRouteService", function($rootScope, $route, $location, $log, NamedRoutesPrefix){
        var routeService = {
            reverse: function (routeName, options) {
                    /* Step through routes,
                        pick one with matching name,
                        replace placeholders with supplied arguments,
                        return built url.
                    */
                    var routes = routeService.match(routeName);
                    if (routes.length == 1) {
                        return routeService.resolve(options, routes[0]);
                    }else if (routes.length === 0) {
                        throw new Error('Route ' + routeName + ' not found');
                    }
                    throw new Error('Multiple routes matching ' + routeName + ' were found');
                },

            match: function(routeName){
                    var routes = [];
                    angular.forEach($route.routes,function (config,route) {
                        if(config.name===routeName){
                            routes.push(route);
                        }
                    });
                    return routes;
                },
            resolve: function(options, route) {
                    var parts = route.split('/');
                    for (var i = 0; i < parts.length; i++) {
                        var part = parts[i];
                        if (part[0] === ':') {
                            parts[i] = options[part.replace(':', '')];
                            if (parts[i] === undefined) throw new Error('Attribute \'' + part + '\' was not given for route \'' + route + '\'');
                        }
                    }
                    var output = parts.join('/');
                    return NamedRoutesPrefix+output;
                }
            };

        return routeService;
    })

    .directive('namedUrl', function($log, $NamedRouteService){
            /* Given that the following route exists :
                    .when('/products/:cat/:id', {
                        controller: 'OptionalController',
                        template: '/static/javascripts/application/templates/optional-template.html',
                        name: 'item-detail'
                    })

               And that an element is present :
                 Salmon Info

                 return the following
                 Salmon Info
             */
            return {
                restrict: "AC",
                link: function(scope, element, attributes){
                    var options = {};
                    var newKey;
                    for(var key in attributes){
                        if(key.indexOf('kwarg')===0){
                            newKey = key.replace('kwarg','');
                            newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1);
                            console.log(key, newKey)
                            options[newKey] = attributes[key];
                        }
                    }
                    var url = $NamedRouteService.reverse(attributes.namedUrl, options);
                    element.attr('href', url);
                }
            };
        })

    .filter('url', function ($route, $NamedRouteService) {
            return function(input, options){
                return $NamedRouteService.reverse(input, options);
            };
        });
<commit_msg>Minification compatible definitions. Fixes #3.<commit_after>"use strict";

angular.module("zj.namedRoutes", [])
    // as a non standard way to fix html5Mode
    // set this to something like :
    // .constant("NamedRoutesPrefix", "#!")
    .constant("NamedRoutesPrefix", "")
    .factory("$NamedRouteService", ['$rootScope', '$route', '$location', '$log', 'NamedRoutesPrefix',
	     function($rootScope, $route, $location, $log, NamedRoutesPrefix){
        var routeService = {
            reverse: function (routeName, options) {
                    /* Step through routes,
                        pick one with matching name,
                        replace placeholders with supplied arguments,
                        return built url.
                    */
                    var routes = routeService.match(routeName);
                    if (routes.length == 1) {
                        return routeService.resolve(options, routes[0]);
                    }else if (routes.length === 0) {
                        throw new Error('Route ' + routeName + ' not found');
                    }
                    throw new Error('Multiple routes matching ' + routeName + ' were found');
                },

            match: function(routeName){
                    var routes = [];
                    angular.forEach($route.routes,function (config,route) {
                        if(config.name===routeName){
                            routes.push(route);
                        }
                    });
                    return routes;
                },
            resolve: function(options, route) {
                    var parts = route.split('/');
                    for (var i = 0; i < parts.length; i++) {
                        var part = parts[i];
                        if (part[0] === ':') {
                            parts[i] = options[part.replace(':', '')];
                            if (parts[i] === undefined) throw new Error('Attribute \'' + part + '\' was not given for route \'' + route + '\'');
                        }
                    }
                    var output = parts.join('/');
                    return NamedRoutesPrefix+output;
                }
            };

        return routeService;
    }])

    .directive('namedUrl', ['$log', '$NamedRouteService', function($log, $NamedRouteService){
            /* Given that the following route exists :
                    .when('/products/:cat/:id', {
                        controller: 'OptionalController',
                        template: '/static/javascripts/application/templates/optional-template.html',
                        name: 'item-detail'
                    })

               And that an element is present :
                 Salmon Info

                 return the following
                 Salmon Info
             */
            return {
                restrict: "AC",
                link: function(scope, element, attributes){
                    var options = {};
                    var newKey;
                    for(var key in attributes){
                        if(key.indexOf('kwarg')===0){
                            newKey = key.replace('kwarg','');
                            newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1);
                            console.log(key, newKey)
                            options[newKey] = attributes[key];
                        }
                    }
                    var url = $NamedRouteService.reverse(attributes.namedUrl, options);
                    element.attr('href', url);
                }
            };
        }])

    .filter('url', ['$route', '$NamedRouteService', function ($route, $NamedRouteService) {
            return function(input, options){
                return $NamedRouteService.reverse(input, options);
            };
        }]);
<|endoftext|>