Commit 2b9bf9f5 authored by Antony's avatar Antony
Browse files

Merge branch '1.0' into 'master'

1.0.22

See merge request internal/umbracocontactnumber!1
parents d5138930 aaa585f1
[*.cs]
# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = silent
# Created by https://www.gitignore.io/api/csharp,visualstudio
# Edit at https://www.gitignore.io/?templates=csharp,visualstudio
### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
### VisualStudio ###
# User-specific files
# User-specific files (MonoDevelop/Xamarin Studio)
# Mono auto generated files
# Build results
# Visual Studio 2015/2017 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
# Visual Studio 2017 auto generated files
# MSTest test Results
# NUnit
# Build Results of an ATL Project
# Benchmark Results
# .NET Core
# StyleCop
# Files built by Visual Studio
# Chutzpah Test files
# Visual C++ cache files
# Visual Studio profiler
# Visual Studio Trace Files
# TFS 2012 Local Workspace
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in
# JustCode is a .NET coding add-in
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool
# AxoCover is a Code Coverage Tool
# Visual Studio code coverage results
# NCrunch
# MightyMoose
# Web workbench (sass)
# Installshield output folder
# DocProject is a documentation generator add-in
# Click-Once directory
# Publish Web Output
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages
# NuGet Symbol Packages
# The packages folder can be ignored because of Package Restore
# except build/, which is used as an MSBuild target.
# Uncomment if necessary however generally it will be regenerated when needed
# NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Build Output
# Microsoft Azure Emulator
# Windows Store app package directories and files
# Visual Studio cache files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache
# Others
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
# RIA/Silverlight projects
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
# SQL Server files
# Business Intelligence projects
# Microsoft Fakes
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio
# Visual Studio 6 build log
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Visual Studio LightSwitch build output
# Paket dependency manager
# FAKE - F# Make
# CodeRush personal settings
# Python Tools for Visual Studio (PTVS)
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
# Telerik's JustMock configuration file
# BizTalk build output
# OpenCover UI analysis results
# Azure Stream Analytics local run output
# MSBuild Binary and Structured Log
# NVidia Nsight GPU debugger configuration file
# MFractors (Xamarin productivity tool) working folder
# Local History for Visual Studio
# BeatPulse healthcheck temp database
# Backup folder for Package Reference Convert tool in Visual Studio 2017
# End of https://www.gitignore.io/api/csharp,visualstudio
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Appstract.UmbracoContactNumber", "Appstract.UmbracoContactNumber\Appstract.UmbracoContactNumber.csproj", "{13039FC7-1946-45AB-9C10-25662BFB7C70}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EEFA0116-3375-4A6C-8964-148AD3A53B65}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
README.md = README.md
UmbracoPackage.targets = UmbracoPackage.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{13039FC7-1946-45AB-9C10-25662BFB7C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13039FC7-1946-45AB-9C10-25662BFB7C70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13039FC7-1946-45AB-9C10-25662BFB7C70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13039FC7-1946-45AB-9C10-25662BFB7C70}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AAB9912E-18B9-4854-9A0B-FB2C0D9931D1}
EndGlobalSection
EndGlobal
<div ng-controller="ContactNumberController">
<label ng-if="!inEditState">{{("+" + model.value.CountryCodeAndPhoneCode.split(model.separator)[1] + " " + model.value.ContactNumber)}}</label>
<div ng-if="inEditState">
<select ng-model="model.value.CountryCodeAndPhoneCode" ng-options="item.ID as item.CountryName +' (+' + item.ID.split(model.separator)[1] +')' for item in model.list | orderBy:'CountryName'"></select>
<input type="text" name="input" numbers-only ng-model="model.value.ContactNumber">
<img ng-if="model.value.CountryCodeAndPhoneCode && model.value.ContactNumber && model.db[model.value.CountryCodeAndPhoneCode.split(model.separator)[0]].ValidLengths.indexOf(model.value.ContactNumber.split(' ').join('').length) !== -1" src="/App_Plugins/Appstract.UmbracoContactNumber/input_check.svg" class="input-field-validation-success" />
</div>
<span ng-if="!inEditState" class="country-picker-edit-label" ng-click="onEdit()">{{translations.ContactNumber_Edit}}</span>
<span ng-if="!inEditState" class="country-picker-edit-label reset" ng-click="onEdit(true)">{{translations.ContactNumber_Delete}}</span>
</div>
angular.module("umbraco").controller("ContactNumberController", function ($scope, $routeParams, localizationService) {
$scope.model.separator = "#";
$scope.model.db = {
"pr": { CountryPhoneCodeList: ["1 787", "1 939"], ValidLengths: [7] },
"dk": { CountryPhoneCodeList: ["45"], ValidLengths: [8] },
"de": { CountryPhoneCodeList: ["49"], ValidLengths: [11] },
"nl": { CountryPhoneCodeList: ["31"], ValidLengths: [9] },
"be": { CountryPhoneCodeList: ["32"], ValidLengths: [8] },
"gb": { CountryPhoneCodeList: ["44"], ValidLengths: [10] },
"no": { CountryPhoneCodeList: ["47"], ValidLengths: [8] },
"az": { CountryPhoneCodeList: ["994"], ValidLengths: [9] },
"qa": { CountryPhoneCodeList: ["974"], ValidLengths: [8] },
"ae": { CountryPhoneCodeList: ["971"], ValidLengths: [8] },
"ca": { CountryPhoneCodeList: ["1"], ValidLengths: [10] },
"ng": { CountryPhoneCodeList: ["234"], ValidLengths: [8] },
"tt": { CountryPhoneCodeList: ["1 868"], ValidLengths: [7] },
"us": { CountryPhoneCodeList: ["1"], ValidLengths: [10] },
"th": { CountryPhoneCodeList: ["66"], ValidLengths: [6] },
"mx": { CountryPhoneCodeList: ["52"], ValidLengths: [10] },
"br": { CountryPhoneCodeList: ["55"], ValidLengths: [10] },
"sg": { CountryPhoneCodeList: ["65"], ValidLengths: [8] },
"my": { CountryPhoneCodeList: ["60"], ValidLengths: [9] },
"in": { CountryPhoneCodeList: ["91"], ValidLengths: [10] },
"af": { CountryPhoneCodeList: ["93"], ValidLengths: [] },
"al": { CountryPhoneCodeList: ["355"], ValidLengths: [] },
"dz": { CountryPhoneCodeList: ["213"], ValidLengths: [] },
"as": { CountryPhoneCodeList: ["1 684"], ValidLengths: [] },
"ad": { CountryPhoneCodeList: ["376"], ValidLengths: [] },
"ao": { CountryPhoneCodeList: ["244"], ValidLengths: [] },
"ai": { CountryPhoneCodeList: ["1 264"], ValidLengths: [] },
"aq": { CountryPhoneCodeList: ["672"], ValidLengths: [] },
"ag": { CountryPhoneCodeList: ["1 268"], ValidLengths: [] },
"ar": { CountryPhoneCodeList: ["54"], ValidLengths: [] },
"am": { CountryPhoneCodeList: ["374"], ValidLengths: [] },
"aw": { CountryPhoneCodeList: ["297"], ValidLengths: [] },
"au": { CountryPhoneCodeList: ["61"], ValidLengths: [] },
"at": { CountryPhoneCodeList: ["43"], ValidLengths: [] },
"bs": { CountryPhoneCodeList: ["1 242"], ValidLengths: [] },
"bh": { CountryPhoneCodeList: ["973"], ValidLengths: [] },
"bd": { CountryPhoneCodeList: ["880"], ValidLengths: [] },
"bb": { CountryPhoneCodeList: ["1 246"], ValidLengths: [] },
"by": { CountryPhoneCodeList: ["375"], ValidLengths: [] },
"bz": { CountryPhoneCodeList: ["501"], ValidLengths: [] },
"bj": { CountryPhoneCodeList: ["229"], ValidLengths: [] },
"bm": { CountryPhoneCodeList: ["1 441"], ValidLengths: [] },
"bt": { CountryPhoneCodeList: ["975"], ValidLengths: [] },
"bo": { CountryPhoneCodeList: ["591"], ValidLengths: [] },
"ba": { CountryPhoneCodeList: ["387"], ValidLengths: [] },
"bw": { CountryPhoneCodeList: ["267"], ValidLengths: [] },
"io": { CountryPhoneCodeList: ["246"], ValidLengths: [] },
"vg": { CountryPhoneCodeList: ["1 284"], ValidLengths: [] },
"bn": { CountryPhoneCodeList: ["673"], ValidLengths: [] },
"bg": { CountryPhoneCodeList: ["359"], ValidLengths: [] },
"bf": { CountryPhoneCodeList: ["226"], ValidLengths: [] },
"bi": { CountryPhoneCodeList: ["257"], ValidLengths: [] },
"kh": { CountryPhoneCodeList: ["855"], ValidLengths: [] },
"cm": { CountryPhoneCodeList: ["237"], ValidLengths: [] },
"cv": { CountryPhoneCodeList: ["238"], ValidLengths: [] },
"ky": { CountryPhoneCodeList: ["1 345"], ValidLengths: [] },
"cf": { CountryPhoneCodeList: ["236"], ValidLengths: [] },
"td": { CountryPhoneCodeList: ["235"], ValidLengths: [] },
"cl": { CountryPhoneCodeList: ["56"], ValidLengths: [] },
"cn": { CountryPhoneCodeList: ["86"], ValidLengths: [] },
"cx": { CountryPhoneCodeList: ["61"], ValidLengths: [] },
"cc": { CountryPhoneCodeList: ["61"], ValidLengths: [] },
"co": { CountryPhoneCodeList: ["57"], ValidLengths: [] },
"km": { CountryPhoneCodeList: ["269"], ValidLengths: [] },
"ck": { CountryPhoneCodeList: ["682"], ValidLengths: [] },
"cr": { CountryPhoneCodeList: ["506"], ValidLengths: [] },
"hr": { CountryPhoneCodeList: ["385"], ValidLengths: [] },
"cu": { CountryPhoneCodeList: ["53"], ValidLengths: [] },
"cw": { CountryPhoneCodeList: ["599"], ValidLengths: [] },
"cy": { CountryPhoneCodeList: ["357"], ValidLengths: [] },
"cz": { CountryPhoneCodeList: ["420"], ValidLengths: [] },
"cd": { CountryPhoneCodeList: ["243"], ValidLengths: [] },
"dj": { CountryPhoneCodeList: ["253"], ValidLengths: [] },
"dm": { CountryPhoneCodeList: ["1 767"], ValidLengths: [] },
"tl"