Skip to content

Commit

Permalink
Merged in development (pull request #5)
Browse files Browse the repository at this point in the history
[TASK] remove version from composer file, possibility to change where to prepand cookie warning
  • Loading branch information
Andriy Oprysko committed Mar 1, 2017
2 parents ea73d4e + 694cc9e commit 4360b19
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 156 deletions.
67 changes: 35 additions & 32 deletions Configuration/TypoScript/constants.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
plugin.tx_pxacookiebar {
view {
# cat=plugin.tx_pxacookiebar/file; type=string; label=Path to template root (FE)
templateRootPath = EXT:pxa_cookie_bar/Resources/Private/Templates/
# cat=plugin.tx_pxacookiebar/file; type=string; label=Path to template partials (FE)
partialRootPath = EXT:pxa_cookie_bar/Resources/Private/Partials/
# cat=plugin.tx_pxacookiebar/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:pxa_cookie_bar/Resources/Private/Layouts/
}
persistence {
# cat=plugin.tx_pxacookiebar//a; type=string; label=Default storage PID
storagePid =
}
view {
# cat=plugin.tx_pxacookiebar/file; type=string; label=Path to template root (FE)
templateRootPath = EXT:pxa_cookie_bar/Resources/Private/Templates/
# cat=plugin.tx_pxacookiebar/file; type=string; label=Path to template partials (FE)
partialRootPath = EXT:pxa_cookie_bar/Resources/Private/Partials/
# cat=plugin.tx_pxacookiebar/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:pxa_cookie_bar/Resources/Private/Layouts/
}

persistence {
# cat=plugin.tx_pxacookiebar//a; type=string; label=Default storage PID
storagePid =
}
}

# Settings for cookies
plugin.tx_pxacookiebar {
# customsubcategory=pxacookiebar=Cookie bar settings
settings {
# cat=plugin.tx_pxacookiebar/pxacookiebar/010; type=boolean; label=Disable using of cookie (Active)
disableCookies = 0

# customsubcategory=pxacookiebar=Cookie bar settings
settings {
# cat=plugin.tx_pxacookiebar/pxacookiebar/010; type=boolean; label=Disable using of cookie (Active)
disableCookies = 0

# cat=plugin.tx_pxacookiebar/pxacookiebar/015; type=string; label=Cookie link or Page UID
page = 1
# cat=plugin.tx_pxacookiebar/pxacookiebar/015; type=string; label=Cookie link or Page UID
page = 1

# cat=plugin.tx_pxacookiebar/pxacookiebar/020; type=boolean; label=Link target blank
targetBlank = 0
# cat=plugin.tx_pxacookiebar/pxacookiebar/020; type=boolean; label=Link target blank
targetBlank = 0

# cat=plugin.tx_pxacookiebar/pxacookiebar/025; type=options[Top=top,Bottom=bottomFix]; label=Position
position = top
# cat=plugin.tx_pxacookiebar/pxacookiebar/025; type=options[Top=top,Bottom=bottomFix]; label=Position
position = top

# cat=plugin.tx_pxacookiebar/pxacookiebar/030; type=boolean; label=Show only after FE user login
showOnlyOnLogin = 0
# cat=plugin.tx_pxacookiebar/pxacookiebar/030; type=boolean; label=Show only after FE user login
showOnlyOnLogin = 0

# cat=plugin.tx_pxacookiebar/pxacookiebar/035; type=options[Standart version=1,Styling version 2=2]; label=Styling version
stylingVersion = 1
# cat=plugin.tx_pxacookiebar/pxacookiebar/035; type=options[Standart version=1,Styling version 2=2]; label=Styling version
stylingVersion = 1

# cat=plugin.tx_pxacookiebar/pxacookiebar/040; type=boolean; label=Don't use ajax for cookie bar loading
disableAjaxLoading = 0

# cat=plugin.tx_pxacookiebar/pxacookiebar/045; type=boolean; label=Use subdomain to get cookie bar
useSubDomain = 0
# cat=plugin.tx_pxacookiebar/pxacookiebar/045; type=boolean; label=Use subdomain to get cookie bar
useSubDomain = 0

# cat=plugin.tx_pxacookiebar/pxacookiebar/050; type=string; label=Subdomain
subDomain =

# cat=plugin.tx_pxacookiebar/pxacookiebar/050; type=string; label=Subdomain
subDomain =
}
prepantTo = 10
}
}
195 changes: 101 additions & 94 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
plugin.tx_pxacookiebar {
view {
templateRootPaths {
10 = {$plugin.tx_pxacookiebar.view.templateRootPath}
}
partialRootPaths {
10 = {$plugin.tx_pxacookiebar.view.partialRootPath}
}
layoutRootPaths {
10 = {$plugin.tx_pxacookiebar.view.layoutRootPath}
}
}
view {
templateRootPaths {
10 = {$plugin.tx_pxacookiebar.view.templateRootPath}
}

persistence {
storagePid = {$plugin.tx_pxacookiebar.persistence.storagePid}
}
partialRootPaths {
10 = {$plugin.tx_pxacookiebar.view.partialRootPath}
}

features {
# uncomment the following line to enable the new Property Mapper.
# rewrittenPropertyMapper = 1
}
layoutRootPaths {
10 = {$plugin.tx_pxacookiebar.view.layoutRootPath}
}
}

persistence {
storagePid = {$plugin.tx_pxacookiebar.persistence.storagePid}
}

features {
# uncomment the following line to enable the new Property Mapper.
# rewrittenPropertyMapper = 1
}

settings {
enable = 1
disableCookies = {$plugin.tx_pxacookiebar.settings.disableCookies}
page = {$plugin.tx_pxacookiebar.settings.page}
targetBlank = {$plugin.tx_pxacookiebar.settings.targetBlank}
showOnlyOnLogin = {$plugin.tx_pxacookiebar.settings.showOnlyOnLogin}
stylingVersion = {$plugin.tx_pxacookiebar.settings.stylingVersion}
useSubDomain = {$plugin.tx_pxacookiebar.settings.useSubDomain}
subDomain = {$plugin.tx_pxacookiebar.settings.subDomain}
settings {
enable = 1
disableCookies = {$plugin.tx_pxacookiebar.settings.disableCookies}
page = {$plugin.tx_pxacookiebar.settings.page}
targetBlank = {$plugin.tx_pxacookiebar.settings.targetBlank}
showOnlyOnLogin = {$plugin.tx_pxacookiebar.settings.showOnlyOnLogin}
stylingVersion = {$plugin.tx_pxacookiebar.settings.stylingVersion}
useSubDomain = {$plugin.tx_pxacookiebar.settings.useSubDomain}
subDomain = {$plugin.tx_pxacookiebar.settings.subDomain}
disableAjaxLoading = {$plugin.tx_pxacookiebar.settings.disableAjaxLoading}
}
}
}

page.includeJSFooter.cookieWarning = EXT:pxa_cookie_bar/Resources/Public/Js/pxa_cookie_warning.js
Expand All @@ -49,40 +51,40 @@ cookieWarning.5 {
vendorName = Pixelant
}


# options
page.headerData.86 = COA
page.headerData.86 {
# helper options
# helper options
5 = TEXT
5.value (
setDocumentClass : function(className) {
document.documentElement.className += (document.documentElement.className == "" ? "":" ") + className;
},
)
10 = TEXT
10 {
typolink {
parameter.data = TSFE:id
additionalParams = &type=314638125&tx_pxacookiebar_pxacookiebar[action]=closeWarning
addQueryString = 1
addQueryString.method = GET
useCacheHash = 1
forceAbsoluteUrl = 1
returnLast = url
}
wrap = cookieCloseUrl:"|",
}
)
10 = TEXT
10 {
typolink {
parameter.data = TSFE:id
additionalParams = &type=314638125&tx_pxacookiebar_pxacookiebar[action]=closeWarning
addQueryString = 1
addQueryString.method = GET
useCacheHash = 1
forceAbsoluteUrl = 1
returnLast = url
}

wrap = cookieCloseUrl:"|",
}

20 < .10
20 {
typolink.additionalParams = &type=314638125&tx_pxacookiebar_pxacookiebar[action]=warning
wrap = cookieBarUrl:"|",
}

30 = TEXT
30 {
value (
30 = TEXT
30 {
value (
getCookie : function(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
Expand All @@ -96,44 +98,48 @@ getCookie : function(c_name) {

return false;
},
)
}
)
}

wrap = <script>var PxaCookieWarningHelper = {|};PxaCookieWarningHelper['cookieIsSet']=PxaCookieWarningHelper.getCookie('pxa_cookie_warning');if(!PxaCookieWarningHelper['cookieIsSet'] && PxaCookieWarningHelper['disableAjaxLoading']) {PxaCookieWarningHelper.setDocumentClass("visible-cookie-warning");}</script>
wrap = <script>var PxaCookieWarningHelper = {|};PxaCookieWarningHelper['cookieIsSet']=PxaCookieWarningHelper.getCookie('pxa_cookie_warning');if(!PxaCookieWarningHelper['cookieIsSet'] && PxaCookieWarningHelper['disableAjaxLoading']) {PxaCookieWarningHelper.setDocumentClass("visible-cookie-warning");}</script>
}

[globalVar = LIT:1 = {$plugin.tx_pxacookiebar.settings.disableAjaxLoading}]
page.headerData.86 {
35 = TEXT
35.value = disableAjaxLoading: true,
}
page {
10 {
stdWrap.prepend = COA
stdWrap.prepend {
10 < cookieWarning.5
10 {
settings {
forceCookieWarningRender = 1
page.headerData.86 {
35 = TEXT
35.value = disableAjaxLoading: true,
}

page {
{$plugin.tx_pxacookiebar.settings.prepantTo} {
stdWrap.prepend = COA
stdWrap.prepend {
10 < cookieWarning.5
10 {
settings {
forceCookieWarningRender = 1
}
}
}
}

cssInline {
87 = TEXT
87.value = #pxa-cookie-mess{display:none;}.visible-cookie-warning #pxa-cookie-mess{display: block;}
}
}
cssInline {
87 = TEXT
87.value = #pxa-cookie-mess{display:none;}.visible-cookie-warning #pxa-cookie-mess{display: block;}
}
}
[else]
page.headerData.86 {
35 = TEXT
35.value = disableAjaxLoading: false,
}
page.headerData.86 {
35 = TEXT
35.value = disableAjaxLoading: false,
}

[globalVar = LIT:1 = {$plugin.tx_pxacookiebar.settings.disableCookies}]
# disallow JS to SetCookie, should be on top of the page
page.headerData.86 {
40 = TEXT
40 {
value (
# disallow JS to SetCookie, should be on top of the page
page.headerData.86 {
40 = TEXT
40 {
value (
pxaPreventJsFromSettingCookies: function() {
if(!document.__defineGetter__) {
Object.defineProperty(document, 'cookie', {
Expand All @@ -145,33 +151,34 @@ pxaPreventJsFromSettingCookies: function() {
document.__defineSetter__("cookie", function() {} );
}
},
)
}
)
}

50 = TEXT
50.value = isActiveConsent: true,
50 = TEXT
50.value = isActiveConsent: true,

wrap (
wrap (
<script>var PxaCookieWarningHelper = {|};
PxaCookieWarningHelper['cookieIsSet']=PxaCookieWarningHelper.getCookie('pxa_cookie_warning');
if(!PxaCookieWarningHelper['cookieIsSet']) {PxaCookieWarningHelper.pxaPreventJsFromSettingCookies();}
if(!PxaCookieWarningHelper['cookieIsSet'] && PxaCookieWarningHelper['disableAjaxLoading']) {PxaCookieWarningHelper.setDocumentClass("visible-cookie-warning");}
</script>
)
}
)
}
[else]
page.headerData.86 {
50 = TEXT
50.value = isActiveConsent: false,
}
page.headerData.86 {
50 = TEXT
50.value = isActiveConsent: false,
}

[globalVar = LIT:1 = {$plugin.tx_pxacookiebar.settings.useSubDomain}]
page.headerData.86 {
20 {
stdWrap.postUserFunc = Pixelant\PxaCookieBar\Utility\CookieUtility->replaceWithSubDomain
}
}
page.headerData.86 {
20 {
stdWrap.postUserFunc = Pixelant\PxaCookieBar\Utility\CookieUtility->replaceWithSubDomain
}
}
[globalVar = LIT:bottomFix = {$plugin.tx_pxacookiebar.settings.position}]
plugin.tx_pxacookiebar.settings.wrapperClasses = bottom-message-wrap
plugin.tx_pxacookiebar.settings.wrapperClasses = bottom-message-wrap
[else]
plugin.tx_pxacookiebar.settings.wrapperClasses = top-message-wrap
plugin.tx_pxacookiebar.settings.wrapperClasses = top-message-wrap
[global]
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "pixelant/pxa-cookie-bar",
"description": "Text and link for page with cookie.",
"type": "typo3-cms-extension",
"version": "1.0.1",
"license": "GPL-2.0+",
"autoload": {
"psr-4": {
Expand All @@ -14,6 +13,6 @@
"typo3-ter/pxa_cookie_bar": "self.version"
},
"require": {
"typo3/cms": ">=8.0.0 <=8.9.99"
"typo3/cms": ">=6.2.0 <=8.9.99"
}
}

0 comments on commit 4360b19

Please sign in to comment.