frenzie / elk-quick-quote Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
In the 2.0 branch https://github.com/Spuds/elk-quick-quote/blob/20/quickQuote.js an item I added that could be pulled back into 1.1.9 (when released) is adding the quick quote button to the topic summary listing below the post area.
In 1.1.8 (and 2.0) the markup is lacking to make this easy, but there is no reason for it to be like that. I've added the necessary markup to 2.0 and 1.1.9 so the JS can grab the author and time for the quote.
Just a suggestion
See Spuds@bc34357
A couple of minor things .. left
and right
are unique BBC codes not part of align=
as such those props objects need to be updated.
In seeing that, center is also a div
class not a span
align. Yes this is not HTML correct, center is not a block element, but as far as the user is concerned when using the editor, center is a block element and that is how ElkArte deals with it. Check the years of defending the way center worked vs left/right.
TLDR, we need to check for the centertext
class in the div
section and not the span
section
Updated the checkCSSProps
function to able to check for a class name by setting isClass
value of the passed object. This allowed the consolication of centertext and tt items.
The above should be clear in the code and is 1.1 valid, hence the issue.
Lines 4 to 20 in 5ebda25
Two things I noted while working on a 2.0 version. The first defined function I could not find any usage.
The second function, selectSingleNode
is only used twice and does not appear to be doing what was expected.
For example it is called as node.selectSingleNode('ancestor::pre'))
where node is a node inside of a specific post. However node is used as a backup in document.evaluate(xpath, this.ownerDocument || this, resolver || null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
this will resolve as document.evaluate(xpath, this.ownerDocument, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
where this.ownerDocument
is likely the entire document and not the real area of interest.
You could reverse the logic as this || this.ownerDocument
but I chose to drop the entire wrapper and just make the native call in the two places used.
Line 365 in 5ebda25
At least in 2.0 this is a section with a class of messageContext, so you may want to check that in 1.1 as well
In the 2.0 that I'm working on this is now
postAncestor = document.evaluate('ancestor-or-self::section[contains(@class,"messageContent")]', selectionAncestor, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
since I also removed the wrapper function
Line 426 in 5ebda25
You should be able to safely use postarea = quotebutton.closest('.postarea'),
now
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.