cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [2/2] git commit: updated refs/heads/4.2 to c1102fc
Date Tue, 23 Jul 2013 22:13:27 GMT
Add disallowSpecialCharacters to some fields


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c1102fcc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c1102fcc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c1102fcc

Branch: refs/heads/4.2
Commit: c1102fcc797f32cdfd9ce1054837f2f283c1ef1e
Parents: fcf111d
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Jul 23 14:22:54 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Jul 23 15:13:19 2013 -0700

----------------------------------------------------------------------
 client/WEB-INF/classes/resources/messages.properties | 1 +
 ui/dictionary.jsp                                    | 1 +
 ui/index.jsp                                         | 6 +++---
 ui/scripts/ui-custom/zoneWizard.js                   | 2 +-
 ui/scripts/ui/widgets/detailView.js                  | 4 ++--
 ui/scripts/ui/widgets/listView.js                    | 5 +++++
 ui/scripts/ui/widgets/multiEdit.js                   | 4 +++-
 7 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 367459b..e03647d 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -22,6 +22,7 @@ label.disk.iops.min=Min IOPS
 label.disk.iops.max=Max IOPS
 label.disk.iops.total=IOPS Total
 label.view.secondary.ips=View secondary IPs
+message.validate.invalid.characters=Invalid characters found; please correct.
 message.acquire.ip.nic=Please confirm that you would like to acquire a new secondary IP for
this NIC.<br/>NOTE: You need to manually configure the newly-acquired secondary IP inside
the virtual machine.
 message.select.affinity.groups=Please select any affinity groups you want this VM to belong
to:
 message.no.affinity.groups=You do not have any affinity groups. Please continue to the next
step.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 748cc7d..b048a67 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -25,6 +25,7 @@ under the License.
 <% long now = System.currentTimeMillis(); %>
 <script language="javascript">
 dictionary = {
+'message.validate.invalid.characters': '<fmt:message key="message.validate.invalid.characters"
/>',
 'label.about': '<fmt:message key="label.about" />',
 'label.about.app': '<fmt:message key="label.about.app" />',
 'label.app.name': '<fmt:message key="label.app.name" />',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index 34f0c54..af5fa37 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -298,7 +298,7 @@ under the License.
                                 <div class="field name hide-if-unselected">
                                   <div class="name"> <span class="field-required">*</span>
<fmt:message key="label.name"/></div>
                                   <div class="value">
-                                    <input type="text" class="required" name="new-network-name"
/>
+                                      <input type="text" class="required disallowSpecialCharacters"
name="new-network-name" />
                                   </div>
                                 </div>
 
@@ -348,7 +348,7 @@ under the License.
                       <span><fmt:message key="label.name"/> (<fmt:message
key="label.optional"/>)</span>
                     </div>
                     <div class="value">
-                      <input type="text" name="displayname" />
+                      <input type="text" name="displayname" class="disallowSpecialCharacters"
/>
                     </div>
                   </div>
                   <!-- Add to group -->
@@ -357,7 +357,7 @@ under the License.
                       <span><fmt:message key="label.add.to.group"/> (<fmt:message
key="label.optional"/>)</span>
                     </div>
                     <div class="value">
-                      <input type="text" name="groupname" />
+                      <input type="text" name="groupname" class="disallowSpecialCharacters"
/>
                     </div>
                   </div>
                   <!-- Zone -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index bba6c04..8af873e 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -588,7 +588,7 @@
                 $('<div>').addClass('value').append(
                     $('<input>').attr({
                         type: 'text'
-                    }).addClass('required')
+                    }).addClass('required disallowSpecialCharacters')
                 )
             );
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 69585ed..92dfe37 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -588,7 +588,7 @@
                             type: 'text',
                             value: data
                         })
-                        .data('original-value', data)
+                        .addClass('disallowSpecialCharacters').data('original-value', data)
                     );
 
                     // Make option values from given array
@@ -617,7 +617,7 @@
                             name: name,
                             type: 'text',
                             value: data
-                        }).data('original-value', data)
+                        }).addClass('disallowSpecialCharacters').data('original-value', data)
                     );
                 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index 4fd0b7f..ddc275e 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -529,6 +529,11 @@
             if (!$editInput.is(':visible') || !(typeof(args.action) == 'undefined')) { //click
Edit button
                 showEditField();
             } else if ($editInput.val() != $label.html()) { //click Save button with changed
value
+                if ($editInput.val().match(/<|>/)) {
+                    cloudStack.dialog.notice({ message: 'message.validate.invalid.characters'
}); 
+                    return false;
+                }
+                
                 $edit.animate({
                     opacity: 0.5
                 });

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c1102fcc/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index a09b0a1..83d1e52 100755
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -918,6 +918,7 @@
 
                     $(field.range).each(function() { //e.g. field.range = ['privateport',
'privateendport'];
                         var $input = $('<input>')
+                            .addClass('disallowSpecialCharacters')
                             .attr({
                                 name: this,
                                 type: 'text'
@@ -941,7 +942,8 @@
                             name: fieldName,
                             type: field.isPassword ? 'password' : 'text'
                         })
-                        .addClass(!field.isOptional ? 'required' : null)
+                            .addClass(!field.isOptional ? 'required' : null)
+                            .addClass('disallowSpecialCharacters')
                         .attr('disabled', field.isDisabled ? 'disabled' : false)
                         .appendTo($td);
 


Mime
View raw message