├── .env.example ├── .gitattributes ├── .gitignore ├── LICENSE.txt ├── README.md ├── app ├── Comment.php ├── CommentVote.php ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── Events │ └── Event.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ └── PasswordController.php │ │ ├── CommentController.php │ │ ├── CommentVotesController.php │ │ ├── Controller.php │ │ ├── HomeController.php │ │ ├── ModeratorsController.php │ │ ├── PostsController.php │ │ ├── ProfilesController.php │ │ ├── SubredditController.php │ │ └── VotesController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ ├── ArticleRequest.php │ │ ├── CommentVoteRequest.php │ │ ├── EditPostRequest.php │ │ ├── EditUserRequest.php │ │ ├── ModeratorRequest.php │ │ ├── PostRequest.php │ │ ├── Request.php │ │ ├── SubredditRequest.php │ │ └── VoteRequest.php │ └── routes.php ├── Image.php ├── Jobs │ └── Job.php ├── Listeners │ └── .gitkeep ├── Logic │ └── Image │ │ └── ImageRepository.php ├── Moderator.php ├── Post.php ├── Providers │ ├── AppServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Subreddit.php ├── User.php └── Vote.php ├── artisan ├── auth.json ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── compile.php ├── constants.php ├── database.php ├── filesystems.php ├── image.php ├── images.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2015_09_10_162605_create_subreddit_table.php │ ├── 2015_09_10_204920_create_posts_table.php │ ├── 2015_09_14_192434_create_votes_table.php │ ├── 2015_10_05_215031_create_moderators_table.php │ ├── 2015_10_12_164352_create_comments_table.php │ └── 2015_10_21_172212_create_commentvotes_table.php └── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── gulpfile.js ├── package.json ├── phpspec.yml ├── phpunit.xml ├── public ├── .htaccess ├── assets │ ├── css │ │ ├── bootstrap-editable.css │ │ ├── bootstrap.min.css │ │ ├── dropzone.css │ │ ├── html5shiv.min.js │ │ ├── images │ │ │ └── sprites-stackoverflow.png │ │ ├── jquery.upvote.css │ │ ├── respond.min.js │ │ ├── sticky-footer-navbar.css │ │ ├── style.css │ │ ├── sweetalert.css │ │ └── typeahead.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── img │ │ ├── clear.png │ │ ├── glyphicons-halflings-white.png │ │ ├── glyphicons-halflings.png │ │ └── loading.gif │ ├── js │ │ ├── bootstrap-editable.min.js │ │ ├── bootstrap-modal.js │ │ ├── bootstrap-modalmanager.js │ │ ├── bootstrap.min.js │ │ ├── dropzone-config.js │ │ ├── dropzone.js │ │ ├── ie10-viewport-bug-workaround.js │ │ ├── jquery-ui.min.js │ │ ├── jquery.jscroll.min.js │ │ ├── jquery.min.js │ │ ├── jquery.upvote.js │ │ ├── sweetalert.min.js │ │ ├── tinymce │ │ │ ├── jquery.tinymce.min.js │ │ │ ├── langs │ │ │ │ └── readme.md │ │ │ ├── license.txt │ │ │ ├── plugins │ │ │ │ ├── advlist │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── anchor │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── autolink │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── autoresize │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── autosave │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── bbcode │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── charmap │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── code │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── colorpicker │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── contextmenu │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── directionality │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── emoticons │ │ │ │ │ ├── img │ │ │ │ │ │ ├── smiley-cool.gif │ │ │ │ │ │ ├── smiley-cry.gif │ │ │ │ │ │ ├── smiley-embarassed.gif │ │ │ │ │ │ ├── smiley-foot-in-mouth.gif │ │ │ │ │ │ ├── smiley-frown.gif │ │ │ │ │ │ ├── smiley-innocent.gif │ │ │ │ │ │ ├── smiley-kiss.gif │ │ │ │ │ │ ├── smiley-laughing.gif │ │ │ │ │ │ ├── smiley-money-mouth.gif │ │ │ │ │ │ ├── smiley-sealed.gif │ │ │ │ │ │ ├── smiley-smile.gif │ │ │ │ │ │ ├── smiley-surprised.gif │ │ │ │ │ │ ├── smiley-tongue-out.gif │ │ │ │ │ │ ├── smiley-undecided.gif │ │ │ │ │ │ ├── smiley-wink.gif │ │ │ │ │ │ └── smiley-yell.gif │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── example │ │ │ │ │ ├── dialog.html │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── example_dependency │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── fullpage │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── fullscreen │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── hr │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── image │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── imagetools │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── importcss │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── insertdatetime │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── jbimages │ │ │ │ │ ├── .gitattributes │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── ci │ │ │ │ │ │ ├── application │ │ │ │ │ │ │ ├── .htaccess │ │ │ │ │ │ │ ├── config │ │ │ │ │ │ │ │ ├── autoload.php │ │ │ │ │ │ │ │ ├── config.php │ │ │ │ │ │ │ │ ├── constants.php │ │ │ │ │ │ │ │ ├── database.php │ │ │ │ │ │ │ │ ├── doctypes.php │ │ │ │ │ │ │ │ ├── foreign_chars.php │ │ │ │ │ │ │ │ ├── hooks.php │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ ├── migration.php │ │ │ │ │ │ │ │ ├── mimes.php │ │ │ │ │ │ │ │ ├── profiler.php │ │ │ │ │ │ │ │ ├── routes.php │ │ │ │ │ │ │ │ ├── smileys.php │ │ │ │ │ │ │ │ ├── uploader_settings.php │ │ │ │ │ │ │ │ └── user_agents.php │ │ │ │ │ │ │ ├── controllers │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ └── uploader.php │ │ │ │ │ │ │ ├── errors │ │ │ │ │ │ │ │ ├── error_404.php │ │ │ │ │ │ │ │ ├── error_db.php │ │ │ │ │ │ │ │ ├── error_general.php │ │ │ │ │ │ │ │ ├── error_php.php │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── helpers │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ └── jbimages_helper.php │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ ├── language │ │ │ │ │ │ │ │ ├── english │ │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ │ └── jbstrings_lang.php │ │ │ │ │ │ │ │ ├── french │ │ │ │ │ │ │ │ │ ├── imglib_lang.php │ │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ │ ├── jbstrings_lang.php │ │ │ │ │ │ │ │ │ └── upload_lang.php │ │ │ │ │ │ │ │ └── russian │ │ │ │ │ │ │ │ │ ├── imglib_lang.php │ │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ │ ├── jbstrings_lang.php │ │ │ │ │ │ │ │ │ └── upload_lang.php │ │ │ │ │ │ │ └── views │ │ │ │ │ │ │ │ ├── ajax_upload_result.php │ │ │ │ │ │ │ │ ├── blank.php │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── index.php │ │ │ │ │ │ └── system │ │ │ │ │ │ │ ├── .htaccess │ │ │ │ │ │ │ ├── core │ │ │ │ │ │ │ ├── Benchmark.php │ │ │ │ │ │ │ ├── CodeIgniter.php │ │ │ │ │ │ │ ├── Common.php │ │ │ │ │ │ │ ├── Config.php │ │ │ │ │ │ │ ├── Controller.php │ │ │ │ │ │ │ ├── Exceptions.php │ │ │ │ │ │ │ ├── Hooks.php │ │ │ │ │ │ │ ├── Input.php │ │ │ │ │ │ │ ├── Lang.php │ │ │ │ │ │ │ ├── Loader.php │ │ │ │ │ │ │ ├── Model.php │ │ │ │ │ │ │ ├── Output.php │ │ │ │ │ │ │ ├── Router.php │ │ │ │ │ │ │ ├── Security.php │ │ │ │ │ │ │ ├── URI.php │ │ │ │ │ │ │ ├── Utf8.php │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── helpers │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ └── language_helper.php │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ ├── language │ │ │ │ │ │ │ ├── english │ │ │ │ │ │ │ │ ├── imglib_lang.php │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ └── upload_lang.php │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ └── libraries │ │ │ │ │ │ │ ├── Image_lib.php │ │ │ │ │ │ │ ├── Upload.php │ │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── config.php │ │ │ │ │ ├── css │ │ │ │ │ │ ├── dialog-v4.css │ │ │ │ │ │ └── dialog.css │ │ │ │ │ ├── dialog-v4.htm │ │ │ │ │ ├── dialog.htm │ │ │ │ │ ├── editor_plugin.js │ │ │ │ │ ├── editor_plugin_src.js │ │ │ │ │ ├── img │ │ │ │ │ │ ├── jbimages-bw.gif │ │ │ │ │ │ └── spinner.gif │ │ │ │ │ ├── is_allowed.php │ │ │ │ │ ├── js │ │ │ │ │ │ ├── dialog-v4.js │ │ │ │ │ │ └── dialog.js │ │ │ │ │ ├── langs │ │ │ │ │ │ ├── en.js │ │ │ │ │ │ ├── en_dlg.js │ │ │ │ │ │ ├── fr.js │ │ │ │ │ │ ├── fr_dlg.js │ │ │ │ │ │ ├── ru.js │ │ │ │ │ │ └── ru_dlg.js │ │ │ │ │ ├── plugin.js │ │ │ │ │ ├── plugin.min.js │ │ │ │ │ └── readme │ │ │ │ ├── layer │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── legacyoutput │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── link │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── lists │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── media │ │ │ │ │ ├── moxieplayer.swf │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── nonbreaking │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── noneditable │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── pagebreak │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── paste │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── preview │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── print │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── save │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── searchreplace │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── spellchecker │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── tabfocus │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── table │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── template │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── textcolor │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── textpattern │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── visualblocks │ │ │ │ │ ├── css │ │ │ │ │ │ └── visualblocks.css │ │ │ │ │ └── plugin.min.js │ │ │ │ ├── visualchars │ │ │ │ │ └── plugin.min.js │ │ │ │ └── wordcount │ │ │ │ │ └── plugin.min.js │ │ │ ├── skins │ │ │ │ └── lightgray │ │ │ │ │ ├── content.inline.min.css │ │ │ │ │ ├── content.min.css │ │ │ │ │ ├── fonts │ │ │ │ │ ├── tinymce-small.eot │ │ │ │ │ ├── tinymce-small.svg │ │ │ │ │ ├── tinymce-small.ttf │ │ │ │ │ ├── tinymce-small.woff │ │ │ │ │ ├── tinymce.eot │ │ │ │ │ ├── tinymce.svg │ │ │ │ │ ├── tinymce.ttf │ │ │ │ │ └── tinymce.woff │ │ │ │ │ ├── img │ │ │ │ │ ├── anchor.gif │ │ │ │ │ ├── loader.gif │ │ │ │ │ ├── object.gif │ │ │ │ │ └── trans.gif │ │ │ │ │ ├── skin.ie7.min.css │ │ │ │ │ └── skin.min.css │ │ │ ├── themes │ │ │ │ └── modern │ │ │ │ │ └── theme.min.js │ │ │ └── tinymce.min.js │ │ └── typeahead.bundle.js │ └── wysihtml5 │ │ ├── bootstrap-wysihtml5-0.0.2 │ │ ├── bootstrap-wysihtml5-0.0.2.css │ │ ├── bootstrap-wysihtml5-0.0.2.js │ │ ├── bootstrap-wysihtml5-0.0.2.min.js │ │ ├── wysihtml5-0.3.0.js │ │ ├── wysihtml5-0.3.0.min.js │ │ └── wysiwyg-color.css │ │ └── wysihtml5.js ├── css │ ├── app.css │ └── app.css.map ├── eastgate │ └── comment │ │ ├── css │ │ └── comment.css │ │ └── js │ │ └── comment.js ├── favicon.ico ├── images │ └── default.png ├── index.php ├── robots.txt └── vendor │ └── folklore │ └── image │ ├── .gitkeep │ └── js │ └── image.js ├── resources ├── assets │ └── sass │ │ └── app.scss ├── lang │ └── en │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── auth │ ├── login.blade.php │ ├── password.blade.php │ ├── register.blade.php │ └── reset.blade.php │ ├── eastgate │ └── comment │ │ ├── cancel_reply.blade.php │ │ ├── comment_fields.blade.php │ │ ├── comment_list.blade.php │ │ └── leave_a_comment.blade.php │ ├── errors │ └── 503.blade.php │ ├── home.blade.php │ ├── layouts │ └── default.blade.php │ ├── partials │ ├── post.blade.php │ ├── post_sidebar.blade.php │ └── sub_sidebar.blade.php │ ├── post │ ├── create.blade.php │ ├── edit.blade.php │ └── show.blade.php │ ├── site │ ├── search.blade.php │ └── sidebar.blade.php │ ├── subreddit │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ ├── moderators │ │ └── create.blade.php │ ├── search.blade.php │ └── show.blade.php │ ├── user │ ├── edit.blade.php │ ├── mysubreddits.blade.php │ └── profile.blade.php │ └── vendor │ ├── .gitkeep │ └── editor │ └── head.blade.php ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── ExampleTest.php └── TestCase.php /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | APP_KEY=SomeRandomString 4 | 5 | DB_HOST=localhost 6 | DB_DATABASE=database 7 | DB_USERNAME=username 8 | DB_PASSWORD=password 9 | 10 | CACHE_DRIVER=file 11 | SESSION_DRIVER=file 12 | QUEUE_DRIVER=sync 13 | 14 | MAIL_DRIVER=smtp 15 | MAIL_HOST=mailtrap.io 16 | MAIL_PORT=2525 17 | MAIL_USERNAME=null 18 | MAIL_PASSWORD=null 19 | MAIL_ENCRYPTION=null -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.less linguist-vendored 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | Homestead.yaml 4 | .env 5 | .idea -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # laravel-reddit 2 | Reddit clone built with Laravel 5 3 | 4 | Demo: http://maghnatis.com 5 | 6 | # Packages Used 7 | 1. ["intervention/image"](https://github.com/Intervention/image) 8 | 2. ["oscarotero/Embed"](https://github.com/oscarotero/Embed) 9 | 3. ["mohankumaranna/comment"](https://github.com/mohankumaranna/comment) 10 | 11 | # Features 12 | 1. Login/Register 13 | 2. Subreddits 14 | 3. Posts (link and text) 15 | 4. Moderators 16 | 5. Search 17 | 6. Threaded Comments with inline editing 18 | 7. Upvote/Downvote 19 | 8. User Profiles 20 | 21 | # To-Do 22 | 1. Sorting 23 | 24 | # Installation 25 | 1. git clone https://github.com/Halnex/laravel-reddit projectname 26 | 2. composer install 27 | 3. php artisan migrate 28 | 29 | Open AuthServiceProvider.php and import the following classes. 30 | ```php 31 | use Illuminate\Auth\Access\Gate; 32 | use Illuminate\Contracts\Auth\Access\Gate as GateContract; 33 | use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; 34 | ``` 35 | Now add the following method to the class 36 | ```php 37 | public function boot(GateContract $gate) 38 | { 39 | parent::registerPolicies($gate); 40 | 41 | $gate->define('update-post', function ($user, $post, $isModerator) { 42 | if ($user->id === $post->subreddit->user->id) { 43 | return true; 44 | } 45 | 46 | if ($user->id === $post->user_id) { 47 | return true; 48 | } 49 | 50 | if ($isModerator) { 51 | return true; 52 | } 53 | 54 | return false; 55 | }); 56 | 57 | $gate->define('update-sub', function($user, $subreddit) { 58 | if($user->id === $subreddit->user->id) { 59 | return true; 60 | } 61 | 62 | return false; 63 | }); 64 | 65 | $gate->define('update-comment', function($user, $comment, $isModerator) { 66 | if($user->id === $comment->user_id) { 67 | return true; 68 | } 69 | 70 | if ($isModerator) { 71 | return true; 72 | } 73 | }); 74 | } 75 | ``` 76 | -------------------------------------------------------------------------------- /app/Comment.php: -------------------------------------------------------------------------------- 1 | where('parent_id', $parentId)->orderBy('created_at', $order); 32 | } 33 | 34 | public function scopeForPost($query, $postId) { 35 | return $query->where('post_id', $postId); 36 | } 37 | 38 | //Then, change your existing methods... 39 | public static function root_comments($postId) { 40 | return self::byParent(0, 'desc')->forPost($postId)->get(); 41 | } 42 | 43 | public static function child_comments($parent_id, $order = 'asc') { 44 | return self::byParent($parent_id, $order)->get(); 45 | } 46 | 47 | /** 48 | * Gets Parent Comment object 49 | * 50 | * @return null/Comment 51 | */ 52 | public function parent(){ 53 | $result = null; 54 | if($this->parent_id > 0) 55 | $result = self::find($this->parent_id); 56 | return $result; 57 | } 58 | 59 | public function posts() { 60 | return $this->belongsTo('App\Post', 'post_id'); 61 | } 62 | 63 | public function user() { 64 | return $this->belongsTo('App\User'); 65 | } 66 | 67 | public function commentvotes() { 68 | return $this->hasMany('App\CommentVote'); 69 | } 70 | 71 | public function subreddit() { 72 | return $this->belongsTo('App\Subreddit'); 73 | } 74 | } -------------------------------------------------------------------------------- /app/CommentVote.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User'); 19 | } 20 | 21 | public function posts() { 22 | return $this->belongsTo('App\Comment'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Console/Commands/Inspire.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | ->hourly(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'getLogout']); 37 | } 38 | 39 | /** 40 | * Get a validator for an incoming registration request. 41 | * 42 | * @param array $data 43 | * @return \Illuminate\Contracts\Validation\Validator 44 | */ 45 | protected function validator(array $data) 46 | { 47 | return Validator::make($data, [ 48 | 'name' => 'required|max:255|alpha_spaces', 49 | 'email' => 'required|email|max:255|unique:users', 50 | 'password' => 'required|confirmed|min:6', 51 | ]); 52 | } 53 | 54 | /** 55 | * Create a new user instance after a valid registration. 56 | * 57 | * @param array $data 58 | * @return User 59 | */ 60 | protected function create(array $data) 61 | { 62 | return User::create([ 63 | 'name' => $data['name'], 64 | 'email' => $data['email'], 65 | 'password' => bcrypt($data['password']), 66 | ]); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/CommentVotesController.php: -------------------------------------------------------------------------------- 1 | middleware('auth', ['only' => ['create', 'edit'] ]); 14 | } 15 | 16 | public function store(Requests\CommentVoteRequest $request) 17 | { 18 | $commentId = $request->input('commentId'); 19 | $userId = $request->user()->id; 20 | $value = $request->input('value'); 21 | 22 | // Check to see if there is an existing vote 23 | $vote = CommentVote::whereCommentId($commentId)->whereUserId($userId)->first(); 24 | if (!$vote) 25 | { 26 | // First time the user is voting 27 | CommentVote::create(['comment_id' => $commentId, 'user_id' => $userId, 'value' => $value]); 28 | } else { 29 | $vote->value == $value ? $vote->delete() : $vote->update(['value' => $value]); 30 | } 31 | // AJAX JSON RESPONSE 32 | return response()->json(['status' => 'success', 33 | 'msg' => 'Vote has been added.']); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | middleware('auth', ['only' => ['edit'] ]); 21 | } 22 | 23 | public function show($user, Post $post) 24 | { 25 | $user = User::whereName($user)->with('posts.votes')->with('comments.posts')->firstOrFail(); 26 | $comments = $user->comments; 27 | $linkKarma = $user->votes()->sum('value'); 28 | $commentKarma = $user->commentvotes()->sum('value'); 29 | $total_comments = $user->comments->count(); 30 | 31 | $isModerator = false; 32 | 33 | return view('user/profile')->with('user', $user) 34 | ->with('linkKarma', $linkKarma) 35 | ->with('commentKarma', $commentKarma) 36 | ->with('comments', $comments) 37 | ->with('total_comments', $total_comments) 38 | ->with('isModerator', $isModerator); 39 | } 40 | 41 | public function edit(User $user) 42 | { 43 | $user = User::where('id', '=', Auth::id())->first(); 44 | return view('user/edit')->with('user', $user); 45 | 46 | } 47 | 48 | public function update(Request $request, User $user, Requests\EditUserRequest $request) 49 | { 50 | $user = User::where('id', '=', Auth::id())->first(); 51 | $user->name = Input::get('name'); 52 | $user->email = Input::get('email'); 53 | 54 | if(!empty(Input::get('password'))) { 55 | $user->password = Hash::make(Input::get('password')); 56 | } 57 | 58 | $user->save(); 59 | 60 | return view('user/edit')->with('user', $user); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/Http/Controllers/VotesController.php: -------------------------------------------------------------------------------- 1 | middleware('auth', ['only' => ['create', 'edit'] ]); 27 | } 28 | 29 | /** 30 | * Store a newly created resource in storage. 31 | * 32 | * NOTE: You are using a FormRequest without any sort of validation.. revise? 33 | * 34 | * @param Requests\VoteRequest|Request $request 35 | * @param $id 36 | * @return Response 37 | */ 38 | public function store(Requests\VoteRequest $request) 39 | { 40 | $postId = $request->input('postId'); 41 | $userId = $request->user()->id; 42 | $value = $request->input('value'); 43 | 44 | // Check to see if there is an existing vote 45 | $vote = Vote::wherePostId($postId)->whereUserId($userId)->first(); 46 | if (!$vote) 47 | { 48 | // First time the user is voting 49 | Vote::create(['post_id' => $postId, 'user_id' => $userId, 'value' => $value]); 50 | } else { 51 | $vote->value == $value ? $vote->delete() : $vote->update(['value' => $value]); 52 | } 53 | // AJAX JSON RESPONSE 54 | return response()->json(['status' => 'success', 55 | 'msg' => 'Vote has been added.']); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | \App\Http\Middleware\Authenticate::class, 30 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 31 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * Handle an incoming request. 30 | * 31 | * @param \Illuminate\Http\Request $request 32 | * @param \Closure $next 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next) 36 | { 37 | if ($this->auth->guest()) { 38 | if ($request->ajax()) { 39 | return response('Unauthorized.', 401); 40 | } else { 41 | return redirect()->guest('auth/login'); 42 | } 43 | } 44 | 45 | return $next($request); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * Handle an incoming request. 30 | * 31 | * @param \Illuminate\Http\Request $request 32 | * @param \Closure $next 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next) 36 | { 37 | if ($this->auth->check()) { 38 | return redirect('/home'); 39 | } 40 | 41 | return $next($request); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 'required|min:3', 28 | 'body' => 'required', 29 | 'published_at' => 'required|date' 30 | ]; 31 | } 32 | } -------------------------------------------------------------------------------- /app/Http/Requests/CommentVoteRequest.php: -------------------------------------------------------------------------------- 1 | 'required' 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/EditUserRequest.php: -------------------------------------------------------------------------------- 1 | 'required|max:255|alpha_spaces', 28 | 'email' => 'required|email|max:255|unique:users', 29 | 'password' => 'confirmed|min:6', 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Requests/ModeratorRequest.php: -------------------------------------------------------------------------------- 1 | 'required' 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Requests/PostRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 26 | 'subreddit_id' => 'required' 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Requests/Request.php: -------------------------------------------------------------------------------- 1 | 'required|min:3|alpha_spaces', 28 | 'description' => 'required' 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Requests/VoteRequest.php: -------------------------------------------------------------------------------- 1 | 'required|mimes:png,gif,jpeg,jpg,bmp' 8 | ]; 9 | public static $messages = [ 10 | 'file.mimes' => 'Uploaded file is not in image format', 11 | 'file.required' => 'Image is required' 12 | ]; 13 | 14 | public function posts() { 15 | return $this->belongsTo('App\Post'); 16 | } 17 | } -------------------------------------------------------------------------------- /app/Jobs/Job.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\Subreddit'); 15 | } 16 | 17 | public function user() { 18 | return $this->belongsTo('App\User', 'user_id'); 19 | } 20 | 21 | public function posts() { 22 | return $this->belongsTo('App\Post'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Post.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User'); 23 | } 24 | 25 | public function subreddit() { 26 | return $this->belongsTo('App\Subreddit'); 27 | } 28 | 29 | public function votes() { 30 | return $this->hasMany('App\Vote'); 31 | } 32 | 33 | public function moderators() { 34 | return $this->hasMany('App\Moderator'); 35 | } 36 | 37 | public function comments() { 38 | return $this->hasMany('App\Comment'); 39 | } 40 | } -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any other events for your application. 23 | * 24 | * @param \Illuminate\Contracts\Events\Dispatcher $events 25 | * @return void 26 | */ 27 | public function boot(DispatcherContract $events) 28 | { 29 | parent::boot($events); 30 | 31 | // 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | model('articles', 'App\Article'); 32 | $router->model('subreddit', 'App\Subreddit'); 33 | $router->model('posts', 'App\Post'); 34 | $router->model('moderators', 'App\Moderator'); 35 | $router->model('comments', 'App\Comment'); 36 | } 37 | 38 | /** 39 | * Define the routes for the application. 40 | * 41 | * @param \Illuminate\Routing\Router $router 42 | * @return void 43 | */ 44 | public function map(Router $router) 45 | { 46 | $router->group(['namespace' => $this->namespace], function ($router) { 47 | require app_path('Http/routes.php'); 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Subreddit.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User'); 17 | } 18 | 19 | public function posts() { 20 | return $this->hasMany('App\Post'); 21 | } 22 | 23 | public function moderators() { 24 | return $this->hasMany('App\Moderator'); 25 | } 26 | 27 | public function comments() { 28 | return $this->hasMany('App\Comment'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Subreddit'); 25 | } 26 | 27 | public function posts() { 28 | return $this->hasMany('App\Post'); 29 | } 30 | 31 | public function votes() { 32 | return $this->hasManyThrough('App\Vote','App\Post'); 33 | } 34 | 35 | public function commentvotes() { 36 | return $this->hasManyThrough('App\CommentVote','App\Comment'); 37 | } 38 | 39 | public function moderators() { 40 | return $this->hasMany('App\Moderator'); 41 | } 42 | 43 | public function comments() { 44 | return $this->hasMany('App\Comment'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Vote.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\User'); 19 | } 20 | 21 | public function posts() { 22 | return $this->belongsTo('App\Post'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "github-oauth": { 3 | "github.com": "5238ed30091254267316e6895f53e5134b7d2325" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | =5.5.9", 9 | "laravel/framework": "5.1.*", 10 | "illuminate/html": "^5.0", 11 | "intervention/image": "^2.3", 12 | "embed/embed": "^2.5" 13 | }, 14 | "require-dev": { 15 | "fzaninotto/faker": "~1.4", 16 | "mockery/mockery": "0.9.*", 17 | "phpunit/phpunit": "~4.0", 18 | "phpspec/phpspec": "~2.1" 19 | }, 20 | "autoload": { 21 | "classmap": [ 22 | "database" 23 | ], 24 | "psr-4": { 25 | "App\\": "app/" 26 | } 27 | }, 28 | "autoload-dev": { 29 | "classmap": [ 30 | "tests/TestCase.php" 31 | ] 32 | }, 33 | "scripts": { 34 | "post-install-cmd": [ 35 | "php artisan clear-compiled", 36 | "php artisan optimize" 37 | ], 38 | "pre-update-cmd": [ 39 | "php artisan clear-compiled" 40 | ], 41 | "post-update-cmd": [ 42 | "php artisan optimize" 43 | ], 44 | "post-root-package-install": [ 45 | "php -r \"copy('.env.example', '.env');\"" 46 | ], 47 | "post-create-project-cmd": [ 48 | "php artisan key:generate" 49 | ] 50 | }, 51 | "config": { 52 | "preferred-install": "dist" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /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' => App\User::class, 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 Reset Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the options for resetting passwords including the view 52 | | that is your password reset e-mail. You can also set the name of the 53 | | table that maintains all of the reset tokens for your application. 54 | | 55 | | The expire time is the number of minutes that the reset token 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 | 'password' => [ 62 | 'email' => 'emails.password', 63 | 'table' => 'password_resets', 64 | 'expire' => 60, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'pusher'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Broadcast Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the broadcast connections that will be used 24 | | to broadcast events to other systems or over websockets. Samples of 25 | | each available type of connection are provided inside this array. 26 | | 27 | */ 28 | 29 | 'connections' => [ 30 | 31 | 'pusher' => [ 32 | 'driver' => 'pusher', 33 | 'key' => env('PUSHER_KEY'), 34 | 'secret' => env('PUSHER_SECRET'), 35 | 'app_id' => env('PUSHER_APP_ID'), 36 | ], 37 | 38 | 'redis' => [ 39 | 'driver' => 'redis', 40 | 'connection' => 'default', 41 | ], 42 | 43 | 'log' => [ 44 | 'driver' => 'log', 45 | ], 46 | 47 | ], 48 | 49 | ]; 50 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Cache Stores 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the cache "stores" for your application as 24 | | well as their drivers. You may even define multiple stores for the 25 | | same cache driver to group types of items stored in your caches. 26 | | 27 | */ 28 | 29 | 'stores' => [ 30 | 31 | 'apc' => [ 32 | 'driver' => 'apc', 33 | ], 34 | 35 | 'array' => [ 36 | 'driver' => 'array', 37 | ], 38 | 39 | 'database' => [ 40 | 'driver' => 'database', 41 | 'table' => 'cache', 42 | 'connection' => null, 43 | ], 44 | 45 | 'file' => [ 46 | 'driver' => 'file', 47 | 'path' => storage_path('framework/cache'), 48 | ], 49 | 50 | 'memcached' => [ 51 | 'driver' => 'memcached', 52 | 'servers' => [ 53 | [ 54 | 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100, 55 | ], 56 | ], 57 | ], 58 | 59 | 'redis' => [ 60 | 'driver' => 'redis', 61 | 'connection' => 'default', 62 | ], 63 | 64 | ], 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Cache Key Prefix 69 | |-------------------------------------------------------------------------- 70 | | 71 | | When utilizing a RAM based store such as APC or Memcached, there might 72 | | be other applications utilizing the same cache. So, we'll specify a 73 | | value to get prefixed to all our keys so we can avoid collisions. 74 | | 75 | */ 76 | 77 | 'prefix' => 'laravel', 78 | 79 | ]; 80 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /config/constants.php: -------------------------------------------------------------------------------- 1 | 50, // number of comments to be shown per page 5 | ); -------------------------------------------------------------------------------- /config/images.php: -------------------------------------------------------------------------------- 1 | 'C:\xampp\htdocs\laravel-5\public\images\full_size\full_size', 5 | 'icon_size' => 'C:\xampp\htdocs\laravel-5\public\images\icon_size\icon_size', 6 | ]; -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => '', 19 | 'secret' => '', 20 | ], 21 | 22 | 'mandrill' => [ 23 | 'secret' => '', 24 | ], 25 | 26 | 'ses' => [ 27 | 'key' => '', 28 | 'secret' => '', 29 | 'region' => 'us-east-1', 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => '', 35 | 'secret' => '', 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function ($faker) { 15 | return [ 16 | 'name' => $faker->name, 17 | 'email' => $faker->email, 18 | 'password' => str_random(10), 19 | 'remember_token' => str_random(10), 20 | ]; 21 | }); 22 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/database/migrations/.gitkeep -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->string('email')->unique(); 19 | $table->string('password', 60); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('users'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 17 | $table->string('token')->index(); 18 | $table->timestamp('created_at'); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('password_resets'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2015_09_10_162605_create_subreddit_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->text('description'); 19 | $table->integer('user_id')->unsigned(); 20 | $table->timestamps(); 21 | 22 | $table->foreign('user_id') 23 | ->references('id') 24 | ->on('users'); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::drop('subreddits'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2015_09_10_204920_create_posts_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('title'); 18 | $table->string('link'); 19 | $table->text('text'); 20 | $table->string('image'); 21 | $table->integer('user_id')->unsigned(); 22 | $table->integer('subreddit_id')->unsigned(); 23 | $table->timestamps(); 24 | 25 | $table->foreign('user_id') 26 | ->references('id') 27 | ->on('users'); 28 | 29 | $table->foreign('subreddit_id') 30 | ->references('id') 31 | ->on('subreddits'); 32 | 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::drop('posts', function(Blueprint $table) { 44 | $table->dropForeign('posts_user_id_foreign'); 45 | $table->dropColumn('user_id'); 46 | $table->dropForeign('posts_subreddit_id_foreign'); 47 | $table->dropColumn('subreddit_id'); 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /database/migrations/2015_09_14_192434_create_votes_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('value'); 18 | $table->integer('user_id')->unsigned(); 19 | $table->integer('post_id')->unsigned(); 20 | $table->timestamps(); 21 | 22 | $table->foreign('user_id') 23 | ->references('id') 24 | ->on('users'); 25 | 26 | $table->foreign('post_id') 27 | ->references('id') 28 | ->on('posts'); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | Schema::drop('votes', function(Blueprint $table) { 40 | $table->dropForeign('votes_user_id_foreign'); 41 | $table->dropColumn('user_id'); 42 | $table->dropForeign('votes_post_id_foreign'); 43 | $table->dropColumn('post_id'); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /database/migrations/2015_10_05_215031_create_moderators_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('user_id')->unsigned(); 18 | $table->integer('subreddit_id')->unsigned(); 19 | $table->timestamps(); 20 | 21 | $table->foreign('user_id') 22 | ->references('id') 23 | ->on('users'); 24 | 25 | $table->foreign('subreddit_id') 26 | ->references('id') 27 | ->on('subreddits'); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::drop('moderators', function(Blueprint $table) { 39 | $table->dropForeign('moderators_user_id_foreign'); 40 | $table->dropColumn('user_id'); 41 | $table->dropForeign('moderators_subreddit_id_foreign'); 42 | $table->dropColumn('subreddit_id'); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /database/migrations/2015_10_12_164352_create_comments_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('post_id')->unsigned(); 18 | $table->string('comment'); // made unique so as to avoid duplicates 19 | $table->integer('user_id')->unsigned(); 20 | $table->integer('parent_id')->default(0); // links to parent comment 21 | $table->string('parents')->nullable(); 22 | $table->softDeletes(); // this adds 'deleted_at' column in the Users table 23 | $table->timestamps(); 24 | 25 | $table->foreign('user_id') 26 | ->references('id') 27 | ->on('users'); 28 | 29 | $table->foreign('post_id') 30 | ->references('id') 31 | ->on('posts'); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::drop('comments', function(Blueprint $table) { 43 | $table->dropForeign('comments_user_id_foreign'); 44 | $table->dropColumn('user_id'); 45 | $table->dropForeign('comments_post_id_foreign'); 46 | $table->dropColumn('post_id'); 47 | }); 48 | } 49 | } -------------------------------------------------------------------------------- /database/migrations/2015_10_21_172212_create_commentvotes_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('value'); 18 | $table->integer('user_id')->unsigned(); 19 | $table->integer('comment_id')->unsigned(); 20 | $table->timestamps(); 21 | 22 | $table->foreign('user_id') 23 | ->references('id') 24 | ->on('users'); 25 | 26 | $table->foreign('comment_id') 27 | ->references('id') 28 | ->on('comments'); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | Schema::drop('commentvotes', function(Blueprint $table) { 40 | $table->dropForeign('commentvotes_user_id_foreign'); 41 | $table->dropColumn('user_id'); 42 | $table->dropForeign('commentvotes_comment_id_foreign'); 43 | $table->dropColumn('comment_id'); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/database/seeds/.gitkeep -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UserTableSeeder::class); 18 | //$this->call(RolesTableSeeder::class); 19 | //$this->call(FlairsTableSeeder::class); 20 | 21 | Model::reguard(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Elixir Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for our application, as well as publishing vendor resources. 11 | | 12 | */ 13 | 14 | elixir(function(mix) { 15 | mix.sass('app.scss'); 16 | }); 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "gulp": "^3.8.8" 5 | }, 6 | "dependencies": { 7 | "laravel-elixir": "^2.0.0", 8 | "bootstrap-sass": "^3.0.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /phpspec.yml: -------------------------------------------------------------------------------- 1 | suites: 2 | main: 3 | namespace: App 4 | psr4_prefix: App 5 | src_path: app -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | 19 | app/ 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | -------------------------------------------------------------------------------- /public/assets/css/images/sprites-stackoverflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/css/images/sprites-stackoverflow.png -------------------------------------------------------------------------------- /public/assets/css/sticky-footer-navbar.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles 2 | -------------------------------------------------- */ 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | /* Margin bottom by footer height */ 9 | margin-bottom: 60px; 10 | } 11 | .footer { 12 | position: absolute; 13 | bottom: 0; 14 | width: 100%; 15 | /* Set the fixed height of the footer here */ 16 | height: 60px; 17 | background-color: #f5f5f5; 18 | } 19 | 20 | 21 | /* Custom page CSS 22 | -------------------------------------------------- */ 23 | /* Not required for template or sticky footer method. */ 24 | 25 | body > .container { 26 | padding: 60px 15px 0; 27 | } 28 | .container .text-muted { 29 | margin: 20px 0; 30 | } 31 | 32 | .footer > .container { 33 | padding-right: 15px; 34 | padding-left: 15px; 35 | } 36 | 37 | code { 38 | font-size: 80%; 39 | } 40 | -------------------------------------------------------------------------------- /public/assets/css/style.css: -------------------------------------------------------------------------------- 1 | .glyphicon { margin-right:5px;} 2 | .section-box h2 { margin-top:0px;} 3 | .section-box h2 a { font-size:15px; } 4 | .glyphicon-heart { color:#e74c3c;} 5 | .glyphicon-comment { color:#27ae60;} 6 | .separator { padding-right:5px;padding-left:5px; } 7 | .section-box hr {margin-top: 0;margin-bottom: 5px;border: 0;border-top: 1px solid rgb(199, 199, 199);} 8 | 9 | .post-comments { 10 | padding-bottom: 9px; 11 | margin: 5px 0 5px; 12 | } 13 | 14 | .comments-nav { 15 | border-bottom: 1px solid #eee; 16 | margin-bottom: 5px; 17 | } 18 | 19 | .post-comments .comment-meta { 20 | border-bottom: 1px solid #eee; 21 | margin-bottom: 5px; 22 | } 23 | 24 | .post-comments .media { 25 | border-left: 1px dotted #000; 26 | border-bottom: 1px dotted #000; 27 | margin-bottom: 5px; 28 | padding-left: 10px; 29 | } 30 | 31 | .post-comments .media-heading { 32 | font-size: 12px; 33 | color: grey; 34 | } 35 | 36 | .post-comments .comment-meta a { 37 | font-size: 12px; 38 | color: grey; 39 | font-weight: bolder; 40 | margin-right: 5px; 41 | } -------------------------------------------------------------------------------- /public/assets/css/typeahead.css: -------------------------------------------------------------------------------- 1 | .typeahead, 2 | .tt-query, 3 | .tt-hint { 4 | width: 396px; 5 | height: 30px; 6 | padding: 8px 12px; 7 | font-size: 24px; 8 | line-height: 30px; 9 | border: 2px solid #ccc; 10 | -webkit-border-radius: 8px; 11 | -moz-border-radius: 8px; 12 | border-radius: 8px; 13 | outline: none; 14 | } 15 | 16 | .typeahead { 17 | background-color: #fff; 18 | } 19 | 20 | .typeahead:focus { 21 | border: 2px solid #0097cf; 22 | } 23 | 24 | .tt-query { 25 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 26 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 27 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 28 | } 29 | 30 | .tt-hint { 31 | color: #999 32 | } 33 | 34 | .tt-menu { 35 | width: 422px; 36 | margin: 12px 0; 37 | padding: 8px 0; 38 | background-color: #fff; 39 | border: 1px solid #ccc; 40 | border: 1px solid rgba(0, 0, 0, 0.2); 41 | -webkit-border-radius: 8px; 42 | -moz-border-radius: 8px; 43 | border-radius: 8px; 44 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); 45 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); 46 | box-shadow: 0 5px 10px rgba(0,0,0,.2); 47 | } 48 | 49 | .tt-suggestion { 50 | padding: 3px 20px; 51 | font-size: 18px; 52 | line-height: 24px; 53 | } 54 | 55 | .tt-suggestion:hover { 56 | cursor: pointer; 57 | color: #fff; 58 | background-color: #0097cf; 59 | } 60 | 61 | .tt-suggestion.tt-cursor { 62 | color: #fff; 63 | background-color: #0097cf; 64 | 65 | } 66 | 67 | .tt-suggestion p { 68 | margin: 0; 69 | } 70 | 71 | .gist { 72 | font-size: 14px; 73 | } -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/assets/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /public/assets/img/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/img/clear.png -------------------------------------------------------------------------------- /public/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /public/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/img/loading.gif -------------------------------------------------------------------------------- /public/assets/js/dropzone-config.js: -------------------------------------------------------------------------------- 1 | var photo_counter = 0; 2 | Dropzone.options.realDropzone = { 3 | 4 | uploadMultiple: false, 5 | parallelUploads: 100, 6 | maxFilesize: 8, 7 | previewsContainer: '#dropzonePreview', 8 | previewTemplate: document.querySelector('#preview-template').innerHTML, 9 | addRemoveLinks: true, 10 | dictRemoveFile: 'Remove', 11 | dictFileTooBig: 'Image is bigger than 8MB', 12 | autoProcessQueue: false, 13 | 14 | // The setting up of the dropzone 15 | init:function() { 16 | 17 | this.on("removedfile", function(file) { 18 | 19 | $.ajax({ 20 | type: 'POST', 21 | url: 'upload/delete', 22 | data: {id: file.name}, 23 | dataType: 'html', 24 | success: function(data){ 25 | var rep = JSON.parse(data); 26 | if(rep.code == 200) 27 | { 28 | photo_counter--; 29 | $("#photoCounter").text( "(" + photo_counter + ")"); 30 | } 31 | 32 | } 33 | }); 34 | 35 | } ); 36 | }, 37 | 38 | error: function(file, response) { 39 | if($.type(response) === "string") 40 | var message = response; //dropzone sends it's own error messages in string 41 | else 42 | var message = response.message; 43 | file.previewElement.classList.add("dz-error"); 44 | _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]"); 45 | _results = []; 46 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { 47 | node = _ref[_i]; 48 | _results.push(node.textContent = message); 49 | } 50 | return _results; 51 | }, 52 | success: function(file,done) { 53 | photo_counter++; 54 | $("#photoCounter").text( "(" + photo_counter + ")"); 55 | } 56 | } -------------------------------------------------------------------------------- /public/assets/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/langs/readme.md: -------------------------------------------------------------------------------- 1 | This is where language files should be placed. 2 | 3 | Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ 4 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/advlist/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;d=e.getParent(f.getNode(),"ol,ul"),d&&d.nodeName==b&&c!==!1||a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList"),c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()})}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/anchor/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("anchor",function(a){function b(){var b=a.selection.getNode(),c="";"A"==b.tagName&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(b){a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:b.data.name}))}})}a.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:b,stateSelector:"a:not([href])"}),a.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:b})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/autolink/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?g.setStart(a,d(a,b)):g.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?g.setEnd(a,d(a,b)):g.setEndAfter(a)}var g,h,i,j,k,l,m,n,o,p;if("A"!=a.selection.getNode().tagName){if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/autoresize/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||0>=l)&&(l=tinymce.Env.ie?i.scrollHeight:tinymce.Env.webkit&&0===i.clientHeight?0:i.offsetHeight),l>e.autoresize_min_height&&(k=l),e.autoresize_max_height&&l>e.autoresize_max_height?(k=e.autoresize_max_height,i.style.overflowY="auto",j.style.overflowY="auto"):(i.style.overflowY="hidden",j.style.overflowY="hidden",i.scrollTop=0),k!==f&&(g=k-f,s.setStyle(a.iframeElement,"height",k+"px"),f=k,tinymce.isWebKit&&0>g&&c(d))}}function d(a,b,e){setTimeout(function(){c({}),a--?d(a,b,e):e&&e()},b)}var e=a.settings,f=0;a.settings.inline||(e.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),e.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",c),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){d(20,100,function(){d(5,1e3)})}),a.addCommand("mceAutoResize",c))}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/autosave/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return(new Date).getTime()-a>m.autosave_retention?(d(!1),!1):!0}function d(b){n.removeItem(k+"draft"),n.removeItem(k+"time"),b!==!1&&a.fire("RemoveDraft")}function e(){!j()&&a.isDirty()&&(n.setItem(k+"draft",a.getContent({format:"raw",no_events:!0})),n.setItem(k+"time",(new Date).getTime()),a.fire("StoreDraft"))}function f(){c()&&(a.setContent(n.getItem(k+"draft"),{format:"raw"}),a.fire("RestoreDraft"))}function g(){l||(setInterval(function(){a.removed||e()},m.autosave_interval),l=!0)}function h(){var b=this;b.disabled(!c()),a.on("StoreDraft RestoreDraft RemoveDraft",function(){b.disabled(!c())}),g()}function i(){a.undoManager.beforeChange(),f(),d(),a.undoManager.add()}function j(b){var c=a.settings.forced_root_block;return b=tinymce.trim("undefined"==typeof b?a.getBody().innerHTML:b),""===b||new RegExp("^<"+c+"[^>]*>((\xa0| |[ ]|]*>)+?|)|
$","i").test(b)}var k,l,m=a.settings,n=tinymce.util.LocalStorage;k=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",k=k.replace(/\{path\}/g,document.location.pathname),k=k.replace(/\{query\}/g,document.location.search),k=k.replace(/\{id\}/g,a.id),m.autosave_interval=b(m.autosave_interval,"30s"),m.autosave_retention=b(m.autosave_retention,"20m"),a.addButton("restoredraft",{title:"Restore last draft",onclick:i,onPostRender:h}),a.addMenuItem("restoredraft",{text:"Restore last draft",onclick:i,onPostRender:h,context:"file"}),a.settings.autosave_restore_when_empty!==!1&&(a.on("init",function(){c()&&j()&&f()}),a.on("saveContent",function(){d()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=c,this.storeDraft=e,this.restoreDraft=f,this.removeDraft=d,this.isEmpty=j}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/contextmenu/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h'}),a+=""}),a+=""}var d=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:c,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent(''+c.getAttribute('),this.hide())}},tooltip:"Emoticons"})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/example/dialog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Custom dialog

