profile
viewpoint

hannonhill/ts-lambda-handler 0

Typescript library for writing AWS Lambda functions.

nadirayasmeen/Asset-Factory-Plugins 0

Custom Asset Factory plugins for Cascade Server.

nadirayasmeen/node-rhyme 0

A rhyming dictionary for node.js

nadirayasmeen/Universal-Migration-Tool 0

CMS-agnostic tool to migrate static web content into a Cascade Server instance

delete branch hannonhill/tinymce

delete branch : fix-applicable-formats-for-wysiwyg-links-imgs

delete time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha f4cb99ca86624fa3c24125f2038cd5c9dbb6e336

Check if the format applies to the current selection before adding it to class list in image/link plugins #3915

view details

Nadira Yasmeen

commit sha 5cb7dc54282d8af8ec3c110239be22b4b2e7d1a6

Removes commented out code #3915

view details

Nadira Yasmeen

commit sha 58c04181dc57eec51f0021cb8dd5ce06061778b4

Only include classes dropdown that are also in the image or link class list #3915

view details

Nadira Yasmeen

commit sha 7da0459f24eb3915397cf31cefea0f5ee52f64d7

temp: Updates logic for populating class dropdown #3915

view details

Nadira Yasmeen

commit sha 7163fc59e496e6c6b9b64ce2b78a62347977cdb8

temp: Rework logic to return custom formats instead of classes of those formats #3915

view details

Ryan Griffith

commit sha f07d429c351f15cb7ded3c54d05151aa797d9702

Allow multiple applicable styles to be selected within image and link plugin dialogs hannonhill/Cascade#3915

view details

Nadira Yasmeen

commit sha 631d8c419d2eaee19de32550556e48b948638362

Adds option groups, convert simple classes to use multi-select, logic for applying styles-only formats #3915 Adds option groups when an advanced format contains both custom formats & existing classes Custom formats that do not include classes only in-line styles weren't getting styles applied to the elements Simple class format now use multi-select instead of dropdown

view details

Ryan Griffith

commit sha 3c044b2a7a0274921d1641660e1f2d8710a9fa23

Ensure class select options have a value #3915

view details

Ryan Griffith

commit sha ce47b933099fe835a31b3d8402a1cb329596d6e3

General code cleanup and reuse #3915

view details

Ryan Griffith

commit sha 8377e28bd643a0dd7e35d497cedcc6f868c2ba72

Add missing type to list items hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha bb5934b47452be230d131b7f5b9d2a01fb283cb6

Refactor merging of selected formats and classes hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha 4263fab90da8eb2bc9ce27fb3f23e8449445a41b

Pass style attribute into link hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha 9ef88c0a40ba078ec84ae0c2bb4da201f39a5149

Always output opt groups hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha edd7f3ae2d625980b03312ab4af8f8a1fd2cb9d8

Sort options when building optgroups hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha 78af7623e7e26640b3fe6a22d344c36ca001f45b

Reworking logic and generation of format and class list items. hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha 14e680f294d1c530845f9f2d9bca83c8c679b236

Pass editor settings not editor when getting link class list setting. hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha 270813b06a9044291537d11c8fac5a72b9bf2cfb

Update handling of existing styles and styles applied through formats hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha 376ac0a3b3340ed58c17cacd2ebdfc72734c53e6

Inline styles applied via a Format take priority over manually added styles Prevents issue where a customized inline style would prevent the Format from being selected on subsequent dialog loading, since the style no longer matches the Format. hannonhill/Cascade#3915

view details

Ryan Griffith

commit sha a89c3b9d62262314796ddeef72dcb863e44b53c0

Fix misspelled method name hannonhill/Cascade#3915

view details

Nadira Yasmeen

commit sha cfb82465a77e2f37b5c019fa84c6632cbf0a3246

Trims existing classes before splitting them hannonhill/Cascade#3915

view details

push time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 50b5a1454dc7fda8a7dbf6adc7d38510a144a4c6

Update format/class label to "Styling" hannonhill/Cascade#3915

view details

push time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 4c887b6ac1a2c108139f8b7d4be4627618355244

Fixes issue where css class option group gets labeled as 'Custom Formats' hannonhill/Cascade#3915

view details

Nadira Yasmeen

commit sha 1487a1c9ea2614e3234d190c05eff4c50d5e2ca9

