Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #55 from Amrykid/non-user-closable-dialogs
Browse files Browse the repository at this point in the history
It's buggy but added non-closeable-dialogs.
  • Loading branch information
AzureKitsune committed Apr 8, 2013
2 parents 075b7d3 + 50f384a commit 71081c3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
8 changes: 7 additions & 1 deletion frontend/app/views/index.php
Expand Up @@ -44,7 +44,7 @@
<button id="settingsButton" class="icon-cog"></button>
</footer>
<div id="paneCover" class="">
<div class="pane dialog">
<div class="pane dialog closeable">
<header>
<h1>Dialog</h1>
<button class="closePane icon-remove"></button>
Expand All @@ -54,6 +54,12 @@
<button class="dialogButton">Dismiss</button>
</footer>
</div>
<div class="pane dialog noncloseable">
<header>
<h1>Dialog</h1>
</header>
<p>Message</p>
</div>
<div class="pane" id="historyPane">
<header>
<h1>History</h1>
Expand Down
16 changes: 13 additions & 3 deletions frontend/public/js/core.js
Expand Up @@ -64,9 +64,19 @@ $('.closePane, .dialogButton').click(function(){
$(".pane").draggable({ containment: $(document.body), scroll: false , opacity: 0.35}); //http://api.jqueryui.com/draggable/#option-containment

function dialog(title,message){
$('.dialog header h1').html(title);
$('.dialog p').html(message);
$('#paneCover, .dialog').fadeToggle(200);
$('.dialog.closeable header h1').html(title);
$('.dialog.closeable p').html(message);
$('#paneCover, .dialog.closeable').fadeToggle(200);
}
function non_close_dialog(title,message){
$('.dialog.noncloseable header h1').html(title);
$('.dialog.noncloseable p').html(message);
$('#paneCover, .dialog.noncloseable').fadeToggle(200);

return function() {
$('#paneCover').fadeOut(200);
$('.dialog.noncloseable').fadeOut(200);
};
}

$('#notiToggle').click(function(){
Expand Down
7 changes: 7 additions & 0 deletions frontend/public/js/hanasu/hanasu.js
Expand Up @@ -39,6 +39,9 @@ var Hanasu = (function () {
}
Hanasu.prototype.setPlayStatus(false);
Hanasu.prototype.clearSongInfo();
if(Hanasu.prototype.loadingScreenHandle != "null") {
Hanasu.prototype.loadingScreenHandle();
}
}
});
} else {
Expand All @@ -63,6 +66,9 @@ var Hanasu = (function () {
Hanasu.prototype.stationTimer.play();
}
Hanasu.prototype.retrieveCurrentStationData(false);
if(Hanasu.prototype.loadingScreenHandle != "null") {
Hanasu.prototype.loadingScreenHandle();
}
});
$("#jquery_jplayer").bind($.jPlayer.event.ended, function (event) {
Hanasu.prototype.setPlayStatus(false);
Expand Down Expand Up @@ -222,6 +228,7 @@ var Hanasu = (function () {
Hanasu.prototype.stopStation(true);
}
Hanasu.prototype.obtainNotificationsPermission();
Hanasu.prototype.loadingScreenHandle = non_close_dialog("Connecting...", "One moment please...");
if(station.PlaylistExt == '') {
Hanasu.prototype._playStation(station, station.Stream);
} else {
Expand Down
13 changes: 13 additions & 0 deletions frontend/public/js/hanasu/hanasu.ts
Expand Up @@ -30,6 +30,8 @@ class Hanasu {
public CurrentStation: Station;
public NotificationToggled: bool;

private loadingScreenHandle: any;

public initializeApplication(isMobile: bool = false) {
//any important starting procedures, we can put here.

Expand Down Expand Up @@ -78,6 +80,11 @@ class Hanasu {

Hanasu.prototype.setPlayStatus(false);
Hanasu.prototype.clearSongInfo();


if (Hanasu.prototype.loadingScreenHandle != "null") {
Hanasu.prototype.loadingScreenHandle();
}
}
});
} else {
Expand Down Expand Up @@ -105,6 +112,10 @@ class Hanasu {
}

Hanasu.prototype.retrieveCurrentStationData(false); //Grabs the song title and artist name in depending on what the Station ServerType is.

if (Hanasu.prototype.loadingScreenHandle != "null") {
Hanasu.prototype.loadingScreenHandle();
}
});

$("#jquery_jplayer").bind($.jPlayer.event.ended, function(event) {
Expand Down Expand Up @@ -330,6 +341,8 @@ class Hanasu {

Hanasu.prototype.obtainNotificationsPermission();

Hanasu.prototype.loadingScreenHandle = non_close_dialog("Connecting...","One moment please...");

// Checks if the station requires any pre-processing.
if (station.PlaylistExt == '') {
Hanasu.prototype._playStation(station, station.Stream); //Plays the station since it is not a playlist, but is a direct stream.
Expand Down

0 comments on commit 71081c3

Please sign in to comment.