raidybor, I suspect you are having me on, your English is fine, I certainly have a much better chance at understanding it than å…¶å®žæˆ‘å¾ˆæƒ³å’Œä½ ä»¬äº¤æµ.
French, Spanish even German I have a hope of understanding but å…¶å®žæˆ‘å¾ˆæƒ³å’Œä½ ä»¬äº¤æµ is all Greek to me!
Ok i'm looking into to make it work for fckeditor. Dinoboff, tinymce doesn't like the cite tag. it strips it leaving only the blockquote <blockquote> MySchizoBuddy:some text<br /></blockquote><p> </p>
Vanilla need a formatter to display your text. And this formatter need to strip out some of the html code, because the badguy can send his post with js off, and post whatever nasty things.
plus how do i make ajaxquote.js appear after fckeditor.js
cause it doessn't run the first time because it cannot find the required function, refresh it then it works.
ok here is the fckeditor one same as dinoboff function _ajaxquote(request)
{
var input = document.getElementById("CommentBox");
if(g_aq){
g_aq.className = '';
g_aq.innerHTML = q_qoute;
}
if(!request.responseText || request.responseText=='ERROR'){ _ajaxquote_failure(); return false;}
var oEditor = FCKeditorAPI.GetInstance('Body') ;
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
{
var FCKeditorquote = '<blockquote><cite>Posted by: '+g_com_author+'</cite>'+ request.responseText+'</blockquote><p> </p>';
oEditor.InsertHtml(FCKeditorquote ) ; }
else
alert( 'You must be on WYSIWYG mode!' ) ;
return false;
}
To make ajaxquote work with the WYSIWYGeditor without the user changing the code of AjaxQuote, you can add the modified ajaxquote.js to the WYSIWYGeditor package and add this to the WYSIWYGeditor code: function SwapAjaxQuoteScript(&$Head, $ScriptRoot, $NewLocation, $ScriptLocation = 'extensions/AjaxQuote/ajaxquote.js') {
$ScriptPath = $ScriptLocation;
if ($ScriptRoot != '') $ScriptPath = ConcatenatePath($ScriptRoot, $ScriptLocation);
for ($i = 0; $i < count($Head->Scripts); $i++) {
if ($Head->Scripts[$i] == $ScriptPath) {
$Head->Scripts[$i] = $NewLocation;
if ($ScriptRoot != '') $Head->Scripts[$i] = ConcatenatePath($ScriptRoot, $NewLocation);
return;
}
}
}
SwapAjaxQuoteScript($Head, $Context->Configuration['WEB_ROOT'], 'extensions/WYSIWYGeditor/ajaxquote.js')
If the WYSIWYGeditor have been installed after the AjaxQuote extension, it should work. (not tested)
for people using quotations use this in quote.js function quote(commentId, authorId, authorName)
{
var selText = getSel();
var commentText = "";
commentText = dumpCodeTree(document.getElementById("CommentBody_" + commentId));
if(selText != "")
commentText = selText;
var oEditor = FCKeditorAPI.GetInstance('Body') ;
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) {
var FCKeditorquote = '<blockquote><cite>'+authorName+'</cite> '+ commentText+'</blockquote><p> </p>';
oEditor.InsertHtml(FCKeditorquote ) ; }
else
alert( 'You must be on WYSIWYG mode!' ) ;
}
its actually a bit late here in good old europe and my eyes are very tired to sort out the necessary infos in this discussion ... is here a solution how to use quotes with fck?
Can I disable my current quote extension and just use this in it's place, or will I need to apply all of these patches being posted about everywhere? :P Cheers
Comments
French, Spanish even German I have a hope of understanding but å…¶å®žæˆ‘å¾ˆæƒ³å’Œä½ ä»¬äº¤æµ is all Greek to me!
ã™ãã«ãƒ©ã‚¤ãƒˆãƒãƒƒã‚¯ã€‚
Dinoboff, tinymce doesn't like the cite tag. it strips it leaving only the blockquote
<blockquote> MySchizoBuddy:some text<br /></blockquote><p> </p>
here's extensions/AjaxQuote/ajaxquote.js :
// customize var ajaxqoute_format = 'Html'; // 'Html' or 'BBCode' var ajaxqoute_errormessage = "Some Error occured while retriving qoute!\nIt's either server problem or comment doesn't exist anymore."; // var g_com_author, q_qoute, g_aq; function ajaxquote(baseurl, com_id, com_author) { if(!document.getElementById("CommentBox")) return true; g_com_author=com_author; var dm = new DataManager(); if((g_aq=document.getElementById('AjaxQuote_' + com_id))){ g_aq.className = 'HideProgress'; q_qoute = g_aq.innerHTML; g_aq.innerHTML = ' '; } if(document.getElementById("BBBar") && ajaxqoute_format == 'BBCode') document.getElementById("BBBar").style.display = ''; if(document.getElementById("Radio_"+ajaxqoute_format)) document.getElementById("Radio_"+ajaxqoute_format).checked = true; dm.RequestCompleteEvent = _ajaxquote; dm.RequestFailedEvent = _ajaxquote_failure; dm.LoadData(baseurl + 'extensions/AjaxQuote/ajax.php?CommentID=' + com_id); return false; } function _ajaxquote(request) { if(g_aq){ g_aq.className = ''; g_aq.innerHTML = q_qoute; } if(!request.responseText || request.responseText=='ERROR'){ _ajaxquote_failure(); return false;} var tinyMCEquote = '<blockquote><cite>'+g_com_author+': </cite>'+ request.responseText+'</blockquote><p> </p>'; tinyMCE.execCommand("mceInsertContent",false,tinyMCEquote); return false; } function _ajaxquote_failure(){ document.getElementById("CommentBox").focus(); alert(ajaxqoute_errormessage); return false; }
Here's my tinyMCE settings:
tinyMCE.init({ mode : "exact", elements : "CommentBox", theme : "advanced", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,link,unlink,image,separator,formatselect,removeformat,code", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_buttons4 : "", valid_elements : "" +"a[accesskey|class|href|tabindex|title|target]," +"abbr[class|title]," +"acronym[class|title]," +"address[class|title]," +"big[class|title]," +"blockquote[cite|class|title]," +"br[class|title]," +"button[accesskey|class|name|tabindex|title|type|value]," +"cite[class|lang|title]," +"code[class|title]," +"dd[class|title]," +"dfn[class|lang|title]," +"div[align<center?left?right|class]," +"dl[class|compact<compact|lang|title]," +"dt[class|lang|title]," +"em/i[class|title]," +"fieldset[class|lang|title]," +"font[class|color|dir<ltr?rtl|face|size|title]," +"h1[align<center?left?right|class|title]," +"h2[align<center?left?right|class|title]," +"h3[align<center?left?right|class|title]," +"h4[align<center?left?right|class|title]," +"h5[align<center?left?right|class|title]," +"h6[align<center?left?right|class|title]," +"hr[align<center?left?right|class|noshade|size|title|width]," +"img[align<bottom?left?middle?right?top|alt|height|src|title|width]," +"legend[accesskey|align<center?left?right|class|lang|title]," +"li[class|title|type]," +"ol[class|compact<compact|start|title|type]," +"p[align<center?left?right|class|title]," +"pre/listing/plaintext/xmp[class|title|width]," +"q[cite|class|title]," +"s[class|title]," +"small[class|title]," +"span[align<center?left?right|class|title]," +"strike[class|title]," +"strong/b[class|title]," +"sub[class|title]," +"sup[class|title]," +"u[class|title]," +"ul[class|compact<compact|title|type]," +"var[class|title]", language : "en", convert_fonts_to_spans : false, theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,blockquote,code", inline_styles : false, theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, theme_advanced_resize_horizontal : false, content_css : "/Vanilla/extensions/WYSIWYGeditor/themes/style/styleContent.css", editor_css : "/Vanilla/extensions/WYSIWYGeditor/themes/style/styleEditor.css" });
same as dinoboff
function _ajaxquote(request) { var input = document.getElementById("CommentBox"); if(g_aq){ g_aq.className = ''; g_aq.innerHTML = q_qoute; } if(!request.responseText || request.responseText=='ERROR'){ _ajaxquote_failure(); return false;} var oEditor = FCKeditorAPI.GetInstance('Body') ; if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) { var FCKeditorquote = '<blockquote><cite>Posted by: '+g_com_author+'</cite>'+ request.responseText+'</blockquote><p> </p>'; oEditor.InsertHtml(FCKeditorquote ) ; } else alert( 'You must be on WYSIWYG mode!' ) ; return false; }
function SwapAjaxQuoteScript(&$Head, $ScriptRoot, $NewLocation, $ScriptLocation = 'extensions/AjaxQuote/ajaxquote.js') { $ScriptPath = $ScriptLocation; if ($ScriptRoot != '') $ScriptPath = ConcatenatePath($ScriptRoot, $ScriptLocation); for ($i = 0; $i < count($Head->Scripts); $i++) { if ($Head->Scripts[$i] == $ScriptPath) { $Head->Scripts[$i] = $NewLocation; if ($ScriptRoot != '') $Head->Scripts[$i] = ConcatenatePath($ScriptRoot, $NewLocation); return; } } } SwapAjaxQuoteScript($Head, $Context->Configuration['WEB_ROOT'], 'extensions/WYSIWYGeditor/ajaxquote.js')
If the WYSIWYGeditor have been installed after the AjaxQuote extension, it should work. (not tested)
use this in quote.js
function quote(commentId, authorId, authorName) { var selText = getSel(); var commentText = ""; commentText = dumpCodeTree(document.getElementById("CommentBody_" + commentId)); if(selText != "") commentText = selText; var oEditor = FCKeditorAPI.GetInstance('Body') ; if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) { var FCKeditorquote = '<blockquote><cite>'+authorName+'</cite> '+ commentText+'</blockquote><p> </p>'; oEditor.InsertHtml(FCKeditorquote ) ; } else alert( 'You must be on WYSIWYG mode!' ) ; }
thanks for helping me.
thanks mang
Can I disable my current quote extension and just use this in it's place, or will I need to apply all of these patches being posted about everywhere? :P Cheers
If ur using ajaxquote then use this one
if ur using quotation then use this one
thanks