', {'class': 'comment-wrapper', id: 'comment_wrapper_id_'+idComment}).html(sHtml);
- if (idCommentParent) {
- $('#comment_wrapper_id_'+idCommentParent).append(newComment);
- } else {
- $('#comments').append(newComment);
- }
- }
-
-
- // Удалить/восстановить комментарий
- this.toggle = function(obj, commentId) {
- ls.ajax(aRouter['ajax']+'comment/delete/', { idComment: commentId }, function(result){
- if (!result) {
- ls.msg.error('Error','Please try again later');
- }
- if (result.bStateError) {
- ls.msg.error(null,result.sMsg);
- } else {
- ls.msg.notice(null,result.sMsg);
-
- $('#comment_id_'+commentId).removeClass(this.options.classes.comment_self+' '+this.options.classes.comment_new+' '+this.options.classes.comment_deleted+' '+this.options.classes.comment_current);
- if (result.bState) {
- $('#comment_id_'+commentId).addClass(this.options.classes.comment_deleted);
- }
- $(obj).text(result.sTextToggle);
- }
- }.bind(this));
- }
-
-
- // Предпросмотр комментария
- this.preview = function() {
- if (this.options.wysiwyg) {
- $("#form_comment_text").val(tinyMCE.activeEditor.getContent());
- }
- if ($("#form_comment_text").val() == '') return;
- $("#comment_preview_"+this.iCurrentShowFormComment).css('display', 'block');
- ls.tools.textPreview('form_comment_text', false, 'comment_preview_'+this.iCurrentShowFormComment);
- }
-
-
- // Устанавливает число новых комментариев
- this.setCountNewComment = function(count) {
- if (count > 0) {
- $('#new_comments_counter').css('display','block').text(count);
- } else {
- $('#new_comments_counter').text(0).hide();
- }
- }
-
-
- // Вычисляет кол-во новых комментариев
- this.calcNewComments = function() {
- var aCommentsNew = $('.'+this.options.classes.comment+'.'+this.options.classes.comment_new);
- this.setCountNewComment(aCommentsNew.length);
- $.each(aCommentsNew,function(k,v){
- this.aCommentNew.push(parseInt($(v).attr('id').replace('comment_id_','')));
- }.bind(this));
- }
-
-
- // Переход к следующему комментарию
- this.goToNextComment = function() {
- if (this.aCommentNew[0]) {
- if ($('#comment_id_'+this.aCommentNew[0]).length) {
- this.scrollToComment(this.aCommentNew[0]);
- }
- this.aCommentNew.shift();
- }
- this.setCountNewComment(this.aCommentNew.length);
- }
-
-
- // Прокрутка к комментарию
- this.scrollToComment = function(idComment) {
- $.scrollTo('#comment_id_'+idComment, 1000, {offset: -250});
-
- if (this.iCurrentViewComment) {
- $('#comment_id_'+this.iCurrentViewComment).removeClass(this.options.classes.comment_current);
- }
- $('#comment_id_'+idComment).addClass(this.options.classes.comment_current);
- this.iCurrentViewComment=idComment;
- }
-
-
- // Прокрутка к родительскому комментарию
- this.goToParentComment = function(id, pid) {
- thisObj = this;
- $('.'+this.options.classes.comment_goto_child).hide().find('a').unbind();
-
- $("#comment_id_"+pid).find('.'+this.options.classes.comment_goto_child).show().find("a").bind("click", function(){
- $(this).parent('.'+thisObj.options.classes.comment_goto_child).hide();
- thisObj.scrollToComment(id);
- return false;
- });
- this.scrollToComment(pid);
- return false;
- }
-
-
- // Сворачивание комментариев
- this.checkFolding = function() {
- $(".folding").each(function(index, element){
- if ($(element).parent(".comment").next(".comment-wrapper").length == 0) {
- $(element).hide();
- } else {
- $(element).show();
- }
- });
- return false;
- }
-
- this.expandComment = function(folding) {
- $(folding).removeClass("folded").parent().nextAll(".comment-wrapper").show();
- }
-
- this.collapseComment = function(folding) {
- $(folding).addClass("folded").parent().nextAll(".comment-wrapper").hide();
- }
-
- this.expandCommentAll = function() {
- $.each($(".folding"),function(k,v){
- this.expandComment(v);
- }.bind(this))
- }
-
- this.collapseCommentAll = function() {
- $.each($(".folding"),function(k,v){
- this.collapseComment(v);
- }.bind(this))
- }
-
- this.init = function() {
- this.initEvent();
- this.calcNewComments();
- this.checkFolding();
- this.toggleCommentForm(this.iCurrentShowFormComment);
-
- if (typeof(this.options.wysiwyg)!='number') {
- this.options.wysiwyg = Boolean(BLOG_USE_TINYMCE && tinyMCE);
- }
- }
-
- this.initEvent = function() {
- $('#form_comment_text').bind('keyup', function(e) {
- key = e.keyCode || e.which;
- if(e.ctrlKey && (key == 13)) {
- $('#comment-button-submit').click();
- return false;
- }
- });
-
- $(".folding").click(function(e){
- if ($(e.target).hasClass("folded")) {
- this.expandComment(e.target);
- } else {
- this.collapseComment(e.target);
- }
- }.bind(this));
- }
-
- return this;
-}).call(ls.comments || {},jQuery);
-
-
-jQuery(document).ready(function(){
- ls.comments.init();
+var ls = ls || {};
+
+/**
+* Обработка комментариев
+*/
+ls.comments = (function ($) {
+ /**
+ * Опции
+ */
+ this.options = {
+ type: {
+ topic: {
+ url_add: aRouter.blog+'ajaxaddcomment/',
+ url_response: aRouter.blog+'ajaxresponsecomment/'
+ },
+ talk: {
+ url_add: aRouter.talk+'ajaxaddcomment/',
+ url_response: aRouter.talk+'ajaxresponsecomment/'
+ }
+ },
+ classes: {
+ form_loader: 'loader',
+ comment_new: 'new',
+ comment_current: 'current',
+ comment_deleted: 'deleted',
+ comment_self: 'self',
+ comment: 'comment',
+ comment_goto_parent: 'goto-comment-parent',
+ comment_goto_child: 'goto-comment-child'
+ },
+ wysiwyg: null
+ };
+
+ this.iCurrentShowFormComment=0;
+ this.iCurrentViewComment=null;
+ this.aCommentNew=[];
+
+ // Добавляет комментарий
+ this.add = function(formObj, targetId, targetType) {
+ if (this.options.wysiwyg) {
+ $('#'+formObj+' textarea').val(tinyMCE.activeEditor.getContent());
+ }
+ formObj = $('#'+formObj);
+
+ $('#form_comment_text').addClass(this.options.classes.form_loader).attr('readonly',true);
+ $('#comment-button-submit').attr('disabled', 'disabled');
+
+ ls.ajax(this.options.type[targetType].url_add, formObj.serializeJSON(), function(result){
+ $('#comment-button-submit').removeAttr('disabled');
+ if (!result) {
+ this.enableFormComment();
+ ls.msg.error('Error','Please try again later');
+ return;
+ }
+ if (result.bStateError) {
+ this.enableFormComment();
+ ls.msg.error(null,result.sMsg);
+ } else {
+ this.enableFormComment();
+ $('#form_comment_text').val('');
+
+ // Load new comments
+ this.load(targetId, targetType, result.sCommentId, true);
+ }
+ }.bind(this));
+ }
+
+
+ // Активирует форму
+ this.enableFormComment = function() {
+ $('#form_comment_text').removeClass(this.options.classes.form_loader).attr('readonly',false);
+ }
+
+
+ // Показывает/скрывает форму комментирования
+ this.toggleCommentForm = function(idComment, bNoFocus) {
+ $('#comment_preview_'+this.iCurrentShowFormComment).html('').css('display','none');
+ if (this.iCurrentShowFormComment==idComment && $('#reply_'+idComment).css('display')=='block') {
+ $('#reply_'+idComment).hide();
+ return;
+ }
+ if (this.options.wysiwyg) {
+ tinyMCE.execCommand('mceRemoveControl',true,'form_comment_text');
+ }
+ $('#form_comment').appendTo("#reply_"+idComment);
+ $('#form_comment_text').val('');
+ $('#form_comment_reply').val(idComment);
+ $('.reply').hide();
+ $('#reply_'+idComment).css('display','block');
+ this.iCurrentShowFormComment=idComment;
+ if (this.options.wysiwyg) {
+ tinyMCE.execCommand('mceAddControl',true,'form_comment_text');
+ }
+ if (!bNoFocus) $('#form_comment_text').focus();
+ }
+
+
+ // Подгружает новые комментарии
+ this.load = function(idTarget, typeTarget, selfIdComment, bNotFlushNew) {
+ var idCommentLast = $("#comment_last_id").val();
+
+ // Удаляем подсветку у комментариев
+ if (!bNotFlushNew) {
+ $('.comment').each(function(index, item){
+ $(item).removeClass(this.options.classes.comment_new+' '+this.options.classes.comment_current);
+ }.bind(this));
+ }
+
+ objImg = $('#update-comments');
+ objImg.addClass('active');
+
+ var params = { idCommentLast: idCommentLast, idTarget: idTarget, typeTarget: typeTarget };
+ if (selfIdComment) {
+ params.selfIdComment = selfIdComment;
+ }
+ if ($('#comment_use_paging').val()) {
+ params.bUsePaging = 1;
+ }
+
+ ls.ajax(this.options.type[typeTarget].url_response, params, function(result) {
+ objImg.removeClass('active');
+
+ if (!result) { ls.msg.error('Error','Please try again later'); }
+ if (result.bStateError) {
+ ls.msg.error(null,result.sMsg);
+ } else {
+ var aCmt = result.aComments;
+ if (aCmt.length > 0 && result.iMaxIdComment) {
+ $("#comment_last_id").val(result.iMaxIdComment);
+ $('#count-comments').text(parseInt($('#count-comments').text())+aCmt.length);
+ if ($('#block_stream_item_comment').length && ls.blocks) {
+ ls.blocks.load($('#block_stream_item_comment'), 'block_stream');
+ }
+ }
+ var iCountOld=0;
+ if (bNotFlushNew) {
+ iCountOld=this.aCommentNew.length;
+ } else {
+ this.aCommentNew=[];
+ }
+ if (selfIdComment) {
+ this.toggleCommentForm(this.iCurrentShowFormComment, true);
+ this.setCountNewComment(aCmt.length-1+iCountOld);
+ } else {
+ this.setCountNewComment(aCmt.length+iCountOld);
+ }
+
+ $.each(aCmt, function(index, item) {
+ if (!(selfIdComment && selfIdComment==item.id)) {
+ this.aCommentNew.push(item.id);
+ }
+ this.inject(item.idParent, item.id, item.html);
+ }.bind(this));
+
+ if (selfIdComment && $('#comment_id_'+selfIdComment).length) {
+ this.scrollToComment(selfIdComment);
+ }
+ this.checkFolding();
+ }
+ }.bind(this));
+ }
+
+
+ // Вставка комментария
+ this.inject = function(idCommentParent, idComment, sHtml) {
+ var newComment = $('
', {'class': 'comment-wrapper', id: 'comment_wrapper_id_'+idComment}).html(sHtml);
+ if (idCommentParent) {
+ $('#comment_wrapper_id_'+idCommentParent).append(newComment);
+ } else {
+ $('#comments').append(newComment);
+ }
+ }
+
+
+ // Удалить/восстановить комментарий
+ this.toggle = function(obj, commentId) {
+ ls.ajax(aRouter['ajax']+'comment/delete/', { idComment: commentId }, function(result){
+ if (!result) {
+ ls.msg.error('Error','Please try again later');
+ }
+ if (result.bStateError) {
+ ls.msg.error(null,result.sMsg);
+ } else {
+ ls.msg.notice(null,result.sMsg);
+
+ $('#comment_id_'+commentId).removeClass(this.options.classes.comment_self+' '+this.options.classes.comment_new+' '+this.options.classes.comment_deleted+' '+this.options.classes.comment_current);
+ if (result.bState) {
+ $('#comment_id_'+commentId).addClass(this.options.classes.comment_deleted);
+ }
+ $(obj).text(result.sTextToggle);
+ }
+ }.bind(this));
+ }
+
+
+ // Предпросмотр комментария
+ this.preview = function() {
+ if (this.options.wysiwyg) {
+ $("#form_comment_text").val(tinyMCE.activeEditor.getContent());
+ }
+ if ($("#form_comment_text").val() == '') return;
+ $("#comment_preview_"+this.iCurrentShowFormComment).css('display', 'block');
+ ls.tools.textPreview('form_comment_text', false, 'comment_preview_'+this.iCurrentShowFormComment);
+ }
+
+
+ // Устанавливает число новых комментариев
+ this.setCountNewComment = function(count) {
+ if (count > 0) {
+ $('#new_comments_counter').css('display','block').text(count);
+ } else {
+ $('#new_comments_counter').text(0).hide();
+ }
+ }
+
+
+ // Вычисляет кол-во новых комментариев
+ this.calcNewComments = function() {
+ var aCommentsNew = $('.'+this.options.classes.comment+'.'+this.options.classes.comment_new);
+ this.setCountNewComment(aCommentsNew.length);
+ $.each(aCommentsNew,function(k,v){
+ this.aCommentNew.push(parseInt($(v).attr('id').replace('comment_id_','')));
+ }.bind(this));
+ }
+
+
+ // Переход к следующему комментарию
+ this.goToNextComment = function() {
+ if (this.aCommentNew[0]) {
+ if ($('#comment_id_'+this.aCommentNew[0]).length) {
+ this.scrollToComment(this.aCommentNew[0]);
+ }
+ this.aCommentNew.shift();
+ }
+ this.setCountNewComment(this.aCommentNew.length);
+ }
+
+
+ // Прокрутка к комментарию
+ this.scrollToComment = function(idComment) {
+ $.scrollTo('#comment_id_'+idComment, 1000, {offset: -250});
+
+ if (this.iCurrentViewComment) {
+ $('#comment_id_'+this.iCurrentViewComment).removeClass(this.options.classes.comment_current);
+ }
+ $('#comment_id_'+idComment).addClass(this.options.classes.comment_current);
+ this.iCurrentViewComment=idComment;
+ }
+
+
+ // Прокрутка к родительскому комментарию
+ this.goToParentComment = function(id, pid) {
+ thisObj = this;
+ $('.'+this.options.classes.comment_goto_child).hide().find('a').unbind();
+
+ $("#comment_id_"+pid).find('.'+this.options.classes.comment_goto_child).show().find("a").bind("click", function(){
+ $(this).parent('.'+thisObj.options.classes.comment_goto_child).hide();
+ thisObj.scrollToComment(id);
+ return false;
+ });
+ this.scrollToComment(pid);
+ return false;
+ }
+
+
+ // Сворачивание комментариев
+ this.checkFolding = function() {
+ $(".folding").each(function(index, element){
+ if ($(element).parent(".comment").next(".comment-wrapper").length == 0) {
+ $(element).hide();
+ } else {
+ $(element).show();
+ }
+ });
+ return false;
+ }
+
+ this.expandComment = function(folding) {
+ $(folding).removeClass("folded").parent().nextAll(".comment-wrapper").show();
+ }
+
+ this.collapseComment = function(folding) {
+ $(folding).addClass("folded").parent().nextAll(".comment-wrapper").hide();
+ }
+
+ this.expandCommentAll = function() {
+ $.each($(".folding"),function(k,v){
+ this.expandComment(v);
+ }.bind(this))
+ }
+
+ this.collapseCommentAll = function() {
+ $.each($(".folding"),function(k,v){
+ this.collapseComment(v);
+ }.bind(this))
+ }
+
+ this.init = function() {
+ this.initEvent();
+ this.calcNewComments();
+ this.checkFolding();
+ this.toggleCommentForm(this.iCurrentShowFormComment);
+
+ if (typeof(this.options.wysiwyg)!='number') {
+ this.options.wysiwyg = Boolean(BLOG_USE_TINYMCE && tinyMCE);
+ }
+ }
+
+ this.initEvent = function() {
+ $('#form_comment_text').bind('keyup', function(e) {
+ key = e.keyCode || e.which;
+ if(e.ctrlKey && (key == 13)) {
+ $('#comment-button-submit').click();
+ return false;
+ }
+ });
+
+ $(".folding").click(function(e){
+ if ($(e.target).hasClass("folded")) {
+ this.expandComment(e.target);
+ } else {
+ this.collapseComment(e.target);
+ }
+ }.bind(this));
+ }
+
+ return this;
+}).call(ls.comments || {},jQuery);
+
+
+jQuery(document).ready(function(){
+ ls.comments.init();
});
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/favourite.js b/templates/skin/new-jquery/js/favourite.js
index 04561d0f..2b4c7996 100644
--- a/templates/skin/new-jquery/js/favourite.js
+++ b/templates/skin/new-jquery/js/favourite.js
@@ -29,14 +29,16 @@ ls.favourite = (function ($) {
* Переключение избранного
*/
this.toggle = function(idTarget, objFavourite, type) {
- if (!this.options.type[type]) { return false; }
+ if (!this.options.type[type]) {
+ return false;
+ }
this.objFavourite = $(objFavourite);
-
+
var params = {};
params['type'] = !this.objFavourite.hasClass(this.options.active);
params[this.options.type[type].targetName] = idTarget;
-
+
ls.ajax(this.options.type[type].url, params, function(result) {
$(this).trigger('toggle',[idTarget,objFavourite,type,params,result]);
if (result.bStateError) {
@@ -48,7 +50,7 @@ ls.favourite = (function ($) {
this.objFavourite.addClass(this.options.active);
}
- $('#fav_count_'+type+'_'+idTarget).text((result.iCount>0) ? result.iCount : '');
+ $('#fav_count_'+type+'_'+idTarget).text((result.iCount>0) ? result.iCount : '');
}
}.bind(this));
return false;
diff --git a/templates/skin/new-jquery/js/friend.js b/templates/skin/new-jquery/js/friend.js
index deae5223..0a379f10 100644
--- a/templates/skin/new-jquery/js/friend.js
+++ b/templates/skin/new-jquery/js/friend.js
@@ -4,7 +4,7 @@ var ls = ls || {};
* Управление пользователями
*/
ls.user = (function ($) {
-
+
/**
* Добавление в друзья
*/
@@ -54,6 +54,6 @@ ls.user = (function ($) {
});
return false;
}
-
+
return this;
}).call(ls.user || {},jQuery);
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/main.js b/templates/skin/new-jquery/js/main.js
index f5ffc85c..af2c97ca 100644
--- a/templates/skin/new-jquery/js/main.js
+++ b/templates/skin/new-jquery/js/main.js
@@ -26,14 +26,14 @@ ls.msg = (function ($) {
this.notice = function(title,msg){
$.notifier.broadcast(title, msg, this.options.class_notice);
};
-
+
/**
- * Отображение сообщения об ошибке
+ * Отображение сообщения об ошибке
*/
this.error = function(title,msg){
$.notifier.broadcast(title, msg, this.options.class_error);
};
-
+
return this;
}).call(ls.msg || {},jQuery);
@@ -53,9 +53,9 @@ ls.lang = (function ($) {
this.load = function(msgs){
$.extend(true,this.msgs,msgs);
};
-
+
/**
- * Отображение сообщения об ошибке
+ * Отображение сообщения об ошибке
*/
this.get = function(name,replace){
if (this.msgs[name]) {
@@ -69,7 +69,7 @@ ls.lang = (function ($) {
}
return '';
};
-
+
return this;
}).call(ls.lang || {},jQuery);
@@ -78,11 +78,11 @@ ls.lang = (function ($) {
* Flash загрузчик
*/
ls.swfupload = (function ($) {
-
+
this.swfu = null;
-
+
this.initOptions = function() {
-
+
this.swfOptions = {
// Backend Settings
upload_url: aRouter['photoset']+"upload",
@@ -115,15 +115,15 @@ ls.swfupload = (function ($) {
// Flash Settings
flash_url : DIR_ROOT_ENGINE_LIB+'/external/swfupload/swfupload.swf',
- custom_settings : {
+ custom_settings : {
},
// Debug Settings
debug: false
};
-
+
}
-
+
this.loadSwf = function() {
$.getScript(DIR_ROOT_ENGINE_LIB+'/external/swfupload/swfupload.swfobject.js',function(){
@@ -134,7 +134,7 @@ ls.swfupload = (function ($) {
$(this).trigger('load');
}.bind(this));
}
-
+
this.init = function(opt) {
if (opt) {
$.extend(true,this.swfOptions,opt);
@@ -142,31 +142,31 @@ ls.swfupload = (function ($) {
this.swfu = new SWFUpload(this.swfOptions);
return this.swfu;
}
-
+
this.handlerFileQueueError = function(file, errorCode, message) {
$(this).trigger('eFileQueueError',[file, errorCode, message]);
}
-
+
this.handlerFileDialogComplete = function(numFilesSelected, numFilesQueued) {
$(this).trigger('eFileDialogComplete',[numFilesSelected, numFilesQueued]);
if (numFilesQueued>0) {
this.startUpload();
}
}
-
+
this.handlerUploadProgress = function(file, bytesLoaded) {
var percent = Math.ceil((bytesLoaded / file.size) * 100);
$(this).trigger('eUploadProgress',[file, bytesLoaded, percent]);
}
-
+
this.handlerUploadError = function(file, errorCode, message) {
$(this).trigger('eUploadError',[file, errorCode, message]);
}
-
+
this.handlerUploadSuccess = function(file, serverData) {
$(this).trigger('eUploadSuccess',[file, serverData]);
}
-
+
this.handlerUploadComplete = function(file) {
var next = this.getStats().files_queued;
if (next > 0) {
@@ -174,7 +174,7 @@ ls.swfupload = (function ($) {
}
$(this).trigger('eUploadComplete',[file, next]);
}
-
+
return this;
}).call(ls.swfupload || {},jQuery);
@@ -191,7 +191,7 @@ ls.tools = (function ($) {
var f = str.charAt(0).toUpperCase();
return f + str.substr(1, str.length-1);
}
-
+
/**
* Выделяет все chekbox с определенным css классом
*/
@@ -209,7 +209,7 @@ ls.tools = (function ($) {
* Предпросмотр
*/
this.textPreview = function(textId, save, divPreview) {
- var text =(BLOG_USE_TINYMCE) ? tinyMCE.activeEditor.getContent() : $('#'+textId).val();
+ var text =(BLOG_USE_TINYMCE) ? tinyMCE.activeEditor.getContent() : $('#'+textId).val();
ls.ajax(aRouter['ajax']+'preview/text/', {text: text, save: save}, function(result){
if (!result) {
ls.msg.error('Error','Please try again later');
@@ -226,7 +226,7 @@ ls.tools = (function ($) {
}
});
}
-
+
/**
* Возвращает выделенный текст на странице
*/
@@ -245,7 +245,7 @@ ls.tools = (function ($) {
}
return text;
}
-
+
return this;
}).call(ls.tools || {},jQuery);
@@ -254,12 +254,12 @@ ls.tools = (function ($) {
* Дополнительные функции
*/
ls = (function ($) {
-
+
/**
* Глобальные опции
*/
this.options = this.options || {}
-
+
/**
* Выполнение AJAX запроса, автоматически передает security key
*/
@@ -267,17 +267,17 @@ ls = (function ($) {
more=more || {};
params=params || {};
params.security_ls_key=LIVESTREET_SECURITY_KEY;
-
+
$.each(params,function(k,v){
if (typeof(v) == "boolean") {
params[k]=v ? 1 : 0;
}
})
-
+
if (url.indexOf('http://')!=0 && url.indexOf('https://')!=0) {
url=aRouter['ajax']+url+'/';
}
-
+
return $.ajax({
type: more.type || "POST",
url: url,
@@ -296,21 +296,21 @@ ls = (function ($) {
ls.debug(msg);
}.bind(this)
});
-
+
};
-
+
/**
* Выполнение AJAX отправки формы, включая загрузку файлов
*/
this.ajaxSubmit = function(url,form,callback,more) {
- more=more || {};
+ more=more || {};
if (typeof(form)=='string') {
form=$('#'+form);
}
if (url.indexOf('http://')!=0 && url.indexOf('https://')!=0) {
url=aRouter['ajax']+url+'/';
}
-
+
var options={
type: 'POST',
url: url,
@@ -326,7 +326,7 @@ ls = (function ($) {
}.bind(this)
}
-
+
form.ajaxSubmit(options);
}
@@ -344,7 +344,7 @@ ls = (function ($) {
}
});
}
-
+
/**
* Дебаг сообщений
*/
@@ -364,7 +364,7 @@ ls = (function ($) {
//alert(msg);
}
}
-
+
return this;
}).call(ls || {},jQuery);
@@ -422,11 +422,11 @@ ls.autocomplete = (function ($) {
this.split = function(val) {
return val.split( /,\s*/ );
}
-
+
this.extractLast = function(term) {
return ls.autocomplete.split(term).pop();
}
-
+
return this;
}).call(ls.autocomplete || {},jQuery);
@@ -444,44 +444,44 @@ jQuery(document).ready(function($){
$('#add_friend_form').jqm({trigger: '#add_friend_show'});
$('#form_upload_img').jqm();
$('#userfield_form').jqm();
-
+
// Datepicker
- $('.date-picker').datepicker({
+ $('.date-picker').datepicker({
dateFormat: 'dd.mm.yy',
dayNamesMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
monthNames: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
firstDay: 1
});
-
-
+
+
// Поиск по тегам
$('#tag_search_form').submit(function(){
window.location = aRouter['tag']+$('#tag_search').val()+'/';
return false;
});
-
-
+
+
// Автокомплит
ls.autocomplete.add($(".autocomplete-tags-sep"), aRouter['ajax']+'autocompleter/tag/', true);
ls.autocomplete.add($(".autocomplete-users"), aRouter['ajax']+'autocompleter/user/', true);
ls.autocomplete.add($(".autocomplete-city"), aRouter['ajax']+'autocompleter/city/', false);
ls.autocomplete.add($(".autocomplete-country"), aRouter['ajax']+'autocompleter/country/', false);
-
+
// Скролл
$(window)._scrollable();
-
-
+
+
// Show blog info
$("#show_blog_info").click(function(){
$("#blog_info").slideToggle(500);
$("#show_blog_info").toggleClass("inactive");
return false;
});
-
-
+
+
// Detecting IE6-IE8
- if ($.browser.msie && $.browser.version.substr(0,1) <= 8) {
+ if ($.browser.msie && $.browser.version.substr(0,1) <= 8) {
$(".switcher li:first-child").addClass("first-child");
$(".switcher li:last-child").addClass("last-child");
}
diff --git a/templates/skin/new-jquery/js/markup_settings.js b/templates/skin/new-jquery/js/markup_settings.js
index 02da50cf..e5d0276f 100644
--- a/templates/skin/new-jquery/js/markup_settings.js
+++ b/templates/skin/new-jquery/js/markup_settings.js
@@ -1,64 +1,64 @@
-// ----------------------------------------------------------------------------
-// markItUp!
-// ----------------------------------------------------------------------------
-// Copyright (C) 2008 Jay Salvat
-// http://markitup.jaysalvat.com/
-// ----------------------------------------------------------------------------
-// Html tags
-// http://en.wikipedia.org/wiki/html
-// ----------------------------------------------------------------------------
-// Basic set. Feel free to add more tags
-// ----------------------------------------------------------------------------
-
-function getMarkitupSettings() {
- return {
- onShiftEnter: {keepDefault:false, replaceWith:'
\n'},
- onTab: {keepDefault:false, replaceWith:' '},
- markupSet: [
- {name:'H4', className:'editor-h4', openWith:'
', closeWith:'
' },
- {name:'H5', className:'editor-h5', openWith:'
', closeWith:'
' },
- {name:'H6', className:'editor-h6', openWith:'
', closeWith:'
' },
- {separator:'---------------' },
- {name: ls.lang.get('panel_b'), className:'editor-bold', key:'B', openWith:'(!(
|!|)!)', closeWith:'(!(|!|)!)' },
- {name: ls.lang.get('panel_i'), className:'editor-italic', key:'I', openWith:'(!(
|!|)!)', closeWith:'(!(|!|)!)' },
- {name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'
', closeWith:'' },
- {name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'
', closeWith:'' },
- {name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return '
'+m.selectionOuter+'
'; else if (m.selection) return '
'+m.selection+'
'; else return '
' } },
- {name: ls.lang.get('panel_code'), className:'editor-code', openWith:'
', closeWith:'
' },
- {separator:'---------------' },
- {name: ls.lang.get('panel_list'), className:'editor-ul', openWith:'
', closeWith:'', multiline: true, openBlockWith:'
' },
- {name: ls.lang.get('panel_list'), className:'editor-ol', openWith:'
', closeWith:'', multiline: true, openBlockWith:'
\n', closeBlockWith:'\n
' },
- {separator:'---------------' },
- {name: ls.lang.get('panel_image'), className:'editor-picture', key:'P', beforeInsert: function(h) { $('#form_upload_img').jqmShow(); } },
- {name: ls.lang.get('panel_image'), className:'editor-image', replaceWith:'
![]([!['+ls.lang.get('panel_image_promt')+':!:http://]!])
' },
- {name: ls.lang.get('panel_video'), className:'editor-video', replaceWith:'
' },
- {name: ls.lang.get('panel_url'), className:'editor-link', key:'L', openWith:'
', closeWith:'', placeHolder:'Your text to link...' },
- {name: ls.lang.get('panel_user'), className:'editor-user', replaceWith:'
' },
- {separator:'---------------' },
- {name: ls.lang.get('panel_clear_tags'), className:'editor-clean', replaceWith: function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
- {name: ls.lang.get('panel_cut'), className:'editor-cut', replaceWith: function(markitup) { if (markitup.selection) return '
'; else return '' }}
- ]
- }
-}
-
-function getMarkitupCommentSettings() {
- return {
- onShiftEnter: {keepDefault:false, replaceWith:'
\n'},
- onTab: {keepDefault:false, replaceWith:' '},
- markupSet: [
- {name: ls.lang.get('panel_b'), className:'editor-bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' },
- {name: ls.lang.get('panel_i'), className:'editor-italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' },
- {name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'', closeWith:'' },
- {name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'', closeWith:'' },
- {separator:'---------------' },
- {name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return ''+m.selectionOuter+'
'; else if (m.selection) return ''+m.selection+'
'; else return '' } },
- {name: ls.lang.get('panel_code'), className:'editor-code', openWith:'', closeWith:'
' },
- {name: ls.lang.get('panel_image'), className:'editor-picture', key:'P', beforeInsert: function(h) { $('#form_upload_img').jqmShow(); } },
- {name: ls.lang.get('panel_image'), className:'editor-image', replaceWith:'
' },
- {name: ls.lang.get('panel_url'), className:'editor-link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' },
- {name: ls.lang.get('panel_user'), className:'editor-user', replaceWith:'' },
- {separator:'---------------' },
- {name: ls.lang.get('panel_clear_tags'), className:'editor-clean', replaceWith: function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }
- ]
- }
-}
+// ----------------------------------------------------------------------------
+// markItUp!
+// ----------------------------------------------------------------------------
+// Copyright (C) 2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// Html tags
+// http://en.wikipedia.org/wiki/html
+// ----------------------------------------------------------------------------
+// Basic set. Feel free to add more tags
+// ----------------------------------------------------------------------------
+
+function getMarkitupSettings() {
+ return {
+ onShiftEnter: {keepDefault:false, replaceWith:'
\n'},
+ onTab: {keepDefault:false, replaceWith:' '},
+ markupSet: [
+ {name:'H4', className:'editor-h4', openWith:'', closeWith:'
' },
+ {name:'H5', className:'editor-h5', openWith:'', closeWith:'
' },
+ {name:'H6', className:'editor-h6', openWith:'', closeWith:'
' },
+ {separator:'---------------' },
+ {name: ls.lang.get('panel_b'), className:'editor-bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' },
+ {name: ls.lang.get('panel_i'), className:'editor-italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' },
+ {name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'', closeWith:'' },
+ {name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'', closeWith:'' },
+ {name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return ''+m.selectionOuter+'
'; else if (m.selection) return ''+m.selection+'
'; else return '' } },
+ {name: ls.lang.get('panel_code'), className:'editor-code', openWith:'', closeWith:'
' },
+ {separator:'---------------' },
+ {name: ls.lang.get('panel_list'), className:'editor-ul', openWith:' ', closeWith:'', multiline: true, openBlockWith:'' },
+ {name: ls.lang.get('panel_list'), className:'editor-ol', openWith:' ', closeWith:'', multiline: true, openBlockWith:'\n', closeBlockWith:'\n
' },
+ {separator:'---------------' },
+ {name: ls.lang.get('panel_image'), className:'editor-picture', key:'P', beforeInsert: function(h) { $('#form_upload_img').jqmShow(); } },
+ {name: ls.lang.get('panel_image'), className:'editor-image', replaceWith:'
' },
+ {name: ls.lang.get('panel_video'), className:'editor-video', replaceWith:'' },
+ {name: ls.lang.get('panel_url'), className:'editor-link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' },
+ {name: ls.lang.get('panel_user'), className:'editor-user', replaceWith:'' },
+ {separator:'---------------' },
+ {name: ls.lang.get('panel_clear_tags'), className:'editor-clean', replaceWith: function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
+ {name: ls.lang.get('panel_cut'), className:'editor-cut', replaceWith: function(markitup) { if (markitup.selection) return ''; else return '' }}
+ ]
+ }
+}
+
+function getMarkitupCommentSettings() {
+ return {
+ onShiftEnter: {keepDefault:false, replaceWith:'
\n'},
+ onTab: {keepDefault:false, replaceWith:' '},
+ markupSet: [
+ {name: ls.lang.get('panel_b'), className:'editor-bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' },
+ {name: ls.lang.get('panel_i'), className:'editor-italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' },
+ {name: ls.lang.get('panel_s'), className:'editor-stroke', key:'S', openWith:'', closeWith:'' },
+ {name: ls.lang.get('panel_u'), className:'editor-underline', key:'U', openWith:'', closeWith:'' },
+ {separator:'---------------' },
+ {name: ls.lang.get('panel_quote'), className:'editor-quote', key:'Q', replaceWith: function(m) { if (m.selectionOuter) return ''+m.selectionOuter+'
'; else if (m.selection) return ''+m.selection+'
'; else return '' } },
+ {name: ls.lang.get('panel_code'), className:'editor-code', openWith:'', closeWith:'
' },
+ {name: ls.lang.get('panel_image'), className:'editor-picture', key:'P', beforeInsert: function(h) { $('#form_upload_img').jqmShow(); } },
+ {name: ls.lang.get('panel_image'), className:'editor-image', replaceWith:'
' },
+ {name: ls.lang.get('panel_url'), className:'editor-link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' },
+ {name: ls.lang.get('panel_user'), className:'editor-user', replaceWith:'' },
+ {separator:'---------------' },
+ {name: ls.lang.get('panel_clear_tags'), className:'editor-clean', replaceWith: function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }
+ ]
+ }
+}
diff --git a/templates/skin/new-jquery/js/photoset.js b/templates/skin/new-jquery/js/photoset.js
index ee26c9f1..99181fad 100644
--- a/templates/skin/new-jquery/js/photoset.js
+++ b/templates/skin/new-jquery/js/photoset.js
@@ -1,16 +1,16 @@
var ls = ls || {};
ls.photoset =( function ($) {
-
+
this.idLast=0;
this.isLoading=false;
this.swfu;
-
+
this.initSwfUpload = function(opt) {
opt=opt || {};
opt.button_placeholder_id = 'photoset-start-upload';
opt.post_params.ls_photoset_target_tmp = $.cookie('ls_photoset_target_tmp') ? $.cookie('ls_photoset_target_tmp') : 0;
-
+
$(ls.swfupload).bind('load',function() {
this.swfu = ls.swfupload.init(opt);
@@ -19,36 +19,36 @@ ls.photoset =( function ($) {
$(this.swfu).bind('eUploadSuccess',this.swfHandlerUploadSuccess);
$(this.swfu).bind('eUploadComplete',this.swfHandlerUploadComplete);
}.bind(this));
-
+
ls.swfupload.loadSwf();
}
-
+
this.swfHandlerUploadProgress = function(e, file, bytesLoaded, percent) {
$('#photoset_photo_empty_progress').text(file.name+': '+( percent==100 ? 'resize..' : percent +'%'));
}
-
+
this.swfHandlerFileDialogComplete = function(e, numFilesSelected, numFilesQueued) {
if (numFilesQueued>0) {
ls.photoset.addPhotoEmpty();
}
}
-
+
this.swfHandlerUploadSuccess = function(e, file, serverData) {
ls.photoset.addPhoto(jQuery.parseJSON(serverData));
}
-
+
this.swfHandlerUploadComplete = function(e, file, next) {
if (next>0) {
ls.photoset.addPhotoEmpty();
}
}
-
+
this.addPhotoEmpty = function() {
template = '
'
+'
';
$('#swfu_images').append(template);
}
-
+
this.addPhoto = function(response) {
$('#photoset_photo_empty').remove();
if (!response.bStateError) {
@@ -92,7 +92,7 @@ ls.photoset =( function ($) {
this.setPreviewDescription = function(id, text)
{
- ls.ajax(aRouter['photoset']+'setimagedescription', {'id':id, 'text':text}, function(result){
+ ls.ajax(aRouter['photoset']+'setimagedescription', {'id':id, 'text':text}, function(result){
if (!result.bStateError) {
} else {
@@ -106,7 +106,7 @@ ls.photoset =( function ($) {
{
if (this.isLoading) return;
this.isLoading=true;
-
+
ls.ajax(aRouter['photoset']+'getmore', {'topic_id':topic_id, 'last_id':this.idLast}, function(result){
this.isLoading=false;
if (!result.bStateError) {
@@ -159,18 +159,18 @@ ls.photoset =( function ($) {
var pos = $select.offset();
w = $select.outerWidth();
h = $select.outerHeight();
- t = pos.top + h - 30 + 'px';
+ t = pos.top + h - 30 + 'px';
l = pos.left - 15 + 'px';
$('#photoset-upload-form').css({'top':t,'left':l});
}
$('#photoset-upload-form').show();
}
-
+
this.showMainPhoto = function(id) {
$('#photoset-main-preview-'+id).css('width',$('#photoset-main-image-'+id).outerWidth());
$('#photoset-photo-count-'+id).show();
$('#photoset-photo-desc-'+id).show();
}
-
+
return this;
}).call(ls.photoset || {},jQuery);
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/poll.js b/templates/skin/new-jquery/js/poll.js
index 0db1ae60..82d8ebd5 100644
--- a/templates/skin/new-jquery/js/poll.js
+++ b/templates/skin/new-jquery/js/poll.js
@@ -4,7 +4,7 @@ var ls = ls || {};
* Опросы
*/
ls.poll = (function ($) {
-
+
/**
* Голосование в опросе
*/
@@ -34,7 +34,7 @@ ls.poll = (function ($) {
}.bind(this)));
newItem.find('input').val('');
}
-
+
/**
* Удаляет вариант ответа
*/
@@ -42,6 +42,6 @@ ls.poll = (function ($) {
$(obj).parent("li").remove();
return false;
}
-
+
return this;
}).call(ls.poll || {},jQuery);
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/stream.js b/templates/skin/new-jquery/js/stream.js
index 700cbf9b..d053b165 100644
--- a/templates/skin/new-jquery/js/stream.js
+++ b/templates/skin/new-jquery/js/stream.js
@@ -1,74 +1,86 @@
var ls = ls || {};
ls.stream =( function ($) {
- this.isBusy = false;
- this.subscribe = function (iTargetUserId) {
- ls.ajax(aRouter['stream']+'subscribe/', {'id':iTargetUserId}, function(data) {
- if (data.bStateError) {
- ls.msg.error(data.sMsgTitle,data.sMsg);
- } else {
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
-
- });
- }
- this.unsubscribe = function (iId) {
- ls.ajax(aRouter['stream']+'unsubscribe/', {'id':iId}, function(data) {
- if (!data.bStateError) {
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- });
- }
- this.switchEventType = function (iType) {
- ls.ajax(aRouter['stream']+'switchEventType/', { 'type':iType}, function(data) {
- if (!data.bStateError) {
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- });
- }
- this.appendUser = function() {
- var sLogin = $('#stream_users_complete').val();
- if (!sLogin) return;
- ls.ajax(aRouter['stream']+'subscribeByLogin/', {'login':sLogin}, function(data) {
- if (!data.bStateError) {
- $('#stream_no_subscribed_users').remove();
- var checkbox = $('#strm_u_'+data.uid);
- if (checkbox.length) {
- if (checkbox.attr('checked')) {
- ls.msg.error(ls.lang.get('error'),ls.lang.get('stream_subscribes_already_subscribed'));
- } else {
- checkbox.attr('checked', 'on');
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- } else {
- var liElement=' '+data.user_login+'';
- $('#stream_block_users_list').append(liElement);
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- } else {
- ls.msg.error(data.sMsgTitle,data.sMsg);
- }
- });
- }
- this.getMore = function () {
- if (this.isBusy) {
- return;
- }
- var lastId = $('#stream_last_id').val();
- if (!lastId) return;
- $('#stream_get_more').addClass('stream_loading');
- this.isBusy = true;
- ls.ajax(aRouter['stream']+'get_more/', {'last_id':lastId}, function(data) {
- if (!data.bStateError && data.events_count) {
- $('#stream-list').append(data.result);
- $('#stream_last_id').attr('value', data.iStreamLastId);
- }
- if (!data.events_count) {
- $('#stream_get_more').css({'display':'none'});
- }
- $('#stream_get_more').removeClass('stream_loading');
- this.isBusy = false;
- }.bind(this));
- }
- return this;
+ this.isBusy = false;
+ this.subscribe = function (iTargetUserId) {
+ ls.ajax(aRouter['stream']+'subscribe/', {
+ 'id':iTargetUserId
+ }, function(data) {
+ if (data.bStateError) {
+ ls.msg.error(data.sMsgTitle,data.sMsg);
+ } else {
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+
+ });
+ }
+ this.unsubscribe = function (iId) {
+ ls.ajax(aRouter['stream']+'unsubscribe/', {
+ 'id':iId
+ }, function(data) {
+ if (!data.bStateError) {
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
+ this.switchEventType = function (iType) {
+ ls.ajax(aRouter['stream']+'switchEventType/', {
+ 'type':iType
+ }, function(data) {
+ if (!data.bStateError) {
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
+ this.appendUser = function() {
+ var sLogin = $('#stream_users_complete').val();
+ if (!sLogin) return;
+ ls.ajax(aRouter['stream']+'subscribeByLogin/', {
+ 'login':sLogin
+ }, function(data) {
+ if (!data.bStateError) {
+ $('#stream_no_subscribed_users').remove();
+ var checkbox = $('#strm_u_'+data.uid);
+ if (checkbox.length) {
+ if (checkbox.attr('checked')) {
+ ls.msg.error(ls.lang.get('error'),ls.lang.get('stream_subscribes_already_subscribed'));
+ } else {
+ checkbox.attr('checked', 'on');
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ } else {
+ var liElement=' '+data.user_login+'';
+ $('#stream_block_users_list').append(liElement);
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ } else {
+ ls.msg.error(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
+ this.getMore = function () {
+ if (this.isBusy) {
+ return;
+ }
+ var lastId = $('#stream_last_id').val();
+ if (!lastId) return;
+ $('#stream_get_more').addClass('stream_loading');
+ this.isBusy = true;
+ ls.ajax(aRouter['stream']+'get_more/', {
+ 'last_id':lastId
+ }, function(data) {
+ if (!data.bStateError && data.events_count) {
+ $('#stream-list').append(data.result);
+ $('#stream_last_id').attr('value', data.iStreamLastId);
+ }
+ if (!data.events_count) {
+ $('#stream_get_more').css({
+ 'display':'none'
+ });
+ }
+ $('#stream_get_more').removeClass('stream_loading');
+ this.isBusy = false;
+ }.bind(this));
+ }
+ return this;
}).call(ls.stream || {},jQuery);
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/talk.js b/templates/skin/new-jquery/js/talk.js
index 76c7235d..346e970f 100644
--- a/templates/skin/new-jquery/js/talk.js
+++ b/templates/skin/new-jquery/js/talk.js
@@ -4,7 +4,7 @@ var ls = ls || {};
* Функционал личных сообщений
*/
ls.talk = (function ($) {
-
+
/**
* Добавляет пользователя к переписке
*/
@@ -12,7 +12,7 @@ ls.talk = (function ($) {
var sUsers = $('#talk_speaker_add').val();
if(!sUsers) return false;
$('#talk_speaker_add').val('');
-
+
ls.ajax(aRouter['talk']+'ajaxaddtalkuser/', {users: sUsers, idTalk: idTalk}, function(result) {
if (result.bStateError) {
ls.msg.error(null, result.sMsg);
@@ -37,7 +37,7 @@ ls.talk = (function ($) {
*/
this.removeFromTalk = function(link, idTalk) {
link = $(link);
-
+
$('#'+link.attr('id')+'_area').fadeOut(500,function(){
$(this).remove();
});
@@ -56,7 +56,7 @@ ls.talk = (function ($) {
return false;
}
-
+
/**
* Добавляет пользователя в черный список
*/
@@ -64,7 +64,7 @@ ls.talk = (function ($) {
var sUsers = $('#talk_blacklist_add').val();
if(!sUsers) return false;
$('#talk_blacklist_add').val('');
-
+
ls.ajax(aRouter['talk']+'ajaxaddtoblacklist/', {users: sUsers}, function(result) {
if (result.bStateError) {
ls.msg.error(null, result.sMsg);
@@ -83,13 +83,13 @@ ls.talk = (function ($) {
});
return false;
}
-
+
/**
* Удаляет пользователя из черного списка
*/
this.removeFromBlackList = function(link) {
link = $(link);
-
+
$('#'+link.attr('id')+'_area').fadeOut(500,function(){
$(this).remove();
});
@@ -107,7 +107,7 @@ ls.talk = (function ($) {
});
return false;
}
-
+
/**
* Добавляет или удаляет друга из списка получателей
*/
@@ -119,7 +119,7 @@ ls.talk = (function ($) {
if (add) { to.push(login); to = $.richArray.unique(to); } else { to = $.richArray.without(to, login); }
$('#talk_users').val(to.join(', '));
}
-
+
return this;
}).call(ls.talk || {},jQuery);
@@ -129,7 +129,7 @@ jQuery(document).ready(function($){
$('#friends input:checkbox').change(function(){
ls.talk.toggleRecipient($('#'+$(this).attr('id')+'_label').text(), $(this).attr('checked'));
});
-
+
// Добавляем всех друзей в список получателей
$('#friend_check_all').click(function(){
$('#friends input:checkbox').each(function(index, item){
@@ -138,7 +138,7 @@ jQuery(document).ready(function($){
});
return false;
});
-
+
// Удаляем всех друзей из списка получателей
$('#friend_uncheck_all').click(function(){
$('#friends input:checkbox').each(function(index, item){
@@ -147,13 +147,13 @@ jQuery(document).ready(function($){
});
return false;
});
-
+
// Удаляем пользователя из черного списка
$("#black_list_block").delegate("a.delete", "click", function(){
ls.talk.removeFromBlackList(this);
return false;
});
-
+
// Удаляем пользователя из переписки
$("#speaker_list_block").delegate("a.delete", "click", function(){
ls.talk.removeFromTalk(this, $('#talk_id').val());
diff --git a/templates/skin/new-jquery/js/userfeed.js b/templates/skin/new-jquery/js/userfeed.js
index 0d328f8a..19db990f 100644
--- a/templates/skin/new-jquery/js/userfeed.js
+++ b/templates/skin/new-jquery/js/userfeed.js
@@ -1,64 +1,76 @@
var ls = ls || {};
ls.userfeed =( function ($) {
- this.isBusy = false;
- this.subscribe = function (sType, iId) {
- ls.ajax(aRouter['feed']+'subscribe/', {'type':sType, 'id':iId}, function(data) {
- if (!data.bStateError) {
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- });
- }
- this.unsubscribe = function (sType, iId) {
- ls.ajax(aRouter['feed']+'unsubscribe/', {'type':sType, 'id':iId}, function(data) {
- if (!data.bStateError) {
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- });
- }
- this.appendUser = function() {
- var sLogin = $('#userfeed_users_complete').val();
- if (!sLogin) return;
- ls.ajax(aRouter['feed']+'subscribeByLogin/', {'login':sLogin}, function(data) {
- if (data.bStateError) {
- ls.msg.error(data.sMsgTitle,data.sMsg);
- } else {
- $('#userfeed_no_subscribed_users').remove();
- var checkbox = $('#usf_u_'+data.uid);
- if (checkbox.length) {
- if (checkbox.attr('checked')) {
- ls.msg.error(data.lang_error_title,data.lang_error_msg);
- } else {
- checkbox.attr('checked', 'on');
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- } else {
- var liElement=''+data.user_login+'';
- $('#userfeed_block_users_list').append(liElement);
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- }
- }
- });
- }
- this.getMore = function () {
- if (this.isBusy) {
- return;
- }
- var lastId = $('#userfeed_last_id').val();
- if (!lastId) return;
- $('#userfeed_get_more').addClass('userfeed_loading');
- this.isBusy = true;
- ls.ajax(aRouter['feed']+'get_more/', {'last_id':lastId}, function(data) {
- if (!data.bStateError && data.topics_count) {
- $('#userfeed_loaded_topics').append(data.result);
- $('#userfeed_last_id').attr('value', data.iUserfeedLastId);
- }
- if (!data.topics_count) {
- $('#userfeed_get_more').css({'display':'none'});
- }
- $('#userfeed_get_more').removeClass('userfeed_loading');
- this.isBusy = false;
- }.bind(this));
- }
- return this;
+ this.isBusy = false;
+ this.subscribe = function (sType, iId) {
+ ls.ajax(aRouter['feed']+'subscribe/', {
+ 'type':sType,
+ 'id':iId
+ }, function(data) {
+ if (!data.bStateError) {
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
+ this.unsubscribe = function (sType, iId) {
+ ls.ajax(aRouter['feed']+'unsubscribe/', {
+ 'type':sType,
+ 'id':iId
+ }, function(data) {
+ if (!data.bStateError) {
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
+ this.appendUser = function() {
+ var sLogin = $('#userfeed_users_complete').val();
+ if (!sLogin) return;
+ ls.ajax(aRouter['feed']+'subscribeByLogin/', {
+ 'login':sLogin
+ }, function(data) {
+ if (data.bStateError) {
+ ls.msg.error(data.sMsgTitle,data.sMsg);
+ } else {
+ $('#userfeed_no_subscribed_users').remove();
+ var checkbox = $('#usf_u_'+data.uid);
+ if (checkbox.length) {
+ if (checkbox.attr('checked')) {
+ ls.msg.error(data.lang_error_title,data.lang_error_msg);
+ } else {
+ checkbox.attr('checked', 'on');
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ } else {
+ var liElement=''+data.user_login+'';
+ $('#userfeed_block_users_list').append(liElement);
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ }
+ }
+ });
+ }
+ this.getMore = function () {
+ if (this.isBusy) {
+ return;
+ }
+ var lastId = $('#userfeed_last_id').val();
+ if (!lastId) return;
+ $('#userfeed_get_more').addClass('userfeed_loading');
+ this.isBusy = true;
+ ls.ajax(aRouter['feed']+'get_more/', {
+ 'last_id':lastId
+ }, function(data) {
+ if (!data.bStateError && data.topics_count) {
+ $('#userfeed_loaded_topics').append(data.result);
+ $('#userfeed_last_id').attr('value', data.iUserfeedLastId);
+ }
+ if (!data.topics_count) {
+ $('#userfeed_get_more').css({
+ 'display':'none'
+ });
+ }
+ $('#userfeed_get_more').removeClass('userfeed_loading');
+ this.isBusy = false;
+ }.bind(this));
+ }
+ return this;
}).call(ls.userfeed || {},jQuery);
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/userfield.js b/templates/skin/new-jquery/js/userfield.js
index 514226c4..06b23f37 100644
--- a/templates/skin/new-jquery/js/userfield.js
+++ b/templates/skin/new-jquery/js/userfield.js
@@ -1,82 +1,98 @@
var ls = ls || {};
ls.userfield =( function ($) {
- this.showAddForm = function(){
- $('#user_fields_form_name').val( '');
- $('#user_fields_form_title').val( '');
- $('#user_fields_form_id').val( '');
- $('#user_fields_form_action').val('add');
- $('#userfield_form').jqmShow();
- }
-
- this.showEditForm = function(id) {
- $('#user_fields_form_action').val('update');
- var name = $('#field_'+id+' .userfield_admin_name').text();
- var title = $('#field_'+id+' .userfield_admin_title').text();
- var pattern = $('#field_'+id+' .userfield_admin_pattern').text();
- $('#user_fields_form_name').val(name);
- $('#user_fields_form_title').val(title);
- $('#user_fields_form_pattern').val(pattern);
- $('#user_fields_form_id').val(id);
- $('#userfield_form').jqmShow();
- }
+ this.showAddForm = function(){
+ $('#user_fields_form_name').val( '');
+ $('#user_fields_form_title').val( '');
+ $('#user_fields_form_id').val( '');
+ $('#user_fields_form_action').val('add');
+ $('#userfield_form').jqmShow();
+ }
- this.applyForm = function(){
- $('#userfield_form').jqmHide();
- if ($('#user_fields_form_action').val() == 'add') {
- this.addUserfield();
- } else if ($('#user_fields_form_action').val() == 'update') {
- this.updateUserfield();
- }
- }
+ this.showEditForm = function(id) {
+ $('#user_fields_form_action').val('update');
+ var name = $('#field_'+id+' .userfield_admin_name').text();
+ var title = $('#field_'+id+' .userfield_admin_title').text();
+ var pattern = $('#field_'+id+' .userfield_admin_pattern').text();
+ $('#user_fields_form_name').val(name);
+ $('#user_fields_form_title').val(title);
+ $('#user_fields_form_pattern').val(pattern);
+ $('#user_fields_form_id').val(id);
+ $('#userfield_form').jqmShow();
+ }
- this.addUserfield = function() {
- var name = $('#user_fields_form_name').val();
- var title = $('#user_fields_form_title').val();
- var pattern = $('#user_fields_form_pattern').val();
- ls.ajax(aRouter['admin']+'userfields', {'action':'add', 'name':name, 'title':title, 'pattern':pattern}, function(data) {
- if (!data.bStateError) {
- liElement = ' / / '+
+ this.applyForm = function(){
+ $('#userfield_form').jqmHide();
+ if ($('#user_fields_form_action').val() == 'add') {
+ this.addUserfield();
+ } else if ($('#user_fields_form_action').val() == 'update') {
+ this.updateUserfield();
+ }
+ }
+
+ this.addUserfield = function() {
+ var name = $('#user_fields_form_name').val();
+ var title = $('#user_fields_form_title').val();
+ var pattern = $('#user_fields_form_pattern').val();
+ ls.ajax(aRouter['admin']+'userfields', {
+ 'action':'add',
+ 'name':name,
+ 'title':title,
+ 'pattern':pattern
+ }, function(data) {
+ if (!data.bStateError) {
+ liElement = ' / / '+
'![]('+DIR_STATIC_SKIN+'/images/edit.png)
'+
'
![]('+DIR_STATIC_SKIN+'/images/delete.png)
';
- $('#user_field_list').append(liElement);
- $('#field_'+data.id+' .userfield_admin_name').text(name);
- $('#field_'+data.id+' .userfield_admin_title').text(title);
- $('#field_'+data.id+' .userfield_admin_pattern').text(pattern);
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- } else {
- ls.msg.error(data.sMsgTitle,data.sMsg);
- }
- });
- }
+ $('#user_field_list').append(liElement);
+ $('#field_'+data.id+' .userfield_admin_name').text(name);
+ $('#field_'+data.id+' .userfield_admin_title').text(title);
+ $('#field_'+data.id+' .userfield_admin_pattern').text(pattern);
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ } else {
+ ls.msg.error(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
- this.updateUserfield = function() {
- var id = $('#user_fields_form_id').val();
- var name = $('#user_fields_form_name').val();
- var title = $('#user_fields_form_title').val();
- var pattern = $('#user_fields_form_pattern').val();
- ls.ajax(aRouter['admin']+'userfields', {'action':'update', 'id':id, 'name':name, 'title':title, 'pattern':pattern}, function(data) {
- if (!data.bStateError) {
- $('#field_'+id+' .userfield_admin_name').text(name);
- $('#field_'+id+' .userfield_admin_title').text(title);
- $('#field_'+id+' .userfield_admin_pattern').text(pattern);
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- } else {
- ls.msg.error(data.sMsgTitle,data.sMsg);
- }
- });
- }
+ this.updateUserfield = function() {
+ var id = $('#user_fields_form_id').val();
+ var name = $('#user_fields_form_name').val();
+ var title = $('#user_fields_form_title').val();
+ var pattern = $('#user_fields_form_pattern').val();
+ ls.ajax(aRouter['admin']+'userfields', {
+ 'action':'update',
+ 'id':id,
+ 'name':name,
+ 'title':title,
+ 'pattern':pattern
+ }, function(data) {
+ if (!data.bStateError) {
+ $('#field_'+id+' .userfield_admin_name').text(name);
+ $('#field_'+id+' .userfield_admin_title').text(title);
+ $('#field_'+id+' .userfield_admin_pattern').text(pattern);
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ } else {
+ ls.msg.error(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
- this.deleteUserfield = function(id) {
- if (!confirm(ls.lang.get('user_field_delete_confirm'))) {return;}
- ls.ajax(aRouter['admin']+'userfields', {'action':'delete', 'id':id}, function(data) {
- if (!data.bStateError) {
- $('#field_'+id).remove();
- ls.msg.notice(data.sMsgTitle,data.sMsg);
- } else {
- ls.msg.error(data.sMsgTitle,data.sMsg);
- }
- });
- }
- return this;
+ this.deleteUserfield = function(id) {
+ if (!confirm(ls.lang.get('user_field_delete_confirm'))) {
+ return;
+ }
+ ls.ajax(aRouter['admin']+'userfields', {
+ 'action':'delete',
+ 'id':id
+ }, function(data) {
+ if (!data.bStateError) {
+ $('#field_'+id).remove();
+ ls.msg.notice(data.sMsgTitle,data.sMsg);
+ } else {
+ ls.msg.error(data.sMsgTitle,data.sMsg);
+ }
+ });
+ }
+ return this;
}).call(ls.userfield || {},jQuery);
\ No newline at end of file
diff --git a/templates/skin/new-jquery/js/vote.js b/templates/skin/new-jquery/js/vote.js
index 4d7a8c38..12878316 100644
--- a/templates/skin/new-jquery/js/vote.js
+++ b/templates/skin/new-jquery/js/vote.js
@@ -9,15 +9,15 @@ ls.vote = (function ($) {
*/
this.options = {
classes: {
- voted: 'voted',
- plus: 'plus',
- minus: 'minus',
+ voted: 'voted',
+ plus: 'plus',
+ minus: 'minus',
positive: 'positive',
- negative: 'negative'
+ negative: 'negative'
},
- prefix_area: 'vote_area_',
- prefix_total: 'vote_total_',
- prefix_count: 'vote_count_',
+ prefix_area: 'vote_area_',
+ prefix_total: 'vote_total_',
+ prefix_count: 'vote_count_',
type: {
comment: {
url: aRouter['ajax']+'vote/comment/',
@@ -40,12 +40,12 @@ ls.vote = (function ($) {
this.vote = function(idTarget, objVote, value, type) {
if (!this.options.type[type]) return false;
-
+
objVote = $(objVote);
var params = {};
params['value'] = value;
params[this.options.type[type].targetName] = idTarget;
-
+
ls.ajax(this.options.type[type].url, params, function(result) {
this.onVote(idTarget, objVote, value, type, result);
}.bind(this));
@@ -57,7 +57,7 @@ ls.vote = (function ($) {
ls.msg.error(null, result.sMsg);
} else {
ls.msg.notice(null, result.sMsg);
-
+
var divVoting = $('#'+this.options.prefix_area+type+'_'+idTarget);
divVoting.addClass(this.options.classes.voted);
@@ -67,10 +67,10 @@ ls.vote = (function ($) {
if (value < 0) {
divVoting.addClass(this.options.classes.minus);
}
-
+
var divTotal = $('#'+this.options.prefix_total+type+'_'+idTarget);
var divCount = $('#'+this.options.prefix_count+type+'_'+idTarget);
-
+
if (divCount.length>0 && result.iCountVote) {
divCount.text(parseInt(result.iCountVote));
}
@@ -99,7 +99,7 @@ ls.vote = (function ($) {
}
$(this).trigger('vote',[idTarget, objVote, value, type, result]);
}
-
+
this.onVoteUser = function(idTarget, objVote, value, type, result) {
$('#user_skill_'+idTarget).text(result.iSkill);
}
diff --git a/templates/skin/new-jquery/menu.blog.tpl b/templates/skin/new-jquery/menu.blog.tpl
index f60684d2..217cba9d 100644
--- a/templates/skin/new-jquery/menu.blog.tpl
+++ b/templates/skin/new-jquery/menu.blog.tpl
@@ -33,17 +33,17 @@
{/if}
-
+
{if $oUserCurrent}
{$aLang.userfeed_title}
{/if}
-
+
{$aLang.blog_menu_top}
{if $sMenuItemSelect=='top'}
-
{hook run='menu_people'}
-
+
\ No newline at end of file
diff --git a/templates/skin/new-jquery/menu.profile.tpl b/templates/skin/new-jquery/menu.profile.tpl
index bf03cb4c..b82eb599 100644
--- a/templates/skin/new-jquery/menu.profile.tpl
+++ b/templates/skin/new-jquery/menu.profile.tpl
@@ -20,6 +20,6 @@
{/if}
-
+
{hook run='menu_profile'}
\ No newline at end of file
diff --git a/templates/skin/new-jquery/menu.settings.tpl b/templates/skin/new-jquery/menu.settings.tpl
index 6246df08..cfb8800d 100644
--- a/templates/skin/new-jquery/menu.settings.tpl
+++ b/templates/skin/new-jquery/menu.settings.tpl
@@ -22,8 +22,4 @@
{/if}
{hook run='menu_settings'}
-
-
-
-
-
+
\ No newline at end of file
diff --git a/templates/skin/new-jquery/menu.talk.tpl b/templates/skin/new-jquery/menu.talk.tpl
index 9f4df591..5622f3b5 100644
--- a/templates/skin/new-jquery/menu.talk.tpl
+++ b/templates/skin/new-jquery/menu.talk.tpl
@@ -1,6 +1,6 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/templates/skin/new-jquery/nav.tpl b/templates/skin/new-jquery/nav.tpl
index 4392f6bb..526afe3e 100644
--- a/templates/skin/new-jquery/nav.tpl
+++ b/templates/skin/new-jquery/nav.tpl
@@ -3,16 +3,16 @@
{if $oUserCurrent and ($sAction=='blog' or $sAction=='index' or $sAction=='new' or $sAction=='personal_blog' or $sAction=='feed' or $sAction=='top')}
{$aLang.topic_create}
{/if}
-
-
+
+
{if $menu}
{if in_array($menu,$aMenuContainers)}{$aMenuFetch.$menu}{else}{include file="menu.$menu.tpl"}{/if}
{/if}
-
-
+
+