lots of nothing

This commit is contained in:
Trevor Squillario 2014-12-06 20:26:19 -05:00
parent 9b6044361f
commit e3fc948a77
9 changed files with 48 additions and 18 deletions

View file

@ -11,15 +11,6 @@ angular.module('JamStash').directive('sortable', function () {
} }
}; };
}) })
/*
.directive('split', function () {
return {
link: function (scope, elm, attrs) {
elm.splitPane();
}
};
})
*/
.directive('fancybox', ['$compile', function($compile){ .directive('fancybox', ['$compile', function($compile){
return { return {
restrict: 'A', restrict: 'A',
@ -123,4 +114,22 @@ angular.module('JamStash').directive('sortable', function () {
} }
}); });
}; };
})
.directive("ngMsgs", function() {
/* Not Using */
return {
restrict: 'E',
transclude : false,
scope: {
msgs: "="
},
template: '<span id="msg_{{$index}}" class="message">{{ item }}</span>',
link: function (scope, elm, attrs) {
scope.$watch(scope.Messages, function () {
var content = $compile((template)(scope));
elm.append(content);
$(elm).parent().fadeIn();
});
}
};
}); });

View file

@ -9,6 +9,7 @@
$rootScope.playingSong = null; $rootScope.playingSong = null;
$rootScope.MusicFolders = []; $rootScope.MusicFolders = [];
$rootScope.Genres = []; $rootScope.Genres = [];
$rootScope.Messages = [];
$rootScope.SelectedMusicFolder = ""; $rootScope.SelectedMusicFolder = "";
$rootScope.unity = null; $rootScope.unity = null;
@ -301,6 +302,9 @@
$scope.isActive = function (route) { $scope.isActive = function (route) {
return route === $location.path(); return route === $location.path();
}; };
$rootScope.reloadRoute = function (reload) {
utils.reloadRoute(reload);
};
$rootScope.getSplitPosition = function (scope, elm) { $rootScope.getSplitPosition = function (scope, elm) {
window.alert(elm.getBoundingClientRect().left); window.alert(elm.getBoundingClientRect().left);
}; };
@ -433,6 +437,7 @@
$scope.toTrusted = function (html) { $scope.toTrusted = function (html) {
return $sce.trustAsHtml(html); return $sce.trustAsHtml(html);
}; };
/* Launch on Startup */ /* Launch on Startup */
$scope.loadSettings(); $scope.loadSettings();

View file

