server/java/renkan-web/src/main/webapp/static/js/admin_form.js
author ymh <ymh.work@gmail.com>
Mon, 21 Jul 2014 14:48:01 +0200
changeset 316 242510015401
parent 309 server/renkan-web/src/main/webapp/static/js/admin_form.js@0c3e6e66881f
permissions -rw-r--r--
move java server project to sub folder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
222
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
function showformErrors(errors) {
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
    $(".form-error").remove();
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
    
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
    $.each(errors,function(k,v){
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
        $("#"+k).after('<div class="form-error">'+v+'</div>');
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    });
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    $(".form-error").effect("highlight", {}, 1500);
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
}
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
function formatJson(jsonText, tabSize) {
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
    var obj = JSON.parse(jsonText);
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    return JSON.stringify(obj, undefined, tabSize);
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
}
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
function compactJson(jsonText) {
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
    var obj = JSON.parse(jsonText);
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    return JSON.stringify(obj);
6ac00231ee34 Manage users. (not passwords)
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
}