plugins/gallery/gallery-bits.js
author Dan
Sat, 23 Feb 2008 16:02:15 -0500
changeset 25 d9f37d2ea2cf
parent 10 b38afb86dcad
child 42 7c6e2e97aa08
permissions -rw-r--r--
Fixed race condition on canvas init (caused boxes to appear off by ~320px); fixed JSON response of null when row[img_tags] is NULL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     1
/*
10
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
     2
 * Misc functions for Snapr.
0
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     3
 */
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     4
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     5
function gal_toggle(elem, img, img_open, img_close)
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     6
{
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     7
  if ( !img_close || !img_open )
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     8
  {
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
     9
    img_close = scriptPath + '/plugins/gallery/toggle-closed.png';
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    10
    img_open  = scriptPath + '/plugins/gallery/toggle-open.png';
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    11
  }
10
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    12
  if ( elem.style.display == 'none' || !elem.style.display )
0
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    13
  {
10
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    14
    elem.style.display = 'block';
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    15
    try {
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    16
      img.src = img_open;
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    17
    } catch(e) {};
0
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    18
  }
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    19
  else
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    20
  {
10
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    21
    elem.style.display = 'none';
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    22
    try {
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    23
      img.src = img_close;
b38afb86dcad Merging with bugfixes on Scribus
Dan
parents: 0
diff changeset
    24
    } catch(e) {};
0
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    25
  }
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    26
}
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    27
7caf561c50ee Initial population; browser, viewer, uploader, and security are working
Dan
parents:
diff changeset
    28