/[suikacvs]/test/html-whatpm/table-script.js
Suika

Diff of /test/html-whatpm/table-script.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by wakaba, Sat Jun 30 08:26:08 2007 UTC revision 1.4 by wakaba, Sun Feb 10 02:30:14 2008 UTC
# Line 1  Line 1 
1  function tableToCanvas (table, parent) {  function tableToCanvas (table, parent, idPrefix) {
2    var canvas = document.createElement ('canvas');    var canvas = document.createElement ('canvas');
3    parent.appendChild (canvas);    parent.appendChild (canvas);
4    if (window.G_vmlCanvasManager) {    if (window.G_vmlCanvasManager) {
# Line 142  for (var i = 1; i < table.cell.length; i Line 142  for (var i = 1; i < table.cell.length; i
142            area.shape = 'rect';            area.shape = 'rect';
143            area.coords = [x, y, x + width, y + height].join (',');            area.coords = [x, y, x + width, y + height].join (',');
144            area.alt = 'Cell (' + c[0].x + ', ' + c[0].y + ')';            area.alt = 'Cell (' + c[0].x + ', ' + c[0].y + ')';
145            area.href = '#node-' + c[0].id;            area.href = '#' + idPrefix + 'node-' + c[0].id;
146            area.id = 'cell-' + c[0].id;            area.id = idPrefix + 'cell-' + c[0].id;
147            map.appendChild (area);            map.appendChild (area);
148          }          }
149        } else {        } else {
# Line 176  for (var i = 1; i < rowNumber; i++) { Line 176  for (var i = 1; i < rowNumber; i++) {
176  }  }
177    
178    if (map.hasChildNodes ()) {    if (map.hasChildNodes ()) {
179      var mapid = 'table-map-' + ++document.TableMapId;      var mapid = /* idPrefix + */ 'table-map-' + ++document.TableMapId;
180      map.name = mapid;      map.name = mapid;
181      parent.appendChild (map);      parent.appendChild (map);
182      var img = document.createElement ('img');      var img = document.createElement ('img');
# Line 191  if (!document.TableMapId) document.Table Line 191  if (!document.TableMapId) document.Table
191    
192  /*  /*
193    
194  Copyright 2007 Wakaba <w@suika.fam.cx>  Copyright 2007-2008 Wakaba <w@suika.fam.cx>
195    
196  This library is free software; you can redistribute it  This library is free software; you can redistribute it
197  and/or modify it under the same terms as Perl itself.  and/or modify it under the same terms as Perl itself.

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24