Added RTE composite block and class formatting

Added "block.class" and "block#id" formatting to the Rich Text Editor.

Example use include following formats:
"p.lead"
"h1#title"

Without this only "p" or ".lead" will work, not composites.
This commit is contained in:
SorenA
2015-01-28 11:38:11 +01:00
parent 9695ccea0a
commit 4482879fc6

View File

@@ -78,6 +78,16 @@ angular.module("umbraco")
r.inline = "span";
r.attributes = { id: rule.selector.substring(1) };
}
else if (rule.selector[0] != "." && rule.selector.indexOf(".") > -1) {
var split = rule.selector.split(".");
r.block = split[0];
r.classes = rule.selector.substring(rule.selector.indexOf(".") + 1);
}
else if (rule.selector[0] != "#" && rule.selector.indexOf("#") > -1) {
var split = rule.selector.split("#");
r.block = split[0];
r.classes = rule.selector.substring(rule.selector.indexOf("#") + 1);
}
else {
r.block = rule.selector;
}
@@ -254,4 +264,4 @@ angular.module("umbraco")
});
});
});
});