update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
function sendGeneralSettingsAJAX() {
|
||||
var enableBrowserTriggerArchiving = $('input[name=enableBrowserTriggerArchiving]:checked').val();
|
||||
var enablePluginUpdateCommunication = $('input[name=enablePluginUpdateCommunication]:checked').val();
|
||||
var enableBetaReleaseCheck = $('input[name=enableBetaReleaseCheck]:checked').val();
|
||||
var releaseChannel = $('input[name=releaseChannel]:checked').val();
|
||||
var todayArchiveTimeToLive = $('#todayArchiveTimeToLive').val();
|
||||
|
||||
var trustedHosts = [];
|
||||
|
|
@ -22,7 +22,7 @@ function sendGeneralSettingsAJAX() {
|
|||
format: 'json',
|
||||
enableBrowserTriggerArchiving: enableBrowserTriggerArchiving,
|
||||
enablePluginUpdateCommunication: enablePluginUpdateCommunication,
|
||||
enableBetaReleaseCheck: enableBetaReleaseCheck,
|
||||
releaseChannel: releaseChannel,
|
||||
todayArchiveTimeToLive: todayArchiveTimeToLive,
|
||||
mailUseSmtp: isSmtpEnabled(),
|
||||
mailPort: $('#mailPort').val(),
|
||||
|
|
@ -55,10 +55,14 @@ function isCustomLogoEnabled() {
|
|||
}
|
||||
|
||||
function refreshCustomLogo() {
|
||||
var imageDiv = $("#currentLogo");
|
||||
if (imageDiv && imageDiv.attr("src")) {
|
||||
var logoUrl = imageDiv.attr("src").split("?")[0];
|
||||
imageDiv.attr("src", logoUrl + "?" + (new Date()).getTime());
|
||||
var selectors = ['#currentLogo', '#currentFavicon'];
|
||||
var index;
|
||||
for (index = 0; index < selectors.length; index++) {
|
||||
var imageDiv = $(selectors[index]);
|
||||
if (imageDiv && imageDiv.attr("src")) {
|
||||
var logoUrl = imageDiv.attr("src").split("?")[0];
|
||||
imageDiv.attr("src", logoUrl + "?" + (new Date()).getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +71,7 @@ $(document).ready(function () {
|
|||
|
||||
showSmtpSettings(isSmtpEnabled());
|
||||
showCustomLogoSettings(isCustomLogoEnabled());
|
||||
$('#generalSettingsSubmit').click(function () {
|
||||
$('.generalSettingsSubmit').click(function () {
|
||||
var doSubmit = function () {
|
||||
sendGeneralSettingsAJAX();
|
||||
};
|
||||
|
|
@ -102,27 +106,41 @@ $(document).ready(function () {
|
|||
$('input').keypress(function (e) {
|
||||
var key = e.keyCode || e.which;
|
||||
if (key == 13) {
|
||||
$('#generalSettingsSubmit').click();
|
||||
$('.generalSettingsSubmit').click();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#logoUploadForm").submit(function (data) {
|
||||
var submittingForm = $(this);
|
||||
$('.uploaderror').fadeOut();
|
||||
var frameName = "upload" + (new Date()).getTime();
|
||||
var uploadFrame = $("<iframe name=\"" + frameName + "\" />");
|
||||
uploadFrame.css("display", "none");
|
||||
uploadFrame.load(function (data) {
|
||||
setTimeout(function () {
|
||||
refreshCustomLogo();
|
||||
uploadFrame.remove();
|
||||
|
||||
var frameContent = $(uploadFrame.contents()).find('body').html();
|
||||
frameContent = $.trim(frameContent);
|
||||
|
||||
if ('0' === frameContent) {
|
||||
$('.uploaderror').show();
|
||||
}
|
||||
|
||||
if ('1' === frameContent || '0' === frameContent) {
|
||||
uploadFrame.remove();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
$("body:first").append(uploadFrame);
|
||||
submittingForm.attr("target", frameName);
|
||||
});
|
||||
|
||||
$('#customLogo').change(function () {$("#logoUploadForm").submit()});
|
||||
$('#customLogo,#customFavicon').change(function () {
|
||||
$("#logoUploadForm").submit();
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
// trusted hosts event handling
|
||||
var trustedHostSettings = $('#trustedHostSettings');
|
||||
|
|
@ -136,7 +154,8 @@ $(document).ready(function () {
|
|||
|
||||
// append new row to the table
|
||||
trustedHostSettings.find('ul').append(trustedHostSettings.find('li:last').clone());
|
||||
trustedHostSettings.find('li:last input').val('');
|
||||
trustedHostSettings.find('li:last input').val('').focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
/**
|
||||
* This class is deprecated. Use server-side events instead.
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
var TrackingCodeGenerator = function () {
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
|
||||
// function that generates JS code
|
||||
var generateJsCodeAjax = null,
|
||||
generateJsCode = function () {
|
||||
generateJsCode = function (trackingCodeChangedManually) {
|
||||
// get params used to generate JS code
|
||||
var params = {
|
||||
piwikUrl: piwikHost + piwikPath,
|
||||
|
|
@ -162,6 +162,7 @@
|
|||
customCampaignNameQueryParam: null,
|
||||
customCampaignKeywordParam: null,
|
||||
doNotTrack: $('#javascript-tracking-do-not-track').is(':checked') ? 1 : 0,
|
||||
disableCookies: $('#javascript-tracking-disable-cookies').is(':checked') ? 1 : 0
|
||||
};
|
||||
|
||||
if ($('#custom-campaign-query-params-check').is(':checked')) {
|
||||
|
|
@ -184,24 +185,30 @@
|
|||
generateJsCodeAjax.setCallback(function (response) {
|
||||
generateJsCodeAjax = null;
|
||||
|
||||
$('#javascript-text').find('textarea').val(response.value);
|
||||
var jsCodeTextarea = $('#javascript-text').find('textarea');
|
||||
jsCodeTextarea.val(response.value);
|
||||
|
||||
if(trackingCodeChangedManually) {
|
||||
jsCodeTextarea.effect("highlight", {}, 1500);
|
||||
}
|
||||
|
||||
});
|
||||
generateJsCodeAjax.send();
|
||||
};
|
||||
|
||||
// function that generates image tracker link
|
||||
var generateImageTrackingAjax = null,
|
||||
generateImageTrackerLink = function () {
|
||||
generateImageTrackerLink = function (trackingCodeChangedManually) {
|
||||
// get data used to generate the link
|
||||
var generateDataParams = {
|
||||
piwikUrl: piwikHost + piwikPath,
|
||||
actionName: $('#image-tracker-action-name').val(),
|
||||
actionName: $('#image-tracker-action-name').val()
|
||||
};
|
||||
|
||||
if ($('#image-tracking-goal-check').is(':checked')) {
|
||||
generateDataParams.idGoal = $('#image-tracker-goal').val();
|
||||
if (generateDataParams.idGoal) {
|
||||
generateDataParams.revenue = $('#image-tracker-advanced-options').find('.revenue').val();
|
||||
generateDataParams.revenue = $('#image-goal-picker-extra').find('.revenue').val();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +227,12 @@
|
|||
generateImageTrackingAjax.setCallback(function (response) {
|
||||
generateImageTrackingAjax = null;
|
||||
|
||||
$('#image-tracking-text').find('textarea').val(response.value);
|
||||
var jsCodeTextarea = $('#image-tracking-text').find('textarea');
|
||||
jsCodeTextarea.val(response.value);
|
||||
|
||||
if(trackingCodeChangedManually) {
|
||||
jsCodeTextarea.effect("highlight", {}, 1500);
|
||||
}
|
||||
});
|
||||
generateImageTrackingAjax.send();
|
||||
};
|
||||
|
|
@ -229,7 +241,7 @@
|
|||
$('#image-tracker-website').bind('change', function (e, site) {
|
||||
getSiteData(site.id, '#image-tracking-code-options', function () {
|
||||
resetGoalSelectItems(site.id, 'image-tracker-goal');
|
||||
generateImageTrackerLink();
|
||||
generateImageTrackerLink(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -249,7 +261,7 @@
|
|||
$('.current-site-alias').text(siteUrls[site.id][1] || defaultAliasUrl);
|
||||
|
||||
resetGoalSelectItems(site.id, 'js-tracker-goal');
|
||||
generateJsCode();
|
||||
generateJsCode(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -259,9 +271,7 @@
|
|||
e.preventDefault();
|
||||
|
||||
var newRow = '<tr>\
|
||||
<td> </td>\
|
||||
<td><input type="textbox" class="custom-variable-name"/></td>\
|
||||
<td> </td>\
|
||||
<td><input type="textbox" class="custom-variable-value"/></td>\
|
||||
</tr>',
|
||||
row = $(this).closest('tr');
|
||||
|
|
@ -279,20 +289,20 @@
|
|||
|
||||
// when any input in the JS tracking options section changes, regenerate JS code
|
||||
$('#optional-js-tracking-options').on('change', 'input', function () {
|
||||
generateJsCode();
|
||||
generateJsCode(true);
|
||||
});
|
||||
|
||||
// when any input/select in the image tracking options section changes, regenerate
|
||||
// image tracker link
|
||||
$('#image-tracking-section').on('change', 'input,select', function () {
|
||||
generateImageTrackerLink();
|
||||
generateImageTrackerLink(true);
|
||||
});
|
||||
|
||||
// on click generated code textareas, select the text so it can be easily copied
|
||||
$('#javascript-text>textarea,#image-tracking-text>textarea').click(function () {
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
|
||||
// initial generation
|
||||
getSiteData(
|
||||
$('#js-tracker-website').attr('siteid'),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -17,6 +17,8 @@ $(document).ready(function () {
|
|||
|
||||
function updatePluginSettings()
|
||||
{
|
||||
$submit.prop('disabled', true);
|
||||
|
||||
var $nonce = $('[name="setpluginsettingsnonce"]');
|
||||
var nonceValue = '';
|
||||
|
||||
|
|
@ -34,7 +36,10 @@ $(document).ready(function () {
|
|||
ajaxHandler.redirectOnSuccess();
|
||||
ajaxHandler.setLoadingElement(getLoadingElement());
|
||||
ajaxHandler.setErrorElement(getErrorElement());
|
||||
ajaxHandler.send(true);
|
||||
ajaxHandler.setCompleteCallback(function () {
|
||||
$submit.prop('disabled', false);
|
||||
});
|
||||
ajaxHandler.send();
|
||||
}
|
||||
|
||||
function getSettings()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
/*!
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
if (!piwik || !location.protocol) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!piwik.hasSuperUserAccess) {
|
||||
// we show a potential notification only to super users
|
||||
return;
|
||||
}
|
||||
|
||||
if (piwik.hasServerDetectedHttps) {
|
||||
// https was detected, not needed to show a message
|
||||
return;
|
||||
}
|
||||
|
||||
var isHttpsUsed = 0 === location.protocol.indexOf('https');
|
||||
|
||||
if (!isHttpsUsed) {
|
||||
// not using https anyway, we do not show a message
|
||||
return;
|
||||
}
|
||||
|
||||
var params = [
|
||||
'"config/config.ini.php"',
|
||||
'"assume_secure_protocol=1"',
|
||||
'"[General]"',
|
||||
'<a href="?module=Proxy&action=redirect&url=https://piwik.org/faq/how-to-install/faq_98/" target="_blank">',
|
||||
'</a>'
|
||||
];
|
||||
var message = _pk_translate('CoreAdminHome_ProtocolNotDetectedCorrectly') + " " + _pk_translate('CoreAdminHome_ProtocolNotDetectedCorrectlySolution', params);
|
||||
|
||||
var UI = require('piwik/UI');
|
||||
var notification = new UI.Notification();
|
||||
notification.show(message, {context: 'warning'});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue