Skip to content

Commit

Permalink
faq contents and floating sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mesh0000 committed Mar 31, 2017
1 parent f272de4 commit b16f215
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 47 deletions.
8 changes: 8 additions & 0 deletions app/app.css
Expand Up @@ -218,4 +218,12 @@ md-dialog .login{

.power a.alt:hover {
color: #f2ff2f;
}

.floating {
position: fixed;
}

.theironfist {
cursor: pointer;
}
63 changes: 34 additions & 29 deletions app/app.js
Expand Up @@ -14,14 +14,14 @@ var app = angular.module('poolui', [
'utils.xhr',
'n3-line-chart',
'angular-page-visibility'
]).config(['$locationProvider', '$routeProvider', '$mdThemingProvider', function($locationProvider, $routeProvider, $mdThemingProvider) {
$locationProvider.hashPrefix('')
;
$mdThemingProvider.theme('default')
.primaryPalette('grey')
.accentPalette('light-blue');

$routeProvider
]).config(['$locationProvider', '$routeProvider', '$mdThemingProvider', function($locationProvider, $routeProvider, $mdThemingProvider) {
$locationProvider.hashPrefix('')
;
$mdThemingProvider.theme('default')
.primaryPalette('grey')
.accentPalette('light-blue');

$routeProvider
.when('/home', {
templateUrl: 'user/home/home.html',
controller: 'HomeCtrl',
Expand Down Expand Up @@ -69,16 +69,15 @@ var app = angular.module('poolui', [
});


$routeProvider.otherwise({redirectTo: '/home'});

}]);

app.controller('AppCtrl', function($scope, $window, $route, $interval, $mdDialog, dataService, timerService, addressService, $mdSidenav, $mdMedia, $localStorage, ngAudio, GLOBALS){
$scope.GLOBALS = GLOBALS;
var appCache = window.applicationCache;
$scope.$storage = $localStorage;
app.controller('AppCtrl', function($scope, $rootScope, $location, $route, $routeParams, $anchorScroll, $window, $interval, $mdDialog, dataService, timerService, addressService, $mdSidenav, $mdMedia, $localStorage, ngAudio, GLOBALS){
$scope.GLOBALS = GLOBALS;
var appCache = window.applicationCache;
$scope.$storage = $localStorage;

$scope.poolList = ["pplns", "pps", "solo"];
$scope.poolList = ["pplns", "pps", "solo"];
$scope.poolStats = {}; // All Pool stats
$scope.addrStats = {}; // All tracked addresses
$scope.lastBlock = {};
Expand Down Expand Up @@ -129,11 +128,11 @@ app.controller('AppCtrl', function($scope, $window, $route, $interval, $mdDialog
// ------- Miner Login and auth
$scope.minerLogin = function (ev) {
$mdDialog.show({
controller: "LoginCtrl",
templateUrl: 'user/home/login.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
controller: "LoginCtrl",
templateUrl: 'user/home/login.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
fullscreen: !$scope.menuOpen // Only for -xs, -sm breakpoints.
})
.then(function(answer) {
Expand All @@ -145,12 +144,12 @@ app.controller('AppCtrl', function($scope, $window, $route, $interval, $mdDialog

$scope.minerConsole = function (ev) {
$mdDialog.show({
locals: $scope.config,
controller: "ConsoleCtrl",
templateUrl: 'user/home/console.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
locals: $scope.config,
controller: "ConsoleCtrl",
templateUrl: 'user/home/console.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
fullscreen: !$scope.menuOpen // Only for -xs, -sm breakpoints.
})
.then(function(answer){
Expand Down Expand Up @@ -200,6 +199,12 @@ app.controller('AppCtrl', function($scope, $window, $route, $interval, $mdDialog
});
}

// For FAQ
$rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
$location.hash($routeParams.scrollTo);
$anchorScroll();
});

// Start doing things
loadOnce();
loadData();
Expand All @@ -212,9 +217,9 @@ app.controller('AppCtrl', function($scope, $window, $route, $interval, $mdDialog

// Start address tracking servuce after starting timer, only one callback supported at a time
addressService.start(function(addrStats) {
$scope.addrStats = addrStats;
updateHashRate(addrStats);
playSiren();
}
$scope.addrStats = addrStats;
updateHashRate(addrStats);
playSiren();
}
);
});
15 changes: 8 additions & 7 deletions app/user/help/faq.html
Expand Up @@ -6,7 +6,7 @@
<md-card-content>
<div ng-repeat="(topic,subject) in faq">
<p class="md-title">{{topic}}</p>
<div ng-repeat="question in subject">
<div ng-repeat="(index, question) in subject" id="{{topic}}_{{index}}">
<p class="md-subhead"><b>{{question.title}}</b></p>
<p class="md-subhead" ng-bind-html="question.answer"></p>
<div ng-if="question.media">
Expand All @@ -21,12 +21,13 @@
</div>
</md-card-content>
</md-card>
<md-card flex-gt-md="20" flex md-auto-height>
<md-card-title>
<span class="md-headline">Contents</span>
</md-card-title>
<md-card-content>

<md-card flex-gt-md="20" flex>
<md-card-content class="floating">
<div class="md-headline">Contents</div>
<div ng-repeat="(topic,subject) in faq">
<p class="md-title">{{topic}}</p>
<p class="md-subhead" ng-repeat="(index, q) in subject"><a class="theironfist" ng-click="goto(topic, index)">{{q.title}}</p>
</div>
</md-card-content>
</md-card>
</div>
34 changes: 23 additions & 11 deletions app/user/help/faq.js
@@ -1,8 +1,20 @@
'use strict';

app.controller('FAQCtrl', function($scope, $sce, dataService) {
app.controller('FAQCtrl', function($scope, $location, $anchorScroll, $sce, dataService) {
// BooHoo:p
$scope.selected = [];
$scope.goto = function(topic, index) {
var newHash = topic + '_' + index;
if ($location.hash() !== newHash) {
// set the $location.hash to `newHash` and
// $anchorScroll will automatically scroll to it
$location.hash(newHash);
} else {
// call $anchorScroll() explicitly,
// since $location.hash hasn't changed
$anchorScroll();
}
};

$scope.faq = {
"General" : [
{
Expand Down Expand Up @@ -31,7 +43,11 @@ app.controller('FAQCtrl', function($scope, $sce, dataService) {
answer: $sce.trustAsHtml("If you are mining on a small scale, it becomes extremely hard and unpredictable to earn a stable profit on your mining income. Pool mining gives you the opportunity to join a group of miners and share earnings for a consistent payout.")
},
{
title: "What is Solo mining ?",
title: "What is PPLNS ?",
answer: $sce.trustAsHtml("")
},
{
title: "What is SOLO mining ?",
answer: $sce.trustAsHtml("Solo mining is the opposite of pool mining. You essentially submit your shares directly to the blockchain, which is the most profitable method if you run your own farm.")
},
{
Expand Down Expand Up @@ -61,25 +77,21 @@ app.controller('FAQCtrl', function($scope, $sce, dataService) {
answer: $sce.trustAsHtml("Your IP gets banned if you submit invalid shares to the pool server. This usually happens if your card is overclocked or unstable.<br/><br/> The ban is temporary and usually cleared in xx mins. You could also contact your pool admin and request an unban.")
},
{
title: "How Fixed / Variable Difficulty works.",
title: "How Fixed / Variable Difficulty works",
answer: $sce.trustAsHtml("When you select a pool port, the starting difficulty only represents your initial setting. As soon as your miner starts submitting shares the server will try to adjust your difficulty to reflect your hash rate.<br/><br/>This assures you not creating too many or too few requests to your server optimizing bandwidth consumption and server loads.<br/><br/>Optionally you could set a fixed difficulty via your miner command line options, though if you set a difficulty too high, you could exceed the 60 seconds job limit and loose earnings.")
},
{
title: "Can i mine other alt coins ?",
title: "Can i mine other coins ?",
answer: $sce.trustAsHtml("Not yet, but we may add more soon. Follow <a href='https://github.com/Snipa22/nodejs-pool/issues/27' target='_new'>https://github.com/Snipa22/nodejs-pool/issues/27</a>.")
}
],
"Mining":[
{
title: "Mining Hardware ?",
title: "Hardware ?",
answer: $sce.trustAsHtml("Monero is an AISC resistant cryptocurrency, that means it should be cost prohibitive to mine monero with an FGPA/AISC allowing desktop grade hardware to keep its share in the network hashrate and earnings.<br/><br/><a href='http://monerobechmarks.byethost5.com/' target='_new'>http://monerobechmarks.byethost5.com/</a> is a list of community collected hashrate results ordered by hardware, but be careful as some entries may not be accurate.")
},
{
title: "",
answer: $sce.trustAsHtml("")
},
{
title: "Mining Software ?",
title: "Software ?",
answer: $sce.trustAsHtml("Read -- <a href='#/help/getting_started'>Getting Started</a>.")
}
]
Expand Down

0 comments on commit b16f215

Please sign in to comment.