From: Dan Brown Date: Sat, 14 Jul 2018 08:36:14 +0000 (+0100) Subject: Merge branch 'master' into feature/edit-link-headers X-Git-Tag: v0.23.0~1^2~12 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/f668bee88bbcd45efeba2f43a2346d4a9b8b6b67?ds=inline;hp=-c Merge branch 'master' into feature/edit-link-headers --- f668bee88bbcd45efeba2f43a2346d4a9b8b6b67 diff --combined resources/assets/js/components/page-display.js index 257deedda,5eb5648cd..260600d34 --- a/resources/assets/js/components/page-display.js +++ b/resources/assets/js/components/page-display.js @@@ -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)); }); } @@@ -74,23 -74,11 +74,23 @@@ 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 @@@ -102,7 -90,7 +102,7 @@@ // Show pointer and set link let $elem = $(this); pointerSectionId = $elem.attr('id'); - updatePointerContent(); + updatePointerContent($elem); $elem.before($pointer); $pointer.show(); @@@ -231,6 -219,7 +231,6 @@@ } } } - } -module.exports = PageDisplay; +module.exports = PageDisplay; diff --combined resources/assets/sass/_pages.scss index 1a4f33dae,4658b9c6a..21fdf90de --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@@ -89,6 -89,12 +89,12 @@@ del { background: #FFECEC; } + + &.page-revision { + pre code { + white-space: pre-wrap; + } + } } // Page content pointers @@@ -107,13 -113,8 +113,13 @@@ position: absolute; top: -60px; background-color:#FFF; - width: 272px; + width: 275px; z-index: 55; + + &.is-page-editable { + width: 328px; + } + &:before { position: absolute; left: 50%; @@@ -137,13 -138,12 +143,13 @@@ 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; @@@ -154,22 -154,11 +160,22 @@@ 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 diff --combined resources/lang/es/entities.php index 0e8ea95e5,866a3c1a6..8c5c9f07f --- a/resources/lang/es/entities.php +++ b/resources/lang/es/entities.php @@@ -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', @@@ -182,7 -185,6 +185,7 @@@ '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',