This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 1.09 KB  |  views: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.       // Quote Text
  2.       var $m = $('#canvas_frame').contents();
  3.       var orig_button = $m.find('.fa.eL')
  4.       var button = '<img id=":kl" class="fa eL blockquote-sel" src="images/cleardot.gif" command="+BLOCKQUOTE_TEXT" title="Quote" unselectable="on">';
  5.       var $ta = $m.find('iframe.Am.Al.editable').contents();
  6.       // Only add when it's not there.
  7.       if ( ! orig_button.next().hasClass('blockquote')) {
  8.        
  9.         orig_button.after(button);
  10.         orig_button.next().unbind().click(function() {
  11.           var selection = $m[0].getSelection().toString();
  12.           var quote = [
  13.             "<div><br></div>",
  14.             '<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">' + selection + "</blockquote>",
  15.             "<div><br></div>"
  16.           ].join('');
  17.          
  18.           console.log('Doing it.');
  19.           // body can be empty.
  20.           $ta.find('body').html($ta.find('body').html() + quote);
  21.         });
  22.       }
clone this paste RAW Paste Data