5 | Input some text: 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/example/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("example",function(a,b){a.addButton("example",{text:"My button",icon:!1,onclick:function(){a.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(b){a.insertContent("Title: "+b.data.title)}})}}),a.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){a.windowManager.open({title:"TinyMCE site",url:b+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var b=a.windowManager.getWindows()[0];a.insertContent(b.getContentWindow().document.getElementById("content").value),b.close()}},{text:"Close",onclick:"close"}]})}})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/example_dependency/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("example_dependency",function(){},["example"]); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/fullscreen/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){function c(){j.setStyle(m,"height",b().h-(l.clientHeight-m.clientHeight))}var k,l,m,n,o=document.body,p=document.documentElement;i=!i,l=a.getContainer(),k=l.style,m=a.getContentAreaContainer().firstChild,n=m.style,i?(d=n.width,e=n.height,n.width=n.height="100%",g=k.width,h=k.height,k.width=k.height="",j.addClass(o,"mce-fullscreen"),j.addClass(p,"mce-fullscreen"),j.addClass(l,"mce-fullscreen"),j.bind(window,"resize",c),c(),f=c):(n.width=d,n.height=e,g&&(k.width=g),h&&(k.height=h),j.removeClass(o,"mce-fullscreen"),j.removeClass(p,"mce-fullscreen"),j.removeClass(l,"mce-fullscreen"),j.unbind(window,"resize",f)),a.fire("FullscreenStateChanged",{state:i})}var d,e,f,g,h,i=!1,j=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Meta+Alt+F","",c)}),a.on("remove",function(){f&&j.unbind(window,"resize",f)}),a.addCommand("mceFullScreen",c),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return i}})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"
")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("importcss",function(a){function b(a){return"string"==typeof a?function(b){return-1!==b.indexOf(a)}:a instanceof RegExp?function(b){return a.test(b)}:a}function c(b,c){function d(a,b){var g,h=a.href;if(h&&c(h,b)){f(a.imports,function(a){d(a,!0)});try{g=a.cssRules||a.rules}catch(i){}f(g,function(a){a.styleSheet?d(a.styleSheet,!0):a.selectorText&&f(a.selectorText.split(","),function(a){e.push(tinymce.trim(a))})})}}var e=[],g={};f(a.contentCSS,function(a){g[a]=!0}),c||(c=function(a,b){return b||g[a]});try{f(b.styleSheets,function(a){d(a)})}catch(h){}return e}function d(b){var c,d=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(b);if(d){var e=d[1],f=d[2].substr(1).split(".").join(" "),g=tinymce.makeMap("a,img");return d[1]?(c={title:b},a.schema.getTextBlockElements()[e]?c.block=e:a.schema.getBlockElements()[e]||g[e.toLowerCase()]?c.selector=e:c.inline=e):d[2]&&(c={inline:"span",title:b.substr(1),classes:f}),a.settings.importcss_merge_classes!==!1?c.classes=f:c.attributes={"class":f},c}}var e=this,f=tinymce.each;a.on("renderFormatsMenu",function(g){var h=a.settings,i={},j=h.importcss_selector_converter||d,k=b(h.importcss_selector_filter),l=g.control;a.settings.importcss_append||l.items().remove();var m=[];tinymce.each(h.importcss_groups,function(a){a=tinymce.extend({},a),a.filter=b(a.filter),m.push(a)}),f(c(g.doc||a.getDoc(),b(h.importcss_file_filter)),function(b){if(-1===b.indexOf(".mce-")&&!i[b]&&(!k||k(b))){var c,d=j.call(e,b);if(d){var f=d.name||tinymce.DOM.uniqueId();if(m)for(var g=0;g'+d+"";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:j,context:"insert"})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must end with two \r 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/config/constants.php: -------------------------------------------------------------------------------- 1 | '', 5 | 'xhtml1-strict' => '', 6 | 'xhtml1-trans' => '', 7 | 'xhtml1-frame' => '', 8 | 'html5' => '', 9 | 'html4-strict' => '', 10 | 'html4-trans' => '', 11 | 'html4-frame' => '' 12 | ); 13 | 14 | /* End of file doctypes.php */ 15 | /* Location: ./application/config/doctypes.php */ -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/config/foreign_chars.php: -------------------------------------------------------------------------------- 1 | 'ae', 12 | '/ö|œ/' => 'oe', 13 | '/ü/' => 'ue', 14 | '/Ä/' => 'Ae', 15 | '/Ü/' => 'Ue', 16 | '/Ö/' => 'Oe', 17 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', 18 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', 19 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 20 | '/ç|ć|ĉ|ċ|č/' => 'c', 21 | '/Ð|Ď|Đ/' => 'D', 22 | '/ð|ď|đ/' => 'd', 23 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', 24 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', 25 | '/Ĝ|Ğ|Ġ|Ģ/' => 'G', 26 | '/ĝ|ğ|ġ|ģ/' => 'g', 27 | '/Ĥ|Ħ/' => 'H', 28 | '/ĥ|ħ/' => 'h', 29 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', 30 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', 31 | '/Ĵ/' => 'J', 32 | '/ĵ/' => 'j', 33 | '/Ķ/' => 'K', 34 | '/ķ/' => 'k', 35 | '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', 36 | '/ĺ|ļ|ľ|ŀ|ł/' => 'l', 37 | '/Ñ|Ń|Ņ|Ň/' => 'N', 38 | '/ñ|ń|ņ|ň|ʼn/' => 'n', 39 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', 40 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', 41 | '/Ŕ|Ŗ|Ř/' => 'R', 42 | '/ŕ|ŗ|ř/' => 'r', 43 | '/Ś|Ŝ|Ş|Š/' => 'S', 44 | '/ś|ŝ|ş|š|ſ/' => 's', 45 | '/Ţ|Ť|Ŧ/' => 'T', 46 | '/ţ|ť|ŧ/' => 't', 47 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', 48 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', 49 | '/Ý|Ÿ|Ŷ/' => 'Y', 50 | '/ý|ÿ|ŷ/' => 'y', 51 | '/Ŵ/' => 'W', 52 | '/ŵ/' => 'w', 53 | '/Ź|Ż|Ž/' => 'Z', 54 | '/ź|ż|ž/' => 'z', 55 | '/Æ|Ǽ/' => 'AE', 56 | '/ß/'=> 'ss', 57 | '/IJ/' => 'IJ', 58 | '/ij/' => 'ij', 59 | '/Œ/' => 'OE', 60 | '/ƒ/' => 'f' 61 | ); 62 | 63 | /* End of file foreign_chars.php */ 64 | /* Location: ./application/config/foreign_chars.php */ -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/config/hooks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->latest() this is the version that schema will 21 | | be upgraded / downgraded to. 22 | | 23 | */ 24 | $config['migration_version'] = 0; 25 | 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Migrations Path 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Path to your migrations folder. 33 | | Typically, it will be within your application path. 34 | | Also, writing permission is required within the migrations path. 35 | | 36 | */ 37 | $config['migration_path'] = APPPATH . 'migrations/'; 38 | 39 | 40 | /* End of file migration.php */ 41 | /* Location: ./application/config/migration.php */ -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/config/profiler.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/errors/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Page Not Found 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/errors/error_db.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Database Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/errors/error_general.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

