These are chat archives for GetmeUK/ContentTools
<a href=""><div>content editor...</div></a>redirecting if its around content editor? if i click its redirect, but needs to show editing :D
lastModifiedagainst a region to determine if it's been modified since the last check, there's some example code for this here: https://github.com/GetmeUK/ContentTools/blob/master/src/scripts/editor.coffee#L523
domElementand apply your own events - though the click event would probably be a bad one to override as it's used for selecting an element in the tree, can you provide an example of what you're struggling with an I'll see what I can recommend
<a href="..." data-ignore-in-editor>...</a>
data-ignore-in-editorits defined in contentools?
Hopefully the above is some use - I didn't write it a colleague did but it should work
# Ye old switcher roo! # -- # Function for switching a tag with another tag whilst still retaining all # of the attributes and inner HTML. yeOldSwitcherRoo = (oldElement, newElementType='div') -> $(oldElement).each -> # Create the new element newElement = $('<' + newElementType + ' data-element-switched></' + newElementType + '>') # Loop through the attributes of the old element and apply them to # the new element. $.each @attributes, -> if @specified $(newElement).attr(@name, @value) # Insert the content of the old element into the new element, and # then remove the old one. $(newElement).html($(oldElement).html()) $(oldElement).after(newElement).remove() # Anchor tags with editable content # -- # When the content editor is initialised and the user starts editing content, # check to see if any links contain editable components. If they do, prevent # the default click behaviour. Re-enable it after editing is complete. editorCls = ContentTools.EditorApp.getCls() editor.start = () -> # Find all editable areas within links and loop through them editableContentWithinLinks = $('a *[data-editable]').closest('a') for oldElement in editableContentWithinLinks yeOldSwitcherRoo(oldElement) @_domRegions = document.querySelectorAll('*[data-editable]') editorCls.prototype.start.call(this) editor.stop = () -> editorCls.prototype.stop.call(this) # Find all editable areas within links and loop through them editableContentWithinLinks = $('*[data-element-switched]') for oldElement in editableContentWithinLinks yeOldSwitcherRoo(oldElement, 'a')