diff --git a/core/modules/macros/button.js b/core/modules/macros/button.js index f0a898f80..490abeb04 100644 --- a/core/modules/macros/button.js +++ b/core/modules/macros/button.js @@ -39,21 +39,21 @@ exports.triggerPopup = function(event,cancel) { } // Check for cancelling if(cancel) { - $tw.popupper.cancel(); + $tw.popup.cancel(); } else { // Get the current popup state tiddler var value = this.wiki.getTextReference(textRef,"",this.tiddlerTitle); // Check if the popup is open by checking whether it matches "(,)" var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/; if(popupLocationRegExp.test(value)) { - $tw.popupper.cancel(); + $tw.popup.cancel(); } else { // Set the position if we're opening it this.wiki.setTextReference(textRef, "(" + this.child.domNode.offsetLeft + "," + this.child.domNode.offsetTop + "," + this.child.domNode.offsetWidth + "," + this.child.domNode.offsetHeight + ")", this.tiddlerTitle,true); - $tw.popupper.popup(textRef); + $tw.popup.popup(textRef); } } }; diff --git a/core/modules/popup.js b/core/modules/popup.js index 145fdb3e6..d4d620af5 100644 --- a/core/modules/popup.js +++ b/core/modules/popup.js @@ -1,9 +1,9 @@ /*\ -title: $:/core/modules/popupper.js +title: $:/core/modules/popup.js type: application/javascript module-type: utils -Plugin that creates a $tw.utils.Popupper object prototype that manages popups in the browser +Plugin that creates a $tw.utils.Popup object prototype that manages popups in the browser \*/ (function(){ @@ -13,38 +13,38 @@ Plugin that creates a $tw.utils.Popupper object prototype that manages popups in "use strict"; /* -Creates a Popupper object with these options: +Creates a Popup object with these options: wiki: the wiki to use for resolving tiddler titles rootElement: the DOM element to which the popup zapper should be attached */ -var Popupper = function(options) { +var Popup = function(options) { options = options || {}; this.wiki = options.wiki; this.rootElement = options.rootElement || document.body; this.popupTextRef = null; }; -Popupper.prototype.popup = function(stateTextRef) { +Popup.prototype.popup = function(stateTextRef) { var popupState; this.cancel(); this.popupTextRef = stateTextRef; this.rootElement.addEventListener("click",this,true); }; -Popupper.prototype.handleEvent = function(event) { +Popup.prototype.handleEvent = function(event) { if(event.type === "click") { this.rootElement.removeEventListener("click",this,true); this.cancel(); } }; -Popupper.prototype.cancel = function() { +Popup.prototype.cancel = function() { if(this.popupTextRef) { this.wiki.deleteTextReference(this.popupTextRef); this.popupTextRef = null; } }; -exports.Popupper = Popupper; +exports.Popup = Popup; })(); diff --git a/core/modules/startup.js b/core/modules/startup.js index 4854e8a74..edcc85178 100644 --- a/core/modules/startup.js +++ b/core/modules/startup.js @@ -56,8 +56,8 @@ exports.startup = function() { $tw.Commander.initCommands(); // Host-specific startup if($tw.browser) { - // Install the popupper - $tw.popupper = new $tw.utils.Popupper({ + // Install the popup manage + $tw.popup = new $tw.utils.Popup({ wiki: $tw.wiki, rootElement: document.body });