]> BookStack Code Mirror - bookstack/commitdiff
Merge branch 'master' into feature/edit-link-headers
authorDan Brown <redacted>
Sat, 14 Jul 2018 08:36:14 +0000 (09:36 +0100)
committerDan Brown <redacted>
Sat, 14 Jul 2018 08:36:14 +0000 (09:36 +0100)
1  2 
resources/assets/js/components/page-display.js
resources/assets/sass/_pages.scss
resources/lang/es/entities.php

index 257deedda834f3377a796e1f034c68af33acd2ad,5eb5648cd809342ae6bfab9faa4e763bf3ca7e10..260600d3420b19c00652d0e5588d1516b9cf1e4f
@@@ -20,7 -20,7 +20,7 @@@ class PageDisplay 
  
          // Sidebar page nav click event
          $('.sidebar-page-nav').on('click', 'a', event => {
-             goToText(event.target.getAttribute('href').substr(1));
+             this.goToText(event.target.getAttribute('href').substr(1));
          });
      }
  
              pointerShowing = false;
          });
  
 -        let updatePointerContent = () => {
 +        let updatePointerContent = ($elem) => {
              let inputText = pointerModeLink ? window.baseUrl(`/link/${this.pageId}#${pointerSectionId}`) : `{{@${this.pageId}#${pointerSectionId}}}`;
              if (pointerModeLink && inputText.indexOf('http') !== 0) inputText = window.location.protocol + "//" + window.location.host + inputText;
  
              $pointer.find('input').val(inputText);
 +
 +            // update anchor if present
 +            const $editAnchor = $pointer.find('#pointer-edit');
 +            if ($editAnchor.length !== 0 && $elem) {
 +                const editHref = $editAnchor.data('editHref');
 +                const element = $elem[0];
 +                const elementId = element.id;
 +
 +                // get the first 50 characters.
 +                let queryContent = element.textContent && element.textContent.substring(0, 50);
 +                $editAnchor[0].href = `${editHref}?content-id=${elementId}&content-text=${encodeURIComponent(queryContent)}`;
 +            }
          };
  
          // Show pointer when selecting a single block of tagged content
              // Show pointer and set link
              let $elem = $(this);
              pointerSectionId = $elem.attr('id');
 -            updatePointerContent();
 +            updatePointerContent($elem);
  
              $elem.before($pointer);
              $pointer.show();
              }
          }
      }
 -
  }
  
 -module.exports = PageDisplay;
 +module.exports = PageDisplay;
index 1a4f33dae29cb47afe229bfb543cbe3ddc62f233,4658b9c6a087d12f6e43ab5313674b1f0fb50eac..21fdf90dea234ad25c95365f6a45e89a20045ca0
    del {
      background: #FFECEC;
    }
+   &.page-revision {
+     pre code {
+       white-space: pre-wrap;
+     }
+   }
  }
  
  // Page content pointers
    position: absolute;
    top: -60px;
    background-color:#FFF;
 -  width: 272px;
 +  width: 275px;
    z-index: 55;
 +
 +  &.is-page-editable {
 +    width: 328px;
 +  }
 +
    &:before {
      position: absolute;
      left: 50%;
      width: 172px;
      z-index: 40;
    }
 -  input, button {
 +  input, button, a {
      position: relative;
      border-radius: 0;
      height: 28px;
      font-size: 12px;
      vertical-align: top;
 +    padding: 5px 16px;
    }
    > i {
      color: #888;
      cursor: pointer;
      user-select: none;
    }
 -  .button {
 +  .input-group .button {
      line-height: 1;
      margin: 0 0 0 -4px;
      box-shadow: none;
    }
 +  a.button {
 +    margin: 0 0 0 0;
 +
 +    &:hover {
 +      fill: #fff;
 +    }
 +  }
 +  .svg-icon {
 +    width: 1.2em;
 +    height: 1.2em;
 +  }
  }
  
  // Attribute form
index 0e8ea95e54549b13f2aa45f713c9147d6be2899b,866a3c1a6833df9ac3f4ca81a50dae68e405a1d5..8c5c9f07f46181ee807f8a06654d82bb5acc2ae2
@@@ -166,6 -166,9 +166,9 @@@ return 
      'pages_not_in_chapter' => 'La página no está en un capítulo',
      'pages_move' => 'Mover página',
      'pages_move_success' => 'Página movida a ":parentName"',
+     'pages_copy' => 'Copiar página',
+     'pages_copy_desination' => 'Destino de la copia',
+     'pages_copy_success' => 'Página copiada a correctamente',
      'pages_permissions' => 'Permisos de página',
      'pages_permissions_success' => 'Permisos de página actualizados',
      'pages_revision' => 'Revisión',
      'pages_revisions_restore' => 'Restaurar',
      'pages_revisions_none' => 'Esta página no tiene revisiones',
      'pages_copy_link' => 'Copiar Enlace',
 +    'pages_edit_content_link' => 'Contenido editado',
      'pages_permissions_active' => 'Permisos de página activos',
      'pages_initial_revision' => 'Publicación inicial',
      'pages_initial_name' => 'Página nueva',