1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 16:04:24 +03:00
ifhub.club/application/frontend/common/js/admin.js
2013-10-02 21:05:44 +07:00

48 lines
1.1 KiB
JavaScript

/**
* Админка
*
* @module ls/admin
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
var ls = ls || {};
ls.admin = (function ($) {
this.addCategoryBlog = function(form) {
var url = aRouter.admin+'blogcategory/add/';
ls.ajax.submit(url, form, function(result) {
if (typeof(form)=='string') {
form=$('#'+form);
}
if (result.bStateError) {
ls.msg.error(result.sMsgTitle,result.sMsg);
} else {
$(form.parents('.modal-ajax')).jqmHide();
window.location.href=window.location.href;
}
}.bind(this));
};
this.editCategoryBlog = function(form) {
var url = aRouter.admin+'blogcategory/edit/';
ls.ajax.submit(url, form, function(result) {
if (typeof(form)=='string') {
form=$('#'+form);
}
if (result.bStateError) {
ls.msg.error(result.sMsgTitle,result.sMsg);
} else {
$(form.parents('.modal-ajax')).jqmHide();
window.location.href=window.location.href;
}
}.bind(this));
};
return this;
}).call(ls.admin || {},jQuery);