aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/utils.js
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-12-30 21:51:07 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-12-30 21:51:07 +1300
commitbc8687deb5f0f9273fc771e79b070f3b49e39fed (patch)
tree07e67eb7c9f732c0419e57b337c31d2372d12cff /web/src/js/utils.js
parentd2c7411f065435e2b2b62a70447cb01895fe69d1 (diff)
downloadmitmproxy-bc8687deb5f0f9273fc771e79b070f3b49e39fed.tar.gz
mitmproxy-bc8687deb5f0f9273fc771e79b070f3b49e39fed.tar.bz2
mitmproxy-bc8687deb5f0f9273fc771e79b070f3b49e39fed.zip
Basic conversion: browserified web app now works.
Diffstat (limited to 'web/src/js/utils.js')
-rw-r--r--web/src/js/utils.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/web/src/js/utils.js b/web/src/js/utils.js
index a8565243..0371810c 100644
--- a/web/src/js/utils.js
+++ b/web/src/js/utils.js
@@ -1,3 +1,6 @@
+var $ = require("jquery");
+
+
var Key = {
UP: 38,
DOWN: 40,
@@ -88,7 +91,7 @@ function getCookie(name) {
var xsrf = $.param({_xsrf: getCookie("_xsrf")});
//Tornado XSRF Protection.
-jQuery.ajaxPrefilter(function (options) {
+$.ajaxPrefilter(function (options) {
if (["post", "put", "delete"].indexOf(options.type.toLowerCase()) >= 0 && options.url[0] === "/") {
if (options.data) {
options.data += ("&" + xsrf);
@@ -103,4 +106,11 @@ $(document).ajaxError(function (event, jqXHR, ajaxSettings, thrownError) {
console.error(message, arguments);
EventLogActions.add_event(thrownError + ": " + message);
window.alert(message);
-}); \ No newline at end of file
+});
+
+module.exports = {
+ EventEmitter: EventEmitter,
+ formatSize: formatSize,
+ formatTimeDelta: formatTimeDelta,
+ formatTimeStamp: formatTimeStamp
+}; \ No newline at end of file