Changes

Jump to navigation Jump to search

AniDB RTE

2,497 bytes removed, 10:26, 20 August 2014
{{TOCright}}
 
The AniDB '''R'''ich '''T'''ext '''E'''ditor<br>
This page will try to explain the AniDB RTE and why it isn't your standard Rich Text Editor.
== How does an RTE work ==
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 AniDB case ==
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 <tt>[b]some bold text[/b]</tt> 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'''".
* <tt>[spoiler]...[/spoiler]</tt> - text is hidden; visibility of text can be toggled using "Show/Hide Spoiler" button
* <tt>[url]HREF[/url]</tt> - link to URL where text is the same as the URL (can only be used to link AniDB domain URLs)
* <tt>[url=HREF]...[/url]</tt> - link to URL where text is different from the URL (can only be used to link anidb AniDB domain URLs)
* <tt>[img]HREF[/img]</tt> - link to an image
 
==== History ====
The commands supported at first were:
 
* <tt>[b]...[/b]</tt> - bold text
* <tt>[i]...[/i]</tt> - italic text
* <tt>[u]...[/u]</tt> - underline
 
These were then expanded to:
 
* <tt>[s]...[/s]</tt> - line-trough style
* <tt>[ul]...[/ul]</tt> - unordered lists
* <tt>[ol]...[/ol]</tt> - ordered lists
* <tt>[li]...[/li]</tt> - lists items (go inside both <tt>[ul]</tt> and <tt>[ol]</tt>)
 
Some alternative methods to add lists were also added:
 
<pre>* list item 1
* list item 1</pre>
 
will produce an unordered list much the same as doing <tt>[ul][li]list item 1[/li][li]list item 2[/li][/ul]</tt>
 
<pre># list item 1
# list item 2</pre>
 
will produce an ordered list much the same as doing <tt>[ol][li]list item 1[/li][li]list item 2[/li][/ol]</tt>
 
Around this time linking to AniDB was also made possible with the following format <tt>[type of link:attribute of link:text of link]</tt>:
 
* <tt>[anime:AID:some text]</tt> - links to an anime page
* <tt>[ep:EID:some text]</tt> - links to an episode page
* <tt>[file:FID:some text]</tt> - links to a file page
* <tt>[group:GID:some text]</tt> - links to a group page
* <tt>[producer:PRID:some text]</tt> - links to a producer page
* <tt>[user:UID:some text]</tt> - links to an user userpage
* <tt>[votes:UID:some text]</tt> - links to an user votes page
* <tt>[creq:CREQID:some text]</tt> - links to a creq
* <tt>[reviews:AID:some text]</tt> - links to anime reviews
* <tt>[mylist:UID:some text]</tt> - links to an user MyList
* <tt>[review:AID:REVIEWID]</tt> - links to a specific review
* <tt>[titles:AID:some text]</tt> - links to the titles of an anime
* <tt>[producers:AID:some text]</tt> - links to an anime producers page
* <tt>[cats:AID:some text]</tt> - links to an anime categories page
* <tt>[relations:AID:some text]</tt> - links to an anime relations page
* <tt>[groupcmts:ID:some text]</tt> - links to a group comments page
* <tt>[tracker:ID:some text]</tt> - links to an AniDB tracker item
* <tt>[wiki::PAGE]</tt> - links to an AniDB wiki page
* <tt>[forum.board:FORUMBOARDID:some text]</tt> - links to an AniDB external forum board
* <tt>[forum.post:FORUMPOSTID:some text]</tt> - links to an AniDB external forum post
* <tt>[forum.topic:FORUMTOPICID:some text]</tt> - 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.
=== Piece it all together ===
== Browser Support ==
Here is a list of the currently browser support and some notes about them:<br/>
For visual preview of the current browser support check this [[http://anidb.net/perl-bin/animedb.pl?show=cmt&id=17941 forum thread]].
* Internet Explorer 7/8 - Can't correctly insert lists
* Firefox/Gecko 2.0 - No issues
* Opera 9.27 - Can't correctly insert lists, no formating
* Safari/AppleWebKit 3.1 - No Issues

Navigation menu

MediaWiki spam blocked by CleanTalk.