summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-02-06 22:40:56 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-02-12 12:38:31 +0200
commit0caa116c914a4969556b4d671ffeadd8b9b12cc6 (patch)
treeac4236342fb1536350f9e6903e6d057172f579f4 /web
parent1dc9c3a59137b1cb9a38669938ba865154100c64 (diff)
downloadacf2-0caa116c914a4969556b4d671ffeadd8b9b12cc6.tar.bz2
acf2-0caa116c914a4969556b4d671ffeadd8b9b12cc6.tar.xz
web client: error module
Diffstat (limited to 'web')
-rw-r--r--web/client.js9
-rw-r--r--web/error.js12
2 files changed, 14 insertions, 7 deletions
diff --git a/web/client.js b/web/client.js
index d289890..310c869 100644
--- a/web/client.js
+++ b/web/client.js
@@ -19,6 +19,7 @@ requirejs.config({
require(
[
+ "acf2/error",
"acf2/path",
"acf2/statusbar",
"acf2/transaction",
@@ -29,7 +30,7 @@ require(
"jquery-blockui",
"jquery-ui/sortable"
],
- function(pth, statusBar, txnMgr, type, $, _) {
+ function(formatError, pth, statusBar, txnMgr, type, $, _) {
$("#login").submit(function() {
$.ajax("/login", {
@@ -44,12 +45,6 @@ require(
xhr.getResponseHeader("X-ACF-Save-Required") == "1"
);
- function formatError(msg, xhr) {
- msg += " " + xhr.statusCode().status;
- if (xhr.responseText) msg += ': ' + xhr.responseText;
- return msg;
- }
-
function href() {
return $("<a>").attr({href: "javascript:void(0);"});
diff --git a/web/error.js b/web/error.js
new file mode 100644
index 0000000..c5c184a
--- /dev/null
+++ b/web/error.js
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2012-2014 Kaarle Ritvanen
+ * See LICENSE file for license details
+ */
+
+define(function() {
+ return function(msg, xhr) {
+ msg += " " + xhr.statusCode().status;
+ if (xhr.responseText) msg += ': ' + xhr.responseText;
+ return msg;
+ }
+});