• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.9.13
    • 2.9.10
    • Inline Editor
    • None

      Link title attribute have some problem.
      When a link is edited the first time all is ok, but in the next link that will be edited, the title attribute is already filled with the value of the last edited link.

          [CMS-600] Problem in link edition

          Solution found for FF : use editor._getSelection().focusNode.parentNode to retrieve the link and set the title.

          Pierre-Henri Sassard (Inactive) added a comment - Solution found for FF : use editor._getSelection().focusNode.parentNode to retrieve the link and set the title.

          Index: plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js
          ===================================================================
          RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js,v
          retrieving revision 1.17
          diff -u -r1.17 htmleditorbutton-access.js
          — plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 27 Nov 2008 17:55:10 -0000 1.17
          +++ plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 8 Dec 2008 09:35:03 -0000
          @@ -2140,13 +2140,18 @@
          break;
          }
          }

          • var title = link.getAttribute("title");
            +
            + var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document;
            +
            + var title = HTMLArea.is_ie ? String(link.getAttribute("title")) : link.getAttribute("title");
            if (title != null) { - var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + _document.getElementById("link_title").value = title; }

            + else

            { + _document.getElementById("link_title").value = ""; + }

            }

          ANWRT_Access_Link.box.showModal();
          @@ -2186,6 +2191,8 @@

          var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document;

          + _document.getElementById("link_title").value = "";
          +
          if (editor.config.linkType.length == 0)
          {
          alert("<i18n:text i18n:key="PLUGINS_ANYCONTENT_HTMLEDITORBUTTON_LINK_DIALOG_ERROR_NOLINK" i18n:catalogue="plugin.anycontent"/>");
          @@ -2353,7 +2360,19 @@
          {
          link = link.parentElement;
          if (link && !/^a$/i.test(link.tagName))

          • link = null;
            + { + link = null; + }

            +
            + //Dans certain cas sous Firefox on n'accède tjrs pas au lien
            + if ( link == null )

            { + + link = editor._getSelection().anchorNode.parentNode; + + if (link && !/^a$/i.test(link.tagName)) + link = null; + }

            +
            }
            if (link != null)
            {

          Julien Cimetiere (Inactive) added a comment - Index: plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js =================================================================== RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js,v retrieving revision 1.17 diff -u -r1.17 htmleditorbutton-access.js — plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 27 Nov 2008 17:55:10 -0000 1.17 +++ plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 8 Dec 2008 09:35:03 -0000 @@ -2140,13 +2140,18 @@ break; } } var title = link.getAttribute("title"); + + var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + + var title = HTMLArea.is_ie ? String(link.getAttribute("title")) : link.getAttribute("title"); if (title != null) { - var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + _document.getElementById("link_title").value = title; } + else { + _document.getElementById("link_title").value = ""; + } } ANWRT_Access_Link.box.showModal(); @@ -2186,6 +2191,8 @@ var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + _document.getElementById("link_title").value = ""; + if (editor.config.linkType.length == 0) { alert("<i18n:text i18n:key="PLUGINS_ANYCONTENT_HTMLEDITORBUTTON_LINK_DIALOG_ERROR_NOLINK" i18n:catalogue="plugin.anycontent"/>"); @@ -2353,7 +2360,19 @@ { link = link.parentElement; if (link && !/^a$/i.test(link.tagName)) link = null; + { + link = null; + } + + //Dans certain cas sous Firefox on n'accède tjrs pas au lien + if ( link == null ) { + + link = editor._getSelection().anchorNode.parentNode; + + if (link && !/^a$/i.test(link.tagName)) + link = null; + } + } if (link != null) {

          Julien Cimetiere (Inactive) added a comment - - edited

          Last solution found.

          Fix, the initialisation of label field in IE and Firefox.

          At the creation, title attribute does not work in Firefox, when you do not select all the text in a <p> element.

          Problem is after line 2354 ( editor._doc.execCommand('createlink', false, f_href); ), link is never found in Firefox, editor.getParentElement() return the <p> parent element instead of the <a>

          Julien Cimetiere (Inactive) added a comment - - edited Last solution found. Fix, the initialisation of label field in IE and Firefox. At the creation, title attribute does not work in Firefox, when you do not select all the text in a <p> element. Problem is after line 2354 ( editor._doc.execCommand('createlink', false, f_href); ), link is never found in Firefox, editor.getParentElement() return the <p> parent element instead of the <a>

          Index: plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js
          ===================================================================
          RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js,v
          retrieving revision 1.17
          diff -u -r1.17 htmleditorbutton-access.js
          — plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 27 Nov 2008 17:55:10 -0000 1.17
          +++ plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 28 Nov 2008 13:09:11 -0000
          @@ -2140,13 +2140,18 @@
          break;
          }
          }

          • +
            + var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document;
            +
            var title = link.getAttribute("title");
            if (title != null)

            { - var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + _document.getElementById("link_title").value = title; }

            + else

            { + _document.getElementById("link_title").value = ""; + }

            }

          ANWRT_Access_Link.box.showModal();
          @@ -2247,6 +2252,7 @@
          return;

          ANWRT_Access_Link.selected = elt;
          + editor = ANWRT_Access_Link.editor;

          var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document;

          @@ -2265,6 +2271,16 @@
          _document.getElementById("link_helper").value = "";
          _document.getElementById("link_value").style.display = (link.helper == null) ? "" : "none";

          + var title = editor.getParentElement().getAttribute("title");
          + if (title != null)
          +

          { + + _document.getElementById("link_title").value = title; + }

          + else

          { + _document.getElementById("link_title").value = ""; + }

          +
          var iframe = _document.getElementById("iframe_helper");
          if (iframe != null && link.helper == null)
          {

          Julien Cimetiere (Inactive) added a comment - Index: plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js =================================================================== RCS file: /cvs/produits/Ametys/AnyContent_2.9/plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js,v retrieving revision 1.17 diff -u -r1.17 htmleditorbutton-access.js — plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 27 Nov 2008 17:55:10 -0000 1.17 +++ plugins/optional/accessibility/resources_dynamic/js/htmleditorbutton-access.js 28 Nov 2008 13:09:11 -0000 @@ -2140,13 +2140,18 @@ break; } } + + var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + var title = link.getAttribute("title"); if (title != null) { - var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; + _document.getElementById("link_title").value = title; } + else { + _document.getElementById("link_title").value = ""; + } } ANWRT_Access_Link.box.showModal(); @@ -2247,6 +2252,7 @@ return; ANWRT_Access_Link.selected = elt; + editor = ANWRT_Access_Link.editor; var _document = ANWRT_Access_Link.box.ui.iframe.contentWindow.document; @@ -2265,6 +2271,16 @@ _document.getElementById("link_helper").value = ""; _document.getElementById("link_value").style.display = (link.helper == null) ? "" : "none"; + var title = editor.getParentElement().getAttribute("title"); + if (title != null) + { + + _document.getElementById("link_title").value = title; + } + else { + _document.getElementById("link_title").value = ""; + } + var iframe = _document.getElementById("iframe_helper"); if (iframe != null && link.helper == null) {

          Here a part of the solution, does not work well in all navigator

          Julien Cimetiere (Inactive) added a comment - Here a part of the solution, does not work well in all navigator

            phsassard Pierre-Henri Sassard (Inactive)
            jcimetiere Julien Cimetiere (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: