summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.xml6
-rw-r--r--www/js/index.js47
2 files changed, 28 insertions, 25 deletions
diff --git a/config.xml b/config.xml
index e1749e8..7bd6246 100644
--- a/config.xml
+++ b/config.xml
@@ -41,13 +41,13 @@
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.network-information" />
- <icon src="icon.png" />
+ <icon src="res/icons/80.png" />
<icon src="res/icons/36-ldpi.png" gap:platform="android" gap:density="ldpi" />
<icon src="res/icons/48-mdpi.png" gap:platform="android" gap:density="mdpi" />
<icon src="res/icons/72-hdpi.png" gap:platform="android" gap:density="hdpi" />
<icon src="res/icons/96-xhdpi.png" gap:platform="android" gap:density="xhdpi" />
- <icon src="res/icons/blackberry/icon-80.png" gap:platform="blackberry" />
- <icon src="res/icons/blackberry/icon-80.png" gap:platform="blackberry" gap:state="hover"/>
+ <icon src="res/icons/80.png" gap:platform="blackberry" />
+ <icon src="res/icons/80.png" gap:platform="blackberry" gap:state="hover"/>
<icon src="res/icons/57.png" gap:platform="ios" width="57" height="57" />
<icon src="res/icons/72-hdpi.png" gap:platform="ios" width="72" height="72" />
<icon src="res/icons/57-2x.png" gap:platform="ios" width="114" height="114" />
diff --git a/www/js/index.js b/www/js/index.js
index 7d2cf5c..978a639 100644
--- a/www/js/index.js
+++ b/www/js/index.js
@@ -13,7 +13,7 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
version = '1.0.1';
@@ -49,7 +49,7 @@ function istPremium(benutzer, key){ // Supersicherer Keygenerator :P Inspiriert
function updateCheck(){
var request = $.ajax({
- url: 'http://klimaag.***REMOVED***/app/www/knockout.html',
+ url: 'https://klimaag.***REMOVED***/app/www/knockout.html',
cache: false
});
@@ -90,15 +90,6 @@ function updateCheck(){
request.fail(fail);
}
-function track(what){
- _paq.push(['setCustomUrl', what]);
- _paq.push(['trackPageView', what]);
-}
-
-function trackPlan(vdate){
- track('plan/' + vdate.format('YYYY/MM/DD'));
-}
-
$('#settingspanel').change(function(){
localStorage.setItem('dntrack', $('#dntflip').val());
localStorage.setItem('classes', $('#addclass').val().toUpperCase());
@@ -129,6 +120,21 @@ $('#mainpage').on('swiperight', function(){
$('#settingspanel').panel('open');
});
+String.prototype.hashCode = function() {
+ var hash = 0, i, chr, len;
+ if (this.length === 0) return hash;
+ for (i = 0, len = this.length; i < len; i++) {
+ chr = this.charCodeAt(i);
+ hash = ((hash << 5) - hash) + chr;
+ hash |= 0; // Convert to 32bit integer
+ }
+ return hash;
+};
+
+function uglyUsername(user) {
+ return Math.abs(user.hashCode()).toString(16);
+}
+
var _paq = _paq || [];
$('#mainpage').on('pagebeforeshow', function(){
/* Versionsnummer zeigen */
@@ -138,7 +144,7 @@ $('#mainpage').on('pagebeforeshow', function(){
moment.lang('de');
/* Nutzungsstatistiken */
- _paq.push(['setTrackerUrl', 'http://klimaag.***REMOVED***/piwik/piwik.php']); // Https wäre schön.
+ _paq.push(['setTrackerUrl', 'https://klimaag.***REMOVED***/piwik/piwik.php']);
_paq.push(['setSiteId', 5]);
console.log('Piwik initialisiert');
@@ -207,7 +213,6 @@ $('#mainpage').on('pagebeforeshow', function(){
/* Piwik initialisieren */
_paq.push(['setCustomVariable', 4, 'DNT', dntrack, 'visit']);
- _paq.push(['setDoNotTrack', Boolean(dntrack)]);
});
// Login-Popup beim Start
@@ -218,10 +223,12 @@ document.addEventListener('deviceready', function(){
}
/* los geht's */
- _paq.push(['setCustomVariable', 1, 'Modell', device.model, 'visit']);
- _paq.push(['setCustomVariable', 2, 'Version', device.version, 'visit']);
- _paq.push(['setCustomVariable', 3, 'Appversion', version, 'visit']);
- track('load');
+ if(! $('#dntflip').val()) {
+ _paq.push(['setCustomVariable', 1, 'Modell', device.model, 'visit']);
+ _paq.push(['setCustomVariable', 2, 'Version', device.version, 'visit']);
+ _paq.push(['setCustomVariable', 3, 'Appversion', version, 'visit']);
+ }
+ _paq.push(['trackPageView', 'load']);
fillForm();
@@ -725,9 +732,6 @@ function neuesPlanTab(fname){
$('#vplannavbar').navbar('destroy');
$('#vplannavbar ul').append('<li><a href="#' + name + '">' + name.replace(/_/g, '.') + '</a></li>');
- $('#vplannavbar ul li:last').click(function(){
- trackPlan(vdate);
- });
$('#vplannavbar').navbar();
@@ -862,8 +866,7 @@ function loggedIn(resultHtml){
$('#error_passwd').show('fast');
return;
}
-
- _paq.push(['setUserId', username]);
+ _paq.push(['setUserId', uglyUsername(username)]);
localStorage.setItem('overviewlink', link);
console.log('Eingeloggt');
getOverview(link);