X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/c9c3cb4c714911710f606f8dc47d5e65707aff67..0a2b0284b8fcb5a613f1cc3da59fc637d3033363:/forum/skins/default/media/js/osqa.main.js?ds=sidebyside
diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js
index 8d55e50..0cf354f 100644
--- a/forum/skins/default/media/js/osqa.main.js
+++ b/forum/skins/default/media/js/osqa.main.js
@@ -53,12 +53,14 @@ var response_commands = {
var $answer = $('#answer-container-' + id);
$answer.addClass('accepted-answer');
$answer.find('.accept-answer').addClass('on');
+ $answer.find('.accept-answer').attr('title', $answer.find('.accept-answer').attr('bn:on'));
},
unmark_accepted: function(id) {
var $answer = $('#answer-container-' + id);
$answer.removeClass('accepted-answer');
$answer.find('.accept-answer').removeClass('on');
+ $answer.find('.accept-answer').attr('title', $answer.find('.accept-answer').attr('bn:off'));
},
remove_comment: function(id) {
@@ -69,7 +71,11 @@ var response_commands = {
});
},
- insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url, edit_url) {
+ award_points: function(id) {
+ alert('ok');
+ },
+
+ insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url, edit_url, convert_url) {
var $container = $('#comments-container-' + post_id);
var skeleton = $('#new-comment-skeleton-' + post_id).html().toString();
@@ -78,7 +84,8 @@ var response_commands = {
.replace(new RegExp('%USERNAME%', 'g'), username)
.replace(new RegExp('%PROFILE_URL%', 'g'), profile_url)
.replace(new RegExp('%DELETE_URL%', 'g'), delete_url)
- .replace(new RegExp('%EDIT_URL%', 'g'), edit_url);
+ .replace(new RegExp('%EDIT_URL%', 'g'), edit_url)
+ .replace(new RegExp('%CONVERT_URL%', 'g'), convert_url);
$container.append(skeleton);
@@ -118,6 +125,10 @@ var response_commands = {
set_subscription_status: function(text) {
$('.subscription-status').html(text);
+ },
+
+ copy_url: function(url) {
+ $.copy(url);
}
}
@@ -182,10 +193,29 @@ function show_dialog (extern) {
top: options.pos.y,
left: options.pos.x
});
-
+
+ top_position_change = (options.dim.h / 2)
+ left_position_change = (options.dim.w / 2)
+
+ new_top_position = options.pos.y - top_position_change
+ new_left_position = options.pos.x - left_position_change
+
+ if (new_left_position < 0) {
+ left_position_change = 0
+ }
+ if (($(window).scrollTop() - new_top_position) > 0) {
+ top_position_change = 0
+ }
+ if ((options.event.pageY + options.dim.h) > ($(window).height() + $(window).scrollTop())) {
+ top_position_change = options.dim.h
+ }
+ if ((options.event.pageX + options.dim.w) > ($(window).width() + $(window).scrollLeft())) {
+ left_position_change = options.dim.w
+ }
+
$dialog.animate({
- top: "-=" + (options.dim.h / 2),
- left: "-=" + (options.dim.w / 2),
+ top: "-=" + top_position_change,
+ left: "-=" + left_position_change,
width: options.dim.w,
height: options.dim.h
}, 200, function() {
@@ -261,6 +291,8 @@ function process_ajax_response(data, evt, callback) {
} else if (typeof data['commands'] != undefined){
for (var command in data.commands) {
response_commands[command].apply(null, data.commands[command])
+
+
}
if (data['message'] != undefined) {
@@ -535,8 +567,8 @@ $(function() {
var $previewer = $('#previewer');
var $container = $('#editor-metrics');
- var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
- var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
+ var initial_whitespace_rExp = /^[^A-Za-zÐ-Яа-Ñ0-9]+/gi;
+ var non_alphanumerics_rExp = rExp = /[^A-Za-zÐ-Яа-Ñ0-9]+/gi;
var editor_interval = null;
$editor.focus(function() {
@@ -651,11 +683,11 @@ function pickedTags(){
new_tag.addClass('deletable-tag');
var tag_link = $('');
tag_link.attr('rel','tag');
- tag_link.attr('href', scriptUrl + $.i18n._('tags/') + tagname);
+ tag_link.attr('href', scriptUrl + $.i18n._('tags/') + tagname + '/');
tag_link.html(tagname);
var del_link = $('');
del_link.addClass('delete-icon');
- del_link.attr('src', mediaUrl('/media/images/close-small-dark.png'));
+ del_link.attr('src', mediaUrl('media/images/close-small-dark.png'));
setupTagDeleteEvents(del_link, to_target, tagname, reason, true);
@@ -892,8 +924,8 @@ var i18nZh = {
'please confirm offensive':"??????????????????????",
'anonymous users cannot flag offensive posts':'???????????',
'cannot flag message as offensive twice':'???????',
- 'flag offensive cap exhausted':'?????????????5??????',
- 'need >15 points to report spam':"??+15??????????",
+ 'flag offensive cap exhausted':'?????????????5?Â??Â???',
+ 'need >15 points to report spam':"??+15??????Â???Â?",
'confirm delete':"?????/????????",
'anonymous users cannot delete/undelete':"???????????????",
'post recovered':"?????????????",
@@ -971,8 +1003,8 @@ var i18nEs = {
'insufficient privilege':'privilegio insuficiente',
'cannot pick own answer as best':'no puede escoger su propia respuesta como la mejor',
'anonymous users cannot select favorite questions':'usuarios anonimos no pueden seleccionar',
- 'please login':'por favor inicie sesión',
- 'anonymous users cannot vote':'usuarios anónimos no pueden votar',
+ 'please login':'por favor inicie sesión',
+ 'anonymous users cannot vote':'usuarios anónimos no pueden votar',
'>15 points requried to upvote': '>15 puntos requeridos para votar positivamente',
'>100 points required to downvote':'>100 puntos requeridos para votar negativamente',
'please see': 'por favor vea',
@@ -980,31 +1012,31 @@ var i18nEs = {
'daily vote cap exhausted':'cuota de votos diarios excedida',
'cannot revoke old vote':'no puede revocar un voto viejo',
'please confirm offensive':"por favor confirme ofensiva",
- 'anonymous users cannot flag offensive posts':'usuarios anónimos no pueden marcar publicaciones como ofensivas',
+ 'anonymous users cannot flag offensive posts':'usuarios anónimos no pueden marcar publicaciones como ofensivas',
'cannot flag message as offensive twice':'no puede marcar mensaje como ofensivo dos veces',
'flag offensive cap exhausted':'cuota para marcar ofensivas ha sido excedida',
'need >15 points to report spam':"necesita >15 puntos para reportar spam",
- 'confirm delete':"¿Está seguro que desea borrar esto?",
- 'anonymous users cannot delete/undelete':"usuarios anónimos no pueden borrar o recuperar publicaciones",
- 'post recovered':"publicación recuperada",
- 'post deleted':"publicación borrada?",
+ 'confirm delete':"¿Está seguro que desea borrar esto?",
+ 'anonymous users cannot delete/undelete':"usuarios anónimos no pueden borrar o recuperar publicaciones",
+ 'post recovered':"publicación recuperada",
+ 'post deleted':"publicación borrada?",
'add comment':'agregar comentario',
- 'community karma points':'reputación comunitaria',
- 'to comment, need':'para comentar, necesita reputación',
+ 'community karma points':'reputación comunitaria',
+ 'to comment, need':'para comentar, necesita reputación',
'delete this comment':'borrar este comentario',
'hide comments':"ocultar comentarios",
'add a comment':"agregar comentarios",
'comments':"comentarios",
- 'confirm delete comment':"¿Realmente desea borrar este comentario?",
+ 'confirm delete comment':"¿Realmente desea borrar este comentario?",
'characters':'caracteres faltantes',
'can write':'tiene ',
'click to close':'haga click para cerrar',
'loading...':'cargando...',
- 'tags cannot be empty':'las etiquetas no pueden estar vacías',
+ 'tags cannot be empty':'las etiquetas no pueden estar vacÃas',
'tablimits info':"hasta 5 etiquetas de no mas de 20 caracteres cada una",
- 'content cannot be empty':'el contenido no puede estar vacío',
+ 'content cannot be empty':'el contenido no puede estar vacÃo',
'content minchars': 'por favor introduzca mas de {0} caracteres',
- 'please enter title':'por favor ingrese un título',
+ 'please enter title':'por favor ingrese un tÃtulo',
'title minchars':"por favor introduzca al menos {0} caracteres",
'delete':'borrar',
'undelete': 'recuperar',
@@ -1043,7 +1075,7 @@ var i18n_dict = i18n[i18nLang];
/*
* Autocomplete - jQuery plugin 1.0.3
*
- * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
+ * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php