├── public ├── favicon.ico ├── packages │ └── .gitkeep ├── robots.txt ├── assets │ ├── images │ │ └── screenshot.png │ ├── css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── app.css │ │ └── libs │ │ │ └── font-awesome.min.css │ └── js │ │ ├── libs │ │ ├── jquery.ui.touch-punch.min.js │ │ ├── jquery-touch-fixer.js │ │ └── jquery.jeditable.mini.js │ │ └── app.js ├── .htaccess └── index.php ├── app ├── config │ ├── packages │ │ ├── .gitkeep │ │ └── toddish │ │ │ └── verify │ │ │ └── config.php │ ├── compile.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── services.php │ ├── workbench.php │ ├── view.php │ ├── remote.php │ ├── auth.php │ ├── queue.php │ ├── cache.php │ ├── database.php │ ├── mail.php │ ├── session.php │ └── app.php ├── database │ ├── seeds │ │ ├── .gitkeep │ │ └── DatabaseSeeder.php │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2014_09_18_085459_create_card_members.php │ │ ├── 2014_09_18_091530_create_card_checklists.php │ │ ├── 2014_09_18_084837_create_board_members.php │ │ ├── 2014_09_18_085724_create_card_comments.php │ │ ├── 2014_09_18_085619_create_card_activities.php │ │ ├── 2014_09_18_083207_create_lists.php │ │ ├── 2014_09_18_082826_create_boards.php │ │ ├── 2014_09_18_083837_create_board_activities.php │ │ ├── 2014_09_18_091651_create_checklist_items.php │ │ ├── 2014_09_18_093316_create_card_attachments.php │ │ └── 2014_09_18_083427_create_cards.php │ └── production.sqlite ├── start │ ├── local.php │ ├── artisan.php │ └── global.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── modules │ ├── api │ │ └── module.json │ ├── auth │ │ ├── module.json │ │ ├── controllers │ │ │ └── AuthController.php │ │ └── views │ │ │ └── users │ │ │ └── login.blade.php │ ├── content │ │ ├── module.json │ │ ├── views │ │ │ ├── hello.blade.php │ │ │ └── layouts │ │ │ │ ├── guest │ │ │ │ └── default.blade.php │ │ │ │ └── users │ │ │ │ └── default.blade.php │ │ └── controllers │ │ │ └── HomeController.php │ └── core │ │ ├── module.json │ │ ├── models │ │ ├── CheckListItem.php │ │ ├── CardAttachment.php │ │ ├── CardActivity.php │ │ ├── CardComment.php │ │ ├── CheckList.php │ │ ├── BoardActivity.php │ │ ├── CardList.php │ │ ├── User.php │ │ ├── Board.php │ │ └── Card.php │ │ ├── controllers │ │ ├── BaseController.php │ │ ├── BoardController.php │ │ ├── ListController.php │ │ └── CardController.php │ │ └── views │ │ └── users │ │ ├── boards-list.blade.php │ │ └── board.blade.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── filters.php └── routes.php ├── .gitattributes ├── CONTRIBUTING.md ├── .gitignore ├── server.php ├── phpunit.xml ├── README.md ├── composer.json ├── bootstrap ├── paths.php ├── start.php └── autoload.php ├── readme-laravel.md ├── artisan └── dbschema └── Dump20141020.sql /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/start/local.php: -------------------------------------------------------------------------------- 1 | call('UserTableSeeder'); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/modules/content/views/hello.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Laravel PHP Framework 6 | 7 | 8 |
9 |

