summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html1
-rw-r--r--js/index.js45
2 files changed, 45 insertions, 1 deletions
diff --git a/index.html b/index.html
index 94ef7e9..92b68d2 100644
--- a/index.html
+++ b/index.html
@@ -48,7 +48,6 @@
<select id="themeselect" data-mini="true">
<option value="a">Hell</option>
<option value="b">Dunkel</option>
- <option value="c">Gold</option>
<option value="d">Pink</option>
</select>
diff --git a/js/index.js b/js/index.js
index a6923dd..a0c838a 100644
--- a/js/index.js
+++ b/js/index.js
@@ -18,6 +18,35 @@
version = '0.9.1_beta';
+function istPremium(benutzer, key){ // Supersicherer Keygenerator :P Inspiriert von kryptochef.de
+ sollKey = '';
+
+ switch(benutzer.length % 10){ // Anzahl Zeichen ausschreiben
+ case 0: sollKey = 'NULL'; break;
+ case 1: sollKey = 'EINS'; break;
+ case 2: sollKey = 'ZWEI'; break;
+ case 3: sollKey = 'DREI'; break;
+ case 4: sollKey = 'VIER'; break;
+ case 5: sollKey = 'FUNF'; break;
+ case 6: sollKey = 'SECHS'; break;
+ case 7: sollKey = 'SIEBEN'; break;
+ case 8: sollKey = 'ACHT'; break;
+ case 9: sollKey = 'NEUN'; break;
+ }
+
+ sollKey = sollKey.replace(/[A-Z]/g, function(s){
+ return String.fromCharCode(s.charCodeAt(0) + (s < 'N' ? 13 : -13)); // ROT13
+ });
+
+ sollKey = sollKey + Math.round(benutzer.length * 3.14); // Eine Zahl anfügen
+
+ if(sollKey === key){
+ return true;
+ }else{
+ return false;
+ }
+}
+
function updateCheck(){
var request = $.ajax({
url: 'http://klimaag.***REMOVED***/app/www/knockout.html'
@@ -112,6 +141,7 @@ $('#mainpage').on('pagebeforeshow', function(){
var additionalClasses = localStorage.getItem('classes');
var notifyDay = localStorage.getItem('notifyday');
var notifyDate = localStorage.getItem('notifydate');
+ var premium = localStorage.getItem('premium');
var apptheme = localStorage.getItem('apptheme');
if(dntrack === null || dntrack.length === 0){
@@ -134,6 +164,13 @@ $('#mainpage').on('pagebeforeshow', function(){
}
$('#notifydate').val(notifyDate).textinput('refresh');
+ if(premium === null || premium.length === 0){
+ premium = false;
+ }
+ if(premium === true){
+ $('#themeselect').append('<option value="c">Gold</option>').selectmenu('refresh');
+ }
+
if(apptheme === null || apptheme.length === 0){
apptheme = 'a';
}
@@ -633,6 +670,14 @@ function getOverview(link){
$('#error_passwd').show('fast');
onfail();
return 0;
+ }else{
+ var benutzername = getUserData()[0];
+ var key = $('#addclass').val().split('\n')[0]; // erste zusätzliche Klasse
+
+ if(istPremium(benutzername, key)){
+ localStorage.setItem('premium', true);
+ console.log('Premium freigeschaltet');
+ }
}
as.each(function(index, element){