Not signed in (Sign In)

Categories

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006
     # 1
    If you're using the latest Vanilla revision, and wondering why the Quotations extension wasn't working, well I fixed it. The changes to the XHTML templates were messing up the javascript, causing it to return blanks. All has been rectified.

    Also I updated the stylesheet to reflect the new layout, and to be a little more "Vanilla-like".

    Get it here

    Screenshot:
    •  
      CommentAuthorjsanders
    • CommentTimeApr 21st 2006
     # 2
    you don't have enough info in the header for it to be recognized.

    i added Extension Url: and it worked.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006
     # 3
    Whoops. Fixed.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 4
    i had already rewritten your extension to work with the new DOM and combined it with some other dude's quote extension that works with partial selection too. it took me a while to figure out the xhtml, so i'll be interested to see "the right way to do it" :)
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006
     # 5
    Oooh, partial selection would be cool.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 6
    nothing to it... document.getSelection(). just be sure to use onmousedown instead of onclick, because lots of browsers including firefox 1.5 clear the selection before onclick fires.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006
     # 7
    Hmm, document.getSelection() only returns text, though.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 8
    how do you mean? isn't it supposed to? :)

    oh, you mean like if i selected some text and an image, i'd want the image included?

    maybe there's a clever solution but i can't think of it. maybe match the first part and the last part of the selection, using the comment id as identified by the quote link, with a regex, to pull the rest of the stuff in between. sounds unreliable at best :)

    anyway my users are happy with the partial selection as it works now.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 9
    you might also try messing with a mysterious property called anchorOffset - i can't find much documentation about it, but it supposedly marks the start of the selection as related to the beginning of the text in the node.
    •  
      CommentAuthorsoupenvy
    • CommentTimeApr 21st 2006
     # 10
    Any working versions of the Quotations extension for a very recent 0.9.3?
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006 edited
     # 11
    Any working versions of the Quotations extension for a very recent 0.9.3?
    The version linked above was tested with revision #358, and seems to work fine. (certainly better than it worked before)
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006 edited
     # 12
    hey bergamot, check this out!

    function quote() {
    var d = document.createElement("p"), s = getSelection();
    for(var i = 0; i < s.rangeCount; ++i)
    {
    var r = s.getRangeAt(i);
    if (!r.collapsed) d.appendChild(r.cloneContents());
    }
    alert(d.innerHTML);
    }


    put that in a document with some html-formatted text, and call quote with onmousedown when you've got a selection. it worked perfectly for me in firefox 1.5!
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006 edited
     # 13
    well, almost perfectly. it catches everything except the outermost tag.
    for example if i select all of this: ddddddsss

    it returns ddd<u>ddd</u>sss, so it's missing the <em> tags.

    but i think i can make it work.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006 edited
     # 14
    Ok, I made those changes and reuploaded it. Seems to work fine, and I didn't run into your bug (probably because I wasn't using innerHTML, which is evil).

    In Internet Explorer, it just ignores the selection and quotes the whole post; I'll mess with that later.

    My code is here, if you want to look at it.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 15
    hmm... doesn't work for me in firefox 1.5.0.2

    oh, i think i see. you need to use onmousedown instead of onclick for the quote link.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 16
    yeah, that fixed it.
    • CommentAuthorithcy
    • CommentTimeApr 21st 2006
     # 17
    but there is another problem.
    no matter where i click quote on the page, it always cites the author of the last comment on the page. i had that problem for a while and i ended up having to re-analyze the dom tree and get all the elements by a different method.

    my code is here but it looks nothing like yours :)
    also i haven't added the new appendChild business yet.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 21st 2006 edited
     # 18
    OK

    I think it's finally working. Of course, I thought that the last time, and there were still bugs.

    Anyone want to try it?

    Ithcy: I ended up using some of your code.
    •  
      CommentAuthorsoupenvy
    • CommentTimeApr 22nd 2006 edited
     # 19
    Yup works perfect, (by works perfect I mean I barely tested it but it does now get the new quote).

    You can try it out over at this board
    •  
      CommentAuthorBergamot
    • CommentTimeApr 22nd 2006 edited
     # 20
    •  
      CommentAuthorblizeH
    • CommentTimeApr 22nd 2006
     # 21
    And that right there is the exact reason I won't be bothering to install any quote feature on my site :P

    Still a very nice extension, good work Bergamot!
    • CommentAuthorithcy
    • CommentTimeApr 23rd 2006
     # 22
    Nice, Bergamot.
    This is of course a personal preference, but you might want to think about adding a commentField.focus(); to the quote function.
    •  
      CommentAuthorJan
    • CommentTimeApr 24th 2006
     # 23
    Looking good, Bergamot. Do you have any plans of adding language definitions to it?
    •  
      CommentAuthorhutstein
    • CommentTimeApr 24th 2006 edited
     # 24
    I can´t install the extension it isn´t listed in the "extension list", i´ve copied it in the extensions folder...

    but when i install it manually in settings/extensions.php it works.
    • CommentAuthorithcy
    • CommentTimeApr 24th 2006
     # 25
    i had that problem too. if you go into Quotations/default.php and change

    Extension Url:
    to
    Extension Url: null

    it will show up in the extensions list.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 24th 2006
     # 26
    ithcy: done, and done :)
    •  
      CommentAuthorsoupenvy
    • CommentTimeApr 24th 2006
     # 27
    And that right there is the exact reason I won't be bothering to install any quote feature on my site :P


    Don't let that deter you, the extension is used quite properly outside of that thread. They were just loving the brand new quote feature, in the appropriate discussion too I might add. They celebrated by going nuts with the quoting!
    •  
      CommentAuthoruzi
    • CommentTimeApr 25th 2006
     # 28
    The extension doesn't work for me.... it shows only <blockquote><cite>Posted By: uzi</cite>hallo</blockquote> but not the formatted quotation... :(((

    P.S. Text Mode is not enabled
    • CommentAuthorjakob_r
    • CommentTimeApr 25th 2006 edited
     # 29
    Is there a way of testing for the existence of other extensions?

    Bergamot, as you wrote, if I change the variables at the top of quote.js as follows it will work with textile too:

    var tagOpenQuote = "bq. ";
    var tagOpenCite = "??";
    var tagCloseQuote = "";
    var tagCloseCite = "??";


    but the TextileFormatter wraps an extra set of p-tags around all of "commentText" resulting in invalid code. It's easy enough to take out of the relevant textile function to get it working, but it would be better if it did that "when the quotations extensions is active". How would I go about testing for that in the following php function:


    if ($tag == "bq") {
    $cite = $this->checkRefs($cite);
    $cite = ($cite != '') ? ' cite="' . $cite . '"' : '';
    // $start = "\t<blockquote$cite>\n\t\t<p";
    $start = "\t<blockquote$cite>\n\t\t"; // replacement without opening-p-tag
    // $end = "</p>\n\t</blockquote>";
    $end = "\n\t</blockquote>"; // replacement without closing-p-tag
    }

    // return "$start$atts>$content$end";
    return "$start$atts$content$end"; // replacement without closing-angle-bracket



    As you can see, the "// commented out" lines are the original code. Possibly it would be better to have an entirely separate replacement textile-bq-function-when-quotes-extension-active to make it easier to manage updating.

    Alternatively, would it be better to test around the other way, i.e. from the quotation extension to test if textileformatter or markdownformatter is active? I guess it depends upon the order in which they're processed.

    BTW: Bergamot, I like the ability to highlight just a portion of the text and then click "quote". Neat.
    •  
      CommentAuthorBergamot
    • CommentTimeApr 25th 2006
     # 30
    I'll take a look at it a little later
    • CommentAuthorLoOkHerE
    • CommentTimeMay 5th 2006
     # 31
    uzi: did you get it to work. I'm having the same problem in the pre-release version of vanilla
    •  
      CommentAuthorBergamot
    • CommentTimeMay 5th 2006
     # 32
    I'll upgrade to pre-release tomorrow and take a look at it.
    •  
      CommentAuthorjsanders
    • CommentTimeMay 5th 2006
     # 33
    do you have the html formatter extension turned on?
    •  
      CommentAuthorjaredb
    • CommentTimeMay 5th 2006 edited
     # 34
    will this extension work if you have the BBcode extension installed? I also have the same problem as uzi

    edit: The only way I got this working was by installing the HTMLFormatter extension and it ONLY worked when I chose the HTML as the comment format type.
    •  
      CommentAuthorBergamot
    • CommentTimeMay 5th 2006 edited
     # 35
    Yeah, if you want it to do bbcode, you have to edit the javascript file.

    Eventually I'd like to assemble scripts for each different markup language.
    •  
      CommentAuthoruzi
    • CommentTimeMay 6th 2006
     # 36
    Hm... but I don't want to enable HTML in the comments. BBcode would be much better solution for me and for all others, who want to use the extension with BBcode.

    To jaredb & LoOkHerE: without enabling HTML it doesn't work :(
    •  
      CommentAuthorBergamot
    • CommentTimeMay 6th 2006
     # 37
    It will work fine with BBCode once someone modifies the javascript to output BBCode instead of HTML. The code was designed so this would be pretty easy to do.

    Until then, it's HTML only.
    •  
      CommentAuthorBergamot
    • CommentTimeMay 6th 2006
     # 38
    Hmmmm, I took a look at it, and changed the script to output BBCode.

    Two problems though:
    1. The BBCode extension doesn't support the blockquote or cite elements. This is easy to fix.
    2. The BBCode extension doesn't support nesting similar tags. This is a major problem, and I don't know how to fix it.
    • CommentAuthorithcy
    • CommentTimeMay 6th 2006
     # 39
    i have an idea!

    ban bbcode from the earth for all eternity.
    •  
      CommentAuthorBergamot
    • CommentTimeMay 6th 2006
     # 40
    Ok, I wrote a new Better BBCode Extension that fixes both of those problems, and quoting works great! I'll release the files once I'm sure there aren't any glaring bugs.
    •  
      CommentAuthorBergamot
    • CommentTimeMay 6th 2006
     # 41
    Ok because I don't have time to put together packages for the addin page tonight, you can get the Better BBCode Extension 1.0 here, and the BBCode javascript file for the Quotations Extension here.
    •  
      CommentAuthoruzi
    • CommentTimeMay 7th 2006
     # 42
    WOW! So quick! The new version works perfect for text, but with smileys there is a problem....

    The Extension quotes the smileys as an HTML code (actually like they are shown in the HTML sourcecode of the page), but it shouldn't. Here an examlple:

    The comment I want to quote is typed in in this way, is also shows up so if I click on the edit button:

    dfgsfgsfg :D :P -> :D and :P are smileys inserted with the Vanillacons extension

    The Quotation-Extension quotes this text on that way:

    [quote][cite]Posted By: uzi[/cite]dfgsfgsfg[img title=:D alt=:D]extensions/Vanillacons/smilies/standard/:D.gif[/img][img title=:P alt=:P]extensions/Vanillacons/smilies/standard/:P.gif[/img][/quote]

    after that the smileys are not shown in the qoute due to the disabled HTML.

    So the quotation should be like that:

    [quote][cite]Posted By: uzi[/cite]dfgsfgsfg :D :P[/quote]

    Then we automatically let the Vanillacons extension convert the smileys and everything works right.

    Any ideas?
    •  
      CommentAuthorBergamot
    • CommentTimeMay 7th 2006
     # 43
    Try it now :D
    •  
      CommentAuthoruzi
    • CommentTimeMay 7th 2006
     # 44
    Yeah! Now it works well with smileys :)
    •  
      CommentAuthorjaredb
    • CommentTimeMay 7th 2006
     # 45
    sweet! will give it a shot later.. will the new updated quotations work w/ both the html and bbcode at the same time?
    •  
      CommentAuthorBergamot
    • CommentTimeMay 7th 2006 edited
     # 46
    will the new updated quotations work w/ both the html and bbcode at the same time?
    No, because there's no way to know which format markup the user is going to use at the time the quote button is pressed.

    Then again, most forums only have one markup choice, and maybe plain text, so I didn't see it being much of an issue.
    •  
      CommentAuthorBergamot
    • CommentTimeMay 7th 2006
     # 47
    I uploaded the new version with BBCode and language support.
    •  
      CommentAuthorjaredb
    • CommentTimeMay 8th 2006
     # 48
    so I installed the new quotation extension and I recieve the following error... when clicking on a thread.

    Fatal error: Call to a member function on a non-object in /home/answerus/domains/answerus.com/public_html/community/extensions/Quotations/default.php on line 25

    i looked at the code but from what i can tell it looks ok... i wish i had a better grasp on php so i could fix myself... anyone wanna take on a student?

    hehe
    •  
      CommentAuthorBergamot
    • CommentTimeMay 8th 2006 edited
     # 49
    Hmm, that seems like a problem with the way I'm accessing the language dictionary; I'll have to look at it later.

    EDIT: for now, replace that line with:
    $CommentList .= '<a onmousedown="quote(this);">quote</a>';
    •  
      CommentAuthorjaredb
    • CommentTimeMay 8th 2006
     # 50
    that worked... what exactly does this do differently that the original code?