Placeholder emulation added in IE
So optional fieleds are marked in IE now Change-Id: Ibaff1fd6b1e60ff7431f1eb763e449070b94247e
This commit is contained in:
parent
8f9e39d289
commit
48f145a048
|
@ -89,6 +89,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
validators:
|
validators:
|
||||||
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
||||||
- expr: {YAQL: $.serviceConfiguration.dcInstances < 2 or not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
|
- expr: {YAQL: $.serviceConfiguration.dcInstances < 2 or not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
|
||||||
|
|
|
@ -71,6 +71,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
- instanceConfiguration:
|
- instanceConfiguration:
|
||||||
fields:
|
fields:
|
||||||
- name: title
|
- name: title
|
||||||
|
|
|
@ -92,6 +92,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
validators:
|
validators:
|
||||||
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
||||||
- expr: {YAQL: not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
|
- expr: {YAQL: not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
|
||||||
|
|
|
@ -152,6 +152,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
validators:
|
validators:
|
||||||
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
||||||
- expr: {YAQL: not $.clusterConfiguration.unitNamingPattern.bool() or '#' in $.clusterConfiguration.unitNamingPattern}
|
- expr: {YAQL: not $.clusterConfiguration.unitNamingPattern.bool() or '#' in $.clusterConfiguration.unitNamingPattern}
|
||||||
|
|
|
@ -81,6 +81,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
- instanceConfiguration:
|
- instanceConfiguration:
|
||||||
fields:
|
fields:
|
||||||
- name: title
|
- name: title
|
||||||
|
|
|
@ -62,6 +62,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
- instanceConfiguration:
|
- instanceConfiguration:
|
||||||
fields:
|
fields:
|
||||||
- name: title
|
- name: title
|
||||||
|
|
|
@ -79,6 +79,10 @@ forms:
|
||||||
required: false
|
required: false
|
||||||
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
|
||||||
helpText: Optional field for a machine hostname template
|
helpText: Optional field for a machine hostname template
|
||||||
|
# temporaryHack
|
||||||
|
widgetMedia:
|
||||||
|
js: [muranodashboard/js/support_placeholder.js]
|
||||||
|
css: {all: [muranodashboard/css/support_placeholder.css]}
|
||||||
validators:
|
validators:
|
||||||
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
|
||||||
- expr: {YAQL: not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
|
- expr: {YAQL: not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
.placeholder {
|
||||||
|
color: #999999;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/* Copyright (c) 2013 Mirantis, Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
not use this file except in compliance with the License. You may obtain
|
||||||
|
a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
*/
|
||||||
|
$(function() {
|
||||||
|
var get_IE_version = function() {
|
||||||
|
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
|
||||||
|
var IE_version = new Number(RegExp.$1) // capture x.x portion and store as a number
|
||||||
|
return IE_version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (get_IE_version() < 10) {
|
||||||
|
$('[placeholder]').focus(function() {
|
||||||
|
var input = $(this);
|
||||||
|
if (input.val() == input.attr('placeholder')) {
|
||||||
|
input.val('');
|
||||||
|
input.removeClass('placeholder');
|
||||||
|
}
|
||||||
|
}).blur(function() {
|
||||||
|
var input = $(this);
|
||||||
|
if (input.val() == '' || input.val() == input.attr('placeholder')) {
|
||||||
|
input.addClass('placeholder');
|
||||||
|
input.val(input.attr('placeholder'));
|
||||||
|
}
|
||||||
|
}).blur();
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue