summaryrefslogtreecommitdiff
path: root/js/index.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-03-15 17:08:39 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2016-08-15 19:46:43 +0200
commitd4157dfc3c074f4b5b986f1e2ec1fca66dbe5a4e (patch)
treef7f92fb4763de7d17c4360fc7ba24c0a2d760efc /js/index.js
parentf8220bbcc4cb744b4fc1b86363e1b8fba15d1bf1 (diff)
downloadwvs-vplan-d4157dfc3c074f4b5b986f1e2ec1fca66dbe5a4e.tar.gz
wvs-vplan-d4157dfc3c074f4b5b986f1e2ec1fca66dbe5a4e.zip
ermögliche das Finden des VPlans durch RE
Diffstat (limited to 'js/index.js')
-rw-r--r--js/index.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/js/index.js b/js/index.js
index c4af8db..0be25f9 100644
--- a/js/index.js
+++ b/js/index.js
@@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-function get_overview(){
+function get_overview(link){
var request = $.ajax({
type: "GET",
- url: "http://***REMOVED***/moodle/course/view.php?id=2"
+ url: link
});
request.done(function(msg){
@@ -48,9 +48,13 @@ function login(){
url: "https://***REMOVED***/moodle/login/index.php",
data: {username: username, password: password}
});
- request.done(function(msg){
- console.log('Login-Request erfolgreich');
- get_overview();
+ request.done(function(result){
+ 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);
+
+ get_overview(link);
});
request.fail(function(jqXHR, textStatus){