diff --git a/src/Umbraco.Core/Serialization/JsonToStringConverter.cs b/src/Umbraco.Core/Serialization/JsonToStringConverter.cs
new file mode 100644
index 0000000000..eeda4345c0
--- /dev/null
+++ b/src/Umbraco.Core/Serialization/JsonToStringConverter.cs
@@ -0,0 +1,33 @@
+using System;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace Umbraco.Core.Serialization
+{
+ ///
+ /// This is used in order to deserialize a json object on a property into a json string since the property's type is 'string'
+ ///
+ internal class JsonToStringConverter : JsonConverter
+ {
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ {
+ if (reader.ValueType == typeof(string))
+ {
+ return reader.Value;
+ }
+ // Load JObject from stream
+ JObject jObject = JObject.Load(reader);
+ return jObject.ToString();
+ }
+
+ public override bool CanConvert(Type objectType)
+ {
+ return typeof(string).IsAssignableFrom(objectType);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/lib/umbraco/Extensions.js b/src/Umbraco.Web.UI.Client/lib/umbraco/Extensions.js
new file mode 100644
index 0000000000..72e1685339
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/lib/umbraco/Extensions.js
@@ -0,0 +1,263 @@
+(function () {
+
+ //extensions to base classes such as String and extension methods for jquery.
+ //NOTE: jquery must be loaded before this file.
+
+ //create guid object on the window (which makes it global)
+ if (window.Guid == null) {
+ window.Guid = {
+ generate: function () {
+ ///generates a new Guid
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+ var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
+ return v.toString(16);
+ });
+ }
+ };
+ }
+
+ if (!window.__debug__) {
+ window.__debug__ = function (msg, category, isErr) {
+ ///global method to send debug statements to console that is cross browser (or at least checks if its possible)
+
+ if (((typeof console) != "undefined") && console.log && console.error) {
+ if (isErr) console.error(category + ": " + msg);
+ else console.log(category + ": " + msg);
+ }
+ };
+ }
+
+ if (!String.prototype.startsWith) {
+ String.prototype.startsWith = function (str) {
+ ///startsWith extension method for string
+
+ return this.substr(0, str.length) === str;
+ };
+ }
+
+ if (!String.prototype.endsWith) {
+ String.prototype.endsWith = function (str) {
+ ///endsWith extension method for string
+
+ return this.substr(this.length - str.length) === str;
+ };
+ }
+
+ if (!String.prototype.trimStart) {
+ String.prototype.trimStart = function (str) {
+ ///trims the start of the string
+ if (this.startsWith(str)) {
+ return this.substring(str.length, this.length - 1);
+ }
+ return this;
+ };
+ }
+
+ if (!String.prototype.utf8Encode) {
+ String.prototype.utf8Encode = function () {
+ ///UTF8 encoder for string
+
+ var str = this.replace(/\r\n/g, "\n");
+ var utftext = "";
+ for (var n = 0; n < str.length; n++) {
+ var c = str.charCodeAt(n);
+ if (c < 128) {
+ utftext += String.fromCharCode(c);
+ }
+ else if ((c > 127) && (c < 2048)) {
+ utftext += String.fromCharCode((c >> 6) | 192);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+ else {
+ utftext += String.fromCharCode((c >> 12) | 224);
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+ }
+ return utftext;
+ };
+ }
+
+ if (!String.prototype.utf8Decode) {
+ String.prototype.utf8Decode = function () {
+ var utftext = this;
+ var string = "";
+ var i = 0;
+ var c = c1 = c2 = 0;
+
+ while (i < utftext.length) {
+
+ c = utftext.charCodeAt(i);
+
+ if (c < 128) {
+ string += String.fromCharCode(c);
+ i++;
+ }
+ else if ((c > 191) && (c < 224)) {
+ c2 = utftext.charCodeAt(i + 1);
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+ i += 2;
+ }
+ else {
+ c2 = utftext.charCodeAt(i + 1);
+ c3 = utftext.charCodeAt(i + 2);
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
+ i += 3;
+ }
+
+ }
+
+ return string;
+ };
+ }
+
+ if (!String.prototype.base64Encode) {
+ String.prototype.base64Encode = function () {
+ ///Base64 encoder for string
+
+ var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ var output = "";
+ var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ var input = this.utf8Encode();
+
+ while (i < input.length) {
+
+ chr1 = input.charCodeAt(i++);
+ chr2 = input.charCodeAt(i++);
+ chr3 = input.charCodeAt(i++);
+
+ enc1 = chr1 >> 2;
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+ enc4 = chr3 & 63;
+
+ if (isNaN(chr2)) {
+ enc3 = enc4 = 64;
+ } else if (isNaN(chr3)) {
+ enc4 = 64;
+ }
+
+ output = output +
+ keyStr.charAt(enc1) + keyStr.charAt(enc2) +
+ keyStr.charAt(enc3) + keyStr.charAt(enc4);
+
+ }
+
+ return output;
+ };
+ }
+
+ if (!String.prototype.base64Decode) {
+ String.prototype.base64Decode = function () {
+ ///Base64 decoder for string
+
+ var input = this;
+ var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ var output = "";
+ var chr1, chr2, chr3;
+ var enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+
+ while (i < input.length) {
+
+ enc1 = keyStr.indexOf(input.charAt(i++));
+ enc2 = keyStr.indexOf(input.charAt(i++));
+ enc3 = keyStr.indexOf(input.charAt(i++));
+ enc4 = keyStr.indexOf(input.charAt(i++));
+
+ chr1 = (enc1 << 2) | (enc2 >> 4);
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+ chr3 = ((enc3 & 3) << 6) | enc4;
+
+ output = output + String.fromCharCode(chr1);
+
+ if (enc3 != 64) {
+ output = output + String.fromCharCode(chr2);
+ }
+ if (enc4 != 64) {
+ output = output + String.fromCharCode(chr3);
+ }
+
+ }
+
+ return output.utf8Decode();
+
+ };
+ }
+
+
+ if (!Math.randomRange) {
+ Math.randomRange = function (from, to) {
+ ///randomRange extension for math
+
+ return Math.floor(Math.random() * (to - from + 1) + from);
+ };
+ }
+
+ if (!String.prototype.toCamelCase) {
+ String.prototype.toCamelCase = function () {
+ ///toCamelCase extension method for string
+
+ var s = this.toPascalCase();
+ if ($.trim(s) == "")
+ return "";
+ if (s.length > 1) {
+ var regex = /^([A-Z]*)([A-Z].*)/g;
+ if (s.match(regex)) {
+ var match = regex.exec(s);
+ s = match[1].toLowerCase() + match[2];
+ s = s.substr(0, 1).toLowerCase() + s.substr(1);
+ }
+ } else {
+ s = s.toLowerCase();
+ }
+ return s;
+ };
+ }
+
+ if (!String.prototype.toPascalCase) {
+ String.prototype.toPascalCase = function () {
+ ///toPascalCase extension method for string
+
+ var s = "";
+ $.each($.trim(this).split(/[\s\.-]+/g), function (idx, val) {
+ if ($.trim(val) == "")
+ return;
+ if (val.length > 1)
+ s += val.substr(0, 1).toUpperCase() + val.substr(1);
+ else
+ s += val.toUpperCase();
+ });
+ return s;
+ };
+ }
+
+ if (!String.prototype.toUmbracoAlias) {
+ String.prototype.toUmbracoAlias = function () {
+ //////toUmbracoAlias extension method for string
+
+ var s = this.replace(/[^a-zA-Z0-9\s\.-]+/g, ''); // Strip none alphanumeric chars
+ return s.toCamelCase(); // Convert to camelCase
+ };
+ }
+
+ if (!String.prototype.toFunction) {
+ String.prototype.toFunction = function () {
+ var arr = this.split(".");
+ var fn = (window || this);
+ for (var i = 0, len = arr.length; i < len; i++) {
+ fn = fn[arr[i]];
+ }
+ if (typeof fn !== "function") {
+ throw new Error("function not found");
+ }
+ return fn;
+ };
+ }
+
+
+})();
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index a4c593a7af..90a1e23c81 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -565,6 +565,7 @@
+
diff --git a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
index 7d66ac7d65..4870a352f8 100644
--- a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
+++ b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
@@ -14,6 +14,7 @@
Umbraco
+
@*Currently this needs to be loaded before anything*@
diff --git a/src/Umbraco.Web.UI/umbraco/Views/common/tree.html b/src/Umbraco.Web.UI/umbraco/Views/common/tree.html
index b56462afc0..913a987010 100644
--- a/src/Umbraco.Web.UI/umbraco/Views/common/tree.html
+++ b/src/Umbraco.Web.UI/umbraco/Views/common/tree.html
@@ -14,7 +14,7 @@
ng-class="{'icon-caret-right': !node.expanded, 'icon-caret-down': node.expanded}"
ng-click="getTreeChildren(node)">
-
+
{{node.name}}
diff --git a/src/Umbraco.Web.UI/umbraco/assets/css/umbraco.css b/src/Umbraco.Web.UI/umbraco/assets/css/umbraco.css
index 1608265dde..60a7cf635f 100644
--- a/src/Umbraco.Web.UI/umbraco/assets/css/umbraco.css
+++ b/src/Umbraco.Web.UI/umbraco/assets/css/umbraco.css
@@ -7,6 +7,52 @@
*
*/
+
+.sprTree {
+ background-image: url(../img/legacytreesprites.png);
+ display:inline-block;
+}
+.sprTreeDeveloperCacheItem {background-position: -6px -8px ! important;}
+.sprTreeDeveloperCacheTypes {background-position: -6px -40px ! important;}
+.sprTreeDeveloperMacro {background-position: -6px -72px ! important;}
+.sprTreeDeveloperPython {background-position: -6px -104px ! important; width: 15px; height: 15px}
+.sprTreeDeveloperRegistry {background-position: -6px -135px ! important;}
+.sprTreeDoc {background-position: -6px -199px ! important;}
+.sprTreeDoc2 {background-position: -6px -231px ! important;}
+.sprTreeDoc3 {background-position: -6px -263px ! important;}
+.sprTreeDoc4 {background-position: -6px -295px ! important;}
+.sprTreeDoc5 {background-position: -6px -327px ! important;}
+.sprTreeDocPic {background-position: -6px -359px ! important;}
+.sprTreeFolder {background-position: -6px -391px ! important;}
+.sprTreeFolder_o {background-position: -6px -423px ! important;}
+.sprTreeMediaFile {background-position: -6px -455px ! important;}
+.sprTreeMediaMovie {background-position: -6px -487px ! important;}
+.sprTreemediaFile {background-position: -6px -519px ! important;}
+.sprTreeMediaPhoto {background-position: -6px -551px ! important;}
+.sprTreeMember {background-position: -6px -583px ! important;}
+.sprTreeMemberGroup {background-position: -6px -615px ! important;}
+.sprTreeMemberType {background-position: -6px -647px ! important;}
+.sprTreeNewsletter {background-position: -6px -679px ! important;}
+.sprTreePackage {background-position: -6px -711px ! important;}
+.sprTreeRepository {background-position: -6px -743px ! important;}
+.sprTreeSettingAgent {background-position: -6px -775px ! important;}
+.sprTreeSettingCss {background-position: -6px -807px ! important;}
+.sprTreeSettingCssItem {background-position: -6px -839px ! important;}
+.sprTreeSettingDataType {background-position: -6px -871px ! important;}
+.sprTreeSettingDataTypeChild {background-position: -6px -903px ! important;}
+.sprTreeSettingDomain {background-position: -6px -935px ! important;}
+.sprTreeSettingLanguage {background-position: -6px -967px ! important;}
+.sprTreeSettingScript {background-position: -6px -999px ! important;}
+.sprTreeSettingTemplate {background-position: -6px -1031px ! important;}
+.sprTreeSettingXml {background-position: -6px -1063px ! important;}
+.sprTreeStatistik {background-position: -6px -1095px ! important;}
+.sprTreeUser {background-position: -6px -1127px ! important;}
+.sprTreeUserGroup {background-position: -6px -1159px ! important;}
+.sprTreeUserType {background-position: -6px -1191px ! important;}
+.sprNew{background-position: -6px -339px;}
+
+
+
.clearfix {
*zoom: 1;
}
@@ -6364,32 +6410,33 @@ legend + .control-group {
}
.umb-tree {
- /*width: auto;
- min-width: 100%;*/
+ width: auto;
+ min-width: 100%;
margin: 0;
- display:block;
}
.umb-tree li {
display: block;
- /*width: auto;
- min-width: 100%;*/
+ width: auto;
+ min-width: 100%;
}
-.umb-tree li.current > div {
- /*background: #2e8aea;*/
+.umb-tree li.current > div,
+.umb-tree div.selected {
+ background: #2e8aea;
}
-.umb-tree li.current > div i.umb-options i {
- /*background: #fff;
- border-color: #2e8aea;*/
+.umb-tree li.current > div i.umb-options i,
+.umb-tree div.selected i {
+ background: #fff;
+ border-color: #2e8aea;
}
.umb-tree li.current > div a,
.umb-tree li.current > div i.icon {
- /*color: white !important;
+ color: white !important;
background: #2e8aea;
- border-color: #2e8aea;*/
+ border-color: #2e8aea;
}
.umb-tree li.root div {
@@ -6401,9 +6448,9 @@ legend + .control-group {
}
.umb-tree ul {
- display: block;
- /*width: 100%;
- min-width: 100%;*/
+ display: table;
+ width: 100%;
+ min-width: 100%;
padding: 0;
margin: 0;
}
@@ -6569,8 +6616,8 @@ i.umb-options i {
.umb-actions a:hover,
.umb-actions li.selected {
- /*color: #fff;
- background: #2e8aea;*/
+ color: #fff;
+ background: #2e8aea;
}
.umb-actions a:hover i {
diff --git a/src/Umbraco.Web.UI/umbraco/assets/img/legacytreesprites.png b/src/Umbraco.Web.UI/umbraco/assets/img/legacytreesprites.png
new file mode 100644
index 0000000000..8a3ed9b934
Binary files /dev/null and b/src/Umbraco.Web.UI/umbraco/assets/img/legacytreesprites.png differ
diff --git a/src/Umbraco.Web.UI/umbraco/js/umbraco.filters.js b/src/Umbraco.Web.UI/umbraco/js/umbraco.filters.js
index f1fe4a6df4..129b96292d 100644
--- a/src/Umbraco.Web.UI/umbraco/js/umbraco.filters.js
+++ b/src/Umbraco.Web.UI/umbraco/js/umbraco.filters.js
@@ -28,7 +28,7 @@ define(['app', 'angular'], function (app, angular) {
if (treeNode.iconIsClass) {
return "";
}
- return "
";
+ return "background-image: url('" + treeNode.iconFilePath + "');";
};
};
angular.module('umbraco.filters').filter("umbTreeIconImage", treeIconImageFilter);
@@ -41,10 +41,11 @@ define(['app', 'angular'], function (app, angular) {
**/
function treeIconClassFilter() {
return function (treeNode, standardClasses) {
+
if (treeNode.iconIsClass) {
- return standardClasses + " " + treeNode.icon;
+ return standardClasses + " " + (treeNode.icon.startsWith('.') ? treeNode.icon.trimStart('.') : treeNode.icon);
}
- return standardClasses;
+ return standardClasses + " icon-custom-file";
};
};
angular.module('umbraco.filters').filter("umbTreeIconClass", treeIconClassFilter);
diff --git a/src/Umbraco.Web.UI/umbraco/lib/Umbraco/Extensions.js b/src/Umbraco.Web.UI/umbraco/lib/Umbraco/Extensions.js
new file mode 100644
index 0000000000..4f2494d3a7
--- /dev/null
+++ b/src/Umbraco.Web.UI/umbraco/lib/Umbraco/Extensions.js
@@ -0,0 +1,263 @@
+(function () {
+
+ //extensions to base classes such as String and extension methods for jquery.
+ //NOTE: jquery must be loaded before this file.
+
+ //create guid object on the window (which makes it global)
+ if (window.Guid == null) {
+ window.Guid = {
+ generate: function () {
+ ///generates a new Guid
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+ var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
+ return v.toString(16);
+ });
+ }
+ };
+ }
+
+ if (!window.__debug__) {
+ window.__debug__ = function (msg, category, isErr) {
+ ///global method to send debug statements to console that is cross browser (or at least checks if its possible)
+
+ if (((typeof console) != "undefined") && console.log && console.error) {
+ if (isErr) console.error(category + ": " + msg);
+ else console.log(category + ": " + msg);
+ }
+ };
+ }
+
+ if (!String.prototype.startsWith) {
+ String.prototype.startsWith = function (str) {
+ ///startsWith extension method for string
+
+ return this.substr(0, str.length) === str;
+ };
+ }
+
+ if (!String.prototype.endsWith) {
+ String.prototype.endsWith = function (str) {
+ ///endsWith extension method for string
+
+ return this.substr(this.length - str.length) === str;
+ };
+ }
+
+ if (!String.prototype.trimStart) {
+ String.prototype.trimStart = function (str) {
+ ///trims the start of the string
+ if (this.startsWith(str)) {
+ return this.substring(str.length);
+ }
+ return this;
+ };
+ }
+
+ if (!String.prototype.utf8Encode) {
+ String.prototype.utf8Encode = function () {
+ ///UTF8 encoder for string
+
+ var str = this.replace(/\r\n/g, "\n");
+ var utftext = "";
+ for (var n = 0; n < str.length; n++) {
+ var c = str.charCodeAt(n);
+ if (c < 128) {
+ utftext += String.fromCharCode(c);
+ }
+ else if ((c > 127) && (c < 2048)) {
+ utftext += String.fromCharCode((c >> 6) | 192);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+ else {
+ utftext += String.fromCharCode((c >> 12) | 224);
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+ }
+ return utftext;
+ };
+ }
+
+ if (!String.prototype.utf8Decode) {
+ String.prototype.utf8Decode = function () {
+ var utftext = this;
+ var string = "";
+ var i = 0;
+ var c = c1 = c2 = 0;
+
+ while (i < utftext.length) {
+
+ c = utftext.charCodeAt(i);
+
+ if (c < 128) {
+ string += String.fromCharCode(c);
+ i++;
+ }
+ else if ((c > 191) && (c < 224)) {
+ c2 = utftext.charCodeAt(i + 1);
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+ i += 2;
+ }
+ else {
+ c2 = utftext.charCodeAt(i + 1);
+ c3 = utftext.charCodeAt(i + 2);
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
+ i += 3;
+ }
+
+ }
+
+ return string;
+ };
+ }
+
+ if (!String.prototype.base64Encode) {
+ String.prototype.base64Encode = function () {
+ ///Base64 encoder for string
+
+ var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ var output = "";
+ var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ var input = this.utf8Encode();
+
+ while (i < input.length) {
+
+ chr1 = input.charCodeAt(i++);
+ chr2 = input.charCodeAt(i++);
+ chr3 = input.charCodeAt(i++);
+
+ enc1 = chr1 >> 2;
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+ enc4 = chr3 & 63;
+
+ if (isNaN(chr2)) {
+ enc3 = enc4 = 64;
+ } else if (isNaN(chr3)) {
+ enc4 = 64;
+ }
+
+ output = output +
+ keyStr.charAt(enc1) + keyStr.charAt(enc2) +
+ keyStr.charAt(enc3) + keyStr.charAt(enc4);
+
+ }
+
+ return output;
+ };
+ }
+
+ if (!String.prototype.base64Decode) {
+ String.prototype.base64Decode = function () {
+ ///Base64 decoder for string
+
+ var input = this;
+ var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ var output = "";
+ var chr1, chr2, chr3;
+ var enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+
+ while (i < input.length) {
+
+ enc1 = keyStr.indexOf(input.charAt(i++));
+ enc2 = keyStr.indexOf(input.charAt(i++));
+ enc3 = keyStr.indexOf(input.charAt(i++));
+ enc4 = keyStr.indexOf(input.charAt(i++));
+
+ chr1 = (enc1 << 2) | (enc2 >> 4);
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+ chr3 = ((enc3 & 3) << 6) | enc4;
+
+ output = output + String.fromCharCode(chr1);
+
+ if (enc3 != 64) {
+ output = output + String.fromCharCode(chr2);
+ }
+ if (enc4 != 64) {
+ output = output + String.fromCharCode(chr3);
+ }
+
+ }
+
+ return output.utf8Decode();
+
+ };
+ }
+
+
+ if (!Math.randomRange) {
+ Math.randomRange = function (from, to) {
+ ///randomRange extension for math
+
+ return Math.floor(Math.random() * (to - from + 1) + from);
+ };
+ }
+
+ if (!String.prototype.toCamelCase) {
+ String.prototype.toCamelCase = function () {
+ ///toCamelCase extension method for string
+
+ var s = this.toPascalCase();
+ if ($.trim(s) == "")
+ return "";
+ if (s.length > 1) {
+ var regex = /^([A-Z]*)([A-Z].*)/g;
+ if (s.match(regex)) {
+ var match = regex.exec(s);
+ s = match[1].toLowerCase() + match[2];
+ s = s.substr(0, 1).toLowerCase() + s.substr(1);
+ }
+ } else {
+ s = s.toLowerCase();
+ }
+ return s;
+ };
+ }
+
+ if (!String.prototype.toPascalCase) {
+ String.prototype.toPascalCase = function () {
+ ///toPascalCase extension method for string
+
+ var s = "";
+ $.each($.trim(this).split(/[\s\.-]+/g), function (idx, val) {
+ if ($.trim(val) == "")
+ return;
+ if (val.length > 1)
+ s += val.substr(0, 1).toUpperCase() + val.substr(1);
+ else
+ s += val.toUpperCase();
+ });
+ return s;
+ };
+ }
+
+ if (!String.prototype.toUmbracoAlias) {
+ String.prototype.toUmbracoAlias = function () {
+ //////toUmbracoAlias extension method for string
+
+ var s = this.replace(/[^a-zA-Z0-9\s\.-]+/g, ''); // Strip none alphanumeric chars
+ return s.toCamelCase(); // Convert to camelCase
+ };
+ }
+
+ if (!String.prototype.toFunction) {
+ String.prototype.toFunction = function () {
+ var arr = this.split(".");
+ var fn = (window || this);
+ for (var i = 0, len = arr.length; i < len; i++) {
+ fn = fn[arr[i]];
+ }
+ if (typeof fn !== "function") {
+ throw new Error("function not found");
+ }
+ return fn;
+ };
+ }
+
+
+})();
\ No newline at end of file
diff --git a/src/Umbraco.Web/UI/JavaScript/Main.js b/src/Umbraco.Web/UI/JavaScript/Main.js
index 0dcf2c80a8..d5340cd8d5 100644
--- a/src/Umbraco.Web/UI/JavaScript/Main.js
+++ b/src/Umbraco.Web/UI/JavaScript/Main.js
@@ -1,6 +1,6 @@
require.config("##RequireJsConfig##");
-require("##RequireJsInitialize##", function (angular, app) {
+require("##RequireJsInitialize##", function (angular, app, jQuery) {
//This function will be called when all the dependencies
//listed above are loaded. Note that this function could
diff --git a/src/Umbraco.Web/UI/JavaScript/RequireJsConfig.js b/src/Umbraco.Web/UI/JavaScript/RequireJsConfig.js
index 26d13c4418..4e6fbf6214 100644
--- a/src/Umbraco.Web/UI/JavaScript/RequireJsConfig.js
+++ b/src/Umbraco.Web/UI/JavaScript/RequireJsConfig.js
@@ -4,6 +4,7 @@
paths: {
jquery: '../lib/jquery/jquery-1.8.2.min',
jqueryCookie: '../lib/jquery/jquery.cookie',
+ umbracoExtensions: '../lib/umbraco/extensions',
bootstrap: '../lib/bootstrap/js/bootstrap',
underscore: '../lib/underscore/underscore',
angular: '../lib/angular/angular.min',
@@ -21,6 +22,7 @@
css: '../lib/require/css'
},
shim: {
+ 'umbracoExtensions' : {'exports' : 'umbracoExtensions'},
'angular' : {'exports' : 'angular'},
'angular-resource': { deps: ['angular'] },
'bootstrap': { deps: ['jquery'] },
diff --git a/src/Umbraco.Web/UI/JavaScript/RequireJsInitialize.js b/src/Umbraco.Web/UI/JavaScript/RequireJsInitialize.js
index 8af8916377..235cb7de9c 100644
--- a/src/Umbraco.Web/UI/JavaScript/RequireJsInitialize.js
+++ b/src/Umbraco.Web/UI/JavaScript/RequireJsInitialize.js
@@ -1,8 +1,9 @@
-[
+[
'angular',
- 'app',
+ 'app',
'jquery',
'jqueryCookie',
+ 'umbracoExtensions',
'bootstrap',
'umbraco.resources',
'umbraco.directives',
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index d1cd2891b9..e41f527696 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -303,7 +303,6 @@
-