OSDN Git Service

Subversion由来のタグを削除
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / javascript / bookmarklet.js
1 /**
2   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) 
3   * Copyright (C) 2002-2012 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   */
14
15 /**
16  * On browsers that have DOM support, the non-visible tabs of the bookmarklet are 
17  * initially hidden. This is not defined in the CSS stylesheet since this causes 
18  * problems with Opera (which does not seem to be sending form data for input
19  * fields which are in a hidden block)
20  *
21 function initStyles() {
22         hideBlock('more');
23         hideBlock('options');
24         hideBlock('preview');
25         
26         // in browsers that do not support DOM (like opera), the buttons used
27         // to switch tabs are useless and can be hidden
28         document.getElementById('switchbuttons').style.display = 'inline';
29 }
30
31 /**
32  * To be called with id='body','more','options' or 'preview'
33  * Hides all other tabs and makes the chosen one visible
34  *
35 function flipBlock(id) {
36
37         showBlock(id);
38         
39         if (id != 'body')
40                 hideBlock('body');
41         if (id != 'more')
42                 hideBlock('more');
43         if (id != 'options')
44                 hideBlock('options');
45         if (id != 'preview')
46                 hideBlock('preview');           
47         
48 }
49
50 /**
51  * Hides one element (tab)
52  *
53 function hideBlock(id) {
54         document.getElementById(id).style.display = "none";
55 }
56
57 /**
58  * Makes an element (tab) visible
59  *
60 function showBlock(id) {
61         document.getElementById(id).style.display = "block";
62 }
63 */
64 function help(url) {
65         popup = window.open(url,'helpwindow','status=no,toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500,top=0,left=0');
66         if (popup.focus) popup.focus();
67         if (popup.GetAttention) popup.GetAttention();
68         return false;
69 }