Permalink
Browse files

Update pageLinksPlugin (fixes #5)

  • Loading branch information...
1 parent 9879cd4 commit 5438e392d89df5cfcbcd0894750db8e36880560e @mamacdon committed Dec 7, 2012
Showing with 41 additions and 6 deletions.
  1. +41 −6 lib/orionode.client/plugins/pageLinksPlugin.html
@@ -2,12 +2,32 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <script src="../orion/plugin.js"></script>
+ <script src="../requirejs/require.js"></script>
<script>
- /*global orion window*/
+ /*global require*/
+ require({
+ baseUrl: '..',
+
+ // set the paths to our library packages
+ packages: [
+ {
+ name: 'dojo',
+ location: 'org.dojotoolkit/dojo',
+ main: 'lib/main-browser',
+ lib: '.'
+ }
+ ],
+ paths: {
+ text: 'requirejs/text',
+ i18n: 'requirejs/i18n',
+ domReady: 'requirejs/domReady'
+ }
+ });
+
+ /*global define orion window*/
var VERSION = "1.0";
-
- window.onload = function() {
+
+ require(['require', 'orion/plugin'], function(require, PluginProvider) {
var serviceImpl = { /* All data is in properties */ };
var headers = {
@@ -16,7 +36,7 @@
description: "This plugin provides the top-level page links for Orion."
};
- var provider = new orion.PluginProvider(headers);
+ var provider = new PluginProvider(headers);
// Primary navigation links
provider.registerService("orion.page.link", serviceImpl, {
@@ -63,6 +83,21 @@
uriTemplate: "{OrionHome}/navigate/table.html#{NavigatorLocation}?depth=1"
});
+ provider.registerService("orion.page.link.user", null, {
+ id: "orion.help",
+ nameKey: "Help",
+ nls: "orion/widgets/nls/messages",
+ uriTemplate: 'https://github.com/mamacdon/orionode/blob/master/README.md#readme',
+ category: 0
+ });
+ provider.registerService("orion.page.link.user", null, {
+ id: "orion.settings",
+ nameKey: "Settings",
+ nls: "orion/widgets/nls/messages",
+ uriTemplate: "{OrionHome}/settings/settings.html",
+ category: 1
+ });
+
var htmlHelloWorld = document.createElement('a');
htmlHelloWorld.href = "./contentTemplates/helloWorld.zip";
var pluginHelloWorld = document.createElement('a');
@@ -125,7 +160,7 @@
});
provider.connect();
- };
+ });
</script>
</head>
<body>

0 comments on commit 5438e39

Please sign in to comment.