Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/js/adm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2249,14 +2249,15 @@ ADMNode.prototype.setProperty = function (property, value, data, raw) {
}
}

// TODO: In HTML5 the rules for ids are not this strict, so this should be
// corrected with reference to the spec.
// HTML id naming rules:
// Must begin with a letter A-Z or a-z
// TODO: In HTML5 the rules for ids are not this strict, but JQM and jQuery don't work well
// with special chars, such as "$" "%" "/" accepted by HTML5.
//
// So we use the following id naming rules:
// Must begin with a letter A-Z or a-z or 0-9
// Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), and underscores ("_")
// In HTML, all values are case-insensitive
if (property == "id") {
var pattern = /^[a-zA-Z]([\w-]*)$/;
var pattern = /^[a-zA-Z0-9]([\w-]*)$/;
if (value && !pattern.test(value)) {
console.error("Error: attempted to set invalid id");
return rval;
Expand Down
2 changes: 1 addition & 1 deletion src/js/views/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
ret = ADM.setProperty(node, updated, value);
type = node.getType();
if (ret.result === false) {
$(this).val(node.getProperty(updated));
$(this).effect("highlight", {color: "red"}, 1000).val(node.getProperty(updated));
} else if (type === "Button" &&
value === "previous page") {
ADM.setProperty(node, "opentargetas", "default");
Expand Down