From 6ab68e0fca38225b69354850aaa083fbbe133f05 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 7 May 2014 14:49:14 +0100 Subject: [PATCH] Remove erroneous global wiki references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $tw.wiki is used as a global reference in the outer initialisation modules. It shouldn’t be used in widgets etc. --- core/modules/widgets/navigator.js | 5 +++-- plugins/tiddlywiki/codemirror/codemirroreditor.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 2225a88ce..1edd19521 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -172,11 +172,12 @@ NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) { // Place a tiddler in edit mode NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) { + var self = this; function isUnmodifiedShadow(title) { // jshint eqnull:true - var tiddler = $tw.wiki.getTiddler(title); + var tiddler = self.wiki.getTiddler(title); return ( - $tw.wiki.isShadowTiddler(title) && + self.wiki.isShadowTiddler(title) && tiddler.fields.modified == null ); } diff --git a/plugins/tiddlywiki/codemirror/codemirroreditor.js b/plugins/tiddlywiki/codemirror/codemirroreditor.js index 2643dc8cc..c898d1ebc 100644 --- a/plugins/tiddlywiki/codemirror/codemirroreditor.js +++ b/plugins/tiddlywiki/codemirror/codemirroreditor.js @@ -59,7 +59,7 @@ EditTextWidget.prototype.postRender = function() { lineWrapping: true, lineNumbers: true }, - tid = $tw.wiki.getTiddler(this.editTitle); + tid = this.wiki.getTiddler(this.editTitle); if(tid && tid.fields.type) { cm_opts.mode = tid.fields.type };