From bf1707b31f7ffa77f3c27acffb032f522f10802f Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 19 Sep 2015 23:33:05 -0500 Subject: [PATCH] Visual Editor fix (part one). --- src/tfd.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tfd.js b/src/tfd.js index f6eb4de..8a586bf 100644 --- a/src/tfd.js +++ b/src/tfd.js @@ -84,14 +84,19 @@ TFD.prototype._error = function(msg, extra) { this._block_submit("error"); }; +TFD.prototype._get_section_edit_tag = function() { + return this.head + .find(".mw-editsection a:not(.mw-editsection-visualeditor)").first(); +}; + TFD.prototype._get_discussion_page = function() { - var url = this.head.find(".mw-editsection a").first().prop("href"); + var url = this._get_section_edit_tag().prop("href"); var match = url.match(/title=(.*?)(\&|$)/); return match ? match[1] : null; }; TFD.prototype._get_section_number = function() { - var url = this.head.find(".mw-editsection a").first().prop("href"); + var url = this._get_section_edit_tag().prop("href"); var match = url.match(/section=(.*?)(\&|$)/); return match ? match[1] : null; };