<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,7 @@
 &lt;frog-plugins&gt;
   &lt;frog-plugin&gt;
       &lt;id&gt;wymeditor&lt;/id&gt;
-      &lt;version&gt;0.0.3&lt;/version&gt;
+      &lt;version&gt;0.0.6&lt;/version&gt;
       &lt;status&gt;alpha&lt;/status&gt;
   &lt;/frog-plugin&gt;
 &lt;/frog-plugins&gt;
\ No newline at end of file</diff>
      <filename>frog-plugins.xml</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ Plugin::setInfos(array(
     'id'          =&gt; $plugin_id,
     'title'       =&gt; __('WYMeditor'),
     'description' =&gt; __('WYMeditor is a web-based WYSIWYM (What You See Is What You Mean) XHTML editor (not WYSIWYG).'),
-    'version'     =&gt; '0.0.5',
+    'version'     =&gt; '0.0.6',
     'license'     =&gt; 'MIT',
     'author'      =&gt; 'THE M',
     'website'     =&gt; 'http://github.com/them/frog_wymeditor/',
@@ -20,14 +20,26 @@ Filter::add($plugin_id, $plugin_id.'/'.ucfirst($plugin_id).'.php');
 // The controller is required for the Frog integration (e.g. stylesheets)
 Plugin::addController($plugin_id, __('WYMeditor'), null, false);
 
-// XXX: this is an ugly hack to include scripts that are not physically present in the file system
+/* XXX: this is an ugly hack to include scripts that are not physically present in the file system */
+// If frog is installed to a subfolder
+$clean_url = URL_PUBLIC;
+if (substr($clean_url, -1) != '/') {
+  $clean_url .= '/';
+}
+
+$public_url_parts = parse_url($clean_url);
+$url_depth = substr_count($public_url_parts['path'], '/') + 1;
+
+// Path to the controller
 $parts = parse_url(get_url('plugin/'.$plugin_id.'/environment'));
 $path = $parts['path'];
 // If 'USE_MOD_REWRITE' is set to false there is a query
 if (isset($parts['query'])) {
   $path .= &quot;?&quot;.$parts['query'];
 }
-Plugin::$javascripts[] = &quot;../..&quot; . $path;
+// All the way up
+$path_to_the_root = str_repeat('../', $url_depth);
+Plugin::$javascripts[] = substr($path_to_the_root, 0, -1) . $path;
 
 Plugin::addJavascript($plugin_id, 'jquery.wymeditor.min.js');
 // Ensure that the Frog integration is included after the editor file</diff>
      <filename>index.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5bcaa56618e830f09d4ac366d150f1914c068349</id>
    </parent>
  </parents>
  <author>
    <name>The M</name>
    <email>only.the.em@googlemail.com</email>
  </author>
  <url>http://github.com/them/frog_wymeditor/commit/77d596704d311f737f6030e5b6f89c1c522459bc</url>
  <id>77d596704d311f737f6030e5b6f89c1c522459bc</id>
  <committed-date>2009-07-17T11:35:03-07:00</committed-date>
  <authored-date>2009-07-17T11:35:03-07:00</authored-date>
  <message>Version: 0.0.6
- now the editor works if Frog is installed to a
  sub directory.</message>
  <tree>e27ab2dd66dab45b6ba34ebbcbea40b7bdeef693</tree>
  <committer>
    <name>The M</name>
    <email>only.the.em@googlemail.com</email>
  </committer>
</commit>
