@@ -841,6 +841,7 @@ jQuery.extend( jQuery.easing,
841841 __extends ( SiteMenu , _super ) ;
842842
843843 function SiteMenu ( elem , site ) {
844+ var _ref ;
844845 SiteMenu . __super__ . constructor . call ( this , $ ( ".hamburger" , elem ) ) ;
845846 this . elem . addClass ( "menu-site" ) ;
846847 this . addItem ( "Update" , ( function ( ) {
@@ -855,6 +856,17 @@ jQuery.extend( jQuery.easing,
855856 return window . zero_hello . siteResume ( site . address ) ;
856857 } ) ) ;
857858 }
859+ if ( ( _ref = site . content ) != null ? _ref . cloneable : void 0 ) {
860+ if ( zero_hello . server_info . rev < 200 ) {
861+ this . addItem ( "Clone" , ( function ( ) {
862+ return window . zero_hello . cmd ( "wrapperNotification" , [ "info" , "Please update to version 0.3.1 to use the site clone feature!" ] ) ;
863+ } ) ) ;
864+ } else {
865+ this . addItem ( "Clone" , ( function ( ) {
866+ return window . zero_hello . siteClone ( site . address ) ;
867+ } ) ) ;
868+ }
869+ }
858870 this . addItem ( "Delete" , ( function ( ) {
859871 return window . zero_hello . siteDelete ( site . address ) ;
860872 } ) ) . addClass ( "menu-item-separator" ) ;
@@ -879,6 +891,7 @@ jQuery.extend( jQuery.easing,
879891} ) . call ( this ) ;
880892
881893
894+
882895/* ---- data/1EU1tbG9oC1A8jz2ouVwGZyQ5asrNsE4Vr/js/ZeroHello.coffee ---- */
883896
884897
@@ -913,6 +926,7 @@ jQuery.extend( jQuery.easing,
913926 return $ ( ".button-update" ) . on ( "click" , ( function ( _this ) {
914927 return function ( ) {
915928 $ ( ".button-update" ) . addClass ( "loading" ) ;
929+ $ ( ".broken-autoupdate" ) . css ( "display" , "block" ) . html ( "Please run update.py manually<br>if ZeroNet doesn't comes back within 1 minute." ) ;
916930 return _this . cmd ( "serverUpdate" , { } ) ;
917931 } ;
918932 } ) ( this ) ) ;
@@ -991,7 +1005,7 @@ jQuery.extend( jQuery.easing,
9911005 } ;
9921006
9931007 ZeroHello . prototype . applySitedata = function ( elem , site ) {
994- var error , href , modified , success , _ref , _ref1 , _ref2 , _ref3 ;
1008+ var error , href , modified , success , _ref , _ref1 , _ref2 , _ref3 , _ref4 , _ref5 ;
9951009 if ( typeof site . bad_files === "object" ) {
9961010 site . bad_files = site . bad_files . length ;
9971011 }
@@ -1034,16 +1048,18 @@ jQuery.extend( jQuery.easing,
10341048 $ ( elem ) . addClass ( "site-paused" ) ;
10351049 $ ( ".status" , elem ) . text ( "Paused" ) ;
10361050 }
1037- if ( site . tasks > 0 ) {
1051+ if ( site . tasks > 0 || ( ( _ref1 = site . event ) != null ? _ref1 [ 0 ] : void 0 ) === "updating" ) {
10381052 $ ( ".anim-updating" , elem ) . addClass ( "visible" ) ;
10391053 } else {
10401054 $ ( ".anim-updating" , elem ) . removeClass ( "visible" ) ;
10411055 }
1042- if ( ( ( _ref1 = site . event ) != null ? _ref1 [ 0 ] : void 0 ) === "file_done" || ( ( _ref2 = site . event ) != null ? _ref2 [ 0 ] : void 0 ) === "file_started " ) {
1056+ if ( ( _ref2 = ( _ref3 = site . event ) != null ? _ref3 [ 0 ] : void 0 ) === "file_done" || _ref2 === "file_started" || _ref2 === "updating" || _ref2 === "updated " ) {
10431057 if ( site . bad_files > 0 ) {
10441058 success = "Updating: " + site . bad_files + " left" ;
1045- } else if ( site . event [ 0 ] === "file_done" && site . bad_files === 0 ) {
1059+ } else if ( ( ( _ref4 = site . event [ 0 ] ) === "file_done" || _ref4 === "updated" ) && site . bad_files === 0 ) {
10461060 success = "Site updated" ;
1061+ } else {
1062+ success = "Site updating..." ;
10471063 }
10481064 }
10491065 if ( success ) {
@@ -1055,7 +1071,7 @@ jQuery.extend( jQuery.easing,
10551071 } else {
10561072 error = "Update failed" ;
10571073 }
1058- } else if ( site . tasks === 0 && site . bad_files > 0 && ( ( _ref3 = site . event ) != null ? _ref3 [ 0 ] : void 0 ) !== "file_done" ) {
1074+ } else if ( site . tasks === 0 && site . bad_files > 0 && ( ( _ref5 = site . event ) != null ? _ref5 [ 0 ] : void 0 ) !== "file_done" ) {
10591075 error = site . bad_files + " file update failed" ;
10601076 }
10611077 if ( error ) {
@@ -1136,6 +1152,16 @@ jQuery.extend( jQuery.easing,
11361152 "settings" : {
11371153 "serving" : false
11381154 }
1155+ } , {
1156+ "content" : {
1157+ "title" : "ZeroID" ,
1158+ "description" : "Sample trusted authorization provider" ,
1159+ "domain" : "ZeroID.bit"
1160+ } ,
1161+ "address" : "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz" ,
1162+ "settings" : {
1163+ "serving" : false
1164+ }
11391165 } , {
11401166 "content" : {
11411167 "title" : "ZeroMarket" ,
@@ -1233,6 +1259,12 @@ jQuery.extend( jQuery.easing,
12331259 } ) ;
12341260 } ;
12351261
1262+ ZeroHello . prototype . siteClone = function ( address ) {
1263+ return this . cmd ( "siteClone" , {
1264+ "address" : address
1265+ } ) ;
1266+ } ;
1267+
12361268 ZeroHello . prototype . siteDelete = function ( address ) {
12371269 var site , title ;
12381270 site = this . sites [ address ] ;
@@ -1263,4 +1295,4 @@ jQuery.extend( jQuery.easing,
12631295
12641296 window . zero_hello = new ZeroHello ( ) ;
12651297
1266- } ) . call ( this ) ;
1298+ } ) . call ( this ) ;
0 commit comments