<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,45 +4,53 @@
  * @author Michael Klier &lt;chi@chimeric.de&gt;
  */
 
-/**
- * performs the ajax call
- *
- * @author Michael Klier &lt;chi@chimeric.de&gt;
- */ 
-function lastfm_ajax(obj){
+function lastfm_ajax(chart, opts) {
     if(!document.getElementById) return;
-    if(!obj) return;
+    if(!chart) return;
+    if(!opts) return;
 
-    // We use SACK to do the AJAX requests
     var ajax = new sack(DOKU_BASE+'lib/exe/ajax.php');
     ajax.AjaxFailedAlert = '';
     ajax.encodeURIString = false;
 
-    ajax.setVar('call', 'lastfm_chart');
-    ajax.setVar('user', plugin_lastfm_user);
-    ajax.setVar('chart', obj.id);
-    ajax.setVar('limit', plugin_lastfm_limit);
-    ajax.setVar('dformat', plugin_lastfm_dformat);
-    ajax.setVar('utc_offset', plugin_lastfm_utc_offset);
-    ajax.setVar('cols', plugin_lastfm_cols);
-    ajax.setVar('imgonly', plugin_lastfm_imgonly);
+    ajax.setVar('call', 'plugin_lastfm');
+    ajax.setVar('plugin_lastfm_chart', chart.id);
+
+    for(var i = 0; i &lt; opts.length; i++) {
+        ajax.setVar(opts[i].firstChild.className, opts[i].firstChild.innerHTML);
+    }
 
     // show loader
-    lastfm_loader(obj);
+    lastfm_loader(chart);
  
     // define callback
     ajax.onCompletion = function(){
         var data = this.response;
         if(data === ''){ return; }
-        obj.style.visibility = 'hidden';
-        obj.innerHTML = data;
-        obj.style.visibility = 'visible';
+        chart.style.visibility = 'hidden';
+        chart.innerHTML = data;
+        chart.style.visibility = 'visible';
     };
 
     ajax.runAJAX();
 }
 
 /**
+ * Calls the ajax function for each requested chart
+ *
+ * @author Michael Klier &lt;chi@chimeric.de&gt;
+ */ 
+function lastfm_get_charts(charts, opts){
+    if(!document.getElementById) return;
+    if(!charts) return;
+    if(!opts) return;
+
+    for(var i = 0; i &lt; charts.length; i++) {
+        lastfm_ajax(charts[i], opts);
+    }
+}
+
+/**
  * shows the loading image
  *
  * @author Michael KLier &lt;chi@chimeric.de&gt;
@@ -54,10 +62,13 @@ function lastfm_loader(obj) {
 
 // add the init event
 addInitEvent(function() {
-    var obj = $('plugin_lastfm');
-    if(!obj) return;
-    var charts = getElementsByClass('plugin_lastfm_chart',obj,'div');
-    for(var i=0;i&lt;charts.length;i++) {
-        lastfm_ajax(charts[i]);
+    var objs = getElementsByClass('plugin_lastfm', document, 'div');
+    if(!objs) return;
+    for(var i = 0; i &lt; objs.length; i++) {
+        var opts   = getElementsByClass('plugin_lastfm_opt', objs[i], 'li');
+        var charts = getElementsByClass('plugin_lastfm_chart', objs[i], 'div');
+        lastfm_get_charts(charts, opts);
     }
 });
+
+// vim:ts=4:sw=4:et:enc=utf-8:</diff>
      <filename>script.js</filename>
    </modified>
    <modified>
      <diff>@@ -41,3 +41,7 @@ div.dokuwiki div.plugin_lastfm_playcount {
   background: #ccc url(images/chart_end.gif) no-repeat right;
   padding-left: 0.3em;
 }
+
+div.dokuwiki ul.plugin_lastfm_opts {
+  display: none;
+}</diff>
      <filename>style.css</filename>
    </modified>
    <modified>
      <diff>@@ -52,7 +52,7 @@ class syntax_plugin_lastfm extends DokuWiki_Syntax_Plugin {
             'author' =&gt; 'Michael Klier (chi)',
             'email'  =&gt; 'chi@chimeric.de',
             'date'   =&gt; @file_get_contents(DOKU_PLUGIN.'lastfm/VERSION'),
-            'name'   =&gt; 'LastFm',
+            'name'   =&gt; 'LastFM Plugin (syntax component)',
             'desc'   =&gt; 'Displays lastfm statistics for a given user',
             'url'    =&gt; 'http://dokuwiki.org/plugin:lastfm'
         );
@@ -124,22 +124,21 @@ class syntax_plugin_lastfm extends DokuWiki_Syntax_Plugin {
             // disable caching
             $renderer-&gt;info['cache'] = false;
 
-            $renderer-&gt;doc .= '&lt;div id=&quot;plugin_lastfm&quot;&gt;' . DW_LF;
+            $renderer-&gt;doc .= '&lt;div class=&quot;plugin_lastfm&quot;&gt;' . DW_LF;
+
+            $renderer-&gt;doc .= '  &lt;ul class=&quot;plugin_lastfm_opts&quot;&gt;' . DOKU_LF;
+            $renderer-&gt;doc .= '     &lt;li class=&quot;plugin_lastfm_opt&quot;&gt;&lt;span class=&quot;plugin_lastfm_user&quot;&gt;' . $data['user'] . '&lt;/span&gt;&lt;/li&gt;' . DOKU_LF;
+            $renderer-&gt;doc .= '     &lt;li class=&quot;plugin_lastfm_opt&quot;&gt;&lt;span class=&quot;plugin_lastfm_limit&quot;&gt;' . $data['limit'] . '&lt;/span&gt;&lt;/li&gt;' . DOKU_LF;
+            $renderer-&gt;doc .= '     &lt;li class=&quot;plugin_lastfm_opt&quot;&gt;&lt;span class=&quot;plugin_lastfm_cols&quot;&gt;' . $data['cols'] . '&lt;/span&gt;&lt;/li&gt;' . DOKU_LF;
+            $renderer-&gt;doc .= '     &lt;li class=&quot;plugin_lastfm_opt&quot;&gt;&lt;span class=&quot;plugin_lastfm_imgonly&quot;&gt;' . $data['imgonly'] . '&lt;/span&gt;&lt;/li&gt;' . DOKU_LF;
+            $renderer-&gt;doc .= '  &lt;/ul&gt;'. DOKU_LF;
+
             foreach($data['charts'] as $chart) {
                 $renderer-&gt;doc .= '  &lt;span class=&quot;plugin_lastfm_charttype&quot;&gt;last.fm ' . $this-&gt;getLang($chart) . '&lt;/span&gt;' . DW_LF;
                 $renderer-&gt;doc .= '  &lt;div class=&quot;plugin_lastfm_chart&quot; id=&quot;plugin_lastfm_' . $chart . '&quot;&gt;&lt;/div&gt;' . DW_LF;
             }
-            $renderer-&gt;doc .= '&lt;/div&gt;' . DW_LF;
 
-            // print javascript
-            $renderer-&gt;doc .= '&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;' . DW_LF;
-            $renderer-&gt;doc .= 'var plugin_lastfm_user = &quot;' . $data['user'] . '&quot;;' . DW_LF;
-            $renderer-&gt;doc .= 'var plugin_lastfm_limit = &quot;' . $data['limit'] . '&quot;;' . DW_LF;
-            $renderer-&gt;doc .= 'var plugin_lastfm_utc_offset = &quot;' . $this-&gt;getConf('utc_offset') . '&quot;;' . DW_LF;
-            $renderer-&gt;doc .= 'var plugin_lastfm_dformat = &quot;' . $this-&gt;getConf('dformat') . '&quot;;' . DW_LF;
-            $renderer-&gt;doc .= 'var plugin_lastfm_cols = &quot;'. $data['cols'] . '&quot;;' . DW_LF;
-            $renderer-&gt;doc .= 'var plugin_lastfm_imgonly = &quot;' . $data['imgonly'] . '&quot;;' . DW_LF;
-            $renderer-&gt;doc .= '&lt;/script&gt;' . DW_LF;
+            $renderer-&gt;doc .= '&lt;/div&gt;' . DW_LF;
 
             return true;
         }</diff>
      <filename>syntax.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d9382dafe52a07be5ace0fc815acb9e63917a5d1</id>
    </parent>
  </parents>
  <author>
    <name>Michael Klier</name>
    <email>chi@chimeric.de</email>
  </author>
  <url>http://github.com/chimeric/dokuwiki-plugin-lastfm/commit/7b726aec82f3b0669ff5cd82cab847b000c0b59f</url>
  <id>7b726aec82f3b0669ff5cd82cab847b000c0b59f</id>
  <committed-date>2009-05-21T05:40:42-07:00</committed-date>
  <authored-date>2009-05-21T05:40:42-07:00</authored-date>
  <message>allow to display date from multiple lastfm profiles</message>
  <tree>ee37d8bcf00f8c2a8dd7386a56712f41156582e0</tree>
  <committer>
    <name>Michael Klier</name>
    <email>chi@chimeric.de</email>
  </committer>
</commit>
