diff --git a/OpenContent/App_LocalResources/SharedResources.resx b/OpenContent/App_LocalResources/SharedResources.resx index cf662096..308e0dee 100644 --- a/OpenContent/App_LocalResources/SharedResources.resx +++ b/OpenContent/App_LocalResources/SharedResources.resx @@ -165,4 +165,10 @@ I want + + Other Portal + + + Portal + \ No newline at end of file diff --git a/OpenContent/Components/Common/Utils.cs b/OpenContent/Components/Common/Utils.cs index 46da372e..374b2efa 100644 --- a/OpenContent/Components/Common/Utils.cs +++ b/OpenContent/Components/Common/Utils.cs @@ -1,10 +1,22 @@ using System; +using System.Diagnostics; using System.Web; namespace Satrabel.OpenContent.Components { public static class Utils { + /// + /// Use to safely call Debugger.Break() + /// + /// + /// Never call Debugger.Break() without checking if Debugger is attached. We have observed weird errors when doing so. + /// + public static void DebuggerBreak() + { + if (Debugger.IsAttached) Debugger.Break(); + } + #region Url utils public static string RemoveQueryParams(this string url) diff --git a/OpenContent/Components/Datasource/DnnUsersDataSource.cs b/OpenContent/Components/Datasource/DnnUsersDataSource.cs index 0cf2064d..97fb7440 100644 --- a/OpenContent/Components/Datasource/DnnUsersDataSource.cs +++ b/OpenContent/Components/Datasource/DnnUsersDataSource.cs @@ -136,6 +136,8 @@ public override IDataItems GetAll(DataSourceContext context, Select selectQuery) pageSize = selectQuery.PageSize; var ruleDisplayName = selectQuery.Query.FilterRules.FirstOrDefault(f => f.Field == "DisplayName"); var ruleRoles = selectQuery.Query.FilterRules.FirstOrDefault(f => f.Field == "Roles"); + var ruleApproved = selectQuery.Query.FilterRules.FirstOrDefault(f => f.Field == "Approved"); + if (ruleDisplayName != null) { string displayName = ruleDisplayName.Value.AsString + "%"; @@ -151,6 +153,11 @@ public override IDataItems GetAll(DataSourceContext context, Select selectQuery) var roleNames = ruleRoles.MultiValue.Select(r => r.AsString).ToList(); users = users.Where(u => u.Roles.Intersect(roleNames).Any()); } + if (ruleApproved!= null) + { + var val = bool.Parse(ruleApproved.Value.AsString); + users = users.Where(u => u.Membership.Approved == val); + } } else { @@ -158,6 +165,8 @@ public override IDataItems GetAll(DataSourceContext context, Select selectQuery) } int excluded = users.Count() - users.Count(u => u.IsInRole("Administrators")); users = users.Where(u => !u.IsInRole("Administrators")); + + //users = users.Skip(pageIndex * pageSize).Take(pageSize); var dataList = new List(); foreach (var user in users) @@ -372,6 +381,7 @@ public IEnumerable GetIndexableData(DataSourceContext context) private static void ReIndexIfNeeded(int moduleid, int tabid, int portalId) { + if (PortalSettings.Current == null) return; // we can not reindex even if we wanted, because we are not in a regular http context (maybe console? scheduler? ashx?) var currentUserCount = UserController.GetUserCountByPortal(portalId); var userCountAtLastIndex = DnnUtils.GetPortalSetting("UserCountAtLastIndex", 0); if (currentUserCount != userCountAtLastIndex) diff --git a/OpenContent/Components/Datasource/IDataIndex.cs b/OpenContent/Components/Datasource/IDataIndex.cs index d0cadbbe..bf542199 100644 --- a/OpenContent/Components/Datasource/IDataIndex.cs +++ b/OpenContent/Components/Datasource/IDataIndex.cs @@ -6,6 +6,5 @@ namespace Satrabel.OpenContent.Components.Datasource public interface IDataIndex { IEnumerable GetIndexableData(DataSourceContext context); - // void Reindex(DataSourceContext context); } } diff --git a/OpenContent/Components/Datasource/OpenContentDataSource.cs b/OpenContent/Components/Datasource/OpenContentDataSource.cs index aaab9c46..3ed54c1f 100644 --- a/OpenContent/Components/Datasource/OpenContentDataSource.cs +++ b/OpenContent/Components/Datasource/OpenContentDataSource.cs @@ -231,13 +231,13 @@ public virtual IDataItems GetAll(DataSourceContext context, Select selectQuery) private static SelectQueryDefinition BuildQuery(DataSourceContext context, Select selectQuery) { SelectQueryDefinition def = new SelectQueryDefinition(); - def.Build(selectQuery); + def.Build(selectQuery, context.CurrentCultureCode); if (LogContext.IsLogActive) { var logKey = "Lucene query"; - LogContext.Log(context.ActiveModuleId, logKey, "Filter", def.Filter.ToString()); - LogContext.Log(context.ActiveModuleId, logKey, "Query", def.Query.ToString()); - LogContext.Log(context.ActiveModuleId, logKey, "Sort", def.Sort.ToString()); + LogContext.Log(context.ActiveModuleId, logKey, "Filter", def.Filter?.ToString()); + LogContext.Log(context.ActiveModuleId, logKey, "Query", def.Query?.ToString()); + LogContext.Log(context.ActiveModuleId, logKey, "Sort", def.Sort?.ToString()); LogContext.Log(context.ActiveModuleId, logKey, "PageIndex", def.PageIndex); LogContext.Log(context.ActiveModuleId, logKey, "PageSize", def.PageSize); } @@ -359,7 +359,7 @@ public virtual JToken Action(DataSourceContext context, string action, IDataItem { ModuleId = GetModuleId(context), Collection = "Submissions", - Title = item.Data["Title"] == null ? "Form" : item.Data["Title"].ToString(), + Title = item?.Data["Title"] == null ? "Form" : item.Data["Title"].ToString(), Json = data["form"].ToString(), CreatedByUserId = context.UserId, CreatedOnDate = DateTime.Now, @@ -374,7 +374,7 @@ public virtual JToken Action(DataSourceContext context, string action, IDataItem // LuceneController.Instance.Add(content, indexConfig); // LuceneController.Instance.Commit(); //} - return FormUtils.FormSubmit(data as JObject, item.Data.DeepClone() as JObject); + return FormUtils.FormSubmit(data as JObject, item?.Data?.DeepClone() as JObject); } return null; } diff --git a/OpenContent/Components/Datasource/search/StringRuleValue.cs b/OpenContent/Components/Datasource/search/StringRuleValue.cs index c9df63fd..ebd50d9e 100644 --- a/OpenContent/Components/Datasource/search/StringRuleValue.cs +++ b/OpenContent/Components/Datasource/search/StringRuleValue.cs @@ -1,4 +1,6 @@ -namespace Satrabel.OpenContent.Components.Datasource.Search +using System; + +namespace Satrabel.OpenContent.Components.Datasource.Search { public class StringRuleValue : RuleValue { @@ -8,5 +10,12 @@ public StringRuleValue(string value) _value = value; } public override string AsString => _value; + + public override float AsFloat => float.Parse(_value); + public override int AsInteger => int.Parse(_value); + public override bool AsBoolean => bool.Parse(_value); + public override long AsLong => long.Parse(_value); + + public override DateTime AsDateTime => DateTime.Parse(_value, null, System.Globalization.DateTimeStyles.RoundtripKind); } } \ No newline at end of file diff --git a/OpenContent/Components/Dnn/DnnLanguageUtils.cs b/OpenContent/Components/Dnn/DnnLanguageUtils.cs index e2ba795d..44c2b383 100644 --- a/OpenContent/Components/Dnn/DnnLanguageUtils.cs +++ b/OpenContent/Components/Dnn/DnnLanguageUtils.cs @@ -12,7 +12,7 @@ namespace Satrabel.OpenContent.Components public static class DnnLanguageUtils { /// - /// Gets the current culture code. + /// Gets the current culture code. Format en-US. /// This code is based on long expierence of how hard it is to get the correct value. /// public static string GetCurrentCultureCode() diff --git a/OpenContent/Components/Dnn/DnnUrlUtils.cs b/OpenContent/Components/Dnn/DnnUrlUtils.cs index db4cacd7..4611367b 100644 --- a/OpenContent/Components/Dnn/DnnUrlUtils.cs +++ b/OpenContent/Components/Dnn/DnnUrlUtils.cs @@ -72,10 +72,10 @@ internal static string NavigateUrl(int tabId, PortalSettings portalSettings, str return Globals.NavigateURL(tabId, isSuperTab, portalSettings, "", currentCultureCode); } - internal static string NavigateUrl(int detailTabId, PortalSettings portalSettings, string pagename, params string[] additionalParameters) + internal static string NavigateUrl(int detailTabId, string currentCultureCode, PortalSettings portalSettings, string pagename, params string[] additionalParameters) { var isSuperTab = Globals.IsHostTab(detailTabId); - var url = Globals.NavigateURL(detailTabId, isSuperTab, portalSettings, "", DnnLanguageUtils.GetCurrentCultureCode(), pagename, additionalParameters); + var url = Globals.NavigateURL(detailTabId, isSuperTab, portalSettings, "", currentCultureCode, pagename, additionalParameters); return url; } diff --git a/OpenContent/Components/Dnn/DnnUtils.cs b/OpenContent/Components/Dnn/DnnUtils.cs index 0fea3ec9..c0bddb8d 100644 --- a/OpenContent/Components/Dnn/DnnUtils.cs +++ b/OpenContent/Components/Dnn/DnnUtils.cs @@ -83,15 +83,15 @@ public static bool IsPublishedTab(this TabInfo tab) public static OpenContentSettings OpenContentSettings(this ModuleInfo module) { - return new OpenContentSettings(ComponentSettingsInfo.Create(module.ModuleSettings)); + return new OpenContentSettings(ComponentSettingsInfo.Create(module.ModuleSettings, module.TabModuleSettings)); } public static OpenContentSettings OpenContentSettings(this ModuleInstanceContext module) { - return new OpenContentSettings(ComponentSettingsInfo.Create(module.Settings)); + return new OpenContentSettings(ComponentSettingsInfo.Create(module.Settings, null)); } public static OpenContentSettings OpenContentSettings(this PortalModuleBase module) { - return new OpenContentSettings(ComponentSettingsInfo.Create(module.Settings)); + return new OpenContentSettings(ComponentSettingsInfo.Create(module.Settings, null)); } internal static void RegisterScript(Page page, string sourceFolder, string jsfilename, int jsOrder, string provider = "DnnBodyProvider") diff --git a/OpenContent/Components/FeatureController.cs b/OpenContent/Components/FeatureController.cs index 70310f12..31a8b702 100644 --- a/OpenContent/Components/FeatureController.cs +++ b/OpenContent/Components/FeatureController.cs @@ -41,7 +41,7 @@ public class FeatureController : ModuleSearchBase, IPortable, IUpgradeable, IMod public string ExportModule(int moduleId) { string xml = ""; - OpenContentController ctrl = new OpenContentController(); + OpenContentController ctrl = new OpenContentController(PortalSettings.Current.PortalId); var items = ctrl.GetContents(moduleId); xml += ""; foreach (var item in items) diff --git a/OpenContent/Components/FileUploadController.cs b/OpenContent/Components/FileUploadController.cs index 7a54afee..aae42682 100644 --- a/OpenContent/Components/FileUploadController.cs +++ b/OpenContent/Components/FileUploadController.cs @@ -205,8 +205,6 @@ private void UploadWholeFile(HttpContextBase context, ICollection s } } - - public static string CleanUpFileName(string filename) { var newName = HttpUtility.UrlDecode(filename); diff --git a/OpenContent/Components/Form/FormUtils.cs b/OpenContent/Components/Form/FormUtils.cs index 3ff5ad89..77c9da24 100644 --- a/OpenContent/Components/Form/FormUtils.cs +++ b/OpenContent/Components/Form/FormUtils.cs @@ -136,7 +136,7 @@ public static string SendMail(string mailFrom, string mailTo, string replyTo, st DotNetNuke.Services.Mail.MailPriority priority = DotNetNuke.Services.Mail.MailPriority.Normal; MailFormat bodyFormat = MailFormat.Html; Encoding bodyEncoding = Encoding.UTF8; - + string smtpServer = Host.SMTPServer; string smtpAuthentication = Host.SMTPAuthentication; string smtpUsername = Host.SMTPUsername; @@ -301,7 +301,26 @@ public static JObject FormSubmit(JObject form, SettingsDTO settings, JObject ite string body = formData; if (!string.IsNullOrEmpty(notification.EmailBody)) { - body = hbs.Execute(notification.EmailBody, data); + try + { + body = hbs.Execute(notification.EmailBody, data); + } + catch (Exception ex) + { + throw new Exception("Email Body : " + ex.Message, ex); + } + } + string subject = notification.EmailSubject; + if (!string.IsNullOrEmpty(notification.EmailSubject)) + { + try + { + subject = hbs.Execute(notification.EmailSubject, data); + } + catch (Exception ex) + { + throw new Exception("Email Subject : " + ex.Message, ex); + } } var attachements = new List(); if (form["Files"] is JArray) @@ -312,7 +331,7 @@ public static JObject FormSubmit(JObject form, SettingsDTO settings, JObject ite 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); + string send = FormUtils.SendMail(from.ToString(), to.ToString(), reply?.ToString() ?? "", notification.CcEmails, notification.BccEmails, subject, body, attachements); if (!string.IsNullOrEmpty(send)) { errors.Add("From:" + from.ToString() + " - To:" + to.ToString() + " - " + send); @@ -320,7 +339,7 @@ public static JObject FormSubmit(JObject form, SettingsDTO settings, JObject ite } catch (Exception exc) { - errors.Add("Notification " + (settings.Notifications.IndexOf(notification) + 1) + " : " + exc.Message); + errors.Add("Error in Email Notification " + (settings.Notifications.IndexOf(notification) + 1) + " : " + exc.Message); App.Services.Logger.Error(exc); } } @@ -343,6 +362,7 @@ public static JObject FormSubmit(JObject form, SettingsDTO settings, JObject ite } var res = new JObject(); res["message"] = message; + res["errors"] = new JArray(errors); return res; } return null; diff --git a/OpenContent/Components/Handlebars/HandlebarsEngine.cs b/OpenContent/Components/Handlebars/HandlebarsEngine.cs index 60727ee7..5901e7de 100644 --- a/OpenContent/Components/Handlebars/HandlebarsEngine.cs +++ b/OpenContent/Components/Handlebars/HandlebarsEngine.cs @@ -58,7 +58,7 @@ public void Compile(string source) catch (Exception ex) { App.Services.Logger.Error($"Failed to render Handlebar template source:[{source}]", ex); - throw new TemplateException("Failed to render Handlebar template " + source, ex, null, source); + throw new TemplateException("Failed to render Handlebar template " + ex.Message, ex, null, source); } } @@ -72,7 +72,7 @@ public string Execute(Dictionary model) catch (Exception ex) { App.Services.Logger.Error(string.Format("Failed to execute Handlebar template with model:[{1}]", "", model), ex); - throw new TemplateException("Failed to render Handlebar template ", ex, model, ""); + throw new TemplateException("Failed to render Handlebar template : "+ex.Message, ex, model, ""); } } @@ -87,7 +87,7 @@ public string Execute(string source, object model) catch (Exception ex) { App.Services.Logger.Error($"Failed to render Handlebar template source:[{source}], model:[{model}]", ex); - throw new TemplateException("Failed to render Handlebar template ", ex, model, source); + throw new TemplateException("Failed to render Handlebar template : " + ex.Message, ex, model, source); } } public string ExecuteWithoutFaillure(string source, Dictionary model, string defaultValue) @@ -613,7 +613,7 @@ private static void RegisterEmailHelper(HandlebarsDotNet.IHandlebars hbs) private static void RegisterUrlHelper(HandlebarsDotNet.IHandlebars hbs) { - hbs.RegisterHelper("url", (writer, context, parameters) => + hbs.RegisterHelper("prefixurl", (writer, context, parameters) => { try { @@ -621,7 +621,7 @@ private static void RegisterUrlHelper(HandlebarsDotNet.IHandlebars hbs) string lowerUrl = url.ToLower(); if (!lowerUrl.StartsWith("http://") && !lowerUrl.StartsWith("https://") && - !lowerUrl.StartsWith("phone:") && + !lowerUrl.StartsWith("tel:") && !lowerUrl.StartsWith("mail:")) { if (IsEmailAdress(url)) @@ -630,7 +630,7 @@ private static void RegisterUrlHelper(HandlebarsDotNet.IHandlebars hbs) } else if (IsPhoneNumber(url)) { - url = "phone:" + url; + url = "tel:" + url; } else { diff --git a/OpenContent/Components/InitAPIController.cs b/OpenContent/Components/InitAPIController.cs index 381ad0e8..21af8c82 100644 --- a/OpenContent/Components/InitAPIController.cs +++ b/OpenContent/Components/InitAPIController.cs @@ -29,6 +29,7 @@ using DotNetNuke.Entities.Tabs; using System.Web.Hosting; using Satrabel.OpenContent.Components.Logging; +using DotNetNuke.Entities.Portals; #endregion @@ -39,6 +40,25 @@ public class InitAPIController : DnnApiController { public object TemplateAvailable { get; private set; } + [ValidateAntiForgeryToken] + [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Admin)] + [HttpGet] + public List GetPortals() + { + IEnumerable portals = (new PortalController()).GetPortals().Cast(); + var listItems = new List(); + foreach (var item in portals) + { + var li = new PortalDto() + { + Text = item.PortalName, + PortalId= item.PortalID + }; + listItems.Add(li); + } + return listItems.OrderBy(x => x.Text).ToList(); + } + [ValidateAntiForgeryToken] [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Admin)] [HttpGet] @@ -53,22 +73,31 @@ public List GetModules() { var tc = new TabController(); var tab = tc.GetTab(item.TabID, ActiveModule.PortalID, false); + //if (!tab.IsNeutralCulture && tab.CultureCode != DnnLanguageUtils.GetCurrentCultureCode()) + //{ + // // skip other cultures + // continue; + //} + var tabpath = tab.TabPath.Replace("//", "/").Trim('/'); if (!tab.IsNeutralCulture && tab.CultureCode != DnnLanguageUtils.GetCurrentCultureCode()) { // skip other cultures - continue; + //continue; } - var tabpath = tab.TabPath.Replace("//", "/").Trim('/'); - var li = new ModuleDto() + else { - Text = string.Format("{1} - {0}", item.ModuleTitle, tabpath), - TabModuleId = item.TabModuleID - }; - listItems.Add(li); + var li = new ModuleDto() + { + Text = string.Format("{1} - {0}", item.ModuleTitle, tabpath), + TabModuleId = item.TabModuleID + }; + listItems.Add(li); + } } } return listItems.OrderBy(x => x.Text).ToList(); } + [ValidateAntiForgeryToken] [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Admin)] [HttpGet] @@ -420,10 +449,14 @@ public class TemplateDto public string Value { get; set; } } +public class PortalDto +{ + public string Text { get; set; } + public int PortalId { get; set; } +} + public class ModuleDto { public string Text { get; set; } public int TabModuleId { get; set; } } - - diff --git a/OpenContent/Components/Json/JsonUtils.cs b/OpenContent/Components/Json/JsonUtils.cs index 9a90d5e6..9b30e828 100644 --- a/OpenContent/Components/Json/JsonUtils.cs +++ b/OpenContent/Components/Json/JsonUtils.cs @@ -105,13 +105,13 @@ public static Dictionary JsonToDictionary(string json) { var jsSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); - if(json.Length >= jsSerializer.MaxJsonLength ) + 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); + Dictionary model = (Dictionary)jsSerializer.DeserializeObject(json); return model; //return ToDictionaryNoCase(model); } @@ -311,7 +311,7 @@ public static void LookupJson(JObject o, JObject additionalData, JObject schema, } catch (System.Exception) { - Debugger.Break(); + Utils.DebuggerBreak(); } } } @@ -330,7 +330,7 @@ public static void LookupJson(JObject o, JObject additionalData, JObject schema, } catch (System.Exception) { - Debugger.Break(); + Utils.DebuggerBreak(); } } } @@ -362,7 +362,7 @@ public static void LookupJson(JObject o, JObject additionalData, JObject schema, } catch (System.Exception) { - Debugger.Break(); + Utils.DebuggerBreak(); } } else if (include && !string.IsNullOrEmpty(collection)) @@ -374,7 +374,7 @@ public static void LookupJson(JObject o, JObject additionalData, JObject schema, } catch (System.Exception) { - Debugger.Break(); + Utils.DebuggerBreak(); } } else if (includelabels && enums != null && labels != null) diff --git a/OpenContent/Components/Lucene/LuceneController.cs b/OpenContent/Components/Lucene/LuceneController.cs index b201cdbe..b7c2bf7a 100644 --- a/OpenContent/Components/Lucene/LuceneController.cs +++ b/OpenContent/Components/Lucene/LuceneController.cs @@ -73,7 +73,10 @@ public SearchResults Search(string type, Query filter, Query query, Sort sort, i App.Config.LuceneIndexAllDelegate(); //execute the IndexAll delegate return luceneResults; } - + if (query == null) + { + query = new MatchAllDocsQuery(); + } var searcher = Store.GetSearcher(); TopDocs topDocs; var numOfItemsToReturn = (pageIndex + 1) * pageSize; @@ -82,6 +85,9 @@ public SearchResults Search(string type, Query filter, Query query, Sort sort, i else topDocs = Search(searcher, type, filter, query, numOfItemsToReturn, sort); luceneResults.TotalResults = topDocs.TotalHits; + + //App.Services.Logger.Error("Search:" + string.Join(",", topDocs.ScoreDocs.Select(d => d.Score.ToString()))); + luceneResults.ids = topDocs.ScoreDocs.Skip(pageIndex * pageSize) .Select(d => searcher.Doc(d.Doc).GetField(JsonMappingUtils.FIELD_ID).StringValue) .ToArray(); diff --git a/OpenContent/Components/Lucene/LuceneUtils.cs b/OpenContent/Components/Lucene/LuceneUtils.cs index 505b3918..b23f53cf 100644 --- a/OpenContent/Components/Lucene/LuceneUtils.cs +++ b/OpenContent/Components/Lucene/LuceneUtils.cs @@ -69,7 +69,7 @@ private static void RegisterAllIndexableData(LuceneController lc) foreach (var module in modules) { if (!OpenContentUtils.CheckOpenContentTemplateFiles(module)) { continue; } - if (module.IsListMode() && module.Settings.Manifest.Index) + if (module.IsListMode() && module.Settings.Manifest.Index) { RegisterModuleDataForIndexing(lc, module); } @@ -81,7 +81,7 @@ private static void RegisterAllIndexableData(LuceneController lc) private static void RegisterModuleDataForIndexing(LuceneController lc, OpenContentModuleConfig module) { var indexableData = GetModuleIndexableData(module); - var dataExample = indexableData?.ToList().FirstOrDefault(); + var dataExample = indexableData.FirstOrDefault(); if (dataExample == null) return; var indexConfig = OpenContentUtils.GetIndexConfig(module.Settings.Template); //todo index is being build from schema & options. But they should be provided by the provider, not directly from the files @@ -91,7 +91,7 @@ private static void RegisterModuleDataForIndexing(LuceneController lc, OpenConte lc.AddList(indexableData, indexConfig, scope); } - private static IEnumerable GetModuleIndexableData(OpenContentModuleConfig module) + private static List GetModuleIndexableData(OpenContentModuleConfig module) { bool index = false; var settings = module.Settings; @@ -107,7 +107,7 @@ private static IEnumerable GetModuleIndexableData(OpenContentMod var dsContext = OpenContentUtils.CreateDataContext(module); var dataIndex = (IDataIndex)ds; - return dataIndex.GetIndexableData(dsContext); + return dataIndex.GetIndexableData(dsContext).ToList(); } #endregion diff --git a/OpenContent/Components/Lucene/Mapping/JsonMappingUtils.cs b/OpenContent/Components/Lucene/Mapping/JsonMappingUtils.cs index 5b711d44..ba0ffe24 100644 --- a/OpenContent/Components/Lucene/Mapping/JsonMappingUtils.cs +++ b/OpenContent/Components/Lucene/Mapping/JsonMappingUtils.cs @@ -1,12 +1,15 @@ using System; using Lucene.Net.Analysis; using Lucene.Net.Analysis.Standard; +using Lucene.Net.Analysis.Fr; +using Lucene.Net.Analysis.Nl; using Lucene.Net.Documents; using Lucene.Net.Index; using Lucene.Net.QueryParsers; using Lucene.Net.Search; using Newtonsoft.Json.Linq; using Satrabel.OpenContent.Components.Lucene.Config; +using System.IO; namespace Satrabel.OpenContent.Components.Lucene.Mapping { @@ -71,10 +74,14 @@ public static Filter GetTypeFilter(string type, Query filter) return resultFilter; } - public static Analyzer GetAnalyser() + public static Analyzer GetAnalyser(string cultureCode="") { - var analyser = new StandardAnalyzer(global::Lucene.Net.Util.Version.LUCENE_30); - return analyser; + if (cultureCode.StartsWith("fr")) + return new FrenchAnalyzer(global::Lucene.Net.Util.Version.LUCENE_30); + else if (cultureCode.StartsWith("nl")) + return new DutchAnalyzer(global::Lucene.Net.Util.Version.LUCENE_30); + else + return new StandardAnalyzer(global::Lucene.Net.Util.Version.LUCENE_30); } public static TermQuery CreateTypeQuery(string type) @@ -82,4 +89,21 @@ public static TermQuery CreateTypeQuery(string type) return new TermQuery(new Term(FIELD_TYPE, type)); } } + + public class ASCIIFoldingAnalyzer : Analyzer + { + private readonly Analyzer subAnalyzer; + + public ASCIIFoldingAnalyzer(Analyzer subAnalyzer) + { + this.subAnalyzer = subAnalyzer; + } + + public override TokenStream TokenStream(string fieldName, TextReader reader) + { + var result = subAnalyzer.TokenStream(fieldName, reader); + result = new ASCIIFoldingFilter(result); + return result; + } + } } diff --git a/OpenContent/Components/Lucene/Mapping/JsonObjectMapper.cs b/OpenContent/Components/Lucene/Mapping/JsonObjectMapper.cs index cb7ce014..20920bbc 100644 --- a/OpenContent/Components/Lucene/Mapping/JsonObjectMapper.cs +++ b/OpenContent/Components/Lucene/Mapping/JsonObjectMapper.cs @@ -91,6 +91,14 @@ private static void Add(Document doc, string prefix, JToken token, FieldConfig f { index = fieldconfig.Index; sort = fieldconfig.Sort; + if (fieldconfig.IndexType == "datetime" && value.Type == JTokenType.String) + { + DateTime d; + if (DateTime.TryParse(value.Value.ToString(), null, System.Globalization.DateTimeStyles.RoundtripKind, out d)) + { + value = new JValue(d); + } + } } switch (value.Type) //todo: simple date gets detected as string @@ -142,7 +150,6 @@ private static void Add(Document doc, string prefix, JToken token, FieldConfig f else { doc.Add(new NumericField(prefix, Field.Store.NO, true).SetFloatValue((float)Convert.ToDouble(value.Value))); - //doc.Add(new NumericField(prefix, Field.Store.NO, true).SetDoubleValue(Convert.ToDouble(value.Value))); } } break; @@ -158,7 +165,6 @@ private static void Add(Document doc, string prefix, JToken token, FieldConfig f if (index || sort) { doc.Add(new NumericField(prefix, Field.Store.NO, true).SetFloatValue((float)Convert.ToInt64(value.Value))); - //doc.Add(new NumericField(prefix, Field.Store.NO, true).SetLongValue(Convert.ToInt64(value.Value))); } break; diff --git a/OpenContent/Components/Lucene/SelectQueryDefinition.cs b/OpenContent/Components/Lucene/SelectQueryDefinition.cs index 7b709b98..30eea89a 100644 --- a/OpenContent/Components/Lucene/SelectQueryDefinition.cs +++ b/OpenContent/Components/Lucene/SelectQueryDefinition.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; +using System.Text; using Lucene.Net.Index; using Lucene.Net.QueryParsers; using Lucene.Net.Search; @@ -12,9 +14,11 @@ namespace Satrabel.OpenContent.Components.Lucene { public class SelectQueryDefinition { + private static readonly Query _DefaultQuery = new MatchAllDocsQuery(); + public SelectQueryDefinition() { - Query = new MatchAllDocsQuery(); + Query = _DefaultQuery; Sort = Sort.RELEVANCE; PageSize = 100; } @@ -28,8 +32,17 @@ public SelectQueryDefinition Build(Select select) { BuildPage(select); Filter = BuildFilter(select.Filter); - Query = BuildFilter(select.Query); - BuildSort(select); + Query = BuildFilter(select.Query, ""); + Sort = BuildSort(select); + return this; + } + + public SelectQueryDefinition Build(Select select, string cultureCode) + { + BuildPage(select); + Filter = BuildFilter(select.Filter); + Query = BuildFilter(select.Query, cultureCode); + Sort = BuildSort(select); return this; } @@ -43,16 +56,25 @@ private SelectQueryDefinition BuildPage(Select select) return this; } - private static Query BuildFilter(FilterGroup filter) + private static Query BuildFilter(FilterGroup filter, string cultureCode = "") { BooleanQuery q = new BooleanQuery(); - q.Add(new MatchAllDocsQuery(), Occur.MUST); + //if (filter.FilterRules.Count == 0 && filter.FilterGroups.Count == 0) + //{ + // q.Add(new MatchAllDocsQuery(), Occur.MUST); + //} + + if (filter.FilterRules.Count > 0 && filter.FilterRules.All(r => r.FieldOperator == OperatorEnum.NOT_EQUAL)) + { + q.Add(new MatchAllDocsQuery(), Occur.MUST); + } + Occur cond = Occur.MUST; // AND if (filter.Condition == ConditionEnum.OR) { cond = Occur.SHOULD; } - AddRules(q, filter.FilterRules, cond); + AddRules(q, filter.FilterRules, cond, cultureCode); foreach (var rule in filter.FilterGroups) { Occur groupCond = Occur.MUST; // AND @@ -61,14 +83,18 @@ private static Query BuildFilter(FilterGroup filter) groupCond = Occur.SHOULD; } BooleanQuery groupQ = new BooleanQuery(); - AddRules(groupQ, rule.FilterRules, groupCond); + AddRules(groupQ, rule.FilterRules, groupCond, cultureCode); q.Add(groupQ, cond); } q = q.Clauses.Count > 0 ? q : null; + + if (q == null) + return _DefaultQuery; + return q; } - private static void AddRules(BooleanQuery q, List filterRules, Occur cond) + private static void AddRules(BooleanQuery q, List filterRules, Occur cond, string cultureCode = "") { foreach (var rule in filterRules) { @@ -83,6 +109,12 @@ private static void AddRules(BooleanQuery q, List filterRules, Occur int ival = rule.Value.AsBoolean ? 1 : 0; q.Add(NumericRangeQuery.NewIntRange(fieldName, ival, ival, true, true), cond); } + else if (rule.FieldType == FieldTypeEnum.DATETIME) + { + var startDate = rule.Value.AsDateTime; + var endDate = rule.Value.AsDateTime; + q.Add(NumericRangeQuery.NewLongRange(fieldName, startDate.Ticks, endDate.Ticks, true, true), cond); + } else if (rule.FieldType == FieldTypeEnum.FLOAT) { float fval = rule.Value.AsFloat; @@ -90,7 +122,7 @@ private static void AddRules(BooleanQuery q, List filterRules, Occur } else if (rule.FieldType == FieldTypeEnum.STRING || rule.FieldType == FieldTypeEnum.TEXT || rule.FieldType == FieldTypeEnum.HTML) { - q.Add(ParseQuery(rule.Value.AsString + "*", fieldName), cond); + q.Add(ParseQuery(rule.Value.AsString + "*", fieldName, cultureCode), cond); } else { @@ -106,7 +138,7 @@ private static void AddRules(BooleanQuery q, List filterRules, Occur { if (rule.FieldType == FieldTypeEnum.STRING || rule.FieldType == FieldTypeEnum.TEXT || rule.FieldType == FieldTypeEnum.HTML) { - q.Add(ParseQuery(rule.Value.AsString + "*", fieldName), cond); + q.Add(ParseQuery(rule.Value.AsString + "*", fieldName, cultureCode), cond); } else { @@ -182,15 +214,17 @@ private static void AddRules(BooleanQuery q, List filterRules, Occur } } - public static Query ParseQuery(string searchQuery, string defaultFieldName) + public static Query ParseQuery(string searchQuery, string defaultFieldName, string CultureCode = "") { - var parser = new QueryParser(Version.LUCENE_30, defaultFieldName, JsonMappingUtils.GetAnalyser()); + searchQuery = RemoveDiacritics(searchQuery); + searchQuery = searchQuery.Replace('-', ' '); // concider '-' as a space + var parser = new QueryParser(Version.LUCENE_30, defaultFieldName, JsonMappingUtils.GetAnalyser(CultureCode)); Query query; try { if (string.IsNullOrEmpty(searchQuery)) { - query = new MatchAllDocsQuery(); + query = _DefaultQuery; } else { @@ -199,26 +233,39 @@ public static Query ParseQuery(string searchQuery, string defaultFieldName) } catch (ParseException) { - query = searchQuery != null ? parser.Parse(QueryParser.Escape(searchQuery.Trim())) : new MatchAllDocsQuery(); + query = searchQuery != null ? parser.Parse(QueryParser.Escape(searchQuery.Trim())) : _DefaultQuery; } return query; } - private SelectQueryDefinition BuildSort(Select select) + public static string RemoveDiacritics(string text) + { + if (string.IsNullOrWhiteSpace(text)) + return text; + + text = text.Normalize(NormalizationForm.FormD); + var chars = text.Where(c => CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark).ToArray(); + return new string(chars).Normalize(NormalizationForm.FormC); + } + + private static Sort BuildSort(Select select) { - var sort = Sort.RELEVANCE; + var sortFields = new List(); + if (!select.Sort.Any()) { - SortRule sortOneCreateDate = new SortRule + // if no sorting is specified, then sort on score and on sortOnCreateDate + sortFields.Add(SortField.FIELD_SCORE); + + var sortOnCreateDate = new SortRule { Field = "createdondate", FieldType = FieldTypeEnum.DATETIME, Descending = false }; - select.Sort.Add(sortOneCreateDate); + select.Sort.Add(sortOnCreateDate); } - - var sortFields = new List(); + foreach (var rule in select.Sort) { int sortfieldtype; @@ -229,10 +276,9 @@ private SelectQueryDefinition BuildSort(Select select) sortFields.Add(new SortField(sortFieldPrefix + rule.Field, sortfieldtype, rule.Descending)); } - sort = new Sort(sortFields.ToArray()); + var sort = new Sort(sortFields.ToArray()); - Sort = sort; - return this; + return sort; } private static void Sortfieldtype(FieldTypeEnum fieldType, out int sortfieldtype, ref string sortFieldPrefix) diff --git a/OpenContent/Components/Manifest/Manifest.cs b/OpenContent/Components/Manifest/Manifest.cs index 969f9485..4003699f 100644 --- a/OpenContent/Components/Manifest/Manifest.cs +++ b/OpenContent/Components/Manifest/Manifest.cs @@ -42,6 +42,9 @@ public class Manifest [JsonProperty(PropertyName = "detailUrl")] public string DetailUrl { get; set; } + [JsonProperty(PropertyName = "mainMeta")] + public string MainMeta { get; set; } + [JsonProperty(PropertyName = "additionalData")] public Dictionary AdditionalDataDefinition { diff --git a/OpenContent/Components/Manifest/OpenContentModuleConfig.cs b/OpenContent/Components/Manifest/OpenContentModuleConfig.cs index b3f1da44..f4e711c4 100644 --- a/OpenContent/Components/Manifest/OpenContentModuleConfig.cs +++ b/OpenContent/Components/Manifest/OpenContentModuleConfig.cs @@ -16,6 +16,7 @@ public class OpenContentModuleConfig : IOpenContentModuleInfo private OpenContentModuleInfo _dataModule; private OpenContentSettings _settings; private readonly IDictionary _moduleSettings; + private readonly IDictionary _tabModuleSettings; private readonly PortalSettings _portalSettings; private OpenContentModuleConfig(ModuleInfo viewModule, PortalSettings portalSettings) @@ -23,6 +24,7 @@ private OpenContentModuleConfig(ModuleInfo viewModule, PortalSettings portalSett ViewModule = new OpenContentModuleInfo(viewModule); PortalId = viewModule.PortalID; _moduleSettings = viewModule.ModuleSettings; + _tabModuleSettings = viewModule.TabModuleSettings; _portalSettings = portalSettings; } @@ -59,7 +61,7 @@ public OpenContentSettings Settings get { if (_settings == null) - _settings = new OpenContentSettings(ComponentSettingsInfo.Create(_moduleSettings)); + _settings = new OpenContentSettings(ComponentSettingsInfo.Create(_moduleSettings, _tabModuleSettings)); return _settings; } } @@ -86,9 +88,9 @@ public string GetUrl(int detailTabId, string getCurrentCultureCode) return DnnUrlUtils.NavigateUrl(detailTabId, _portalSettings, getCurrentCultureCode); } - internal string GetUrl(int detailTabId, string pagename, string idParam) + internal string GetUrl(int detailTabId, string cultureCode, string pagename, string idParam) { - return DnnUrlUtils.NavigateUrl(detailTabId, _portalSettings, pagename, idParam); + return DnnUrlUtils.NavigateUrl(detailTabId, cultureCode, _portalSettings, pagename, idParam); } public string EditUrl(string id, string itemId, int viewModuleModuleId) diff --git a/OpenContent/Components/OpenContentAPIController.cs b/OpenContent/Components/OpenContentAPIController.cs index e4bc282e..bc79738b 100644 --- a/OpenContent/Components/OpenContentAPIController.cs +++ b/OpenContent/Components/OpenContentAPIController.cs @@ -671,18 +671,36 @@ public HttpResponseMessage ReOrder(List ids) int i = 1; foreach (var id in ids) { + if (id == "-1") continue; // ignore items explicitly marked with id -1; var dsItem = ds.Get(dsContext, id); if (dsItem == null) { - Debugger.Break(); // this should never happen: investigate! + Utils.DebuggerBreak(); // 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 { - if (json["SortIndex"].Type != JTokenType.Object) // old data-format (single-language) detected. Migrate to ML version. + #region Normalize irregulatities with SortIndex field + // if old data-format (single-language) detected. Migrate to ML version. + if (json["SortIndex"] == null || json["SortIndex"].Type != JTokenType.Object) + { json["SortIndex"] = new JObject(); + } + + // if not all site languages initialized, then give them a default value. + var langList = DnnLanguageUtils.GetPortalLocales(this.PortalSettings.PortalId); + if (json["SortIndex"].Count() != langList.Count) + { + foreach (var locale in langList) + { + json["SortIndex"][locale.Key] = i; + } + } + #endregion + + // Set the new SortIndex value for this item. json["SortIndex"][DnnLanguageUtils.GetCurrentCultureCode()] = i; } else diff --git a/OpenContent/Components/Querying/QueryBuilder.cs b/OpenContent/Components/Querying/QueryBuilder.cs index b157fe75..e5ab9c7d 100644 --- a/OpenContent/Components/Querying/QueryBuilder.cs +++ b/OpenContent/Components/Querying/QueryBuilder.cs @@ -124,6 +124,19 @@ private QueryBuilder BuildFilter(JObject query, bool addWorkflowFilter, int user }); } } + else if (fieldConfig != null && fieldConfig.IndexType == "datetime") + { + DateTime dval; + if (DateTime.TryParse(val, null, System.Globalization.DateTimeStyles.RoundtripKind, out dval)) + { + workFlowFilter.AddRule(new FilterRule() + { + Field = item.Name, + FieldType = FieldTypeEnum.DATETIME, + Value = new DateTimeRuleValue(dval) + }); + } + } else if (!string.IsNullOrEmpty(val)) { workFlowFilter.AddRule(FieldConfigUtils.CreateFilterRule(_indexConfig, cultureCode, diff --git a/OpenContent/Components/Render/ModelFactoryBase.cs b/OpenContent/Components/Render/ModelFactoryBase.cs index 4f8dc3ea..ce50d0f4 100644 --- a/OpenContent/Components/Render/ModelFactoryBase.cs +++ b/OpenContent/Components/Render/ModelFactoryBase.cs @@ -469,7 +469,7 @@ protected void LookupSelect2InOtherModule(JObject model, JObject options, bool o } catch (System.Exception) { - Debugger.Break(); + Utils.DebuggerBreak(); } } } @@ -495,7 +495,7 @@ protected void LookupSelect2InOtherModule(JObject model, JObject options, bool o } catch (System.Exception ) { - Debugger.Break(); + Utils.DebuggerBreak(); } } } @@ -523,7 +523,7 @@ private JToken GenerateObject(string id, int tabId, int moduleId, bool onlyData) var context = new JObject(); json["Context"] = context; context["Id"] = dataItem.Id; - context["DetailUrl"] = GenerateDetailUrl(dataItem, json, module.Settings.Manifest, tabId > 0 ? tabId : _detailTabId); + context["DetailUrl"] = GenerateDetailUrl(dataItem, json, module.Settings.Manifest, GetCurrentCultureCode(), tabId > 0 ? tabId : _detailTabId); } return json; } @@ -534,7 +534,7 @@ private JToken GenerateObject(string id, int tabId, int moduleId, bool onlyData) return res; } - protected string GenerateDetailUrl(IDataItem item, JObject dyn, Manifest.Manifest manifest, int detailTabId) + protected string GenerateDetailUrl(IDataItem item, JObject dyn, Manifest.Manifest manifest, string cultureCode, int detailTabId) { string url = ""; if (!string.IsNullOrEmpty(manifest.DetailUrl)) @@ -545,7 +545,7 @@ protected string GenerateDetailUrl(IDataItem item, JObject dyn, Manifest.Manifes url = hbEngine.Execute(manifest.DetailUrl, dynForHBS); url = HttpUtility.HtmlDecode(url); } - return _module.GetUrl(_detailTabId, url.CleanupUrl(), "id=" + item.Id); + return _module.GetUrl(_detailTabId, cultureCode, url.CleanupUrl(), "id=" + item.Id); } } } \ No newline at end of file diff --git a/OpenContent/Components/Render/ModelFactoryMultiple.cs b/OpenContent/Components/Render/ModelFactoryMultiple.cs index 1e672a45..5b972131 100644 --- a/OpenContent/Components/Render/ModelFactoryMultiple.cs +++ b/OpenContent/Components/Render/ModelFactoryMultiple.cs @@ -109,7 +109,7 @@ public override JToken GetModelAsJson(bool onlyData = false, bool onlyMainData = { context["EditUrl"] = _module.EditUrl("id", item.Id, _module.ViewModule.ModuleId); } - context["DetailUrl"] = GenerateDetailUrl(item, dyn, _manifest, _detailTabId); + context["DetailUrl"] = GenerateDetailUrl(item, dyn, _manifest, GetCurrentCultureCode(), _detailTabId); context["MainUrl"] = mainUrl; } items.Add(dyn); diff --git a/OpenContent/Components/Render/ModelFactorySingle.cs b/OpenContent/Components/Render/ModelFactorySingle.cs index d342ca4a..98d4418c 100644 --- a/OpenContent/Components/Render/ModelFactorySingle.cs +++ b/OpenContent/Components/Render/ModelFactorySingle.cs @@ -55,7 +55,7 @@ private void ExtendModelSingle(JObject model) var context = model["Context"]; if (Detail) { - context["DetailUrl"] = GenerateDetailUrl(_data, model, _manifest, _detailTabId); + context["DetailUrl"] = GenerateDetailUrl(_data, model, _manifest, GetCurrentCultureCode(), _detailTabId); context["Id"] = _data.Id; var editIsAllowed = !_manifest.DisableEdit && IsEditAllowed(_data.CreatedByUserId); context["EditUrl"] = editIsAllowed ? _module.EditUrl("id", _data.Id, _module.ViewModule.ModuleId) : ""; diff --git a/OpenContent/Components/Render/RenderEngine.cs b/OpenContent/Components/Render/RenderEngine.cs index 90c54ebf..8edbf33f 100644 --- a/OpenContent/Components/Render/RenderEngine.cs +++ b/OpenContent/Components/Render/RenderEngine.cs @@ -456,6 +456,7 @@ private string GetTemplateKey(FieldConfig indexConfig) #endregion #region ExecuteTemplates + private string ExecuteRazor(FileUri template, dynamic model) { string webConfig = template.PhysicalFullDirectory; @@ -511,7 +512,7 @@ private string ExecuteTemplate(Page page, TemplateManifest templateManifest, Tem return output; } - #endregion + #endregion ExecuteTemplates #region Generate output @@ -646,9 +647,16 @@ private string GenerateListOutput(Page page, TemplateManifest templateManifest, else model = mf.GetModelAsDynamic(); } + if (!string.IsNullOrEmpty(_renderinfo.Template.Manifest.MainMeta)) + { + HandlebarsEngine hbEngine = new HandlebarsEngine(); + //PageUtils.SetPageMeta(page, hbEngine.Execute(_renderinfo.Template.Manifest.DetailMeta, model)); + MetaOther = hbEngine.Execute(_renderinfo.Template.Manifest.MainMeta, model); + } return ExecuteTemplate(page, templateManifest, files, templateUri, model); } } + return ""; } diff --git a/OpenContent/Components/Rest/RestQueryBuilder.cs b/OpenContent/Components/Rest/RestQueryBuilder.cs index 8566ae95..084c9040 100644 --- a/OpenContent/Components/Rest/RestQueryBuilder.cs +++ b/OpenContent/Components/Rest/RestQueryBuilder.cs @@ -1,4 +1,5 @@ using System.Linq; +using Newtonsoft.Json.Linq; using Satrabel.OpenContent.Components.Datasource.Search; using Satrabel.OpenContent.Components.Lucene.Config; @@ -28,29 +29,22 @@ public static Select MergeQuery(FieldConfig config, Select select, RestSelect re } else if (rule.FieldOperator == OperatorEnum.BETWEEN) { - // not yet implemented + var val1 = GenerateValue(rule.LowerValue); + var val2 = GenerateValue(rule.UpperValue); + query.AddRule(FieldConfigUtils.CreateFilterRule(config, cultureCode, + rule.Field, + rule.FieldOperator, + val1, val2 + )); } else { + // EQUAL if (rule.Value != null) { RuleValue val; - if(rule.Value.Type == Newtonsoft.Json.Linq.JTokenType.Boolean) - { - val = new BooleanRuleValue((bool)rule.Value.Value); - } - else if (rule.Value.Type == Newtonsoft.Json.Linq.JTokenType.Integer) - { - val = new IntegerRuleValue((int)rule.Value.Value); - } - else if (rule.Value.Type == Newtonsoft.Json.Linq.JTokenType.Float) - { - val = new FloatRuleValue((float)rule.Value.Value); - } - else - { - val = new StringRuleValue(rule.Value.ToString()); - } + + val = GenerateValue(rule.Value); query.AddRule(FieldConfigUtils.CreateFilterRule(config, cultureCode, rule.Field, @@ -76,6 +70,29 @@ public static Select MergeQuery(FieldConfig config, Select select, RestSelect re return select; } + private static RuleValue GenerateValue(JValue jvalue) + { + + RuleValue val; + if (jvalue.Type == Newtonsoft.Json.Linq.JTokenType.Boolean) + { + val = new BooleanRuleValue((bool)jvalue.Value); + } + else if (jvalue.Type == Newtonsoft.Json.Linq.JTokenType.Integer) + { + val = new IntegerRuleValue((int)jvalue.Value); + } + else if (jvalue.Type == Newtonsoft.Json.Linq.JTokenType.Float) + { + val = new FloatRuleValue((float)jvalue.Value); + } + else + { + val = new StringRuleValue(jvalue.ToString()); + } + + return val; + } } } \ No newline at end of file diff --git a/OpenContent/Components/Settings/ComponentSettingsInfo.cs b/OpenContent/Components/Settings/ComponentSettingsInfo.cs index 13f74d8d..884a4593 100644 --- a/OpenContent/Components/Settings/ComponentSettingsInfo.cs +++ b/OpenContent/Components/Settings/ComponentSettingsInfo.cs @@ -4,8 +4,10 @@ namespace Satrabel.OpenContent.Components { public class ComponentSettingsInfo { - public static ComponentSettingsInfo Create(IDictionary moduleSettings) + public static ComponentSettingsInfo Create(IDictionary moduleSettings, IDictionary tabModuleSettings) { + // moduleSettings is somethimes a concatanation of module settings and tabmodule settings, somethimes not + var retval = new ComponentSettingsInfo() { Template = moduleSettings["template"] as string, //templatepath+file or //manifestpath+key @@ -14,6 +16,7 @@ public static ComponentSettingsInfo Create(IDictionary moduleSettings) }; //normalize TabId & ModuleId + var sPortalId = moduleSettings["portalid"] as string; var sTabId = moduleSettings["tabid"] as string; var sModuleId = moduleSettings["moduleid"] as string; retval.TabId = -1; @@ -23,13 +26,32 @@ public static ComponentSettingsInfo Create(IDictionary moduleSettings) retval.TabId = int.Parse(sTabId); retval.ModuleId = int.Parse(sModuleId); } + retval.PortalId = -1; + if (sPortalId != null ) + { + retval.PortalId = int.Parse(sPortalId); + } //normalize DetailTabId - var sDetailTabId = moduleSettings["detailtabid"] as string; retval.DetailTabId = -1; - if (!string.IsNullOrEmpty(sDetailTabId)) + + // try tabmodule settings + if (tabModuleSettings != null) + { + var sDetailTabId = tabModuleSettings["detailtabid"] as string; + if (!string.IsNullOrEmpty(sDetailTabId)) + { + retval.DetailTabId = int.Parse(sDetailTabId); + } + } + if (retval.DetailTabId == -1) { - retval.DetailTabId = int.Parse(sDetailTabId); + // try module settings + var sDetailTabId = moduleSettings["detailtabid"] as string; + if (!string.IsNullOrEmpty(sDetailTabId)) + { + retval.DetailTabId = int.Parse(sDetailTabId); + } } return retval; } @@ -43,6 +65,7 @@ public static ComponentSettingsInfo Create(IDictionary moduleSettings) public int ModuleId { get; set; } public int TabId { get; set; } + public int PortalId { get; set; } /// /// Gets or sets the template. diff --git a/OpenContent/Components/Settings/OpenContentSettings.cs b/OpenContent/Components/Settings/OpenContentSettings.cs index ded95169..907f70f9 100644 --- a/OpenContent/Components/Settings/OpenContentSettings.cs +++ b/OpenContent/Components/Settings/OpenContentSettings.cs @@ -18,6 +18,7 @@ public OpenContentSettings(ComponentSettingsInfo moduleSettings) Manifest = ManifestUtils.GetManifest(TemplateKey, out templateManifest); Template = templateManifest; } + PortalId = moduleSettings.PortalId; TabId = moduleSettings.TabId; ModuleId = moduleSettings.ModuleId; @@ -29,6 +30,7 @@ public OpenContentSettings(ComponentSettingsInfo moduleSettings) internal TemplateKey TemplateKey { get; } + public int PortalId { get; } public int TabId { get; } /// @@ -50,6 +52,7 @@ public OpenContentSettings(ComponentSettingsInfo moduleSettings) public JObject Query => !string.IsNullOrEmpty(_query) ? JObject.Parse(_query) : new JObject(); public bool IsOtherModule => TabId > 0 && ModuleId > 0; + public bool IsOtherPortal => PortalId > 0 && TabId > 0 && ModuleId > 0; public bool TemplateAvailable => TemplateKey != null; diff --git a/OpenContent/Components/TemplateHelpers/RazorUtils.cs b/OpenContent/Components/TemplateHelpers/RazorUtils.cs index 9e6aa4fa..4afe56b6 100644 --- a/OpenContent/Components/TemplateHelpers/RazorUtils.cs +++ b/OpenContent/Components/TemplateHelpers/RazorUtils.cs @@ -12,7 +12,7 @@ public static class RazorUtils /// public static void Break() { - Debugger.Break(); + Utils.DebuggerBreak(); } /// diff --git a/OpenContent/Components/UrlRewriter/UrlRulesCaching.cs b/OpenContent/Components/UrlRewriter/UrlRulesCaching.cs index a2e003d3..1c4f6fc5 100644 --- a/OpenContent/Components/UrlRewriter/UrlRulesCaching.cs +++ b/OpenContent/Components/UrlRewriter/UrlRulesCaching.cs @@ -234,6 +234,9 @@ public static List GetCache(int portalId, string cacheKey, L public static void PurgeCache(int portalId) { PurgeCache(GetCacheFolder(portalId)); + + var portalCacheKey = UrlRulesCaching.GeneratePortalCacheKey(portalId, null); + App.Services.CacheAdapter.ClearCache(portalCacheKey); } public static PurgeResult PurgeExpiredItems(int portalId) @@ -326,7 +329,7 @@ public static void Remove(int portalId, int dataModuleId) throw new IOException("Deleted " + i + " files, however, some files are locked. Could not delete the following files: " + filesNotDeleted); } - DataCache.ClearCache(string.Format(UrlRuleConfigCacheKey, portalId)); + App.Services.CacheAdapter.ClearCache(string.Format(UrlRuleConfigCacheKey, portalId)); } #endregion diff --git a/OpenContent/Components/Utils/OpenContentUtils.cs b/OpenContent/Components/Utils/OpenContentUtils.cs index 8ffbe9be..429184c5 100644 --- a/OpenContent/Components/Utils/OpenContentUtils.cs +++ b/OpenContent/Components/Utils/OpenContentUtils.cs @@ -550,7 +550,7 @@ public static FieldConfig GetIndexConfig(FolderUri folder, string collection) { //we should log this App.Services.Logger.Error($"Error while parsing json", ex); - if (Debugger.IsAttached) Debugger.Break(); + Utils.DebuggerBreak(); return null; } } diff --git a/OpenContent/EditGlobalSettings.ascx.cs b/OpenContent/EditGlobalSettings.ascx.cs index 19e0e88d..73c559d8 100644 --- a/OpenContent/EditGlobalSettings.ascx.cs +++ b/OpenContent/EditGlobalSettings.ascx.cs @@ -128,7 +128,7 @@ protected void cmdUpgradeXml_Click(object sender, EventArgs e) var modules = DnnUtils.GetDnnOpenContentModules(ModuleContext.PortalId); foreach (var module in modules) { - Log.Logger.Info("Updating all OpenContent Xml data for module " + module.ModuleId); + App.Services.Logger.Info("Updating all OpenContent Xml data for module " + module.ModuleId); var contents = ctrl.GetContents(module.ModuleId); foreach (var item in contents) { @@ -143,7 +143,7 @@ protected void cmdUpgradeXml_Click(object sender, EventArgs e) finally { } - Log.Logger.Info("Finished Updating all OpenContent Xml data for portal " + ModuleContext.PortalId); + App.Services.Logger.Info("Finished Updating all OpenContent Xml data for portal " + ModuleContext.PortalId); } //Response.Redirect(Globals.NavigateURL(), true); } diff --git a/OpenContent/OpenContent.csproj b/OpenContent/OpenContent.csproj index 6c0313ed..856002cc 100644 --- a/OpenContent/OpenContent.csproj +++ b/OpenContent/OpenContent.csproj @@ -87,10 +87,9 @@ ..\ref\dnn732\DotNetNuke.WebUtility.dll False - + False ..\ref\EPPlus.dll - True ..\ref\Handlebars.dll @@ -121,6 +120,7 @@ ..\ref\dnn732\Newtonsoft.Json.dll False + @@ -134,6 +134,7 @@ ..\ref\dnn732\System.Net.Http.Formatting.dll False + diff --git a/OpenContent/OpenContent.dnn b/OpenContent/OpenContent.dnn index f30288f8..8f2b724e 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 diff --git a/OpenContent/TemplateInit.ascx b/OpenContent/TemplateInit.ascx index 403cf17b..0e837339 100644 --- a/OpenContent/TemplateInit.ascx +++ b/OpenContent/TemplateInit.ascx @@ -7,9 +7,17 @@ - + + + +
+ + + +
+
diff --git a/OpenContent/TemplateInit.ascx.cs b/OpenContent/TemplateInit.ascx.cs index 24b2357c..d2a91a21 100644 --- a/OpenContent/TemplateInit.ascx.cs +++ b/OpenContent/TemplateInit.ascx.cs @@ -13,6 +13,7 @@ using Satrabel.OpenContent.Components.Rss; using Satrabel.OpenContent.Components.Logging; using DotNetNuke.Services.Localization; +using DotNetNuke.Entities.Portals; namespace Satrabel.OpenContent { @@ -29,6 +30,8 @@ protected void Page_Load(object sender, EventArgs e) { pHelp.Visible = false; phCurrentTemplate.Visible = false; + ddlPortals.Enabled = ModuleContext.PortalSettings.UserInfo.IsSuperUser; + rblDataSource.Items[2].Enabled = ModuleContext.PortalSettings.UserInfo.IsSuperUser; foreach (ListItem item in rblDataSource.Items) { @@ -60,6 +63,7 @@ public string Resource(string key) { return Localization.GetString(key + ".Text", ResourceFile); } + protected void rblFrom_SelectedIndexChanged(object sender, EventArgs e) { ddlTemplate.Items.Clear(); @@ -103,6 +107,14 @@ protected void rblDataSource_SelectedIndexChanged(object sender, EventArgs e) var dsSettings = dsModule.OpenContentSettings(); BindTemplates(dsSettings.Template, dsSettings.Template.MainTemplateUri()); } + if (rblDataSource.SelectedIndex == 2) // other portal + { + BindOtherPortals(-1); + BindOtherModules(-1, -1); + var dsModule = (new ModuleController()).GetTabModule(int.Parse(ddlDataSource.SelectedValue)); + var dsSettings = dsModule.OpenContentSettings(); + BindTemplates(dsSettings.Template, dsSettings.Template.MainTemplateUri()); + } else // this module { BindOtherModules(-1, -1); @@ -136,12 +148,22 @@ protected void bSave_Click(object sender, EventArgs e) ModuleController mc = new ModuleController(); if (rblDataSource.SelectedIndex == 0) // this module { + mc.DeleteModuleSetting(ModuleContext.ModuleId, "portalid"); mc.DeleteModuleSetting(ModuleContext.ModuleId, "tabid"); mc.DeleteModuleSetting(ModuleContext.ModuleId, "moduleid"); } - else // other module + else if (rblDataSource.SelectedIndex == 1) // other module { var dsModule = (new ModuleController()).GetTabModule(int.Parse(ddlDataSource.SelectedValue)); + mc.DeleteModuleSetting(ModuleContext.ModuleId, "portalid"); + mc.UpdateModuleSetting(ModuleContext.ModuleId, "tabid", dsModule.TabID.ToString()); + mc.UpdateModuleSetting(ModuleContext.ModuleId, "moduleid", dsModule.ModuleID.ToString()); + } + else // other portal + { + var dsModule = (new ModuleController()).GetTabModule(int.Parse(ddlDataSource.SelectedValue)); + var dsPortal = int.Parse(ddlPortals.SelectedValue); + mc.UpdateModuleSetting(ModuleContext.ModuleId, "portalid", dsModule.PortalID.ToString()); mc.UpdateModuleSetting(ModuleContext.ModuleId, "tabid", dsModule.TabID.ToString()); mc.UpdateModuleSetting(ModuleContext.ModuleId, "moduleid", dsModule.ModuleID.ToString()); } @@ -172,7 +194,7 @@ protected void bSave_Click(object sender, EventArgs e) ModuleContext.Settings["template"] = template; } } - mc.UpdateModuleSetting(ModuleContext.ModuleId, "detailtabid", ddlDetailPage.SelectedValue); + mc.UpdateTabModuleSetting(ModuleContext.TabModuleId, "detailtabid", ddlDetailPage.SelectedValue); //don't reset settings. Sure they might be invalid, but maybe not. And you can't ever revert. @@ -226,8 +248,13 @@ protected void ddlDataSource_SelectedIndexChanged(object sender, EventArgs e) private void BindTemplates(TemplateManifest template, FileUri otherModuleTemplate) { + var SelectedPortalSettings = ModuleContext.PortalSettings; + if (rblDataSource.SelectedIndex == 2)// other portal + { + SelectedPortalSettings = new PortalSettings(int.Parse(ddlPortals.SelectedValue)); + } ddlTemplate.Items.Clear(); - ddlTemplate.Items.AddRange(OpenContentUtils.ListOfTemplatesFiles(ModuleContext.PortalSettings, ModuleContext.ModuleId, template, App.Config.Opencontent, otherModuleTemplate).ToArray()); + ddlTemplate.Items.AddRange(OpenContentUtils.ListOfTemplatesFiles(SelectedPortalSettings, ModuleContext.ModuleId, template, App.Config.Opencontent, otherModuleTemplate).ToArray()); if (ddlTemplate.Items.Count == 0) { rblUseTemplate.Items[0].Enabled = false; @@ -318,13 +345,14 @@ public void RenderInitForm() pHelp.Visible = true; if (!Page.IsPostBack || ddlTemplate.Items.Count == 0) { - rblDataSource.SelectedIndex = (Settings.IsOtherModule ? 1 : 0); + rblDataSource.SelectedIndex = (Settings.IsOtherPortal ? 2 : (Settings.IsOtherModule ? 1 : 0)); + BindOtherPortals(Settings.PortalId); BindOtherModules(Settings.TabId, Settings.ModuleId); BindTemplates(Settings.Template, (Renderinfo.IsOtherModule ? Renderinfo.Template.MainTemplateUri() : null)); BindDetailPage(Settings.DetailTabId, Settings.TabId, Settings.GetModuleId(ModuleContext.ModuleId)); } - if (rblDataSource.SelectedIndex == 1) // other module + if (rblDataSource.SelectedIndex == 1 || rblDataSource.SelectedIndex == 2) // other module or other portal { var dsModule = (new ModuleController()).GetTabModule(int.Parse(ddlDataSource.SelectedValue)); Renderinfo.IsOtherModule = (dsModule.TabID > 0 && dsModule.ModuleID > 0); @@ -358,41 +386,88 @@ public void RenderInitForm() } } + private void BindOtherPortals(int portalId) + { + phPortals.Visible = rblDataSource.SelectedIndex == 2; // other portal + IEnumerable portals = (new PortalController()).GetPortals().Cast(); + + ddlPortals.Items.Clear(); + + var listItems = new List(); + foreach (var item in portals) + { + + var li = new ListItem(item.PortalName, item.PortalID.ToString()); + listItems.Add(li); + if (item.PortalID == portalId) + { + li.Selected = true; + } + + } + foreach (ListItem li in listItems.OrderBy(x => x.Text)) + { + ddlPortals.Items.Add(li); + } + if (portalId < 0) + { + ddlPortals.SelectedValue = ModuleContext.PortalId.ToString(); + } + + //ddlPortals.Items[1].Enabled = ddlDataSource.Items.Count > 0; + } private void BindOtherModules(int tabId, int moduleId) { - IEnumerable modules = (new ModuleController()).GetModules(ModuleContext.PortalId).Cast(); + int SelectedPortalId = ModuleContext.PortalId; + if (rblDataSource.SelectedIndex == 2) // other portal + { + SelectedPortalId = int.Parse(ddlPortals.SelectedValue); + } + IEnumerable modules = (new ModuleController()).GetModules(SelectedPortalId).Cast(); modules = modules.Where(m => m.ModuleDefinition.DefinitionName == App.Config.Opencontent && m.IsDeleted == false && !m.OpenContentSettings().IsOtherModule); rblDataSource.Items[1].Enabled = modules.Any(); - phDataSource.Visible = rblDataSource.SelectedIndex == 1; // other module - if (rblDataSource.SelectedIndex == 1) // other module + phPortals.Visible = rblDataSource.SelectedIndex == 2; // other portal + phDataSource.Visible = rblDataSource.SelectedIndex == 1 || rblDataSource.SelectedIndex == 2; // other module + if (rblDataSource.SelectedIndex == 1 || rblDataSource.SelectedIndex == 2) // other module { rblUseTemplate.SelectedIndex = 0; // existing template phFrom.Visible = false; phTemplateName.Visible = false; } rblUseTemplate.Items[1].Enabled = rblDataSource.SelectedIndex == 0; // this module + + ddlDataSource.Items.Clear(); + var listItems = new List(); foreach (var item in modules) { if (item.TabModuleID != ModuleContext.TabModuleId) { var tc = new TabController(); - var tab = tc.GetTab(item.TabID, ModuleContext.PortalId, false); + var tab = tc.GetTab(item.TabID, SelectedPortalId, false); + var tabpath = tab.TabPath.Replace("//", "/").Trim('/'); + if (!tab.IsNeutralCulture && tab.CultureCode != DnnLanguageUtils.GetCurrentCultureCode()) { + if (item.TabID == tabId && item.ModuleID == moduleId) + { + var li = new ListItem(string.Format("{1} - {0} ({2})", item.ModuleTitle, tabpath, tab.CultureCode), item.TabModuleID.ToString()); + li.Selected = true; + listItems.Add(li); + } // skip other cultures - continue; + //continue; } - - var tabpath = tab.TabPath.Replace("//", "/").Trim('/'); - var li = new ListItem(string.Format("{1} - {0}", item.ModuleTitle, tabpath), item.TabModuleID.ToString()); - - listItems.Add(li); - if (item.TabID == tabId && item.ModuleID == moduleId) + else { - li.Selected = true; + var li = new ListItem(string.Format("{1} - {0}", item.ModuleTitle, tabpath), item.TabModuleID.ToString()); + listItems.Add(li); + if (item.TabID == tabId && item.ModuleID == moduleId) + { + li.Selected = true; + } } } } @@ -411,7 +486,7 @@ private void BindDetailPage(int currentDetailTabId, int othermoduleTabId, int da ddlDetailPage.Items.Clear(); int othermoduleDetailTabId = GetOtherModuleDetailTabId(othermoduleTabId, dataModuleId); - if (othermoduleDetailTabId > 0) + if (othermoduleDetailTabId > 0 && rblDataSource.SelectedIndex != 2) { //add extra li with "Default Detail Page" directly to dropdown format = LogContext.IsLogActive ? "Main Module Detail Page - [{0}]" : "Main Module Detail Page"; @@ -523,7 +598,12 @@ private void ActivateDetailPage() } } - - + protected void ddlPotals_SelectedIndexChanged(object sender, EventArgs e) + { + BindOtherModules(-1, -1); + var dsModule = (new ModuleController()).GetTabModule(int.Parse(ddlDataSource.SelectedValue)); + var dsSettings = dsModule.OpenContentSettings(); + BindTemplates(dsSettings.Template, dsSettings.Template.MainTemplateUri()); + } } } \ No newline at end of file diff --git a/OpenContent/TemplateInit.ascx.designer.cs b/OpenContent/TemplateInit.ascx.designer.cs index c3dbfd82..e88b46c8 100644 --- a/OpenContent/TemplateInit.ascx.designer.cs +++ b/OpenContent/TemplateInit.ascx.designer.cs @@ -39,6 +39,24 @@ public partial class TemplateInit { /// protected global::System.Web.UI.WebControls.RadioButtonList rblDataSource; + /// + /// Contrôle phPortals. + /// + /// + /// 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.PlaceHolder phPortals; + + /// + /// Contrôle ddlPortals. + /// + /// + /// 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 ddlPortals; + /// /// Contrôle phDataSource. /// diff --git a/OpenContent/View.ascx b/OpenContent/View.ascx index ac0fabcd..289271a2 100644 --- a/OpenContent/View.ascx +++ b/OpenContent/View.ascx @@ -29,6 +29,12 @@
+ <%--
+ + +
--%>
').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 +(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"||n.type=="imagecrop2"||n.type=="imagex"){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/packages.config b/OpenContent/packages.config index 11c5d2da..04a7081d 100644 --- a/OpenContent/packages.config +++ b/OpenContent/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OpenContentTests/OpenContentTests.csproj b/OpenContentTests/OpenContentTests.csproj index cc29ff37..cb6c7476 100644 --- a/OpenContentTests/OpenContentTests.csproj +++ b/OpenContentTests/OpenContentTests.csproj @@ -41,6 +41,10 @@ ..\ref\dnn740\DotNetNuke.Instrumentation.dll + + False + ..\ref\EPPlus.dll + False ..\ref\Handlebars.dll