diff --git a/build/build.php b/build/build.php index 82f84bdf2..d95247e7c 100644 --- a/build/build.php +++ b/build/build.php @@ -8,7 +8,7 @@ $buildLog = "Building version $version \n\n"; $header = ""; - $js = file(dirname(__FILE__) . '/../examples/phaser-debug-js.php'); + $js = file(dirname(__FILE__) . 'config.php'); $output = ""; for ($i = 0; $i < count($js); $i++) diff --git a/build/config.php b/build/config.php new file mode 100644 index 000000000..e41fb353c --- /dev/null +++ b/build/config.php @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/_site/css/phaser-lite.css b/examples/_site/css/phaser-lite.css new file mode 100644 index 000000000..ce1d4bdf6 --- /dev/null +++ b/examples/_site/css/phaser-lite.css @@ -0,0 +1,84 @@ +@font-face { + + font-family: 'inconsolata'; + src: url('../../_site/fonts/inconsolata.woff') format('woff'); + font-weight: normal; + font-style: normal; + +} + +body { + + background: #e0e4f1; + margin: 0px; + font-family: 'inconsolata'; + font-size: 15px; + overflow: hidden; + +} + +a { + text-decoration: none; + color: #1c99bb; +} + +a:hover { + background-color: #e69b0b; + color: #fff; +} + +h1 { + + font-size: 25px; + font-weight: normal; + +} + +h2 { + + font-size: 20px; + font-weight: normal; + +} + +#header { + background: url(../../_site/images/lite_header.jpg) no-repeat left top; + width: 300px; + height: 100px; +} + +#panel { + + background: url(../../_site/images/lite_header_2.jpg) no-repeat left top; + width: 300px; + overflow-x: hidden; + overflow-y: scroll; + +} + + #panel #examples-list { + + padding: 10px 20px; + line-height: 18px; + + } + +#footer { + background: url(../../_site/images/lite_footer.jpg) no-repeat left top; + width: 300px; + height: 170px; + color: #000; + text-align: center; +} + +#viewer { + + position: absolute; + top: 0px; + left: 300px; + width: -webkit-calc(100% - 300px); /* Safari */ + width: calc(100% - 300px); + height: 100%; + border: 0px; + +} diff --git a/examples/_site/funcs.php b/examples/_site/funcs.php index b06f3946d..86af8ce01 100644 --- a/examples/_site/funcs.php +++ b/examples/_site/funcs.php @@ -1,5 +1,4 @@ ' + dir + ''; + + for (var e = 0; e < files.length; e++) + { + node += '' + files[e].title + '
'; + } + + $("#examples-list").append(node); + + i += files.length; + + }); + + $("#total").append(i); + + // Re-calc the viewer height + var height = $(window).height() - 270; + $("#panel").css('height', height + 'px'); + + }) + + .fail(function() { + + var node = '

Error!

'; + + node += '

Unable to load examples.json data file

'; + node += '

Did you open this html file locally?

'; + node += '

It needs to be opened via a web server, or due to browser security permissions
it will be unable to load local resources such as images and json data.

'; + node += '

Please see our Getting Started guide for details.

'; + + $("#viewer").contents().find('body').append(node); + + }); + +}); diff --git a/examples/_site/js/phaser-viewer.js b/examples/_site/js/phaser-viewer.js index 6de8919a8..ab6c64bb6 100644 --- a/examples/_site/js/phaser-viewer.js +++ b/examples/_site/js/phaser-viewer.js @@ -10,13 +10,37 @@ $(document).ready(function(){ $.getScript(dir + "/" + file) - .done(function(script, textStatus){ + .done(function(script, textStatus) { - // $.get(dir + "/" + file, function(data) { - // console.log(typeof data); - // console.log(data); - // $("#sourcecode").text(data); - // }); + $.ajax({ url: dir + "/" + file, dataType: "text" }).done(function(data) { $("#sourcecode").text(data); }); + + // Hook up the control panel + + $(".pause-button").click(function() { + if (game.paused) + { + game.paused = false; + } + else + { + game.paused = true; + } + }); + + $(".mute-button").click(function() { + if (game.sound.mute) + { + game.sound.mute = false; + } + else + { + game.sound.mute = true; + } + }); + + $(".reset-button").click(function() { + document.location.reload(true); + }); }) diff --git a/examples/_site/view_full.html b/examples/_site/view_full.html index 0066dd368..0bd418b2a 100644 --- a/examples/_site/view_full.html +++ b/examples/_site/view_full.html @@ -121,7 +121,7 @@
Phaser Version: 1.1 - 1.2 dev branch + 1.2 dev branch
@@ -161,7 +161,6 @@

Source code:


-        
 
         
+ +

Some stuff here

+
+