mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 15:46:44 +02:00
@@ -56,17 +56,23 @@ $(document).ready(function()
|
|||||||
|
|
||||||
$("#comment").val('');
|
$("#comment").val('');
|
||||||
|
|
||||||
|
if($('#comments-container').length){
|
||||||
|
alert('true');
|
||||||
|
}else{
|
||||||
|
$("#e-comment-form").parent().prepend("<div id='comments-container'></div>");
|
||||||
|
}
|
||||||
|
|
||||||
if(pid != 0)
|
if(pid != 0)
|
||||||
{
|
{
|
||||||
$('#comment-'+pid).after(a.html).hide().slideDown(800);
|
$('#comment-'+pid).after(a.html).hide().slideDown(800);
|
||||||
}
|
}
|
||||||
else if(sort == 'desc')
|
else if(sort == 'desc')
|
||||||
{
|
{
|
||||||
$(a.html).prependTo('#comments-container').hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
|
$('#comments-container').prepend(a.html).hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$(a.html).appendTo('#comments-container').hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
|
$('#comments-container').append(a.html).hide().slideDown(800); // FIXME - works in jquery 1.7, not 1.8
|
||||||
alert('Thank you for commenting'); // possibly needed as the submission may go unoticed by the user
|
alert('Thank you for commenting'); // possibly needed as the submission may go unoticed by the user
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,12 +11,22 @@ $(document).ready(function()
|
|||||||
|
|
||||||
//alert('hello');
|
//alert('hello');
|
||||||
if(!target){return true; }
|
if(!target){return true; }
|
||||||
|
|
||||||
|
//console.log($('#' + target, window.top.document).attr('value'));
|
||||||
|
|
||||||
|
var cursorIndex = $('#' + target, window.top.document).attr("selectionStart");
|
||||||
|
var lStr = $('#' + target, window.top.document).attr('value').substr(0,cursorIndex) + " " + newval + " ";
|
||||||
|
var rStr = $('#' + target, window.top.document).attr('value').substr(cursorIndex);
|
||||||
|
|
||||||
|
$('#' + target, window.top.document).attr('value',lStr+rStr);
|
||||||
|
$('#' + target, window.top.document).attr("selectionStart",lStr.length);
|
||||||
|
|
||||||
//('#' + target, window.top.document).insertAtCaret(newVal);
|
//('#' + target, window.top.document).insertAtCaret(newVal);
|
||||||
|
|
||||||
// $('#' + target, window.parent.document).append(newval); //FIXME caret!!
|
// $('#' + target, window.parent.document).append(newval); //FIXME caret!!
|
||||||
// var t = $('#' + target, window.parent.document).text();
|
// var t = $('#' + target, window.parent.document).text();
|
||||||
|
|
||||||
$('#' + target, window.top.document).attr('value',newval); // set new value
|
//$('#' + target, window.top.document).attr('value',newval); // set new value
|
||||||
// inserttext(newval,target);
|
// inserttext(newval,target);
|
||||||
// alert(newval);
|
// alert(newval);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user