From ff5f463f77d7eef492d3ae926ce65cdfdb45dfdb Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Mon, 5 Sep 2016 11:48:35 +0200 Subject: Actualy fixed safari --- public/javascripts/bundle.js | 48 ++++++++++++++++++++++++------------------ public/javascripts/getUsers.js | 48 ++++++++++++++++++++++++------------------ 2 files changed, 56 insertions(+), 40 deletions(-) (limited to 'public') diff --git a/public/javascripts/bundle.js b/public/javascripts/bundle.js index c2a9af8..b15380a 100644 --- a/public/javascripts/bundle.js +++ b/public/javascripts/bundle.js @@ -96739,7 +96739,7 @@ const cheerio = require('cheerio') const request = Promise.promisify(require('request')) module.exports = function () { - return new Promise((resolve, reject) => { + return new Promise(function (resolve, reject) { request(`http://${window.location.host}/meetingpointProxy/Roosters-AL%2Fdoc%2Fdagroosters%2Fframes%2Fnavbar.htm`) .then(function (page) { page = page.body @@ -96752,26 +96752,34 @@ module.exports = function () { const items = regexs.map(regex => scriptText.match(regex)[1].split(',').map(item => item.replace(/"/g, ''))) resolve([] - .concat(items[0].map((item, index) => ({ - type: 'c', - value: item, - index: index - }))) - .concat(items[1].map((item, index) => ({ - type: 't', - value: item, - index: index - }))) - .concat(items[2].map((item, index) => ({ - type: 'r', - value: item, - index: index + .concat(items[0].map(function (item, index) { + return { + type: 'c', + value: item, + index: index + } + })) + .concat(items[1].map(function (item, index) { + return { + type: 't', + value: item, + index: index + } + })) + .concat(items[2].map(function (item, index) { + return { + type: 'r', + value: item, + index: index + } + })) + .concat(items[3].map(function (item, index) { + return { + type: 's', + value: item, + index: index + } }))) - .concat(items[3].map((item, index) => ({ - type: 's', - value: item, - index: index - })))) }) }) } diff --git a/public/javascripts/getUsers.js b/public/javascripts/getUsers.js index fb54659..34f7b3b 100644 --- a/public/javascripts/getUsers.js +++ b/public/javascripts/getUsers.js @@ -3,7 +3,7 @@ const cheerio = require('cheerio') const request = Promise.promisify(require('request')) module.exports = function () { - return new Promise((resolve, reject) => { + return new Promise(function (resolve, reject) { request(`http://${window.location.host}/meetingpointProxy/Roosters-AL%2Fdoc%2Fdagroosters%2Fframes%2Fnavbar.htm`) .then(function (page) { page = page.body @@ -16,26 +16,34 @@ module.exports = function () { const items = regexs.map(regex => scriptText.match(regex)[1].split(',').map(item => item.replace(/"/g, ''))) resolve([] - .concat(items[0].map((item, index) => ({ - type: 'c', - value: item, - index: index + .concat(items[0].map(function (item, index) { + return { + type: 'c', + value: item, + index: index + } + })) + .concat(items[1].map(function (item, index) { + return { + type: 't', + value: item, + index: index + } + })) + .concat(items[2].map(function (item, index) { + return { + type: 'r', + value: item, + index: index + } + })) + .concat(items[3].map(function (item, index) { + return { + type: 's', + value: item, + index: index + } }))) - .concat(items[1].map((item, index) => ({ - type: 't', - value: item, - index: index - }))) - .concat(items[2].map((item, index) => ({ - type: 'r', - value: item, - index: index - }))) - .concat(items[3].map((item, index) => ({ - type: 's', - value: item, - index: index - })))) }) }) } -- cgit v1.1