});\r
},\r
\r
- insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url, edit_url) {\r
+ award_points: function(id) {\r
+ alert('ok');\r
+ },\r
+\r
+ insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url, edit_url, convert_url) {\r
var $container = $('#comments-container-' + post_id);\r
var skeleton = $('#new-comment-skeleton-' + post_id).html().toString();\r
\r
.replace(new RegExp('%USERNAME%', 'g'), username)\r
.replace(new RegExp('%PROFILE_URL%', 'g'), profile_url)\r
.replace(new RegExp('%DELETE_URL%', 'g'), delete_url)\r
- .replace(new RegExp('%EDIT_URL%', 'g'), edit_url);\r
+ .replace(new RegExp('%EDIT_URL%', 'g'), edit_url)\r
+ .replace(new RegExp('%CONVERT_URL%', 'g'), convert_url);\r
\r
$container.append(skeleton);\r
\r
\r
set_subscription_status: function(text) {\r
$('.subscription-status').html(text);\r
+ },\r
+\r
+ copy_url: function(url) {\r
+ $.copy(url);\r
}\r
}\r
\r
top: options.pos.y,\r
left: options.pos.x\r
});\r
-\r
+ \r
+ top_position_change = (options.dim.h / 2)\r
+ left_position_change = (options.dim.w / 2)\r
+ \r
+ new_top_position = options.pos.y - top_position_change\r
+ new_left_position = options.pos.x - left_position_change\r
+ \r
+ if (new_left_position < 0) {\r
+ left_position_change = 0\r
+ }\r
+ if (($(window).scrollTop() - new_top_position) > 0) {\r
+ top_position_change = 0\r
+ }\r
+ if ((options.event.pageY + options.dim.h) > ($(window).height() + $(window).scrollTop())) {\r
+ top_position_change = options.dim.h\r
+ }\r
+ if ((options.event.pageX + options.dim.w) > ($(window).width() + $(window).scrollLeft())) {\r
+ left_position_change = options.dim.w\r
+ }\r
+ \r
$dialog.animate({\r
- top: "-=" + (options.dim.h / 2),\r
- left: "-=" + (options.dim.w / 2),\r
+ top: "-=" + top_position_change,\r
+ left: "-=" + left_position_change,\r
width: options.dim.w,\r
height: options.dim.h\r
}, 200, function() {\r
for (var command in data.commands) {\r
response_commands[command].apply(null, data.commands[command])\r
\r
+\r
}\r
\r
if (data['message'] != undefined) {\r
var $previewer = $('#previewer');\r
var $container = $('#editor-metrics');\r
\r
- var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;\r
- var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;\r
+ var initial_whitespace_rExp = /^[^A-Za-zА-Яа-я0-9]+/gi;\r
+ var non_alphanumerics_rExp = rExp = /[^A-Za-zА-Яа-я0-9]+/gi;\r
var editor_interval = null;\r
\r
$editor.focus(function() {\r
tag_link.html(tagname);\r
var del_link = $('<img></img>');\r
del_link.addClass('delete-icon');\r
- del_link.attr('src', mediaUrl('/media/images/close-small-dark.png'));\r
+ del_link.attr('src', mediaUrl('media/images/close-small-dark.png'));\r
\r
setupTagDeleteEvents(del_link, to_target, tagname, reason, true);\r
\r