@@ -55,6 +55,11 @@ Ember.Handlebars.helper('format-xmarkdown', function(input) {
5555 var markdown = new Markdown . getSanitizingConverter ( ) ;
5656 return new Ember . Handlebars . SafeString ( emoji . replace_colons ( markdown . makeHtml ( input ) ) ) ;
5757} ) ;
58+ /*
59+ |---------------------------
60+ | Router
61+ |---------------------------
62+ */
5863Exyht . Router . map ( function ( ) {
5964 this . route ( 'index' , { path : Exyht . BaseUrl } ) ;
6065 this . route ( 'comments' , { path : Exyht . BaseUrl + '/comments/:post_id' } ) ;
@@ -109,6 +114,11 @@ model: function()
109114 } ) ;
110115}
111116} ) ;
117+ /*
118+ |--------------------
119+ | Textarea Component
120+ |--------------------
121+ */
112122Exyht . AutoExpandingTextAreaComponent = Ember . TextArea . extend ( {
113123 didInsertElement : function ( ) {
114124
@@ -183,6 +193,11 @@ Exyht.AutoExpandingTextAreaComponent = Ember.TextArea.extend({
183193}
184194} ) ;
185195
196+ /*
197+ |------------------
198+ | Index Controller
199+ |------------------
200+ */
186201Exyht . IndexController = Ember . ObjectController . extend ( {
187202 loadingOn : false ,
188203 actions : {
@@ -292,6 +307,11 @@ Exyht.IndexController = Ember.ObjectController.extend({
292307 }
293308 }
294309} ) ;
310+ /*
311+ |----------------
312+ | App Controller
313+ |----------------
314+ */
295315Exyht . ApplicationController = Ember . ObjectController . extend ( {
296316 actions : {
297317 logOut : function ( ) {
@@ -303,6 +323,11 @@ Exyht.ApplicationController = Ember.ObjectController.extend({
303323 }
304324 } ,
305325} ) ;
326+ /*
327+ |----------------------
328+ | Blog Link Controller
329+ |----------------------
330+ */
306331Exyht . BloglinkController = Ember . ObjectController . extend ( {
307332 actions : {
308333 removeLink : function ( ) {
@@ -325,11 +350,20 @@ Exyht.BloglinkController = Ember.ObjectController.extend({
325350 }
326351 }
327352} ) ;
353+ /*
354+ |---------------------
355+ | Comments Controller
356+ |---------------------
357+ */
328358Exyht . CommentsController = Ember . ArrayController . extend ( {
329359 needs : "posttitle" ,
330360 title : '' ,
331361} ) ;
332-
362+ /*
363+ |--------------------
364+ | Comment Controller
365+ |--------------------
366+ */
333367Exyht . CommentController = Ember . ObjectController . extend ( {
334368 banLoading : false ,
335369 flagLoading : false ,
@@ -357,9 +391,11 @@ Exyht.CommentController = Ember.ObjectController.extend({
357391 url : Exyht . BaseUrl + "/removeComment/" + commentId ,
358392 success : function ( msg ) {
359393 console . log ( msg ) ;
360- self . set ( 'showLoading' , false ) ;
361- self . set ( 'isFlagged' , false ) ;
362- self . set ( 'status' , false ) ;
394+ self . setProperties ( {
395+ 'showLoading' : false ,
396+ 'isFlagged' : false ,
397+ 'status' : false
398+ } ) ;
363399 alert ( msg ) ;
364400 }
365401 } ) ;
@@ -378,8 +414,10 @@ Exyht.CommentController = Ember.ObjectController.extend({
378414 url : Exyht . BaseUrl + "/banIp/" + ipAddress ,
379415 success : function ( msg ) {
380416 console . log ( msg ) ;
381- self . set ( 'banLoading' , false ) ;
382- self . set ( 'ip_status' , true ) ;
417+ self . setProperties ( {
418+ 'banLoading' : false ,
419+ 'ip_status' : true
420+ } ) ;
383421 alert ( msg ) ;
384422 }
385423 } ) ;
@@ -398,8 +436,10 @@ Exyht.CommentController = Ember.ObjectController.extend({
398436 url : Exyht . BaseUrl + "/removeFlag/" + commentId ,
399437 success : function ( msg ) {
400438 console . log ( msg ) ;
401- self . set ( 'flagLoading' , false ) ;
402- self . set ( 'isFlagged' , false ) ;
439+ self . setProperties ( {
440+ 'flagLoading' : false ,
441+ 'isFlagged' : false
442+ } ) ;
403443 alert ( msg ) ;
404444 }
405445 } ) ;
@@ -409,6 +449,11 @@ Exyht.CommentController = Ember.ObjectController.extend({
409449 }
410450 }
411451} ) ;
452+ /*
453+ |--------------------------
454+ | Image Gallery Controller
455+ |--------------------------
456+ */
412457Exyht . ImggalleryController = Ember . ObjectController . extend ( {
413458 img_from : 15 , // load more pics offset
414459 img_to : 30 , // load more pics limit
@@ -451,7 +496,11 @@ Exyht.ImggalleryController = Ember.ObjectController.extend({
451496 }
452497 }
453498} ) ;
454-
499+ /*
500+ |--------------------------
501+ | Gallery Image Controller
502+ |--------------------------
503+ */
455504Exyht . GalleryimageController = Ember . ObjectController . extend ( {
456505 deletingImg : false ,
457506 srcPath : function ( ) {
@@ -472,14 +521,21 @@ Exyht.GalleryimageController = Ember.ObjectController.extend({
472521 url : Exyht . BaseUrl + "/removeGimg" ,
473522 data : { img_path : img_path } ,
474523 success : function ( msg ) {
475- self . set ( 'img_visible' , false ) ;
476- self . set ( 'deletingImg' , false ) ;
477- alert ( msg ) ;
524+ self . setProperties ( {
525+ 'img_visible' : false ,
526+ 'deletingImg' : false
527+ } ) ;
528+ alert ( msg ) ;
478529 }
479530 } ) ;
480531 }
481532 }
482533} ) ;
534+ /*
535+ |-----------------------
536+ | Post title controller
537+ |-----------------------
538+ */
483539Exyht . PosttitleController = Ember . ObjectController . extend ( {
484540
485541 needs : [ "typeblogpost" , "comments" , "profilesetting" ] ,
@@ -502,12 +558,14 @@ Exyht.PosttitleController = Ember.ObjectController.extend({
502558
503559 actions : {
504560 editPostTrue : function ( ) {
505- this . set ( 'isEditingOnForPostTitle' , true ) ;
506- this . set ( 'postIdForTypeBlogPost' , this . get ( 'model.id' ) ) ;
507- this . set ( 'isEditingOnForTypeBlogPost' , true ) ;
508- this . set ( 'isProfileEditingOnForTypeBlogPost' , false ) ;
509- this . set ( 'editingOnForProfSetCtlr' , false ) ;
510- this . set ( 'titleForTypeBlogPost' , this . get ( 'model.title' ) ) ;
561+ this . setProperties ( {
562+ 'isEditingOnForPostTitle' : true ,
563+ 'postIdForTypeBlogPost' : this . get ( 'model.id' ) ,
564+ 'isEditingOnForTypeBlogPost' : true ,
565+ 'isProfileEditingOnForTypeBlogPost' : false ,
566+ 'editingOnForProfSetCtlr' : false ,
567+ 'titleForTypeBlogPost' : this . get ( 'model.title' )
568+ } ) ;
511569
512570 var self = this ;
513571 Ember . $ . getJSON ( Exyht . currentBaseUri + '/getOnlyPostBody/' + this . get ( 'model.id' ) ) . then ( function ( data ) {
@@ -523,6 +581,11 @@ Exyht.PosttitleController = Ember.ObjectController.extend({
523581 }
524582 }
525583} ) ;
584+ /*
585+ |---------------------------
586+ | Profilesetting Controller
587+ |---------------------------
588+ */
526589Exyht . ProfilesettingController = Ember . ObjectController . extend ( {
527590needs : "typeblogpost" ,
528591admin_token : function ( ) {
@@ -562,16 +625,20 @@ actions: {
562625 success : function ( msg ) {
563626 console . log ( 'Response: ' + msg ) ;
564627 alert ( msg ) ;
565- self . set ( 'old_password' , '' ) ;
566- self . set ( 'new_password' , '' ) ;
567- self . set ( 'confirm_password' , '' ) ;
628+ self . setProperties ( {
629+ 'old_password' : '' ,
630+ 'new_password' : '' ,
631+ 'confirm_password' : ''
632+ } ) ;
568633 }
569634 } ) ;
570635 } ,
571636 editProfileTrue : function ( ) {
572- this . set ( 'isProfileEditingOnForProfileSetting' , true ) ;
573- this . set ( 'isProfEditOnForTypeBlogPost' , true ) ;
574- this . set ( 'aboutAdminForTypeBlogPost' , this . get ( 'model.about' ) ) ;
637+ this . setProperties ( {
638+ 'isProfileEditingOnForProfileSetting' : true ,
639+ 'isProfEditOnForTypeBlogPost' : true ,
640+ 'aboutAdminForTypeBlogPost' : this . get ( 'model.about' )
641+ } ) ;
575642 this . transitionToRoute ( 'typeblogpost' ) ;
576643 } ,
577644 removeProfPicture : function ( ) {
@@ -583,8 +650,10 @@ actions: {
583650 success : function ( msg ) {
584651 console . log ( 'Response: ' + msg ) ;
585652 alert ( msg ) ;
586- self . set ( 'isRemoved' , true ) ;
587- self . set ( 'isRemovingPicture' , false ) ;
653+ self . setProperties ( {
654+ 'isRemoved' : true ,
655+ 'isRemovingPicture' : false
656+ } ) ;
588657 }
589658 } ) ;
590659 } ,
@@ -593,6 +662,11 @@ actions: {
593662 }
594663}
595664} ) ;
665+ /*
666+ |---------------------------
667+ | Toprow Controller
668+ |---------------------------
669+ */
596670Exyht . ToprowController = Ember . ObjectController . extend ( {
597671
598672 notificationTemplate : function ( value1 , value2 ) {
@@ -637,6 +711,11 @@ Exyht.ToprowController = Ember.ObjectController.extend({
637711 } . property ( 'model.flaggedComment' ) ,
638712} ) ;
639713
714+ /*
715+ |---------------------------
716+ | Typeblogpost Controller
717+ |---------------------------
718+ */
640719Exyht . TypeblogpostController = Ember . ObjectController . extend ( {
641720
642721 needs : [ "posttitle" , "profilesetting" ] ,
@@ -696,9 +775,11 @@ Exyht.TypeblogpostController = Ember.ObjectController.extend({
696775 data : { title : blogTitle , body : blogBody } ,
697776 success : function ( msg ) {
698777 console . log ( 'Response: ' + msg ) ;
699- self . set ( value1 , false ) ;
700- self . set ( 'ntitle' , '' ) ;
701- self . set ( 'nbody' , '' ) ;
778+ self . setProperties ( {
779+ value1 : false ,
780+ 'ntitle' : '' ,
781+ 'nbody' : ''
782+ } ) ;
702783 alert ( msg ) ;
703784 }
704785 } ) ;
@@ -723,12 +804,14 @@ Exyht.TypeblogpostController = Ember.ObjectController.extend({
723804 } ) ;
724805 } ,
725806 cancelProfileEditing : function ( ) {
726- this . set ( 'isProfileEditingOn' , false ) ;
727- this . set ( 'isEditingOn' , false ) ;
728- this . set ( 'ntitle' , '' ) ;
729- this . set ( 'nbody' , '' ) ;
730- this . set ( 'postId' , '' ) ;
731- this . set ( 'editOnForProfSetContr' , false ) ;
807+ this . setProperties ( {
808+ 'isProfileEditingOn' : false ,
809+ 'isEditingOn' : false ,
810+ 'ntitle' : '' ,
811+ 'nbody' : '' ,
812+ 'postId' : '' ,
813+ 'editOnForProfSetContr' : false
814+ } ) ;
732815 } ,
733816 saveEdit : function ( postId ) {
734817 var blogTitle = this . get ( 'ntitle' ) . trim ( ) ;
@@ -748,10 +831,12 @@ Exyht.TypeblogpostController = Ember.ObjectController.extend({
748831 } ) ;
749832 } ,
750833 cancelEditing : function ( ) {
751- this . set ( 'isEditingOn' , false ) ;
752- this . set ( 'ntitle' , '' ) ;
753- this . set ( 'nbody' , '' ) ;
754- this . set ( 'postId' , '' ) ;
834+ this . setProperties ( {
835+ 'isEditingOn' : false ,
836+ 'ntitle' : '' ,
837+ 'nbody' : '' ,
838+ 'postId' : ''
839+ } ) ;
755840 } ,
756841 // Editor tools
757842 ctv : function ( input ) {
@@ -849,7 +934,11 @@ Exyht.RadioButton = Ember.Component.extend({
849934 attributeBindings : [ "name" , "type" , "value" , "style" ] ,
850935} ) ;
851936Ember . Handlebars . helper ( 'radio-button' , Exyht . RadioButton ) ;
852-
937+ /*
938+ |---------------------------
939+ | Uisettings Controller
940+ |---------------------------
941+ */
853942Exyht . UisettingsController = Ember . ObjectController . extend ( {
854943 favcolor : '' ,
855944 selectedCategory : '' ,
@@ -903,6 +992,11 @@ Exyht.UisettingsController = Ember.ObjectController.extend({
903992 }
904993 }
905994} ) ;
995+ /*
996+ |---------------------------
997+ | Comment View
998+ |---------------------------
999+ */
9061000Exyht . CommentView = Ember . View . extend ( {
9071001
9081002 templateName : "comment" ,
@@ -911,6 +1005,11 @@ Exyht.CommentView = Ember.View.extend({
9111005 return "http://www.gravatar.com/avatar/" + this . get ( "controller.gravatarUri" ) + '?d=' + Exyht . gravatarVersion + '&s=30' ;
9121006 } ) . property ( "controller.gravatarUri" )
9131007} ) ;
1008+ /*
1009+ |---------------------------
1010+ | Imggallery View
1011+ |---------------------------
1012+ */
9141013Exyht . ImggalleryView = Ember . View . extend ( {
9151014
9161015 templateName : "imggallery" ,
@@ -966,6 +1065,11 @@ Exyht.ImggalleryView = Ember.View.extend({
9661065 }
9671066 }
9681067} ) ;
1068+ /*
1069+ |---------------------------
1070+ | Index View
1071+ |---------------------------
1072+ */
9691073Exyht . IndexView = Ember . View . extend ( {
9701074
9711075 templateName : "index" ,
0 commit comments