You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/05/12 22:51:54 UTC

[GitHub] [solr] HoustonPutman opened a new pull request, #859: Ref guide overall version improvement

HoustonPutman opened a new pull request, #859:
URL: https://github.com/apache/solr/pull/859

   - Moved the version selector up to the title.
   - Added a perma-link button to get the permanent link for a page.
   - Made the page-version selector orange, to make it more visible.
   
   Looks like this:
   
   
   <img width="1282" alt="Screen Shot 2022-05-12 at 6 49 47 PM" src="https://user-images.githubusercontent.com/3376422/168179996-4c9f4890-696f-4121-aee5-b7c494fe8e93.png">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] HoustonPutman commented on pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on PR #859:
URL: https://github.com/apache/solr/pull/859#issuecomment-1126549605

   You can build this yourself and test it out with:
   ```
   gradle buildOfficialSite -Prefguide.official.includePrereleaseVersions=true -Prefguide.buildLocalUI=true
   ```
   
   New look of link:
   
   <img width="1168" alt="Screen Shot 2022-05-13 at 6 16 36 PM" src="https://user-images.githubusercontent.com/3376422/168396162-80201f02-4c1b-421b-a633-df553fc0a284.png">
   
   Hover:
   
   <img width="1170" alt="Screen Shot 2022-05-13 at 6 17 57 PM" src="https://user-images.githubusercontent.com/3376422/168396245-a37b0e4a-014d-4fe2-8d47-c638371060d6.png">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #859:
URL: https://github.com/apache/solr/pull/859#discussion_r871875679


