From f836982f8485a0da2b42bf2b6ceb6ba9885f90c7 Mon Sep 17 00:00:00 2001 From: farr3ll Date: Fri, 30 Nov 2012 04:52:01 +0200 Subject: [PATCH 1/3] Issue #23 --- e107_web/js/core/front.jquery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_web/js/core/front.jquery.js b/e107_web/js/core/front.jquery.js index 5f1c38f18..54018c1bf 100644 --- a/e107_web/js/core/front.jquery.js +++ b/e107_web/js/core/front.jquery.js @@ -62,11 +62,11 @@ $(document).ready(function() } 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 { - $(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 } From 84b0c89db9874a64a0e3ad242ee145faaf1d83c9 Mon Sep 17 00:00:00 2001 From: farr3ll Date: Fri, 30 Nov 2012 05:00:20 +0200 Subject: [PATCH 2/3] Issue #25 --- e107_web/js/core/mediaManager.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/e107_web/js/core/mediaManager.js b/e107_web/js/core/mediaManager.js index 5b04cfa63..f16792d28 100644 --- a/e107_web/js/core/mediaManager.js +++ b/e107_web/js/core/mediaManager.js @@ -11,12 +11,22 @@ $(document).ready(function() //alert('hello'); 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.parent.document).append(newval); //FIXME caret!! // 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); // alert(newval); }); From ffc1459e86e266e350883fda57ed49dea72898c4 Mon Sep 17 00:00:00 2001 From: farr3ll Date: Fri, 30 Nov 2012 06:29:25 +0200 Subject: [PATCH 3/3] Issue #23 revision --- e107_web/js/core/front.jquery.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/e107_web/js/core/front.jquery.js b/e107_web/js/core/front.jquery.js index 54018c1bf..33b8b4cb1 100644 --- a/e107_web/js/core/front.jquery.js +++ b/e107_web/js/core/front.jquery.js @@ -56,6 +56,12 @@ $(document).ready(function() $("#comment").val(''); + if($('#comments-container').length){ + alert('true'); + }else{ + $("#e-comment-form").parent().prepend("
"); + } + if(pid != 0) { $('#comment-'+pid).after(a.html).hide().slideDown(800);