plugin:divalign2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:divalign2 [2019-01-05 16:19] – turnermm | plugin:divalign2 [2023-10-30 22:36] (current) – Klap-in | ||
---|---|---|---|
Line 4: | Line 4: | ||
description: | description: | ||
author | author | ||
- | email : luis.machuca | + | email : lambalicious |
type : syntax | type : syntax | ||
- | lastupdate : 2013-08-12 | + | lastupdate : 2020-06-11 |
- | compatible : " | + | compatible : Weatherwax, |
depends | depends | ||
- | conflicts | + | conflicts |
similar | similar | ||
- | tags : style, typography, odt, toolbar, !experimental | + | tags : style, typography, odt, toolbar |
- | downloadurl: | + | downloadurl: |
- | bugtracker : # eg. https://github.com/ryan.chappelle/dokuwiki-plugin-noiewarning/issues | + | bugtracker : https://notabug.org/lmachucabezzaza/dw-plugin-divalign2/issues |
- | sourcerepo : https://github.com/lmachucab/ | + | sourcerepo : https://notabug.org/lmachucabezzaza/ |
- | donationurl: | + | donationurl: |
+ | demourl: | ||
---- | ---- | ||
Line 34: | Line 35: | ||
Search and install the plugin using the [[plugin: | Search and install the plugin using the [[plugin: | ||
- | The link above will always point to the latest **stable** version. Should you need a previous | + | The link above will always point to the <del>latest |
+ | :!: **Note**: As of June 2020, plugin is in release candidate stages to check compatibility with Hogfather. If you can test the plugin and report back, feedback is welcome! | ||
+ | |||
+ | :!: **Note**: Versions of Dokuwiki previous to // | ||
- | **Note**: Versions of Dokuwiki previous to // | ||
==== Syntax ==== | ==== Syntax ==== | ||
Line 86: | Line 89: | ||
==== Demo ==== | ==== Demo ==== | ||
- | **Want to see the plugin in action? | + | **Want to see the plugin in action? |
- | If you want to contribute with a demo of this plugin, contact me. | ||
=====Other Details===== | =====Other Details===== | ||
Line 101: | Line 103: | ||
if(window.toolbar!=undefined){ | if(window.toolbar!=undefined){ | ||
- | | + | var align_da2_arr={ |
'#;; | '#;; | ||
';#; | ';#; | ||
';;# | ';;# | ||
'### | '### | ||
- | toolbar[toolbar.length] = { " | + | toolbar[toolbar.length] = { |
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
" | " | ||
- | " | + | " |
- | /* In some configurations, | + | /* In some configurations, |
- | / | + | |
+ | | ||
+ | }; | ||
} | } | ||
Line 142: | Line 147: | ||
====Changelog==== | ====Changelog==== | ||
- | FIXME The changelog will be updated later. In short: | + | See the repository page or [[https:// |
- | **2013** | ||
- | |||
- | * Removed multiple-paragrapgh misfeature. | ||
- | * Refactored code. | ||
- | * Still pending: toolbar update. | ||
- | |||
- | |||
- | **2011** | ||
- | |||
- | * '' | ||
- | * a small fix that imitates the same behaviour with DW versions previous to 2010-11-07, hopefully fixing the generation of invalid XHTML code. | ||
- | * new toolbar icons courtesy of // | ||
- | * the "blank line at the end" requirement for multiple paragraphs is removed for DW releases 2010-11-07 and hopefully later. | ||
==== Source Code ==== | ==== Source Code ==== | ||
Unzipping the file from the download link above will give you the source code, as will do checking the source repo. It is free, in the GPL definition of the word. | Unzipping the file from the download link above will give you the source code, as will do checking the source repo. It is free, in the GPL definition of the word. | ||
- | |||
- | ==== Legalese ==== | ||
- | |||
- | This plugin (" | ||
- | |||
- | " | ||
- | |||
- | Credits are given to Jason Byrne for the original implementation of this plugin, which you will find under [[plugin: | ||
- | |||
- | ---- | ||
===== Discussion ===== | ===== Discussion ===== | ||
- | Feel free to :?: ask questions here. However, please __check the [[plugin:divalign|original plugin page]]__ before | + | :?: [[plugin:divalign2: |
- | ---- | ||
- | |||
- | >Hello, Since a few months I've been workign on a docuwiki and text-alignment certainly fails... I've found your plugin but it doesn' | ||
- | > | ||
- | > All the best, | ||
- | > --- User unknown // | ||
- | |||
- | If you do not get this plugin to work you might also like to try the [[wrap]] plugin. It supports alignment too, I think. | ||
- | --- [[user> | ||
- | |||
- | ---- | ||
- | |||
- | Hi! | ||
- | |||
- | You can simplify your code by writing one class that extends the DokuWiki_Syntax_Plugin class. And let next all your other syntax classes extend this first pluginsyntaxclass. So you can use parent:: | ||
- | |||
- | Good luck! | ||
- | --- [[user> | ||
- | ---- | ||
- | |||
- | The option ### for justify don't work. To make it work change in /// | ||
- | >< | ||
- | |||
- | FROM: Michel\\ | ||
- | Nice to be able to align text the way you want! | ||
- | Is there a way to make it work with tables? | ||
- | >Hi. I haven' | ||
- | |||
- | ---- | ||
- | |||
- | Just installed this. The icon on the toolbar shows X but the other align symbols show up when the X is clicked. Used plugin manager. How do I fix it? Thanks. peterennis (at) yahoo (dot) com // | ||
- | >Yeah, that was a mistake I made with the path to the icon file. In '' | ||
- | >< | ||
- | >and change as follows: | ||
- | >< | ||
- | >< | ||
- | |||
- | ---- | ||
- | |||
- | winky 2010/02/17 | ||
- | IMHO the Toolbar-Buttons are broken. For example, if I click " | ||
- | |||
- | < | ||
- | ;#;\n;#;\n | ||
- | </ | ||
- | |||
- | instead | ||
- | |||
- | < | ||
- | ;#; | ||
- | |||
- | ;#; | ||
- | </ | ||
- | |||
- | >Hi. I've taken note of this issue, but can only reproduce it with the latest version of DokuWiki. Let me check for a while before releasing a patch or something. -- --- // | ||
- | |||
- | Hi Luis, the following mod fixed it for me: | ||
- | < | ||
- | diff script.js script.js.org | ||
- | 13,15c13,15 | ||
- | < align_da2_arr['#;; | ||
- | < align_da2_arr[';#; | ||
- | < align_da2_arr[';;# | ||
- | --- | ||
- | > align_da2_arr['#;; | ||
- | > align_da2_arr[';#; | ||
- | > align_da2_arr[';;# | ||
- | </ | ||
- | |||
- | thx a lot for this plugin. another problem exists with the toolbar-icon (will not be displayed correctly). if i have some time i try to fix it too. | ||
- | --- // | ||
- | |||
- | OK, that was quite simple ... to fix the toolbar-icon you have only correct the path from '' | ||
- | |||
- | < | ||
- | 20c20 | ||
- | < " | ||
- | --- | ||
- | > " | ||
- | 24c24 | ||
- | < " | ||
- | --- | ||
- | > " | ||
- | </ | ||
- | |||
- | --- // | ||
- | |||
- | >Thanks for the clarification, | ||
- | |||
- | Hi Luis, the following mod fixed the broken Toolbar-Buttons for me: | ||
- | < | ||
- | original: | ||
- | align_da2_arr['#;; | ||
- | align_da2_arr[';#; | ||
- | align_da2_arr[';;# | ||
- | --- | ||
- | change to: | ||
- | align_da2_arr['#;; | ||
- | align_da2_arr[';#; | ||
- | align_da2_arr[';;# | ||
- | </ | ||
- | and it works fine. | ||
- | |||
- | --- // slowbu 2010/03/17 14:42// | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | Since troubles seem unsolved (at least for me) here my complete script.js, that fixed icon and usage errors: | ||
- | |||
- | < | ||
- | var align_da2_arr = new Array(); | ||
- | align_da2_arr['#;; | ||
- | align_da2_arr[';#; | ||
- | align_da2_arr[';;# | ||
- | |||
- | if(window.toolbar!=undefined){ | ||
- | toolbar[toolbar.length] = { " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | /* subdir of lib/images/ where images found.*/ | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | Remark the ../../ for the icon path but only ../ for the icobase path. | ||
- | |||
- | --- // | ||
- | |||
- | >Thanks for the clarification, | ||
- | |||
- | I don't like the buttons, so i worked out my own. Just click and download them, if u like them: {{http:// | ||
- | |||
- | --- // | ||
- | >Looks nice, maybe I can use them. Also, what problems? Could be of help to get some pointers to improve development. | ||
- | >> | ||
- | >> | ||
- | >>< | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | anzeigen lassen. | ||
- | |||
- | Du kannst einen Text | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | anzeigen lassen.</ | ||
- | >>And i get many problems. With the original php plugin code, i get something like this: {{http:// | ||
- | >> | ||
- | >>> | ||
- | >>> | ||
- | >>> | ||
- | >>>> | ||
- | |||
- | ---- | ||
- | |||
- | Plugin download link is down?? --- //Garrett 2010/08/27 12:48// | ||
- | >< | ||
- | |||
- | ---- | ||
- | |||
- | Would you add a way change text width? | ||
- | |||
- | A lot of blogs use 500-600px text column width. But Dokuwiki text is too long horizontally. | ||
- | |||
- | ex. < | ||
- | |||
- | > | ||
- | ---- | ||
- | |||
- | I updated the action.php file to make the toolbar works with Angua version of DokuWiki \\ | ||
- | // | ||
- | <file php action.php> | ||
- | <?php | ||
- | /** | ||
- | * @file | ||
- | * @brief | ||
- | * @license | ||
- | * @version | ||
- | * @date | ||
- | * @author | ||
- | **/ | ||
- | |||
- | if(!defined(' | ||
- | if(!defined(' | ||
- | require_once(DOKU_PLUGIN.' | ||
- | require_once(DOKU_PLUGIN. ' | ||
- | |||
- | class action_plugin_divalign2 extends DokuWiki_Action_Plugin { | ||
- | |||
- | /** | ||
- | * return some info | ||
- | */ | ||
- | function getInfo(){ | ||
- | return DW_common_divalign2:: | ||
- | } | ||
- | |||
- | function register(Doku_Event_Handler $controller) { | ||
- | // detect DokuWiki version | ||
- | /* $v= file_get_contents(DOKU_INC. ' | ||
- | if ($v===false) return; | ||
- | // else | ||
- | $v= substr($v, 0, strpos($v, ' ')); | ||
- | $v_is_old= intval ($v < ' | ||
- | //echo "< | ||
- | if ($v_is_old) { | ||
- | $res= $controller-> | ||
- | } | ||
- | if (0) $res= $controller-> | ||
- | $controller-> | ||
- | |||
- | } | ||
- | |||
- | function divalign_toolbar(& | ||
- | $event-> | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ), | ||
- | array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ), | ||
- | array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ), | ||
- | array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ), | ||
- | ) | ||
- | ); | ||
- | } | ||
- | |||
- | } | ||
- | //... and that's all | ||
- | |||
- | </ |
plugin/divalign2.1546701542.txt.gz · Last modified: 2019-01-05 16:19 by turnermm