You have arrived.

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /app/modules/core/models/CheckListItem.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\CheckList', 'checklist_id'); 13 | } 14 | } -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /app/modules/core/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 17 | { 18 | $this->layout = View::make($this->layout); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/modules/core/models/CardAttachment.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\Card'); 13 | } 14 | 15 | public function user() { 16 | return $this->belongsTo('Mejili\Core\Models\User'); 17 | } 18 | } -------------------------------------------------------------------------------- /app/modules/core/models/CardActivity.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\User', 'member_id'); 13 | } 14 | 15 | public function card(){ 16 | return $this->belongsTo('Mejili\Core\Models\Card', 'card_id'); 17 | } 18 | } -------------------------------------------------------------------------------- /app/modules/core/models/CardComment.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\User', 'commenter_id'); 13 | } 14 | 15 | public function card(){ 16 | return $this->belongsTo('Mejili\Core\Models\Card', 'card_id'); 17 | } 18 | } -------------------------------------------------------------------------------- /app/modules/core/models/CheckList.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\Card', 'card_id'); 13 | } 14 | 15 | public function items(){ 16 | return $this->hasMany('Mejili\Core\Models\CheckListItem', 'checklist_id'); 17 | } 18 | } -------------------------------------------------------------------------------- /app/start/artisan.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\Board', 'board_id'); 13 | } 14 | 15 | public function user(){ 16 | return $this->belongsTo('Mejili\Core\Models\User', 'member_id'); 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/config/compile.php: -------------------------------------------------------------------------------- 1 | ['username', 'email'], 5 | 6 | // The Super Admin role 7 | // (returns true for all permissions) 8 | 'super_admin' => 'Super Admin', 9 | 10 | // DB prefix for tables 11 | 'prefix' => '', 12 | 13 | // Define Models if you extend them. 14 | 'models' => [ 15 | 'user' => 'Toddish\Verify\Models\User', 16 | 'role' => 'Toddish\Verify\Models\Role', 17 | 'permission' => 'Toddish\Verify\Models\Permission', 18 | ] 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /app/modules/core/models/CardList.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\Board', 'board_id'); 17 | } 18 | 19 | public function cards(){ 20 | return $this->hasMany('Mejili\Core\Models\Card', 'list_id'); 21 | } 22 | } -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Note 2 | ======== 3 | This repos is not being maintained or developed anymore hence its readonly 4 | 5 | Mejili 6 | ====== 7 | 8 | A Trello clone based on Laravel 4.2. It uses Knockoutjs and Twitter Bootstrap for frontend. 9 | 10 | Mejili stands for "Magical Lean". 11 | 12 | 13 | Demo 14 | ---- 15 | Demo site is available [here](http://mejili.16mb.com/login) 16 | 17 | username: admin 18 | 19 | password: password 20 | 21 | ![Screenshot](/public/assets/images/screenshot.png) 22 | 23 | Installation Instructions 24 | ------------------------- 25 | 26 | To be available soon. 27 | 28 | License 29 | ------- 30 | Mejili is released under the [MIT License](/LICENSE). 31 | 32 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_085459_create_card_members.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('card_id'); 19 | $table->integer('member_id'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('card_members'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_091530_create_card_checklists.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('title', 45); 19 | $table->integer('card_id'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('card_checklists'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/modules/core/models/User.php: -------------------------------------------------------------------------------- 1 | belongsToMany('Mejili\Core\Models\Board', 'board_members', 'member_id', 'board_id')->withPivot('admin'); 18 | } 19 | 20 | public function boardActivities(){ 21 | return $this->hasMany('Mejili\Core\Models\BoardActivity', 'member_id'); 22 | } 23 | 24 | public function cards(){ 25 | return $this->belongsToMany('Mejili\Core\Models\Card', 'card_members', 'member_id', 'card_id'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least 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 | "sent" => "Password reminder sent!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/modules/core/models/Board.php: -------------------------------------------------------------------------------- 1 | belongsToMany('Mejili\Core\Models\User', 'board_members', 'board_id', 'member_id')->withPivot('admin'); 17 | } 18 | 19 | public function activities(){ 20 | return $this->hasMany('Mejili\Core\Models\BoardActivity', 'board_id'); 21 | } 22 | 23 | public function lists(){ 24 | return $this->hasMany('Mejili\Core\Models\CardList', 'board_id'); 25 | } 26 | } -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_084837_create_board_members.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->boolean('admin'); 19 | $table->integer('board_id'); 20 | $table->integer('member_id'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('board_members'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_085724_create_card_comments.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->text('content'); 19 | $table->integer('card_id'); 20 | $table->integer('commenter_id'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('card_comments'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/config/services.php: -------------------------------------------------------------------------------- 1 | array( 18 | 'domain' => '', 19 | 'secret' => '', 20 | ), 21 | 22 | 'mandrill' => array( 23 | 'secret' => '', 24 | ), 25 | 26 | 'stripe' => array( 27 | 'model' => 'User', 28 | 'secret' => '', 29 | ), 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_085619_create_card_activities.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->text('description'); 19 | $table->integer('card_id'); 20 | $table->integer('member_id'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('card_activities'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_083207_create_lists.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('title', 255); 19 | $table->integer('position'); 20 | $table->integer('board_id'); 21 | $table->boolean('archived'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('lists'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_082826_create_boards.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name',255); 19 | $table->text('description'); 20 | $table->boolean('open'); 21 | $table->integer('board_visibility'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('boards'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_083837_create_board_activities.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('description',255); 19 | $table->integer('board_id'); 20 | $table->integer('member_id'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('board_activities'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_091651_create_checklist_items.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('position'); 19 | $table->string('title',255); 20 | $table->boolean('checked'); 21 | $table->integer('checklist_id'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('checklist_items'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_093316_create_card_attachments.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('file_name', 255); 19 | $table->string('file_extension', 45); 20 | $table->string('file_location', 255); 21 | $table->boolean('attachment_type'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('card_attachments'); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /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.2.*", 8 | "toddish/verify": "3.*", 9 | "creolab/laravel-modules": "dev-master" 10 | 11 | }, 12 | "autoload": { 13 | "classmap": [ 14 | "app/commands", 15 | "app/controllers", 16 | "app/database/migrations", 17 | "app/database/seeds", 18 | "app/tests/TestCase.php", 19 | "app/modules" 20 | ] 21 | }, 22 | "scripts": { 23 | "post-install-cmd": [ 24 | "php artisan clear-compiled", 25 | "php artisan optimize" 26 | ], 27 | "post-update-cmd": [ 28 | "php artisan clear-compiled", 29 | "php artisan optimize" 30 | ], 31 | "post-create-project-cmd": [ 32 | "php artisan key:generate" 33 | ] 34 | }, 35 | "config": { 36 | "preferred-install": "dist" 37 | }, 38 | "minimum-stability": "stable" 39 | } 40 | -------------------------------------------------------------------------------- /app/modules/content/controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | 'done']); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/database/migrations/2014_09_18_083427_create_cards.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->text('title'); 19 | $table->text('description'); 20 | $table->dateTime('due_date'); 21 | $table->integer('position'); 22 | $table->integer('list_id'); 23 | $table->integer('assignee_id'); 24 | $table->boolean('archived'); 25 | $table->string('color'); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::drop('cards'); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /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 | ); 32 | -------------------------------------------------------------------------------- /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-3', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/modules/core/models/Card.php: -------------------------------------------------------------------------------- 1 | belongsTo('Mejili\Core\Models\CardList', 'list_id'); 15 | } 16 | 17 | public function assignee(){ 18 | return $this->belongsTo('Mejili\Core\Models\User', 'assignee_id'); 19 | } 20 | 21 | public function users(){ 22 | return $this->belongsToMany('Mejili\Core\Models\User', 'card_members', 'card_id', 'member_id'); 23 | } 24 | 25 | public function comments(){ 26 | return $this->hasMany('Mejili\Core\Models\CardComment', 'card_id'); 27 | } 28 | 29 | public function activities(){ 30 | return $this->hasMany('Mejili\Core\Models\CardActivity', 'card_id'); 31 | } 32 | 33 | public function checklists(){ 34 | return $this->hasMany('Mejili\Core\Models\Checklists', 'card_id'); 35 | } 36 | 37 | public function attachments(){ 38 | return $this->hasMany('Mejili\Core\Models\CardAttachment'); 39 | } 40 | 41 | 42 | } -------------------------------------------------------------------------------- /app/modules/auth/controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | 14 | 15 | class AuthController extends BaseController { 16 | 17 | public function showLoginPage() { 18 | 19 | return View::make('auth::users.login'); 20 | } 21 | 22 | public function login(){ 23 | 24 | $username = Input::get('username'); 25 | $pass = Input::get('password'); 26 | 27 | try{ 28 | Auth::attempt(array( 29 | 'username' => $username, 30 | 'password' => $pass 31 | )); 32 | } 33 | catch(UserNotFoundException $e){ 34 | //Todo: show an error on the screen for user not found 35 | } 36 | catch(UserPasswordIncorrectException $e){ 37 | //Todo: show an error on the screen for incorrect password 38 | } 39 | 40 | return Redirect::route('boards'); 41 | } 42 | 43 | public function logout(){ 44 | Auth::logout(); 45 | return Redirect::route('home'); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/assets/js/libs/jquery.ui.touch-punch.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Touch Punch 0.2.3 3 | * 4 | * Copyright 2011–2014, Dave Furfero 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * 7 | * Depends: 8 | * jquery.ui.widget.js 9 | * jquery.ui.mouse.js 10 | */ 11 | !function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery); -------------------------------------------------------------------------------- /app/modules/core/controllers/BoardController.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | 15 | class BoardController extends BaseController { 16 | 17 | public function index($id){ 18 | $data['id'] = $id; 19 | return View::make('core::users.board', $data); 20 | } 21 | 22 | public function listBoards(){ 23 | 24 | $user = Auth::user(); 25 | $boards = $user->boards; 26 | $data['boards'] = $boards; 27 | return View::make('core::users.boards-list', $data); 28 | } 29 | 30 | public function addBoard(){ 31 | 32 | $name = Input::get('boardName'); 33 | if($name!=''){ 34 | $user = Auth::user(); 35 | $board = new Board(['name' => $name, 'open' => true, 'board_visibility' => 0, 'description' => 'n']); 36 | $board = $user->boards()->save($board); 37 | $user->boards()->updateExistingPivot($board->id, ['admin'=> true]); 38 | } 39 | return Redirect::route('boards'); 40 | } 41 | 42 | public function getViewModel(){ 43 | $boardId = Input::get('b'); 44 | $board = Board::find($boardId); 45 | $lists = $board->lists()->with('cards')->get(); 46 | $data['lists'] = $lists; 47 | 48 | return Response::json($data); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/modules/core/views/users/boards-list.blade.php: -------------------------------------------------------------------------------- 1 | @extends('content::layouts.users.default') 2 | 3 | @section('navbarHeader') 4 | 13 | @stop 14 | 15 | @section('content') 16 | 17 |
18 |
19 | @foreach ($boards as $board) 20 | 21 |
22 | {{$board->name}} 23 |
24 |
25 | 26 | @endforeach 27 |
28 |
29 |
30 | 36 |
37 |
38 | 39 | 50 | 51 | @stop 52 | -------------------------------------------------------------------------------- /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 application we have whipped up for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | -------------------------------------------------------------------------------- /app/config/remote.php: -------------------------------------------------------------------------------- 1 | 'production', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Remote Server Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These are the servers that will be accessible via the SSH task runner 24 | | facilities of Laravel. This feature radically simplifies executing 25 | | tasks on your servers, such as deploying out these applications. 26 | | 27 | */ 28 | 29 | 'connections' => array( 30 | 31 | 'production' => array( 32 | 'host' => '', 33 | 'username' => '', 34 | 'password' => '', 35 | 'key' => '', 36 | 'keyphrase' => '', 37 | 'root' => '/var/www', 38 | ), 39 | 40 | ), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Remote Server Groups 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Here you may list connections under a single group name, which allows 48 | | you to easily access all of the servers at once using a short name 49 | | that is extremely easy to remember, such as "web" or "database". 50 | | 51 | */ 52 | 53 | 'groups' => array( 54 | 55 | 'web' => array('production') 56 | 57 | ), 58 | 59 | ); 60 | -------------------------------------------------------------------------------- /app/modules/content/views/layouts/guest/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mejili - Kanban Board 7 | 8 | 9 | 10 | 23 | 24 | @yield('content') 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/modules/auth/views/users/login.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @extends('content::layouts.guest.default') 3 | @section('content') 4 | 5 |
6 |
7 |
8 |

