Recent Changes - Search:

PmWiki

pmwiki.org

edit SideBar

https://www.jetphotos.com/photographer/598301 https://www.jetphotos.com/photographer/598304 https://www.jetphotos.com/photographer/598305 https://www.jetphotos.com/photographer/598307 https://www.jetphotos.com/photographer/598310 https://www.jetphotos.com/photographer/598312 https://www.jetphotos.com/photographer/598317 https://www.jetphotos.com/photographer/598318 https://www.jetphotos.com/photographer/598320 https://www.jetphotos.com/photographer/598321 https://www.jetphotos.com/photographer/598322 https://www.jetphotos.com/photographer/598324 https://www.jetphotos.com/photographer/598328 https://www.jetphotos.com/photographer/598340 https://www.jetphotos.com/photographer/598341 https://www.jetphotos.com/photographer/598346 https://www.jetphotos.com/photographer/598349 https://www.jetphotos.com/photographer/598357 https://www.jetphotos.com/photographer/598366 https://www.jetphotos.com/photographer/598372 https://www.jetphotos.com/photographer/598374 https://www.jetphotos.com/photographer/598378 https://www.jetphotos.com/photographer/600028 https://www.jetphotos.com/photographer/600031 https://www.jetphotos.com/photographer/600032 https://www.jetphotos.com/photographer/600034 https://www.jetphotos.com/photographer/600036 https://www.jetphotos.com/photographer/600037 https://www.jetphotos.com/photographer/600039 https://www.jetphotos.com/photographer/600041 https://www.jetphotos.com/photographer/600042 https://www.jetphotos.com/photographer/600045 https://www.jetphotos.com/photographer/600046 https://www.jetphotos.com/photographer/600047 https://www.jetphotos.com/photographer/600048 https://www.jetphotos.com/photographer/600050 https://www.jetphotos.com/photographer/600051 https://www.jetphotos.com/photographer/600052 https://www.jetphotos.com/photographer/600053 https://www.jetphotos.com/photographer/600055 https://www.jetphotos.com/photographer/600057 https://www.jetphotos.com/photographer/600641 https://www.jetphotos.com/photographer/600644 https://www.jetphotos.com/photographer/600645 https://www.jetphotos.com/photographer/600646 https://www.jetphotos.com/photographer/602231 https://www.jetphotos.com/photographer/602240 https://www.jetphotos.com/photographer/602244 https://www.jetphotos.com/photographer/602247 https://www.jetphotos.com/photographer/602261 https://www.jetphotos.com/photographer/602265 https://www.jetphotos.com/photographer/602279 https://www.jetphotos.com/photographer/602307 https://www.jetphotos.com/photographer/602315 https://www.jetphotos.com/photographer/602323 https://www.jetphotos.com/photographer/602340 https://www.jetphotos.com/photographer/602346 https://www.jetphotos.com/photographer/602741 https://www.jetphotos.com/photographer/602743 https://www.jetphotos.com/photographer/602744 https://www.jetphotos.com/photographer/602745 https://www.jetphotos.com/photographer/602746 https://www.jetphotos.com/photographer/602748 https://www.jetphotos.com/photographer/602749 https://www.jetphotos.com/photographer/602750 https://www.jetphotos.com/photographer/602757 https://www.jetphotos.com/photographer/602758 https://www.jetphotos.com/photographer/602762 https://www.jetphotos.com/photographer/602763 https://www.jetphotos.com/photographer/602764 https://www.jetphotos.com/photographer/602769 https://www.jetphotos.com/photographer/602770 https://www.jetphotos.com/photographer/602772 https://www.jetphotos.com/photographer/602773 https://www.jetphotos.com/photographer/602774 https://www.jetphotos.com/photographer/602775 https://www.jetphotos.com/photographer/601186 https://www.jetphotos.com/photographer/601188 https://www.jetphotos.com/photographer/601189 https://www.jetphotos.com/photographer/601191 https://www.jetphotos.com/photographer/601192 https://www.jetphotos.com/photographer/601194 https://www.jetphotos.com/photographer/601196 https://www.jetphotos.com/photographer/601197 https://www.jetphotos.com/photographer/601248 https://www.jetphotos.com/photographer/601249 https://www.jetphotos.com/photographer/601250 https://www.jetphotos.com/photographer/601251 https://www.jetphotos.com/photographer/601252 https://www.jetphotos.com/photographer/601254 https://www.jetphotos.com/photographer/601255 https://www.jetphotos.com/photographer/601256 https://www.jetphotos.com/photographer/601258 https://www.jetphotos.com/photographer/601260 https://www.jetphotos.com/photographer/601261 https://www.jetphotos.com/photographer/601263 https://www.jetphotos.com/photographer/601264 https://www.jetphotos.com/photographer/601265 https://www.jetphotos.com/photographer/601266 https://www.jetphotos.com/photographer/601267 https://www.jetphotos.com/photographer/601268 https://www.jetphotos.com/photographer/601269 https://www.jetphotos.com/photographer/601270 https://www.jetphotos.com/photographer/601272 https://www.jetphotos.com/photographer/601273 https://www.jetphotos.com/photographer/602779 https://www.jetphotos.com/photographer/602780 https://www.jetphotos.com/photographer/602781 https://www.jetphotos.com/photographer/602782 https://www.jetphotos.com/photographer/600111 https://www.jetphotos.com/photographer/600112 https://www.jetphotos.com/photographer/600148 https://www.jetphotos.com/photographer/600151 https://www.jetphotos.com/photographer/600155 https://www.jetphotos.com/photographer/600157 https://www.jetphotos.com/photographer/600159 https://www.jetphotos.com/photographer/600161 https://www.jetphotos.com/photographer/600163 https://www.jetphotos.com/photographer/600647 https://www.jetphotos.com/photographer/600648 https://www.jetphotos.com/photographer/600649 https://www.jetphotos.com/photographer/600650 https://www.jetphotos.com/photographer/602889 https://www.jetphotos.com/photographer/602890 https://www.jetphotos.com/photographer/602891 https://www.jetphotos.com/photographer/602895 https://www.jetphotos.com/photographer/602897 https://www.jetphotos.com/photographer/602900 https://www.jetphotos.com/photographer/602904 https://www.jetphotos.com/photographer/602907 https://www.jetphotos.com/photographer/602913 https://www.jetphotos.com/photographer/602916 https://www.jetphotos.com/photographer/602918 https://www.jetphotos.com/photographer/602922 https://www.jetphotos.com/photographer/602923 https://www.jetphotos.com/photographer/602925 https://www.jetphotos.com/photographer/602926 https://www.jetphotos.com/photographer/600534 https://www.jetphotos.com/photographer/600535 https://www.jetphotos.com/photographer/600536 https://www.jetphotos.com/photographer/600538 https://www.jetphotos.com/photographer/600539 https://www.jetphotos.com/photographer/600540 https://www.jetphotos.com/photographer/600542 https://www.jetphotos.com/photographer/600543 https://www.jetphotos.com/photographer/600544 https://www.jetphotos.com/photographer/600547 https://www.jetphotos.com/photographer/600548 https://www.jetphotos.com/photographer/600549 https://www.jetphotos.com/photographer/600550 https://www.jetphotos.com/photographer/600552 https://www.jetphotos.com/photographer/600553 https://www.jetphotos.com/photographer/600555 https://www.jetphotos.com/photographer/600558 https://www.jetphotos.com/photographer/600565 https://www.jetphotos.com/photographer/600566 https://www.jetphotos.com/photographer/600567 https://www.jetphotos.com/photographer/600568 https://www.jetphotos.com/photographer/600571 https://www.jetphotos.com/photographer/600573 https://www.jetphotos.com/photographer/600575 https://www.jetphotos.com/photographer/600576 https://www.jetphotos.com/photographer/600577 https://www.jetphotos.com/photographer/600578 https://www.jetphotos.com/photographer/600666 https://www.jetphotos.com/photographer/600668 https://www.jetphotos.com/photographer/600669 https://www.jetphotos.com/photographer/600670 https://www.jetphotos.com/photographer/602963 https://www.jetphotos.com/photographer/601276 https://www.jetphotos.com/photographer/601280 https://www.jetphotos.com/photographer/601281 https://www.jetphotos.com/photographer/601284 https://www.jetphotos.com/photographer/601285 https://www.jetphotos.com/photographer/601286 https://www.jetphotos.com/photographer/601287 https://www.jetphotos.com/photographer/601288 https://www.jetphotos.com/photographer/601291 https://www.jetphotos.com/photographer/601293 https://www.jetphotos.com/photographer/602776 https://www.jetphotos.com/photographer/602777 https://www.jetphotos.com/photographer/602955 https://www.jetphotos.com/photographer/602956 https://www.jetphotos.com/photographer/602957 https://www.jetphotos.com/photographer/602959 https://www.jetphotos.com/photographer/602960 https://www.jetphotos.com/photographer/602961

