Feature #618
未完了Ability to list all pages alphabetically
0%
説明
It would be awesome to have a way to list all articles within a project wiki, maybe as an extension of the tags macro, by not listing any particular tags. It would even be better if it could be grouped as shown in the example I've attached to this message.
ファイル
FLX FLX さんがほぼ14年前に更新
Hi,
I've cheated around a bit and made a function in ProtoType that accomplishes this: http://jsfiddle.net/flxfxp/3LwH8/19/
However, I've tried to implement it in Redmine but when using it it actually clears the list.
Maybe you can get it to work inside Redmine?
Thanks.
Dennis
FLX FLX さんがほぼ14年前に更新
I completely understand. However, since the English alphabet only consists of 26 letters it would be handy for those who need it. I've been trying to get it working as an extension of the taggedpages macro by creating the following:
Redmine::WikiFormatting::Macros.register do desc "Creates a nice list format for the taggedpages macro" macro :taggedlist do |obj, args| s = ' <script type="text/javascript"> var output = $H({}); $$(".wiki ul.wikiext-taggedpages li a").each(function(el) { var l = el.innerHTML.substr(0, 1).toUpperCase(); if (typeof(output.get(l)) == "undefined") output.set(l, []); output.get(l).push(el.innerHTML); }); $$(".wiki ul.wikiext-taggedpages").invoke("update", ""); output.keys().each(function(key) { var values = output.get(key); $$("ul").first().insert("<li><p>" + key + "</p></li>"); values.each(function(v) { $$("ul").first().insert("<li>" + v + "</li>"); }); }); </script> '
It doesn't seem to work like my example at http://jsfiddle.net/flxfxp/3LwH8/19/, as it removes the entire list content. Even if it's not going to be in the wiki extensions plugin, can you help me get this working?
Many thanks,
Dennis
Haru Iida さんが13年以上前に更新
You have to use $$(".wiki ul.wikiext-taggedpages") instead of $$("ul").
How about following code?
Redmine::WikiFormatting::Macros.register do desc "Creates a nice list format for the taggedpages macro" macro :taggedlist do |obj, args| s = ' <script type="text/javascript"> var output = $H({}); $$(".wiki ul.wikiext-taggedpages li a").each(function(el) { var l = el.innerHTML.substr(0, 1).toUpperCase(); if (typeof(output.get(l)) == "undefined") output.set(l, []); output.get(l).push(el.innerHTML); }); var ul = $$(".wiki ul.wikiext-taggedpages"); ul.invoke("update", ""); output.keys().each(function(key) { var values = output.get(key); ul.first().insert("<li><p>" + key + "</p></li>"); values.each(function(v) { ul.first().insert("<li>" + v + "</li>"); }); }); </script> ' end end
Haru Iida さんが13年以上前に更新
You can try this one.
Redmine::WikiFormatting::Macros.register do desc "Creates a nice list format for the taggedpages macro" macro :taggedlist do |obj, args| s = ' <script type="text/javascript"> var output = $H({}); $$(".wiki ul.wikiext-taggedpages li a").each(function(el) { var l = el.innerHTML.substr(0, 1).toUpperCase(); if (typeof(output.get(l)) == "undefined") output.set(l, []); output.get(l).push(el.parentNode.innerHTML); }); var ul = $$(".wiki ul.wikiext-taggedpages"); ul.invoke("update", ""); output.keys().each(function(key) { var values = output.get(key); ul.first().insert("<li><p>" + key + "</p></li>"); values.each(function(v) { ul.first().insert("<li>" + v + "</li>"); }); }); </script> ' end end