Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] difficulties porting plugin to Orion 4.0 RC2

So... by having this in my plugin' s html file:

  <script src="../orion/Deferred.js"></script>

the issue is avoided.  Still unsure whether this is a workaround or an
actual solution (then probably should be mentioned in the plugin
development tutorial). Thoughts?

It seems from my untrained eyes that Deferred ends up being needed in
my plugin because I implement an outliner, which in 4.0 uses a
promise/deferred to retrieve the editor contents.

Cheers,

Rafael

On Thu, Oct 31, 2013 at 1:25 PM, Rafael Chaves <rafael@xxxxxxxxxxxx> wrote:
> Hi all.
>
> I am in the process of porting a plugin from Orion 1.0 (RC2) to Orion
> 4.0 (RC2). Right now I am having a hard time getting the plugin to
> work with the new plugin.js. I am by no means experienced with JS so
> that is probably the reason of my struggle. But I am seeing the
> plugin.js ending up with the "Deferred" symbol being undefined.
> Basically, in this code:
>
>     if (typeof define === "function" && define.amd) { //$NON-NLS-0$
>         define(["orion/Deferred"], factory);
>     } else if (typeof exports === "object") { //$NON-NLS-0$
>         module.exports = factory(require("orion/Deferred"));
>     } else {
>         root.orion = root.orion || {};
>         root.orion.PluginProvider = factory(root.orion.Deferred);
>     }
>
> the last else is the block executing, and since root.orion is
> undefined, it falls back to {}, so root.orion,Deferred of course will
> be undefined as well.
>
> I suspect that my root issue may originate before this initialization
> code runs but I have no idea of what it is. Any tips?
>
> Rafael


Back to the top