PDF rausgenommen
This commit is contained in:
@ -0,0 +1,62 @@
|
||||
/*!
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
(function () {
|
||||
angular.module('piwikApp').controller('OptOutCustomizerController', OptOutCustomizerController);
|
||||
|
||||
OptOutCustomizerController.$inject = ["$scope"];
|
||||
|
||||
function OptOutCustomizerController($scope) {
|
||||
var vm = this;
|
||||
vm.piwikurl = $scope.piwikurl;
|
||||
vm.language = $scope.language;
|
||||
vm.fontSizeUnit = 'px';
|
||||
vm.fontSizeWithUnit = '';
|
||||
vm.backgroundColor = '';
|
||||
vm.fontColor = '';
|
||||
vm.fontSize = '';
|
||||
vm.fontFamily = '';
|
||||
vm.updateFontSize = function () {
|
||||
if (vm.fontSize) {
|
||||
vm.fontSizeWithUnit = vm.fontSize + vm.fontSizeUnit;
|
||||
} else {
|
||||
vm.fontSizeWithUnit = "";
|
||||
}
|
||||
this.onUpdate();
|
||||
};
|
||||
vm.onUpdate = function () {
|
||||
if (vm.piwikurl) {
|
||||
if (vm.backgroundColor === '' && vm.fontColor !== '' && vm.nearlyWhite(vm.fontColor.substr(1))) {
|
||||
$('#previewIframe').addClass('withBg');
|
||||
} else {
|
||||
$('#previewIframe').removeClass('withBg');
|
||||
}
|
||||
var value = vm.piwikurl + "index.php?module=CoreAdminHome&action=optOut&language=" + vm.language + "&backgroundColor=" + vm.backgroundColor.substr(1) + "&fontColor=" + vm.fontColor.substr(1) + "&fontSize=" + vm.fontSizeWithUnit + "&fontFamily=" + encodeURIComponent(vm.fontFamily);
|
||||
var isAnimationAlreadyRunning = $('.optOutCustomizer pre').queue('fx').length > 0;
|
||||
if (value !== vm.iframeUrl && !isAnimationAlreadyRunning) {
|
||||
$('.optOutCustomizer pre').effect("highlight", {}, 1500);
|
||||
}
|
||||
vm.iframeUrl = value;
|
||||
|
||||
} else {
|
||||
vm.iframeUrl = "";
|
||||
};
|
||||
}
|
||||
vm.nearlyWhite = function (hex) {
|
||||
var bigint = parseInt(hex, 16);
|
||||
var r = (bigint >> 16) & 255;
|
||||
var g = (bigint >> 8) & 255;
|
||||
var b = bigint & 255;
|
||||
|
||||
return (r >= 225 && g >= 225 && b >= 225);
|
||||
}
|
||||
vm.onUpdate();
|
||||
|
||||
$scope.$watch('piwikurl', function (val, oldVal) {
|
||||
vm.onUpdate();
|
||||
});
|
||||
}
|
||||
})();
|
@ -0,0 +1,52 @@
|
||||
<div class="optOutCustomizer">
|
||||
<p>
|
||||
{{ 'CoreAdminHome_OptOutExplanation'|translate }}
|
||||
<span ng-bind-html="'General_ReadThisToLearnMore'|translate:'<a rel=\'noreferrer noopener\' target=\'_blank\' href=\'https://matomo.org/faq/how-to/faq_25918/\'>':'</a>'"></span>
|
||||
</p>
|
||||
|
||||
<h3>Customize the Opt-out iframe</h3>
|
||||
<div>
|
||||
<p>
|
||||
<span>
|
||||
Font Color:
|
||||
<input type="color" ng-model="optOutCustomizer.fontColor" ng-change="optOutCustomizer.onUpdate()">
|
||||
</span>
|
||||
|
||||
<span>
|
||||
Background Color:
|
||||
<input type="color" ng-model="optOutCustomizer.backgroundColor" ng-change="optOutCustomizer.onUpdate()">
|
||||
</span>
|
||||
|
||||
<span>
|
||||
Font Size:
|
||||
<input id=FontSizeInput type="number" min="1" max="100" ng-model="optOutCustomizer.fontSize" ng-change="optOutCustomizer.updateFontSize()">
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<select class="browser-default" ng-model="optOutCustomizer.fontSizeUnit" ng-change="optOutCustomizer.updateFontSize()">
|
||||
<option value="px">px</option>
|
||||
<option value="pt">pt</option>
|
||||
<option value="em">em</option>
|
||||
<option value="rem">rem</option>
|
||||
<option value="%">%</option>
|
||||
</select>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
Font Family:
|
||||
<input id=FontFamilyInput type="text" ng-model="optOutCustomizer.fontFamily" ng-change="optOutCustomizer.onUpdate()">
|
||||
</span>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</p>
|
||||
<h3>HTML code to embed on your website</h3>
|
||||
<pre piwik-select-on-focus><iframe
|
||||
style="border: 0; height: 200px; width: 600px;"
|
||||
src="{{ optOutCustomizer.iframeUrl }}"
|
||||
></iframe></pre>
|
||||
<p ng-bind-html="'CoreAdminHome_OptOutExplanationIntro'|translate:'<a href=\'' + optOutCustomizer.iframeUrl + '\' rel=\'noreferrer noopener\' target=\'_blank\'>':'</a>'">
|
||||
</p>
|
||||
<h3>Preview of the Opt-out as it will appear on your website</h3>
|
||||
<iframe id="previewIframe" ng-src="{{ optOutCustomizer.iframeUrl }}" style="border: 1px solid #333; height: 200px; width: 600px;" />
|
||||
</div>
|
@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* <div piwik-opt-out-customizer>
|
||||
*/
|
||||
(function () {
|
||||
angular.module('piwikApp').directive('piwikOptOutCustomizer', piwikOptOutCustomizer);
|
||||
|
||||
piwikOptOutCustomizer.$inject = ['piwik'];
|
||||
|
||||
function piwikOptOutCustomizer(piwik){
|
||||
var defaults = {
|
||||
// showAllSitesItem: 'true'
|
||||
};
|
||||
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
language: '@',
|
||||
piwikurl: '@'
|
||||
},
|
||||
templateUrl: 'plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html?cb=' + piwik.cacheBuster,
|
||||
controller: 'OptOutCustomizerController',
|
||||
controllerAs: 'optOutCustomizer',
|
||||
compile: function (element, attrs) {
|
||||
|
||||
for (var index in defaults) {
|
||||
if (defaults.hasOwnProperty(index) && attrs[index] === undefined) {
|
||||
attrs[index] = defaults[index];
|
||||
}
|
||||
}
|
||||
|
||||
return function (scope, element, attrs) {
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
})();
|
@ -0,0 +1,30 @@
|
||||
.optOutCustomizer {
|
||||
|
||||
#FontSizeInput {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#FontFamilyInput {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
input, select{
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
select{
|
||||
width:60px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
p span{
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
iframe{
|
||||
width: 100%;
|
||||
&.withBg{
|
||||
background-color: #4d4d4d;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user