aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
authorValerio Virgillito2012-03-14 11:47:06 -0700
committerValerio Virgillito2012-03-14 11:47:06 -0700
commite07ec7dd1a4b8df747f6af0d54fe95e3a237f0c8 (patch)
tree376f07eccb2de93b8a2c1c825e6e74346f7e4794 /js/controllers/elements
parent7a481168f1dd52069023cc0c8766f8078fe20089 (diff)
downloadninja-e07ec7dd1a4b8df747f6af0d54fe95e3a237f0c8.tar.gz
Removing the name attribute from the PI. Fixing the ID and Class attribute from the PI
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/element-controller.js17
1 files changed, 0 insertions, 17 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 9f00604f..70aba54e 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -51,23 +51,6 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
51 51
52 setAttribute: { 52 setAttribute: {
53 value: function(el, att, value) { 53 value: function(el, att, value) {
54 if(att === "id") {
55 if(value === "") {
56 el.setAttribute(att, value);
57 return;
58 }
59
60 // Then check if this is a valid id by the following spec: http://www.w3.org/TR/REC-html40/types.html#h-6.2
61 var regexID = /^([a-zA-Z])+([a-zA-Z0-9_\.\:\-])+/;
62 if(!regexID.test(value)) {
63 alert("Invalid ID");
64 return;
65 } else if (this.application.ninja.currentDocument._document.getElementById(value) !== null) {
66 alert("The following ID: " + value + " is already in Use");
67 }
68
69 }
70
71 el.setAttribute(att, value); 54 el.setAttribute(att, value);
72 } 55 }
73 }, 56 },