@@ -189,7 +189,8 @@ window.initScrollable = function () {
189189 var Sidebar ,
190190 bind = function ( fn , me ) { return function ( ) { return fn . apply ( me , arguments ) ; } ; } ,
191191 extend = function ( child , parent ) { for ( var key in parent ) { if ( hasProp . call ( parent , key ) ) child [ key ] = parent [ key ] ; } function ctor ( ) { this . constructor = child ; } ctor . prototype = parent . prototype ; child . prototype = new ctor ( ) ; child . __super__ = parent . prototype ; return child ; } ,
192- hasProp = { } . hasOwnProperty ;
192+ hasProp = { } . hasOwnProperty ,
193+ indexOf = [ ] . indexOf || function ( item ) { for ( var i = 0 , l = this . length ; i < l ; i ++ ) { if ( i in this && this [ i ] === item ) return i ; } return - 1 ; } ;
193194
194195 Sidebar = ( function ( superClass ) {
195196 extend ( Sidebar , superClass ) ;
@@ -600,27 +601,32 @@ window.initScrollable = function () {
600601 return function ( ) {
601602 var inner_path ;
602603 inner_path = _this . tag . find ( "#input-contents" ) . val ( ) ;
603- if ( wrapper . site_info . privatekey ) {
604- wrapper . ws . cmd ( "siteSign" , {
605- privatekey : "stored" ,
606- inner_path : inner_path ,
607- update_changed_files : true
608- } , function ( res ) {
609- return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
610- } ) ;
611- } else {
612- wrapper . displayPrompt ( "Enter your private key:" , "password" , "Sign" , "" , function ( privatekey ) {
604+ wrapper . ws . cmd ( "fileRules" , {
605+ inner_path : inner_path
606+ } , function ( res ) {
607+ var ref ;
608+ if ( wrapper . site_info . privatekey || ( ref = wrapper . site_info . auth_address , indexOf . call ( res . signers , ref ) >= 0 ) ) {
613609 return wrapper . ws . cmd ( "siteSign" , {
614- privatekey : privatekey ,
610+ privatekey : "stored" ,
615611 inner_path : inner_path ,
616612 update_changed_files : true
617613 } , function ( res ) {
618- if ( res === "ok" ) {
619- return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
620- }
614+ return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
621615 } ) ;
622- } ) ;
623- }
616+ } else {
617+ return wrapper . displayPrompt ( "Enter your private key:" , "password" , "Sign" , "" , function ( privatekey ) {
618+ return wrapper . ws . cmd ( "siteSign" , {
619+ privatekey : privatekey ,
620+ inner_path : inner_path ,
621+ update_changed_files : true
622+ } , function ( res ) {
623+ if ( res === "ok" ) {
624+ return wrapper . notifications . add ( "sign" , "done" , inner_path + " Signed!" , 5000 ) ;
625+ }
626+ } ) ;
627+ } ) ;
628+ }
629+ } ) ;
624630 return false ;
625631 } ;
626632 } ) ( this ) ) ;
@@ -676,7 +682,7 @@ window.initScrollable = function () {
676682 return img . onload = ( function ( _this ) {
677683 return function ( ) {
678684 return wrapper . ws . cmd ( "sidebarGetPeers" , [ ] , function ( globe_data ) {
679- var e , ref , ref1 ;
685+ var e , error , ref , ref1 ;
680686 if ( _this . globe ) {
681687 _this . globe . scene . remove ( _this . globe . points ) ;
682688 _this . globe . addData ( globe_data , {
0 commit comments