@ -11,11 +11,8 @@ angular.module('jamstash.notifications', [])
var msgIndex = 1; var msgIndex = 1;
this.updateMessage = function (msg, autohide) { this.updateMessage = function (msg, autohide) {
if (msg !== '') { if (msg !== '') {
var id = msgIndex; $rootScope.Messages.push(msg);
$('#messages').append('<span id=\"msg_' + id + '\" class="message">' + msg + '</span>');
$('#messages').fadeIn(); $('#messages').fadeIn();
$("#messages").scrollTo('100%');
var el = '#msg_' + id;
if (autohide) { if (autohide) {
setTimeout(function () { setTimeout(function () {
$(el).fadeOut(function () { $(this).remove(); }); $(el).fadeOut(function () { $(this).remove(); });
@ -26,7 +23,6 @@ angular.module('jamstash.notifications', [])
return false; return false;
}); });
} }
msgIndex++;
} }
}; };
this.requestPermissionIfRequired = function () { this.requestPermissionIfRequired = function () {

View file

@ -337,6 +337,13 @@ angular.module('jamstash.utils', ['jamstash.settings'])
} }
} }
}; };
this.reloadRoute = function (date) {
if (reload) {
$window.location.reload();
} else {
$route.reload();
}
};
this.parseDate = function (date) { this.parseDate = function (date) {
// input: "2012-09-23 20:00:00.0" // input: "2012-09-23 20:00:00.0"
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

View file

@ -23,7 +23,9 @@
<body ng-controller="AppCtrl"> <body ng-controller="AppCtrl">
<div id="container"> <div id="container">
<div id="header"> <div id="header">
<div id="messages"></div> <div id="messages">
<span id="msg_{{$index}}" class="message" ng-repeat="item in Messages track by $index" ng-bind-html="item"></span>
</div>
<div id="loading"></div> <div id="loading"></div>
<a id="jslogo" title="Jamstash" class="showQueue" href=""></a> <a id="jslogo" title="Jamstash" class="showQueue" href=""></a>
<a id="sslogo" target="_blank" ng-show="settings.Server" ng-href="{{settings.Server}}" title="{{settings.Server}}"></a> <a id="sslogo" target="_blank" ng-show="settings.Server" ng-href="{{settings.Server}}" title="{{settings.Server}}"></a>

View file

@ -65,6 +65,8 @@ angular.module('jamstash.settings', [])
this.SavedGenres = []; this.SavedGenres = [];
this.Player1 = '#playdeck_1'; this.Player1 = '#playdeck_1';
this.archiveUrl = 'https://archive.org/'; this.archiveUrl = 'https://archive.org/';
this.ChangeLog = null;
this.Messages = [];
this.BaseURL = function () { return this.settings.Server + '/rest'; }; this.BaseURL = function () { return this.settings.Server + '/rest'; };
this.BaseParams = function () { return 'u=' + this.settings.Username + '&p=' + this.settings.Password + '&f=' + this.settings.Protocol + '&v=' + this.settings.ApiVersion + '&c=' + this.settings.ApplicationName; }; this.BaseParams = function () { return 'u=' + this.settings.Username + '&p=' + this.settings.Password + '&f=' + this.settings.Protocol + '&v=' + this.settings.ApiVersion + '&c=' + this.settings.ApplicationName; };

View file

@ -124,7 +124,7 @@
<li><em>&rarr;</em> Next Track</li> <li><em>&rarr;</em> Next Track</li>
<li><em>&larr;</em> Previous Track</li> <li><em>&larr;</em> Previous Track</li>
<li><em>-/_</em> Volume Down <em>=/+</em> Volume Up</li> <li><em>-/_</em> Volume Down <em>=/+</em> Volume Up</li>
<li><em>Media Keys</em> via <a href="https://chrome.google.com/webstore/detail/swayfm-unified-music-medi/icckhjgjjompfgoiidainoapgjepncej" target="_blank">Sway.fm Unified Music Media Keys</a></li> <li><em>Media Keys</em> via <a href="https://chrome.google.com/webstore/detail/key-socket-media-keys/fphfgdknbpakeedbaenojjdcdoajihik" target="_blank">Key Socket Media Keys</a></li>
</ul> </ul>
<div id="donate" class="subsection floatleft"> <div id="donate" class="subsection floatleft">
<h3 class="title">Buy me a <span class="beer">beer</span>! I'd like that :)</h3> <h3 class="title">Buy me a <span class="beer">beer</span>! I'd like that :)</h3>

View file

@ -67,7 +67,16 @@
}; };
json.getChangeLog(function (data) { json.getChangeLog(function (data) {
$scope.changeLog = data.slice(0, 10); $scope.changeLog = data.slice(0, 10);
//notifications.updateMessage('Latest Version: ' + $scope.changeLog[0].version, true); globals.ChangeLog = data;
var newVersion = $scope.changeLog[0].version;
if (!utils.getValue('JamstashVersion')) {
utils.setValue('JamstashVersion', newVersion);
}
var oldVersion = utils.getValue('JamstashVersion');
if (utils.checkVersionNewer(oldVersion, newVersion)) {
utils.setValue('JamstashVersion', newVersion);
notifications.updateMessage('Version ' + oldVersion + ' to ' + newVersion, true);
}
}); });
$scope.changeLogShowMore = function () { $scope.changeLogShowMore = function () {
json.getChangeLog(function (data) { json.getChangeLog(function (data) {

View file

@ -872,7 +872,7 @@ ul.songlist .row .itemactions
{ {
/*width: 15%;*/ /*width: 15%;*/
float: left; float: left;
padding: 6px 10px 0 6px; padding: 6px 10px 0 15px;
} }
ul.songlist .row .itemactions a ul.songlist .row .itemactions a
{ {