====== Dokucrypt Plugin ======
---- plugin ----
description: A plugin to support client side cryptography
author : Scott Moser (Updated by Ahmet Sacan)
email : smoser@brickies.net
type : admin
lastupdate : 2013-02-25
compatible : 2012-10-13, 2009-02-14, 2008-05-05
depends :
conflicts : aceeditor
similar :
tags : encryption, password, deprecated
downloadurl: https://sacan.biomed.drexel.edu/index.php?id=index&do=serveplugin_download&plugin=crypt
----
\\
:!::!: **This Plugin has been replaced by: [[plugin:dokucrypt2]]** :!::!:
\\
\\
----
The below info is out of date.
----
[[http://www.brickies.net/wiki/dokucrypt:start|Details and Original Documentation]]
===== About This Plugin - Read Before Installing =====
* :!: The latest version of this plugin (main download link above) requires PATCH1, PATCH2, PATCH3 below to work properly.
* The update supplied by Ahmet Sacan below has been installed and tested to work well under Version 2012-10-13 “Adora Belle" when combined with PATCH1 & PATCH2 below. I have updated the plugin info and main download link to point to this new version and have contacted the original author. --- [[user>sherri|Sherri]] //2013/02/25 19:02//
* PATCH1 below fixes issues with some editor buttons not working and some buttons missing.
* PATCH2 below fixes issues with the editor's header buttons not working.
* :!: **Important:** Scott Moser the original creator of this plugin has provided the following:
* https://github.com/smoser/dokuwiki - GitHub Branch of Dokuwiki with the patches applied. Hopefully we can get this merged into the main trunk.
* http://smoser.brickies.net/git/?p=dokucrypt.git;a=summary - Git repo of the plugin and the patches described below as handy patch files.
* I have used this plugin for years. I did not find a similar plugin that I like as much as this one. However it does needs some maintenance. I managed to get this working with HRUN using the patches below, as well as updating lib/plugins/crypt/action.php based on [[devel:jqueryfaq#will_my_old_plugins_continue_to_work|the jQueryfaq]]
==== PATCH1: Resolving conflict with Linkwizard JS code (Editor Toolbar Issues) ====
This solution makes "almost" everything work: The linkwizard is checking the textearea's form's pageid, but fails to do so, because moving the textarea out of the form is a critical part of the crypt's functionality. You need to change 2 lines in linkwiz.js to enable its to access the form's pageid:
**Here is the patch for version 2013-10-13+:**
--- \lib\scripts\linkwiz-original.js
+++ \lib\scripts\linkwiz.js
@@ -41,12 +41,13 @@
'left': (pos.left+80)+'px'
})
.hide()
.appendTo('.dokuwiki:first');
dw_linkwiz.textArea = $editor[0];
+ dw_linkwiz.formid = dw_linkwiz.textArea.form['id'].value; // Dokucrypt Plugin Mod
dw_linkwiz.result = jQuery('#link__wiz_result')[0];
// scrollview correction on arrow up/down gets easier
jQuery(dw_linkwiz.result).css('position', 'relative');
dw_linkwiz.$entry = jQuery('#link__wiz_entry');
@@ -224,13 +225,14 @@
if(!stxt && !DOKU_UHC) {
stxt=title;
}
// prepend colon inside namespaces for non namespace pages
- if(dw_linkwiz.textArea.form.id.value.indexOf(':') != -1 &&
+ //if(dw_linkwiz.textArea.form.id.value.indexOf(':') != -1 && // Dokucrypt Plugin Mod
+ if(dw_linkwiz.formid.indexOf(':') != -1 && // Dokucrypt Plugin Mod
link.indexOf(':') == -1){
link = ':' + link;
}
var so = link.length+3;
Posted by: --- [[user>sherri|Sherri]] //2013/02/25 22:27//
**Here is the patch for older versions of Dokuwiki:**
--- lib/scripts/linkwiz.js (revision 158)
+++ lib/scripts/linkwiz.js (revision 167)
@@ -41,4 +41,5 @@
textArea.form.parentNode.appendChild(linkwiz.wiz);
linkwiz.textArea = textArea;
+ linkwiz.formid = textArea.form['id'].value;
linkwiz.result = $('link__wiz_result');
linkwiz.entry = $('link__wiz_entry');
@@ -205,5 +206,6 @@
// prepend colon inside namespaces for non namespace pages
- if(linkwiz.textArea.form['id'].value.indexOf(':') != -1 &&
+ // ahmet: replaced linkwiz.textArea.form['id'].value with linkwiz.formid
+ if(linkwiz.formid.indexOf(':') != -1 &&
linkwiz.entry.value.indexOf(':') == -1){
linkwiz.entry.value = ':'+linkwiz.entry.value;
* [[https://sacan.biomed.drexel.edu/index.php?id=index&do=serveplugin_download&plugin=crypt|Here is a fix]] to make this plugin work with DokuWiki after 2009-12-02. The fix involves delaying the addInitEvent after toolbar is setup by moving the init call into action.php. -Ahmet Sacan
* Note: This URL has been set as the main download URL for this plugin. --- [[user>sherri|Sherri]] //2013/03/08 02:28//
posted by: ---//ahmetsacan//
==== PATCH2: Resolving problems with empty pages and toolbar header buttons ====
The header buttons in the editor toolbar are not working. Reported by //Termiter//. This patch resolves the issue.
**Here is the patch for version 2013-10-13+:**
--- \lib\scripts\edit-original.js
+++ \lib\scripts\edit.js
@@ -143,16 +143,17 @@
* @author Andreas Gohr
*/
function currentHeadlineLevel(textboxId){
var field = jQuery('#' + textboxId)[0],
s = false,
opts = [field.value.substr(0,getSelection(field).start)];
- if (field.form.prefix) {
- // we need to look in prefix context
- opts.push(field.form.prefix.value);
- }
+ //if (field.form.prefix) { // Dokucrypt Plugin Mod
+ if (field.form && field.form.prefix) { // Dokucrypt Plugin Mod
+ // we need to look in prefix context
+ opts.push(field.form.prefix.value);
+ }
jQuery.each(opts, function (_, opt) {
// Check whether there is a headline in the given string
var str = "\n" + opt,
lasthl = str.lastIndexOf("\n==");
if (lasthl !== -1) {
Posted by: --- [[user>sherri|Sherri]] //2013/02/26 04:47//
**Here is the patch for older versions of Dokuwiki:**
--- edit.js.orig 2010-06-22 09:31:07.000000000 +0200
+++ edit.js 2010-06-22 09:31:12.000000000 +0200
@@ -220,7 +220,7 @@
var selection = getSelection(field);
var search = "\n"+field.value.substr(0,selection.start);
var lasthl = search.lastIndexOf("\n==");
- if(lasthl == -1 && field.form.prefix){
+ if(lasthl == -1 && field.form && field.form.prefix){
// we need to look in prefix context
search = field.form.prefix.value;
lasthl = search.lastIndexOf("\n==");
-----
==== PATCH3: Resolving addInitEvent is not defined JS error. ====
In action.php change this line:
$event->data['script'][]=array('type'=>'text/javascript','charset'=>'utf-8','_data'=>'','_data'=>"addInitEvent(function() { return(decryptEditSetup()); });");
to this:
$event->data['script'][]=array('type'=>'text/javascript','charset'=>'utf-8','_data'=>'','_data'=>"jQuery(function(){ return(decryptEditSetup()); });");
Note that I am going to fork this plugin and release a clean working one.
--- [[user>sherri|Sherri]] //2017-06-26 04:39//
===== Comments & Discussion =====
IMHO it's not a really good idea to using "prompt" for insert the pass-phrase, cause anybody can see what you type. anyway if I can read the passphrase, it's not useful to type it twice, or?
winky 2010/02/26
----
any fix to make a password prompt?
peufel 2011/10/06
----
Not compatible with the version 2013/03/06
biowan 2013/04/29
----
I don't know if I'm alone in this case, but it's really **doesn't work** with the version in **2013-05-10**. I patched and empty cache folder, no way.
biowan 2013/05/27
----
I also had problems with the latest version of Dokuwiki **2013-05-10**. The tag does not work and there is no "DecryptSecret" button when editing pages. I think there is a typo on the version of Dokuwiki for which PATCH1 and PATCH2 should be used: instead of **2013-10-13**, it should be **2012-10-13**, right ?
renatocan 2013/08/09
----
Is there A better way to build this type of plugin so it doesn't break every time DokuWiki gets an upgrade?
Whats the best model for encrypting text client side?
J 2013/October/8th
----
Somewhere, I'm happy that I'm not alone. I'm really frustate that there is no solution and I don't know how this plugin works. No way for me to debug it and it's really complex to understand what the javascript does. So I must migration to another plugin and I must change them 1 by 1 manually.
biowan 2013/12/18