meteotest / npd

New Page Dialog for Dokuwiki
http://www.dokuwiki.org/plugin:npd
0 stars 3 forks source link

Cyrillic folders can not be selected #12

Open nelidimitrova opened 9 years ago

nelidimitrova commented 9 years ago

Hi. There is a problem with plugin when I use Cyrillic names of namespaces. When I try to add new folder with Cyrillic name (per example: животни) and one page in it (per example: риба) there is no problem. The namespace and the page are successfully created. But when I try to add other page in same namespace I can not because I can not select it at all. Plugin decide to choose [root] namespace and create new page in it instead of my Cyrillic namespace.

Screenshots:

  1. Create folder животни in Природа [root] namespace and page риба in it. create_new_page_1
  2. As you can see folder and page are successfully created. create_new_page_2
  3. Click again to "Create new page" button and as you can see plugin picked Природа [root] namespace. create_new_page_3 No matter how many times I click on folder животни plugin picks Природа.
  4. So new page кон is created in Природа [root] instead of in животни. create_new_page_4

I debuged code and I found that the problem is with encoding of names. In tpl/main.php I replaced:

a = a.replace(/%3A/g, ":");

with

a = decodeURIComponent(a);

and now it works perfectly.

Have a nice day. :)