A PHP Error was encountered

4 | 5 |

Severity:

6 |

Message:

7 |

Filename:

8 |

Line Number:

9 | 10 |
-------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/helpers/jbimages_helper.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/language/english/jbstrings_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/language/french/jbstrings_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/language/russian/jbstrings_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JustBoil's Result Page 6 | 13 | 16 | 17 | 18 | 19 | 20 | Result: 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/views/blank.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JustBoil's Blank 6 | 9 | 10 | 11 | 12 | 13 |

14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/core/Controller.php: -------------------------------------------------------------------------------- 1 | $class) 45 | { 46 | $this->$var =& load_class($class); 47 | } 48 | 49 | $this->load =& load_class('Loader', 'core'); 50 | 51 | $this->load->initialize(); 52 | 53 | log_message('debug', "Controller Class Initialized"); 54 | } 55 | 56 | public static function &get_instance() 57 | { 58 | return self::$instance; 59 | } 60 | } 61 | // END Controller class 62 | 63 | /* End of file Controller.php */ 64 | /* Location: ./system/core/Controller.php */ -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/core/Model.php: -------------------------------------------------------------------------------- 1 | $key; 52 | } 53 | } 54 | // END Model Class 55 | 56 | /* End of file Model.php */ 57 | /* Location: ./system/core/Model.php */ -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/helpers/language_helper.php: -------------------------------------------------------------------------------- 1 | lang->line($line); 46 | 47 | if ($id != '') 48 | { 49 | $line = '"; 50 | } 51 | 52 | return $line; 53 | } 54 | } 55 | 56 | // ------------------------------------------------------------------------ 57 | /* End of file language_helper.php */ 58 | /* Location: ./system/helpers/language_helper.php */ -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/language/english/imglib_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/language/english/upload_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/ci/system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/css/dialog-v4.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/css/dialog-v4.css 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -text-align:center; padding:0 10px 0 5px;} 15 | h2 {color:#666; visibility:hidden;} 16 | 17 | .form-inline input { 18 | display: inline-block; 19 | *display: inline; 20 | margin-bottom: 0; 21 | vertical-align: middle; 22 | *zoom: 1; 23 | } 24 | 25 | #upload_target {border:0; margin:0; padding:0; width:0; height:0; display:none;} 26 | 27 | .upload_infobar {display:none; font-size:12pt; background:#fff; margin-top:10px; border-radius:5px;} 28 | .upload_infobar img.spinner {margin-right:10px;} 29 | .upload_infobar a {color:#0000cc;} 30 | #upload_additional_info {font-size:10pt; padding-left:26px;} 31 | 32 | #the_plugin_name {margin:15px 0 0 0;} 33 | #the_plugin_name, #the_plugin_name a {color:#777; font-size:9px;} 34 | #the_plugin_name a {text-decoration:none;} 35 | #the_plugin_name a:hover {color:#333;} 36 | 37 | /* this class makes the upload script output visible */ 38 | .upload_target_visible {width:100%!important; height:200px!important; border:1px solid #000!important; display:block!important} -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/dialog-v4.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Upload an image 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
Upload in progress…
14 |
15 | 16 |