GuiEdit

Question

質問

How can I add a graphical button bar in the edit window, as in the pmwiki.org site ?

どうやって編集画面に、pmwiki.orgサイトのようなグラフィカルボタンバーを加えられますか?

Answer

回答

Add the following in local/config.php file

  $EnableGUIButtons = 1;

That's all !

次のようにlocal/config.phpファイルに加えます

    $EnableGUIButtons = 1;

それだけ!

Options

オプション

Larger buttons

You may find the original buttons a bit small (22x22) so you can find a new set of larger buttons (34x32) here :

  Attach:GUIButtons32.zip

大きなボタン

オリジナルの小さなボタン(22x22)を見つければ、大きなボタン(34x32)を見つけることが出来ます:

  GUIButtons32.zip

These buttons shall be installed in a new subdirectory of /pub directory, e.g. pub/guiedit32.
The following line shall be added in the local/config.php file

これらのボタンは /pubディレクトリの新しいサブディレクトリにインストールされるでしょう、例えば pub/guiedit32に。
次の行がlocal/config.phpに加えられます。

 $GUIButtonDirUrlFmt = '$FarmPubDirUrl/guiedit32'; 

New buttons

You can add new buttons by adding their description in local/config.php file.

New buttons

local/config.phpに定義を加えることで新しいボタンを加えられます。

