diff options
Diffstat (limited to 'plugins')
-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 |
6 files changed, 90 insertions, 60 deletions
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."> |