Version 6 (modified by timothy, 13 years ago) (diff)

Changed the variable name from final to finalHTML since final is a reserved JavaScript word.

TracNav(Development)? This is part of the Development Documentation Project, please help document Colloquy if you know anything that would be relevant here for other users to know about.

JavaScript PlugIns for Colloquy

To develop JavaScript PlugIns, you will need:

  • A plain text editor (TextEdit is fine in plain-text mode).
  • The latest list of function names Colloquy looks for (available in the Colloquy SDK JavaScript template below).
  • Reasonably good knowledge of JavaScript, Colloquy classes and utilizing the Cocoa frameworks.
  • A good understanding of how to call Objective-C methods from JavaScript, detailed in Using Objective-C From JavaScript.

There is a template script available in the JavaScript SDK section containing stubs and commentary for all available functions a JavaScript PlugIn for Colloquy can implement.

For those not familiar with the language, we recomend: W3Schools' JavaScript Tutorial.

(for more information come to our chat room)

Example Plugin: Grab URL Titles

The following example will take a URL mentioned in the chat and get it's title by fetching the HTML. Save this script in Colloquy's PlugIns folder as "Grab Title.js" and /reload plugins in Colloquy. Note: this script requires build 3437 or later.

Error: Failed to load processor text/x-javascript
No macro or processor named 'text/x-javascript' found