This script adds a graphical button bar to the edit page form.

このスクリプトは編集ページのフォームにグラフィカルなボタンを加えます。

The buttons are placed in the $GUIButtons array; each button is specified by an array of five values:

  • the position of the button relative to others (a number)
  • the opening markup sequence
  • the closing markup sequence
  • the default text if none was highlighted
  • the text of the button, either (a) HTML markup or (b) the url of a gif/jpg/png image to be used for the button (along with optional "title" text in quotes).

ボタンは $GUIButtons配列に設定され、それぞれのボタン配列は5つの値で定義される。

  • ボタンの相対位置(番号)
  • 開始のマークアップ要素
  • 終了のマークアップ要素
  • 強調されるデフォルトのテキスト
  • ボタンテキスト、(a)HTMLマークアップ、(b)ボタンに使われるgif/jpg/png画像のURLのいずれか(クオート内に"title"オプション)

The position is just an order number, you can have more than a difference of 1 between the numbers, which allow room to insert others buttons later.

位置番号は順番のみで(1以上異なる数値)、後で異なるボタンを挿入できる余地を許可します。

The present positions are :

表示されている位置は:

  • 'em' : 100
  • 'strong' : 110
  • 'pagelink' : 200
  • 'extlink' : 210
  • 'attach' : 220
  • 'big' : 300
  • 'small' : 310
  • 'sup' : 320
  • 'sub' : 330
  • 'h2' : 400
  • 'center' : 410

Others buttons, from sample-config file

その他のボタン、sample-configファイルより

  • For Heading - the difference with the existing is the image
  $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
                     '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');

  • For sub-heading
  $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
                     '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');

  • For indenting text
  $GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
                     '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');

  • For 'outdenting' text (indent start at second line)
  $GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
                     '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');

  • For ordered list
  $GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
                     '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');

  • For unordered (bullet) list
  $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
                     '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');

  • For an horizontal rule
  $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
                     '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');

  • A template of simple table
  $GUIButtons['table'] = array(600,
                     '||border=1 width=80%\\n||$[!Hdr] ||$[!Hdr] ||$[!Hdr] ||\\n'.
                     '||     ||     ||     ||\\n||     ||     ||     ||\\n',
                     '', '', 
                     '$GUIButtonDirUrlFmt/table.gif"$[Table]"');

Miscellaneous buttons

  • Underlining the text
  $GUIButtons ['underline'] = array(95, '{+', '+}', '$[text]',
   '$GUIButtonDirUrlFmt/underline.gif"$[Underline]"'); 
  • A template of advanced table
  $GUIButtons ['advtable'] = array(610, 
    '(:table border=1 width=80%:)\\n(:cellnr:)\'\'\'$[Header]\'\'\'\\n'.
    '(:cell:)\'\'\'$[Header]\'\'\'\\n(:cell:)\'\'\'$[Header]\'\'\'\\n'.
    '(:cellnr:)\\n(:cell:)\\n(:cell:)\\n(:tableend:)\\n',
    '', '', '$GUIButtonDirUrlFmt/table2.gif"$[Advanced table]"'); 

  • Four Buttons for custom block styles. Below they are defined to give coloured backgrounds, but they can easily be changed to other styles using wiki styles definitions (see PmWiki/CustomWikiStyles).

