<img id="floater" src="images/Arrow_Floating.gif" />
<h1 style="text-align:center;">DivinElegy</h1>
-<ul class="menu">
- <li>
+<ul class="menu" style="text-align: center">
+ <!--<li>
<a href="#/simfiles">
<img ng-mouseover = "archiveImg='simfiles_hover.png'; page='Simfile Archive (Individual Files)'"
ng-mouseleave = "archiveImg='simfiles.png'"
ng-init = "archiveImg='simfiles.png'"
ng-src="images/{{archiveImg}}"/>
</a>
- </li>
+ </li>-->
<li>
<a href="#/packs">
<img ng-mouseover = "fImg='simfiles_hover.png'; page='Simfile Archive (Packs)'"
</ul>
<div class="clearfix"></div>
<hr style="margin-top: 5px;"/>
-<div class='page-title'>{{page}}</div>
+<div class='page-title'>{{page || 'hello : )'}}</div>
<hr style="margin-top: 5px;" />
-<div latest-simfile></div>
+<!--<div latest-simfile></div>-->
<div latest-pack></div>
<hr />
<div most-downloaded></div>
\ No newline at end of file
//don't put ,[] because that declares a new module. This gets the existing one
angular.module('DivinElegy.components.simfiles').
-directive('latestPack', ['rockEndpoint', '$http', 'UserService', 'HelloService', '$rootScope', function(rockEndpoint, $http, UserService, HelloService, $rootScope)
+directive('latestPack', ['rockEndpoint', '$http', 'UserService', 'HelloService', 'UiSettingsService', '$rootScope', function(rockEndpoint, $http, UserService, HelloService, UiSettingsService, $rootScope)
{
return {
templateUrl: 'components/simfiles/latest-pack.html',
+ scope: {},
link: function($scope) {
$http({
url: rockEndpoint + "simfiles/latest/pack",
} else {
//TODO: Maybe access token should be in user obj?
var url = rockEndpoint + '' + simfile.mirrors[0].uri + '?token=' + HelloService.getAccessToken(); //0th mirror will always be de
- $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ if(UiSettingsService.getDirective('showDownloadWarning') === 'Yes')
+ {
+ $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ } else {
+ window.location = url;
+ $rootScope.updateUserCache();
+ }
}
});
};
$scope.pack = data;
$scope.rockEndpoint = rockEndpoint;
$scope.contributors = data.contributors.join(', ');
- $scope.$$phase || $scope.$apply();
+ $rootScope.$$phase || $rootScope.$apply();
});
}
};
//don't put ,[] because that declares a new module. This gets the existing one
angular.module('DivinElegy.components.simfiles').
-directive('latestSimfile', ['rockEndpoint', '$http', 'UserService', 'HelloService', '$rootScope', function(rockEndpoint, $http, UserService, HelloService, $rootScope)
+directive('latestSimfile', ['rockEndpoint', '$http', 'UserService', 'HelloService', 'UiSettingsService', '$rootScope', function(rockEndpoint, $http, UserService, HelloService, UiSettingsService, $rootScope)
{
return {
templateUrl: 'components/simfiles/latest-simfile.html',
+ scope: {},
link: function($scope) {
$http({
url: rockEndpoint + "simfiles/latest/simfile",
} else {
//TODO: Maybe access token should be in user obj?
var url = rockEndpoint + '' + simfile.download + '?token=' + HelloService.getAccessToken(); //0th mirror will always be de
- $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ if(UiSettingsService.getDirective('showDownloadWarning') === 'Yes')
+ {
+ $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ } else {
+ window.location = url;
+ $rootScope.updateUserCache();
+ }
}
});
};
$scope.simfile = data;
$scope.rockEndpoint = rockEndpoint;
$scope.authors = authors.join(', ');
- $scope.$$phase || $scope.$apply();
+ $rootScope.$$phase || $rootScope.$apply();
});
}
};
//don't put ,[] because that declares a new module. This gets the existing one
angular.module('DivinElegy.components.simfiles').
-directive('mostDownloaded', ['rockEndpoint', '$http', 'UserService', 'HelloService', '$rootScope', function(rockEndpoint, $http, UserService, HelloService, $rootScope)
+directive('mostDownloaded', ['rockEndpoint', '$http', 'UserService', 'UiSettingsService', 'HelloService', '$rootScope', function(rockEndpoint, $http, UserService, UiSettingsService, HelloService, $rootScope)
{
return {
templateUrl: 'components/simfiles/most-downloaded.html',
} else {
url = rockEndpoint + '' + simfile.download + '?token=' + HelloService.getAccessToken(); //0th mirror will always be de
}
- $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+
+ if(UiSettingsService.getDirective('showDownloadWarning') === 'Yes')
+ {
+ $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ } else {
+ window.location = url;
+ $rootScope.updateUserCache();
+ }
}
});
//don't put ,[] because that declares a new module. This gets the existing one
angular.module('DivinElegy.components.simfiles').
-directive('simfile', ['$rootScope', 'UserService', 'HelloService', 'rockEndpoint', function($rootScope, UserService, HelloService, rockEndpoint)
+directive('simfile', ['$rootScope', 'UserService', 'HelloService', 'rockEndpoint', 'UiSettingsService', function($rootScope, UserService, HelloService, rockEndpoint, UiSettingsService)
{
return {
restrict: 'E',
} else {
//TODO: Maybe access token should be in user obj?
var url = rockEndpoint + '' + simfile.download + '?token=' + HelloService.getAccessToken(); //0th mirror will always be de
- $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ if(UiSettingsService.getDirective('showDownloadWarning') === 'Yes')
+ {
+ $rootScope.$broadcast('message.warning', 'You are about to download ' + simfile.title + ' which is ' + simfile.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ } else {
+ window.location = url;
+ $rootScope.updateUserCache();
+ }
}
});
};
$localStorage.$default({
ui: {
'simfilesPerPage': 10,
- 'showDownloadWarning' : true
+ 'showDownloadWarning' : 'Yes'
}
});
return {
templateUrl: 'components/userMenu/userMenu.html',
link: function(scope, element){
+ scope.menuReady = !HelloService.isLoggedIn()
+
scope.doLogin = function()
{
+ scope.menuReady = false;
HelloService.facebookLogin();
};
scope.quota = user.quota;
scope.quotaRemaining = user.quotaRemaining;
scope.loggedIn = true;
+ scope.menuReady = true;
scope.$$phase || scope.$apply();
});
});
<img id="targets" src="images/Targets.png" />
-<h1 ng-if="loggedIn">Welcome!</h1>
-<h1 ng-if="!loggedIn">Hello!</h1>
-<ul>
- <li>
- {{welcomeMessage}}
- <a class="de-link" ng-if="loggedIn" ng-click="doLogout()">logout</a>
- <span ng-if="!loggedIn"><a class="de-link" ng-click="doLogin()">Login</a> to access your own control panel.</span>
- </li>
-</ul>
-<div ng-if="loggedIn">
- <h1>My Arrows</h1>
+<div ng-if="menuReady">
+ <h1 ng-if="loggedIn">Welcome!</h1>
+ <h1 ng-if="!loggedIn">Hello!</h1>
<ul>
- <li><a href="#/profile">Public Profile</a></li>
- <li><a class="de-link" ng-click='openAccountSettings()'>Account Settings</a></li>
+ <li>
+ {{welcomeMessage}}
+ <a class="de-link" ng-if="loggedIn" ng-click="doLogout()">logout</a>
+ <span ng-if="!loggedIn"><a class="de-link" ng-click="doLogin()">Login</a> to access your own control panel.</span>
+ </li>
</ul>
- <!--<ul>
- <li>My Uploads</li>
- <li>My Favourite Files</li>
- <li>My Favourite Uploaders</li>
- <li>My Followers</li>
- </ul>
- <br />
- <ul>
- <li>All Members</li>
- </ul>-->
- <h1>My Quota</h1>
- {{quotaRemaining}} of {{quota}} remaining
+ <div ng-if="loggedIn">
+ <h1>My Arrows</h1>
+ <ul>
+ <!--<li><a href="#/profile">Public Profile</a></li>-->
+ <li><a class="de-link" ng-click='openAccountSettings()'>Account Settings</a></li>
+ </ul>
+ <!--<ul>
+ <li>My Uploads</li>
+ <li>My Favourite Files</li>
+ <li>My Favourite Uploaders</li>
+ <li>My Followers</li>
+ </ul>
+ <br />
+ <ul>
+ <li>All Members</li>
+ </ul>-->
+ <h1>My Quota</h1>
+ {{quotaRemaining}} of {{quota}} remaining
+ </div>
+</div>
+<div ng-if="!menuReady" style="text-align:center; padding-top: 10px; padding-bottom: 10px;">
+ <img class="rotato" src="images/page_loading.png" />
+ <h2>Just a moment...</h2>
</div>
\ No newline at end of file
-webkit-transition-property: height, visibility;
-o-transition-property: height, visibility;
transition-property: height, visibility;
-}
\ No newline at end of file
+}
+
+.rotato{
+ -webkit-animation-name: rotate;
+ -webkit-animation-duration: 2s;
+ -webkit-animation-iteration-count: infinite;
+ -webkit-animation-timing-function: linear;
+ -moz-animation-name: rotate;
+ -moz-animation-duration: 2s;
+ -moz-animation-iteration-count: infinite;
+ -moz-animation-timing-function: linear;
+}
+
+@-webkit-keyframes rotate {
+ from {-webkit-transform: rotate(0deg);}
+ to {-webkit-transform: rotate(360deg);}
+}
+
+@-moz-keyframes rotate {
+ from {-moz-transform: rotate(0deg);}
+ to {-moz-transform: rotate(360deg);}
+}
--- /dev/null
+.btn-primary {
+ color: #fff;
+ background-color: #428bca;
+ border-color: #357ebd;
+}
+
+.btn {
+ display: inline-block;
+ padding: 6px 12px;
+ margin-bottom: 0;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 1.42857143;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: middle;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+
+button {
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit;
+}
+
+.btn-warning {
+ color: #fff;
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+
+.btn-xs {
+ padding: 1px 5px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
\ No newline at end of file
margin-bottom: 20px;
}
-input[type="text"], #filters select {
+input[type="text"], select {
box-sizing:content-box;
-ms-box-sizing:content-box;
-moz-box-sizing:content-box;
margin-bottom: -40px;
}
-#message-box {
+#message-box button{
+ position: absolute;
+ right: 10px;
+ top: 5px;
+}
+
+#message-box #message {
+ display: block;
text-align: center;
+}
+
+#message-box {
font-weight: bold;
margin-top: 40px;
padding: 10px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
+ position: relative;
}
#message-box .ok {
$routeProvider.
when('/',
{
- templateUrl: 'pages/index/index.html',
- controller: 'IndexController'
+ templateUrl: 'pages/packs/packs.html',
+ controller: 'PackController'
}).
when('/upload',
{
<link rel="stylesheet" href="css/animations.css"/>
<link rel="stylesheet" href="css/pager.css"/>
<link rel="stylesheet" href="css/modal.css"/>
+ <link rel="stylesheet" href="css/buttons.css"/>
<link rel="stylesheet" href="css/divinelegy.css"/>
<!-- endbuild -->
'error' : messageType == 'error',
'success' : messageType == 'success',
'hidden' : hidden}">
- <span message="message"></span> <span class="ok" ng-click="hide()">OK</span>
+ <span id="message" message="message"></span> <button class="btn btn-warning btn-xs" ng-click="hide()">X</button>
</div>
</div>
<div class="box_side alpha">
<div class="modal-header">
<h1 class="modal-title">Account Settings</h1>
+ <h2 ng-if="status">{{status}}</h2>
</div>
<div class="modal-body">
<h2>Simfiles per page</h2>
<input type="text" ng-model="simfilesPerPage"/>
+ <h2>Download Warnings</h2>
+ <select ng-model="downloadWarnings">
+ <option value="Yes">Yes</option>
+ <option value="No">No</option>
+ </select>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">Save</button>
- <button class="btn button-warning" ng-click="cancel()">Cancel</button>
+ <button class="btn" ng-click="cancel()">Close</button>
</div>
\ No newline at end of file
.controller("AccountController", ['$scope', '$modalInstance', 'UiSettingsService', function($scope, $modalInstance, UiSettingsService)
{
$scope.simfilesPerPage = UiSettingsService.getDirective('simfilesPerPage');
+ $scope.downloadWarnings = UiSettingsService.getDirective('showDownloadWarning');
$scope.ok = function()
{
UiSettingsService.setDirective('simfilesPerPage', $scope.simfilesPerPage);
+ UiSettingsService.setDirective('showDownloadWarning', $scope.downloadWarnings);
+ $scope.status = "Saved!";
};
$scope.cancel = function()
} else {
//TODO: Maybe access token should be in user obj?
var url = rockEndpoint + '' + pack.mirrors[0].uri + '?token=' + HelloService.getAccessToken(); //0th mirror will always be de
- $rootScope.$broadcast('message.warning', 'You are about to download ' + pack.title + ' which is ' + pack.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ if(UiSettingsService.getDirective('showDownloadWarning') === 'Yes')
+ {
+ $rootScope.$broadcast('message.warning', 'You are about to download ' + pack.title + ' which is ' + pack.size + '. Your current quota is ' + user.quotaRemaining + ' click <a ng-click="updateUserCache()" href="' + url + '">here</a> to confirm.');
+ } else {
+ window.location = url;
+ $rootScope.updateUserCache();
+ }
}
});
};