AniDB RTE: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
(→‎Supported tags: Added spoiler tag)
mNo edit summary
Line 11: Line 11:


An RTE is usually an html document within an iframe with the contentEditable attribute enabled which allows for the editing of the document in your browser, there is then a set of basic commands for doing basic commands, these basic commands are done via the document.execCommand command, stuff like bold, italic and so on are applied with this command, execCommand also has another functions to control how an RTE works.<br />
An RTE is usually an html document within an iframe with the contentEditable attribute enabled which allows for the editing of the document in your browser, there is then a set of basic commands for doing basic commands, these basic commands are done via the document.execCommand command, stuff like bold, italic and so on are applied with this command, execCommand also has another functions to control how an RTE works.<br />
The RTE interface was developed by microsoft and ported to other browsers by their respective vendors, much like the xmlhttprequest function that is core of AJAX.
The RTE interface was developed by Microsoft and ported to other browsers by their respective vendors, much like the xmlhttprequest function that is core of AJAX.


The content of the edited document is then sent by some way to the server, usually by an HTTP POST command, server then store the content and after display it.
The content of the edited document is then sent by some way to the server, usually by an HTTP POST command, server then store the content and after display it.
Line 21: Line 21:
== The AniDB case ==
== The AniDB case ==


AniDB doesn't store html formated content like many other sites do, anidb had for a long time a kind of tags, much like to the phpbb forum, like [b]some bold text[/b] and so on.<br />
AniDB doesn't store html formatted content like many other sites do, AniDB had for a long time a kind of tags, much like to the phpBB forum, like [b]some bold text[/b] and so on.<br />
Whenever you used one of these tags in a review or message or whatever those tags were then saved to the server and then parsed and converted to html content on display by the server, so the above text would be returned as "'''some bold text'''".
Whenever you used one of these tags in a review or message or whatever those tags were then saved to the server and then parsed and converted to html content on display by the server, so the above text would be returned as "'''some bold text'''".


Line 35: Line 35:
* [quote]...[/quote] - quoted text without name
* [quote]...[/quote] - quoted text without name
* [quote=USERNAME]...[/quote] - quoted text with name referenced
* [quote=USERNAME]...[/quote] - quoted text with name referenced
* [code]...[/code] - non-formated text
* [code]...[/code] - non-formatted text
* [spoiler]...[/spoiler] - text is hidden; visibility of text can be toggled using "Show/Hide Spoiler" button
* [spoiler]...[/spoiler] - text is hidden; visibility of text can be toggled using "Show/Hide Spoiler" button
* [url]HREF[/url] - link to url where text is the same as the url (can only be used to link anidb domain urls)
* [url]HREF[/url] - link to URL where text is the same as the URL (can only be used to link AniDB domain URLs)
* [url=HREF]...[/url] - link to url where text is different from the url (can only be used to link anidb domain urls)
* [url=HREF]...[/url] - link to URL where text is different from the URL (can only be used to link anidb domain URLs)
* [img]HREF[/img] - link to an image
* [img]HREF[/img] - link to an image


Line 68: Line 68:
will produce an ordered list much the same as doing [ol][li]list item 1[/li][li]list item 2[/li][/ol]
will produce an ordered list much the same as doing [ol][li]list item 1[/li][li]list item 2[/li][/ol]


Around this time linking to anidb was also made possible with the following format [type of link:attribute of link:text of link]:
Around this time linking to AniDB was also made possible with the following format [type of link:attribute of link:text of link]:


* [anime:AID:some text] - links to an anime page
* [anime:AID:some text] - links to an anime page
Line 79: Line 79:
* [creq:CREQID:some text] - links to a creq
* [creq:CREQID:some text] - links to a creq
* [reviews:AID:some text] - links to anime reviews
* [reviews:AID:some text] - links to anime reviews
* [mylist:UID:some text] - links to an user mylist
* [mylist:UID:some text] - links to an user MyList
* [review:AID:REVIEWID] - links to a specific review
* [review:AID:REVIEWID] - links to a specific review
* [titles:AID:some text] - links to the titles of an anime
* [titles:AID:some text] - links to the titles of an anime
Line 86: Line 86:
* [relations:AID:some text] - links to an anime relations page
* [relations:AID:some text] - links to an anime relations page
* [groupcmts:ID:some text] - links to a group comments page
* [groupcmts:ID:some text] - links to a group comments page
* [tracker:ID:some text] - links to an anidb tracker item
* [tracker:ID:some text] - links to an AniDB tracker item
* [wiki::PAGE] - links to an anidb wiki page
* [wiki::PAGE] - links to an AniDB wiki page
* [forum.board:FORUMBOARDID:some text] - links to an anidb external forum board
* [forum.board:FORUMBOARDID:some text] - links to an AniDB external forum board
* [forum.post:FORUMPOSTID:some text] - links to an anidb external forum post
* [forum.post:FORUMPOSTID:some text] - links to an AniDB external forum post
* [forum.topic:FORUMTOPICID:some text] - links to an anidb external forum topic
* [forum.topic:FORUMTOPICID:some text] - links to an AniDB external forum topic


All of these can be added manually to any pm, review or comment and will be parsed accordingly, the RTE will also provide buttons and usually keyboard shortcuts to apply the above format.
All of these can be added manually to any pm, review or comment and will be parsed accordingly, the RTE will also provide buttons and usually keyboard shortcuts to apply the above format.
Line 98: Line 98:
Now that you know all the commands/tags what really happens when you write something in the RTE is:
Now that you know all the commands/tags what really happens when you write something in the RTE is:


# You type all the text you wish and apply all the formating you wish
# You type all the text you wish and apply all the formatting you wish
# You press add/submit/send/whatever
# You press add/submit/send/whatever
# Before your text is actually submitted to the server it will be parsed and known html commands will be converted to the anidb format
# Before your text is actually submitted to the server it will be parsed and known html commands will be converted to the AniDB format
# Your text is submitted to the server
# Your text is submitted to the server


Line 116: Line 116:
==== What can you do to fix the output ====
==== What can you do to fix the output ====


* First and most useful is before copy/pasting text from a text editor first paste it in notepad to remove the underlying formats and then copy/paste the notepad text into the the RTE and apply formating in the RTE
* First and most useful is before copy/pasting text from a text editor first paste it in notepad to remove the underlying formats and then copy/paste the notepad text into the the RTE and apply formatting in the RTE
* Disable javascript and reload the page and use the normal textarea to clean up the content
* Disable JavaScript and reload the page and use the normal textarea to clean up the content
* Bug fahrenheit until he finds out what have you done wrong and solve the issue
* Bug fahrenheit until he finds out what have you done wrong and solve the issue


Line 132: Line 132:


=== Not Supported ===
=== Not Supported ===
* Any non-javascript enabled browser
* Any non-JavaScript enabled browser
* Any browser that browser that doesn't support document.contentEditable (ie: Opera 8)
* Any browser that browser that doesn't support document.contentEditable (ie: Opera 8)


=== Not tested by AniDB ===
=== Not tested by AniDB ===
* Any other browser and or browser versions
* Any other browser and or browser versions
1,633

edits

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.