diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-05-16 23:37:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 23:37:17 +0300 |
commit | a54f62f55e500644372fa342738483a6fd3dfaa3 (patch) | |
tree | 5afe9ff6ee31d0142ddcb5e5ca8d86bd42573684 | |
parent | 724119543029ba7af449d06be5b2c8f448346f70 (diff) | |
parent | 8139c3b30fef0fb17162133abdbe13952e21cd2f (diff) |
Merge pull request #11711 from piwik/3.x-dev3.0.4-rc2
Release Piwik 3.0.4-rc2
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | core/Settings/FieldConfig.php | 10 | ||||
-rw-r--r-- | core/Version.php | 2 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 131 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_dataTableCell.twig | 2 | ||||
-rw-r--r-- | plugins/CorePluginsAdmin/angularjs/form-field/form-field.directive.js | 2 | ||||
-rw-r--r-- | plugins/Login/templates/login.twig | 5 | ||||
m--------- | plugins/Morpheus/icons | 0 | ||||
-rw-r--r-- | plugins/Morpheus/templates/demo.twig | 10 | ||||
-rw-r--r-- | tests/UI/expected-screenshots/Morpheus_load.png | 4 |
10 files changed, 104 insertions, 63 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ce9011186d..3d53f51515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The Product Changelog at **[piwik.org/changelog](http://piwik.org/changelog)** l * A new JavaScript tracker method `getCurrentUrl` has been added to retrieve the current URL of the website. * A new JavaScript tracker method `getNumTrackedPageViews` has been added to retrieve the number of tracked page views within the currently loaded page or web application. * New JavaScript tracker methods `setSessionCookie`, `getCookie`, `hasCookies`, `getCookieDomain`, `getCookiePath`, and `getSessionCookieTimeout` have been added for better cookie support in plugins. +* `email` and `url` form fields can now be used in settings. ## Piwik 3.0.3 diff --git a/core/Settings/FieldConfig.php b/core/Settings/FieldConfig.php index ef8a6155e2..7b2ce1df03 100644 --- a/core/Settings/FieldConfig.php +++ b/core/Settings/FieldConfig.php @@ -27,6 +27,16 @@ class FieldConfig const UI_CONTROL_TEXT = 'text'; /** + * Shows an email text field. To use this field assign it to the `$uiControl` property. + */ + const UI_CONTROL_EMAIL = 'email'; + + /** + * Shows a URL text field. To use this field assign it to the `$uiControl` property. + */ + const UI_CONTROL_URL = 'url'; + + /** * Shows a text area. To use this field assign it to the `$uiControl` property. */ const UI_CONTROL_TEXTAREA = 'textarea'; diff --git a/core/Version.php b/core/Version.php index e424ffe26c..43a1226b8b 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '3.0.4-rc1'; + const VERSION = '3.0.4-rc2'; public function isStableVersion($version) { diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 433d5b52cc..408c45692f 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -1569,57 +1569,55 @@ $.extend(DataTable.prototype, UIControl.prototype, { var self = this; // higlight all columns on hover - $('td', domElem).hover( - function() { - - if ($(this).hasClass('label')) { - return; - } + $('td', domElem).hover(function() { + var $this = $(this); + if ($this.hasClass('label')) { + return; + } - var table = $(this).closest('table'); - var nthChild = $(this).parent('tr').children().index($(this)) + 1; - var rows = $('> tbody > tr', table); + var table = $this.closest('table'); + var nthChild = $this.parent('tr').children().index($(this)) + 1; + var rows = $('> tbody > tr', table); - if (!maxWidth[nthChild]) { - maxWidth[nthChild] = 0; - rows.find("td:nth-child(" + (nthChild) + ").column .value").each(function (index, element) { - var width = $(element).width(); - if (width > maxWidth[nthChild]) { - maxWidth[nthChild] = width; - } - }); - rows.find("td:nth-child(" + (nthChild) + ").column .value").each(function (index, element) { - $(element).css({width: maxWidth[nthChild], display: 'inline-block'}); - }); - } - - if (currentNthChild === nthChild) { - return; - } + if (!maxWidth[nthChild]) { + maxWidth[nthChild] = 0; + rows.find("td:nth-child(" + (nthChild) + ").column .value").each(function (index, element) { + var width = $(element).width(); + if (width > maxWidth[nthChild]) { + maxWidth[nthChild] = width; + } + }); + rows.find("td:nth-child(" + (nthChild) + ").column .value").each(function (index, element) { + $(element).css({width: maxWidth[nthChild], display: 'inline-block'}); + }); + } - currentNthChild = nthChild; + if (currentNthChild === nthChild) { + return; + } - rows.children("td:nth-child(" + (nthChild) + ")").addClass('highlight'); - self.repositionRowActions($(this).parent('tr')); - }, - function(event) { + currentNthChild = nthChild; - var table = $(this).closest('table'); - var tr = $(this).parent('tr').children(); - var nthChild = $(this).parent('tr').children().index($(this)); - var targetTd = $(event.relatedTarget).closest('td'); - var nthChildTarget = targetTd.parent('tr').children().index(targetTd); + rows.children("td:nth-child(" + (nthChild) + ")").addClass('highlight'); + self.repositionRowActions($this.parent('tr')); + }, function(event) { + var $this = $(this); + var table = $this.closest('table'); + var $parentTr = $this.parent('tr'); + var tr = $parentTr.children(); + var nthChild = $parentTr.children().index($this); + var targetTd = $(event.relatedTarget).closest('td'); + var nthChildTarget = targetTd.parent('tr').children().index(targetTd); - if (nthChild == nthChildTarget) { - return; - } + if (nthChild == nthChildTarget) { + return; + } - currentNthChild = null; + currentNthChild = null; - var rows = $('tr', table); - rows.find("td:nth-child(" + (nthChild + 1) + ")").removeClass('highlight'); - } - ); + var rows = $('tr', table); + rows.find("td:nth-child(" + (nthChild + 1) + ")").removeClass('highlight'); + }); }, //behaviour for 'nested DataTable' (DataTable loaded on a click on a row) @@ -1918,23 +1916,44 @@ $.extend(DataTable.prototype, UIControl.prototype, { // show actions that are available for the row on hover var actionsDom = null; - tr.hover(function () { - if (actionsDom === null) { - // create dom nodes on the fly - actionsDom = self.createRowActions(availableActionsForReport, tr, actionInstances); - td.prepend(actionsDom); - } - // reposition and show the actions - self.repositionRowActions(tr); - if ($(window).width() >= 600) { - actionsDom.show(); - } - }, - function () { + var useTouchEvent = false; + var listenEvent = 'mouseenter'; + var userAgent = String(navigator.userAgent).toLowerCase(); + if (userAgent.match(/(iPod|iPhone|iPad|Android|IEMobile|Windows Phone)/i)) { + useTouchEvent = true; + listenEvent = 'click'; + } + + tr.on(listenEvent, function () { + if (useTouchEvent && actionsDom && actionsDom.prop('rowActionsVisible')) { + actionsDom.prop('rowActionsVisible', false); + actionsDom.hide(); + return; + } + + if (actionsDom === null) { + // create dom nodes on the fly + actionsDom = self.createRowActions(availableActionsForReport, tr, actionInstances); + td.prepend(actionsDom); + } + + // reposition and show the actions + self.repositionRowActions(tr); + if ($(window).width() >= 600 || useTouchEvent) { + actionsDom.show(); + } + + if (useTouchEvent) { + actionsDom.prop('rowActionsVisible', true); + } + }); + if (!useTouchEvent) { + tr.on('mouseleave', function () { if (actionsDom !== null) { actionsDom.hide(); } }); + } }); }, diff --git a/plugins/CoreHome/templates/_dataTableCell.twig b/plugins/CoreHome/templates/_dataTableCell.twig index 2db3545136..3b771e596c 100644 --- a/plugins/CoreHome/templates/_dataTableCell.twig +++ b/plugins/CoreHome/templates/_dataTableCell.twig @@ -46,7 +46,7 @@ {{ piwik.logoHtml(row.getMetadata(), row.getColumn('label')) }} {% if row.getMetadata('html_label_prefix') %}<span class='label-prefix'>{{ row.getMetadata('html_label_prefix') | raw }} </span>{% endif -%} {% endif %}<span class="value"> - {%- if row.getColumn(column) or (column=='label' and row.getColumn(column) is same as("0")) %}{% if column=='label' %}{{- row.getColumn(column)|rawSafeDecoded -}}{% else %}{% if row.getMetadata('html_column_' ~ column ~ '_prefix') %}<span class='column-prefix'>{{ row.getMetadata('html_column_' ~ column ~ '_prefix') | raw }} </span>{% endif -%}{{- row.getColumn(column)|number(2,0)|rawSafeDecoded -}}{% endif %} + {%- if row.getColumn(column) or (column=='label' and row.getColumn(column) is same as("0")) %}{% if column=='label' %}{{- row.getColumn(column)|rawSafeDecoded -}}{% else %}{% if row.getMetadata('html_column_' ~ column ~ '_prefix') %}<span class='column-prefix'>{{ row.getMetadata('html_column_' ~ column ~ '_prefix') | raw }}</span>{% endif -%}{{- row.getColumn(column)|number(2,0)|rawSafeDecoded -}}{% if row.getMetadata('html_column_' ~ column ~ '_suffix') %}<span class='column-suffix'>{{ row.getMetadata('html_column_' ~ column ~ '_suffix') | raw }}</span>{% endif -%}{% endif %} {%- else -%}- {%- endif -%}</span> {% if column=='label' %}{%- if row.getMetadata('html_label_suffix') %}<span class='label-suffix'>{{ row.getMetadata('html_label_suffix') | raw }}</span>{% endif -%}</span>{% endif %} diff --git a/plugins/CorePluginsAdmin/angularjs/form-field/form-field.directive.js b/plugins/CorePluginsAdmin/angularjs/form-field/form-field.directive.js index 821404e9e2..30d73fee7c 100644 --- a/plugins/CorePluginsAdmin/angularjs/form-field/form-field.directive.js +++ b/plugins/CorePluginsAdmin/angularjs/form-field/form-field.directive.js @@ -148,7 +148,7 @@ function getTemplate(field) { var control = field.uiControl; - if (control === 'password') { + if (control === 'password' || control === 'url' || control === 'search' || control === 'email') { control = 'text'; // we use same template for text and password both } diff --git a/plugins/Login/templates/login.twig b/plugins/Login/templates/login.twig index b8c2ae7693..45e406ea1c 100644 --- a/plugins/Login/templates/login.twig +++ b/plugins/Login/templates/login.twig @@ -78,6 +78,7 @@ <div class="row"> <div class="col s12 input-field"> <input type="text" name="form_login" placeholder="" id="login_form_login" class="input" value="" size="20" + autocorrect="off" autocapitalize="none" tabindex="10" autofocus="autofocus"/> <label for="login_form_login"><i class="icon-user icon"></i> {{ 'General_Username'|translate }}</label> </div> @@ -87,6 +88,7 @@ <div class="col s12 input-field"> <input type="hidden" name="form_nonce" id="login_form_nonce" value="{{ nonce }}"/> <input type="password" placeholder="" name="form_password" id="login_form_password" class="input" value="" size="20" + autocorrect="off" autocapitalize="none" tabindex="20" /> <label for="login_form_password"><i class="icon-locked icon"></i> {{ 'General_Password'|translate }}</label> </div> @@ -131,6 +133,7 @@ <div class="col s12 input-field"> <input type="hidden" name="form_nonce" id="reset_form_nonce" value="{{ nonce }}"/> <input type="text" placeholder="" name="form_login" id="reset_form_login" class="input" value="" size="20" + autocorrect="off" autocapitalize="none" tabindex="10"/> <label for="reset_form_login">{{ 'Login_LoginOrEmail'|translate }}</label> </div> @@ -138,6 +141,7 @@ <div class="row"> <div class="col s12 input-field"> <input type="password" placeholder="" name="form_password" id="reset_form_password" class="input" value="" size="20" + autocorrect="off" autocapitalize="none" tabindex="20" autocomplete="off"/> <label for="reset_form_password">{{ 'Login_NewPassword'|translate }}</label> </div> @@ -145,6 +149,7 @@ <div class="row"> <div class="col s12 input-field"> <input type="password" placeholder="" name="form_password_bis" id="reset_form_password_bis" class="input" value="" + autocorrect="off" autocapitalize="none" size="20" tabindex="30" autocomplete="off"/> <label for="reset_form_password_bis">{{ 'Login_NewPasswordRepeat'|translate }}</label> </div> diff --git a/plugins/Morpheus/icons b/plugins/Morpheus/icons -Subproject a4a79c96561af63c626285673a464d59eeaea4f +Subproject 9d8522f98a2c9c5de4f7c267f0ca0618b185a87 diff --git a/plugins/Morpheus/templates/demo.twig b/plugins/Morpheus/templates/demo.twig index e1bb02ee60..84d6a2fec4 100644 --- a/plugins/Morpheus/templates/demo.twig +++ b/plugins/Morpheus/templates/demo.twig @@ -274,7 +274,7 @@ placeholder="Some text here"> </div> - <div piwik-field uicontrol="text" name="email" + <div piwik-field uicontrol="email" name="email" title="Email" inline-help="This is the inline help which provides more information."> </div> @@ -314,6 +314,9 @@ placeholder="Some text here..."> </div> + <div piwik-field uicontrol="url" name="urlText" title="URL" inline-help="URL field"> + </div> + <div piwik-field uicontrol="textarea" name="description" title="Description" inline-help="This is a textarea. It automatically gets larger the more text is entered."> @@ -375,7 +378,7 @@ placeholder="Some text here"> </div> - <div piwik-field uicontrol="text" name="email" + <div piwik-field uicontrol="email" name="email" title="Email" inline-help="This is the inline help which provides more information."> </div> @@ -415,6 +418,9 @@ placeholder="Some text here..."> </div> + <div piwik-field uicontrol="url" name="urlText" title="URL" inline-help="URL field"> + </div> + <div piwik-field uicontrol="textarea" name="description" title="Description" inline-help="This is a textarea. It automatically gets larger the more text is entered."> diff --git a/tests/UI/expected-screenshots/Morpheus_load.png b/tests/UI/expected-screenshots/Morpheus_load.png index b124217687..aa8dde7314 100644 --- a/tests/UI/expected-screenshots/Morpheus_load.png +++ b/tests/UI/expected-screenshots/Morpheus_load.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:73c4779f2af6eef0ddc37badcb41bf484d9e3fb056acacbbb78317d23759116f -size 1186022 +oid sha256:b22962c13f73dafd96f26d588529445ec295c3b37010b24fe81e4b7c860969c9 +size 1196468 |