From 7f1d75cc025bee8ee0c0b37f392a5722431fe182 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Wed, 25 Nov 2015 21:30:06 +0100 Subject: [PATCH 1/6] Homepage is now link to userscript readme --- Github_Comment_Enhancer/Github_Comment_Enhancer.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index 7f36c08..bc0cf5b 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -6,8 +6,8 @@ // @author jerone // @copyright 2014+, jerone (http://jeroenvanwarmerdam.nl) // @license GNU GPLv3 -// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer -// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer +// @homepage https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer#readme +// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Comment_Enhancer#readme // @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js // @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js // @supportURL https://github.com/jerone/UserScripts/issues From 59997ef106decbbb1d07dd79fb7e5ab4c4d35915 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Wed, 25 Nov 2015 21:49:30 +0100 Subject: [PATCH 2/6] Reverted commit 9bf8974 to fix the toolbar on the wiki. Included fix for enabling and disabling buttons per language on wiki. Also fixes non-working italic button (fixes #83). --- .../Github_Comment_Enhancer.user.js | 133 ++++++++++-------- 1 file changed, 73 insertions(+), 60 deletions(-) diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index bc0cf5b..b3dfa28 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -38,7 +38,7 @@ // Source: https://github.com/gollum/gollum/blob/9c714e768748db4560bc017cacef4afa0c751a63/lib/gollum/public/gollum/javascript/editor/langs/markdown.js var MarkDown = (function MarkDown() { return { - "bold": { + "function-bold": { search: /^(\s*)([\s\S]*?)(\s*)$/g, replace: "$1**$2**$3", shortcut: "ctrl+b" @@ -48,55 +48,55 @@ replace: "$1_$2_$3", shortcut: "ctrl+i" }, - "underline": { + "function-underline": { search: /^(\s*)([\s\S]*?)(\s*)$/g, replace: "$1$2$3", shortcut: "ctrl+u" }, - "strikethrough": { + "function-strikethrough": { search: /^(\s*)([\s\S]*?)(\s*)$/g, replace: "$1~~$2~~$3", shortcut: "ctrl+s" }, - "h1": { + "function-h1": { search: /(.+)([\n]?)/g, replace: "# $1$2", forceNewline: true, shortcut: "ctrl+1" }, - "h2": { + "function-h2": { search: /(.+)([\n]?)/g, replace: "## $1$2", forceNewline: true, shortcut: "ctrl+2" }, - "h3": { + "function-h3": { search: /(.+)([\n]?)/g, replace: "### $1$2", forceNewline: true, shortcut: "ctrl+3" }, - "h4": { + "function-h4": { search: /(.+)([\n]?)/g, replace: "#### $1$2", forceNewline: true, shortcut: "ctrl+4" }, - "h5": { + "function-h5": { search: /(.+)([\n]?)/g, replace: "##### $1$2", forceNewline: true, shortcut: "ctrl+5" }, - "h6": { + "function-h6": { search: /(.+)([\n]?)/g, replace: "###### $1$2", forceNewline: true, shortcut: "ctrl+6" }, - "link": { + "function-link": { exec: function(button, selText, commentForm, next) { var selTxt = selText.trim(), isUrl = selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), @@ -108,7 +108,7 @@ }, shortcut: "ctrl+l" }, - "image": { + "function-image": { exec: function(button, selText, commentForm, next) { var selTxt = selText.trim(), isUrl = selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), @@ -121,13 +121,13 @@ shortcut: "ctrl+g" }, - "ul": { + "function-ul": { search: /(.+)([\n]?)/g, replace: String.format("{0} $1$2", listCharacter), forceNewline: true, shortcut: "alt+ctrl+u" }, - "ol": { + "function-ol": { exec: function(button, selText, commentForm, next) { var repText = ""; if (!selText) { @@ -145,39 +145,39 @@ }, shortcut: "alt+ctrl+o" }, - "checklist": { + "function-checklist": { search: /(.+)([\n]?)/g, replace: String.format("{0} [ ] $1$2", listCharacter), forceNewline: true, shortcut: "alt+ctrl+t" }, - "code": { + "function-code": { exec: function(button, selText, commentForm, next) { var rt = selText.indexOf("\n") > -1 ? "$1\n```\n$2\n```$3" : "$1`$2`$3"; next(selText.replace(/^(\s*)([\s\S]*?)(\s*)$/g, rt)); }, shortcut: "ctrl+k" }, - "code-syntax": { + "function-code-syntax": { exec: function(button, selText, commentForm, next) { var rt = "$1\n```" + button.dataset.value + "\n$2\n```$3"; next(selText.replace(/^(\s*)([\s\S]*?)(\s*)$/g, rt)); } }, - "blockquote": { + "function-blockquote": { search: /(.+)([\n]?)/g, replace: "> $1$2", forceNewline: true, shortcut: "ctrl+q" }, - "rule": { + "function-rule": { append: String.format("\n{0}\n", lineCharacter), forceNewline: true, shortcut: "ctrl+r" }, - "table": { + "function-table": { append: "\n" + "| Head | Head | Head |\n" + "| :--- | :----: | ----: |\n" + @@ -187,7 +187,7 @@ shortcut: "alt+shift+t" }, - "clear": { + "function-clear": { exec: function(button, selText, commentForm, next) { commentForm.value = ""; next(""); @@ -195,23 +195,23 @@ shortcut: "alt+ctrl+x" }, - "snippets-tab": { + "function-snippets-tab": { exec: function(button, selText, commentForm, next) { next("\t"); } }, - "snippets-useragent": { + "function-snippets-useragent": { exec: function(button, selText, commentForm, next) { next("`" + navigator.userAgent + "`"); } }, - "snippets-contributing": { + "function-snippets-contributing": { exec: function(button, selText, commentForm, next) { next("Please, always consider reviewing the [guidelines for contributing](../blob/master/CONTRIBUTING.md) to this repository."); } }, - "emoji": { + "function-emoji": { exec: function(button, selText, commentForm, next) { next(button.dataset.value); } @@ -221,26 +221,29 @@ var editorHTML = (function editorHTML() { return '
' + + + /* Bold, italic, underline & Strikethrough; */ ' ' + + /* Headers (1 - 6); */ '
' + '
' + - ' ' + - ' h#' + - ' ' + + ' ' + + ' h#' + + ' ' + '
' + '
' + '
' + @@ -248,22 +251,22 @@ ' ' + '
' + ' ' + @@ -272,29 +275,33 @@ '
' + '
' + + /* Link & image; */ ' ' + + + /* Lists (unordered, ordered & task); */ ' ' + + /* Code (syntax); */ '
' + '
' + - ' ' + + ' ' + ' ' + ' ' + '
' + @@ -313,27 +320,29 @@ '
' + '
' + '
' + - ' ' + + ' ' + '
' + '
' + + /* Blockquote, horizontal rule & table; */ ' ' + + /* Snippets; */ '
' + '
' + - ' ' + + ' ' + ' ' + - ' ' + + ' ' + '
' + '
' + '
' + @@ -347,13 +356,13 @@ '
' + ' ' + + /* Emoji; */ '
' + '
' + - ' ' + + ' ' + ' ' + - ' ' + + ' ' + '
' + '
' + '
' + @@ -393,8 +403,9 @@ '
' + + /* Clear; */ ''; @@ -506,9 +517,11 @@ } var buttonEvent = function(e) { - e.preventDefault(); - executeAction(MarkDown[this.dataset.function], this.commentForm, this); - return false; + if (!this.classList.contains("function-dummy")) { + e.preventDefault(); + executeAction(MarkDown[this.id], this.commentForm, this); + return false; + } }; var codeSyntaxTop = ["JavaScript", "Java", "Ruby", "PHP", "Python", "CSS", "C++", "C#", "C", "HTML"]; // https://github.com/blog/2047-language-trends-on-github @@ -613,7 +626,7 @@ syntaxSuggestion.setAttribute("href", "#"); syntaxSuggestion.classList.add("function-button", "select-menu-item", "js-navigation-item"); syntaxSuggestion.dataset.value = syntax; - syntaxSuggestion.dataset.function = "code-syntax"; + syntaxSuggestion.id = "function-code-syntax"; syntaxSuggestions.appendChild(syntaxSuggestion); var syntaxSuggestionText = document.createElement("span"); @@ -666,7 +679,7 @@ var buttons = suggester.querySelectorAll(".function-button"); Array.prototype.forEach.call(buttons, function(button) { button.commentForm = commentForm; - button.dataset.function = "emoji"; + button.id = "function-emoji"; button.addEventListener("click", buttonEvent, false); unsafeWindow.$(button).on("navigation:keydown", function(e) { if (e.hotkey === "enter") { From 3d587b6fc169f96ed534efc4db9108943e4000ba Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Wed, 25 Nov 2015 23:45:36 +0100 Subject: [PATCH 3/6] Added clear button back to wiki. Moved help button to the right. --- .../Github_Comment_Enhancer.user.js | 412 +++++++++--------- 1 file changed, 209 insertions(+), 203 deletions(-) diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index b3dfa28..9a050e0 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -219,197 +219,198 @@ }; })(); - var editorHTML = (function editorHTML() { - return '
' + - - /* Bold, italic, underline & Strikethrough; */ - ' ' + - - /* Headers (1 - 6); */ - '
' + - '
' + - ' ' + - ' h#' + - ' ' + - '
' + - '
' + - '
' + - ' Choose header' + - ' ' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
' + - - /* Link & image; */ - '
' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
' + - - /* Lists (unordered, ordered & task); */ - '
' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
' + - - /* Code (syntax); */ - '
' + - '
' + - ' ' + - ' ' + - ' ' + - '
' + - '
' + - '
' + - ' Code syntax' + - ' ' + - '
' + - '
' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
Nothing to show
' + - '
' + - '
' + - '
' + - ' ' + - '
' + - '
' + - - /* Blockquote, horizontal rule & table; */ - '
' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
' + - - /* Snippets; */ - '
' + - '
' + - ' ' + - ' ' + - ' ' + - '
' + - '
' + - '
' + - ' Snippets' + - ' ' + - '
' + - '
' + - '
' + - ' ' + - '
' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
' + - - /* Emoji; */ - '
' + - '
' + - ' ' + - ' ' + - ' ' + - '
' + - '
' + - '
' + - ' Emoji' + - ' ' + - '
' + - '
' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
Nothing to show
' + - '
' + - '
' + - '
' + - '
' + - '
' + - - '
' + - - /* Clear; */ - '
' + - ' ' + - ' ' + - ' ' + - '
'; - })(); + var toolBarLeftHTML = + '
' + + + /* Bold, italic, underline & Strikethrough; */ + ' ' + + + /* Headers (1 - 6); */ + '
' + + '
' + + ' ' + + ' h#' + + ' ' + + '
' + + '
' + + '
' + + ' Choose header' + + ' ' + + '
' + + ' ' + + '
' + + '
' + + '
' + + '
' + + + /* Link & image; */ + '
' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
' + + + /* Lists (unordered, ordered & task); */ + '
' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
' + + + /* Code (syntax); */ + '
' + + '
' + + ' ' + + ' ' + + ' ' + + '
' + + '
' + + '
' + + ' Code syntax' + + ' ' + + '
' + + '
' + + '
' + + ' ' + + '
' + + '
' + + '
' + + '
Nothing to show
' + + '
' + + '
' + + '
' + + ' ' + + '
' + + '
' + + + /* Blockquote, horizontal rule & table; */ + '
' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
' + + + /* Snippets; */ + '
' + + '
' + + ' ' + + ' ' + + ' ' + + '
' + + '
' + + '
' + + ' Snippets' + + ' ' + + '
' + + '
' + + '
' + + ' ' + + '
' + + '
' + + ' ' + + '
' + + '
' + + '
' + + '
' + + + /* Emoji; */ + '
' + + '
' + + ' ' + + ' ' + + ' ' + + '
' + + '
' + + '
' + + ' Emoji' + + ' ' + + '
' + + '
' + + '
' + + ' ' + + '
' + + '
' + + '
' + + '
Nothing to show
' + + '
' + + '
' + + '
' + + '
' + + '
' + + + '
'; + var toolBarRightHTML = + /* Clear; */ + '
' + + '
' + + ' ' + + ' ' + + ' ' + + '
' + + '
'; // Source: https://github.com/gollum/gollum/blob/9c714e768748db4560bc017cacef4afa0c751a63/lib/gollum/public/gollum/javascript/editor/gollum.editor.js#L516 function executeAction(definitionObject, commentForm, button) { @@ -744,20 +745,25 @@ if (isWiki()) { gollumEditor = document.getElementById("gollum-editor-function-bar"); - var temp = document.createElement("div"); - temp.innerHTML = editorHTML; - temp.firstElementChild.appendChild(document.getElementById("function-help")); // restore the help button; - gollumEditor.replaceChild(temp.querySelector("#gollum-editor-function-buttons"), document.getElementById("gollum-editor-function-buttons")); - Array.prototype.forEach.call(temp.children, function(elm) { - elm.style.position = "absolute"; - elm.style.right = "30px"; - elm.style.top = "0"; - commentForm.parentNode.insertBefore(elm, commentForm); - }); - temp = null; + + var helpButton = document.createElement("div"); + helpButton.classList.add("button-group", "btn-group"); + helpButton.appendChild(document.getElementById("function-help")); + + var tempLeft = document.createElement("div"); + tempLeft.innerHTML = toolBarLeftHTML; + gollumEditor.replaceChild(tempLeft.querySelector("#gollum-editor-function-buttons"), document.getElementById("gollum-editor-function-buttons")); + + var tempRight = document.createElement("div"); + tempRight.innerHTML = toolBarRightHTML; + tempRight.firstElementChild.appendChild(document.createTextNode(" ")); // extra space; + tempRight.firstElementChild.appendChild(helpButton); // restore the help button; + gollumEditor.appendChild(tempRight); + + tempLeft = tempRight = null; } else { gollumEditor = document.createElement("div"); - gollumEditor.innerHTML = editorHTML; + gollumEditor.innerHTML = toolBarLeftHTML + toolBarRightHTML; gollumEditor.id = "gollum-editor-function-bar"; gollumEditor.style.height = "26px"; gollumEditor.style.margin = "10px 0"; From 45b62a8fa1b9cac00a95a376a29efdd8c7e2ce93 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Wed, 25 Nov 2015 23:51:49 +0100 Subject: [PATCH 4/6] Only execute action when button is not disabled. --- Github_Comment_Enhancer/Github_Comment_Enhancer.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index 9a050e0..4f4e8df 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -518,7 +518,7 @@ } var buttonEvent = function(e) { - if (!this.classList.contains("function-dummy")) { + if (!this.classList.contains("disabled") && !this.classList.contains("function-dummy")) { e.preventDefault(); executeAction(MarkDown[this.id], this.commentForm, this); return false; From 0a4621aea79f4da8462b5c30c5a1ff79b763dba5 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Thu, 26 Nov 2015 22:39:12 +0100 Subject: [PATCH 5/6] :sparkles: Added dialog when inserting link or image; --- .../Github_Comment_Enhancer.user.js | 190 +++++++++++++++++- 1 file changed, 180 insertions(+), 10 deletions(-) diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index 4f4e8df..1a0c784 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -100,11 +100,29 @@ exec: function(button, selText, commentForm, next) { var selTxt = selText.trim(), isUrl = selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), - href = window.prompt("Link href:", isUrl ? selTxt : ""), - text = window.prompt("Link text:", isUrl ? "" : selTxt); - if (href) { - next(String.format("[{0}]({1}){2}", text || href, href, (/\s+$/.test(selText) ? " " : ""))); - } + text = isUrl ? "" : selTxt, + href = isUrl ? selTxt : ""; + unsafeWindow.$.GollumDialog.init({ + title: "Insert Link", + fields: [{ + id: "text", + name: "Link Text", + type: "text", + value: text + }, { + id: "href", + name: "URL", + type: "text", + value: href + }], + OK: function(t) { + if (t.href) { + next(String.format("[{0}]({1}){2}", + t.text || t.href, + t.href, (/\s+$/.test(selText) ? " " : ""))); + } + } + }); }, shortcut: "ctrl+l" }, @@ -112,11 +130,29 @@ exec: function(button, selText, commentForm, next) { var selTxt = selText.trim(), isUrl = selTxt && /(?:https?:\/\/)|(?:www\.)/.test(selTxt), - href = window.prompt("Image href:", isUrl ? selTxt : ""), - text = window.prompt("Image text:", isUrl ? "" : selTxt); - if (href) { - next(String.format("![{0}]({1}){2}", text || href, href, (/\s+$/.test(selText) ? " " : ""))); - } + url = isUrl ? selTxt : "", + alt = isUrl ? "" : selTxt; + unsafeWindow.$.GollumDialog.init({ + title: "Insert Image", + fields: [{ + id: "url", + name: "Image URL", + type: "text", + value: url + }, { + id: "alt", + name: "Alt Text", + type: "text", + value: alt + }], + OK: function(t) { + if (t.url) { + next(String.format("![{0}]({1}){2}", + t.alt || t.url, + t.url, (/\s+$/.test(selText) ? " " : ""))); + } + } + }); }, shortcut: "ctrl+g" }, @@ -806,6 +842,139 @@ }); } + function overrideGollumDialog() { + if (unsafeWindow.$.GollumDialog === undefined) { + (function(e) { + var t = { + markupCreated: !1, + markup: "", + attachEvents: function(o) { + e("#gollum-dialog-action-ok").click(function(e) { + t.eventOK(e, o) + }), + e("#gollum-dialog-action-cancel").click(t.eventCancel), + e('#gollum-dialog-dialog input[type="text"]').keydown(function(e) { + 13 == e.keyCode && t.eventOK(e, o) + }) + }, + detachEvents: function() { + e("#gollum-dialog-action-ok").unbind("click"), + e("#gollum-dialog-action-cancel").unbind("click") + }, + createFieldMarkup: function(e) { + for (var o = "
", n = 0; n < e.length; n++) + if ("object" == typeof e[n]) { + switch (o += '
', + e[n].type) { + case "text": + o += t.createFieldText(e[n]) + } + o += "
" + } + return o += "
" + }, + createFieldText: function(e) { + var t = ""; + return e.name && (t += ""), + t += ''), + t + }, + createMarkup: function(o, n) { + return t.markupCreated = !0, + e.facebox ? '

