From 6597cbb7cc94f08bcda74a334b55a5186429b241 Mon Sep 17 00:00:00 2001 From: sleroux-keep Date: Mon, 13 Apr 2015 10:50:49 +0100 Subject: [PATCH] Fixed wikicipher button issue Incremented version --- assets/javascripts/jstoolbar/wikicipher.js | 10 ++++++++-- init.rb | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) 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