diff --git a/assets/javascripts/jstoolbar/wikicipher.js b/assets/javascripts/jstoolbar/wikicipher.js index e23ce03..ff800d3 100644 --- a/assets/javascripts/jstoolbar/wikicipher.js +++ b/assets/javascripts/jstoolbar/wikicipher.js @@ -12,11 +12,17 @@ jsToolBar.prototype.elements.wikicipher = { window.onload=function(){ var warn = document.getElementsByClassName('flash warning'); - var isWiki = "/Wiki/edit"; + var wikiEdit = "/edit"; + var wiki = "wiki"; if (warn.length>0){ document.getElementsByClassName('jstb_wikicipher')[0].hide(); } - if(window.location.pathname.indexOf(isWiki, window.location.pathname.length - isWiki.length) !== -1){ + var pathName = window.location.pathname; + if( + (pathName.indexOf(wiki)>=0 && pathName.indexOf(wikiEdit, pathName.length - wikiEdit.length) !== -1) + || + (pathName.indexOf(wiki, pathName.length - wiki.length) !== -1) + ){ // nothing to do... }else{ //hide wikicipher toolbar buttons diff --git a/init.rb b/init.rb index 6a62d74..09419ae 100644 --- a/init.rb +++ b/init.rb @@ -14,7 +14,7 @@ author 'Sébastien Leroux' author_url 'mailto:sleroux@keep.pt' description 'This plugin adds the ability to encrypt section of text' - version '0.0.8' + version '0.0.10' url 'https://github.com/keeps/redmine_wikicipher' end