commit 49d4ca78a0938150bc45de4d7d6bb19c386db2b1 Author: root Date: Thu Jun 22 15:48:15 2017 +0300 First commit diff --git a/.DS_Store b/.DS_Store new file mode 100755 index 0000000..0de12ee Binary files /dev/null and b/.DS_Store differ diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7061901 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.bat] +end_of_line = crlf + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..926a808 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,36 @@ +# Define the line ending behavior of the different file extensions +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto +* text eol=lf + +# Explicitly declare text files we want to always be normalized and converted +# to native line endings on checkout. +*.php text +*.default text +*.ctp text +*.sql text +*.md text +*.po text +*.js text +*.css text +*.ini text +*.properties text +*.txt text +*.xml text +*.yml text +.htaccess text + +# Declare files that will always have CRLF line endings on checkout. +*.bat eol=crlf + +# Declare files that will always have LF line endings on checkout. +*.pem eol=lf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.gif binary +*.ico binary +*.mo binary +*.pdf binary +*.phar binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2e825d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/vendor/* +/config/app.php +/tmp/* +/logs/* diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..fc3aac4 --- /dev/null +++ b/.htaccess @@ -0,0 +1,5 @@ + + RewriteEngine on + RewriteRule ^$ webroot/ [L] + RewriteRule (.*) webroot/$1 [L] + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d10f740 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: php + +sudo: false + +php: + - 7.0 + +before_script: + - sh -c "composer require 'cakephp/cakephp-codesniffer:dev-master'" + - phpenv rehash + +script: + - sh -c "vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests ./config ./webroot" + +notifications: + email: false diff --git a/AdminMappingsTable.php b/AdminMappingsTable.php new file mode 100755 index 0000000..7aaea87 --- /dev/null +++ b/AdminMappingsTable.php @@ -0,0 +1,74 @@ +table('admin_mappings'); + $this->displayField('id'); + $this->primaryKey('id'); + + $this->addBehavior('Timestamp'); + + $this->belongsTo('Users', [ + 'foreignKey' => 'user_id', + 'joinType' => 'INNER' + ]); + $this->belongsTo('AccountMappings', [ + 'foreignKey' => 'account_mapping_id', + 'joinType' => 'INNER' + ]); + } + + /** + * Default validation rules. + * + * @param \Cake\Validation\Validator $validator Validator instance. + * @return \Cake\Validation\Validator + */ + public function validationDefault(Validator $validator) + { + $validator + ->uuid('id') + ->allowEmpty('id', 'create'); + + return $validator; + } + + /** + * Returns a rules checker object that will be used for validating + * application integrity. + * + * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. + * @return \Cake\ORM\RulesChecker + */ + public function buildRules(RulesChecker $rules) + { + $rules->add($rules->existsIn(['user_id'], 'Users')); + $rules->add($rules->existsIn(['account_mapping_id'], 'AccountMappings')); + $rules->add($rules->isUnique(['account_mapping_id', 'user_id']), ['message' => 'unique error']); + return $rules; + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..5568240 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# CakePHP Application Skeleton + +[![Build Status](https://img.shields.io/travis/cakephp/app/master.svg?style=flat-square)](https://travis-ci.org/cakephp/app) +[![License](https://img.shields.io/packagist/l/cakephp/app.svg?style=flat-square)](https://packagist.org/packages/cakephp/app) + +A skeleton for creating applications with [CakePHP](http://cakephp.org) 3.x. + +The framework source code can be found here: [cakephp/cakephp](https://github.com/cakephp/cakephp). + +## Installation + +1. Download [Composer](http://getcomposer.org/doc/00-intro.md) or update `composer self-update`. +2. Run `php composer.phar create-project --prefer-dist cakephp/app [app_name]`. + +If Composer is installed globally, run +```bash +composer create-project --prefer-dist cakephp/app [app_name] +``` + +You should now be able to visit the path to where you installed the app and see +the setup traffic lights. + +## Configuration + +Read and edit `config/app.php` and setup the 'Datasources' and any other +configuration relevant for your application. diff --git a/bin/cake b/bin/cake new file mode 100755 index 0000000..b034386 --- /dev/null +++ b/bin/cake @@ -0,0 +1,40 @@ +#!/usr/bin/env sh +################################################################################ +# +# Cake is a shell script for invoking CakePHP shell commands +# +# CakePHP(tm) : Rapid Development Framework (http://cakephp.org) +# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# +# Licensed under The MIT License +# For full copyright and license information, please see the LICENSE.txt +# Redistributions of files must retain the above copyright notice. +# +# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +# @link http://cakephp.org CakePHP(tm) Project +# @since 1.2.0 +# @license http://www.opensource.org/licenses/mit-license.php MIT License +# +################################################################################ + +# Canonicalize by following every symlink of the given name recursively +canonicalize() { + NAME="$1" + if [ -f "$NAME" ] + then + DIR=$(dirname -- "$NAME") + NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME") + fi + while [ -h "$NAME" ]; do + DIR=$(dirname -- "$NAME") + SYM=$(readlink "$NAME") + NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM") + done + echo "$NAME" +} + +CONSOLE=$(dirname -- "$(canonicalize "$0")") +APP=$(dirname "$CONSOLE") + +exec php "$CONSOLE"/cake.php "$@" +exit diff --git a/bin/cake.bat b/bin/cake.bat new file mode 100644 index 0000000..d63fa83 --- /dev/null +++ b/bin/cake.bat @@ -0,0 +1,27 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Cake is a Windows batch script for invoking CakePHP shell commands +:: +:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org) +:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +:: +:: Licensed under The MIT License +:: Redistributions of files must retain the above copyright notice. +:: +:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) +:: @link http://cakephp.org CakePHP(tm) Project +:: @since 2.0.0 +:: @license http://www.opensource.org/licenses/mit-license.php MIT License +:: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +@echo off + +SET app=%0 +SET lib=%~dp0 + +php "%lib%cake.php" %* + +echo. + +exit /B %ERRORLEVEL% diff --git a/bin/cake.php b/bin/cake.php new file mode 100644 index 0000000..6e4a16a --- /dev/null +++ b/bin/cake.php @@ -0,0 +1,33 @@ +#!/usr/bin/php -q +require->php)) { + $minVersion = preg_replace('/([^0-9\.])/', '', $composer->require->php); + } +} +if (version_compare(phpversion(), $minVersion, '<')) { + fwrite(STDERR, sprintf("Minimum PHP version: %s. You are using: %s.\n", $minVersion, phpversion())); + exit(-1); +} + +include dirname(__DIR__) . '/config/bootstrap.php'; + +exit(Cake\Console\ShellDispatcher::run($argv)); diff --git a/bower_components/bootstrap-toggle/.bower.json b/bower_components/bootstrap-toggle/.bower.json new file mode 100644 index 0000000..d9645b7 --- /dev/null +++ b/bower_components/bootstrap-toggle/.bower.json @@ -0,0 +1,42 @@ +{ + "name": "bootstrap-toggle", + "description": "Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles", + "version": "2.2.2", + "keywords": [ + "bootstrap", + "toggle", + "bootstrap-toggle", + "switch", + "bootstrap-switch" + ], + "homepage": "http://www.bootstraptoggle.com", + "repository": { + "type": "git", + "url": "https://github.com/minhur/bootstrap-toggle.git" + }, + "license": "MIT", + "authors": [ + "Min Hur " + ], + "main": [ + "./js/bootstrap-toggle.min.js", + "./css/bootstrap-toggle.min.css" + ], + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "_release": "2.2.2", + "_resolution": { + "type": "version", + "tag": "2.2.2", + "commit": "f043b18456b62b4ce84a455f772b323ebe7fb148" + }, + "_source": "git://github.com/minhur/bootstrap-toggle.git", + "_target": "^2.2.2", + "_originalSource": "bootstrap-toggle", + "_direct": true +} \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/Gruntfile.js b/bower_components/bootstrap-toggle/Gruntfile.js new file mode 100644 index 0000000..9ac6fc5 --- /dev/null +++ b/bower_components/bootstrap-toggle/Gruntfile.js @@ -0,0 +1,37 @@ +module.exports = function(grunt) { + 'use strict'; + + grunt.initConfig({ + clean: ['dist'], + uglify: { + options: { + preserveComments: 'some', + sourceMap: true + }, + build: { + expand: true, + cwd: 'js', + src: ['**/*.js', ['!**/*.min.js']], + dest: 'js', + ext: '.min.js', + } + }, + cssmin: { + options: { + keepBreaks: true + }, + build: { + expand: true, + cwd: 'css', + src: ['**/*.css', ['!**/*.min.css']], + dest: 'css', + ext: '.min.css', + } + } + }); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.registerTask('default', ['clean', 'uglify', 'cssmin']); + +}; \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/LICENSE b/bower_components/bootstrap-toggle/LICENSE new file mode 100644 index 0000000..88bb5ab --- /dev/null +++ b/bower_components/bootstrap-toggle/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2011-2014 Min Hur, The New York Times Company + +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. \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/README.md b/bower_components/bootstrap-toggle/README.md new file mode 100644 index 0000000..f9c0dcd --- /dev/null +++ b/bower_components/bootstrap-toggle/README.md @@ -0,0 +1,175 @@ +# Bootstrap Toggle +Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles. + +Visit http://www.bootstraptoggle.com for demos. + +## Getting Started + +### Installation +You can [download](https://github.com/minhur/bootstrap-toggle/archive/master.zip) the latest version of Bootstrap Toggle or use CDN to load the library. + +`Warning` If you are using Bootstrap v2.3.2, use `bootstrap2-toggle.min.js` and `bootstrap2-toggle.min.css` instead. + +```html + + +``` + +### Bower Install +```bash +bower install bootstrap-toggle +``` + +## Usage + +### Basic example +Simply add `data-toggle="toggle"` to convert checkboxes into toggles. + +```html + +``` + +### Stacked checkboxes +Refer to Bootstrap Form Controls documentation to create stacked checkboxes. Simply add `data-toggle="toggle"` to convert checkboxes into toggles. + +```html +
+ +
+
+ +
+``` + +### Inline Checkboxes +Refer to Bootstrap Form Controls documentation to create inline checkboxes. Simply add `data-toggle="toggle"` to a convert checkboxes into toggles. + +```html + + + +``` + +## API + +### Initialize by JavaScript +Initialize toggles with id `toggle-one` with a single line of JavaScript. + +```html + + +``` + +### Options +Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-on="Enabled"`. + +```html + + + +``` + +Name|Type|Default|Description| +---|---|---|--- +on|string/html|"On"|Text of the on toggle +off|string/html|"Off"|Text of the off toggle +size|string|"normal"|Size of the toggle. Possible values are `large`, `normal`, `small`, `mini`. +onstyle|string|"primary"|Style of the on toggle. Possible values are `default`, `primary`, `success`, `info`, `warning`, `danger` +offstyle|string|"default"|Style of the off toggle. Possible values are `default`, `primary`, `success`, `info`, `warning`, `danger` +style|string| |Appends the value to the class attribute of the toggle. This can be used to apply custom styles. Refer to Custom Styles for reference. +width|integer|*null*|Sets the width of the toggle. if set to *null*, width will be calculated. +height|integer|*null*|Sets the height of the toggle. if set to *null*, height will be calculated. + +### Methods +Methods can be used to control toggles directly. + +```html + +``` + +Method|Example|Description +---|---|--- +initialize|$('#toggle-demo').bootstrapToggle()|Initializes the toggle plugin with options +destroy|$('#toggle-demo').bootstrapToggle('destroy')|Destroys the toggle +on|$('#toggle-demo').bootstrapToggle('on')|Sets the toggle to 'On' state +off|$('#toggle-demo').bootstrapToggle('off')|Sets the toggle to 'Off' state +toggle|$('#toggle-demo').bootstrapToggle('toggle')|Toggles the state of the toggle +enable|$('#toggle-demo').bootstrapToggle('enable')|Enables the toggle +disable|$('#toggle-demo').bootstrapToggle('disable')|Disables the toggle + +## Events + +### Event Propagation +Note All events are propagated to and from input element to the toggle. + +You should listen to events from the `` directly rather than look for custom events. + +```html + +
+ +``` + +### API vs Input +This also means that using the API or Input to trigger events will work both ways. + +```html + + + + + + +``` + +### Integration + +#### [KnockoutJS](http://knockoutjs.com) + +A binding for knockout is available here: [aAXEe/knockout-bootstrap-toggle](https://github.com/aAXEe/knockout-bootstrap-toggle) + +## Demos + +Visit http://www.bootstraptoggle.com for demos. diff --git a/bower_components/bootstrap-toggle/bower.json b/bower_components/bootstrap-toggle/bower.json new file mode 100644 index 0000000..9d941df --- /dev/null +++ b/bower_components/bootstrap-toggle/bower.json @@ -0,0 +1,32 @@ +{ + "name": "bootstrap-toggle", + "description": "Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles", + "version": "2.2.1", + "keywords": [ + "bootstrap", + "toggle", + "bootstrap-toggle", + "switch", + "bootstrap-switch" + ], + "homepage": "http://www.bootstraptoggle.com", + "repository": { + "type": "git", + "url": "https://github.com/minhur/bootstrap-toggle.git" + }, + "license": "MIT", + "authors": [ + "Min Hur " + ], + "main": [ + "./js/bootstrap-toggle.min.js", + "./css/bootstrap-toggle.min.css" + ], + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/bower_components/bootstrap-toggle/css/bootstrap-toggle.css b/bower_components/bootstrap-toggle/css/bootstrap-toggle.css new file mode 100644 index 0000000..057d08b --- /dev/null +++ b/bower_components/bootstrap-toggle/css/bootstrap-toggle.css @@ -0,0 +1,83 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ + + +.checkbox label .toggle, +.checkbox-inline .toggle { + margin-left: -20px; + margin-right: 5px; +} + +.toggle { + position: relative; + overflow: hidden; +} +.toggle input[type="checkbox"] { + display: none; +} +.toggle-group { + position: absolute; + width: 200%; + top: 0; + bottom: 0; + left: 0; + transition: left 0.35s; + -webkit-transition: left 0.35s; + -moz-user-select: none; + -webkit-user-select: none; +} +.toggle.off .toggle-group { + left: -100%; +} +.toggle-on { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 50%; + margin: 0; + border: 0; + border-radius: 0; +} +.toggle-off { + position: absolute; + top: 0; + bottom: 0; + left: 50%; + right: 0; + margin: 0; + border: 0; + border-radius: 0; +} +.toggle-handle { + position: relative; + margin: 0 auto; + padding-top: 0px; + padding-bottom: 0px; + height: 100%; + width: 0px; + border-width: 0 1px; +} + +.toggle.btn { min-width: 59px; min-height: 34px; } +.toggle-on.btn { padding-right: 24px; } +.toggle-off.btn { padding-left: 24px; } + +.toggle.btn-lg { min-width: 79px; min-height: 45px; } +.toggle-on.btn-lg { padding-right: 31px; } +.toggle-off.btn-lg { padding-left: 31px; } +.toggle-handle.btn-lg { width: 40px; } + +.toggle.btn-sm { min-width: 50px; min-height: 30px;} +.toggle-on.btn-sm { padding-right: 20px; } +.toggle-off.btn-sm { padding-left: 20px; } + +.toggle.btn-xs { min-width: 35px; min-height: 22px;} +.toggle-on.btn-xs { padding-right: 12px; } +.toggle-off.btn-xs { padding-left: 12px; } + diff --git a/bower_components/bootstrap-toggle/css/bootstrap-toggle.min.css b/bower_components/bootstrap-toggle/css/bootstrap-toggle.min.css new file mode 100644 index 0000000..0d42ed0 --- /dev/null +++ b/bower_components/bootstrap-toggle/css/bootstrap-toggle.min.css @@ -0,0 +1,28 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ +.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} +.toggle{position:relative;overflow:hidden} +.toggle input[type=checkbox]{display:none} +.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} +.toggle.off .toggle-group{left:-100%} +.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} +.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} +.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} +.toggle.btn{min-width:59px;min-height:34px} +.toggle-on.btn{padding-right:24px} +.toggle-off.btn{padding-left:24px} +.toggle.btn-lg{min-width:79px;min-height:45px} +.toggle-on.btn-lg{padding-right:31px} +.toggle-off.btn-lg{padding-left:31px} +.toggle-handle.btn-lg{width:40px} +.toggle.btn-sm{min-width:50px;min-height:30px} +.toggle-on.btn-sm{padding-right:20px} +.toggle-off.btn-sm{padding-left:20px} +.toggle.btn-xs{min-width:35px;min-height:22px} +.toggle-on.btn-xs{padding-right:12px} +.toggle-off.btn-xs{padding-left:12px} \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/css/bootstrap2-toggle.css b/bower_components/bootstrap-toggle/css/bootstrap2-toggle.css new file mode 100644 index 0000000..3f48927 --- /dev/null +++ b/bower_components/bootstrap-toggle/css/bootstrap2-toggle.css @@ -0,0 +1,85 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap2-toggle.css v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ + + +label.checkbox .toggle, +label.checkbox.inline .toggle { + margin-left: -20px; + margin-right: 5px; +} +.toggle { + min-width: 40px; + height: 20px; + position: relative; + overflow: hidden; +} +.toggle input[type="checkbox"] { + display: none; +} +.toggle-group { + position: absolute; + width: 200%; + top: 0; + bottom: 0; + left: 0; + transition: left 0.35s; + -webkit-transition: left 0.35s; + -moz-user-select: none; + -webkit-user-select: none; +} +.toggle.off .toggle-group { + left: -100%; +} +.toggle-on { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 50%; + margin: 0; + border: 0; + border-radius: 0; +} +.toggle-off { + position: absolute; + top: 0; + bottom: 0; + left: 50%; + right: 0; + margin: 0; + border: 0; + border-radius: 0; +} +.toggle-handle { + position: relative; + margin: 0 auto; + padding-top: 0px; + padding-bottom: 0px; + height: 100%; + width: 0px; + border-width: 0 1px; +} +.toggle-handle.btn-mini { + top: -1px; +} +.toggle.btn { min-width: 30px; } +.toggle-on.btn { padding-right: 24px; } +.toggle-off.btn { padding-left: 24px; } + +.toggle.btn-large { min-width: 40px; } +.toggle-on.btn-large { padding-right: 35px; } +.toggle-off.btn-large { padding-left: 35px; } + +.toggle.btn-small { min-width: 25px; } +.toggle-on.btn-small { padding-right: 20px; } +.toggle-off.btn-small { padding-left: 20px; } + +.toggle.btn-mini { min-width: 20px; } +.toggle-on.btn-mini { padding-right: 12px; } +.toggle-off.btn-mini { padding-left: 12px; } + diff --git a/bower_components/bootstrap-toggle/css/bootstrap2-toggle.min.css b/bower_components/bootstrap-toggle/css/bootstrap2-toggle.min.css new file mode 100644 index 0000000..1509c57 --- /dev/null +++ b/bower_components/bootstrap-toggle/css/bootstrap2-toggle.min.css @@ -0,0 +1,28 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap2-toggle.css v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ +label.checkbox .toggle,label.checkbox.inline .toggle{margin-left:-20px;margin-right:5px} +.toggle{min-width:40px;height:20px;position:relative;overflow:hidden} +.toggle input[type=checkbox]{display:none} +.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} +.toggle.off .toggle-group{left:-100%} +.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} +.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} +.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} +.toggle-handle.btn-mini{top:-1px} +.toggle.btn{min-width:30px} +.toggle-on.btn{padding-right:24px} +.toggle-off.btn{padding-left:24px} +.toggle.btn-large{min-width:40px} +.toggle-on.btn-large{padding-right:35px} +.toggle-off.btn-large{padding-left:35px} +.toggle.btn-small{min-width:25px} +.toggle-on.btn-small{padding-right:20px} +.toggle-off.btn-small{padding-left:20px} +.toggle.btn-mini{min-width:20px} +.toggle-on.btn-mini{padding-right:12px} +.toggle-off.btn-mini{padding-left:12px} \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/doc/header.png b/bower_components/bootstrap-toggle/doc/header.png new file mode 100644 index 0000000..eb8d58b Binary files /dev/null and b/bower_components/bootstrap-toggle/doc/header.png differ diff --git a/bower_components/bootstrap-toggle/doc/nyt.png b/bower_components/bootstrap-toggle/doc/nyt.png new file mode 100644 index 0000000..4025f26 Binary files /dev/null and b/bower_components/bootstrap-toggle/doc/nyt.png differ diff --git a/bower_components/bootstrap-toggle/doc/nytdev.svg b/bower_components/bootstrap-toggle/doc/nytdev.svg new file mode 100644 index 0000000..39669ee --- /dev/null +++ b/bower_components/bootstrap-toggle/doc/nytdev.svg @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bower_components/bootstrap-toggle/doc/script.js b/bower_components/bootstrap-toggle/doc/script.js new file mode 100644 index 0000000..863728a --- /dev/null +++ b/bower_components/bootstrap-toggle/doc/script.js @@ -0,0 +1,49 @@ ++function ($) { + 'use strict'; + + $('.example:not(.skip)').each(function() { + // fetch & encode html + var html = $('
').text($(this).html()).html() + // find number of space/tabs on first line (minus line break) + var count = html.match(/^(\s+)/)[0].length - 1 + // replace tabs/spaces on each lines with + var regex = new RegExp('\\n\\s{'+count+'}', 'g') + var code = html.replace(regex, '\n').replace(/\t/g, ' ').trim() + // other cleanup + code = code.replace(/=""/g,'') + // add code block to dom + $(this).after( $('').html(code) ) + }); + + $('code.highlight').each(function() { + hljs.highlightBlock(this) + }); + +}(jQuery); + +var Demo = function () {} + +Demo.prototype.init = function(selector) { + $(selector).bootstrapToggle(selector) +} +Demo.prototype.destroy = function(selector) { + $(selector).bootstrapToggle('destroy') +} +Demo.prototype.on = function(selector) { + $(selector).bootstrapToggle('on') +} +Demo.prototype.off = function(selector) { + $(selector).bootstrapToggle('off') +} +Demo.prototype.toggle = function(selector) { + $(selector).bootstrapToggle('toggle') +} +Demo.prototype.enable = function(selector) { + $(selector).bootstrapToggle('enable') +} +Demo.prototype.disable = function(selector) { + $(selector).bootstrapToggle('disable') +} + + +demo = new Demo() diff --git a/bower_components/bootstrap-toggle/doc/stylesheet.css b/bower_components/bootstrap-toggle/doc/stylesheet.css new file mode 100644 index 0000000..fe7a444 --- /dev/null +++ b/bower_components/bootstrap-toggle/doc/stylesheet.css @@ -0,0 +1,112 @@ +header, footer { + padding: 20px; + background-image: url('header.png'); + background-size: 256px 256px; +} +footer { + color: #fff; + text-align: center; +} +.nyt-logo { + max-height: 40px; + margin-top: 5px; + margin-right: 5px; +} + +nav.navbar { + margin-bottom: 10px; + background-color: #fff; + border: 0px; + border-radius: 2px; +} +#navbar { + margin: 0px; +} +#navbar .navbar-nav li iframe { + margin-top: 15px; +} +#navbar .navbar-nav li:last-child iframe { + margin-right: 15px; +} + +@media screen and (max-width: 767px) { + #navbar .navbar-nav li iframe { + display: none; + } +} + +.mast-head { + margin: 10px 0; +} +.mast-head h1 { + margin-bottom: 15px; + color: #fff; +} +.mast-head p { + color: #fff; +} + +.mast-links { + padding-top: 10px; +} + +.mast-links > * { + vertical-align: middle; + margin-bottom: 10px; +} + +.mast-links > .btn { + margin-right: 30px; +} +main { + margin: 10px 20px; +} +main .container { + margin-bottom: 40px; +} + +code.hljs { + border: 1px solid #ccc; + padding: 1em; + white-space: pre; + margin-bottom: 10px; +} + +.example { + position: relative; + border: 1px solid #ccc; + padding: 1em 1em 0.5em 1em; + border-radius: 4px 4px 0 0; +} + +.example:after { + content: "Example"; + position: absolute; + top: 0px; + right: 0px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + background-color: #f5f5f5; + border: 1px solid #ccc; + color: #9da0a4; + border-radius: 0px 4px 0px 4px; + border-width: 0px 0px 1px 1px; +} + +.example + code.hljs { + border-top: 0; + border-radius: 0px 0px 4px 4px; +} + +.example > * { + margin-bottom: 10px; +} + +.example > div.toggle { + margin-right: 10px; +} + +.table-striped code { + background-color: inherit; +} \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/index.html b/bower_components/bootstrap-toggle/index.html new file mode 100644 index 0000000..3874fa2 --- /dev/null +++ b/bower_components/bootstrap-toggle/index.html @@ -0,0 +1,449 @@ + + + + + + + + + + + + + Bootstrap Toggle + + + + + + + + + +
+ +
+
+

Bootstrap Toggle

+

Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles

+ +
+
+
+ +
+
+

Getting Started

+
+

Installation

+

You can download the latest version of Bootstrap Toggle or use CDN to load the library.

+

Warning If you are using Bootstrap v2.3.2, use bootstrap2-toggle.min.js and bootstrap2-toggle.min.css instead.

+ <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.0/css/bootstrap-toggle.min.css" rel="stylesheet"> +<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.0/js/bootstrap-toggle.min.js"></script> + +

Bower Install

+

+ bower install bootstrap-toggle +
+
+

Usage

+
+ +

Basic example

+

Simply add data-toggle="toggle" to convert checkboxes into toggles.

+
+ +
+ +

Stacked checkboxes

+

Refer to Bootstrap Form Controls documentation to create stacked checkboxes. Simply add data-toggle="toggle" to convert checkboxes into toggles.

+
+
+ +
+
+ +
+
+ +

Inline Checkboxes

+

Refer to Bootstrap Form Controls documentation to create inline checkboxes. Simply add data-toggle="toggle" to a convert checkboxes into toggles.

+
+ + + +
+
+ +
+

API

+
+ +

Initialize by JavaScript

+

Initialize toggles with id toggle-one with a single line of JavaScript.

+
+ + +
+ +

Options

+

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-on="Enabled".

+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
onstring | html"On"Text of the on toggle
offstring | html"Off"Text of the off toggle
sizestring"normal" + Size of the toggle. Possible values are:large,normal,small,mini
+ Refer to Bootstrap Button Sizes documentation for more information. +
onstylestring"primary" + Style of the on toggle.
Possible values are:default,primary,success,info,warning,danger
+ Refer to Bootstrap Button Options documentation for more information. +
offstylestring"default" + Style of the off toggle.
Possible values are:default,primary,success,info,warning,danger
+ Refer to Bootstrap Button Options documentation for more information. +
stylestring + Appends the value to the class attribute of the toggle. This can be used to apply custom styles. Refer to Custom Styles for reference. +
widthintegernull + Sets the width of the toggle. if set to null, width will be calculated. +
heightintegernull + Sets the height of the toggle. if set to null, height will be calculated. +
+
+ +

Methods

+

Methods can be used to control toggles directly.

+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodExampleDescriptionDemo
initialize$('#toggle-demo').bootstrapToggle()Initializes the toggle plugin with options
destroy$('#toggle-demo').bootstrapToggle('destroy')Destroys the toggle
on$('#toggle-demo').bootstrapToggle('on')Sets the toggle to 'On' state
off$('#toggle-demo').bootstrapToggle('off')Sets the toggle to 'Off' state
toggle$('#toggle-demo').bootstrapToggle('toggle')Toggles the state of the toggle
enable$('#toggle-demo').bootstrapToggle('enable')Enables the toggle
disable$('#toggle-demo').bootstrapToggle('disable')Disables the toggle
+
+
+ + +
+

Events

+
+ +

Event Propagation

+

Note All events are propagated to and from input element to the toggle.

+

You should listen to events from the <input type="checkbox"> directly rather than look for custom events.

+
+ +
+ +
+ +

API vs Input

+

This also means that using the API or Input to trigger events will work both ways.

+
+ + + + + + +
+
+ +
+

Demos

+
+ +

Sizes

+

Bootstrap toggle is available in different sizes. Refer to Bootstrap Button Sizes documentation for more information.

+
+ + + + +
+ +

Custom Sizes

+

Bootstrap toggle can handle custom sizes by data-width and data-height options.

+
+ + + +
+ +

Colors

+

Bootstrap Toggle supports various colors. Refer to Bootstrap Button Options documentation for more information.

+
+ + + + + + +
+ +

Colors Mix

+

You can style on state as well as the off state.

+
+ + +
+ +

Custom Style

+

Customized styles can be applied as easily.

+
+ + + + +
+ +

Custom Text

+

The text can be changed easily with attributes or options.

+
+ +
+ +

Icons/Html Text

+

You can easily add icons or images since html is supported for on/off text.

+
+ +
+ +

Multiple Lines of Text

+

Toggles with multiple lines will adjust its heights.

+
+ +
+ +

Animation Speed

+

Transition speed can be easily controlled with css transition property on .toggle-group. You can also turn animation off completely.

+
+ + + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/bower_components/bootstrap-toggle/js/bootstrap-toggle.js b/bower_components/bootstrap-toggle/js/bootstrap-toggle.js new file mode 100644 index 0000000..533914e --- /dev/null +++ b/bower_components/bootstrap-toggle/js/bootstrap-toggle.js @@ -0,0 +1,180 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.js v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ + + + +function ($) { + 'use strict'; + + // TOGGLE PUBLIC CLASS DEFINITION + // ============================== + + var Toggle = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, this.defaults(), options) + this.render() + } + + Toggle.VERSION = '2.2.0' + + Toggle.DEFAULTS = { + on: 'On', + off: 'Off', + onstyle: 'primary', + offstyle: 'default', + size: 'normal', + style: '', + width: null, + height: null + } + + Toggle.prototype.defaults = function() { + return { + on: this.$element.attr('data-on') || Toggle.DEFAULTS.on, + off: this.$element.attr('data-off') || Toggle.DEFAULTS.off, + onstyle: this.$element.attr('data-onstyle') || Toggle.DEFAULTS.onstyle, + offstyle: this.$element.attr('data-offstyle') || Toggle.DEFAULTS.offstyle, + size: this.$element.attr('data-size') || Toggle.DEFAULTS.size, + style: this.$element.attr('data-style') || Toggle.DEFAULTS.style, + width: this.$element.attr('data-width') || Toggle.DEFAULTS.width, + height: this.$element.attr('data-height') || Toggle.DEFAULTS.height + } + } + + Toggle.prototype.render = function () { + this._onstyle = 'btn-' + this.options.onstyle + this._offstyle = 'btn-' + this.options.offstyle + var size = this.options.size === 'large' ? 'btn-lg' + : this.options.size === 'small' ? 'btn-sm' + : this.options.size === 'mini' ? 'btn-xs' + : '' + var $toggleOn = $('