[ Index ]

PHP Cross Reference of Nucleus CMS 3.32

title

Body

[close]

/nucleus/javascript/ -> bookmarklet.js (source)

   1  /**
   2    * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) 
   3    * Copyright (C) 2002-2007 The Nucleus Group
   4    *
   5    * This program is free software; you can redistribute it and/or
   6    * modify it under the terms of the GNU General Public License
   7    * as published by the Free Software Foundation; either version 2
   8    * of the License, or (at your option) any later version.
   9    * (see nucleus/documentation/index.html#license for more info)
  10    *  
  11    * Some JavaScript code for the bookmarklets
  12    *
  13    * $Id: bookmarklet.js 1116 2007-02-03 08:24:29Z kimitake $
  14    */
  15  
  16  /**
  17   * On browsers that have DOM support, the non-visible tabs of the bookmarklet are 
  18   * initially hidden. This is not defined in the CSS stylesheet since this causes 
  19   * problems with Opera (which does not seem to be sending form data for input
  20   * fields which are in a hidden block)
  21   */
  22  function initStyles() {
  23      hideBlock('more');
  24      hideBlock('options');
  25      hideBlock('preview');
  26      
  27      // in browsers that do not support DOM (like opera), the buttons used
  28      // to switch tabs are useless and can be hidden
  29      document.getElementById('switchbuttons').style.display = 'inline';
  30  }
  31  
  32  /**
  33   * To be called with id='body','more','options' or 'preview'
  34   * Hides all other tabs and makes the chosen one visible
  35   */
  36  function flipBlock(id) {
  37  
  38      showBlock(id);
  39      
  40      if (id != 'body')
  41          hideBlock('body');
  42      if (id != 'more')
  43          hideBlock('more');
  44      if (id != 'options')
  45          hideBlock('options');
  46      if (id != 'preview')
  47          hideBlock('preview');        
  48      
  49  }
  50  
  51  /**
  52   * Hides one element (tab)
  53   */
  54  function hideBlock(id) {
  55      document.getElementById(id).style.display = "none";
  56  }
  57  
  58  /**
  59   * Makes an element (tab) visible
  60   */
  61  function showBlock(id) {
  62      document.getElementById(id).style.display = "block";
  63  }
  64  
  65  function help(url) {
  66      popup = window.open(url,'helpwindow','status=no,toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500,top=0,left=0');
  67      if (popup.focus) popup.focus();
  68      if (popup.GetAttention) popup.GetAttention();
  69      return false;
  70  }


Generated: Tue Feb 12 15:34:36 2008 Cross-referenced by PHPXref 0.7