doing some reshuffling in public/src

public/src/admin and public/src/client; also some cleanup in
src/meta/js, no need to filter out admin files anymore
This commit is contained in:
psychobunny
2014-10-08 15:36:47 -04:00
parent 006322f386
commit b51c90dcb3
53 changed files with 6848 additions and 6 deletions

View File

@@ -0,0 +1,39 @@
"use strict";
/* global define, app, RELATIVE_PATH */
define('forum/login', function() {
var Login = {};
Login.init = function() {
var errorEl = $('#login-error-notify'),
submitEl = $('#login'),
formEl = $('#login-form');
submitEl.on('click', function(e) {
e.preventDefault();
if (!$('#username').val() || !$('#password').val()) {
translator.translate('[[error:invalid-username-or-password]]', function(translated) {
errorEl.find('p').text(translated)
errorEl.show();
});
} else {
errorEl.hide();
if (!submitEl.hasClass('disabled')) {
submitEl.addClass('disabled');
formEl.submit();
}
}
});
$('#login-error-notify button').on('click', function(e) {
e.preventDefault();
errorEl.hide();
});
$('#content #username').focus();
};
return Login;
});