##########
solr/solr-ref-guide/ui-src/js/07-copy-perma-link.js:
##########
@@ -0,0 +1,51 @@
+;(function () {
+  'use strict'
+
+  var TRAILING_SPACE_RX = / +$/gm
+  var config = (document.getElementById('site-script') || { dataset: {} }).dataset
+
+  ;[].slice.call(document.querySelectorAll('span.perma-link-copy')).forEach(function (span) {
+    var link, copy, toast, permaLinkText, toolbox
+    link = window.location.href.replace('/latest/', '/' + span.getAttribute('version') + '/')
+    ;(toolbox = document.createElement('div')).className = 'perma-link'
+    if (window.navigator.clipboard) {
+      ;(copy = document.createElement('button')).className = 'copy-button'
+      copy.setAttribute('title', 'Copy Link')
+      ;(permaLinkText = document.createElement('span')).className = 'button-label'
+      permaLinkText.appendChild(document.createTextNode('Permanent Link'))
+      copy.appendChild(permaLinkText)
+      if (config.svgAs === 'svg') {
+        var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
+        svg.setAttribute('class', 'copy-icon')
+        var use = document.createElementNS('http://www.w3.org/2000/svg', 'use')
+        use.setAttribute('href', window.uiRootPath + '/img/octicons-16.svg#icon-clippy')
+        svg.appendChild(use)
+        copy.appendChild(svg)
+      } else {
+        var img = document.createElement('img')
+        img.src = window.uiRootPath + '/img/octicons-16.svg#view-clippy'
+        img.alt = 'copy icon'
+        img.className = 'copy-icon'
+        copy.appendChild(img)
+      }
+      ;(toast = document.createElement('span')).className = 'copy-toast'
+      toast.appendChild(document.createTextNode('Copied!'))
+      copy.appendChild(toast)
+      toolbox.appendChild(copy)
+    }
+    span.appendChild(toolbox)
+    if (copy) copy.addEventListener('click', writeToClipboard.bind(copy, link))
+  })
+
+  function writeToClipboard (link) {
+    var text = link.replace(TRAILING_SPACE_RX, '')
+    window.navigator.clipboard.writeText(text).then(
+      function () {
+        this.classList.add('clicked')
+        this.offsetHeight // eslint-disable-line no-unused-expressions

Review Comment:
   *JSC_USELESS_CODE:*  Suspicious code. The result of the 'getprop' operator is not being used.
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=208451309&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=208451309&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=208451309&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=208451309&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=208451309&lift_comment_rating=5) ]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #859:
URL: https://github.com/apache/solr/pull/859#discussion_r872870358


##########
solr/solr-ref-guide/ui-src/js/07-copy-perma-link.js:
##########
@@ -0,0 +1,51 @@
+;(function () {
+  'use strict'
+
+  var TRAILING_SPACE_RX = / +$/gm
+  var config = (document.getElementById('site-script') || { dataset: {} }).dataset
+
+  ;[].slice.call(document.querySelectorAll('span.perma-link-copy')).forEach(function (span) {
+    var link, copy, toast, permaLinkText, toolbox
+    link = window.location.href.replace('/latest/', '/' + span.getAttribute('version') + '/')
+    ;(toolbox = document.createElement('div')).className = 'perma-link'
+    if (window.navigator.clipboard) {
+      ;(copy = document.createElement('button')).className = 'copy-button'
+      copy.setAttribute('title', 'Copy Link')
+      ;(permaLinkText = document.createElement('span')).className = 'button-label'
+      permaLinkText.appendChild(document.createTextNode('Permanent Link'))
+      copy.appendChild(permaLinkText)
+      if (config.svgAs === 'svg') {
+        var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
+        svg.setAttribute('class', 'copy-icon')
+        var use = document.createElementNS('http://www.w3.org/2000/svg', 'use')
+        use.setAttribute('href', window.uiRootPath + '/img/octicons-16.svg#icon-clippy')
+        svg.appendChild(use)
+        copy.appendChild(svg)
+      } else {
+        var img = document.createElement('img')
+        img.src = window.uiRootPath + '/img/octicons-16.svg#view-clippy'
+        img.alt = 'copy icon'
+        img.className = 'copy-icon'
+        copy.appendChild(img)
+      }
+      ;(toast = document.createElement('span')).className = 'copy-toast'
+      toast.appendChild(document.createTextNode('Copied!'))
+      copy.appendChild(toast)
+      toolbox.appendChild(copy)
+    }
+    span.appendChild(toolbox)
+    if (copy) copy.addEventListener('click', writeToClipboard.bind(copy, link))
+  })
+
+  function writeToClipboard (link) {
+    var text = link.replace(TRAILING_SPACE_RX, '')
+    window.navigator.clipboard.writeText(text).then(
+      function () {
+        this.classList.add('clicked')
+        this.offsetHeight // eslint-disable-line no-unused-expressions

Review Comment:
   I've recorded this as ignored for this pull request. If you change your mind, just comment `@sonatype-lift unignore`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
madrob commented on PR #859:
URL: https://github.com/apache/solr/pull/859#issuecomment-1125488745

   Are there two version selectors now? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
madrob commented on PR #859:
URL: https://github.com/apache/solr/pull/859#issuecomment-1125490044

   Where do the new files come from? Copied from the same Antora default templates?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] HoustonPutman commented on a diff in pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on code in PR #859:
URL: https://github.com/apache/solr/pull/859#discussion_r872870330


##########
solr/solr-ref-guide/ui-src/js/07-copy-perma-link.js:
##########
@@ -0,0 +1,51 @@
+;(function () {
+  'use strict'
+
+  var TRAILING_SPACE_RX = / +$/gm
+  var config = (document.getElementById('site-script') || { dataset: {} }).dataset
+
+  ;[].slice.call(document.querySelectorAll('span.perma-link-copy')).forEach(function (span) {
+    var link, copy, toast, permaLinkText, toolbox
+    link = window.location.href.replace('/latest/', '/' + span.getAttribute('version') + '/')
+    ;(toolbox = document.createElement('div')).className = 'perma-link'
+    if (window.navigator.clipboard) {
+      ;(copy = document.createElement('button')).className = 'copy-button'
+      copy.setAttribute('title', 'Copy Link')
+      ;(permaLinkText = document.createElement('span')).className = 'button-label'
+      permaLinkText.appendChild(document.createTextNode('Permanent Link'))
+      copy.appendChild(permaLinkText)
+      if (config.svgAs === 'svg') {
+        var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
+        svg.setAttribute('class', 'copy-icon')
+        var use = document.createElementNS('http://www.w3.org/2000/svg', 'use')
+        use.setAttribute('href', window.uiRootPath + '/img/octicons-16.svg#icon-clippy')
+        svg.appendChild(use)
+        copy.appendChild(svg)
+      } else {
+        var img = document.createElement('img')
+        img.src = window.uiRootPath + '/img/octicons-16.svg#view-clippy'
+        img.alt = 'copy icon'
+        img.className = 'copy-icon'
+        copy.appendChild(img)
+      }
+      ;(toast = document.createElement('span')).className = 'copy-toast'
+      toast.appendChild(document.createTextNode('Copied!'))
+      copy.appendChild(toast)
+      toolbox.appendChild(copy)
+    }
+    span.appendChild(toolbox)
+    if (copy) copy.addEventListener('click', writeToClipboard.bind(copy, link))
+  })
+
+  function writeToClipboard (link) {
+    var text = link.replace(TRAILING_SPACE_RX, '')
+    window.navigator.clipboard.writeText(text).then(
+      function () {
+        this.classList.add('clicked')
+        this.offsetHeight // eslint-disable-line no-unused-expressions

Review Comment:
   @sonatype-lift ignore



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] HoustonPutman commented on pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on PR #859:
URL: https://github.com/apache/solr/pull/859#issuecomment-1125491836

   > Are there two version selectors now?
   
   there always have been. I just made each more prominent.
   
   
   
   > Where do the new files come from? Copied from the same Antora default templates?
   
   yes, (almost) all files in ui-src are copied from the antora template and modified. I have made sure that all changes, additions and removals are noted, so that we can upgrade these files in the future.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] HoustonPutman merged pull request #859: Ref guide overall version improvement

Posted by GitBox <gi...@apache.org>.
HoustonPutman merged PR #859:
URL: https://github.com/apache/solr/pull/859


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org