' + o + '

' + n + '
' : '

' + o + '

' + n + '
' + }, + eventCancel: function(e) { + e.preventDefault(), + t.hide() + }, + eventOK: function(o, n) { + o.preventDefault(); + var a = []; + e("#gollum-dialog-dialog-body input").each(function() { + a[e(this).attr("name")] = e(this).val() + }), + n && "function" == typeof n && n(a), + t.hide() + }, + hide: function() { + e.facebox ? (t.markupCreated = !1, + e(document).trigger("close.facebox"), + t.detachEvents()) : e.browser.msie ? (e("#gollum-dialog-dialog").hide().removeClass("active"), + e("select").css("visibility", "visible")) : e("#gollum-dialog-dialog").animate({ + opacity: 0 + }, { + duration: 200, + complete: function() { + e("#gollum-dialog-dialog").removeClass("active") + } + }) + }, + init: function(o) { + var n = "", + a = ""; + o && "object" == typeof o && (o.body && "string" == typeof o.body && (a = "

" + o.body + "

"), + o.fields && "object" == typeof o.fields && (a += t.createFieldMarkup(o.fields)), + o.title && "string" == typeof o.title && (n = o.title), + t.markupCreated && (e.facebox ? e(document).trigger("close.facebox") : e("#gollum-dialog-dialog").remove()), + t.markup = t.createMarkup(n, a), + e.facebox ? e(document).bind("reveal.facebox", function() { + o.OK && "function" == typeof o.OK && (t.attachEvents(o.OK), + e(e('#facebox input[type="text"]').get(0)).focus()) + }) : (e("body").append(t.markup), + o.OK && "function" == typeof o.OK && t.attachEvents(o.OK)), + t.show()) + }, + show: function() { + t.markupCreated && (e.facebox ? e.facebox(t.markup) : e.browser.msie ? (e("#gollum-dialog.dialog").addClass("active"), + t.position(), + e("select").css("visibility", "hidden")) : (e("#gollum-dialog.dialog").css("display", "none"), + e("#gollum-dialog-dialog").animate({ + opacity: 0 + }, { + duration: 0, + complete: function() { + e("#gollum-dialog-dialog").css("display", "block"), + t.position(), + e("#gollum-dialog-dialog").animate({ + opacity: 1 + }, { + duration: 500 + }) + } + }))) + }, + position: function() { + var t = e("#gollum-dialog-dialog-inner").height(); + e("#gollum-dialog-dialog-inner").css("height", t + "px").css("margin-top", -1 * parseInt(t / 2)) + } + }; + e.facebox && e(document).bind("reveal.facebox", function() { + e("#facebox img.close_image").remove() + }), + e.GollumDialog = t + })(unsafeWindow.$) + } else { + unsafeWindow.$.GollumEditor.Dialog.createFieldText = unsafeWindow.$.GollumDialog.createFieldText = function(e) { + var t = ""; + return e.name && (t += ""), + t += ''), + t + }; + } + } + /* * to-markdown - an HTML to Markdown converter * Copyright 2011, Dom Christie @@ -1072,6 +1241,7 @@ addToolbar(); addReplyButtons(); } + overrideGollumDialog(); init(); // on pjax; From 15ce1a1ff4cc9bea52eec1d6cf790132f21b7528 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Sun, 29 Nov 2015 12:48:07 +0100 Subject: [PATCH 6/6] :clapper: Released new version of Github Comment Enhancer; --- .../Github_Comment_Enhancer.user.js | 2 +- Github_Comment_Enhancer/README.md | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js index 1a0c784..00d65a0 100644 --- a/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js +++ b/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js @@ -12,7 +12,7 @@ // @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Comment_Enhancer/Github_Comment_Enhancer.user.js // @supportURL https://github.com/jerone/UserScripts/issues // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 2.7.0 +// @version 2.8.0 // @grant none // @run-at document-end // @include https://github.com/* diff --git a/Github_Comment_Enhancer/README.md b/Github_Comment_Enhancer/README.md index 8467eb3..3955592 100644 --- a/Github_Comment_Enhancer/README.md +++ b/Github_Comment_Enhancer/README.md @@ -39,7 +39,7 @@ Every comment field also got a toolbar, consisting of the following buttons: * UserAgent * Contributing message * Emoji -* Clear comment field content (alt+ctrl+x) +* Clear content (alt+ctrl+x) ## Screenshot @@ -60,6 +60,15 @@ Every comment field also got a toolbar, consisting of the following buttons: ## Version History +* **2.8.0** + * Reverted commit 9bf8974 to fix the toolbar on the wiki. + * Included fix for enabling and disabling buttons per language on wiki. + * Also fixes non-working italic button (fixes #83). + * Added clear button back to wiki. + * Moved help button to the right. + * Only execute action when button is not disabled. + * :sparkles: Added dialog when inserting link or image. + * Homepage is now link to userscript readme. * **2.7.0** * Fixed Github's name completion (fixes https://github.com/jerone/UserScripts/issues/81); * Restored using enter key on dropdown menus.