├── .gitignore ├── LICENSE ├── README.md ├── bootstrap ├── paths.php └── start.php ├── composer.json ├── console └── bin │ └── craft ├── public ├── .htaccess ├── assets │ ├── css │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ └── js │ │ │ │ ├── affix.js │ │ │ │ ├── alert.js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── button.js │ │ │ │ ├── carousel.js │ │ │ │ ├── collapse.js │ │ │ │ ├── dropdown.js │ │ │ │ ├── modal.js │ │ │ │ ├── popover.js │ │ │ │ ├── scrollspy.js │ │ │ │ ├── tab.js │ │ │ │ ├── tooltip.js │ │ │ │ └── transition.js │ │ └── cygnite │ │ │ ├── bootstrap │ │ │ ├── datatables-bootstrap.css │ │ │ └── images │ │ │ │ ├── border.png │ │ │ │ ├── controls.png │ │ │ │ ├── loading.gif │ │ │ │ ├── loading_background.png │ │ │ │ └── overlay.png │ │ │ ├── colorbox.css │ │ │ ├── flash.css │ │ │ ├── style.css │ │ │ ├── table.css │ │ │ ├── tr_back.gif │ │ │ └── wysihtml5 │ │ │ ├── bootstrap-wysihtml5.css │ │ │ └── prettify.css │ ├── img │ │ ├── cygnite │ │ │ ├── close.png │ │ │ ├── cross.png │ │ │ ├── facebook.png │ │ │ ├── favicon.ico │ │ │ ├── fevicon.png │ │ │ ├── google.png │ │ │ ├── help.png │ │ │ ├── linkedin.png │ │ │ ├── tick.png │ │ │ ├── twitter.png │ │ │ └── warning.png │ │ └── datatables │ │ │ ├── sort_asc.png │ │ │ ├── sort_asc_disabled.png │ │ │ ├── sort_both.png │ │ │ ├── sort_desc.png │ │ │ └── sort_desc_disabled.png │ └── js │ │ ├── angular │ │ ├── app.js │ │ └── maincontroller.js │ │ ├── custom.js │ │ ├── cygnite │ │ └── jquery │ │ │ └── 1.10.1 │ │ │ └── jquery.min.js │ │ ├── dataTables │ │ ├── datatables-bootstrap.js │ │ ├── datatables.fnReloadAjax.js │ │ ├── jquery.dataTables.min.js │ │ └── prettify.js │ │ └── twitter │ │ └── bootstrap │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ └── bootstrap.min.css │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── js │ │ ├── affix.js │ │ ├── alert.js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── button.js │ │ ├── carousel.js │ │ ├── collapse.js │ │ ├── dropdown.js │ │ ├── modal.js │ │ ├── popover.js │ │ ├── scrollspy.js │ │ ├── tab.js │ │ ├── tooltip.js │ │ └── transition.js ├── index.php └── storage │ ├── cache │ └── .gitkeep │ ├── logs │ └── .gitkeep │ └── temp │ └── twig │ └── tmp │ └── cache │ └── .gitkeep └── src └── Apps ├── .htaccess ├── Bootstrappers └── ConfigBootstraper.php ├── Configs ├── application.php ├── bootstrappers.php ├── custom.config.php ├── database.php ├── definitions │ └── configuration.php ├── files.php ├── migration.php ├── module.php ├── omnipay.php ├── param.php ├── services.php ├── session.php ├── socialauth.php ├── stripe.php └── view.php ├── Console ├── Commands │ └── GreetCommand.php └── Kernel.php ├── Controllers ├── AuthController.php ├── Backend │ └── .gitkeep ├── Frontend │ └── .gitkeep ├── HomeController.php ├── ProductController.php └── UserController.php ├── Exceptions └── Handler.php ├── Form └── ProductForm.php ├── Kernel.php ├── Middleware ├── AccessMiddleware.php ├── Authentication │ └── Auth.php └── Events │ └── Event.php ├── Models ├── Product.php └── User.php ├── Modules ├── Acme │ ├── BootStrap.php │ ├── Configs │ │ └── acme.php │ ├── Controllers │ │ └── UserController.php │ ├── Models │ │ └── User.php │ └── Views │ │ └── user.view.php └── Demo │ ├── BootStrap.php │ ├── Configs │ └── demo.php │ ├── Controllers │ ├── .gitkeep │ └── IndexController.php │ ├── Models │ └── .gitkeep │ └── Views │ └── .gitkeep ├── Resources ├── Components │ └── .gitkeep ├── Database │ ├── Migrations │ │ └── 20150630201319_product.php │ ├── Seeding │ │ ├── DatabaseTable.php │ │ ├── RoleTable.php │ │ └── UserTable.php │ └── migrations.sql ├── Extensions │ ├── .gitkeep │ ├── Api.php │ ├── Custom.php │ ├── CustomInterface.php │ └── SocialShare.php └── Languages │ ├── en │ ├── .gitkeep │ └── message.php │ ├── es │ └── message.php │ └── pt │ └── message.php ├── Routing ├── RouteCollection.php ├── Routes.php └── StaticRoutesController.php ├── Services └── Providers │ ├── .gitkeep │ ├── Hash │ └── HashServiceProvider.php │ └── Payment │ └── ApiServiceProvider.php └── Views ├── .htaccess ├── Assets ├── BaseAssetCollection.php └── HomeAssetCollection.php ├── Events └── Product │ └── IndexViewEvent.php ├── errors ├── 403.view.php ├── 404.view.php ├── 500.view.php └── 503.view.php ├── home └── welcome.view.php ├── layouts ├── .htaccess ├── base.view.php ├── home.view.php ├── main │ └── base.html.twig └── widgets │ └── navbar.view.php └── product ├── create.view.php ├── index.view.php ├── show.view.php └── update.view.php /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | 3 | #Build System 4 | **/builds/* 5 | 6 | #bower 7 | /bower_components 8 | 9 | #Binary files 10 | /bin/ 11 | 12 | #Grunt 13 | /node_modules/* 14 | 15 | # Composer 16 | /vendor/ 17 | composer.phar 18 | composer.lock 19 | 20 | # Code Coverage 21 | build/coverage/* 22 | 23 | # always-ignore extensionsalways-ignore extensions 24 | *.diff 25 | *.err 26 | *.orig 27 | *.log 28 | *.rej 29 | *.swo 30 | *.swp 31 | *.vi 32 | *~ 33 | *.sass-cache 34 | 35 | # OS or Editor folders 36 | .DS_Store 37 | Thumbs.db 38 | .cache 39 | .project 40 | .settings 41 | .tmproj 42 | *.esproj 43 | nbproject 44 | 45 | # Dreamweaver added files 46 | _notes 47 | dwsync.xml 48 | 49 | # Komodo 50 | *.komodoproject 51 | .komodotools 52 | 53 | # Folders to ignore 54 | .hg 55 | .svn 56 | .CVS 57 | intermediate 58 | publish 59 | .idea 60 | 61 | 62 | #Arcanist 63 | .arcconfig -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2014 Cygnite Framework 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Skeleton Application Using Cygnite PHP Framework 2 | ------------------------------------------------------------------ 3 | 4 | [![Build Status](https://travis-ci.org/cygnite/framework.svg)](https://travis-ci.org/cygnite/framework) 5 | [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cygnite/framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | [![Latest Stable Version](https://poser.pugx.org/cygnite/cygnite-application/v/stable.svg)](https://packagist.org/packages/cygnite/cygnite-application) [![Total Downloads](https://poser.pugx.org/cygnite/cygnite-application/downloads.svg)](https://packagist.org/packages/cygnite/cygnite-application) [![Latest Unstable Version](https://poser.pugx.org/cygnite/cygnite-application/v/unstable.svg)](https://packagist.org/packages/cygnite/cygnite-application) [![License](https://poser.pugx.org/cygnite/cygnite-application/license.svg)](https://packagist.org/packages/cygnite/cygnite-application) 7 | 8 | Sample skeleton application using the Cygnite MVC layer - http://www.cygniteframework.com 9 | 10 | > Note: This repository contains the skeleton application of the Cygnite Framework. If you would like to contribute 11 | on Cygnite Framework, please visit the core [repository](https://github.com/cygnite/framework). 12 | 13 | ###Installation 14 | 15 | The best way to install Cygnite Framework is to download composer.phar from [http://getcomposer.org/](http://getcomposer.org/) to your local directory and move it to 16 | `usr/local/bin` to use globally on your system. For windows users please download and [install composer setup](https://getcomposer.org/doc/00-intro.md#installation-windows). 17 | 18 | You may install Cygnite Framework either simply downloading skeleton application from github repository and issuing `composer install` or using composer `create-project command`. 19 | 20 | ###Composer: Create Project 21 | 22 | Create a project from your terminal by executing below command. 23 | 24 | ```php 25 | composer create-project cygnite/cygnite-application cygnite --prefer-dist 26 | or 27 | composer.phar create-project cygnite/cygnite-application cygnite --prefer-dist 28 | ``` 29 | 30 | That's all, you are ready to build your awesome application. 31 | 32 | 33 | ###Contribute 34 | 35 | i. Getting bored with the same kind of development all time? 36 | 37 | ii. Want to build something awesome? 38 | 39 | iii. Want to help open source community? 40 | 41 | You are at right place. We welcome you to participate on Cygnite Framework's development or its documentation. 42 | 43 | Contribute on Cygnite Framework development, grow with us. Join the team, learn, get help and help others, find, report bugs, send us your feedback, send your wishlist for new features or write and send us patches for Cygnite Framework. 44 | 45 | 46 | ###Contributing To Core Framework- 47 | 48 | i. Make sure you have GitHub Account. 49 | 50 | ii. Clearly describe the issue you find to fix shortly. 51 | 52 | iii. Create a branch where you would like to place your changes and send the patches to us. 53 | 54 | iv. Fork cygnite/framework repository on GitHub. 55 | 56 | v. PSR coding standards must be followed. 57 | 58 | ###License 59 | 60 | The Cygnite framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). 61 | -------------------------------------------------------------------------------- /bootstrap/paths.php: -------------------------------------------------------------------------------- 1 | The root directory 9 | */ 10 | "root" => realpath(__DIR__ . "/.."), 11 | 12 | /** 13 | * ---------------------------------------------------------- 14 | * Source 15 | * ---------------------------------------------------------- 16 | * 17 | * "src" => The application source directory 18 | */ 19 | "src" => realpath(__DIR__ . "/../src"), 20 | 21 | /** 22 | * ---------------------------------------------------------- 23 | * Vendor 24 | * ---------------------------------------------------------- 25 | * 26 | * "vendor" => The vendor directory 27 | */ 28 | "vendor" => realpath(__DIR__ . "/../vendor"), 29 | 30 | /** 31 | * ---------------------------------------------------------- 32 | * Public 33 | * ---------------------------------------------------------- 34 | * 35 | * "public" => The public directory 36 | */ 37 | "public" => realpath(__DIR__ . "/../public/"), 38 | 39 | "app.namespace" => "Apps", 40 | 41 | 'app.path' => realpath(__DIR__.'/../src/Apps/'), 42 | 43 | 'app.config' => realpath(__DIR__.'/../src/Apps/Configs/'), 44 | 45 | 'routes.dir' => realpath(__DIR__.'/../src/Apps/Routing/'), 46 | 47 | /*'assets.path' => realpath(CYGNITE_BASE.'/public/assets'), 48 | 49 | 'storage.path' => realpath(CYGNITE_BASE.'/public/storage/'), 50 | 51 | 'core.path' => realpath(__DIR__.'/../vendor/cygnite/'),*/ 52 | ]; 53 | 54 | /* 55 | |------------------------------------------------------------------- 56 | | Register Composer PSR Auto Loader 57 | |------------------------------------------------------------------- 58 | | 59 | | Composer is the convenient way to auto load all dependencies and 60 | | classes. We will simple require it here, so that we don't need 61 | | worry about importing classes manually. 62 | */ 63 | require __DIR__ . "/../vendor/autoload.php"; 64 | 65 | return $paths; 66 | -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | 45 | | define('ENV', 'development'); 46 | | define('ENV', 'production'); 47 | | 48 | */ 49 | define('ENV', $config['environment']); 50 | 51 | if (ENV == 'development') { 52 | ini_set('display_errors', '-1'); 53 | error_reporting(E_ALL); 54 | } else { 55 | ini_set('display_error', '0'); 56 | error_reporting(0); 57 | } 58 | 59 | // Register debugger into the application 60 | $container->singleton('debugger', function () use($paths) { 61 | return new \Apps\Exceptions\Handler($paths); 62 | }); 63 | 64 | $container['debugger']->setEnv(ENV)->handleException(); 65 | $bootstrapper = new Bootstrapper(new \Cygnite\Bootstrappers\Paths($paths)); 66 | $bootstrapper->registerBootstrappers(require $paths['app.config'].DS.'bootstrappers.php'); 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Create The Application 71 | |-------------------------------------------------------------------------- 72 | | 73 | | To boot framework first thing we will create a new application instance 74 | | which serves glue for all the components, and binding components 75 | | with the IoC container 76 | */ 77 | $app = new Application($container, new BootstrapperDispatcher($container, $bootstrapper)); 78 | 79 | if (isCli()) { 80 | return true; 81 | } 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Run The Application 86 | |-------------------------------------------------------------------------- 87 | | 88 | | We will handle the incoming request using Kernel and send response 89 | | back to the browser. Http middlewares will get executed during the request 90 | | handling process. 91 | */ 92 | $kernel = $app->createKernel('\Apps\Kernel'); 93 | 94 | $response = $kernel->handle( 95 | $request = \Cygnite\Http\Requests\Request::createFromGlobals() 96 | ); 97 | 98 | $response->send(); 99 | 100 | /* 101 | | The response sent to the browser. Let us fire middleware's 102 | | shutdown method before shutting down the application 103 | | 104 | */ 105 | $kernel->shutdown($request, $response); 106 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cygnite/cygnite-application", 3 | "description": "Cygnite PHP Framework- Skeleton Application", 4 | "keywords": ["Cygnite", "PHP", "Framework"], 5 | "homepage": "http://www.cygniteframework.com", 6 | "license": "MIT", 7 | "type": "project", 8 | "authors": [ 9 | { 10 | "name": "Sanjoy Dey", 11 | "email": "dey.sanjoy0@gmail.com", 12 | "homepage": "http://www.appsntech.com" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=7.0", 17 | "cygnite/framework": "dev-master" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "Apps\\": "src/Apps/" 22 | } 23 | }, 24 | "extra": { 25 | "branch-alias": { 26 | "dev-master": "3.0-dev" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /console/bin/craft: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 74 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | # Apache configuration file 2 | # http://httpd.apache.org/docs/2.2/mod/quickreference.html 3 | 4 | # Note: ".htaccess" files are an overhead for each request. This logic should 5 | # be placed in your Apache config whenever possible. 6 | # http://httpd.apache.org/docs/2.2/howto/htaccess.html 7 | 8 | # Turning on the rewrite engine is necessary for the following rules and 9 | # features. "+FollowSymLinks" must be enabled for this to work symbolically. 10 | 11 | 12 | Options +FollowSymLinks 13 | RewriteEngine On 14 | php_value safe_mode off 15 | 16 | 17 | # For all files not found in the file system, reroute the request to the 18 | # "index.php" front controller, keeping the query string intact 19 | 20 | 21 | RewriteCond %{REQUEST_FILENAME} !-f 22 | RewriteCond %{REQUEST_FILENAME} !-d 23 | RewriteRule ^(.*)$ index.php/$1 [L] 24 | 25 | 26 | 27 | Order allow,deny 28 | Allow from all -------------------------------------------------------------------------------- /public/assets/css/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cygnite/cygnite-application/6bf00491ceea9b1ec31b41378edb55a78832a11b/public/assets/css/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/assets/css/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cygnite/cygnite-application/6bf00491ceea9b1ec31b41378edb55a78832a11b/public/assets/css/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/assets/css/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cygnite/cygnite-application/6bf00491ceea9b1ec31b41378edb55a78832a11b/public/assets/css/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/assets/css/bootstrap/js/affix.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: affix.js v3.0.0 3 | * http://twbs.github.com/bootstrap/javascript.html#affix 4 | * ======================================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================================== */ 19 | 20 | 21 | +function ($) { "use strict"; 22 | 23 | // AFFIX CLASS DEFINITION 24 | // ====================== 25 | 26 | var Affix = function (element, options) { 27 | this.options = $.extend({}, Affix.DEFAULTS, options) 28 | this.$window = $(window) 29 | .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 30 | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 31 | 32 | this.$element = $(element) 33 | this.affixed = 34 | this.unpin = null 35 | 36 | this.checkPosition() 37 | } 38 | 39 | Affix.RESET = 'affix affix-top affix-bottom' 40 | 41 | Affix.DEFAULTS = { 42 | offset: 0 43 | } 44 | 45 | Affix.prototype.checkPositionWithEventLoop = function () { 46 | setTimeout($.proxy(this.checkPosition, this), 1) 47 | } 48 | 49 | Affix.prototype.checkPosition = function () { 50 | if (!this.$element.is(':visible')) return 51 | 52 | var scrollHeight = $(document).height() 53 | var scrollTop = this.$window.scrollTop() 54 | var position = this.$element.offset() 55 | var offset = this.options.offset 56 | var offsetTop = offset.top 57 | var offsetBottom = offset.bottom 58 | 59 | if (typeof offset != 'object') offsetBottom = offsetTop = offset 60 | if (typeof offsetTop == 'function') offsetTop = offset.top() 61 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() 62 | 63 | var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : 64 | offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : 65 | offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false 66 | 67 | if (this.affixed === affix) return 68 | if (this.unpin) this.$element.css('top', '') 69 | 70 | this.affixed = affix 71 | this.unpin = affix == 'bottom' ? position.top - scrollTop : null 72 | 73 | this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : '')) 74 | 75 | if (affix == 'bottom') { 76 | this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() }) 77 | } 78 | } 79 | 80 | 81 | // AFFIX PLUGIN DEFINITION 82 | // ======================= 83 | 84 | var old = $.fn.affix 85 | 86 | $.fn.affix = function (option) { 87 | return this.each(function () { 88 | var $this = $(this) 89 | var data = $this.data('bs.affix') 90 | var options = typeof option == 'object' && option 91 | 92 | if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 93 | if (typeof option == 'string') data[option]() 94 | }) 95 | } 96 | 97 | $.fn.affix.Constructor = Affix 98 | 99 | 100 | // AFFIX NO CONFLICT 101 | // ================= 102 | 103 | $.fn.affix.noConflict = function () { 104 | $.fn.affix = old 105 | return this 106 | } 107 | 108 | 109 | // AFFIX DATA-API 110 | // ============== 111 | 112 | $(window).on('load', function () { 113 | $('[data-spy="affix"]').each(function () { 114 | var $spy = $(this) 115 | var data = $spy.data() 116 | 117 | data.offset = data.offset || {} 118 | 119 | if (data.offsetBottom) data.offset.bottom = data.offsetBottom 120 | if (data.offsetTop) data.offset.top = data.offsetTop 121 | 122 | $spy.affix(data) 123 | }) 124 | }) 125 | 126 | }(window.jQuery); 127 | -------------------------------------------------------------------------------- /public/assets/css/bootstrap/js/alert.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: alert.js v3.0.0 3 | * http://twbs.github.com/bootstrap/javascript.html#alerts 4 | * ======================================================================== 5 | * Copyright 2013 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================================== */ 19 | 20 | 21 | +function ($) { "use strict"; 22 | 23 | // ALERT CLASS DEFINITION 24 | // ====================== 25 | 26 | var dismiss = '[data-dismiss="alert"]' 27 | var Alert = function (el) { 28 | $(el).on('click', dismiss, this.close) 29 | } 30 | 31 | Alert.prototype.close = function (e) { 32 | var $this = $(this) 33 | var selector = $this.attr('data-target') 34 | 35 | if (!selector) { 36 | selector = $this.attr('href') 37 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 38 | } 39 | 40 | var $parent = $(selector) 41 | 42 | if (e) e.preventDefault() 43 | 44 | if (!$parent.length) { 45 | $parent = $this.hasClass('alert') ? $this : $this.parent() 46 | } 47 | 48 | $parent.trigger(e = $.Event('close.bs.alert')) 49 | 50 | if (e.isDefaultPrevented()) return 51 | 52 | $parent.removeClass('in') 53 | 54 | function removeElement() { 55 | $parent.trigger('closed.bs.alert').remove() 56 | } 57 | 58 | $.support.transition && $parent.hasClass('fade') ? 59 | $parent 60 | .one($.support.transition.end, removeElement) 61 | .emulateTransitionEnd(150) : 62 | removeElement() 63 | } 64 | 65 | 66 | // ALERT PLUGIN DEFINITION 67 | // ======================= 68 | 69 | var old = $.fn.alert 70 | 71 | $.fn.alert = function (option) { 72 | return this.each(function () { 73 | var $this = $(this) 74 | var data = $this.data('bs.alert') 75 | 76 | if (!data) $this.data('bs.alert', (data = new Alert(this))) 77 | if (typeof option == 'string') data[option].call($this) 78 | }) 79 | } 80 | 81 | $.fn.alert.Constructor = Alert 82 | 83 | 84 | // ALERT NO CONFLICT 85 | // ================= 86 | 87 | $.fn.alert.noConflict = function () { 88 | $.fn.alert = old 89 | return this 90 | } 91 | 92 | 93 | // ALERT DATA-API 94 | // ============== 95 | 96 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 97 | 98 | }(window.jQuery); 99 | -------------------------------------------------------------------------------- /public/assets/css/bootstrap/js/button.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: button.js v3.0.0 3 | * http://twbs.github.com/bootstrap/javascript.html#buttons 4 | * ======================================================================== 5 | * Copyright 2013 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================================== */ 19 | 20 | 21 | +function ($) { "use strict"; 22 | 23 | // BUTTON PUBLIC CLASS DEFINITION 24 | // ============================== 25 | 26 | var Button = function (element, options) { 27 | this.$element = $(element) 28 | this.options = $.extend({}, Button.DEFAULTS, options) 29 | } 30 | 31 | Button.DEFAULTS = { 32 | loadingText: 'loading...' 33 | } 34 | 35 | Button.prototype.setState = function (state) { 36 | var d = 'disabled' 37 | var $el = this.$element 38 | var val = $el.is('input') ? 'val' : 'html' 39 | var data = $el.data() 40 | 41 | state = state + 'Text' 42 | 43 | if (!data.resetText) $el.data('resetText', $el[val]()) 44 | 45 | $el[val](data[state] || this.options[state]) 46 | 47 | // push to event loop to allow forms to submit 48 | setTimeout(function () { 49 | state == 'loadingText' ? 50 | $el.addClass(d).attr(d, d) : 51 | $el.removeClass(d).removeAttr(d); 52 | }, 0) 53 | } 54 | 55 | Button.prototype.toggle = function () { 56 | var $parent = this.$element.closest('[data-toggle="buttons"]') 57 | 58 | if ($parent.length) { 59 | var $input = this.$element.find('input') 60 | .prop('checked', !this.$element.hasClass('active')) 61 | .trigger('change') 62 | if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') 63 | } 64 | 65 | this.$element.toggleClass('active') 66 | } 67 | 68 | 69 | // BUTTON PLUGIN DEFINITION 70 | // ======================== 71 | 72 | var old = $.fn.button 73 | 74 | $.fn.button = function (option) { 75 | return this.each(function () { 76 | var $this = $(this) 77 | var data = $this.data('bs.button') 78 | var options = typeof option == 'object' && option 79 | 80 | if (!data) $this.data('bs.button', (data = new Button(this, options))) 81 | 82 | if (option == 'toggle') data.toggle() 83 | else if (option) data.setState(option) 84 | }) 85 | } 86 | 87 | $.fn.button.Constructor = Button 88 | 89 | 90 | // BUTTON NO CONFLICT 91 | // ================== 92 | 93 | $.fn.button.noConflict = function () { 94 | $.fn.button = old 95 | return this 96 | } 97 | 98 | 99 | // BUTTON DATA-API 100 | // =============== 101 | 102 | $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { 103 | var $btn = $(e.target) 104 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 105 | $btn.button('toggle') 106 | e.preventDefault() 107 | }) 108 | 109 | }(window.jQuery); 110 | -------------------------------------------------------------------------------- /public/assets/css/bootstrap/js/dropdown.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: dropdown.js v3.0.0 3 | * http://twbs.github.com/bootstrap/javascript.html#dropdowns 4 | * ======================================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================================== */ 19 | 20 | 21 | +function ($) { "use strict"; 22 | 23 | // DROPDOWN CLASS DEFINITION 24 | // ========================= 25 | 26 | var backdrop = '.dropdown-backdrop' 27 | var toggle = '[data-toggle=dropdown]' 28 | var Dropdown = function (element) { 29 | var $el = $(element).on('click.bs.dropdown', this.toggle) 30 | } 31 | 32 | Dropdown.prototype.toggle = function (e) { 33 | var $this = $(this) 34 | 35 | if ($this.is('.disabled, :disabled')) return 36 | 37 | var $parent = getParent($this) 38 | var isActive = $parent.hasClass('open') 39 | 40 | clearMenus() 41 | 42 | if (!isActive) { 43 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 44 | // if mobile we we use a backdrop because click events don't delegate 45 | $('