Fixes issue where new elements didn't load simple classes in dialogs hannonhill/Cascade#3915

view details

push time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha e709e613f78ab49ab237d7eddf5cf800bf7f386f

Update Format control label, add help text for selecting multiple formats hannonhill/Cascade#3915

view details

push time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 1fdd7a7d011af92f045666ab456411c663bcd0f8

Adds additional checks so image/link dialogs aren't broken in non-editor configuration WYSIWYGs hannonhill/Cascade#3915

view details

push time in 2 months

pull request commenthannonhill/tinymce

feat: Show applicable formats/classes in image/link WYSIWYG dialog

Code restructuring looks good. Good call moving Inline styles logic to its own util 👍

nadirayasmeen

comment created time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha cfb82465a77e2f37b5c019fa84c6632cbf0a3246

Trims existing classes before splitting them hannonhill/Cascade#3915

view details

push time in 2 months

Pull request review commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

 define(         return uniqueImageClasses;       }; +      var getFormatInlineStyles = function (selectedCustomFormatNames, customStyleFormats) {

I originally added logic for merging inline styles with any existing inline styles but ran into a lot of issues getting it working properly & the logic was getting more complex & time-consuming on top of what was already added.

Mainly, it was hard to determine if an inline style was existing previously because for some styles, i.e. something like border: 1px solid green would automatically get converted into a separate style, 'border-width: 1px'; when the dialog was submitted; so simply comparing to the format "combined" version wouldn't work. Wondering if there's a more convenient way to do this, or possibly tabling it for now & considering in post issue (hopefully, there isn't a heavy reliance on inline styling).

nadirayasmeen

comment created time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 631d8c419d2eaee19de32550556e48b948638362

Adds option groups, convert simple classes to use multi-select, logic for applying styles-only formats #3915 Adds option groups when an advanced format contains both custom formats & existing classes Custom formats that do not include classes only in-line styles weren't getting styles applied to the elements Simple class format now use multi-select instead of dropdown

view details

push time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 7163fc59e496e6c6b9b64ce2b78a62347977cdb8

temp: Rework logic to return custom formats instead of classes of those formats #3915

view details

push time in 2 months

pull request commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

Was able to get the class populating correctly for existing links/images using dom.is: https://www.tiny.cloud/docs/api/tinymce.dom/tinymce.dom.domutils/#is

formatter.matchNode was always return false for new/existing elements, but I think I was misunderstanding how it works. If it only returns true once the format has been applied to the element, then that makes sense, since the format hasn't been applied yet. So either dom.is(), formatter.canApply() seems to work in this case.

However, still having some trouble getting the class dropdown populating correctly when inserting a new image/link though; not really sure how to proceed or if I'm possibly missing something available in the TinyMCE API that would help?

nadirayasmeen

comment created time in 2 months

Pull request review commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

 define(   ],     function (Tools) {       var getImageClassesForDropdown = function (editor, defaultClassList) {-        return getClassesForDropdown(editor, defaultClassList, "image");+        return getClassesForDropdown(editor, defaultClassList, "img");       };       var getLinkClassesForDropdown = function (editor, defaultClassList) {-        return getClassesForDropdown(editor, defaultClassList, "link");+        return getClassesForDropdown(editor, defaultClassList, "a");       };       var getClassesForDropdown = function (editor, defaultClassList, element) {         var editorSettings = editor.settings;-        var classList = [];+        var selectedNode = editor.selection.getNode();+        var nodeName = selectedNode.nodeName;++        if (nodeName.toLowerCase() !== element) {+          var elementNode = editor.dom.create(element, {});+         // editor.selection.setNode(elementNode); //adds node to DOM+         // selectedNode.append(elementNode); // definitely adds node+         // var selectedNewNode = editor.selection.select(elementNode); //selecting without inserting/appending causes error+         // selectedNode = editor.selection.getNode();+          selectedNode = elementNode; //doesn't seem to work against editor.dom.is for some reason, maybe because it's not an actual node?+        } +        var classList = [];         var formatMenuItems = editorSettings.style_formats;-        Tools.each(formatMenuItems, function (formatMenuItem) {-          if (formatMenuItem.title === "Custom") {-            Tools.each(formatMenuItem.items, function (format) {-              var formatName = format.name;-              if (editor.formatter.canApply(formatName) && format.classes) {-                Tools.each(format.classes, function (formatClass) {-                  if (isInElementClassList(formatClass, element, editorSettings)) {-                    classList.push(formatClass);-                  }-                });-              }+        var customMenu = formatMenuItems.filter(function (format) {+          return format.title === "Custom";+        });++        if (customMenu[0] === null) {+          return defaultClassList;+        }++        Tools.each(customMenu[0].items, function (format) {+          if ((editor.dom.is(selectedNode, format.selector) || matchesSelectorForNewElement(element, editor.selection.getNode(), format.selector, editor)) && format.classes) {+            Tools.each(format.classes, function (formatClass) {+              classList.push(formatClass);             });           }         });          return hasAdvancedFormatMenu(editor) ? classList : defaultClassList;       }; +      // Attempts to checks the selector up until the element since it hasn't been inserted into the editor yet+      var matchesSelectorForNewElement = function (element, selectedNode, selector, editor) {

I moved the logic added in the earlier wysiwyg.js commits to the plugin side & updated it to so dom.is could semi-work against the selector to help determine if a format would apply to the new element. However, it's definitely imperfect & for more complex selectors, those classes will not get added to the dropdown.

nadirayasmeen

comment created time in 2 months

Pull request review commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

 define(   ],     function (Tools) {       var getImageClassesForDropdown = function (editor, defaultClassList) {-        return getClassesForDropdown(editor, defaultClassList, "image");+        return getClassesForDropdown(editor, defaultClassList, "img");       };       var getLinkClassesForDropdown = function (editor, defaultClassList) {-        return getClassesForDropdown(editor, defaultClassList, "link");+        return getClassesForDropdown(editor, defaultClassList, "a");       };       var getClassesForDropdown = function (editor, defaultClassList, element) {         var editorSettings = editor.settings;-        var classList = [];+        var selectedNode = editor.selection.getNode();+        var nodeName = selectedNode.nodeName;++        if (nodeName.toLowerCase() !== element) {+          var elementNode = editor.dom.create(element, {});+         // editor.selection.setNode(elementNode); //adds node to DOM

Create didn't insert a node into the editor, but also wouldn't work as a Node parameter to dom.is() unless it's either appended to the current selection, or attempted to set the node in the selection object: selection.setNode(newNode) but those options insert the element (which we're trying to avoid)

nadirayasmeen

comment created time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 7da0459f24eb3915397cf31cefea0f5ee52f64d7

temp: Updates logic for populating class dropdown #3915

view details

push time in 2 months

Pull request review commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

+/**+ * Utils.js+ *+ */+define(+  'tinymce.plugins.cascade.core.Utils',

This Utils plugin doesn't get compiled and resulting files copied over to Cascade like for image & link & seems to work. I'm assuming that this plugin, like the regular Settings and Utils in the image plugin, just get compiled in the image & link plugins.

nadirayasmeen

comment created time in 2 months

Pull request review commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

+/**+ * Utils.js+ *+ */+define(+  'tinymce.plugins.cascade.core.Utils',

Bolt configuration is pretty particular about the file hierarchy format...

nadirayasmeen

comment created time in 2 months

Pull request review commenthannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

 define(         };       } -      if (Settings.hasLinkClassList(editor.settings)) {+      if (editor.settings.style_formats) {+        var classList;++        classList = CascadeUtils.getClassesForDropdown(editor, editor.settings.link_class_list);++        if (classList) {+          // Add a 'None' option to the beginning if it is not already present.+          if (typeof classList[0] !== 'object') {

I kept trying to extract this out by using CascadeUtils.appendOptionsToDropDown(classList, data); (same as in the image plugin), but grunt kept throwing syntax errors for some reason when I tried to compile the change. I gave up temporarily to keep the issue moving 😞

nadirayasmeen

comment created time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 58c04181dc57eec51f0021cb8dd5ce06061778b4

Only include classes dropdown that are also in the image or link class list #3915

view details

push time in 2 months

push eventhannonhill/tinymce

Nadira Yasmeen

commit sha 5cb7dc54282d8af8ec3c110239be22b4b2e7d1a6

Removes commented out code #3915

view details

push time in 2 months

PR opened hannonhill/tinymce

fix: Check if the format applies to the current selection before adding it…

… to class list in image/link plugins #3915

+97 -22

0 comment

3 changed files

pr created time in 2 months

create barnchhannonhill/tinymce

branch : fix-applicable-formats-for-wysiwyg-links-imgs

created branch time in 2 months

more