Uploaded image for project: 'Maven Doxia Sitetools'
  1. Maven Doxia Sitetools
  2. DOXIASITETOOLS-150

create a "isLink(href)" function for use in skins

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: Decoration model
    • Labels:
      None

      Description

      many skins copy/paste following code:

       #if ( $href.toLowerCase().startsWith("http:/") || $href.toLowerCase().startsWith("https:/") ||
          $href.toLowerCase().startsWith("ftp:/") || $href.toLowerCase().startsWith("mailto:") ||
          $href.toLowerCase().startsWith("file:/") || ($href.toLowerCase().indexOf("://") != -1) )

      putting this as a function available from skins will improve their maintenance

      one idea is to add this code as a method of decoration model, which is already available in skins as $decoration variable: this would permit to replace previous snippet with

      #if $decoration.isLink($href)

        Attachments

          Activity

            People

            • Assignee:
              hboutemy Herve Boutemy
              Reporter:
              hboutemy Herve Boutemy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: