@@ -844,19 +844,19 @@ jQuery.extend( jQuery.easing,
844844 SiteMenu . __super__ . constructor . call ( this , $ ( ".hamburger" , elem ) ) ;
845845 this . elem . addClass ( "menu-site" ) ;
846846 this . addItem ( "Update" , ( function ( ) {
847- return window . zero_hello . siteUpdate ( site . content . address ) ;
847+ return window . zero_hello . siteUpdate ( site . address ) ;
848848 } ) ) ;
849849 if ( site . settings . serving ) {
850850 this . addItem ( "Pause" , ( function ( ) {
851- return window . zero_hello . sitePause ( site . content . address ) ;
851+ return window . zero_hello . sitePause ( site . address ) ;
852852 } ) ) ;
853853 } else {
854854 this . addItem ( "Resume" , ( function ( ) {
855- return window . zero_hello . siteResume ( site . content . address ) ;
855+ return window . zero_hello . siteResume ( site . address ) ;
856856 } ) ) ;
857857 }
858858 this . addItem ( "Delete" , ( function ( ) {
859- return window . zero_hello . siteDelete ( site . content . address ) ;
859+ return window . zero_hello . siteDelete ( site . address ) ;
860860 } ) ) . addClass ( "menu-item-separator" ) ;
861861 }
862862
@@ -901,6 +901,7 @@ jQuery.extend( jQuery.easing,
901901 this . log ( "inited!" ) ;
902902 this . sites = { } ;
903903 this . local_storage = null ;
904+ this . is_proxy_request = document . location . host === "zero" || document . location . pathname === "/" ;
904905 this . cmd ( "wrapperGetLocalStorage" , [ ] , ( function ( _this ) {
905906 return function ( res ) {
906907 if ( res == null ) {
@@ -990,7 +991,7 @@ jQuery.extend( jQuery.easing,
990991 } ;
991992
992993 ZeroHello . prototype . applySitedata = function ( elem , site ) {
993- var error , modified , success , _ref , _ref1 , _ref2 , _ref3 ;
994+ var error , href , modified , success , _ref , _ref1 , _ref2 , _ref3 ;
994995 if ( typeof site . bad_files === "object" ) {
995996 site . bad_files = site . bad_files . length ;
996997 }
@@ -1012,10 +1013,19 @@ jQuery.extend( jQuery.easing,
10121013 modified = site . settings . modified ? site . settings . modified : site . content . modified ;
10131014 $ ( ".modified-date" , elem ) . html ( this . formatSince ( modified ) ) ;
10141015 if ( ( this . server_info . plugins != null ) && ( __indexOf . call ( this . server_info . plugins , "Zeroname" ) >= 0 || __indexOf . call ( this . server_info . plugins , "Dnschain" ) >= 0 ) && ( ( _ref = site . content ) != null ? _ref . domain : void 0 ) ) {
1015- $ ( ".site" , elem ) . attr ( "href" , "/" + site . content . domain ) ;
1016+ if ( this . is_proxy_request ) {
1017+ href = "http://" + site . content . domain ;
1018+ } else {
1019+ href = "/" + site . content . domain ;
1020+ }
10161021 } else {
1017- $ ( ".site" , elem ) . attr ( "href" , "/" + site . address ) ;
1022+ if ( this . is_proxy_request ) {
1023+ href = "http://zero/" + site . address ;
1024+ } else {
1025+ href = "/" + site . address ;
1026+ }
10181027 }
1028+ $ ( ".site" , elem ) . attr ( "href" , href ) ;
10191029 $ ( elem ) . removeClass ( "site-seeding" ) . removeClass ( "site-paused" ) ;
10201030 if ( site . settings . serving && site . address ) {
10211031 $ ( elem ) . addClass ( "site-seeding" ) ;
0 commit comments