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

13»

Comments

  • Does anyone know of a way to hack this add on so it doesn't add the quote link to a whisper? I'm having issues with people accidentally quoting a private conversation to the public thread, and removing the quote link would at least remind them that the whisper wasn't intended for the whole group.
  • hello, everyone
    I changed AjaxQuote.js to make it work with tinymce. Seems to work for me. Not sure how good my coding but its better than nothing i guess.
    I used fckajaxquote extension for reference and tinymce API from their website.

    Here it is:
    // 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(!tinyMCE.get("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 = ' ';
    }

    dm.RequestCompleteEvent = _ajaxquote;
    dm.RequestFailedEvent = _ajaxquote_failure;
    dm.LoadData(baseurl + 'extensions/AjaxQuote/ajax.php?CommentID=' + com_id);

    return false;
    }

    function _ajaxquote(request)
    {
    var input = tinyMCE.get("CommentBox");

    if(g_aq){
    g_aq.className = '';
    g_aq.innerHTML = q_qoute;
    }
    if(!request.responseText || request.responseText=='ERROR'){ _ajaxquote_failure(' - in'); return false;}
    tinyMCE.execCommand('mceInsertContent',false,'
    '+g_com_author+':'+ request.responseText+'
    ');
    tinyMCE.get("CommentBox").focus();
    ScrollToElement(document.getElementById("Form"));

    return false;
    }


    function _ajaxquote_failure(e){
    tinyMCE.get("CommentBox").focus();
    ScrollToElement(document.getElementById("Form"));
    alert(ajaxqoute_errormessage+e);
    return false;
    }

    function ScrollToElement(theElement){

    var selectedPosX = 0;
    var selectedPosY = 0;

    while(theElement != null){
    selectedPosX += theElement.offsetLeft;
    selectedPosY += theElement.offsetTop;
    theElement = theElement.offsetParent;
    }
    window.scrollTo(selectedPosX,selectedPosY);

    }
Sign In or Register to comment.