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