On 10/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Author: gscokart
> Date: Wed Oct 24 12:35:34 2007
> New Revision: 587977
>
> URL: http://svn.apache.org/viewvc?rev=587977&view=rev
> Log:
> add support for include using [<URL>]
>
> Modified:
>     incubator/ivy/site/xooki/xooki.js


As I think you know xooki is a separate project from Ivy, so modifying
xooki.js without modifying it in the original project is risky: we may have
problem with later upgrade.

So I see several options:
1) I give you commit access to xooki, so that you can commit this change in
xooki too
2) I push your change to xooki myself, and whenever one of us need to
improve xooki we discuss it here and I take care of maintaining the original
xooki.js in sync
3) since your change is "just" a new input type, I think this can be done
externally to xooki.js using the config.js file. and thus do not cause
problem for later upgrade

I'm personnally in favor of #1, then #3, then #2.

WDYT?

Xavier

Modified: incubator/ivy/site/xooki/xooki.js
> URL:
> http://svn.apache.org/viewvc/incubator/ivy/site/xooki/xooki.js?rev=587977&r1=587976&r2=587977&view=diff
>
> ==============================================================================
> --- incubator/ivy/site/xooki/xooki.js (original)
> +++ incubator/ivy/site/xooki/xooki.js Wed Oct 24 12:35:34 2007
> @@ -781,6 +781,22 @@
>                      return '<br class="xooki-br"/>'; // the class is not
> really necessary but allow to distinguish generated br from input one
>                  }
>              });
> +        },
> +
> +        includes: function (input) {
> +               //[<url>] replaced by the content of the url
> +               result = "";
> +               lastStart = 0;
> +               nextPos = input.indexOf("[<" , lastStart);
> +               while( nextPos > 0 ) {
> +                       result = result + input.slice(lastStart,nextPos);
> +                       lastStart = nextPos;
> +                       nextPos = input.indexOf(">]" , lastStart);
> +                       result = result + xooki.url.loadURL(u(input.slice
> (lastStart+2,nextPos)));
> +                       lastStart = nextPos + 2;
> +                       nextPos = input.indexOf("[<" , lastStart);
> +               }
> +            return result + input.slice(lastStart);
>          }
>      },
>
> @@ -884,7 +900,7 @@
>      xooki.c.initProperty("xookiInputFormat", ["xooki"]);
>      xooki.c.initProperty("allowEdit", !batchMode && xooki.pageURL.substr(0,5)
> == "file:");
>
> -    xooki.input.format.define("xooki", ["code", "shortcuts", "url",
> "xookiLinks", "jira", "lineBreak"]);
> +    xooki.input.format.define("xooki", ["code", "shortcuts", "url",
> "xookiLinks", "jira", "lineBreak" , "includes"]);
>
>      xooki.c.path = (typeof xooki.c.path != "undefined")?xooki.c.path:{};
>      xooki.c.path.initProperty = initConfigProperty;
>
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Reply via email to