File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < title > Enable Phoenix development site</ title >
6+ < link rel ="stylesheet " href ="styles.css " />
7+ < script >
8+ function showEnabledStatus ( ) {
9+ let enabled = localStorage . getItem ( "devDomainsEnabled" ) === "true" ,
10+ statusMessage = `Dev site at ${ location . hostname } is currently disabled` ,
11+ btnMessage = `Enable ${ location . hostname } ` ,
12+ color = "red" ;
13+ if ( enabled ) {
14+ statusMessage = `Dev site at ${ location . hostname } is currently Enabled` ;
15+ btnMessage = `Disable ${ location . hostname } ` ;
16+ color = "green" ;
17+ }
18+ document . getElementById ( "heading" ) . textContent = `Enable or Disable Phoenix Development site at: ${ location . hostname } ` ;
19+ document . getElementById ( "enableStatus" ) . textContent = statusMessage ;
20+ document . getElementById ( 'enableStatus' ) . style . color = color ;
21+ document . getElementById ( "enableBtn" ) . textContent = btnMessage ;
22+ }
23+ function buttonClicked ( ) {
24+ let enabled = localStorage . getItem ( "devDomainsEnabled" ) === "true" ;
25+ enabled = "" + ( ! enabled ) ;
26+ localStorage . setItem ( "devDomainsEnabled" , enabled ) ;
27+ showEnabledStatus ( ) ;
28+ }
29+ </ script >
30+ </ head >
31+ < body onload ="showEnabledStatus() ">
32+ < h1 id ="heading "> Enable or Disable Phoenix Dev site.</ h1 >
33+ < div id ="enableStatus "> Checking if dev site is enabled...</ div >
34+ < br />
35+ < button id ="enableBtn " onclick ="buttonClicked() "> Click me</ button >
36+ </ body >
37+ </ html >
Original file line number Diff line number Diff line change 4545
4646 <!-- JavaScript -->
4747 < script type ="text/javascript ">
48+ if ( [ "dev.phcode.dev" , "staging.phcode.dev" ] . includes ( location . hostname )
49+ && localStorage . getItem ( "devDomainsEnabled" ) !== "true" ) {
50+ alert ( "Hello explorer, you have reached a development version of phcode.dev that is not for general use and could be very unstable." +
51+ `\n\nIf you know what you are doing and what to visit the dev site, please go to https://${ location . hostname } /devEnable.html to enable dev site and visit again.` +
52+ "\n\nYou will now be redirected to phcode.dev." ) ;
53+ window . location = "https://phcode.dev" ;
54+ }
55+
4856 // logger setup
4957 function swallowLogs ( ) {
5058 // Do nothing
You can’t perform that action at this time.
0 commit comments