Changeset 14935 in project


Ignore:
Timestamp:
06/07/09 18:50:11 (10 years ago)
Author:
azul
Message:

Removing functions that are already provided by the svnwikiJavascript library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-image/trunk/svnwiki-image.scm

    r14934 r14935  
    1212var svnwikiImage = new Object();
    1313
    14 svnwikiImage.cleanContent = function (element)
    15 {
    16   while (element.hasChildNodes())
    17     element.removeChild(element.firstChild);
    18 }
    19 
    20 svnwikiImage.makeLink = function ( target, content )
    21 {
    22   var link = svnwikiImage.makeElement('A', content);
    23   link.setAttribute('href', target);
    24   return link;
    25 }
    26 
    27 svnwikiImage.makeElement = function ( type, content )
    28 {
    29   var elem = document.createElement(type);
    30   if (content)
    31     elem.appendChild(content);
    32   return elem;
    33 }
    34 
    3514svnwikiImage.pickSize = function (imgName, prefix, width, height)
    3615{
    3716  var sizesDiv = document.getElementById('svnwikiImageSizes' + imgName);
    38   svnwikiImage.cleanContent(sizesDiv);
    39   sizesDiv.appendChild(svnwikiImage.makeElement('p', document.createTextNode('Please wait, loading image...')));
     17  svnwikiJavascript.cleanContent(sizesDiv);
     18  sizesDiv.appendChild(svnwikiJavascript.makeElement('p', document.createTextNode('Please wait, loading image...')));
    4019
    4120  var img = document.getElementById('svnwikiImage' + imgName);
     
    4322  img.height = height;
    4423  img.src = prefix + '-' + Math.max(width, height);
    45   img.onload = function () { svnwikiImage.cleanContent(sizesDiv); };
     24  img.onload = function () { svnwikiJavascript.cleanContent(sizesDiv); };
    4625
    4726  var imgLink = document.getElementById('svnwikiImageLink' + imgName);
     
    125104
    126105  if (sizesDiv.firstChild) {
    127     svnwikiImage.cleanContent(sizesDiv);
     106    svnwikiJavascript.cleanContent(sizesDiv);
    128107    return;
    129108  }
     
    134113    var target = "javascript:svnwikiImage.pickSize('" + imgName + "','" + prefix + "'," + sizes[j][0] + "," + sizes[j][1] + ");";
    135114    var text = document.createTextNode(sizes[j][0] + "x" + sizes[j][1]);
    136     ul.appendChild(svnwikiImage.makeElement('li', svnwikiImage.makeLink(target, text)));
     115    ul.appendChild(svnwikiJavascript.makeElement('li', svnwikiJavascript.makeLink(target, text)));
    137116  }
    138117  sizesDiv.appendChild(ul)
Note: See TracChangeset for help on using the changeset viewer.