Jump to: navigation, search

Difference between revisions of "Orion/How Tos/Installing A Plugin"

< Orion‎ | How Tos
m (Use installed functionality)
m (wording)
Line 27: Line 27:
 
-->
 
-->
  
=== Use installed functionality  ===
+
=== Using installed functionality  ===
 
Installed plugins may contribute functionality to Orion in a number of different ways, not all of which are immediately visible in the UI.
 
Installed plugins may contribute functionality to Orion in a number of different ways, not all of which are immediately visible in the UI.
  
 
Continuing from where the [[#Install using Registry Page|previous example]] left off:
 
Continuing from where the [[#Install using Registry Page|previous example]] left off:
*Create a new JavaScript file called '''test.js'''.
+
*From the Navigator page, create a new JavaScript file called '''test.js'''.
 
*Click on '''test.js''' to open it in the Orion code editor.
 
*Click on '''test.js''' to open it in the Orion code editor.
 
*Type in or copy/paste some JavaScript code into the editor (preferably some code with messy formatting).
 
*Type in or copy/paste some JavaScript code into the editor (preferably some code with messy formatting).

Revision as of 18:42, 17 June 2011

This page explains how an end-user can install third-party functionality so that it is available to the Orion editor.

Install using Registry Page

Orion-plugin-list.png

  • Enter a plugin URL into the text field. For example, enter http://jsbeautifier.org/orion/0.2/jsbeautify.html to install JavaScript code formatting functionality. Click "Install".
  • You should see a success message, and the the tree will refresh. It should now contain the new plugin.
  • The plugins are currently installed using local storage, which means that they are only active in one browser.


To remove an installed plugin:

  • Select its URL in the tree.
  • Click the Copy Location button to copy its URL into the text box.
  • Click Uninstall, then OK to the prompt.
  • The plugin should disappear from the list.

Using installed functionality

Installed plugins may contribute functionality to Orion in a number of different ways, not all of which are immediately visible in the UI.

Continuing from where the previous example left off:

  • From the Navigator page, create a new JavaScript file called test.js.
  • Click on test.js to open it in the Orion code editor.
  • Type in or copy/paste some JavaScript code into the editor (preferably some code with messy formatting).
  • Look at the editor toolbar. You'll see a new command available called "Format JS". This command was contributed by the jsbeautify plugin we installed earlier. Commands on the editor toolbar can also define a key binding that activates the command. These commands have access to the selected text in the editor, the complete editor buffer, and the current selection. As a result of invoking a command, the command can replace the current selection with a new text, change the complete editor buffer, and/or change the selection.

Orion-plugin-action.png

  • Select your code, click "Format JS", and it will be formatted for you.
  • If you have ideas for extensions but need more or different API to implement it, please file a bug.