diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-03-29 11:53:02 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-08-15 19:46:47 +0200 |
| commit | a8a8407a0cfe556e604d10f806a55b665e3e0f07 (patch) | |
| tree | 6404e43bd54c36d8c6f2af9e657beaf9df1c065b | |
| parent | 6c08d1129e50afaf1cfd3f9839996e56e51853f8 (diff) | |
| download | wvs-vplan-a8a8407a0cfe556e604d10f806a55b665e3e0f07.tar.gz wvs-vplan-a8a8407a0cfe556e604d10f806a55b665e3e0f07.zip | |
benutze durchgängig dieselben Quotes
| -rw-r--r-- | index.html | 2 | ||||
| -rw-r--r-- | js/index.js | 52 |
2 files changed, 27 insertions, 27 deletions
@@ -33,7 +33,7 @@ <h1>WvS VPlan</h1> </div> <div role="main" class="ui-content"> - <a id='lnklogin' href='#loginpopup' data-rel="popup" data-role="button" data-position-to="window" data-inline="true" style="display:none;"></a> + <a id="lnklogin" href="#loginpopup" data-rel="popup" data-role="button" data-position-to="window" data-inline="true" style="display:none;"></a> <div data-role="popup" id="loginpopup" data-theme="a" data-dismissible> <form style="padding:10px 20px;" id="loginform" action="javascript:login()"> diff --git a/js/index.js b/js/index.js index ebb5b0c..5a06d7b 100644 --- a/js/index.js +++ b/js/index.js @@ -70,7 +70,7 @@ function renderPage(div, pdf, pageNumber, callback){ } function render_pdf(viewerstr){ - console.log("Rendere PDF: " + $(viewerstr).attr('data-plan-url') + " (" + viewerstr + ")"); + console.log('Rendere PDF: ' + $(viewerstr).attr('data-plan-url') + ' (' + viewerstr + ')'); PDFJS.getDocument($(viewerstr).attr('data-plan-url')).then(function(pdf){ var viewer = document.getElementById(viewerstr.replace(/#/, '')); @@ -85,9 +85,9 @@ function render_pdf(viewerstr){ } function fail(text){ - $('#error_noconn').show("fast"); - $('#loader').hide("slow"); - console.log("Fehler: " + text.toString()); + $('#error_noconn').show('fast'); + $('#loader').hide('slow'); + console.log('Fehler: ' + text.toString()); } function download_pdf(link, id){ @@ -99,8 +99,8 @@ function download_pdf(link, id){ fileSystem.root.getFile( filename, {create: true, exclusive: false}, function gotFileEntry(fileEntry){ - var sPath = "/storage/sdcard0" + fileEntry.fullPath; // !!! TODO Unterstützung anderer Geräte - console.log("Pfad: " + sPath); + var sPath = '/storage/sdcard0' + fileEntry.fullPath; // !!! TODO Unterstützung anderer Geräte + console.log('Pfad: ' + sPath); var fileTransfer = new FileTransfer(); fileEntry.remove(); @@ -108,16 +108,16 @@ function download_pdf(link, id){ link, sPath, function(theFile){ - console.log("Download fertig: " + theFile.toURL()); + console.log('Download fertig: ' + theFile.toURL()); $('#pdf-' + id).attr('data-plan-url', theFile.toURL()); - if(location.href.indexOf("page-") == -1){ - $('#loader').hide("fast"); - $.mobile.changePage("#page-vplan-" + id); + if(location.href.indexOf('page-') == -1){ + $('#loader').hide('fast'); + $.mobile.changePage('#page-vplan-' + id); } }, function(error){ - console.log("Fehler: " + error.source + " - "+ error.target + " - " + error.code); + console.log('Fehler: ' + error.source + ' - '+ error.target + ' - ' + error.code); } ); }, @@ -128,12 +128,12 @@ function download_pdf(link, id){ function get_plan(link, id){ var request = $.ajax({ - type: "GET", + type: 'GET', url: link }); request.done(function(result){ - var pdf_re = new RegExp("(http://***REMOVED***\\.de/moodle/pluginfile\\.php/\\d+/mod_resource/content/\\d+.*?\\.pdf)"); + var pdf_re = new RegExp('(http://***REMOVED***\\.de/moodle/pluginfile\\.php/\\d+/mod_resource/content/\\d+.*?\\.pdf)'); var pdflink = pdf_re.exec(result)[1]; console.log('Plan gefunden: ' + pdflink); @@ -146,12 +146,12 @@ function get_plan(link, id){ function get_overview(link){ var request = $.ajax({ - type: "GET", + type: 'GET', url: link }); request.done(function(result){ - var plans_re = new RegExp("window\\.open\\('(http://***REMOVED***\\.de/moodle/mod/resource/view\\.php\\?id=\\d+)&redirect=1'\\)", "g"); + var plans_re = new RegExp('window\\.open\\('(http://***REMOVED***\\.de/moodle/mod/resource/view\\.php\\?id=\\d+)&redirect=1'\\)', 'g'); var link; // Pages für Vertretungsplände erstellen und pageshow-Events festlegen @@ -173,15 +173,15 @@ function get_overview(link){ if(j + 1 < resultl){ $('#page-vplan-' + j).on('swipeleft', function(event){ - console.log("Wisch links"); - $.mobile.changePage("#page-vplan-" + (parseInt($('.ui-page-active').attr('id').match(/\d+/)[0]) + 1)); + console.log('Wisch links'); + $.mobile.changePage('#page-vplan-' + (parseInt($('.ui-page-active').attr('id').match(/\d+/)[0]) + 1)); }); } if(j - 1 >= 0){ $('#page-vplan-' + j).on('swiperight', function(event){ - console.log("Wisch rechts"); - $.mobile.changePage("#page-vplan-" + (parseInt($('.ui-page-active').attr('id').match(/\d+/)[0]) - 1)); + console.log('Wisch rechts'); + $.mobile.changePage('#page-vplan-' + (parseInt($('.ui-page-active').attr('id').match(/\d+/)[0]) - 1)); }); } @@ -206,20 +206,20 @@ function get_overview(link){ } function login(){ - var username = encodeURIComponent($("#username").val()); - var password = encodeURIComponent($("#password").val()); - var params = "username=" + username + "&password=" + password; + var username = encodeURIComponent($('#username').val()); + var password = encodeURIComponent($('#password').val()); + var params = 'username=' + username + '&password=' + password; var request = $.ajax({ - type: "POST", - url: "https://***REMOVED***/moodle/login/index.php", + type: 'POST', + url: 'https://***REMOVED***/moodle/login/index.php', data: {username: username, password: password} }); - $('#loader').show("fast"); + $('#loader').show('fast'); request.done(function(result){ - var vertretungs_re = new RegExp("title=\"Vertretungsplan\" href=\"(http://***REMOVED***\\.de/moodle/course/view\\.php\\?id=\\d+)"); + var vertretungs_re = new RegExp('title="Vertretungsplan" href="(http://***REMOVED***\\.de/moodle/course/view\\.php\\?id=\\d+)"'); var link = vertretungs_re.exec(result)[1]; console.log('Login-Request erfolgreich: ' + link); |
