├── public ├── favicon.ico ├── packages │ └── .gitkeep ├── robots.txt ├── img │ ├── image1.jpg │ ├── image2.jpg │ ├── image3.jpg │ ├── image4.jpg │ └── image5.jpg ├── css │ ├── icomoon │ │ ├── icomoon.eot │ │ ├── icomoon.ttf │ │ ├── icomoon.woff │ │ ├── icomoon.svg │ │ └── icomoon.dev.svg │ ├── fonts │ │ └── medium-icons.woff │ └── styles.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.svg ├── .htaccess ├── index.php └── js │ ├── app.js │ └── vendor │ ├── grande.js │ └── bootstrap.min.js ├── app ├── commands │ └── .gitkeep ├── config │ ├── packages │ │ └── .gitkeep │ ├── blog.php │ ├── compile.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── workbench.php │ ├── view.php │ ├── queue.php │ ├── auth.php │ ├── cache.php │ ├── database.php │ ├── mail.php │ ├── session.php │ └── app.php ├── controllers │ ├── .gitkeep │ ├── Admin │ │ ├── PostsController.php │ │ └── CommentsController.php │ ├── BaseController.php │ └── AuthController.php ├── database │ ├── seeds │ │ ├── .gitkeep │ │ ├── DatabaseSeeder.php │ │ ├── UserSeeder.php │ │ └── PostSeeder.php │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2013_10_18_064413_create_tags_table.php │ │ ├── 2013_10_18_064415_create_post_tag_table.php │ │ ├── 2013_10_18_064417_create_categories_table.php │ │ ├── 2013_10_18_070220_create_category_post_table.php │ │ ├── 2013_10_18_064256_create_users_table.php │ │ ├── 2013_10_18_064423_create_comments_table.php │ │ └── 2013_10_18_064412_create_posts_table.php │ └── production.sqlite ├── start │ ├── local.php │ ├── artisan.php │ └── global.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── models │ ├── Tag.php │ ├── Category.php │ ├── Comment.php │ ├── Post.php │ └── User.php ├── tests │ ├── ExampleTest.php │ └── TestCase.php ├── views │ ├── layouts │ │ └── default.blade.php │ └── blog.blade.php ├── routes.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php └── filters.php ├── .gitignore ├── CONTRIBUTING.md ├── server.php ├── phpunit.xml ├── composer.json ├── Boxfile ├── readme.md ├── bootstrap ├── paths.php ├── start.php └── autoload.php └── artisan /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/start/local.php: -------------------------------------------------------------------------------- 1 | belongsToMany('Post'); 8 | } 9 | } -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/codrops-medium-style-page-transitions/master/public/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/codrops-medium-style-page-transitions/master/public/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/codrops-medium-style-page-transitions/master/public/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /app/models/Category.php: -------------------------------------------------------------------------------- 1 | belongsToMany('Post'); 8 | } 9 | } -------------------------------------------------------------------------------- /app/config/blog.php: -------------------------------------------------------------------------------- 1 | array( 7 | 'admin' => 40, 8 | 'contributor' => 30, 9 | 'user' => 10 10 | ), 11 | ); -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Options -MultiViews 3 | RewriteEngine On 4 | 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteRule ^ index.php [L] 8 | -------------------------------------------------------------------------------- /app/controllers/Admin/PostsController.php: -------------------------------------------------------------------------------- 1 | layout->content = View::make('admin.posts.index'); 10 | } 11 | } -------------------------------------------------------------------------------- /app/controllers/Admin/CommentsController.php: -------------------------------------------------------------------------------- 1 | layout->content = View::make('admin.comments.index'); 10 | } 11 | } -------------------------------------------------------------------------------- /app/tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /app/models/Comment.php: -------------------------------------------------------------------------------- 1 | belongsTo('User'); 8 | } 9 | 10 | public function post() 11 | { 12 | return $this->belongsTo('Post'); 13 | } 14 | 15 | public function parentComment() 16 | { 17 | return $this->belongsTo('Comment'); 18 | } 19 | } -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | call('UserSeeder'); 15 | $this->command->info('User table seeded!'); 16 | 17 | $this->call('PostSeeder'); 18 | $this->command->info('Post table seeded!'); 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /app/views/layouts/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | {{ HTML::style('css/bootstrap.min.css')}} 7 | 8 | 9 |
10 | @yield('content') 11 |
12 | {{ HTML::script('js/vendor/jquery-1.9.1.min.js')}} 13 | {{ HTML::script('js/vendor/bootstrap.min.js')}} 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/database/seeds/UserSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 8 | 9 | User::create(array( 10 | 'id' => 1, 11 | 'email' => 'admin@email.com', 12 | 'password' => 'password', 13 | 'role' => '40', 14 | 'confirmed' => '1', 15 | 'name' => 'Admin', 16 | )); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/start/artisan.php: -------------------------------------------------------------------------------- 1 | count(); 6 | $currentPostID = Post::first()->id; 7 | $nextPostID = Post::first()->next; 8 | 9 | return View::make('blog', array('postCount'=>$postCount,'currentPostID'=>$currentPostID,'nextPostID'=>$nextPostID)); 10 | }); 11 | 12 | Route::get('api/posts/{id}', function($id) 13 | { 14 | $post = Post::find($id); 15 | $post->date = $post->date; 16 | $post->author = $post->user->name; 17 | $post->nextID = $post->next; 18 | 19 | return $post; 20 | }); -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_064413_create_tags_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('content')->unique(); 18 | $table->string('slug'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('tags'); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_064415_create_post_tag_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('post_id')->unsigned(); 18 | $table->integer('tag_id')->unsigned(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('post_tag'); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_064417_create_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('content')->unique(); 18 | $table->string('slug'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('categories'); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_070220_create_category_post_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('post_id')->unsigned(); 18 | $table->integer('category_id')->unsigned(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('category_post'); 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | ); -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_064256_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('role'); 18 | $table->boolean('confirmed'); 19 | $table->string('name'); 20 | $table->string('email')->unique(); 21 | $table->string('password'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('users'); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "4.0.*" 8 | }, 9 | "autoload": { 10 | "classmap": [ 11 | "app/commands", 12 | "app/controllers", 13 | "app/models", 14 | "app/database/migrations", 15 | "app/database/seeds", 16 | "app/tests/TestCase.php" 17 | ] 18 | }, 19 | "scripts": { 20 | "post-install-cmd": [ 21 | "php artisan optimize" 22 | ], 23 | "pre-update-cmd": [ 24 | "php artisan clear-compiled" 25 | ], 26 | "post-update-cmd": [ 27 | "php artisan optimize" 28 | ], 29 | "post-create-project-cmd": [ 30 | "php artisan key:generate" 31 | ] 32 | }, 33 | "config": { 34 | "preferred-install": "dist" 35 | }, 36 | "minimum-stability": "dev" 37 | } 38 | -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_064423_create_comments_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('user_id')->unsigned(); 18 | $table->integer('post_id')->unsigned(); 19 | $table->integer('comment_id')->unsigned(); 20 | $table->text('content'); 21 | $table->boolean('spam')->default(0); 22 | $table->boolean('approved')->default(0); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::drop('comments'); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /app/database/migrations/2013_10_18_064412_create_posts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('user_id')->unsigned(); 18 | $table->string('title', 300); 19 | $table->string('slug', 300); 20 | $table->string('description', 500); 21 | $table->string('image', 255); 22 | $table->text('content'); 23 | $table->boolean('published')->default('0'); 24 | $table->dateTime('published_at'); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::drop('posts'); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /Boxfile: -------------------------------------------------------------------------------- 1 | web1: 2 | document_root: public 3 | php_version: 5.4.14 4 | php_upload_max_filesize: "10M" 5 | php_post_max_size: "10M" 6 | php_extensions: 7 | - mbstring 8 | - mcrypt 9 | - curl 10 | - gd 11 | - pdo_mysql 12 | - redis 13 | - zip 14 | - xcache 15 | php_session_save_handler: redis 16 | php_session_save_path: "tcp://tunnel.pagodabox.com:6379" 17 | shared_writable_dirs: 18 | - app/storage/cache 19 | - app/storage/logs 20 | - app/storage/meta 21 | - app/storage/sessions 22 | - app/storage/views 23 | - /public/img/screenshots 24 | - /public/img/avatars 25 | - /public/img/screenshots/temp 26 | after_build: 27 | - "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install --prefer-source" 28 | after_deploy: 29 | - "rm -f app/storage/cache/*" 30 | - "php artisan cache:clear" 31 | - "rm -f app/storage/views/*" 32 | before_deploy: 33 | - "php artisan migrate" 34 | - "php artisan db:seed" 35 | cache1: 36 | type: redis 37 | 38 | db1: 39 | type: mysql -------------------------------------------------------------------------------- /app/models/Post.php: -------------------------------------------------------------------------------- 1 | 'required|unique:posts'); 8 | } 9 | 10 | public function updateRules() 11 | { 12 | return array('title' => 'required|unique:posts,title,'.$this->id); 13 | } 14 | 15 | public function tags() 16 | { 17 | return $this->belongsToMany('Tag'); 18 | } 19 | 20 | public function categories() 21 | { 22 | return $this->belongsToMany('Category'); 23 | } 24 | 25 | public function comments() 26 | { 27 | return $this->hasMany('Comment'); 28 | } 29 | 30 | public function user() 31 | { 32 | return $this->belongsTo('User'); 33 | } 34 | 35 | public function scopePublished($query) 36 | { 37 | return $query->where('published', true); 38 | } 39 | 40 | public function getDateAttribute() 41 | { 42 | $date = \Carbon\Carbon::createFromTimeStamp(strtotime($this->created_at))->diffForHumans(); 43 | return $date; 44 | } 45 | 46 | public function getNextAttribute() 47 | { 48 | $id = self::published()->where('id', '>', $this->id)->min('id'); 49 | return $id; 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/models/User.php: -------------------------------------------------------------------------------- 1 | getKey(); 30 | } 31 | 32 | /** 33 | * Get the password for the user. 34 | * 35 | * @return string 36 | */ 37 | public function getAuthPassword() 38 | { 39 | return $this->password; 40 | } 41 | 42 | /** 43 | * Get the e-mail address where password reminders are sent. 44 | * 45 | * @return string 46 | */ 47 | public function getReminderEmail() 48 | { 49 | return $this->email; 50 | } 51 | 52 | public function setPasswordAttribute($value) 53 | { 54 | $this->attributes['password'] = Hash::make($value); 55 | } 56 | 57 | public function isAdmin() 58 | { 59 | if ($this->role == Config::get('blog.roles.admin')) { 60 | return true; 61 | } else { 62 | return false; 63 | } 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | ), 42 | 43 | 'sqs' => array( 44 | 'driver' => 'sqs', 45 | 'key' => 'your-public-key', 46 | 'secret' => 'your-secret-key', 47 | 'queue' => 'your-queue-url', 48 | 'region' => 'us-east-1', 49 | ), 50 | 51 | 'iron' => array( 52 | 'driver' => 'iron', 53 | 'project' => 'your-project-id', 54 | 'token' => 'your-token', 55 | 'queue' => 'your-queue-name', 56 | ), 57 | 58 | ), 59 | 60 | ); 61 | -------------------------------------------------------------------------------- /app/controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | layout->content = View::make('login'); 10 | } 11 | 12 | public function postLogin() 13 | { 14 | $input = array( 15 | 'username' => Input::get( 'login_username' ), 16 | 'password' => Input::get( 'login_password' ) 17 | ); 18 | if (($input['password']!='') && Auth::attempt($input, Input::get( 'login_remember' ))) 19 | { 20 | return Redirect::intended('user'); 21 | } else { 22 | return Redirect::to('auth/login')->with('status','error')->withInput(); 23 | } 24 | } 25 | 26 | public function postRegister(){ 27 | 28 | $rules = array( 29 | 'username' => 'required|min:4|alpha_num|unique:users,username', 30 | 'email' => 'required|email|min:5|unique:users,email', 31 | 'password' => 'required|min:6|confirmed' 32 | ); 33 | 34 | $validation = Validator::make(Input::all(), $rules); 35 | 36 | if ( $validation -> fails()){ 37 | return Redirect::to('auth/login')->withErrors($validation)->withInput(); 38 | } 39 | 40 | $user = new User; 41 | 42 | $user->email = e(Input::get('email')); 43 | $user->username = e(Input::get('username')); 44 | $user->password = Input::get('password'); 45 | 46 | $user->save(); 47 | 48 | if ($user) { 49 | // user created, log them in 50 | Auth::login($user); 51 | return Redirect::to('user'); 52 | } else { 53 | return Redirect::to('/'); 54 | } 55 | } 56 | 57 | public function getLogout() 58 | { 59 | Auth::logout(); 60 | return Redirect::to('auth/login')->with('status','logout'); 61 | } 62 | } -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Laravel PHP Framework 2 | 3 | [![Latest Stable Version](https://poser.pugx.org/laravel/framework/version.png)](https://packagist.org/packages/laravel/framework) [![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.png)](https://packagist.org/packages/laravel/framework) [![Build Status](https://travis-ci.org/laravel/framework.png)](https://travis-ci.org/laravel/framework) 4 | 5 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching. 6 | 7 | Laravel aims to make the development process a pleasing one for the developer without sacrificing application functionality. Happy developers make the best code. To this end, we've attempted to combine the very best of what we have seen in other web frameworks, including frameworks implemented in other languages, such as Ruby on Rails, ASP.NET MVC, and Sinatra. 8 | 9 | Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. 10 | 11 | ## Official Documentation 12 | 13 | Documentation for the entire framework can be found on the [Laravel website](http://laravel.com/docs). 14 | 15 | ### Contributing To Laravel 16 | 17 | **All issues and pull requests should be filed on the [laravel/framework](http://github.com/laravel/framework) repository.** 18 | 19 | ### License 20 | 21 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 22 | -------------------------------------------------------------------------------- /bootstrap/paths.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful applications we have created for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Shutdown The Application 54 | |-------------------------------------------------------------------------- 55 | | 56 | | Once the app has finished running, we will fire off the shutdown events 57 | | so that any final work may be done by the application before we shut 58 | | down the process. This is the last thing to happen to the request. 59 | | 60 | */ 61 | 62 | $app->shutdown(); -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | | The "expire" time is the number of minutes that the reminder should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'reminder' => array( 62 | 63 | 'email' => 'emails.auth.reminder', 64 | 65 | 'table' => 'password_reminders', 66 | 67 | 'expire' => 60, 68 | 69 | ), 70 | 71 | ); -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | isAdmin()) return Redirect::guest('login'); 41 | }); 42 | 43 | Route::filter('auth', function() 44 | { 45 | if (Auth::guest()) return Redirect::guest('login'); 46 | }); 47 | 48 | 49 | Route::filter('auth.basic', function() 50 | { 51 | return Auth::basic(); 52 | }); 53 | 54 | /* 55 | |-------------------------------------------------------------------------- 56 | | Guest Filter 57 | |-------------------------------------------------------------------------- 58 | | 59 | | The "guest" filter is the counterpart of the authentication filters as 60 | | it simply checks that the current user is not logged in. A redirect 61 | | response will be issued if they are, which you may freely change. 62 | | 63 | */ 64 | 65 | Route::filter('guest', function() 66 | { 67 | if (Auth::check()) return Redirect::to('/'); 68 | }); 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | CSRF Protection Filter 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The CSRF filter is responsible for protecting your application against 76 | | cross-site request forgery attacks. If this special token in a user 77 | | session does not match the one given in this request, we'll bail. 78 | | 79 | */ 80 | 81 | Route::filter('csrf', function() 82 | { 83 | if (Session::token() != Input::get('_token')) 84 | { 85 | throw new Illuminate\Session\TokenMismatchException; 86 | } 87 | }); -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | redirectIfTrailingSlash(); 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Detect The Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Laravel takes a dead simple approach to your application environments 24 | | so you can just specify a machine name or HTTP host that matches a 25 | | given environment, then we will automatically detect it for you. 26 | | 27 | */ 28 | 29 | $env = $app->detectEnvironment(array( 30 | 31 | 'local' => array('your-machine-name'), 32 | 33 | )); 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Bind Paths 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here we are binding the paths configured in paths.php to the app. You 41 | | should not be changing these here. If you need to change these you 42 | | may do so within the paths.php file and they will be bound here. 43 | | 44 | */ 45 | 46 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Load The Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | Here we will load the Illuminate application. We'll keep this is in a 54 | | separate location so we can isolate the creation of an application 55 | | from the actual running of the application with a given request. 56 | | 57 | */ 58 | 59 | $framework = $app['path.base'].'/vendor/laravel/framework/src'; 60 | 61 | require $framework.'/Illuminate/Foundation/start.php'; 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | Return The Application 66 | |-------------------------------------------------------------------------- 67 | | 68 | | This script returns the application instance. The instance is given to 69 | | the calling script so we can separate the building of the instances 70 | | from the actual running of the application and sending responses. 71 | | 72 | */ 73 | 74 | return $app; 75 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | boot(); 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Load The Artisan Console Application 37 | |-------------------------------------------------------------------------- 38 | | 39 | | We'll need to run the script to load and return the Artisan console 40 | | application. We keep this in its own script so that we will load 41 | | the console application independent of running commands which 42 | | will allow us to fire commands from Routes when we want to. 43 | | 44 | */ 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/views/blog.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Medium-Style Article Transition 8 | 9 | 10 | 11 | 12 | 13 | 14 | 35 | 36 | 37 | 38 | 53 | 54 | 55 | 56 | 77 | 78 | -------------------------------------------------------------------------------- /app/config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => isset($_SERVER['DB1_HOST']) ? $_SERVER['DB1_HOST'] : 'localhost', 58 | 'database' => isset($_SERVER['DB1_NAME']) ? $_SERVER['DB1_NAME'] : 'laramedium', 59 | 'username' => isset($_SERVER['DB1_USER']) ? $_SERVER['DB1_USER'] : 'root', 60 | 'password' => isset($_SERVER['DB1_PASS']) ? $_SERVER['DB1_PASS'] : 'root', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => '', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'database', 70 | 'username' => 'root', 71 | 'password' => '', 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | ), 76 | 77 | 'sqlsrv' => array( 78 | 'driver' => 'sqlsrv', 79 | 'host' => 'localhost', 80 | 'database' => 'database', 81 | 'username' => 'root', 82 | 'password' => '', 83 | 'prefix' => '', 84 | ), 85 | 86 | ), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Migration Repository Table 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This table keeps track of all the migrations that have already run for 94 | | your application. Using this information, we can determine which of 95 | | the migrations on disk have not actually be run in the databases. 96 | | 97 | */ 98 | 99 | 'migrations' => 'migrations', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Redis Databases 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Redis is an open source, fast, and advanced key-value store that also 107 | | provides a richer set of commands than a typical key-value systems 108 | | such as APC or Memcached. Laravel makes it easy to dig right in. 109 | | 110 | */ 111 | 112 | 'redis' => array( 113 | 114 | 'cluster' => true, 115 | 116 | 'default' => array( 117 | 'host' => 'tunnel.pagodabox.com', 118 | 'port' => 6379, 119 | 'database' => 0, 120 | ), 121 | 122 | ), 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Postmark mail service, which will provide reliable delivery. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to delivery e-mails to 39 | | users of your application. Like the host we have set this value to 40 | | stay compatible with the Postmark e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => array('address' => null, 'name' => null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ); -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'native', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire when the browser closes, set it to zero. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Session File Location 37 | |-------------------------------------------------------------------------- 38 | | 39 | | When using the native session driver, we need a location where session 40 | | files may be stored. A default has been set for you but a different 41 | | location may be specified. This is only needed for file sessions. 42 | | 43 | */ 44 | 45 | 'files' => storage_path().'/sessions', 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Session Database Connection 50 | |-------------------------------------------------------------------------- 51 | | 52 | | When using the "database" session driver, you may specify the database 53 | | connection that should be used to manage your sessions. This should 54 | | correspond to a connection in your "database" configuration file. 55 | | 56 | */ 57 | 58 | 'connection' => null, 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | Session Database Table 63 | |-------------------------------------------------------------------------- 64 | | 65 | | When using the "database" session driver, you may specify the table we 66 | | should use to manage the sessions. Of course, a sensible default is 67 | | provided for you; however, you are free to change this as needed. 68 | | 69 | */ 70 | 71 | 'table' => 'sessions', 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | Session Sweeping Lottery 76 | |-------------------------------------------------------------------------- 77 | | 78 | | Some session drivers must manually sweep their storage location to get 79 | | rid of old sessions from storage. Here are the chances that it will 80 | | happen on a given request. By default, the odds are 2 out of 100. 81 | | 82 | */ 83 | 84 | 'lottery' => array(2, 100), 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | Session Cookie Name 89 | |-------------------------------------------------------------------------- 90 | | 91 | | Here you may change the name of the cookie used to identify a session 92 | | instance by ID. The name specified here will get used every time a 93 | | new session cookie is created by the framework for every driver. 94 | | 95 | */ 96 | 97 | 'cookie' => 'med_session', 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Session Cookie Path 102 | |-------------------------------------------------------------------------- 103 | | 104 | | The session cookie path determines the path for which the cookie will 105 | | be regarded as available. Typically, this will be the root path of 106 | | your application but you are free to change this when necessary. 107 | | 108 | */ 109 | 110 | 'path' => '/', 111 | 112 | /* 113 | |-------------------------------------------------------------------------- 114 | | Session Cookie Domain 115 | |-------------------------------------------------------------------------- 116 | | 117 | | Here you may change the domain of the cookie used to identify a session 118 | | in your application. This will determine which domains the cookie is 119 | | available to in your application. A sensible default has been set. 120 | | 121 | */ 122 | 123 | 'domain' => null, 124 | 125 | ); 126 | -------------------------------------------------------------------------------- /app/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => array( 25 | "numeric" => "The :attribute must be between :min - :max.", 26 | "file" => "The :attribute must be between :min - :max kilobytes.", 27 | "string" => "The :attribute must be between :min - :max characters.", 28 | "array" => "The :attribute must have between :min - :max items.", 29 | ), 30 | "confirmed" => "The :attribute confirmation does not match.", 31 | "date" => "The :attribute is not a valid date.", 32 | "date_format" => "The :attribute does not match the format :format.", 33 | "different" => "The :attribute and :other must be different.", 34 | "digits" => "The :attribute must be :digits digits.", 35 | "digits_between" => "The :attribute must be between :min and :max digits.", 36 | "email" => "The :attribute format is invalid.", 37 | "exists" => "The selected :attribute is invalid.", 38 | "image" => "The :attribute must be an image.", 39 | "in" => "The selected :attribute is invalid.", 40 | "integer" => "The :attribute must be an integer.", 41 | "ip" => "The :attribute must be a valid IP address.", 42 | "max" => array( 43 | "numeric" => "The :attribute may not be greater than :max.", 44 | "file" => "The :attribute may not be greater than :max kilobytes.", 45 | "string" => "The :attribute may not be greater than :max characters.", 46 | "array" => "The :attribute may not have more than :max items.", 47 | ), 48 | "mimes" => "The :attribute must be a file of type: :values.", 49 | "min" => array( 50 | "numeric" => "The :attribute must be at least :min.", 51 | "file" => "The :attribute must be at least :min kilobytes.", 52 | "string" => "The :attribute must be at least :min characters.", 53 | "array" => "The :attribute must have at least :min items.", 54 | ), 55 | "not_in" => "The selected :attribute is invalid.", 56 | "numeric" => "The :attribute must be a number.", 57 | "regex" => "The :attribute format is invalid.", 58 | "required" => "The :attribute field is required.", 59 | "required_if" => "The :attribute field is required when :other is :value.", 60 | "required_with" => "The :attribute field is required when :values is present.", 61 | "required_without" => "The :attribute field is required when :values is not present.", 62 | "same" => "The :attribute and :other must match.", 63 | "size" => array( 64 | "numeric" => "The :attribute must be :size.", 65 | "file" => "The :attribute must be :size kilobytes.", 66 | "string" => "The :attribute must be :size characters.", 67 | "array" => "The :attribute must contain :size items.", 68 | ), 69 | "unique" => "The :attribute has already been taken.", 70 | "url" => "The :attribute format is invalid.", 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Custom Validation Language Lines 75 | |-------------------------------------------------------------------------- 76 | | 77 | | Here you may specify custom validation messages for attributes using the 78 | | convention "attribute.rule" to name the lines. This makes it quick to 79 | | specify a specific custom language line for a given attribute rule. 80 | | 81 | */ 82 | 83 | 'custom' => array(), 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Custom Validation Attributes 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The following language lines are used to swap attribute place-holders 91 | | with something more reader friendly such as E-Mail Address instead 92 | | of "email". This simply helps us make messages a little cleaner. 93 | | 94 | */ 95 | 96 | 'attributes' => array(), 97 | 98 | ); 99 | -------------------------------------------------------------------------------- /app/database/seeds/PostSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 8 | 9 | Post::create(array( 10 | 'user_id' => '1', 11 | 'title' => 'First Post', 12 | 'slug' => 'first_post', 13 | 'description' => 'This is my first post', 14 | 'image' => 'img/image1.jpg', 15 | 'published_at' => '2013-10-24 10:10:10', 16 | 'published' => 1, 17 | 'content' => '

She closed the door, locked it, and put the key carefully in the pocket of her dress. And so, with Toto trotting along soberly behind her, she started on her journey.

Some takeaways

There were several roads near by, but it did not take her long to find the one paved with yellow bricks. Within a short time she was walking briskly toward the Emerald City, her silver shoes tinkling merrily on the hard, yellow road-bed. The sun shone bright and the birds sang sweetly, and Dorothy did not feel nearly so bad as you might think a little girl would who had been suddenly whisked away from her own country and set down in the midst of a strange land.

She was surprised, as she walked along, to see how pretty the country was about her. There were neat fences at the sides of the road, painted a dainty blue color, and beyond them were fields of grain and vegetables in abundance. Evidently the Munchkins were good farmers and able to raise large crops. Once in a while she would pass a house, and the people came out to look at her and bow low as she went by; for everyone knew she had been the means of destroying the Wicked Witch and setting them free from bondage. The houses of the Munchkins were odd-looking dwellings, for each was round, with a big dome for a roof. All were painted blue, for in this country of the East blue was the favorite color.

', 18 | )); 19 | 20 | Post::create(array( 21 | 'user_id' => '1', 22 | 'title' => 'Second Post', 23 | 'slug' => 'second_post', 24 | 'description' => 'This is my Second post', 25 | 'image' => 'img/image2.jpg', 26 | 'published_at' => '2013-10-26 10:15:10', 27 | 'published' => 1, 28 | 'content' => '

She closed the door, locked it, and put the key carefully in the pocket of her dress. And so, with Toto trotting along soberly behind her, she started on her journey.

Some takeaways

There were several roads near by, but it did not take her long to find the one paved with yellow bricks. Within a short time she was walking briskly toward the Emerald City, her silver shoes tinkling merrily on the hard, yellow road-bed. The sun shone bright and the birds sang sweetly, and Dorothy did not feel nearly so bad as you might think a little girl would who had been suddenly whisked away from her own country and set down in the midst of a strange land.

She was surprised, as she walked along, to see how pretty the country was about her. There were neat fences at the sides of the road, painted a dainty blue color, and beyond them were fields of grain and vegetables in abundance. Evidently the Munchkins were good farmers and able to raise large crops. Once in a while she would pass a house, and the people came out to look at her and bow low as she went by; for everyone knew she had been the means of destroying the Wicked Witch and setting them free from bondage. The houses of the Munchkins were odd-looking dwellings, for each was round, with a big dome for a roof. All were painted blue, for in this country of the East blue was the favorite color.

', 29 | )); 30 | 31 | Post::create(array( 32 | 'user_id' => '1', 33 | 'title' => 'Third Post', 34 | 'slug' => 'third_post', 35 | 'description' => 'This is my Third post', 36 | 'image' => 'img/image3.jpg', 37 | 'published_at' => '2013-10-26 10:15:10', 38 | 'published' => 1, 39 | 'content' => '

She closed the door, locked it, and put the key carefully in the pocket of her dress. And so, with Toto trotting along soberly behind her, she started on her journey.

Some takeaways

There were several roads near by, but it did not take her long to find the one paved with yellow bricks. Within a short time she was walking briskly toward the Emerald City, her silver shoes tinkling merrily on the hard, yellow road-bed. The sun shone bright and the birds sang sweetly, and Dorothy did not feel nearly so bad as you might think a little girl would who had been suddenly whisked away from her own country and set down in the midst of a strange land.

She was surprised, as she walked along, to see how pretty the country was about her. There were neat fences at the sides of the road, painted a dainty blue color, and beyond them were fields of grain and vegetables in abundance. Evidently the Munchkins were good farmers and able to raise large crops. Once in a while she would pass a house, and the people came out to look at her and bow low as she went by; for everyone knew she had been the means of destroying the Wicked Witch and setting them free from bondage. The houses of the Munchkins were odd-looking dwellings, for each was round, with a big dome for a roof. All were painted blue, for in this country of the East blue was the favorite color.

', 40 | )); 41 | } 42 | } -------------------------------------------------------------------------------- /public/js/app.js: -------------------------------------------------------------------------------- 1 | ArticleAnimator.load = function(){ 2 | this.currentPostIndex = getURLIndex(); 3 | this.makeSelections(); 4 | 5 | $body.append( this.$current ) 6 | $body.append( this.$next ) 7 | 8 | var self = this; 9 | this.createPost({ type: 'current' }, function(){ 10 | self.createPost({ type: 'next' }, function(){ 11 | 12 | /* Selections. */ 13 | self.refreshCurrentAndNextSelection(); 14 | 15 | /* Push initial on to stack */ 16 | history.pushState(pageState(), "", "#" + self.currentPostIndex) 17 | 18 | /* Bind to some events. */ 19 | self.bindGotoNextClick(); 20 | self.bindPopstate(); 21 | self.bindWindowScroll(); 22 | }) 23 | }) 24 | } 25 | 26 | ArticleAnimator.makeSelections = function(){ 27 | this.$page = $('.page'); 28 | this.pageTemplate = elementToTemplate( this.$page.clone() ); 29 | this.$current = this.currentElementClone(); 30 | this.$next = this.nextElementClone(); 31 | } 32 | 33 | ArticleAnimator.getPost = function(index, callback){ 34 | callback = callback || $.noop; 35 | 36 | if ( this.postCache[index] ){ 37 | callback( this.postCache[index] ); 38 | return; 39 | } 40 | 41 | var self = this; 42 | $.getJSON('api/posts/'+ index, function(d){ 43 | self.postCache[index] = d; 44 | callback(d) 45 | }); 46 | } 47 | 48 | ArticleAnimator.nextPostIndex = function(index){ 49 | return (index === this.postCount+this.firstPostIndex-1) ? this.firstPostIndex : this.nextPostID 50 | } 51 | 52 | ArticleAnimator.createPost = function(opts, callback){ 53 | opts = opts || {}; 54 | var self = this; 55 | var type = opts['type'] || 'next'; 56 | 57 | if ( opts['fromTemplate'] ){ 58 | $body.append( this.nextElementClone() ); 59 | this['$' + type] = $('.' + type) 60 | } 61 | 62 | var index = (type == 'next') ? this.nextPostIndex( this.currentPostIndex) : this.currentPostIndex; 63 | this.getPost(index, function(d){ 64 | self.nextPostID = d.nextID; 65 | self.contentizeElement(self['$' + type], d); 66 | callback && callback(); 67 | }); 68 | 69 | } 70 | 71 | ArticleAnimator.contentizeElement = function($el, d){ 72 | $el.find('.big-image').css({ backgroundImage: "url(" + d.image + ")" }); 73 | $el.find('h1.title').html(d.title); 74 | $el.find('h2.description').html(d.description); 75 | $el.find('.content .text').html(d.content); 76 | $el.find('h3.byline time').html(d.date); 77 | $el.find('h3.byline .author').html(d.author); 78 | } 79 | 80 | ArticleAnimator.animatePage = function(callback){ 81 | var self = this; 82 | var translationValue = this.$next.get(0).getBoundingClientRect().top; 83 | this.canScroll = false; 84 | 85 | this.$current.addClass('fade-up-out'); 86 | 87 | this.$next.removeClass('content-hidden next') 88 | .addClass('easing-upward') 89 | .css({ "transform": "translate3d(0, -"+ translationValue +"px, 0)" }); 90 | 91 | setTimeout(function(){ 92 | self.$current.remove(); 93 | self.$next.removeClass('easing-upward'); 94 | self.$next.css({ "transform": "" }); 95 | scrollTop(); 96 | 97 | self.$current = self.$next.addClass('current'); 98 | 99 | self.canScroll = true; 100 | self.currentPostIndex = self.nextPostIndex( self.currentPostIndex ); 101 | 102 | callback(); 103 | }, self.animationDuration ); 104 | } 105 | 106 | ArticleAnimator.bindGotoNextClick = function(){ 107 | var self = this; 108 | var e = 'ontouchstart' in window ? 'touchstart' : 'click'; 109 | 110 | this.$next.find('.big-image').on(e, function(e){ 111 | e.preventDefault(); 112 | $(this).unbind(e); 113 | 114 | self.animatePage(function(){ 115 | self.createPost({ fromTemplate: true, type: 'next' }); 116 | self.bindGotoNextClick(); 117 | history.pushState( pageState(), '', "#" + self.currentPostIndex); 118 | }); 119 | }); 120 | } 121 | 122 | ArticleAnimator.bindPopstate = function(){ 123 | var self = this; 124 | $window.on('popstate', function(e){ 125 | 126 | if( !history.state || self.initialLoad ){ 127 | self.initialLoad = false; 128 | return; 129 | } 130 | 131 | self.currentPostIndex = history.state.index; 132 | self.$current.replaceWith( history.state.current ); 133 | self.$next.replaceWith( history.state.next ); 134 | 135 | self.refreshCurrentAndNextSelection(); 136 | self.createPost({ type: 'next' }); 137 | self.bindGotoNextClick(); 138 | }); 139 | } 140 | 141 | ArticleAnimator.bindWindowScroll = function(){ 142 | var self = this; 143 | $window.on('mousewheel', function(ev){ 144 | if ( !self.canScroll ) 145 | ev.preventDefault() 146 | }) 147 | } 148 | 149 | ArticleAnimator.refreshCurrentAndNextSelection = function(){ 150 | this.$current = $('.page.current'); 151 | this.$next = $('.page.next'); 152 | } 153 | 154 | ArticleAnimator.nextElementClone = function(){ 155 | return this.$page.clone().removeClass('hidden').addClass('next content-hidden'); 156 | } 157 | 158 | ArticleAnimator.currentElementClone = function(){ 159 | return this.$page.clone().removeClass('hidden').addClass('current'); 160 | } 161 | 162 | /* 163 | Helper Functions. 164 | ************************************************************************/ 165 | function elementToTemplate($element){ 166 | return $element.get(0).outerHTML; 167 | } 168 | 169 | function scrollTop(){ 170 | $body.add($html).scrollTop(0); 171 | } 172 | 173 | function pageState(){ 174 | return { index: ArticleAnimator.currentPostIndex, current: elementToTemplate(ArticleAnimator.$current), next: elementToTemplate(ArticleAnimator.$next) } 175 | } 176 | 177 | function getURLIndex(){ 178 | return parseInt( (history.state && history.state.index) ||window.location.hash.replace('#', "") || ArticleAnimator.currentPostIndex ); 179 | } 180 | -------------------------------------------------------------------------------- /public/css/icomoon/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 31 | 34 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /public/css/icomoon/icomoon.dev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom SVG font generated by IcoMoon. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 31 | 34 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /public/css/styles.css: -------------------------------------------------------------------------------- 1 | /* line 2, ../scss/_extensions.scss */ 2 | .container, body article.page .content { 3 | max-width: 600px; 4 | margin: 0 auto; 5 | } 6 | 7 | /* line 7, ../scss/_extensions.scss */ 8 | .stretchy-bg, body article.page .big-image { 9 | background-position: center center; 10 | background-repeat: none; 11 | -webkit-background-size: cover; 12 | -moz-background-size: cover; 13 | -o-background-size: cover; 14 | background-size: cover; 15 | } 16 | 17 | /* line 13, ../scss/_extensions.scss */ 18 | .big-image, body article.page .big-image { 19 | height: 300px; 20 | } 21 | @media only screen and (min-width: 500px) { 22 | /* line 13, ../scss/_extensions.scss */ 23 | .big-image, body article.page .big-image { 24 | height: 420px; 25 | } 26 | } 27 | 28 | /* line 61, ../../../../../../../../../Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss */ 29 | * html { 30 | font-size: 125%; 31 | } 32 | 33 | /* line 64, ../../../../../../../../../Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss */ 34 | html { 35 | font-size: 20px; 36 | line-height: 0.3em; 37 | } 38 | 39 | /* line 4, ../scss/_mixins.scss */ 40 | ::-webkit-scrollbar { 41 | width: 3px; 42 | height: 3px; 43 | } 44 | 45 | /* line 9, ../scss/_mixins.scss */ 46 | ::-webkit-scrollbar-thumb { 47 | background: #666666; 48 | } 49 | 50 | /* line 13, ../scss/_mixins.scss */ 51 | ::-webkit-scrollbar-track { 52 | background: rgba(255, 255, 255, 0.1); 53 | } 54 | 55 | /* line 18, ../scss/_mixins.scss */ 56 | body { 57 | scrollbar-face-color: #666666; 58 | scrollbar-track-color: rgba(255, 255, 255, 0.1); 59 | } 60 | 61 | /* line 11, ../scss/styles.scss */ 62 | body { 63 | font-family: 'PT Serif', serif; 64 | color: #555; 65 | padding: 20px; 66 | padding: 0; 67 | margin: 0; 68 | -webkit-backface-visibility: hidden; 69 | -webkit-font-smoothing: antialiased; 70 | text-rendering: optimizeLegibility; 71 | line-height: 1.8em; 72 | /* Responsive typography, yay! */ 73 | font-size: 80%; 74 | /* Page-wrap styles. */ 75 | } 76 | @media only screen and (min-width: 500px) { 77 | /* line 11, ../scss/styles.scss */ 78 | body { 79 | font-size: 100%; 80 | } 81 | } 82 | /* line 27, ../scss/styles.scss */ 83 | body h1 { 84 | font-family: 'Source Sans Pro', serif; 85 | } 86 | /* line 31, ../scss/styles.scss */ 87 | body h1, body h2, body h3, body h4, body h5, body h6 { 88 | color: #333; 89 | } 90 | /* line 36, ../scss/styles.scss */ 91 | body article.page { 92 | -webkit-transform-origin: bottom center; 93 | /* Class applied when when page fades away. */ 94 | /* The large image that accompanies every post. */ 95 | /* The content. */ 96 | } 97 | /* line 39, ../scss/styles.scss */ 98 | body article.page.hidden { 99 | display: none; 100 | } 101 | /* line 42, ../scss/styles.scss */ 102 | body article.page.next .big-image, body article.page.next .big-image { 103 | cursor: pointer; 104 | } 105 | /* line 43, ../scss/styles.scss */ 106 | body article.page.next .big-image .inner, body article.page.next .big-image .inner { 107 | opacity: 1; 108 | } 109 | /* line 47, ../scss/styles.scss */ 110 | body article.page.content-hidden .content { 111 | display: none; 112 | } 113 | /* line 51, ../scss/styles.scss */ 114 | body article.page.fade-up-out { 115 | opacity: 0; 116 | -webkit-transform: scale(0.8) translate3d(0, -10%, 0); 117 | -moz-transform: scale(0.8) translate3d(0, -10%, 0); 118 | -ms-transform: scale(0.8) translate3d(0, -10%, 0); 119 | -o-transform: scale(0.8) translate3d(0, -10%, 0); 120 | transform: scale(0.8) translate3d(0, -10%, 0); 121 | -webkit-transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 122 | -moz-transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 123 | -o-transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 124 | transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 125 | } 126 | /* line 57, ../scss/styles.scss */ 127 | body article.page.easing-upward { 128 | -webkit-transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 129 | -moz-transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 130 | -o-transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 131 | transition: all 450ms cubic-bezier(0.165, 0.84, 0.44, 1); 132 | } 133 | /* line 62, ../scss/styles.scss */ 134 | body article.page .big-image, body article.page .big-image { 135 | font-size: 80%; 136 | } 137 | @media only screen and (min-width: 500px) { 138 | /* line 62, ../scss/styles.scss */ 139 | body article.page .big-image, body article.page .big-image { 140 | font-size: 100%; 141 | } 142 | } 143 | /* line 69, ../scss/styles.scss */ 144 | body article.page .big-image .inner, body article.page .big-image .inner { 145 | position: relative; 146 | width: 100%; 147 | height: 100%; 148 | text-align: center; 149 | overflow: hidden; 150 | opacity: 0; 151 | text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2); 152 | -webkit-transition: all 0.5s ease; 153 | -moz-transition: all 0.5s ease; 154 | -o-transition: all 0.5s ease; 155 | transition: all 0.5s ease; 156 | } 157 | /* line 78, ../scss/styles.scss */ 158 | body article.page .big-image .inner .fader, body article.page .big-image .inner .fader { 159 | width: 100%; 160 | height: 100%; 161 | background: rgba(0, 0, 0, 0.6); 162 | } 163 | /* line 83, ../scss/styles.scss */ 164 | body article.page .big-image .inner .fader .text { 165 | position: absolute; 166 | top: 50%; 167 | left: 50%; 168 | width: 80%; 169 | -webkit-transform: translateX(-50%) translateY(-50%); 170 | -moz-transform: translateX(-50%) translateY(-50%); 171 | -ms-transform: translateX(-50%) translateY(-50%); 172 | -o-transform: translateX(-50%) translateY(-50%); 173 | transform: translateX(-50%) translateY(-50%); 174 | } 175 | /* line 89, ../scss/styles.scss */ 176 | body article.page .big-image .inner .fader .text a, body article.page .big-image .inner .fader .text h1, body article.page .big-image .inner .fader .text h2 { 177 | color: white; 178 | } 179 | /* line 91, ../scss/styles.scss */ 180 | body article.page .big-image .inner .fader .text a { 181 | color: white; 182 | border-bottom: 1px solid white; 183 | text-decoration: none; 184 | font-style: italic; 185 | font-size: 0.8em; 186 | line-height: 1.5em; 187 | } 188 | /* line 99, ../scss/styles.scss */ 189 | body article.page .big-image .inner .fader .text h1 { 190 | margin: 0; 191 | margin-top: 0.1em; 192 | padding-top: 0em; 193 | padding-bottom: 0em; 194 | margin-bottom: 0em; 195 | font-size: 3em; 196 | line-height: 1.1em; 197 | } 198 | /* line 105, ../scss/styles.scss */ 199 | body article.page .big-image .inner .fader .text h2 { 200 | margin: 0; 201 | font-style: italic; 202 | font-weight: normal; 203 | margin-top: 0.2em; 204 | padding-top: 0em; 205 | padding-bottom: 0em; 206 | margin-bottom: 0em; 207 | font-size: 1.5em; 208 | line-height: 1.2em; 209 | } 210 | /* line 119, ../scss/styles.scss */ 211 | body article.page .content { 212 | padding: 0 3em; 213 | } 214 | /* line 123, ../scss/styles.scss */ 215 | body article.page .content h3 { 216 | color: #999; 217 | font-family: 'Source Sans Pro', serif; 218 | font-weight: 400; 219 | margin-top: 3em; 220 | padding-top: 0em; 221 | padding-bottom: 0em; 222 | margin-bottom: 0.375em; 223 | font-size: 0.8em; 224 | line-height: 1.5em; 225 | } 226 | /* line 131, ../scss/styles.scss */ 227 | body article.page .content h1 { 228 | margin-top: 0em; 229 | padding-top: 0em; 230 | padding-bottom: 0em; 231 | margin-bottom: 0.24em; 232 | font-size: 2.5em; 233 | line-height: 1.08em; 234 | } 235 | /* line 136, ../scss/styles.scss */ 236 | body article.page .content h2.description { 237 | font-weight: normal; 238 | font-style: italic; 239 | } 240 | /* line 140, ../scss/styles.scss */ 241 | body article.page .content p:last-child { 242 | margin-bottom: 3em; 243 | } 244 | -------------------------------------------------------------------------------- /app/config/app.php: -------------------------------------------------------------------------------- 1 | true, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application URL 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This URL is used by the console to properly generate URLs when using 24 | | the Artisan command line tool. You should set this to the root of 25 | | your application so that it is used when running Artisan tasks. 26 | | 27 | */ 28 | 29 | 'url' => 'http://localhost', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Timezone 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify the default timezone for your application, which 37 | | will be used by the PHP date and date-time functions. We have gone 38 | | ahead and set this to a sensible default for you out of the box. 39 | | 40 | */ 41 | 42 | 'timezone' => 'UTC', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application Locale Configuration 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The application locale determines the default locale that will be used 50 | | by the translation service provider. You are free to set this value 51 | | to any of the locales which will be supported by the application. 52 | | 53 | */ 54 | 55 | 'locale' => 'en', 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Encryption Key 60 | |-------------------------------------------------------------------------- 61 | | 62 | | This key is used by the Illuminate encrypter service and should be set 63 | | to a random, 32 character string, otherwise these encrypted strings 64 | | will not be safe. Please do this before deploying an application! 65 | | 66 | */ 67 | 68 | 'key' => 'ZnDfbD26yd38QLumFVU4VdcaRPWsmuDV', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Autoloaded Service Providers 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The service providers listed here will be automatically loaded on the 76 | | request to your application. Feel free to add your own services to 77 | | this array to grant expanded functionality to your applications. 78 | | 79 | */ 80 | 81 | 'providers' => array( 82 | 83 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 84 | 'Illuminate\Auth\AuthServiceProvider', 85 | 'Illuminate\Cache\CacheServiceProvider', 86 | 'Illuminate\Foundation\Providers\CommandCreatorServiceProvider', 87 | 'Illuminate\Session\CommandsServiceProvider', 88 | 'Illuminate\Foundation\Providers\ComposerServiceProvider', 89 | 'Illuminate\Routing\ControllerServiceProvider', 90 | 'Illuminate\Cookie\CookieServiceProvider', 91 | 'Illuminate\Database\DatabaseServiceProvider', 92 | 'Illuminate\Encryption\EncryptionServiceProvider', 93 | 'Illuminate\Filesystem\FilesystemServiceProvider', 94 | 'Illuminate\Hashing\HashServiceProvider', 95 | 'Illuminate\Html\HtmlServiceProvider', 96 | 'Illuminate\Foundation\Providers\KeyGeneratorServiceProvider', 97 | 'Illuminate\Log\LogServiceProvider', 98 | 'Illuminate\Mail\MailServiceProvider', 99 | 'Illuminate\Foundation\Providers\MaintenanceServiceProvider', 100 | 'Illuminate\Database\MigrationServiceProvider', 101 | 'Illuminate\Foundation\Providers\OptimizeServiceProvider', 102 | 'Illuminate\Pagination\PaginationServiceProvider', 103 | 'Illuminate\Foundation\Providers\PublisherServiceProvider', 104 | 'Illuminate\Queue\QueueServiceProvider', 105 | 'Illuminate\Redis\RedisServiceProvider', 106 | 'Illuminate\Auth\Reminders\ReminderServiceProvider', 107 | 'Illuminate\Foundation\Providers\RouteListServiceProvider', 108 | 'Illuminate\Database\SeedServiceProvider', 109 | 'Illuminate\Foundation\Providers\ServerServiceProvider', 110 | 'Illuminate\Session\SessionServiceProvider', 111 | 'Illuminate\Foundation\Providers\TinkerServiceProvider', 112 | 'Illuminate\Translation\TranslationServiceProvider', 113 | 'Illuminate\Validation\ValidationServiceProvider', 114 | 'Illuminate\View\ViewServiceProvider', 115 | 'Illuminate\Workbench\WorkbenchServiceProvider', 116 | 117 | ), 118 | 119 | /* 120 | |-------------------------------------------------------------------------- 121 | | Service Provider Manifest 122 | |-------------------------------------------------------------------------- 123 | | 124 | | The service provider manifest is used by Laravel to lazy load service 125 | | providers which are not needed for each request, as well to keep a 126 | | list of all of the services. Here, you may set its storage spot. 127 | | 128 | */ 129 | 130 | 'manifest' => storage_path().'/meta', 131 | 132 | /* 133 | |-------------------------------------------------------------------------- 134 | | Class Aliases 135 | |-------------------------------------------------------------------------- 136 | | 137 | | This array of class aliases will be registered when this application 138 | | is started. However, feel free to register as many as you wish as 139 | | the aliases are "lazy" loaded so they don't hinder performance. 140 | | 141 | */ 142 | 143 | 'aliases' => array( 144 | 145 | 'App' => 'Illuminate\Support\Facades\App', 146 | 'Artisan' => 'Illuminate\Support\Facades\Artisan', 147 | 'Auth' => 'Illuminate\Support\Facades\Auth', 148 | 'Blade' => 'Illuminate\Support\Facades\Blade', 149 | 'Cache' => 'Illuminate\Support\Facades\Cache', 150 | 'ClassLoader' => 'Illuminate\Support\ClassLoader', 151 | 'Config' => 'Illuminate\Support\Facades\Config', 152 | 'Controller' => 'Illuminate\Routing\Controllers\Controller', 153 | 'Cookie' => 'Illuminate\Support\Facades\Cookie', 154 | 'Crypt' => 'Illuminate\Support\Facades\Crypt', 155 | 'DB' => 'Illuminate\Support\Facades\DB', 156 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 157 | 'Event' => 'Illuminate\Support\Facades\Event', 158 | 'File' => 'Illuminate\Support\Facades\File', 159 | 'Form' => 'Illuminate\Support\Facades\Form', 160 | 'Hash' => 'Illuminate\Support\Facades\Hash', 161 | 'HTML' => 'Illuminate\Support\Facades\HTML', 162 | 'Input' => 'Illuminate\Support\Facades\Input', 163 | 'Lang' => 'Illuminate\Support\Facades\Lang', 164 | 'Log' => 'Illuminate\Support\Facades\Log', 165 | 'Mail' => 'Illuminate\Support\Facades\Mail', 166 | 'Paginator' => 'Illuminate\Support\Facades\Paginator', 167 | 'Password' => 'Illuminate\Support\Facades\Password', 168 | 'Queue' => 'Illuminate\Support\Facades\Queue', 169 | 'Redirect' => 'Illuminate\Support\Facades\Redirect', 170 | 'Redis' => 'Illuminate\Support\Facades\Redis', 171 | 'Request' => 'Illuminate\Support\Facades\Request', 172 | 'Response' => 'Illuminate\Support\Facades\Response', 173 | 'Route' => 'Illuminate\Support\Facades\Route', 174 | 'Schema' => 'Illuminate\Support\Facades\Schema', 175 | 'Seeder' => 'Illuminate\Database\Seeder', 176 | 'Session' => 'Illuminate\Support\Facades\Session', 177 | 'Str' => 'Illuminate\Support\Str', 178 | 'URL' => 'Illuminate\Support\Facades\URL', 179 | 'Validator' => 'Illuminate\Support\Facades\Validator', 180 | 'View' => 'Illuminate\Support\Facades\View', 181 | 182 | ), 183 | 184 | ); 185 | -------------------------------------------------------------------------------- /public/js/vendor/grande.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var EDGE = -999; 3 | 4 | var root = this, // Root object, this is going to be the window for now 5 | document = this.document, // Safely store a document here for us to use 6 | editableNodes = document.querySelectorAll(".g-body article"), 7 | editNode = editableNodes[0], // TODO: cross el support for imageUpload 8 | isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1, 9 | options = { 10 | animate: true 11 | }, 12 | textMenu, 13 | optionsNode, 14 | urlInput, 15 | previouslySelectedText, 16 | imageTooltip, 17 | imageInput, 18 | imageBound; 19 | 20 | grande = { 21 | bind: function(bindableNodes, opts) { 22 | if (bindableNodes) { 23 | editableNodes = bindableNodes; 24 | } 25 | 26 | options = opts || options; 27 | 28 | attachToolbarTemplate(); 29 | bindTextSelectionEvents(); 30 | bindTextStylingEvents(); 31 | }, 32 | select: function() { 33 | triggerTextSelection(); 34 | } 35 | }, 36 | 37 | tagClassMap = { 38 | "b": "bold", 39 | "i": "italic", 40 | "h1": "header1", 41 | "h2": "header2", 42 | "a": "url", 43 | "blockquote": "quote" 44 | }; 45 | 46 | function attachToolbarTemplate() { 47 | var div = document.createElement("div"), 48 | toolbarTemplate = "
\ 49 | \ 50 | \ 51 | \ 52 | \ 53 | \ 54 | \ 55 | \ 56 | \ 57 | \ 58 | \ 59 | \ 60 |
", 61 | imageTooltipTemplate = document.createElement("div"); 62 | 63 | imageTooltipTemplate.innerHTML = "
Insert image
\ 64 | "; 65 | imageTooltipTemplate.className = "image-tooltip hide"; 66 | 67 | div.className = "text-menu hide"; 68 | div.innerHTML = toolbarTemplate; 69 | 70 | if (document.querySelectorAll(".text-menu").length === 0) { 71 | document.body.appendChild(div); 72 | document.body.appendChild(imageTooltipTemplate); 73 | } 74 | 75 | imageInput = document.querySelectorAll(".file-label + input")[0]; 76 | imageTooltip = document.querySelectorAll(".image-tooltip")[0]; 77 | textMenu = document.querySelectorAll(".text-menu")[0]; 78 | optionsNode = document.querySelectorAll(".text-menu .options")[0]; 79 | urlInput = document.querySelectorAll(".text-menu .url-input")[0]; 80 | } 81 | 82 | function bindTextSelectionEvents() { 83 | var i, 84 | len, 85 | node; 86 | 87 | // Trigger on both mousedown and mouseup so that the click on the menu 88 | // feels more instantaneously active 89 | document.onmousedown = triggerTextSelection; 90 | document.onmouseup = function(event) { 91 | setTimeout(function() { 92 | triggerTextSelection(event); 93 | }, 1); 94 | }; 95 | 96 | document.onkeydown = preprocessKeyDown; 97 | 98 | document.onkeyup = function(event){ 99 | var sel = window.getSelection(); 100 | 101 | // FF will return sel.anchorNode to be the parentNode when the triggered keyCode is 13 102 | if (sel.anchorNode && sel.anchorNode.nodeName !== "ARTICLE") { 103 | triggerNodeAnalysis(event); 104 | 105 | if (sel.isCollapsed) { 106 | triggerTextParse(event); 107 | } 108 | } 109 | }; 110 | 111 | // Handle window resize events 112 | root.onresize = triggerTextSelection; 113 | 114 | urlInput.onblur = triggerUrlBlur; 115 | urlInput.onkeydown = triggerUrlSet; 116 | 117 | if (options.allowImages) { 118 | imageTooltip.onmousedown = triggerImageUpload; 119 | imageInput.onchange = uploadImage; 120 | document.onmousemove = triggerOverlayStyling; 121 | } 122 | 123 | for (i = 0, len = editableNodes.length; i < len; i++) { 124 | node = editableNodes[i]; 125 | node.contentEditable = true; 126 | node.onmousedown = node.onkeyup = node.onmouseup = triggerTextSelection; 127 | } 128 | } 129 | 130 | function triggerOverlayStyling(event) { 131 | toggleImageTooltip(event, event.target); 132 | } 133 | 134 | function triggerImageUpload(event) { 135 | // Cache the bound that was originally clicked on before the image upload 136 | var childrenNodes = editNode.children, 137 | editBounds = editNode.getBoundingClientRect(); 138 | 139 | imageBound = getHorizontalBounds(childrenNodes, editBounds); 140 | } 141 | 142 | function uploadImage(event) { 143 | // Only allow uploading of 1 image for now, this is the first file 144 | var file = this.files[0], 145 | reader = new FileReader(), 146 | figEl; 147 | 148 | reader.onload = (function(f) { 149 | return function(e) { 150 | figEl = document.createElement("figure"); 151 | figEl.innerHTML = ""; 152 | editNode.insertBefore(figEl, imageBound.bottomElement); 153 | }; 154 | }(file)); 155 | 156 | reader.readAsDataURL(file); 157 | } 158 | 159 | function toggleImageTooltip(event, element) { 160 | var childrenNodes = editNode.children, 161 | editBounds = editNode.getBoundingClientRect(), 162 | bound = getHorizontalBounds(childrenNodes, editBounds); 163 | 164 | if (bound) { 165 | imageTooltip.style.left = (editBounds.left - 90 ) + "px"; 166 | imageTooltip.style.top = (bound.top - 17) + "px"; 167 | } else { 168 | imageTooltip.style.left = EDGE + "px"; 169 | imageTooltip.style.top = EDGE + "px"; 170 | } 171 | } 172 | 173 | function getHorizontalBounds(nodes, target) { 174 | var bounds = [], 175 | bound, 176 | i, 177 | len, 178 | preNode, 179 | postNode, 180 | bottomBound, 181 | topBound, 182 | coordY; 183 | 184 | // Compute top and bottom bounds for each child element 185 | for (i = 0, len = nodes.length - 1; i < len; i++) { 186 | preNode = nodes[i]; 187 | postNode = nodes[i+1] || null; 188 | 189 | bottomBound = preNode.getBoundingClientRect().bottom - 5; 190 | topBound = postNode.getBoundingClientRect().top; 191 | 192 | bounds.push({ 193 | top: topBound, 194 | bottom: bottomBound, 195 | topElement: preNode, 196 | bottomElement: postNode, 197 | index: i+1 198 | }); 199 | } 200 | 201 | coordY = event.pageY - root.scrollY; 202 | 203 | // Find if there is a range to insert the image tooltip between two elements 204 | for (i = 0, len = bounds.length; i < len; i++) { 205 | bound = bounds[i]; 206 | if (coordY < bound.top && coordY > bound.bottom) { 207 | return bound; 208 | } 209 | } 210 | 211 | return null; 212 | } 213 | 214 | function iterateTextMenuButtons(callback) { 215 | var textMenuButtons = document.querySelectorAll(".text-menu button"), 216 | i, 217 | len, 218 | node; 219 | 220 | for (i = 0, len = textMenuButtons.length; i < len; i++) { 221 | node = textMenuButtons[i]; 222 | 223 | (function(n) { 224 | callback(n); 225 | })(node); 226 | } 227 | } 228 | 229 | function bindTextStylingEvents() { 230 | iterateTextMenuButtons(function(node) { 231 | node.onmousedown = function(event) { 232 | triggerTextStyling(node); 233 | }; 234 | }); 235 | } 236 | 237 | function getFocusNode() { 238 | return root.getSelection().focusNode; 239 | } 240 | 241 | function reloadMenuState() { 242 | var className, 243 | focusNode = getFocusNode(), 244 | tagClass, 245 | reTag; 246 | 247 | iterateTextMenuButtons(function(node) { 248 | className = node.className; 249 | 250 | for (var tag in tagClassMap) { 251 | tagClass = tagClassMap[tag]; 252 | reTag = new RegExp(tagClass); 253 | 254 | if (reTag.test(className)) { 255 | if (hasParentWithTag(focusNode, tag)) { 256 | node.className = tagClass + " active"; 257 | } else { 258 | node.className = tagClass; 259 | } 260 | 261 | break; 262 | } 263 | } 264 | }); 265 | } 266 | 267 | function preprocessKeyDown(event) { 268 | var sel = window.getSelection(), 269 | parentParagraph = getParentWithTag(sel.anchorNode, "p"), 270 | p, 271 | isHr; 272 | 273 | if (event.keyCode === 13 && parentParagraph) { 274 | prevSibling = parentParagraph.previousSibling; 275 | isHr = prevSibling && prevSibling.nodeName === "HR" && 276 | !parentParagraph.textContent.length; 277 | 278 | // Stop enters from creating another

after a


on enter 279 | if (isHr) { 280 | event.preventDefault(); 281 | } 282 | } 283 | } 284 | 285 | function triggerNodeAnalysis(event) { 286 | var sel = window.getSelection(), 287 | anchorNode, 288 | parentParagraph; 289 | 290 | if (event.keyCode === 13) { 291 | 292 | // Enters should replace it's parent
with a

293 | if (sel.anchorNode.nodeName === "DIV") { 294 | toggleFormatBlock("p"); 295 | } 296 | 297 | parentParagraph = getParentWithTag(sel.anchorNode, "p"); 298 | 299 | if (parentParagraph) { 300 | insertHorizontalRule(parentParagraph); 301 | } 302 | } 303 | } 304 | 305 | function insertHorizontalRule(parentParagraph) { 306 | var prevSibling, 307 | prevPrevSibling, 308 | hr; 309 | 310 | prevSibling = parentParagraph.previousSibling; 311 | prevPrevSibling = prevSibling; 312 | 313 | while(prevPrevSibling = prevPrevSibling.previousSibling) { 314 | if (prevPrevSibling.nodeType != Node.TEXT_NODE) { 315 | break; 316 | } 317 | } 318 | 319 | if (prevSibling.nodeName === "P" && !prevSibling.textContent.length && prevPrevSibling.nodeName !== "HR") { 320 | hr = document.createElement("hr"); 321 | hr.contentEditable = false; 322 | parentParagraph.parentNode.replaceChild(hr, prevSibling); 323 | } 324 | } 325 | 326 | function getTextProp(el) { 327 | var textProp; 328 | 329 | if (el.nodeType === Node.TEXT_NODE) { 330 | textProp = "data"; 331 | } else if (isFirefox) { 332 | textProp = "textContent"; 333 | } else { 334 | textProp = "innerText"; 335 | } 336 | 337 | return textProp; 338 | } 339 | 340 | function insertListOnSelection(sel, textProp, listType) { 341 | var execListCommand = listType === "ol" ? "insertOrderedList" : "insertUnorderedList", 342 | nodeOffset = listType === "ol" ? 3 : 2; 343 | 344 | document.execCommand(execListCommand); 345 | sel.anchorNode[textProp] = sel.anchorNode[textProp].substring(nodeOffset); 346 | 347 | return getParentWithTag(sel.anchorNode, listType); 348 | } 349 | 350 | function triggerTextParse(event) { 351 | var sel = window.getSelection(), 352 | textProp, 353 | subject, 354 | insertedNode, 355 | unwrap, 356 | node, 357 | parent, 358 | range; 359 | 360 | // FF will return sel.anchorNode to be the parentNode when the triggered keyCode is 13 361 | if (!sel.isCollapsed || !sel.anchorNode || sel.anchorNode.nodeName === "ARTICLE") { 362 | return; 363 | } 364 | 365 | textProp = getTextProp(sel.anchorNode); 366 | subject = sel.anchorNode[textProp]; 367 | 368 | if (subject.match(/^-\s/) && sel.anchorNode.parentNode.nodeName !== "LI") { 369 | insertedNode = insertListOnSelection(sel, textProp, "ul"); 370 | } 371 | 372 | if (subject.match(/^1\.\s/) && sel.anchorNode.parentNode.nodeName !== "LI") { 373 | insertedNode = insertListOnSelection(sel, textProp, "ol"); 374 | } 375 | 376 | unwrap = insertedNode && 377 | ["ul", "ol"].indexOf(insertedNode.nodeName.toLocaleLowerCase()) >= 0 && 378 | ["p", "div"].indexOf(insertedNode.parentNode.nodeName.toLocaleLowerCase()) >= 0; 379 | 380 | if (unwrap) { 381 | node = sel.anchorNode; 382 | parent = insertedNode.parentNode; 383 | parent.parentNode.insertBefore(insertedNode, parent); 384 | parent.parentNode.removeChild(parent); 385 | moveCursorToBeginningOfSelection(sel, node); 386 | } 387 | } 388 | 389 | function moveCursorToBeginningOfSelection(selection, node) { 390 | range = document.createRange(); 391 | range.setStart(node, 0); 392 | range.setEnd(node, 0); 393 | selection.removeAllRanges(); 394 | selection.addRange(range); 395 | } 396 | 397 | function triggerTextStyling(node) { 398 | var className = node.className, 399 | sel = window.getSelection(), 400 | selNode = sel.anchorNode, 401 | tagClass, 402 | reTag; 403 | 404 | for (var tag in tagClassMap) { 405 | tagClass = tagClassMap[tag]; 406 | reTag = new RegExp(tagClass); 407 | 408 | if (reTag.test(className)) { 409 | switch(tag) { 410 | case "b": 411 | if (selNode && !hasParentWithTag(selNode, "h1") && !hasParentWithTag(selNode, "h2")) { 412 | document.execCommand(tagClass, false); 413 | } 414 | return; 415 | case "i": 416 | document.execCommand(tagClass, false); 417 | return; 418 | 419 | case "h1": 420 | case "h2": 421 | case "h3": 422 | case "blockquote": 423 | toggleFormatBlock(tag); 424 | return; 425 | 426 | case "a": 427 | toggleUrlInput(); 428 | optionsNode.className = "options url-mode"; 429 | return; 430 | } 431 | } 432 | } 433 | 434 | triggerTextSelection(); 435 | } 436 | 437 | function triggerUrlBlur(event) { 438 | var url = urlInput.value; 439 | 440 | optionsNode.className = "options"; 441 | window.getSelection().addRange(previouslySelectedText); 442 | 443 | document.execCommand("unlink", false); 444 | 445 | if (url === "") { 446 | return false; 447 | } 448 | 449 | if (!url.match("^(http://|https://|mailto:)")) { 450 | url = "http://" + url; 451 | } 452 | 453 | document.execCommand("createLink", false, url); 454 | 455 | urlInput.value = ""; 456 | } 457 | 458 | function triggerUrlSet(event) { 459 | if (event.keyCode === 13) { 460 | event.preventDefault(); 461 | event.stopPropagation(); 462 | 463 | urlInput.blur(); 464 | } 465 | } 466 | 467 | function toggleFormatBlock(tag) { 468 | if (hasParentWithTag(getFocusNode(), tag)) { 469 | document.execCommand("formatBlock", false, "p"); 470 | document.execCommand("outdent"); 471 | } else { 472 | document.execCommand("formatBlock", false, tag); 473 | } 474 | } 475 | 476 | function toggleUrlInput() { 477 | setTimeout(function() { 478 | var url = getParentHref(getFocusNode()); 479 | 480 | if (typeof url !== "undefined") { 481 | urlInput.value = url; 482 | } else { 483 | document.execCommand("createLink", false, "/"); 484 | } 485 | 486 | previouslySelectedText = window.getSelection().getRangeAt(0); 487 | 488 | urlInput.focus(); 489 | }, 150); 490 | } 491 | 492 | function getParent(node, condition, returnCallback) { 493 | while (node.parentNode) { 494 | if (condition(node)) { 495 | return returnCallback(node); 496 | } 497 | 498 | node = node.parentNode; 499 | } 500 | } 501 | 502 | function getParentWithTag(node, nodeType) { 503 | var checkNodeType = function(node) { return node.nodeName.toLowerCase() === nodeType; }, 504 | returnNode = function(node) { return node; }; 505 | 506 | return getParent(node, checkNodeType, returnNode); 507 | } 508 | 509 | function hasParentWithTag(node, nodeType) { 510 | return !!getParentWithTag(node, nodeType); 511 | } 512 | 513 | function getParentHref(node) { 514 | var checkHref = function(node) { return typeof node.href !== "undefined"; }, 515 | returnHref = function(node) { return node.href; }; 516 | 517 | return getParent(node, checkHref, returnHref); 518 | } 519 | 520 | function triggerTextSelection() { 521 | var selectedText = root.getSelection(), 522 | range, 523 | clientRectBounds; 524 | 525 | // The selected text is collapsed, push the menu out of the way 526 | if (selectedText.isCollapsed) { 527 | setTextMenuPosition(EDGE, EDGE); 528 | textMenu.className = "text-menu hide"; 529 | } else { 530 | range = selectedText.getRangeAt(0); 531 | clientRectBounds = range.getBoundingClientRect(); 532 | 533 | // Every time we show the menu, reload the state 534 | reloadMenuState(); 535 | setTextMenuPosition( 536 | clientRectBounds.top - 5 + root.pageYOffset, 537 | (clientRectBounds.left + clientRectBounds.right) / 2 538 | ); 539 | } 540 | } 541 | 542 | function setTextMenuPosition(top, left) { 543 | textMenu.style.top = top + "px"; 544 | textMenu.style.left = left + "px"; 545 | 546 | if (options.animate) { 547 | if (top === EDGE) { 548 | textMenu.className = "text-menu hide"; 549 | } else { 550 | textMenu.className = "text-menu active"; 551 | } 552 | } 553 | } 554 | 555 | root.grande = grande; 556 | 557 | }).call(this); 558 | -------------------------------------------------------------------------------- /public/js/vendor/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bootstrap.js v3.0.0 by @fat and @mdo 3 | * Copyright 2013 Twitter Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0 5 | */ 6 | if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('

'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery); -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | --------------------------------------------------------------------------------