17 | 18 |

19 | 20 |

JustBoil.me Images Plugin

21 | 22 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/dialog.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {#jbimages_dlg.title} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |

{#jbimages_dlg.select_an_image}

16 | 17 |
{#jbimages_dlg.upload_in_progress}…
18 |
19 | 20 |

21 | 22 | 23 |

24 | 25 |

JustBoil.me Images Plugin

26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/editor_plugin.js: -------------------------------------------------------------------------------- 1 | (function(){tinymce.PluginManager.requireLangPack('jbimages');tinymce.create('tinymce.plugins.jbImagesPlugin',{init:function(ed,url){ed.addCommand('jbImages',function(){var unixtime_ms=new Date().getTime();ed.windowManager.open({file:url+'/dialog.htm?z'+unixtime_ms,width:330+parseInt(ed.getLang('jbimages.delta_width',0)),height:155+parseInt(ed.getLang('jbimages.delta_height',0)),inline:1},{plugin_url:url})});ed.addButton('jbimages',{title:'jbimages.desc',cmd:'jbImages',image:url+'/img/jbimages-bw.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('jbimages',n.nodeName=='IMG')})},createControl:function(n,cm){return null},getInfo:function(){return{longname:'JustBoil.me Images Plugin',author:'Viktor Kuzhelnyi',authorurl:'http://justboil.me/',infourl:'http://justboil.me/',version:"2.3"}}});tinymce.PluginManager.add('jbimages',tinymce.plugins.jbImagesPlugin)})(); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/img/jbimages-bw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/plugins/jbimages/img/jbimages-bw.gif -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/plugins/jbimages/img/spinner.gif -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/is_allowed.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/plugins/jbimages/is_allowed.php -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/langs/en.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/langs/en.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinyMCE.addI18n('en.jbimages',{ 15 | desc : 'Upload an image' 16 | }); 17 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/langs/en_dlg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/langs/en_dlg.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinyMCE.addI18n('en.jbimages_dlg',{ 15 | title : 'Upload an image from computer', 16 | select_an_image : 'Select an image', 17 | upload_in_progress : 'Upload in progress', 18 | upload_complete : 'Upload Complete', 19 | upload : 'Upload', 20 | longer_than_usual : 'This is taking longer than usual.', 21 | maybe_an_error : 'An error may have occurred.', 22 | view_output : 'View script\'s output', 23 | 24 | lang_id : 'english' /* php-side language files are in: ci/application/language/{lang_id}; and in ci/system/language/{lang_id} */ 25 | }); 26 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/langs/fr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/langs/fr.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinyMCE.addI18n('fr.jbimages',{ 15 | desc : 'T\u00E9l\u00E9charger une image' 16 | }); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/langs/fr_dlg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/langs/fr_dlg.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinyMCE.addI18n('fr.jbimages_dlg',{ 15 | title : 'T\u00E9l\u00E9charger une image depuis votre ordinateur', 16 | select_an_image : 'S\u00E9lectionnez une image', 17 | upload_in_progress : 'T\u00E9l\u00E9chargement en cours', 18 | upload_complete : 'T\u00E9l\u00E9chargement termin\u00E9', 19 | upload : 'T\u00E9l\u00E9charger', 20 | longer_than_usual : 'C\'est plus long que pr\u00E9vu.', 21 | maybe_an_error : 'Une erreur est probablement survenue.', 22 | view_output : 'Voir la sortie du script', 23 | 24 | lang_id : 'french' /* php-side language files are in: ci/application/language/{lang_id}; and in ci/system/language/{lang_id} */ 25 | }); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/langs/ru.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/langs/ru.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinyMCE.addI18n('ru.jbimages',{ 15 | desc : '\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435', 16 | delta_width : 10 17 | }); 18 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/langs/ru_dlg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/langs/ru_dlg.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinyMCE.addI18n('ru.jbimages_dlg',{ 15 | title : '\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430', 16 | select_an_image : '\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435', 17 | upload_in_progress : '\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430', 18 | upload_complete : '\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430', 19 | upload : '\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c', 20 | longer_than_usual : '\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e.', 21 | maybe_an_error : '\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.', 22 | view_output : '\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0430', 23 | 24 | lang_id : 'russian' /* php-side language files are in: ci/application/language/{lang_id}; */ 25 | }); 26 | -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Justboil.me - a TinyMCE image upload plugin 3 | * jbimages/plugin.js 4 | * 5 | * Released under Creative Commons Attribution 3.0 Unported License 6 | * 7 | * License: http://creativecommons.org/licenses/by/3.0/ 8 | * Plugin info: http://justboil.me/ 9 | * Author: Viktor Kuzhelnyi 10 | * 11 | * Version: 2.3 released 23/06/2013 12 | */ 13 | 14 | tinymce.PluginManager.add('jbimages', function(editor, url) { 15 | 16 | function jbBox() { 17 | editor.windowManager.open({ 18 | title: 'Upload an image', 19 | file : url + '/dialog-v4.htm', 20 | width : 350, 21 | height: 135, 22 | buttons: [{ 23 | text: 'Upload', 24 | classes:'widget btn primary first abs-layout-item', 25 | disabled : true, 26 | onclick: 'close' 27 | }, 28 | { 29 | text: 'Close', 30 | onclick: 'close' 31 | }] 32 | }); 33 | } 34 | 35 | // Add a button that opens a window 36 | editor.addButton('jbimages', { 37 | tooltip: 'Upload an image', 38 | icon : 'image', 39 | text: 'Upload', 40 | onclick: jbBox 41 | }); 42 | 43 | // Adds a menu item to the tools menu 44 | editor.addMenuItem('jbimages', { 45 | text: 'Upload image', 46 | icon : 'image', 47 | context: 'insert', 48 | onclick: jbBox 49 | }); 50 | }); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add('jbimages',function(editor,url){function jbBox(){editor.windowManager.open({title:'Upload an image',file:url+'/dialog-v4.htm',width:350,height:135,buttons:[{text:'Upload',classes:'widget btn primary first abs-layout-item',disabled:true,onclick:'close'},{text:'Close',onclick:'close'}]})}editor.addButton('jbimages',{tooltip:'Upload an image',icon:'image',text:'Upload',onclick:jbBox});editor.addMenuItem('jbimages',{text:'Upload image',icon:'image',context:'insert',onclick:jbBox})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/jbimages/readme: -------------------------------------------------------------------------------- 1 | |------------| 2 | | README | 3 | |------------| 4 | 5 | JustBoil.me Images is a simple, elegant image upload plugin for TinyMCE. It is free, opensource and licensed under Creative Commons Attribution 3.0 Unported License. 6 | 7 | Docs & stuff at: http://justboil.me 8 | Donation gives you the right to remove attribution: http://justboil.me/donate/ 9 | 10 | -- 11 | Have a nice day! )) -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/media/moxieplayer.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/plugins/media/moxieplayer.swf -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?' ':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;c>d;d++)a.execCommand("mceNonBreaking")}})}}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/pagebreak/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator",""),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("

"+e+"

"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='',tinymce.each(a.contentCSS,function(b){e+=''});var f=b.body_id||"tinymce";-1!=f.indexOf("=")&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";-1!=g.indexOf("=")&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d=""+e+'"+a.getContent()+"",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var i=this.getEl("body").firstChild.contentWindow.document;i.open(),i.write(d),i.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()}),a.addButton("print",{title:"Print",cmd:"mcePrint"}),a.addShortcut("Meta+P","","mcePrint"),a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/save/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("save",function(a){function b(){var b;return b=tinymce.DOM.getParent(a.id,"form"),!a.getParam("save_enablewhendirty",!0)||a.isDirty()?(tinymce.triggerSave(),a.getParam("save_onsavecallback")?void(a.execCallback("save_onsavecallback",a)&&(a.startContent=tinymce.trim(a.getContent({format:"raw"})),a.nodeChanged())):void(b?(a.isNotDirty=!0,(!b.onsubmit||b.onsubmit())&&("function"==typeof b.submit?b.submit():a.windowManager.alert("Error: Form submit field collision.")),a.nodeChanged()):a.windowManager.alert("Error: No form element found."))):void 0}function c(){var b=tinymce.trim(a.startContent);return a.getParam("save_oncancelcallback")?void a.execCallback("save_oncancelcallback",a):(a.setContent(b),a.undoManager.clear(),void a.nodeChanged())}function d(){var b=this;a.on("nodeChange",function(){b.disabled(a.getParam("save_enablewhendirty",!0)&&!a.isDirty())})}a.addCommand("mceSave",b),a.addCommand("mceCancel",c),a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:d}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:d}),a.addShortcut("Meta+S","","mceSave")}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(c){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function i(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&tinymce.get(b.id)&&-1!=a.tabIndex&&f(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),c>0){for(j=g+1;j=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/visualblocks/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualblocks",function(a,b){function c(){var b=this;b.active(f),a.on("VisualBlocks",function(){b.active(a.dom.hasClass(a.getBody(),"mce-visualblocks"))})}var d,e,f;window.NodeList&&(a.addCommand("mceVisualBlocks",function(){var c,g=a.dom;d||(d=g.uniqueId(),c=g.create("link",{id:d,rel:"stylesheet",href:b+"/css/visualblocks.css"}),a.getDoc().getElementsByTagName("head")[0].appendChild(c)),a.on("PreviewFormats AfterPreviewFormats",function(b){f&&g.toggleClass(a.getBody(),"mce-visualblocks","afterpreviewformats"==b.type)}),g.toggleClass(a.getBody(),"mce-visualblocks"),f=a.dom.hasClass(a.getBody(),"mce-visualblocks"),e&&e.active(g.hasClass(a.getBody(),"mce-visualblocks")),a.fire("VisualBlocks")}),a.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:c}),a.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("init",function(){a.settings.visualblocks_default_state&&a.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),a.on("remove",function(){a.dom.removeClass(a.getBody(),"mce-visualblocks")}))}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/visualchars/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualchars",function(a){function b(b){function c(a){return''+a+""}function f(){var a,b="";for(a in n)b+=a;return new RegExp("["+b+"]","g")}function g(){var a,b="";for(a in n)b&&(b+=","),b+="span.mce-"+n[a];return b}var h,i,j,k,l,m,n,o,p=a.getBody(),q=a.selection;if(n={"\xa0":"nbsp","\xad":"shy"},d=!d,e.state=d,a.fire("VisualChars",{state:d}),o=f(),b&&(m=q.getBookmark()),d)for(i=[],tinymce.walk(p,function(a){3==a.nodeType&&a.nodeValue&&o.test(a.nodeValue)&&i.push(a)},"childNodes"),j=0;j=0;j--)a.dom.remove(i[j],1);q.moveToBookmark(m)}function c(){var b=this;a.on("VisualChars",function(a){b.active(a.state)})}var d,e=this;a.addCommand("mceVisualChars",b),a.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c}),a.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("beforegetcontent",function(a){d&&"raw"!=a.format&&!a.draft&&(d=!0,b(!1))})}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/plugins/wordcount/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("wordcount",function(a){function b(){a.theme.panel.find("#wordcount").text(["Words: {0}",e.getCount()])}var c,d,e=this;c=a.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),d=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),a.on("init",function(){var c=a.theme.panel&&a.theme.panel.find("#statusbar")[0];c&&window.setTimeout(function(){c.insert({type:"label",name:"wordcount",text:["Words: {0}",e.getCount()],classes:"wordcount",disabled:a.settings.readonly},0),a.on("setcontent beforeaddundo",b),a.on("keyup",function(a){32==a.keyCode&&b()})},0)}),e.getCount=function(){var b=a.getContent({format:"raw"}),e=0;if(b){b=b.replace(/\.\.\./g," "),b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),b=b.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),b=b.replace(d,"");var f=b.match(c);f&&(e=f.length)}return e}}); -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/content.inline.min.css: -------------------------------------------------------------------------------- 1 | .mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/content.min.css: -------------------------------------------------------------------------------- 1 | body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /public/assets/js/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/assets/js/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /public/assets/wysihtml5/bootstrap-wysihtml5-0.0.2/wysiwyg-color.css: -------------------------------------------------------------------------------- 1 | .wysiwyg-color-black { 2 | color: black; 3 | } 4 | 5 | .wysiwyg-color-silver { 6 | color: silver; 7 | } 8 | 9 | .wysiwyg-color-gray { 10 | color: gray; 11 | } 12 | 13 | .wysiwyg-color-white { 14 | color: white; 15 | } 16 | 17 | .wysiwyg-color-maroon { 18 | color: maroon; 19 | } 20 | 21 | .wysiwyg-color-red { 22 | color: red; 23 | } 24 | 25 | .wysiwyg-color-purple { 26 | color: purple; 27 | } 28 | 29 | .wysiwyg-color-fuchsia { 30 | color: fuchsia; 31 | } 32 | 33 | .wysiwyg-color-green { 34 | color: green; 35 | } 36 | 37 | .wysiwyg-color-lime { 38 | color: lime; 39 | } 40 | 41 | .wysiwyg-color-olive { 42 | color: olive; 43 | } 44 | 45 | .wysiwyg-color-yellow { 46 | color: yellow; 47 | } 48 | 49 | .wysiwyg-color-navy { 50 | color: navy; 51 | } 52 | 53 | .wysiwyg-color-blue { 54 | color: blue; 55 | } 56 | 57 | .wysiwyg-color-teal { 58 | color: teal; 59 | } 60 | 61 | .wysiwyg-color-aqua { 62 | color: aqua; 63 | } 64 | 65 | .wysiwyg-color-orange { 66 | color: orange; 67 | } -------------------------------------------------------------------------------- /public/css/app.css: -------------------------------------------------------------------------------- 1 | 2 | /*# sourceMappingURL=app.css.map */ -------------------------------------------------------------------------------- /public/css/app.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["app.css"],"names":[],"mappings":"AAAA","file":"app.css","sourcesContent":[],"sourceRoot":"/source/"} -------------------------------------------------------------------------------- /public/eastgate/comment/css/comment.css: -------------------------------------------------------------------------------- 1 | .comment-info li{ 2 | display: inline; 3 | } 4 | .comment-list .comment-by{ 5 | color: blue; 6 | } 7 | .comment-list .separator:before{ 8 | content: '\0026AB'; 9 | color: gray; 10 | font-size: 0.5em; 11 | } 12 | .comment-list .reply-to, 13 | .comment-list .comment-on, 14 | .comment-list .reply { 15 | color: darkgray; 16 | font-size: 12px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/favicon.ico -------------------------------------------------------------------------------- /public/images/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/images/default.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/vendor/folklore/image/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/public/vendor/folklore/image/.gitkeep -------------------------------------------------------------------------------- /public/vendor/folklore/image/js/image.js: -------------------------------------------------------------------------------- 1 | (function (root, factory) { 2 | if (typeof define === 'function' && define.amd) { 3 | // AMD. Register as an anonymous module. 4 | define([], factory); 5 | } else if (typeof exports === 'object') { 6 | // Node. Does not work with strict CommonJS, but 7 | // only CommonJS-like environments that support module.exports, 8 | // like Node. 9 | module.exports = factory(); 10 | } else { 11 | // Browser globals (root is window) 12 | if(typeof(root.Folklore) === 'undefined') { 13 | root.Folklore = {}; 14 | } 15 | root.Folklore.Image = factory(); 16 | } 17 | }(this, function () { 18 | 19 | 'use strict'; 20 | 21 | var URL_PARAMETER = '-image({options})'; 22 | 23 | // Build a image formatted URL 24 | function url(src, width, height, options) { 25 | 26 | // Don't allow empty strings 27 | if (!src || !src.length) return; 28 | 29 | //If width parameter is an array, use it as options 30 | if(width instanceof Object) 31 | { 32 | options = width; 33 | width = null; 34 | height = null; 35 | } 36 | 37 | //Get size 38 | if (!width) width = '_'; 39 | if (!height) height = '_'; 40 | 41 | // Produce the image option 42 | var params = []; 43 | 44 | //Add size if presents 45 | if(width != '_' || height != '_') { 46 | params.push(width+'x'+height); 47 | } 48 | 49 | // Add options. 50 | if (options && options instanceof Object) { 51 | var val, key; 52 | for (key in options) { 53 | val = options[key]; 54 | if (val === true || val === null) { 55 | params.push(key); 56 | } 57 | else if (val instanceof Array) { 58 | params.push(key+'('+val.join(',')+')'); 59 | } 60 | else { 61 | params.push(key+'('+val+')'); 62 | } 63 | } 64 | } 65 | 66 | params = params.join('-'); 67 | var parameter = URL_PARAMETER.replace('{options}',params); 68 | 69 | // Break the path apart and put back together again 70 | return src.replace(/^(.+)(\.[a-z]+)$/i, "$1"+parameter+"$2"); 71 | 72 | } 73 | 74 | // Expose public methods. 75 | return { 76 | url: url 77 | }; 78 | })); 79 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | // @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 2 | 3 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'user' => "We can't find a user with that e-mail address.", 18 | 'token' => 'This password reset token is invalid.', 19 | 'sent' => 'We have e-mailed your password reset link!', 20 | 'reset' => 'Your password has been reset!', 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('content') 4 | 5 | {!! Form::open(['url' => 'auth/login']) !!} 6 | 7 | 8 | 9 | 10 | 11 |
12 | 15 |
16 | 17 | {!! Form::close() !!} 18 | 19 | @stop -------------------------------------------------------------------------------- /resources/views/auth/password.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('content') 4 | 5 | 6 | 7 |
8 | {!! csrf_field() !!} 9 | 10 |
11 | Email 12 | 13 |
14 | 15 |
16 | 19 |
20 |
21 | 22 | @stop -------------------------------------------------------------------------------- /resources/views/auth/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('content') 4 | 5 | 6 |
7 | {!! csrf_field() !!} 8 | 9 | 10 |
11 | Email 12 | 13 |
14 | 15 |
16 | Password 17 | 18 |
19 | 20 |
21 | Confirm Password 22 | 23 |
24 | 25 |
26 | 29 |
30 |
31 | 32 | @stop -------------------------------------------------------------------------------- /resources/views/eastgate/comment/cancel_reply.blade.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | × 4 |

5 |
-------------------------------------------------------------------------------- /resources/views/eastgate/comment/comment_fields.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | 8 |
9 | 10 | 11 |
12 | 13 |
14 |
15 | Comment 16 |
17 |
18 |
-------------------------------------------------------------------------------- /resources/views/eastgate/comment/leave_a_comment.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |

Leave A Comment

5 |
6 | @include('eastgate/comment/comment_fields') 7 |
8 | @include('eastgate/comment/comment_list') 9 |
10 | 15 | 16 | 41 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('content') 4 |
5 |

Homepage

6 | 7 | @if($errors->any()) 8 |
    9 | @foreach($errors->all() as $error) 10 |
  • {{ $error }}
  • 11 | @endforeach 12 |
13 | @endif 14 | 15 | @foreach($posts as $post) 16 | @include('partials/post') 17 | @endforeach 18 |
19 | 20 |
21 | @include('site/sidebar') 22 |
23 | @stop -------------------------------------------------------------------------------- /resources/views/partials/post_sidebar.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Search {{ $post->subreddit->name }}

4 | {!! Form::open(['route' => ['search_post', $post]]) !!} 5 |
6 |
7 | 8 | 9 | 10 | 13 | 14 |
15 |
16 | {!! Form::close() !!} 17 | 18 |
19 | 20 | 21 |
22 |

About {{ $post->subreddit->name }}

23 |

{!! strip_tags($post->subreddit->description, '


25 | 26 | 27 |
28 |

Moderators Of {{ $post->subreddit->name }}

29 |
30 |
31 |
    32 | @foreach($modList as $mod) 33 |
  • {!! link_to_route('profile_path', $mod->user->name, $mod->user->name) !!}
  • 34 | @endforeach 35 |
36 |
37 | 38 |
39 |
    40 |
41 |
42 | 43 |
44 | 45 |
46 | -------------------------------------------------------------------------------- /resources/views/partials/sub_sidebar.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Search {{ $subreddit->name }}

4 | {!! Form::open(['route' => ['search', $subreddit]]) !!} 5 |
6 |
7 | 8 | 9 | 12 | 13 |
14 |
15 | {!! Form::close() !!} 16 |
17 | 18 | 19 |
23 | 24 | 25 |
26 |

Moderators Of {{ $subreddit->name }}

27 |
28 |
29 |
    30 | @foreach($modList as $mod) 31 |
  • {!! link_to_route('profile_path', $mod->user->name, $mod->user->name) !!}
  • 32 | @endforeach 33 |
34 |
35 | 36 |
37 |
    38 |
39 |
40 | 41 |
42 | 43 |
44 | -------------------------------------------------------------------------------- /resources/views/post/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('content') 4 |
5 |
6 | @include('partials/post') 7 | 8 | @include('eastgate/comment/leave_a_comment') 9 |
10 | 11 |
12 | @include('partials/post_sidebar') 13 |
14 |
15 | @stop -------------------------------------------------------------------------------- /resources/views/site/search.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('scripts') 4 | 5 | 6 | 7 | @endsection 8 | 9 | @section('content') 10 |
11 |
12 | @if($errors->any()) 13 |
    14 | @foreach($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 | @endif 19 |

Searching entire Site

20 |
21 | @if(count($posts) < 1) 22 | There are no matches 23 | @endif 24 | 25 | @foreach($posts as $post) 26 | @include('partials/post') 27 | @endforeach 28 | 29 |
30 |
31 | 32 |
33 | @include('site/sidebar') 34 |
35 |
36 | @stop -------------------------------------------------------------------------------- /resources/views/site/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Search

4 | {!! Form::open(['route' => 'search_site']) !!} 5 |
6 |
7 | 8 | 9 | 12 | 13 |
14 |
15 | {!! Form::close() !!} 16 |
17 | 18 |
19 |

Welcome to Reddit-Clone

20 |

Built with Laravel 5

21 |
-------------------------------------------------------------------------------- /resources/views/subreddit/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('scripts') 4 | 5 | 6 | 16 | @endsection 17 | 18 | @section('content') 19 |

Create Subreddit

20 | 21 | {!! Form::open(['url' => 'subreddit']) !!} 22 | 23 |

24 | {!! Form::label('name', 'Name:') !!} 25 | {!! Form::text('name', null, ['class' => 'form-control']) !!} 26 |

27 | 28 |

29 | {!! Form::label('description', 'Description:') !!} 30 | {!! Form::textarea('description', null, ['class' => 'form-control']) !!} 31 |

32 | 33 |

34 | {!! Form::submit('Create Subreddit', ['id' => 'submit', 'class' => 'btn btn-primary']) !!} 35 |

36 | 37 | @if($errors->any()) 38 |
    39 | @foreach($errors->all() as $error) 40 |
  • {{ $error }}
  • 41 | @endforeach 42 |
43 | @endif 44 | @stop -------------------------------------------------------------------------------- /resources/views/subreddit/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('scripts') 4 | 5 | 6 | 16 | @endsection 17 | 18 | @section('content') 19 |

Edit sub: {{ $subreddit->name }}

20 | 21 | {!! Form::model($subreddit, ['method' => 'PATCH', 'action' => ['SubredditController@update', $subreddit->id]]) !!} 22 | 23 |

24 | {!! Form::label('name', 'Name:') !!} 25 | {!! Form::text('name', null, ['class' => 'form-control']) !!} 26 |

27 | 28 |

29 | {!! Form::label('description', 'Description:') !!} 30 | {!! Form::textarea('description', null, ['class' => 'form-control']) !!} 31 |

32 | 33 |

34 | {!! Form::submit('Update Subreddit', ['id' => 'submit', 'class' => 'btn btn-primary']) !!} 35 |

36 | 37 | @if($errors->any()) 38 |
    39 | @foreach($errors->all() as $error) 40 |
  • {{ $error }}
  • 41 | @endforeach 42 |
43 | @endif 44 | @stop -------------------------------------------------------------------------------- /resources/views/subreddit/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('scripts') 4 | 5 | 6 | 7 | 20 | @endsection 21 | 22 | @section('content') 23 |

All Subreddits

24 |
25 | @foreach($subreddit as $sub) 26 |
27 |
28 |
29 |
30 |
31 |

32 | {{ $sub->name }} 33 |

34 |

{!! $sub->description !!}

35 |
36 |
37 | 9,732 subscribers, community for {{ $sub->created_at->diffForHumans() }} | 38 | created by {{ $sub->user->name }} 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | @endforeach 47 | 48 | {!! $subreddit->render() !!} 49 |
50 | @stop -------------------------------------------------------------------------------- /resources/views/subreddit/search.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('scripts') 4 | 5 | 6 | 7 | @endsection 8 | 9 | @section('content') 10 |
11 |
12 | @if($errors->any()) 13 |
    14 | @foreach($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 | @endif 19 |

Searching: {{ $subreddit->name }}

20 |
21 | @if(count($posts) < 1) 22 | There are no matches 23 | @endif 24 | 25 | @foreach($posts as $post) 26 | @include('partials/post') 27 | @endforeach 28 | 29 |
30 |
31 | 32 |
33 | @include('partials/sub_sidebar') 34 |
35 |
36 | @stop -------------------------------------------------------------------------------- /resources/views/subreddit/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('scripts') 4 | 5 | 6 | 7 | @endsection 8 | 9 | @section('content') 10 |
11 |
12 | @if($errors->any()) 13 |
    14 | @foreach($errors->all() as $error) 15 |
  • {{ $error }}
  • 16 | @endforeach 17 |
18 | @endif 19 |

Subreddit: {{ $subreddit->name }}

20 |
21 | @foreach($posts as $post) 22 | @include('partials/post') 23 | @endforeach 24 | {!! $posts->render() !!} 25 |
26 |
27 | 28 |
29 | @include('partials/sub_sidebar') 30 |
31 |
32 | @stop 33 | -------------------------------------------------------------------------------- /resources/views/user/mysubreddits.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts/default') 2 | 3 | @section('content') 4 |

My Subreddits

5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | @if(Session::has('message')) 18 | 19 | @elseif(Session::has('message_info')) 20 | 21 | @elseif(Session::has('message_danger')) 22 | 23 | @endif 24 | 25 | @foreach($subreddit as $sub) 26 | 27 | 28 | 29 | 33 | 34 | @endforeach 35 |
IDTitleAction
{{ $sub->id }}{{ $sub->name }} 30 | Edit 31 | Moderators 32 |
36 |
37 |
38 | @stop -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geosem42/laravel-reddit/b616da3f606985b686452fe1d8ec9547b9da21b3/resources/views/vendor/.gitkeep -------------------------------------------------------------------------------- /resources/views/vendor/editor/head.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 30 | 31 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | services.json 5 | events.scanned.php 6 | routes.scanned.php 7 | down 8 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | visit('/') 17 | ->see('Laravel 5'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | --------------------------------------------------------------------------------