From 69e48ec05bafab2ec714e246cc7c152ddd4a0be6 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Wed, 13 Apr 2016 14:23:42 +0200 Subject: [PATCH] Fix smiley & fix Opera/Presto --- quickQuote.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/quickQuote.js b/quickQuote.js index aba33fe..babb4c4 100644 --- a/quickQuote.js +++ b/quickQuote.js @@ -263,16 +263,14 @@ function initializeQuickQuote() { * getSmileyCode() - returns smiley code */ function getSmileyCode(img) { - var re = '^' + location.protocol + '\/\/' + location.hostname + '.+' + '\/smileys\/\\w+\/(\\w+)\\.gif$'; - re = re.replace(/\//g, '\\/'); - re = new RegExp(re); - if (!img.src.match(re)) { - return ''; // Event not spawned by a forum smiley (else match smiley name below) - } - else { + if (img.alt && img.className && img.className === 'smiley') { // Alternative text corresponds to smiley code. return img.alt; } + else { + // Event not spawned by a forum smiley (else match smiley name below) + return ''; + } /* var smileyName = RegExp.$1; @@ -295,7 +293,7 @@ function initializeQuickQuote() { if (selection) { var selectionAncestor = selection.commonAncestorContainer; var selectionContents; - var postAncestor = selectionAncestor.selectSingleNode('ancestor-or-self::div[contains(@class,"post")]'); + var postAncestor = selectionAncestor.selectSingleNode('ancestor-or-self::div[contains(@class,"inner")]'); setHiddenFlag(selectionAncestor); if (selectionAncestor.nodeType != 3 && selectionAncestor.nodeType != 4) @@ -318,7 +316,6 @@ function initializeQuickQuote() { selectionContents = newSelectionContents; } } - var selectedText = trim(treeToBBCode(selectionContents)); //if( selectedText ){