Use your username

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 | 43 |
44 |
45 | @stop 46 | -------------------------------------------------------------------------------- /readme-laravel.md: -------------------------------------------------------------------------------- 1 | ## Laravel PHP Framework 2 | 3 | [![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) 4 | [![Total Downloads](https://poser.pugx.org/laravel/framework/downloads.svg)](https://packagist.org/packages/laravel/framework) 5 | [![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework) 6 | [![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework) 7 | [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 8 | 9 | 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. 10 | 11 | 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. 12 | 13 | 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. 14 | 15 | ## Official Documentation 16 | 17 | Documentation for the entire framework can be found on the [Laravel website](http://laravel.com/docs). 18 | 19 | ### Contributing To Laravel 20 | 21 | **All issues and pull requests should be filed on the [laravel/framework](http://github.com/laravel/framework) repository.** 22 | 23 | ### License 24 | 25 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 26 | -------------------------------------------------------------------------------- /public/assets/js/libs/jquery-touch-fixer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Content-Type:text/javascript 3 | * 4 | * A bridge between iPad and iPhone touch events and jquery draggable, 5 | * sortable etc. mouse interactions. 6 | * @author Oleg Slobodskoi 7 | * 8 | * modified by John Hardy to use with any touch device 9 | * fixed breakage caused by jquery.ui so that mouseHandled internal flag is reset 10 | * before each touchStart event 11 | * 12 | */ 13 | (function( $ ) { 14 | 15 | $.support.touch = typeof Touch === 'object'; 16 | 17 | if (!$.support.touch) { 18 | return; 19 | } 20 | 21 | var proto = $.ui.mouse.prototype, 22 | _mouseInit = proto._mouseInit; 23 | 24 | $.extend( proto, { 25 | _mouseInit: function() { 26 | this.element 27 | .bind( "touchstart." + this.widgetName, $.proxy( this, "_touchStart" ) ); 28 | _mouseInit.apply( this, arguments ); 29 | }, 30 | 31 | _touchStart: function( event ) { 32 | if ( event.originalEvent.targetTouches.length != 1 ) { 33 | return false; 34 | } 35 | 36 | this.element 37 | .bind( "touchmove." + this.widgetName, $.proxy( this, "_touchMove" ) ) 38 | .bind( "touchend." + this.widgetName, $.proxy( this, "_touchEnd" ) ); 39 | 40 | this._modifyEvent( event ); 41 | 42 | $( document ).trigger($.Event("mouseup")); //reset mouseHandled flag in ui.mouse 43 | this._mouseDown( event ); 44 | 45 | return false; 46 | }, 47 | 48 | _touchMove: function( event ) { 49 | this._modifyEvent( event ); 50 | this._mouseMove( event ); 51 | }, 52 | 53 | _touchEnd: function( event ) { 54 | this.element 55 | .unbind( "touchmove." + this.widgetName ) 56 | .unbind( "touchend." + this.widgetName ); 57 | this._mouseUp( event ); 58 | }, 59 | 60 | _modifyEvent: function( event ) { 61 | event.which = 1; 62 | var target = event.originalEvent.targetTouches[0]; 63 | event.pageX = target.clientX; 64 | event.pageY = target.clientY; 65 | } 66 | 67 | }); 68 | 69 | })( jQuery ); 70 | -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'verify', 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' => 'Mejili\Core\Models\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 | ); 72 | -------------------------------------------------------------------------------- /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 | 'ttr' => 60, 42 | ), 43 | 44 | 'sqs' => array( 45 | 'driver' => 'sqs', 46 | 'key' => 'your-public-key', 47 | 'secret' => 'your-secret-key', 48 | 'queue' => 'your-queue-url', 49 | 'region' => 'us-east-1', 50 | ), 51 | 52 | 'iron' => array( 53 | 'driver' => 'iron', 54 | 'host' => 'mq-aws-us-east-1.iron.io', 55 | 'token' => 'your-token', 56 | 'project' => 'your-project-id', 57 | 'queue' => 'your-queue-name', 58 | 'encrypt' => true, 59 | ), 60 | 61 | 'redis' => array( 62 | 'driver' => 'redis', 63 | 'queue' => 'default', 64 | ), 65 | 66 | ), 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Failed Queue Jobs 71 | |-------------------------------------------------------------------------- 72 | | 73 | | These options configure the behavior of failed queue job logging so you 74 | | can control which database and table are used to store the jobs that 75 | | have failed. You may change them to any database / table you wish. 76 | | 77 | */ 78 | 79 | 'failed' => array( 80 | 81 | 'database' => 'mysql', 'table' => 'failed_jobs', 82 | 83 | ), 84 | 85 | ); 86 | -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | detectEnvironment(array( 28 | 29 | 'local' => array('*.dev', gethostname()), 30 | 'production' => array('*.com', '*.net', 'www.somedomain.com') 31 | 32 | )); 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Bind Paths 37 | |-------------------------------------------------------------------------- 38 | | 39 | | Here we are binding the paths configured in paths.php to the app. You 40 | | should not be changing these here. If you need to change these you 41 | | may do so within the paths.php file and they will be bound here. 42 | | 43 | */ 44 | 45 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Load The Application 50 | |-------------------------------------------------------------------------- 51 | | 52 | | Here we will load this Illuminate application. We will keep this in a 53 | | separate location so we can isolate the creation of an application 54 | | from the actual running of the application with a given request. 55 | | 56 | */ 57 | 58 | $framework = $app['path.base']. 59 | '/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 | setRequestForConsoleEnvironment(); 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); 75 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mejili - Kanban Board 7 | 8 | 9 | 10 | 37 | 38 | @yield('content') 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/start/global.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/routes.php: -------------------------------------------------------------------------------- 1 | 'home', 'uses'=> 'Mejili\Content\Controllers\HomeController@showWelcome']); 15 | Route::post('save', 'Mejili\Content\Controllers\HomeController@dummy'); 16 | 17 | 18 | Route::group(['before' => 'guest'], function() 19 | { 20 | Route::get('login', ['as'=>'login' ,'uses'=>'Mejili\Auth\Controllers\AuthController@showLoginPage']); 21 | 22 | Route::post('login', ['as'=>'login' ,'uses'=>'Mejili\Auth\Controllers\AuthController@login']); 23 | }); 24 | 25 | 26 | Route::group(['before' => 'auth'], function() 27 | { 28 | Route::get('b/{id}', ['as'=>'board' ,'uses'=>'Mejili\Core\Controllers\BoardController@index']); 29 | 30 | Route::get('boards', ['as'=>'boards' ,'uses'=>'Mejili\Core\Controllers\BoardController@listBoards']); 31 | 32 | Route::post('addboard', ['as'=>'addboard' ,'uses'=>'Mejili\Core\Controllers\BoardController@addBoard']); 33 | 34 | Route::get('logout', [ 'as'=>'logout' , 'uses'=>'Mejili\Auth\Controllers\AuthController@logout']); 35 | 36 | // Access api routes 37 | Route::group(['prefix' => '/api'], function(){ 38 | 39 | Route::post('b/view_model', ['as'=>'api_get_view_model' ,'uses'=>'Mejili\Core\Controllers\BoardController@getViewModel']); 40 | 41 | Route::post('b/list/add_list', ['as'=>'api_add_list' ,'uses'=>'Mejili\Core\Controllers\ListController@addList']); 42 | 43 | Route::post('b/list/card/add_card', ['as'=>'api_get_add_card' ,'uses'=>'Mejili\Core\Controllers\CardController@addCard']); 44 | 45 | Route::post('b/list/card/updatePosition', ['as'=>'api_get_update_card' ,'uses'=>'Mejili\Core\Controllers\CardController@updatePosition']); 46 | 47 | Route::post('b/list/updatePosition', 'Mejili\Core\Controllers\ListController@updatePosition'); 48 | 49 | Route::post('b/list/delete', 'Mejili\Core\Controllers\ListController@deleteList'); 50 | 51 | Route::post('b/list/card/setColor', 'Mejili\Core\Controllers\CardController@setColor'); 52 | 53 | Route::post('b/list/card/delete', 'Mejili\Core\Controllers\CardController@deleteCard'); 54 | 55 | Route::post('b/list/setTitle', 'Mejili\Core\Controllers\ListController@setTitle'); 56 | 57 | Route::post('b/list/card/updateDescription', 'Mejili\Core\Controllers\CardController@updateDescription'); 58 | 59 | Route::post('b/list/card/updateTitle', 'Mejili\Core\Controllers\CardController@updateTitle'); 60 | 61 | 62 | // only for development 63 | // Route::get('b/view_model', ['as'=>'api_get_view_model' ,'uses'=>'BoardController@getViewModel']); 64 | 65 | }); 66 | }); 67 | 68 | -------------------------------------------------------------------------------- /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' => 'sqlite', 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/dump2.db', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'mejili', 59 | 'username' => 'work', 60 | 'password' => 'work', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => '', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'forge', 70 | 'username' => 'forge', 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 haven't actually been run in the database. 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' => false, 115 | 116 | 'default' => array( 117 | 'host' => '127.0.0.1', 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 Mailgun mail service which will provide reliable deliveries. 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 deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun 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 | ); 125 | -------------------------------------------------------------------------------- /app/modules/core/controllers/ListController.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | 16 | class ListController extends BaseController { 17 | 18 | /** 19 | * Add new list to the board and set the postion 20 | * of the list to the max + 1 on the board 21 | * return success status and the id of the new list 22 | * @return success:Boolean and id: int 23 | */ 24 | 25 | public function addList(){ 26 | $boardid = Input::get('b'); 27 | $title = Input::get('t'); 28 | $board = Board::find($boardid); 29 | $list = new CardList(); 30 | $list->title = $title; 31 | $maxPos = $board->lists()->max('position'); 32 | $list->position = $maxPos + 1; 33 | $response['success'] = $board->lists()->save($list); 34 | $response['id'] = $list->id; 35 | return Response::json($response); 36 | } 37 | 38 | /** 39 | * Update the position of the list and 40 | * return true if successful else return false 41 | * @return Boolean 42 | */ 43 | public function updatePosition(){ 44 | $boardid = Input::get('b'); 45 | $board = Board::find($boardid); 46 | $newPos = Input::get('np'); 47 | $list = CardList::find(Input::get('lid')); 48 | $this->placeListAtPosition($board, $list, $newPos); 49 | $list->save(); 50 | $this->reorganizeBoard($board); 51 | $response['success'] = true; 52 | return Response::json($response); 53 | } 54 | 55 | /** 56 | * Delete the specified list. 57 | * @returns Boolean success status. 58 | */ 59 | public function deleteList(){ 60 | $listId = Input::get('lid'); 61 | $list = CardList::find($listId); 62 | foreach($list->cards as $card){ 63 | $card->delete(); 64 | } 65 | $response['success'] = $list->delete(); 66 | return Response::json($response); 67 | } 68 | 69 | /** 70 | * Change the title of the card 71 | * @returns Boolean success status. 72 | */ 73 | public function setTitle(){ 74 | $title = Input::get('lTitle'); 75 | $list = CardList::find(Input::get('lid')); 76 | $list->title = $title; 77 | $response['success'] = $list->save(); 78 | return Response::json($response); 79 | } 80 | 81 | /** 82 | * Place the moved list at the target postion 83 | * @return void 84 | */ 85 | 86 | private function placeListAtPosition($board, $list, $newPos){ 87 | if($list->position > $newPos){ 88 | $this->shifListstLeft($board, $newPos); 89 | $list->position = $newPos - 2; 90 | } 91 | else{ 92 | $this->shiftListsRight($board, $newPos); 93 | $list->position = $newPos + 2 ; 94 | } 95 | } 96 | 97 | /** 98 | * Push all the lists having position less than the current 99 | * to the left by decreasing their position value. 100 | * @return void 101 | */ 102 | 103 | private function shifListstLeft($board, $pos){ 104 | foreach($board->lists()->get() as $list){ 105 | if($list->position <= $pos){ 106 | $list->position = $list->position - 1; 107 | $list->save(); 108 | } 109 | } 110 | } 111 | 112 | /** 113 | * Push all the lists having position greater than the current 114 | * to the right by increasing their position value. 115 | * @return void 116 | */ 117 | 118 | private function shiftListsRight($board, $pos){ 119 | foreach($board->lists()->get() as $list){ 120 | if($list->position >= $pos){ 121 | $list->position = $list->position + 1; 122 | $list->save(); 123 | } 124 | } 125 | } 126 | 127 | /** 128 | * Remove all the empty list positions in the board 129 | * caused by moving the list. 130 | * @return void 131 | */ 132 | 133 | private function reorganizeBoard($board){ 134 | $position=0; 135 | foreach ($board->lists()->orderby('position')->get() as $list ){ 136 | $list->position = $position; 137 | $list->save(); 138 | $position++; 139 | } 140 | } 141 | } -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'file', 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 on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session File Location 39 | |-------------------------------------------------------------------------- 40 | | 41 | | When using the native session driver, we need a location where session 42 | | files may be stored. A default has been set for you but a different 43 | | location may be specified. This is only needed for file sessions. 44 | | 45 | */ 46 | 47 | 'files' => storage_path().'/sessions', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session Database Connection 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the "database" or "redis" session drivers, you may specify a 55 | | connection that should be used to manage these sessions. This should 56 | | correspond to a connection in your database configuration options. 57 | | 58 | */ 59 | 60 | 'connection' => null, 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Table 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" session driver, you may specify the table we 68 | | should use to manage the sessions. Of course, a sensible default is 69 | | provided for you; however, you are free to change this as needed. 70 | | 71 | */ 72 | 73 | 'table' => 'sessions', 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Sweeping Lottery 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some session drivers must manually sweep their storage location to get 81 | | rid of old sessions from storage. Here are the chances that it will 82 | | happen on a given request. By default, the odds are 2 out of 100. 83 | | 84 | */ 85 | 86 | 'lottery' => array(2, 100), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cookie Name 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Here you may change the name of the cookie used to identify a session 94 | | instance by ID. The name specified here will get used every time a 95 | | new session cookie is created by the framework for every driver. 96 | | 97 | */ 98 | 99 | 'cookie' => 'laravel_session', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Path 104 | |-------------------------------------------------------------------------- 105 | | 106 | | The session cookie path determines the path for which the cookie will 107 | | be regarded as available. Typically, this will be the root path of 108 | | your application but you are free to change this when necessary. 109 | | 110 | */ 111 | 112 | 'path' => '/', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Domain 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the domain of the cookie used to identify a session 120 | | in your application. This will determine which domains the cookie is 121 | | available to in your application. A sensible default has been set. 122 | | 123 | */ 124 | 125 | 'domain' => null, 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | HTTPS Only Cookies 130 | |-------------------------------------------------------------------------- 131 | | 132 | | By setting this option to true, session cookies will only be sent back 133 | | to the server if the browser has a HTTPS connection. This will keep 134 | | the cookie from being sent to you if it can not be done securely. 135 | | 136 | */ 137 | 138 | 'secure' => false, 139 | 140 | ); 141 | -------------------------------------------------------------------------------- /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 and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :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 must be a valid email address.", 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_with_all" => "The :attribute field is required when :values is present.", 62 | "required_without" => "The :attribute field is required when :values is not present.", 63 | "required_without_all" => "The :attribute field is required when none of :values are present.", 64 | "same" => "The :attribute and :other must match.", 65 | "size" => array( 66 | "numeric" => "The :attribute must be :size.", 67 | "file" => "The :attribute must be :size kilobytes.", 68 | "string" => "The :attribute must be :size characters.", 69 | "array" => "The :attribute must contain :size items.", 70 | ), 71 | "unique" => "The :attribute has already been taken.", 72 | "url" => "The :attribute format is invalid.", 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Custom Validation Language Lines 77 | |-------------------------------------------------------------------------- 78 | | 79 | | Here you may specify custom validation messages for attributes using the 80 | | convention "attribute.rule" to name the lines. This makes it quick to 81 | | specify a specific custom language line for a given attribute rule. 82 | | 83 | */ 84 | 85 | 'custom' => array( 86 | 'attribute-name' => array( 87 | 'rule-name' => 'custom-message', 88 | ), 89 | ), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Custom Validation Attributes 94 | |-------------------------------------------------------------------------- 95 | | 96 | | The following language lines are used to swap attribute place-holders 97 | | with something more reader friendly such as E-Mail Address instead 98 | | of "email". This simply helps us make messages a little cleaner. 99 | | 100 | */ 101 | 102 | 'attributes' => array(), 103 | 104 | ); 105 | -------------------------------------------------------------------------------- /app/modules/core/controllers/CardController.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | 16 | class CardController extends BaseController { 17 | 18 | /** 19 | * Add new Card to the list and set the position 20 | * of the card to the max + 1 on the list 21 | * return success status and the id of the new card 22 | * @return success:Boolean and id: int 23 | */ 24 | 25 | public function addCard(){ 26 | $listId = Input::get('l'); 27 | $title = Input::get('t'); 28 | 29 | $list = CardList::find($listId); 30 | $card = new Card(); 31 | $card->title = $title; 32 | $card->description = ''; 33 | $maxPos = $list->cards()->max('position'); 34 | $card->position = $maxPos + 1; 35 | 36 | $response['success'] = $list->cards()->save($card); 37 | $response['id'] = $card->id; 38 | return Response::json($response); 39 | } 40 | 41 | /** 42 | * Update position of the card and 43 | * return true if successful else return false 44 | * @return Boolean 45 | */ 46 | 47 | public function updatePosition(){ 48 | $cardId = Input::get('cid'); 49 | $card = Card::find($cardId); 50 | $newListId = Input::get('nl'); 51 | $previousList = $card->cardList; 52 | $list = CardList::find($newListId); 53 | $newPos = Input::get('np'); 54 | if($list->id == $previousList->id){ 55 | $this->makeSpaceInListAt($list, $card, $newPos); 56 | } 57 | else{ 58 | $this->shiftCardsDown($list, $newPos); 59 | } 60 | $card->position = $newPos; 61 | $response['success'] = $list->cards()->save($card); 62 | $this->reorganizeList($previousList); 63 | return Response::json($response); 64 | } 65 | 66 | /** 67 | * Change the color of the card 68 | * @returns Boolean success status. 69 | */ 70 | public function setColor(){ 71 | $color = Input::get('clr'); 72 | $card = Card::find(Input::get('cid')); 73 | $card->color = $color; 74 | $response['success'] = $card->save(); 75 | return Response::json($response); 76 | } 77 | 78 | /** 79 | * Delete the specified card 80 | * @returns Boolean success status. 81 | */ 82 | public function deleteCard(){ 83 | $card = Card::find(Input::get('cid')); 84 | $response['success'] = $card->delete(); 85 | return Response::json($response); 86 | } 87 | 88 | /** 89 | * Update the card title property 90 | * @returns Boolean success. 91 | */ 92 | public function updateTitle(){ 93 | $card = Card::find(Input::get('cid')); 94 | $title = Input::get('cardTitle'); 95 | $card->title = $title; 96 | $response['success'] = $card->save(); 97 | return Response::json($response); 98 | } 99 | 100 | /** 101 | * Update the card description property 102 | * @returns Boolean success. 103 | */ 104 | public function updateDescription(){ 105 | $card = Card::find(Input::get('cid')); 106 | $desc = Input::get('cardDesc'); 107 | $card->description = $desc; 108 | $response['success'] = $card->save(); 109 | return Response::json($response); 110 | } 111 | 112 | /** 113 | * Make space for a card by moving rest of the cards 114 | * up or down. 115 | * @return void 116 | */ 117 | 118 | private function makeSpaceInListAt($list, $card, $newPos){ 119 | if($card->position < $newPos){ 120 | $this->shiftCardsUp($list, $newPos); 121 | } 122 | else{ 123 | $this->shiftCardsDown($list, $newPos); 124 | } 125 | } 126 | 127 | /** 128 | * Push all the cards up having position less than 129 | * the current by decreasing their position value. 130 | * @return void 131 | */ 132 | 133 | private function shiftCardsUp($list, $pos){ 134 | foreach($list->cards()->get() as $card){ 135 | if($card->position <= $pos){ 136 | $card->position = $card->position - 1; 137 | $card->save(); 138 | } 139 | } 140 | } 141 | 142 | /** 143 | * Push all the cards down having position less than 144 | * the current by decreasing their position value. 145 | * @return void 146 | */ 147 | 148 | private function shiftCardsDown($list, $pos){ 149 | foreach($list->cards()->get() as $card){ 150 | if($card->position >= $pos){ 151 | $card->position = $card->position + 1; 152 | $card->save(); 153 | } 154 | } 155 | } 156 | 157 | /** 158 | * Remove all the empty card positions in the board 159 | * caused by moving the cards. 160 | * @return void 161 | */ 162 | 163 | private function reorganizeList($list){ 164 | $position=0; 165 | foreach ($list->cards()->orderby('position')->get() as $card ){ 166 | $card->position = $position; 167 | $card->save(); 168 | $position++; 169 | } 170 | } 171 | 172 | 173 | } -------------------------------------------------------------------------------- /app/modules/core/views/users/board.blade.php: -------------------------------------------------------------------------------- 1 | @extends('content::layouts.users.default') 2 | 3 | @section('navbarHeader') 4 | 13 | @stop 14 | @section('content') 15 |
16 | 17 |
18 | 52 |
53 |
54 |
55 |
Add a list...
56 | 57 |
58 |
59 |
60 |
61 |
62 | 112 | 113 | @stop 114 | -------------------------------------------------------------------------------- /public/assets/js/libs/jquery.jeditable.mini.js: -------------------------------------------------------------------------------- 1 | 2 | (function($){$.fn.editable=function(target,options){if('disable'==target){$(this).data('disabled.editable',true);return;} 3 | if('enable'==target){$(this).data('disabled.editable',false);return;} 4 | if('destroy'==target){$(this).unbind($(this).data('event.editable')).removeData('disabled.editable').removeData('event.editable');return;} 5 | var settings=$.extend({},$.fn.editable.defaults,{target:target},options);var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types['defaults'].buttons;var content=$.editable.types[settings.type].content||$.editable.types['defaults'].content;var element=$.editable.types[settings.type].element||$.editable.types['defaults'].element;var reset=$.editable.types[settings.type].reset||$.editable.types['defaults'].reset;var callback=settings.callback||function(){};var onedit=settings.onedit||function(){};var onsubmit=settings.onsubmit||function(){};var onreset=settings.onreset||function(){};var onerror=settings.onerror||reset;if(settings.tooltip){$(this).attr('title',settings.tooltip);} 6 | settings.autowidth='auto'==settings.width;settings.autoheight='auto'==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();$(this).data('event.editable',settings.event);if(!$.trim($(this).html())){$(this).html(settings.placeholder);} 7 | $(this).bind(settings.event,function(e){if(true===$(this).data('disabled.editable')){return;} 8 | if(self.editing){return;} 9 | if(false===onedit.apply(this,[settings,self])){return;} 10 | e.preventDefault();e.stopPropagation();if(settings.tooltip){$(self).removeAttr('title');} 11 | if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight;}else{if(settings.width!='none'){settings.width=settings.autowidth?$(self).width():settings.width;} 12 | if(settings.height!='none'){settings.height=settings.autoheight?$(self).height():settings.height;}} 13 | if($(this).html().toLowerCase().replace(/(;|")/g,'')==settings.placeholder.toLowerCase().replace(/(;|")/g,'')){$(this).html('');} 14 | self.editing=true;self.revert=$(self).html();$(self).html('');var form=$('
');if(settings.cssclass){if('inherit'==settings.cssclass){form.attr('class',$(self).attr('class'));}else{form.attr('class',settings.cssclass);}} 15 | if(settings.style){if('inherit'==settings.style){form.attr('style',$(self).attr('style'));form.css('display',$(self).css('display'));}else{form.attr('style',settings.style);}} 16 | var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self]);},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]));}else{$.extend(loaddata,settings.loaddata);} 17 | $.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false;}});}else if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings]);}}else{input_content=self.revert;} 18 | content.apply(form,[input_content,settings,self]);input.attr('name',settings.name);buttons.apply(form,[settings,self]);$(self).append(form);plugin.apply(form,[settings,self]);$(':input:visible:enabled:first',form).focus();if(settings.select){input.select();} 19 | input.keydown(function(e){if(e.keyCode==27){e.preventDefault();reset.apply(form,[settings,self]);}});var t;if('cancel'==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self]);},500);});}else if('submit'==settings.onblur){input.blur(function(e){t=setTimeout(function(){form.submit();},200);});}else if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings]);});}else{input.blur(function(e){});} 20 | form.submit(function(e){if(t){clearTimeout(t);} 21 | e.preventDefault();if(false!==onsubmit.apply(form,[settings,self])){if(false!==submit.apply(form,[settings,self])){if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}}else{var submitdata={};submitdata[settings.name]=input.val();submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]));}else{$.extend(submitdata,settings.submitdata);} 22 | if('PUT'==settings.method){submitdata['_method']='put';} 23 | $(self).html(settings.indicator);var ajaxoptions={type:'POST',data:submitdata,dataType:'html',url:settings.target,success:function(result,status){if(ajaxoptions.dataType=='html'){$(self).html(result);} 24 | self.editing=false;callback.apply(self,[result,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}},error:function(xhr,status,error){onerror.apply(form,[settings,self,xhr]);}};$.extend(ajaxoptions,settings.ajaxoptions);$.ajax(ajaxoptions);}}} 25 | $(self).attr('title',settings.tooltip);return false;});});this.reset=function(form){if(this.editing){if(false!==onreset.apply(form,[settings,self])){$(self).html(self.revert);self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder);} 26 | if(settings.tooltip){$(self).attr('title',settings.tooltip);}}}};});};$.editable={types:{defaults:{element:function(settings,original){var input=$('');$(this).append(input);return(input);},content:function(string,settings,original){$(':input:first',this).val(string);},reset:function(settings,original){original.reset(this);},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){if(submit.attr("type")!="submit"){form.submit();}});}else{var submit=$('