Images: Attach:gui-style-buttons.zip Attach:st1.gif Attach:st2.gif Attach:st3.gif Attach:st4.gif

   #Define custom styles s1 to s4:  
   $WikiStyle['s1']['background-color']='#def';
   $WikiStyle['s1']['padding']='3px';
   $WikiStyle['s2']['background-color']='#efd';
   $WikiStyle['s2']['padding']='3px';
   $WikiStyle['s3']['background-color']='#ffb';
   $WikiStyle['s3']['padding']='3px';
   $WikiStyle['s4']['background-color']='#fed';
   $WikiStyle['s4']['padding']='3px';

   #Button definitions creating %block s1% etc markup:
   $GUIButtons ['style1'] = array(500, '%25block s1%25', '', '',
     '$GUIButtonDirUrlFmt/st1.gif"$[Style 1]"');
   $GUIButtons ['style2'] = array(510, '%25block s2%25', '', '',
     '$GUIButtonDirUrlFmt/st2.gif"$[Style 2]"');
   $GUIButtons ['style3'] = array(520, '%25block s3%25', '', '',
     '$GUIButtonDirUrlFmt/st3.gif"$[Style 3]"');
   $GUIButtons ['style4'] = array(530, '%25block s4%25', '', '',
     '$GUIButtonDirUrlFmt/st4.gif"$[Style 4]"');

Buttons for Cookbook addons :

   $GUIButtons ['pagetoc'] = array(90, '\\n(:toc:)\\n', '', '',
     '$GUIButtonDirUrlFmt/toc.gif"$[Table of content]"');				

   $GUIButtons ['image'] = array(620, 'Img:', '', '$[MyImage.jpg]',
     '$GUIButtonDirUrlFmt/image.gif"$[Insert image]"');

   $GUIButtons ['snote'] = array(640, '{=', '=}', '$[text]',
     '$GUIButtonDirUrlFmt/snote.gif"$[Sticky note]"');	

  • Signature/datestamp for discussion Attach:sig.gif (image? only for 22x22 set)
   $GUIButtons['sig'] = array(460, '----\\n~~~:\\\\\\\\\n', '\\n ~~~~\\n\\n', '',
                  '$GUIButtonDirUrlFmt/sig.gif"$[Stamp your name and current date]"');
  • Button images for highlighting text Attach:hightext.gif and background Attach:highbg.gif
   $GUIButtons['hit'] = array(420, '%green%', '%%', '',
   '$GUIButtonDirUrlFmt/hightext.gif"$[Highlight the text color\\n(select text, then click here)]"');
   $GUIButtons['hib'] = array(440, '%bgcolor=yellow%', '%%', '',
                  '$GUIButtonDirUrlFmt/highbg.gif"$[Highlight the paper color]"');

Discussion

An improvement to the script can be to allow an undo. On some browser/installation 'Ctrl-Z' works, but not on all.

Q: Is it possible to add a 2nd row of buttons below the first one ? jmi? Also curious about this as well -cs

Problems

  • In Opera and Khtml the text is inlined at the end of the document, not at the cursor position. - Schlaefer?
    This is a known limitation of Opera -- Opera doesn't provide the ability to find the current cursor position or insert text into the middle of a <textarea> element. I don't know about Khtml, but I suspect it's the same thing. --Pm?

I didn't know that. I choose not to output the buttonbar by putting the following at the beginning of insButton()

 var clientPC = navigator.userAgent.toLowerCase(); 
 var BrowserIsSafari = ((clientPC.indexOf('applewebkit')!=-1)
                 && (clientPC.indexOf('spoofer')==-1));
 var BrowserIsOpera = clientPC.indexOf('opera')!=-1;
 if (BrowserIsSafari || BrowserIsOpera) return;

Schlaefer?

  • On loading beta44, found that the row of buttons jumps from the top of the edit box when the browser screen is wide enough, and settle between the sidebar and the left edge of the edit box. Occurs in IE and Firefox. Des 11 July 05.
Now fixed for beta45.
  • On loading beta46, noted that the editing box below the row of buttons has now changed to fixed width from the previous proportional width, which seemed much better. Des 12 July 05.

See also

An example of the big button bar, with the button as defined above :

http://cncloisirs.com/Fonctionnement.BacASable?action=edit

Note : you can also find on this edit window a removal of menu, header and footer described here : layout edit modified?

Translation

The text associated with the button can be translated in a given language via the XLPage. See the appropriated paragraph in the Localization.XLPageTemplate and for Cookbook buttons in Localization.XLPageCookbookTemplate

Contributors


Category: Layout

Edit - History - Print - Recent Changes - Search
Page last modified on December 23, 2021, at 06:48 AM