/[drupal]/contributions/modules/comicview/comicview.js
ViewVC logotype

Contents of /contributions/modules/comicview/comicview.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Aug 27 18:25:54 2008 UTC (15 months ago) by pedrofaria
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/javascript
Initial commit of comicview module.
1 var comicview_files = [];
2
3 function comicviews_add_file ( nid, filepath ) {
4 var id = 'node-'+nid;
5 if (!comicview_files[id]) comicview_files[id] = [];
6 comicview_files[id].push(filepath);
7 }
8
9 $().ready(function() {
10
11 for (key in comicview_files) {
12
13 var cv = $('#'+key+' .content');
14 cv.prepend('<div class="comicview"><div class="comicview-display"></div><div class="comicview-pager"></div></div>');
15
16 // mount pager
17 var cvpager = $('#'+key+' .content .comicview .comicview-pager');
18 $.each(comicview_files[key], function(i, val) {
19 var pager = '<a href="javascript: void(0);" class="'+i+'">'+(i+1)+'</a>';
20 cvpager.append(''+pager+'');
21 });
22
23 $('a', cvpager).click(function() {
24 //var path = Drupal.settings.comicview.base_path + comicview_files[key][$(this).attr('class')];
25 var path = comicview_files[key][$(this).attr('class')];
26 var img = '<img src="'+path+'" />';
27
28 $('.comicview .comicview-display', cv).html(img);
29 });
30
31 $('a:eq(0)', cvpager).trigger('click');
32
33 }
34
35 });

  ViewVC Help
Powered by ViewVC 1.1.2