Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
[SOLVED] How to disable automatic list indentation?
Avatar
Algarrobo #1
Member for a month · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] How to disable automatic list indentation?
Hello,

Is there any way to disable the automatic list indentation?
This new feature appeared in the last release. It makes me lost a lot of time while editing a document due to my way of typing and I would like to disable it.

Thank you!
This post was edited on 2010-02-05, 19:57 by Algarrobo.
Avatar
chi (Moderator) #2
Member since Jun 2006 · 1637 posts · Location: Munich Germany
Group memberships: Global Moderators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by Algarrobo:
Is there any way to disable the automatic list indentation?

Nope.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
kazmiya #3
Member since Oct 2009 · 10 posts · Location: Tsukuba, Japan
Group memberships: Members
Show profile · Link to this post
Currently there is no setting options to disable automatic
indentation, however DokuWiki has a "userscript" feature.

To disable it, save this script as "conf/userscript.js".

/**
 * Disables an automatic list indentation feature
 */
addInitEvent(function() {
    var field = $('wiki__text');
    if (!field) return;
    var events = field.events;
    if (!events) return;

    for (var $$guid in events.keydown) {
        if (events.keydown[$$guid].toString().match(/^function\s+keyHandler\b/)) {
            removeEvent(field, 'keydown', events.keydown[$$guid]);
        }
    }
});

Usage Notice:

  * Better be aware that you're using a "quick hack".

  * This script may only be valid for DokuWiki 2009-12-25.
    Since the "conf/userscript.js" is for your own special
    functionalities or temporal workarounds, you must
    reevaluate the script when upgrading your DokuWiki
    installation.

  * This script removes any events using keyHandler() function
    on the 'wiki__text' id in your DokuWiki pages. That means,
    if your DokuWiki uses such event for other than automatic
    indentation, this script may break some functionalities.
This post was edited on 2010-02-08, 13:49 by kazmiya.
Avatar
Algarrobo #4
Member for a month · 2 posts
Group memberships: Members
Show profile · Link to this post
Solved! The hack of kazmiya works fine.
Thank you!
Avatar
turnermm #5
Member since Oct 2009 · 104 posts · Location: Winnipeg, Manitoba, Canada
Group memberships: Members
Show profile · Link to this post
In reply to post #3
I haven't investigated this thoroughly but doesn't this remove all keydown events from the editing area?   It doesn't appear to affect Dokuwiki's scripts currently, but it could in the future, and it could corrupt plugins that listen for key events and initialize using Dokuwiki's addEvent protocol.
Myron Turner
fcgkLite: http://www.mturner.org/dwfck/fckgLite/
DokuWikiFCK:  http://www.mturner.org/dwfck/
New Media: http://www.room535.org
Avatar
kazmiya #6
Member since Oct 2009 · 10 posts · Location: Tsukuba, Japan
Group memberships: Members
Show profile · Link to this post
Thanks turnermm, I have revised my previous post to follow your
advice.

---

Mumbling...

In the JavaScript framework of DokuWiki, adding an event is
easy, but removing an event is difficult.

In this case that event uses explicitly declared function, so
we can easily identify what is the event to be removed. However
when an event is registered with anonymous function, that is
difficult to remove. I'd like to know a better way to handle it.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20090606-dev, © 2003-8 by Yves Goergen
Current time: 2010-03-19, 08:43:40 (UTC +01:00)
WikiForumIRCBugsGitXRefTranslate