This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch SLING-7858
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git

commit 0281a487818135819c10d755ae160957ec583ab3
Author: Dan Klco <[email protected]>
AuthorDate: Wed Aug 29 20:35:01 2018 -0400

    Got the version manager and taxonomy working, cleaning up instances of old 
hide mixin
---
 ui/src/main/frontend/src/js/scripts.js             | 17 +++++++---
 ui/src/main/frontend/src/scss/styles.scss          | 36 ++++++++++++++--------
 .../components/cms/contentnav/contentnav.jsp       |  4 +--
 .../components/cms/staticnav/staticnav.jsp         |  6 ++--
 .../cms/versionmanager/versionmanager.jsp          |  8 ++---
 .../components/editor/fields/file/field.jsp        |  2 +-
 .../components/editor/fields/repeating/field.jsp   |  2 +-
 .../components/editor/fields/taxonomy/field.jsp    | 27 ++++++++++------
 .../sling-cms/components/pages/base/scripts.jsp    |  8 +----
 9 files changed, 65 insertions(+), 45 deletions(-)

diff --git a/ui/src/main/frontend/src/js/scripts.js 
b/ui/src/main/frontend/src/js/scripts.js
index 1fc36be..fab6b63 100644
--- a/ui/src/main/frontend/src/js/scripts.js
+++ b/ui/src/main/frontend/src/js/scripts.js
@@ -39,7 +39,7 @@ Sling.CMS = {
                },
                ui: {
                        confirmMessage: function(title, message, complete){
-                               var $modal = $('<div class="modal"><div 
class="modal-background"></div><div class="modal-card"><div 
class="modal-card-head Draggable">'+title+'</div><div 
class="modal-card-body">'+message+'</div><div class="modal-card-foot"><button 
type="button" class="close-modal button is-primary">OK</button></div></div>');
+                               var $modal = $('<div class="modal"><div 
class="modal-background"></div><div class="modal-card is-draggable"><div 
class="modal-card-head">'+title+'</div><div 
class="modal-card-body">'+message+'</div><div class="modal-card-foot"><button 
type="button" class="close-modal button is-primary">OK</button></div></div>');
                                $('body').append($modal);
                                $modal.addClass('is-active');
                                $modal.find('.close-modal').click(function(){
@@ -50,7 +50,7 @@ Sling.CMS = {
                                return $modal;
                        },
                        fetchModal: function(title, link, path, complete){
-                               var $modal = $('<div class="modal"><div 
class="modal-background"></div><div class="modal-card Draggable"><div 
class="modal-card-head">'+title+'<button type="button" 
class="modal-close"></button></div><div class="modal-card-body""></div><div 
class="modal-card-foot"></div></div>');
+                               var $modal = $('<div class="modal"><div 
class="modal-background"></div><div class="modal-card is-draggable"><div 
class="modal-card-head">'+title+'<button type="button" 
class="modal-close"></button></div><div class="modal-card-body""></div><div 
class="modal-card-foot"></div></div>');
                                $('body').append($modal);
                                $modal.find('.modal-card-body').load(link + " " 
+path,function(){
                                        $modal.addClass('is-active');
@@ -472,6 +472,15 @@ Sling.CMS = {
                                $(this).addClass('is-selected');
                                $(this).find('.cell-actions > 
*').appendTo('#Actions-Target')
                        });
+
+                       $ctx.find('table').each(function(){
+                               var sort = $(this).data('sort') !== 'false';
+                               var paginate = $(this).data('paginate') !== 
'false';
+                               $(this).DataTable({
+                                       sort: sort,
+                                       paginate: paginate
+                               });
+                       });
                }
        };
 
@@ -512,8 +521,8 @@ Sling.CMS = {
        
        Sling.CMS.ext['toggle-hidden'] = {
                decorate: function($ctx){
-                       $ctx.find('.Toggle-Hidden').click(function(){
-                               $($(this).data('target')).toggleClass('Hide');
+                       $ctx.find('.toggle-hidden').click(function(){
+                               
$($(this).data('target')).toggleClass('is-hidden');
                        });
                }
        };
diff --git a/ui/src/main/frontend/src/scss/styles.scss 
b/ui/src/main/frontend/src/scss/styles.scss
index da1ba85..c03f5a6 100644
--- a/ui/src/main/frontend/src/scss/styles.scss
+++ b/ui/src/main/frontend/src/scss/styles.scss
@@ -17,6 +17,29 @@
  * under the License.
  */
 
+.is-draggable {
+       position: relative;
+}
+
+.menu-label {
+       text-transform: none;
+       font-size: 1.25em;
+       letter-spacing: normal;
+}
+
+.note-group-select-from-files {
+       display: none;
+}
+
+.note-toolbar-wrapper {
+       height: auto !important;
+}
+
+.Preview {
+       max-width: 100%;
+       padding: .5em;
+}
+
 table.dataTable thead .sorting:after,
 table.dataTable thead .sorting_asc:after,
 table.dataTable thead .sorting_desc:after,
@@ -35,17 +58,4 @@ table.dataTable thead .sorting_asc:after {
 
 table.dataTable thead .sorting_desc:after {
        content: "\e92a"
-}
-
-.note-group-select-from-files {
-       display: none;
-}
-
-.note-toolbar-wrapper {
-       height: auto !important;
-}
-
-.Preview {
-       max-width: 100%;
-       padding: .5em;
 }
\ No newline at end of file
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
index dfb8a8b..17570b7 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
@@ -19,8 +19,8 @@
  <%@include file="/libs/sling-cms/global.jsp"%>
 <sling:findResources var="content" query="${properties.query}" 
language="JCR-SQL2" />
 <aside class="menu">
-<a class="menu-label Toggle-Hidden" 
data-target="#Nav-${fn:replace(properties.title,' 
','-')}">${properties.title}</a>
-<ul class="menu-list ${fn:startsWith(slingRequest.requestURI, 
properties.prefix) ? '' : 'Hide'}" id="Nav-${fn:replace(properties.title,' 
','-')}">
+<a class="menu-label toggle-hidden" 
data-target="#nav-${fn:replace(properties.title,' 
','-')}">${properties.title}</a>
+<ul class="menu-list ${fn:startsWith(slingRequest.requestURI, 
properties.prefix) ? '' : 'is-hidden'}" id="nav-${fn:replace(properties.title,' 
','-')}">
     <c:forEach var="item" items="${content}">
         <c:set var="prefixPath" value="${item.path}/" />
         <li class="${(fn:startsWith(slingRequest.requestPathInfo.suffix, 
prefixPath) || slingRequest.requestPathInfo.suffix == item.path) ? 'is-active' 
: ''}">
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/staticnav/staticnav.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/staticnav/staticnav.jsp
index 082ec53..7d6f342 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/staticnav/staticnav.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/staticnav/staticnav.jsp
@@ -18,14 +18,14 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
 <div class="menu">
-<a class="menu-label Toggle-Hidden" 
data-target="#${fn:replace(properties.title,' 
','-')}-Nav">${properties.title}</a>
-<c:set var="hidden" value="Hide" />
+<a class="menu-label toggle-hidden" 
data-target="#${fn:replace(properties.title,' 
','-')}-nav">${properties.title}</a>
+<c:set var="hidden" value="is-hidden" />
 <c:forEach var="item" 
items="${sling:listChildren(sling:getRelativeResource(resource,'links'))}">
     <c:if test="${fn:startsWith(slingRequest.requestURI,item.valueMap.link)}">
         <c:set var="hidden" value="" />
     </c:if>
 </c:forEach>
-<ul id="${fn:replace(properties.title,' ','-')}-Nav" class="menu-list 
${hidden}">
+<ul id="${fn:replace(properties.title,' ','-')}-nav" class="menu-list 
${hidden}">
     <c:forEach var="item" 
items="${sling:listChildren(sling:getRelativeResource(resource,'links'))}">
         <li class="${fn:startsWith(slingRequest.requestURI,item.valueMap.link) 
? 'active' : ''}"><a href="${item.valueMap.link}">${item.valueMap.text}</a></li>
     </c:forEach>
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/versionmanager/versionmanager.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/versionmanager/versionmanager.jsp
index 7748520..fb178f3 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/versionmanager/versionmanager.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/versionmanager/versionmanager.jsp
@@ -27,7 +27,7 @@
                        <form method="post" 
action="${slingRequest.requestPathInfo.suffix}" enctype="multipart/form-data" 
class="Form-Ajax" data-add-date="false">
                                <input type="hidden" name=":operation" 
value="checkpoint" />
                                <div class="Field-Group">
-                                       <button type="submit" class="btn 
btn-success" title="Create a new version for the content">
+                                       <button type="submit" class="button 
is-primary" title="Create a new version for the content">
                                                Create Version
                                        </button>
                                </div>
@@ -40,14 +40,14 @@
                                <input type="hidden" 
name="jcr:mixinTypes@TypeHint" value="Type[]">
                            <input type="hidden" name="jcr:mixinTypes" 
value="mix:versionable">
                                <div class="Field-Group">
-                                       <button type="submit" class="btn 
btn-success" title="Make the content versionable">
+                                       <button type="submit" class="button 
is-primary" title="Make the content versionable">
                                                Make Versionable
                                        </button>
                                </div>
                        </form>
                </c:otherwise>
        </c:choose>
-       <table>
+       <table class="table" data-sort="false" data-paginate="false">
                <thead>
                        <tr>
                                <th>Version</th>
@@ -85,7 +85,7 @@
                                                <input type="hidden" 
name=":operation" value="restore" />
                                                <input type="hidden" 
name=":version" value="{{@key}}" />
                                                <div class="Field-Group">
-                                                       <button type="submit" 
class="btn btn-success" title="Restore the content to {{@key}}">
+                                                       <button type="submit" 
class="button" title="Restore the content to {{@key}}">
                                                                Restore Version
                                                        </button>
                                                </div>
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
index 814f488..2da4a5b 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
@@ -26,7 +26,7 @@
        </c:otherwise>
 </c:choose>
 <div class="repeating">
-       <div disabled="disabled" class="repeating__template Hide">
+       <div disabled="disabled" class="repeating__template is-hidden">
                <div class="repeating__item Grid">
                        <div class="Cell Mobile-80">
                                <input type="file" name="${properties.name}" 
${required} accept="${accepts}" />
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
index 26401fe..3da4290 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
@@ -18,7 +18,7 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
  <div class="repeating">
-       <div disabled="disabled" class="repeating__template Hide">
+       <div disabled="disabled" class="repeating__template is-hidden">
                <div class="repeating__item Grid">
                        <div class="Cell Mobile-80">
                                <input type="${properties.type}" value="" 
name="${properties.name}" ${required} ${disabled} />
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
index 98adb5c..0fdeec1 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
@@ -18,25 +18,32 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
  <div class="taxonomy">
-       <fieldset disabled="disabled" class="taxonomy__template Hide">
-               <a class="Button taxonomy__item">
+       <fieldset disabled="disabled" class="taxonomy__template is-hidden">
+               <a class="button taxonomy__item">
                        <input type="hidden" name="${properties.name}" value="" 
/>
-                       <span class="taxonomy__title"></span>
+                       <span class="taxonomy__title">
+                       </span>
+                       <span class="jam jam-close"></span>
                </a>
        </fieldset>
-       <div class="taxonomy__field Grid">
-               <div class="Cell Mobile-80">
-                       <input type="text" ${required} ${disabled} 
list="taxonomy-${fn:replace(resource.name,':','-')}" autocomplete="off" />
+       <div class="taxonomy__field field has-addons">
+               <div class="control">
+                       <input class="input" type="text" ${required} 
${disabled} list="taxonomy-${fn:replace(resource.name,':','-')}" 
autocomplete="off" />
                </div>
-               <div class="Cell Mobile-20">
-                       <button class="taxonomy__add">+</button>
+               <div class="control">
+                       <button class="taxonomy__add button">
+                               <span class="jam jam-plus"></span>
+                       </button>
                </div>
        </div>
        <div class="taxonomy__container">
                <c:forEach var="item" 
items="${editProperties[properties.name]}">
-                       <a class="Button taxonomy__item">
+                       <a class="button taxonomy__item">
                                <input type="hidden" name="${properties.name}" 
value="${item}" />
-                               <span 
class="taxonomy__title">${sling:encode(sling:getResource(resourceResolver,item).valueMap['jcr:title'],'HTML')}</span>
+                               <span class="taxonomy__title">
+                                       
${sling:encode(sling:getResource(resourceResolver,item).valueMap['jcr:title'],'HTML')}
+                               </span>
+                               <span class="jam jam-close"></span>
                        </a>
                </c:forEach>
        </div>
diff --git 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/base/scripts.jsp
 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/base/scripts.jsp
index db55b29..fe2c77c 100644
--- 
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/base/scripts.jsp
+++ 
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/base/scripts.jsp
@@ -17,10 +17,4 @@
  * under the License.
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
-<script src="/static/clientlibs/sling-cms/js/scripts-all.min.js"></script>
-<script>
-
-$(document).ready( function () {
-    $('.table').DataTable();
-} );
-</script>
\ No newline at end of file
+<script src="/static/clientlibs/sling-cms/js/scripts-all.min.js"></script>
\ No newline at end of file

Reply via email to