@@ -693,27 +693,7 @@ window.initScrollable = function () {
693693 } ;
694694 } ) ( this ) ) ;
695695 menu = new Menu ( this . tag . find ( "#wrapper-sign-publish" ) ) ;
696- menu . addItem ( "Sign" ) ;
697- menu . addItem ( "Publush" ) ;
698- this . tag . find ( "#menu-sign-publish" ) . off ( "click touchend" ) . on ( "click touchend" , ( function ( _this ) {
699- return function ( ) {
700- if ( window . visible_menu === menu ) {
701- _this . tag . find ( ".contents + .flex" ) . removeClass ( "active" ) ;
702- menu . hide ( ) ;
703- } else {
704- _this . tag . find ( ".contents + .flex" ) . addClass ( "active" ) ;
705- _this . tag . find ( ".content-wrapper" ) . prop ( "scrollTop" , 10000 ) ;
706- menu . show ( ) ;
707- }
708- return false ;
709- } ;
710- } ) ( this ) ) ;
711- $ ( "body" ) . on ( "click" , ( function ( _this ) {
712- return function ( ) {
713- return _this . tag . find ( ".contents + .flex" ) . removeClass ( "active" ) ;
714- } ;
715- } ) ( this ) ) ;
716- this . tag . find ( "#button-sign-publish" ) . off ( "click touchend" ) . on ( "click touchend" , ( function ( _this ) {
696+ menu . addItem ( "Sign" , ( function ( _this ) {
717697 return function ( ) {
718698 var inner_path ;
719699 inner_path = _this . tag . find ( "#input-contents" ) . val ( ) ;
@@ -722,34 +702,64 @@ window.initScrollable = function () {
722702 } , function ( res ) {
723703 var ref ;
724704 if ( wrapper . site_info . privatekey || ( ref = wrapper . site_info . auth_address , indexOf . call ( res . signers , ref ) >= 0 ) ) {
725- return wrapper . ws . cmd ( "sitePublish " , {
705+ return wrapper . ws . cmd ( "siteSign " , {
726706 privatekey : "stored" ,
727707 inner_path : inner_path ,
728- sign : true
708+ update_changed_files : true
729709 } , function ( res ) {
730710 if ( res === "ok" ) {
731- return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed and published !" , 5000 ) ;
711+ return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
732712 }
733713 } ) ;
734714 } else {
735715 return wrapper . displayPrompt ( "Enter your private key:" , "password" , "Sign" , "" , function ( privatekey ) {
736- return wrapper . ws . cmd ( "sitePublish " , {
716+ return wrapper . ws . cmd ( "siteSign " , {
737717 privatekey : privatekey ,
738718 inner_path : inner_path ,
739- sign : true
719+ update_changed_files : true
740720 } , function ( res ) {
741721 if ( res === "ok" ) {
742- return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed and published !" , 5000 ) ;
722+ return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
743723 }
744724 } ) ;
745725 } ) ;
746726 }
747727 } ) ;
748- _this . tag . find ( "#button-sign-publish-menu" ) . removeClass ( "visible" ) ;
728+ _this . tag . find ( ".contents + .flex" ) . removeClass ( "active" ) ;
729+ return menu . hide ( ) ;
730+ } ;
731+ } ) ( this ) ) ;
732+ menu . addItem ( "Publish" , ( function ( _this ) {
733+ return function ( ) {
734+ var inner_path ;
735+ inner_path = _this . tag . find ( "#input-contents" ) . val ( ) ;
736+ wrapper . ws . cmd ( "sitePublish" , {
737+ "inner_path" : inner_path ,
738+ "sign" : false
739+ } ) ;
740+ _this . tag . find ( ".contents + .flex" ) . removeClass ( "active" ) ;
741+ return menu . hide ( ) ;
742+ } ;
743+ } ) ( this ) ) ;
744+ this . tag . find ( "#menu-sign-publish" ) . off ( "click touchend" ) . on ( "click touchend" , ( function ( _this ) {
745+ return function ( ) {
746+ if ( window . visible_menu === menu ) {
747+ _this . tag . find ( ".contents + .flex" ) . removeClass ( "active" ) ;
748+ menu . hide ( ) ;
749+ } else {
750+ _this . tag . find ( ".contents + .flex" ) . addClass ( "active" ) ;
751+ _this . tag . find ( ".content-wrapper" ) . prop ( "scrollTop" , 10000 ) ;
752+ menu . show ( ) ;
753+ }
749754 return false ;
750755 } ;
751756 } ) ( this ) ) ;
752- this . tag . find ( "#button-sign" ) . off ( "click touchend" ) . on ( "click touchend" , ( function ( _this ) {
757+ $ ( "body" ) . on ( "click" , ( function ( _this ) {
758+ return function ( ) {
759+ return _this . tag . find ( ".contents + .flex" ) . removeClass ( "active" ) ;
760+ } ;
761+ } ) ( this ) ) ;
762+ this . tag . find ( "#button-sign-publish" ) . off ( "click touchend" ) . on ( "click touchend" , ( function ( _this ) {
753763 return function ( ) {
754764 var inner_path ;
755765 inner_path = _this . tag . find ( "#input-contents" ) . val ( ) ;
@@ -758,44 +768,29 @@ window.initScrollable = function () {
758768 } , function ( res ) {
759769 var ref ;
760770 if ( wrapper . site_info . privatekey || ( ref = wrapper . site_info . auth_address , indexOf . call ( res . signers , ref ) >= 0 ) ) {
761- return wrapper . ws . cmd ( "siteSign " , {
771+ return wrapper . ws . cmd ( "sitePublish " , {
762772 privatekey : "stored" ,
763773 inner_path : inner_path ,
764- update_changed_files : true
774+ sign : true
765775 } , function ( res ) {
766776 if ( res === "ok" ) {
767- return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
777+ return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed and published !" , 5000 ) ;
768778 }
769779 } ) ;
770780 } else {
771781 return wrapper . displayPrompt ( "Enter your private key:" , "password" , "Sign" , "" , function ( privatekey ) {
772- return wrapper . ws . cmd ( "siteSign " , {
782+ return wrapper . ws . cmd ( "sitePublish " , {
773783 privatekey : privatekey ,
774784 inner_path : inner_path ,
775- update_changed_files : true
785+ sign : true
776786 } , function ( res ) {
777787 if ( res === "ok" ) {
778- return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
788+ return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed and published !" , 5000 ) ;
779789 }
780790 } ) ;
781791 } ) ;
782792 }
783793 } ) ;
784- _this . tag . find ( "#button-sign-publish-menu" ) . removeClass ( "visible" ) ;
785- return false ;
786- } ;
787- } ) ( this ) ) ;
788- this . tag . find ( "#button-publish" ) . off ( "click touchend" ) . on ( "click touchend" , ( function ( _this ) {
789- return function ( ) {
790- var inner_path ;
791- inner_path = _this . tag . find ( "#input-contents" ) . val ( ) ;
792- _this . tag . find ( "#button-publish" ) . addClass ( "loading" ) ;
793- wrapper . ws . cmd ( "sitePublish" , {
794- "inner_path" : inner_path ,
795- "sign" : false
796- } , function ( ) {
797- return _this . tag . find ( "#button-publish" ) . removeClass ( "loading" ) ;
798- } ) ;
799794 return false ;
800795 } ;
801796 } ) ( this ) ) ;
0 commit comments