Benutzer:Netaction/WikiCite

aus Wikipedia, der freien Enzyklopädie
Datei:WikiCite-Screenshot.png
WikiCite exports HTML of your selected text.

The jQuery Script WikiCite.js helps you copying some text for your website or blog.

Install it, go to any page and highlight some text. You will see the little helper.

Characteristics

  • Tested with Chromium 12 and Firefox 5 under Ubuntu Linux 11.04 and Firefox 5 under Win7.
  • Does not copy to clipboard. (not possible without Flash)
  • Textarea does not grow because the html does not look nice and is hard to read. But it can be expanded by user interaction.
  • Works on all Wikipedias, translations in German and English.

Questions

  • Use HTML entities ( & auml ; ) instead of Unicode where possible?
  • Who provides this information? Written by (up to 5 main authors, with links to their user page) and x others (if appropriate), yyyy - yyyy (year of first and last edit).

Installation auf de.wikipedia.org

Du musst als Benutzer eingeloggt sein. Bearbeite deine commons.js und füge diese Zeile ein:

 mw.loader.load('//de.wikipedia.org/w/index.php?title=Benutzer:Netaction/WikiCite.js&action=raw&ctype=text/javascript');

Das sollte es gewesen sein. Falls es nicht klappt, melde dich bitte. Es ist nicht notwendig, das gesamte Script WikiCite.js zu kopieren.

Installation on en.wikipedia.org

You must be logged in as a user. Edit your skin's js file and add this line:

 mw.loader.load('//de.wikipedia.org/w/index.php?title=Benutzer:Netaction/WikiCite.js&action=raw&ctype=text/javascript');

That should be it. If it doesn't work please contact me. It is not neccessary to copy the whole script from WikiCite.js.

Installation on fr.wikipedia.org

You must be logged in as a user. If you use the MonoBook style you have to create a file monobook.js. In the case of vector it is vector.js. Add this line:

 mw.loader.load('//de.wikipedia.org/w/index.php?title=Benutzer:Netaction/WikiCite.js&action=raw&ctype=text/javascript');

Done.

TODO

  • Exported code in TEXTAREA has to be cleaned (div elements, attributes)
  • references must be expanded to full urls


Ways to get the authors' names

The best way would be some markup in the usual Wikipedia pages that provides information about the authors of the specific text. Maybe that is hard to implement. A workaround may be to get this HTML code from the WikiTrust server after some text has been highlighted. How to find the right position in the WikiTrust HTML?

  • Count elements. Take the HTML of the current article, cut off the header and count the "<" characters from the beginning of the content to the beginning of the highlighted area. The result is not very preceise and will contain the authors who wrote the text around the highlighted content tool. Advantage: If this is done on the server the traffic is extremely low. Only the number of tags has to be transmitted to the server. Disadvantage: Need Ajax call to a slow server.
  • Count characters. Get the number of characters from the beginning of the content to the beginning of the selection. Take the WikiTrust HTML and do the same. Then look into the markup to find out who the authors are. We need SPAN elements from the WikiTrust server to do that. Disadvantage: We need the whole HTML from WikiTrust in the browser. Need Ajax call to a slow server.
  • Search for the highlighted text in HTML from WikiTrust. Very undependable. Need to wait for Ajax call to a slow server.
  • Replace the original HTML with WikiTrust HTML on loading of every page. The user will not recognize it if his bandwidth is ok. The highlighted text will already contain the information about authors. Pro: Fast for the user because information is loaded in advance. Con: Heavy traffic.