Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

AjaxQuote

245

Comments

  • 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!

    すぐにライトバック。
  • any way to make this work with the FCKEditor plugin?
  • edited October 2006
    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>&nbsp;</p>
  • that would be sweet, thanks
  • edited October 2006
    @ MySchizoBuddy, about tinyMCE: I tested it on IE 6.0 and FF 1.5 on pc and it was working fine without refreshing the page.

    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 = '&nbsp;'; } 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>&nbsp;</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" });
  • yeah just read about valid elements, added cite to it and now it works. which means that we don't need kses with tinymce. thanks I'll just use ur code
  • TinyMCE stripout what ever you ask him to
  • edited October 2006
    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.
  • IS there a way to check which WYSIWYG is running. if tinymce is running, or fckeditor or bbcode. this way ajaxquote will work for all of em.
  • 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>&nbsp;</p>'; oEditor.InsertHtml(FCKeditorquote ) ; } else alert( 'You must be on WYSIWYG mode!' ) ; return false; }
  • edited October 2006
    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)
  • MySchizoBuddy: awesome, thanks!
  • 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>&nbsp;</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?

    thanks for helping me.
  • fery the patch is already mentioned in this thread
  • so what exactly do i have to do with this code snippet? just adding it into ajaxquote?

    thanks mang :)
  • This thread is confusing :(

    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
  • ur using fckeditor and which quote extension
    If ur using ajaxquote then use this one
    if ur using quotation then use this one
  • :D schizo .. i saw that line of code allready ..the question was not where that code snippet is, it was more a "to where should it go?"


    thanks :)
This discussion has been closed.