Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add support for extension bookmark_pages
- Loading branch information
Showing
20 changed files
with
210 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Extensions/bookmark_pages/Configuration/TypoScript/constants.typoscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
plugin.tx_bookmarkpages.settings { | ||
# cat=plugin.tx_bookmarkpages/general; type=string; label=Additional class for dropdown (e.g. dropup) | ||
dropdownClass = | ||
} |
14 changes: 14 additions & 0 deletions
14
Extensions/bookmark_pages/Configuration/TypoScript/setup.typoscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugin.tx_bookmarkpages { | ||
view { | ||
templateRootPaths.20 = EXT:pizpalue/Extensions/bookmark_pages/Resources/Private/Templates | ||
partialRootPaths.20 = EXT:pizpalue/Extensions/bookmark_pages/Resources/Private/Partials | ||
} | ||
settings { | ||
dropdownClass = {$plugin.tx_bookmarkpages.settings.dropdownClass} | ||
} | ||
} | ||
|
||
page { | ||
includeCSS.pizpalueBookmarkPages = EXT:pizpalue/Extensions/bookmark_pages/Resources/Public/Scss/general.scss | ||
includeJSFooterlibs.bookmark_pages_jquery > | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Apache < 2.3 | ||
<IfModule !mod_authz_core.c> | ||
Order allow,deny | ||
Deny from all | ||
Satisfy All | ||
</IfModule> | ||
|
||
# Apache >= 2.3 | ||
<IfModule mod_authz_core.c> | ||
Require all denied | ||
</IfModule> |
10 changes: 10 additions & 0 deletions
10
Extensions/bookmark_pages/Resources/Private/Partials/ListItem.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:f="http://xsd.helmut-hummel.de/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
xmlns:t="http://typo3.org/ns/Helhum/TyposcriptRendering/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
|
||
<li class="dropdown-item"> | ||
<f:link.external class="bookmark-link" uri="{bookmark.url}" title="{bookmark.title}">{bookmark.title}</f:link.external> | ||
<a class="action-button bookmark-ajax-submit ppicon ppicon-trash-alt" data-remove="{bookmark.id}" href="javascript:void(0);"></a> | ||
</li> | ||
|
||
</html> |
34 changes: 34 additions & 0 deletions
34
Extensions/bookmark_pages/Resources/Private/Templates/Bookmarks/Index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:f="http://xsd.helmut-hummel.de/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
xmlns:t="http://typo3.org/ns/Helhum/TyposcriptRendering/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
|
||
<f:layout name="Default" /> | ||
|
||
<f:section name="main"> | ||
<f:if condition="{settings.listType} === 'alternative'"> | ||
<f:then> | ||
<ul class="bookmarks-list ppc-complementary"></ul> | ||
</f:then> | ||
<f:else> | ||
<div class="btn-group{f:if(condition: settings.dropdownClass, then: ' {settings.dropdownClass}')}"> | ||
<button type="button" | ||
class="btn btn-primary dropdown-toggle dropdown-toggle-split" | ||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
Bookmarks | ||
</button> | ||
<button type="button" class="btn btn-default bookmark-ajax-submit bookmark-this-page" title="{f:translate(key: 'bookmarkThisPage', extensionName: 'bookmarkPages')}"> | ||
<i class="ppicon ppicon-star-regular"></i> | ||
</button> | ||
<button type="button" class="btn btn-default ppc-bookmarked"> | ||
<i class="ppicon ppicon-star-solid"></i> | ||
</button> | ||
<ul class="bookmarks-list dropdown-menu"></ul> | ||
<template id="bookmark-template"> | ||
<f:render partial="ListItem" arguments="{bookmark: bookmark}" /> | ||
</template> | ||
</div> | ||
</f:else> | ||
</f:if> | ||
</f:section> | ||
|
||
</html> |
34 changes: 34 additions & 0 deletions
34
Extensions/bookmark_pages/Resources/Public/Scripts/JavaScript/bookmark_pages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function ($) { | ||
$(function () { | ||
|
||
if ( $( "#is-bookmarked" ).length ) { | ||
// add a class to all bookmark links on the page because somewhere is a #is-bookmarked flag in html | ||
$('.bookmark-this-page').addClass('is-bookmarked'); | ||
} | ||
|
||
// doing it this way: | ||
// $('.bookmark-ajax-submit').on('click', function (event) { | ||
// would not work for initially hidden elements | ||
|
||
$('.bookmark-pages').on('click', '.bookmark-ajax-submit', function (event) { | ||
event.preventDefault(); | ||
var $submitButton = $(this); | ||
var uri = $submitButton.data('ajaxuri'); | ||
$.ajax( | ||
uri, | ||
{ | ||
'type': 'post' | ||
} | ||
).done(function (result) { | ||
$('#bookmarks-list').html(result.list); | ||
|
||
if (result.isBookmarked) { | ||
$('.bookmark-this-page').addClass('is-bookmarked'); | ||
} else { | ||
$('.bookmark-this-page').removeClass('is-bookmarked'); | ||
} | ||
}); | ||
}); | ||
|
||
}); | ||
})(jQuery); |
47 changes: 47 additions & 0 deletions
47
Extensions/bookmark_pages/Resources/Public/Scss/general.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.bookmark-pages { | ||
li { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.dropdown-item { | ||
.bookmark-ajax-submit { | ||
margin-left: 1.5em; | ||
margin-bottom: 0.2em; | ||
} | ||
} | ||
.btn { | ||
&.dropdown-toggle-split:after { | ||
margin-left: 0.5rem; | ||
vertical-align: middle; | ||
} | ||
&.dropdown-toggle-split:before { | ||
margin-right: 0.5rem; | ||
vertical-align: middle; | ||
} | ||
&.bookmark-this-page { | ||
display: block; | ||
+.ppc-bookmarked { | ||
display: none; | ||
} | ||
&.is-bookmarked { | ||
display: none; | ||
+.ppc-bookmarked { | ||
display: block; | ||
} | ||
} | ||
} | ||
} | ||
.ppicon { | ||
text-decoration: none; | ||
} | ||
} | ||
.bookmarks-list.ppc-complementary { | ||
&, & li { | ||
padding-left: 0; | ||
padding-right: 0; | ||
} | ||
} | ||
.footer-section { | ||
overflow: visible; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.