From 276604a580e739527c16e1a17093339f78b64f39 Mon Sep 17 00:00:00 2001 From: Stefan Kamphuis Date: Fri, 30 Nov 2018 18:10:09 +0100 Subject: [PATCH 01/34] DnnPortalSettingsDataProvider --- .../Datasource/DnnPortalSettingsDataSource.cs | 363 ++++++++++++++++++ OpenContent/OpenContent.csproj | 1 + 2 files changed, 364 insertions(+) create mode 100644 OpenContent/Components/Datasource/DnnPortalSettingsDataSource.cs diff --git a/OpenContent/Components/Datasource/DnnPortalSettingsDataSource.cs b/OpenContent/Components/Datasource/DnnPortalSettingsDataSource.cs new file mode 100644 index 00000000..8e9feaef --- /dev/null +++ b/OpenContent/Components/Datasource/DnnPortalSettingsDataSource.cs @@ -0,0 +1,363 @@ +using DotNetNuke.Application; +using DotNetNuke.ComponentModel.DataAnnotations; +using DotNetNuke.Data; +using Newtonsoft.Json.Linq; +using Satrabel.OpenContent.Components.Alpaca; +using Satrabel.OpenContent.Components.Datasource.Search; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; + +namespace Satrabel.OpenContent.Components.Datasource +{ + public class DnnPortalSettingsDataSource : DefaultDataSource //, IDataActions + { + public override string Name => "Satrabel.DnnPortalSettings"; + + public override IDataItem Get(DataSourceContext context, string id) + { + IDataItem data = null; + PortalSettingInfoBase item; + if (DotNetNukeContext.Current.Application.Version.Major <= 7) + { + var ps = new PortalSettingInfo7(id); + item = GetByPrimaryKey(ps.PortalID, ps.SettingName, ps.CultureCode); + } + else + { + item = GetById(Int32.Parse(id)); + } + data = ToData(item); + return data; + } + private static IDataItem ToData(PortalSettingInfoBase setting) + { + var item = new DefaultDataItem() + { + Id = setting.Id(), + Title = $"{setting.SettingName}", + Data = JObject.FromObject(new + { + Id = setting.Id(), + setting.PortalID, + setting.SettingName, + setting.SettingValue, + setting.CultureCode, + //setting.CreatedByUserID, + //setting.CreatedOnDate, + //setting.LastModifiedByUserID, + //setting.LastModifiedOnDate + }), + CreatedByUserId = setting.CreatedByUserID.GetValueOrDefault(), + LastModifiedByUserId = setting.LastModifiedByUserID.GetValueOrDefault(), + LastModifiedOnDate = setting.LastModifiedOnDate.GetValueOrDefault(), + CreatedOnDate = setting.CreatedOnDate.GetValueOrDefault(), + Item = setting + }; + return item; + } + + public override IDataItems GetAll(DataSourceContext context, Select selectQuery) + { + IEnumerable all; + if (DotNetNukeContext.Current.Application.Version.Major <= 7) + { + all = GetAll(context.PortalId); + } + else + { + all = GetAll(context.PortalId); + } + int total = all.Count(); + if (selectQuery != null) + { + var settingName = selectQuery.Query.FilterRules.FirstOrDefault(f => f.Field == "SettingName"); + if (settingName != null) + { + all = all.Where(t => t.SettingName.ToLower().Contains(settingName.Value.AsString.ToLower())); + } + settingName = selectQuery.Query.FilterRules.FirstOrDefault(f => f.Field == "CultureCode"); + if (settingName != null) + { + all = all.Where(t => t.CultureCode.ToLower().Contains(settingName.Value.AsString.ToLower())); + } + all = all.Skip(selectQuery.PageIndex * selectQuery.PageSize).Take(selectQuery.PageSize).ToList(); + } + var dataList = new List(); + foreach (var setting in all) + { + dataList.Add(ToData(setting)); + } + return new DefaultDataItems() + { + Items = dataList, + Total = total + }; + } + + public override JObject GetAlpaca(DataSourceContext context, bool schema, bool options, bool view) + { + var fb = new FormBuilder(new FolderUri(context.TemplateFolder)); + var alpaca = fb.BuildForm("", context.CurrentCultureCode); + return alpaca; + } + public override void Add(DataSourceContext context, JToken data) + { + var schema = GetAlpaca(context, true, false, false)["schema"] as JObject; + + if (DotNetNukeContext.Current.Application.Version.Major <= 7) + { + var sett = new PortalSettingInfo7(); + sett.PortalID = context.PortalId; + sett.CultureCode = context.CurrentCultureCode; + sett.CreatedByUserID = context.UserId; + sett.CreatedOnDate = DateTime.Now; + sett.LastModifiedByUserID = context.UserId; + sett.LastModifiedOnDate = DateTime.Now; + if (HasProperty(schema, "", "SettingName")) + { + sett.SettingName = data["SettingName"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "SettingValue")) + { + sett.SettingValue = data["SettingValue"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "CultureCode")) + { + sett.CultureCode = data["CultureCode"]?.ToString() ?? ""; + } + + Add(sett); + } + else + { + var sett = new PortalSettingInfo(); + sett.PortalID = context.PortalId; + sett.CultureCode = context.CurrentCultureCode; + sett.CreatedByUserID = context.UserId; + sett.CreatedOnDate = DateTime.Now; + sett.LastModifiedByUserID = context.UserId; + sett.LastModifiedOnDate = DateTime.Now; + if (HasProperty(schema, "", "SettingName")) + { + sett.SettingName = data["SettingName"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "SettingValue")) + { + sett.SettingValue = data["SettingValue"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "CultureCode")) + { + sett.CultureCode = data["CultureCode"]?.ToString() ?? ""; + if (sett.CultureCode == "") sett.CultureCode = null; + } + + Add(sett); + } + + } + + public override void Update(DataSourceContext context, IDataItem item, JToken data) + { + var schema = GetAlpaca(context, true, false, false)["schema"] as JObject; + + if (DotNetNukeContext.Current.Application.Version.Major <= 7) + { + var sett = (PortalSettingInfo7)item.Item; + if (HasProperty(schema, "", "SettingName")) + { + sett.SettingName = data["SettingName"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "SettingValue")) + { + sett.SettingValue = data["SettingValue"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "CultureCode")) + { + sett.CultureCode = data["CultureCode"]?.ToString() ?? ""; + } + Update(sett); + } + else + { + var sett = (PortalSettingInfo)item.Item; + if (HasProperty(schema, "", "SettingName")) + { + sett.SettingName = data["SettingName"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "SettingValue")) + { + sett.SettingValue = data["SettingValue"]?.ToString() ?? ""; + } + if (HasProperty(schema, "", "CultureCode")) + { + sett.CultureCode = data["CultureCode"]?.ToString() ?? ""; + if (sett.CultureCode == "") sett.CultureCode = null; + } + Update(sett); + } + + } + + public override void Delete(DataSourceContext context, IDataItem item) + { + throw new NotImplementedException(); + } + + //public List GetActions(DataSourceContext context, IDataItem item) + //{ + // return null; + //} + + //public override JToken Action(DataSourceContext context, string action, IDataItem item, JToken data) + //{ + // throw new NotImplementedException(); + //} + + #region private methods + + private static bool HasProperty(JObject schema, string subobject, string property) + { + if (!string.IsNullOrEmpty(subobject)) + { + schema = schema[subobject] as JObject; + } + if (!(schema?["properties"] is JObject)) return false; + + return ((JObject)schema["properties"]).Properties().Any(p => p.Name == property); + } + + #endregion + + public T GetById(int id) where T : class + { + T t; + using (IDataContext ctx = DataContext.Instance()) + { + var rep = ctx.GetRepository(); + t = rep.GetById(id); + } + return t; + } + + public T Update(T setting) where T : class + { + using (IDataContext ctx = DataContext.Instance()) + { + var rep = ctx.GetRepository(); + rep.Update(setting); + } + return setting; + } + + public T Add(T setting) where T : class + { + using (IDataContext ctx = DataContext.Instance()) + { + var rep = ctx.GetRepository(); + rep.Insert(setting); + } + return setting; + } + + #region DNN 7 stuff + + public PortalSettingInfo7 Update(PortalSettingInfo7 setting) + { + using (IDataContext ctx = DataContext.Instance()) + { + ctx.Execute(CommandType.Text, + "UPDATE {databaseOwner}[{objectQualifier}PortalSettings] SET SettingName = @1, SettingValue = @3, CultureCode = @2 WHERE PortalID = @0 AND SettingName = @1 AND CultureCode = @2 ", + setting.PortalID, setting.SettingName, setting.CultureCode, setting.SettingValue); + } + return setting; + } + + public PortalSettingInfo7 Add(PortalSettingInfo7 setting) + { + using (IDataContext ctx = DataContext.Instance()) + { + ctx.Execute(CommandType.Text, + "INSERT INTO {databaseOwner}[{objectQualifier}PortalSettings] " + + "(PortalID, SettingName, SettingValue, CreatedByUserID, CreatedOnDate, LastModifiedByUserID, LastModifiedOnDate, CultureCode) " + + "VALUES (@0, @1, @2, @3, @4, @5, @6, @7)", + setting.PortalID, setting.SettingName, setting.SettingValue, setting.CreatedByUserID, setting.CreatedOnDate, setting.LastModifiedByUserID, setting.LastModifiedOnDate, setting.CultureCode); + } + return setting; + } + + public IEnumerable GetAll(int portalId) where T : PortalSettingInfoBase + { + IEnumerable t; + using (IDataContext ctx = DataContext.Instance()) + { + var rep = ctx.GetRepository(); + t = rep.Get(portalId); + } + return t; + } + + public PortalSettingInfo7 GetByPrimaryKey(int portalId, string settingName, string cultureCode) + { + PortalSettingInfo7 t; + using (IDataContext ctx = DataContext.Instance()) + { + var rep = ctx.GetRepository(); + t = rep.Find("WHERE PortalID = @0 AND SettingName = @1 AND CultureCode = @2", portalId, settingName, cultureCode).FirstOrDefault(); + } + return t; + } + + #endregion + } + + [TableName("PortalSettings")] + [Scope("PortalID")] + public class PortalSettingInfo7 : PortalSettingInfoBase + { + public PortalSettingInfo7() : base() { } + public PortalSettingInfo7(string id) : base() + { + var values = id.Split(IdSep); + PortalID = int.Parse(values[0]); + SettingName = values[1]; + CultureCode = values[2]; + } + public const char IdSep = '~'; + public const char IdSepReplace = '*'; + public override string Id() + { + return $"{PortalID}{IdSep}{SettingName.Replace(IdSep, IdSepReplace)}{IdSep}{CultureCode}"; + } + } + + [TableName("PortalSettings")] + [PrimaryKey("PortalSettingID", AutoIncrement = true)] + [Scope("PortalID")] + public class PortalSettingInfo : PortalSettingInfoBase + { + public override string Id() + { + return PortalSettingID.ToString(); + } + + public int PortalSettingID { get; set; } + } + public abstract class PortalSettingInfoBase + { + protected PortalSettingInfoBase() + { + } + + public abstract string Id(); + public int PortalID { get; set; } + public string SettingName { get; set; } + public string SettingValue { get; set; } + public int? CreatedByUserID { get; set; } + public DateTime? CreatedOnDate { get; set; } + public int? LastModifiedByUserID { get; set; } + public DateTime? LastModifiedOnDate { get; set; } + public string CultureCode { get; set; } + } +} \ No newline at end of file diff --git a/OpenContent/OpenContent.csproj b/OpenContent/OpenContent.csproj index 960eed7d..b0fab8d2 100644 --- a/OpenContent/OpenContent.csproj +++ b/OpenContent/OpenContent.csproj @@ -175,6 +175,7 @@ AddEdit.ascx + From 7ed6b2c69f647be03dab061f7f9cd46156bfc991 Mon Sep 17 00:00:00 2001 From: Will Strohl Date: Sun, 28 Jul 2019 12:49:07 -0700 Subject: [PATCH 02/34] Adding a contains helper --- .../Components/Handlebars/HandlebarsEngine.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/OpenContent/Components/Handlebars/HandlebarsEngine.cs b/OpenContent/Components/Handlebars/HandlebarsEngine.cs index 4a0be7e7..323b7037 100644 --- a/OpenContent/Components/Handlebars/HandlebarsEngine.cs +++ b/OpenContent/Components/Handlebars/HandlebarsEngine.cs @@ -126,6 +126,7 @@ private static void RegisterHelpers(IHandlebars hbs) RegisterReplaceNewlineHelper(hbs); RegisterTemplateHelper(hbs); RegisterRawHelper(hbs); + RegisterContainsHelper(hbs); } private static void RegisterTruncateWordsHelper(HandlebarsDotNet.IHandlebars hbs) @@ -1023,5 +1024,32 @@ private static void RegisterTemplateHelper(HandlebarsDotNet.IHandlebars hbs) }); } + private static void RegisterContainsHelper(IHandlebars hbs) + { + hbs.RegisterHelper("contains", (writer, options, context, arguments) => + { + bool res = false; + if (arguments != null && arguments.Length == 2) + { + foreach (var arg in arguments) + { + res = res || HandlebarsUtils.IsTruthyOrNonEmpty(arg); + } + } + + var arg1 = arguments[0].ToString(); + var arg2 = arguments[1].ToString(); + + if (res && arg2.Contains(arg1)) + { + options.Template(writer, (object)context); + } + else + { + options.Inverse(writer, (object)context); + } + }); + } + } } \ No newline at end of file From 70901f9ad52788743fc5fdbf6cef85742422d10a Mon Sep 17 00:00:00 2001 From: Will Strohl Date: Sun, 28 Jul 2019 12:50:08 -0700 Subject: [PATCH 03/34] Added the missing compile registration --- OpenContent/Components/Handlebars/HandlebarsEngine.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenContent/Components/Handlebars/HandlebarsEngine.cs b/OpenContent/Components/Handlebars/HandlebarsEngine.cs index 323b7037..c24f9d16 100644 --- a/OpenContent/Components/Handlebars/HandlebarsEngine.cs +++ b/OpenContent/Components/Handlebars/HandlebarsEngine.cs @@ -49,6 +49,7 @@ public void Compile(string source) RegisterReplaceNewlineHelper(hbs); RegisterTemplateHelper(hbs); RegisterRawHelper(hbs); + RegisterContainsHelper(hbs); _template = hbs.Compile(source); } catch (Exception ex) From 6de4686f0ce97beb59ee0f647a987f334047fdab Mon Sep 17 00:00:00 2001 From: Will Strohl Date: Wed, 31 Jul 2019 09:15:20 -0700 Subject: [PATCH 04/34] Optimized code suggested by Sacha --- .../Components/Handlebars/HandlebarsEngine.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/OpenContent/Components/Handlebars/HandlebarsEngine.cs b/OpenContent/Components/Handlebars/HandlebarsEngine.cs index c24f9d16..9be95ec6 100644 --- a/OpenContent/Components/Handlebars/HandlebarsEngine.cs +++ b/OpenContent/Components/Handlebars/HandlebarsEngine.cs @@ -1032,16 +1032,12 @@ private static void RegisterContainsHelper(IHandlebars hbs) bool res = false; if (arguments != null && arguments.Length == 2) { - foreach (var arg in arguments) - { - res = res || HandlebarsUtils.IsTruthyOrNonEmpty(arg); - } + var arg1 = arguments[0].ToString(); + var arg2 = arguments[1].ToString(); + res = arg2.Contains(arg1); } - var arg1 = arguments[0].ToString(); - var arg2 = arguments[1].ToString(); - - if (res && arg2.Contains(arg1)) + if (res) { options.Template(writer, (object)context); } From 908c4f590c68d98b4005fb80154bcff5ce073772 Mon Sep 17 00:00:00 2001 From: Will Strohl Date: Wed, 31 Jul 2019 19:37:30 -0700 Subject: [PATCH 05/34] Added the new handlebar helper to the autocomplete --- OpenContent/js/oc.codemirror.js | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenContent/js/oc.codemirror.js b/OpenContent/js/oc.codemirror.js index f6eb6633..57f0cfae 100644 --- a/OpenContent/js/oc.codemirror.js +++ b/OpenContent/js/oc.codemirror.js @@ -411,6 +411,7 @@ function ocSetupCodeMirror(mimeType, elem, model) { { 'text': '{{#unless var}}\n{{/unless}}', 'displayText': 'unless' }, { 'text': '{{#with var}}\n{{/with}}', 'displayText': 'with' }, { 'text': '{{!-- --}}', 'displayText': 'comment' }, + { 'text': '{{#contains lookFor insideOf}}\n{{/contains}}', 'displayText': 'contains' } ]; var razorHelpers = [ From a771256180108158c7938e5a384084376873a1ed Mon Sep 17 00:00:00 2001 From: Robrecht Siera Date: Sat, 24 Aug 2019 07:50:23 +0200 Subject: [PATCH 06/34] add remark regarding issue with large sized Serverside Lists of Data. --- OpenContent/Components/Json/JsonUtils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenContent/Components/Json/JsonUtils.cs b/OpenContent/Components/Json/JsonUtils.cs index 40e3df64..3009b6b3 100644 --- a/OpenContent/Components/Json/JsonUtils.cs +++ b/OpenContent/Components/Json/JsonUtils.cs @@ -103,7 +103,8 @@ public static dynamic JsonToDynamic(string json) public static Dictionary JsonToDictionary(string json) { var jsSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); - Dictionary model = (Dictionary)jsSerializer.DeserializeObject(json); + // next line fails with large amount of data (>4MB). Use a client side template to fix that. + Dictionary model = (Dictionary)jsSerializer.DeserializeObject(json); return model; //return ToDictionaryNoCase(model); } From ddc86c04ee6b182bfaf535a3026a9967048bbcb9 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Fri, 6 Sep 2019 17:25:04 +0200 Subject: [PATCH 07/34] Fix for : TypeError: access to strict mode caller function is censored --- OpenContent/EditSettings.ascx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenContent/EditSettings.ascx b/OpenContent/EditSettings.ascx index fb398a18..790f5491 100644 --- a/OpenContent/EditSettings.ascx +++ b/OpenContent/EditSettings.ascx @@ -137,8 +137,11 @@ var windowTop = parent; //needs to be assign to a varaible for Opera compatibility issues. var popup = windowTop.jQuery("#iPopUp"); - if (popup.length > 0 && windowTop.WebForm_GetElementById('dnn_ctr<%=ModuleId %>_View__UP')) { - windowTop.__doPostBack('dnn_ctr<%=ModuleId %>_View__UP', ''); + if (popup.length > 0 && windowTop.WebForm_GetElementById('dnn_ctr<%=ModuleId %>_View__UP')) { + setTimeout(function () { + windowTop.__doPostBack('dnn_ctr<%=ModuleId %>_View__UP', ''); + }, 1); + //$('#' + 'dnn_ctr' + self.moduleId + '_View__UP').click(); dnnModal.closePopUp(false, href); } From d050e6df56dba10a2bb44cb5874970cd48e4fc83 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Tue, 24 Sep 2019 19:11:50 +0200 Subject: [PATCH 08/34] add jquery events on postRender, beforeSubmit, afterSubmit for content edit forms --- OpenContent/Components/Alpaca/AlpacaEngine.cs | 10 ++++++++++ OpenContent/js/alpacaengine.js | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/OpenContent/Components/Alpaca/AlpacaEngine.cs b/OpenContent/Components/Alpaca/AlpacaEngine.cs index 621945fb..c128419f 100644 --- a/OpenContent/Components/Alpaca/AlpacaEngine.cs +++ b/OpenContent/Components/Alpaca/AlpacaEngine.cs @@ -113,6 +113,16 @@ private void RegisterAlpaca(bool bootstrap, bool loadBootstrap, bool loadGlyphic ClientResourceManager.RegisterScript(Page, "~/DesktopModules/OpenContent/js/alpacaengine.js", FileOrder.Js.DefaultPriority + 10); ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/OpenContent/css/font-awesome/css/font-awesome.min.css", FileOrder.Css.DefaultPriority + 1); + + + string prefix = (string.IsNullOrEmpty(Prefix) ? "" : $"{Prefix}-"); + string physicalDirectory = HostingEnvironment.MapPath("~/" + VirtualDirectory); + string jsFilename = physicalDirectory + "\\" + $"{prefix}edit.js"; + if (File.Exists(jsFilename)) + { + ClientResourceManager.RegisterScript(Page, $"~/{VirtualDirectory}/{prefix}edit.js", FileOrder.Js.DefaultPriority + 11); + } + } public void RegisterTemplates() { diff --git a/OpenContent/js/alpacaengine.js b/OpenContent/js/alpacaengine.js index d9dc6453..8b1d75c9 100644 --- a/OpenContent/js/alpacaengine.js +++ b/OpenContent/js/alpacaengine.js @@ -71,7 +71,6 @@ alpacaEngine.engine = function (config) { $("div.alpaca").parent().addClass('popup'); - $("#" + self.cancelButton).click(function () { dnnModal.closePopUp(false, ""); return false; @@ -216,7 +215,9 @@ alpacaEngine.engine = function (config) { var value = selfControl.getValue(); //alert(JSON.stringify(value, null, " ")); var href = $(button).attr('href'); + $(document).trigger("beforeSubmit.opencontent", [value, self.moduleId, self.data.id, self.sf, self.editAction]); self.FormSubmit(value, href); + $(document).trigger("afterSubmit.opencontent", [value, self.moduleId, self.data.id, self.sf, self.editAction]); } }); return false; @@ -227,7 +228,9 @@ alpacaEngine.engine = function (config) { if (selfControl.isValid(true)) { var value = selfControl.getValue(); var href = $(button).attr('href'); + $(document).trigger("beforeSubmit.opencontent", [value, self.moduleId, self.data.id, self.sf, self.editAction]); self.FormSubmit(value, href, true); + $(document).trigger("afterSubmit.opencontent", [value, self.moduleId, self.data.id, self.sf, self.editAction]); } }); return false; @@ -243,7 +246,7 @@ alpacaEngine.engine = function (config) { self.Version(self.itemId, $(this).val(), control); return false; }); - + $(document).trigger("postRender.opencontent", [selfControl, self.moduleId, self.data.id, self.sf, self.editAction]); } }); From 1a193b30d149b573ceab806aeb91bcf38d0dd961 Mon Sep 17 00:00:00 2001 From: Robrecht Siera Date: Tue, 1 Oct 2019 13:52:24 +0200 Subject: [PATCH 09/34] Throw meaningful error in case we can't deserialize the json data. --- OpenContent/Components/Json/JsonUtils.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenContent/Components/Json/JsonUtils.cs b/OpenContent/Components/Json/JsonUtils.cs index 3009b6b3..9a90d5e6 100644 --- a/OpenContent/Components/Json/JsonUtils.cs +++ b/OpenContent/Components/Json/JsonUtils.cs @@ -100,14 +100,22 @@ public static dynamic JsonToDynamic(string json) var dynamicObject = System.Web.Helpers.Json.Decode(json); return dynamicObject; } + public static Dictionary JsonToDictionary(string json) { var jsSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); + + if(json.Length >= jsSerializer.MaxJsonLength ) + { + //jsSerializer.MaxJsonLength = jsSerializer.MaxJsonLength + 40000; //temp fix + throw new Exception($"Too much data to deserialize. Please use a client side template to circumvent that."); + } // next line fails with large amount of data (>4MB). Use a client side template to fix that. Dictionary model = (Dictionary)jsSerializer.DeserializeObject(json); return model; //return ToDictionaryNoCase(model); } + private static DictionaryNoCase ToDictionaryNoCase(Dictionary dic) { var newDic = new DictionaryNoCase(); From 9c48098ea190d4e740da1e24dabb39dc46bfc73d Mon Sep 17 00:00:00 2001 From: Robrecht Siera Date: Tue, 1 Oct 2019 21:03:27 +0200 Subject: [PATCH 10/34] Add helper to help debug razorfiles --- OpenContent/Components/TemplateHelpers/RazorUtils.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenContent/Components/TemplateHelpers/RazorUtils.cs b/OpenContent/Components/TemplateHelpers/RazorUtils.cs index fabf5542..9e6aa4fa 100644 --- a/OpenContent/Components/TemplateHelpers/RazorUtils.cs +++ b/OpenContent/Components/TemplateHelpers/RazorUtils.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Globalization; using System.Text; @@ -6,6 +7,14 @@ namespace Satrabel.OpenContent.Components.TemplateHelpers { public static class RazorUtils { + /// + /// Helper to quick and easy add a Debug Break in your Razor files, a point from whereon you can start debugging with Visual Studio + /// + public static void Break() + { + Debugger.Break(); + } + /// /// Helper method to obfusticates an email address but keeping the mailto functionality. /// From e370481c34590629837942ce735eedd3fe5a1f15 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Thu, 10 Oct 2019 18:29:14 +0200 Subject: [PATCH 11/34] fil upload in opencontent end user forms --- OpenContent/Components/Form/FormUtils.cs | 53 ++++++++- OpenContent/Components/FormAPIController.cs | 124 +++++++++++++++++++- OpenContent/Submissions.ascx.cs | 23 +++- OpenContent/js/builder/formbuilder.js | 10 +- OpenContent/js/oc.jquery.js | 21 +++- 5 files changed, 213 insertions(+), 18 deletions(-) diff --git a/OpenContent/Components/Form/FormUtils.cs b/OpenContent/Components/Form/FormUtils.cs index 0ed58390..3ff5ad89 100644 --- a/OpenContent/Components/Form/FormUtils.cs +++ b/OpenContent/Components/Form/FormUtils.cs @@ -1,6 +1,7 @@ using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; +using DotNetNuke.Services.FileSystem; using DotNetNuke.Services.Mail; using Newtonsoft.Json.Linq; using Satrabel.OpenContent.Components.Handlebars; @@ -12,7 +13,7 @@ using System.Net.Mail; using System.Text; using System.Text.RegularExpressions; - +using System.Web; namespace Satrabel.OpenContent.Components.Form { @@ -129,13 +130,13 @@ public static string SendMail(string mailFrom, string mailTo, string replyTo, st { return SendMail(mailFrom, mailTo, replyTo, "", "", subject, body); } - public static string SendMail(string mailFrom, string mailTo, string replyTo, string cc, string bcc, string subject, string body) + public static string SendMail(string mailFrom, string mailTo, string replyTo, string cc, string bcc, string subject, string body, List attachments = null) { DotNetNuke.Services.Mail.MailPriority priority = DotNetNuke.Services.Mail.MailPriority.Normal; MailFormat bodyFormat = MailFormat.Html; Encoding bodyEncoding = Encoding.UTF8; - List attachments = new List(); + string smtpServer = Host.SMTPServer; string smtpAuthentication = Host.SMTPAuthentication; string smtpUsername = Host.SMTPUsername; @@ -173,7 +174,19 @@ public static dynamic GenerateFormData(string form, out string formData) formDataS.Append(""); foreach (var item in JObject.Parse(form).Properties()) { - formDataS.Append("").Append("").Append("").Append("").Append(""); + if (item.Name == "Files") + { + var files = item.Value as JArray; + foreach (var file in files) + { + formDataS.Append("").Append("").Append("").Append("").Append(""); + } + } + else + { + formDataS.Append("").Append("").Append("").Append("").Append(""); + } + //formDataS.Append("").Append("").Append("").Append("").Append(""); } formDataS.Append("
").Append(item.Name).Append("").Append(" : ").Append("").Append(item.Value).Append("
").Append("File").Append("").Append(" : ").Append("").Append(file["name"]).Append("
").Append(item.Name).Append("").Append(" : ").Append("").Append(HttpUtility.HtmlEncode(item.Value)).Append("
").Append(item.Name).Append("").Append(" : ").Append("").Append(item.Value).Append("
"); data = JsonUtils.JsonToDynamic(form); @@ -290,8 +303,16 @@ public static JObject FormSubmit(JObject form, SettingsDTO settings, JObject ite { body = hbs.Execute(notification.EmailBody, data); } - - string send = FormUtils.SendMail(from.ToString(), to.ToString(), reply?.ToString() ?? "", notification.CcEmails, notification.BccEmails, notification.EmailSubject, body); + var attachements = new List(); + if (form["Files"] is JArray) + { + foreach (var fileItem in form["Files"] as JArray) + { + var file = FileManager.Instance.GetFile((int)fileItem["id"]); + attachements.Add(new Attachment(FileManager.Instance.GetFileContent(file), fileItem["name"].ToString())); + } + } + string send = FormUtils.SendMail(from.ToString(), to.ToString(), reply?.ToString() ?? "", notification.CcEmails, notification.BccEmails, notification.EmailSubject, body, attachements); if (!string.IsNullOrEmpty(send)) { errors.Add("From:" + from.ToString() + " - To:" + to.ToString() + " - " + send); @@ -367,5 +388,25 @@ private static void ProcessTemplates(HandlebarsEngine hbs, dynamic data, Notific notification.EmailSubject = hbs.Execute(notification.EmailSubject, data); } } + + public static string ToAbsoluteUrl(string relativeUrl) + { + if (string.IsNullOrEmpty(relativeUrl)) + return relativeUrl; + + if (HttpContext.Current == null) + return relativeUrl; + + if (relativeUrl.StartsWith("/")) + relativeUrl = relativeUrl.Insert(0, "~"); + if (!relativeUrl.StartsWith("~/")) + relativeUrl = relativeUrl.Insert(0, "~/"); + + var url = HttpContext.Current.Request.Url; + var port = url.Port != 80 ? (":" + url.Port) : String.Empty; + + return String.Format("{0}://{1}{2}{3}", + url.Scheme, url.Host, port, VirtualPathUtility.ToAbsolute(relativeUrl)); + } } } \ No newline at end of file diff --git a/OpenContent/Components/FormAPIController.cs b/OpenContent/Components/FormAPIController.cs index fe4ceeb5..82bdfbfd 100644 --- a/OpenContent/Components/FormAPIController.cs +++ b/OpenContent/Components/FormAPIController.cs @@ -1,13 +1,22 @@ -using DotNetNuke.Security; +using DotNetNuke.Common; +using DotNetNuke.Entities.Host; +using DotNetNuke.Entities.Icons; +using DotNetNuke.Security; +using DotNetNuke.Services.FileSystem; using DotNetNuke.Web.Api; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Satrabel.OpenContent.Components.Alpaca; using Satrabel.OpenContent.Components.Datasource; using Satrabel.OpenContent.Components.Form; using Satrabel.OpenContent.Components.Logging; using System; +using System.Collections.Generic; +using System.IO; using System.Net; using System.Net.Http; +using System.Text.RegularExpressions; +using System.Web; using System.Web.Http; namespace Satrabel.OpenContent.Components @@ -46,8 +55,35 @@ public HttpResponseMessage Form(string key) [HttpPost] [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.View)] - public HttpResponseMessage Submit(SubmitDTO req) + //public HttpResponseMessage Submit(SubmitDTO req) + public HttpResponseMessage Submit() { + SubmitDTO req = JsonConvert.DeserializeObject(HttpContextSource.Current.Request.Form["data"].ToString()); + //var form = JObject.Parse(HttpContextSource.Current.Request.Form["data"].ToString()); + var form = req.form; + var statuses = new List(); + try + { + //todo can we eliminate the HttpContext here + UploadWholeFile(HttpContextSource.Current, statuses); + var files = new JArray(); + form["Files"] = files; + int i = 1; + foreach (var item in statuses) + { + var file = new JObject(); + file["id"] = item.id; + file["name"] = item.name; + file["url"] = FormUtils.ToAbsoluteUrl(item.url); + files.Add(file); + //form["File"+i] = OpenFormUtils.ToAbsoluteUrl(item.url); + i++; + } + } + catch (Exception exc) + { + Log.Logger.Error(exc); + } try { var data = new JObject(); @@ -71,6 +107,90 @@ public HttpResponseMessage Submit(SubmitDTO req) } } + private void UploadWholeFile(HttpContextBase context, ICollection statuses) + { + IFileManager _fileManager = FileManager.Instance; + IFolderManager _folderManager = FolderManager.Instance; + for (var i = 0; i < context.Request.Files.Count; i++) + { + var file = context.Request.Files[i]; + if (file == null) continue; + + var fileName = FileUploadController.CleanUpFileName(Path.GetFileName(file.FileName)); + + + if (IsAllowedExtension(fileName)) + { + string uploadfolder = "OpenContent/FormFiles/" + ActiveModule.ModuleID; + + if (!string.IsNullOrEmpty(context.Request.Form["uploadfolder"])) + { + uploadfolder = context.Request.Form["uploadfolder"]; + } + var userFolder = _folderManager.GetFolder(PortalSettings.PortalId, uploadfolder); + if (userFolder == null) + { + // Get folder mapping + var folderMapping = FolderMappingController.Instance.GetFolderMapping(PortalSettings.PortalId, "Secure"); + userFolder = _folderManager.AddFolder(folderMapping, uploadfolder); + //userFolder = _folderManager.AddFolder(PortalSettings.PortalId, uploadfolder); + } + int suffix = 0; + string baseFileName = Path.GetFileNameWithoutExtension(fileName); + string extension = Path.GetExtension(fileName); + var fileInfo = _fileManager.GetFile(userFolder, fileName); + while (fileInfo != null) + { + suffix++; + fileName = baseFileName + "-" + suffix + extension; + fileInfo = _fileManager.GetFile(userFolder, fileName); + } + fileInfo = _fileManager.AddFile(userFolder, fileName, file.InputStream, true); + var fileIcon = IconController.IconURL("Ext" + fileInfo.Extension, "32x32"); + if (!File.Exists(context.Server.MapPath(fileIcon))) + { + fileIcon = IconController.IconURL("File", "32x32"); + } + + statuses.Add(new FilesStatus + { + success = true, + name = fileName, + extension = fileInfo.Extension, + type = fileInfo.ContentType, + size = file.ContentLength, + progress = "1.0", + url = _fileManager.GetUrl(fileInfo), + thumbnail_url = fileIcon, + message = "success", + id = fileInfo.FileId, + }); + } + else + { + statuses.Add(new FilesStatus + { + success = false, + name = fileName, + message = "File type not allowed." + }); + } + } + + } + + private static bool IsAllowedExtension(string fileName) + { + var extension = Path.GetExtension(fileName); + + //regex matches a dot followed by 1 or more chars followed by a semi-colon + //regex is meant to block files like "foo.asp;.png" which can take advantage + //of a vulnerability in IIS6 which treasts such files as .asp, not .png + return !string.IsNullOrEmpty(extension) + && Host.AllowedExtensionWhitelist.IsAllowedExtension(extension) + && !Regex.IsMatch(fileName, @"\..+;"); + } + } public class SubmitDTO diff --git a/OpenContent/Submissions.ascx.cs b/OpenContent/Submissions.ascx.cs index df1ff61c..e1559919 100644 --- a/OpenContent/Submissions.ascx.cs +++ b/OpenContent/Submissions.ascx.cs @@ -34,6 +34,14 @@ protected void Page_Load(object sender, EventArgs e) var dynData = GetDataAsListOfDynamics(); gvData.DataSource = ToDataTable(dynData); gvData.DataBind(); + for (int i = 0; i < gvData.Rows.Count; i++) + { + for (int j = 1; j < gvData.Rows[i].Cells.Count; j++) + { + string encoded = gvData.Rows[i].Cells[j].Text; + gvData.Rows[i].Cells[j].Text = Context.Server.HtmlDecode(encoded); + } + } } } catch (Exception exc) //Module failed to load @@ -134,7 +142,20 @@ private static DataTable ToDataTable(IEnumerable items) } else if (value is DynamicJsonArray) { - row.Add(string.Join(";", (DynamicJsonArray)value)); + if (key == "Files") + { + string files = ""; + foreach (dynamic file in (DynamicJsonArray)value) + { + //files = files + ""+file.name+" "; + files = files + "" + file.name + " "; + } + row.Add(files); + } + else + { + row.Add(string.Join(";", (DynamicJsonArray)value)); + } } else { diff --git a/OpenContent/js/builder/formbuilder.js b/OpenContent/js/builder/formbuilder.js index bad5d739..ba43a51a 100644 --- a/OpenContent/js/builder/formbuilder.js +++ b/OpenContent/js/builder/formbuilder.js @@ -648,8 +648,8 @@ var BootstrapHorizontal = false; function showForm(value) { if (ContactForm) { - fieldSchema.properties.fieldtype.enum.splice(9); - fieldOptions.fieldtype.optionLabels.splice(9); + fieldSchema.properties.fieldtype.enum.splice(10); + fieldOptions.fieldtype.optionLabels.splice(10); } if (!Indexable) { @@ -716,7 +716,7 @@ var fieldSchema = "required": true, "title": "Type", "enum": ["text", "checkbox", "multicheckbox", "select", "radio", "textarea", "email", "date", "number", - "image", "imagex", "file", "url", "icon", "guid", "address", + "file", "image", "imagex", "url", "icon", "guid", "address", "array", "table", "accordion", "relation", "related", "folder2", "file2", "url2", "role2", "wysihtml", "summernote", "ckeditor", "gallery", "documents", "object", @@ -831,7 +831,7 @@ var fieldSchema = "type": "string", "title": "Filter pattern" } - } + } }, "folder2options": { "type": "object", @@ -1076,7 +1076,7 @@ var fieldOptions = "fieldtype": { "optionLabels": ["Text", "Checkbox", "Multi checkbox", "Dropdown list (select)", "Radio buttons", "Text area", "Email address", "Date", "Number", - "Image (upload & autocomplete)", "ImageX (cropper, overwrite, ...)", "File (upload & autocomplete)", "Url (autocomplete for pages)", "Font Awesome Icons", "Guid (auto id)", "Address (autocomplete & geocode)", + "File (upload & autocomplete)", "Image (upload & autocomplete)", "ImageX (cropper, overwrite, ...)", "Url (autocomplete for pages)", "Font Awesome Icons", "Guid (auto id)", "Address (autocomplete & geocode)", "List (Panels)", "List (Table)", "List (Accordion)", "Relation (Additional Data)", "Related", "Folder2 (folderID)", "File2 (fileID)", "Url2 (tabID)", "Role2 (roleID)", "Html (Wysihtml)", "Html (Summernote)", "Html (CK Editor)", "Image Gallery", "Documents", "Group (object)", diff --git a/OpenContent/js/oc.jquery.js b/OpenContent/js/oc.jquery.js index 39a20e60..294b9a0b 100644 --- a/OpenContent/js/oc.jquery.js +++ b/OpenContent/js/oc.jquery.js @@ -289,20 +289,33 @@ if (settings.onSubmit) { settings.onSubmit(data); } + + var fd = new FormData(); + $("input[type='file']", elem).each(function () { + var file_data = $(this).prop("files")[0]; + var name = $(this).attr("name"); + fd.append(name, file_data); + + }); + fd.append("data", JSON.stringify({ id: id, form: data, action: settings.action })); + var sf = settings.servicesFramework; $.ajax({ type: "POST", url: sf.getServiceRoot('OpenContent') + "FormAPI/Submit", - contentType: "application/json; charset=utf-8", - dataType: "json", - data: JSON.stringify({ id: id, form: data, action: settings.action }), + //contentType: "application/json; charset=utf-8", + //dataType: "json", + //data: JSON.stringify({ id: id, form: data, action: settings.action }), + contentType: false, + processData: false, + data: fd, beforeSend: sf.setModuleHeaders }).done(function (data) { if (data.Errors && data.Errors.length > 0) { console.log(data.Errors); } if (data.Tracking) { - + // nothing } if (typeof ga === 'function') { ga('send', 'event', { From a3f8d699ab81f35c4e8444a23b55b377d86fdc3c Mon Sep 17 00:00:00 2001 From: Robrecht Siera Date: Tue, 15 Oct 2019 08:38:54 -0700 Subject: [PATCH 12/34] catch errors with failing AutoAttach --- OpenContent/View.ascx.cs | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/OpenContent/View.ascx.cs b/OpenContent/View.ascx.cs index 549658d5..f8fc8b54 100644 --- a/OpenContent/View.ascx.cs +++ b/OpenContent/View.ascx.cs @@ -176,7 +176,7 @@ protected override void OnPreRender(EventArgs e) StringBuilder logScript = new StringBuilder(); //logScript.AppendLine(""); @@ -227,21 +227,28 @@ private void AutoAttachLocalizedModule(ref ModuleInfo module) { // this module is in another language but has already data. // Therefor we will not AutoAttach it, because otherwise all data will be deleted. - + //App.Services.Logger.Info($"Module {module.ModuleID} on Tab {module.TabID} has not been AutoAttached because it already contains data."); //return; } - var mc = (new ModuleController()); - mc.DeLocalizeModule(module); + try + { + var mc = (new ModuleController()); + mc.DeLocalizeModule(module); - mc.ClearCache(defaultModule.TabID); - mc.ClearCache(module.TabID); - const string MODULE_SETTINGS_CACHE_KEY = "ModuleSettings{0}"; // to be compatible with dnn 7.2 - DataCache.RemoveCache(string.Format(MODULE_SETTINGS_CACHE_KEY, defaultModule.TabID)); - DataCache.RemoveCache(string.Format(MODULE_SETTINGS_CACHE_KEY, module.TabID)); + mc.ClearCache(defaultModule.TabID); + mc.ClearCache(module.TabID); + const string MODULE_SETTINGS_CACHE_KEY = "ModuleSettings{0}"; // to be compatible with dnn 7.2 + DataCache.RemoveCache(string.Format(MODULE_SETTINGS_CACHE_KEY, defaultModule.TabID)); + DataCache.RemoveCache(string.Format(MODULE_SETTINGS_CACHE_KEY, module.TabID)); - module = mc.GetModule(defaultModule.ModuleID, ModuleContext.TabId, true); + module = mc.GetModule(defaultModule.ModuleID, ModuleContext.TabId, true); + } + catch (Exception ex) + { + App.Services.Logger.Error($"Module {module.ModuleID} on Tab {module.TabID} has not been AutoAttached because an error occured", ex); + } } private static bool ModuleHasValidConfig(ModuleInfo moduleInfo) @@ -344,7 +351,7 @@ private void AutoSetPermission(ModuleInfo objModule, int roleId) { ModulePermissionController.SaveModulePermissions(objModule); } - catch (Exception ) + catch (Exception) { //App.Services.Logger.Error($"Failed to automaticly set the permission. It already exists? tab={0}, moduletitle={1} ", objModule.TabID ,objModule.ModuleTitle); } @@ -477,6 +484,6 @@ private void RenderHttpException(NotAuthorizedException ex) #endregion } - + } \ No newline at end of file From 1d3a5f824b69d964f271177f81bfdcb269962ab3 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Thu, 17 Oct 2019 15:34:43 +0200 Subject: [PATCH 13/34] fix for template selection on new site --- OpenContent/View.ascx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenContent/View.ascx b/OpenContent/View.ascx index 9739f921..ac0fabcd 100644 --- a/OpenContent/View.ascx +++ b/OpenContent/View.ascx @@ -217,7 +217,7 @@ self.UseTemplate = '1'; self.from = '1'; self.loading = true; - self.apiGet('GetTemplates', { web: true }, function (data) { + self.apiGet('GetNewTemplates', { web: true }, function (data) { self.templates = data; self.loading = false; }); From aeb1ba2f89f948fad313d9d347ee8b238d130aae Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Mon, 21 Oct 2019 12:48:31 +0200 Subject: [PATCH 14/34] generate page url in place of detail url in multi item templates when to detail template defined in manifest --- OpenContent/Components/FeatureController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenContent/Components/FeatureController.cs b/OpenContent/Components/FeatureController.cs index aae2d15a..70310f12 100644 --- a/OpenContent/Components/FeatureController.cs +++ b/OpenContent/Components/FeatureController.cs @@ -194,7 +194,7 @@ private static SearchDocument CreateSearchDocument(ModuleInfo modInfo, OpenConte string url = null; // Check if it is a single or list template - if (settings.Template.IsListTemplate) + if (settings.Template.IsListTemplate && settings.Template.Detail != null) { url = TestableGlobals.Instance.NavigateURL(modInfo.TabID, ps, "", $"id={itemId}"); } From 28b3161240164a3837477aea382ddb4c025e958b Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Mon, 21 Oct 2019 13:10:36 +0200 Subject: [PATCH 15/34] test --- OpenContent/Components/Dnn/DnnUtils.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenContent/Components/Dnn/DnnUtils.cs b/OpenContent/Components/Dnn/DnnUtils.cs index 91b732ec..6d1b9a83 100644 --- a/OpenContent/Components/Dnn/DnnUtils.cs +++ b/OpenContent/Components/Dnn/DnnUtils.cs @@ -213,5 +213,11 @@ public static void UpdateModuleTitle(this ModuleInfo module, string moduleTitle) mc.UpdateModule(mod); } } + + public static void CreateUser() + { + + } + } } \ No newline at end of file From fc561b850d3f8dbd4c7badd37ccd371676d06716 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Mon, 21 Oct 2019 16:46:29 +0200 Subject: [PATCH 16/34] fix authorization issue with EditRole --- OpenContent/Components/Dnn/DnnUsersUtils.cs | 138 ++++++++++++++++++ OpenContent/Components/Dnn/DnnUtils.cs | 5 +- .../Components/OpenContentAPIController.cs | 3 +- OpenContent/OpenContent.csproj | 1 + 4 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 OpenContent/Components/Dnn/DnnUsersUtils.cs diff --git a/OpenContent/Components/Dnn/DnnUsersUtils.cs b/OpenContent/Components/Dnn/DnnUsersUtils.cs new file mode 100644 index 00000000..b5d1bfb1 --- /dev/null +++ b/OpenContent/Components/Dnn/DnnUsersUtils.cs @@ -0,0 +1,138 @@ +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Users; +using DotNetNuke.Security.Membership; +using DotNetNuke.Security.Roles; +using DotNetNuke.Services.Mail; +using Satrabel.OpenContent.Components.Datasource; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace Satrabel.OpenContent.Components.Dnn +{ + public class DnnUsersUtils + { + public static void CreateUserForItems(int TabId, int ModuleId, int userToChangeId, string passPrefix, string passSuffix, string roleName, string titlePath, string emailPath, string firstName) + { + //int ModuleId = 585; // dev 682; + //int TabId = 160; // dev 210; + ModuleController mc = new ModuleController(); + var activeModule = mc.GetModule(ModuleId, TabId, false); + if (activeModule != null) + { + var ocModule = new OpenContentModuleInfo(activeModule); + + //IDataSource ds = DataSourceManager.GetDataSource(module.Settings.Manifest.DataSource); + var dsContext = OpenContentUtils.CreateDataContext(ocModule); + var ds = new OpenContentDataSource(); + var items = ds.GetAll(dsContext); + foreach (var item in items.Items) + { + if (item.CreatedByUserId == userToChangeId) + { + var title = item.Data.SelectToken(titlePath, false)?.ToString(); + var email = item.Data.SelectToken(emailPath, false)?.ToString(); + if (!string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(email)) + { + //var name = title.Replace(" ", "").ToLower(); + var password = (new Guid()).ToString().Substring(0, 10); + int userid =CreateUser(email, passPrefix + item.Id+ passSuffix, firstName, title, email, roleName); + var content = (OpenContentInfo)item.Item; + content.CreatedByUserId = userid; + ds.Update(dsContext, item, item.Data); + } + } + break; + } + } + } + + private static int CreateUser(string username, string password, string firstName, string lastName, string email, string roleName = "") + { + var ps = PortalSettings.Current; + var user = new UserInfo + { + AffiliateID = Null.NullInteger, + PortalID = ps.PortalId, + IsDeleted = false, + IsSuperUser = false, + Profile = new UserProfile() + }; + + //user.LastIPAddress = Request.UserHostAddress + + user.Profile.InitialiseProfile(ps.PortalId, true); + user.Profile.PreferredLocale = ps.DefaultLanguage; + user.Profile.PreferredTimeZone = ps.TimeZone; + + user.Username = username; + user.Membership.Password = password; + //user.DisplayName = DisplayName"]?.ToString() ?? ""; + user.FirstName = firstName; + user.LastName = lastName; + user.Email = email; + //user.Profile.PreferredLocale = data["PreferredLocale"].ToString(); + + //FillUser(data, schema, user); + //FillProfile(data, schema, user, false); + UpdateDisplayName(ps.PortalId, user); + if (string.IsNullOrEmpty(user.DisplayName)) + { + user.DisplayName = user.FirstName + " " + user.LastName; + } + user.Membership.Approved = true; //chkAuthorize.Checked; + var newUser = user; + var createStatus = UserController.CreateUser(ref newUser); + bool notify = true; + if (createStatus == UserCreateStatus.Success) + { + string strMessage = ""; + if (notify) + { + //Send Notification to User + if (ps.UserRegistration == (int)Globals.PortalRegistrationType.VerifiedRegistration) + { + //strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationVerified, ps); + } + else + { + //strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPublic, ps); + } + } + if (!string.IsNullOrEmpty(strMessage)) + { + App.Services.Logger.Error($"Error sending notification email: [{strMessage}]"); + //don't throw error, otherwise item does not get indexed. + //throw new Exception($"Error sending notification email: {strMessage}"); + } + //FillProfile(data, schema, user, true); + //UpdateRoles(context, data, schema, user); + if (!string.IsNullOrEmpty(roleName)) + { + var roleInfo = RoleController.Instance.GetRoleByName(ps.PortalId, roleName); + RoleController.AddUserRole(user, roleInfo, ps, RoleStatus.Approved, Null.NullDate, Null.NullDate, false, false); + } + return user.UserID; + } + else + { + App.Services.Logger.Error($"Creation of user failed with createStatus: {createStatus}"); + throw new DataNotValidException(App.Services.Localizer.GetString(createStatus.ToString()) + " (1)"); + } + + } + private static void UpdateDisplayName(int portalId, UserInfo user) + { + //Update DisplayName to conform to Format + object setting = UserModuleBase.GetSetting(portalId, "Security_DisplayNameFormat"); + if ((setting != null) && (!string.IsNullOrEmpty(Convert.ToString(setting)))) + { + user.UpdateDisplayName(Convert.ToString(setting)); + } + } + } +} \ No newline at end of file diff --git a/OpenContent/Components/Dnn/DnnUtils.cs b/OpenContent/Components/Dnn/DnnUtils.cs index 6d1b9a83..0fea3ec9 100644 --- a/OpenContent/Components/Dnn/DnnUtils.cs +++ b/OpenContent/Components/Dnn/DnnUtils.cs @@ -214,10 +214,7 @@ public static void UpdateModuleTitle(this ModuleInfo module, string moduleTitle) } } - public static void CreateUser() - { - - } + } } \ No newline at end of file diff --git a/OpenContent/Components/OpenContentAPIController.cs b/OpenContent/Components/OpenContentAPIController.cs index 8b3f1cd6..7a75a969 100644 --- a/OpenContent/Components/OpenContentAPIController.cs +++ b/OpenContent/Components/OpenContentAPIController.cs @@ -338,7 +338,7 @@ public HttpResponseMessage EditQuerySettings() /// The req. /// [ValidateAntiForgeryToken] - [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Edit)] + [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.View)] [HttpPost] public HttpResponseMessage LookupData(LookupDataRequestDTO req) { @@ -347,6 +347,7 @@ public HttpResponseMessage LookupData(LookupDataRequestDTO req) { var module = OpenContentModuleConfig.Create(ActiveModule, PortalSettings); + string key = req.dataKey; var additionalDataManifest = module.Settings.Template.Manifest.GetAdditionalData(key); diff --git a/OpenContent/OpenContent.csproj b/OpenContent/OpenContent.csproj index 09f49e15..840ed218 100644 --- a/OpenContent/OpenContent.csproj +++ b/OpenContent/OpenContent.csproj @@ -176,6 +176,7 @@ + From fefbbde5fc51f7e9e412e7e7c358e336a7162093 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Mon, 21 Oct 2019 18:45:27 +0200 Subject: [PATCH 17/34] fix --- OpenContent/Components/Dnn/DnnUsersUtils.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenContent/Components/Dnn/DnnUsersUtils.cs b/OpenContent/Components/Dnn/DnnUsersUtils.cs index b5d1bfb1..7fcd8bcf 100644 --- a/OpenContent/Components/Dnn/DnnUsersUtils.cs +++ b/OpenContent/Components/Dnn/DnnUsersUtils.cs @@ -39,14 +39,21 @@ public static void CreateUserForItems(int TabId, int ModuleId, int userToChangeI if (!string.IsNullOrEmpty(title) && !string.IsNullOrEmpty(email)) { //var name = title.Replace(" ", "").ToLower(); - var password = (new Guid()).ToString().Substring(0, 10); + //var password = (new Guid()).ToString().Substring(0, 10); + try + { + + int userid =CreateUser(email, passPrefix + item.Id+ passSuffix, firstName, title, email, roleName); var content = (OpenContentInfo)item.Item; content.CreatedByUserId = userid; ds.Update(dsContext, item, item.Data); - } + } + catch (Exception) + { + } + } } - break; } } } From e2955a59a2886a1a4ab91a78cbf868b04d8e619e Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Tue, 22 Oct 2019 19:06:03 +0200 Subject: [PATCH 18/34] add even and odd handlebars helper --- .../Components/Handlebars/HandlebarsEngine.cs | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/OpenContent/Components/Handlebars/HandlebarsEngine.cs b/OpenContent/Components/Handlebars/HandlebarsEngine.cs index 9be95ec6..4b36e7b7 100644 --- a/OpenContent/Components/Handlebars/HandlebarsEngine.cs +++ b/OpenContent/Components/Handlebars/HandlebarsEngine.cs @@ -34,6 +34,7 @@ public void Compile(string source) RegisterAdditionHelper(hbs); RegisterSubstractionHelper(hbs); RegisterEqualHelper(hbs); + RegisterOddEvenHelper(hbs); RegisterFormatNumberHelper(hbs); RegisterFormatDateTimeHelper(hbs); RegisterImageUrlHelper(hbs); @@ -109,6 +110,7 @@ private static void RegisterHelpers(IHandlebars hbs) RegisterAdditionHelper(hbs); RegisterSubstractionHelper(hbs); RegisterEqualHelper(hbs); + RegisterOddEvenHelper(hbs); RegisterFormatNumberHelper(hbs); RegisterFormatDateTimeHelper(hbs); RegisterImageUrlHelper(hbs); @@ -362,6 +364,34 @@ private static void RegisterEqualHelper(HandlebarsDotNet.IHandlebars hbs) } }); } + private static void RegisterOddEvenHelper(HandlebarsDotNet.IHandlebars hbs) + { + hbs.RegisterHelper("odd", (writer, options, context, arguments) => + { + int number = 0; + if (arguments.Length == 1 && int.TryParse(arguments[0].ToString(), out number) && number % 2 != 0) + { + options.Template(writer, (object)context); + } + else + { + options.Inverse(writer, (object)context); + } + }); + hbs.RegisterHelper("even", (writer, options, context, arguments) => + { + int number = 0; + if (arguments.Length == 1 && int.TryParse(arguments[0].ToString(), out number) && number % 2 == 0) + { + options.Template(writer, (object)context); + } + else + { + options.Inverse(writer, (object)context); + } + }); + } + private static void RegisterEachPublishedHelper(HandlebarsDotNet.IHandlebars hbs) { hbs.RegisterHelper("published", (writer, options, context, parameters) => @@ -442,7 +472,8 @@ private static void RegisterHandlebarsHelper(HandlebarsDotNet.IHandlebars hbs) private static void RegisterRawHelper(HandlebarsDotNet.IHandlebars hbs) { - hbs.RegisterHelper("raw", (writer, options, context, parameters) => { + hbs.RegisterHelper("raw", (writer, options, context, parameters) => + { options.Template(writer, null); }); @@ -1018,7 +1049,7 @@ private static void RegisterTemplateHelper(HandlebarsDotNet.IHandlebars hbs) var res = hbs2.Execute(html, parameters[1]); writer.WriteSafeString(res); } - catch (Exception ) + catch (Exception) { writer.WriteSafeString(""); } From 40fbd33110cfaa5ecbc3de6aca74ac5cd13031c0 Mon Sep 17 00:00:00 2001 From: Robrecht Siera Date: Mon, 28 Oct 2019 15:43:08 +0100 Subject: [PATCH 19/34] fix issue where Hyperlink button of CKEditor did not work. --- OpenContent/OpenContent.csproj | 67 +++++++++++++++++++ .../js/ckeditor/plugins/dnnpages/lang/af.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ar.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/az.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/bg.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/bn.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/bs.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ca.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/cs.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/cy.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/da.js | 3 +- .../ckeditor/plugins/dnnpages/lang/de-ch.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/de.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/el.js | 3 +- .../ckeditor/plugins/dnnpages/lang/en-au.js | 3 +- .../ckeditor/plugins/dnnpages/lang/en-ca.js | 3 +- .../ckeditor/plugins/dnnpages/lang/en-gb.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/en.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/eo.js | 3 +- .../ckeditor/plugins/dnnpages/lang/es-mx.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/es.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/et.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/eu.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/fa.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/fi.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/fo.js | 3 +- .../ckeditor/plugins/dnnpages/lang/fr-ca.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/gl.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/gu.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/he.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/hi.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/hr.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/hu.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/id.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/is.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/it.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ja.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ka.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/km.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ko.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/ku.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/lt.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/lv.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/mk.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/mn.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/ms.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/nb.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/nl.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/no.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/oc.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/pl.js | 2 +- .../ckeditor/plugins/dnnpages/lang/pt-br.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/pt.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ro.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/ru.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/si.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/sk.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/sl.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/sq.js | 3 +- .../ckeditor/plugins/dnnpages/lang/sr-latn.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/sr.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/sv.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/th.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/tr.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/tt.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/ug.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/uk.js | 3 +- .../js/ckeditor/plugins/dnnpages/lang/vi.js | 3 +- .../ckeditor/plugins/dnnpages/lang/zh-cn.js | 2 +- .../js/ckeditor/plugins/dnnpages/lang/zh.js | 2 +- 70 files changed, 185 insertions(+), 69 deletions(-) diff --git a/OpenContent/OpenContent.csproj b/OpenContent/OpenContent.csproj index 840ed218..8364bf04 100644 --- a/OpenContent/OpenContent.csproj +++ b/OpenContent/OpenContent.csproj @@ -597,9 +597,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/af.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/af.js index 7799930e..1b8d332a 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/af.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/af.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'af', { +CKEDITOR.plugins.setLang( 'dnnpages', 'af', { acccessKey: 'Toegangsleutel', advanced: 'Gevorderd', advisoryContentType: 'Aanbevole inhoudstipe', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'af', { toAnchor: 'Anker in bladsy', toEmail: 'E-pos', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Skakel invoeg/wysig', type: 'Skakelsoort', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ar.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ar.js index 5b770e20..fb1a5a89 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ar.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ar.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ar', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ar', { acccessKey: 'مفاتيح الإختصار', advanced: 'متقدم', advisoryContentType: 'نوع التقرير', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/az.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/az.js index c9770b6e..26fcd543 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/az.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/az.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'az', { +CKEDITOR.plugins.setLang( 'dnnpages', 'az', { acccessKey: 'Qısayol düyməsi', advanced: 'Geniş seçimləri', advisoryContentType: 'Məsləhətli məzmunun növü', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'az', { toAnchor: 'Xeş', toEmail: 'E-poçt', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link', type: 'Linkin növü', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/bg.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/bg.js index 11a43300..303b41ab 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/bg.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/bg.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'bg', { +CKEDITOR.plugins.setLang( 'dnnpages', 'bg', { acccessKey: 'Клавиш за достъп', advanced: 'Разширено', advisoryContentType: 'Тип на съдържанието', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/bn.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/bn.js index 8538889d..be9bc74c 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/bn.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/bn.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'bn', { +CKEDITOR.plugins.setLang( 'dnnpages', 'bn', { acccessKey: 'প্রবেশ কী', advanced: 'এডভান্সড', advisoryContentType: 'পরামর্শ কন্টেন্টের প্রকার', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'bn', { toAnchor: 'এই পেজে নোঙর কর', toEmail: 'ইমেইল', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'লিংক যুক্ত কর', type: 'লিংক প্রকার', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/bs.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/bs.js index b43a1a87..5d2021f5 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/bs.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/bs.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'bs', { +CKEDITOR.plugins.setLang( 'dnnpages', 'bs', { acccessKey: 'Pristupna tipka', advanced: 'Naprednije', advisoryContentType: 'Advisory vrsta sadržaja', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'bs', { toAnchor: 'Sidro na ovoj stranici', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Ubaci/Izmjeni link', type: 'Tip linka', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ca.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ca.js index 6aca4c55..fca31056 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ca.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ca.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ca', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ca', { acccessKey: 'Clau d\'accés', advanced: 'Avançat', advisoryContentType: 'Tipus de contingut consultiu', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'ca', { toAnchor: 'Àncora en aquesta pàgina', toEmail: 'Correu electrònic', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Insereix/Edita enllaç', type: 'Tipus d\'enllaç', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/cs.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/cs.js index 478bc98d..d758f556 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/cs.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/cs.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'cs', { +CKEDITOR.plugins.setLang( 'dnnpages', 'cs', { acccessKey: 'Přístupový klíč', advanced: 'Rozšířené', advisoryContentType: 'Pomocný typ obsahu', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'cs', { toAnchor: 'Kotva v této stránce', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefon', toolbar: 'Odkaz', type: 'Typ odkazu', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/cy.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/cy.js index 4f1e0ce4..4878ef25 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/cy.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/cy.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'cy', { +CKEDITOR.plugins.setLang( 'dnnpages', 'cy', { acccessKey: 'Allwedd Mynediad', advanced: 'Uwch', advisoryContentType: 'Math y Cynnwys Cynghorol', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'cy', { toAnchor: 'Dolen at angor yn y testun', toEmail: 'E-bost', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Dolen', type: 'Math y Ddolen', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/da.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/da.js index 7923be76..6d49881c 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/da.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/da.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'da', { +CKEDITOR.plugins.setLang( 'dnnpages', 'da', { acccessKey: 'Genvejstast', advanced: 'Avanceret', advisoryContentType: 'Indholdstype', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'da', { toAnchor: 'Bogmærke på denne side', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Indsæt/redigér hyperlink', type: 'Type', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/de-ch.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/de-ch.js index 64cf3880..d605752f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/de-ch.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/de-ch.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'de-ch', { +CKEDITOR.plugins.setLang( 'dnnpages', 'de-ch', { acccessKey: 'Zugriffstaste', advanced: 'Erweitert', advisoryContentType: 'Inhaltstyp', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'de-ch', { toAnchor: 'Anker in dieser Seite', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link einfügen/editieren', type: 'Link-Typ', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/de.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/de.js index b58cbdbf..ad07f971 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/de.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/de.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'de', { +CKEDITOR.plugins.setLang( 'dnnpages', 'de', { acccessKey: 'Zugriffstaste', advanced: 'Erweitert', advisoryContentType: 'Inhaltstyp', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'de', { toAnchor: 'Anker in dieser Seite', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link einfügen/editieren', type: 'Link-Typ', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/el.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/el.js index 2d35ecca..394bab3a 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/el.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/el.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'el', { +CKEDITOR.plugins.setLang( 'dnnpages', 'el', { acccessKey: 'Συντόμευση', advanced: 'Για Προχωρημένους', advisoryContentType: 'Ενδεικτικός Τύπος Περιεχομένου', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'el', { toAnchor: 'Άγκυρα σε αυτήν τη σελίδα', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Σύνδεσμος', type: 'Τύπος Συνδέσμου', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-au.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-au.js index 814dbb03..808ff7c5 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-au.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-au.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'en-au', { +CKEDITOR.plugins.setLang( 'dnnpages', 'en-au', { acccessKey: 'Access Key', advanced: 'Advanced', advisoryContentType: 'Advisory Content Type', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'en-au', { toAnchor: 'Link to anchor in the text', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link', type: 'Link Type', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-ca.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-ca.js index 4337f7f1..3bd1d94e 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-ca.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-ca.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'en-ca', { +CKEDITOR.plugins.setLang( 'dnnpages', 'en-ca', { acccessKey: 'Access Key', advanced: 'Advanced', advisoryContentType: 'Advisory Content Type', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'en-ca', { toAnchor: 'Link to anchor in the text', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link', type: 'Link Type', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-gb.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-gb.js index 2474b68e..0532502f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-gb.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en-gb.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'en-gb', { +CKEDITOR.plugins.setLang( 'dnnpages', 'en-gb', { acccessKey: 'Access Key', advanced: 'Advanced', advisoryContentType: 'Advisory Content Type', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'en-gb', { toAnchor: 'Link to anchor in the text', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link', type: 'Link Type', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en.js index 8b1917c3..e10ac911 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/en.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/en.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'en', { +CKEDITOR.plugins.setLang( 'dnnpages', 'en', { acccessKey: 'Access Key', advanced: 'Advanced', advisoryContentType: 'Advisory Content Type', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/eo.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/eo.js index 98dab73a..65dc1853 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/eo.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/eo.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'eo', { +CKEDITOR.plugins.setLang( 'dnnpages', 'eo', { acccessKey: 'Fulmoklavo', advanced: 'Speciala', advisoryContentType: 'Enhavotipo', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'eo', { toAnchor: 'Ankri en tiu ĉi paĝo', toEmail: 'Retpoŝto', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Enmeti/Ŝanĝi Ligilon', type: 'Tipo de Ligilo', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/es-mx.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/es-mx.js index 9d60c8a7..d5b993d0 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/es-mx.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/es-mx.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'es-mx', { +CKEDITOR.plugins.setLang( 'dnnpages', 'es-mx', { acccessKey: 'Llave de acceso', advanced: 'Avanzada', advisoryContentType: 'Tipo de contenido consultivo', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'es-mx', { toAnchor: 'Enlace al ancla en el texto', toEmail: 'Correo electrónico', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Enlace', type: 'Tipo de enlace', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/es.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/es.js index b6c76f51..43311b78 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/es.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/es.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'es', { +CKEDITOR.plugins.setLang( 'dnnpages', 'es', { acccessKey: 'Tecla de Acceso', advanced: 'Avanzado', advisoryContentType: 'Tipo de Contenido', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'es', { toAnchor: 'Referencia en esta página', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Insertar/Editar Vínculo', type: 'Tipo de vínculo', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/et.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/et.js index 186b7dfa..2677f94d 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/et.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/et.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'et', { +CKEDITOR.plugins.setLang( 'dnnpages', 'et', { acccessKey: 'Juurdepääsu võti', advanced: 'Täpsemalt', advisoryContentType: 'Juhendava sisu tüüp', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'et', { toAnchor: 'Ankur sellel lehel', toEmail: 'E-post', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Lingi lisamine/muutmine', type: 'Lingi liik', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/eu.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/eu.js index cb54dc58..173f7b4f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/eu.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/eu.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'eu', { +CKEDITOR.plugins.setLang( 'dnnpages', 'eu', { acccessKey: 'Sarbide-tekla', advanced: 'Aurreratua', advisoryContentType: 'Aholkatutako eduki-mota', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fa.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fa.js index 6e47d3bd..fe8f2703 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fa.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fa.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'fa', { +CKEDITOR.plugins.setLang( 'dnnpages', 'fa', { acccessKey: 'کلید دستیابی', advanced: 'پیشرفته', advisoryContentType: 'نوع محتوای کمکی', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'fa', { toAnchor: 'لنگر در همین صفحه', toEmail: 'پست الکترونیکی', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'گنجاندن/ویرایش پیوند', type: 'نوع پیوند', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fi.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fi.js index 22d3d432..058fa91b 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fi.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fi.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'fi', { +CKEDITOR.plugins.setLang( 'dnnpages', 'fi', { acccessKey: 'Pikanäppäin', advanced: 'Lisäominaisuudet', advisoryContentType: 'Avustava sisällön tyyppi', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fo.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fo.js index 9e48aeb1..41e1fb96 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fo.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fo.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'fo', { +CKEDITOR.plugins.setLang( 'dnnpages', 'fo', { acccessKey: 'Snarvegisknöttur', advanced: 'Fjølbroytt', advisoryContentType: 'Vegleiðandi innihaldsslag', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'fo', { toAnchor: 'Tilknýti til marknastein í tekstinum', toEmail: 'Teldupostur', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Ger/broyt tilknýti', type: 'Tilknýtisslag', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fr-ca.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fr-ca.js index 7d3f885b..1af1e819 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/fr-ca.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/fr-ca.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'fr-ca', { +CKEDITOR.plugins.setLang( 'dnnpages', 'fr-ca', { acccessKey: 'Touche d\'accessibilité', advanced: 'Avancé', advisoryContentType: 'Type de contenu', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'fr-ca', { toAnchor: 'Ancre dans cette page', toEmail: 'Courriel', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Lien', type: 'Type de lien', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/gl.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/gl.js index 72c9db0d..a4d4a475 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/gl.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/gl.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'gl', { +CKEDITOR.plugins.setLang( 'dnnpages', 'gl', { acccessKey: 'Chave de acceso', advanced: 'Avanzado', advisoryContentType: 'Tipo de contido informativo', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'gl', { toAnchor: 'Ligar coa ancoraxe no testo', toEmail: 'Correo', toUrl: 'URL', +toPage: 'Page', toPhone: 'Teléfono', toolbar: 'Ligazón', type: 'Tipo de ligazón', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/gu.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/gu.js index c090d0fe..19ca80bd 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/gu.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/gu.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'gu', { +CKEDITOR.plugins.setLang( 'dnnpages', 'gu', { acccessKey: 'ઍક્સેસ કી', advanced: 'અડ્વાન્સડ', advisoryContentType: 'મુખ્ય કન્ટેન્ટ પ્રકાર', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'gu', { toAnchor: 'આ પેજનો ઍંકર', toEmail: 'ઈ-મેલ', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'લિંક ઇન્સર્ટ/દાખલ કરવી', type: 'લિંક પ્રકાર', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/he.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/he.js index 4defe8f7..f895ca91 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/he.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/he.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'he', { +CKEDITOR.plugins.setLang( 'dnnpages', 'he', { acccessKey: 'מקש גישה', advanced: 'אפשרויות מתקדמות', advisoryContentType: 'Content Type מוצע', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/hi.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/hi.js index a306e052..ccd6d395 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/hi.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/hi.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'hi', { +CKEDITOR.plugins.setLang( 'dnnpages', 'hi', { acccessKey: 'ऍक्सॅस की', advanced: 'ऍड्वान्स्ड', advisoryContentType: 'परामर्श कन्टॅन्ट प्रकार', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'hi', { toAnchor: 'इस पेज का ऐंकर', toEmail: 'ई-मेल', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'लिंक इन्सर्ट/संपादन', type: 'लिंक प्रकार', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/hr.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/hr.js index 74381407..3660f94f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/hr.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/hr.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'hr', { +CKEDITOR.plugins.setLang( 'dnnpages', 'hr', { acccessKey: 'Pristupna tipka', advanced: 'Napredno', advisoryContentType: 'Savjetodavna vrsta sadržaja', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'hr', { toAnchor: 'Sidro na ovoj stranici', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Ubaci/promijeni vezu', type: 'Vrsta veze', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/hu.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/hu.js index f1293b95..107856e8 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/hu.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/hu.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'hu', { +CKEDITOR.plugins.setLang( 'dnnpages', 'hu', { acccessKey: 'Billentyűkombináció', advanced: 'További opciók', advisoryContentType: 'Súgó tartalomtípusa', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'hu', { toAnchor: 'Horgony az oldalon', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Hivatkozás beillesztése/módosítása', type: 'Hivatkozás típusa', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/id.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/id.js index 1b761e26..4d2f96f9 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/id.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/id.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'id', { +CKEDITOR.plugins.setLang( 'dnnpages', 'id', { acccessKey: 'Access Key', // MISSING advanced: 'Advanced', // MISSING advisoryContentType: 'Advisory Content Type', // MISSING @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'id', { toAnchor: 'Link to anchor in the text', // MISSING toEmail: 'E-mail', // MISSING toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Tautan', type: 'Link Type', // MISSING diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/is.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/is.js index 4cf782aa..41c464b9 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/is.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/is.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'is', { +CKEDITOR.plugins.setLang( 'dnnpages', 'is', { acccessKey: 'Skammvalshnappur', advanced: 'Tæknilegt', advisoryContentType: 'Tegund innihalds', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/it.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/it.js index f13a48da..007e483a 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/it.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/it.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'it', { +CKEDITOR.plugins.setLang( 'dnnpages', 'it', { acccessKey: 'Scorciatoia da tastiera', advanced: 'Avanzate', advisoryContentType: 'Tipo della risorsa collegata', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'it', { toAnchor: 'Ancora nel testo', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefono', toolbar: 'Collegamento', type: 'Tipo di Collegamento', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ja.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ja.js index b0f257e1..0c77e022 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ja.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ja.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ja', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ja', { acccessKey: 'アクセスキー', advanced: '高度な設定', advisoryContentType: 'Content Type属性', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'ja', { toAnchor: 'ページ内のアンカー', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'リンク挿入/編集', type: 'リンクタイプ', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ka.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ka.js index 77f748a8..c1717cea 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ka.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ka.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ka', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ka', { acccessKey: 'წვდომის ღილაკი', advanced: 'დაწვრილებით', advisoryContentType: 'შიგთავსის ტიპი', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'ka', { toAnchor: 'ბმული ტექსტში ღუზაზე', toEmail: 'ელფოსტა', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'ბმული', type: 'ბმულის ტიპი', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/km.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/km.js index f0ba5ae8..ff2f2c5c 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/km.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/km.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'km', { +CKEDITOR.plugins.setLang( 'dnnpages', 'km', { acccessKey: 'សោរ​ចូល', advanced: 'កម្រិត​ខ្ពស់', advisoryContentType: 'ប្រភេទអត្ថបទ​ប្រឹក្សា', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'km', { toAnchor: 'ត​ភ្ជាប់​ទៅ​យុថ្កា​ក្នុង​អត្ថបទ', toEmail: 'អ៊ីមែល', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'តំណ', type: 'ប្រភេទ​តំណ', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ko.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ko.js index 2be0dfea..86b79ebc 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ko.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ko.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ko', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ko', { acccessKey: '액세스 키', advanced: '고급', advisoryContentType: '보조 콘텐츠 유형', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ku.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ku.js index 3167d209..a73bf2e0 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ku.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ku.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ku', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ku', { acccessKey: 'کلیلی دەستپێگەیشتن', advanced: 'پێشکەوتوو', advisoryContentType: 'جۆری ناوەڕۆکی ڕاویژکار', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/lt.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/lt.js index cf175a81..bee21bf2 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/lt.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/lt.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'lt', { +CKEDITOR.plugins.setLang( 'dnnpages', 'lt', { acccessKey: 'Prieigos raktas', advanced: 'Papildomas', advisoryContentType: 'Konsultacinio turinio tipas', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/lv.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/lv.js index 0af60a3f..71971ba4 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/lv.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/lv.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'lv', { +CKEDITOR.plugins.setLang( 'dnnpages', 'lv', { acccessKey: 'Pieejas taustiņš', advanced: 'Izvērstais', advisoryContentType: 'Konsultatīvs satura tips', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/mk.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/mk.js index 1ef62a92..7f7a00ed 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/mk.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/mk.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'mk', { +CKEDITOR.plugins.setLang( 'dnnpages', 'mk', { acccessKey: 'Access Key', // MISSING advanced: 'Advanced', // MISSING advisoryContentType: 'Advisory Content Type', // MISSING @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'mk', { toAnchor: 'Link to anchor in the text', // MISSING toEmail: 'E-mail', // MISSING toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Врска', type: 'Link Type', // MISSING diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/mn.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/mn.js index 3f2ef833..a57ef04f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/mn.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/mn.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'mn', { +CKEDITOR.plugins.setLang( 'dnnpages', 'mn', { acccessKey: 'Холбох түлхүүр', advanced: 'Нэмэлт', advisoryContentType: 'Зөвлөлдөх төрлийн агуулга', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ms.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ms.js index 0bb923dd..84e16680 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ms.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ms.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ms', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ms', { acccessKey: 'Kunci Akses', advanced: 'Advanced', advisoryContentType: 'Jenis Kandungan Makluman', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'ms', { toAnchor: 'Pautan dalam muka surat ini', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Masukkan/Sunting Sambungan', type: 'Jenis Sambungan', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/nb.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/nb.js index 6842d8e5..be529adc 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/nb.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/nb.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'nb', { +CKEDITOR.plugins.setLang( 'dnnpages', 'nb', { acccessKey: 'Aksessknapp', advanced: 'Avansert', advisoryContentType: 'Type', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'nb', { toAnchor: 'Lenke til anker i teksten', toEmail: 'E-post', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefon', toolbar: 'Lenke', type: 'Lenketype', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/nl.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/nl.js index 71756394..4cbe751a 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/nl.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/nl.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'nl', { +CKEDITOR.plugins.setLang( 'dnnpages', 'nl', { acccessKey: 'Toegangstoets', advanced: 'Geavanceerd', advisoryContentType: 'Aanbevolen content-type', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'nl', { toAnchor: 'Interne link in pagina', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link invoegen/wijzigen', type: 'Linktype', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/no.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/no.js index dcc6c316..0f91befe 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/no.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/no.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'no', { +CKEDITOR.plugins.setLang( 'dnnpages', 'no', { acccessKey: 'Aksessknapp', advanced: 'Avansert', advisoryContentType: 'Type', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'no', { toAnchor: 'Lenke til anker i teksten', toEmail: 'E-post', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Sett inn/Rediger lenke', type: 'Lenketype', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/oc.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/oc.js index 966d812e..b01203bb 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/oc.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/oc.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'oc', { +CKEDITOR.plugins.setLang( 'dnnpages', 'oc', { acccessKey: 'Tòca d\'accessibilitat', advanced: 'Avançat', advisoryContentType: 'Tipe de contengut (indicatiu)', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'oc', { toAnchor: 'Ancòra', toEmail: 'Corrièl', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Ligam', type: 'Tipe de ligam', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/pl.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/pl.js index a2c36bef..05566bdd 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/pl.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/pl.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'pl', { +CKEDITOR.plugins.setLang( 'dnnpages', 'pl', { acccessKey: 'Klawisz dostępu', advanced: 'Zaawansowane', advisoryContentType: 'Typ MIME obiektu docelowego', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt-br.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt-br.js index 5612ea15..258cad88 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt-br.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt-br.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'pt-br', { +CKEDITOR.plugins.setLang( 'dnnpages', 'pt-br', { acccessKey: 'Chave de Acesso', advanced: 'Avançado', advisoryContentType: 'Tipo de Conteúdo', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'pt-br', { toAnchor: 'Âncora nesta página', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Inserir/Editar Link', type: 'Tipo de hiperlink', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt.js index 80c96231..5b23276a 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/pt.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'pt', { +CKEDITOR.plugins.setLang( 'dnnpages', 'pt', { acccessKey: 'Chave de acesso', advanced: 'Avançado', advisoryContentType: 'Tipo de conteúdo', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'pt', { toAnchor: 'Ligar a âncora no texto', toEmail: 'Email', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefone', toolbar: 'Hiperligação', type: 'Tipo de hiperligação', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ro.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ro.js index bcc78122..997fb25f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ro.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ro.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ro', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ro', { acccessKey: 'Tasta de acces', advanced: 'Avansat', advisoryContentType: 'Tipul consultativ al titlului', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'ro', { toAnchor: 'Ancoră în această pagină', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Inserează/Editează link (legătură web)', type: 'Tipul link-ului (al legăturii web)', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ru.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ru.js index 514d9760..875151cf 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ru.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ru.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ru', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ru', { acccessKey: 'Клавиша доступа', advanced: 'Дополнительно', advisoryContentType: 'Тип содержимого', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/si.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/si.js index 20122d8d..2b44c38c 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/si.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/si.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'si', { +CKEDITOR.plugins.setLang( 'dnnpages', 'si', { acccessKey: 'ප්‍රවේශ යතුර', advanced: 'දීය', advisoryContentType: 'උපදේශාත්මක අන්තර්ගත ආකාරය', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'si', { toAnchor: 'Link to anchor in the text', // MISSING toEmail: 'E-mail', // MISSING toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'සබැඳිය', type: 'Link Type', // MISSING diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sk.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sk.js index 6fba5877..0496d05e 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sk.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sk.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'sk', { +CKEDITOR.plugins.setLang( 'dnnpages', 'sk', { acccessKey: 'Prístupový kľúč', advanced: 'Rozšírené', advisoryContentType: 'Pomocný typ obsahu', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'sk', { toAnchor: 'Odkaz na kotvu v texte', toEmail: 'E-mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefón', toolbar: 'Odkaz', type: 'Typ odkazu', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sl.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sl.js index 3f60026b..b86a9305 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sl.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sl.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'sl', { +CKEDITOR.plugins.setLang( 'dnnpages', 'sl', { acccessKey: 'Tipka za dostop', advanced: 'Napredno', advisoryContentType: 'Predlagana vrsta vsebine', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'sl', { toAnchor: 'Sidro na tej strani', toEmail: 'E-pošta', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Vstavi/uredi povezavo', type: 'Vrsta povezave', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sq.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sq.js index cf1b523d..6568b177 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sq.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sq.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'sq', { +CKEDITOR.plugins.setLang( 'dnnpages', 'sq', { acccessKey: 'Elementi i qasjes', advanced: 'Të përparuara', advisoryContentType: 'Lloji i Përmbajtjes Këshillimorit', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'sq', { toAnchor: 'Lidhu me spirancën në tekst', toEmail: 'Posta Elektronike', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Nyja', type: 'Lloji i Nyjës', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr-latn.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr-latn.js index 40e716f5..d62ca928 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr-latn.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr-latn.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'sr-latn', { +CKEDITOR.plugins.setLang( 'dnnpages', 'sr-latn', { acccessKey: 'Kombinacija tastera', advanced: 'Dalje mogućnosti', advisoryContentType: 'Tip sadržaja pomoći', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'sr-latn', { toAnchor: 'Sidro na ovoj stranici', toEmail: 'E-Mail', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefon', toolbar: 'Unesi/izmeni link', type: 'Vrsta linka', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr.js index 23b44723..1c56b300 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sr.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'sr', { +CKEDITOR.plugins.setLang( 'dnnpages', 'sr', { acccessKey: 'Комбинација тастера', advanced: 'Даље поције', advisoryContentType: 'Тип садржаја помоћи', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sv.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sv.js index 6534524c..551d8421 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/sv.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/sv.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'sv', { +CKEDITOR.plugins.setLang( 'dnnpages', 'sv', { acccessKey: 'Behörighetsnyckel', advanced: 'Avancerad', advisoryContentType: 'Innehållstyp', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'sv', { toAnchor: 'Länk till ankare i texten', toEmail: 'E-post', toUrl: 'URL', +toPage: 'Page', toPhone: 'Telefon', toolbar: 'Infoga/Redigera länk', type: 'Länktyp', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/th.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/th.js index 76718ba8..c2a2e279 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/th.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/th.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'th', { +CKEDITOR.plugins.setLang( 'dnnpages', 'th', { acccessKey: 'แอคเซส คีย์', advanced: 'ขั้นสูง', advisoryContentType: 'ชนิดของคำเกริ่นนำ', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/tr.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/tr.js index 2d9501ff..058c8b14 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/tr.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/tr.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'tr', { +CKEDITOR.plugins.setLang( 'dnnpages', 'tr', { acccessKey: 'Erişim Tuşu', advanced: 'Gelişmiş', advisoryContentType: 'Danışma İçerik Türü', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'tr', { toAnchor: 'Bu sayfada çapa', toEmail: 'E-Posta', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Link Ekle/Düzenle', type: 'Link Türü', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/tt.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/tt.js index 97a9ee55..4f6ec527 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/tt.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/tt.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'tt', { +CKEDITOR.plugins.setLang( 'dnnpages', 'tt', { acccessKey: 'Access Key', // MISSING advanced: 'Киңәйтелгән көйләүләр', advisoryContentType: 'Advisory Content Type', // MISSING diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ug.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ug.js index 799e81fe..f6e84f4a 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/ug.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/ug.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'ug', { +CKEDITOR.plugins.setLang( 'dnnpages', 'ug', { acccessKey: 'زىيارەت كۇنۇپكا', advanced: 'ئالىي', advisoryContentType: 'مەزمۇن تىپى', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/uk.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/uk.js index 0e2d0e09..ada53a21 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/uk.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/uk.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'uk', { +CKEDITOR.plugins.setLang( 'dnnpages', 'uk', { acccessKey: 'Гаряча клавіша', advanced: 'Додаткове', advisoryContentType: 'Тип вмісту', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'uk', { toAnchor: 'Якір на цю сторінку', toEmail: 'Ел. пошта', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Вставити/Редагувати посилання', type: 'Тип посилання', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/vi.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/vi.js index 6589f384..2922a06f 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/vi.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/vi.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'vi', { +CKEDITOR.plugins.setLang( 'dnnpages', 'vi', { acccessKey: 'Phím hỗ trợ truy cập', advanced: 'Mở rộng', advisoryContentType: 'Nội dung hướng dẫn', @@ -62,6 +62,7 @@ CKEDITOR.plugins.setLang( 'link', 'vi', { toAnchor: 'Neo trong trang này', toEmail: 'Thư điện tử', toUrl: 'URL', +toPage: 'Page', toPhone: 'Phone', // MISSING toolbar: 'Chèn/Sửa liên kết', type: 'Kiểu liên kết', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh-cn.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh-cn.js index 4df58393..e0626ccf 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh-cn.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh-cn.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'zh-cn', { +CKEDITOR.plugins.setLang( 'dnnpages', 'zh-cn', { acccessKey: '访问键', advanced: '高级', advisoryContentType: '内容类型', diff --git a/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh.js b/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh.js index a235d02e..58253e27 100644 --- a/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh.js +++ b/OpenContent/js/ckeditor/plugins/dnnpages/lang/zh.js @@ -2,7 +2,7 @@ Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -CKEDITOR.plugins.setLang( 'link', 'zh', { +CKEDITOR.plugins.setLang( 'dnnpages', 'zh', { acccessKey: '便捷鍵', advanced: '進階', advisoryContentType: '建議內容類型', From e532f28c67f2a81f5c794fc6233bf4c870f90d60 Mon Sep 17 00:00:00 2001 From: holoncom Date: Wed, 30 Oct 2019 12:14:33 +0100 Subject: [PATCH 20/34] Fix issue where items with same fieldname (case sensitive) can not not be displayed --- OpenContent/Submissions.ascx.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/OpenContent/Submissions.ascx.cs b/OpenContent/Submissions.ascx.cs index e1559919..d8790716 100644 --- a/OpenContent/Submissions.ascx.cs +++ b/OpenContent/Submissions.ascx.cs @@ -73,15 +73,22 @@ private List GetDataAsListOfDynamics() dynamic o = new ExpandoObject(); var dict = (IDictionary)o; o.CreatedOnDate = item.CreatedOnDate; + o.Id = item.ContentId; o.Title = item.Title; - //o.Json = item.Json; - dynamic d = JsonUtils.JsonToDynamic(item.Json); - //o.Data = d; - Dictionary jdic = Dyn2Dict(d); - foreach (var p in jdic) + try { - dict[p.Key] = p.Value; + dynamic d = JsonUtils.JsonToDynamic(item.Json); + Dictionary jdic = Dyn2Dict(d); + foreach (var p in jdic) + { + dict[p.Key] = p.Value; + } } + catch (Exception e) + { + o.Error = $"Failed to Convert item [{item.ContentId}] to dynamic. Item.CreatedOnDate: {item.CreatedOnDate}"; + } + dynData.Add(o); } return dynData; From f4e4b490a31a42ae7574635e35c7512d147dd16a Mon Sep 17 00:00:00 2001 From: holoncom Date: Wed, 30 Oct 2019 12:17:03 +0100 Subject: [PATCH 21/34] Beautify - bring in line with Edit.cs of OpenForm --- OpenContent/Submissions.ascx | 4 ++-- OpenContent/Submissions.ascx.cs | 27 ++++++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/OpenContent/Submissions.ascx b/OpenContent/Submissions.ascx index aacdd090..c9bf3432 100644 --- a/OpenContent/Submissions.ascx +++ b/OpenContent/Submissions.ascx @@ -4,8 +4,8 @@

- diff --git a/OpenContent/Submissions.ascx.cs b/OpenContent/Submissions.ascx.cs index d8790716..29a7183c 100644 --- a/OpenContent/Submissions.ascx.cs +++ b/OpenContent/Submissions.ascx.cs @@ -31,17 +31,7 @@ protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { - var dynData = GetDataAsListOfDynamics(); - gvData.DataSource = ToDataTable(dynData); - gvData.DataBind(); - for (int i = 0; i < gvData.Rows.Count; i++) - { - for (int j = 1; j < gvData.Rows[i].Cells.Count; j++) - { - string encoded = gvData.Rows[i].Cells[j].Text; - gvData.Rows[i].Cells[j].Text = Context.Server.HtmlDecode(encoded); - } - } + DataBindGrid(); } } catch (Exception exc) //Module failed to load @@ -50,6 +40,21 @@ protected void Page_Load(object sender, EventArgs e) } } + private void DataBindGrid() + { + var dynData = GetDataAsListOfDynamics(); + gvData.DataSource = ToDataTable(dynData); + gvData.DataBind(); + for (int i = 0; i < gvData.Rows.Count; i++) + { + for (int j = 1; j < gvData.Rows[i].Cells.Count; j++) + { + string encoded = gvData.Rows[i].Cells[j].Text; + gvData.Rows[i].Cells[j].Text = Context.Server.HtmlDecode(encoded); + } + } + } + protected void ExcelDownload_Click(object sender, EventArgs e) { var dynData = GetDataAsListOfDynamics(); From 42dfe52408a79653aaa3cdd599c05958dee26d23 Mon Sep 17 00:00:00 2001 From: holoncom Date: Wed, 30 Oct 2019 12:23:54 +0100 Subject: [PATCH 22/34] new feature - Delete submission button implemented. Not tested yet. Copied the feature from OpenForm.Edit.ascx --- OpenContent/Submissions.ascx | 13 +++++++++++-- OpenContent/Submissions.ascx.cs | 11 +++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/OpenContent/Submissions.ascx b/OpenContent/Submissions.ascx index c9bf3432..ec72cf39 100644 --- a/OpenContent/Submissions.ascx +++ b/OpenContent/Submissions.ascx @@ -5,13 +5,22 @@
+ EnableViewState="true" BorderStyle="None" > + + + + + + + + + +
diff --git a/OpenContent/Submissions.ascx.cs b/OpenContent/Submissions.ascx.cs index 29a7183c..b5dc57fb 100644 --- a/OpenContent/Submissions.ascx.cs +++ b/OpenContent/Submissions.ascx.cs @@ -17,6 +17,7 @@ using System.Linq; using System.Web; using System.Web.Helpers; +using System.Web.UI.WebControls; using DotNetNuke.Services.Exceptions; using Satrabel.OpenContent.Components; using Satrabel.OpenContent.Components.Json; @@ -185,5 +186,15 @@ private static DataTable ToDataTable(IEnumerable items) } #endregion + + protected void btnDelete_Click(object sender, EventArgs e) + { + var btn = (Button)sender; + int id = int.Parse(btn.CommandArgument); + OpenContentController ctrl = new OpenContentController(ModuleContext.PortalId); + var data = ctrl.GetContent(id); + ctrl.DeleteContent(data); + DataBindGrid(); + } } } \ No newline at end of file From 0fe393915bd929b567155de17a920ab6d212ec11 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Thu, 31 Oct 2019 10:57:58 +0100 Subject: [PATCH 23/34] new multi language address field --- OpenContent/Components/Alpaca/AlpacaEngine.cs | 2 +- OpenContent/OpenContent.csproj | 1 + .../alpaca/js/fields/dnn/MLAddressField.js | 358 ++++++++++++++++++ OpenContent/alpaca/js/fields/dnn/dnnfields.js | 358 ++++++++++++++++++ OpenContent/bundleconfig.json | 1 + OpenContent/js/builder/formbuilder.js | 2 +- 6 files changed, 720 insertions(+), 2 deletions(-) create mode 100644 OpenContent/alpaca/js/fields/dnn/MLAddressField.js diff --git a/OpenContent/Components/Alpaca/AlpacaEngine.cs b/OpenContent/Components/Alpaca/AlpacaEngine.cs index c128419f..2387895e 100644 --- a/OpenContent/Components/Alpaca/AlpacaEngine.cs +++ b/OpenContent/Components/Alpaca/AlpacaEngine.cs @@ -166,7 +166,7 @@ private void RegisterFields(bool bootstrap) fieldTypes = FieldTypes(options); } } - if (allFields || fieldTypes.Contains("address")) + if (allFields || fieldTypes.Contains("address") || fieldTypes.Contains("mladdress")) { string apikey = App.Services.CreateGlobalSettingsRepository(PortalId).GetGoogleApiKey(); ClientResourceManager.RegisterScript(Page, "//maps.googleapis.com/maps/api/js?v=3.exp&libraries=places" + (string.IsNullOrEmpty(apikey) ? "" : "&key=" + apikey), FileOrder.Js.DefaultPriority); diff --git a/OpenContent/OpenContent.csproj b/OpenContent/OpenContent.csproj index 8364bf04..fabb34c7 100644 --- a/OpenContent/OpenContent.csproj +++ b/OpenContent/OpenContent.csproj @@ -419,6 +419,7 @@ EditFormSettings.ascx + diff --git a/OpenContent/alpaca/js/fields/dnn/MLAddressField.js b/OpenContent/alpaca/js/fields/dnn/MLAddressField.js new file mode 100644 index 00000000..4b755e4a --- /dev/null +++ b/OpenContent/alpaca/js/fields/dnn/MLAddressField.js @@ -0,0 +1,358 @@ +(function ($) { + var Alpaca = $.alpaca; + Alpaca.Fields.MLAddressField = Alpaca.Fields.ObjectField.extend( + { + getFieldType: function () { + return "mladdress"; + }, + constructor: function (container, data, options, schema, view, connector) { + this.base(container, data, options, schema, view, connector); + this.culture = connector.culture; + this.defaultCulture = connector.defaultCulture; + }, + setup: function () { + this.base(); + if (this.data === undefined) { + this.data = { + }; + } + this.schema = { + "title": "Address", + "type": "object", + "properties": { + "search": { + "title": "Search", + "type": "string" + }, + "street": { + "title": "Street", + "type": "string" + }, + "number": { + "title": "House Number", + "type": "string" + }, + "city": { + "title": "City", + "type": "string" + }, + "state": { + "title": "State", + "type": "string", + "enum": ["AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY"] + }, + "postalcode": { + "title": "Postal Code", + "type": "string" + }, + "country": { + "title": "Country", + "type": "string" + }, + "latitude": { + "title": "Latitude", + "type": "number" + }, + "longitude": { + "title": "Longitude", + "type": "number" + } + } + }; + Alpaca.merge(this.options, { + "fields": { + "search": { + "fieldClass": "googlesearch" + }, + "street": { + "type": "mltext", + "fieldClass": "street" + }, + "number": { + "fieldClass": "number" + }, + "city": { + "type": "mltext", + "fieldClass": "city" + }, + "postalcode": { + "fieldClass": "postalcode" + }, + "state": { + "optionLabels": ["ALABAMA", "ALASKA", "AMERICANSAMOA", "ARIZONA", "ARKANSAS", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DELAWARE", "DISTRICTOFCOLUMBIA", "FEDERATEDSTATESOFMICRONESIA", "FLORIDA", "GEORGIA", "GUAM", "HAWAII", "IDAHO", "ILLINOIS", "INDIANA", "IOWA", "KANSAS", "KENTUCKY", "LOUISIANA", "MAINE", "MARSHALLISLANDS", "MARYLAND", "MASSACHUSETTS", "MICHIGAN", "MINNESOTA", "MISSISSIPPI", "MISSOURI", "MONTANA", "NEBRASKA", "NEVADA", "NEWHAMPSHIRE", "NEWJERSEY", "NEWMEXICO", "NEWYORK", "NORTHCAROLINA", "NORTHDAKOTA", "NORTHERNMARIANAISLANDS", "OHIO", "OKLAHOMA", "OREGON", "PALAU", "PENNSYLVANIA", "PUERTORICO", "RHODEISLAND", "SOUTHCAROLINA", "SOUTHDAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VERMONT", "VIRGINISLANDS", "VIRGINIA", "WASHINGTON", "WESTVIRGINIA", "WISCONSIN", "WYOMING"], + "fieldClass": "state", + "hidden": true + }, + "country": { + "type": "country", + "fieldClass": "country" + }, + "latitude": { + "fieldClass": "lat" + }, + "longitude": { + "fieldClass": "lng" + } + } + }); + if (Alpaca.isEmpty(this.options.addressValidation)) { + this.options.addressValidation = true; + } + }, + isContainer: function () { + return false; + }, + getAddress: function () { + var value = this.getValue(); + if (this.view.type === "view") { + value = this.data; + } + var address = ""; + if (value) { + var street = this.getValueOfML(value.street); + if (value.street) { + address += street + " "; + } + if (value.number) { + address += value.number + " "; + } + var city = this.getValueOfML(value.city); + if (value.city) { + address += city + " "; + } + if (value.state) { + address += value.state + " "; + } + if (value.postalcode) { + address += value.postalcode + " "; + } + if (value.country) { + address += countryName(value.country); + } + } + return address; + }, + afterRenderContainer: function (model, callback) { + + var self = this; + + this.base(model, function () { + var container = self.getContainerEl(); + + // apply additional css + $(container).addClass("alpaca-addressfield"); + + if (self.options.addressValidation && !self.isDisplayOnly()) { + $('
').appendTo(container); + var mapButton = $('Geocode Address').appendTo(container); + if (mapButton.button) { + mapButton.button({ + text: true + }); + } + mapButton.click(function () { + + if (google && google.maps) { + var geocoder = new google.maps.Geocoder(); + var address = self.getAddress(); + if (geocoder) { + geocoder.geocode({ + 'address': address + }, function (results, status) { + if (status === google.maps.GeocoderStatus.OK) { + /* + var mapCanvasId = self.getId() + "-map-canvas"; + if ($('#' + mapCanvasId).length === 0) { + $("
").appendTo(self.getFieldEl()); + } + + var map = new google.maps.Map(document.getElementById(self.getId() + "-map-canvas"), { + "zoom": 10, + "center": results[0].geometry.location, + "mapTypeId": google.maps.MapTypeId.ROADMAP + }); + + var marker = new google.maps.Marker({ + map: map, + position: results[0].geometry.location + }); + */ + $(".alpaca-field.lng input.alpaca-control", container).val(results[0].geometry.location.lng()); + $(".alpaca-field.lat input.alpaca-control", container).val(results[0].geometry.location.lat()); + } + else { + self.displayMessage("Geocoding failed: " + status); + } + }); + } + + } + else { + self.displayMessage("Google Map API is not installed."); + } + return false; + }).wrap(''); + + //var mapSearchId = self.getId() + "-map-search"; + //var input = $("
").prependTo(container)[0]; + var input = $(".alpaca-field.googlesearch input.alpaca-control", container)[0]; + //var input = document.getElementById(mapSearchId); + if (input && (typeof google != "undefined") && google && google.maps) { + var searchBox = new google.maps.places.SearchBox(input); + google.maps.event.addListener(searchBox, 'places_changed', function () { + var places = searchBox.getPlaces(); + if (places.length == 0) { + return; + } + var place = places[0]; + $(".alpaca-field.postalcode input.alpaca-control", container).val(addressPart(place, "postal_code")); + $(".alpaca-field.city input.alpaca-control", container).val(addressPart(place, "locality")); + $(".alpaca-field.street input.alpaca-control", container).val(addressPart(place, "route")); + $(".alpaca-field.number input.alpaca-control", container).val(addressPart(place, "street_number")); + $(".alpaca-field.country select.alpaca-control", container).val(countryISO3(addressCountry(place, "country"))); + + $(".alpaca-field.lng input.alpaca-control", container).val(place.geometry.location.lng()); + $(".alpaca-field.lat input.alpaca-control", container).val(place.geometry.location.lat()); + input.value = ''; + + }); + google.maps.event.addDomListener(input, 'keydown', function (e) { + if (e.keyCode == 13) { + e.preventDefault(); + } + }); + } + + if (self.options.showMapOnLoad) { + mapButton.click(); + } + } + + callback(); + + }); + }, + + getType: function () { + return "any"; + }, + getValueOfML(ml) { + if (ml && Alpaca.isObject(ml)) { + if (ml[this.culture]) { + return ml[this.culture]; + } else { + return ""; + } + } else if (ml) { + return ml; + } else { + return ""; + } + } + /* builder_helpers */ + , + getTitle: function () { + return "Address"; + }, + getDescription: function () { + return "Address with Street, City, State, Postal code and Country. Also comes with support for Google map."; + }, + getSchemaOfOptions: function () { + return Alpaca.merge(this.base(), { + "properties": { + "validateAddress": { + "title": "Address Validation", + "description": "Enable address validation if true", + "type": "boolean", + "default": true + }, + "showMapOnLoad": { + "title": "Whether to show the map when first loaded", + "type": "boolean" + } + } + }); + }, + getOptionsForOptions: function () { + return Alpaca.merge(this.base(), { + "fields": { + "validateAddress": { + "helper": "Address validation if checked", + "rightLabel": "Enable Google Map for address validation?", + "type": "checkbox" + } + } + }); + } + + /* end_builder_helpers */ + }); + + function addressPart(place, adrtype) { + var res = ""; + if (place && place.address_components) { + $.each(place.address_components, function (i, comp) { + $.each(comp.types, function (i, comptype) { + if (comptype == adrtype) { + //alert(comp.long_name); + res = comp.long_name; + return; + } + }); + if (res != "") return; + }); + } + return res; + } + function addressCountry(place) { + var res = ""; + if (place && place.address_components) { + $.each(place.address_components, function (i, comp) { + $.each(comp.types, function (i, comptype) { + if (comptype == 'country') { + //alert(comp.long_name); + res = comp.short_name; + return; + } + }); + if (res != "") return; + }); + } + return res; + } + + var countries = [{ "countryName": "Afghanistan", "iso2": "AF", "iso3": "AFG", "phoneCode": "93" }, { "countryName": "Albania", "iso2": "AL", "iso3": "ALB", "phoneCode": "355" }, { "countryName": "Algeria", "iso2": "DZ", "iso3": "DZA", "phoneCode": "213" }, { "countryName": "American Samoa", "iso2": "AS", "iso3": "ASM", "phoneCode": "1 684" }, { "countryName": "Andorra", "iso2": "AD", "iso3": "AND", "phoneCode": "376" }, { "countryName": "Angola", "iso2": "AO", "iso3": "AGO", "phoneCode": "244" }, { "countryName": "Anguilla", "iso2": "AI", "iso3": "AIA", "phoneCode": "1 264" }, { "countryName": "Antarctica", "iso2": "AQ", "iso3": "ATA", "phoneCode": "672" }, { "countryName": "Antigua and Barbuda", "iso2": "AG", "iso3": "ATG", "phoneCode": "1 268" }, { "countryName": "Argentina", "iso2": "AR", "iso3": "ARG", "phoneCode": "54" }, { "countryName": "Armenia", "iso2": "AM", "iso3": "ARM", "phoneCode": "374" }, { "countryName": "Aruba", "iso2": "AW", "iso3": "ABW", "phoneCode": "297" }, { "countryName": "Australia", "iso2": "AU", "iso3": "AUS", "phoneCode": "61" }, { "countryName": "Austria", "iso2": "AT", "iso3": "AUT", "phoneCode": "43" }, { "countryName": "Azerbaijan", "iso2": "AZ", "iso3": "AZE", "phoneCode": "994" }, { "countryName": "Bahamas", "iso2": "BS", "iso3": "BHS", "phoneCode": "1 242" }, { "countryName": "Bahrain", "iso2": "BH", "iso3": "BHR", "phoneCode": "973" }, { "countryName": "Bangladesh", "iso2": "BD", "iso3": "BGD", "phoneCode": "880" }, { "countryName": "Barbados", "iso2": "BB", "iso3": "BRB", "phoneCode": "1 246" }, { "countryName": "Belarus", "iso2": "BY", "iso3": "BLR", "phoneCode": "375" }, { "countryName": "Belgium", "iso2": "BE", "iso3": "BEL", "phoneCode": "32" }, { "countryName": "Belize", "iso2": "BZ", "iso3": "BLZ", "phoneCode": "501" }, { "countryName": "Benin", "iso2": "BJ", "iso3": "BEN", "phoneCode": "229" }, { "countryName": "Bermuda", "iso2": "BM", "iso3": "BMU", "phoneCode": "1 441" }, { "countryName": "Bhutan", "iso2": "BT", "iso3": "BTN", "phoneCode": "975" }, { "countryName": "Bolivia", "iso2": "BO", "iso3": "BOL", "phoneCode": "591" }, { "countryName": "Bosnia and Herzegovina", "iso2": "BA", "iso3": "BIH", "phoneCode": "387" }, { "countryName": "Botswana", "iso2": "BW", "iso3": "BWA", "phoneCode": "267" }, { "countryName": "Brazil", "iso2": "BR", "iso3": "BRA", "phoneCode": "55" }, { "countryName": "British Indian Ocean Territory", "iso2": "IO", "iso3": "IOT", "phoneCode": "" }, { "countryName": "British Virgin Islands", "iso2": "VG", "iso3": "VGB", "phoneCode": "1 284" }, { "countryName": "Brunei", "iso2": "BN", "iso3": "BRN", "phoneCode": "673" }, { "countryName": "Bulgaria", "iso2": "BG", "iso3": "BGR", "phoneCode": "359" }, { "countryName": "Burkina Faso", "iso2": "BF", "iso3": "BFA", "phoneCode": "226" }, { "countryName": "Burma (Myanmar)", "iso2": "MM", "iso3": "MMR", "phoneCode": "95" }, { "countryName": "Burundi", "iso2": "BI", "iso3": "BDI", "phoneCode": "257" }, { "countryName": "Cambodia", "iso2": "KH", "iso3": "KHM", "phoneCode": "855" }, { "countryName": "Cameroon", "iso2": "CM", "iso3": "CMR", "phoneCode": "237" }, { "countryName": "Canada", "iso2": "CA", "iso3": "CAN", "phoneCode": "1" }, { "countryName": "Cape Verde", "iso2": "CV", "iso3": "CPV", "phoneCode": "238" }, { "countryName": "Cayman Islands", "iso2": "KY", "iso3": "CYM", "phoneCode": "1 345" }, { "countryName": "Central African Republic", "iso2": "CF", "iso3": "CAF", "phoneCode": "236" }, { "countryName": "Chad", "iso2": "TD", "iso3": "TCD", "phoneCode": "235" }, { "countryName": "Chile", "iso2": "CL", "iso3": "CHL", "phoneCode": "56" }, { "countryName": "China", "iso2": "CN", "iso3": "CHN", "phoneCode": "86" }, { "countryName": "Christmas Island", "iso2": "CX", "iso3": "CXR", "phoneCode": "61" }, { "countryName": "Cocos (Keeling) Islands", "iso2": "CC", "iso3": "CCK", "phoneCode": "61" }, { "countryName": "Colombia", "iso2": "CO", "iso3": "COL", "phoneCode": "57" }, { "countryName": "Comoros", "iso2": "KM", "iso3": "COM", "phoneCode": "269" }, { "countryName": "Cook Islands", "iso2": "CK", "iso3": "COK", "phoneCode": "682" }, { "countryName": "Costa Rica", "iso2": "CR", "iso3": "CRC", "phoneCode": "506" }, { "countryName": "Croatia", "iso2": "HR", "iso3": "HRV", "phoneCode": "385" }, { "countryName": "Cuba", "iso2": "CU", "iso3": "CUB", "phoneCode": "53" }, { "countryName": "Cyprus", "iso2": "CY", "iso3": "CYP", "phoneCode": "357" }, { "countryName": "Czech Republic", "iso2": "CZ", "iso3": "CZE", "phoneCode": "420" }, { "countryName": "Democratic Republic of the Congo", "iso2": "CD", "iso3": "COD", "phoneCode": "243" }, { "countryName": "Denmark", "iso2": "DK", "iso3": "DNK", "phoneCode": "45" }, { "countryName": "Djibouti", "iso2": "DJ", "iso3": "DJI", "phoneCode": "253" }, { "countryName": "Dominica", "iso2": "DM", "iso3": "DMA", "phoneCode": "1 767" }, { "countryName": "Dominican Republic", "iso2": "DO", "iso3": "DOM", "phoneCode": "1 809" }, { "countryName": "Ecuador", "iso2": "EC", "iso3": "ECU", "phoneCode": "593" }, { "countryName": "Egypt", "iso2": "EG", "iso3": "EGY", "phoneCode": "20" }, { "countryName": "El Salvador", "iso2": "SV", "iso3": "SLV", "phoneCode": "503" }, { "countryName": "Equatorial Guinea", "iso2": "GQ", "iso3": "GNQ", "phoneCode": "240" }, { "countryName": "Eritrea", "iso2": "ER", "iso3": "ERI", "phoneCode": "291" }, { "countryName": "Estonia", "iso2": "EE", "iso3": "EST", "phoneCode": "372" }, { "countryName": "Ethiopia", "iso2": "ET", "iso3": "ETH", "phoneCode": "251" }, { "countryName": "Falkland Islands", "iso2": "FK", "iso3": "FLK", "phoneCode": "500" }, { "countryName": "Faroe Islands", "iso2": "FO", "iso3": "FRO", "phoneCode": "298" }, { "countryName": "Fiji", "iso2": "FJ", "iso3": "FJI", "phoneCode": "679" }, { "countryName": "Finland", "iso2": "FI", "iso3": "FIN", "phoneCode": "358" }, { "countryName": "France", "iso2": "FR", "iso3": "FRA", "phoneCode": "33" }, { "countryName": "French Polynesia", "iso2": "PF", "iso3": "PYF", "phoneCode": "689" }, { "countryName": "Gabon", "iso2": "GA", "iso3": "GAB", "phoneCode": "241" }, { "countryName": "Gambia", "iso2": "GM", "iso3": "GMB", "phoneCode": "220" }, { "countryName": "Gaza Strip", "iso2": "", "iso3": "", "phoneCode": "970" }, { "countryName": "Georgia", "iso2": "GE", "iso3": "GEO", "phoneCode": "995" }, { "countryName": "Germany", "iso2": "DE", "iso3": "DEU", "phoneCode": "49" }, { "countryName": "Ghana", "iso2": "GH", "iso3": "GHA", "phoneCode": "233" }, { "countryName": "Gibraltar", "iso2": "GI", "iso3": "GIB", "phoneCode": "350" }, { "countryName": "Greece", "iso2": "GR", "iso3": "GRC", "phoneCode": "30" }, { "countryName": "Greenland", "iso2": "GL", "iso3": "GRL", "phoneCode": "299" }, { "countryName": "Grenada", "iso2": "GD", "iso3": "GRD", "phoneCode": "1 473" }, { "countryName": "Guam", "iso2": "GU", "iso3": "GUM", "phoneCode": "1 671" }, { "countryName": "Guatemala", "iso2": "GT", "iso3": "GTM", "phoneCode": "502" }, { "countryName": "Guinea", "iso2": "GN", "iso3": "GIN", "phoneCode": "224" }, { "countryName": "Guinea-Bissau", "iso2": "GW", "iso3": "GNB", "phoneCode": "245" }, { "countryName": "Guyana", "iso2": "GY", "iso3": "GUY", "phoneCode": "592" }, { "countryName": "Haiti", "iso2": "HT", "iso3": "HTI", "phoneCode": "509" }, { "countryName": "Holy See (Vatican City)", "iso2": "VA", "iso3": "VAT", "phoneCode": "39" }, { "countryName": "Honduras", "iso2": "HN", "iso3": "HND", "phoneCode": "504" }, { "countryName": "Hong Kong", "iso2": "HK", "iso3": "HKG", "phoneCode": "852" }, { "countryName": "Hungary", "iso2": "HU", "iso3": "HUN", "phoneCode": "36" }, { "countryName": "Iceland", "iso2": "IS", "iso3": "IS", "phoneCode": "354" }, { "countryName": "India", "iso2": "IN", "iso3": "IND", "phoneCode": "91" }, { "countryName": "Indonesia", "iso2": "ID", "iso3": "IDN", "phoneCode": "62" }, { "countryName": "Iran", "iso2": "IR", "iso3": "IRN", "phoneCode": "98" }, { "countryName": "Iraq", "iso2": "IQ", "iso3": "IRQ", "phoneCode": "964" }, { "countryName": "Ireland", "iso2": "IE", "iso3": "IRL", "phoneCode": "353" }, { "countryName": "Isle of Man", "iso2": "IM", "iso3": "IMN", "phoneCode": "44" }, { "countryName": "Israel", "iso2": "IL", "iso3": "ISR", "phoneCode": "972" }, { "countryName": "Italy", "iso2": "IT", "iso3": "ITA", "phoneCode": "39" }, { "countryName": "Ivory Coast", "iso2": "CI", "iso3": "CIV", "phoneCode": "225" }, { "countryName": "Jamaica", "iso2": "JM", "iso3": "JAM", "phoneCode": "1 876" }, { "countryName": "Japan", "iso2": "JP", "iso3": "JPN", "phoneCode": "81" }, { "countryName": "Jersey", "iso2": "JE", "iso3": "JEY", "phoneCode": "" }, { "countryName": "Jordan", "iso2": "JO", "iso3": "JOR", "phoneCode": "962" }, { "countryName": "Kazakhstan", "iso2": "KZ", "iso3": "KAZ", "phoneCode": "7" }, { "countryName": "Kenya", "iso2": "KE", "iso3": "KEN", "phoneCode": "254" }, { "countryName": "Kiribati", "iso2": "KI", "iso3": "KIR", "phoneCode": "686" }, { "countryName": "Kosovo", "iso2": "", "iso3": "", "phoneCode": "381" }, { "countryName": "Kuwait", "iso2": "KW", "iso3": "KWT", "phoneCode": "965" }, { "countryName": "Kyrgyzstan", "iso2": "KG", "iso3": "KGZ", "phoneCode": "996" }, { "countryName": "Laos", "iso2": "LA", "iso3": "LAO", "phoneCode": "856" }, { "countryName": "Latvia", "iso2": "LV", "iso3": "LVA", "phoneCode": "371" }, { "countryName": "Lebanon", "iso2": "LB", "iso3": "LBN", "phoneCode": "961" }, { "countryName": "Lesotho", "iso2": "LS", "iso3": "LSO", "phoneCode": "266" }, { "countryName": "Liberia", "iso2": "LR", "iso3": "LBR", "phoneCode": "231" }, { "countryName": "Libya", "iso2": "LY", "iso3": "LBY", "phoneCode": "218" }, { "countryName": "Liechtenstein", "iso2": "LI", "iso3": "LIE", "phoneCode": "423" }, { "countryName": "Lithuania", "iso2": "LT", "iso3": "LTU", "phoneCode": "370" }, { "countryName": "Luxembourg", "iso2": "LU", "iso3": "LUX", "phoneCode": "352" }, { "countryName": "Macau", "iso2": "MO", "iso3": "MAC", "phoneCode": "853" }, { "countryName": "Macedonia", "iso2": "MK", "iso3": "MKD", "phoneCode": "389" }, { "countryName": "Madagascar", "iso2": "MG", "iso3": "MDG", "phoneCode": "261" }, { "countryName": "Malawi", "iso2": "MW", "iso3": "MWI", "phoneCode": "265" }, { "countryName": "Malaysia", "iso2": "MY", "iso3": "MYS", "phoneCode": "60" }, { "countryName": "Maldives", "iso2": "MV", "iso3": "MDV", "phoneCode": "960" }, { "countryName": "Mali", "iso2": "ML", "iso3": "MLI", "phoneCode": "223" }, { "countryName": "Malta", "iso2": "MT", "iso3": "MLT", "phoneCode": "356" }, { "countryName": "Marshall Islands", "iso2": "MH", "iso3": "MHL", "phoneCode": "692" }, { "countryName": "Mauritania", "iso2": "MR", "iso3": "MRT", "phoneCode": "222" }, { "countryName": "Mauritius", "iso2": "MU", "iso3": "MUS", "phoneCode": "230" }, { "countryName": "Mayotte", "iso2": "YT", "iso3": "MYT", "phoneCode": "262" }, { "countryName": "Mexico", "iso2": "MX", "iso3": "MEX", "phoneCode": "52" }, { "countryName": "Micronesia", "iso2": "FM", "iso3": "FSM", "phoneCode": "691" }, { "countryName": "Moldova", "iso2": "MD", "iso3": "MDA", "phoneCode": "373" }, { "countryName": "Monaco", "iso2": "MC", "iso3": "MCO", "phoneCode": "377" }, { "countryName": "Mongolia", "iso2": "MN", "iso3": "MNG", "phoneCode": "976" }, { "countryName": "Montenegro", "iso2": "ME", "iso3": "MNE", "phoneCode": "382" }, { "countryName": "Montserrat", "iso2": "MS", "iso3": "MSR", "phoneCode": "1 664" }, { "countryName": "Morocco", "iso2": "MA", "iso3": "MAR", "phoneCode": "212" }, { "countryName": "Mozambique", "iso2": "MZ", "iso3": "MOZ", "phoneCode": "258" }, { "countryName": "Namibia", "iso2": "NA", "iso3": "NAM", "phoneCode": "264" }, { "countryName": "Nauru", "iso2": "NR", "iso3": "NRU", "phoneCode": "674" }, { "countryName": "Nepal", "iso2": "NP", "iso3": "NPL", "phoneCode": "977" }, { "countryName": "Netherlands", "iso2": "NL", "iso3": "NLD", "phoneCode": "31" }, { "countryName": "Netherlands Antilles", "iso2": "AN", "iso3": "ANT", "phoneCode": "599" }, { "countryName": "New Caledonia", "iso2": "NC", "iso3": "NCL", "phoneCode": "687" }, { "countryName": "New Zealand", "iso2": "NZ", "iso3": "NZL", "phoneCode": "64" }, { "countryName": "Nicaragua", "iso2": "NI", "iso3": "NIC", "phoneCode": "505" }, { "countryName": "Niger", "iso2": "NE", "iso3": "NER", "phoneCode": "227" }, { "countryName": "Nigeria", "iso2": "NG", "iso3": "NGA", "phoneCode": "234" }, { "countryName": "Niue", "iso2": "NU", "iso3": "NIU", "phoneCode": "683" }, { "countryName": "Norfolk Island", "iso2": "", "iso3": "NFK", "phoneCode": "672" }, { "countryName": "North Korea", "iso2": "KP", "iso3": "PRK", "phoneCode": "850" }, { "countryName": "Northern Mariana Islands", "iso2": "MP", "iso3": "MNP", "phoneCode": "1 670" }, { "countryName": "Norway", "iso2": "NO", "iso3": "NOR", "phoneCode": "47" }, { "countryName": "Oman", "iso2": "OM", "iso3": "OMN", "phoneCode": "968" }, { "countryName": "Pakistan", "iso2": "PK", "iso3": "PAK", "phoneCode": "92" }, { "countryName": "Palau", "iso2": "PW", "iso3": "PLW", "phoneCode": "680" }, { "countryName": "Panama", "iso2": "PA", "iso3": "PAN", "phoneCode": "507" }, { "countryName": "Papua New Guinea", "iso2": "PG", "iso3": "PNG", "phoneCode": "675" }, { "countryName": "Paraguay", "iso2": "PY", "iso3": "PRY", "phoneCode": "595" }, { "countryName": "Peru", "iso2": "PE", "iso3": "PER", "phoneCode": "51" }, { "countryName": "Philippines", "iso2": "PH", "iso3": "PHL", "phoneCode": "63" }, { "countryName": "Pitcairn Islands", "iso2": "PN", "iso3": "PCN", "phoneCode": "870" }, { "countryName": "Poland", "iso2": "PL", "iso3": "POL", "phoneCode": "48" }, { "countryName": "Portugal", "iso2": "PT", "iso3": "PRT", "phoneCode": "351" }, { "countryName": "Puerto Rico", "iso2": "PR", "iso3": "PRI", "phoneCode": "1" }, { "countryName": "Qatar", "iso2": "QA", "iso3": "QAT", "phoneCode": "974" }, { "countryName": "Republic of the Congo", "iso2": "CG", "iso3": "COG", "phoneCode": "242" }, { "countryName": "Romania", "iso2": "RO", "iso3": "ROU", "phoneCode": "40" }, { "countryName": "Russia", "iso2": "RU", "iso3": "RUS", "phoneCode": "7" }, { "countryName": "Rwanda", "iso2": "RW", "iso3": "RWA", "phoneCode": "250" }, { "countryName": "Saint Barthelemy", "iso2": "BL", "iso3": "BLM", "phoneCode": "590" }, { "countryName": "Saint Helena", "iso2": "SH", "iso3": "SHN", "phoneCode": "290" }, { "countryName": "Saint Kitts and Nevis", "iso2": "KN", "iso3": "KNA", "phoneCode": "1 869" }, { "countryName": "Saint Lucia", "iso2": "LC", "iso3": "LCA", "phoneCode": "1 758" }, { "countryName": "Saint Martin", "iso2": "MF", "iso3": "MAF", "phoneCode": "1 599" }, { "countryName": "Saint Pierre and Miquelon", "iso2": "PM", "iso3": "SPM", "phoneCode": "508" }, { "countryName": "Saint Vincent and the Grenadines", "iso2": "VC", "iso3": "VCT", "phoneCode": "1 784" }, { "countryName": "Samoa", "iso2": "WS", "iso3": "WSM", "phoneCode": "685" }, { "countryName": "San Marino", "iso2": "SM", "iso3": "SMR", "phoneCode": "378" }, { "countryName": "Sao Tome and Principe", "iso2": "ST", "iso3": "STP", "phoneCode": "239" }, { "countryName": "Saudi Arabia", "iso2": "SA", "iso3": "SAU", "phoneCode": "966" }, { "countryName": "Senegal", "iso2": "SN", "iso3": "SEN", "phoneCode": "221" }, { "countryName": "Serbia", "iso2": "RS", "iso3": "SRB", "phoneCode": "381" }, { "countryName": "Seychelles", "iso2": "SC", "iso3": "SYC", "phoneCode": "248" }, { "countryName": "Sierra Leone", "iso2": "SL", "iso3": "SLE", "phoneCode": "232" }, { "countryName": "Singapore", "iso2": "SG", "iso3": "SGP", "phoneCode": "65" }, { "countryName": "Slovakia", "iso2": "SK", "iso3": "SVK", "phoneCode": "421" }, { "countryName": "Slovenia", "iso2": "SI", "iso3": "SVN", "phoneCode": "386" }, { "countryName": "Solomon Islands", "iso2": "SB", "iso3": "SLB", "phoneCode": "677" }, { "countryName": "Somalia", "iso2": "SO", "iso3": "SOM", "phoneCode": "252" }, { "countryName": "South Africa", "iso2": "ZA", "iso3": "ZAF", "phoneCode": "27" }, { "countryName": "South Korea", "iso2": "KR", "iso3": "KOR", "phoneCode": "82" }, { "countryName": "Spain", "iso2": "ES", "iso3": "ESP", "phoneCode": "34" }, { "countryName": "Sri Lanka", "iso2": "LK", "iso3": "LKA", "phoneCode": "94" }, { "countryName": "Sudan", "iso2": "SD", "iso3": "SDN", "phoneCode": "249" }, { "countryName": "Suriname", "iso2": "SR", "iso3": "SUR", "phoneCode": "597" }, { "countryName": "Svalbard", "iso2": "SJ", "iso3": "SJM", "phoneCode": "" }, { "countryName": "Swaziland", "iso2": "SZ", "iso3": "SWZ", "phoneCode": "268" }, { "countryName": "Sweden", "iso2": "SE", "iso3": "SWE", "phoneCode": "46" }, { "countryName": "Switzerland", "iso2": "CH", "iso3": "CHE", "phoneCode": "41" }, { "countryName": "Syria", "iso2": "SY", "iso3": "SYR", "phoneCode": "963" }, { "countryName": "Taiwan", "iso2": "TW", "iso3": "TWN", "phoneCode": "886" }, { "countryName": "Tajikistan", "iso2": "TJ", "iso3": "TJK", "phoneCode": "992" }, { "countryName": "Tanzania", "iso2": "TZ", "iso3": "TZA", "phoneCode": "255" }, { "countryName": "Thailand", "iso2": "TH", "iso3": "THA", "phoneCode": "66" }, { "countryName": "Timor-Leste", "iso2": "TL", "iso3": "TLS", "phoneCode": "670" }, { "countryName": "Togo", "iso2": "TG", "iso3": "TGO", "phoneCode": "228" }, { "countryName": "Tokelau", "iso2": "TK", "iso3": "TKL", "phoneCode": "690" }, { "countryName": "Tonga", "iso2": "TO", "iso3": "TON", "phoneCode": "676" }, { "countryName": "Trinidad and Tobago", "iso2": "TT", "iso3": "TTO", "phoneCode": "1 868" }, { "countryName": "Tunisia", "iso2": "TN", "iso3": "TUN", "phoneCode": "216" }, { "countryName": "Turkey", "iso2": "TR", "iso3": "TUR", "phoneCode": "90" }, { "countryName": "Turkmenistan", "iso2": "TM", "iso3": "TKM", "phoneCode": "993" }, { "countryName": "Turks and Caicos Islands", "iso2": "TC", "iso3": "TCA", "phoneCode": "1 649" }, { "countryName": "Tuvalu", "iso2": "TV", "iso3": "TUV", "phoneCode": "688" }, { "countryName": "Uganda", "iso2": "UG", "iso3": "UGA", "phoneCode": "256" }, { "countryName": "Ukraine", "iso2": "UA", "iso3": "UKR", "phoneCode": "380" }, { "countryName": "United Arab Emirates", "iso2": "AE", "iso3": "ARE", "phoneCode": "971" }, { "countryName": "United Kingdom", "iso2": "GB", "iso3": "GBR", "phoneCode": "44" }, { "countryName": "United States", "iso2": "US", "iso3": "USA", "phoneCode": "1" }, { "countryName": "Uruguay", "iso2": "UY", "iso3": "URY", "phoneCode": "598" }, { "countryName": "US Virgin Islands", "iso2": "VI", "iso3": "VIR", "phoneCode": "1 340" }, { "countryName": "Uzbekistan", "iso2": "UZ", "iso3": "UZB", "phoneCode": "998" }, { "countryName": "Vanuatu", "iso2": "VU", "iso3": "VUT", "phoneCode": "678" }, { "countryName": "Venezuela", "iso2": "VE", "iso3": "VEN", "phoneCode": "58" }, { "countryName": "Vietnam", "iso2": "VN", "iso3": "VNM", "phoneCode": "84" }, { "countryName": "Wallis and Futuna", "iso2": "WF", "iso3": "WLF", "phoneCode": "681" }, { "countryName": "West Bank", "iso2": "", "iso3": "", "phoneCode": "970" }, { "countryName": "Western Sahara", "iso2": "EH", "iso3": "ESH", "phoneCode": "" }, { "countryName": "Yemen", "iso2": "YE", "iso3": "YEM", "phoneCode": "967" }, { "countryName": "Zambia", "iso2": "ZM", "iso3": "ZMB", "phoneCode": "260" }, { "countryName": "Zimbabwe", "iso2": "ZW", "iso3": "ZWE", "phoneCode": "263" }]; + + function countryISO2(iso3) { + iso2 = iso2.toUpperCase(); + for (index = 0; index < countries.length; ++index) { + if (countries[index].iso3 === iso3) { + return countries[index].iso2; + } + } + return ""; + } + + function countryISO3(iso2) { + iso2 = iso2.toUpperCase(); + for (index = 0; index < countries.length; ++index) { + if (countries[index].iso2 === iso2) { + return countries[index].iso3.toLowerCase(); + } + } + return ""; + } + + function countryName(iso3) { + iso3 = iso3.toUpperCase(); + for (index = 0; index < countries.length; ++index) { + if (countries[index].iso3 === iso3) { + return countries[index].countryName; + } + } + return ""; + } + + Alpaca.registerFieldClass("mladdress", Alpaca.Fields.MLAddressField); + +})(jQuery); \ No newline at end of file diff --git a/OpenContent/alpaca/js/fields/dnn/dnnfields.js b/OpenContent/alpaca/js/fields/dnn/dnnfields.js index 3c63b95a..544e1730 100644 --- a/OpenContent/alpaca/js/fields/dnn/dnnfields.js +++ b/OpenContent/alpaca/js/fields/dnn/dnnfields.js @@ -394,6 +394,364 @@ Alpaca.registerFieldClass("address", Alpaca.Fields.AddressField); +})(jQuery); +(function ($) { + var Alpaca = $.alpaca; + Alpaca.Fields.MLAddressField = Alpaca.Fields.ObjectField.extend( + { + getFieldType: function () { + return "mladdress"; + }, + constructor: function (container, data, options, schema, view, connector) { + this.base(container, data, options, schema, view, connector); + this.culture = connector.culture; + this.defaultCulture = connector.defaultCulture; + }, + setup: function () { + this.base(); + if (this.data === undefined) { + this.data = { + }; + } + this.schema = { + "title": "Address", + "type": "object", + "properties": { + "search": { + "title": "Search", + "type": "string" + }, + "street": { + "title": "Street", + "type": "string" + }, + "number": { + "title": "House Number", + "type": "string" + }, + "city": { + "title": "City", + "type": "string" + }, + "state": { + "title": "State", + "type": "string", + "enum": ["AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY"] + }, + "postalcode": { + "title": "Postal Code", + "type": "string" + }, + "country": { + "title": "Country", + "type": "string" + }, + "latitude": { + "title": "Latitude", + "type": "number" + }, + "longitude": { + "title": "Longitude", + "type": "number" + } + } + }; + Alpaca.merge(this.options, { + "fields": { + "search": { + "fieldClass": "googlesearch" + }, + "street": { + "type": "mltext", + "fieldClass": "street" + }, + "number": { + "fieldClass": "number" + }, + "city": { + "type": "mltext", + "fieldClass": "city" + }, + "postalcode": { + "fieldClass": "postalcode" + }, + "state": { + "optionLabels": ["ALABAMA", "ALASKA", "AMERICANSAMOA", "ARIZONA", "ARKANSAS", "CALIFORNIA", "COLORADO", "CONNECTICUT", "DELAWARE", "DISTRICTOFCOLUMBIA", "FEDERATEDSTATESOFMICRONESIA", "FLORIDA", "GEORGIA", "GUAM", "HAWAII", "IDAHO", "ILLINOIS", "INDIANA", "IOWA", "KANSAS", "KENTUCKY", "LOUISIANA", "MAINE", "MARSHALLISLANDS", "MARYLAND", "MASSACHUSETTS", "MICHIGAN", "MINNESOTA", "MISSISSIPPI", "MISSOURI", "MONTANA", "NEBRASKA", "NEVADA", "NEWHAMPSHIRE", "NEWJERSEY", "NEWMEXICO", "NEWYORK", "NORTHCAROLINA", "NORTHDAKOTA", "NORTHERNMARIANAISLANDS", "OHIO", "OKLAHOMA", "OREGON", "PALAU", "PENNSYLVANIA", "PUERTORICO", "RHODEISLAND", "SOUTHCAROLINA", "SOUTHDAKOTA", "TENNESSEE", "TEXAS", "UTAH", "VERMONT", "VIRGINISLANDS", "VIRGINIA", "WASHINGTON", "WESTVIRGINIA", "WISCONSIN", "WYOMING"], + "fieldClass": "state", + "hidden": true + }, + "country": { + "type": "country", + "fieldClass": "country" + }, + "latitude": { + "fieldClass": "lat" + }, + "longitude": { + "fieldClass": "lng" + } + } + }); + if (Alpaca.isEmpty(this.options.addressValidation)) { + this.options.addressValidation = true; + } + }, + isContainer: function () { + return false; + }, + getAddress: function () { + var value = this.getValue(); + if (this.view.type === "view") { + value = this.data; + } + var address = ""; + if (value) { + var street = this.getValueOfML(value.street); + if (value.street) { + address += street + " "; + } + if (value.number) { + address += value.number + " "; + } + var city = this.getValueOfML(value.city); + if (value.city) { + address += city + " "; + } + if (value.state) { + address += value.state + " "; + } + if (value.postalcode) { + address += value.postalcode + " "; + } + if (value.country) { + address += countryName(value.country); + } + } + return address; + }, + afterRenderContainer: function (model, callback) { + + var self = this; + + this.base(model, function () { + var container = self.getContainerEl(); + + // apply additional css + $(container).addClass("alpaca-addressfield"); + + if (self.options.addressValidation && !self.isDisplayOnly()) { + $('
').appendTo(container); + var mapButton = $('Geocode Address').appendTo(container); + if (mapButton.button) { + mapButton.button({ + text: true + }); + } + mapButton.click(function () { + + if (google && google.maps) { + var geocoder = new google.maps.Geocoder(); + var address = self.getAddress(); + if (geocoder) { + geocoder.geocode({ + 'address': address + }, function (results, status) { + if (status === google.maps.GeocoderStatus.OK) { + /* + var mapCanvasId = self.getId() + "-map-canvas"; + if ($('#' + mapCanvasId).length === 0) { + $("
").appendTo(self.getFieldEl()); + } + + var map = new google.maps.Map(document.getElementById(self.getId() + "-map-canvas"), { + "zoom": 10, + "center": results[0].geometry.location, + "mapTypeId": google.maps.MapTypeId.ROADMAP + }); + + var marker = new google.maps.Marker({ + map: map, + position: results[0].geometry.location + }); + */ + $(".alpaca-field.lng input.alpaca-control", container).val(results[0].geometry.location.lng()); + $(".alpaca-field.lat input.alpaca-control", container).val(results[0].geometry.location.lat()); + } + else { + self.displayMessage("Geocoding failed: " + status); + } + }); + } + + } + else { + self.displayMessage("Google Map API is not installed."); + } + return false; + }).wrap(''); + + //var mapSearchId = self.getId() + "-map-search"; + //var input = $("").prependTo(container)[0]; + var input = $(".alpaca-field.googlesearch input.alpaca-control", container)[0]; + //var input = document.getElementById(mapSearchId); + if (input && (typeof google != "undefined") && google && google.maps) { + var searchBox = new google.maps.places.SearchBox(input); + google.maps.event.addListener(searchBox, 'places_changed', function () { + var places = searchBox.getPlaces(); + if (places.length == 0) { + return; + } + var place = places[0]; + $(".alpaca-field.postalcode input.alpaca-control", container).val(addressPart(place, "postal_code")); + $(".alpaca-field.city input.alpaca-control", container).val(addressPart(place, "locality")); + $(".alpaca-field.street input.alpaca-control", container).val(addressPart(place, "route")); + $(".alpaca-field.number input.alpaca-control", container).val(addressPart(place, "street_number")); + $(".alpaca-field.country select.alpaca-control", container).val(countryISO3(addressCountry(place, "country"))); + + $(".alpaca-field.lng input.alpaca-control", container).val(place.geometry.location.lng()); + $(".alpaca-field.lat input.alpaca-control", container).val(place.geometry.location.lat()); + input.value = ''; + + }); + google.maps.event.addDomListener(input, 'keydown', function (e) { + if (e.keyCode == 13) { + e.preventDefault(); + } + }); + } + + if (self.options.showMapOnLoad) { + mapButton.click(); + } + } + + callback(); + + }); + }, + + getType: function () { + return "any"; + }, + getValueOfML(ml) { + if (ml && Alpaca.isObject(ml)) { + if (ml[this.culture]) { + return ml[this.culture]; + } else { + return ""; + } + } else if (ml) { + return ml; + } else { + return ""; + } + } + /* builder_helpers */ + , + getTitle: function () { + return "Address"; + }, + getDescription: function () { + return "Address with Street, City, State, Postal code and Country. Also comes with support for Google map."; + }, + getSchemaOfOptions: function () { + return Alpaca.merge(this.base(), { + "properties": { + "validateAddress": { + "title": "Address Validation", + "description": "Enable address validation if true", + "type": "boolean", + "default": true + }, + "showMapOnLoad": { + "title": "Whether to show the map when first loaded", + "type": "boolean" + } + } + }); + }, + getOptionsForOptions: function () { + return Alpaca.merge(this.base(), { + "fields": { + "validateAddress": { + "helper": "Address validation if checked", + "rightLabel": "Enable Google Map for address validation?", + "type": "checkbox" + } + } + }); + } + + /* end_builder_helpers */ + }); + + function addressPart(place, adrtype) { + var res = ""; + if (place && place.address_components) { + $.each(place.address_components, function (i, comp) { + $.each(comp.types, function (i, comptype) { + if (comptype == adrtype) { + //alert(comp.long_name); + res = comp.long_name; + return; + } + }); + if (res != "") return; + }); + } + return res; + } + function addressCountry(place) { + var res = ""; + if (place && place.address_components) { + $.each(place.address_components, function (i, comp) { + $.each(comp.types, function (i, comptype) { + if (comptype == 'country') { + //alert(comp.long_name); + res = comp.short_name; + return; + } + }); + if (res != "") return; + }); + } + return res; + } + + var countries = [{ "countryName": "Afghanistan", "iso2": "AF", "iso3": "AFG", "phoneCode": "93" }, { "countryName": "Albania", "iso2": "AL", "iso3": "ALB", "phoneCode": "355" }, { "countryName": "Algeria", "iso2": "DZ", "iso3": "DZA", "phoneCode": "213" }, { "countryName": "American Samoa", "iso2": "AS", "iso3": "ASM", "phoneCode": "1 684" }, { "countryName": "Andorra", "iso2": "AD", "iso3": "AND", "phoneCode": "376" }, { "countryName": "Angola", "iso2": "AO", "iso3": "AGO", "phoneCode": "244" }, { "countryName": "Anguilla", "iso2": "AI", "iso3": "AIA", "phoneCode": "1 264" }, { "countryName": "Antarctica", "iso2": "AQ", "iso3": "ATA", "phoneCode": "672" }, { "countryName": "Antigua and Barbuda", "iso2": "AG", "iso3": "ATG", "phoneCode": "1 268" }, { "countryName": "Argentina", "iso2": "AR", "iso3": "ARG", "phoneCode": "54" }, { "countryName": "Armenia", "iso2": "AM", "iso3": "ARM", "phoneCode": "374" }, { "countryName": "Aruba", "iso2": "AW", "iso3": "ABW", "phoneCode": "297" }, { "countryName": "Australia", "iso2": "AU", "iso3": "AUS", "phoneCode": "61" }, { "countryName": "Austria", "iso2": "AT", "iso3": "AUT", "phoneCode": "43" }, { "countryName": "Azerbaijan", "iso2": "AZ", "iso3": "AZE", "phoneCode": "994" }, { "countryName": "Bahamas", "iso2": "BS", "iso3": "BHS", "phoneCode": "1 242" }, { "countryName": "Bahrain", "iso2": "BH", "iso3": "BHR", "phoneCode": "973" }, { "countryName": "Bangladesh", "iso2": "BD", "iso3": "BGD", "phoneCode": "880" }, { "countryName": "Barbados", "iso2": "BB", "iso3": "BRB", "phoneCode": "1 246" }, { "countryName": "Belarus", "iso2": "BY", "iso3": "BLR", "phoneCode": "375" }, { "countryName": "Belgium", "iso2": "BE", "iso3": "BEL", "phoneCode": "32" }, { "countryName": "Belize", "iso2": "BZ", "iso3": "BLZ", "phoneCode": "501" }, { "countryName": "Benin", "iso2": "BJ", "iso3": "BEN", "phoneCode": "229" }, { "countryName": "Bermuda", "iso2": "BM", "iso3": "BMU", "phoneCode": "1 441" }, { "countryName": "Bhutan", "iso2": "BT", "iso3": "BTN", "phoneCode": "975" }, { "countryName": "Bolivia", "iso2": "BO", "iso3": "BOL", "phoneCode": "591" }, { "countryName": "Bosnia and Herzegovina", "iso2": "BA", "iso3": "BIH", "phoneCode": "387" }, { "countryName": "Botswana", "iso2": "BW", "iso3": "BWA", "phoneCode": "267" }, { "countryName": "Brazil", "iso2": "BR", "iso3": "BRA", "phoneCode": "55" }, { "countryName": "British Indian Ocean Territory", "iso2": "IO", "iso3": "IOT", "phoneCode": "" }, { "countryName": "British Virgin Islands", "iso2": "VG", "iso3": "VGB", "phoneCode": "1 284" }, { "countryName": "Brunei", "iso2": "BN", "iso3": "BRN", "phoneCode": "673" }, { "countryName": "Bulgaria", "iso2": "BG", "iso3": "BGR", "phoneCode": "359" }, { "countryName": "Burkina Faso", "iso2": "BF", "iso3": "BFA", "phoneCode": "226" }, { "countryName": "Burma (Myanmar)", "iso2": "MM", "iso3": "MMR", "phoneCode": "95" }, { "countryName": "Burundi", "iso2": "BI", "iso3": "BDI", "phoneCode": "257" }, { "countryName": "Cambodia", "iso2": "KH", "iso3": "KHM", "phoneCode": "855" }, { "countryName": "Cameroon", "iso2": "CM", "iso3": "CMR", "phoneCode": "237" }, { "countryName": "Canada", "iso2": "CA", "iso3": "CAN", "phoneCode": "1" }, { "countryName": "Cape Verde", "iso2": "CV", "iso3": "CPV", "phoneCode": "238" }, { "countryName": "Cayman Islands", "iso2": "KY", "iso3": "CYM", "phoneCode": "1 345" }, { "countryName": "Central African Republic", "iso2": "CF", "iso3": "CAF", "phoneCode": "236" }, { "countryName": "Chad", "iso2": "TD", "iso3": "TCD", "phoneCode": "235" }, { "countryName": "Chile", "iso2": "CL", "iso3": "CHL", "phoneCode": "56" }, { "countryName": "China", "iso2": "CN", "iso3": "CHN", "phoneCode": "86" }, { "countryName": "Christmas Island", "iso2": "CX", "iso3": "CXR", "phoneCode": "61" }, { "countryName": "Cocos (Keeling) Islands", "iso2": "CC", "iso3": "CCK", "phoneCode": "61" }, { "countryName": "Colombia", "iso2": "CO", "iso3": "COL", "phoneCode": "57" }, { "countryName": "Comoros", "iso2": "KM", "iso3": "COM", "phoneCode": "269" }, { "countryName": "Cook Islands", "iso2": "CK", "iso3": "COK", "phoneCode": "682" }, { "countryName": "Costa Rica", "iso2": "CR", "iso3": "CRC", "phoneCode": "506" }, { "countryName": "Croatia", "iso2": "HR", "iso3": "HRV", "phoneCode": "385" }, { "countryName": "Cuba", "iso2": "CU", "iso3": "CUB", "phoneCode": "53" }, { "countryName": "Cyprus", "iso2": "CY", "iso3": "CYP", "phoneCode": "357" }, { "countryName": "Czech Republic", "iso2": "CZ", "iso3": "CZE", "phoneCode": "420" }, { "countryName": "Democratic Republic of the Congo", "iso2": "CD", "iso3": "COD", "phoneCode": "243" }, { "countryName": "Denmark", "iso2": "DK", "iso3": "DNK", "phoneCode": "45" }, { "countryName": "Djibouti", "iso2": "DJ", "iso3": "DJI", "phoneCode": "253" }, { "countryName": "Dominica", "iso2": "DM", "iso3": "DMA", "phoneCode": "1 767" }, { "countryName": "Dominican Republic", "iso2": "DO", "iso3": "DOM", "phoneCode": "1 809" }, { "countryName": "Ecuador", "iso2": "EC", "iso3": "ECU", "phoneCode": "593" }, { "countryName": "Egypt", "iso2": "EG", "iso3": "EGY", "phoneCode": "20" }, { "countryName": "El Salvador", "iso2": "SV", "iso3": "SLV", "phoneCode": "503" }, { "countryName": "Equatorial Guinea", "iso2": "GQ", "iso3": "GNQ", "phoneCode": "240" }, { "countryName": "Eritrea", "iso2": "ER", "iso3": "ERI", "phoneCode": "291" }, { "countryName": "Estonia", "iso2": "EE", "iso3": "EST", "phoneCode": "372" }, { "countryName": "Ethiopia", "iso2": "ET", "iso3": "ETH", "phoneCode": "251" }, { "countryName": "Falkland Islands", "iso2": "FK", "iso3": "FLK", "phoneCode": "500" }, { "countryName": "Faroe Islands", "iso2": "FO", "iso3": "FRO", "phoneCode": "298" }, { "countryName": "Fiji", "iso2": "FJ", "iso3": "FJI", "phoneCode": "679" }, { "countryName": "Finland", "iso2": "FI", "iso3": "FIN", "phoneCode": "358" }, { "countryName": "France", "iso2": "FR", "iso3": "FRA", "phoneCode": "33" }, { "countryName": "French Polynesia", "iso2": "PF", "iso3": "PYF", "phoneCode": "689" }, { "countryName": "Gabon", "iso2": "GA", "iso3": "GAB", "phoneCode": "241" }, { "countryName": "Gambia", "iso2": "GM", "iso3": "GMB", "phoneCode": "220" }, { "countryName": "Gaza Strip", "iso2": "", "iso3": "", "phoneCode": "970" }, { "countryName": "Georgia", "iso2": "GE", "iso3": "GEO", "phoneCode": "995" }, { "countryName": "Germany", "iso2": "DE", "iso3": "DEU", "phoneCode": "49" }, { "countryName": "Ghana", "iso2": "GH", "iso3": "GHA", "phoneCode": "233" }, { "countryName": "Gibraltar", "iso2": "GI", "iso3": "GIB", "phoneCode": "350" }, { "countryName": "Greece", "iso2": "GR", "iso3": "GRC", "phoneCode": "30" }, { "countryName": "Greenland", "iso2": "GL", "iso3": "GRL", "phoneCode": "299" }, { "countryName": "Grenada", "iso2": "GD", "iso3": "GRD", "phoneCode": "1 473" }, { "countryName": "Guam", "iso2": "GU", "iso3": "GUM", "phoneCode": "1 671" }, { "countryName": "Guatemala", "iso2": "GT", "iso3": "GTM", "phoneCode": "502" }, { "countryName": "Guinea", "iso2": "GN", "iso3": "GIN", "phoneCode": "224" }, { "countryName": "Guinea-Bissau", "iso2": "GW", "iso3": "GNB", "phoneCode": "245" }, { "countryName": "Guyana", "iso2": "GY", "iso3": "GUY", "phoneCode": "592" }, { "countryName": "Haiti", "iso2": "HT", "iso3": "HTI", "phoneCode": "509" }, { "countryName": "Holy See (Vatican City)", "iso2": "VA", "iso3": "VAT", "phoneCode": "39" }, { "countryName": "Honduras", "iso2": "HN", "iso3": "HND", "phoneCode": "504" }, { "countryName": "Hong Kong", "iso2": "HK", "iso3": "HKG", "phoneCode": "852" }, { "countryName": "Hungary", "iso2": "HU", "iso3": "HUN", "phoneCode": "36" }, { "countryName": "Iceland", "iso2": "IS", "iso3": "IS", "phoneCode": "354" }, { "countryName": "India", "iso2": "IN", "iso3": "IND", "phoneCode": "91" }, { "countryName": "Indonesia", "iso2": "ID", "iso3": "IDN", "phoneCode": "62" }, { "countryName": "Iran", "iso2": "IR", "iso3": "IRN", "phoneCode": "98" }, { "countryName": "Iraq", "iso2": "IQ", "iso3": "IRQ", "phoneCode": "964" }, { "countryName": "Ireland", "iso2": "IE", "iso3": "IRL", "phoneCode": "353" }, { "countryName": "Isle of Man", "iso2": "IM", "iso3": "IMN", "phoneCode": "44" }, { "countryName": "Israel", "iso2": "IL", "iso3": "ISR", "phoneCode": "972" }, { "countryName": "Italy", "iso2": "IT", "iso3": "ITA", "phoneCode": "39" }, { "countryName": "Ivory Coast", "iso2": "CI", "iso3": "CIV", "phoneCode": "225" }, { "countryName": "Jamaica", "iso2": "JM", "iso3": "JAM", "phoneCode": "1 876" }, { "countryName": "Japan", "iso2": "JP", "iso3": "JPN", "phoneCode": "81" }, { "countryName": "Jersey", "iso2": "JE", "iso3": "JEY", "phoneCode": "" }, { "countryName": "Jordan", "iso2": "JO", "iso3": "JOR", "phoneCode": "962" }, { "countryName": "Kazakhstan", "iso2": "KZ", "iso3": "KAZ", "phoneCode": "7" }, { "countryName": "Kenya", "iso2": "KE", "iso3": "KEN", "phoneCode": "254" }, { "countryName": "Kiribati", "iso2": "KI", "iso3": "KIR", "phoneCode": "686" }, { "countryName": "Kosovo", "iso2": "", "iso3": "", "phoneCode": "381" }, { "countryName": "Kuwait", "iso2": "KW", "iso3": "KWT", "phoneCode": "965" }, { "countryName": "Kyrgyzstan", "iso2": "KG", "iso3": "KGZ", "phoneCode": "996" }, { "countryName": "Laos", "iso2": "LA", "iso3": "LAO", "phoneCode": "856" }, { "countryName": "Latvia", "iso2": "LV", "iso3": "LVA", "phoneCode": "371" }, { "countryName": "Lebanon", "iso2": "LB", "iso3": "LBN", "phoneCode": "961" }, { "countryName": "Lesotho", "iso2": "LS", "iso3": "LSO", "phoneCode": "266" }, { "countryName": "Liberia", "iso2": "LR", "iso3": "LBR", "phoneCode": "231" }, { "countryName": "Libya", "iso2": "LY", "iso3": "LBY", "phoneCode": "218" }, { "countryName": "Liechtenstein", "iso2": "LI", "iso3": "LIE", "phoneCode": "423" }, { "countryName": "Lithuania", "iso2": "LT", "iso3": "LTU", "phoneCode": "370" }, { "countryName": "Luxembourg", "iso2": "LU", "iso3": "LUX", "phoneCode": "352" }, { "countryName": "Macau", "iso2": "MO", "iso3": "MAC", "phoneCode": "853" }, { "countryName": "Macedonia", "iso2": "MK", "iso3": "MKD", "phoneCode": "389" }, { "countryName": "Madagascar", "iso2": "MG", "iso3": "MDG", "phoneCode": "261" }, { "countryName": "Malawi", "iso2": "MW", "iso3": "MWI", "phoneCode": "265" }, { "countryName": "Malaysia", "iso2": "MY", "iso3": "MYS", "phoneCode": "60" }, { "countryName": "Maldives", "iso2": "MV", "iso3": "MDV", "phoneCode": "960" }, { "countryName": "Mali", "iso2": "ML", "iso3": "MLI", "phoneCode": "223" }, { "countryName": "Malta", "iso2": "MT", "iso3": "MLT", "phoneCode": "356" }, { "countryName": "Marshall Islands", "iso2": "MH", "iso3": "MHL", "phoneCode": "692" }, { "countryName": "Mauritania", "iso2": "MR", "iso3": "MRT", "phoneCode": "222" }, { "countryName": "Mauritius", "iso2": "MU", "iso3": "MUS", "phoneCode": "230" }, { "countryName": "Mayotte", "iso2": "YT", "iso3": "MYT", "phoneCode": "262" }, { "countryName": "Mexico", "iso2": "MX", "iso3": "MEX", "phoneCode": "52" }, { "countryName": "Micronesia", "iso2": "FM", "iso3": "FSM", "phoneCode": "691" }, { "countryName": "Moldova", "iso2": "MD", "iso3": "MDA", "phoneCode": "373" }, { "countryName": "Monaco", "iso2": "MC", "iso3": "MCO", "phoneCode": "377" }, { "countryName": "Mongolia", "iso2": "MN", "iso3": "MNG", "phoneCode": "976" }, { "countryName": "Montenegro", "iso2": "ME", "iso3": "MNE", "phoneCode": "382" }, { "countryName": "Montserrat", "iso2": "MS", "iso3": "MSR", "phoneCode": "1 664" }, { "countryName": "Morocco", "iso2": "MA", "iso3": "MAR", "phoneCode": "212" }, { "countryName": "Mozambique", "iso2": "MZ", "iso3": "MOZ", "phoneCode": "258" }, { "countryName": "Namibia", "iso2": "NA", "iso3": "NAM", "phoneCode": "264" }, { "countryName": "Nauru", "iso2": "NR", "iso3": "NRU", "phoneCode": "674" }, { "countryName": "Nepal", "iso2": "NP", "iso3": "NPL", "phoneCode": "977" }, { "countryName": "Netherlands", "iso2": "NL", "iso3": "NLD", "phoneCode": "31" }, { "countryName": "Netherlands Antilles", "iso2": "AN", "iso3": "ANT", "phoneCode": "599" }, { "countryName": "New Caledonia", "iso2": "NC", "iso3": "NCL", "phoneCode": "687" }, { "countryName": "New Zealand", "iso2": "NZ", "iso3": "NZL", "phoneCode": "64" }, { "countryName": "Nicaragua", "iso2": "NI", "iso3": "NIC", "phoneCode": "505" }, { "countryName": "Niger", "iso2": "NE", "iso3": "NER", "phoneCode": "227" }, { "countryName": "Nigeria", "iso2": "NG", "iso3": "NGA", "phoneCode": "234" }, { "countryName": "Niue", "iso2": "NU", "iso3": "NIU", "phoneCode": "683" }, { "countryName": "Norfolk Island", "iso2": "", "iso3": "NFK", "phoneCode": "672" }, { "countryName": "North Korea", "iso2": "KP", "iso3": "PRK", "phoneCode": "850" }, { "countryName": "Northern Mariana Islands", "iso2": "MP", "iso3": "MNP", "phoneCode": "1 670" }, { "countryName": "Norway", "iso2": "NO", "iso3": "NOR", "phoneCode": "47" }, { "countryName": "Oman", "iso2": "OM", "iso3": "OMN", "phoneCode": "968" }, { "countryName": "Pakistan", "iso2": "PK", "iso3": "PAK", "phoneCode": "92" }, { "countryName": "Palau", "iso2": "PW", "iso3": "PLW", "phoneCode": "680" }, { "countryName": "Panama", "iso2": "PA", "iso3": "PAN", "phoneCode": "507" }, { "countryName": "Papua New Guinea", "iso2": "PG", "iso3": "PNG", "phoneCode": "675" }, { "countryName": "Paraguay", "iso2": "PY", "iso3": "PRY", "phoneCode": "595" }, { "countryName": "Peru", "iso2": "PE", "iso3": "PER", "phoneCode": "51" }, { "countryName": "Philippines", "iso2": "PH", "iso3": "PHL", "phoneCode": "63" }, { "countryName": "Pitcairn Islands", "iso2": "PN", "iso3": "PCN", "phoneCode": "870" }, { "countryName": "Poland", "iso2": "PL", "iso3": "POL", "phoneCode": "48" }, { "countryName": "Portugal", "iso2": "PT", "iso3": "PRT", "phoneCode": "351" }, { "countryName": "Puerto Rico", "iso2": "PR", "iso3": "PRI", "phoneCode": "1" }, { "countryName": "Qatar", "iso2": "QA", "iso3": "QAT", "phoneCode": "974" }, { "countryName": "Republic of the Congo", "iso2": "CG", "iso3": "COG", "phoneCode": "242" }, { "countryName": "Romania", "iso2": "RO", "iso3": "ROU", "phoneCode": "40" }, { "countryName": "Russia", "iso2": "RU", "iso3": "RUS", "phoneCode": "7" }, { "countryName": "Rwanda", "iso2": "RW", "iso3": "RWA", "phoneCode": "250" }, { "countryName": "Saint Barthelemy", "iso2": "BL", "iso3": "BLM", "phoneCode": "590" }, { "countryName": "Saint Helena", "iso2": "SH", "iso3": "SHN", "phoneCode": "290" }, { "countryName": "Saint Kitts and Nevis", "iso2": "KN", "iso3": "KNA", "phoneCode": "1 869" }, { "countryName": "Saint Lucia", "iso2": "LC", "iso3": "LCA", "phoneCode": "1 758" }, { "countryName": "Saint Martin", "iso2": "MF", "iso3": "MAF", "phoneCode": "1 599" }, { "countryName": "Saint Pierre and Miquelon", "iso2": "PM", "iso3": "SPM", "phoneCode": "508" }, { "countryName": "Saint Vincent and the Grenadines", "iso2": "VC", "iso3": "VCT", "phoneCode": "1 784" }, { "countryName": "Samoa", "iso2": "WS", "iso3": "WSM", "phoneCode": "685" }, { "countryName": "San Marino", "iso2": "SM", "iso3": "SMR", "phoneCode": "378" }, { "countryName": "Sao Tome and Principe", "iso2": "ST", "iso3": "STP", "phoneCode": "239" }, { "countryName": "Saudi Arabia", "iso2": "SA", "iso3": "SAU", "phoneCode": "966" }, { "countryName": "Senegal", "iso2": "SN", "iso3": "SEN", "phoneCode": "221" }, { "countryName": "Serbia", "iso2": "RS", "iso3": "SRB", "phoneCode": "381" }, { "countryName": "Seychelles", "iso2": "SC", "iso3": "SYC", "phoneCode": "248" }, { "countryName": "Sierra Leone", "iso2": "SL", "iso3": "SLE", "phoneCode": "232" }, { "countryName": "Singapore", "iso2": "SG", "iso3": "SGP", "phoneCode": "65" }, { "countryName": "Slovakia", "iso2": "SK", "iso3": "SVK", "phoneCode": "421" }, { "countryName": "Slovenia", "iso2": "SI", "iso3": "SVN", "phoneCode": "386" }, { "countryName": "Solomon Islands", "iso2": "SB", "iso3": "SLB", "phoneCode": "677" }, { "countryName": "Somalia", "iso2": "SO", "iso3": "SOM", "phoneCode": "252" }, { "countryName": "South Africa", "iso2": "ZA", "iso3": "ZAF", "phoneCode": "27" }, { "countryName": "South Korea", "iso2": "KR", "iso3": "KOR", "phoneCode": "82" }, { "countryName": "Spain", "iso2": "ES", "iso3": "ESP", "phoneCode": "34" }, { "countryName": "Sri Lanka", "iso2": "LK", "iso3": "LKA", "phoneCode": "94" }, { "countryName": "Sudan", "iso2": "SD", "iso3": "SDN", "phoneCode": "249" }, { "countryName": "Suriname", "iso2": "SR", "iso3": "SUR", "phoneCode": "597" }, { "countryName": "Svalbard", "iso2": "SJ", "iso3": "SJM", "phoneCode": "" }, { "countryName": "Swaziland", "iso2": "SZ", "iso3": "SWZ", "phoneCode": "268" }, { "countryName": "Sweden", "iso2": "SE", "iso3": "SWE", "phoneCode": "46" }, { "countryName": "Switzerland", "iso2": "CH", "iso3": "CHE", "phoneCode": "41" }, { "countryName": "Syria", "iso2": "SY", "iso3": "SYR", "phoneCode": "963" }, { "countryName": "Taiwan", "iso2": "TW", "iso3": "TWN", "phoneCode": "886" }, { "countryName": "Tajikistan", "iso2": "TJ", "iso3": "TJK", "phoneCode": "992" }, { "countryName": "Tanzania", "iso2": "TZ", "iso3": "TZA", "phoneCode": "255" }, { "countryName": "Thailand", "iso2": "TH", "iso3": "THA", "phoneCode": "66" }, { "countryName": "Timor-Leste", "iso2": "TL", "iso3": "TLS", "phoneCode": "670" }, { "countryName": "Togo", "iso2": "TG", "iso3": "TGO", "phoneCode": "228" }, { "countryName": "Tokelau", "iso2": "TK", "iso3": "TKL", "phoneCode": "690" }, { "countryName": "Tonga", "iso2": "TO", "iso3": "TON", "phoneCode": "676" }, { "countryName": "Trinidad and Tobago", "iso2": "TT", "iso3": "TTO", "phoneCode": "1 868" }, { "countryName": "Tunisia", "iso2": "TN", "iso3": "TUN", "phoneCode": "216" }, { "countryName": "Turkey", "iso2": "TR", "iso3": "TUR", "phoneCode": "90" }, { "countryName": "Turkmenistan", "iso2": "TM", "iso3": "TKM", "phoneCode": "993" }, { "countryName": "Turks and Caicos Islands", "iso2": "TC", "iso3": "TCA", "phoneCode": "1 649" }, { "countryName": "Tuvalu", "iso2": "TV", "iso3": "TUV", "phoneCode": "688" }, { "countryName": "Uganda", "iso2": "UG", "iso3": "UGA", "phoneCode": "256" }, { "countryName": "Ukraine", "iso2": "UA", "iso3": "UKR", "phoneCode": "380" }, { "countryName": "United Arab Emirates", "iso2": "AE", "iso3": "ARE", "phoneCode": "971" }, { "countryName": "United Kingdom", "iso2": "GB", "iso3": "GBR", "phoneCode": "44" }, { "countryName": "United States", "iso2": "US", "iso3": "USA", "phoneCode": "1" }, { "countryName": "Uruguay", "iso2": "UY", "iso3": "URY", "phoneCode": "598" }, { "countryName": "US Virgin Islands", "iso2": "VI", "iso3": "VIR", "phoneCode": "1 340" }, { "countryName": "Uzbekistan", "iso2": "UZ", "iso3": "UZB", "phoneCode": "998" }, { "countryName": "Vanuatu", "iso2": "VU", "iso3": "VUT", "phoneCode": "678" }, { "countryName": "Venezuela", "iso2": "VE", "iso3": "VEN", "phoneCode": "58" }, { "countryName": "Vietnam", "iso2": "VN", "iso3": "VNM", "phoneCode": "84" }, { "countryName": "Wallis and Futuna", "iso2": "WF", "iso3": "WLF", "phoneCode": "681" }, { "countryName": "West Bank", "iso2": "", "iso3": "", "phoneCode": "970" }, { "countryName": "Western Sahara", "iso2": "EH", "iso3": "ESH", "phoneCode": "" }, { "countryName": "Yemen", "iso2": "YE", "iso3": "YEM", "phoneCode": "967" }, { "countryName": "Zambia", "iso2": "ZM", "iso3": "ZMB", "phoneCode": "260" }, { "countryName": "Zimbabwe", "iso2": "ZW", "iso3": "ZWE", "phoneCode": "263" }]; + + function countryISO2(iso3) { + iso2 = iso2.toUpperCase(); + for (index = 0; index < countries.length; ++index) { + if (countries[index].iso3 === iso3) { + return countries[index].iso2; + } + } + return ""; + } + + function countryISO3(iso2) { + iso2 = iso2.toUpperCase(); + for (index = 0; index < countries.length; ++index) { + if (countries[index].iso2 === iso2) { + return countries[index].iso3.toLowerCase(); + } + } + return ""; + } + + function countryName(iso3) { + iso3 = iso3.toUpperCase(); + for (index = 0; index < countries.length; ++index) { + if (countries[index].iso3 === iso3) { + return countries[index].countryName; + } + } + return ""; + } + + Alpaca.registerFieldClass("mladdress", Alpaca.Fields.MLAddressField); + })(jQuery); (function ($) { diff --git a/OpenContent/bundleconfig.json b/OpenContent/bundleconfig.json index e1cf0deb..88567194 100644 --- a/OpenContent/bundleconfig.json +++ b/OpenContent/bundleconfig.json @@ -3,6 +3,7 @@ "outputFileName": "alpaca/js/fields/dnn/dnnfields.js", "inputFiles": [ "alpaca/js/fields/dnn/AddressField.js", + "alpaca/js/fields/dnn/MLAddressField.js", "alpaca/js/fields/dnn/CKEditorField.js", "alpaca/js/fields/dnn/CheckboxField.js", "alpaca/js/fields/dnn/DateField.js", diff --git a/OpenContent/js/builder/formbuilder.js b/OpenContent/js/builder/formbuilder.js index ba43a51a..7122f0fe 100644 --- a/OpenContent/js/builder/formbuilder.js +++ b/OpenContent/js/builder/formbuilder.js @@ -1051,7 +1051,7 @@ var fieldOptions = "label": "Multi language", "dependencies": { "advanced": [true], - "fieldtype": ["text", "textarea", "ckeditor", "file", "image", "url", "wysihtml", "summernote", "file2", "url2", "role2", "image2", "imagex"] + "fieldtype": ["address","text", "textarea", "ckeditor", "file", "image", "url", "wysihtml", "summernote", "file2", "url2", "role2", "image2", "imagex"] } }, "index": { From 5a8d05c0d75a536275d698a5181b89d2eee193ae Mon Sep 17 00:00:00 2001 From: holoncom Date: Fri, 1 Nov 2019 13:37:24 +0100 Subject: [PATCH 24/34] Allow SkinObject RenderModule() to be disabled --- OpenContent/RenderModule.ascx.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenContent/RenderModule.ascx.cs b/OpenContent/RenderModule.ascx.cs index 55b4b081..fe50db63 100644 --- a/OpenContent/RenderModule.ascx.cs +++ b/OpenContent/RenderModule.ascx.cs @@ -19,6 +19,7 @@ public partial class RenderModule : SkinObjectBase public bool ShowOnHostTabs { get; set; } public string Template { get; set; } public string ModuleTitle { get; set; } + public bool Enabled { get; set; } = true; private void InitializeComponent() { @@ -32,6 +33,9 @@ protected override void OnInit(EventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); + + if (!Enabled) return; + int[] hideTabs = new int[1] { TabId }; if (!string.IsNullOrEmpty(HideOnTabIds)) { From 0a132dadce8c74084fb501da1bb2dc3e89ae474b Mon Sep 17 00:00:00 2001 From: holoncom Date: Wed, 20 Nov 2019 21:56:12 +0100 Subject: [PATCH 25/34] Fix issue where ClearCache did not clear all cached items --- OpenContent/Components/OpenContentController.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenContent/Components/OpenContentController.cs b/OpenContent/Components/OpenContentController.cs index dc088ed7..edc8c91b 100644 --- a/OpenContent/Components/OpenContentController.cs +++ b/OpenContent/Components/OpenContentController.cs @@ -48,7 +48,7 @@ public OpenContentController(int portalId) public void AddContent(OpenContentInfo content) { SynchronizeXml(content); - ClearDataCache(content); + ClearDataCache(content); var json = content.JsonAsJToken; if (string.IsNullOrEmpty(content.Key)) { @@ -189,7 +189,7 @@ public OpenContentInfo GetContent(int contentId) public OpenContentInfo GetFirstContent(int moduleId) { - var cacheArgs = new CacheItemArgs(GetModuleIdCacheKey(moduleId) + "GetFirstContent", CACHE_TIME); + var cacheArgs = new CacheItemArgs(GetModuleIdCacheKey(moduleId, "GetFirstContent"), CACHE_TIME); return DataCache.GetCachedData(cacheArgs, args => { OpenContentInfo content; @@ -266,8 +266,17 @@ private static string GetModuleIdCacheKey(int moduleId, string suffix = null) private static void ClearDataCache(OpenContentInfo content) { - if (content.ContentId > 0) App.Services.CacheAdapter.ClearCache(GetContentIdCacheKey(content.ContentId)); - if (content.ModuleId > 0) App.Services.CacheAdapter.ClearCache(GetModuleIdCacheKey(content.ModuleId)); + if (content.ContentId > 0) + { + App.Services.CacheAdapter.ClearCache(GetContentIdCacheKey(content.ContentId)); + } + + if (content.ModuleId > 0) + { + App.Services.CacheAdapter.ClearCache(GetModuleIdCacheKey(content.ModuleId, "GetContents")); + App.Services.CacheAdapter.ClearCache(GetModuleIdCacheKey(content.ModuleId, "GetFirstContent")); + return; + } } #endregion From 6f10c612487b69e2909126a887537cc4ab3ba038 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Thu, 5 Dec 2019 12:22:02 +0100 Subject: [PATCH 26/34] add handlebars url helper - automatic url complete --- .../Components/Handlebars/HandlebarsEngine.cs | 50 +++++++++++++++++++ OpenContent/OpenContent.dnn | 7 ++- OpenContent/js/oc.codemirror.js | 29 ++++++----- 3 files changed, 73 insertions(+), 13 deletions(-) diff --git a/OpenContent/Components/Handlebars/HandlebarsEngine.cs b/OpenContent/Components/Handlebars/HandlebarsEngine.cs index 4b36e7b7..60727ee7 100644 --- a/OpenContent/Components/Handlebars/HandlebarsEngine.cs +++ b/OpenContent/Components/Handlebars/HandlebarsEngine.cs @@ -15,6 +15,7 @@ using DotNetNuke.Entities.Portals; using Satrabel.OpenContent.Components.Logging; using Newtonsoft.Json.Linq; +using System.Text.RegularExpressions; namespace Satrabel.OpenContent.Components.Handlebars { @@ -51,6 +52,7 @@ public void Compile(string source) RegisterTemplateHelper(hbs); RegisterRawHelper(hbs); RegisterContainsHelper(hbs); + RegisterUrlHelper(hbs); _template = hbs.Compile(source); } catch (Exception ex) @@ -130,6 +132,7 @@ private static void RegisterHelpers(IHandlebars hbs) RegisterTemplateHelper(hbs); RegisterRawHelper(hbs); RegisterContainsHelper(hbs); + RegisterUrlHelper(hbs); } private static void RegisterTruncateWordsHelper(HandlebarsDotNet.IHandlebars hbs) @@ -608,6 +611,53 @@ private static void RegisterEmailHelper(HandlebarsDotNet.IHandlebars hbs) }); } + private static void RegisterUrlHelper(HandlebarsDotNet.IHandlebars hbs) + { + hbs.RegisterHelper("url", (writer, context, parameters) => + { + try + { + string url = parameters[0].ToString(); + string lowerUrl = url.ToLower(); + if (!lowerUrl.StartsWith("http://") && + !lowerUrl.StartsWith("https://") && + !lowerUrl.StartsWith("phone:") && + !lowerUrl.StartsWith("mail:")) + { + if (IsEmailAdress(url)) + { + url = "mailto:" + url; + } + else if (IsPhoneNumber(url)) + { + url = "phone:" + url; + } + else + { + url = "http://" + url; + } + } + writer.WriteSafeString(url); + } + catch (Exception) + { + writer.WriteSafeString(""); + } + }); + } + private static bool IsPhoneNumber(string number) + { + return Regex.Match(number, @"^(\+[0-9]{9})$").Success; + } + + private static bool IsEmailAdress(string number) + { + string validEmailPattern = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|" + + @"([-a-z0-9!#$%&'*+/=?^_`{|}~]|(? /// Retrieved an element from a list. /// First param is List, the second param is the int with the position to retrieve. diff --git a/OpenContent/OpenContent.dnn b/OpenContent/OpenContent.dnn index 2d9e519b..f30288f8 100644 --- a/OpenContent/OpenContent.dnn +++ b/OpenContent/OpenContent.dnn @@ -1,6 +1,6 @@ - + OpenContent OpenContent module by Satrabel.be ~/DesktopModules/OpenContent/Images/icon_extensions.png @@ -66,6 +66,11 @@ OpenContent Satrabel.OpenContent.Components.FeatureController + + + + + OpenContent diff --git a/OpenContent/js/oc.codemirror.js b/OpenContent/js/oc.codemirror.js index 57f0cfae..06d05bf0 100644 --- a/OpenContent/js/oc.codemirror.js +++ b/OpenContent/js/oc.codemirror.js @@ -389,29 +389,34 @@ function ocSetupCodeMirror(mimeType, elem, model) { - var handlebarsHelpers = [ + var handlebarsHelpers = [ + { 'text': '{{add var 2}}', 'displayText': 'add' }, + { 'text': '{{#contains lookFor insideOf}}\n{{/contains}}', 'displayText': 'contains' }, + { 'text': '{{divide var 2}}', 'displayText': 'divide' }, { 'text': '{{#each var}}\n{{/each}}', 'displayText': 'each' }, - { 'text': '{{#if var}}\n{{/if}}', 'displayText': 'if' }, - { 'text': '{{#if var}}\n{{else}}\n{{/if}}', 'displayText': 'ifelse' }, - { 'text': '{{else}}', 'displayText': 'else' }, + { 'text': '{{else}}', 'displayText': 'else' }, + { 'text': '{{#if var}}\n{{/if}}', 'displayText': 'if' }, + { 'text': '{{#if var}}\n{{else}}\n{{/if}}', 'displayText': 'ifelse' }, { 'text': '{{#ifand var1 var2 var3}}\n{{/ifand}}', 'displayText': 'ifand' }, { 'text': '{{#ifor var1 var2 var3}}\n{{/ifor}}', 'displayText': 'ifor' }, - { 'text': '{{multiply var 2}}', 'displayText': 'multiply' }, - { 'text': '{{divide var 2}}', 'displayText': 'divide' }, - { 'text': '{{add var 2}}', 'displayText': 'add' }, - { 'text': '{{substract var 2}}', 'displayText': 'substract' }, + { 'text': '{{multiply var 2}}', 'displayText': 'multiply' }, + { 'text': '{{substract var 2}}', 'displayText': 'substract' }, + { 'text': '{{raw var}}', 'displayText': 'raw' }, + { 'text': '{{replace var}}', 'displayText': 'replace' }, + { 'text': '{{replacenewline var}}', 'displayText': 'replacenewline' }, { 'text': '{{registerscript "javascript.js"}}', 'displayText': 'registerscript' }, { 'text': '{{registerstylesheet "stylesheet.css"}}', 'displayText': 'registerstylesheet' }, { 'text': '{{formatNumber var "0.00"}}', 'displayText': 'formatNumber' }, { 'text': '{{formatDateTime var "dd/MMM/yy" "nl-NL" }}', 'displayText': 'formatDateTime' }, { 'text': '{{convertHtmlToText var }}', 'displayText': 'convertHtmlToText' }, - { 'text': '{{convertToJson var }}', 'displayText': 'convertToJson' }, + { 'text': '{{convertToJson var }}', 'displayText': 'convertToJson' }, + { 'text': '{{template var}}', 'displayText': 'template' }, { 'text': '{{truncateWords var 50 "..." }}', 'displayText': 'formatDateTime' }, { 'text': '{{#equal var "value"}}\n{{/equal}}', 'displayText': 'equal' }, - { 'text': '{{#unless var}}\n{{/unless}}', 'displayText': 'unless' }, + { 'text': '{{#unless var}}\n{{/unless}}', 'displayText': 'unless' }, + { 'text': '{{url var}}', 'displayText': 'url' }, { 'text': '{{#with var}}\n{{/with}}', 'displayText': 'with' }, - { 'text': '{{!-- --}}', 'displayText': 'comment' }, - { 'text': '{{#contains lookFor insideOf}}\n{{/contains}}', 'displayText': 'contains' } + { 'text': '{{!-- --}}', 'displayText': 'comment' } ]; var razorHelpers = [ From bc7a84dcc07ea04d24812665b586693cb1a42233 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Fri, 6 Dec 2019 12:23:32 +0100 Subject: [PATCH 27/34] new mlnumber field defferent sorting for defferentt languages fix for mladdress field in ie --- OpenContent/Components/Alpaca/FormBuilder.cs | 13 +- .../Components/OpenContentAPIController.cs | 12 +- OpenContent/Edit.ascx | 2 +- OpenContent/Edit.ascx.designer.cs | 46 ++-- OpenContent/OpenContent.csproj | 1 + .../alpaca/js/fields/dnn/MLAddressField.js | 2 +- .../alpaca/js/fields/dnn/MLNumberField.js | 252 +++++++++++++++++ OpenContent/alpaca/js/fields/dnn/dnnfields.js | 254 +++++++++++++++++- .../alpaca/js/fields/dnn/dnnfields.min.js | 2 +- OpenContent/bundleconfig.json | 1 + OpenContent/js/alpacaengine.js | 8 +- OpenContent/js/builder/formbuilder.js | 2 +- 12 files changed, 562 insertions(+), 33 deletions(-) create mode 100644 OpenContent/alpaca/js/fields/dnn/MLNumberField.js diff --git a/OpenContent/Components/Alpaca/FormBuilder.cs b/OpenContent/Components/Alpaca/FormBuilder.cs index 415d934e..c78c9722 100644 --- a/OpenContent/Components/Alpaca/FormBuilder.cs +++ b/OpenContent/Components/Alpaca/FormBuilder.cs @@ -149,7 +149,7 @@ private static void GetFields(SchemaConfig newSchemaFilter, OptionsConfig newOpt fieldLst.Add(propKey); } - else if (prop.Value.Type == "number") + else if (prop.Value.Type == "number" || optType == "mlnumber") { var newProp = new SchemaConfig() { @@ -409,6 +409,17 @@ private FieldConfig CreateFieldConfigFromSchemaAndOptionFile(string key) }; newConfig.Fields.Add(prop.Key, newField); } + else if (optType == "mlnumber") + { + var newField = new FieldConfig() + { + IndexType = "float", + Index = true, + Sort = true, + MultiLanguage = true + }; + newConfig.Fields.Add(prop.Key, newField); + } else if (optType == "mlwysihtml") { var newField = new FieldConfig() diff --git a/OpenContent/Components/OpenContentAPIController.cs b/OpenContent/Components/OpenContentAPIController.cs index 7a75a969..53b4cc4d 100644 --- a/OpenContent/Components/OpenContentAPIController.cs +++ b/OpenContent/Components/OpenContentAPIController.cs @@ -656,6 +656,11 @@ public HttpResponseMessage ReOrder(List ids) var module = OpenContentModuleConfig.Create(ActiveModule, PortalSettings); IDataSource ds = DataSourceManager.GetDataSource(module.Settings.Manifest.DataSource); var dsContext = OpenContentUtils.CreateDataContext(module, UserInfo.UserID); + + var alpaca = ds.GetAlpaca(dsContext, false, true, false); + var opt = alpaca["options"]?["fields"]?["SortIndex"]?["type"]?.ToString(); + var ml = opt == "mlnumber"; + IDataItem dsItem = null; if (module.IsListMode()) { @@ -666,7 +671,10 @@ public HttpResponseMessage ReOrder(List ids) { dsItem = ds.Get(dsContext, id); var json = dsItem.Data; - json["SortIndex"] = i; + if (ml) // multi language + json["SortIndex"][DnnLanguageUtils.GetCurrentCultureCode()] = i; + else + json["SortIndex"] = i; ds.Update(dsContext, dsItem, json); i++; } @@ -684,6 +692,8 @@ public HttpResponseMessage ReOrder(List ids) } } + + private void AddNotifyInfo(DataSourceContext dsContext) { string jsonSettings = ActiveModule.ModuleSettings["notifications"] as string; diff --git a/OpenContent/Edit.ascx b/OpenContent/Edit.ascx index 7d4afa0f..e1aadedf 100644 --- a/OpenContent/Edit.ascx +++ b/OpenContent/Edit.ascx @@ -15,7 +15,7 @@
  • - +
  • diff --git a/OpenContent/Edit.ascx.designer.cs b/OpenContent/Edit.ascx.designer.cs index 319c1a6f..3b741af9 100644 --- a/OpenContent/Edit.ascx.designer.cs +++ b/OpenContent/Edit.ascx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Ce code a été généré par un outil. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// //------------------------------------------------------------------------------ namespace Satrabel.OpenContent { @@ -13,56 +13,56 @@ namespace Satrabel.OpenContent { public partial class Edit { /// - /// ScopeWrapper control. + /// Contrôle ScopeWrapper. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Champ généré automatiquement. + /// Pour modifier, déplacez la déclaration de champ du fichier de concepteur dans le fichier code-behind. /// protected global::System.Web.UI.WebControls.Panel ScopeWrapper; /// - /// cmdSave control. + /// Contrôle cmdSave. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Champ généré automatiquement. + /// Pour modifier, déplacez la déclaration de champ du fichier de concepteur dans le fichier code-behind. /// protected global::System.Web.UI.WebControls.HyperLink cmdSave; /// - /// cmdCopy control. + /// Contrôle cmdCopy. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Champ généré automatiquement. + /// Pour modifier, déplacez la déclaration de champ du fichier de concepteur dans le fichier code-behind. /// protected global::System.Web.UI.WebControls.HyperLink cmdCopy; /// - /// hlCancel control. + /// Contrôle hlCancel. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Champ généré automatiquement. + /// Pour modifier, déplacez la déclaration de champ du fichier de concepteur dans le fichier code-behind. /// protected global::System.Web.UI.WebControls.HyperLink hlCancel; /// - /// hlDelete control. + /// Contrôle hlDelete. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Champ généré automatiquement. + /// Pour modifier, déplacez la déclaration de champ du fichier de concepteur dans le fichier code-behind. /// protected global::System.Web.UI.WebControls.HyperLink hlDelete; /// - /// ddlVersions control. + /// Contrôle ddlVersions. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Champ généré automatiquement. + /// Pour modifier, déplacez la déclaration de champ du fichier de concepteur dans le fichier code-behind. /// protected global::System.Web.UI.WebControls.DropDownList ddlVersions; } diff --git a/OpenContent/OpenContent.csproj b/OpenContent/OpenContent.csproj index fabb34c7..ec2df7af 100644 --- a/OpenContent/OpenContent.csproj +++ b/OpenContent/OpenContent.csproj @@ -423,6 +423,7 @@ + diff --git a/OpenContent/alpaca/js/fields/dnn/MLAddressField.js b/OpenContent/alpaca/js/fields/dnn/MLAddressField.js index 4b755e4a..d82e6c23 100644 --- a/OpenContent/alpaca/js/fields/dnn/MLAddressField.js +++ b/OpenContent/alpaca/js/fields/dnn/MLAddressField.js @@ -236,7 +236,7 @@ getType: function () { return "any"; }, - getValueOfML(ml) { + getValueOfML: function(ml) { if (ml && Alpaca.isObject(ml)) { if (ml[this.culture]) { return ml[this.culture]; diff --git a/OpenContent/alpaca/js/fields/dnn/MLNumberField.js b/OpenContent/alpaca/js/fields/dnn/MLNumberField.js new file mode 100644 index 00000000..c212c7be --- /dev/null +++ b/OpenContent/alpaca/js/fields/dnn/MLNumberField.js @@ -0,0 +1,252 @@ +(function ($) { + + var Alpaca = $.alpaca; + + Alpaca.Fields.MLNumberField = Alpaca.Fields.NumberField.extend( + { + constructor: function (container, data, options, schema, view, connector) { + var self = this; + this.base(container, data, options, schema, view, connector); + this.culture = connector.culture; + this.defaultCulture = connector.defaultCulture; + this.rootUrl = connector.rootUrl; + }, + /** + * @see Alpaca.Fields.TextField#getFieldType + */ + /* + getFieldType: function () { + return "text"; + }, + */ + + /** + * @see Alpaca.Fields.TextField#setup + */ + setup: function () { + + if (this.data && Alpaca.isObject(this.data)) { + this.olddata = this.data; + } else if (this.data) { + this.olddata = {}; + this.olddata[this.defaultCulture] = this.data; + } + + if (this.culture != this.defaultCulture && this.olddata && this.olddata[this.defaultCulture]) { + this.options.placeholder = this.olddata[this.defaultCulture]; + } else if (this.olddata && Object.keys(this.olddata).length && this.olddata[Object.keys(this.olddata)[0]]) { + this.options.placeholder = this.olddata[Object.keys(this.olddata)[0]]; + } else { + this.options.placeholder = ""; + } + this.base(); + /* + Alpaca.mergeObject(this.options, { + "fieldClass": "flag-"+this.culture + }); + */ + }, + getValue: function () { + var val = this.base(); + var self = this; + /* + if (val === "") { + return []; + } + */ + + var o = {}; + if (this.olddata && Alpaca.isObject(this.olddata)) { + $.each(this.olddata, function (key, value) { + var v = Alpaca.copyOf(value); + if (key != self.culture) { + o[key] = v; + } + }); + } + if (val != "") { + o[self.culture] = val; + } + if ($.isEmptyObject(o)) { + return ""; + } + //o["_type"] = "languages"; + return o; + }, + getFloatValue: function () { + var val = this.base(); + var self = this; + + return val; + }, + setValue: function (val) { + if (val === "") { + return; + } + if (!val) { + this.base(""); + return; + } + if (Alpaca.isObject(val)) { + var v = val[this.culture]; + if (!v) { + this.base(""); + return; + } + this.base(v); + } + else { + this.base(val); + } + }, + + getControlValue: function () { + var val = this._getControlVal(true); + + if (typeof (val) == "undefined" || "" == val) { + return val; + } + + return parseFloat(val); + }, + + afterRenderControl: function (model, callback) { + var self = this; + this.base(model, function () { + self.handlePostRender(function () { + callback(); + }); + }); + }, + handlePostRender: function (callback) { + var self = this; + var el = this.getControlEl(); + $(this.control.get(0)).after(''); + callback(); + }, + + + /** + * Validates if it is a float number. + * @returns {Boolean} true if it is a float number + */ + _validateNumber: function () { + + // get value as text + var textValue = this._getControlVal(); + if (typeof (textValue) === "number") { + textValue = "" + textValue; + } + + // allow empty + if (Alpaca.isValEmpty(textValue)) { + return true; + } + + // check if valid number format + var validNumber = Alpaca.testRegex(Alpaca.regexps.number, textValue); + if (!validNumber) { + return false; + } + + // quick check to see if what they entered was a number + var floatValue = this.getFloatValue(); + if (isNaN(floatValue)) { + return false; + } + + return true; + }, + + /** + * Validates divisibleBy constraint. + * @returns {Boolean} true if it passes the divisibleBy constraint. + */ + _validateDivisibleBy: function () { + var floatValue = this.getFloatValue(); + if (!Alpaca.isEmpty(this.schema.divisibleBy)) { + + // mod + if (floatValue % this.schema.divisibleBy !== 0) { + return false; + } + } + return true; + }, + + /** + * Validates maximum constraint. + * @returns {Boolean} true if it passes the maximum constraint. + */ + _validateMaximum: function () { + var floatValue = this.getFloatValue(); + + if (!Alpaca.isEmpty(this.schema.maximum)) { + if (floatValue > this.schema.maximum) { + return false; + } + + if (!Alpaca.isEmpty(this.schema.exclusiveMaximum)) { + if (floatValue == this.schema.maximum && this.schema.exclusiveMaximum) { // jshint ignore:line + return false; + } + } + } + + return true; + }, + + /** + * Validates maximum constraint. + * @returns {Boolean} true if it passes the minimum constraint. + */ + _validateMinimum: function () { + var floatValue = this.getFloatValue(); + + if (!Alpaca.isEmpty(this.schema.minimum)) { + if (floatValue < this.schema.minimum) { + return false; + } + + if (!Alpaca.isEmpty(this.schema.exclusiveMinimum)) { + if (floatValue == this.schema.minimum && this.schema.exclusiveMinimum) { // jshint ignore:line + return false; + } + } + } + + return true; + }, + + /** + * Validates multipleOf constraint. + * @returns {Boolean} true if it passes the multipleOf constraint. + */ + _validateMultipleOf: function () { + var floatValue = this.getFloatValue(); + + if (!Alpaca.isEmpty(this.schema.multipleOf)) { + if (floatValue && this.schema.multipleOf !== 0) { + return false; + } + } + + return true; + }, + + getTitle: function () { + return "Multi Language Number Field"; + }, + + + getDescription: function () { + return "Multi Language Number field ."; + }, + + + /* end_builder_helpers */ + }); + + Alpaca.registerFieldClass("mlnumber", Alpaca.Fields.MLNumberField); + +})(jQuery); \ No newline at end of file diff --git a/OpenContent/alpaca/js/fields/dnn/dnnfields.js b/OpenContent/alpaca/js/fields/dnn/dnnfields.js index 544e1730..61feea7a 100644 --- a/OpenContent/alpaca/js/fields/dnn/dnnfields.js +++ b/OpenContent/alpaca/js/fields/dnn/dnnfields.js @@ -633,7 +633,7 @@ getType: function () { return "any"; }, - getValueOfML(ml) { + getValueOfML: function(ml) { if (ml && Alpaca.isObject(ml)) { if (ml[this.culture]) { return ml[this.culture]; @@ -15117,6 +15117,258 @@ Alpaca.registerFieldClass("mltextarea", Alpaca.Fields.MLTextAreaField); +})(jQuery); +(function ($) { + + var Alpaca = $.alpaca; + + Alpaca.Fields.MLNumberField = Alpaca.Fields.NumberField.extend( + { + constructor: function (container, data, options, schema, view, connector) { + var self = this; + this.base(container, data, options, schema, view, connector); + this.culture = connector.culture; + this.defaultCulture = connector.defaultCulture; + this.rootUrl = connector.rootUrl; + }, + /** + * @see Alpaca.Fields.TextField#getFieldType + */ + /* + getFieldType: function () { + return "text"; + }, + */ + + /** + * @see Alpaca.Fields.TextField#setup + */ + setup: function () { + + if (this.data && Alpaca.isObject(this.data)) { + this.olddata = this.data; + } else if (this.data) { + this.olddata = {}; + this.olddata[this.defaultCulture] = this.data; + } + + if (this.culture != this.defaultCulture && this.olddata && this.olddata[this.defaultCulture]) { + this.options.placeholder = this.olddata[this.defaultCulture]; + } else if (this.olddata && Object.keys(this.olddata).length && this.olddata[Object.keys(this.olddata)[0]]) { + this.options.placeholder = this.olddata[Object.keys(this.olddata)[0]]; + } else { + this.options.placeholder = ""; + } + this.base(); + /* + Alpaca.mergeObject(this.options, { + "fieldClass": "flag-"+this.culture + }); + */ + }, + getValue: function () { + var val = this.base(); + var self = this; + /* + if (val === "") { + return []; + } + */ + + var o = {}; + if (this.olddata && Alpaca.isObject(this.olddata)) { + $.each(this.olddata, function (key, value) { + var v = Alpaca.copyOf(value); + if (key != self.culture) { + o[key] = v; + } + }); + } + if (val != "") { + o[self.culture] = val; + } + if ($.isEmptyObject(o)) { + return ""; + } + //o["_type"] = "languages"; + return o; + }, + getFloatValue: function () { + var val = this.base(); + var self = this; + + return val; + }, + setValue: function (val) { + if (val === "") { + return; + } + if (!val) { + this.base(""); + return; + } + if (Alpaca.isObject(val)) { + var v = val[this.culture]; + if (!v) { + this.base(""); + return; + } + this.base(v); + } + else { + this.base(val); + } + }, + + getControlValue: function () { + var val = this._getControlVal(true); + + if (typeof (val) == "undefined" || "" == val) { + return val; + } + + return parseFloat(val); + }, + + afterRenderControl: function (model, callback) { + var self = this; + this.base(model, function () { + self.handlePostRender(function () { + callback(); + }); + }); + }, + handlePostRender: function (callback) { + var self = this; + var el = this.getControlEl(); + $(this.control.get(0)).after(''); + callback(); + }, + + + /** + * Validates if it is a float number. + * @returns {Boolean} true if it is a float number + */ + _validateNumber: function () { + + // get value as text + var textValue = this._getControlVal(); + if (typeof (textValue) === "number") { + textValue = "" + textValue; + } + + // allow empty + if (Alpaca.isValEmpty(textValue)) { + return true; + } + + // check if valid number format + var validNumber = Alpaca.testRegex(Alpaca.regexps.number, textValue); + if (!validNumber) { + return false; + } + + // quick check to see if what they entered was a number + var floatValue = this.getFloatValue(); + if (isNaN(floatValue)) { + return false; + } + + return true; + }, + + /** + * Validates divisibleBy constraint. + * @returns {Boolean} true if it passes the divisibleBy constraint. + */ + _validateDivisibleBy: function () { + var floatValue = this.getFloatValue(); + if (!Alpaca.isEmpty(this.schema.divisibleBy)) { + + // mod + if (floatValue % this.schema.divisibleBy !== 0) { + return false; + } + } + return true; + }, + + /** + * Validates maximum constraint. + * @returns {Boolean} true if it passes the maximum constraint. + */ + _validateMaximum: function () { + var floatValue = this.getFloatValue(); + + if (!Alpaca.isEmpty(this.schema.maximum)) { + if (floatValue > this.schema.maximum) { + return false; + } + + if (!Alpaca.isEmpty(this.schema.exclusiveMaximum)) { + if (floatValue == this.schema.maximum && this.schema.exclusiveMaximum) { // jshint ignore:line + return false; + } + } + } + + return true; + }, + + /** + * Validates maximum constraint. + * @returns {Boolean} true if it passes the minimum constraint. + */ + _validateMinimum: function () { + var floatValue = this.getFloatValue(); + + if (!Alpaca.isEmpty(this.schema.minimum)) { + if (floatValue < this.schema.minimum) { + return false; + } + + if (!Alpaca.isEmpty(this.schema.exclusiveMinimum)) { + if (floatValue == this.schema.minimum && this.schema.exclusiveMinimum) { // jshint ignore:line + return false; + } + } + } + + return true; + }, + + /** + * Validates multipleOf constraint. + * @returns {Boolean} true if it passes the multipleOf constraint. + */ + _validateMultipleOf: function () { + var floatValue = this.getFloatValue(); + + if (!Alpaca.isEmpty(this.schema.multipleOf)) { + if (floatValue && this.schema.multipleOf !== 0) { + return false; + } + } + + return true; + }, + + getTitle: function () { + return "Multi Language Number Field"; + }, + + + getDescription: function () { + return "Multi Language Number field ."; + }, + + + /* end_builder_helpers */ + }); + + Alpaca.registerFieldClass("mlnumber", Alpaca.Fields.MLNumberField); + })(jQuery); (function ($) { diff --git a/OpenContent/alpaca/js/fields/dnn/dnnfields.min.js b/OpenContent/alpaca/js/fields/dnn/dnnfields.min.js index 23e8a247..ced3f877 100644 --- a/OpenContent/alpaca/js/fields/dnn/dnnfields.min.js +++ b/OpenContent/alpaca/js/fields/dnn/dnnfields.min.js @@ -1 +1 @@ -(function(n){function r(t,i){var r="";return t&&t.address_components&&n.each(t.address_components,function(t,u){n.each(u.types,function(n,t){if(t==i){r=u.long_name;return}});r!=""}),r}function u(t){var i="";return t&&t.address_components&&n.each(t.address_components,function(t,r){n.each(r.types,function(n,t){if(t=="country"){i=r.short_name;return}});i!=""}),i}function f(n){for(n=n.toUpperCase(),index=0;index<\/div>').appendTo(t),o=n('Geocode Address<\/a>').appendTo(t),o.button&&o.button({text:!0}),o.click(function(){if(google&&google.maps){var i=new google.maps.Geocoder,r=e.getAddress();i&&i.geocode({address:r},function(i,r){r===google.maps.GeocoderStatus.OK?(n(".alpaca-field.lng input.alpaca-control",t).val(i[0].geometry.location.lng()),n(".alpaca-field.lat input.alpaca-control",t).val(i[0].geometry.location.lat())):e.displayMessage("Geocoding failed: "+r)})}else e.displayMessage("Google Map API is not installed.");return!1}).wrap(""),s=n(".alpaca-field.googlesearch input.alpaca-control",t)[0],s&&typeof google!="undefined"&&google&&google.maps&&(h=new google.maps.places.SearchBox(s),google.maps.event.addListener(h,"places_changed",function(){var e=h.getPlaces(),i;e.length!=0&&(i=e[0],n(".alpaca-field.postalcode input.alpaca-control",t).val(r(i,"postal_code")),n(".alpaca-field.city input.alpaca-control",t).val(r(i,"locality")),n(".alpaca-field.street input.alpaca-control",t).val(r(i,"route")),n(".alpaca-field.number input.alpaca-control",t).val(r(i,"street_number")),n(".alpaca-field.country select.alpaca-control",t).val(f(u(i,"country"))),n(".alpaca-field.lng input.alpaca-control",t).val(i.geometry.location.lng()),n(".alpaca-field.lat input.alpaca-control",t).val(i.geometry.location.lat()),s.value="")}),google.maps.event.addDomListener(s,"keydown",function(n){n.keyCode==13&&n.preventDefault()})),e.options.showMapOnLoad&&o.click());i()})},getType:function(){return"any"},getTitle:function(){return"Address"},getDescription:function(){return"Address with Street, City, State, Postal code and Country. Also comes with support for Google map."},getSchemaOfOptions:function(){return i.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return i.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t=[{countryName:"Afghanistan",iso2:"AF",iso3:"AFG",phoneCode:"93"},{countryName:"Albania",iso2:"AL",iso3:"ALB",phoneCode:"355"},{countryName:"Algeria",iso2:"DZ",iso3:"DZA",phoneCode:"213"},{countryName:"American Samoa",iso2:"AS",iso3:"ASM",phoneCode:"1 684"},{countryName:"Andorra",iso2:"AD",iso3:"AND",phoneCode:"376"},{countryName:"Angola",iso2:"AO",iso3:"AGO",phoneCode:"244"},{countryName:"Anguilla",iso2:"AI",iso3:"AIA",phoneCode:"1 264"},{countryName:"Antarctica",iso2:"AQ",iso3:"ATA",phoneCode:"672"},{countryName:"Antigua and Barbuda",iso2:"AG",iso3:"ATG",phoneCode:"1 268"},{countryName:"Argentina",iso2:"AR",iso3:"ARG",phoneCode:"54"},{countryName:"Armenia",iso2:"AM",iso3:"ARM",phoneCode:"374"},{countryName:"Aruba",iso2:"AW",iso3:"ABW",phoneCode:"297"},{countryName:"Australia",iso2:"AU",iso3:"AUS",phoneCode:"61"},{countryName:"Austria",iso2:"AT",iso3:"AUT",phoneCode:"43"},{countryName:"Azerbaijan",iso2:"AZ",iso3:"AZE",phoneCode:"994"},{countryName:"Bahamas",iso2:"BS",iso3:"BHS",phoneCode:"1 242"},{countryName:"Bahrain",iso2:"BH",iso3:"BHR",phoneCode:"973"},{countryName:"Bangladesh",iso2:"BD",iso3:"BGD",phoneCode:"880"},{countryName:"Barbados",iso2:"BB",iso3:"BRB",phoneCode:"1 246"},{countryName:"Belarus",iso2:"BY",iso3:"BLR",phoneCode:"375"},{countryName:"Belgium",iso2:"BE",iso3:"BEL",phoneCode:"32"},{countryName:"Belize",iso2:"BZ",iso3:"BLZ",phoneCode:"501"},{countryName:"Benin",iso2:"BJ",iso3:"BEN",phoneCode:"229"},{countryName:"Bermuda",iso2:"BM",iso3:"BMU",phoneCode:"1 441"},{countryName:"Bhutan",iso2:"BT",iso3:"BTN",phoneCode:"975"},{countryName:"Bolivia",iso2:"BO",iso3:"BOL",phoneCode:"591"},{countryName:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phoneCode:"387"},{countryName:"Botswana",iso2:"BW",iso3:"BWA",phoneCode:"267"},{countryName:"Brazil",iso2:"BR",iso3:"BRA",phoneCode:"55"},{countryName:"British Indian Ocean Territory",iso2:"IO",iso3:"IOT",phoneCode:""},{countryName:"British Virgin Islands",iso2:"VG",iso3:"VGB",phoneCode:"1 284"},{countryName:"Brunei",iso2:"BN",iso3:"BRN",phoneCode:"673"},{countryName:"Bulgaria",iso2:"BG",iso3:"BGR",phoneCode:"359"},{countryName:"Burkina Faso",iso2:"BF",iso3:"BFA",phoneCode:"226"},{countryName:"Burma (Myanmar)",iso2:"MM",iso3:"MMR",phoneCode:"95"},{countryName:"Burundi",iso2:"BI",iso3:"BDI",phoneCode:"257"},{countryName:"Cambodia",iso2:"KH",iso3:"KHM",phoneCode:"855"},{countryName:"Cameroon",iso2:"CM",iso3:"CMR",phoneCode:"237"},{countryName:"Canada",iso2:"CA",iso3:"CAN",phoneCode:"1"},{countryName:"Cape Verde",iso2:"CV",iso3:"CPV",phoneCode:"238"},{countryName:"Cayman Islands",iso2:"KY",iso3:"CYM",phoneCode:"1 345"},{countryName:"Central African Republic",iso2:"CF",iso3:"CAF",phoneCode:"236"},{countryName:"Chad",iso2:"TD",iso3:"TCD",phoneCode:"235"},{countryName:"Chile",iso2:"CL",iso3:"CHL",phoneCode:"56"},{countryName:"China",iso2:"CN",iso3:"CHN",phoneCode:"86"},{countryName:"Christmas Island",iso2:"CX",iso3:"CXR",phoneCode:"61"},{countryName:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phoneCode:"61"},{countryName:"Colombia",iso2:"CO",iso3:"COL",phoneCode:"57"},{countryName:"Comoros",iso2:"KM",iso3:"COM",phoneCode:"269"},{countryName:"Cook Islands",iso2:"CK",iso3:"COK",phoneCode:"682"},{countryName:"Costa Rica",iso2:"CR",iso3:"CRC",phoneCode:"506"},{countryName:"Croatia",iso2:"HR",iso3:"HRV",phoneCode:"385"},{countryName:"Cuba",iso2:"CU",iso3:"CUB",phoneCode:"53"},{countryName:"Cyprus",iso2:"CY",iso3:"CYP",phoneCode:"357"},{countryName:"Czech Republic",iso2:"CZ",iso3:"CZE",phoneCode:"420"},{countryName:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phoneCode:"243"},{countryName:"Denmark",iso2:"DK",iso3:"DNK",phoneCode:"45"},{countryName:"Djibouti",iso2:"DJ",iso3:"DJI",phoneCode:"253"},{countryName:"Dominica",iso2:"DM",iso3:"DMA",phoneCode:"1 767"},{countryName:"Dominican Republic",iso2:"DO",iso3:"DOM",phoneCode:"1 809"},{countryName:"Ecuador",iso2:"EC",iso3:"ECU",phoneCode:"593"},{countryName:"Egypt",iso2:"EG",iso3:"EGY",phoneCode:"20"},{countryName:"El Salvador",iso2:"SV",iso3:"SLV",phoneCode:"503"},{countryName:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phoneCode:"240"},{countryName:"Eritrea",iso2:"ER",iso3:"ERI",phoneCode:"291"},{countryName:"Estonia",iso2:"EE",iso3:"EST",phoneCode:"372"},{countryName:"Ethiopia",iso2:"ET",iso3:"ETH",phoneCode:"251"},{countryName:"Falkland Islands",iso2:"FK",iso3:"FLK",phoneCode:"500"},{countryName:"Faroe Islands",iso2:"FO",iso3:"FRO",phoneCode:"298"},{countryName:"Fiji",iso2:"FJ",iso3:"FJI",phoneCode:"679"},{countryName:"Finland",iso2:"FI",iso3:"FIN",phoneCode:"358"},{countryName:"France",iso2:"FR",iso3:"FRA",phoneCode:"33"},{countryName:"French Polynesia",iso2:"PF",iso3:"PYF",phoneCode:"689"},{countryName:"Gabon",iso2:"GA",iso3:"GAB",phoneCode:"241"},{countryName:"Gambia",iso2:"GM",iso3:"GMB",phoneCode:"220"},{countryName:"Gaza Strip",iso2:"",iso3:"",phoneCode:"970"},{countryName:"Georgia",iso2:"GE",iso3:"GEO",phoneCode:"995"},{countryName:"Germany",iso2:"DE",iso3:"DEU",phoneCode:"49"},{countryName:"Ghana",iso2:"GH",iso3:"GHA",phoneCode:"233"},{countryName:"Gibraltar",iso2:"GI",iso3:"GIB",phoneCode:"350"},{countryName:"Greece",iso2:"GR",iso3:"GRC",phoneCode:"30"},{countryName:"Greenland",iso2:"GL",iso3:"GRL",phoneCode:"299"},{countryName:"Grenada",iso2:"GD",iso3:"GRD",phoneCode:"1 473"},{countryName:"Guam",iso2:"GU",iso3:"GUM",phoneCode:"1 671"},{countryName:"Guatemala",iso2:"GT",iso3:"GTM",phoneCode:"502"},{countryName:"Guinea",iso2:"GN",iso3:"GIN",phoneCode:"224"},{countryName:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phoneCode:"245"},{countryName:"Guyana",iso2:"GY",iso3:"GUY",phoneCode:"592"},{countryName:"Haiti",iso2:"HT",iso3:"HTI",phoneCode:"509"},{countryName:"Holy See (Vatican City)",iso2:"VA",iso3:"VAT",phoneCode:"39"},{countryName:"Honduras",iso2:"HN",iso3:"HND",phoneCode:"504"},{countryName:"Hong Kong",iso2:"HK",iso3:"HKG",phoneCode:"852"},{countryName:"Hungary",iso2:"HU",iso3:"HUN",phoneCode:"36"},{countryName:"Iceland",iso2:"IS",iso3:"IS",phoneCode:"354"},{countryName:"India",iso2:"IN",iso3:"IND",phoneCode:"91"},{countryName:"Indonesia",iso2:"ID",iso3:"IDN",phoneCode:"62"},{countryName:"Iran",iso2:"IR",iso3:"IRN",phoneCode:"98"},{countryName:"Iraq",iso2:"IQ",iso3:"IRQ",phoneCode:"964"},{countryName:"Ireland",iso2:"IE",iso3:"IRL",phoneCode:"353"},{countryName:"Isle of Man",iso2:"IM",iso3:"IMN",phoneCode:"44"},{countryName:"Israel",iso2:"IL",iso3:"ISR",phoneCode:"972"},{countryName:"Italy",iso2:"IT",iso3:"ITA",phoneCode:"39"},{countryName:"Ivory Coast",iso2:"CI",iso3:"CIV",phoneCode:"225"},{countryName:"Jamaica",iso2:"JM",iso3:"JAM",phoneCode:"1 876"},{countryName:"Japan",iso2:"JP",iso3:"JPN",phoneCode:"81"},{countryName:"Jersey",iso2:"JE",iso3:"JEY",phoneCode:""},{countryName:"Jordan",iso2:"JO",iso3:"JOR",phoneCode:"962"},{countryName:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phoneCode:"7"},{countryName:"Kenya",iso2:"KE",iso3:"KEN",phoneCode:"254"},{countryName:"Kiribati",iso2:"KI",iso3:"KIR",phoneCode:"686"},{countryName:"Kosovo",iso2:"",iso3:"",phoneCode:"381"},{countryName:"Kuwait",iso2:"KW",iso3:"KWT",phoneCode:"965"},{countryName:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phoneCode:"996"},{countryName:"Laos",iso2:"LA",iso3:"LAO",phoneCode:"856"},{countryName:"Latvia",iso2:"LV",iso3:"LVA",phoneCode:"371"},{countryName:"Lebanon",iso2:"LB",iso3:"LBN",phoneCode:"961"},{countryName:"Lesotho",iso2:"LS",iso3:"LSO",phoneCode:"266"},{countryName:"Liberia",iso2:"LR",iso3:"LBR",phoneCode:"231"},{countryName:"Libya",iso2:"LY",iso3:"LBY",phoneCode:"218"},{countryName:"Liechtenstein",iso2:"LI",iso3:"LIE",phoneCode:"423"},{countryName:"Lithuania",iso2:"LT",iso3:"LTU",phoneCode:"370"},{countryName:"Luxembourg",iso2:"LU",iso3:"LUX",phoneCode:"352"},{countryName:"Macau",iso2:"MO",iso3:"MAC",phoneCode:"853"},{countryName:"Macedonia",iso2:"MK",iso3:"MKD",phoneCode:"389"},{countryName:"Madagascar",iso2:"MG",iso3:"MDG",phoneCode:"261"},{countryName:"Malawi",iso2:"MW",iso3:"MWI",phoneCode:"265"},{countryName:"Malaysia",iso2:"MY",iso3:"MYS",phoneCode:"60"},{countryName:"Maldives",iso2:"MV",iso3:"MDV",phoneCode:"960"},{countryName:"Mali",iso2:"ML",iso3:"MLI",phoneCode:"223"},{countryName:"Malta",iso2:"MT",iso3:"MLT",phoneCode:"356"},{countryName:"Marshall Islands",iso2:"MH",iso3:"MHL",phoneCode:"692"},{countryName:"Mauritania",iso2:"MR",iso3:"MRT",phoneCode:"222"},{countryName:"Mauritius",iso2:"MU",iso3:"MUS",phoneCode:"230"},{countryName:"Mayotte",iso2:"YT",iso3:"MYT",phoneCode:"262"},{countryName:"Mexico",iso2:"MX",iso3:"MEX",phoneCode:"52"},{countryName:"Micronesia",iso2:"FM",iso3:"FSM",phoneCode:"691"},{countryName:"Moldova",iso2:"MD",iso3:"MDA",phoneCode:"373"},{countryName:"Monaco",iso2:"MC",iso3:"MCO",phoneCode:"377"},{countryName:"Mongolia",iso2:"MN",iso3:"MNG",phoneCode:"976"},{countryName:"Montenegro",iso2:"ME",iso3:"MNE",phoneCode:"382"},{countryName:"Montserrat",iso2:"MS",iso3:"MSR",phoneCode:"1 664"},{countryName:"Morocco",iso2:"MA",iso3:"MAR",phoneCode:"212"},{countryName:"Mozambique",iso2:"MZ",iso3:"MOZ",phoneCode:"258"},{countryName:"Namibia",iso2:"NA",iso3:"NAM",phoneCode:"264"},{countryName:"Nauru",iso2:"NR",iso3:"NRU",phoneCode:"674"},{countryName:"Nepal",iso2:"NP",iso3:"NPL",phoneCode:"977"},{countryName:"Netherlands",iso2:"NL",iso3:"NLD",phoneCode:"31"},{countryName:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phoneCode:"599"},{countryName:"New Caledonia",iso2:"NC",iso3:"NCL",phoneCode:"687"},{countryName:"New Zealand",iso2:"NZ",iso3:"NZL",phoneCode:"64"},{countryName:"Nicaragua",iso2:"NI",iso3:"NIC",phoneCode:"505"},{countryName:"Niger",iso2:"NE",iso3:"NER",phoneCode:"227"},{countryName:"Nigeria",iso2:"NG",iso3:"NGA",phoneCode:"234"},{countryName:"Niue",iso2:"NU",iso3:"NIU",phoneCode:"683"},{countryName:"Norfolk Island",iso2:"",iso3:"NFK",phoneCode:"672"},{countryName:"North Korea",iso2:"KP",iso3:"PRK",phoneCode:"850"},{countryName:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phoneCode:"1 670"},{countryName:"Norway",iso2:"NO",iso3:"NOR",phoneCode:"47"},{countryName:"Oman",iso2:"OM",iso3:"OMN",phoneCode:"968"},{countryName:"Pakistan",iso2:"PK",iso3:"PAK",phoneCode:"92"},{countryName:"Palau",iso2:"PW",iso3:"PLW",phoneCode:"680"},{countryName:"Panama",iso2:"PA",iso3:"PAN",phoneCode:"507"},{countryName:"Papua New Guinea",iso2:"PG",iso3:"PNG",phoneCode:"675"},{countryName:"Paraguay",iso2:"PY",iso3:"PRY",phoneCode:"595"},{countryName:"Peru",iso2:"PE",iso3:"PER",phoneCode:"51"},{countryName:"Philippines",iso2:"PH",iso3:"PHL",phoneCode:"63"},{countryName:"Pitcairn Islands",iso2:"PN",iso3:"PCN",phoneCode:"870"},{countryName:"Poland",iso2:"PL",iso3:"POL",phoneCode:"48"},{countryName:"Portugal",iso2:"PT",iso3:"PRT",phoneCode:"351"},{countryName:"Puerto Rico",iso2:"PR",iso3:"PRI",phoneCode:"1"},{countryName:"Qatar",iso2:"QA",iso3:"QAT",phoneCode:"974"},{countryName:"Republic of the Congo",iso2:"CG",iso3:"COG",phoneCode:"242"},{countryName:"Romania",iso2:"RO",iso3:"ROU",phoneCode:"40"},{countryName:"Russia",iso2:"RU",iso3:"RUS",phoneCode:"7"},{countryName:"Rwanda",iso2:"RW",iso3:"RWA",phoneCode:"250"},{countryName:"Saint Barthelemy",iso2:"BL",iso3:"BLM",phoneCode:"590"},{countryName:"Saint Helena",iso2:"SH",iso3:"SHN",phoneCode:"290"},{countryName:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phoneCode:"1 869"},{countryName:"Saint Lucia",iso2:"LC",iso3:"LCA",phoneCode:"1 758"},{countryName:"Saint Martin",iso2:"MF",iso3:"MAF",phoneCode:"1 599"},{countryName:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phoneCode:"508"},{countryName:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phoneCode:"1 784"},{countryName:"Samoa",iso2:"WS",iso3:"WSM",phoneCode:"685"},{countryName:"San Marino",iso2:"SM",iso3:"SMR",phoneCode:"378"},{countryName:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phoneCode:"239"},{countryName:"Saudi Arabia",iso2:"SA",iso3:"SAU",phoneCode:"966"},{countryName:"Senegal",iso2:"SN",iso3:"SEN",phoneCode:"221"},{countryName:"Serbia",iso2:"RS",iso3:"SRB",phoneCode:"381"},{countryName:"Seychelles",iso2:"SC",iso3:"SYC",phoneCode:"248"},{countryName:"Sierra Leone",iso2:"SL",iso3:"SLE",phoneCode:"232"},{countryName:"Singapore",iso2:"SG",iso3:"SGP",phoneCode:"65"},{countryName:"Slovakia",iso2:"SK",iso3:"SVK",phoneCode:"421"},{countryName:"Slovenia",iso2:"SI",iso3:"SVN",phoneCode:"386"},{countryName:"Solomon Islands",iso2:"SB",iso3:"SLB",phoneCode:"677"},{countryName:"Somalia",iso2:"SO",iso3:"SOM",phoneCode:"252"},{countryName:"South Africa",iso2:"ZA",iso3:"ZAF",phoneCode:"27"},{countryName:"South Korea",iso2:"KR",iso3:"KOR",phoneCode:"82"},{countryName:"Spain",iso2:"ES",iso3:"ESP",phoneCode:"34"},{countryName:"Sri Lanka",iso2:"LK",iso3:"LKA",phoneCode:"94"},{countryName:"Sudan",iso2:"SD",iso3:"SDN",phoneCode:"249"},{countryName:"Suriname",iso2:"SR",iso3:"SUR",phoneCode:"597"},{countryName:"Svalbard",iso2:"SJ",iso3:"SJM",phoneCode:""},{countryName:"Swaziland",iso2:"SZ",iso3:"SWZ",phoneCode:"268"},{countryName:"Sweden",iso2:"SE",iso3:"SWE",phoneCode:"46"},{countryName:"Switzerland",iso2:"CH",iso3:"CHE",phoneCode:"41"},{countryName:"Syria",iso2:"SY",iso3:"SYR",phoneCode:"963"},{countryName:"Taiwan",iso2:"TW",iso3:"TWN",phoneCode:"886"},{countryName:"Tajikistan",iso2:"TJ",iso3:"TJK",phoneCode:"992"},{countryName:"Tanzania",iso2:"TZ",iso3:"TZA",phoneCode:"255"},{countryName:"Thailand",iso2:"TH",iso3:"THA",phoneCode:"66"},{countryName:"Timor-Leste",iso2:"TL",iso3:"TLS",phoneCode:"670"},{countryName:"Togo",iso2:"TG",iso3:"TGO",phoneCode:"228"},{countryName:"Tokelau",iso2:"TK",iso3:"TKL",phoneCode:"690"},{countryName:"Tonga",iso2:"TO",iso3:"TON",phoneCode:"676"},{countryName:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phoneCode:"1 868"},{countryName:"Tunisia",iso2:"TN",iso3:"TUN",phoneCode:"216"},{countryName:"Turkey",iso2:"TR",iso3:"TUR",phoneCode:"90"},{countryName:"Turkmenistan",iso2:"TM",iso3:"TKM",phoneCode:"993"},{countryName:"Turks and Caicos Islands",iso2:"TC",iso3:"TCA",phoneCode:"1 649"},{countryName:"Tuvalu",iso2:"TV",iso3:"TUV",phoneCode:"688"},{countryName:"Uganda",iso2:"UG",iso3:"UGA",phoneCode:"256"},{countryName:"Ukraine",iso2:"UA",iso3:"UKR",phoneCode:"380"},{countryName:"United Arab Emirates",iso2:"AE",iso3:"ARE",phoneCode:"971"},{countryName:"United Kingdom",iso2:"GB",iso3:"GBR",phoneCode:"44"},{countryName:"United States",iso2:"US",iso3:"USA",phoneCode:"1"},{countryName:"Uruguay",iso2:"UY",iso3:"URY",phoneCode:"598"},{countryName:"US Virgin Islands",iso2:"VI",iso3:"VIR",phoneCode:"1 340"},{countryName:"Uzbekistan",iso2:"UZ",iso3:"UZB",phoneCode:"998"},{countryName:"Vanuatu",iso2:"VU",iso3:"VUT",phoneCode:"678"},{countryName:"Venezuela",iso2:"VE",iso3:"VEN",phoneCode:"58"},{countryName:"Vietnam",iso2:"VN",iso3:"VNM",phoneCode:"84"},{countryName:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phoneCode:"681"},{countryName:"West Bank",iso2:"",iso3:"",phoneCode:"970"},{countryName:"Western Sahara",iso2:"EH",iso3:"ESH",phoneCode:""},{countryName:"Yemen",iso2:"YE",iso3:"YEM",phoneCode:"967"},{countryName:"Zambia",iso2:"ZM",iso3:"ZMB",phoneCode:"260"},{countryName:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phoneCode:"263"}];i.registerFieldClass("address",i.Fields.AddressField)})(jQuery),function(n){var t=n.alpaca;t.Fields.CKEditorField=t.Fields.TextAreaField.extend({getFieldType:function(){return"ckeditor"},constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},setup:function(){this.data||(this.data="");this.base();typeof this.options.ckeditor=="undefined"&&(this.options.ckeditor={});typeof this.options.configset=="undefined"&&(this.options.configset="")},afterRenderControl:function(t,i){var r=this;this.base(t,function(){var t,u;if(!r.isDisplayOnly()&&r.control&&typeof CKEDITOR!="undefined"){t={toolbar:[{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"styles",items:["Styles","Format"]},{name:"paragraph",groups:["list","indent","blocks","align"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock",]},{name:"links",items:["Link","Unlink"]},{name:"document",groups:["mode","document","doctools"],items:["Source"]},],format_tags:"p;h1;h2;h3;pre",removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]};r.options.configset=="basic"?t={toolbar:[{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"styles",items:["Styles","Format"]},{name:"paragraph",groups:["list","indent","blocks","align"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock",]},{name:"links",items:["Link","Unlink"]},{name:"document",groups:["mode","document","doctools"],items:["Maximize","Source"]},],format_tags:"p;h1;h2;h3;pre",removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath,link",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]}:r.options.configset=="standard"?t={toolbar:[{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"styles",items:["Styles","Format"]},{name:"paragraph",groups:["list","indent","blocks","align"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock",]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"insert",items:["Table","Smiley","SpecialChar","Iframe"]},{name:"document",groups:["mode","document","doctools"],items:["Maximize","ShowBlocks","Source"]}],format_tags:"p;h1;h2;h3;pre;div",extraAllowedContent:"table tr th td caption[*](*);div span(*);",removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath,link",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]}:r.options.configset=="full"&&(t={toolbar:[{name:"clipboard",items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"editing",items:["Find","Replace","-","SelectAll","-","SpellChecker","Scayt"]},{name:"insert",items:["EasyImageUpload","Table","HorizontalRule","Smiley","SpecialChar","PageBreak","Iframe"]},"/",{name:"basicstyles",items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","CreateDiv","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","-","BidiLtr","BidiRtl"]},{name:"links",items:["Link","Unlink","Anchor"]},"/",{name:"styles",items:["Styles","Format","Font","FontSize"]},{name:"colors",items:["TextColor","BGColor"]},{name:"tools",items:["Maximize","ShowBlocks","-","About","-","Source"]}],format_tags:"p;h1;h2;h3;pre;div",allowedContentRules:!0,removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath,link,image",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]});u=n.extend({},t,r.options.ckeditor);r.on("ready",function(){r.editor||(r.sf&&(u.cloudServices_uploadUrl=r.sf.getServiceRoot("OpenContent")+"FileUpload/UploadEasyImage",u.cloudServices_tokenUrl=r.sf.getServiceRoot("OpenContent")+"FileUpload/EasyImageToken"),r.editor=CKEDITOR.replace(n(r.control)[0],u),r.initCKEditorEvents())})}n(r.control).bind("destroyed",function(){if(r.editor){r.editor.removeAllListeners();try{r.editor.destroy(!1)}catch(n){}r.editor=null}});i()})},initCKEditorEvents:function(){var n=this;if(n.editor){n.editor.on("click",function(t){n.onClick.call(n,t);n.trigger("click",t)});n.editor.on("change",function(t){n.onChange();n.triggerWithPropagation("change",t)});n.editor.on("blur",function(t){n.onBlur();n.trigger("blur",t)});n.editor.on("focus",function(t){n.onFocus.call(n,t);n.trigger("focus",t)});n.editor.on("key",function(t){n.onKeyPress.call(n,t);n.trigger("keypress",t)});n.editor.on("fileUploadRequest",function(t){n.sf.setModuleHeaders(t.data.fileLoader.xhr)})}},setValue:function(n){var t=this;this.base(n);t.editor&&t.editor.setData(n)},getControlValue:function(){var n=this,t=null;return n.editor&&(t=n.editor.getData()),t},destroy:function(){var n=this;n.editor&&(n.editor.destroy(),n.editor=null);this.base()},getTitle:function(){return"CK Editor"},getDescription:function(){return"Provides an instance of a CK Editor control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{ckeditor:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{ckeditor:{type:"any"}}})}});t.registerFieldClass("ckeditor",t.Fields.CKEditorField)}(jQuery),function(n){var t=n.alpaca;t.Fields.CheckBoxField=t.ControlField.extend({getFieldType:function(){return"checkbox"},setup:function(){var i=this,r;i.base();typeof i.options.multiple=="undefined"&&(i.schema.type==="array"?i.options.multiple=!0:typeof i.schema["enum"]!="undefined"&&(i.options.multiple=!0));i.options.multiple?(i.checkboxOptions=[],i.getEnum()&&(i.sortEnum(),r=i.getOptionLabels(),n.each(i.getEnum(),function(n,u){var f=u;r&&(t.isEmpty(r[n])?t.isEmpty(r[u])||(f=r[u]):f=r[n]);i.checkboxOptions.push({value:u,text:f})})),i.options.datasource&&!i.options.dataSource&&(i.options.dataSource=i.options.datasource,delete i.options.datasource),typeof i.options.useDataSourceAsEnum=="undefined"&&(i.options.useDataSourceAsEnum=!0)):this.options.rightLabel||(this.options.rightLabel="")},prepareControlModel:function(n){var t=this;this.base(function(i){t.checkboxOptions&&(i.checkboxOptions=t.checkboxOptions);n(i)})},getEnum:function(){var n=this.base();return n||this.schema&&this.schema.items&&this.schema.items.enum&&(n=this.schema.items.enum),n},getOptionLabels:function(){var n=this.base();return n||this.options&&this.options.items&&this.options.items.optionLabels&&(n=this.options.items.optionLabels),n},onClick:function(){this.refreshValidationState()},beforeRenderControl:function(n,t){var i=this;this.base(n,function(){i.options.dataSource?(i.options.multiple=!0,i.checkboxOptions||(n.checkboxOptions=i.checkboxOptions=[]),i.checkboxOptions.length=0,i.invokeDataSource(i.checkboxOptions,n,function(){var r,u,n;if(i.options.useDataSourceAsEnum){for(r=[],u=[],n=0;n0?t.checked(n(e[0])):!1;return r},isEmpty:function(){var n=this,i=this.getControlValue();if(n.options.multiple){if(n.schema.type==="array")return i.length==0;if(n.schema.type==="string")return t.isEmpty(i)}else return!i},setValue:function(i){var r=this,f=function(i){t.isString(i)&&(i=i==="true");var u=n(r.getFieldEl()).find("input");u.length>0&&t.checked(n(u[0]),i)},e=function(u){var f,e,o;for(typeof u=="string"&&(u=u.split(",")),f=0;f0&&t.checked(n(o[0]),i)},u=!1;r.options.multiple?typeof i=="string"?(e(i),u=!0):t.isArray(i)&&(e(i),u=!0):typeof i=="boolean"?(f(i),u=!0):typeof i=="string"&&(f(i),u=!0);!u&&i&&t.logError("CheckboxField cannot set value for schema.type="+r.schema.type+" and value="+i);this.base(i)},_validateEnum:function(){var i=this,n;return i.options.multiple?(n=i.getValue(),!i.isRequired()&&t.isValEmpty(n))?!0:(typeof n=="string"&&(n=n.split(",")),t.anyEquality(n,i.getEnum())):!0},disable:function(){n(this.control).find("input").each(function(){n(this).disabled=!0;n(this).prop("disabled",!0)})},enable:function(){n(this.control).find("input").each(function(){n(this).disabled=!1;n(this).prop("disabled",!1)})},getType:function(){return"boolean"},getTitle:function(){return"Checkbox Field"},getDescription:function(){return"Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rightLabel:{title:"Option Label",description:"Optional right-hand side label for single checkbox field.",type:"string"},multiple:{title:"Multiple",description:"Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)",type:"boolean"},dataSource:{title:"Option DataSource",description:"Data source for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.",type:"string"},useDataSourceAsEnum:{title:"Use Data Source as Enumerated Values",description:"Whether to constrain the field's schema enum property to the values that come back from the data source.",type:"boolean","default":!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rightLabel:{type:"text"},multiple:{type:"checkbox"},dataSource:{type:"text"}}})}});t.registerFieldClass("checkbox",t.Fields.CheckBoxField);t.registerDefaultSchemaFieldMapping("boolean","checkbox")}(jQuery),function(n){var t=n.alpaca;t.Fields.DateField=t.Fields.TextField.extend({getFieldType:function(){return"date"},getDefaultFormat:function(){return"MM/DD/YYYY"},getDefaultExtraFormats:function(){return[]},setup:function(){var n=this,t;this.base();n.options.picker||(n.options.picker={});typeof n.options.picker.useCurrent=="undefined"&&(n.options.picker.useCurrent=!1);!n.options.dateFormat;n.options.picker.format||(n.options.picker.format=n.options.dateFormat);n.options.picker.extraFormats||(t=n.getDefaultExtraFormats(),t&&(n.options.picker.extraFormats=t));typeof n.options.manualEntry=="undefined"&&(n.options.manualEntry=!1);typeof n.options.icon=="undefined"&&(n.options.icon=!1)},onKeyPress:function(n){if(this.options.manualEntry)n.preventDefault(),n.stopImmediatePropagation();else{this.base(n);return}},onKeyDown:function(n){if(this.options.manualEntry)n.preventDefault(),n.stopImmediatePropagation();else{this.base(n);return}},beforeRenderControl:function(n,t){this.field.css("position","relative");t()},afterRenderControl:function(t,i){var r=this;this.base(t,function(){if(r.view.type!=="display"){if(t=r.getControlEl(),r.options.icon){r.getControlEl().wrap('
    <\/div>');r.getControlEl().after('<\/span><\/span>');var t=r.getControlEl().parent()}if(n.fn.datetimepicker){t.datetimepicker(r.options.picker);r.picker=t.data("DateTimePicker");t.on("dp.change",function(n){setTimeout(function(){r.onChange.call(r,n);r.triggerWithPropagation("change",n)},250)});r.data&&r.picker.date(r.data)}}i()})},getDate:function(){var n=this,t=null;try{t=n.picker?n.picker.date()?n.picker.date()._d:null:new Date(this.getValue())}catch(i){console.error(i)}return t},date:function(){return this.getDate()},onChange:function(){this.base();this.refreshValidationState()},isAutoFocusable:function(){return!1},handleValidate:function(){var r=this.base(),n=this.validation,i=this._validateDateFormat();return n.invalidDate={message:i?"":t.substituteTokens(this.getMessage("invalidDate"),[this.options.dateFormat]),status:i},r&&n.invalidDate.status},_validateDateFormat:function(){var n=this,r=!0,u,i,t;if(n.options.dateFormat&&(u=n.getValue(),u||n.isRequired())){if(i=[],i.push(n.options.dateFormat),n.options.picker&&n.options.picker.extraFormats)for(t=0;tBootstrap DateTime Picker<\/a>.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{dateFormat:{type:"text"},picker:{type:"any"}}})}});t.registerMessages({invalidDate:"Invalid date for format {0}"});t.registerFieldClass("date",t.Fields.DateField);t.registerDefaultFormatFieldMapping("date","date")}(jQuery),function(n){var t=n.alpaca;t.Fields.CheckBoxField=t.ControlField.extend({getFieldType:function(){return"checkbox"},setup:function(){var i=this,r;i.base();typeof i.options.multiple=="undefined"&&(i.schema.type==="array"?i.options.multiple=!0:typeof i.schema["enum"]!="undefined"&&(i.options.multiple=!0));i.options.multiple?(i.checkboxOptions=[],i.getEnum()&&(i.sortEnum(),r=i.getOptionLabels(),n.each(i.getEnum(),function(n,u){var f=u;r&&(t.isEmpty(r[n])?t.isEmpty(r[u])||(f=r[u]):f=r[n]);i.checkboxOptions.push({value:u,text:f})})),i.options.datasource&&!i.options.dataSource&&(i.options.dataSource=i.options.datasource,delete i.options.datasource),typeof i.options.useDataSourceAsEnum=="undefined"&&(i.options.useDataSourceAsEnum=!0)):this.options.rightLabel||(this.options.rightLabel="")},prepareControlModel:function(n){var t=this;this.base(function(i){t.checkboxOptions&&(i.checkboxOptions=t.checkboxOptions);n(i)})},getEnum:function(){var n=this.base();return n||this.schema&&this.schema.items&&this.schema.items.enum&&(n=this.schema.items.enum),n},getOptionLabels:function(){var n=this.base();return n||this.options&&this.options.items&&this.options.items.optionLabels&&(n=this.options.items.optionLabels),n},onClick:function(){this.refreshValidationState()},beforeRenderControl:function(n,t){var i=this;this.base(n,function(){i.options.dataSource?(i.options.multiple=!0,i.checkboxOptions||(n.checkboxOptions=i.checkboxOptions=[]),i.checkboxOptions.length=0,i.invokeDataSource(i.checkboxOptions,n,function(){var r,u,n;if(i.options.useDataSourceAsEnum){for(r=[],u=[],n=0;n0?t.checked(n(e[0])):!1;return r},isEmpty:function(){var n=this,i=this.getControlValue();if(n.options.multiple){if(n.schema.type==="array")return i.length==0;if(n.schema.type==="string")return t.isEmpty(i)}else return!i},setValue:function(i){var r=this,f=function(i){t.isString(i)&&(i=i==="true");var u=n(r.getFieldEl()).find("input");u.length>0&&t.checked(n(u[0]),i)},e=function(u){var f,e,o;for(typeof u=="string"&&(u=u.split(",")),f=0;f0&&t.checked(n(o[0]),i)},u=!1;r.options.multiple?typeof i=="string"?(e(i),u=!0):t.isArray(i)&&(e(i),u=!0):typeof i=="boolean"?(f(i),u=!0):typeof i=="string"&&(f(i),u=!0);!u&&i&&t.logError("CheckboxField cannot set value for schema.type="+r.schema.type+" and value="+i);this.base(i)},_validateEnum:function(){var i=this,n;return i.options.multiple?(n=i.getValue(),!i.isRequired()&&t.isValEmpty(n))?!0:(typeof n=="string"&&(n=n.split(",")),t.anyEquality(n,i.getEnum())):!0},disable:function(){n(this.control).find("input").each(function(){n(this).disabled=!0;n(this).prop("disabled",!0)})},enable:function(){n(this.control).find("input").each(function(){n(this).disabled=!1;n(this).prop("disabled",!1)})},getType:function(){return"boolean"},getTitle:function(){return"Checkbox Field"},getDescription:function(){return"Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rightLabel:{title:"Option Label",description:"Optional right-hand side label for single checkbox field.",type:"string"},multiple:{title:"Multiple",description:"Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)",type:"boolean"},dataSource:{title:"Option DataSource",description:"Data source for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.",type:"string"},useDataSourceAsEnum:{title:"Use Data Source as Enumerated Values",description:"Whether to constrain the field's schema enum property to the values that come back from the data source.",type:"boolean","default":!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rightLabel:{type:"text"},multiple:{type:"checkbox"},dataSource:{type:"text"}}})}});t.registerFieldClass("checkbox",t.Fields.CheckBoxField);t.registerDefaultSchemaFieldMapping("boolean","checkbox")}(jQuery),function(n){var t=n.alpaca;t.Fields.MultiUploadField=t.Fields.ArrayField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.itemsCount=0},setup:function(){var t,n;if(this.base(),this.options.uploadfolder||(this.options.uploadfolder=""),this.urlfield="",this.options&&this.options.items&&(this.options.items.fields||this.options.items.type)&&this.options.items.type!="image"&&this.options.items.fields)for(t in this.options.items.fields)if(n=this.options.items.fields[t],n.type=="image"||n.type=="mlimage"||n.type=="imagecrop"){this.urlfield=t;this.options.uploadfolder=n.uploadfolder;break}else if(n.type=="file"||n.type=="mlfile"){this.urlfield=t;this.options.uploadfolder=n.uploadfolder;break}else if(n.type=="image2"||n.type=="mlimage2"){this.urlfield=t;this.options.uploadfolder=n.folder;break}else if(n.type=="file2"||n.type=="mlfile2"){this.urlfield=t;this.options.uploadfolder=n.folder;break}},afterRenderContainer:function(t,i){var r=this;this.base(t,function(){var t=r.getContainerEl(),f,u;r.isDisplayOnly()||(n('
    <\/div>').prependTo(t),f=n('
    <\/div><\/div>').prependTo(t),u=n('').prependTo(t),this.wrapper=n("<\/span>"),this.wrapper.text("Upload muliple files"),u.wrap(this.wrapper),r.sf&&u.fileupload({dataType:"json",url:r.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:r.options.uploadfolder},beforeSend:r.sf.setModuleHeaders,change:function(){r.itemsCount=r.children.length},add:function(n,t){t.submit()},progressall:function(t,i){var r=parseInt(i.loaded/i.total*100,10);n(".bar",f).css("width",r+"%").find("span").html(r+"%")},done:function(t,i){i.result&&n.each(i.result,function(n,t){r.handleActionBarAddItemClick(r.itemsCount-1,function(n){var i=n.getValue();r.urlfield==""?i=t.url:i[r.urlfield]=t.url;n.setValue(i)});r.itemsCount++})}}).data("loaded",!0));i()})},getTitle:function(){return"Multi Upload"},getDescription:function(){return"Multi Upload for images and files"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t.registerFieldClass("multiupload",t.Fields.MultiUploadField)}(jQuery),function(n){var t=n.alpaca;t.Fields.DocumentsField=t.Fields.MultiUploadField.extend({setup:function(){this.base();this.schema.items={type:"object",properties:{Title:{title:"Title",type:"string"},File:{title:"File",type:"string"}}};t.merge(this.options.items,{fields:{File:{type:"file"}}});this.urlfield="File"},getTitle:function(){return"Gallery"},getDescription:function(){return"Image Gallery"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t.registerFieldClass("documents",t.Fields.DocumentsField)}(jQuery),function(n){var t=n.alpaca;t.Fields.File2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"file2"},setup:function(){var n=this,t;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.options.filter||(this.options.filter="");this.options.showUrlUpload||(this.options.showUrlUpload=!1);this.options.showFileUpload||(this.options.showFileUpload=!1);this.options.showUrlUpload&&(this.options.buttons={downloadButton:{value:"Upload External File",click:function(){this.DownLoadFile()}}});n=this;this.options.lazyLoading&&(t=10,this.options.select2={ajax:{url:this.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FilesLookup",beforeSend:this.sf.setModuleHeaders,type:"get",dataType:"json",delay:250,data:function(i){return{q:i.term?i.term:"*",d:n.options.folder,filter:n.options.filter,pageIndex:i.page?i.page:1,pageSize:t}},processResults:function(i,r){return r.page=r.page||1,r.page==1&&i.items.unshift({id:"",text:n.options.noneLabel}),{results:i.items,pagination:{more:r.page*t0){if(i=n(this.control).find("select").val(),typeof i=="undefined")i=this.data;else if(t.isArray(i))for(r=0;r0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(t.loading)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n("select",u.getControlEl()).select2(i)}u.options.uploadhidden?n(u.getControlEl()).find("input[type=file]").hide():u.sf&&n(u.getControlEl()).find("input[type=file]").fileupload({dataType:"json",url:u.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:u.options.folder},beforeSend:u.sf.setModuleHeaders,add:function(n,t){if(t&&t.files&&t.files.length>0)if(u.isFilter(t.files[0].name))t.submit();else{alert("file not in filter");return}},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(t,i){$select=n(u.control).find("select");u.options.lazyLoading?u.getFileUrl(i.id,function(n){$select.find("option").first().val(n.id).text(n.text).removeData();$select.val(i.id).change()}):u.refresh(function(){$select=n(u.control).find("select");$select.val(i.id).change()})})}}).data("loaded",!0);r()})},getFileUrl:function(t,i){var r=this,u;r.sf&&(u={fileid:t,folder:r.options.folder},n.ajax({url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileInfo",beforeSend:r.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:u,success:function(n){i&&i(n)},error:function(){alert("Error getFileUrl "+t)}}))},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(){}),r):!0:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTextControlEl:function(){var t=this;return n(t.getControlEl()).find("input[type=text]")},DownLoadFile:function(){var t=this,u=this.getTextControlEl(),i=u.val(),r;if(!i||!t.isURL(i)){alert("url not valid");return}if(!t.isFilter(i)){alert("url not in filter");return}r={url:i,uploadfolder:t.options.folder};n(t.getControlEl()).css("cursor","wait");n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/DownloadFile",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(r),beforeSend:t.sf.setModuleHeaders}).done(function(i){i.error?alert(i.error):($select=n(t.control).find("select"),t.options.lazyLoading?t.getFileUrl(i.id,function(n){$select.find("option").first().val(n.id).text(n.text).removeData();$select.val(i.id).change()}):t.refresh(function(){$select=n(t.control).find("select");$select.val(i.id).change()}));setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")})},isURL:function(n){var t=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i");return n.length<2083&&t.test(n)},isFilter:function(n){if(this.options.filter){var t=new RegExp(this.options.filter,"i");return n.length<2083&&t.test(n)}return!0},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("file2",t.Fields.File2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.FileField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"file"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.downloadButton||(this.options.downloadButton=!1);this.options.downloadButton&&(this.options.buttons={downloadButton:{value:"Download",click:function(){this.DownLoadFile()}}});this.base()},getTitle:function(){return"File Field"},getDescription:function(){return"File Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(n){var i=this.getTextControlEl();i&&i.length>0&&(t.isEmpty(n)?i.val(""):i.val(n));this.updateMaxLengthIndicator()},getValue:function(){var t=null,n=this.getTextControlEl();return n&&n.length>0&&(t=n.val()),t},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getTextControlEl();i.sf&&n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,u){u.result&&n.each(u.result,function(t,u){i.setValue(u.url);n(r).change()})}}).data("loaded",!0);t()},applyTypeAhead:function(){var r=this,o,i,s,f,e,h,c,l,u;if(r.control.typeahead&&r.options.typeahead&&!t.isEmpty(r.options.typeahead)&&r.sf){if(o=r.options.typeahead.config,o||(o={}),i=i={},i.name||(i.name=r.getId()),s=r.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Files?q=%QUERY&d="+s,ajax:{beforeSend:r.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"{{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));u=this.getTextControlEl();n(u).typeahead(o,i);n(u).on("typeahead:autocompleted",function(t,i){r.setValue(i.value);n(u).change()});n(u).on("typeahead:selected",function(t,i){r.setValue(i.value);n(u).change()});if(f){if(f.autocompleted)n(u).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(u).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(u).change(function(){var t=n(this).val(),i=n(u).typeahead("val");i!==t&&n(u).typeahead("val",t)});n(r.field).find("span.twitter-typeahead").first().css("display","block");n(r.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}},DownLoadFile:function(){var t=this,u=this.getTextControlEl(),i=t.getValue(),f=new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|(www‌​.)?){1}([0-9A-Za-z-‌​\\.@:%_+~#=]+)+((\\‌​.[a-zA-Z]{2,3})+)(/(‌​.)*)?(\\?(.)*)?"),r;if(!i||!t.isURL(i)){alert("url not valid");return}r={url:i,uploadfolder:t.options.uploadfolder};n(t.getControlEl()).css("cursor","wait");n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/DownloadFile",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(r),beforeSend:t.sf.setModuleHeaders}).done(function(i){i.error?alert(i.error):(t.setValue(i.url),n(u).change());setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")})},isURL:function(n){var t=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i");return n.length<2083&&t.test(n)}});t.registerFieldClass("file",t.Fields.FileField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Folder2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.options.filter||(this.options.filter="");this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},getFileUrl:function(t){var i={fileid:t};n.ajax({url:self.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:self.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:i,success:function(n){return n},error:function(){return""}})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("folder2",t.Fields.Folder2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.GalleryField=t.Fields.MultiUploadField.extend({setup:function(){this.base();this.schema.items={type:"object",properties:{Image:{title:"Image",type:"string"}}};t.merge(this.options.items,{fields:{Image:{type:"image"}}});this.urlfield="Image"},getTitle:function(){return"Gallery"},getDescription:function(){return"Image Gallery"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t.registerFieldClass("gallery",t.Fields.GalleryField)}(jQuery),function(n){var t=n.alpaca;t.Fields.GuidField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f)},setup:function(){var n=this;this.base()},setValue:function(n){t.isEmpty(n)&&(n=this.createGuid());this.base(n)},getValue:function(){var n=this.base();return(t.isEmpty(n)||n=="")&&(n=this.createGuid()),n},createGuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n==="x"?t:t&3|8;return i.toString(16)})},getTitle:function(){return"Guid Field"},getDescription:function(){return"Guid field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("guid",t.Fields.GuidField)}(jQuery),function(n){var t=n.alpaca;t.Fields.IconField=t.Fields.TextField.extend({setup:function(){this.options.glyphicons===undefined&&(this.options.glyphicons=!1);this.options.bootstrap===undefined&&(this.options.bootstrap=!1);this.options.fontawesome===undefined&&(this.options.fontawesome=!0);this.base()},setValue:function(n){this.base(n);this.loadIcons()},getTitle:function(){return"Icon Field"},getDescription:function(){return"Font Icon Field."},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(n){var t=this,i=this.control;this.control.fontIconPicker({emptyIcon:!0,hasSearch:!0});this.loadIcons();n()},loadIcons:function(){var o=this,t=[],e;if(this.options.bootstrap&&n.each(i,function(n,i){t.push("glyphicon "+i)}),this.options.fontawesome)for(e in r)t.push("fa "+e);this.options.glyphicons&&(n.each(u,function(n,i){t.push("glyphicons "+i)}),n.each(f,function(n,i){t.push("social "+i)}));this.control.fontIconPicker().setIcons(t)}});t.registerFieldClass("icon",t.Fields.IconField);var i=["glyphicon-glass","glyphicon-music","glyphicon-search","glyphicon-envelope","glyphicon-heart","glyphicon-star","glyphicon-star-empty","glyphicon-user","glyphicon-film","glyphicon-th-large","glyphicon-th","glyphicon-th-list","glyphicon-ok","glyphicon-remove","glyphicon-zoom-in","glyphicon-zoom-out","glyphicon-off","glyphicon-signal","glyphicon-cog","glyphicon-trash","glyphicon-home","glyphicon-file","glyphicon-time","glyphicon-road","glyphicon-download-alt","glyphicon-download","glyphicon-upload","glyphicon-inbox","glyphicon-play-circle","glyphicon-repeat","glyphicon-refresh","glyphicon-list-alt","glyphicon-lock","glyphicon-flag","glyphicon-headphones","glyphicon-volume-off","glyphicon-volume-down","glyphicon-volume-up","glyphicon-qrcode","glyphicon-barcode","glyphicon-tag","glyphicon-tags","glyphicon-book","glyphicon-bookmark","glyphicon-print","glyphicon-camera","glyphicon-font","glyphicon-bold","glyphicon-italic","glyphicon-text-height","glyphicon-text-width","glyphicon-align-left","glyphicon-align-center","glyphicon-align-right","glyphicon-align-justify","glyphicon-list","glyphicon-indent-left","glyphicon-indent-right","glyphicon-facetime-video","glyphicon-picture","glyphicon-pencil","glyphicon-map-marker","glyphicon-adjust","glyphicon-tint","glyphicon-edit","glyphicon-share","glyphicon-check","glyphicon-move","glyphicon-step-backward","glyphicon-fast-backward","glyphicon-backward","glyphicon-play","glyphicon-pause","glyphicon-stop","glyphicon-forward","glyphicon-fast-forward","glyphicon-step-forward","glyphicon-eject","glyphicon-chevron-left","glyphicon-chevron-right","glyphicon-plus-sign","glyphicon-minus-sign","glyphicon-remove-sign","glyphicon-ok-sign","glyphicon-question-sign","glyphicon-info-sign","glyphicon-screenshot","glyphicon-remove-circle","glyphicon-ok-circle","glyphicon-ban-circle","glyphicon-arrow-left","glyphicon-arrow-right","glyphicon-arrow-up","glyphicon-arrow-down","glyphicon-share-alt","glyphicon-resize-full","glyphicon-resize-small","glyphicon-plus","glyphicon-minus","glyphicon-asterisk","glyphicon-exclamation-sign","glyphicon-gift","glyphicon-leaf","glyphicon-fire","glyphicon-eye-open","glyphicon-eye-close","glyphicon-warning-sign","glyphicon-plane","glyphicon-calendar","glyphicon-random","glyphicon-comment","glyphicon-magnet","glyphicon-chevron-up","glyphicon-chevron-down","glyphicon-retweet","glyphicon-shopping-cart","glyphicon-folder-close","glyphicon-folder-open","glyphicon-resize-vertical","glyphicon-resize-horizontal","glyphicon-hdd","glyphicon-bullhorn","glyphicon-bell","glyphicon-certificate","glyphicon-thumbs-up","glyphicon-thumbs-down","glyphicon-hand-right","glyphicon-hand-left","glyphicon-hand-up","glyphicon-hand-down","glyphicon-circle-arrow-right","glyphicon-circle-arrow-left","glyphicon-circle-arrow-up","glyphicon-circle-arrow-down","glyphicon-globe","glyphicon-wrench","glyphicon-tasks","glyphicon-filter","glyphicon-briefcase","glyphicon-fullscreen","glyphicon-dashboard","glyphicon-paperclip","glyphicon-heart-empty","glyphicon-link","glyphicon-phone","glyphicon-pushpin","glyphicon-euro","glyphicon-usd","glyphicon-gbp","glyphicon-sort","glyphicon-sort-by-alphabet","glyphicon-sort-by-alphabet-alt","glyphicon-sort-by-order","glyphicon-sort-by-order-alt","glyphicon-sort-by-attributes","glyphicon-sort-by-attributes-alt","glyphicon-unchecked","glyphicon-expand","glyphicon-collapse","glyphicon-collapse-top"],r={"fa-500px":{unicode:"\\f26e",name:"500px"},"fa-address-book":{unicode:"\\f2b9",name:"Address book"},"fa-address-book-o":{unicode:"\\f2ba",name:"Address book o"},"fa-address-card":{unicode:"\\f2bb",name:"Address card"},"fa-address-card-o":{unicode:"\\f2bc",name:"Address card o"},"fa-adjust":{unicode:"\\f042",name:"Adjust"},"fa-adn":{unicode:"\\f170",name:"Adn"},"fa-align-center":{unicode:"\\f037",name:"Align center"},"fa-align-justify":{unicode:"\\f039",name:"Align justify"},"fa-align-left":{unicode:"\\f036",name:"Align left"},"fa-align-right":{unicode:"\\f038",name:"Align right"},"fa-amazon":{unicode:"\\f270",name:"Amazon"},"fa-ambulance":{unicode:"\\f0f9",name:"Ambulance"},"fa-american-sign-language-interpreting":{unicode:"\\f2a3",name:"American sign language interpreting"},"fa-anchor":{unicode:"\\f13d",name:"Anchor"},"fa-android":{unicode:"\\f17b",name:"Android"},"fa-angellist":{unicode:"\\f209",name:"Angellist"},"fa-angle-double-down":{unicode:"\\f103",name:"Angle double down"},"fa-angle-double-left":{unicode:"\\f100",name:"Angle double left"},"fa-angle-double-right":{unicode:"\\f101",name:"Angle double right"},"fa-angle-double-up":{unicode:"\\f102",name:"Angle double up"},"fa-angle-down":{unicode:"\\f107",name:"Angle down"},"fa-angle-left":{unicode:"\\f104",name:"Angle left"},"fa-angle-right":{unicode:"\\f105",name:"Angle right"},"fa-angle-up":{unicode:"\\f106",name:"Angle up"},"fa-apple":{unicode:"\\f179",name:"Apple"},"fa-archive":{unicode:"\\f187",name:"Archive"},"fa-area-chart":{unicode:"\\f1fe",name:"Area chart"},"fa-arrow-circle-down":{unicode:"\\f0ab",name:"Arrow circle down"},"fa-arrow-circle-left":{unicode:"\\f0a8",name:"Arrow circle left"},"fa-arrow-circle-o-down":{unicode:"\\f01a",name:"Arrow circle o down"},"fa-arrow-circle-o-left":{unicode:"\\f190",name:"Arrow circle o left"},"fa-arrow-circle-o-right":{unicode:"\\f18e",name:"Arrow circle o right"},"fa-arrow-circle-o-up":{unicode:"\\f01b",name:"Arrow circle o up"},"fa-arrow-circle-right":{unicode:"\\f0a9",name:"Arrow circle right"},"fa-arrow-circle-up":{unicode:"\\f0aa",name:"Arrow circle up"},"fa-arrow-down":{unicode:"\\f063",name:"Arrow down"},"fa-arrow-left":{unicode:"\\f060",name:"Arrow left"},"fa-arrow-right":{unicode:"\\f061",name:"Arrow right"},"fa-arrow-up":{unicode:"\\f062",name:"Arrow up"},"fa-arrows":{unicode:"\\f047",name:"Arrows"},"fa-arrows-alt":{unicode:"\\f0b2",name:"Arrows alt"},"fa-arrows-h":{unicode:"\\f07e",name:"Arrows h"},"fa-arrows-v":{unicode:"\\f07d",name:"Arrows v"},"fa-assistive-listening-systems":{unicode:"\\f2a2",name:"Assistive listening systems"},"fa-asterisk":{unicode:"\\f069",name:"Asterisk"},"fa-at":{unicode:"\\f1fa",name:"At"},"fa-audio-description":{unicode:"\\f29e",name:"Audio description"},"fa-backward":{unicode:"\\f04a",name:"Backward"},"fa-balance-scale":{unicode:"\\f24e",name:"Balance scale"},"fa-ban":{unicode:"\\f05e",name:"Ban"},"fa-bandcamp":{unicode:"\\f2d5",name:"Bandcamp"},"fa-bar-chart":{unicode:"\\f080",name:"Bar chart"},"fa-barcode":{unicode:"\\f02a",name:"Barcode"},"fa-bars":{unicode:"\\f0c9",name:"Bars"},"fa-bath":{unicode:"\\f2cd",name:"Bath"},"fa-battery-empty":{unicode:"\\f244",name:"Battery empty"},"fa-battery-full":{unicode:"\\f240",name:"Battery full"},"fa-battery-half":{unicode:"\\f242",name:"Battery half"},"fa-battery-quarter":{unicode:"\\f243",name:"Battery quarter"},"fa-battery-three-quarters":{unicode:"\\f241",name:"Battery three quarters"},"fa-bed":{unicode:"\\f236",name:"Bed"},"fa-beer":{unicode:"\\f0fc",name:"Beer"},"fa-behance":{unicode:"\\f1b4",name:"Behance"},"fa-behance-square":{unicode:"\\f1b5",name:"Behance square"},"fa-bell":{unicode:"\\f0f3",name:"Bell"},"fa-bell-o":{unicode:"\\f0a2",name:"Bell o"},"fa-bell-slash":{unicode:"\\f1f6",name:"Bell slash"},"fa-bell-slash-o":{unicode:"\\f1f7",name:"Bell slash o"},"fa-bicycle":{unicode:"\\f206",name:"Bicycle"},"fa-binoculars":{unicode:"\\f1e5",name:"Binoculars"},"fa-birthday-cake":{unicode:"\\f1fd",name:"Birthday cake"},"fa-bitbucket":{unicode:"\\f171",name:"Bitbucket"},"fa-bitbucket-square":{unicode:"\\f172",name:"Bitbucket square"},"fa-black-tie":{unicode:"\\f27e",name:"Black tie"},"fa-blind":{unicode:"\\f29d",name:"Blind"},"fa-bluetooth":{unicode:"\\f293",name:"Bluetooth"},"fa-bluetooth-b":{unicode:"\\f294",name:"Bluetooth b"},"fa-bold":{unicode:"\\f032",name:"Bold"},"fa-bolt":{unicode:"\\f0e7",name:"Bolt"},"fa-bomb":{unicode:"\\f1e2",name:"Bomb"},"fa-book":{unicode:"\\f02d",name:"Book"},"fa-bookmark":{unicode:"\\f02e",name:"Bookmark"},"fa-bookmark-o":{unicode:"\\f097",name:"Bookmark o"},"fa-braille":{unicode:"\\f2a1",name:"Braille"},"fa-briefcase":{unicode:"\\f0b1",name:"Briefcase"},"fa-btc":{unicode:"\\f15a",name:"Btc"},"fa-bug":{unicode:"\\f188",name:"Bug"},"fa-building":{unicode:"\\f1ad",name:"Building"},"fa-building-o":{unicode:"\\f0f7",name:"Building o"},"fa-bullhorn":{unicode:"\\f0a1",name:"Bullhorn"},"fa-bullseye":{unicode:"\\f140",name:"Bullseye"},"fa-bus":{unicode:"\\f207",name:"Bus"},"fa-buysellads":{unicode:"\\f20d",name:"Buysellads"},"fa-calculator":{unicode:"\\f1ec",name:"Calculator"},"fa-calendar":{unicode:"\\f073",name:"Calendar"},"fa-calendar-check-o":{unicode:"\\f274",name:"Calendar check o"},"fa-calendar-minus-o":{unicode:"\\f272",name:"Calendar minus o"},"fa-calendar-o":{unicode:"\\f133",name:"Calendar o"},"fa-calendar-plus-o":{unicode:"\\f271",name:"Calendar plus o"},"fa-calendar-times-o":{unicode:"\\f273",name:"Calendar times o"},"fa-camera":{unicode:"\\f030",name:"Camera"},"fa-camera-retro":{unicode:"\\f083",name:"Camera retro"},"fa-car":{unicode:"\\f1b9",name:"Car"},"fa-caret-down":{unicode:"\\f0d7",name:"Caret down"},"fa-caret-left":{unicode:"\\f0d9",name:"Caret left"},"fa-caret-right":{unicode:"\\f0da",name:"Caret right"},"fa-caret-square-o-down":{unicode:"\\f150",name:"Caret square o down"},"fa-caret-square-o-left":{unicode:"\\f191",name:"Caret square o left"},"fa-caret-square-o-right":{unicode:"\\f152",name:"Caret square o right"},"fa-caret-square-o-up":{unicode:"\\f151",name:"Caret square o up"},"fa-caret-up":{unicode:"\\f0d8",name:"Caret up"},"fa-cart-arrow-down":{unicode:"\\f218",name:"Cart arrow down"},"fa-cart-plus":{unicode:"\\f217",name:"Cart plus"},"fa-cc":{unicode:"\\f20a",name:"Cc"},"fa-cc-amex":{unicode:"\\f1f3",name:"Cc amex"},"fa-cc-diners-club":{unicode:"\\f24c",name:"Cc diners club"},"fa-cc-discover":{unicode:"\\f1f2",name:"Cc discover"},"fa-cc-jcb":{unicode:"\\f24b",name:"Cc jcb"},"fa-cc-mastercard":{unicode:"\\f1f1",name:"Cc mastercard"},"fa-cc-paypal":{unicode:"\\f1f4",name:"Cc paypal"},"fa-cc-stripe":{unicode:"\\f1f5",name:"Cc stripe"},"fa-cc-visa":{unicode:"\\f1f0",name:"Cc visa"},"fa-certificate":{unicode:"\\f0a3",name:"Certificate"},"fa-chain-broken":{unicode:"\\f127",name:"Chain broken"},"fa-check":{unicode:"\\f00c",name:"Check"},"fa-check-circle":{unicode:"\\f058",name:"Check circle"},"fa-check-circle-o":{unicode:"\\f05d",name:"Check circle o"},"fa-check-square":{unicode:"\\f14a",name:"Check square"},"fa-check-square-o":{unicode:"\\f046",name:"Check square o"},"fa-chevron-circle-down":{unicode:"\\f13a",name:"Chevron circle down"},"fa-chevron-circle-left":{unicode:"\\f137",name:"Chevron circle left"},"fa-chevron-circle-right":{unicode:"\\f138",name:"Chevron circle right"},"fa-chevron-circle-up":{unicode:"\\f139",name:"Chevron circle up"},"fa-chevron-down":{unicode:"\\f078",name:"Chevron down"},"fa-chevron-left":{unicode:"\\f053",name:"Chevron left"},"fa-chevron-right":{unicode:"\\f054",name:"Chevron right"},"fa-chevron-up":{unicode:"\\f077",name:"Chevron up"},"fa-child":{unicode:"\\f1ae",name:"Child"},"fa-chrome":{unicode:"\\f268",name:"Chrome"},"fa-circle":{unicode:"\\f111",name:"Circle"},"fa-circle-o":{unicode:"\\f10c",name:"Circle o"},"fa-circle-o-notch":{unicode:"\\f1ce",name:"Circle o notch"},"fa-circle-thin":{unicode:"\\f1db",name:"Circle thin"},"fa-clipboard":{unicode:"\\f0ea",name:"Clipboard"},"fa-clock-o":{unicode:"\\f017",name:"Clock o"},"fa-clone":{unicode:"\\f24d",name:"Clone"},"fa-cloud":{unicode:"\\f0c2",name:"Cloud"},"fa-cloud-download":{unicode:"\\f0ed",name:"Cloud download"},"fa-cloud-upload":{unicode:"\\f0ee",name:"Cloud upload"},"fa-code":{unicode:"\\f121",name:"Code"},"fa-code-fork":{unicode:"\\f126",name:"Code fork"},"fa-codepen":{unicode:"\\f1cb",name:"Codepen"},"fa-codiepie":{unicode:"\\f284",name:"Codiepie"},"fa-coffee":{unicode:"\\f0f4",name:"Coffee"},"fa-cog":{unicode:"\\f013",name:"Cog"},"fa-cogs":{unicode:"\\f085",name:"Cogs"},"fa-columns":{unicode:"\\f0db",name:"Columns"},"fa-comment":{unicode:"\\f075",name:"Comment"},"fa-comment-o":{unicode:"\\f0e5",name:"Comment o"},"fa-commenting":{unicode:"\\f27a",name:"Commenting"},"fa-commenting-o":{unicode:"\\f27b",name:"Commenting o"},"fa-comments":{unicode:"\\f086",name:"Comments"},"fa-comments-o":{unicode:"\\f0e6",name:"Comments o"},"fa-compass":{unicode:"\\f14e",name:"Compass"},"fa-compress":{unicode:"\\f066",name:"Compress"},"fa-connectdevelop":{unicode:"\\f20e",name:"Connectdevelop"},"fa-contao":{unicode:"\\f26d",name:"Contao"},"fa-copyright":{unicode:"\\f1f9",name:"Copyright"},"fa-creative-commons":{unicode:"\\f25e",name:"Creative commons"},"fa-credit-card":{unicode:"\\f09d",name:"Credit card"},"fa-credit-card-alt":{unicode:"\\f283",name:"Credit card alt"},"fa-crop":{unicode:"\\f125",name:"Crop"},"fa-crosshairs":{unicode:"\\f05b",name:"Crosshairs"},"fa-css3":{unicode:"\\f13c",name:"Css3"},"fa-cube":{unicode:"\\f1b2",name:"Cube"},"fa-cubes":{unicode:"\\f1b3",name:"Cubes"},"fa-cutlery":{unicode:"\\f0f5",name:"Cutlery"},"fa-dashcube":{unicode:"\\f210",name:"Dashcube"},"fa-database":{unicode:"\\f1c0",name:"Database"},"fa-deaf":{unicode:"\\f2a4",name:"Deaf"},"fa-delicious":{unicode:"\\f1a5",name:"Delicious"},"fa-desktop":{unicode:"\\f108",name:"Desktop"},"fa-deviantart":{unicode:"\\f1bd",name:"Deviantart"},"fa-diamond":{unicode:"\\f219",name:"Diamond"},"fa-digg":{unicode:"\\f1a6",name:"Digg"},"fa-dot-circle-o":{unicode:"\\f192",name:"Dot circle o"},"fa-download":{unicode:"\\f019",name:"Download"},"fa-dribbble":{unicode:"\\f17d",name:"Dribbble"},"fa-dropbox":{unicode:"\\f16b",name:"Dropbox"},"fa-drupal":{unicode:"\\f1a9",name:"Drupal"},"fa-edge":{unicode:"\\f282",name:"Edge"},"fa-eercast":{unicode:"\\f2da",name:"Eercast"},"fa-eject":{unicode:"\\f052",name:"Eject"},"fa-ellipsis-h":{unicode:"\\f141",name:"Ellipsis h"},"fa-ellipsis-v":{unicode:"\\f142",name:"Ellipsis v"},"fa-empire":{unicode:"\\f1d1",name:"Empire"},"fa-envelope":{unicode:"\\f0e0",name:"Envelope"},"fa-envelope-o":{unicode:"\\f003",name:"Envelope o"},"fa-envelope-open":{unicode:"\\f2b6",name:"Envelope open"},"fa-envelope-open-o":{unicode:"\\f2b7",name:"Envelope open o"},"fa-envelope-square":{unicode:"\\f199",name:"Envelope square"},"fa-envira":{unicode:"\\f299",name:"Envira"},"fa-eraser":{unicode:"\\f12d",name:"Eraser"},"fa-etsy":{unicode:"\\f2d7",name:"Etsy"},"fa-eur":{unicode:"\\f153",name:"Eur"},"fa-exchange":{unicode:"\\f0ec",name:"Exchange"},"fa-exclamation":{unicode:"\\f12a",name:"Exclamation"},"fa-exclamation-circle":{unicode:"\\f06a",name:"Exclamation circle"},"fa-exclamation-triangle":{unicode:"\\f071",name:"Exclamation triangle"},"fa-expand":{unicode:"\\f065",name:"Expand"},"fa-expeditedssl":{unicode:"\\f23e",name:"Expeditedssl"},"fa-external-link":{unicode:"\\f08e",name:"External link"},"fa-external-link-square":{unicode:"\\f14c",name:"External link square"},"fa-eye":{unicode:"\\f06e",name:"Eye"},"fa-eye-slash":{unicode:"\\f070",name:"Eye slash"},"fa-eyedropper":{unicode:"\\f1fb",name:"Eyedropper"},"fa-facebook":{unicode:"\\f09a",name:"Facebook"},"fa-facebook-official":{unicode:"\\f230",name:"Facebook official"},"fa-facebook-square":{unicode:"\\f082",name:"Facebook square"},"fa-fast-backward":{unicode:"\\f049",name:"Fast backward"},"fa-fast-forward":{unicode:"\\f050",name:"Fast forward"},"fa-fax":{unicode:"\\f1ac",name:"Fax"},"fa-female":{unicode:"\\f182",name:"Female"},"fa-fighter-jet":{unicode:"\\f0fb",name:"Fighter jet"},"fa-file":{unicode:"\\f15b",name:"File"},"fa-file-archive-o":{unicode:"\\f1c6",name:"File archive o"},"fa-file-audio-o":{unicode:"\\f1c7",name:"File audio o"},"fa-file-code-o":{unicode:"\\f1c9",name:"File code o"},"fa-file-excel-o":{unicode:"\\f1c3",name:"File excel o"},"fa-file-image-o":{unicode:"\\f1c5",name:"File image o"},"fa-file-o":{unicode:"\\f016",name:"File o"},"fa-file-pdf-o":{unicode:"\\f1c1",name:"File pdf o"},"fa-file-powerpoint-o":{unicode:"\\f1c4",name:"File powerpoint o"},"fa-file-text":{unicode:"\\f15c",name:"File text"},"fa-file-text-o":{unicode:"\\f0f6",name:"File text o"},"fa-file-video-o":{unicode:"\\f1c8",name:"File video o"},"fa-file-word-o":{unicode:"\\f1c2",name:"File word o"},"fa-files-o":{unicode:"\\f0c5",name:"Files o"},"fa-film":{unicode:"\\f008",name:"Film"},"fa-filter":{unicode:"\\f0b0",name:"Filter"},"fa-fire":{unicode:"\\f06d",name:"Fire"},"fa-fire-extinguisher":{unicode:"\\f134",name:"Fire extinguisher"},"fa-firefox":{unicode:"\\f269",name:"Firefox"},"fa-first-order":{unicode:"\\f2b0",name:"First order"},"fa-flag":{unicode:"\\f024",name:"Flag"},"fa-flag-checkered":{unicode:"\\f11e",name:"Flag checkered"},"fa-flag-o":{unicode:"\\f11d",name:"Flag o"},"fa-flask":{unicode:"\\f0c3",name:"Flask"},"fa-flickr":{unicode:"\\f16e",name:"Flickr"},"fa-floppy-o":{unicode:"\\f0c7",name:"Floppy o"},"fa-folder":{unicode:"\\f07b",name:"Folder"},"fa-folder-o":{unicode:"\\f114",name:"Folder o"},"fa-folder-open":{unicode:"\\f07c",name:"Folder open"},"fa-folder-open-o":{unicode:"\\f115",name:"Folder open o"},"fa-font":{unicode:"\\f031",name:"Font"},"fa-font-awesome":{unicode:"\\f2b4",name:"Font awesome"},"fa-fonticons":{unicode:"\\f280",name:"Fonticons"},"fa-fort-awesome":{unicode:"\\f286",name:"Fort awesome"},"fa-forumbee":{unicode:"\\f211",name:"Forumbee"},"fa-forward":{unicode:"\\f04e",name:"Forward"},"fa-foursquare":{unicode:"\\f180",name:"Foursquare"},"fa-free-code-camp":{unicode:"\\f2c5",name:"Free code camp"},"fa-frown-o":{unicode:"\\f119",name:"Frown o"},"fa-futbol-o":{unicode:"\\f1e3",name:"Futbol o"},"fa-gamepad":{unicode:"\\f11b",name:"Gamepad"},"fa-gavel":{unicode:"\\f0e3",name:"Gavel"},"fa-gbp":{unicode:"\\f154",name:"Gbp"},"fa-genderless":{unicode:"\\f22d",name:"Genderless"},"fa-get-pocket":{unicode:"\\f265",name:"Get pocket"},"fa-gg":{unicode:"\\f260",name:"Gg"},"fa-gg-circle":{unicode:"\\f261",name:"Gg circle"},"fa-gift":{unicode:"\\f06b",name:"Gift"},"fa-git":{unicode:"\\f1d3",name:"Git"},"fa-git-square":{unicode:"\\f1d2",name:"Git square"},"fa-github":{unicode:"\\f09b",name:"Github"},"fa-github-alt":{unicode:"\\f113",name:"Github alt"},"fa-github-square":{unicode:"\\f092",name:"Github square"},"fa-gitlab":{unicode:"\\f296",name:"Gitlab"},"fa-glass":{unicode:"\\f000",name:"Glass"},"fa-glide":{unicode:"\\f2a5",name:"Glide"},"fa-glide-g":{unicode:"\\f2a6",name:"Glide g"},"fa-globe":{unicode:"\\f0ac",name:"Globe"},"fa-google":{unicode:"\\f1a0",name:"Google"},"fa-google-plus":{unicode:"\\f0d5",name:"Google plus"},"fa-google-plus-official":{unicode:"\\f2b3",name:"Google plus official"},"fa-google-plus-square":{unicode:"\\f0d4",name:"Google plus square"},"fa-google-wallet":{unicode:"\\f1ee",name:"Google wallet"},"fa-graduation-cap":{unicode:"\\f19d",name:"Graduation cap"},"fa-gratipay":{unicode:"\\f184",name:"Gratipay"},"fa-grav":{unicode:"\\f2d6",name:"Grav"},"fa-h-square":{unicode:"\\f0fd",name:"H square"},"fa-hacker-news":{unicode:"\\f1d4",name:"Hacker news"},"fa-hand-lizard-o":{unicode:"\\f258",name:"Hand lizard o"},"fa-hand-o-down":{unicode:"\\f0a7",name:"Hand o down"},"fa-hand-o-left":{unicode:"\\f0a5",name:"Hand o left"},"fa-hand-o-right":{unicode:"\\f0a4",name:"Hand o right"},"fa-hand-o-up":{unicode:"\\f0a6",name:"Hand o up"},"fa-hand-paper-o":{unicode:"\\f256",name:"Hand paper o"},"fa-hand-peace-o":{unicode:"\\f25b",name:"Hand peace o"},"fa-hand-pointer-o":{unicode:"\\f25a",name:"Hand pointer o"},"fa-hand-rock-o":{unicode:"\\f255",name:"Hand rock o"},"fa-hand-scissors-o":{unicode:"\\f257",name:"Hand scissors o"},"fa-hand-spock-o":{unicode:"\\f259",name:"Hand spock o"},"fa-handshake-o":{unicode:"\\f2b5",name:"Handshake o"},"fa-hashtag":{unicode:"\\f292",name:"Hashtag"},"fa-hdd-o":{unicode:"\\f0a0",name:"Hdd o"},"fa-header":{unicode:"\\f1dc",name:"Header"},"fa-headphones":{unicode:"\\f025",name:"Headphones"},"fa-heart":{unicode:"\\f004",name:"Heart"},"fa-heart-o":{unicode:"\\f08a",name:"Heart o"},"fa-heartbeat":{unicode:"\\f21e",name:"Heartbeat"},"fa-history":{unicode:"\\f1da",name:"History"},"fa-home":{unicode:"\\f015",name:"Home"},"fa-hospital-o":{unicode:"\\f0f8",name:"Hospital o"},"fa-hourglass":{unicode:"\\f254",name:"Hourglass"},"fa-hourglass-end":{unicode:"\\f253",name:"Hourglass end"},"fa-hourglass-half":{unicode:"\\f252",name:"Hourglass half"},"fa-hourglass-o":{unicode:"\\f250",name:"Hourglass o"},"fa-hourglass-start":{unicode:"\\f251",name:"Hourglass start"},"fa-houzz":{unicode:"\\f27c",name:"Houzz"},"fa-html5":{unicode:"\\f13b",name:"Html5"},"fa-i-cursor":{unicode:"\\f246",name:"I cursor"},"fa-id-badge":{unicode:"\\f2c1",name:"Id badge"},"fa-id-card":{unicode:"\\f2c2",name:"Id card"},"fa-id-card-o":{unicode:"\\f2c3",name:"Id card o"},"fa-ils":{unicode:"\\f20b",name:"Ils"},"fa-imdb":{unicode:"\\f2d8",name:"Imdb"},"fa-inbox":{unicode:"\\f01c",name:"Inbox"},"fa-indent":{unicode:"\\f03c",name:"Indent"},"fa-industry":{unicode:"\\f275",name:"Industry"},"fa-info":{unicode:"\\f129",name:"Info"},"fa-info-circle":{unicode:"\\f05a",name:"Info circle"},"fa-inr":{unicode:"\\f156",name:"Inr"},"fa-instagram":{unicode:"\\f16d",name:"Instagram"},"fa-internet-explorer":{unicode:"\\f26b",name:"Internet explorer"},"fa-ioxhost":{unicode:"\\f208",name:"Ioxhost"},"fa-italic":{unicode:"\\f033",name:"Italic"},"fa-joomla":{unicode:"\\f1aa",name:"Joomla"},"fa-jpy":{unicode:"\\f157",name:"Jpy"},"fa-jsfiddle":{unicode:"\\f1cc",name:"Jsfiddle"},"fa-key":{unicode:"\\f084",name:"Key"},"fa-keyboard-o":{unicode:"\\f11c",name:"Keyboard o"},"fa-krw":{unicode:"\\f159",name:"Krw"},"fa-language":{unicode:"\\f1ab",name:"Language"},"fa-laptop":{unicode:"\\f109",name:"Laptop"},"fa-lastfm":{unicode:"\\f202",name:"Lastfm"},"fa-lastfm-square":{unicode:"\\f203",name:"Lastfm square"},"fa-leaf":{unicode:"\\f06c",name:"Leaf"},"fa-leanpub":{unicode:"\\f212",name:"Leanpub"},"fa-lemon-o":{unicode:"\\f094",name:"Lemon o"},"fa-level-down":{unicode:"\\f149",name:"Level down"},"fa-level-up":{unicode:"\\f148",name:"Level up"},"fa-life-ring":{unicode:"\\f1cd",name:"Life ring"},"fa-lightbulb-o":{unicode:"\\f0eb",name:"Lightbulb o"},"fa-line-chart":{unicode:"\\f201",name:"Line chart"},"fa-link":{unicode:"\\f0c1",name:"Link"},"fa-linkedin":{unicode:"\\f0e1",name:"Linkedin"},"fa-linkedin-square":{unicode:"\\f08c",name:"Linkedin square"},"fa-linode":{unicode:"\\f2b8",name:"Linode"},"fa-linux":{unicode:"\\f17c",name:"Linux"},"fa-list":{unicode:"\\f03a",name:"List"},"fa-list-alt":{unicode:"\\f022",name:"List alt"},"fa-list-ol":{unicode:"\\f0cb",name:"List ol"},"fa-list-ul":{unicode:"\\f0ca",name:"List ul"},"fa-location-arrow":{unicode:"\\f124",name:"Location arrow"},"fa-lock":{unicode:"\\f023",name:"Lock"},"fa-long-arrow-down":{unicode:"\\f175",name:"Long arrow down"},"fa-long-arrow-left":{unicode:"\\f177",name:"Long arrow left"},"fa-long-arrow-right":{unicode:"\\f178",name:"Long arrow right"},"fa-long-arrow-up":{unicode:"\\f176",name:"Long arrow up"},"fa-low-vision":{unicode:"\\f2a8",name:"Low vision"},"fa-magic":{unicode:"\\f0d0",name:"Magic"},"fa-magnet":{unicode:"\\f076",name:"Magnet"},"fa-male":{unicode:"\\f183",name:"Male"},"fa-map":{unicode:"\\f279",name:"Map"},"fa-map-marker":{unicode:"\\f041",name:"Map marker"},"fa-map-o":{unicode:"\\f278",name:"Map o"},"fa-map-pin":{unicode:"\\f276",name:"Map pin"},"fa-map-signs":{unicode:"\\f277",name:"Map signs"},"fa-mars":{unicode:"\\f222",name:"Mars"},"fa-mars-double":{unicode:"\\f227",name:"Mars double"},"fa-mars-stroke":{unicode:"\\f229",name:"Mars stroke"},"fa-mars-stroke-h":{unicode:"\\f22b",name:"Mars stroke h"},"fa-mars-stroke-v":{unicode:"\\f22a",name:"Mars stroke v"},"fa-maxcdn":{unicode:"\\f136",name:"Maxcdn"},"fa-meanpath":{unicode:"\\f20c",name:"Meanpath"},"fa-medium":{unicode:"\\f23a",name:"Medium"},"fa-medkit":{unicode:"\\f0fa",name:"Medkit"},"fa-meetup":{unicode:"\\f2e0",name:"Meetup"},"fa-meh-o":{unicode:"\\f11a",name:"Meh o"},"fa-mercury":{unicode:"\\f223",name:"Mercury"},"fa-microchip":{unicode:"\\f2db",name:"Microchip"},"fa-microphone":{unicode:"\\f130",name:"Microphone"},"fa-microphone-slash":{unicode:"\\f131",name:"Microphone slash"},"fa-minus":{unicode:"\\f068",name:"Minus"},"fa-minus-circle":{unicode:"\\f056",name:"Minus circle"},"fa-minus-square":{unicode:"\\f146",name:"Minus square"},"fa-minus-square-o":{unicode:"\\f147",name:"Minus square o"},"fa-mixcloud":{unicode:"\\f289",name:"Mixcloud"},"fa-mobile":{unicode:"\\f10b",name:"Mobile"},"fa-modx":{unicode:"\\f285",name:"Modx"},"fa-money":{unicode:"\\f0d6",name:"Money"},"fa-moon-o":{unicode:"\\f186",name:"Moon o"},"fa-motorcycle":{unicode:"\\f21c",name:"Motorcycle"},"fa-mouse-pointer":{unicode:"\\f245",name:"Mouse pointer"},"fa-music":{unicode:"\\f001",name:"Music"},"fa-neuter":{unicode:"\\f22c",name:"Neuter"},"fa-newspaper-o":{unicode:"\\f1ea",name:"Newspaper o"},"fa-object-group":{unicode:"\\f247",name:"Object group"},"fa-object-ungroup":{unicode:"\\f248",name:"Object ungroup"},"fa-odnoklassniki":{unicode:"\\f263",name:"Odnoklassniki"},"fa-odnoklassniki-square":{unicode:"\\f264",name:"Odnoklassniki square"},"fa-opencart":{unicode:"\\f23d",name:"Opencart"},"fa-openid":{unicode:"\\f19b",name:"Openid"},"fa-opera":{unicode:"\\f26a",name:"Opera"},"fa-optin-monster":{unicode:"\\f23c",name:"Optin monster"},"fa-outdent":{unicode:"\\f03b",name:"Outdent"},"fa-pagelines":{unicode:"\\f18c",name:"Pagelines"},"fa-paint-brush":{unicode:"\\f1fc",name:"Paint brush"},"fa-paper-plane":{unicode:"\\f1d8",name:"Paper plane"},"fa-paper-plane-o":{unicode:"\\f1d9",name:"Paper plane o"},"fa-paperclip":{unicode:"\\f0c6",name:"Paperclip"},"fa-paragraph":{unicode:"\\f1dd",name:"Paragraph"},"fa-pause":{unicode:"\\f04c",name:"Pause"},"fa-pause-circle":{unicode:"\\f28b",name:"Pause circle"},"fa-pause-circle-o":{unicode:"\\f28c",name:"Pause circle o"},"fa-paw":{unicode:"\\f1b0",name:"Paw"},"fa-paypal":{unicode:"\\f1ed",name:"Paypal"},"fa-pencil":{unicode:"\\f040",name:"Pencil"},"fa-pencil-square":{unicode:"\\f14b",name:"Pencil square"},"fa-pencil-square-o":{unicode:"\\f044",name:"Pencil square o"},"fa-percent":{unicode:"\\f295",name:"Percent"},"fa-phone":{unicode:"\\f095",name:"Phone"},"fa-phone-square":{unicode:"\\f098",name:"Phone square"},"fa-picture-o":{unicode:"\\f03e",name:"Picture o"},"fa-pie-chart":{unicode:"\\f200",name:"Pie chart"},"fa-pied-piper":{unicode:"\\f2ae",name:"Pied piper"},"fa-pied-piper-alt":{unicode:"\\f1a8",name:"Pied piper alt"},"fa-pied-piper-pp":{unicode:"\\f1a7",name:"Pied piper pp"},"fa-pinterest":{unicode:"\\f0d2",name:"Pinterest"},"fa-pinterest-p":{unicode:"\\f231",name:"Pinterest p"},"fa-pinterest-square":{unicode:"\\f0d3",name:"Pinterest square"},"fa-plane":{unicode:"\\f072",name:"Plane"},"fa-play":{unicode:"\\f04b",name:"Play"},"fa-play-circle":{unicode:"\\f144",name:"Play circle"},"fa-play-circle-o":{unicode:"\\f01d",name:"Play circle o"},"fa-plug":{unicode:"\\f1e6",name:"Plug"},"fa-plus":{unicode:"\\f067",name:"Plus"},"fa-plus-circle":{unicode:"\\f055",name:"Plus circle"},"fa-plus-square":{unicode:"\\f0fe",name:"Plus square"},"fa-plus-square-o":{unicode:"\\f196",name:"Plus square o"},"fa-podcast":{unicode:"\\f2ce",name:"Podcast"},"fa-power-off":{unicode:"\\f011",name:"Power off"},"fa-print":{unicode:"\\f02f",name:"Print"},"fa-product-hunt":{unicode:"\\f288",name:"Product hunt"},"fa-puzzle-piece":{unicode:"\\f12e",name:"Puzzle piece"},"fa-qq":{unicode:"\\f1d6",name:"Qq"},"fa-qrcode":{unicode:"\\f029",name:"Qrcode"},"fa-question":{unicode:"\\f128",name:"Question"},"fa-question-circle":{unicode:"\\f059",name:"Question circle"},"fa-question-circle-o":{unicode:"\\f29c",name:"Question circle o"},"fa-quora":{unicode:"\\f2c4",name:"Quora"},"fa-quote-left":{unicode:"\\f10d",name:"Quote left"},"fa-quote-right":{unicode:"\\f10e",name:"Quote right"},"fa-random":{unicode:"\\f074",name:"Random"},"fa-ravelry":{unicode:"\\f2d9",name:"Ravelry"},"fa-rebel":{unicode:"\\f1d0",name:"Rebel"},"fa-recycle":{unicode:"\\f1b8",name:"Recycle"},"fa-reddit":{unicode:"\\f1a1",name:"Reddit"},"fa-reddit-alien":{unicode:"\\f281",name:"Reddit alien"},"fa-reddit-square":{unicode:"\\f1a2",name:"Reddit square"},"fa-refresh":{unicode:"\\f021",name:"Refresh"},"fa-registered":{unicode:"\\f25d",name:"Registered"},"fa-renren":{unicode:"\\f18b",name:"Renren"},"fa-repeat":{unicode:"\\f01e",name:"Repeat"},"fa-reply":{unicode:"\\f112",name:"Reply"},"fa-reply-all":{unicode:"\\f122",name:"Reply all"},"fa-retweet":{unicode:"\\f079",name:"Retweet"},"fa-road":{unicode:"\\f018",name:"Road"},"fa-rocket":{unicode:"\\f135",name:"Rocket"},"fa-rss":{unicode:"\\f09e",name:"Rss"},"fa-rss-square":{unicode:"\\f143",name:"Rss square"},"fa-rub":{unicode:"\\f158",name:"Rub"},"fa-safari":{unicode:"\\f267",name:"Safari"},"fa-scissors":{unicode:"\\f0c4",name:"Scissors"},"fa-scribd":{unicode:"\\f28a",name:"Scribd"},"fa-search":{unicode:"\\f002",name:"Search"},"fa-search-minus":{unicode:"\\f010",name:"Search minus"},"fa-search-plus":{unicode:"\\f00e",name:"Search plus"},"fa-sellsy":{unicode:"\\f213",name:"Sellsy"},"fa-server":{unicode:"\\f233",name:"Server"},"fa-share":{unicode:"\\f064",name:"Share"},"fa-share-alt":{unicode:"\\f1e0",name:"Share alt"},"fa-share-alt-square":{unicode:"\\f1e1",name:"Share alt square"},"fa-share-square":{unicode:"\\f14d",name:"Share square"},"fa-share-square-o":{unicode:"\\f045",name:"Share square o"},"fa-shield":{unicode:"\\f132",name:"Shield"},"fa-ship":{unicode:"\\f21a",name:"Ship"},"fa-shirtsinbulk":{unicode:"\\f214",name:"Shirtsinbulk"},"fa-shopping-bag":{unicode:"\\f290",name:"Shopping bag"},"fa-shopping-basket":{unicode:"\\f291",name:"Shopping basket"},"fa-shopping-cart":{unicode:"\\f07a",name:"Shopping cart"},"fa-shower":{unicode:"\\f2cc",name:"Shower"},"fa-sign-in":{unicode:"\\f090",name:"Sign in"},"fa-sign-language":{unicode:"\\f2a7",name:"Sign language"},"fa-sign-out":{unicode:"\\f08b",name:"Sign out"},"fa-signal":{unicode:"\\f012",name:"Signal"},"fa-simplybuilt":{unicode:"\\f215",name:"Simplybuilt"},"fa-sitemap":{unicode:"\\f0e8",name:"Sitemap"},"fa-skyatlas":{unicode:"\\f216",name:"Skyatlas"},"fa-skype":{unicode:"\\f17e",name:"Skype"},"fa-slack":{unicode:"\\f198",name:"Slack"},"fa-sliders":{unicode:"\\f1de",name:"Sliders"},"fa-slideshare":{unicode:"\\f1e7",name:"Slideshare"},"fa-smile-o":{unicode:"\\f118",name:"Smile o"},"fa-snapchat":{unicode:"\\f2ab",name:"Snapchat"},"fa-snapchat-ghost":{unicode:"\\f2ac",name:"Snapchat ghost"},"fa-snapchat-square":{unicode:"\\f2ad",name:"Snapchat square"},"fa-snowflake-o":{unicode:"\\f2dc",name:"Snowflake o"},"fa-sort":{unicode:"\\f0dc",name:"Sort"},"fa-sort-alpha-asc":{unicode:"\\f15d",name:"Sort alpha asc"},"fa-sort-alpha-desc":{unicode:"\\f15e",name:"Sort alpha desc"},"fa-sort-amount-asc":{unicode:"\\f160",name:"Sort amount asc"},"fa-sort-amount-desc":{unicode:"\\f161",name:"Sort amount desc"},"fa-sort-asc":{unicode:"\\f0de",name:"Sort asc"},"fa-sort-desc":{unicode:"\\f0dd",name:"Sort desc"},"fa-sort-numeric-asc":{unicode:"\\f162",name:"Sort numeric asc"},"fa-sort-numeric-desc":{unicode:"\\f163",name:"Sort numeric desc"},"fa-soundcloud":{unicode:"\\f1be",name:"Soundcloud"},"fa-space-shuttle":{unicode:"\\f197",name:"Space shuttle"},"fa-spinner":{unicode:"\\f110",name:"Spinner"},"fa-spoon":{unicode:"\\f1b1",name:"Spoon"},"fa-spotify":{unicode:"\\f1bc",name:"Spotify"},"fa-square":{unicode:"\\f0c8",name:"Square"},"fa-square-o":{unicode:"\\f096",name:"Square o"},"fa-stack-exchange":{unicode:"\\f18d",name:"Stack exchange"},"fa-stack-overflow":{unicode:"\\f16c",name:"Stack overflow"},"fa-star":{unicode:"\\f005",name:"Star"},"fa-star-half":{unicode:"\\f089",name:"Star half"},"fa-star-half-o":{unicode:"\\f123",name:"Star half o"},"fa-star-o":{unicode:"\\f006",name:"Star o"},"fa-steam":{unicode:"\\f1b6",name:"Steam"},"fa-steam-square":{unicode:"\\f1b7",name:"Steam square"},"fa-step-backward":{unicode:"\\f048",name:"Step backward"},"fa-step-forward":{unicode:"\\f051",name:"Step forward"},"fa-stethoscope":{unicode:"\\f0f1",name:"Stethoscope"},"fa-sticky-note":{unicode:"\\f249",name:"Sticky note"},"fa-sticky-note-o":{unicode:"\\f24a",name:"Sticky note o"},"fa-stop":{unicode:"\\f04d",name:"Stop"},"fa-stop-circle":{unicode:"\\f28d",name:"Stop circle"},"fa-stop-circle-o":{unicode:"\\f28e",name:"Stop circle o"},"fa-street-view":{unicode:"\\f21d",name:"Street view"},"fa-strikethrough":{unicode:"\\f0cc",name:"Strikethrough"},"fa-stumbleupon":{unicode:"\\f1a4",name:"Stumbleupon"},"fa-stumbleupon-circle":{unicode:"\\f1a3",name:"Stumbleupon circle"},"fa-subscript":{unicode:"\\f12c",name:"Subscript"},"fa-subway":{unicode:"\\f239",name:"Subway"},"fa-suitcase":{unicode:"\\f0f2",name:"Suitcase"},"fa-sun-o":{unicode:"\\f185",name:"Sun o"},"fa-superpowers":{unicode:"\\f2dd",name:"Superpowers"},"fa-superscript":{unicode:"\\f12b",name:"Superscript"},"fa-table":{unicode:"\\f0ce",name:"Table"},"fa-tablet":{unicode:"\\f10a",name:"Tablet"},"fa-tachometer":{unicode:"\\f0e4",name:"Tachometer"},"fa-tag":{unicode:"\\f02b",name:"Tag"},"fa-tags":{unicode:"\\f02c",name:"Tags"},"fa-tasks":{unicode:"\\f0ae",name:"Tasks"},"fa-taxi":{unicode:"\\f1ba",name:"Taxi"},"fa-telegram":{unicode:"\\f2c6",name:"Telegram"},"fa-television":{unicode:"\\f26c",name:"Television"},"fa-tencent-weibo":{unicode:"\\f1d5",name:"Tencent weibo"},"fa-terminal":{unicode:"\\f120",name:"Terminal"},"fa-text-height":{unicode:"\\f034",name:"Text height"},"fa-text-width":{unicode:"\\f035",name:"Text width"},"fa-th":{unicode:"\\f00a",name:"Th"},"fa-th-large":{unicode:"\\f009",name:"Th large"},"fa-th-list":{unicode:"\\f00b",name:"Th list"},"fa-themeisle":{unicode:"\\f2b2",name:"Themeisle"},"fa-thermometer-empty":{unicode:"\\f2cb",name:"Thermometer empty"},"fa-thermometer-full":{unicode:"\\f2c7",name:"Thermometer full"},"fa-thermometer-half":{unicode:"\\f2c9",name:"Thermometer half"},"fa-thermometer-quarter":{unicode:"\\f2ca",name:"Thermometer quarter"},"fa-thermometer-three-quarters":{unicode:"\\f2c8",name:"Thermometer three quarters"},"fa-thumb-tack":{unicode:"\\f08d",name:"Thumb tack"},"fa-thumbs-down":{unicode:"\\f165",name:"Thumbs down"},"fa-thumbs-o-down":{unicode:"\\f088",name:"Thumbs o down"},"fa-thumbs-o-up":{unicode:"\\f087",name:"Thumbs o up"},"fa-thumbs-up":{unicode:"\\f164",name:"Thumbs up"},"fa-ticket":{unicode:"\\f145",name:"Ticket"},"fa-times":{unicode:"\\f00d",name:"Times"},"fa-times-circle":{unicode:"\\f057",name:"Times circle"},"fa-times-circle-o":{unicode:"\\f05c",name:"Times circle o"},"fa-tint":{unicode:"\\f043",name:"Tint"},"fa-toggle-off":{unicode:"\\f204",name:"Toggle off"},"fa-toggle-on":{unicode:"\\f205",name:"Toggle on"},"fa-trademark":{unicode:"\\f25c",name:"Trademark"},"fa-train":{unicode:"\\f238",name:"Train"},"fa-transgender":{unicode:"\\f224",name:"Transgender"},"fa-transgender-alt":{unicode:"\\f225",name:"Transgender alt"},"fa-trash":{unicode:"\\f1f8",name:"Trash"},"fa-trash-o":{unicode:"\\f014",name:"Trash o"},"fa-tree":{unicode:"\\f1bb",name:"Tree"},"fa-trello":{unicode:"\\f181",name:"Trello"},"fa-tripadvisor":{unicode:"\\f262",name:"Tripadvisor"},"fa-trophy":{unicode:"\\f091",name:"Trophy"},"fa-truck":{unicode:"\\f0d1",name:"Truck"},"fa-try":{unicode:"\\f195",name:"Try"},"fa-tty":{unicode:"\\f1e4",name:"Tty"},"fa-tumblr":{unicode:"\\f173",name:"Tumblr"},"fa-tumblr-square":{unicode:"\\f174",name:"Tumblr square"},"fa-twitch":{unicode:"\\f1e8",name:"Twitch"},"fa-twitter":{unicode:"\\f099",name:"Twitter"},"fa-twitter-square":{unicode:"\\f081",name:"Twitter square"},"fa-umbrella":{unicode:"\\f0e9",name:"Umbrella"},"fa-underline":{unicode:"\\f0cd",name:"Underline"},"fa-undo":{unicode:"\\f0e2",name:"Undo"},"fa-universal-access":{unicode:"\\f29a",name:"Universal access"},"fa-university":{unicode:"\\f19c",name:"University"},"fa-unlock":{unicode:"\\f09c",name:"Unlock"},"fa-unlock-alt":{unicode:"\\f13e",name:"Unlock alt"},"fa-upload":{unicode:"\\f093",name:"Upload"},"fa-usb":{unicode:"\\f287",name:"Usb"},"fa-usd":{unicode:"\\f155",name:"Usd"},"fa-user":{unicode:"\\f007",name:"User"},"fa-user-circle":{unicode:"\\f2bd",name:"User circle"},"fa-user-circle-o":{unicode:"\\f2be",name:"User circle o"},"fa-user-md":{unicode:"\\f0f0",name:"User md"},"fa-user-o":{unicode:"\\f2c0",name:"User o"},"fa-user-plus":{unicode:"\\f234",name:"User plus"},"fa-user-secret":{unicode:"\\f21b",name:"User secret"},"fa-user-times":{unicode:"\\f235",name:"User times"},"fa-users":{unicode:"\\f0c0",name:"Users"},"fa-venus":{unicode:"\\f221",name:"Venus"},"fa-venus-double":{unicode:"\\f226",name:"Venus double"},"fa-venus-mars":{unicode:"\\f228",name:"Venus mars"},"fa-viacoin":{unicode:"\\f237",name:"Viacoin"},"fa-viadeo":{unicode:"\\f2a9",name:"Viadeo"},"fa-viadeo-square":{unicode:"\\f2aa",name:"Viadeo square"},"fa-video-camera":{unicode:"\\f03d",name:"Video camera"},"fa-vimeo":{unicode:"\\f27d",name:"Vimeo"},"fa-vimeo-square":{unicode:"\\f194",name:"Vimeo square"},"fa-vine":{unicode:"\\f1ca",name:"Vine"},"fa-vk":{unicode:"\\f189",name:"Vk"},"fa-volume-control-phone":{unicode:"\\f2a0",name:"Volume control phone"},"fa-volume-down":{unicode:"\\f027",name:"Volume down"},"fa-volume-off":{unicode:"\\f026",name:"Volume off"},"fa-volume-up":{unicode:"\\f028",name:"Volume up"},"fa-weibo":{unicode:"\\f18a",name:"Weibo"},"fa-weixin":{unicode:"\\f1d7",name:"Weixin"},"fa-whatsapp":{unicode:"\\f232",name:"Whatsapp"},"fa-wheelchair":{unicode:"\\f193",name:"Wheelchair"},"fa-wheelchair-alt":{unicode:"\\f29b",name:"Wheelchair alt"},"fa-wifi":{unicode:"\\f1eb",name:"Wifi"},"fa-wikipedia-w":{unicode:"\\f266",name:"Wikipedia w"},"fa-window-close":{unicode:"\\f2d3",name:"Window close"},"fa-window-close-o":{unicode:"\\f2d4",name:"Window close o"},"fa-window-maximize":{unicode:"\\f2d0",name:"Window maximize"},"fa-window-minimize":{unicode:"\\f2d1",name:"Window minimize"},"fa-window-restore":{unicode:"\\f2d2",name:"Window restore"},"fa-windows":{unicode:"\\f17a",name:"Windows"},"fa-wordpress":{unicode:"\\f19a",name:"Wordpress"},"fa-wpbeginner":{unicode:"\\f297",name:"Wpbeginner"},"fa-wpexplorer":{unicode:"\\f2de",name:"Wpexplorer"},"fa-wpforms":{unicode:"\\f298",name:"Wpforms"},"fa-wrench":{unicode:"\\f0ad",name:"Wrench"},"fa-xing":{unicode:"\\f168",name:"Xing"},"fa-xing-square":{unicode:"\\f169",name:"Xing square"},"fa-y-combinator":{unicode:"\\f23b",name:"Y combinator"},"fa-yahoo":{unicode:"\\f19e",name:"Yahoo"},"fa-yelp":{unicode:"\\f1e9",name:"Yelp"},"fa-yoast":{unicode:"\\f2b1",name:"Yoast"},"fa-youtube":{unicode:"\\f167",name:"Youtube"},"fa-youtube-play":{unicode:"\\f16a",name:"Youtube play"},"fa-youtube-square":{unicode:"\\f166",name:"Youtube square"}},u=["glyph-glass","glyph-leaf","glyph-dog","glyph-user","glyph-girl","glyph-car","glyph-user-add","glyph-user-remove","glyph-film","glyph-magic","glyph-envelope","glyph-camera","glyph-heart","glyph-beach-umbrella","glyph-train","glyph-print","glyph-bin","glyph-music","glyph-note","glyph-heart-empty","glyph-home","glyph-snowflake","glyph-fire","glyph-magnet","glyph-parents","glyph-binoculars","glyph-road","glyph-search","glyph-cars","glyph-notes-2","glyph-pencil","glyph-bus","glyph-wifi-alt","glyph-luggage","glyph-old-man","glyph-woman","glyph-file","glyph-coins","glyph-airplane","glyph-notes","glyph-stats","glyph-charts","glyph-pie-chart","glyph-group","glyph-keys","glyph-calendar","glyph-router","glyph-camera-small","glyph-dislikes","glyph-star","glyph-link","glyph-eye-open","glyph-eye-close","glyph-alarm","glyph-clock","glyph-stopwatch","glyph-projector","glyph-history","glyph-truck","glyph-cargo","glyph-compass","glyph-keynote","glyph-paperclip","glyph-power","glyph-lightbulb","glyph-tag","glyph-tags","glyph-cleaning","glyph-ruller","glyph-gift","glyph-umbrella","glyph-book","glyph-bookmark","glyph-wifi","glyph-cup","glyph-stroller","glyph-headphones","glyph-headset","glyph-warning-sign","glyph-signal","glyph-retweet","glyph-refresh","glyph-roundabout","glyph-random","glyph-heat","glyph-repeat","glyph-display","glyph-log-book","glyph-address-book","glyph-building","glyph-eyedropper","glyph-adjust","glyph-tint","glyph-crop","glyph-vector-path-square","glyph-vector-path-circle","glyph-vector-path-polygon","glyph-vector-path-line","glyph-vector-path-curve","glyph-vector-path-all","glyph-font","glyph-italic","glyph-bold","glyph-text-underline","glyph-text-strike","glyph-text-height","glyph-text-width","glyph-text-resize","glyph-left-indent","glyph-right-indent","glyph-align-left","glyph-align-center","glyph-align-right","glyph-justify","glyph-list","glyph-text-smaller","glyph-text-bigger","glyph-embed","glyph-embed-close","glyph-table","glyph-message-full","glyph-message-empty","glyph-message-in","glyph-message-out","glyph-message-plus","glyph-message-minus","glyph-message-ban","glyph-message-flag","glyph-message-lock","glyph-message-new","glyph-inbox","glyph-inbox-plus","glyph-inbox-minus","glyph-inbox-lock","glyph-inbox-in","glyph-inbox-out","glyph-cogwheel","glyph-cogwheels","glyph-picture","glyph-adjust-alt","glyph-database-lock","glyph-database-plus","glyph-database-minus","glyph-database-ban","glyph-folder-open","glyph-folder-plus","glyph-folder-minus","glyph-folder-lock","glyph-folder-flag","glyph-folder-new","glyph-edit","glyph-new-window","glyph-check","glyph-unchecked","glyph-more-windows","glyph-show-big-thumbnails","glyph-show-thumbnails","glyph-show-thumbnails-with-lines","glyph-show-lines","glyph-playlist","glyph-imac","glyph-macbook","glyph-ipad","glyph-iphone","glyph-iphone-transfer","glyph-iphone-exchange","glyph-ipod","glyph-ipod-shuffle","glyph-ear-plugs","glyph-record","glyph-step-backward","glyph-fast-backward","glyph-rewind","glyph-play","glyph-pause","glyph-stop","glyph-forward","glyph-fast-forward","glyph-step-forward","glyph-eject","glyph-facetime-video","glyph-download-alt","glyph-mute","glyph-volume-down","glyph-volume-up","glyph-screenshot","glyph-move","glyph-more","glyph-brightness-reduce","glyph-brightness-increase","glyph-circle-plus","glyph-circle-minus","glyph-circle-remove","glyph-circle-ok","glyph-circle-question-mark","glyph-circle-info","glyph-circle-exclamation-mark","glyph-remove","glyph-ok","glyph-ban","glyph-download","glyph-upload","glyph-shopping-cart","glyph-lock","glyph-unlock","glyph-electricity","glyph-ok-2","glyph-remove-2","glyph-cart-out","glyph-cart-in","glyph-left-arrow","glyph-right-arrow","glyph-down-arrow","glyph-up-arrow","glyph-resize-small","glyph-resize-full","glyph-circle-arrow-left","glyph-circle-arrow-right","glyph-circle-arrow-top","glyph-circle-arrow-down","glyph-play-button","glyph-unshare","glyph-share","glyph-chevron-right","glyph-chevron-left","glyph-bluetooth","glyph-euro","glyph-usd","glyph-gbp","glyph-retweet-2","glyph-moon","glyph-sun","glyph-cloud","glyph-direction","glyph-brush","glyph-pen","glyph-zoom-in","glyph-zoom-out","glyph-pin","glyph-albums","glyph-rotation-lock","glyph-flash","glyph-google-maps","glyph-anchor","glyph-conversation","glyph-chat","glyph-male","glyph-female","glyph-asterisk","glyph-divide","glyph-snorkel-diving","glyph-scuba-diving","glyph-oxygen-bottle","glyph-fins","glyph-fishes","glyph-boat","glyph-delete","glyph-sheriffs-star","glyph-qrcode","glyph-barcode","glyph-pool","glyph-buoy","glyph-spade","glyph-bank","glyph-vcard","glyph-electrical-plug","glyph-flag","glyph-credit-card","glyph-keyboard-wireless","glyph-keyboard-wired","glyph-shield","glyph-ring","glyph-cake","glyph-drink","glyph-beer","glyph-fast-food","glyph-cutlery","glyph-pizza","glyph-birthday-cake","glyph-tablet","glyph-settings","glyph-bullets","glyph-cardio","glyph-t-shirt","glyph-pants","glyph-sweater","glyph-fabric","glyph-leather","glyph-scissors","glyph-bomb","glyph-skull","glyph-celebration","glyph-tea-kettle","glyph-french-press","glyph-coffe-cup","glyph-pot","glyph-grater","glyph-kettle","glyph-hospital","glyph-hospital-h","glyph-microphone","glyph-webcam","glyph-temple-christianity-church","glyph-temple-islam","glyph-temple-hindu","glyph-temple-buddhist","glyph-bicycle","glyph-life-preserver","glyph-share-alt","glyph-comments","glyph-flower","glyph-baseball","glyph-rugby","glyph-ax","glyph-table-tennis","glyph-bowling","glyph-tree-conifer","glyph-tree-deciduous","glyph-more-items","glyph-sort","glyph-filter","glyph-gamepad","glyph-playing-dices","glyph-calculator","glyph-tie","glyph-wallet","glyph-piano","glyph-sampler","glyph-podium","glyph-soccer-ball","glyph-blog","glyph-dashboard","glyph-certificate","glyph-bell","glyph-candle","glyph-pushpin","glyph-iphone-shake","glyph-pin-flag","glyph-turtle","glyph-rabbit","glyph-globe","glyph-briefcase","glyph-hdd","glyph-thumbs-up","glyph-thumbs-down","glyph-hand-right","glyph-hand-left","glyph-hand-up","glyph-hand-down","glyph-fullscreen","glyph-shopping-bag","glyph-book-open","glyph-nameplate","glyph-nameplate-alt","glyph-vases","glyph-bullhorn","glyph-dumbbell","glyph-suitcase","glyph-file-import","glyph-file-export","glyph-bug","glyph-crown","glyph-smoking","glyph-cloud-upload","glyph-cloud-download","glyph-restart","glyph-security-camera","glyph-expand","glyph-collapse","glyph-collapse-top","glyph-globe-af","glyph-global","glyph-spray","glyph-nails","glyph-claw-hammer","glyph-classic-hammer","glyph-hand-saw","glyph-riflescope","glyph-electrical-socket-eu","glyph-electrical-socket-us","glyph-message-forward","glyph-coat-hanger","glyph-dress","glyph-bathrobe","glyph-shirt","glyph-underwear","glyph-log-in","glyph-log-out","glyph-exit","glyph-new-window-alt","glyph-video-sd","glyph-video-hd","glyph-subtitles","glyph-sound-stereo","glyph-sound-dolby","glyph-sound-5-1","glyph-sound-6-1","glyph-sound-7-1","glyph-copyright-mark","glyph-registration-mark","glyph-radar","glyph-skateboard","glyph-golf-course","glyph-sorting","glyph-sort-by-alphabet","glyph-sort-by-alphabet-alt","glyph-sort-by-order","glyph-sort-by-order-alt","glyph-sort-by-attributes","glyph-sort-by-attributes-alt","glyph-compressed","glyph-package","glyph-cloud-plus","glyph-cloud-minus","glyph-disk-save","glyph-disk-open","glyph-disk-saved","glyph-disk-remove","glyph-disk-import","glyph-disk-export","glyph-tower","glyph-send","glyph-git-branch","glyph-git-create","glyph-git-private","glyph-git-delete","glyph-git-merge","glyph-git-pull-request","glyph-git-compare","glyph-git-commit","glyph-construction-cone","glyph-shoe-steps","glyph-plus","glyph-minus","glyph-redo","glyph-undo","glyph-golf","glyph-hockey","glyph-pipe","glyph-wrench","glyph-folder-closed","glyph-phone-alt","glyph-earphone","glyph-floppy-disk","glyph-floppy-saved","glyph-floppy-remove","glyph-floppy-save","glyph-floppy-open","glyph-translate","glyph-fax","glyph-factory","glyph-shop-window","glyph-shop","glyph-kiosk","glyph-kiosk-wheels","glyph-kiosk-light","glyph-kiosk-food","glyph-transfer","glyph-money","glyph-header","glyph-blacksmith","glyph-saw-blade","glyph-basketball","glyph-server","glyph-server-plus","glyph-server-minus","glyph-server-ban","glyph-server-flag","glyph-server-lock","glyph-server-new"],f=["social-pinterest","social-dropbox","social-google-plus","social-jolicloud","social-yahoo","social-blogger","social-picasa","social-amazon","social-tumblr","social-wordpress","social-instapaper","social-evernote","social-xing","social-zootool","social-dribbble","social-deviantart","social-read-it-later","social-linked-in","social-forrst","social-pinboard","social-behance","social-github","social-youtube","social-skitch","social-foursquare","social-quora","social-badoo","social-spotify","social-stumbleupon","social-readability","social-facebook","social-twitter","social-instagram","social-posterous-spaces","social-vimeo","social-flickr","social-last-fm","social-rss","social-skype","social-e-mail","social-vine","social-myspace","social-goodreads","social-apple","social-windows","social-yelp","social-playstation","social-xbox","social-android","social-ios"]}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageXField=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"imagex"},setup:function(){var n=this;this.options.advanced=!0;this.options.fileExtensions||(this.options.fileExtensions="gif|jpg|jpeg|tiff|png");this.options.fileMaxSize||(this.options.fileMaxSize=2e6);this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.overwrite||(this.options.overwrite=!1);this.options.showOverwrite||(this.options.showOverwrite=!1);this.options.uploadhidden&&(this.options.showOverwrite=!1);this.options.showCropper===undefined&&(this.options.showCropper=!1);this.options.showCropper&&(this.options.showImage=!0,this.options.advanced=!0);this.options.showImage===undefined&&(this.options.showImage=!0);this.options.showCropper&&(this.options.cropfolder||(this.options.cropfolder=this.options.uploadfolder),this.options.cropper||(this.options.cropper={}),this.options.width&&this.options.height&&(this.options.cropper.aspectRatio=this.options.width/this.options.height),this.options.ratio&&(this.options.cropper.aspectRatio=this.options.ratio),this.options.cropper.responsive=!1,this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1),this.options.cropper.viewMode||(this.options.cropper.viewMode=1),this.options.cropper.zoomOnWheel||(this.options.cropper.zoomOnWheel=!1),this.options.saveCropFile||(this.options.saveCropFile=!1),this.options.saveCropFile&&(this.options.buttons={check:{value:"Crop Image",click:function(){this.cropImage()}}}));this.base()},getValue:function(){return this.getBaseValue()},setValue:function(i){var r=this,u;this.control&&typeof i!="undefined"&&i!=null&&($image=r.getImage(),t.isEmpty(i)?($image.attr("src",url),this.options.showCropper&&(r.cropper(""),r.setCropUrl("")),n(this.control).find("select").val("")):t.isObject(i)?(i.url&&(i.url=i.url.split("?")[0]),$image.attr("src",i.url),this.options.showCropper&&(i.cropUrl&&(i.cropUrl=i.cropUrl.split("?")[0]),i.cropdata&&Object.keys(i.cropdata).length>0?(u=i.cropdata[Object.keys(i.cropdata)[0]],r.cropper(i.url,u.cropper),r.setCropUrl(u.url)):i.crop?(r.cropper(i.url,i.crop),r.setCropUrl(i.cropUrl)):(r.cropper(i.url,i.crop),r.setCropUrl(i.cropUrl))),n(this.control).find("select").val(i.url)):($image.attr("src",i),this.options.showCropper&&(r.cropper(i),r.setCropUrl("")),n(this.control).find("select").val(i)),n(this.control).find("select").trigger("change.select2"))},getBaseValue:function(){var i=this,t,r;if(this.control&&this.control.length>0)return t=null,$image=i.getImage(),t={},this.options.showCropper&&i.cropperExist()&&(t.crop=$image.cropper("getData",{rounded:!0})),r=n(this.control).find("select").val(),i.options.advanced?t.url=r:t=r,t.url&&(this.dataSource&&this.dataSource[t.url]&&(t.id=this.dataSource[t.url].id,t.filename=this.dataSource[t.url].filename,t.width=this.dataSource[t.url].width,t.height=this.dataSource[t.url].height),this.options.showCropper&&(t.cropUrl=this.getCropUrl())),t},beforeRenderControl:function(i,r){var u=this;this.base(i,function(){if(u.selectOptions=[],u.sf){var f=function(){u.schema.enum=[];u.options.optionLabels=[];for(var n=0;n0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};n(u.getControlEl().find("select")).select2(i)}u.options.uploadhidden?n(u.getControlEl()).find("input[type=file]").hide():u.sf&&n(u.getControlEl()).find("input[type=file]").fileupload({dataType:"json",url:u.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:function(){var n=[{name:"uploadfolder",value:u.options.uploadfolder}];return u.options.showOverwrite?n.push({name:"overwrite",value:u.isOverwrite()}):u.options.overwrite&&n.push({name:"overwrite",value:!0}),n},beforeSend:u.sf.setModuleHeaders,add:function(n,t){var i=!0,r=t.files[0],f=new RegExp("\\.("+u.options.fileExtensions+")$","i");f.test(r.name)||(u.showAlert("You must select an image file only ("+u.options.fileExtensions+")"),i=!1);r.size>u.options.fileMaxSize&&(u.showAlert("Please upload a smaller image, max size is "+u.options.fileMaxSize+" bytes"),i=!1);i==!0&&(u.showAlert("File uploading..."),t.submit())},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(n,t){t.success?u.refresh(function(){u.setValue(t.url);u.showAlert("File uploaded",!0)}):u.showAlert(t.message,!0)})}}).data("loaded",!0);u.options.showOverwrite||n(u.control).parent().find("#"+u.id+"-overwriteLabel").hide();r()})},cropImage:function(){var t=this,r=t.getBaseValue(),u,i;r.url&&($image=t.getImage(),u=$image.cropper("getData",{rounded:!0}),i={url:r.url,cropfolder:t.options.cropfolder,crop:u,id:"crop"},t.options.width&&t.options.height&&(i.resize={width:t.options.width,height:t.options.height}),n(t.getControlEl()).css("cursor","wait"),t.showAlert("Image cropping..."),n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/CropImage",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(i),beforeSend:t.sf.setModuleHeaders}).done(function(i){t.setCropUrl(i.url);t.showAlert("Image cropped",!0);setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")}))},getFileUrl:function(t){var i=this,r;i.sf&&(r={fileid:t},n.ajax({url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:i.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:r,success:function(n){return n},error:function(){return""}}))},cropper:function(t,i){var u=this,r,f;$image=u.getImage();r=$image.data("cropper");t?($image.show(),r?((t!=r.originalUrl||r.url&&t!=r.url)&&$image.cropper("replace",t),i&&$image.cropper("setData",i)):(f=n.extend({},{aspectRatio:16/9,checkOrientation:!1,autoCropArea:.9,minContainerHeight:200,minContainerWidth:400,toggleDragModeOnDblclick:!1,zoomOnWheel:!1,cropmove:function(){u.setCropUrl("")}},u.options.cropper),i&&(f.data=i),$image.cropper(f))):($image.hide(),r&&$image.cropper("destroy"))},cropperExist:function(){var n=this;return $image=n.getImage(),$image.data("cropper")},getImage:function(){var t=this;return n(t.control).parent().find("#"+t.id+"-image")},isOverwrite:function(){var i=this,r;return this.options.showOverwrite?(r=n(i.control).parent().find("#"+i.id+"-overwrite"),t.checked(r)):this.options.overwrite},getCropUrl:function(){var t=this;return n(t.getControlEl()).attr("data-cropurl")},setCropUrl:function(t){var i=this;n(i.getControlEl()).attr("data-cropurl",t);i.refreshValidationState()},handleValidate:function(){var r=this.base(),t=this.validation,u=n(this.control).find("select").val(),i=!u||!this.options.showCropper||!this.options.saveCropFile||this.getCropUrl();return t.cropMissing={message:i?"":this.getMessage("cropMissing"),status:i},r&&t.cropMissing.status},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data?this.data.url:"",!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;i.setCropUrl("");t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).find("select");i.focus();t&&t(this)}},getTitle:function(){return"Image Crop 2 Field"},getDescription:function(){return"Image Crop 2 Field"},showAlert:function(t,i){var r=this;n("#"+r.id+"-alert").text(t);n("#"+r.id+"-alert").show();i&&setTimeout(function(){n("#"+r.id+"-alert").hide()},4e3)}});t.registerFieldClass("imagex",t.Fields.ImageXField);t.registerMessages({cropMissing:"Cropped image missing (click the crop button)"})}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"image"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.base()},getTitle:function(){return"Image Field"},getDescription:function(){return"Image Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(i){var u=this,r=this.getTextControlEl();r&&r.length>0&&(t.isEmpty(i)?r.val(""):(r.val(i),n(u.control).parent().find(".alpaca-image-display img").attr("src",i)));this.updateMaxLengthIndicator()},getValue:function(){var t=null,n=this.getTextControlEl();return n&&n.length>0&&(t=n.val()),t},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getTextControlEl(),u;i.options.uploadhidden?n(this.control.get(0)).find("input[type=file]").hide():i.sf&&n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,u){u.result&&n.each(u.result,function(t,u){i.setValue(u.url);n(r).change()})}}).data("loaded",!0);n(r).change(function(){var t=n(this).val();n(i.control).parent().find(".alpaca-image-display img").attr("src",t)});i.options.manageurl&&(u=n('Manage files<\/a>').appendTo(n(r).parent()));t()},applyTypeAhead:function(){var r=this,o,i,s,f,e,h,c,l,u;if(r.control.typeahead&&r.options.typeahead&&!t.isEmpty(r.options.typeahead)&&r.sf){if(o=r.options.typeahead.config,o||(o={}),i=r.options.typeahead.datasets,i||(i={}),i.name||(i.name=r.getId()),s=r.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Images?q=%QUERY&d="+s,ajax:{beforeSend:r.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"
    <\/div> {{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));u=this.getTextControlEl();n(u).typeahead(o,i);n(u).on("typeahead:autocompleted",function(t,i){r.setValue(i.value);n(u).change()});n(u).on("typeahead:selected",function(t,i){r.setValue(i.value);n(u).change()});if(f){if(f.autocompleted)n(u).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(u).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(u).change(function(){var t=n(this).val(),i=n(u).typeahead("val");i!==t&&n(u).typeahead("val",t)});n(r.field).find("span.twitter-typeahead").first().css("display","block");n(r.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("image",t.Fields.ImageField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Image2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},getFileUrl:function(t){if(self.sf){var i={fileid:t};n.ajax({url:self.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:self.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:i,success:function(n){return n},error:function(){return""}})}},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select Field"},getDescription:function(){return"Select Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("image2",t.Fields.Image2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageCrop2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"imagecrop2"},setup:function(){var n=this;this.options.uploadfolder||(this.options.uploadfolder="");this.options.cropfolder||(this.options.cropfolder=this.options.uploadfolder);this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.cropper||(this.options.cropper={});this.options.width&&this.options.height&&(this.options.cropper.aspectRatio=this.options.width/this.options.height);this.options.cropper.responsive=!1;this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1);this.options.cropButtonHidden||(this.options.cropButtonHidden=!1);this.options.cropButtonHidden||(this.options.buttons={check:{value:"Crop",click:function(){this.cropImage()}}});this.base()},getValue:function(){var i=this,t;if(this.control&&this.control.length>0)return t=null,$image=i.getImage(),t=i.cropperExist()?$image.cropper("getData",{rounded:!0}):{},t.url=n(this.control).find("select").val(),t.url&&(this.dataSource&&this.dataSource[t.url]&&(t.id=this.dataSource[t.url].id),t.cropUrl=n(i.getControlEl()).attr("data-cropurl")),t},setValue:function(i){var r=this,u;i!==this.getValue()&&this.control&&typeof i!="undefined"&&i!=null&&(t.isEmpty(i)?(r.cropper(""),n(this.control).find("select").val(""),n(r.getControlEl()).attr("data-cropurl","")):t.isObject(i)?(i.url&&(i.url=i.url.split("?")[0]),i.cropUrl&&(i.cropUrl=i.cropUrl.split("?")[0]),i.cropdata&&Object.keys(i.cropdata).length>0?(u=i.cropdata[Object.keys(i.cropdata)[0]],r.cropper(i.url,u.cropper),n(this.control).find("select").val(i.url),n(r.getControlEl()).attr("data-cropurl",u.url)):(r.cropper(i.url,i),n(this.control).find("select").val(i.url),n(r.getControlEl()).attr("data-cropurl",i.cropUrl))):(r.cropper(i),n(this.control).find("select").val(i),n(r.getControlEl()).attr("data-cropurl","")),n(this.control).find("select").trigger("change.select2"))},getEnum:function(){if(this.schema){if(this.schema["enum"])return this.schema["enum"];if(this.schema.type&&this.schema.type==="array"&&this.schema.items&&this.schema.items["enum"])return this.schema.items["enum"]}},initControlEvents:function(){var n=this,t;if(n.base(),n.options.multiple){t=this.control.parent().find(".select2-search__field");t.focus(function(t){n.suspendBlurFocus||(n.onFocus.call(n,t),n.trigger("focus",t))});t.blur(function(t){n.suspendBlurFocus||(n.onBlur.call(n,t),n.trigger("blur",t))});this.control.on("change",function(t){n.onChange.call(n,t);n.trigger("change",t)})}},beforeRenderControl:function(i,r){var u=this;this.base(i,function(){if(u.selectOptions=[],u.sf){var f=function(){u.schema.enum=[];u.options.optionLabels=[];for(var n=0;n0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};n(u.getControlEl().find("select")).select2(i)}u.options.uploadhidden?n(u.getControlEl()).find("input[type=file]").hide():u.sf&&n(u.getControlEl()).find("input[type=file]").fileupload({dataType:"json",url:u.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:u.options.uploadfolder},beforeSend:u.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(n,t){u.refresh(function(){u.setValue(t.url)})})}}).data("loaded",!0);r()})},cropImage:function(){var t=this,i=t.getValue(),r={url:i.url,cropfolder:t.options.cropfolder,crop:i,id:"crop"};t.options.width&&t.options.height&&(r.resize={width:t.options.width,height:t.options.height});n(t.getControlEl()).css("cursor","wait");n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/CropImage",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(r),beforeSend:t.sf.setModuleHeaders}).done(function(i){n(t.getControlEl()).attr("data-cropurl",i.url);setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")})},getFileUrl:function(t){var i=this,r;i.sf&&(r={fileid:t},n.ajax({url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:i.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:r,success:function(n){return n},error:function(){return""}}))},cropper:function(t,i){var f=this,r,u;$image=f.getImage();$image.attr("src",t);r=$image.data("cropper");t?($image.show(),r?((t!=r.originalUrl||r.url&&t!=r.url)&&$image.cropper("replace",t),i&&$image.cropper("setData",i)):(u=n.extend({},{aspectRatio:16/9,checkOrientation:!1,autoCropArea:.9,minContainerHeight:200,minContainerWidth:400,toggleDragModeOnDblclick:!1},f.options.cropper),i&&(u.data=i),$image.cropper(u))):($image.hide(),r&&$image.cropper("destroy"))},cropperExist:function(){var n=this;return $image=n.getImage(),$image.data("cropper")},getImage:function(){var t=this;return n(t.control).parent().find("#"+t.id+"-image")},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data?this.data.url:"",!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).find("select");i.focus();t&&t(this)}},getTitle:function(){return"Image Crop 2 Field"},getDescription:function(){return"Image Crop 2 Field"}});t.registerFieldClass("imagecrop2",t.Fields.ImageCrop2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageCropField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"imagecrop"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.cropper||(this.options.cropper={});this.options.cropper.responsive=!1;this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1);this.base()},getTitle:function(){return"Image Crop Field"},getDescription:function(){return"Image Crop Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(n){var r=this,i=this.getTextControlEl();i&&i.length>0&&(t.isEmpty(n)?(i.val(""),r.cropper("")):t.isObject(n)?(i.val(n.url),r.cropper(n.url,n)):(i.val(n),r.cropper(n)));this.updateMaxLengthIndicator()},getValue:function(){var i=this,n=null,t=this.getTextControlEl();return $image=i.getImage(),t&&t.length>0&&(n=i.cropperExist()?$image.cropper("getData",{rounded:!0}):{},n.url=t.val()),n},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getTextControlEl(),u;$image=n(i.control).parent().find(".alpaca-image-display img");i.sf?(i.options.uploadhidden?n(this.control.get(0)).find("input[type=file]").hide():n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(t,i){n(r).val(i.url);n(r).change()})}}).data("loaded",!0),n(r).change(function(){var t=n(this).val();i.cropper(t)}),i.options.manageurl&&(u=n('Manage files<\/a>').appendTo(n(r).parent()))):$image.hide();t()},cropper:function(t,i){var f=this,r,u;$image=f.getImage();$image.attr("src",t);r=$image.data("cropper");t?($image.show(),r?(t!=r.originalUrl&&$image.cropper("replace",t),i&&$image.cropper("setData",i)):(u=n.extend({},{aspectRatio:16/9,checkOrientation:!1,autoCropArea:.9,minContainerHeight:200,minContainerWidth:400,toggleDragModeOnDblclick:!1},f.options.cropper),i&&(u.data=i),$image.cropper(u))):($image.hide(),r&&$image.cropper("destroy"))},cropperExist:function(){var n=this;return $image=n.getImage(),$image.data("cropper")},getImage:function(){var t=this;return n(t.control).parent().find("#"+t.id+"-image")},applyTypeAhead:function(){var u=this,o,i,s,f,e,h,c,l,r;if(u.control.typeahead&&u.options.typeahead&&!t.isEmpty(u.options.typeahead)&&u.sf){if(o=u.options.typeahead.config,o||(o={}),i=i={},i.name||(i.name=u.getId()),s=u.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:u.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Images?q=%QUERY&d="+s,ajax:{beforeSend:u.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"
    <\/div> {{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));r=this.getTextControlEl();n(r).typeahead(o,i);n(r).on("typeahead:autocompleted",function(t,i){n(r).val(i.value);n(r).change()});n(r).on("typeahead:selected",function(t,i){n(r).val(i.value);n(r).change()});if(f){if(f.autocompleted)n(r).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(r).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(r).change(function(){var t=n(this).val(),i=n(r).typeahead("val");i!==t&&n(r).typeahead("val",t)});n(u.field).find("span.twitter-typeahead").first().css("display","block");n(u.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("imagecrop",t.Fields.ImageCropField)}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageCropperField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"imagecropper"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.cropper||(this.options.cropper={});this.options.cropper.responsive=!1;this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1);this.base()},getTitle:function(){return"Image Cropper Field"},getDescription:function(){return"Image Cropper Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(n){var i=this.getTextControlEl();i&&i.length>0&&(t.isEmpty(n)?i.val(""):t.isString(n)?i.val(n):(i.val(n.url),this.setCroppedData(n.cropdata)));this.updateMaxLengthIndicator()},getValue:function(){var n=null,t=this.getTextControlEl();return t&&t.length>0&&(n={url:t.val()},n.cropdata=this.getCroppedData()),n},getCroppedData:function(){var f=this.getTextControlEl(),i={};for(var t in this.options.croppers){var e=this.options.croppers[t],r=this.id+"-"+t,u=n("#"+r);i[t]=u.data("cropdata")}return i},cropAllImages:function(t){var i=this;for(var r in this.options.croppers){var f=this.id+"-"+r,s=n("#"+f),u=this.options.croppers[r],e={x:-1,y:-1,width:u.width,height:u.height,rotate:0},o=JSON.stringify({url:t,id:r,crop:e,resize:u,cropfolder:this.options.cropfolder});n.ajax({type:"POST",url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/CropImage",contentType:"application/json; charset=utf-8",dataType:"json",async:!1,data:o,beforeSend:i.sf.setModuleHeaders}).done(function(n){var t={url:n.url,cropper:{}};i.setCroppedDataForId(f,t)}).fail(function(n,t,i){alert("Uh-oh, something broke: "+i)})}},setCroppedData:function(i){var e=this.getTextControlEl(),h=this.getFieldEl(),u,r,f,o;if(e&&e.length>0&&!t.isEmpty(i))for(r in this.options.croppers){var o=this.options.croppers[r],c=this.id+"-"+r,s=n("#"+c);cropdata=i[r];cropdata&&s.data("cropdata",cropdata);u||(u=s,n(u).addClass("active"),cropdata&&(f=n(h).find(".alpaca-image-display img.image"),o=f.data("cropper"),o&&f.cropper("setData",cropdata.cropper)))}},setCroppedDataForId:function(t,i){var u=this.getTextControlEl(),r;i&&(r=n("#"+t),r.data("cropdata",i))},getCurrentCropData:function(){var t=this.getFieldEl(),i=n(t).parent().find(".alpaca-form-tab.active");return n(i).data("cropdata")},setCurrentCropData:function(t){var i=this.getFieldEl(),r=n(i).parent().find(".alpaca-form-tab.active");n(r).data("cropdata",t)},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},cropChange:function(t){var u=t.data,f=u.getCurrentCropData(),e;if(f){var r=f.cropper,o=this,i=n(this).cropper("getData",{rounded:!0});(i.x!=r.x||i.y!=r.y||i.width!=r.width||i.height!=r.height||i.rotate!=r.rotate)&&(e={url:"",cropper:i},u.setCurrentCropData(e))}},getCropppersData:function(){var n,t,i;for(n in self.options.croppers)t=self.options.croppers[n],i=self.id+"-"+n},handlePostRender:function(t){var i=this,f=this.getTextControlEl(),s=this.getFieldEl(),r=n('Crop<\/a>'),e,o,u,a;r.click(function(){var u=i.getCroppedData(),e=JSON.stringify({url:f.val(),cropfolder:i.options.cropfolder,cropdata:u,croppers:i.options.croppers}),t;return n(r).css("cursor","wait"),t="CropImages",n.ajax({type:"POST",url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/"+t,contentType:"application/json; charset=utf-8",dataType:"json",data:e,beforeSend:i.sf.setModuleHeaders}).done(function(t){var u,f;for(u in i.options.croppers){var s=i.options.croppers[u],e=i.id+"-"+u,o=n("#"+e);t.cropdata[u]&&(f={url:t.cropdata[u].url,cropper:t.cropdata[u].crop},f&&o.data("cropdata",f))}setTimeout(function(){n(r).css("cursor","initial")},500)}).fail(function(t,i,r){alert("Uh-oh, something broke: "+r);n(s).css("cursor","initial")}),!1});for(o in i.options.croppers){var c=i.options.croppers[o],l=i.id+"-"+o,h=n(''+o+"<\/a>").appendTo(n(f).parent());h.data("cropopt",c);h.click(function(){u.off("crop.cropper");var t=n(this).data("cropdata"),f=n(this).data("cropopt");u.cropper("setAspectRatio",f.width/f.height);t?u.cropper("setData",t.cropper):u.cropper("reset");r.data("cropperButtonId",this.id);r.data("cropperId",n(this).attr("data-id"));n(this).parent().find(".alpaca-form-tab").removeClass("active");n(this).addClass("active");u.on("crop.cropper",i,i.cropChange);return!1});e||(e=h,n(e).addClass("active"),r.data("cropperButtonId",n(e).attr("id")),r.data("cropperId",n(e).attr("data-id")))}u=n(s).find(".alpaca-image-display img.image");u.cropper(i.options.cropper).on("built.cropper",function(){var t=n(e).data("cropopt"),r,u;t&&n(this).cropper("setAspectRatio",t.width/t.height);r=n(e).data("cropdata");r&&n(this).cropper("setData",r.cropper);u=n(s).find(".alpaca-image-display img.image");u.on("crop.cropper",i,i.cropChange)});i.options.uploadhidden?n(this.control.get(0)).find("input[type=file]").hide():n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(t,i){f.val(i.url);n(f).change()})}}).data("loaded",!0);n(f).change(function(){var t=n(this).val();n(s).find(".alpaca-image-display img.image").attr("src",t);u.cropper("replace",t);t&&i.cropAllImages(t)});r.appendTo(n(f).parent());i.options.manageurl&&(a=n('Manage files<\/a>').appendTo(n(f).parent()));t()},applyTypeAhead:function(){var u=this,o,i,s,f,e,h,c,l,r;if(u.control.typeahead&&u.options.typeahead&&!t.isEmpty(u.options.typeahead)){if(o=u.options.typeahead.config,o||(o={}),i=i={},i.name||(i.name=u.getId()),s=u.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:u.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Images?q=%QUERY&d="+s,ajax:{beforeSend:u.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"
    <\/div> {{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));r=this.getTextControlEl();n(r).typeahead(o,i);n(r).on("typeahead:autocompleted",function(t,i){r.val(i.value);n(r).change()});n(r).on("typeahead:selected",function(t,i){r.val(i.value);n(r).change()});if(f){if(f.autocompleted)n(r).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(r).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(r).change(function(){var t=n(this).val(),i=n(r).typeahead("val");i!==t&&n(r).typeahead("val",t)});n(u.field).find("span.twitter-typeahead").first().css("display","block");n(u.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("imagecropper",t.Fields.ImageCropperField)}(jQuery),function(n){var t=n.alpaca;t.Fields.NumberField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.numberDecimalSeparator=f.numberDecimalSeparator||"."},setup:function(){this.base()},getFieldType:function(){return"number"},getValue:function(){var n=this._getControlVal(!1);return typeof n=="undefined"||""==n?n:(this.numberDecimalSeparator!="."&&(n=(""+n).replace(this.numberDecimalSeparator,".")),parseFloat(n))},setValue:function(n){var i=n;this.numberDecimalSeparator!="."&&(i=t.isEmpty(n)?"":(""+n).replace(".",this.numberDecimalSeparator));this.base(i)},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateNumber();return i.stringNotANumber={message:n?"":this.view.getMessage("stringNotANumber"),status:n},n=this._validateDivisibleBy(),i.stringDivisibleBy={message:n?"":t.substituteTokens(this.view.getMessage("stringDivisibleBy"),[this.schema.divisibleBy]),status:n},n=this._validateMaximum(),i.stringValueTooLarge={message:"",status:n},n||(i.stringValueTooLarge.message=this.schema.exclusiveMaximum?t.substituteTokens(this.view.getMessage("stringValueTooLargeExclusive"),[this.schema.maximum]):t.substituteTokens(this.view.getMessage("stringValueTooLarge"),[this.schema.maximum])),n=this._validateMinimum(),i.stringValueTooSmall={message:"",status:n},n||(i.stringValueTooSmall.message=this.schema.exclusiveMinimum?t.substituteTokens(this.view.getMessage("stringValueTooSmallExclusive"),[this.schema.minimum]):t.substituteTokens(this.view.getMessage("stringValueTooSmall"),[this.schema.minimum])),n=this._validateMultipleOf(),i.stringValueNotMultipleOf={message:"",status:n},n||(i.stringValueNotMultipleOf.message=t.substituteTokens(this.view.getMessage("stringValueNotMultipleOf"),[this.schema.multipleOf])),r&&i.stringNotANumber.status&&i.stringDivisibleBy.status&&i.stringValueTooLarge.status&&i.stringValueTooSmall.status&&i.stringValueNotMultipleOf.status},_validateNumber:function(){var n=this._getControlVal(),i,r;return(this.numberDecimalSeparator!="."&&(n=n.replace(this.numberDecimalSeparator,".")),typeof n=="number"&&(n=""+n),t.isValEmpty(n))?!0:(i=t.testRegex(t.regexps.number,n),!i)?!1:(r=this.getValue(),isNaN(r))?!1:!0},_validateDivisibleBy:function(){var n=this.getValue();return!t.isEmpty(this.schema.divisibleBy)&&n%this.schema.divisibleBy!=0?!1:!0},_validateMaximum:function(){var n=this.getValue();return!t.isEmpty(this.schema.maximum)&&(n>this.schema.maximum||!t.isEmpty(this.schema.exclusiveMaximum)&&n==this.schema.maximum&&this.schema.exclusiveMaximum)?!1:!0},_validateMinimum:function(){var n=this.getValue();return!t.isEmpty(this.schema.minimum)&&(n0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("role2",t.Fields.Role2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.User2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this,t;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.options.role||(this.options.role="");n=this;this.options.lazyLoading&&(t=10,this.options.select2={ajax:{url:this.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/UsersLookup",beforeSend:this.sf.setModuleHeaders,type:"get",dataType:"json",delay:250,data:function(i){return{q:i.term?i.term:"",d:n.options.folder,role:n.options.role,pageIndex:i.page?i.page:1,pageSize:t}},processResults:function(i,r){return r.page=r.page||1,r.page==1&&i.items.unshift({id:"",text:n.options.noneLabel}),{results:i.items,pagination:{more:r.page*t0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(t.loading)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},getUserName:function(t,i){var r=this,u;r.sf&&(u={userid:t},n.ajax({url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/GetUserInfo",beforeSend:r.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:u,success:function(n){i&&i(n)},error:function(){alert("Error GetUserInfo "+t)}}))},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(){}),r):!0:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTextControlEl:function(){var t=this;return n(t.getControlEl()).find("input[type=text]")},getTitle:function(){return"Select User Field"},getDescription:function(){return"Select User Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("user2",t.Fields.User2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.Select2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);n.schema.required&&(n.options.hideNone=!1);this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};n(u.getControlEl()).select2(i)}r()})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select Field"},getDescription:function(){return"Select Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("select2",t.Fields.Select2Field)}(jQuery),function(n){var t=n.alpaca;n.alpaca.Fields.DnnUrlField=n.alpaca.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.sf=f.servicesFramework},setup:function(){this.base()},applyTypeAhead:function(){var t=this,f,i,r,u,e,o,s,h;if(t.sf){if(f=f={},i=i={},i.name||(i.name=t.getId()),r=r={},u={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},u.remote={url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Tabs?q=%QUERY&l="+t.culture,ajax:{beforeSend:t.sf.setModuleHeaders}},i.filter&&(u.remote.filter=i.filter),i.replace&&(u.remote.replace=i.replace),e=new Bloodhound(u),e.initialize(),i.source=e.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"{{name}}"},i.templates)for(o in i.templates)s=i.templates[o],typeof s=="string"&&(i.templates[o]=Handlebars.compile(s));n(t.control).typeahead(f,i);n(t.control).on("typeahead:autocompleted",function(i,r){t.setValue(r.value);n(t.control).change()});n(t.control).on("typeahead:selected",function(i,r){t.setValue(r.value);n(t.control).change()});if(r){if(r.autocompleted)n(t.control).on("typeahead:autocompleted",function(n,t){r.autocompleted(n,t)});if(r.selected)n(t.control).on("typeahead:selected",function(n,t){r.selected(n,t)})}h=n(t.control);n(t.control).change(function(){var i=n(this).val(),t=n(h).typeahead("val");t!==i&&n(h).typeahead("val",t)});n(t.field).find("span.twitter-typeahead").first().css("display","block");n(t.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("url",t.Fields.DnnUrlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Url2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.culture=f.culture;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("url2",t.Fields.Url2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.wysihtmlField=t.Fields.TextAreaField.extend({getFieldType:function(){return"wysihtml"},setup:function(){this.data||(this.data="");this.base();typeof this.options.wysihtml=="undefined"&&(this.options.wysihtml={})},afterRenderControl:function(t,i){var r=this;this.base(t,function(){if(!r.isDisplayOnly()&&r.control){var t=r.control,u=n(t).find("#"+r.id)[0];r.editor=new wysihtml5.Editor(u,{toolbar:n(t).find("#"+r.id+"-toolbar")[0],parserRules:wysihtml5ParserRules});wysihtml5.commands.custom_class={exec:function(n,t,i){return wysihtml5.commands.formatBlock.exec(n,t,"p",i,new RegExp(i,"g"))},state:function(n,t,i){return wysihtml5.commands.formatBlock.state(n,t,"p",i,new RegExp(i,"g"))}}}i()})},getEditor:function(){return this.editor},setValue:function(n){var t=this;this.editor&&this.editor.setValue(n);this.base(n)},getValue:function(){var n=null;return this.editor&&(n=this.editor.currentView=="source"?this.editor.sourceView.textarea.value:this.editor.getValue()),n},getTitle:function(){return"wysihtml"},getDescription:function(){return"Provides an instance of a wysihtml control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{wysihtml:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{wysiwyg:{type:"any"}}})}});t.registerFieldClass("wysihtml",t.Fields.wysihtmlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.SummernoteField=t.Fields.TextAreaField.extend({getFieldType:function(){return"summernote"},setup:function(){this.data||(this.data="");this.base();typeof this.options.summernote=="undefined"&&(this.options.summernote={height:null,minHeight:null,maxHeight:null});this.options.placeholder&&(this.options.summernote=this.options.placeholder)},afterRenderControl:function(t,i){var r=this;this.base(t,function(){if(!r.isDisplayOnly()&&r.control&&n.fn.summernote)r.on("ready",function(){n(r.control).summernote(r.options.summernote)});n(r.control).bind("destroyed",function(){try{n(r.control).summernote("destroy")}catch(t){}});i()})},getTitle:function(){return"Summernote Editor"},getDescription:function(){return"Provides an instance of a Summernote Editor control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{summernote:{title:"Summernote Editor options",description:"Use this entry to provide configuration options to the underlying Summernote plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{summernote:{type:"any"}}})}});t.registerFieldClass("summernote",t.Fields.SummernoteField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLSummernote=t.Fields.SummernoteField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language CKEditor Field"},getDescription:function(){return"Multi Language CKEditor field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlsummernote",t.Fields.MLSummernote)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLCKEditorField=t.Fields.CKEditorField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base();this.options.ckeditor||(this.options.ckeditor={});CKEDITOR.config.enableConfigHelper&&!this.options.ckeditor.extraPlugins&&(this.options.ckeditor.extraPlugins="dnnpages,confighelper")},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language CKEditor Field"},getDescription:function(){return"Multi Language CKEditor field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlckeditor",t.Fields.MLCKEditorField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLFile2Field=t.Fields.File2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(r),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).after('')}});t.registerFieldClass("mlfile2",t.Fields.MLFile2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLFileField=t.Fields.FileField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getTextControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Url Field"},getDescription:function(){return"Multi Language Url field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlfile",t.Fields.MLFileField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLFolder2Field=t.Fields.Folder2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(r),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlfolder2",t.Fields.MLFolder2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLImage2Field=t.Fields.Image2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlimage2",t.Fields.MLImage2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLImageXField=t.Fields.ImageXField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlimagex",t.Fields.MLImageXField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLImageField=t.Fields.ImageField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getTextControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Url Field"},getDescription:function(){return"Multi Language Url field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlimage",t.Fields.MLImageField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLTextAreaField=t.Fields.TextAreaField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Text Field"},getDescription:function(){return"Multi Language Text field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mltextarea",t.Fields.MLTextAreaField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLTextField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Text Field"},getDescription:function(){return"Multi Language Text field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mltext",t.Fields.MLTextField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLUrl2Field=t.Fields.Url2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(r),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlurl2",t.Fields.MLUrl2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLUrlField=t.Fields.DnnUrlField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Url Field"},getDescription:function(){return"Multi Language Url field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlurl",t.Fields.MLUrlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLwysihtmlField=t.Fields.wysihtmlField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"ML wysihtml Field"},getDescription:function(){return"Provides an instance of a wysihtml control for use in editing MLHTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{wysihtml:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{wysiwyg:{type:"any"}}})}});t.registerFieldClass("mlwysihtml",t.Fields.MLwysihtmlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Accordion=t.Fields.ArrayField.extend({getFieldType:function(){return"accordion"},constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.base();n.options.titleField||n.schema.items&&n.schema.items.properties&&Object.keys(n.schema.items.properties).length&&(n.options.titleField=Object.keys(n.schema.items.properties)[0])},createItem:function(i,r,u,f,e){var o=this;this.base(i,r,u,f,function(i){var f="[no title]",u=i.childrenByPropertyId[o.options.titleField],r;if(u){r=u.getValue();t.isObject(r)&&(r=r[o.culture]);r=r?r:f;i.getContainerEl().closest(".panel").find(".panel-title a").first().text(r);u.on("keyup",function(){var i=this.getValue();t.isObject(i)&&(i=i[o.culture]);i=i?i:f;n(this.getControlEl()).closest(".panel").find(".panel-title a").first().text(i)})}e&&e(i)})},getType:function(){return"array"},getTitle:function(){return"accordion Field"},getDescription:function(){return"Renders array with title"}});t.registerFieldClass("accordion",t.Fields.Accordion)}(jQuery); \ No newline at end of file +(function(n){function r(t,i){var r="";return t&&t.address_components&&n.each(t.address_components,function(t,u){n.each(u.types,function(n,t){if(t==i){r=u.long_name;return}});r!=""}),r}function u(t){var i="";return t&&t.address_components&&n.each(t.address_components,function(t,r){n.each(r.types,function(n,t){if(t=="country"){i=r.short_name;return}});i!=""}),i}function f(n){for(n=n.toUpperCase(),index=0;index<\/div>').appendTo(t),o=n('Geocode Address<\/a>').appendTo(t),o.button&&o.button({text:!0}),o.click(function(){if(google&&google.maps){var i=new google.maps.Geocoder,r=e.getAddress();i&&i.geocode({address:r},function(i,r){r===google.maps.GeocoderStatus.OK?(n(".alpaca-field.lng input.alpaca-control",t).val(i[0].geometry.location.lng()),n(".alpaca-field.lat input.alpaca-control",t).val(i[0].geometry.location.lat())):e.displayMessage("Geocoding failed: "+r)})}else e.displayMessage("Google Map API is not installed.");return!1}).wrap(""),s=n(".alpaca-field.googlesearch input.alpaca-control",t)[0],s&&typeof google!="undefined"&&google&&google.maps&&(h=new google.maps.places.SearchBox(s),google.maps.event.addListener(h,"places_changed",function(){var e=h.getPlaces(),i;e.length!=0&&(i=e[0],n(".alpaca-field.postalcode input.alpaca-control",t).val(r(i,"postal_code")),n(".alpaca-field.city input.alpaca-control",t).val(r(i,"locality")),n(".alpaca-field.street input.alpaca-control",t).val(r(i,"route")),n(".alpaca-field.number input.alpaca-control",t).val(r(i,"street_number")),n(".alpaca-field.country select.alpaca-control",t).val(f(u(i,"country"))),n(".alpaca-field.lng input.alpaca-control",t).val(i.geometry.location.lng()),n(".alpaca-field.lat input.alpaca-control",t).val(i.geometry.location.lat()),s.value="")}),google.maps.event.addDomListener(s,"keydown",function(n){n.keyCode==13&&n.preventDefault()})),e.options.showMapOnLoad&&o.click());i()})},getType:function(){return"any"},getTitle:function(){return"Address"},getDescription:function(){return"Address with Street, City, State, Postal code and Country. Also comes with support for Google map."},getSchemaOfOptions:function(){return i.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return i.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t=[{countryName:"Afghanistan",iso2:"AF",iso3:"AFG",phoneCode:"93"},{countryName:"Albania",iso2:"AL",iso3:"ALB",phoneCode:"355"},{countryName:"Algeria",iso2:"DZ",iso3:"DZA",phoneCode:"213"},{countryName:"American Samoa",iso2:"AS",iso3:"ASM",phoneCode:"1 684"},{countryName:"Andorra",iso2:"AD",iso3:"AND",phoneCode:"376"},{countryName:"Angola",iso2:"AO",iso3:"AGO",phoneCode:"244"},{countryName:"Anguilla",iso2:"AI",iso3:"AIA",phoneCode:"1 264"},{countryName:"Antarctica",iso2:"AQ",iso3:"ATA",phoneCode:"672"},{countryName:"Antigua and Barbuda",iso2:"AG",iso3:"ATG",phoneCode:"1 268"},{countryName:"Argentina",iso2:"AR",iso3:"ARG",phoneCode:"54"},{countryName:"Armenia",iso2:"AM",iso3:"ARM",phoneCode:"374"},{countryName:"Aruba",iso2:"AW",iso3:"ABW",phoneCode:"297"},{countryName:"Australia",iso2:"AU",iso3:"AUS",phoneCode:"61"},{countryName:"Austria",iso2:"AT",iso3:"AUT",phoneCode:"43"},{countryName:"Azerbaijan",iso2:"AZ",iso3:"AZE",phoneCode:"994"},{countryName:"Bahamas",iso2:"BS",iso3:"BHS",phoneCode:"1 242"},{countryName:"Bahrain",iso2:"BH",iso3:"BHR",phoneCode:"973"},{countryName:"Bangladesh",iso2:"BD",iso3:"BGD",phoneCode:"880"},{countryName:"Barbados",iso2:"BB",iso3:"BRB",phoneCode:"1 246"},{countryName:"Belarus",iso2:"BY",iso3:"BLR",phoneCode:"375"},{countryName:"Belgium",iso2:"BE",iso3:"BEL",phoneCode:"32"},{countryName:"Belize",iso2:"BZ",iso3:"BLZ",phoneCode:"501"},{countryName:"Benin",iso2:"BJ",iso3:"BEN",phoneCode:"229"},{countryName:"Bermuda",iso2:"BM",iso3:"BMU",phoneCode:"1 441"},{countryName:"Bhutan",iso2:"BT",iso3:"BTN",phoneCode:"975"},{countryName:"Bolivia",iso2:"BO",iso3:"BOL",phoneCode:"591"},{countryName:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phoneCode:"387"},{countryName:"Botswana",iso2:"BW",iso3:"BWA",phoneCode:"267"},{countryName:"Brazil",iso2:"BR",iso3:"BRA",phoneCode:"55"},{countryName:"British Indian Ocean Territory",iso2:"IO",iso3:"IOT",phoneCode:""},{countryName:"British Virgin Islands",iso2:"VG",iso3:"VGB",phoneCode:"1 284"},{countryName:"Brunei",iso2:"BN",iso3:"BRN",phoneCode:"673"},{countryName:"Bulgaria",iso2:"BG",iso3:"BGR",phoneCode:"359"},{countryName:"Burkina Faso",iso2:"BF",iso3:"BFA",phoneCode:"226"},{countryName:"Burma (Myanmar)",iso2:"MM",iso3:"MMR",phoneCode:"95"},{countryName:"Burundi",iso2:"BI",iso3:"BDI",phoneCode:"257"},{countryName:"Cambodia",iso2:"KH",iso3:"KHM",phoneCode:"855"},{countryName:"Cameroon",iso2:"CM",iso3:"CMR",phoneCode:"237"},{countryName:"Canada",iso2:"CA",iso3:"CAN",phoneCode:"1"},{countryName:"Cape Verde",iso2:"CV",iso3:"CPV",phoneCode:"238"},{countryName:"Cayman Islands",iso2:"KY",iso3:"CYM",phoneCode:"1 345"},{countryName:"Central African Republic",iso2:"CF",iso3:"CAF",phoneCode:"236"},{countryName:"Chad",iso2:"TD",iso3:"TCD",phoneCode:"235"},{countryName:"Chile",iso2:"CL",iso3:"CHL",phoneCode:"56"},{countryName:"China",iso2:"CN",iso3:"CHN",phoneCode:"86"},{countryName:"Christmas Island",iso2:"CX",iso3:"CXR",phoneCode:"61"},{countryName:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phoneCode:"61"},{countryName:"Colombia",iso2:"CO",iso3:"COL",phoneCode:"57"},{countryName:"Comoros",iso2:"KM",iso3:"COM",phoneCode:"269"},{countryName:"Cook Islands",iso2:"CK",iso3:"COK",phoneCode:"682"},{countryName:"Costa Rica",iso2:"CR",iso3:"CRC",phoneCode:"506"},{countryName:"Croatia",iso2:"HR",iso3:"HRV",phoneCode:"385"},{countryName:"Cuba",iso2:"CU",iso3:"CUB",phoneCode:"53"},{countryName:"Cyprus",iso2:"CY",iso3:"CYP",phoneCode:"357"},{countryName:"Czech Republic",iso2:"CZ",iso3:"CZE",phoneCode:"420"},{countryName:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phoneCode:"243"},{countryName:"Denmark",iso2:"DK",iso3:"DNK",phoneCode:"45"},{countryName:"Djibouti",iso2:"DJ",iso3:"DJI",phoneCode:"253"},{countryName:"Dominica",iso2:"DM",iso3:"DMA",phoneCode:"1 767"},{countryName:"Dominican Republic",iso2:"DO",iso3:"DOM",phoneCode:"1 809"},{countryName:"Ecuador",iso2:"EC",iso3:"ECU",phoneCode:"593"},{countryName:"Egypt",iso2:"EG",iso3:"EGY",phoneCode:"20"},{countryName:"El Salvador",iso2:"SV",iso3:"SLV",phoneCode:"503"},{countryName:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phoneCode:"240"},{countryName:"Eritrea",iso2:"ER",iso3:"ERI",phoneCode:"291"},{countryName:"Estonia",iso2:"EE",iso3:"EST",phoneCode:"372"},{countryName:"Ethiopia",iso2:"ET",iso3:"ETH",phoneCode:"251"},{countryName:"Falkland Islands",iso2:"FK",iso3:"FLK",phoneCode:"500"},{countryName:"Faroe Islands",iso2:"FO",iso3:"FRO",phoneCode:"298"},{countryName:"Fiji",iso2:"FJ",iso3:"FJI",phoneCode:"679"},{countryName:"Finland",iso2:"FI",iso3:"FIN",phoneCode:"358"},{countryName:"France",iso2:"FR",iso3:"FRA",phoneCode:"33"},{countryName:"French Polynesia",iso2:"PF",iso3:"PYF",phoneCode:"689"},{countryName:"Gabon",iso2:"GA",iso3:"GAB",phoneCode:"241"},{countryName:"Gambia",iso2:"GM",iso3:"GMB",phoneCode:"220"},{countryName:"Gaza Strip",iso2:"",iso3:"",phoneCode:"970"},{countryName:"Georgia",iso2:"GE",iso3:"GEO",phoneCode:"995"},{countryName:"Germany",iso2:"DE",iso3:"DEU",phoneCode:"49"},{countryName:"Ghana",iso2:"GH",iso3:"GHA",phoneCode:"233"},{countryName:"Gibraltar",iso2:"GI",iso3:"GIB",phoneCode:"350"},{countryName:"Greece",iso2:"GR",iso3:"GRC",phoneCode:"30"},{countryName:"Greenland",iso2:"GL",iso3:"GRL",phoneCode:"299"},{countryName:"Grenada",iso2:"GD",iso3:"GRD",phoneCode:"1 473"},{countryName:"Guam",iso2:"GU",iso3:"GUM",phoneCode:"1 671"},{countryName:"Guatemala",iso2:"GT",iso3:"GTM",phoneCode:"502"},{countryName:"Guinea",iso2:"GN",iso3:"GIN",phoneCode:"224"},{countryName:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phoneCode:"245"},{countryName:"Guyana",iso2:"GY",iso3:"GUY",phoneCode:"592"},{countryName:"Haiti",iso2:"HT",iso3:"HTI",phoneCode:"509"},{countryName:"Holy See (Vatican City)",iso2:"VA",iso3:"VAT",phoneCode:"39"},{countryName:"Honduras",iso2:"HN",iso3:"HND",phoneCode:"504"},{countryName:"Hong Kong",iso2:"HK",iso3:"HKG",phoneCode:"852"},{countryName:"Hungary",iso2:"HU",iso3:"HUN",phoneCode:"36"},{countryName:"Iceland",iso2:"IS",iso3:"IS",phoneCode:"354"},{countryName:"India",iso2:"IN",iso3:"IND",phoneCode:"91"},{countryName:"Indonesia",iso2:"ID",iso3:"IDN",phoneCode:"62"},{countryName:"Iran",iso2:"IR",iso3:"IRN",phoneCode:"98"},{countryName:"Iraq",iso2:"IQ",iso3:"IRQ",phoneCode:"964"},{countryName:"Ireland",iso2:"IE",iso3:"IRL",phoneCode:"353"},{countryName:"Isle of Man",iso2:"IM",iso3:"IMN",phoneCode:"44"},{countryName:"Israel",iso2:"IL",iso3:"ISR",phoneCode:"972"},{countryName:"Italy",iso2:"IT",iso3:"ITA",phoneCode:"39"},{countryName:"Ivory Coast",iso2:"CI",iso3:"CIV",phoneCode:"225"},{countryName:"Jamaica",iso2:"JM",iso3:"JAM",phoneCode:"1 876"},{countryName:"Japan",iso2:"JP",iso3:"JPN",phoneCode:"81"},{countryName:"Jersey",iso2:"JE",iso3:"JEY",phoneCode:""},{countryName:"Jordan",iso2:"JO",iso3:"JOR",phoneCode:"962"},{countryName:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phoneCode:"7"},{countryName:"Kenya",iso2:"KE",iso3:"KEN",phoneCode:"254"},{countryName:"Kiribati",iso2:"KI",iso3:"KIR",phoneCode:"686"},{countryName:"Kosovo",iso2:"",iso3:"",phoneCode:"381"},{countryName:"Kuwait",iso2:"KW",iso3:"KWT",phoneCode:"965"},{countryName:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phoneCode:"996"},{countryName:"Laos",iso2:"LA",iso3:"LAO",phoneCode:"856"},{countryName:"Latvia",iso2:"LV",iso3:"LVA",phoneCode:"371"},{countryName:"Lebanon",iso2:"LB",iso3:"LBN",phoneCode:"961"},{countryName:"Lesotho",iso2:"LS",iso3:"LSO",phoneCode:"266"},{countryName:"Liberia",iso2:"LR",iso3:"LBR",phoneCode:"231"},{countryName:"Libya",iso2:"LY",iso3:"LBY",phoneCode:"218"},{countryName:"Liechtenstein",iso2:"LI",iso3:"LIE",phoneCode:"423"},{countryName:"Lithuania",iso2:"LT",iso3:"LTU",phoneCode:"370"},{countryName:"Luxembourg",iso2:"LU",iso3:"LUX",phoneCode:"352"},{countryName:"Macau",iso2:"MO",iso3:"MAC",phoneCode:"853"},{countryName:"Macedonia",iso2:"MK",iso3:"MKD",phoneCode:"389"},{countryName:"Madagascar",iso2:"MG",iso3:"MDG",phoneCode:"261"},{countryName:"Malawi",iso2:"MW",iso3:"MWI",phoneCode:"265"},{countryName:"Malaysia",iso2:"MY",iso3:"MYS",phoneCode:"60"},{countryName:"Maldives",iso2:"MV",iso3:"MDV",phoneCode:"960"},{countryName:"Mali",iso2:"ML",iso3:"MLI",phoneCode:"223"},{countryName:"Malta",iso2:"MT",iso3:"MLT",phoneCode:"356"},{countryName:"Marshall Islands",iso2:"MH",iso3:"MHL",phoneCode:"692"},{countryName:"Mauritania",iso2:"MR",iso3:"MRT",phoneCode:"222"},{countryName:"Mauritius",iso2:"MU",iso3:"MUS",phoneCode:"230"},{countryName:"Mayotte",iso2:"YT",iso3:"MYT",phoneCode:"262"},{countryName:"Mexico",iso2:"MX",iso3:"MEX",phoneCode:"52"},{countryName:"Micronesia",iso2:"FM",iso3:"FSM",phoneCode:"691"},{countryName:"Moldova",iso2:"MD",iso3:"MDA",phoneCode:"373"},{countryName:"Monaco",iso2:"MC",iso3:"MCO",phoneCode:"377"},{countryName:"Mongolia",iso2:"MN",iso3:"MNG",phoneCode:"976"},{countryName:"Montenegro",iso2:"ME",iso3:"MNE",phoneCode:"382"},{countryName:"Montserrat",iso2:"MS",iso3:"MSR",phoneCode:"1 664"},{countryName:"Morocco",iso2:"MA",iso3:"MAR",phoneCode:"212"},{countryName:"Mozambique",iso2:"MZ",iso3:"MOZ",phoneCode:"258"},{countryName:"Namibia",iso2:"NA",iso3:"NAM",phoneCode:"264"},{countryName:"Nauru",iso2:"NR",iso3:"NRU",phoneCode:"674"},{countryName:"Nepal",iso2:"NP",iso3:"NPL",phoneCode:"977"},{countryName:"Netherlands",iso2:"NL",iso3:"NLD",phoneCode:"31"},{countryName:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phoneCode:"599"},{countryName:"New Caledonia",iso2:"NC",iso3:"NCL",phoneCode:"687"},{countryName:"New Zealand",iso2:"NZ",iso3:"NZL",phoneCode:"64"},{countryName:"Nicaragua",iso2:"NI",iso3:"NIC",phoneCode:"505"},{countryName:"Niger",iso2:"NE",iso3:"NER",phoneCode:"227"},{countryName:"Nigeria",iso2:"NG",iso3:"NGA",phoneCode:"234"},{countryName:"Niue",iso2:"NU",iso3:"NIU",phoneCode:"683"},{countryName:"Norfolk Island",iso2:"",iso3:"NFK",phoneCode:"672"},{countryName:"North Korea",iso2:"KP",iso3:"PRK",phoneCode:"850"},{countryName:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phoneCode:"1 670"},{countryName:"Norway",iso2:"NO",iso3:"NOR",phoneCode:"47"},{countryName:"Oman",iso2:"OM",iso3:"OMN",phoneCode:"968"},{countryName:"Pakistan",iso2:"PK",iso3:"PAK",phoneCode:"92"},{countryName:"Palau",iso2:"PW",iso3:"PLW",phoneCode:"680"},{countryName:"Panama",iso2:"PA",iso3:"PAN",phoneCode:"507"},{countryName:"Papua New Guinea",iso2:"PG",iso3:"PNG",phoneCode:"675"},{countryName:"Paraguay",iso2:"PY",iso3:"PRY",phoneCode:"595"},{countryName:"Peru",iso2:"PE",iso3:"PER",phoneCode:"51"},{countryName:"Philippines",iso2:"PH",iso3:"PHL",phoneCode:"63"},{countryName:"Pitcairn Islands",iso2:"PN",iso3:"PCN",phoneCode:"870"},{countryName:"Poland",iso2:"PL",iso3:"POL",phoneCode:"48"},{countryName:"Portugal",iso2:"PT",iso3:"PRT",phoneCode:"351"},{countryName:"Puerto Rico",iso2:"PR",iso3:"PRI",phoneCode:"1"},{countryName:"Qatar",iso2:"QA",iso3:"QAT",phoneCode:"974"},{countryName:"Republic of the Congo",iso2:"CG",iso3:"COG",phoneCode:"242"},{countryName:"Romania",iso2:"RO",iso3:"ROU",phoneCode:"40"},{countryName:"Russia",iso2:"RU",iso3:"RUS",phoneCode:"7"},{countryName:"Rwanda",iso2:"RW",iso3:"RWA",phoneCode:"250"},{countryName:"Saint Barthelemy",iso2:"BL",iso3:"BLM",phoneCode:"590"},{countryName:"Saint Helena",iso2:"SH",iso3:"SHN",phoneCode:"290"},{countryName:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phoneCode:"1 869"},{countryName:"Saint Lucia",iso2:"LC",iso3:"LCA",phoneCode:"1 758"},{countryName:"Saint Martin",iso2:"MF",iso3:"MAF",phoneCode:"1 599"},{countryName:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phoneCode:"508"},{countryName:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phoneCode:"1 784"},{countryName:"Samoa",iso2:"WS",iso3:"WSM",phoneCode:"685"},{countryName:"San Marino",iso2:"SM",iso3:"SMR",phoneCode:"378"},{countryName:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phoneCode:"239"},{countryName:"Saudi Arabia",iso2:"SA",iso3:"SAU",phoneCode:"966"},{countryName:"Senegal",iso2:"SN",iso3:"SEN",phoneCode:"221"},{countryName:"Serbia",iso2:"RS",iso3:"SRB",phoneCode:"381"},{countryName:"Seychelles",iso2:"SC",iso3:"SYC",phoneCode:"248"},{countryName:"Sierra Leone",iso2:"SL",iso3:"SLE",phoneCode:"232"},{countryName:"Singapore",iso2:"SG",iso3:"SGP",phoneCode:"65"},{countryName:"Slovakia",iso2:"SK",iso3:"SVK",phoneCode:"421"},{countryName:"Slovenia",iso2:"SI",iso3:"SVN",phoneCode:"386"},{countryName:"Solomon Islands",iso2:"SB",iso3:"SLB",phoneCode:"677"},{countryName:"Somalia",iso2:"SO",iso3:"SOM",phoneCode:"252"},{countryName:"South Africa",iso2:"ZA",iso3:"ZAF",phoneCode:"27"},{countryName:"South Korea",iso2:"KR",iso3:"KOR",phoneCode:"82"},{countryName:"Spain",iso2:"ES",iso3:"ESP",phoneCode:"34"},{countryName:"Sri Lanka",iso2:"LK",iso3:"LKA",phoneCode:"94"},{countryName:"Sudan",iso2:"SD",iso3:"SDN",phoneCode:"249"},{countryName:"Suriname",iso2:"SR",iso3:"SUR",phoneCode:"597"},{countryName:"Svalbard",iso2:"SJ",iso3:"SJM",phoneCode:""},{countryName:"Swaziland",iso2:"SZ",iso3:"SWZ",phoneCode:"268"},{countryName:"Sweden",iso2:"SE",iso3:"SWE",phoneCode:"46"},{countryName:"Switzerland",iso2:"CH",iso3:"CHE",phoneCode:"41"},{countryName:"Syria",iso2:"SY",iso3:"SYR",phoneCode:"963"},{countryName:"Taiwan",iso2:"TW",iso3:"TWN",phoneCode:"886"},{countryName:"Tajikistan",iso2:"TJ",iso3:"TJK",phoneCode:"992"},{countryName:"Tanzania",iso2:"TZ",iso3:"TZA",phoneCode:"255"},{countryName:"Thailand",iso2:"TH",iso3:"THA",phoneCode:"66"},{countryName:"Timor-Leste",iso2:"TL",iso3:"TLS",phoneCode:"670"},{countryName:"Togo",iso2:"TG",iso3:"TGO",phoneCode:"228"},{countryName:"Tokelau",iso2:"TK",iso3:"TKL",phoneCode:"690"},{countryName:"Tonga",iso2:"TO",iso3:"TON",phoneCode:"676"},{countryName:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phoneCode:"1 868"},{countryName:"Tunisia",iso2:"TN",iso3:"TUN",phoneCode:"216"},{countryName:"Turkey",iso2:"TR",iso3:"TUR",phoneCode:"90"},{countryName:"Turkmenistan",iso2:"TM",iso3:"TKM",phoneCode:"993"},{countryName:"Turks and Caicos Islands",iso2:"TC",iso3:"TCA",phoneCode:"1 649"},{countryName:"Tuvalu",iso2:"TV",iso3:"TUV",phoneCode:"688"},{countryName:"Uganda",iso2:"UG",iso3:"UGA",phoneCode:"256"},{countryName:"Ukraine",iso2:"UA",iso3:"UKR",phoneCode:"380"},{countryName:"United Arab Emirates",iso2:"AE",iso3:"ARE",phoneCode:"971"},{countryName:"United Kingdom",iso2:"GB",iso3:"GBR",phoneCode:"44"},{countryName:"United States",iso2:"US",iso3:"USA",phoneCode:"1"},{countryName:"Uruguay",iso2:"UY",iso3:"URY",phoneCode:"598"},{countryName:"US Virgin Islands",iso2:"VI",iso3:"VIR",phoneCode:"1 340"},{countryName:"Uzbekistan",iso2:"UZ",iso3:"UZB",phoneCode:"998"},{countryName:"Vanuatu",iso2:"VU",iso3:"VUT",phoneCode:"678"},{countryName:"Venezuela",iso2:"VE",iso3:"VEN",phoneCode:"58"},{countryName:"Vietnam",iso2:"VN",iso3:"VNM",phoneCode:"84"},{countryName:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phoneCode:"681"},{countryName:"West Bank",iso2:"",iso3:"",phoneCode:"970"},{countryName:"Western Sahara",iso2:"EH",iso3:"ESH",phoneCode:""},{countryName:"Yemen",iso2:"YE",iso3:"YEM",phoneCode:"967"},{countryName:"Zambia",iso2:"ZM",iso3:"ZMB",phoneCode:"260"},{countryName:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phoneCode:"263"}];i.registerFieldClass("address",i.Fields.AddressField)})(jQuery),function(n){function r(t,i){var r="";return t&&t.address_components&&n.each(t.address_components,function(t,u){n.each(u.types,function(n,t){if(t==i){r=u.long_name;return}});r!=""}),r}function u(t){var i="";return t&&t.address_components&&n.each(t.address_components,function(t,r){n.each(r.types,function(n,t){if(t=="country"){i=r.short_name;return}});i!=""}),i}function f(n){for(n=n.toUpperCase(),index=0;index<\/div>').appendTo(t),o=n('Geocode Address<\/a>').appendTo(t),o.button&&o.button({text:!0}),o.click(function(){if(google&&google.maps){var i=new google.maps.Geocoder,r=e.getAddress();i&&i.geocode({address:r},function(i,r){r===google.maps.GeocoderStatus.OK?(n(".alpaca-field.lng input.alpaca-control",t).val(i[0].geometry.location.lng()),n(".alpaca-field.lat input.alpaca-control",t).val(i[0].geometry.location.lat())):e.displayMessage("Geocoding failed: "+r)})}else e.displayMessage("Google Map API is not installed.");return!1}).wrap(""),s=n(".alpaca-field.googlesearch input.alpaca-control",t)[0],s&&typeof google!="undefined"&&google&&google.maps&&(h=new google.maps.places.SearchBox(s),google.maps.event.addListener(h,"places_changed",function(){var e=h.getPlaces(),i;e.length!=0&&(i=e[0],n(".alpaca-field.postalcode input.alpaca-control",t).val(r(i,"postal_code")),n(".alpaca-field.city input.alpaca-control",t).val(r(i,"locality")),n(".alpaca-field.street input.alpaca-control",t).val(r(i,"route")),n(".alpaca-field.number input.alpaca-control",t).val(r(i,"street_number")),n(".alpaca-field.country select.alpaca-control",t).val(f(u(i,"country"))),n(".alpaca-field.lng input.alpaca-control",t).val(i.geometry.location.lng()),n(".alpaca-field.lat input.alpaca-control",t).val(i.geometry.location.lat()),s.value="")}),google.maps.event.addDomListener(s,"keydown",function(n){n.keyCode==13&&n.preventDefault()})),e.options.showMapOnLoad&&o.click());i()})},getType:function(){return"any"},getValueOfML:function(n){return n&&i.isObject(n)?n[this.culture]?n[this.culture]:"":n?n:""},getTitle:function(){return"Address"},getDescription:function(){return"Address with Street, City, State, Postal code and Country. Also comes with support for Google map."},getSchemaOfOptions:function(){return i.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return i.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t=[{countryName:"Afghanistan",iso2:"AF",iso3:"AFG",phoneCode:"93"},{countryName:"Albania",iso2:"AL",iso3:"ALB",phoneCode:"355"},{countryName:"Algeria",iso2:"DZ",iso3:"DZA",phoneCode:"213"},{countryName:"American Samoa",iso2:"AS",iso3:"ASM",phoneCode:"1 684"},{countryName:"Andorra",iso2:"AD",iso3:"AND",phoneCode:"376"},{countryName:"Angola",iso2:"AO",iso3:"AGO",phoneCode:"244"},{countryName:"Anguilla",iso2:"AI",iso3:"AIA",phoneCode:"1 264"},{countryName:"Antarctica",iso2:"AQ",iso3:"ATA",phoneCode:"672"},{countryName:"Antigua and Barbuda",iso2:"AG",iso3:"ATG",phoneCode:"1 268"},{countryName:"Argentina",iso2:"AR",iso3:"ARG",phoneCode:"54"},{countryName:"Armenia",iso2:"AM",iso3:"ARM",phoneCode:"374"},{countryName:"Aruba",iso2:"AW",iso3:"ABW",phoneCode:"297"},{countryName:"Australia",iso2:"AU",iso3:"AUS",phoneCode:"61"},{countryName:"Austria",iso2:"AT",iso3:"AUT",phoneCode:"43"},{countryName:"Azerbaijan",iso2:"AZ",iso3:"AZE",phoneCode:"994"},{countryName:"Bahamas",iso2:"BS",iso3:"BHS",phoneCode:"1 242"},{countryName:"Bahrain",iso2:"BH",iso3:"BHR",phoneCode:"973"},{countryName:"Bangladesh",iso2:"BD",iso3:"BGD",phoneCode:"880"},{countryName:"Barbados",iso2:"BB",iso3:"BRB",phoneCode:"1 246"},{countryName:"Belarus",iso2:"BY",iso3:"BLR",phoneCode:"375"},{countryName:"Belgium",iso2:"BE",iso3:"BEL",phoneCode:"32"},{countryName:"Belize",iso2:"BZ",iso3:"BLZ",phoneCode:"501"},{countryName:"Benin",iso2:"BJ",iso3:"BEN",phoneCode:"229"},{countryName:"Bermuda",iso2:"BM",iso3:"BMU",phoneCode:"1 441"},{countryName:"Bhutan",iso2:"BT",iso3:"BTN",phoneCode:"975"},{countryName:"Bolivia",iso2:"BO",iso3:"BOL",phoneCode:"591"},{countryName:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phoneCode:"387"},{countryName:"Botswana",iso2:"BW",iso3:"BWA",phoneCode:"267"},{countryName:"Brazil",iso2:"BR",iso3:"BRA",phoneCode:"55"},{countryName:"British Indian Ocean Territory",iso2:"IO",iso3:"IOT",phoneCode:""},{countryName:"British Virgin Islands",iso2:"VG",iso3:"VGB",phoneCode:"1 284"},{countryName:"Brunei",iso2:"BN",iso3:"BRN",phoneCode:"673"},{countryName:"Bulgaria",iso2:"BG",iso3:"BGR",phoneCode:"359"},{countryName:"Burkina Faso",iso2:"BF",iso3:"BFA",phoneCode:"226"},{countryName:"Burma (Myanmar)",iso2:"MM",iso3:"MMR",phoneCode:"95"},{countryName:"Burundi",iso2:"BI",iso3:"BDI",phoneCode:"257"},{countryName:"Cambodia",iso2:"KH",iso3:"KHM",phoneCode:"855"},{countryName:"Cameroon",iso2:"CM",iso3:"CMR",phoneCode:"237"},{countryName:"Canada",iso2:"CA",iso3:"CAN",phoneCode:"1"},{countryName:"Cape Verde",iso2:"CV",iso3:"CPV",phoneCode:"238"},{countryName:"Cayman Islands",iso2:"KY",iso3:"CYM",phoneCode:"1 345"},{countryName:"Central African Republic",iso2:"CF",iso3:"CAF",phoneCode:"236"},{countryName:"Chad",iso2:"TD",iso3:"TCD",phoneCode:"235"},{countryName:"Chile",iso2:"CL",iso3:"CHL",phoneCode:"56"},{countryName:"China",iso2:"CN",iso3:"CHN",phoneCode:"86"},{countryName:"Christmas Island",iso2:"CX",iso3:"CXR",phoneCode:"61"},{countryName:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phoneCode:"61"},{countryName:"Colombia",iso2:"CO",iso3:"COL",phoneCode:"57"},{countryName:"Comoros",iso2:"KM",iso3:"COM",phoneCode:"269"},{countryName:"Cook Islands",iso2:"CK",iso3:"COK",phoneCode:"682"},{countryName:"Costa Rica",iso2:"CR",iso3:"CRC",phoneCode:"506"},{countryName:"Croatia",iso2:"HR",iso3:"HRV",phoneCode:"385"},{countryName:"Cuba",iso2:"CU",iso3:"CUB",phoneCode:"53"},{countryName:"Cyprus",iso2:"CY",iso3:"CYP",phoneCode:"357"},{countryName:"Czech Republic",iso2:"CZ",iso3:"CZE",phoneCode:"420"},{countryName:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phoneCode:"243"},{countryName:"Denmark",iso2:"DK",iso3:"DNK",phoneCode:"45"},{countryName:"Djibouti",iso2:"DJ",iso3:"DJI",phoneCode:"253"},{countryName:"Dominica",iso2:"DM",iso3:"DMA",phoneCode:"1 767"},{countryName:"Dominican Republic",iso2:"DO",iso3:"DOM",phoneCode:"1 809"},{countryName:"Ecuador",iso2:"EC",iso3:"ECU",phoneCode:"593"},{countryName:"Egypt",iso2:"EG",iso3:"EGY",phoneCode:"20"},{countryName:"El Salvador",iso2:"SV",iso3:"SLV",phoneCode:"503"},{countryName:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phoneCode:"240"},{countryName:"Eritrea",iso2:"ER",iso3:"ERI",phoneCode:"291"},{countryName:"Estonia",iso2:"EE",iso3:"EST",phoneCode:"372"},{countryName:"Ethiopia",iso2:"ET",iso3:"ETH",phoneCode:"251"},{countryName:"Falkland Islands",iso2:"FK",iso3:"FLK",phoneCode:"500"},{countryName:"Faroe Islands",iso2:"FO",iso3:"FRO",phoneCode:"298"},{countryName:"Fiji",iso2:"FJ",iso3:"FJI",phoneCode:"679"},{countryName:"Finland",iso2:"FI",iso3:"FIN",phoneCode:"358"},{countryName:"France",iso2:"FR",iso3:"FRA",phoneCode:"33"},{countryName:"French Polynesia",iso2:"PF",iso3:"PYF",phoneCode:"689"},{countryName:"Gabon",iso2:"GA",iso3:"GAB",phoneCode:"241"},{countryName:"Gambia",iso2:"GM",iso3:"GMB",phoneCode:"220"},{countryName:"Gaza Strip",iso2:"",iso3:"",phoneCode:"970"},{countryName:"Georgia",iso2:"GE",iso3:"GEO",phoneCode:"995"},{countryName:"Germany",iso2:"DE",iso3:"DEU",phoneCode:"49"},{countryName:"Ghana",iso2:"GH",iso3:"GHA",phoneCode:"233"},{countryName:"Gibraltar",iso2:"GI",iso3:"GIB",phoneCode:"350"},{countryName:"Greece",iso2:"GR",iso3:"GRC",phoneCode:"30"},{countryName:"Greenland",iso2:"GL",iso3:"GRL",phoneCode:"299"},{countryName:"Grenada",iso2:"GD",iso3:"GRD",phoneCode:"1 473"},{countryName:"Guam",iso2:"GU",iso3:"GUM",phoneCode:"1 671"},{countryName:"Guatemala",iso2:"GT",iso3:"GTM",phoneCode:"502"},{countryName:"Guinea",iso2:"GN",iso3:"GIN",phoneCode:"224"},{countryName:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phoneCode:"245"},{countryName:"Guyana",iso2:"GY",iso3:"GUY",phoneCode:"592"},{countryName:"Haiti",iso2:"HT",iso3:"HTI",phoneCode:"509"},{countryName:"Holy See (Vatican City)",iso2:"VA",iso3:"VAT",phoneCode:"39"},{countryName:"Honduras",iso2:"HN",iso3:"HND",phoneCode:"504"},{countryName:"Hong Kong",iso2:"HK",iso3:"HKG",phoneCode:"852"},{countryName:"Hungary",iso2:"HU",iso3:"HUN",phoneCode:"36"},{countryName:"Iceland",iso2:"IS",iso3:"IS",phoneCode:"354"},{countryName:"India",iso2:"IN",iso3:"IND",phoneCode:"91"},{countryName:"Indonesia",iso2:"ID",iso3:"IDN",phoneCode:"62"},{countryName:"Iran",iso2:"IR",iso3:"IRN",phoneCode:"98"},{countryName:"Iraq",iso2:"IQ",iso3:"IRQ",phoneCode:"964"},{countryName:"Ireland",iso2:"IE",iso3:"IRL",phoneCode:"353"},{countryName:"Isle of Man",iso2:"IM",iso3:"IMN",phoneCode:"44"},{countryName:"Israel",iso2:"IL",iso3:"ISR",phoneCode:"972"},{countryName:"Italy",iso2:"IT",iso3:"ITA",phoneCode:"39"},{countryName:"Ivory Coast",iso2:"CI",iso3:"CIV",phoneCode:"225"},{countryName:"Jamaica",iso2:"JM",iso3:"JAM",phoneCode:"1 876"},{countryName:"Japan",iso2:"JP",iso3:"JPN",phoneCode:"81"},{countryName:"Jersey",iso2:"JE",iso3:"JEY",phoneCode:""},{countryName:"Jordan",iso2:"JO",iso3:"JOR",phoneCode:"962"},{countryName:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phoneCode:"7"},{countryName:"Kenya",iso2:"KE",iso3:"KEN",phoneCode:"254"},{countryName:"Kiribati",iso2:"KI",iso3:"KIR",phoneCode:"686"},{countryName:"Kosovo",iso2:"",iso3:"",phoneCode:"381"},{countryName:"Kuwait",iso2:"KW",iso3:"KWT",phoneCode:"965"},{countryName:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phoneCode:"996"},{countryName:"Laos",iso2:"LA",iso3:"LAO",phoneCode:"856"},{countryName:"Latvia",iso2:"LV",iso3:"LVA",phoneCode:"371"},{countryName:"Lebanon",iso2:"LB",iso3:"LBN",phoneCode:"961"},{countryName:"Lesotho",iso2:"LS",iso3:"LSO",phoneCode:"266"},{countryName:"Liberia",iso2:"LR",iso3:"LBR",phoneCode:"231"},{countryName:"Libya",iso2:"LY",iso3:"LBY",phoneCode:"218"},{countryName:"Liechtenstein",iso2:"LI",iso3:"LIE",phoneCode:"423"},{countryName:"Lithuania",iso2:"LT",iso3:"LTU",phoneCode:"370"},{countryName:"Luxembourg",iso2:"LU",iso3:"LUX",phoneCode:"352"},{countryName:"Macau",iso2:"MO",iso3:"MAC",phoneCode:"853"},{countryName:"Macedonia",iso2:"MK",iso3:"MKD",phoneCode:"389"},{countryName:"Madagascar",iso2:"MG",iso3:"MDG",phoneCode:"261"},{countryName:"Malawi",iso2:"MW",iso3:"MWI",phoneCode:"265"},{countryName:"Malaysia",iso2:"MY",iso3:"MYS",phoneCode:"60"},{countryName:"Maldives",iso2:"MV",iso3:"MDV",phoneCode:"960"},{countryName:"Mali",iso2:"ML",iso3:"MLI",phoneCode:"223"},{countryName:"Malta",iso2:"MT",iso3:"MLT",phoneCode:"356"},{countryName:"Marshall Islands",iso2:"MH",iso3:"MHL",phoneCode:"692"},{countryName:"Mauritania",iso2:"MR",iso3:"MRT",phoneCode:"222"},{countryName:"Mauritius",iso2:"MU",iso3:"MUS",phoneCode:"230"},{countryName:"Mayotte",iso2:"YT",iso3:"MYT",phoneCode:"262"},{countryName:"Mexico",iso2:"MX",iso3:"MEX",phoneCode:"52"},{countryName:"Micronesia",iso2:"FM",iso3:"FSM",phoneCode:"691"},{countryName:"Moldova",iso2:"MD",iso3:"MDA",phoneCode:"373"},{countryName:"Monaco",iso2:"MC",iso3:"MCO",phoneCode:"377"},{countryName:"Mongolia",iso2:"MN",iso3:"MNG",phoneCode:"976"},{countryName:"Montenegro",iso2:"ME",iso3:"MNE",phoneCode:"382"},{countryName:"Montserrat",iso2:"MS",iso3:"MSR",phoneCode:"1 664"},{countryName:"Morocco",iso2:"MA",iso3:"MAR",phoneCode:"212"},{countryName:"Mozambique",iso2:"MZ",iso3:"MOZ",phoneCode:"258"},{countryName:"Namibia",iso2:"NA",iso3:"NAM",phoneCode:"264"},{countryName:"Nauru",iso2:"NR",iso3:"NRU",phoneCode:"674"},{countryName:"Nepal",iso2:"NP",iso3:"NPL",phoneCode:"977"},{countryName:"Netherlands",iso2:"NL",iso3:"NLD",phoneCode:"31"},{countryName:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phoneCode:"599"},{countryName:"New Caledonia",iso2:"NC",iso3:"NCL",phoneCode:"687"},{countryName:"New Zealand",iso2:"NZ",iso3:"NZL",phoneCode:"64"},{countryName:"Nicaragua",iso2:"NI",iso3:"NIC",phoneCode:"505"},{countryName:"Niger",iso2:"NE",iso3:"NER",phoneCode:"227"},{countryName:"Nigeria",iso2:"NG",iso3:"NGA",phoneCode:"234"},{countryName:"Niue",iso2:"NU",iso3:"NIU",phoneCode:"683"},{countryName:"Norfolk Island",iso2:"",iso3:"NFK",phoneCode:"672"},{countryName:"North Korea",iso2:"KP",iso3:"PRK",phoneCode:"850"},{countryName:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phoneCode:"1 670"},{countryName:"Norway",iso2:"NO",iso3:"NOR",phoneCode:"47"},{countryName:"Oman",iso2:"OM",iso3:"OMN",phoneCode:"968"},{countryName:"Pakistan",iso2:"PK",iso3:"PAK",phoneCode:"92"},{countryName:"Palau",iso2:"PW",iso3:"PLW",phoneCode:"680"},{countryName:"Panama",iso2:"PA",iso3:"PAN",phoneCode:"507"},{countryName:"Papua New Guinea",iso2:"PG",iso3:"PNG",phoneCode:"675"},{countryName:"Paraguay",iso2:"PY",iso3:"PRY",phoneCode:"595"},{countryName:"Peru",iso2:"PE",iso3:"PER",phoneCode:"51"},{countryName:"Philippines",iso2:"PH",iso3:"PHL",phoneCode:"63"},{countryName:"Pitcairn Islands",iso2:"PN",iso3:"PCN",phoneCode:"870"},{countryName:"Poland",iso2:"PL",iso3:"POL",phoneCode:"48"},{countryName:"Portugal",iso2:"PT",iso3:"PRT",phoneCode:"351"},{countryName:"Puerto Rico",iso2:"PR",iso3:"PRI",phoneCode:"1"},{countryName:"Qatar",iso2:"QA",iso3:"QAT",phoneCode:"974"},{countryName:"Republic of the Congo",iso2:"CG",iso3:"COG",phoneCode:"242"},{countryName:"Romania",iso2:"RO",iso3:"ROU",phoneCode:"40"},{countryName:"Russia",iso2:"RU",iso3:"RUS",phoneCode:"7"},{countryName:"Rwanda",iso2:"RW",iso3:"RWA",phoneCode:"250"},{countryName:"Saint Barthelemy",iso2:"BL",iso3:"BLM",phoneCode:"590"},{countryName:"Saint Helena",iso2:"SH",iso3:"SHN",phoneCode:"290"},{countryName:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phoneCode:"1 869"},{countryName:"Saint Lucia",iso2:"LC",iso3:"LCA",phoneCode:"1 758"},{countryName:"Saint Martin",iso2:"MF",iso3:"MAF",phoneCode:"1 599"},{countryName:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phoneCode:"508"},{countryName:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phoneCode:"1 784"},{countryName:"Samoa",iso2:"WS",iso3:"WSM",phoneCode:"685"},{countryName:"San Marino",iso2:"SM",iso3:"SMR",phoneCode:"378"},{countryName:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phoneCode:"239"},{countryName:"Saudi Arabia",iso2:"SA",iso3:"SAU",phoneCode:"966"},{countryName:"Senegal",iso2:"SN",iso3:"SEN",phoneCode:"221"},{countryName:"Serbia",iso2:"RS",iso3:"SRB",phoneCode:"381"},{countryName:"Seychelles",iso2:"SC",iso3:"SYC",phoneCode:"248"},{countryName:"Sierra Leone",iso2:"SL",iso3:"SLE",phoneCode:"232"},{countryName:"Singapore",iso2:"SG",iso3:"SGP",phoneCode:"65"},{countryName:"Slovakia",iso2:"SK",iso3:"SVK",phoneCode:"421"},{countryName:"Slovenia",iso2:"SI",iso3:"SVN",phoneCode:"386"},{countryName:"Solomon Islands",iso2:"SB",iso3:"SLB",phoneCode:"677"},{countryName:"Somalia",iso2:"SO",iso3:"SOM",phoneCode:"252"},{countryName:"South Africa",iso2:"ZA",iso3:"ZAF",phoneCode:"27"},{countryName:"South Korea",iso2:"KR",iso3:"KOR",phoneCode:"82"},{countryName:"Spain",iso2:"ES",iso3:"ESP",phoneCode:"34"},{countryName:"Sri Lanka",iso2:"LK",iso3:"LKA",phoneCode:"94"},{countryName:"Sudan",iso2:"SD",iso3:"SDN",phoneCode:"249"},{countryName:"Suriname",iso2:"SR",iso3:"SUR",phoneCode:"597"},{countryName:"Svalbard",iso2:"SJ",iso3:"SJM",phoneCode:""},{countryName:"Swaziland",iso2:"SZ",iso3:"SWZ",phoneCode:"268"},{countryName:"Sweden",iso2:"SE",iso3:"SWE",phoneCode:"46"},{countryName:"Switzerland",iso2:"CH",iso3:"CHE",phoneCode:"41"},{countryName:"Syria",iso2:"SY",iso3:"SYR",phoneCode:"963"},{countryName:"Taiwan",iso2:"TW",iso3:"TWN",phoneCode:"886"},{countryName:"Tajikistan",iso2:"TJ",iso3:"TJK",phoneCode:"992"},{countryName:"Tanzania",iso2:"TZ",iso3:"TZA",phoneCode:"255"},{countryName:"Thailand",iso2:"TH",iso3:"THA",phoneCode:"66"},{countryName:"Timor-Leste",iso2:"TL",iso3:"TLS",phoneCode:"670"},{countryName:"Togo",iso2:"TG",iso3:"TGO",phoneCode:"228"},{countryName:"Tokelau",iso2:"TK",iso3:"TKL",phoneCode:"690"},{countryName:"Tonga",iso2:"TO",iso3:"TON",phoneCode:"676"},{countryName:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phoneCode:"1 868"},{countryName:"Tunisia",iso2:"TN",iso3:"TUN",phoneCode:"216"},{countryName:"Turkey",iso2:"TR",iso3:"TUR",phoneCode:"90"},{countryName:"Turkmenistan",iso2:"TM",iso3:"TKM",phoneCode:"993"},{countryName:"Turks and Caicos Islands",iso2:"TC",iso3:"TCA",phoneCode:"1 649"},{countryName:"Tuvalu",iso2:"TV",iso3:"TUV",phoneCode:"688"},{countryName:"Uganda",iso2:"UG",iso3:"UGA",phoneCode:"256"},{countryName:"Ukraine",iso2:"UA",iso3:"UKR",phoneCode:"380"},{countryName:"United Arab Emirates",iso2:"AE",iso3:"ARE",phoneCode:"971"},{countryName:"United Kingdom",iso2:"GB",iso3:"GBR",phoneCode:"44"},{countryName:"United States",iso2:"US",iso3:"USA",phoneCode:"1"},{countryName:"Uruguay",iso2:"UY",iso3:"URY",phoneCode:"598"},{countryName:"US Virgin Islands",iso2:"VI",iso3:"VIR",phoneCode:"1 340"},{countryName:"Uzbekistan",iso2:"UZ",iso3:"UZB",phoneCode:"998"},{countryName:"Vanuatu",iso2:"VU",iso3:"VUT",phoneCode:"678"},{countryName:"Venezuela",iso2:"VE",iso3:"VEN",phoneCode:"58"},{countryName:"Vietnam",iso2:"VN",iso3:"VNM",phoneCode:"84"},{countryName:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phoneCode:"681"},{countryName:"West Bank",iso2:"",iso3:"",phoneCode:"970"},{countryName:"Western Sahara",iso2:"EH",iso3:"ESH",phoneCode:""},{countryName:"Yemen",iso2:"YE",iso3:"YEM",phoneCode:"967"},{countryName:"Zambia",iso2:"ZM",iso3:"ZMB",phoneCode:"260"},{countryName:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phoneCode:"263"}];i.registerFieldClass("mladdress",i.Fields.MLAddressField)}(jQuery),function(n){var t=n.alpaca;t.Fields.CKEditorField=t.Fields.TextAreaField.extend({getFieldType:function(){return"ckeditor"},constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},setup:function(){this.data||(this.data="");this.base();typeof this.options.ckeditor=="undefined"&&(this.options.ckeditor={});typeof this.options.configset=="undefined"&&(this.options.configset="")},afterRenderControl:function(t,i){var r=this;this.base(t,function(){var t,u;if(!r.isDisplayOnly()&&r.control&&typeof CKEDITOR!="undefined"){t={toolbar:[{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"styles",items:["Styles","Format"]},{name:"paragraph",groups:["list","indent","blocks","align"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock",]},{name:"links",items:["Link","Unlink"]},{name:"document",groups:["mode","document","doctools"],items:["Source"]},],format_tags:"p;h1;h2;h3;pre",removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]};r.options.configset=="basic"?t={toolbar:[{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"styles",items:["Styles","Format"]},{name:"paragraph",groups:["list","indent","blocks","align"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock",]},{name:"links",items:["Link","Unlink"]},{name:"document",groups:["mode","document","doctools"],items:["Maximize","Source"]},],format_tags:"p;h1;h2;h3;pre",removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath,link",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]}:r.options.configset=="standard"?t={toolbar:[{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"styles",items:["Styles","Format"]},{name:"paragraph",groups:["list","indent","blocks","align"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock",]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"insert",items:["Table","Smiley","SpecialChar","Iframe"]},{name:"document",groups:["mode","document","doctools"],items:["Maximize","ShowBlocks","Source"]}],format_tags:"p;h1;h2;h3;pre;div",extraAllowedContent:"table tr th td caption[*](*);div span(*);",removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath,link",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]}:r.options.configset=="full"&&(t={toolbar:[{name:"clipboard",items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"editing",items:["Find","Replace","-","SelectAll","-","SpellChecker","Scayt"]},{name:"insert",items:["EasyImageUpload","Table","HorizontalRule","Smiley","SpecialChar","PageBreak","Iframe"]},"/",{name:"basicstyles",items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","CreateDiv","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","-","BidiLtr","BidiRtl"]},{name:"links",items:["Link","Unlink","Anchor"]},"/",{name:"styles",items:["Styles","Format","Font","FontSize"]},{name:"colors",items:["TextColor","BGColor"]},{name:"tools",items:["Maximize","ShowBlocks","-","About","-","Source"]}],format_tags:"p;h1;h2;h3;pre;div",allowedContentRules:!0,removeDialogTabs:"image:advanced;link:advanced",removePlugins:"elementspath,link,image",extraPlugins:"dnnpages",height:150,customConfig:"",stylesSet:[]});u=n.extend({},t,r.options.ckeditor);r.on("ready",function(){r.editor||(r.sf&&(u.cloudServices_uploadUrl=r.sf.getServiceRoot("OpenContent")+"FileUpload/UploadEasyImage",u.cloudServices_tokenUrl=r.sf.getServiceRoot("OpenContent")+"FileUpload/EasyImageToken"),r.editor=CKEDITOR.replace(n(r.control)[0],u),r.initCKEditorEvents())})}n(r.control).bind("destroyed",function(){if(r.editor){r.editor.removeAllListeners();try{r.editor.destroy(!1)}catch(n){}r.editor=null}});i()})},initCKEditorEvents:function(){var n=this;if(n.editor){n.editor.on("click",function(t){n.onClick.call(n,t);n.trigger("click",t)});n.editor.on("change",function(t){n.onChange();n.triggerWithPropagation("change",t)});n.editor.on("blur",function(t){n.onBlur();n.trigger("blur",t)});n.editor.on("focus",function(t){n.onFocus.call(n,t);n.trigger("focus",t)});n.editor.on("key",function(t){n.onKeyPress.call(n,t);n.trigger("keypress",t)});n.editor.on("fileUploadRequest",function(t){n.sf.setModuleHeaders(t.data.fileLoader.xhr)})}},setValue:function(n){var t=this;this.base(n);t.editor&&t.editor.setData(n)},getControlValue:function(){var n=this,t=null;return n.editor&&(t=n.editor.getData()),t},destroy:function(){var n=this;n.editor&&(n.editor.destroy(),n.editor=null);this.base()},getTitle:function(){return"CK Editor"},getDescription:function(){return"Provides an instance of a CK Editor control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{ckeditor:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{ckeditor:{type:"any"}}})}});t.registerFieldClass("ckeditor",t.Fields.CKEditorField)}(jQuery),function(n){var t=n.alpaca;t.Fields.CheckBoxField=t.ControlField.extend({getFieldType:function(){return"checkbox"},setup:function(){var i=this,r;i.base();typeof i.options.multiple=="undefined"&&(i.schema.type==="array"?i.options.multiple=!0:typeof i.schema["enum"]!="undefined"&&(i.options.multiple=!0));i.options.multiple?(i.checkboxOptions=[],i.getEnum()&&(i.sortEnum(),r=i.getOptionLabels(),n.each(i.getEnum(),function(n,u){var f=u;r&&(t.isEmpty(r[n])?t.isEmpty(r[u])||(f=r[u]):f=r[n]);i.checkboxOptions.push({value:u,text:f})})),i.options.datasource&&!i.options.dataSource&&(i.options.dataSource=i.options.datasource,delete i.options.datasource),typeof i.options.useDataSourceAsEnum=="undefined"&&(i.options.useDataSourceAsEnum=!0)):this.options.rightLabel||(this.options.rightLabel="")},prepareControlModel:function(n){var t=this;this.base(function(i){t.checkboxOptions&&(i.checkboxOptions=t.checkboxOptions);n(i)})},getEnum:function(){var n=this.base();return n||this.schema&&this.schema.items&&this.schema.items.enum&&(n=this.schema.items.enum),n},getOptionLabels:function(){var n=this.base();return n||this.options&&this.options.items&&this.options.items.optionLabels&&(n=this.options.items.optionLabels),n},onClick:function(){this.refreshValidationState()},beforeRenderControl:function(n,t){var i=this;this.base(n,function(){i.options.dataSource?(i.options.multiple=!0,i.checkboxOptions||(n.checkboxOptions=i.checkboxOptions=[]),i.checkboxOptions.length=0,i.invokeDataSource(i.checkboxOptions,n,function(){var r,u,n;if(i.options.useDataSourceAsEnum){for(r=[],u=[],n=0;n0?t.checked(n(e[0])):!1;return r},isEmpty:function(){var n=this,i=this.getControlValue();if(n.options.multiple){if(n.schema.type==="array")return i.length==0;if(n.schema.type==="string")return t.isEmpty(i)}else return!i},setValue:function(i){var r=this,f=function(i){t.isString(i)&&(i=i==="true");var u=n(r.getFieldEl()).find("input");u.length>0&&t.checked(n(u[0]),i)},e=function(u){var f,e,o;for(typeof u=="string"&&(u=u.split(",")),f=0;f0&&t.checked(n(o[0]),i)},u=!1;r.options.multiple?typeof i=="string"?(e(i),u=!0):t.isArray(i)&&(e(i),u=!0):typeof i=="boolean"?(f(i),u=!0):typeof i=="string"&&(f(i),u=!0);!u&&i&&t.logError("CheckboxField cannot set value for schema.type="+r.schema.type+" and value="+i);this.base(i)},_validateEnum:function(){var i=this,n;return i.options.multiple?(n=i.getValue(),!i.isRequired()&&t.isValEmpty(n))?!0:(typeof n=="string"&&(n=n.split(",")),t.anyEquality(n,i.getEnum())):!0},disable:function(){n(this.control).find("input").each(function(){n(this).disabled=!0;n(this).prop("disabled",!0)})},enable:function(){n(this.control).find("input").each(function(){n(this).disabled=!1;n(this).prop("disabled",!1)})},getType:function(){return"boolean"},getTitle:function(){return"Checkbox Field"},getDescription:function(){return"Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rightLabel:{title:"Option Label",description:"Optional right-hand side label for single checkbox field.",type:"string"},multiple:{title:"Multiple",description:"Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)",type:"boolean"},dataSource:{title:"Option DataSource",description:"Data source for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.",type:"string"},useDataSourceAsEnum:{title:"Use Data Source as Enumerated Values",description:"Whether to constrain the field's schema enum property to the values that come back from the data source.",type:"boolean","default":!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rightLabel:{type:"text"},multiple:{type:"checkbox"},dataSource:{type:"text"}}})}});t.registerFieldClass("checkbox",t.Fields.CheckBoxField);t.registerDefaultSchemaFieldMapping("boolean","checkbox")}(jQuery),function(n){var t=n.alpaca;t.Fields.DateField=t.Fields.TextField.extend({getFieldType:function(){return"date"},getDefaultFormat:function(){return"MM/DD/YYYY"},getDefaultExtraFormats:function(){return[]},setup:function(){var n=this,t;this.base();n.options.picker||(n.options.picker={});typeof n.options.picker.useCurrent=="undefined"&&(n.options.picker.useCurrent=!1);!n.options.dateFormat;n.options.picker.format||(n.options.picker.format=n.options.dateFormat);n.options.picker.extraFormats||(t=n.getDefaultExtraFormats(),t&&(n.options.picker.extraFormats=t));typeof n.options.manualEntry=="undefined"&&(n.options.manualEntry=!1);typeof n.options.icon=="undefined"&&(n.options.icon=!1)},onKeyPress:function(n){if(this.options.manualEntry)n.preventDefault(),n.stopImmediatePropagation();else{this.base(n);return}},onKeyDown:function(n){if(this.options.manualEntry)n.preventDefault(),n.stopImmediatePropagation();else{this.base(n);return}},beforeRenderControl:function(n,t){this.field.css("position","relative");t()},afterRenderControl:function(t,i){var r=this;this.base(t,function(){if(r.view.type!=="display"){if(t=r.getControlEl(),r.options.icon){r.getControlEl().wrap('
    <\/div>');r.getControlEl().after('<\/span><\/span>');var t=r.getControlEl().parent()}if(n.fn.datetimepicker){t.datetimepicker(r.options.picker);r.picker=t.data("DateTimePicker");t.on("dp.change",function(n){setTimeout(function(){r.onChange.call(r,n);r.triggerWithPropagation("change",n)},250)});r.data&&r.picker.date(r.data)}}i()})},getDate:function(){var n=this,t=null;try{t=n.picker?n.picker.date()?n.picker.date()._d:null:new Date(this.getValue())}catch(i){console.error(i)}return t},date:function(){return this.getDate()},onChange:function(){this.base();this.refreshValidationState()},isAutoFocusable:function(){return!1},handleValidate:function(){var r=this.base(),n=this.validation,i=this._validateDateFormat();return n.invalidDate={message:i?"":t.substituteTokens(this.getMessage("invalidDate"),[this.options.dateFormat]),status:i},r&&n.invalidDate.status},_validateDateFormat:function(){var n=this,r=!0,u,i,t;if(n.options.dateFormat&&(u=n.getValue(),u||n.isRequired())){if(i=[],i.push(n.options.dateFormat),n.options.picker&&n.options.picker.extraFormats)for(t=0;tBootstrap DateTime Picker<\/a>.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{dateFormat:{type:"text"},picker:{type:"any"}}})}});t.registerMessages({invalidDate:"Invalid date for format {0}"});t.registerFieldClass("date",t.Fields.DateField);t.registerDefaultFormatFieldMapping("date","date")}(jQuery),function(n){var t=n.alpaca;t.Fields.CheckBoxField=t.ControlField.extend({getFieldType:function(){return"checkbox"},setup:function(){var i=this,r;i.base();typeof i.options.multiple=="undefined"&&(i.schema.type==="array"?i.options.multiple=!0:typeof i.schema["enum"]!="undefined"&&(i.options.multiple=!0));i.options.multiple?(i.checkboxOptions=[],i.getEnum()&&(i.sortEnum(),r=i.getOptionLabels(),n.each(i.getEnum(),function(n,u){var f=u;r&&(t.isEmpty(r[n])?t.isEmpty(r[u])||(f=r[u]):f=r[n]);i.checkboxOptions.push({value:u,text:f})})),i.options.datasource&&!i.options.dataSource&&(i.options.dataSource=i.options.datasource,delete i.options.datasource),typeof i.options.useDataSourceAsEnum=="undefined"&&(i.options.useDataSourceAsEnum=!0)):this.options.rightLabel||(this.options.rightLabel="")},prepareControlModel:function(n){var t=this;this.base(function(i){t.checkboxOptions&&(i.checkboxOptions=t.checkboxOptions);n(i)})},getEnum:function(){var n=this.base();return n||this.schema&&this.schema.items&&this.schema.items.enum&&(n=this.schema.items.enum),n},getOptionLabels:function(){var n=this.base();return n||this.options&&this.options.items&&this.options.items.optionLabels&&(n=this.options.items.optionLabels),n},onClick:function(){this.refreshValidationState()},beforeRenderControl:function(n,t){var i=this;this.base(n,function(){i.options.dataSource?(i.options.multiple=!0,i.checkboxOptions||(n.checkboxOptions=i.checkboxOptions=[]),i.checkboxOptions.length=0,i.invokeDataSource(i.checkboxOptions,n,function(){var r,u,n;if(i.options.useDataSourceAsEnum){for(r=[],u=[],n=0;n0?t.checked(n(e[0])):!1;return r},isEmpty:function(){var n=this,i=this.getControlValue();if(n.options.multiple){if(n.schema.type==="array")return i.length==0;if(n.schema.type==="string")return t.isEmpty(i)}else return!i},setValue:function(i){var r=this,f=function(i){t.isString(i)&&(i=i==="true");var u=n(r.getFieldEl()).find("input");u.length>0&&t.checked(n(u[0]),i)},e=function(u){var f,e,o;for(typeof u=="string"&&(u=u.split(",")),f=0;f0&&t.checked(n(o[0]),i)},u=!1;r.options.multiple?typeof i=="string"?(e(i),u=!0):t.isArray(i)&&(e(i),u=!0):typeof i=="boolean"?(f(i),u=!0):typeof i=="string"&&(f(i),u=!0);!u&&i&&t.logError("CheckboxField cannot set value for schema.type="+r.schema.type+" and value="+i);this.base(i)},_validateEnum:function(){var i=this,n;return i.options.multiple?(n=i.getValue(),!i.isRequired()&&t.isValEmpty(n))?!0:(typeof n=="string"&&(n=n.split(",")),t.anyEquality(n,i.getEnum())):!0},disable:function(){n(this.control).find("input").each(function(){n(this).disabled=!0;n(this).prop("disabled",!0)})},enable:function(){n(this.control).find("input").each(function(){n(this).disabled=!1;n(this).prop("disabled",!1)})},getType:function(){return"boolean"},getTitle:function(){return"Checkbox Field"},getDescription:function(){return"Checkbox Field for boolean (true/false), string ('true', 'false' or comma-delimited string of values) or data array."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rightLabel:{title:"Option Label",description:"Optional right-hand side label for single checkbox field.",type:"string"},multiple:{title:"Multiple",description:"Whether to render multiple checkboxes for multi-valued type (such as an array or a comma-delimited string)",type:"boolean"},dataSource:{title:"Option DataSource",description:"Data source for generating list of options. This can be a string or a function. If a string, it is considered to be a URI to a service that produces a object containing key/value pairs or an array of elements of structure {'text': '', 'value': ''}. This can also be a function that is called to produce the same list.",type:"string"},useDataSourceAsEnum:{title:"Use Data Source as Enumerated Values",description:"Whether to constrain the field's schema enum property to the values that come back from the data source.",type:"boolean","default":!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rightLabel:{type:"text"},multiple:{type:"checkbox"},dataSource:{type:"text"}}})}});t.registerFieldClass("checkbox",t.Fields.CheckBoxField);t.registerDefaultSchemaFieldMapping("boolean","checkbox")}(jQuery),function(n){var t=n.alpaca;t.Fields.MultiUploadField=t.Fields.ArrayField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.itemsCount=0},setup:function(){var t,n;if(this.base(),this.options.uploadfolder||(this.options.uploadfolder=""),this.urlfield="",this.options&&this.options.items&&(this.options.items.fields||this.options.items.type)&&this.options.items.type!="image"&&this.options.items.fields)for(t in this.options.items.fields)if(n=this.options.items.fields[t],n.type=="image"||n.type=="mlimage"||n.type=="imagecrop"){this.urlfield=t;this.options.uploadfolder=n.uploadfolder;break}else if(n.type=="file"||n.type=="mlfile"){this.urlfield=t;this.options.uploadfolder=n.uploadfolder;break}else if(n.type=="image2"||n.type=="mlimage2"){this.urlfield=t;this.options.uploadfolder=n.folder;break}else if(n.type=="file2"||n.type=="mlfile2"){this.urlfield=t;this.options.uploadfolder=n.folder;break}},afterRenderContainer:function(t,i){var r=this;this.base(t,function(){var t=r.getContainerEl(),f,u;r.isDisplayOnly()||(n('
    <\/div>').prependTo(t),f=n('
    <\/div><\/div>').prependTo(t),u=n('').prependTo(t),this.wrapper=n("<\/span>"),this.wrapper.text("Upload muliple files"),u.wrap(this.wrapper),r.sf&&u.fileupload({dataType:"json",url:r.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:r.options.uploadfolder},beforeSend:r.sf.setModuleHeaders,change:function(){r.itemsCount=r.children.length},add:function(n,t){t.submit()},progressall:function(t,i){var r=parseInt(i.loaded/i.total*100,10);n(".bar",f).css("width",r+"%").find("span").html(r+"%")},done:function(t,i){i.result&&n.each(i.result,function(n,t){r.handleActionBarAddItemClick(r.itemsCount-1,function(n){var i=n.getValue();r.urlfield==""?i=t.url:i[r.urlfield]=t.url;n.setValue(i)});r.itemsCount++})}}).data("loaded",!0));i()})},getTitle:function(){return"Multi Upload"},getDescription:function(){return"Multi Upload for images and files"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t.registerFieldClass("multiupload",t.Fields.MultiUploadField)}(jQuery),function(n){var t=n.alpaca;t.Fields.DocumentsField=t.Fields.MultiUploadField.extend({setup:function(){this.base();this.schema.items={type:"object",properties:{Title:{title:"Title",type:"string"},File:{title:"File",type:"string"}}};t.merge(this.options.items,{fields:{File:{type:"file"}}});this.urlfield="File"},getTitle:function(){return"Gallery"},getDescription:function(){return"Image Gallery"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t.registerFieldClass("documents",t.Fields.DocumentsField)}(jQuery),function(n){var t=n.alpaca;t.Fields.File2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"file2"},setup:function(){var n=this,t;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.options.filter||(this.options.filter="");this.options.showUrlUpload||(this.options.showUrlUpload=!1);this.options.showFileUpload||(this.options.showFileUpload=!1);this.options.showUrlUpload&&(this.options.buttons={downloadButton:{value:"Upload External File",click:function(){this.DownLoadFile()}}});n=this;this.options.lazyLoading&&(t=10,this.options.select2={ajax:{url:this.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FilesLookup",beforeSend:this.sf.setModuleHeaders,type:"get",dataType:"json",delay:250,data:function(i){return{q:i.term?i.term:"*",d:n.options.folder,filter:n.options.filter,pageIndex:i.page?i.page:1,pageSize:t}},processResults:function(i,r){return r.page=r.page||1,r.page==1&&i.items.unshift({id:"",text:n.options.noneLabel}),{results:i.items,pagination:{more:r.page*t0){if(i=n(this.control).find("select").val(),typeof i=="undefined")i=this.data;else if(t.isArray(i))for(r=0;r0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(t.loading)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n("select",u.getControlEl()).select2(i)}u.options.uploadhidden?n(u.getControlEl()).find("input[type=file]").hide():u.sf&&n(u.getControlEl()).find("input[type=file]").fileupload({dataType:"json",url:u.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:u.options.folder},beforeSend:u.sf.setModuleHeaders,add:function(n,t){if(t&&t.files&&t.files.length>0)if(u.isFilter(t.files[0].name))t.submit();else{alert("file not in filter");return}},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(t,i){$select=n(u.control).find("select");u.options.lazyLoading?u.getFileUrl(i.id,function(n){$select.find("option").first().val(n.id).text(n.text).removeData();$select.val(i.id).change()}):u.refresh(function(){$select=n(u.control).find("select");$select.val(i.id).change()})})}}).data("loaded",!0);r()})},getFileUrl:function(t,i){var r=this,u;r.sf&&(u={fileid:t,folder:r.options.folder},n.ajax({url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileInfo",beforeSend:r.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:u,success:function(n){i&&i(n)},error:function(){alert("Error getFileUrl "+t)}}))},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(){}),r):!0:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTextControlEl:function(){var t=this;return n(t.getControlEl()).find("input[type=text]")},DownLoadFile:function(){var t=this,u=this.getTextControlEl(),i=u.val(),r;if(!i||!t.isURL(i)){alert("url not valid");return}if(!t.isFilter(i)){alert("url not in filter");return}r={url:i,uploadfolder:t.options.folder};n(t.getControlEl()).css("cursor","wait");n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/DownloadFile",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(r),beforeSend:t.sf.setModuleHeaders}).done(function(i){i.error?alert(i.error):($select=n(t.control).find("select"),t.options.lazyLoading?t.getFileUrl(i.id,function(n){$select.find("option").first().val(n.id).text(n.text).removeData();$select.val(i.id).change()}):t.refresh(function(){$select=n(t.control).find("select");$select.val(i.id).change()}));setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")})},isURL:function(n){var t=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i");return n.length<2083&&t.test(n)},isFilter:function(n){if(this.options.filter){var t=new RegExp(this.options.filter,"i");return n.length<2083&&t.test(n)}return!0},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("file2",t.Fields.File2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.FileField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"file"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.downloadButton||(this.options.downloadButton=!1);this.options.downloadButton&&(this.options.buttons={downloadButton:{value:"Download",click:function(){this.DownLoadFile()}}});this.base()},getTitle:function(){return"File Field"},getDescription:function(){return"File Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(n){var i=this.getTextControlEl();i&&i.length>0&&(t.isEmpty(n)?i.val(""):i.val(n));this.updateMaxLengthIndicator()},getValue:function(){var t=null,n=this.getTextControlEl();return n&&n.length>0&&(t=n.val()),t},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getTextControlEl();i.sf&&n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,u){u.result&&n.each(u.result,function(t,u){i.setValue(u.url);n(r).change()})}}).data("loaded",!0);t()},applyTypeAhead:function(){var r=this,o,i,s,f,e,h,c,l,u;if(r.control.typeahead&&r.options.typeahead&&!t.isEmpty(r.options.typeahead)&&r.sf){if(o=r.options.typeahead.config,o||(o={}),i=i={},i.name||(i.name=r.getId()),s=r.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Files?q=%QUERY&d="+s,ajax:{beforeSend:r.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"{{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));u=this.getTextControlEl();n(u).typeahead(o,i);n(u).on("typeahead:autocompleted",function(t,i){r.setValue(i.value);n(u).change()});n(u).on("typeahead:selected",function(t,i){r.setValue(i.value);n(u).change()});if(f){if(f.autocompleted)n(u).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(u).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(u).change(function(){var t=n(this).val(),i=n(u).typeahead("val");i!==t&&n(u).typeahead("val",t)});n(r.field).find("span.twitter-typeahead").first().css("display","block");n(r.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}},DownLoadFile:function(){var t=this,u=this.getTextControlEl(),i=t.getValue(),f=new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|(www‌​.)?){1}([0-9A-Za-z-‌​\\.@:%_+~#=]+)+((\\‌​.[a-zA-Z]{2,3})+)(/(‌​.)*)?(\\?(.)*)?"),r;if(!i||!t.isURL(i)){alert("url not valid");return}r={url:i,uploadfolder:t.options.uploadfolder};n(t.getControlEl()).css("cursor","wait");n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/DownloadFile",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(r),beforeSend:t.sf.setModuleHeaders}).done(function(i){i.error?alert(i.error):(t.setValue(i.url),n(u).change());setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")})},isURL:function(n){var t=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i");return n.length<2083&&t.test(n)}});t.registerFieldClass("file",t.Fields.FileField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Folder2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.options.filter||(this.options.filter="");this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},getFileUrl:function(t){var i={fileid:t};n.ajax({url:self.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:self.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:i,success:function(n){return n},error:function(){return""}})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("folder2",t.Fields.Folder2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.GalleryField=t.Fields.MultiUploadField.extend({setup:function(){this.base();this.schema.items={type:"object",properties:{Image:{title:"Image",type:"string"}}};t.merge(this.options.items,{fields:{Image:{type:"image"}}});this.urlfield="Image"},getTitle:function(){return"Gallery"},getDescription:function(){return"Image Gallery"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{validateAddress:{title:"Address Validation",description:"Enable address validation if true",type:"boolean","default":!0},showMapOnLoad:{title:"Whether to show the map when first loaded",type:"boolean"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{validateAddress:{helper:"Address validation if checked",rightLabel:"Enable Google Map for address validation?",type:"checkbox"}}})}});t.registerFieldClass("gallery",t.Fields.GalleryField)}(jQuery),function(n){var t=n.alpaca;t.Fields.GuidField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f)},setup:function(){var n=this;this.base()},setValue:function(n){t.isEmpty(n)&&(n=this.createGuid());this.base(n)},getValue:function(){var n=this.base();return(t.isEmpty(n)||n=="")&&(n=this.createGuid()),n},createGuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n==="x"?t:t&3|8;return i.toString(16)})},getTitle:function(){return"Guid Field"},getDescription:function(){return"Guid field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("guid",t.Fields.GuidField)}(jQuery),function(n){var t=n.alpaca;t.Fields.IconField=t.Fields.TextField.extend({setup:function(){this.options.glyphicons===undefined&&(this.options.glyphicons=!1);this.options.bootstrap===undefined&&(this.options.bootstrap=!1);this.options.fontawesome===undefined&&(this.options.fontawesome=!0);this.base()},setValue:function(n){this.base(n);this.loadIcons()},getTitle:function(){return"Icon Field"},getDescription:function(){return"Font Icon Field."},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(n){var t=this,i=this.control;this.control.fontIconPicker({emptyIcon:!0,hasSearch:!0});this.loadIcons();n()},loadIcons:function(){var o=this,t=[],e;if(this.options.bootstrap&&n.each(i,function(n,i){t.push("glyphicon "+i)}),this.options.fontawesome)for(e in r)t.push("fa "+e);this.options.glyphicons&&(n.each(u,function(n,i){t.push("glyphicons "+i)}),n.each(f,function(n,i){t.push("social "+i)}));this.control.fontIconPicker().setIcons(t)}});t.registerFieldClass("icon",t.Fields.IconField);var i=["glyphicon-glass","glyphicon-music","glyphicon-search","glyphicon-envelope","glyphicon-heart","glyphicon-star","glyphicon-star-empty","glyphicon-user","glyphicon-film","glyphicon-th-large","glyphicon-th","glyphicon-th-list","glyphicon-ok","glyphicon-remove","glyphicon-zoom-in","glyphicon-zoom-out","glyphicon-off","glyphicon-signal","glyphicon-cog","glyphicon-trash","glyphicon-home","glyphicon-file","glyphicon-time","glyphicon-road","glyphicon-download-alt","glyphicon-download","glyphicon-upload","glyphicon-inbox","glyphicon-play-circle","glyphicon-repeat","glyphicon-refresh","glyphicon-list-alt","glyphicon-lock","glyphicon-flag","glyphicon-headphones","glyphicon-volume-off","glyphicon-volume-down","glyphicon-volume-up","glyphicon-qrcode","glyphicon-barcode","glyphicon-tag","glyphicon-tags","glyphicon-book","glyphicon-bookmark","glyphicon-print","glyphicon-camera","glyphicon-font","glyphicon-bold","glyphicon-italic","glyphicon-text-height","glyphicon-text-width","glyphicon-align-left","glyphicon-align-center","glyphicon-align-right","glyphicon-align-justify","glyphicon-list","glyphicon-indent-left","glyphicon-indent-right","glyphicon-facetime-video","glyphicon-picture","glyphicon-pencil","glyphicon-map-marker","glyphicon-adjust","glyphicon-tint","glyphicon-edit","glyphicon-share","glyphicon-check","glyphicon-move","glyphicon-step-backward","glyphicon-fast-backward","glyphicon-backward","glyphicon-play","glyphicon-pause","glyphicon-stop","glyphicon-forward","glyphicon-fast-forward","glyphicon-step-forward","glyphicon-eject","glyphicon-chevron-left","glyphicon-chevron-right","glyphicon-plus-sign","glyphicon-minus-sign","glyphicon-remove-sign","glyphicon-ok-sign","glyphicon-question-sign","glyphicon-info-sign","glyphicon-screenshot","glyphicon-remove-circle","glyphicon-ok-circle","glyphicon-ban-circle","glyphicon-arrow-left","glyphicon-arrow-right","glyphicon-arrow-up","glyphicon-arrow-down","glyphicon-share-alt","glyphicon-resize-full","glyphicon-resize-small","glyphicon-plus","glyphicon-minus","glyphicon-asterisk","glyphicon-exclamation-sign","glyphicon-gift","glyphicon-leaf","glyphicon-fire","glyphicon-eye-open","glyphicon-eye-close","glyphicon-warning-sign","glyphicon-plane","glyphicon-calendar","glyphicon-random","glyphicon-comment","glyphicon-magnet","glyphicon-chevron-up","glyphicon-chevron-down","glyphicon-retweet","glyphicon-shopping-cart","glyphicon-folder-close","glyphicon-folder-open","glyphicon-resize-vertical","glyphicon-resize-horizontal","glyphicon-hdd","glyphicon-bullhorn","glyphicon-bell","glyphicon-certificate","glyphicon-thumbs-up","glyphicon-thumbs-down","glyphicon-hand-right","glyphicon-hand-left","glyphicon-hand-up","glyphicon-hand-down","glyphicon-circle-arrow-right","glyphicon-circle-arrow-left","glyphicon-circle-arrow-up","glyphicon-circle-arrow-down","glyphicon-globe","glyphicon-wrench","glyphicon-tasks","glyphicon-filter","glyphicon-briefcase","glyphicon-fullscreen","glyphicon-dashboard","glyphicon-paperclip","glyphicon-heart-empty","glyphicon-link","glyphicon-phone","glyphicon-pushpin","glyphicon-euro","glyphicon-usd","glyphicon-gbp","glyphicon-sort","glyphicon-sort-by-alphabet","glyphicon-sort-by-alphabet-alt","glyphicon-sort-by-order","glyphicon-sort-by-order-alt","glyphicon-sort-by-attributes","glyphicon-sort-by-attributes-alt","glyphicon-unchecked","glyphicon-expand","glyphicon-collapse","glyphicon-collapse-top"],r={"fa-500px":{unicode:"\\f26e",name:"500px"},"fa-address-book":{unicode:"\\f2b9",name:"Address book"},"fa-address-book-o":{unicode:"\\f2ba",name:"Address book o"},"fa-address-card":{unicode:"\\f2bb",name:"Address card"},"fa-address-card-o":{unicode:"\\f2bc",name:"Address card o"},"fa-adjust":{unicode:"\\f042",name:"Adjust"},"fa-adn":{unicode:"\\f170",name:"Adn"},"fa-align-center":{unicode:"\\f037",name:"Align center"},"fa-align-justify":{unicode:"\\f039",name:"Align justify"},"fa-align-left":{unicode:"\\f036",name:"Align left"},"fa-align-right":{unicode:"\\f038",name:"Align right"},"fa-amazon":{unicode:"\\f270",name:"Amazon"},"fa-ambulance":{unicode:"\\f0f9",name:"Ambulance"},"fa-american-sign-language-interpreting":{unicode:"\\f2a3",name:"American sign language interpreting"},"fa-anchor":{unicode:"\\f13d",name:"Anchor"},"fa-android":{unicode:"\\f17b",name:"Android"},"fa-angellist":{unicode:"\\f209",name:"Angellist"},"fa-angle-double-down":{unicode:"\\f103",name:"Angle double down"},"fa-angle-double-left":{unicode:"\\f100",name:"Angle double left"},"fa-angle-double-right":{unicode:"\\f101",name:"Angle double right"},"fa-angle-double-up":{unicode:"\\f102",name:"Angle double up"},"fa-angle-down":{unicode:"\\f107",name:"Angle down"},"fa-angle-left":{unicode:"\\f104",name:"Angle left"},"fa-angle-right":{unicode:"\\f105",name:"Angle right"},"fa-angle-up":{unicode:"\\f106",name:"Angle up"},"fa-apple":{unicode:"\\f179",name:"Apple"},"fa-archive":{unicode:"\\f187",name:"Archive"},"fa-area-chart":{unicode:"\\f1fe",name:"Area chart"},"fa-arrow-circle-down":{unicode:"\\f0ab",name:"Arrow circle down"},"fa-arrow-circle-left":{unicode:"\\f0a8",name:"Arrow circle left"},"fa-arrow-circle-o-down":{unicode:"\\f01a",name:"Arrow circle o down"},"fa-arrow-circle-o-left":{unicode:"\\f190",name:"Arrow circle o left"},"fa-arrow-circle-o-right":{unicode:"\\f18e",name:"Arrow circle o right"},"fa-arrow-circle-o-up":{unicode:"\\f01b",name:"Arrow circle o up"},"fa-arrow-circle-right":{unicode:"\\f0a9",name:"Arrow circle right"},"fa-arrow-circle-up":{unicode:"\\f0aa",name:"Arrow circle up"},"fa-arrow-down":{unicode:"\\f063",name:"Arrow down"},"fa-arrow-left":{unicode:"\\f060",name:"Arrow left"},"fa-arrow-right":{unicode:"\\f061",name:"Arrow right"},"fa-arrow-up":{unicode:"\\f062",name:"Arrow up"},"fa-arrows":{unicode:"\\f047",name:"Arrows"},"fa-arrows-alt":{unicode:"\\f0b2",name:"Arrows alt"},"fa-arrows-h":{unicode:"\\f07e",name:"Arrows h"},"fa-arrows-v":{unicode:"\\f07d",name:"Arrows v"},"fa-assistive-listening-systems":{unicode:"\\f2a2",name:"Assistive listening systems"},"fa-asterisk":{unicode:"\\f069",name:"Asterisk"},"fa-at":{unicode:"\\f1fa",name:"At"},"fa-audio-description":{unicode:"\\f29e",name:"Audio description"},"fa-backward":{unicode:"\\f04a",name:"Backward"},"fa-balance-scale":{unicode:"\\f24e",name:"Balance scale"},"fa-ban":{unicode:"\\f05e",name:"Ban"},"fa-bandcamp":{unicode:"\\f2d5",name:"Bandcamp"},"fa-bar-chart":{unicode:"\\f080",name:"Bar chart"},"fa-barcode":{unicode:"\\f02a",name:"Barcode"},"fa-bars":{unicode:"\\f0c9",name:"Bars"},"fa-bath":{unicode:"\\f2cd",name:"Bath"},"fa-battery-empty":{unicode:"\\f244",name:"Battery empty"},"fa-battery-full":{unicode:"\\f240",name:"Battery full"},"fa-battery-half":{unicode:"\\f242",name:"Battery half"},"fa-battery-quarter":{unicode:"\\f243",name:"Battery quarter"},"fa-battery-three-quarters":{unicode:"\\f241",name:"Battery three quarters"},"fa-bed":{unicode:"\\f236",name:"Bed"},"fa-beer":{unicode:"\\f0fc",name:"Beer"},"fa-behance":{unicode:"\\f1b4",name:"Behance"},"fa-behance-square":{unicode:"\\f1b5",name:"Behance square"},"fa-bell":{unicode:"\\f0f3",name:"Bell"},"fa-bell-o":{unicode:"\\f0a2",name:"Bell o"},"fa-bell-slash":{unicode:"\\f1f6",name:"Bell slash"},"fa-bell-slash-o":{unicode:"\\f1f7",name:"Bell slash o"},"fa-bicycle":{unicode:"\\f206",name:"Bicycle"},"fa-binoculars":{unicode:"\\f1e5",name:"Binoculars"},"fa-birthday-cake":{unicode:"\\f1fd",name:"Birthday cake"},"fa-bitbucket":{unicode:"\\f171",name:"Bitbucket"},"fa-bitbucket-square":{unicode:"\\f172",name:"Bitbucket square"},"fa-black-tie":{unicode:"\\f27e",name:"Black tie"},"fa-blind":{unicode:"\\f29d",name:"Blind"},"fa-bluetooth":{unicode:"\\f293",name:"Bluetooth"},"fa-bluetooth-b":{unicode:"\\f294",name:"Bluetooth b"},"fa-bold":{unicode:"\\f032",name:"Bold"},"fa-bolt":{unicode:"\\f0e7",name:"Bolt"},"fa-bomb":{unicode:"\\f1e2",name:"Bomb"},"fa-book":{unicode:"\\f02d",name:"Book"},"fa-bookmark":{unicode:"\\f02e",name:"Bookmark"},"fa-bookmark-o":{unicode:"\\f097",name:"Bookmark o"},"fa-braille":{unicode:"\\f2a1",name:"Braille"},"fa-briefcase":{unicode:"\\f0b1",name:"Briefcase"},"fa-btc":{unicode:"\\f15a",name:"Btc"},"fa-bug":{unicode:"\\f188",name:"Bug"},"fa-building":{unicode:"\\f1ad",name:"Building"},"fa-building-o":{unicode:"\\f0f7",name:"Building o"},"fa-bullhorn":{unicode:"\\f0a1",name:"Bullhorn"},"fa-bullseye":{unicode:"\\f140",name:"Bullseye"},"fa-bus":{unicode:"\\f207",name:"Bus"},"fa-buysellads":{unicode:"\\f20d",name:"Buysellads"},"fa-calculator":{unicode:"\\f1ec",name:"Calculator"},"fa-calendar":{unicode:"\\f073",name:"Calendar"},"fa-calendar-check-o":{unicode:"\\f274",name:"Calendar check o"},"fa-calendar-minus-o":{unicode:"\\f272",name:"Calendar minus o"},"fa-calendar-o":{unicode:"\\f133",name:"Calendar o"},"fa-calendar-plus-o":{unicode:"\\f271",name:"Calendar plus o"},"fa-calendar-times-o":{unicode:"\\f273",name:"Calendar times o"},"fa-camera":{unicode:"\\f030",name:"Camera"},"fa-camera-retro":{unicode:"\\f083",name:"Camera retro"},"fa-car":{unicode:"\\f1b9",name:"Car"},"fa-caret-down":{unicode:"\\f0d7",name:"Caret down"},"fa-caret-left":{unicode:"\\f0d9",name:"Caret left"},"fa-caret-right":{unicode:"\\f0da",name:"Caret right"},"fa-caret-square-o-down":{unicode:"\\f150",name:"Caret square o down"},"fa-caret-square-o-left":{unicode:"\\f191",name:"Caret square o left"},"fa-caret-square-o-right":{unicode:"\\f152",name:"Caret square o right"},"fa-caret-square-o-up":{unicode:"\\f151",name:"Caret square o up"},"fa-caret-up":{unicode:"\\f0d8",name:"Caret up"},"fa-cart-arrow-down":{unicode:"\\f218",name:"Cart arrow down"},"fa-cart-plus":{unicode:"\\f217",name:"Cart plus"},"fa-cc":{unicode:"\\f20a",name:"Cc"},"fa-cc-amex":{unicode:"\\f1f3",name:"Cc amex"},"fa-cc-diners-club":{unicode:"\\f24c",name:"Cc diners club"},"fa-cc-discover":{unicode:"\\f1f2",name:"Cc discover"},"fa-cc-jcb":{unicode:"\\f24b",name:"Cc jcb"},"fa-cc-mastercard":{unicode:"\\f1f1",name:"Cc mastercard"},"fa-cc-paypal":{unicode:"\\f1f4",name:"Cc paypal"},"fa-cc-stripe":{unicode:"\\f1f5",name:"Cc stripe"},"fa-cc-visa":{unicode:"\\f1f0",name:"Cc visa"},"fa-certificate":{unicode:"\\f0a3",name:"Certificate"},"fa-chain-broken":{unicode:"\\f127",name:"Chain broken"},"fa-check":{unicode:"\\f00c",name:"Check"},"fa-check-circle":{unicode:"\\f058",name:"Check circle"},"fa-check-circle-o":{unicode:"\\f05d",name:"Check circle o"},"fa-check-square":{unicode:"\\f14a",name:"Check square"},"fa-check-square-o":{unicode:"\\f046",name:"Check square o"},"fa-chevron-circle-down":{unicode:"\\f13a",name:"Chevron circle down"},"fa-chevron-circle-left":{unicode:"\\f137",name:"Chevron circle left"},"fa-chevron-circle-right":{unicode:"\\f138",name:"Chevron circle right"},"fa-chevron-circle-up":{unicode:"\\f139",name:"Chevron circle up"},"fa-chevron-down":{unicode:"\\f078",name:"Chevron down"},"fa-chevron-left":{unicode:"\\f053",name:"Chevron left"},"fa-chevron-right":{unicode:"\\f054",name:"Chevron right"},"fa-chevron-up":{unicode:"\\f077",name:"Chevron up"},"fa-child":{unicode:"\\f1ae",name:"Child"},"fa-chrome":{unicode:"\\f268",name:"Chrome"},"fa-circle":{unicode:"\\f111",name:"Circle"},"fa-circle-o":{unicode:"\\f10c",name:"Circle o"},"fa-circle-o-notch":{unicode:"\\f1ce",name:"Circle o notch"},"fa-circle-thin":{unicode:"\\f1db",name:"Circle thin"},"fa-clipboard":{unicode:"\\f0ea",name:"Clipboard"},"fa-clock-o":{unicode:"\\f017",name:"Clock o"},"fa-clone":{unicode:"\\f24d",name:"Clone"},"fa-cloud":{unicode:"\\f0c2",name:"Cloud"},"fa-cloud-download":{unicode:"\\f0ed",name:"Cloud download"},"fa-cloud-upload":{unicode:"\\f0ee",name:"Cloud upload"},"fa-code":{unicode:"\\f121",name:"Code"},"fa-code-fork":{unicode:"\\f126",name:"Code fork"},"fa-codepen":{unicode:"\\f1cb",name:"Codepen"},"fa-codiepie":{unicode:"\\f284",name:"Codiepie"},"fa-coffee":{unicode:"\\f0f4",name:"Coffee"},"fa-cog":{unicode:"\\f013",name:"Cog"},"fa-cogs":{unicode:"\\f085",name:"Cogs"},"fa-columns":{unicode:"\\f0db",name:"Columns"},"fa-comment":{unicode:"\\f075",name:"Comment"},"fa-comment-o":{unicode:"\\f0e5",name:"Comment o"},"fa-commenting":{unicode:"\\f27a",name:"Commenting"},"fa-commenting-o":{unicode:"\\f27b",name:"Commenting o"},"fa-comments":{unicode:"\\f086",name:"Comments"},"fa-comments-o":{unicode:"\\f0e6",name:"Comments o"},"fa-compass":{unicode:"\\f14e",name:"Compass"},"fa-compress":{unicode:"\\f066",name:"Compress"},"fa-connectdevelop":{unicode:"\\f20e",name:"Connectdevelop"},"fa-contao":{unicode:"\\f26d",name:"Contao"},"fa-copyright":{unicode:"\\f1f9",name:"Copyright"},"fa-creative-commons":{unicode:"\\f25e",name:"Creative commons"},"fa-credit-card":{unicode:"\\f09d",name:"Credit card"},"fa-credit-card-alt":{unicode:"\\f283",name:"Credit card alt"},"fa-crop":{unicode:"\\f125",name:"Crop"},"fa-crosshairs":{unicode:"\\f05b",name:"Crosshairs"},"fa-css3":{unicode:"\\f13c",name:"Css3"},"fa-cube":{unicode:"\\f1b2",name:"Cube"},"fa-cubes":{unicode:"\\f1b3",name:"Cubes"},"fa-cutlery":{unicode:"\\f0f5",name:"Cutlery"},"fa-dashcube":{unicode:"\\f210",name:"Dashcube"},"fa-database":{unicode:"\\f1c0",name:"Database"},"fa-deaf":{unicode:"\\f2a4",name:"Deaf"},"fa-delicious":{unicode:"\\f1a5",name:"Delicious"},"fa-desktop":{unicode:"\\f108",name:"Desktop"},"fa-deviantart":{unicode:"\\f1bd",name:"Deviantart"},"fa-diamond":{unicode:"\\f219",name:"Diamond"},"fa-digg":{unicode:"\\f1a6",name:"Digg"},"fa-dot-circle-o":{unicode:"\\f192",name:"Dot circle o"},"fa-download":{unicode:"\\f019",name:"Download"},"fa-dribbble":{unicode:"\\f17d",name:"Dribbble"},"fa-dropbox":{unicode:"\\f16b",name:"Dropbox"},"fa-drupal":{unicode:"\\f1a9",name:"Drupal"},"fa-edge":{unicode:"\\f282",name:"Edge"},"fa-eercast":{unicode:"\\f2da",name:"Eercast"},"fa-eject":{unicode:"\\f052",name:"Eject"},"fa-ellipsis-h":{unicode:"\\f141",name:"Ellipsis h"},"fa-ellipsis-v":{unicode:"\\f142",name:"Ellipsis v"},"fa-empire":{unicode:"\\f1d1",name:"Empire"},"fa-envelope":{unicode:"\\f0e0",name:"Envelope"},"fa-envelope-o":{unicode:"\\f003",name:"Envelope o"},"fa-envelope-open":{unicode:"\\f2b6",name:"Envelope open"},"fa-envelope-open-o":{unicode:"\\f2b7",name:"Envelope open o"},"fa-envelope-square":{unicode:"\\f199",name:"Envelope square"},"fa-envira":{unicode:"\\f299",name:"Envira"},"fa-eraser":{unicode:"\\f12d",name:"Eraser"},"fa-etsy":{unicode:"\\f2d7",name:"Etsy"},"fa-eur":{unicode:"\\f153",name:"Eur"},"fa-exchange":{unicode:"\\f0ec",name:"Exchange"},"fa-exclamation":{unicode:"\\f12a",name:"Exclamation"},"fa-exclamation-circle":{unicode:"\\f06a",name:"Exclamation circle"},"fa-exclamation-triangle":{unicode:"\\f071",name:"Exclamation triangle"},"fa-expand":{unicode:"\\f065",name:"Expand"},"fa-expeditedssl":{unicode:"\\f23e",name:"Expeditedssl"},"fa-external-link":{unicode:"\\f08e",name:"External link"},"fa-external-link-square":{unicode:"\\f14c",name:"External link square"},"fa-eye":{unicode:"\\f06e",name:"Eye"},"fa-eye-slash":{unicode:"\\f070",name:"Eye slash"},"fa-eyedropper":{unicode:"\\f1fb",name:"Eyedropper"},"fa-facebook":{unicode:"\\f09a",name:"Facebook"},"fa-facebook-official":{unicode:"\\f230",name:"Facebook official"},"fa-facebook-square":{unicode:"\\f082",name:"Facebook square"},"fa-fast-backward":{unicode:"\\f049",name:"Fast backward"},"fa-fast-forward":{unicode:"\\f050",name:"Fast forward"},"fa-fax":{unicode:"\\f1ac",name:"Fax"},"fa-female":{unicode:"\\f182",name:"Female"},"fa-fighter-jet":{unicode:"\\f0fb",name:"Fighter jet"},"fa-file":{unicode:"\\f15b",name:"File"},"fa-file-archive-o":{unicode:"\\f1c6",name:"File archive o"},"fa-file-audio-o":{unicode:"\\f1c7",name:"File audio o"},"fa-file-code-o":{unicode:"\\f1c9",name:"File code o"},"fa-file-excel-o":{unicode:"\\f1c3",name:"File excel o"},"fa-file-image-o":{unicode:"\\f1c5",name:"File image o"},"fa-file-o":{unicode:"\\f016",name:"File o"},"fa-file-pdf-o":{unicode:"\\f1c1",name:"File pdf o"},"fa-file-powerpoint-o":{unicode:"\\f1c4",name:"File powerpoint o"},"fa-file-text":{unicode:"\\f15c",name:"File text"},"fa-file-text-o":{unicode:"\\f0f6",name:"File text o"},"fa-file-video-o":{unicode:"\\f1c8",name:"File video o"},"fa-file-word-o":{unicode:"\\f1c2",name:"File word o"},"fa-files-o":{unicode:"\\f0c5",name:"Files o"},"fa-film":{unicode:"\\f008",name:"Film"},"fa-filter":{unicode:"\\f0b0",name:"Filter"},"fa-fire":{unicode:"\\f06d",name:"Fire"},"fa-fire-extinguisher":{unicode:"\\f134",name:"Fire extinguisher"},"fa-firefox":{unicode:"\\f269",name:"Firefox"},"fa-first-order":{unicode:"\\f2b0",name:"First order"},"fa-flag":{unicode:"\\f024",name:"Flag"},"fa-flag-checkered":{unicode:"\\f11e",name:"Flag checkered"},"fa-flag-o":{unicode:"\\f11d",name:"Flag o"},"fa-flask":{unicode:"\\f0c3",name:"Flask"},"fa-flickr":{unicode:"\\f16e",name:"Flickr"},"fa-floppy-o":{unicode:"\\f0c7",name:"Floppy o"},"fa-folder":{unicode:"\\f07b",name:"Folder"},"fa-folder-o":{unicode:"\\f114",name:"Folder o"},"fa-folder-open":{unicode:"\\f07c",name:"Folder open"},"fa-folder-open-o":{unicode:"\\f115",name:"Folder open o"},"fa-font":{unicode:"\\f031",name:"Font"},"fa-font-awesome":{unicode:"\\f2b4",name:"Font awesome"},"fa-fonticons":{unicode:"\\f280",name:"Fonticons"},"fa-fort-awesome":{unicode:"\\f286",name:"Fort awesome"},"fa-forumbee":{unicode:"\\f211",name:"Forumbee"},"fa-forward":{unicode:"\\f04e",name:"Forward"},"fa-foursquare":{unicode:"\\f180",name:"Foursquare"},"fa-free-code-camp":{unicode:"\\f2c5",name:"Free code camp"},"fa-frown-o":{unicode:"\\f119",name:"Frown o"},"fa-futbol-o":{unicode:"\\f1e3",name:"Futbol o"},"fa-gamepad":{unicode:"\\f11b",name:"Gamepad"},"fa-gavel":{unicode:"\\f0e3",name:"Gavel"},"fa-gbp":{unicode:"\\f154",name:"Gbp"},"fa-genderless":{unicode:"\\f22d",name:"Genderless"},"fa-get-pocket":{unicode:"\\f265",name:"Get pocket"},"fa-gg":{unicode:"\\f260",name:"Gg"},"fa-gg-circle":{unicode:"\\f261",name:"Gg circle"},"fa-gift":{unicode:"\\f06b",name:"Gift"},"fa-git":{unicode:"\\f1d3",name:"Git"},"fa-git-square":{unicode:"\\f1d2",name:"Git square"},"fa-github":{unicode:"\\f09b",name:"Github"},"fa-github-alt":{unicode:"\\f113",name:"Github alt"},"fa-github-square":{unicode:"\\f092",name:"Github square"},"fa-gitlab":{unicode:"\\f296",name:"Gitlab"},"fa-glass":{unicode:"\\f000",name:"Glass"},"fa-glide":{unicode:"\\f2a5",name:"Glide"},"fa-glide-g":{unicode:"\\f2a6",name:"Glide g"},"fa-globe":{unicode:"\\f0ac",name:"Globe"},"fa-google":{unicode:"\\f1a0",name:"Google"},"fa-google-plus":{unicode:"\\f0d5",name:"Google plus"},"fa-google-plus-official":{unicode:"\\f2b3",name:"Google plus official"},"fa-google-plus-square":{unicode:"\\f0d4",name:"Google plus square"},"fa-google-wallet":{unicode:"\\f1ee",name:"Google wallet"},"fa-graduation-cap":{unicode:"\\f19d",name:"Graduation cap"},"fa-gratipay":{unicode:"\\f184",name:"Gratipay"},"fa-grav":{unicode:"\\f2d6",name:"Grav"},"fa-h-square":{unicode:"\\f0fd",name:"H square"},"fa-hacker-news":{unicode:"\\f1d4",name:"Hacker news"},"fa-hand-lizard-o":{unicode:"\\f258",name:"Hand lizard o"},"fa-hand-o-down":{unicode:"\\f0a7",name:"Hand o down"},"fa-hand-o-left":{unicode:"\\f0a5",name:"Hand o left"},"fa-hand-o-right":{unicode:"\\f0a4",name:"Hand o right"},"fa-hand-o-up":{unicode:"\\f0a6",name:"Hand o up"},"fa-hand-paper-o":{unicode:"\\f256",name:"Hand paper o"},"fa-hand-peace-o":{unicode:"\\f25b",name:"Hand peace o"},"fa-hand-pointer-o":{unicode:"\\f25a",name:"Hand pointer o"},"fa-hand-rock-o":{unicode:"\\f255",name:"Hand rock o"},"fa-hand-scissors-o":{unicode:"\\f257",name:"Hand scissors o"},"fa-hand-spock-o":{unicode:"\\f259",name:"Hand spock o"},"fa-handshake-o":{unicode:"\\f2b5",name:"Handshake o"},"fa-hashtag":{unicode:"\\f292",name:"Hashtag"},"fa-hdd-o":{unicode:"\\f0a0",name:"Hdd o"},"fa-header":{unicode:"\\f1dc",name:"Header"},"fa-headphones":{unicode:"\\f025",name:"Headphones"},"fa-heart":{unicode:"\\f004",name:"Heart"},"fa-heart-o":{unicode:"\\f08a",name:"Heart o"},"fa-heartbeat":{unicode:"\\f21e",name:"Heartbeat"},"fa-history":{unicode:"\\f1da",name:"History"},"fa-home":{unicode:"\\f015",name:"Home"},"fa-hospital-o":{unicode:"\\f0f8",name:"Hospital o"},"fa-hourglass":{unicode:"\\f254",name:"Hourglass"},"fa-hourglass-end":{unicode:"\\f253",name:"Hourglass end"},"fa-hourglass-half":{unicode:"\\f252",name:"Hourglass half"},"fa-hourglass-o":{unicode:"\\f250",name:"Hourglass o"},"fa-hourglass-start":{unicode:"\\f251",name:"Hourglass start"},"fa-houzz":{unicode:"\\f27c",name:"Houzz"},"fa-html5":{unicode:"\\f13b",name:"Html5"},"fa-i-cursor":{unicode:"\\f246",name:"I cursor"},"fa-id-badge":{unicode:"\\f2c1",name:"Id badge"},"fa-id-card":{unicode:"\\f2c2",name:"Id card"},"fa-id-card-o":{unicode:"\\f2c3",name:"Id card o"},"fa-ils":{unicode:"\\f20b",name:"Ils"},"fa-imdb":{unicode:"\\f2d8",name:"Imdb"},"fa-inbox":{unicode:"\\f01c",name:"Inbox"},"fa-indent":{unicode:"\\f03c",name:"Indent"},"fa-industry":{unicode:"\\f275",name:"Industry"},"fa-info":{unicode:"\\f129",name:"Info"},"fa-info-circle":{unicode:"\\f05a",name:"Info circle"},"fa-inr":{unicode:"\\f156",name:"Inr"},"fa-instagram":{unicode:"\\f16d",name:"Instagram"},"fa-internet-explorer":{unicode:"\\f26b",name:"Internet explorer"},"fa-ioxhost":{unicode:"\\f208",name:"Ioxhost"},"fa-italic":{unicode:"\\f033",name:"Italic"},"fa-joomla":{unicode:"\\f1aa",name:"Joomla"},"fa-jpy":{unicode:"\\f157",name:"Jpy"},"fa-jsfiddle":{unicode:"\\f1cc",name:"Jsfiddle"},"fa-key":{unicode:"\\f084",name:"Key"},"fa-keyboard-o":{unicode:"\\f11c",name:"Keyboard o"},"fa-krw":{unicode:"\\f159",name:"Krw"},"fa-language":{unicode:"\\f1ab",name:"Language"},"fa-laptop":{unicode:"\\f109",name:"Laptop"},"fa-lastfm":{unicode:"\\f202",name:"Lastfm"},"fa-lastfm-square":{unicode:"\\f203",name:"Lastfm square"},"fa-leaf":{unicode:"\\f06c",name:"Leaf"},"fa-leanpub":{unicode:"\\f212",name:"Leanpub"},"fa-lemon-o":{unicode:"\\f094",name:"Lemon o"},"fa-level-down":{unicode:"\\f149",name:"Level down"},"fa-level-up":{unicode:"\\f148",name:"Level up"},"fa-life-ring":{unicode:"\\f1cd",name:"Life ring"},"fa-lightbulb-o":{unicode:"\\f0eb",name:"Lightbulb o"},"fa-line-chart":{unicode:"\\f201",name:"Line chart"},"fa-link":{unicode:"\\f0c1",name:"Link"},"fa-linkedin":{unicode:"\\f0e1",name:"Linkedin"},"fa-linkedin-square":{unicode:"\\f08c",name:"Linkedin square"},"fa-linode":{unicode:"\\f2b8",name:"Linode"},"fa-linux":{unicode:"\\f17c",name:"Linux"},"fa-list":{unicode:"\\f03a",name:"List"},"fa-list-alt":{unicode:"\\f022",name:"List alt"},"fa-list-ol":{unicode:"\\f0cb",name:"List ol"},"fa-list-ul":{unicode:"\\f0ca",name:"List ul"},"fa-location-arrow":{unicode:"\\f124",name:"Location arrow"},"fa-lock":{unicode:"\\f023",name:"Lock"},"fa-long-arrow-down":{unicode:"\\f175",name:"Long arrow down"},"fa-long-arrow-left":{unicode:"\\f177",name:"Long arrow left"},"fa-long-arrow-right":{unicode:"\\f178",name:"Long arrow right"},"fa-long-arrow-up":{unicode:"\\f176",name:"Long arrow up"},"fa-low-vision":{unicode:"\\f2a8",name:"Low vision"},"fa-magic":{unicode:"\\f0d0",name:"Magic"},"fa-magnet":{unicode:"\\f076",name:"Magnet"},"fa-male":{unicode:"\\f183",name:"Male"},"fa-map":{unicode:"\\f279",name:"Map"},"fa-map-marker":{unicode:"\\f041",name:"Map marker"},"fa-map-o":{unicode:"\\f278",name:"Map o"},"fa-map-pin":{unicode:"\\f276",name:"Map pin"},"fa-map-signs":{unicode:"\\f277",name:"Map signs"},"fa-mars":{unicode:"\\f222",name:"Mars"},"fa-mars-double":{unicode:"\\f227",name:"Mars double"},"fa-mars-stroke":{unicode:"\\f229",name:"Mars stroke"},"fa-mars-stroke-h":{unicode:"\\f22b",name:"Mars stroke h"},"fa-mars-stroke-v":{unicode:"\\f22a",name:"Mars stroke v"},"fa-maxcdn":{unicode:"\\f136",name:"Maxcdn"},"fa-meanpath":{unicode:"\\f20c",name:"Meanpath"},"fa-medium":{unicode:"\\f23a",name:"Medium"},"fa-medkit":{unicode:"\\f0fa",name:"Medkit"},"fa-meetup":{unicode:"\\f2e0",name:"Meetup"},"fa-meh-o":{unicode:"\\f11a",name:"Meh o"},"fa-mercury":{unicode:"\\f223",name:"Mercury"},"fa-microchip":{unicode:"\\f2db",name:"Microchip"},"fa-microphone":{unicode:"\\f130",name:"Microphone"},"fa-microphone-slash":{unicode:"\\f131",name:"Microphone slash"},"fa-minus":{unicode:"\\f068",name:"Minus"},"fa-minus-circle":{unicode:"\\f056",name:"Minus circle"},"fa-minus-square":{unicode:"\\f146",name:"Minus square"},"fa-minus-square-o":{unicode:"\\f147",name:"Minus square o"},"fa-mixcloud":{unicode:"\\f289",name:"Mixcloud"},"fa-mobile":{unicode:"\\f10b",name:"Mobile"},"fa-modx":{unicode:"\\f285",name:"Modx"},"fa-money":{unicode:"\\f0d6",name:"Money"},"fa-moon-o":{unicode:"\\f186",name:"Moon o"},"fa-motorcycle":{unicode:"\\f21c",name:"Motorcycle"},"fa-mouse-pointer":{unicode:"\\f245",name:"Mouse pointer"},"fa-music":{unicode:"\\f001",name:"Music"},"fa-neuter":{unicode:"\\f22c",name:"Neuter"},"fa-newspaper-o":{unicode:"\\f1ea",name:"Newspaper o"},"fa-object-group":{unicode:"\\f247",name:"Object group"},"fa-object-ungroup":{unicode:"\\f248",name:"Object ungroup"},"fa-odnoklassniki":{unicode:"\\f263",name:"Odnoklassniki"},"fa-odnoklassniki-square":{unicode:"\\f264",name:"Odnoklassniki square"},"fa-opencart":{unicode:"\\f23d",name:"Opencart"},"fa-openid":{unicode:"\\f19b",name:"Openid"},"fa-opera":{unicode:"\\f26a",name:"Opera"},"fa-optin-monster":{unicode:"\\f23c",name:"Optin monster"},"fa-outdent":{unicode:"\\f03b",name:"Outdent"},"fa-pagelines":{unicode:"\\f18c",name:"Pagelines"},"fa-paint-brush":{unicode:"\\f1fc",name:"Paint brush"},"fa-paper-plane":{unicode:"\\f1d8",name:"Paper plane"},"fa-paper-plane-o":{unicode:"\\f1d9",name:"Paper plane o"},"fa-paperclip":{unicode:"\\f0c6",name:"Paperclip"},"fa-paragraph":{unicode:"\\f1dd",name:"Paragraph"},"fa-pause":{unicode:"\\f04c",name:"Pause"},"fa-pause-circle":{unicode:"\\f28b",name:"Pause circle"},"fa-pause-circle-o":{unicode:"\\f28c",name:"Pause circle o"},"fa-paw":{unicode:"\\f1b0",name:"Paw"},"fa-paypal":{unicode:"\\f1ed",name:"Paypal"},"fa-pencil":{unicode:"\\f040",name:"Pencil"},"fa-pencil-square":{unicode:"\\f14b",name:"Pencil square"},"fa-pencil-square-o":{unicode:"\\f044",name:"Pencil square o"},"fa-percent":{unicode:"\\f295",name:"Percent"},"fa-phone":{unicode:"\\f095",name:"Phone"},"fa-phone-square":{unicode:"\\f098",name:"Phone square"},"fa-picture-o":{unicode:"\\f03e",name:"Picture o"},"fa-pie-chart":{unicode:"\\f200",name:"Pie chart"},"fa-pied-piper":{unicode:"\\f2ae",name:"Pied piper"},"fa-pied-piper-alt":{unicode:"\\f1a8",name:"Pied piper alt"},"fa-pied-piper-pp":{unicode:"\\f1a7",name:"Pied piper pp"},"fa-pinterest":{unicode:"\\f0d2",name:"Pinterest"},"fa-pinterest-p":{unicode:"\\f231",name:"Pinterest p"},"fa-pinterest-square":{unicode:"\\f0d3",name:"Pinterest square"},"fa-plane":{unicode:"\\f072",name:"Plane"},"fa-play":{unicode:"\\f04b",name:"Play"},"fa-play-circle":{unicode:"\\f144",name:"Play circle"},"fa-play-circle-o":{unicode:"\\f01d",name:"Play circle o"},"fa-plug":{unicode:"\\f1e6",name:"Plug"},"fa-plus":{unicode:"\\f067",name:"Plus"},"fa-plus-circle":{unicode:"\\f055",name:"Plus circle"},"fa-plus-square":{unicode:"\\f0fe",name:"Plus square"},"fa-plus-square-o":{unicode:"\\f196",name:"Plus square o"},"fa-podcast":{unicode:"\\f2ce",name:"Podcast"},"fa-power-off":{unicode:"\\f011",name:"Power off"},"fa-print":{unicode:"\\f02f",name:"Print"},"fa-product-hunt":{unicode:"\\f288",name:"Product hunt"},"fa-puzzle-piece":{unicode:"\\f12e",name:"Puzzle piece"},"fa-qq":{unicode:"\\f1d6",name:"Qq"},"fa-qrcode":{unicode:"\\f029",name:"Qrcode"},"fa-question":{unicode:"\\f128",name:"Question"},"fa-question-circle":{unicode:"\\f059",name:"Question circle"},"fa-question-circle-o":{unicode:"\\f29c",name:"Question circle o"},"fa-quora":{unicode:"\\f2c4",name:"Quora"},"fa-quote-left":{unicode:"\\f10d",name:"Quote left"},"fa-quote-right":{unicode:"\\f10e",name:"Quote right"},"fa-random":{unicode:"\\f074",name:"Random"},"fa-ravelry":{unicode:"\\f2d9",name:"Ravelry"},"fa-rebel":{unicode:"\\f1d0",name:"Rebel"},"fa-recycle":{unicode:"\\f1b8",name:"Recycle"},"fa-reddit":{unicode:"\\f1a1",name:"Reddit"},"fa-reddit-alien":{unicode:"\\f281",name:"Reddit alien"},"fa-reddit-square":{unicode:"\\f1a2",name:"Reddit square"},"fa-refresh":{unicode:"\\f021",name:"Refresh"},"fa-registered":{unicode:"\\f25d",name:"Registered"},"fa-renren":{unicode:"\\f18b",name:"Renren"},"fa-repeat":{unicode:"\\f01e",name:"Repeat"},"fa-reply":{unicode:"\\f112",name:"Reply"},"fa-reply-all":{unicode:"\\f122",name:"Reply all"},"fa-retweet":{unicode:"\\f079",name:"Retweet"},"fa-road":{unicode:"\\f018",name:"Road"},"fa-rocket":{unicode:"\\f135",name:"Rocket"},"fa-rss":{unicode:"\\f09e",name:"Rss"},"fa-rss-square":{unicode:"\\f143",name:"Rss square"},"fa-rub":{unicode:"\\f158",name:"Rub"},"fa-safari":{unicode:"\\f267",name:"Safari"},"fa-scissors":{unicode:"\\f0c4",name:"Scissors"},"fa-scribd":{unicode:"\\f28a",name:"Scribd"},"fa-search":{unicode:"\\f002",name:"Search"},"fa-search-minus":{unicode:"\\f010",name:"Search minus"},"fa-search-plus":{unicode:"\\f00e",name:"Search plus"},"fa-sellsy":{unicode:"\\f213",name:"Sellsy"},"fa-server":{unicode:"\\f233",name:"Server"},"fa-share":{unicode:"\\f064",name:"Share"},"fa-share-alt":{unicode:"\\f1e0",name:"Share alt"},"fa-share-alt-square":{unicode:"\\f1e1",name:"Share alt square"},"fa-share-square":{unicode:"\\f14d",name:"Share square"},"fa-share-square-o":{unicode:"\\f045",name:"Share square o"},"fa-shield":{unicode:"\\f132",name:"Shield"},"fa-ship":{unicode:"\\f21a",name:"Ship"},"fa-shirtsinbulk":{unicode:"\\f214",name:"Shirtsinbulk"},"fa-shopping-bag":{unicode:"\\f290",name:"Shopping bag"},"fa-shopping-basket":{unicode:"\\f291",name:"Shopping basket"},"fa-shopping-cart":{unicode:"\\f07a",name:"Shopping cart"},"fa-shower":{unicode:"\\f2cc",name:"Shower"},"fa-sign-in":{unicode:"\\f090",name:"Sign in"},"fa-sign-language":{unicode:"\\f2a7",name:"Sign language"},"fa-sign-out":{unicode:"\\f08b",name:"Sign out"},"fa-signal":{unicode:"\\f012",name:"Signal"},"fa-simplybuilt":{unicode:"\\f215",name:"Simplybuilt"},"fa-sitemap":{unicode:"\\f0e8",name:"Sitemap"},"fa-skyatlas":{unicode:"\\f216",name:"Skyatlas"},"fa-skype":{unicode:"\\f17e",name:"Skype"},"fa-slack":{unicode:"\\f198",name:"Slack"},"fa-sliders":{unicode:"\\f1de",name:"Sliders"},"fa-slideshare":{unicode:"\\f1e7",name:"Slideshare"},"fa-smile-o":{unicode:"\\f118",name:"Smile o"},"fa-snapchat":{unicode:"\\f2ab",name:"Snapchat"},"fa-snapchat-ghost":{unicode:"\\f2ac",name:"Snapchat ghost"},"fa-snapchat-square":{unicode:"\\f2ad",name:"Snapchat square"},"fa-snowflake-o":{unicode:"\\f2dc",name:"Snowflake o"},"fa-sort":{unicode:"\\f0dc",name:"Sort"},"fa-sort-alpha-asc":{unicode:"\\f15d",name:"Sort alpha asc"},"fa-sort-alpha-desc":{unicode:"\\f15e",name:"Sort alpha desc"},"fa-sort-amount-asc":{unicode:"\\f160",name:"Sort amount asc"},"fa-sort-amount-desc":{unicode:"\\f161",name:"Sort amount desc"},"fa-sort-asc":{unicode:"\\f0de",name:"Sort asc"},"fa-sort-desc":{unicode:"\\f0dd",name:"Sort desc"},"fa-sort-numeric-asc":{unicode:"\\f162",name:"Sort numeric asc"},"fa-sort-numeric-desc":{unicode:"\\f163",name:"Sort numeric desc"},"fa-soundcloud":{unicode:"\\f1be",name:"Soundcloud"},"fa-space-shuttle":{unicode:"\\f197",name:"Space shuttle"},"fa-spinner":{unicode:"\\f110",name:"Spinner"},"fa-spoon":{unicode:"\\f1b1",name:"Spoon"},"fa-spotify":{unicode:"\\f1bc",name:"Spotify"},"fa-square":{unicode:"\\f0c8",name:"Square"},"fa-square-o":{unicode:"\\f096",name:"Square o"},"fa-stack-exchange":{unicode:"\\f18d",name:"Stack exchange"},"fa-stack-overflow":{unicode:"\\f16c",name:"Stack overflow"},"fa-star":{unicode:"\\f005",name:"Star"},"fa-star-half":{unicode:"\\f089",name:"Star half"},"fa-star-half-o":{unicode:"\\f123",name:"Star half o"},"fa-star-o":{unicode:"\\f006",name:"Star o"},"fa-steam":{unicode:"\\f1b6",name:"Steam"},"fa-steam-square":{unicode:"\\f1b7",name:"Steam square"},"fa-step-backward":{unicode:"\\f048",name:"Step backward"},"fa-step-forward":{unicode:"\\f051",name:"Step forward"},"fa-stethoscope":{unicode:"\\f0f1",name:"Stethoscope"},"fa-sticky-note":{unicode:"\\f249",name:"Sticky note"},"fa-sticky-note-o":{unicode:"\\f24a",name:"Sticky note o"},"fa-stop":{unicode:"\\f04d",name:"Stop"},"fa-stop-circle":{unicode:"\\f28d",name:"Stop circle"},"fa-stop-circle-o":{unicode:"\\f28e",name:"Stop circle o"},"fa-street-view":{unicode:"\\f21d",name:"Street view"},"fa-strikethrough":{unicode:"\\f0cc",name:"Strikethrough"},"fa-stumbleupon":{unicode:"\\f1a4",name:"Stumbleupon"},"fa-stumbleupon-circle":{unicode:"\\f1a3",name:"Stumbleupon circle"},"fa-subscript":{unicode:"\\f12c",name:"Subscript"},"fa-subway":{unicode:"\\f239",name:"Subway"},"fa-suitcase":{unicode:"\\f0f2",name:"Suitcase"},"fa-sun-o":{unicode:"\\f185",name:"Sun o"},"fa-superpowers":{unicode:"\\f2dd",name:"Superpowers"},"fa-superscript":{unicode:"\\f12b",name:"Superscript"},"fa-table":{unicode:"\\f0ce",name:"Table"},"fa-tablet":{unicode:"\\f10a",name:"Tablet"},"fa-tachometer":{unicode:"\\f0e4",name:"Tachometer"},"fa-tag":{unicode:"\\f02b",name:"Tag"},"fa-tags":{unicode:"\\f02c",name:"Tags"},"fa-tasks":{unicode:"\\f0ae",name:"Tasks"},"fa-taxi":{unicode:"\\f1ba",name:"Taxi"},"fa-telegram":{unicode:"\\f2c6",name:"Telegram"},"fa-television":{unicode:"\\f26c",name:"Television"},"fa-tencent-weibo":{unicode:"\\f1d5",name:"Tencent weibo"},"fa-terminal":{unicode:"\\f120",name:"Terminal"},"fa-text-height":{unicode:"\\f034",name:"Text height"},"fa-text-width":{unicode:"\\f035",name:"Text width"},"fa-th":{unicode:"\\f00a",name:"Th"},"fa-th-large":{unicode:"\\f009",name:"Th large"},"fa-th-list":{unicode:"\\f00b",name:"Th list"},"fa-themeisle":{unicode:"\\f2b2",name:"Themeisle"},"fa-thermometer-empty":{unicode:"\\f2cb",name:"Thermometer empty"},"fa-thermometer-full":{unicode:"\\f2c7",name:"Thermometer full"},"fa-thermometer-half":{unicode:"\\f2c9",name:"Thermometer half"},"fa-thermometer-quarter":{unicode:"\\f2ca",name:"Thermometer quarter"},"fa-thermometer-three-quarters":{unicode:"\\f2c8",name:"Thermometer three quarters"},"fa-thumb-tack":{unicode:"\\f08d",name:"Thumb tack"},"fa-thumbs-down":{unicode:"\\f165",name:"Thumbs down"},"fa-thumbs-o-down":{unicode:"\\f088",name:"Thumbs o down"},"fa-thumbs-o-up":{unicode:"\\f087",name:"Thumbs o up"},"fa-thumbs-up":{unicode:"\\f164",name:"Thumbs up"},"fa-ticket":{unicode:"\\f145",name:"Ticket"},"fa-times":{unicode:"\\f00d",name:"Times"},"fa-times-circle":{unicode:"\\f057",name:"Times circle"},"fa-times-circle-o":{unicode:"\\f05c",name:"Times circle o"},"fa-tint":{unicode:"\\f043",name:"Tint"},"fa-toggle-off":{unicode:"\\f204",name:"Toggle off"},"fa-toggle-on":{unicode:"\\f205",name:"Toggle on"},"fa-trademark":{unicode:"\\f25c",name:"Trademark"},"fa-train":{unicode:"\\f238",name:"Train"},"fa-transgender":{unicode:"\\f224",name:"Transgender"},"fa-transgender-alt":{unicode:"\\f225",name:"Transgender alt"},"fa-trash":{unicode:"\\f1f8",name:"Trash"},"fa-trash-o":{unicode:"\\f014",name:"Trash o"},"fa-tree":{unicode:"\\f1bb",name:"Tree"},"fa-trello":{unicode:"\\f181",name:"Trello"},"fa-tripadvisor":{unicode:"\\f262",name:"Tripadvisor"},"fa-trophy":{unicode:"\\f091",name:"Trophy"},"fa-truck":{unicode:"\\f0d1",name:"Truck"},"fa-try":{unicode:"\\f195",name:"Try"},"fa-tty":{unicode:"\\f1e4",name:"Tty"},"fa-tumblr":{unicode:"\\f173",name:"Tumblr"},"fa-tumblr-square":{unicode:"\\f174",name:"Tumblr square"},"fa-twitch":{unicode:"\\f1e8",name:"Twitch"},"fa-twitter":{unicode:"\\f099",name:"Twitter"},"fa-twitter-square":{unicode:"\\f081",name:"Twitter square"},"fa-umbrella":{unicode:"\\f0e9",name:"Umbrella"},"fa-underline":{unicode:"\\f0cd",name:"Underline"},"fa-undo":{unicode:"\\f0e2",name:"Undo"},"fa-universal-access":{unicode:"\\f29a",name:"Universal access"},"fa-university":{unicode:"\\f19c",name:"University"},"fa-unlock":{unicode:"\\f09c",name:"Unlock"},"fa-unlock-alt":{unicode:"\\f13e",name:"Unlock alt"},"fa-upload":{unicode:"\\f093",name:"Upload"},"fa-usb":{unicode:"\\f287",name:"Usb"},"fa-usd":{unicode:"\\f155",name:"Usd"},"fa-user":{unicode:"\\f007",name:"User"},"fa-user-circle":{unicode:"\\f2bd",name:"User circle"},"fa-user-circle-o":{unicode:"\\f2be",name:"User circle o"},"fa-user-md":{unicode:"\\f0f0",name:"User md"},"fa-user-o":{unicode:"\\f2c0",name:"User o"},"fa-user-plus":{unicode:"\\f234",name:"User plus"},"fa-user-secret":{unicode:"\\f21b",name:"User secret"},"fa-user-times":{unicode:"\\f235",name:"User times"},"fa-users":{unicode:"\\f0c0",name:"Users"},"fa-venus":{unicode:"\\f221",name:"Venus"},"fa-venus-double":{unicode:"\\f226",name:"Venus double"},"fa-venus-mars":{unicode:"\\f228",name:"Venus mars"},"fa-viacoin":{unicode:"\\f237",name:"Viacoin"},"fa-viadeo":{unicode:"\\f2a9",name:"Viadeo"},"fa-viadeo-square":{unicode:"\\f2aa",name:"Viadeo square"},"fa-video-camera":{unicode:"\\f03d",name:"Video camera"},"fa-vimeo":{unicode:"\\f27d",name:"Vimeo"},"fa-vimeo-square":{unicode:"\\f194",name:"Vimeo square"},"fa-vine":{unicode:"\\f1ca",name:"Vine"},"fa-vk":{unicode:"\\f189",name:"Vk"},"fa-volume-control-phone":{unicode:"\\f2a0",name:"Volume control phone"},"fa-volume-down":{unicode:"\\f027",name:"Volume down"},"fa-volume-off":{unicode:"\\f026",name:"Volume off"},"fa-volume-up":{unicode:"\\f028",name:"Volume up"},"fa-weibo":{unicode:"\\f18a",name:"Weibo"},"fa-weixin":{unicode:"\\f1d7",name:"Weixin"},"fa-whatsapp":{unicode:"\\f232",name:"Whatsapp"},"fa-wheelchair":{unicode:"\\f193",name:"Wheelchair"},"fa-wheelchair-alt":{unicode:"\\f29b",name:"Wheelchair alt"},"fa-wifi":{unicode:"\\f1eb",name:"Wifi"},"fa-wikipedia-w":{unicode:"\\f266",name:"Wikipedia w"},"fa-window-close":{unicode:"\\f2d3",name:"Window close"},"fa-window-close-o":{unicode:"\\f2d4",name:"Window close o"},"fa-window-maximize":{unicode:"\\f2d0",name:"Window maximize"},"fa-window-minimize":{unicode:"\\f2d1",name:"Window minimize"},"fa-window-restore":{unicode:"\\f2d2",name:"Window restore"},"fa-windows":{unicode:"\\f17a",name:"Windows"},"fa-wordpress":{unicode:"\\f19a",name:"Wordpress"},"fa-wpbeginner":{unicode:"\\f297",name:"Wpbeginner"},"fa-wpexplorer":{unicode:"\\f2de",name:"Wpexplorer"},"fa-wpforms":{unicode:"\\f298",name:"Wpforms"},"fa-wrench":{unicode:"\\f0ad",name:"Wrench"},"fa-xing":{unicode:"\\f168",name:"Xing"},"fa-xing-square":{unicode:"\\f169",name:"Xing square"},"fa-y-combinator":{unicode:"\\f23b",name:"Y combinator"},"fa-yahoo":{unicode:"\\f19e",name:"Yahoo"},"fa-yelp":{unicode:"\\f1e9",name:"Yelp"},"fa-yoast":{unicode:"\\f2b1",name:"Yoast"},"fa-youtube":{unicode:"\\f167",name:"Youtube"},"fa-youtube-play":{unicode:"\\f16a",name:"Youtube play"},"fa-youtube-square":{unicode:"\\f166",name:"Youtube square"}},u=["glyph-glass","glyph-leaf","glyph-dog","glyph-user","glyph-girl","glyph-car","glyph-user-add","glyph-user-remove","glyph-film","glyph-magic","glyph-envelope","glyph-camera","glyph-heart","glyph-beach-umbrella","glyph-train","glyph-print","glyph-bin","glyph-music","glyph-note","glyph-heart-empty","glyph-home","glyph-snowflake","glyph-fire","glyph-magnet","glyph-parents","glyph-binoculars","glyph-road","glyph-search","glyph-cars","glyph-notes-2","glyph-pencil","glyph-bus","glyph-wifi-alt","glyph-luggage","glyph-old-man","glyph-woman","glyph-file","glyph-coins","glyph-airplane","glyph-notes","glyph-stats","glyph-charts","glyph-pie-chart","glyph-group","glyph-keys","glyph-calendar","glyph-router","glyph-camera-small","glyph-dislikes","glyph-star","glyph-link","glyph-eye-open","glyph-eye-close","glyph-alarm","glyph-clock","glyph-stopwatch","glyph-projector","glyph-history","glyph-truck","glyph-cargo","glyph-compass","glyph-keynote","glyph-paperclip","glyph-power","glyph-lightbulb","glyph-tag","glyph-tags","glyph-cleaning","glyph-ruller","glyph-gift","glyph-umbrella","glyph-book","glyph-bookmark","glyph-wifi","glyph-cup","glyph-stroller","glyph-headphones","glyph-headset","glyph-warning-sign","glyph-signal","glyph-retweet","glyph-refresh","glyph-roundabout","glyph-random","glyph-heat","glyph-repeat","glyph-display","glyph-log-book","glyph-address-book","glyph-building","glyph-eyedropper","glyph-adjust","glyph-tint","glyph-crop","glyph-vector-path-square","glyph-vector-path-circle","glyph-vector-path-polygon","glyph-vector-path-line","glyph-vector-path-curve","glyph-vector-path-all","glyph-font","glyph-italic","glyph-bold","glyph-text-underline","glyph-text-strike","glyph-text-height","glyph-text-width","glyph-text-resize","glyph-left-indent","glyph-right-indent","glyph-align-left","glyph-align-center","glyph-align-right","glyph-justify","glyph-list","glyph-text-smaller","glyph-text-bigger","glyph-embed","glyph-embed-close","glyph-table","glyph-message-full","glyph-message-empty","glyph-message-in","glyph-message-out","glyph-message-plus","glyph-message-minus","glyph-message-ban","glyph-message-flag","glyph-message-lock","glyph-message-new","glyph-inbox","glyph-inbox-plus","glyph-inbox-minus","glyph-inbox-lock","glyph-inbox-in","glyph-inbox-out","glyph-cogwheel","glyph-cogwheels","glyph-picture","glyph-adjust-alt","glyph-database-lock","glyph-database-plus","glyph-database-minus","glyph-database-ban","glyph-folder-open","glyph-folder-plus","glyph-folder-minus","glyph-folder-lock","glyph-folder-flag","glyph-folder-new","glyph-edit","glyph-new-window","glyph-check","glyph-unchecked","glyph-more-windows","glyph-show-big-thumbnails","glyph-show-thumbnails","glyph-show-thumbnails-with-lines","glyph-show-lines","glyph-playlist","glyph-imac","glyph-macbook","glyph-ipad","glyph-iphone","glyph-iphone-transfer","glyph-iphone-exchange","glyph-ipod","glyph-ipod-shuffle","glyph-ear-plugs","glyph-record","glyph-step-backward","glyph-fast-backward","glyph-rewind","glyph-play","glyph-pause","glyph-stop","glyph-forward","glyph-fast-forward","glyph-step-forward","glyph-eject","glyph-facetime-video","glyph-download-alt","glyph-mute","glyph-volume-down","glyph-volume-up","glyph-screenshot","glyph-move","glyph-more","glyph-brightness-reduce","glyph-brightness-increase","glyph-circle-plus","glyph-circle-minus","glyph-circle-remove","glyph-circle-ok","glyph-circle-question-mark","glyph-circle-info","glyph-circle-exclamation-mark","glyph-remove","glyph-ok","glyph-ban","glyph-download","glyph-upload","glyph-shopping-cart","glyph-lock","glyph-unlock","glyph-electricity","glyph-ok-2","glyph-remove-2","glyph-cart-out","glyph-cart-in","glyph-left-arrow","glyph-right-arrow","glyph-down-arrow","glyph-up-arrow","glyph-resize-small","glyph-resize-full","glyph-circle-arrow-left","glyph-circle-arrow-right","glyph-circle-arrow-top","glyph-circle-arrow-down","glyph-play-button","glyph-unshare","glyph-share","glyph-chevron-right","glyph-chevron-left","glyph-bluetooth","glyph-euro","glyph-usd","glyph-gbp","glyph-retweet-2","glyph-moon","glyph-sun","glyph-cloud","glyph-direction","glyph-brush","glyph-pen","glyph-zoom-in","glyph-zoom-out","glyph-pin","glyph-albums","glyph-rotation-lock","glyph-flash","glyph-google-maps","glyph-anchor","glyph-conversation","glyph-chat","glyph-male","glyph-female","glyph-asterisk","glyph-divide","glyph-snorkel-diving","glyph-scuba-diving","glyph-oxygen-bottle","glyph-fins","glyph-fishes","glyph-boat","glyph-delete","glyph-sheriffs-star","glyph-qrcode","glyph-barcode","glyph-pool","glyph-buoy","glyph-spade","glyph-bank","glyph-vcard","glyph-electrical-plug","glyph-flag","glyph-credit-card","glyph-keyboard-wireless","glyph-keyboard-wired","glyph-shield","glyph-ring","glyph-cake","glyph-drink","glyph-beer","glyph-fast-food","glyph-cutlery","glyph-pizza","glyph-birthday-cake","glyph-tablet","glyph-settings","glyph-bullets","glyph-cardio","glyph-t-shirt","glyph-pants","glyph-sweater","glyph-fabric","glyph-leather","glyph-scissors","glyph-bomb","glyph-skull","glyph-celebration","glyph-tea-kettle","glyph-french-press","glyph-coffe-cup","glyph-pot","glyph-grater","glyph-kettle","glyph-hospital","glyph-hospital-h","glyph-microphone","glyph-webcam","glyph-temple-christianity-church","glyph-temple-islam","glyph-temple-hindu","glyph-temple-buddhist","glyph-bicycle","glyph-life-preserver","glyph-share-alt","glyph-comments","glyph-flower","glyph-baseball","glyph-rugby","glyph-ax","glyph-table-tennis","glyph-bowling","glyph-tree-conifer","glyph-tree-deciduous","glyph-more-items","glyph-sort","glyph-filter","glyph-gamepad","glyph-playing-dices","glyph-calculator","glyph-tie","glyph-wallet","glyph-piano","glyph-sampler","glyph-podium","glyph-soccer-ball","glyph-blog","glyph-dashboard","glyph-certificate","glyph-bell","glyph-candle","glyph-pushpin","glyph-iphone-shake","glyph-pin-flag","glyph-turtle","glyph-rabbit","glyph-globe","glyph-briefcase","glyph-hdd","glyph-thumbs-up","glyph-thumbs-down","glyph-hand-right","glyph-hand-left","glyph-hand-up","glyph-hand-down","glyph-fullscreen","glyph-shopping-bag","glyph-book-open","glyph-nameplate","glyph-nameplate-alt","glyph-vases","glyph-bullhorn","glyph-dumbbell","glyph-suitcase","glyph-file-import","glyph-file-export","glyph-bug","glyph-crown","glyph-smoking","glyph-cloud-upload","glyph-cloud-download","glyph-restart","glyph-security-camera","glyph-expand","glyph-collapse","glyph-collapse-top","glyph-globe-af","glyph-global","glyph-spray","glyph-nails","glyph-claw-hammer","glyph-classic-hammer","glyph-hand-saw","glyph-riflescope","glyph-electrical-socket-eu","glyph-electrical-socket-us","glyph-message-forward","glyph-coat-hanger","glyph-dress","glyph-bathrobe","glyph-shirt","glyph-underwear","glyph-log-in","glyph-log-out","glyph-exit","glyph-new-window-alt","glyph-video-sd","glyph-video-hd","glyph-subtitles","glyph-sound-stereo","glyph-sound-dolby","glyph-sound-5-1","glyph-sound-6-1","glyph-sound-7-1","glyph-copyright-mark","glyph-registration-mark","glyph-radar","glyph-skateboard","glyph-golf-course","glyph-sorting","glyph-sort-by-alphabet","glyph-sort-by-alphabet-alt","glyph-sort-by-order","glyph-sort-by-order-alt","glyph-sort-by-attributes","glyph-sort-by-attributes-alt","glyph-compressed","glyph-package","glyph-cloud-plus","glyph-cloud-minus","glyph-disk-save","glyph-disk-open","glyph-disk-saved","glyph-disk-remove","glyph-disk-import","glyph-disk-export","glyph-tower","glyph-send","glyph-git-branch","glyph-git-create","glyph-git-private","glyph-git-delete","glyph-git-merge","glyph-git-pull-request","glyph-git-compare","glyph-git-commit","glyph-construction-cone","glyph-shoe-steps","glyph-plus","glyph-minus","glyph-redo","glyph-undo","glyph-golf","glyph-hockey","glyph-pipe","glyph-wrench","glyph-folder-closed","glyph-phone-alt","glyph-earphone","glyph-floppy-disk","glyph-floppy-saved","glyph-floppy-remove","glyph-floppy-save","glyph-floppy-open","glyph-translate","glyph-fax","glyph-factory","glyph-shop-window","glyph-shop","glyph-kiosk","glyph-kiosk-wheels","glyph-kiosk-light","glyph-kiosk-food","glyph-transfer","glyph-money","glyph-header","glyph-blacksmith","glyph-saw-blade","glyph-basketball","glyph-server","glyph-server-plus","glyph-server-minus","glyph-server-ban","glyph-server-flag","glyph-server-lock","glyph-server-new"],f=["social-pinterest","social-dropbox","social-google-plus","social-jolicloud","social-yahoo","social-blogger","social-picasa","social-amazon","social-tumblr","social-wordpress","social-instapaper","social-evernote","social-xing","social-zootool","social-dribbble","social-deviantart","social-read-it-later","social-linked-in","social-forrst","social-pinboard","social-behance","social-github","social-youtube","social-skitch","social-foursquare","social-quora","social-badoo","social-spotify","social-stumbleupon","social-readability","social-facebook","social-twitter","social-instagram","social-posterous-spaces","social-vimeo","social-flickr","social-last-fm","social-rss","social-skype","social-e-mail","social-vine","social-myspace","social-goodreads","social-apple","social-windows","social-yelp","social-playstation","social-xbox","social-android","social-ios"]}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageXField=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"imagex"},setup:function(){var n=this;this.options.advanced=!0;this.options.fileExtensions||(this.options.fileExtensions="gif|jpg|jpeg|tiff|png");this.options.fileMaxSize||(this.options.fileMaxSize=2e6);this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.overwrite||(this.options.overwrite=!1);this.options.showOverwrite||(this.options.showOverwrite=!1);this.options.uploadhidden&&(this.options.showOverwrite=!1);this.options.showCropper===undefined&&(this.options.showCropper=!1);this.options.showCropper&&(this.options.showImage=!0,this.options.advanced=!0);this.options.showImage===undefined&&(this.options.showImage=!0);this.options.showCropper&&(this.options.cropfolder||(this.options.cropfolder=this.options.uploadfolder),this.options.cropper||(this.options.cropper={}),this.options.width&&this.options.height&&(this.options.cropper.aspectRatio=this.options.width/this.options.height),this.options.ratio&&(this.options.cropper.aspectRatio=this.options.ratio),this.options.cropper.responsive=!1,this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1),this.options.cropper.viewMode||(this.options.cropper.viewMode=1),this.options.cropper.zoomOnWheel||(this.options.cropper.zoomOnWheel=!1),this.options.saveCropFile||(this.options.saveCropFile=!1),this.options.saveCropFile&&(this.options.buttons={check:{value:"Crop Image",click:function(){this.cropImage()}}}));this.base()},getValue:function(){return this.getBaseValue()},setValue:function(i){var r=this,u;this.control&&typeof i!="undefined"&&i!=null&&($image=r.getImage(),t.isEmpty(i)?($image.attr("src",url),this.options.showCropper&&(r.cropper(""),r.setCropUrl("")),n(this.control).find("select").val("")):t.isObject(i)?(i.url&&(i.url=i.url.split("?")[0]),$image.attr("src",i.url),this.options.showCropper&&(i.cropUrl&&(i.cropUrl=i.cropUrl.split("?")[0]),i.cropdata&&Object.keys(i.cropdata).length>0?(u=i.cropdata[Object.keys(i.cropdata)[0]],r.cropper(i.url,u.cropper),r.setCropUrl(u.url)):i.crop?(r.cropper(i.url,i.crop),r.setCropUrl(i.cropUrl)):(r.cropper(i.url,i.crop),r.setCropUrl(i.cropUrl))),n(this.control).find("select").val(i.url)):($image.attr("src",i),this.options.showCropper&&(r.cropper(i),r.setCropUrl("")),n(this.control).find("select").val(i)),n(this.control).find("select").trigger("change.select2"))},getBaseValue:function(){var i=this,t,r;if(this.control&&this.control.length>0)return t=null,$image=i.getImage(),t={},this.options.showCropper&&i.cropperExist()&&(t.crop=$image.cropper("getData",{rounded:!0})),r=n(this.control).find("select").val(),i.options.advanced?t.url=r:t=r,t.url&&(this.dataSource&&this.dataSource[t.url]&&(t.id=this.dataSource[t.url].id,t.filename=this.dataSource[t.url].filename,t.width=this.dataSource[t.url].width,t.height=this.dataSource[t.url].height),this.options.showCropper&&(t.cropUrl=this.getCropUrl())),t},beforeRenderControl:function(i,r){var u=this;this.base(i,function(){if(u.selectOptions=[],u.sf){var f=function(){u.schema.enum=[];u.options.optionLabels=[];for(var n=0;n0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};n(u.getControlEl().find("select")).select2(i)}u.options.uploadhidden?n(u.getControlEl()).find("input[type=file]").hide():u.sf&&n(u.getControlEl()).find("input[type=file]").fileupload({dataType:"json",url:u.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:function(){var n=[{name:"uploadfolder",value:u.options.uploadfolder}];return u.options.showOverwrite?n.push({name:"overwrite",value:u.isOverwrite()}):u.options.overwrite&&n.push({name:"overwrite",value:!0}),n},beforeSend:u.sf.setModuleHeaders,add:function(n,t){var i=!0,r=t.files[0],f=new RegExp("\\.("+u.options.fileExtensions+")$","i");f.test(r.name)||(u.showAlert("You must select an image file only ("+u.options.fileExtensions+")"),i=!1);r.size>u.options.fileMaxSize&&(u.showAlert("Please upload a smaller image, max size is "+u.options.fileMaxSize+" bytes"),i=!1);i==!0&&(u.showAlert("File uploading..."),t.submit())},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(n,t){t.success?u.refresh(function(){u.setValue(t.url);u.showAlert("File uploaded",!0)}):u.showAlert(t.message,!0)})}}).data("loaded",!0);u.options.showOverwrite||n(u.control).parent().find("#"+u.id+"-overwriteLabel").hide();r()})},cropImage:function(){var t=this,r=t.getBaseValue(),u,i;r.url&&($image=t.getImage(),u=$image.cropper("getData",{rounded:!0}),i={url:r.url,cropfolder:t.options.cropfolder,crop:u,id:"crop"},t.options.width&&t.options.height&&(i.resize={width:t.options.width,height:t.options.height}),n(t.getControlEl()).css("cursor","wait"),t.showAlert("Image cropping..."),n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/CropImage",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(i),beforeSend:t.sf.setModuleHeaders}).done(function(i){t.setCropUrl(i.url);t.showAlert("Image cropped",!0);setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")}))},getFileUrl:function(t){var i=this,r;i.sf&&(r={fileid:t},n.ajax({url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:i.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:r,success:function(n){return n},error:function(){return""}}))},cropper:function(t,i){var u=this,r,f;$image=u.getImage();r=$image.data("cropper");t?($image.show(),r?((t!=r.originalUrl||r.url&&t!=r.url)&&$image.cropper("replace",t),i&&$image.cropper("setData",i)):(f=n.extend({},{aspectRatio:16/9,checkOrientation:!1,autoCropArea:.9,minContainerHeight:200,minContainerWidth:400,toggleDragModeOnDblclick:!1,zoomOnWheel:!1,cropmove:function(){u.setCropUrl("")}},u.options.cropper),i&&(f.data=i),$image.cropper(f))):($image.hide(),r&&$image.cropper("destroy"))},cropperExist:function(){var n=this;return $image=n.getImage(),$image.data("cropper")},getImage:function(){var t=this;return n(t.control).parent().find("#"+t.id+"-image")},isOverwrite:function(){var i=this,r;return this.options.showOverwrite?(r=n(i.control).parent().find("#"+i.id+"-overwrite"),t.checked(r)):this.options.overwrite},getCropUrl:function(){var t=this;return n(t.getControlEl()).attr("data-cropurl")},setCropUrl:function(t){var i=this;n(i.getControlEl()).attr("data-cropurl",t);i.refreshValidationState()},handleValidate:function(){var r=this.base(),t=this.validation,u=n(this.control).find("select").val(),i=!u||!this.options.showCropper||!this.options.saveCropFile||this.getCropUrl();return t.cropMissing={message:i?"":this.getMessage("cropMissing"),status:i},r&&t.cropMissing.status},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data?this.data.url:"",!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;i.setCropUrl("");t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).find("select");i.focus();t&&t(this)}},getTitle:function(){return"Image Crop 2 Field"},getDescription:function(){return"Image Crop 2 Field"},showAlert:function(t,i){var r=this;n("#"+r.id+"-alert").text(t);n("#"+r.id+"-alert").show();i&&setTimeout(function(){n("#"+r.id+"-alert").hide()},4e3)}});t.registerFieldClass("imagex",t.Fields.ImageXField);t.registerMessages({cropMissing:"Cropped image missing (click the crop button)"})}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"image"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.base()},getTitle:function(){return"Image Field"},getDescription:function(){return"Image Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(i){var u=this,r=this.getTextControlEl();r&&r.length>0&&(t.isEmpty(i)?r.val(""):(r.val(i),n(u.control).parent().find(".alpaca-image-display img").attr("src",i)));this.updateMaxLengthIndicator()},getValue:function(){var t=null,n=this.getTextControlEl();return n&&n.length>0&&(t=n.val()),t},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getTextControlEl(),u;i.options.uploadhidden?n(this.control.get(0)).find("input[type=file]").hide():i.sf&&n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,u){u.result&&n.each(u.result,function(t,u){i.setValue(u.url);n(r).change()})}}).data("loaded",!0);n(r).change(function(){var t=n(this).val();n(i.control).parent().find(".alpaca-image-display img").attr("src",t)});i.options.manageurl&&(u=n('Manage files<\/a>').appendTo(n(r).parent()));t()},applyTypeAhead:function(){var r=this,o,i,s,f,e,h,c,l,u;if(r.control.typeahead&&r.options.typeahead&&!t.isEmpty(r.options.typeahead)&&r.sf){if(o=r.options.typeahead.config,o||(o={}),i=r.options.typeahead.datasets,i||(i={}),i.name||(i.name=r.getId()),s=r.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Images?q=%QUERY&d="+s,ajax:{beforeSend:r.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"
    <\/div> {{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));u=this.getTextControlEl();n(u).typeahead(o,i);n(u).on("typeahead:autocompleted",function(t,i){r.setValue(i.value);n(u).change()});n(u).on("typeahead:selected",function(t,i){r.setValue(i.value);n(u).change()});if(f){if(f.autocompleted)n(u).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(u).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(u).change(function(){var t=n(this).val(),i=n(u).typeahead("val");i!==t&&n(u).typeahead("val",t)});n(r.field).find("span.twitter-typeahead").first().css("display","block");n(r.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("image",t.Fields.ImageField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Image2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},getFileUrl:function(t){if(self.sf){var i={fileid:t};n.ajax({url:self.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:self.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:i,success:function(n){return n},error:function(){return""}})}},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select Field"},getDescription:function(){return"Select Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("image2",t.Fields.Image2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageCrop2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"imagecrop2"},setup:function(){var n=this;this.options.uploadfolder||(this.options.uploadfolder="");this.options.cropfolder||(this.options.cropfolder=this.options.uploadfolder);this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.cropper||(this.options.cropper={});this.options.width&&this.options.height&&(this.options.cropper.aspectRatio=this.options.width/this.options.height);this.options.cropper.responsive=!1;this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1);this.options.cropButtonHidden||(this.options.cropButtonHidden=!1);this.options.cropButtonHidden||(this.options.buttons={check:{value:"Crop",click:function(){this.cropImage()}}});this.base()},getValue:function(){var i=this,t;if(this.control&&this.control.length>0)return t=null,$image=i.getImage(),t=i.cropperExist()?$image.cropper("getData",{rounded:!0}):{},t.url=n(this.control).find("select").val(),t.url&&(this.dataSource&&this.dataSource[t.url]&&(t.id=this.dataSource[t.url].id),t.cropUrl=n(i.getControlEl()).attr("data-cropurl")),t},setValue:function(i){var r=this,u;i!==this.getValue()&&this.control&&typeof i!="undefined"&&i!=null&&(t.isEmpty(i)?(r.cropper(""),n(this.control).find("select").val(""),n(r.getControlEl()).attr("data-cropurl","")):t.isObject(i)?(i.url&&(i.url=i.url.split("?")[0]),i.cropUrl&&(i.cropUrl=i.cropUrl.split("?")[0]),i.cropdata&&Object.keys(i.cropdata).length>0?(u=i.cropdata[Object.keys(i.cropdata)[0]],r.cropper(i.url,u.cropper),n(this.control).find("select").val(i.url),n(r.getControlEl()).attr("data-cropurl",u.url)):(r.cropper(i.url,i),n(this.control).find("select").val(i.url),n(r.getControlEl()).attr("data-cropurl",i.cropUrl))):(r.cropper(i),n(this.control).find("select").val(i),n(r.getControlEl()).attr("data-cropurl","")),n(this.control).find("select").trigger("change.select2"))},getEnum:function(){if(this.schema){if(this.schema["enum"])return this.schema["enum"];if(this.schema.type&&this.schema.type==="array"&&this.schema.items&&this.schema.items["enum"])return this.schema.items["enum"]}},initControlEvents:function(){var n=this,t;if(n.base(),n.options.multiple){t=this.control.parent().find(".select2-search__field");t.focus(function(t){n.suspendBlurFocus||(n.onFocus.call(n,t),n.trigger("focus",t))});t.blur(function(t){n.suspendBlurFocus||(n.onBlur.call(n,t),n.trigger("blur",t))});this.control.on("change",function(t){n.onChange.call(n,t);n.trigger("change",t)})}},beforeRenderControl:function(i,r){var u=this;this.base(i,function(){if(u.selectOptions=[],u.sf){var f=function(){u.schema.enum=[];u.options.optionLabels=[];for(var n=0;n0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(' '+t.text+"<\/span>")};n(u.getControlEl().find("select")).select2(i)}u.options.uploadhidden?n(u.getControlEl()).find("input[type=file]").hide():u.sf&&n(u.getControlEl()).find("input[type=file]").fileupload({dataType:"json",url:u.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:u.options.uploadfolder},beforeSend:u.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(n,t){u.refresh(function(){u.setValue(t.url)})})}}).data("loaded",!0);r()})},cropImage:function(){var t=this,i=t.getValue(),r={url:i.url,cropfolder:t.options.cropfolder,crop:i,id:"crop"};t.options.width&&t.options.height&&(r.resize={width:t.options.width,height:t.options.height});n(t.getControlEl()).css("cursor","wait");n.ajax({type:"POST",url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/CropImage",contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(r),beforeSend:t.sf.setModuleHeaders}).done(function(i){n(t.getControlEl()).attr("data-cropurl",i.url);setTimeout(function(){n(t.getControlEl()).css("cursor","initial")},500)}).fail(function(i,r,u){alert("Uh-oh, something broke: "+u);n(t.getControlEl()).css("cursor","initial")})},getFileUrl:function(t){var i=this,r;i.sf&&(r={fileid:t},n.ajax({url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/FileUrl",beforeSend:i.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:r,success:function(n){return n},error:function(){return""}}))},cropper:function(t,i){var f=this,r,u;$image=f.getImage();$image.attr("src",t);r=$image.data("cropper");t?($image.show(),r?((t!=r.originalUrl||r.url&&t!=r.url)&&$image.cropper("replace",t),i&&$image.cropper("setData",i)):(u=n.extend({},{aspectRatio:16/9,checkOrientation:!1,autoCropArea:.9,minContainerHeight:200,minContainerWidth:400,toggleDragModeOnDblclick:!1},f.options.cropper),i&&(u.data=i),$image.cropper(u))):($image.hide(),r&&$image.cropper("destroy"))},cropperExist:function(){var n=this;return $image=n.getImage(),$image.data("cropper")},getImage:function(){var t=this;return n(t.control).parent().find("#"+t.id+"-image")},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data?this.data.url:"",!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).find("select");i.focus();t&&t(this)}},getTitle:function(){return"Image Crop 2 Field"},getDescription:function(){return"Image Crop 2 Field"}});t.registerFieldClass("imagecrop2",t.Fields.ImageCrop2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageCropField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"imagecrop"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.cropper||(this.options.cropper={});this.options.cropper.responsive=!1;this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1);this.base()},getTitle:function(){return"Image Crop Field"},getDescription:function(){return"Image Crop Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(n){var r=this,i=this.getTextControlEl();i&&i.length>0&&(t.isEmpty(n)?(i.val(""),r.cropper("")):t.isObject(n)?(i.val(n.url),r.cropper(n.url,n)):(i.val(n),r.cropper(n)));this.updateMaxLengthIndicator()},getValue:function(){var i=this,n=null,t=this.getTextControlEl();return $image=i.getImage(),t&&t.length>0&&(n=i.cropperExist()?$image.cropper("getData",{rounded:!0}):{},n.url=t.val()),n},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getTextControlEl(),u;$image=n(i.control).parent().find(".alpaca-image-display img");i.sf?(i.options.uploadhidden?n(this.control.get(0)).find("input[type=file]").hide():n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(t,i){n(r).val(i.url);n(r).change()})}}).data("loaded",!0),n(r).change(function(){var t=n(this).val();i.cropper(t)}),i.options.manageurl&&(u=n('Manage files<\/a>').appendTo(n(r).parent()))):$image.hide();t()},cropper:function(t,i){var f=this,r,u;$image=f.getImage();$image.attr("src",t);r=$image.data("cropper");t?($image.show(),r?(t!=r.originalUrl&&$image.cropper("replace",t),i&&$image.cropper("setData",i)):(u=n.extend({},{aspectRatio:16/9,checkOrientation:!1,autoCropArea:.9,minContainerHeight:200,minContainerWidth:400,toggleDragModeOnDblclick:!1},f.options.cropper),i&&(u.data=i),$image.cropper(u))):($image.hide(),r&&$image.cropper("destroy"))},cropperExist:function(){var n=this;return $image=n.getImage(),$image.data("cropper")},getImage:function(){var t=this;return n(t.control).parent().find("#"+t.id+"-image")},applyTypeAhead:function(){var u=this,o,i,s,f,e,h,c,l,r;if(u.control.typeahead&&u.options.typeahead&&!t.isEmpty(u.options.typeahead)&&u.sf){if(o=u.options.typeahead.config,o||(o={}),i=i={},i.name||(i.name=u.getId()),s=u.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:u.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Images?q=%QUERY&d="+s,ajax:{beforeSend:u.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"
    <\/div> {{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));r=this.getTextControlEl();n(r).typeahead(o,i);n(r).on("typeahead:autocompleted",function(t,i){n(r).val(i.value);n(r).change()});n(r).on("typeahead:selected",function(t,i){n(r).val(i.value);n(r).change()});if(f){if(f.autocompleted)n(r).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(r).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(r).change(function(){var t=n(this).val(),i=n(r).typeahead("val");i!==t&&n(r).typeahead("val",t)});n(u.field).find("span.twitter-typeahead").first().css("display","block");n(u.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("imagecrop",t.Fields.ImageCropField)}(jQuery),function(n){var t=n.alpaca;t.Fields.ImageCropperField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"imagecropper"},setup:function(){this.options.uploadfolder||(this.options.uploadfolder="");this.options.uploadhidden||(this.options.uploadhidden=!1);this.options.cropper||(this.options.cropper={});this.options.cropper.responsive=!1;this.options.cropper.autoCropArea||(this.options.cropper.autoCropArea=1);this.base()},getTitle:function(){return"Image Cropper Field"},getDescription:function(){return"Image Cropper Field."},getTextControlEl:function(){return n(this.control.get(0)).find("input[type=text]#"+this.id)},setValue:function(n){var i=this.getTextControlEl();i&&i.length>0&&(t.isEmpty(n)?i.val(""):t.isString(n)?i.val(n):(i.val(n.url),this.setCroppedData(n.cropdata)));this.updateMaxLengthIndicator()},getValue:function(){var n=null,t=this.getTextControlEl();return t&&t.length>0&&(n={url:t.val()},n.cropdata=this.getCroppedData()),n},getCroppedData:function(){var f=this.getTextControlEl(),i={};for(var t in this.options.croppers){var e=this.options.croppers[t],r=this.id+"-"+t,u=n("#"+r);i[t]=u.data("cropdata")}return i},cropAllImages:function(t){var i=this;for(var r in this.options.croppers){var f=this.id+"-"+r,s=n("#"+f),u=this.options.croppers[r],e={x:-1,y:-1,width:u.width,height:u.height,rotate:0},o=JSON.stringify({url:t,id:r,crop:e,resize:u,cropfolder:this.options.cropfolder});n.ajax({type:"POST",url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/CropImage",contentType:"application/json; charset=utf-8",dataType:"json",async:!1,data:o,beforeSend:i.sf.setModuleHeaders}).done(function(n){var t={url:n.url,cropper:{}};i.setCroppedDataForId(f,t)}).fail(function(n,t,i){alert("Uh-oh, something broke: "+i)})}},setCroppedData:function(i){var e=this.getTextControlEl(),h=this.getFieldEl(),u,r,f,o;if(e&&e.length>0&&!t.isEmpty(i))for(r in this.options.croppers){var o=this.options.croppers[r],c=this.id+"-"+r,s=n("#"+c);cropdata=i[r];cropdata&&s.data("cropdata",cropdata);u||(u=s,n(u).addClass("active"),cropdata&&(f=n(h).find(".alpaca-image-display img.image"),o=f.data("cropper"),o&&f.cropper("setData",cropdata.cropper)))}},setCroppedDataForId:function(t,i){var u=this.getTextControlEl(),r;i&&(r=n("#"+t),r.data("cropdata",i))},getCurrentCropData:function(){var t=this.getFieldEl(),i=n(t).parent().find(".alpaca-form-tab.active");return n(i).data("cropdata")},setCurrentCropData:function(t){var i=this.getFieldEl(),r=n(i).parent().find(".alpaca-form-tab.active");n(r).data("cropdata",t)},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},cropChange:function(t){var u=t.data,f=u.getCurrentCropData(),e;if(f){var r=f.cropper,o=this,i=n(this).cropper("getData",{rounded:!0});(i.x!=r.x||i.y!=r.y||i.width!=r.width||i.height!=r.height||i.rotate!=r.rotate)&&(e={url:"",cropper:i},u.setCurrentCropData(e))}},getCropppersData:function(){var n,t,i;for(n in self.options.croppers)t=self.options.croppers[n],i=self.id+"-"+n},handlePostRender:function(t){var i=this,f=this.getTextControlEl(),s=this.getFieldEl(),r=n('Crop<\/a>'),e,o,u,a;r.click(function(){var u=i.getCroppedData(),e=JSON.stringify({url:f.val(),cropfolder:i.options.cropfolder,cropdata:u,croppers:i.options.croppers}),t;return n(r).css("cursor","wait"),t="CropImages",n.ajax({type:"POST",url:i.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/"+t,contentType:"application/json; charset=utf-8",dataType:"json",data:e,beforeSend:i.sf.setModuleHeaders}).done(function(t){var u,f;for(u in i.options.croppers){var s=i.options.croppers[u],e=i.id+"-"+u,o=n("#"+e);t.cropdata[u]&&(f={url:t.cropdata[u].url,cropper:t.cropdata[u].crop},f&&o.data("cropdata",f))}setTimeout(function(){n(r).css("cursor","initial")},500)}).fail(function(t,i,r){alert("Uh-oh, something broke: "+r);n(s).css("cursor","initial")}),!1});for(o in i.options.croppers){var c=i.options.croppers[o],l=i.id+"-"+o,h=n(''+o+"<\/a>").appendTo(n(f).parent());h.data("cropopt",c);h.click(function(){u.off("crop.cropper");var t=n(this).data("cropdata"),f=n(this).data("cropopt");u.cropper("setAspectRatio",f.width/f.height);t?u.cropper("setData",t.cropper):u.cropper("reset");r.data("cropperButtonId",this.id);r.data("cropperId",n(this).attr("data-id"));n(this).parent().find(".alpaca-form-tab").removeClass("active");n(this).addClass("active");u.on("crop.cropper",i,i.cropChange);return!1});e||(e=h,n(e).addClass("active"),r.data("cropperButtonId",n(e).attr("id")),r.data("cropperId",n(e).attr("data-id")))}u=n(s).find(".alpaca-image-display img.image");u.cropper(i.options.cropper).on("built.cropper",function(){var t=n(e).data("cropopt"),r,u;t&&n(this).cropper("setAspectRatio",t.width/t.height);r=n(e).data("cropdata");r&&n(this).cropper("setData",r.cropper);u=n(s).find(".alpaca-image-display img.image");u.on("crop.cropper",i,i.cropChange)});i.options.uploadhidden?n(this.control.get(0)).find("input[type=file]").hide():n(this.control.get(0)).find("input[type=file]").fileupload({dataType:"json",url:i.sf.getServiceRoot("OpenContent")+"FileUpload/UploadFile",maxFileSize:25e6,formData:{uploadfolder:i.options.uploadfolder},beforeSend:i.sf.setModuleHeaders,add:function(n,t){t.submit()},progress:function(n,t){if(t.context){var i=parseInt(t.loaded/t.total*100,10);t.context.find(opts.progressBarSelector).css("width",i+"%").find("span").html(i+"%")}},done:function(t,i){i.result&&n.each(i.result,function(t,i){f.val(i.url);n(f).change()})}}).data("loaded",!0);n(f).change(function(){var t=n(this).val();n(s).find(".alpaca-image-display img.image").attr("src",t);u.cropper("replace",t);t&&i.cropAllImages(t)});r.appendTo(n(f).parent());i.options.manageurl&&(a=n('Manage files<\/a>').appendTo(n(f).parent()));t()},applyTypeAhead:function(){var u=this,o,i,s,f,e,h,c,l,r;if(u.control.typeahead&&u.options.typeahead&&!t.isEmpty(u.options.typeahead)){if(o=u.options.typeahead.config,o||(o={}),i=i={},i.name||(i.name=u.getId()),s=u.options.typeahead.Folder,s||(s=""),f=f={},e={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},e.remote={url:u.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Images?q=%QUERY&d="+s,ajax:{beforeSend:u.sf.setModuleHeaders}},i.filter&&(e.remote.filter=i.filter),i.replace&&(e.remote.replace=i.replace),h=new Bloodhound(e),h.initialize(),i.source=h.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"
    <\/div> {{name}}"},i.templates)for(c in i.templates)l=i.templates[c],typeof l=="string"&&(i.templates[c]=Handlebars.compile(l));r=this.getTextControlEl();n(r).typeahead(o,i);n(r).on("typeahead:autocompleted",function(t,i){r.val(i.value);n(r).change()});n(r).on("typeahead:selected",function(t,i){r.val(i.value);n(r).change()});if(f){if(f.autocompleted)n(r).on("typeahead:autocompleted",function(n,t){f.autocompleted(n,t)});if(f.selected)n(r).on("typeahead:selected",function(n,t){f.selected(n,t)})}n(r).change(function(){var t=n(this).val(),i=n(r).typeahead("val");i!==t&&n(r).typeahead("val",t)});n(u.field).find("span.twitter-typeahead").first().css("display","block");n(u.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("imagecropper",t.Fields.ImageCropperField)}(jQuery),function(n){var t=n.alpaca;t.Fields.NumberField=t.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.numberDecimalSeparator=f.numberDecimalSeparator||"."},setup:function(){this.base()},getFieldType:function(){return"number"},getValue:function(){var n=this._getControlVal(!1);return typeof n=="undefined"||""==n?n:(this.numberDecimalSeparator!="."&&(n=(""+n).replace(this.numberDecimalSeparator,".")),parseFloat(n))},setValue:function(n){var i=n;this.numberDecimalSeparator!="."&&(i=t.isEmpty(n)?"":(""+n).replace(".",this.numberDecimalSeparator));this.base(i)},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateNumber();return i.stringNotANumber={message:n?"":this.view.getMessage("stringNotANumber"),status:n},n=this._validateDivisibleBy(),i.stringDivisibleBy={message:n?"":t.substituteTokens(this.view.getMessage("stringDivisibleBy"),[this.schema.divisibleBy]),status:n},n=this._validateMaximum(),i.stringValueTooLarge={message:"",status:n},n||(i.stringValueTooLarge.message=this.schema.exclusiveMaximum?t.substituteTokens(this.view.getMessage("stringValueTooLargeExclusive"),[this.schema.maximum]):t.substituteTokens(this.view.getMessage("stringValueTooLarge"),[this.schema.maximum])),n=this._validateMinimum(),i.stringValueTooSmall={message:"",status:n},n||(i.stringValueTooSmall.message=this.schema.exclusiveMinimum?t.substituteTokens(this.view.getMessage("stringValueTooSmallExclusive"),[this.schema.minimum]):t.substituteTokens(this.view.getMessage("stringValueTooSmall"),[this.schema.minimum])),n=this._validateMultipleOf(),i.stringValueNotMultipleOf={message:"",status:n},n||(i.stringValueNotMultipleOf.message=t.substituteTokens(this.view.getMessage("stringValueNotMultipleOf"),[this.schema.multipleOf])),r&&i.stringNotANumber.status&&i.stringDivisibleBy.status&&i.stringValueTooLarge.status&&i.stringValueTooSmall.status&&i.stringValueNotMultipleOf.status},_validateNumber:function(){var n=this._getControlVal(),i,r;return(this.numberDecimalSeparator!="."&&(n=n.replace(this.numberDecimalSeparator,".")),typeof n=="number"&&(n=""+n),t.isValEmpty(n))?!0:(i=t.testRegex(t.regexps.number,n),!i)?!1:(r=this.getValue(),isNaN(r))?!1:!0},_validateDivisibleBy:function(){var n=this.getValue();return!t.isEmpty(this.schema.divisibleBy)&&n%this.schema.divisibleBy!=0?!1:!0},_validateMaximum:function(){var n=this.getValue();return!t.isEmpty(this.schema.maximum)&&(n>this.schema.maximum||!t.isEmpty(this.schema.exclusiveMaximum)&&n==this.schema.maximum&&this.schema.exclusiveMaximum)?!1:!0},_validateMinimum:function(){var n=this.getValue();return!t.isEmpty(this.schema.minimum)&&(n0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("role2",t.Fields.Role2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.User2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this,t;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.options.folder||(this.options.folder="");this.options.role||(this.options.role="");n=this;this.options.lazyLoading&&(t=10,this.options.select2={ajax:{url:this.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/UsersLookup",beforeSend:this.sf.setModuleHeaders,type:"get",dataType:"json",delay:250,data:function(i){return{q:i.term?i.term:"",d:n.options.folder,role:n.options.role,pageIndex:i.page?i.page:1,pageSize:t}},processResults:function(i,r){return r.page=r.page||1,r.page==1&&i.items.unshift({id:"",text:n.options.noneLabel}),{results:i.items,pagination:{more:r.page*t0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(t.loading)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},getUserName:function(t,i){var r=this,u;r.sf&&(u={userid:t},n.ajax({url:r.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/GetUserInfo",beforeSend:r.sf.setModuleHeaders,type:"get",asych:!1,dataType:"json",data:u,success:function(n){i&&i(n)},error:function(){alert("Error GetUserInfo "+t)}}))},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(){}),r):!0:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTextControlEl:function(){var t=this;return n(t.getControlEl()).find("input[type=text]")},getTitle:function(){return"Select User Field"},getDescription:function(){return"Select User Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("user2",t.Fields.User2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.Select2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);n.schema.required&&(n.options.hideNone=!1);this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};n(u.getControlEl()).select2(i)}r()})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select Field"},getDescription:function(){return"Select Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("select2",t.Fields.Select2Field)}(jQuery),function(n){var t=n.alpaca;n.alpaca.Fields.DnnUrlField=n.alpaca.Fields.TextField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.sf=f.servicesFramework},setup:function(){this.base()},applyTypeAhead:function(){var t=this,f,i,r,u,e,o,s,h;if(t.sf){if(f=f={},i=i={},i.name||(i.name=t.getId()),r=r={},u={datumTokenizer:function(n){return Bloodhound.tokenizers.whitespace(n.value)},queryTokenizer:Bloodhound.tokenizers.whitespace},u.remote={url:t.sf.getServiceRoot("OpenContent")+"DnnEntitiesAPI/Tabs?q=%QUERY&l="+t.culture,ajax:{beforeSend:t.sf.setModuleHeaders}},i.filter&&(u.remote.filter=i.filter),i.replace&&(u.remote.replace=i.replace),e=new Bloodhound(u),e.initialize(),i.source=e.ttAdapter(),i.templates={empty:"Nothing found...",suggestion:"{{name}}"},i.templates)for(o in i.templates)s=i.templates[o],typeof s=="string"&&(i.templates[o]=Handlebars.compile(s));n(t.control).typeahead(f,i);n(t.control).on("typeahead:autocompleted",function(i,r){t.setValue(r.value);n(t.control).change()});n(t.control).on("typeahead:selected",function(i,r){t.setValue(r.value);n(t.control).change()});if(r){if(r.autocompleted)n(t.control).on("typeahead:autocompleted",function(n,t){r.autocompleted(n,t)});if(r.selected)n(t.control).on("typeahead:selected",function(n,t){r.selected(n,t)})}h=n(t.control);n(t.control).change(function(){var i=n(this).val(),t=n(h).typeahead("val");t!==i&&n(h).typeahead("val",t)});n(t.field).find("span.twitter-typeahead").first().css("display","block");n(t.field).find("span.twitter-typeahead input.tt-input").first().css("background-color","")}}});t.registerFieldClass("url",t.Fields.DnnUrlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Url2Field=t.Fields.ListField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.sf=f.servicesFramework;this.culture=f.culture;this.dataSource={}},getFieldType:function(){return"select"},setup:function(){var n=this;n.schema.type&&n.schema.type==="array"&&(n.options.multiple=!0,n.options.removeDefaultNone=!0);this.base()},getValue:function(){var n,i;if(this.control&&this.control.length>0){if(n=this._getControlVal(!0),typeof n=="undefined")n=this.data;else if(t.isArray(n))for(i=0;i0&&(u.data=u.selectOptions[0].value),u.data&&u.setValue(u.data),n.fn.select2){var i=null;i=u.options.select2?u.options.select2:{};i.templateResult=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};i.templateSelection=function(t){if(!t.id)return t.text;return n(""+t.text+"<\/span>")};n(u.getControlEl()).select2(i)}r()})},_validateEnum:function(){var u=this,i,r;return this.schema["enum"]?(i=this.data,!this.isRequired()&&t.isValEmpty(i))?!0:this.options.multiple?(r=!0,i||(i=[]),t.isArray(i)||t.isObject(i)||(i=[i]),n.each(i,function(t,i){if(n.inArray(i,u.schema["enum"])<=-1)return r=!1,!1}),r):n.inArray(i,this.schema["enum"])>-1:!0},onChange:function(n){this.base(n);var i=this;t.later(25,this,function(){var n=i.getValue();i.setValue(n);i.refreshValidationState()})},_validateMinItems:function(){return this.schema.items&&this.schema.items.minItems&&n(":selected",this.control).lengththis.schema.items.maxItems?!1:!0},handleValidate:function(){var r=this.base(),i=this.validation,n=this._validateMaxItems();return i.tooManyItems={message:n?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.items.maxItems]),status:n},n=this._validateMinItems(),i.notEnoughItems={message:n?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.items.minItems]),status:n},r&&i.tooManyItems.status&&i.notEnoughItems.status},focus:function(t){if(this.control&&this.control.length>0){var i=n(this.control).get(0);i.focus();t&&t(this)}},getTitle:function(){return"Select File Field"},getDescription:function(){return"Select File Field"},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{multiple:{title:"Mulitple Selection",description:"Allow multiple selection if true.",type:"boolean","default":!1},size:{title:"Displayed Options",description:"Number of options to be shown.",type:"number"},emptySelectFirst:{title:"Empty Select First",description:"If the data is empty, then automatically select the first item in the list.",type:"boolean","default":!1},multiselect:{title:"Multiselect Plugin Settings",description:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{multiple:{rightLabel:"Allow multiple selection ?",helper:"Allow multiple selection if checked",type:"checkbox"},size:{type:"integer"},emptySelectFirst:{type:"checkbox",rightLabel:"Empty Select First"},multiselect:{type:"object",rightLabel:"Multiselect plugin properties - http://davidstutz.github.io/bootstrap-multiselect"}}})}});t.registerFieldClass("url2",t.Fields.Url2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.wysihtmlField=t.Fields.TextAreaField.extend({getFieldType:function(){return"wysihtml"},setup:function(){this.data||(this.data="");this.base();typeof this.options.wysihtml=="undefined"&&(this.options.wysihtml={})},afterRenderControl:function(t,i){var r=this;this.base(t,function(){if(!r.isDisplayOnly()&&r.control){var t=r.control,u=n(t).find("#"+r.id)[0];r.editor=new wysihtml5.Editor(u,{toolbar:n(t).find("#"+r.id+"-toolbar")[0],parserRules:wysihtml5ParserRules});wysihtml5.commands.custom_class={exec:function(n,t,i){return wysihtml5.commands.formatBlock.exec(n,t,"p",i,new RegExp(i,"g"))},state:function(n,t,i){return wysihtml5.commands.formatBlock.state(n,t,"p",i,new RegExp(i,"g"))}}}i()})},getEditor:function(){return this.editor},setValue:function(n){var t=this;this.editor&&this.editor.setValue(n);this.base(n)},getValue:function(){var n=null;return this.editor&&(n=this.editor.currentView=="source"?this.editor.sourceView.textarea.value:this.editor.getValue()),n},getTitle:function(){return"wysihtml"},getDescription:function(){return"Provides an instance of a wysihtml control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{wysihtml:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{wysiwyg:{type:"any"}}})}});t.registerFieldClass("wysihtml",t.Fields.wysihtmlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.SummernoteField=t.Fields.TextAreaField.extend({getFieldType:function(){return"summernote"},setup:function(){this.data||(this.data="");this.base();typeof this.options.summernote=="undefined"&&(this.options.summernote={height:null,minHeight:null,maxHeight:null});this.options.placeholder&&(this.options.summernote=this.options.placeholder)},afterRenderControl:function(t,i){var r=this;this.base(t,function(){if(!r.isDisplayOnly()&&r.control&&n.fn.summernote)r.on("ready",function(){n(r.control).summernote(r.options.summernote)});n(r.control).bind("destroyed",function(){try{n(r.control).summernote("destroy")}catch(t){}});i()})},getTitle:function(){return"Summernote Editor"},getDescription:function(){return"Provides an instance of a Summernote Editor control for use in editing HTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{summernote:{title:"Summernote Editor options",description:"Use this entry to provide configuration options to the underlying Summernote plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{summernote:{type:"any"}}})}});t.registerFieldClass("summernote",t.Fields.SummernoteField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLSummernote=t.Fields.SummernoteField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language CKEditor Field"},getDescription:function(){return"Multi Language CKEditor field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlsummernote",t.Fields.MLSummernote)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLCKEditorField=t.Fields.CKEditorField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base();this.options.ckeditor||(this.options.ckeditor={});CKEDITOR.config.enableConfigHelper&&!this.options.ckeditor.extraPlugins&&(this.options.ckeditor.extraPlugins="dnnpages,confighelper")},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language CKEditor Field"},getDescription:function(){return"Multi Language CKEditor field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlckeditor",t.Fields.MLCKEditorField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLFile2Field=t.Fields.File2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(r),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).after('')}});t.registerFieldClass("mlfile2",t.Fields.MLFile2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLFileField=t.Fields.FileField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getTextControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Url Field"},getDescription:function(){return"Multi Language Url field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlfile",t.Fields.MLFileField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLFolder2Field=t.Fields.Folder2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(r),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlfolder2",t.Fields.MLFolder2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLImage2Field=t.Fields.Image2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlimage2",t.Fields.MLImage2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLImageXField=t.Fields.ImageXField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlimagex",t.Fields.MLImageXField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLImageField=t.Fields.ImageField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getTextControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Url Field"},getDescription:function(){return"Multi Language Url field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlimage",t.Fields.MLImageField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLTextAreaField=t.Fields.TextAreaField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Text Field"},getDescription:function(){return"Multi Language Text field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mltextarea",t.Fields.MLTextAreaField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLNumberField=t.Fields.NumberField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},getFloatValue:function(){var n=this.base(),t=this;return n},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},getControlValue:function(){var n=this._getControlVal(!0);return typeof n=="undefined"||""==n?n:parseFloat(n)},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},_validateNumber:function(){var n=this._getControlVal(),i,r;return(typeof n=="number"&&(n=""+n),t.isValEmpty(n))?!0:(i=t.testRegex(t.regexps.number,n),!i)?!1:(r=this.getFloatValue(),isNaN(r))?!1:!0},_validateDivisibleBy:function(){var n=this.getFloatValue();return!t.isEmpty(this.schema.divisibleBy)&&n%this.schema.divisibleBy!=0?!1:!0},_validateMaximum:function(){var n=this.getFloatValue();return!t.isEmpty(this.schema.maximum)&&(n>this.schema.maximum||!t.isEmpty(this.schema.exclusiveMaximum)&&n==this.schema.maximum&&this.schema.exclusiveMaximum)?!1:!0},_validateMinimum:function(){var n=this.getFloatValue();return!t.isEmpty(this.schema.minimum)&&(n');t()},getTitle:function(){return"Multi Language Text Field"},getDescription:function(){return"Multi Language Text field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mltext",t.Fields.MLTextField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLUrl2Field=t.Fields.Url2Field.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(r),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();t();n(this.control).parent().find(".select2").after('')}});t.registerFieldClass("mlurl2",t.Fields.MLUrl2Field)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLUrlField=t.Fields.DnnUrlField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.options.placeholder=this.culture!=this.defaultCulture&&this.olddata&&this.olddata[this.defaultCulture]?this.olddata[this.defaultCulture]:this.olddata&&Object.keys(this.olddata).length&&this.olddata[Object.keys(this.olddata)[0]]?this.olddata[Object.keys(this.olddata)[0]]:"";this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender(function(){t()})})},handlePostRender:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"Multi Language Url Field"},getDescription:function(){return"Multi Language Url field ."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{separator:{title:"Separator",description:"Separator used to split tags.",type:"string","default":","}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{separator:{type:"text"}}})}});t.registerFieldClass("mlurl",t.Fields.MLUrlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.MLwysihtmlField=t.Fields.wysihtmlField.extend({constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){this.data&&t.isObject(this.data)?this.olddata=this.data:this.data&&(this.olddata={},this.olddata[this.defaultCulture]=this.data);this.base()},getValue:function(){var r=this.base(),u=this,i={};return(this.olddata&&t.isObject(this.olddata)&&n.each(this.olddata,function(n,r){var f=t.copyOf(r);n!=u.culture&&(i[n]=f)}),r!=""&&(i[u.culture]=r),n.isEmptyObject(i))?"":i},setValue:function(n){if(n!==""){if(!n){this.base("");return}if(t.isObject(n)){var i=n[this.culture];if(!i){this.base("");return}this.base(i)}else this.base(n)}},afterRenderControl:function(n,t){var i=this;this.base(n,function(){i.handlePostRender2(function(){t()})})},handlePostRender2:function(t){var i=this,r=this.getControlEl();n(this.control.get(0)).after('');t()},getTitle:function(){return"ML wysihtml Field"},getDescription:function(){return"Provides an instance of a wysihtml control for use in editing MLHTML."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{wysihtml:{title:"CK Editor options",description:"Use this entry to provide configuration options to the underlying CKEditor plugin.",type:"any"}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{wysiwyg:{type:"any"}}})}});t.registerFieldClass("mlwysihtml",t.Fields.MLwysihtmlField)}(jQuery),function(n){var t=n.alpaca;t.Fields.Accordion=t.Fields.ArrayField.extend({getFieldType:function(){return"accordion"},constructor:function(n,t,i,r,u,f){var e=this;this.base(n,t,i,r,u,f);this.culture=f.culture;this.defaultCulture=f.defaultCulture;this.rootUrl=f.rootUrl},setup:function(){var n=this;this.base();n.options.titleField||n.schema.items&&n.schema.items.properties&&Object.keys(n.schema.items.properties).length&&(n.options.titleField=Object.keys(n.schema.items.properties)[0])},createItem:function(i,r,u,f,e){var o=this;this.base(i,r,u,f,function(i){var f="[no title]",u=i.childrenByPropertyId[o.options.titleField],r;if(u){r=u.getValue();t.isObject(r)&&(r=r[o.culture]);r=r?r:f;i.getContainerEl().closest(".panel").find(".panel-title a").first().text(r);u.on("keyup",function(){var i=this.getValue();t.isObject(i)&&(i=i[o.culture]);i=i?i:f;n(this.getControlEl()).closest(".panel").find(".panel-title a").first().text(i)})}e&&e(i)})},getType:function(){return"array"},getTitle:function(){return"accordion Field"},getDescription:function(){return"Renders array with title"}});t.registerFieldClass("accordion",t.Fields.Accordion)}(jQuery); \ No newline at end of file diff --git a/OpenContent/bundleconfig.json b/OpenContent/bundleconfig.json index 88567194..03226410 100644 --- a/OpenContent/bundleconfig.json +++ b/OpenContent/bundleconfig.json @@ -39,6 +39,7 @@ "alpaca/js/fields/dnn/MLImageXField.js", "alpaca/js/fields/dnn/MLImageField.js", "alpaca/js/fields/dnn/MLTextAreaField.js", + "alpaca/js/fields/dnn/MLNumberField.js", "alpaca/js/fields/dnn/MLTextField.js", "alpaca/js/fields/dnn/MLUrl2Field.js", "alpaca/js/fields/dnn/MLUrlField.js", diff --git a/OpenContent/js/alpacaengine.js b/OpenContent/js/alpacaengine.js index 8b1d75c9..d24cddcf 100644 --- a/OpenContent/js/alpacaengine.js +++ b/OpenContent/js/alpacaengine.js @@ -81,8 +81,10 @@ alpacaEngine.engine = function (config) { $("#" + self.copyButton).hide(); } - $("#" + self.deleteButton).click(function () { - + $("#" + self.deleteButton).dnnConfirm({ + callbackTrue: function () { + + var postData = JSON.stringify({ id: self.itemId }); //var action = "Delete"; $.ajax({ @@ -108,9 +110,9 @@ alpacaEngine.engine = function (config) { alert("Uh-oh, something broke: " + status); }); return false; + } }); - //var moduleScope = $('#'+self.scopeWrapper), //self = moduleScope, //sf = $.ServicesFramework(self.moduleId); diff --git a/OpenContent/js/builder/formbuilder.js b/OpenContent/js/builder/formbuilder.js index 7122f0fe..973b02e9 100644 --- a/OpenContent/js/builder/formbuilder.js +++ b/OpenContent/js/builder/formbuilder.js @@ -1051,7 +1051,7 @@ var fieldOptions = "label": "Multi language", "dependencies": { "advanced": [true], - "fieldtype": ["address","text", "textarea", "ckeditor", "file", "image", "url", "wysihtml", "summernote", "file2", "url2", "role2", "image2", "imagex"] + "fieldtype": ["number","address","text", "textarea", "ckeditor", "file", "image", "url", "wysihtml", "summernote", "file2", "url2", "role2", "image2", "imagex"] } }, "index": { From 32d6994fbe24b91f7eaa054deae02cd8c89624f2 Mon Sep 17 00:00:00 2001 From: holoncom Date: Sun, 8 Dec 2019 10:30:38 +0100 Subject: [PATCH 28/34] add tabid with link to CloneModule list. --- OpenContent/CloneModule.ascx.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenContent/CloneModule.ascx.cs b/OpenContent/CloneModule.ascx.cs index be50a026..a9983aed 100644 --- a/OpenContent/CloneModule.ascx.cs +++ b/OpenContent/CloneModule.ascx.cs @@ -18,6 +18,7 @@ using DotNetNuke.Entities.Tabs; using DotNetNuke.Framework.JavaScriptLibraries; using Satrabel.OpenContent.Components; +using Satrabel.OpenContent.Components.Dnn; using Satrabel.OpenContent.Components.Manifest; #endregion @@ -56,7 +57,7 @@ protected override void OnLoad(EventArgs e) { { ListItem li = new ListItem(ti.TabName, ti.TabID.ToString()); - li.Text = ti.IndentedTabName; + li.Text = $"{ti.IndentedTabName} ({ti.TabID})" ; li.Enabled = ti.TabID != m.TabID; cblPages.Items.Add(li); @@ -68,7 +69,7 @@ protected override void OnLoad(EventArgs e) if (tmi.IsDeleted) { //li.Enabled = false; - li.Text = "" + li.Text + ""; + li.Text = $"{li.Text}"; } else { From 49ed3a1814da52e8deb01ddb2bbb5476712a5497 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Thu, 12 Dec 2019 09:46:20 +0100 Subject: [PATCH 29/34] fix template helper help --- OpenContent/js/oc.codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenContent/js/oc.codemirror.js b/OpenContent/js/oc.codemirror.js index 06d05bf0..4795f5f3 100644 --- a/OpenContent/js/oc.codemirror.js +++ b/OpenContent/js/oc.codemirror.js @@ -410,7 +410,7 @@ function ocSetupCodeMirror(mimeType, elem, model) { { 'text': '{{formatDateTime var "dd/MMM/yy" "nl-NL" }}', 'displayText': 'formatDateTime' }, { 'text': '{{convertHtmlToText var }}', 'displayText': 'convertHtmlToText' }, { 'text': '{{convertToJson var }}', 'displayText': 'convertToJson' }, - { 'text': '{{template var}}', 'displayText': 'template' }, + { 'text': '{{template varTemplate varModel}}', 'displayText': 'template' }, { 'text': '{{truncateWords var 50 "..." }}', 'displayText': 'formatDateTime' }, { 'text': '{{#equal var "value"}}\n{{/equal}}', 'displayText': 'equal' }, { 'text': '{{#unless var}}\n{{/unless}}', 'displayText': 'unless' }, From 09b8baecbcc5e5e04c74c7cea44ae584ac293fe3 Mon Sep 17 00:00:00 2001 From: holoncom Date: Fri, 20 Dec 2019 11:41:02 +0100 Subject: [PATCH 30/34] beautify: simplify if-nesting and minor cleanup --- OpenContent/Components/FormAPIController.cs | 2 - OpenContent/Components/Json/JsonExtensions.cs | 1 - .../Components/Json/JsonMergeExtensions.cs | 3 +- .../Components/OpenContentAPIController.cs | 42 +++++++++++-------- .../alpaca/js/fields/dnn/MLNumberField.js | 1 - .../alpaca/js/fields/dnn/MLTextField.js | 5 +-- OpenContent/alpaca/js/fields/dnn/dnnfields.js | 6 +-- 7 files changed, 28 insertions(+), 32 deletions(-) diff --git a/OpenContent/Components/FormAPIController.cs b/OpenContent/Components/FormAPIController.cs index 82bdfbfd..cc248774 100644 --- a/OpenContent/Components/FormAPIController.cs +++ b/OpenContent/Components/FormAPIController.cs @@ -55,11 +55,9 @@ public HttpResponseMessage Form(string key) [HttpPost] [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.View)] - //public HttpResponseMessage Submit(SubmitDTO req) public HttpResponseMessage Submit() { SubmitDTO req = JsonConvert.DeserializeObject(HttpContextSource.Current.Request.Form["data"].ToString()); - //var form = JObject.Parse(HttpContextSource.Current.Request.Form["data"].ToString()); var form = req.form; var statuses = new List(); try diff --git a/OpenContent/Components/Json/JsonExtensions.cs b/OpenContent/Components/Json/JsonExtensions.cs index 0bc73b3b..05bb3c9b 100644 --- a/OpenContent/Components/Json/JsonExtensions.cs +++ b/OpenContent/Components/Json/JsonExtensions.cs @@ -64,7 +64,6 @@ public static bool GetValue(this JObject json, string fieldname, bool defaultval return json?[fieldname]?.Value() ?? defaultvalue; } - public static void MakeSureFieldExists(this JToken jToken, string fieldname, JTokenType jTokenType) { JToken defaultvalue; diff --git a/OpenContent/Components/Json/JsonMergeExtensions.cs b/OpenContent/Components/Json/JsonMergeExtensions.cs index a279a6f3..27bcaf31 100644 --- a/OpenContent/Components/Json/JsonMergeExtensions.cs +++ b/OpenContent/Components/Json/JsonMergeExtensions.cs @@ -13,8 +13,7 @@ public static class JsonMergeExtensions /// Token to merge, overwriting the left /// Options for merge /// A new merged token - public static JToken JsonMerge( - this JToken left, JToken right, JsonMergeOptions options) + public static JToken JsonMerge(this JToken left, JToken right, JsonMergeOptions options) { if (left.Type != JTokenType.Object) return right.DeepClone(); diff --git a/OpenContent/Components/OpenContentAPIController.cs b/OpenContent/Components/OpenContentAPIController.cs index 53b4cc4d..cfe65ae6 100644 --- a/OpenContent/Components/OpenContentAPIController.cs +++ b/OpenContent/Components/OpenContentAPIController.cs @@ -21,6 +21,7 @@ using Satrabel.OpenContent.Components.Json; using DotNetNuke.Entities.Modules; using System.Collections.Generic; +using System.Diagnostics; using DotNetNuke.Services.Localization; using Satrabel.OpenContent.Components.Alpaca; using Satrabel.OpenContent.Components.Manifest; @@ -388,7 +389,7 @@ public HttpResponseMessage Lookup(LookupRequestDTO req) int tabid = req.tabid > 0 ? req.tabid : ActiveModule.TabID; var module = OpenContentModuleConfig.Create(moduleid, tabid, PortalSettings); if (module == null) throw new Exception($"Can not find ModuleInfo (tabid:{req.tabid}, moduleid:{req.moduleid})"); - + List res = new List(); try { @@ -661,24 +662,31 @@ public HttpResponseMessage ReOrder(List ids) var opt = alpaca["options"]?["fields"]?["SortIndex"]?["type"]?.ToString(); var ml = opt == "mlnumber"; - IDataItem dsItem = null; - if (module.IsListMode()) + if (!module.IsListMode()) + return Request.CreateResponse(HttpStatusCode.OK, new { isValid = true }); + + if (ids == null) + return Request.CreateResponse(HttpStatusCode.OK, new { isValid = true }); + + int i = 1; + foreach (var id in ids) { - if (ids != null) + var dsItem = ds.Get(dsContext, id); + if (dsItem == null) { - int i = 1; - foreach (var id in ids) - { - dsItem = ds.Get(dsContext, id); - var json = dsItem.Data; - if (ml) // multi language - json["SortIndex"][DnnLanguageUtils.GetCurrentCultureCode()] = i; - else - json["SortIndex"] = i; - ds.Update(dsContext, dsItem, json); - i++; - } + Debugger.Break(); // this should never happen: investigate! + throw new Exception($"Reorder failed. Unknown item {id}. Reindex module and try again."); } + + var json = dsItem.Data; + if (ml) // multi language + { + json["SortIndex"][DnnLanguageUtils.GetCurrentCultureCode()] = i; + } + else + json["SortIndex"] = i; + ds.Update(dsContext, dsItem, json); + i++; } return Request.CreateResponse(HttpStatusCode.OK, new { @@ -692,7 +700,7 @@ public HttpResponseMessage ReOrder(List ids) } } - + private void AddNotifyInfo(DataSourceContext dsContext) { diff --git a/OpenContent/alpaca/js/fields/dnn/MLNumberField.js b/OpenContent/alpaca/js/fields/dnn/MLNumberField.js index c212c7be..f6e0b770 100644 --- a/OpenContent/alpaca/js/fields/dnn/MLNumberField.js +++ b/OpenContent/alpaca/js/fields/dnn/MLNumberField.js @@ -125,7 +125,6 @@ callback(); }, - /** * Validates if it is a float number. * @returns {Boolean} true if it is a float number diff --git a/OpenContent/alpaca/js/fields/dnn/MLTextField.js b/OpenContent/alpaca/js/fields/dnn/MLTextField.js index 68bbc95b..3c2ea5c4 100644 --- a/OpenContent/alpaca/js/fields/dnn/MLTextField.js +++ b/OpenContent/alpaca/js/fields/dnn/MLTextField.js @@ -35,7 +35,6 @@ this.olddata[this.defaultCulture] = this.data; } - if (this.culture != this.defaultCulture && this.olddata && this.olddata[this.defaultCulture]) { this.options.placeholder = this.olddata[this.defaultCulture]; } else if (this.olddata && Object.keys(this.olddata).length && this.olddata[Object.keys(this.olddata)[0]]) { @@ -100,8 +99,7 @@ } this.base(v); } - else - { + else { this.base(val); } }, @@ -117,7 +115,6 @@ var self = this; var el = this.getControlEl(); $(this.control.get(0)).after(''); - //$(this.control.get(0)).after('
    ' + this.culture + '
    '); callback(); }, diff --git a/OpenContent/alpaca/js/fields/dnn/dnnfields.js b/OpenContent/alpaca/js/fields/dnn/dnnfields.js index 61feea7a..57e1f72c 100644 --- a/OpenContent/alpaca/js/fields/dnn/dnnfields.js +++ b/OpenContent/alpaca/js/fields/dnn/dnnfields.js @@ -15245,7 +15245,6 @@ callback(); }, - /** * Validates if it is a float number. * @returns {Boolean} true if it is a float number @@ -15407,7 +15406,6 @@ this.olddata[this.defaultCulture] = this.data; } - if (this.culture != this.defaultCulture && this.olddata && this.olddata[this.defaultCulture]) { this.options.placeholder = this.olddata[this.defaultCulture]; } else if (this.olddata && Object.keys(this.olddata).length && this.olddata[Object.keys(this.olddata)[0]]) { @@ -15472,8 +15470,7 @@ } this.base(v); } - else - { + else { this.base(val); } }, @@ -15489,7 +15486,6 @@ var self = this; var el = this.getControlEl(); $(this.control.get(0)).after(''); - //$(this.control.get(0)).after('
    ' + this.culture + '
    '); callback(); }, From 0a9ff700d24976a90e4dc5b12d08bb55c051f1fe Mon Sep 17 00:00:00 2001 From: holoncom Date: Fri, 20 Dec 2019 11:51:13 +0100 Subject: [PATCH 31/34] Fix issue where old SortIndex data is not migrated corretly to Multi-Language SortIndex --- OpenContent/Components/OpenContentAPIController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenContent/Components/OpenContentAPIController.cs b/OpenContent/Components/OpenContentAPIController.cs index cfe65ae6..e4bc282e 100644 --- a/OpenContent/Components/OpenContentAPIController.cs +++ b/OpenContent/Components/OpenContentAPIController.cs @@ -681,6 +681,8 @@ public HttpResponseMessage ReOrder(List ids) var json = dsItem.Data; if (ml) // multi language { + if (json["SortIndex"].Type != JTokenType.Object) // old data-format (single-language) detected. Migrate to ML version. + json["SortIndex"] = new JObject(); json["SortIndex"][DnnLanguageUtils.GetCurrentCultureCode()] = i; } else From 41efee03bbc4cdc6a04bb8215560c02660e9c74a Mon Sep 17 00:00:00 2001 From: holoncom Date: Fri, 20 Dec 2019 13:45:18 +0100 Subject: [PATCH 32/34] Fix issue where Sorting on MLSortIndex did not work after Reindex. --- OpenContent/Components/Alpaca/FormBuilder.cs | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OpenContent/Components/Alpaca/FormBuilder.cs b/OpenContent/Components/Alpaca/FormBuilder.cs index c78c9722..87f621d3 100644 --- a/OpenContent/Components/Alpaca/FormBuilder.cs +++ b/OpenContent/Components/Alpaca/FormBuilder.cs @@ -358,6 +358,17 @@ private FieldConfig CreateFieldConfigFromSchemaAndOptionFile(string key) }; newConfig.Fields.Add(prop.Key, newField); } + else if (optType == "mlnumber") + { + var newField = new FieldConfig() + { + IndexType = "float", + Index = true, + Sort = true, + MultiLanguage = true + }; + newConfig.Fields.Add(prop.Key, newField); + } else if (prop.Value.Type == "number") { var newField = new FieldConfig() @@ -409,17 +420,6 @@ private FieldConfig CreateFieldConfigFromSchemaAndOptionFile(string key) }; newConfig.Fields.Add(prop.Key, newField); } - else if (optType == "mlnumber") - { - var newField = new FieldConfig() - { - IndexType = "float", - Index = true, - Sort = true, - MultiLanguage = true - }; - newConfig.Fields.Add(prop.Key, newField); - } else if (optType == "mlwysihtml") { var newField = new FieldConfig() From 0087a982030a7eb5459037d23d7146172a32c733 Mon Sep 17 00:00:00 2001 From: holoncom Date: Fri, 20 Dec 2019 21:21:26 +0100 Subject: [PATCH 33/34] Sync version of DLL with module manifest --- OpenContent/License.txt | 2 +- OpenContent/Properties/AssemblyInfo.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenContent/License.txt b/OpenContent/License.txt index 1bf3c5eb..84894148 100644 --- a/OpenContent/License.txt +++ b/OpenContent/License.txt @@ -1,7 +1,7 @@ 

    License

    - Copyright (c) 2016-2018 by Satrabel.be
    + Copyright (c) 2016-2020 by Satrabel.be
    www.satrabel.be

    diff --git a/OpenContent/Properties/AssemblyInfo.cs b/OpenContent/Properties/AssemblyInfo.cs index 9a296f3f..e5b70e25 100644 --- a/OpenContent/Properties/AssemblyInfo.cs +++ b/OpenContent/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Satrabel")] [assembly: AssemblyProduct("OpenContent")] -[assembly: AssemblyCopyright("Copyright © 2015-2019")] +[assembly: AssemblyCopyright("Copyright © 2015-2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -30,5 +30,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("04.03.00.0")] -[assembly: AssemblyFileVersion("04.03.00.0")] +[assembly: AssemblyVersion("04.04.00.0")] +[assembly: AssemblyFileVersion("04.04.00.0")] From 17442ee94f18443b88a4ede42503257843228b85 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Thu, 9 Jan 2020 16:19:43 +0100 Subject: [PATCH 34/34] fix cropfolder on fullexport --- OpenContent/Components/Export/FullExport.cs | 33 +++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/OpenContent/Components/Export/FullExport.cs b/OpenContent/Components/Export/FullExport.cs index 15338126..9d9a01ee 100644 --- a/OpenContent/Components/Export/FullExport.cs +++ b/OpenContent/Components/Export/FullExport.cs @@ -160,9 +160,14 @@ private void ExportTraverse(JObject alpaca, JToken json) { folder = optionsFolder + "/"; } - + var cropfolder = folder; + var optionsCropFolder = options?.Value("cropfolder"); + if (!string.IsNullOrEmpty(optionsCropFolder)) + { + cropfolder = optionsCropFolder + "/"; + } SaveFile(data?["url"].ToString(), folder); - SaveFile(data?["cropUrl"].ToString(), folder); + SaveFile(data?["cropUrl"].ToString(), cropfolder); } else if (optionsType == "mlimagex") { @@ -172,6 +177,12 @@ private void ExportTraverse(JObject alpaca, JToken json) { folder = optionsFolder + "/"; } + var cropfolder = folder; + var optionsCropFolder = options?.Value("cropfolder"); + if (!string.IsNullOrEmpty(optionsCropFolder)) + { + cropfolder = optionsCropFolder + "/"; + } if (json is JObject) { foreach (var item in (data as JObject).Children()) @@ -179,7 +190,7 @@ private void ExportTraverse(JObject alpaca, JToken json) if (item.Type == JTokenType.Object) { SaveFile(item.Value?["url"].ToString(), folder); - SaveFile(item.Value?["cropUrl"].ToString(), folder); + SaveFile(item.Value?["cropUrl"].ToString(), cropfolder); } } } @@ -244,7 +255,13 @@ private JToken ImportTraverse(JObject alpaca, JToken json) folder = optionsFolder + "/"; } ImportFile(data, "url", ModuleFilesFolder, folder, true); - ImportFile(data, "cropUrl", ModuleCroppedFolder, folder); + var cropfolder = folder; + var optionsCropFolder = options?.Value("cropfolder"); + if (!string.IsNullOrEmpty(optionsCropFolder)) + { + cropfolder = optionsCropFolder + "/"; + } + ImportFile(data, "cropUrl", ModuleCroppedFolder, cropfolder); } else if (optionsType == "mlimagex") { @@ -254,12 +271,18 @@ private JToken ImportTraverse(JObject alpaca, JToken json) { folder = optionsFolder + "/"; } + var cropfolder = folder; + var optionsCropFolder = options?.Value("cropfolder"); + if (!string.IsNullOrEmpty(optionsCropFolder)) + { + cropfolder = optionsCropFolder + "/"; + } if (json is JObject) { foreach (var item in (data as JObject).Children()) { ImportFile(item.Value, "url", ModuleFilesFolder, folder, true); - ImportFile(item.Value, "cropUrl", ModuleCroppedFolder, folder); + ImportFile(item.Value, "cropUrl", ModuleCroppedFolder, cropfolder); } } }