#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Aug 29, 2013 22:56:03 GMT -8
Short of manually converting each HTML element into a piece of BBCode, can anyone think of any creative ways to get the BBCode source of a post?
(I'm really thinking this one is not possible.)
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Aug 30, 2013 7:41:56 GMT -8
The WYSIWYG has an html2bbcode function that's probably your best bet.
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Aug 30, 2013 7:59:55 GMT -8
I'm referring to getting this data from the post list page, not the post editor. Is the WYSIWYG available there? If so, can it handle the HTML of the rendered post from the post list, or does it have to be the HTML from the WYSIWYG on the editor page?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Aug 30, 2013 8:28:22 GMT -8
You should be able to pass in a string, so the full html of the post should work just fine. You might have to figure out how to get that function on that page, or at worst, extract the relevant function from the WYSIWYG page js and add it into a plugin or template.
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Aug 30, 2013 12:26:44 GMT -8
Sounds good, thanks!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 1, 2013 10:47:23 GMT -8
Since calls to that function will generate an AJAX request (if not in cache) I'll take this as confirmation and established precedence regarding actions that may indirectly trigger AJAX calls are to be considered OK (woohoo!). I can now say this without invoking my constitutional right against self incrimination. Here's a working example of usage taken from a recent plugin (although this is executing from posting page). The "w" is referencing the wysiwyg data object (widget instance) which wouldn't exists on a page that did not have the wysiwyg initialized which means you would need to use the wysiwyg prototype ($.ui.wysiwyg.prototype) and also likely (can't recall for this particular method) have to fake a few properties (e.g wysiwyg textarea, smiley toggle field, etc.) to get the method to think wysiwyg exists before calling it and avoid reference errors (pretty much what the Quick Reply buttons code does on thread pages) code:function insertSavedQuote(quotes) { if (w.currentEditorName == "visual") { var frag = document.createDocumentFragment(), quotes = $(quotes + "<br />").get() $.each(quotes, function () { frag.appendChild(this); }) w.editors[w.currentEditorName].replaceSelection(frag) } else if (w.currentEditorName == "bbcode") { w.html2bbcode(quotes, { success : function (c) { w.editors[w.currentEditorName].replaceSelection(c + "\n"); // collapse any selection if (typeof w.editors[w.currentEditorName].textarea.selectionStart != 'undefined') { w.editors[w.currentEditorName].textarea.selectionStart = w.editors[w.currentEditorName].textarea.selectionEnd; } else { w.editors[w.currentEditorName].range.collapse(false); w.editors[w.currentEditorName].range.select(); } }, error : function () { proboards.alert("There was a problem inserting your quote(s) into the editor, please switch to the PREVIEW tab if not already there and try again"); } }); } } It was changed to a callback (error/success) model during the "leave page" AJAX debacle RedBassett so if you need further examples of usage or more details let me know Arrested Development" Software designed to push the boundaries of what is legally possible"
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Sept 1, 2013 11:07:00 GMT -8
That code snippet is great, thanks!
|
|
inherit
200668
0
Oct 7, 2013 11:55:31 GMT -8
zlatovlaska980
13
October 2013
zlatovlaska980
|
Post by zlatovlaska980 on Oct 6, 2013 1:51:06 GMT -8
I also want to clean bb code
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Oct 7, 2013 8:32:56 GMT -8
I also want to clean bb code I'm not sure what you're asking...
|
|
inherit
200668
0
Oct 7, 2013 11:55:31 GMT -8
zlatovlaska980
13
October 2013
zlatovlaska980
|
Post by zlatovlaska980 on Oct 7, 2013 8:48:59 GMT -8
I also want to clean bb code I'm not sure what you're asking... I ask and insist that require
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Oct 7, 2013 12:20:29 GMT -8
still not a question. you need to ask a question if you want an answer. I realize english isnt your native language, so you need to find a better way to translate your question.
|
|