<commit_before>/**
 *  Init
 */

define(['jquery'], function($) {

    'use strict';

    var Config = {
        path: {
            img: 'public/img/',                                     // path for images
            // user API
            getCaptcha: 'api/user/getCaptcha',                      // ajax URL - get captcha image
            sendInviteKey: 'api/user/sendInvite',                   // ajax URL - send registration key
            logIn: 'api/user/logIn',                                // ajax URL - login
            logOut: 'api/user/logOut',                              // ajax URL - logout
            deleteLog: 'api/user/deleteLog',                        // ajax URL - delete character log
            saveUserConfig: 'api/user/saveAccount',                 // ajax URL - saves/update user account
            saveSharingConfig: 'api/user/saveSharingConfig',        // ajax URL - save "sharing settings" dialog
            deleteAccount: 'api/user/deleteAccount',                // ajax URL - delete Account data
            // access API
            searchAccess: 'api/access/search',                      // ajax URL - search user/corporation/ally by name
            // main config/map ping API
            initMap: 'api/map/init',                                // ajax URL - get static data
            updateMapData: 'api/map/updateData',                    // ajax URL - main map update trigger
            updateUserData: 'api/map/updateUserData',               // ajax URL - main map user data trigger
            // map API
            saveMap: 'api/map/save',                                // ajax URL - save/update map
            deleteMap: 'api/map/delete',                            // ajax URL - delete map
            importMap: 'api/map/import',                            // ajax URL - import map
            // system API
            searchSystem: 'api/system/search',                      // ajax URL - search system by name
            saveSystem: 'api/system/save',                          // ajax URL - saves system to map
            deleteSystem: 'api/system/delete',                      // ajax URL - delete system from map
            getSystemGraphData: 'api/system/graphData',             // ajax URL - get all system graph data
            getConstellationData: 'api/system/constellationData',   // ajax URL - get system constellation data

            // connection API
            saveConnection: 'api/connection/save',                  // ajax URL - save new connection to map
            deleteConnection: 'api/connection/delete',              // ajax URL - delete connection from map
            // signature API
            getSignatures: 'api/signature/getAll',                  // ajax URL - get all signature data for system
            saveSignatureData: 'api/signature/save',                // ajax URL - save signature data for system
            deleteSignatureData: 'api/signature/delete',            // ajax URL - delete signature data for system
            // route API
            searchRoute: 'api/route/search',                        // ajax URL - search system routes
            // GitHub API
            gitHubReleases: 'api/github/releases'                   // ajax URL - get release info from GitHub
        },
        url: {
            ccpImageServer: 'https://image.eveonline.com/',         // CCP image Server
            zKillboard: 'https://zkillboard.com/api/'               // killboard api
        },
        animationSpeed: {
            splashOverlay: 300,                                     // "splash" loading overlay
            headerLink: 100,                                        // links in head bar
            mapOverlay: 200,                                        // show/hide duration for map overlays
            mapMoveSystem: 300,                                     // system position has changed animation
            mapDeleteSystem: 200,                                   // remove system from map
            mapModule: 200,                                         // show/hide of an map module
            dialogEvents: 180                                       // dialog events /slide/show/...
        },
        mapIcons: [                                                 // map tab-icons
            {
                class: 'fa-desktop',
                label: 'desktop',
                unicode: ''
            },{
                class: 'fa-bookmark',
                label: 'bookmark',
                unicode: ''
            },{
                class: 'fa-cube',
                label: 'cube',
                unicode: ''
            },{
                class: 'fa-plane',
                label: 'plane',
                unicode: ''
            },{
                class: 'fa-globe',
                label: 'globe',
                unicode: ''
            },{
                class: 'fa-rocket',
                label: 'rocket',
                unicode: ''
            },{
                class: 'fa-life-ring',
                label: 'life ring',
                unicode: ''
            },{
                class: 'fa-heart',
                label: 'heart',
                unicode: ''
            }
        ],

        classes: {
            // log types
            logTypes: {
                info: {
                    class: 'pf-log-info',
                    label: 'info'
                },
                warning: {
                    class: 'pf-log-warning',
                    label: 'warning'
                },
                error: {
                    class: 'pf-log-error',
                    label: 'error'
                }
            },
            // system effects
            systemEffects: {

                effect: {
                    class: 'pf-system-effect',
                    name: 'no effect'
                },
                magnetar: {
                    class: 'pf-system-effect-magnetar',
                    name: 'magnetar'
                },
                redGiant: {
                    class: 'pf-system-effect-redgiant',
                    name: 'red gaint'
                },
                pulsar: {
                    class: 'pf-system-effect-pulsar',
                    name: 'pulsar'
                },
                wolfRayet: {
                    class: 'pf-system-effect-wolfrayet',
                    name: 'wolf rayet'
                },
                cataclysmic: {
                    class: 'pf-system-effect-cataclysmic',
                    name: 'cytaclysmic'
                },
                blackHole: {
                    class: 'pf-system-effect-blackhole',
                    name: 'black hole'
                }
            },
            // system security
            systemSecurity: {
                security: {
                    class: 'pf-system-sec'
                },
                'SH': {
                    class: 'pf-system-sec-unknown'
                },
                'H': {
                     class: 'pf-system-sec-highSec'
                },
                'L': {
                    class: 'pf-system-sec-lowSec'
                },
                '0.0': {
                    class: 'pf-system-sec-nullSec'
                },
                'C6': {
                    class: 'pf-system-sec-high'
                },
                'C5': {
                    class: 'pf-system-sec-high'
                },
                'C4': {
                    class: 'pf-system-sec-mid'
                },
                'C3': {
                    class: 'pf-system-sec-mid'
                },
                'C2': {
                    class: 'pf-system-sec-low'
                },
                'C1': {
                    class: 'pf-system-sec-low'
                }
            },
            // true sec
            trueSec: {
                '0.0': {
                    class: 'pf-system-security-0-0'
                },
                '0.1': {
                    class: 'pf-system-security-0-1'
                },
                '0.2': {
                    class: 'pf-system-security-0-2'
                },
                '0.3': {
                    class: 'pf-system-security-0-3'
                },
                '0.4': {
                    class: 'pf-system-security-0-4'
                },
                '0.5': {
                    class: 'pf-system-security-0-5'
                },
                '0.6': {
                    class: 'pf-system-security-0-6'
                },
                '0.7': {
                    class: 'pf-system-security-0-7'
                },
                '0.8': {
                    class: 'pf-system-security-0-8'
                },
                '0.9': {
                    class: 'pf-system-security-0-9'
                },
                '1.0': {
                    class: 'pf-system-security-1-0'
                }
            },
            // system info
            systemInfo: {
                rally: {
                    class: 'pf-system-info-rally',
                    label: 'rally point'
                }
            },
            // easy-pie-charts
            pieChart: {
                class: 'pf-pie-chart',                              // class for all pie charts
                pieChartMapCounterClass: 'pf-pie-chart-map-timer'   // class for timer chart
            }
        },
        // map scopes
        defaultMapScope: 'wh',                                      // default scope for connection
        // map connection types
        connectionTypes: {
            jumpbridge: {
                cssClass: 'pf-map-connection-jumpbridge',
                paintStyle: {
                    dashstyle: '4 2 1 2'
                }
            },
            stargate: {
                cssClass: 'pf-map-connection-stargate',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_eol: {
                cssClass: 'pf-map-connection-wh-eol',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_fresh: {
                cssClass: 'pf-map-connection-wh-fresh',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_reduced: {
                cssClass: 'pf-map-connection-wh-reduced',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_critical: {
                cssClass: 'pf-map-connection-wh-critical',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            frigate: {
                cssClass: 'pf-map-connection-frig',
                paintStyle: {
                    dashstyle: '0.99'
                },
                overlays:[
                    [ 'Label',
                        {
                            label: 'frig',
                            cssClass: ['pf-map-connection-overlay', 'frig'].join(' ')
                        } ]
                ]
            },
            preserve_mass: {
                cssClass: 'pf-map-connection-preserve-mass',
                overlays:[
                    [ 'Label',
                        {
                            label: '<i class="fa fa-warning"></i> save mass',
                            cssClass: ['pf-map-connection-overlay', 'mass'].join(' '),
                            width:50, length:30,
                            location: 0.5
                        } ]
                ]
            }
        },
        // signature groups
        signatureGroups: {
            1: {
                name: 'combat site', //*
                label: 'Combat'
            },
            2: {
                name: 'relic site', //*
                label: 'Relic'
            },
            3: {
                name: 'data site',
                label: 'Data'
            },
            4: {
                name: 'gas site',
                label: 'Gas'
            },
            5: {
                name: 'wormhole',
                label: 'Wormhole'
            },
            6: {
                name: 'ore site',
                label: 'Ore'
            },
            7: {
                name: 'ghost',
                label: 'Ghost'
            }
        },
        // frigate wormholes
        frigateWormholes: {
            1: {    // C1

            },
            2: {    // C2
                1: 'L005 - C2',
                2: 'C008 - C5',
                3: 'Q003 - 0.0'
            },
            3: {    // C3
                1: 'E004 - C1',
                2: 'L005 - C2',
                3: 'M001 - C4'
            },
            4: {    // C4
                1: 'L005 - C2',
                2: 'G008 - C6',
                3: 'Q003 - 0.0'
            },
            5: {    // C5
                1: 'E004 - C1',
                2: 'L005 - C2',
                3: 'Z006 - C3',
                4: 'C008 - C5',
                5: 'Q003 - 0.0'
            },
            6: {    // C6
                1: 'E004 - C1',
                2: 'Z006 - C3',
                5: 'Q003 - 0.0'
            },
            13: {   // Shattered Wormholes (some of them are static)
                1: 'E004 - C1',
                2: 'L005 - C2',
                3: 'Z006 - C3',
                4: 'M001 - C4',
                5: 'C008 - C5',
                6: 'G008 - C6',
                7: 'Q003 - C7'

            }
        },
        // incoming wormholes
        incomingWormholes: {
            1: 'K162 - C1/2/3 (unknown)',
            2: 'K162 - C4/5 (dangerous)',
            3: 'K162 - C6 (deadly)'
        }

    };

    return Config;
});<commit_msg>closed #91 added new "K162" wormhole types for HS, LS and 0.0<commit_after>/**
 *  Init
 */

define(['jquery'], function($) {

    'use strict';

    var Config = {
        path: {
            img: 'public/img/',                                     // path for images
            // user API
            getCaptcha: 'api/user/getCaptcha',                      // ajax URL - get captcha image
            sendInviteKey: 'api/user/sendInvite',                   // ajax URL - send registration key
            logIn: 'api/user/logIn',                                // ajax URL - login
            logOut: 'api/user/logOut',                              // ajax URL - logout
            deleteLog: 'api/user/deleteLog',                        // ajax URL - delete character log
            saveUserConfig: 'api/user/saveAccount',                 // ajax URL - saves/update user account
            saveSharingConfig: 'api/user/saveSharingConfig',        // ajax URL - save "sharing settings" dialog
            deleteAccount: 'api/user/deleteAccount',                // ajax URL - delete Account data
            // access API
            searchAccess: 'api/access/search',                      // ajax URL - search user/corporation/ally by name
            // main config/map ping API
            initMap: 'api/map/init',                                // ajax URL - get static data
            updateMapData: 'api/map/updateData',                    // ajax URL - main map update trigger
            updateUserData: 'api/map/updateUserData',               // ajax URL - main map user data trigger
            // map API
            saveMap: 'api/map/save',                                // ajax URL - save/update map
            deleteMap: 'api/map/delete',                            // ajax URL - delete map
            importMap: 'api/map/import',                            // ajax URL - import map
            // system API
            searchSystem: 'api/system/search',                      // ajax URL - search system by name
            saveSystem: 'api/system/save',                          // ajax URL - saves system to map
            deleteSystem: 'api/system/delete',                      // ajax URL - delete system from map
            getSystemGraphData: 'api/system/graphData',             // ajax URL - get all system graph data
            getConstellationData: 'api/system/constellationData',   // ajax URL - get system constellation data

            // connection API
            saveConnection: 'api/connection/save',                  // ajax URL - save new connection to map
            deleteConnection: 'api/connection/delete',              // ajax URL - delete connection from map
            // signature API
            getSignatures: 'api/signature/getAll',                  // ajax URL - get all signature data for system
            saveSignatureData: 'api/signature/save',                // ajax URL - save signature data for system
            deleteSignatureData: 'api/signature/delete',            // ajax URL - delete signature data for system
            // route API
            searchRoute: 'api/route/search',                        // ajax URL - search system routes
            // GitHub API
            gitHubReleases: 'api/github/releases'                   // ajax URL - get release info from GitHub
        },
        url: {
            ccpImageServer: 'https://image.eveonline.com/',         // CCP image Server
            zKillboard: 'https://zkillboard.com/api/'               // killboard api
        },
        animationSpeed: {
            splashOverlay: 300,                                     // "splash" loading overlay
            headerLink: 100,                                        // links in head bar
            mapOverlay: 200,                                        // show/hide duration for map overlays
            mapMoveSystem: 300,                                     // system position has changed animation
            mapDeleteSystem: 200,                                   // remove system from map
            mapModule: 200,                                         // show/hide of an map module
            dialogEvents: 180                                       // dialog events /slide/show/...
        },
        mapIcons: [                                                 // map tab-icons
            {
                class: 'fa-desktop',
                label: 'desktop',
                unicode: ''
            },{
                class: 'fa-bookmark',
                label: 'bookmark',
                unicode: ''
            },{
                class: 'fa-cube',
                label: 'cube',
                unicode: ''
            },{
                class: 'fa-plane',
                label: 'plane',
                unicode: ''
            },{
                class: 'fa-globe',
                label: 'globe',
                unicode: ''
            },{
                class: 'fa-rocket',
                label: 'rocket',
                unicode: ''
            },{
                class: 'fa-life-ring',
                label: 'life ring',
                unicode: ''
            },{
                class: 'fa-heart',
                label: 'heart',
                unicode: ''
            }
        ],

        classes: {
            // log types
            logTypes: {
                info: {
                    class: 'pf-log-info',
                    label: 'info'
                },
                warning: {
                    class: 'pf-log-warning',
                    label: 'warning'
                },
                error: {
                    class: 'pf-log-error',
                    label: 'error'
                }
            },
            // system effects
            systemEffects: {

                effect: {
                    class: 'pf-system-effect',
                    name: 'no effect'
                },
                magnetar: {
                    class: 'pf-system-effect-magnetar',
                    name: 'magnetar'
                },
                redGiant: {
                    class: 'pf-system-effect-redgiant',
                    name: 'red gaint'
                },
                pulsar: {
                    class: 'pf-system-effect-pulsar',
                    name: 'pulsar'
                },
                wolfRayet: {
                    class: 'pf-system-effect-wolfrayet',
                    name: 'wolf rayet'
                },
                cataclysmic: {
                    class: 'pf-system-effect-cataclysmic',
                    name: 'cytaclysmic'
                },
                blackHole: {
                    class: 'pf-system-effect-blackhole',
                    name: 'black hole'
                }
            },
            // system security
            systemSecurity: {
                security: {
                    class: 'pf-system-sec'
                },
                'SH': {
                    class: 'pf-system-sec-unknown'
                },
                'H': {
                     class: 'pf-system-sec-highSec'
                },
                'L': {
                    class: 'pf-system-sec-lowSec'
                },
                '0.0': {
                    class: 'pf-system-sec-nullSec'
                },
                'C6': {
                    class: 'pf-system-sec-high'
                },
                'C5': {
                    class: 'pf-system-sec-high'
                },
                'C4': {
                    class: 'pf-system-sec-mid'
                },
                'C3': {
                    class: 'pf-system-sec-mid'
                },
                'C2': {
                    class: 'pf-system-sec-low'
                },
                'C1': {
                    class: 'pf-system-sec-low'
                }
            },
            // true sec
            trueSec: {
                '0.0': {
                    class: 'pf-system-security-0-0'
                },
                '0.1': {
                    class: 'pf-system-security-0-1'
                },
                '0.2': {
                    class: 'pf-system-security-0-2'
                },
                '0.3': {
                    class: 'pf-system-security-0-3'
                },
                '0.4': {
                    class: 'pf-system-security-0-4'
                },
                '0.5': {
                    class: 'pf-system-security-0-5'
                },
                '0.6': {
                    class: 'pf-system-security-0-6'
                },
                '0.7': {
                    class: 'pf-system-security-0-7'
                },
                '0.8': {
                    class: 'pf-system-security-0-8'
                },
                '0.9': {
                    class: 'pf-system-security-0-9'
                },
                '1.0': {
                    class: 'pf-system-security-1-0'
                }
            },
            // system info
            systemInfo: {
                rally: {
                    class: 'pf-system-info-rally',
                    label: 'rally point'
                }
            },
            // easy-pie-charts
            pieChart: {
                class: 'pf-pie-chart',                              // class for all pie charts
                pieChartMapCounterClass: 'pf-pie-chart-map-timer'   // class for timer chart
            }
        },
        // map scopes
        defaultMapScope: 'wh',                                      // default scope for connection
        // map connection types
        connectionTypes: {
            jumpbridge: {
                cssClass: 'pf-map-connection-jumpbridge',
                paintStyle: {
                    dashstyle: '4 2 1 2'
                }
            },
            stargate: {
                cssClass: 'pf-map-connection-stargate',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_eol: {
                cssClass: 'pf-map-connection-wh-eol',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_fresh: {
                cssClass: 'pf-map-connection-wh-fresh',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_reduced: {
                cssClass: 'pf-map-connection-wh-reduced',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            wh_critical: {
                cssClass: 'pf-map-connection-wh-critical',
                paintStyle: {
                    dashstyle: '0' // solid line
                }
            },
            frigate: {
                cssClass: 'pf-map-connection-frig',
                paintStyle: {
                    dashstyle: '0.99'
                },
                overlays:[
                    [ 'Label',
                        {
                            label: 'frig',
                            cssClass: ['pf-map-connection-overlay', 'frig'].join(' ')
                        } ]
                ]
            },
            preserve_mass: {
                cssClass: 'pf-map-connection-preserve-mass',
                overlays:[
                    [ 'Label',
                        {
                            label: '<i class="fa fa-warning"></i> save mass',
                            cssClass: ['pf-map-connection-overlay', 'mass'].join(' '),
                            width:50, length:30,
                            location: 0.5
                        } ]
                ]
            }
        },
        // signature groups
        signatureGroups: {
            1: {
                name: 'combat site', //*
                label: 'Combat'
            },
            2: {
                name: 'relic site', //*
                label: 'Relic'
            },
            3: {
                name: 'data site',
                label: 'Data'
            },
            4: {
                name: 'gas site',
                label: 'Gas'
            },
            5: {
                name: 'wormhole',
                label: 'Wormhole'
            },
            6: {
                name: 'ore site',
                label: 'Ore'
            },
            7: {
                name: 'ghost',
                label: 'Ghost'
            }
        },
        // frigate wormholes
        frigateWormholes: {
            1: {    // C1

            },
            2: {    // C2
                1: 'L005 - C2',
                2: 'C008 - C5',
                3: 'Q003 - 0.0'
            },
            3: {    // C3
                1: 'E004 - C1',
                2: 'L005 - C2',
                3: 'M001 - C4'
            },
            4: {    // C4
                1: 'L005 - C2',
                2: 'G008 - C6',
                3: 'Q003 - 0.0'
            },
            5: {    // C5
                1: 'E004 - C1',
                2: 'L005 - C2',
                3: 'Z006 - C3',
                4: 'C008 - C5',
                5: 'Q003 - 0.0'
            },
            6: {    // C6
                1: 'E004 - C1',
                2: 'Z006 - C3',
                5: 'Q003 - 0.0'
            },
            13: {   // Shattered Wormholes (some of them are static)
                1: 'E004 - C1',
                2: 'L005 - C2',
                3: 'Z006 - C3',
                4: 'M001 - C4',
                5: 'C008 - C5',
                6: 'G008 - C6',
                7: 'Q003 - C7'

            }
        },
        // incoming wormholes
        incomingWormholes: {
            1: 'K162 - C1/2/3 (unknown)',
            2: 'K162 - C4/5 (dangerous)',
            3: 'K162 - C6 (deadly)',
            4: 'K162 - HS',
            5: 'K162 - LS',
            6: 'K162 - 0.0'
        }

    };

    return Config;
});<|endoftext|>


<commit_before>var util = require('util'),
    webutil = require('../util/web'),
    Tab = require('../client/tab').Tab,
    Currency = ripple.Currency;

var AdvancedTab = function ()
{
  Tab.call(this);
};

util.inherits(AdvancedTab, Tab);

AdvancedTab.prototype.tabName = 'advanced';
AdvancedTab.prototype.mainMenu = 'advanced';

AdvancedTab.prototype.generateHtml = function ()
{
  return require('../../jade/tabs/advanced.jade')();
};

AdvancedTab.prototype.angular = function(module)
{
  module.controller('AdvancedCtrl', ['$scope', 'rpId', 'rpKeychain',
                                    function ($scope, $id, $keychain)
  {
    // XRP currency object.
    // {name: "XRP - Ripples", order: 146, value: "XRP"}
    var xrpCurrency = Currency.from_json("XRP");

    $scope.xrp = {
      name: xrpCurrency.to_human({full_name:$scope.currencies_all_keyed.XRP.name}),
      code: xrpCurrency.get_iso(),
      currency: xrpCurrency
    };

    $scope.options = Options;
    $scope.optionsBackup = $.extend(true, {}, Options);
    $scope.passwordProtection = !$scope.userBlob.data.persistUnlock;
    $scope.editBridge = false;
    $scope.editBlob = false;
    $scope.editMaxNetworkFee = false;
    $scope.editAcctOptions = false;
    $scope.max_tx_network_fee_human = ripple.Amount.from_json($scope.options.max_tx_network_fee).to_human();
    $scope.advancedFeatureSwitchChanged = false;

    // Initialize the notification object
    $scope.success = {};

    $scope.saveBlob = function () {
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editBlob = false;

      // Reload
      location.reload();

      // Notify the user
      $scope.success.saveBlob = true;
    };

    $scope.saveBridge = function () {
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editBridge = false;

      // Reload
      location.reload();

      // Notify the user
      $scope.success.saveBridge = true;
    };

    $scope.saveMaxNetworkFee = function () {
      // Save in local storage
      if (!store.disabled) {
        $scope.options.max_tx_network_fee = ripple.Amount.from_human($scope.max_tx_network_fee_human).to_json();
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editMaxNetworkFee = false;

      // Reload
      location.reload();

      // Notify the user
      $scope.success.saveMaxNetworkFee = true;
    };

    $scope.saveAcctOptions = function () {
      //ignore it if we are not going to change anything
      if (!$scope.advancedFeatureSwitchChanged) {
        return;
      }
      $scope.advancedFeatureSwitchChanged = false;

      if (!store.disabled) {
        // Save in local storage
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editAcctOptions = false;

      // Reload
      location.reload();

      // Notify the user
      $scope.success.saveAcctOptions = true;
    };

    $scope.deleteBlob = function () {
      $scope.options.blobvault = "";
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }
    };

    $scope.deleteBridge = function () {
      $scope.options.bridge.out.bitcoin = "";
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }
    };

    $scope.cancelEditBlob = function () {
      $scope.editBlob = false;
      $scope.options.blobvault = $scope.optionsBackup.blobvault;
    };

    $scope.cancelEditBridge = function () {
      $scope.editBridge = false;
      $scope.options.bridge.out.bitcoin = $scope.optionsBackup.bridge.out.bitcoin;
    };

    $scope.cancelEditMaxNetworkFee = function () {
      $scope.editMaxNetworkFee = false;
      $scope.options.max_tx_network_fee = $scope.optionsBackup.max_tx_network_fee;
      $scope.max_tx_network_fee_human = ripple.Amount.from_json($scope.options.max_tx_network_fee).to_human();
    };

    $scope.cancelEditAcctOptions = function () {
      $scope.editAcctOptions = false;
      $scope.options.advanced_feature_switch = $scope.optionsBackup.advanced_feature_switch;
    };

    $scope.$on('$blobUpdate', function () {
      $scope.passwordProtection = !$scope.userBlob.data.persistUnlock;
    });

    // Add a new server
    $scope.addServer = function () {
      // Create a new server line
      if(!$scope.options.server.servers.isEmptyServer)
        $scope.options.server.servers.push({isEmptyServer: true, secure: false});

      // Set editing to true
      $scope.editing = true;

      // Notify the user on save later
      $scope.success.addServer = true;
    };

  }]);

  module.controller('ServerRowCtrl', ['$scope',
    function ($scope) {
      $scope.editing = $scope.server.isEmptyServer;

      // Delete the server
      $scope.remove = function () {
        $scope.options.server.servers.splice($scope.index,1);

        // Save in local storage
        if (!store.disabled) {
          store.set('ripple_settings', JSON.stringify($scope.options));
        }

        // Notify the user
        $scope.success.removeServer = true;
      };

      $scope.hasRemove = function () {
        return !$scope.server.isEmptyServer && $scope.options.server.servers.length !== 1;
      };

      $scope.cancel = function () {
        if ($scope.server.isEmptyServer) {
          $scope.remove();
          return;
        }

        $scope.editing = false;
        $scope.server = $.extend({}, $scope.optionsBackup.server.servers[$scope.index]);

      };

      $scope.noCancel = function () {
        return $scope.server.isEmptyServer && $scope.options.server.servers.length === 1;
      };

      $scope.save = function () {
        $scope.server.isEmptyServer = false;
        $scope.editing = false;

        // Save in local storage
        if (!store.disabled) {
          store.set('ripple_settings', JSON.stringify($scope.options));
        }

        // Reload
        location.reload();

        // Notify the user
        $scope.success.saveServer = true;
      };
    }
  ]);
};

module.exports = AdvancedTab;
<commit_msg>[TASK] settings: Remove the need for some of the browser force reload<commit_after>var util = require('util'),
    webutil = require('../util/web'),
    Tab = require('../client/tab').Tab,
    Currency = ripple.Currency;

var AdvancedTab = function ()
{
  Tab.call(this);
};

util.inherits(AdvancedTab, Tab);

AdvancedTab.prototype.tabName = 'advanced';
AdvancedTab.prototype.mainMenu = 'advanced';

AdvancedTab.prototype.generateHtml = function ()
{
  return require('../../jade/tabs/advanced.jade')();
};

AdvancedTab.prototype.angular = function(module)
{
  module.controller('AdvancedCtrl', ['$scope', 'rpId', 'rpKeychain', 'rpNetwork',
                                    function ($scope, $id, $keychain, $network)
  {
    // XRP currency object.
    // {name: "XRP - Ripples", order: 146, value: "XRP"}
    var xrpCurrency = Currency.from_json("XRP");

    $scope.xrp = {
      name: xrpCurrency.to_human({full_name:$scope.currencies_all_keyed.XRP.name}),
      code: xrpCurrency.get_iso(),
      currency: xrpCurrency
    };

    $scope.options = Options;
    $scope.optionsBackup = $.extend(true, {}, Options);
    $scope.passwordProtection = !$scope.userBlob.data.persistUnlock;
    $scope.editBridge = false;
    $scope.editBlob = false;
    $scope.editMaxNetworkFee = false;
    $scope.editAcctOptions = false;
    $scope.max_tx_network_fee_human = ripple.Amount.from_json($scope.options.max_tx_network_fee).to_human();
    $scope.advancedFeatureSwitchChanged = false;

    // Initialize the notification object
    $scope.success = {};

    $scope.saveBlob = function () {
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editBlob = false;

      // Reload
      location.reload();

      // Notify the user
      $scope.success.saveBlob = true;
    };

    $scope.saveBridge = function () {
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editBridge = false;

      // Notify the user
      $scope.success.saveBridge = true;
    };

    $scope.saveMaxNetworkFee = function () {
      // Save in local storage
      if (!store.disabled) {
        $scope.options.max_tx_network_fee = ripple.Amount.from_human($scope.max_tx_network_fee_human).to_json();
        store.set('ripple_settings', JSON.stringify($scope.options));
      }
      // This has to be updated manually because the network object is not
      // recreated unless we do location.reload()
      $network.remote.max_fee = $scope.options.max_tx_network_fee;

      $scope.editMaxNetworkFee = false;

      // Notify the user
      $scope.success.saveMaxNetworkFee = true;
    };

    $scope.saveAcctOptions = function () {
      //ignore it if we are not going to change anything
      if (!$scope.advancedFeatureSwitchChanged) {
        return;
      }
      $scope.advancedFeatureSwitchChanged = false;

      if (!store.disabled) {
        // Save in local storage
        store.set('ripple_settings', JSON.stringify($scope.options));
      }

      $scope.editAcctOptions = false;

      // Notify the user
      $scope.success.saveAcctOptions = true;
    };

    $scope.deleteBlob = function () {
      $scope.options.blobvault = "";
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }
    };

    $scope.deleteBridge = function () {
      $scope.options.bridge.out.bitcoin = "";
      // Save in local storage
      if (!store.disabled) {
        store.set('ripple_settings', JSON.stringify($scope.options));
      }
    };

    $scope.cancelEditBlob = function () {
      $scope.editBlob = false;
      $scope.options.blobvault = $scope.optionsBackup.blobvault;
    };

    $scope.cancelEditBridge = function () {
      $scope.editBridge = false;
      $scope.options.bridge.out.bitcoin = $scope.optionsBackup.bridge.out.bitcoin;
    };

    $scope.cancelEditMaxNetworkFee = function () {
      $scope.editMaxNetworkFee = false;
      $scope.options.max_tx_network_fee = $scope.optionsBackup.max_tx_network_fee;
      $scope.max_tx_network_fee_human = ripple.Amount.from_json($scope.options.max_tx_network_fee).to_human();
    };

    $scope.cancelEditAcctOptions = function () {
      $scope.editAcctOptions = false;
      $scope.options.advanced_feature_switch = $scope.optionsBackup.advanced_feature_switch;
    };

    $scope.$on('$blobUpdate', function () {
      $scope.passwordProtection = !$scope.userBlob.data.persistUnlock;
    });

    // Add a new server
    $scope.addServer = function () {
      // Create a new server line
      if(!$scope.options.server.servers.isEmptyServer)
        $scope.options.server.servers.push({isEmptyServer: true, secure: false});

      // Set editing to true
      $scope.editing = true;

      // Notify the user on save later
      $scope.success.addServer = true;
    };

  }]);

  module.controller('ServerRowCtrl', ['$scope',
    function ($scope) {
      $scope.editing = $scope.server.isEmptyServer;

      // Delete the server
      $scope.remove = function () {
        $scope.options.server.servers.splice($scope.index,1);

        // Save in local storage
        if (!store.disabled) {
          store.set('ripple_settings', JSON.stringify($scope.options));
        }

        // Notify the user
        $scope.success.removeServer = true;
      };

      $scope.hasRemove = function () {
        return !$scope.server.isEmptyServer && $scope.options.server.servers.length !== 1;
      };

      $scope.cancel = function () {
        if ($scope.server.isEmptyServer) {
          $scope.remove();
          return;
        }

        $scope.editing = false;
        $scope.server = $.extend({}, $scope.optionsBackup.server.servers[$scope.index]);

      };

      $scope.noCancel = function () {
        return $scope.server.isEmptyServer && $scope.options.server.servers.length === 1;
      };

      $scope.save = function () {
        $scope.server.isEmptyServer = false;
        $scope.editing = false;

        // Save in local storage
        if (!store.disabled) {
          store.set('ripple_settings', JSON.stringify($scope.options));
        }

        // Notify the user
        $scope.success.saveServer = true;

        // Reload
        // A force reload is necessary here because we have to re-initialize
        // the network object with the new server list.
        location.reload();
      };
    }
  ]);
};

module.exports = AdvancedTab;
<|endoftext|>


<commit_before>$(function() {
	$.ajaxSetup({ cache: true });
	$.getScript('//connect.facebook.net/en_US/all.js', function(){
		FB.init({
		  appId: '509825915758193',
		  channelUrl: '//http://crowdbuy.sapuan.org/channel.html',
		});

		$('#loginbutton,#feedbutton').removeAttr('disabled');

		FB.getLoginStatus(authenticationCallback);
	});
});

function authenticationCallback(response) {
	if (response.status === 'connected') {
		// Handle authentication here.
        setUpBackbone();
	} else {
		alert("Whoa, something went wrong! Try refreshing this page.");
	}
}

function setUpBackbone() {
    searchCollection = new Models.SearchResults();

	yourCollection = new Models.Wants();
	friendCollection = new Models.Wants();
	featuredCollection = new Models.Wants();
	publicCollection = new Models.Wants();

    searchFormView = new Views.SearchFormView({
        el: document.getElementById('search-section'),
        id: "search"
    });

    /*searchListingView = new Views.SearchListingView({
        collection: searchCollection,
        el: document.getElementById('search-results'),
        id: "search-results"
    });*/

	yourView = new Views.ListingView({
		collection: yourCollection,
		el: document.getElementById('you-section'),
		id: "you"
	});

	friendView = new Views.ListingView({
		collection: friendCollection,
		el: document.getElementById('friend-section'),
		id: "friend"
	});

	featuredView = new Views.ListingView({
		collection: featuredCollection,
		el: document.getElementById('featured-section'),
		id: "featured"
	});

	publicView = new Views.ListingView({
		collection: publicCollection,
		el: document.getElementById('public-section'),
		id: "public"
	});

	yourCollection.fetch({ data: $.param({ type:'you' }) });
    friendCollection.fetch({ data: $.param({ type:'friend' }) });
    featuredCollection.fetch({ data: $.param({ type:'featured' }) });
    publicCollection.fetch({ data: $.param({ type:'public' }) });

	FB.api('/me', function(response) {
		$('#welcome').html('Welcome, ' + response.name + '!');
	});
}<commit_msg>called render in searchFormView<commit_after>$(function() {
	$.ajaxSetup({ cache: true });
	$.getScript('//connect.facebook.net/en_US/all.js', function(){
		FB.init({
		  appId: '509825915758193',
		  channelUrl: '//http://crowdbuy.sapuan.org/channel.html',
		});

		$('#loginbutton,#feedbutton').removeAttr('disabled');

		FB.getLoginStatus(authenticationCallback);
	});
});

function authenticationCallback(response) {
	if (response.status === 'connected') {
		// Handle authentication here.
        setUpBackbone();
	} else {
		alert("Whoa, something went wrong! Try refreshing this page.");
	}
}

function setUpBackbone() {
    searchCollection = new Models.SearchResults();

	yourCollection = new Models.Wants();
	friendCollection = new Models.Wants();
	featuredCollection = new Models.Wants();
	publicCollection = new Models.Wants();

    searchFormView = new Views.SearchFormView({
        el: document.getElementById('search-section'),
        id: "search-section"
    });
    searchFormView.render();

    searchListingView = new Views.SearchListingView({
        collection: searchCollection,
        el: document.getElementById('search-results'),
        id: "search-results"
    });

	yourView = new Views.ListingView({
		collection: yourCollection,
		el: document.getElementById('you-section'),
		id: "you"
	});

	friendView = new Views.ListingView({
		collection: friendCollection,
		el: document.getElementById('friend-section'),
		id: "friend"
	});

	featuredView = new Views.ListingView({
		collection: featuredCollection,
		el: document.getElementById('featured-section'),
		id: "featured"
	});

	publicView = new Views.ListingView({
		collection: publicCollection,
		el: document.getElementById('public-section'),
		id: "public"
	});

	yourCollection.fetch({ data: $.param({ type:'you' }) });
    friendCollection.fetch({ data: $.param({ type:'friend' }) });
    featuredCollection.fetch({ data: $.param({ type:'featured' }) });
    publicCollection.fetch({ data: $.param({ type:'public' }) });

	FB.api('/me', function(response) {
		$('#welcome').html('Welcome, ' + response.name + '!');
	});
}<|endoftext|>


<commit_before>/*jslint browser: true*/

define(["jquery", "app/commands", "jquery.mousewheel", "jquery.terminal"], function ($, commands) {
    "use strict";

    /*
    | Constant variables
    */
    var greetingMsg = $('#greeting').html() +
        "\nType 'help' to list available commands\n";

    /*
    | Helper functions
    */

    function printUsage(command, term) {
        term.echo('Usage: ' + command.usage + '\n' + command.description + '\n');
    }

    /*
    | Initialize the terminal
    */
    $('#terminal').terminal(function (input, term) {
        var split   = input.split(" "),
            args    = split.slice(1),
            command;

        if (input !== '') {
            command = commands[split[0]];

            if (command) {
                if (command.args === undefined || command.args === args.length) {
                    command.callback(args, term);
                } else {
                    printUsage(command, term);
                }
            } else {
                term.echo(split[0] + ': command not found\n');
            }
        }
    }, {
        width: '800px',
        height: '100%',
        prompt: '> ',
        greetings: greetingMsg
    });
});<commit_msg>Removed 'clear' and 'exit' commands<commit_after>/*jslint browser: true*/

define(["jquery", "app/commands", "jquery.mousewheel", "jquery.terminal"], function ($, commands) {
    "use strict";

    /*
    | Constant variables
    */
    var greetingMsg = $('#greeting').html() +
        "\nType 'help' to list available commands\n";

    /*
    | Helper functions
    */

    function printUsage(command, term) {
        term.echo('Usage: ' + command.usage + '\n' + command.description + '\n');
    }

    /*
    | Initialize the terminal
    */
    $('#terminal').terminal(function (input, term) {
        var split   = input.split(" "),
            args    = split.slice(1),
            command;

        if (input !== '') {
            command = commands[split[0]];

            if (command) {
                if (command.args === undefined || command.args === args.length) {
                    command.callback(args, term);
                } else {
                    printUsage(command, term);
                }
            } else {
                term.echo(split[0] + ': command not found\n');
            }
        }
    }, {
        width: '800px',
        height: '100%',
        prompt: '> ',
        greetings: greetingMsg,
        exit: false,
        clear: false
    });
});<|endoftext|>


<commit_before>/*
 * Rapid Interface Builder (RIB) - A simple WYSIWYG HTML5 app creator
 * Copyright (c) 2011-2012, Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 */
"use strict";

// Palette view widget

(function($, undefined) {

    $.widget('rib.paletteView', {

        options: {
            model: null,
        },

        _create: function() {
            var o = this.options,
                e = this.element;

            this.refresh(null, this);

            return this;
        },

        _setOption: function(key, value) {
            switch (key) {
                case 'model':
                    this.options.model = value;
                    this.refresh(null, this);
                    break;
                default:
                    break;
            }
        },

        destroy: function() {
            // TODO: unbind any ADM event handlers
            $(this.element).find('.'+this.widgetName).remove();
            this.options.primaryTools.remove();
            this.options.secondaryTools.remove();
        },

        refresh: function(event, widget) {
            var listWidgets, columns;

            widget = widget || this;

            listWidgets = function (container, group) {
                $.each(group, function (i, value) {
                    if (value && typeof value === "string") {
                        if (BWidget.isPaletteWidget(value)) {
                            var li = $('')
                                .attr("src", "src/css/images/widgets/" +
                                             BWidget.getPaletteImageName(value))
                                .appendTo(container);
                            $(li).disableSelection()
                                .addClass('nrc-palette-widget')
                                .data("adm-node", {type: value});
                        }
                    }
                    else if (value)
                        listWidgets(container, value);
                });
            };

            if (widget.options && widget.options.model) {
                this.element.empty();
                this.element.append('
');
                listWidgets((this.element.find('.columns')), this.options.model);
                var w = this.element.find('.nrc-palette-widget');

                w.draggable({
                    scroll: false,
                    revert: false,
                    appendTo: 'body',
                    iframeFix: true,
                    containment: false,
                    connectToSortable: $(':rib-layoutView')
                                       .layoutView('option', 'contentDocument')
                                       .find('.ui-page-active'),
                    helper: 'clone',
                    refreshPositions: true,
                    stack: '.layoutView iframe',
                    revertDuration: 0,
                    filter: function() { return $.rib.dndfilter($(this)); },
                    start: function(event,ui){
                        var d = $(this).draggable('option','connectToSortable'),
                            f = $(':rib-layoutView')
                                    .layoutView('option','contentDocument'),
                            s = [], id;

                        if (ui.helper) {
                            if (ui.helper[0].id == "") {
                                ui.helper[0].id = this.id+'-helper';
                            }
                        }

                        // Must have an active page in order to filter
                        if (!ADM.getActivePage()) {
                            console.warning('Filter failure: No active page.');
                            return s;
                        } else {
                            id = ADM.getActivePage().getProperty('id');
                        }

                        // Find all adm-nodes (and page) on the active page
                        f = f.find('#'+id);
                        s = f.find('.adm-node').andSelf();

                        // First mark all nodes as blocked
                        s && s.addClass('ui-masked');

                        // Then unmark all valid targets
                        d && d.removeClass('ui-masked')
                              .addClass('ui-unmasked');

                        // Also unmark adm-node descendants of valid targets
                        // that are not also children of a masked container
                        // - Solves styling issues with nested containers
                        $('.ui-unmasked',f).each(function() {
                            var that = this, nodes;
                            $('.adm-node',this)
                                .not('.nrc-sortable-container')
                                .each(function() {
                                    var rents = $(this).parentsUntil(that,
                                          '.nrc-sortable-container.ui-masked');
                                    if (!rents.length) {
                                        $(this).removeClass('ui-masked')
                                               .addClass('ui-unmasked');
                                    }
                                });
                        });
                    },
                    stop: function(event,ui){
                        var f = $(':rib-layoutView')
                                    .layoutView('option','contentDocument');
                        f = f.find('#'+ADM.getActivePage().getProperty('id'));

                        // Reset masked states on all nodes on the active page
                        f.find('.ui-masked, .ui-unmasked')
                            .andSelf()
                            .removeClass('ui-masked ui-unmasked');

                        // Reset active state on all nodes on the active page
                        // - Fixes a glitch where ui-state-active sometimes
                        //   remains after dragging has completed...
                        f.find('.ui-state-active')
                            .removeClass('ui-state-active');
                    },
                })
                .disableSelection();
            }
        },
        resize: function(event, widget) {
            var headerHeight = 30, resizeBarHeight = 20, used, e;
            e = this.element;

            // allocate 70% of the remaining space for the palette
            used = 2 * headerHeight + resizeBarHeight;
            e.height(Math.round((e.parent().height() - used) * 0.7));
        },

    });
})(jQuery);
<commit_msg>[Palette View] Fix the problem that SVG font not loaded.<commit_after>/*
 * Rapid Interface Builder (RIB) - A simple WYSIWYG HTML5 app creator
 * Copyright (c) 2011-2012, Intel Corporation.
 *
 * This program is licensed under the terms and conditions of the
 * Apache License, version 2.0.  The full text of the Apache License is at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 */
"use strict";

// Palette view widget

(function($, undefined) {

    $.widget('rib.paletteView', {

        options: {
            model: null,
        },

        _create: function() {
            var o = this.options,
                e = this.element;

            this.refresh(null, this);

            return this;
        },

        _setOption: function(key, value) {
            switch (key) {
                case 'model':
                    this.options.model = value;
                    this.refresh(null, this);
                    break;
                default:
                    break;
            }
        },

        destroy: function() {
            // TODO: unbind any ADM event handlers
            $(this.element).find('.'+this.widgetName).remove();
            this.options.primaryTools.remove();
            this.options.secondaryTools.remove();
        },

        refresh: function(event, widget) {
            var listWidgets, columns, generateWidget;

            widget = widget || this;

            generateWidget = function (container, name) {
                var reg = new RegExp("src:\\s*url\\s*\\('../../"),
                    li = $('')
                        .appendTo(container);
                $.get("src/css/images/widgets/" +
                        BWidget.getPaletteImageName(name), function (data) {
                    li.attr('src','data:image/svg+xml;utf8,'
                        + new XMLSerializer().serializeToString(data)
                            .replace(reg, "src: url('" + location.protocol
                                + "//" + location.host + "/" + location.pathname
                                + "/src/css/")
                    );
                });
                $(li).disableSelection()
                    .addClass('nrc-palette-widget')
                    .data("adm-node", {type: name});
            };
            listWidgets = function (container, group) {
                $.each(group, function (i, value) {
                    if (value && typeof value === "string") {
                        if (BWidget.isPaletteWidget(value)) {
                            generateWidget(container, value);
                        }
                    }
                    else if (value)
                        listWidgets(container, value);
                });
            };

            if (widget.options && widget.options.model) {
                this.element.empty();
                this.element.append('
');
                listWidgets((this.element.find('.columns')), this.options.model);
                var w = this.element.find('.nrc-palette-widget');

                w.draggable({
                    scroll: false,
                    revert: false,
                    appendTo: 'body',
                    iframeFix: true,
                    containment: false,
                    connectToSortable: $(':rib-layoutView')
                                       .layoutView('option', 'contentDocument')
                                       .find('.ui-page-active'),
                    helper: 'clone',
                    refreshPositions: true,
                    stack: '.layoutView iframe',
                    revertDuration: 0,
                    filter: function() { return $.rib.dndfilter($(this)); },
                    start: function(event,ui){
                        var d = $(this).draggable('option','connectToSortable'),
                            f = $(':rib-layoutView')
                                    .layoutView('option','contentDocument'),
                            s = [], id;

                        if (ui.helper) {
                            if (ui.helper[0].id == "") {
                                ui.helper[0].id = this.id+'-helper';
                            }
                        }

                        // Must have an active page in order to filter
                        if (!ADM.getActivePage()) {
                            console.warning('Filter failure: No active page.');
                            return s;
                        } else {
                            id = ADM.getActivePage().getProperty('id');
                        }

                        // Find all adm-nodes (and page) on the active page
                        f = f.find('#'+id);
                        s = f.find('.adm-node').andSelf();

                        // First mark all nodes as blocked
                        s && s.addClass('ui-masked');

                        // Then unmark all valid targets
                        d && d.removeClass('ui-masked')
                              .addClass('ui-unmasked');

                        // Also unmark adm-node descendants of valid targets
                        // that are not also children of a masked container
                        // - Solves styling issues with nested containers
                        $('.ui-unmasked',f).each(function() {
                            var that = this, nodes;
                            $('.adm-node',this)
                                .not('.nrc-sortable-container')
                                .each(function() {
                                    var rents = $(this).parentsUntil(that,
                                          '.nrc-sortable-container.ui-masked');
                                    if (!rents.length) {
                                        $(this).removeClass('ui-masked')
                                               .addClass('ui-unmasked');
                                    }
                                });
                        });
                    },
                    stop: function(event,ui){
                        var f = $(':rib-layoutView')
                                    .layoutView('option','contentDocument');
                        f = f.find('#'+ADM.getActivePage().getProperty('id'));

                        // Reset masked states on all nodes on the active page
                        f.find('.ui-masked, .ui-unmasked')
                            .andSelf()
                            .removeClass('ui-masked ui-unmasked');

                        // Reset active state on all nodes on the active page
                        // - Fixes a glitch where ui-state-active sometimes
                        //   remains after dragging has completed...
                        f.find('.ui-state-active')
                            .removeClass('ui-state-active');
                    },
                })
                .disableSelection();
            }
        },
        resize: function(event, widget) {
            var headerHeight = 30, resizeBarHeight = 20, used, e;
            e = this.element;

            // allocate 70% of the remaining space for the palette
            used = 2 * headerHeight + resizeBarHeight;
            e.height(Math.round((e.parent().height() - used) * 0.7));
        },

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


<commit_before>( function(){
    var autoload = {

        /***************************
         * DatePicker - Default CSS selector is .ink-datepicker
         ***************************/
        'DatePicker_1': '.ink-datepicker',

        /***************************
         * Gallery - Default CSS selector is ul.ink-gallery-source
         ***************************/
        'Gallery_1': 'ul.ink-gallery-source',

        /***************************
         * Modal - Default CSS selector is .ink-modal
         ***************************/
         'Modal_1': '.ink-modal',

        /***************************
         * ProgressBar - Default CSS selector is .ink-progress-bar
         ***************************/
         'ProgressBar_1': '.ink-progress-bar',

        /***************************
         * SortableList - Default CSS selector is .ink-sortable-list
         ***************************/
         'SortableList_1': '.ink-sortable-list',

        /***************************
         * Spy - Default CSS selector is *[data-spy="true"]
         ***************************/
         'Spy_1': '*[data-spy="true"]',

        /***************************
         * Sticky - Default CSS selector is .ink-navigation.sticky
         ***************************/
         'Sticky_1': '.ink-navigation.sticky',

        /***************************
         * Table - Default CSS selector is .ink-table
         ***************************/
         'Table_1': '.ink-table',

        /***************************
         * Tabs - Default CSS selector is .ink-tabs
         ***************************/
         'Tabs_1': '.ink-tabs',

        /***************************
         * TreeView - Default CSS selector is .ink-tree-view
         ***************************/
         'TreeView_1': '.ink-tree-view',

        /***************************
         * Toggle - Default CSS selector is .toggle
         ***************************/
         'Toggle_1': '.toggle'

    };

    Ink.requireModules(['Ink.Dom.Selector_1', 'Ink.Dom.Loaded_1', 'Ink.Util.Array_1', 'Ink.UI.SmoothScroller_1', 'Ink.UI.Close_1'],
        function( Selector, Loaded, InkArray, Scroller, Close ){

        var elements;
        var fn = function( Component ) {
            InkArray.each(elements, function( element ){
                new Component(element);
            });
        };

        Loaded.run(function(){
            for( var mod in autoload ){
                if( !autoload.hasOwnProperty(mod) ){
                    continue;
                }
                elements = Selector.select( autoload[mod] );
                if( elements.length ){
                    Ink.requireModules( ['Ink.UI.' + mod ], fn);
                }
            }
            Scroller.init();
            new Close();
        });
    });
})();
<commit_msg>adding tooltips to autoload<commit_after>( function(){
    var autoload = {

        /***************************
         * DatePicker - Default CSS selector is .ink-datepicker
         ***************************/
        'DatePicker_1': '.ink-datepicker',

        /***************************
         * Gallery - Default CSS selector is ul.ink-gallery-source
         ***************************/
        'Gallery_1': 'ul.ink-gallery-source',

        /***************************
         * Modal - Default CSS selector is .ink-modal
         ***************************/
         'Modal_1': '.ink-modal',

        /***************************
         * ProgressBar - Default CSS selector is .ink-progress-bar
         ***************************/
         'ProgressBar_1': '.ink-progress-bar',

        /***************************
         * SortableList - Default CSS selector is .ink-sortable-list
         ***************************/
         'SortableList_1': '.ink-sortable-list',

        /***************************
         * Spy - Default CSS selector is *[data-spy="true"]
         ***************************/
         'Spy_1': '*[data-spy="true"]',

        /***************************
         * Sticky - Default CSS selector is .ink-navigation.sticky
         ***************************/
         'Sticky_1': '.ink-navigation.sticky',

        /***************************
         * Table - Default CSS selector is .ink-table
         ***************************/
         'Table_1': '.ink-table',

        /***************************
         * Tabs - Default CSS selector is .ink-tabs
         ***************************/
         'Tabs_1': '.ink-tabs',

        /***************************
         * TreeView - Default CSS selector is .ink-tree-view
         ***************************/
         'TreeView_1': '.ink-tree-view',

        /***************************
         * Toggle - Default CSS selector is .toggle
         ***************************/
         'Toggle_1': '.toggle',

        /***************************
         * Tooltip - Default CSS selector is .tooltip
         ***************************/
         'Tooltip_1': '.tooltip'
    };

    Ink.requireModules(['Ink.Dom.Selector_1', 'Ink.Dom.Loaded_1', 'Ink.Util.Array_1', 'Ink.UI.SmoothScroller_1', 'Ink.UI.Close_1'],
        function( Selector, Loaded, InkArray, Scroller, Close ){

        var elements;
        var fn = function( Component ) {
            InkArray.each(elements, function( element ){
                new Component(element);
            });
        };

        Loaded.run(function(){
            for( var mod in autoload ){
                if( !autoload.hasOwnProperty(mod) ){
                    continue;
                }
                elements = Selector.select( autoload[mod] );
                if( elements.length ){
                    Ink.requireModules( ['Ink.UI.' + mod ], fn);
                }
            }
            Scroller.init();
            new Close();
        });
    });
})();
<|endoftext|>


<commit_before>/*global $, document, alert*/

(function () {

  // minimal config
  var repeat = false;//true;

  // Track multiple players on the page
  var bbplayers = [];

  // Stop all other bbplayers on page when starting another
  function stopAllBBPlayers() {
    var i = 0;
    for (i = 0; i < bbplayers.length; i++) {
      bbplayers[i].bbaudio.pause();
      bbplayers[i].updateDisplay();
    }
  }

  // Pad a number with leading zeros
  function zeroPad(number, places) {
    var zeros = places - number.toString().length + 1;
    return new Array(+(zeros > 0 && zeros)).join("0") + number;
  }

  // Convert seconds to mm:ss format
  function toTimeString(seconds) {
    if (isNaN(seconds)) {
      return "--:--";
    }
    var minutes = Math.floor(seconds / 60);
    seconds = seconds - minutes * 60;
    return zeroPad(minutes, 2) + ":" + zeroPad(seconds, 2);
  }

  // Parse out file name from path, unescape
  function parseTitle(path) {
    path = decodeURI(path);
    return path.split('/').pop().split('.').shift();
  }

  // Object to represent bbplayer
  var BBPlayer = function (elem) {
    this.bbplayer  = elem;
    this.bbaudio   = elem.getElementsByTagName("audio").item(0);
    this.bbdebug   = elem.getElementsByClassName("bb-debug").item(0);
    this.bbaudio.setAttribute("preload", "auto");
    this.state     = "paused";
    this.trackList = [];
    this.init();
  }

  // Debug logger
  BBPlayer.prototype.log = function (msg) {
    if (this.bbdebug) {
      this.bbdebug.appendChild(document.createTextNode(msg));
      this.bbdebug.appendChild(document.createElement('br'));
      this.bbdebug.scrollTop = (this.bbdebug.scrollHeight - this.bbdebug.clientHeight);
    }
  };

  // say if audio element can play file type
  BBPlayer.prototype.canPlay = function (extension) {
    if ((/mp3/i).test(extension) && this.bbaudio.canPlayType('audio/mpeg')) {
      return true;
    }
    if ((/ogg/i).test(extension) && this.bbaudio.canPlayType('audio/ogg')) {
      return true;
    }
    return false;
  };

  // Set up multiple sources as track list,
  // Remove duplicate and unplayable sources
  BBPlayer.prototype.loadSources = function () {
    var self = this;
    var unused = [];
    self.log('func: loadSources');
    var sources = self.bbaudio.getElementsByTagName("source");
    [].forEach.call(
      self.bbaudio.getElementsByTagName("source"),
      function (elem) {
        var fileName  = elem.getAttribute('src').split('/').pop();
        var extension = fileName.split('.').pop();
        var trackName = fileName.split('.').shift();
        var playable  = self.canPlay(extension);
        if (self.trackList.indexOf(trackName) === -1 && playable === true) {
          self.trackList.push(trackName);
        } else {
          unused.push(elem);
        }
      }
    );
    [].forEach.call(
      unused,
      function (x) {
        x.remove();
      }
    );
  };

  // Update display
  BBPlayer.prototype.updateDisplay = function () {
    var audioElem = this.bbaudio;
    var duration  = toTimeString(Math.ceil(audioElem.duration));
    var elapsed   = toTimeString(Math.ceil(audioElem.currentTime));
    var title     = parseTitle(audioElem.currentSrc);
    this.bbplayer.getElementsByClassName('bb-trackLength').item(0).innerHTML = duration;
    this.bbplayer.getElementsByClassName('bb-trackTime').item(0).innerHTML = elapsed;
    this.bbplayer.getElementsByClassName('bb-trackTitle').item(0).innerHTML = title;
    var playButton = this.bbplayer.getElementsByClassName("bb-play").item(0);
    if (this.bbaudio.paused) {
      playButton.classList.remove("bb-playing");
      playButton.classList.add("bb-paused");
      this.state = "paused";
    } else {
      playButton.classList.remove("bb-paused");
      playButton.classList.add("bb-playing");
      this.state = "playing";
    }
  };

  // Set current source for audio to given track number
  BBPlayer.prototype.loadTrack = function (trackNumber) {
    var source = this.bbaudio.getElementsByTagName("source").item(trackNumber).getAttribute('src');
    this.bbaudio.src = source;
    // don't autoplay if bbplayer state is paused
    if (this.state === 'paused') {
      this.bbaudio.pause();
    }
    this.currentTrack = trackNumber;
    this.log('func: loadTrack: loaded ' + source);
  };

  // Load next track in playlist
  BBPlayer.prototype.loadNext = function () {
    this.log('func: loadNext');
    var trackCount = this.bbaudio.getElementsByTagName("source").length;
    var newTrack   = ((1 + this.currentTrack) % trackCount);
    if (newTrack <= this.currentTrack && !repeat) {
      this.state = "paused";
    }
    this.loadTrack(newTrack);
  };

  // Load previous track in playlist
  BBPlayer.prototype.loadPrevious = function () {
    this.log('func: loadPrevious');
    var trackCount = this.bbaudio.getElementsByTagName('source').length;
    var newTrack = (this.currentTrack + (trackCount - 1)) % trackCount;
    this.loadTrack(newTrack);
  };

  // Set up event handlers for audio element events
  BBPlayer.prototype.setAudioEventHandlers = function () {

    var self = this;
    self.log('func: setAudioEventHandlers');

    self.bbaudio.addEventListener('abort', function () {
      self.log('event: audio abort');
    });

    // Update display and continue play when song has loaded
    self.bbaudio.addEventListener('canplay', function () {
      self.log('event: audio canplay');
      if (self.state === 'playing' && this.paused) {
        this.play();
      }
      self.updateDisplay();
    });

    self.bbaudio.addEventListener('canplaythrough', function () {
      self.log('event: audio canplaythrough');
    });

    self.bbaudio.addEventListener('durationchange', function () {
      self.log('event: audio durationchange');
    });

    self.bbaudio.addEventListener('emptied', function () {
      self.log('event: audio emptied');
    });

    // Load next track when current one ends
    self.bbaudio.addEventListener('ended', function () {
      self.log('event: audio ended');
      self.loadNext();
    });

    self.bbaudio.addEventListener('error', function () {
      self.log('event: audio error');
    });

    self.bbaudio.addEventListener('loadeddata', function () {
      self.log('event: audio loadeddata');
    });

    self.bbaudio.addEventListener('loadedmetadata', function () {
      self.log('event: audio loadedmetadata');
    });

    self.bbaudio.addEventListener('loadstart', function () {
      self.log('event: audio loadstart');
    });

    self.bbaudio.addEventListener('pause', function () {
      self.log('event: audio pause');
    });

    self.bbaudio.addEventListener('play', function () {
      self.log('event: audio play');
    });

    self.bbaudio.addEventListener('playing', function () {
      self.log('event: audio playing');
    });

    self.bbaudio.addEventListener('progress', function () {
      self.log('event: audio progress');
    });

    self.bbaudio.addEventListener('ratechange', function () {
      self.log('event: audio ratechange');
    });

    self.bbaudio.addEventListener('seeked', function () {
      self.log('event: audio seeked');
    });

    self.bbaudio.addEventListener('seeking', function () {
      self.log('event: audio seeking');
    });

    self.bbaudio.addEventListener('stalled', function () {
      self.log('event: audio stalled');
    });

    self.bbaudio.addEventListener('suspend', function () {
      self.log('event: audio suspend');
    });

    self.bbaudio.addEventListener('timeupdate', function () {
      // self.log('event: audio timeupdate');
      self.updateDisplay();
    });

    self.bbaudio.addEventListener('volumechange', function () {
      self.log('event: audio volumechange');
    });

    self.bbaudio.addEventListener('waiting', function () {
      self.log('event: audio waiting');
    });

  };

  // Set up button click handlers
  BBPlayer.prototype.setClickHandlers = function () {

    var self = this;
    self.log('func: setClickHandlers');
    var audioElem = self.bbaudio;

    // Activate fast-forward
    [].forEach.call(
      self.bbplayer.getElementsByClassName('bb-forward'),
      function (el) {
        el.addEventListener('click', function () {
          self.log('event: click .bb-forward');
          self.loadNext();
        });
      }
    );

    // Toggle play / pause
    [].forEach.call(
      self.bbplayer.getElementsByClassName('bb-play'),
      function (el) {
        el.addEventListener('click', function () {
          self.log('event: click .bb-play');
          if (self.bbaudio.paused) { //(audioElem.paused) {
            stopAllBBPlayers();
            self.bbaudio.play();
            self.state = "playing";
          } else {
            self.bbaudio.pause();
            self.state = "paused";
          }
          self.updateDisplay();
        });
      }
    );

    // Activate rewind
    [].forEach.call(
      self.bbplayer.getElementsByClassName('bb-rewind'),
      function (el) {
        el.addEventListener('click', function () {
          self.log('event: click .bb-rewind');
          var time = audioElem.currentTime;
          if (time > 1.5) {
            audioElem.currentTime = 0;
          } else {
            self.loadPrevious();
          }
        });
      }
    );

    // TODO make debug more "pluggy".
    if (self.bbdebug) {
      self.bbdebug.click(function () {
        $(this).empty();
      });
    }

  };

  // BBPlayer initialisation
  BBPlayer.prototype.init = function () {
    var self = this;
    self.setAudioEventHandlers();
    self.loadSources();
    self.currentTrack = 0;
    self.setClickHandlers();
    self.updateDisplay();
  };

  // Create BBPlayer Object for each element of .bbplayer class
  document.addEventListener('DOMContentLoaded', function() {
    [].forEach.call(
      document.getElementsByClassName("bbplayer"),
      function (el) {
        bbplayers.push(new BBPlayer(el));
      }
    );
  });

}());
<commit_msg>Default to looping<commit_after>/*global $, document, alert*/

(function () {

  // minimal config
  var repeat = true;

  // Track multiple players on the page
  var bbplayers = [];

  // Stop all other bbplayers on page when starting another
  function stopAllBBPlayers() {
    var i = 0;
    for (i = 0; i < bbplayers.length; i++) {
      bbplayers[i].bbaudio.pause();
      bbplayers[i].updateDisplay();
    }
  }

  // Pad a number with leading zeros
  function zeroPad(number, places) {
    var zeros = places - number.toString().length + 1;
    return new Array(+(zeros > 0 && zeros)).join("0") + number;
  }

  // Convert seconds to mm:ss format
  function toTimeString(seconds) {
    if (isNaN(seconds)) {
      return "--:--";
    }
    var minutes = Math.floor(seconds / 60);
    seconds = seconds - minutes * 60;
    return zeroPad(minutes, 2) + ":" + zeroPad(seconds, 2);
  }

  // Parse out file name from path, unescape
  function parseTitle(path) {
    path = decodeURI(path);
    return path.split('/').pop().split('.').shift();
  }

  // Object to represent bbplayer
  var BBPlayer = function (elem) {
    this.bbplayer  = elem;
    this.bbaudio   = elem.getElementsByTagName("audio").item(0);
    this.bbdebug   = elem.getElementsByClassName("bb-debug").item(0);
    this.bbaudio.setAttribute("preload", "auto");
    this.state     = "paused";
    this.trackList = [];
    this.init();
  }

  // Debug logger
  BBPlayer.prototype.log = function (msg) {
    if (this.bbdebug) {
      this.bbdebug.appendChild(document.createTextNode(msg));
      this.bbdebug.appendChild(document.createElement('br'));
      this.bbdebug.scrollTop = (this.bbdebug.scrollHeight - this.bbdebug.clientHeight);
    }
  };

  // say if audio element can play file type
  BBPlayer.prototype.canPlay = function (extension) {
    if ((/mp3/i).test(extension) && this.bbaudio.canPlayType('audio/mpeg')) {
      return true;
    }
    if ((/ogg/i).test(extension) && this.bbaudio.canPlayType('audio/ogg')) {
      return true;
    }
    return false;
  };

  // Set up multiple sources as track list,
  // Remove duplicate and unplayable sources
  BBPlayer.prototype.loadSources = function () {
    var self = this;
    var unused = [];
    self.log('func: loadSources');
    var sources = self.bbaudio.getElementsByTagName("source");
    [].forEach.call(
      self.bbaudio.getElementsByTagName("source"),
      function (elem) {
        var fileName  = elem.getAttribute('src').split('/').pop();
        var extension = fileName.split('.').pop();
        var trackName = fileName.split('.').shift();
        var playable  = self.canPlay(extension);
        if (self.trackList.indexOf(trackName) === -1 && playable === true) {
          self.trackList.push(trackName);
        } else {
          unused.push(elem);
        }
      }
    );
    [].forEach.call(
      unused,
      function (x) {
        x.remove();
      }
    );
  };

  // Update display
  BBPlayer.prototype.updateDisplay = function () {
    var audioElem = this.bbaudio;
    var duration  = toTimeString(Math.ceil(audioElem.duration));
    var elapsed   = toTimeString(Math.ceil(audioElem.currentTime));
    var title     = parseTitle(audioElem.currentSrc);
    this.bbplayer.getElementsByClassName('bb-trackLength').item(0).innerHTML = duration;
    this.bbplayer.getElementsByClassName('bb-trackTime').item(0).innerHTML = elapsed;
    this.bbplayer.getElementsByClassName('bb-trackTitle').item(0).innerHTML = title;
    var playButton = this.bbplayer.getElementsByClassName("bb-play").item(0);
    if (this.bbaudio.paused) {
      playButton.classList.remove("bb-playing");
      playButton.classList.add("bb-paused");
      this.state = "paused";
    } else {
      playButton.classList.remove("bb-paused");
      playButton.classList.add("bb-playing");
      this.state = "playing";
    }
  };

  // Set current source for audio to given track number
  BBPlayer.prototype.loadTrack = function (trackNumber) {
    var source = this.bbaudio.getElementsByTagName("source").item(trackNumber).getAttribute('src');
    this.bbaudio.src = source;
    // don't autoplay if bbplayer state is paused
    if (this.state === 'paused') {
      this.bbaudio.pause();
    }
    this.currentTrack = trackNumber;
    this.log('func: loadTrack: loaded ' + source);
  };

  // Load next track in playlist
  BBPlayer.prototype.loadNext = function () {
    this.log('func: loadNext');
    var trackCount = this.bbaudio.getElementsByTagName("source").length;
    var newTrack   = ((1 + this.currentTrack) % trackCount);
    if (newTrack <= this.currentTrack && !repeat) {
      this.state = "paused";
    }
    this.loadTrack(newTrack);
  };

  // Load previous track in playlist
  BBPlayer.prototype.loadPrevious = function () {
    this.log('func: loadPrevious');
    var trackCount = this.bbaudio.getElementsByTagName('source').length;
    var newTrack = (this.currentTrack + (trackCount - 1)) % trackCount;
    this.loadTrack(newTrack);
  };

  // Set up event handlers for audio element events
  BBPlayer.prototype.setAudioEventHandlers = function () {

    var self = this;
    self.log('func: setAudioEventHandlers');

    self.bbaudio.addEventListener('abort', function () {
      self.log('event: audio abort');
    });

    // Update display and continue play when song has loaded
    self.bbaudio.addEventListener('canplay', function () {
      self.log('event: audio canplay');
      if (self.state === 'playing' && this.paused) {
        this.play();
      }
      self.updateDisplay();
    });

    self.bbaudio.addEventListener('canplaythrough', function () {
      self.log('event: audio canplaythrough');
    });

    self.bbaudio.addEventListener('durationchange', function () {
      self.log('event: audio durationchange');
    });

    self.bbaudio.addEventListener('emptied', function () {
      self.log('event: audio emptied');
    });

    // Load next track when current one ends
    self.bbaudio.addEventListener('ended', function () {
      self.log('event: audio ended');
      self.loadNext();
    });

    self.bbaudio.addEventListener('error', function () {
      self.log('event: audio error');
    });

    self.bbaudio.addEventListener('loadeddata', function () {
      self.log('event: audio loadeddata');
    });

    self.bbaudio.addEventListener('loadedmetadata', function () {
      self.log('event: audio loadedmetadata');
    });

    self.bbaudio.addEventListener('loadstart', function () {
      self.log('event: audio loadstart');
    });

    self.bbaudio.addEventListener('pause', function () {
      self.log('event: audio pause');
    });

    self.bbaudio.addEventListener('play', function () {
      self.log('event: audio play');
    });

    self.bbaudio.addEventListener('playing', function () {
      self.log('event: audio playing');
    });

    self.bbaudio.addEventListener('progress', function () {
      self.log('event: audio progress');
    });

    self.bbaudio.addEventListener('ratechange', function () {
      self.log('event: audio ratechange');
    });

    self.bbaudio.addEventListener('seeked', function () {
      self.log('event: audio seeked');
    });

    self.bbaudio.addEventListener('seeking', function () {
      self.log('event: audio seeking');
    });

    self.bbaudio.addEventListener('stalled', function () {
      self.log('event: audio stalled');
    });

    self.bbaudio.addEventListener('suspend', function () {
      self.log('event: audio suspend');
    });

    self.bbaudio.addEventListener('timeupdate', function () {
      // self.log('event: audio timeupdate');
      self.updateDisplay();
    });

    self.bbaudio.addEventListener('volumechange', function () {
      self.log('event: audio volumechange');
    });

    self.bbaudio.addEventListener('waiting', function () {
      self.log('event: audio waiting');
    });

  };

  // Set up button click handlers
  BBPlayer.prototype.setClickHandlers = function () {

    var self = this;
    self.log('func: setClickHandlers');
    var audioElem = self.bbaudio;

    // Activate fast-forward
    [].forEach.call(
      self.bbplayer.getElementsByClassName('bb-forward'),
      function (el) {
        el.addEventListener('click', function () {
          self.log('event: click .bb-forward');
          self.loadNext();
        });
      }
    );

    // Toggle play / pause
    [].forEach.call(
      self.bbplayer.getElementsByClassName('bb-play'),
      function (el) {
        el.addEventListener('click', function () {
          self.log('event: click .bb-play');
          if (self.bbaudio.paused) { //(audioElem.paused) {
            stopAllBBPlayers();
            self.bbaudio.play();
            self.state = "playing";
          } else {
            self.bbaudio.pause();
            self.state = "paused";
          }
          self.updateDisplay();
        });
      }
    );

    // Activate rewind
    [].forEach.call(
      self.bbplayer.getElementsByClassName('bb-rewind'),
      function (el) {
        el.addEventListener('click', function () {
          self.log('event: click .bb-rewind');
          var time = audioElem.currentTime;
          if (time > 1.5) {
            audioElem.currentTime = 0;
          } else {
            self.loadPrevious();
          }
        });
      }
    );

    // TODO make debug more "pluggy".
    if (self.bbdebug) {
      self.bbdebug.click(function () {
        $(this).empty();
      });
    }

  };

  // BBPlayer initialisation
  BBPlayer.prototype.init = function () {
    var self = this;
    self.setAudioEventHandlers();
    self.loadSources();
    self.currentTrack = 0;
    self.setClickHandlers();
    self.updateDisplay();
  };

  // Create BBPlayer Object for each element of .bbplayer class
  document.addEventListener('DOMContentLoaded', function() {
    [].forEach.call(
      document.getElementsByClassName("bbplayer"),
      function (el) {
        bbplayers.push(new BBPlayer(el));
      }
    );
  });

}());
<|endoftext|>


<commit_before>var Q     = require('q');
var Redis = require('redis');

/*
 * RedisCache Constructor
 */
function RedisCache = function(config) {

};

module.exports = RedisCache;

RedisCache.prototype.get = function(key) {

};<commit_msg>RedisCache - Boot up instance, set namespace and sort defaults etc<commit_after>var _     = require('lodash');
var Q     = require('q');
var Redis = require('redback');

/**
 * RedisCache Constructor
 */
function RedisCache(config) {
  this.name = 'RedisCache';

  /* Setup the config by merging
   * with the defaults
   */
  this.config = _.merge({
    port : 6379,
    host : '127.0.0.1',
    opts : {
      namespace : ''
    }
  }, config);

  /* Create an redis connection
   * with the config passed
   */
  this.instance = new Redis.createClient(
    this.config.port,
    this.config.host,
    this.config.opts
  );

  /* Create a new Cache instance
   * with the namespace given
   */
  this.cache = this.instance.createCache(
    this.config.opts.namespace
  );
};

module.exports = RedisCache;

/**
 * Get
 * @param  String key String to get
 * @return Promise    Promise
 */
RedisCache.prototype.get = function(key) {

};

RedisCache.prototype.get = function(key, value) {

};<|endoftext|>