2013-10-22 20:29:58 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
|
|
|
|
var dir = $.url().param('d');
|
|
|
|
var file = $.url().param('f');
|
|
|
|
var title = $.url().param('t');
|
|
|
|
|
|
|
|
document.title = 'phaser - ' + title;
|
|
|
|
|
|
|
|
$("#title").append(title);
|
|
|
|
|
|
|
|
$.getScript(dir + "/" + file)
|
|
|
|
|
2013-10-23 01:14:51 +00:00
|
|
|
.done(function(script, textStatus) {
|
|
|
|
|
|
|
|
$.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);
|
|
|
|
});
|
2013-10-22 20:29:58 +00:00
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.fail(function(jqxhr, settings, exception) {
|
|
|
|
|
|
|
|
$("#title").text("Error");
|
|
|
|
|
|
|
|
var node = '<p>Unable to load <u>' + dir + '/' + file + '</u></p>';
|
|
|
|
|
|
|
|
$('#phaser-example').append(node);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2013-11-28 15:57:09 +00:00
|
|
|
$.getJSON("http://phaser.io/version.json")
|
|
|
|
|
|
|
|
.done(function(data) {
|
|
|
|
|
2014-02-28 09:30:53 +00:00
|
|
|
if (data.version !== '2.0.0')
|
2013-11-28 15:57:09 +00:00
|
|
|
{
|
|
|
|
$("#upgrade").append(data.version);
|
|
|
|
$("#upgrade").css('display', 'inline-block');
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2013-10-22 20:29:58 +00:00
|
|
|
});
|