├── .gitattributes ├── .gitignore ├── README.txt ├── TestApp ├── App_Start │ └── WebApiConfig.cs ├── Content │ ├── samples.css │ ├── samples.less │ └── samples.min.css ├── DefaultPage.html ├── Global.asax ├── Global.asax.cs ├── ListOfSamples.html ├── Properties │ └── AssemblyInfo.cs ├── Sample.Chosen.html ├── Sample.Grid.html ├── Sample.KO1.html ├── Sample.KO2.html ├── Sample.KO3.html ├── Sample.KO4.html ├── Sample.KO5.html ├── Sample.MapControl.html ├── Sample.Modal.html ├── Sample.ShopCart.html ├── Sample.TabControl.html ├── Sample.Youtube.html ├── Scripts │ └── typings │ │ ├── bootstrap │ │ └── bootstrap.d.ts │ │ ├── googlemaps │ │ └── google.maps.d.ts │ │ ├── jquery │ │ └── jquery.d.ts │ │ └── vue │ │ └── vue.d.ts ├── ScriptsLocal │ ├── Sample.Chosen.js │ ├── Sample.Chosen.js.map │ ├── Sample.Chosen.ts │ ├── Sample.Grid.js │ ├── Sample.Grid.ts │ ├── Sample.KO1.js │ ├── Sample.KO1.js.map │ ├── Sample.KO1.ts │ ├── Sample.KO2.js │ ├── Sample.KO2.js.map │ ├── Sample.KO2.ts │ ├── Sample.KO3.js │ ├── Sample.KO3.js.map │ ├── Sample.KO3.ts │ ├── Sample.KO4.js │ ├── Sample.KO4.js.map │ ├── Sample.KO4.ts │ ├── Sample.KO5.js │ ├── Sample.KO5.js.map │ ├── Sample.KO5.ts │ ├── Sample.MapControl.js │ ├── Sample.MapControl.js.map │ ├── Sample.MapControl.ts │ ├── Sample.Modal.js │ ├── Sample.Modal.js.map │ ├── Sample.Modal.ts │ ├── Sample.ShopCart-products.js │ ├── Sample.ShopCart-products.js.map │ ├── Sample.ShopCart-products.ts │ ├── Sample.ShopCart.js │ ├── Sample.ShopCart.js.map │ ├── Sample.ShopCart.ts │ ├── Sample.TabControl.js │ ├── Sample.TabControl.js.map │ ├── Sample.TabControl.ts │ ├── Sample.Youtube.ts │ ├── Utils.js │ ├── Utils.js.map │ ├── Utils.ts │ ├── chosen.d.ts │ └── components │ │ ├── GoogleMap.js │ │ ├── GoogleMap.js.map │ │ ├── GoogleMap.ts │ │ ├── Grid.html │ │ ├── Grid.js │ │ ├── Grid.ts │ │ ├── Modal.html │ │ ├── Modal.js │ │ ├── Modal.js.map │ │ ├── Modal.ts │ │ ├── SourceView.js │ │ ├── SourceView.js.map │ │ ├── SourceView.ts │ │ ├── TabControl.js │ │ ├── TabControl.js.map │ │ ├── TabControl.ts │ │ ├── VueChosen.js │ │ ├── VueChosen.js.map │ │ ├── VueChosen.ts │ │ ├── directives.js │ │ ├── directives.js.map │ │ └── directives.ts ├── TestApp.csproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── WebUtils │ └── BrowserJsonFormatter.cs ├── compilerconfig.json ├── compilerconfig.json.defaults └── packages.config └── VueTests.sln /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | *.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | 2 | VisualStudio 2015 project show casing VueJS, TypeScript, Bootstrap 3 | 4 | - VueJS: http://vuejs.org 5 | - Bootstrap: http://getbootstrap.com/ 6 | - TypeScript: http://www.typescriptlang.org/ 7 | 8 | (also requires "Web Compiler" VS Extension to turn .less file into .css) 9 | 10 | Mostly a collection of simple but progressively complex samples. 11 | It's an empty MVC project with WebAPI setup in the eventuality of doing some JSON experiment with Vue. 12 | As well as some advanced sample and reusable control I need for my own projects. 13 | 14 | 15 | TODO: 16 | + Paged Sorted grid 17 | + add some JSON loader... (with wait animation) 18 | 19 | 20 | port to Vue 1.0 rc1 21 | https://github.com/vuejs/vue/releases/tag/1.0.0-rc.1 22 | http://rc.vuejs.org/guide/installation.html 23 | CDNJS: http://cdnjs.cloudflare.com/ajax/libs/vue/1.0.0-rc.1/vue.min.js 24 | -------------------------------------------------------------------------------- /TestApp/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | using TestApp.WebUtils; 6 | 7 | namespace TestApp 8 | { 9 | public static class WebApiConfig 10 | { 11 | public static void Register(HttpConfiguration config) 12 | { 13 | // Web API configuration and services 14 | 15 | // Web API routes 16 | config.MapHttpAttributeRoutes(); 17 | 18 | config.Routes.MapHttpRoute( 19 | name: "DefaultApi", 20 | routeTemplate: "api/{controller}/{action}/{id}", 21 | defaults: new { id = RouteParameter.Optional } 22 | ); 23 | 24 | // remove the XML formatter, just in case 25 | GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); 26 | 27 | // sets the return media type properly for requests that are using the xml media type 28 | // http://stackoverflow.com/questions/9847564/how-do-i-get-asp-net-web-api-to-return-json-instead-of-xml-using-chrome/20556625#20556625 29 | // scroll down for Todd Menier's answer and explanation. 30 | config.Formatters.Add(new BrowserJsonFormatter()); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /TestApp/Content/samples.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | width: 100%; 4 | } 5 | body { 6 | height: 100%; 7 | width: 100%; 8 | overflow: hidden; 9 | display: -webkit-flex; 10 | display: flex; 11 | -ms-flex-direction: column; 12 | flex-direction: column; 13 | } 14 | body main { 15 | overflow: auto; 16 | flex-grow: 1; 17 | display: -webkit-flex; 18 | display: flex; 19 | -ms-flex-flow: row; 20 | flex-flow: row; 21 | } 22 | body header, 23 | body footer, 24 | body aside, 25 | body nav { 26 | flex-shrink: 0; 27 | flex-basis: auto; 28 | } 29 | body nav { 30 | min-height: 100%; 31 | } 32 | body header { 33 | background-color: #4E0A01; 34 | color: #FFEEDD; 35 | text-align: center; 36 | padding: 5px; 37 | } 38 | body header h1 { 39 | color: #FFEEDD; 40 | } 41 | body nav { 42 | background-color: #FAEFE6; 43 | padding: 5px; 44 | max-width: 15em; 45 | min-height: 100%; 46 | } 47 | body nav h1, 48 | body nav h2, 49 | body nav h3, 50 | body nav h4, 51 | body nav h5 { 52 | color: #4E0A01; 53 | } 54 | body nav a { 55 | color: #4E0A01; 56 | text-decoration: none; 57 | } 58 | body nav ul { 59 | padding: 0; 60 | } 61 | body article { 62 | padding: 1em; 63 | } 64 | [v-cloak] { 65 | display: none; 66 | } 67 | .liveExample { 68 | padding: 1em; 69 | background-color: #EEEEDD; 70 | border: 1px solid #CCC; 71 | max-width: 800px; 72 | } 73 | .code { 74 | background-color: #FFEECC; 75 | border: 1px solid #006; 76 | border-bottom-left-radius: 7.7px; 77 | border-bottom-right-radius: 7.7px; 78 | border-top-left-radius: 7.7px; 79 | border-top-right-radius: 7.7px; 80 | color: gb(120, 60, 10); 81 | font-family: Consolas, Monaco, "Courier New", mono-space, monospace !important; 82 | max-width: 60em; 83 | max-height: 400px; 84 | } 85 | h1 { 86 | color: #A71500; 87 | } 88 | button:disabled { 89 | color: graytext; 90 | } -------------------------------------------------------------------------------- /TestApp/Content/samples.less: -------------------------------------------------------------------------------- 1 | // simple layout 2 | html { 3 | height: 100%; 4 | width:100%; 5 | } 6 | body { 7 | height: 100%; 8 | width:100%; 9 | overflow:hidden; 10 | 11 | display: -webkit-flex; 12 | display: flex; 13 | -ms-flex-direction: column; 14 | flex-direction: column; 15 | 16 | main { 17 | overflow:auto; 18 | flex-grow: 1; 19 | 20 | display: -webkit-flex; 21 | display: flex; 22 | -ms-flex-flow: row; 23 | flex-flow: row; 24 | } 25 | header, footer, aside, nav { 26 | flex-shrink:0; 27 | flex-basis:auto; 28 | } 29 | nav { 30 | min-height: 100%; 31 | } 32 | } 33 | 34 | // styling 35 | body { 36 | header { 37 | background-color:#4E0A01; 38 | color:#FFEEDD; 39 | text-align:center; 40 | padding:5px; 41 | 42 | h1 { 43 | color: #FFEEDD; 44 | } 45 | } 46 | nav { 47 | background-color:#FAEFE6; 48 | padding:5px; 49 | max-width:15em; 50 | min-height:100%; 51 | h1,h2,h3,h4,h5 {color: #4E0A01;} 52 | a {color: #4E0A01; text-decoration:none;} 53 | ul { padding:0; } 54 | } 55 | article { 56 | padding:1em; 57 | } 58 | } 59 | 60 | // hide items until processed 61 | [v-cloak] { display: none } 62 | 63 | // item styling 64 | .liveExample { 65 | padding: 1em; 66 | background-color: #EEEEDD; 67 | border: 1px solid #CCC; 68 | max-width: 800px; 69 | } 70 | 71 | .code { 72 | background-color: #FFEECC; 73 | border: 1px solid #006; 74 | border-bottom-left-radius: 7.7px; 75 | border-bottom-right-radius: 7.7px; 76 | border-top-left-radius: 7.7px; 77 | border-top-right-radius: 7.7px; 78 | color: gb(120, 60, 10); 79 | font-family: Consolas, Monaco, "Courier New", mono-space, monospace !important; 80 | 81 | max-width: 60em; 82 | max-height:400px; 83 | } 84 | 85 | h1 { 86 | color: #A71500; 87 | } 88 | 89 | button:disabled { 90 | color: graytext; 91 | } -------------------------------------------------------------------------------- /TestApp/Content/samples.min.css: -------------------------------------------------------------------------------- 1 | html{height:100%;width:100%;}body{height:100%;width:100%;overflow:hidden;display:-webkit-flex;display:flex;-ms-flex-direction:column;flex-direction:column;}body main{overflow:auto;flex-grow:1;display:-webkit-flex;display:flex;-ms-flex-flow:row;flex-flow:row;}body header,body footer,body aside,body nav{flex-shrink:0;flex-basis:auto;}body nav{min-height:100%;}body header{background-color:#4e0a01;color:#fed;text-align:center;padding:5px;}body header h1{color:#fed;}body nav{background-color:#faefe6;padding:5px;max-width:15em;min-height:100%;}body nav h1,body nav h2,body nav h3,body nav h4,body nav h5{color:#4e0a01;}body nav a{color:#4e0a01;text-decoration:none;}body nav ul{padding:0;}body article{padding:1em;}[v-cloak]{display:none;}.liveExample{padding:1em;background-color:#eed;border:1px solid #ccc;max-width:800px;}.code{background-color:#fec;border:1px solid #006;border-bottom-left-radius:7.7px;border-bottom-right-radius:7.7px;border-top-left-radius:7.7px;border-top-right-radius:7.7px;color:gb(120,60,10);font-family:Consolas,Monaco,"Courier New",mono-space,monospace !important;max-width:60em;max-height:400px;}h1{color:#a71500;}button:disabled{color:graytext;} -------------------------------------------------------------------------------- /TestApp/DefaultPage.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | INTRODUCTORY TEXT HERE 34 | 35 |
36 |

Live Example

37 |
38 | CONTENT HERE 39 |
40 | 41 | 42 | 43 | 44 |
45 | 46 |
47 |
48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /TestApp/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="TestApp.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /TestApp/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Routing; 7 | 8 | namespace TestApp 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /TestApp/ListOfSamples.html: -------------------------------------------------------------------------------- 1 | 
2 |

Introductory examples

3 | 25 | 26 |

27 | 28 |

Advanced examples

29 | 59 | 60 |
-------------------------------------------------------------------------------- /TestApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TestApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TestApp")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("16dda46f-318e-475f-a5df-f6ad0099bb4d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /TestApp/Sample.Chosen.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |

Vue Samples Collection

27 |
28 | Vue (resources) 29 | | Bootstrap 30 | | TypeScript 31 |
32 |
33 |
34 | 37 |
38 | This demonstrate how to use Chosen with Vue. 39 | 40 |
41 |

Live Example

42 |
43 |

44 | Multi Selection: 45 | 51 |
52 | 53 | {{ item.name }} ({{ item.ID }}), 54 | 55 |

56 |

57 | Single Selection 58 | 63 |
64 | 65 | {{single.name}} by {{single.author}}, ratings: {{single.rating}} ({{single.ID}}) 66 | 67 |

68 |
69 | 70 | 71 | 72 | 73 | 74 |
75 | 76 |
77 |
78 | 79 | 80 | 81 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /TestApp/Sample.Grid.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | This example demonstrate a fully functional client side, paged, sorted grid control. 34 | 35 |
36 |

Live Example

37 |
38 | GRID HERE 39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /TestApp/Sample.KO1.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | 34 | 35 |

Hello World Example

36 |

37 | In this example, the two text boxes are bound to observable variables on a data model. The “full name” display is bound to a computed observable, whose value is calculated in terms of the observables. 38 |

39 |

40 | Edit either text box to see the “full name” display update. See the HTML source code and notice there’s no need to catch “onchange” events. Knockout knows when to update the UI. 41 |

42 | 43 |
44 |

Live Example

45 |
46 |

First name:

47 |

Last name:

48 |

Hello, !

49 |
50 | 51 | 52 | 53 | 54 |
55 | 56 |
57 |
58 | 59 | 60 | 61 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /TestApp/Sample.KO2.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |

Vue Samples Collection

21 |
22 | Vue (resources) 23 | | Bootstrap 24 | | TypeScript 25 |
26 |
27 |
28 | 31 |
32 | 33 | 34 |

Click counter example

35 |

36 | This example demonstrates creating a view model class and applying various bindings to some HTML markup so that it reflects and edits the state of the view model. 37 |

38 |

39 | VueJS tracks dependencies. Internally, hasClickedTooManyTimes has a subscription on numberOfClicks, so when numberOfClicks changes, that forces hasClickedTooManyTimes to be re-evaluated. Similarly, multiple parts of the UI reference hasClickedTooManyTimes and are therefore subscribed to it. Whenever hasClickedTooManyTimes changes, this causes the UI to be updated. 40 |

41 |

42 | You don’t have to define or manage these subscriptions manually. They are created and destroyed as needed by the framework. Check the HTML source code to see how simple this is. 43 |

44 | 45 |
46 |

Live Example

47 |
48 |
You've clicked   times
49 | 50 |
51 | That's too many clicks! Please stop before you wear out your fingers. 52 | 53 |
54 |
55 | 56 | 57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 | 65 | 66 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /TestApp/Sample.KO3.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | 34 | 35 |

Simple list example

36 |

37 | This example demonstrates binding to an array of values. 38 |

39 |

40 | Notice how the “Add” button is enabled only when you have entered some text - check the HTML source code to see how to use the “enable” binding. 41 |

42 | 43 |
44 |

Live Example

45 |
46 |
47 | New item: 48 | 49 | 50 |

Your items:

51 | 54 |
55 |
56 | 57 | 58 | 59 | 60 |
61 | 62 |
63 |
64 | 65 | 66 | 67 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /TestApp/Sample.KO4.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | 34 | 35 |

Better list example

36 |

37 | This example builds on the earlier simple list example by making it possible to remove items (with multi-selection) and to sort the list. The “remove” and “sort” buttons become disabled if they are not applicable (e.g., if there aren’t enough items to sort). 38 |

39 |

40 | Check out the HTML source code to see how little code all this takes. This example also shows how you can use function literals in bindings (see the binding for ‘sort’). 41 |

42 | 43 |
44 |

Live Example

45 |
46 |
47 | New item: 48 | 49 | 50 |
51 |

Your values:

52 | 55 |
56 | 57 | 58 |
59 |
60 | 61 | 62 | 63 | 64 |
65 | 66 |
67 |
68 | 69 | 70 | 71 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /TestApp/Sample.KO5.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 23 | 24 | 25 |
26 |

Vue Samples Collection

27 |
28 | Vue (resources) 29 | | Bootstrap 30 | | TypeScript 31 |
32 |
33 |
34 | 37 |
38 | 39 | 40 |

Control types example

41 |

42 | For reference, here’s an example of binding view model properties to a range of HTML control types. There’s nothing interesting about the view model here - this is just to make clear how bindings work with select elements, radio buttons, etc. 43 |

44 | 45 |
46 |

Live Example

47 |
48 |
49 |

What's in the model?

50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
Text value:
Password:
Bool value:
Selected option:
Multi-selected options:
Radio button selection:
76 |
77 | 78 |

HTML controls

79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 107 | 108 | 109 | 110 | 115 | 116 | 117 | 118 | 123 | 124 |
Text value (updates on change):
Text value (updates on keystroke):
Text value (multi-line):
Password:
Checkbox:
Drop-down list: 103 | 106 |
Multi-select drop-down list: 111 | 114 |
Radio buttons: 119 | 120 | 121 | 122 |
125 |
126 | 127 | 128 | 129 | 130 | 131 |
132 | 133 |
134 |
135 | 136 | 137 | 138 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /TestApp/Sample.MapControl.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 |

34 | This sample show a simple Google map control. Following direction from 35 | Google Map API documentation and wrapping them with View. 36 |

37 | 38 |
39 |

Live Example

40 |
41 | 42 | 43 |
44 | 45 | 46 |
47 | 48 | 49 | 50 | 51 | 52 |
53 | 54 |
55 |
56 | 57 | 58 | 59 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /TestApp/Sample.Modal.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | This show a simple binding for Bootstrap's Modal dialog. 34 | 35 |
36 |

Live Example

37 |
38 | 39 | 40 | 41 |
42 |

customized header

43 | 44 |
45 |
46 |

Name

47 |

Age

48 |

Info

49 |
50 |
51 |
52 | 53 | 54 | 55 | 56 | 57 | 58 |
59 | 60 |
61 |
62 | 63 | 64 | 65 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /TestApp/Sample.ShopCart.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 28 |
29 |

Vue Samples Collection

30 |
31 | Vue (resources) 32 | | Bootstrap 33 | | TypeScript 34 |
35 |
36 |
37 | 40 |
41 | 42 |

Cart editor example

43 |

44 | This example shows how computed observables can be chained together. Each cart line has a ko.pureComputed property for its own subtotal, and these in turn are combined in a further ko.pureComputed property for the grand total. When you change the data, your changes ripple out through this chain of computed properties, and all associated UI is updated. 45 |

46 |

47 | This example also demonstrates a simple way to create cascading dropdowns. 48 |

49 | 50 |
51 |

Live Example

52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 72 | 78 | 81 | 84 | 87 | 90 | 91 | 92 |
CategoryProductPriceQuantitySubtotal
67 | 71 | 73 | 77 | 79 | 80 | 82 | 83 | 85 | 86 | 88 | Remove 89 |
93 |

94 | Total value: 95 |

96 | 97 | 98 | 99 |
100 | 101 | 102 | 103 | 104 |
105 | 106 |
107 |
108 | 109 | 110 | 111 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /TestApp/Sample.TabControl.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 |

34 | This sample illustrate a custom directive to simplify writing Bootstrap Tab controls. 35 |

36 | 37 |
38 |

Live Example

39 |
40 | 41 |
42 | 43 | somethings 44 | 45 | 46 | something else! 47 | 48 | 49 |
50 | Identity 51 |
52 |
53 | Name, please? 54 |
55 |
56 |
57 |
58 | 59 | 60 | 61 | 62 | 63 |
64 | 65 |
66 |
67 | 68 | 69 | 70 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /TestApp/Sample.Youtube.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TITLE HERE 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Vue Samples Collection

22 |
23 | Vue (resources) 24 | | Bootstrap 25 | | TypeScript 26 |
27 |
28 |
29 | 32 |
33 | Display some youtube video! 34 | 35 |
36 |

Live Example

37 |
38 | 42 |
43 | 51 |
52 |
53 | 54 |
55 | {{selection.name}} 56 |
57 |
58 | 59 | 60 | 61 | 62 |
63 | 64 |
65 |
66 | 67 | 68 | 69 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /TestApp/Scripts/typings/bootstrap/bootstrap.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Bootstrap 3.3.5 2 | // Project: http://twitter.github.com/bootstrap/ 3 | // Definitions by: Boris Yankov 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | /// 8 | 9 | interface ModalOptions { 10 | backdrop?: boolean | string; 11 | keyboard?: boolean; 12 | show?: boolean; 13 | remote?: string; 14 | } 15 | 16 | interface ModalOptionsBackdropString { 17 | backdrop?: string; // for "static" 18 | keyboard?: boolean; 19 | show?: boolean; 20 | remote?: string; 21 | } 22 | 23 | interface ScrollSpyOptions { 24 | offset?: number; 25 | target?: string; 26 | } 27 | 28 | interface TooltipOptions { 29 | animation?: boolean; 30 | html?: boolean; 31 | placement?: string | Function; 32 | selector?: string; 33 | title?: string | Function; 34 | trigger?: string; 35 | template?: string; 36 | delay?: number | Object; 37 | container?: string | boolean; 38 | viewport?: string | Function | Object; 39 | } 40 | 41 | interface PopoverOptions { 42 | animation?: boolean; 43 | html?: boolean; 44 | placement?: string | Function; 45 | selector?: string; 46 | trigger?: string; 47 | title?: string | Function; 48 | template?: string; 49 | content?: any; 50 | delay?: number | Object; 51 | container?: string | boolean; 52 | viewport?: string | Function | Object; 53 | } 54 | 55 | interface CollapseOptions { 56 | parent?: any; 57 | toggle?: boolean; 58 | } 59 | 60 | interface CarouselOptions { 61 | interval?: number; 62 | pause?: string; 63 | wrap?: boolean; 64 | keybord?: boolean; 65 | } 66 | 67 | interface TypeaheadOptions { 68 | source?: any; 69 | items?: number; 70 | minLength?: number; 71 | matcher?: (item: any) => boolean; 72 | sorter?: (items: any[]) => any[]; 73 | updater?: (item: any) => any; 74 | highlighter?: (item: any) => string; 75 | } 76 | 77 | interface AffixOptions { 78 | offset?: number | Function | Object; 79 | target?: any; 80 | } 81 | 82 | interface JQuery { 83 | modal(options?: ModalOptions): JQuery; 84 | modal(options?: ModalOptionsBackdropString): JQuery; 85 | modal(command: string): JQuery; 86 | 87 | dropdown(): JQuery; 88 | dropdown(command: string): JQuery; 89 | 90 | scrollspy(command: string): JQuery; 91 | scrollspy(options?: ScrollSpyOptions): JQuery; 92 | 93 | tab(): JQuery; 94 | tab(command: string): JQuery; 95 | 96 | tooltip(options?: TooltipOptions): JQuery; 97 | tooltip(command: string): JQuery; 98 | 99 | popover(options?: PopoverOptions): JQuery; 100 | popover(command: string): JQuery; 101 | 102 | alert(): JQuery; 103 | alert(command: string): JQuery; 104 | 105 | button(): JQuery; 106 | button(command: string): JQuery; 107 | 108 | collapse(options?: CollapseOptions): JQuery; 109 | collapse(command: string): JQuery; 110 | 111 | carousel(options?: CarouselOptions): JQuery; 112 | carousel(command: string): JQuery; 113 | 114 | typeahead(options?: TypeaheadOptions): JQuery; 115 | 116 | affix(options?: AffixOptions): JQuery; 117 | } 118 | 119 | declare module "bootstrap" { 120 | } -------------------------------------------------------------------------------- /TestApp/Scripts/typings/vue/vue.d.ts: -------------------------------------------------------------------------------- 1 |  2 | interface VueAttributes { 3 | [n: string]: string; 4 | } 5 | 6 | interface VueCallback { 7 | (): void; 8 | } 9 | 10 | interface ValueCallback { 11 | (value: any): void; 12 | } 13 | 14 | interface Array { 15 | $set(o: T): Array; 16 | $remove(o: T): Array; 17 | } 18 | 19 | declare class Vue { 20 | constructor(); 21 | constructor(options: boolean); 22 | constructor(options: {}); 23 | static extend(options: {}): Vue; 24 | static config(key: string, value?: any); 25 | static config(options: string); 26 | static config(options: string, value: any); 27 | static config(options: {}); 28 | static directive(id: string, definition: ValueCallback); 29 | static directive(id: string, definition?: any); 30 | static filter(id: string, definition?: ValueCallback); 31 | static component(id: string, definition: Vue); 32 | static component(id: string, definition?: {}); 33 | static effect(id: string, definition?: ValueCallback); 34 | static partial(id: string, definition: string); 35 | static partial(id: string, definition: HTMLElement); 36 | static nextTick(callback: ValueCallback); 37 | static require(module: string); 38 | static use(plugin: string, args?: {}); 39 | static use(plugin: {}, args?: {}); 40 | 41 | $init(options: any); 42 | $watch(keypath: string, callback: any); 43 | $unwatch(keypath: string, callback?: any); 44 | $get(keypath: string); 45 | $set(keypath: string, value: any); 46 | $dispatch(event: string, ...args: any[]); 47 | $broadcast(event: string, ...args: any[]); 48 | $emit(event: string, ...args: any[]); 49 | $on(keypath: string, callback: any); 50 | $once(keypath: string, callback: any); 51 | $off(keypath: string, callback: any); 52 | $appendTo(element: HTMLElement); 53 | $appendTo(element: string); 54 | 55 | $log(keypath?: string); 56 | $add(key: string, value); 57 | $delete(key: string); 58 | $eval(expression: string); 59 | $interpolate(templateString: string); 60 | 61 | $mount(target: HTMLElement | string); 62 | $destroy(remove?: boolean); 63 | $compile(element: HTMLElement); 64 | $addChild(options?: any, construct?: Function); 65 | 66 | $before(element: HTMLElement); 67 | $before(element: string); 68 | 69 | $after(element: HTMLElement); 70 | $after(element: string); 71 | 72 | $remove(); 73 | $destroy(); 74 | 75 | $el: HTMLElement; 76 | $data: any; // {} 77 | $options: any; // {} 78 | $: any; // {} 79 | $index: number; 80 | $parent: Vue; 81 | $root: Vue; 82 | $compiler: any; 83 | 84 | 85 | template: string; 86 | replace: boolean; 87 | tagName: string; 88 | id: string; 89 | className: string; 90 | attributes: any; 91 | 92 | created(): void; 93 | ready(): void; 94 | attached(): void; 95 | detached(): void; 96 | beforeDestroy(): void; 97 | afterDestroy(): void; 98 | 99 | lazy: boolean; 100 | } 101 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Chosen.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var Chosen; 4 | (function (Chosen) { 5 | var data = [ 6 | { ID: 'B00CGOSBTU', name: 'Dark Space', author: 'Jasper T. Scott', rating: 4.0 }, 7 | { ID: 'B007Y6LHAA', name: 'The Backworlds: Living on the Edge', author: 'M. Pax', rating: 3.5 }, 8 | { ID: 'B00YR3S2SI', name: '2287 A.D. - After Destruction', author: 'R. Brown', rating: 3.6 }, 9 | { ID: 'B00S8FCJCQ', name: 'The Three-Body Problem', author: 'Cixin Liu', rating: 4.5 }, 10 | { ID: 'B004GJXQ20', name: 'A Game of Thrones', author: 'George R. R. Martin', rating: 4.5 }, 11 | { ID: 'B004H4XAXO', name: 'The Way of Kings: The Stormlight Archive', author: ' Brandon Sanderson', rating: 4.7 }, 12 | { ID: 'B00L3S2LWS', name: 'The Abyss Beyond Dreams', author: 'Peter F. Hamilton', rating: 4.3 }, 13 | { ID: 'B0047T70VW', name: 'The Windup Girl', author: ' Paolo Bacigalupi', rating: 3.9 }, 14 | { ID: 'B00I5NVFS0', name: 'Frostborn: The Undying Wizard', author: 'Jonathan Moeller', rating: 4.3 }, 15 | { ID: 'B00C2RSA9C', name: 'The Human Division', author: 'John Scalzi', rating: 4.1 }, 16 | { ID: 'B00I2WNYJW', name: 'Capital in the Twenty-First Century', author: 'Thomas Piketty', rating: 4.0 }, 17 | ]; 18 | var model = { 19 | books: data, 20 | selected: [], 21 | single: data[1], 22 | }; 23 | new Vue({ 24 | el: '#sample', 25 | data: model, 26 | }); 27 | model.single = data[0]; 28 | })(Chosen = Sample.Chosen || (Sample.Chosen = {})); 29 | })(Sample || (Sample = {})); 30 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Chosen.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.Chosen.js","sourceRoot":"","sources":["Sample.Chosen.ts"],"names":["Sample","Sample.Chosen"],"mappings":"AAAA,IAAO,MAAM,CAiCZ;AAjCD,WAAO,MAAM;IAACA,IAAAA,MAAMA,CAiCnBA;IAjCaA,WAAAA,MAAMA,EAACA,CAACA;QASlBC,IAAIA,IAAIA,GAAYA;YAChBA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,YAAYA,EAAEA,MAAMA,EAAEA,iBAAiBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YAChFA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,oCAAoCA,EAAEA,MAAMA,EAAEA,QAAQA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YAC/FA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,+BAA+BA,EAAEA,MAAMA,EAAEA,UAAUA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YAC5FA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,wBAAwBA,EAAEA,MAAMA,EAAEA,WAAWA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YACtFA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,mBAAmBA,EAAEA,MAAMA,EAAEA,qBAAqBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YAC3FA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,0CAA0CA,EAAEA,MAAMA,EAAEA,oBAAoBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YACjHA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,yBAAyBA,EAAEA,MAAMA,EAAEA,mBAAmBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YAC/FA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,iBAAiBA,EAAEA,MAAMA,EAAEA,mBAAmBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YACvFA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,+BAA+BA,EAAEA,MAAMA,EAAEA,kBAAkBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YACpGA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,oBAAoBA,EAAEA,MAAMA,EAAEA,aAAaA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;YACpFA,EAAEA,EAAEA,EAAEA,YAAYA,EAAEA,IAAIA,EAAEA,qCAAqCA,EAAEA,MAAMA,EAAEA,gBAAgBA,EAAEA,MAAMA,EAAEA,GAAGA,EAAEA;SAC3GA,CAACA;QACFA,IAAIA,KAAKA,GAAGA;YACRA,KAAKA,EAAEA,IAAIA;YACXA,QAAQA,EAAWA,EAAEA;YACrBA,MAAMA,EAASA,IAAIA,CAACA,CAACA,CAACA;SACzBA,CAACA;QAEFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;SACdA,CAACA,CAACA;QACHA,KAAKA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,CAACA,CAACA,CAACA;IAC3BA,CAACA,EAjCaD,MAAMA,GAANA,aAAMA,KAANA,aAAMA,QAiCnBA;AAADA,CAACA,EAjCM,MAAM,KAAN,MAAM,QAiCZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Chosen.ts: -------------------------------------------------------------------------------- 1 | module Sample.Chosen { 2 | 3 | interface IBook { 4 | ID: string; 5 | name: string; 6 | author?: string; 7 | value?: number; 8 | rating?: number; 9 | } 10 | var data: IBook[] = [ 11 | { ID: 'B00CGOSBTU', name: 'Dark Space', author: 'Jasper T. Scott', rating: 4.0 }, 12 | { ID: 'B007Y6LHAA', name: 'The Backworlds: Living on the Edge', author: 'M. Pax', rating: 3.5 }, 13 | { ID: 'B00YR3S2SI', name: '2287 A.D. - After Destruction', author: 'R. Brown', rating: 3.6 }, 14 | { ID: 'B00S8FCJCQ', name: 'The Three-Body Problem', author: 'Cixin Liu', rating: 4.5 }, 15 | { ID: 'B004GJXQ20', name: 'A Game of Thrones', author: 'George R. R. Martin', rating: 4.5 }, 16 | { ID: 'B004H4XAXO', name: 'The Way of Kings: The Stormlight Archive', author: ' Brandon Sanderson', rating: 4.7 }, 17 | { ID: 'B00L3S2LWS', name: 'The Abyss Beyond Dreams', author: 'Peter F. Hamilton', rating: 4.3 }, 18 | { ID: 'B0047T70VW', name: 'The Windup Girl', author: ' Paolo Bacigalupi', rating: 3.9 }, 19 | { ID: 'B00I5NVFS0', name: 'Frostborn: The Undying Wizard', author: 'Jonathan Moeller', rating: 4.3 }, 20 | { ID: 'B00C2RSA9C', name: 'The Human Division', author: 'John Scalzi', rating: 4.1 }, 21 | { ID: 'B00I2WNYJW', name: 'Capital in the Twenty-First Century', author: 'Thomas Piketty', rating: 4.0 }, 22 | ]; 23 | var model = { 24 | books: data, 25 | selected: [], 26 | single: data[1], 27 | }; 28 | 29 | new Vue({ 30 | el: '#sample', 31 | data: model, 32 | }); 33 | model.single = data[0]; 34 | } 35 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Grid.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO1; 4 | (function (KO1) { 5 | new Vue({ 6 | el: '#sample', 7 | data: null, 8 | }); 9 | })(KO1 = Sample.KO1 || (Sample.KO1 = {})); 10 | })(Sample || (Sample = {})); 11 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Grid.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO1 { 2 | 3 | new Vue({ 4 | el: '#sample', 5 | data: null, 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO1.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO1; 4 | (function (KO1) { 5 | var model = { 6 | firstName: "Albert", 7 | lastName: "Einstein", 8 | }; 9 | new Vue({ 10 | el: '#sample', 11 | data: model, 12 | computed: { 13 | fullName: function () { 14 | return this.firstName + ' ' + this.lastName; 15 | } 16 | } 17 | }); 18 | })(KO1 = Sample.KO1 || (Sample.KO1 = {})); 19 | })(Sample || (Sample = {})); 20 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.KO1.js","sourceRoot":"","sources":["Sample.KO1.ts"],"names":["Sample","Sample.KO1"],"mappings":"AAAA,IAAO,MAAM,CAgBZ;AAhBD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CAgBhBA;IAhBaA,WAAAA,GAAGA,EAACA,CAACA;QAEfC,IAAIA,KAAKA,GAAGA;YACRA,SAASA,EAAEA,QAAQA;YACnBA,QAAQA,EAAEA,UAAUA;SACvBA,CAACA;QAEFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;YACXA,QAAQA,EAAEA;gBACNA,QAAQA,EAAEA;oBACN,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAChD,CAAC;aACJA;SACJA,CAACA,CAACA;IACPA,CAACA,EAhBaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QAgBhBA;AAADA,CAACA,EAhBM,MAAM,KAAN,MAAM,QAgBZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO1.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO1 { 2 | 3 | var model = { 4 | firstName: "Albert", 5 | lastName: "Einstein", 6 | }; 7 | 8 | new Vue({ 9 | el: '#sample', 10 | data: model, 11 | computed: { 12 | fullName: function () { 13 | return this.firstName + ' ' + this.lastName; 14 | } 15 | } 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO2.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO2; 4 | (function (KO2) { 5 | var model = { 6 | numberOfClicks: 0, 7 | registerClick: function () { this.numberOfClicks++; }, 8 | }; 9 | new Vue({ 10 | el: '#sample', 11 | data: model, 12 | computed: { 13 | hasClickedTooManyTimes: function () { 14 | return this.numberOfClicks >= 3; 15 | } 16 | } 17 | }); 18 | })(KO2 = Sample.KO2 || (Sample.KO2 = {})); 19 | })(Sample || (Sample = {})); 20 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO2.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.KO2.js","sourceRoot":"","sources":["Sample.KO2.ts"],"names":["Sample","Sample.KO2"],"mappings":"AAAA,IAAO,MAAM,CAgBZ;AAhBD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CAgBhBA;IAhBaA,WAAAA,GAAGA,EAACA,CAACA;QAEfC,IAAIA,KAAKA,GAAGA;YACRA,cAAcA,EAAEA,CAACA;YACjBA,aAAaA,EAAEA,cAAc,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;SACxDA,CAACA;QAEFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;YACXA,QAAQA,EAAEA;gBACNA,sBAAsBA,EAAEA;oBACpB,MAAM,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;gBACpC,CAAC;aACJA;SACJA,CAACA,CAACA;IACPA,CAACA,EAhBaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QAgBhBA;AAADA,CAACA,EAhBM,MAAM,KAAN,MAAM,QAgBZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO2.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO2 { 2 | 3 | var model = { 4 | numberOfClicks: 0, 5 | registerClick: function () { this.numberOfClicks++; }, 6 | }; 7 | 8 | new Vue({ 9 | el: '#sample', 10 | data: model, 11 | computed: { 12 | hasClickedTooManyTimes: function () { 13 | return this.numberOfClicks >= 3; 14 | } 15 | } 16 | }); 17 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO3.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO3; 4 | (function (KO3) { 5 | var model = { 6 | itemToAdd: "", 7 | items: ["Alpha", "Beta", "Gamma"], 8 | }; 9 | new Vue({ 10 | el: '#sample', 11 | data: model, 12 | methods: { 13 | addItem: function (e) { 14 | e.preventDefault(); 15 | if (this.itemToAdd) { 16 | this.items.push(this.itemToAdd); 17 | this.itemToAdd = ""; 18 | } 19 | }, 20 | }, 21 | }); 22 | })(KO3 = Sample.KO3 || (Sample.KO3 = {})); 23 | })(Sample || (Sample = {})); 24 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO3.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.KO3.js","sourceRoot":"","sources":["Sample.KO3.ts"],"names":["Sample","Sample.KO3"],"mappings":"AAAA,IAAO,MAAM,CAoBZ;AApBD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CAoBhBA;IApBaA,WAAAA,GAAGA,EAACA,CAACA;QAEfC,IAAIA,KAAKA,GAAGA;YACRA,SAASA,EAAEA,EAAEA;YACbA,KAAKA,EAAEA,CAACA,OAAOA,EAAEA,MAAMA,EAAEA,OAAOA,CAACA;SACpCA,CAACA;QAEFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;YACXA,OAAOA,EAAEA;gBACLA,OAAOA,EAAEA,UAAUA,CAACA;oBAChB,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;wBACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBAChC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;oBACxB,CAAC;gBACL,CAAC;aACJA;SACJA,CAACA,CAACA;IACPA,CAACA,EApBaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QAoBhBA;AAADA,CAACA,EApBM,MAAM,KAAN,MAAM,QAoBZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO3.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO3 { 2 | 3 | var model = { 4 | itemToAdd: "", 5 | items: ["Alpha", "Beta", "Gamma"], 6 | }; 7 | 8 | new Vue({ 9 | el: '#sample', 10 | data: model, 11 | methods: { 12 | addItem: function (e) { 13 | e.preventDefault(); 14 | if (this.itemToAdd) { 15 | this.items.push(this.itemToAdd); 16 | this.itemToAdd = ""; 17 | } 18 | }, 19 | }, 20 | }); 21 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO4.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO3; 4 | (function (KO3) { 5 | var model = { 6 | itemToAdd: "", 7 | items: ["Alpha", "Beta", "Gamma"], 8 | selected: [], 9 | }; 10 | new Vue({ 11 | el: '#sample', 12 | data: model, 13 | methods: { 14 | addItem: function (e) { 15 | e.preventDefault(); 16 | if (this.itemToAdd) { 17 | this.items.push(this.itemToAdd); 18 | this.itemToAdd = ""; 19 | } 20 | }, 21 | removeSelected: function () { 22 | for (var i = 0; i < this.selected.length; i++) { 23 | var item = this.selected[i]; 24 | this.items.remove(item); 25 | } 26 | this.selected = []; 27 | }, 28 | sortItems: function () { 29 | this.items.sort(function (s1, s2) { 30 | s1 = s1.toLowerCase(); 31 | s2 = s2.toLowerCase(); 32 | return s1 < s2 ? -1 : s1 > s2 ? 1 : 0; 33 | }); 34 | }, 35 | }, 36 | }); 37 | })(KO3 = Sample.KO3 || (Sample.KO3 = {})); 38 | })(Sample || (Sample = {})); 39 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO4.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.KO4.js","sourceRoot":"","sources":["Sample.KO4.ts"],"names":["Sample","Sample.KO3"],"mappings":"AAAA,IAAO,MAAM,CAmCZ;AAnCD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CAmChBA;IAnCaA,WAAAA,GAAGA,EAACA,CAACA;QAEfC,IAAIA,KAAKA,GAAGA;YACRA,SAASA,EAAEA,EAAEA;YACbA,KAAKA,EAAEA,CAACA,OAAOA,EAAEA,MAAMA,EAAEA,OAAOA,CAACA;YACjCA,QAAQA,EAAEA,EAAEA;SACfA,CAACA;QAEFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;YACXA,OAAOA,EAAEA;gBACLA,OAAOA,EAAEA,UAAUA,CAACA;oBAChB,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;wBACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBAChC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;oBACxB,CAAC;gBACL,CAAC;gBACDA,cAAcA,EAAEA;oBACZ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;wBAC5C,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBAC5B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC;oBACD,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;gBACvB,CAAC;gBACDA,SAASA,EAAEA;oBACP,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAC,EAAU,EAAE,EAAU;wBACnC,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;wBACtB,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;wBACtB,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;oBAC1C,CAAC,CAAC,CAAC;gBACP,CAAC;aACJA;SACJA,CAACA,CAACA;IACPA,CAACA,EAnCaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QAmChBA;AAADA,CAACA,EAnCM,MAAM,KAAN,MAAM,QAmCZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO4.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO3 { 2 | 3 | var model = { 4 | itemToAdd: "", 5 | items: ["Alpha", "Beta", "Gamma"], 6 | selected: [], 7 | }; 8 | 9 | new Vue({ 10 | el: '#sample', 11 | data: model, 12 | methods: { 13 | addItem: function (e) { 14 | e.preventDefault(); 15 | if (this.itemToAdd) { 16 | this.items.push(this.itemToAdd); 17 | this.itemToAdd = ""; 18 | } 19 | }, 20 | removeSelected: function () { 21 | for (var i = 0; i < this.selected.length; i++) { 22 | var item = this.selected[i]; 23 | this.items.remove(item); 24 | } 25 | this.selected = []; 26 | }, 27 | sortItems: function () { 28 | this.items.sort((s1: string, s2: string) => { 29 | s1 = s1.toLowerCase(); 30 | s2 = s2.toLowerCase(); 31 | return s1 < s2 ? -1 : s1 > s2 ? 1 : 0; 32 | }); 33 | }, 34 | }, 35 | }); 36 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO5.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO3; 4 | (function (KO3) { 5 | var model = { 6 | stringValue: "Hello", 7 | passwordValue: "mypass", 8 | booleanValue: true, 9 | optionValues: ["Alpha", "Beta", "Gamma"], 10 | selectedOptionValue: "Gamma", 11 | multipleSelectedOptionValues: ["Alpha", "Beta"], 12 | radioSelectedOptionValue: "Beta" 13 | }; 14 | new Vue({ 15 | el: '#sample', 16 | data: model, 17 | }); 18 | })(KO3 = Sample.KO3 || (Sample.KO3 = {})); 19 | })(Sample || (Sample = {})); 20 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO5.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.KO5.js","sourceRoot":"","sources":["Sample.KO5.ts"],"names":["Sample","Sample.KO3"],"mappings":"AAAA,IAAO,MAAM,CAgBZ;AAhBD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CAgBhBA;IAhBaA,WAAAA,GAAGA,EAACA,CAACA;QAEfC,IAAIA,KAAKA,GAAGA;YACRA,WAAWA,EAAEA,OAAOA;YACpBA,aAAaA,EAAEA,QAAQA;YACvBA,YAAYA,EAAEA,IAAIA;YAClBA,YAAYA,EAAEA,CAACA,OAAOA,EAAEA,MAAMA,EAAEA,OAAOA,CAACA;YACxCA,mBAAmBA,EAAEA,OAAOA;YAC5BA,4BAA4BA,EAAEA,CAACA,OAAOA,EAAEA,MAAMA,CAACA;YAC/CA,wBAAwBA,EAAEA,MAAMA;SACnCA,CAACA;QAEFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;SACdA,CAACA,CAACA;IACPA,CAACA,EAhBaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QAgBhBA;AAADA,CAACA,EAhBM,MAAM,KAAN,MAAM,QAgBZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.KO5.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO3 { 2 | 3 | var model = { 4 | stringValue: "Hello", 5 | passwordValue: "mypass", 6 | booleanValue: true, 7 | optionValues: ["Alpha", "Beta", "Gamma"], 8 | selectedOptionValue: "Gamma", 9 | multipleSelectedOptionValues: ["Alpha", "Beta"], 10 | radioSelectedOptionValue: "Beta" 11 | }; 12 | 13 | new Vue({ 14 | el: '#sample', 15 | data: model, 16 | }); 17 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.MapControl.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var MapControl; 4 | (function (MapControl) { 5 | var model = { 6 | markers: null, 7 | }; 8 | new Vue({ 9 | el: '#sample', 10 | data: model, 11 | }); 12 | GoogleMapInitDeferred.then(function () { 13 | model.markers = [ 14 | new google.maps.LatLng(-27.468, 153.025), 15 | new google.maps.LatLng(-27.478, 153.035), 16 | new google.maps.LatLng(-27.458, 153.015), 17 | new google.maps.LatLng(-27.458, 153.055), 18 | ]; 19 | }); 20 | })(MapControl = Sample.MapControl || (Sample.MapControl = {})); 21 | })(Sample || (Sample = {})); 22 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.MapControl.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.MapControl.js","sourceRoot":"","sources":["Sample.MapControl.ts"],"names":["Sample","Sample.MapControl"],"mappings":"AACA,IAAO,MAAM,CAgBZ;AAhBD,WAAO,MAAM;IAACA,IAAAA,UAAUA,CAgBvBA;IAhBaA,WAAAA,UAAUA,EAACA,CAACA;QACtBC,IAAIA,KAAKA,GAAGA;YACRA,OAAOA,EAAwBA,IAAIA;SACtCA,CAACA;QACFA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,KAAKA;SACdA,CAACA,CAACA;QACHA,qBAAqBA,CAACA,IAAIA,CAACA;YACvBA,KAAKA,CAACA,OAAOA,GAAGA;gBACZA,IAAIA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,MAAMA,EAAEA,OAAOA,CAACA;gBACxCA,IAAIA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,MAAMA,EAAEA,OAAOA,CAACA;gBACxCA,IAAIA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,MAAMA,EAAEA,OAAOA,CAACA;gBACxCA,IAAIA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,MAAMA,EAAEA,OAAOA,CAACA;aAC3CA,CAACA;QACNA,CAACA,CAACA,CAACA;IACPA,CAACA,EAhBaD,UAAUA,GAAVA,iBAAUA,KAAVA,iBAAUA,QAgBvBA;AAADA,CAACA,EAhBM,MAAM,KAAN,MAAM,QAgBZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.MapControl.ts: -------------------------------------------------------------------------------- 1 |  2 | module Sample.MapControl { 3 | var model = { 4 | markers: null, 5 | }; 6 | new Vue({ 7 | el: '#sample', 8 | data: model, 9 | }); 10 | GoogleMapInitDeferred.then(() => { 11 | model.markers = [ 12 | new google.maps.LatLng(-27.468, 153.025), 13 | new google.maps.LatLng(-27.478, 153.035), 14 | new google.maps.LatLng(-27.458, 153.015), 15 | new google.maps.LatLng(-27.458, 153.055), 16 | ]; 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Modal.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var Modal; 4 | (function (Modal) { 5 | new Vue({ 6 | el: '#sample', 7 | data: { 8 | showModal: false 9 | }, 10 | }); 11 | })(Modal = Sample.Modal || (Sample.Modal = {})); 12 | })(Sample || (Sample = {})); 13 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Modal.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.Modal.js","sourceRoot":"","sources":["Sample.Modal.ts"],"names":["Sample","Sample.Modal"],"mappings":"AAAA,IAAO,MAAM,CAQZ;AARD,WAAO,MAAM;IAACA,IAAAA,KAAKA,CAQlBA;IARaA,WAAAA,KAAKA,EAACA,CAACA;QAEjBC,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA;gBACFA,SAASA,EAAEA,KAAKA;aACnBA;SACJA,CAACA,CAACA;IACPA,CAACA,EARaD,KAAKA,GAALA,YAAKA,KAALA,YAAKA,QAQlBA;AAADA,CAACA,EARM,MAAM,KAAN,MAAM,QAQZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Modal.ts: -------------------------------------------------------------------------------- 1 | module Sample.Modal { 2 | 3 | new Vue({ 4 | el: '#sample', 5 | data: { 6 | showModal: false 7 | }, 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.ShopCart-products.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.ShopCart-products.js","sourceRoot":"","sources":["Sample.ShopCart-products.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,IAAI,uBAAuB,GAAG;IAC1B;QACI,UAAU,EAAE;YACR;gBACI,MAAM,EAAE,6BAA6B;gBACrC,OAAO,EAAE,IAAI;aAChB;YACD;gBACI,MAAM,EAAE,gCAAgC;gBACxC,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,oBAAoB;gBAC5B,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,0BAA0B;gBAClC,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,mBAAmB;gBAC3B,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,yBAAyB;gBACjC,OAAO,EAAE,IAAI;aAChB;YACD;gBACI,MAAM,EAAE,2BAA2B;gBACnC,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,uBAAuB;gBAC/B,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EA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B,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,kCAAkC;gBAC1C,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,0CAA0C;gBAClD,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,2BAA2B;gBACnC,OAAO,EAAE,IAAI;aAChB;YACD;gBACI,MAAM,EAAE,sBAAsB;gBAC9B,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,2CAA2C;gBACnD,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,yBAAyB;gBACjC,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,6BAA6B;gBACrC,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,0BAA0B;gBAClC,OAAO,EAAE,KAAK;aACjB;YACD;gBACI,MAAM,EAAE,yCAAyC;gBACjD,OAAO,EAAE,KAAK;aACjB;SACJ;QACD,MAAM,EAAE,cAAc;KACzB;CACJ,CAAC"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.ShopCart.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO3; 4 | (function (KO3) { 5 | var CartLine = (function () { 6 | function CartLine() { 7 | this.product = null; 8 | this.quantity = 1; 9 | this._category = null; 10 | // REMARK local additional functionality, not part of original Vue!!! 11 | //Vue.watcher(this, 'category', (x) => this.product = null); // previous technique 12 | } 13 | Object.defineProperty(CartLine.prototype, "category", { 14 | // using getter and setter property! :P 15 | get: function () { return this._category; }, 16 | set: function (value) { 17 | this._category = value; 18 | this.product = null; 19 | }, 20 | enumerable: true, 21 | configurable: true 22 | }); 23 | CartLine.prototype.subtotal = function () { 24 | if (!this.product) 25 | return 0; 26 | return this.product.price * this.quantity; 27 | }; 28 | return CartLine; 29 | })(); 30 | var Cart = (function () { 31 | function Cart() { 32 | this.lines = [new CartLine()]; 33 | this.categories = sampleProductCategories; 34 | } 35 | Cart.prototype.grandTotal = function () { 36 | var total = 0; 37 | $.each(this.lines, function (i, item) { return total += item.subtotal(); }); 38 | return total; 39 | }; 40 | Cart.prototype.addLine = function () { this.lines.push(new CartLine()); }; 41 | Cart.prototype.removeLine = function (line) { this.lines.remove(line); }; 42 | Cart.prototype.save = function () { 43 | var data = $.map(this.lines, function (line) { 44 | if (!line.product) 45 | return undefined; 46 | return { 47 | productName: line.product.name, 48 | quantity: line.quantity, 49 | }; 50 | }); 51 | alert("Could now send this to server: " + JSON.stringify(data)); 52 | }; 53 | return Cart; 54 | })(); 55 | new Vue({ 56 | el: '#sample', 57 | data: new Cart(), 58 | // get around that Vue only support plain objects 59 | methods: { 60 | formatCurrency: function (value) { 61 | return "$" + value.toFixed(2); 62 | }, 63 | }, 64 | }); 65 | })(KO3 = Sample.KO3 || (Sample.KO3 = {})); 66 | })(Sample || (Sample = {})); 67 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.ShopCart.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.ShopCart.js","sourceRoot":"","sources":["Sample.ShopCart.ts"],"names":["Sample","Sample.KO3","Sample.KO3.CartLine","Sample.KO3.CartLine.constructor","Sample.KO3.CartLine.category","Sample.KO3.CartLine.subtotal","Sample.KO3.Cart","Sample.KO3.Cart.constructor","Sample.KO3.Cart.grandTotal","Sample.KO3.Cart.addLine","Sample.KO3.Cart.removeLine","Sample.KO3.Cart.save"],"mappings":"AAAA,IAAO,MAAM,CA6DZ;AA7DD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CA6DhBA;IA7DaA,WAAAA,GAAGA,EAACA,CAACA;QAMfC;YAGIC;gBAFAC,YAAOA,GAAaA,IAAIA,CAACA;gBACzBA,aAAQA,GAAWA,CAACA,CAACA;gBAYbA,cAASA,GAAQA,IAAIA,CAACA;gBAV1BA,qEAAqEA;gBACrEA,kFAAkFA;YACtFA,CAACA;YAGDD,sBAAIA,8BAAQA;gBADZA,uCAAuCA;qBACvCA,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,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,OAAOA,CAACA;wBACdA,MAAMA,CAACA,SAASA,CAACA;oBACrBA,MAAMA,CAACA;wBACHA,WAAWA,EAAEA,IAAIA,CAACA,OAAOA,CAACA,IAAIA;wBAC9BA,QAAQA,EAAEA,IAAIA,CAACA,QAAQA;qBAC1BA,CAACA;gBACNA,CAACA,CAACA,CAACA;gBACHA,KAAKA,CAACA,iCAAiCA,GAAGA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA;YACpEA,CAACA;YACLL,WAACA;QAADA,CAACA,AArBDL,IAqBCA;QAEDA,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,IAAIA,EAAEA,IAAIA,IAAIA,EAAEA;YAChBA,iDAAiDA;YACjDA,OAAOA,EAAEA;gBACLA,cAAcA,EAAEA,UAAUA,KAAKA;oBAC3B,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAClC,CAAC;aACJA;SACJA,CAACA,CAACA;IACPA,CAACA,EA7DaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QA6DhBA;AAADA,CAACA,EA7DM,MAAM,KAAN,MAAM,QA6DZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.ShopCart.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO3 { 2 | 3 | interface IProduct { 4 | name: string; 5 | price: number; 6 | } 7 | class CartLine { 8 | product: IProduct = null; 9 | quantity: number = 1; 10 | constructor() { 11 | // REMARK local additional functionality, not part of original Vue!!! 12 | //Vue.watcher(this, 'category', (x) => this.product = null); // previous technique 13 | } 14 | 15 | // using getter and setter property! :P 16 | get category() { return this._category; } 17 | set category(value) { 18 | this._category = value; 19 | this.product = null; 20 | } 21 | private _category: any = null; 22 | 23 | subtotal() { 24 | if (!this.product) 25 | return 0; 26 | return this.product.price * this.quantity; 27 | } 28 | } 29 | class Cart { 30 | lines = [new CartLine()]; 31 | grandTotal() { 32 | var total = 0; 33 | $.each(this.lines, (i, item) => total += item.subtotal()); 34 | return total; 35 | } 36 | categories = sampleProductCategories; 37 | addLine() { this.lines.push(new CartLine()); } 38 | removeLine(line: CartLine) { this.lines.remove(line); } 39 | save() { 40 | var data = $.map(this.lines, (line) => { 41 | if (!line.product) 42 | return undefined; 43 | return { 44 | productName: line.product.name, 45 | quantity: line.quantity, 46 | }; 47 | }); 48 | alert("Could now send this to server: " + JSON.stringify(data)); 49 | } 50 | } 51 | 52 | new Vue({ 53 | el: '#sample', 54 | data: new Cart(), 55 | // get around that Vue only support plain objects 56 | methods: { 57 | formatCurrency: function (value) { 58 | return "$" + value.toFixed(2); 59 | }, 60 | }, 61 | }); 62 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.TabControl.js: -------------------------------------------------------------------------------- 1 | var Sample; 2 | (function (Sample) { 3 | var KO1; 4 | (function (KO1) { 5 | new Vue({ 6 | el: '#sample', 7 | computed: { 8 | fullName: function () { 9 | return this.firstName + ' ' + this.lastName; 10 | } 11 | } 12 | }); 13 | })(KO1 = Sample.KO1 || (Sample.KO1 = {})); 14 | })(Sample || (Sample = {})); 15 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.TabControl.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Sample.TabControl.js","sourceRoot":"","sources":["Sample.TabControl.ts"],"names":["Sample","Sample.KO1"],"mappings":"AAAA,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAACA,IAAAA,GAAGA,CAUhBA;IAVaA,WAAAA,GAAGA,EAACA,CAACA;QAEfC,IAAIA,GAAGA,CAACA;YACJA,EAAEA,EAAEA,SAASA;YACbA,QAAQA,EAAEA;gBACNA,QAAQA,EAAEA;oBACN,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAChD,CAAC;aACJA;SACJA,CAACA,CAACA;IACPA,CAACA,EAVaD,GAAGA,GAAHA,UAAGA,KAAHA,UAAGA,QAUhBA;AAADA,CAACA,EAVM,MAAM,KAAN,MAAM,QAUZ"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.TabControl.ts: -------------------------------------------------------------------------------- 1 | module Sample.KO1 { 2 | 3 | new Vue({ 4 | el: '#sample', 5 | computed: { 6 | fullName: function () { 7 | return this.firstName + ' ' + this.lastName; 8 | } 9 | } 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Sample.Youtube.ts: -------------------------------------------------------------------------------- 1 | namespace Sample.Youtue { 2 | 3 | var clips = [ 4 | { name: '10 Video Games That Left Us Emotionally Devastated', tag: 'gYi9Xfguf_g' }, 5 | { name: 'Tested: Microsoft Surface Book Review', tag: 'UBF3EreWIm8' }, 6 | { name: 'Star Wars: The Force Awakens Official Trailer', tag: 'ecH49e_Pw20' }, 7 | ]; 8 | 9 | new Vue({ 10 | el: '#sample', 11 | data: { 12 | selection: null, 13 | clips: clips, 14 | }, 15 | }); 16 | 17 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Utils.js: -------------------------------------------------------------------------------- 1 | /// 2 | var LoaderType; 3 | (function (LoaderType) { 4 | LoaderType[LoaderType["AsString"] = 0] = "AsString"; 5 | LoaderType[LoaderType["AsScriptTag"] = 1] = "AsScriptTag"; 6 | LoaderType[LoaderType["AsCssTag"] = 2] = "AsCssTag"; 7 | LoaderType[LoaderType["AsContent"] = 3] = "AsContent"; 8 | })(LoaderType || (LoaderType = {})); 9 | function loader(urlOrArgs) { 10 | var options; 11 | if (typeof urlOrArgs === "string") { 12 | options = { 13 | url: urlOrArgs, 14 | }; 15 | } 16 | else { 17 | options = urlOrArgs; 18 | } 19 | var result = $.Deferred(); 20 | if (!options.url) { 21 | result.reject('No URL'); 22 | return result; 23 | } 24 | if (options.url[0] != '/') 25 | options.url = '/' + options.url; 26 | var useCache = options.cached == undefined ? loader.useCache : options.cached; 27 | var cache = loader.cache[options.url]; 28 | if (!cache) { 29 | cache = new loader.CacheData(options); 30 | loader.cache[options.url] = cache; 31 | } 32 | else if (!useCache) { 33 | cache.reload(false); 34 | } 35 | cache.then(function (s) { 36 | cache.handle(options); 37 | result.resolve(s); 38 | }); 39 | return result; 40 | } 41 | var loader; 42 | (function (loader) { 43 | var CacheData = (function () { 44 | function CacheData(options) { 45 | this.done = false; 46 | this.callbacks = []; 47 | this.url = options.url; 48 | this.reload(options.cached); 49 | } 50 | CacheData.prototype.then = function (doneFilter) { 51 | if (this.done) { 52 | if (this.text) { 53 | doneFilter(this.text); 54 | } 55 | } 56 | else { 57 | this.callbacks.push(doneFilter); 58 | } 59 | }; 60 | CacheData.prototype.reload = function (useCache) { 61 | var _this = this; 62 | if (useCache === undefined) 63 | useCache = true; 64 | this.done = false; 65 | this.text = null; 66 | this.query = $.ajax({ 67 | url: loader.baseURL + this.url, 68 | cache: useCache, 69 | }); 70 | this.query 71 | .then(function (s) { 72 | _this.done = true; 73 | _this.text = s; 74 | for (var i = 0; i < _this.callbacks.length; i++) { 75 | _this.callbacks[i](s); 76 | } 77 | _this.callbacks.splice(0, _this.callbacks.length); 78 | }) 79 | .fail(function (err) { 80 | _this.done = true; 81 | _this.text = null; 82 | _this.callbacks.splice(0, _this.callbacks.length); 83 | alert('Problem loading ' + _this.url + ', ' + JSON.stringify(err)); 84 | }); 85 | ; 86 | }; 87 | CacheData.prototype.handle = function (options) { 88 | if (!this.done || !this.text) 89 | return; 90 | if (options.type === undefined) 91 | options.type = LoaderType.AsString; 92 | switch (options.type) { 93 | case LoaderType.AsScriptTag: 94 | if (!this.Script) { 95 | this.Script = document.createElement('script'); 96 | if (options.tagType == undefined) 97 | options.tagType = "text/javascript"; 98 | document.appendChild(this.Script); 99 | } 100 | this.Script.type = options.tagType; 101 | this.Script.text = this.text; 102 | break; 103 | case LoaderType.AsCssTag: 104 | if (!this.CSS) { 105 | this.CSS = document.createElement('style'); 106 | if (options.tagType == undefined) 107 | options.tagType = "text/css"; 108 | document.appendChild(this.CSS); 109 | } 110 | this.CSS.type = options.tagType; 111 | this.CSS.style.cssText = this.text; 112 | break; 113 | case LoaderType.AsContent: 114 | if (!this.CONTENT) { 115 | this.CONTENT = document.createElement('div'); 116 | document.appendChild(this.CONTENT); 117 | } 118 | this.CONTENT.innerHTML = this.text; 119 | break; 120 | } 121 | }; 122 | return CacheData; 123 | })(); 124 | loader.CacheData = CacheData; 125 | loader.cache = {}; 126 | loader.baseURL = ""; 127 | loader.useCache = true; 128 | })(loader || (loader = {})); 129 | /** check an array contains an item */ 130 | Array.prototype.contains = function (item) { 131 | for (var i = this.length; i-- > 0;) { 132 | var ti = this[i]; 133 | if (ti === item) 134 | return true; 135 | } 136 | return false; 137 | }; 138 | /** remove one instance of the item and returns whether it was in the array or not */ 139 | Array.prototype.remove = function (item) { 140 | for (var i = this.length; i-- > 0;) { 141 | var ti = this[i]; 142 | if (ti === item) { 143 | this.splice(i, 1); 144 | return true; 145 | } 146 | } 147 | return false; 148 | }; 149 | /** remove one instance of the item and returns whether it was in the array or not */ 150 | Array.prototype.removeWhere = function (predicate, max) { 151 | var rc = 0; 152 | for (var i = this.length; i-- > 0;) { 153 | if (predicate(this[i])) { 154 | this.splice(i, 1); 155 | if (max && max > 0) { 156 | rc++; 157 | if (rc >= max) 158 | break; 159 | } 160 | } 161 | } 162 | }; 163 | function guid() { 164 | var d = Date.now(); 165 | var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 166 | var r = (d + Math.random() * 16) % 16 | 0; 167 | d = Math.floor(d / 16); 168 | return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); 169 | }); 170 | return uuid; 171 | } 172 | function createHTML(name, attributes) { 173 | var res = document.createElement(name); 174 | for (var k in attributes) { 175 | res.setAttribute(k, attributes[k]); 176 | } 177 | return res; 178 | } 179 | // a module which help to do routing / hash navigation, 100 lines for full flexibility and no mystery! :P 180 | var HASH; 181 | (function (HASH) { 182 | var handlers = []; 183 | var _previous = { p: [], kv: {} }; 184 | var current = hashToObject(); 185 | function handle(e) { 186 | _previous = current; 187 | current = hashToObject(); 188 | for (var i = 0; i < handlers.length; i++) { 189 | var data = handlers[i]; 190 | data(_previous, current); 191 | } 192 | } 193 | window.onhashchange = function (e) { handle(e); }; 194 | function on(handler) { 195 | if (!handler) 196 | return; 197 | handlers.push(handler); 198 | } 199 | HASH.on = on; 200 | function off(handler) { 201 | if (!handler) 202 | return; 203 | handlers.remove(handler); 204 | } 205 | HASH.off = off; 206 | function hashToObject(hash) { 207 | if (hash == undefined) 208 | hash = window.location.hash; 209 | var jo = { p: [], kv: {} }; 210 | if (hash == null || hash.substr(0, 1) != "#") 211 | return jo; 212 | var s = hash.substr(1); 213 | var ss = s.split(';'); 214 | for (var i = 0; i < ss.length; i++) { 215 | var sss = ss[i].split(':'); 216 | if (sss.length == 2) 217 | jo.kv[decodeURIComponent(sss[0])] = decodeURIComponent(sss[1]); 218 | else 219 | jo.p.push(decodeURIComponent(ss[i])); 220 | } 221 | return jo; 222 | } 223 | function objectToHash(o) { 224 | var s = ''; 225 | for (var i = 0; i < o.p.length; i++) { 226 | var p = o.p[i]; 227 | if (!p) 228 | continue; 229 | if (s) 230 | s += ';'; 231 | s += encodeURIComponent(p); 232 | } 233 | for (var k in o.kv) { 234 | var v = o.kv[k]; 235 | if (v == undefined || v == null || v == '') 236 | continue; 237 | if (s) 238 | s += ';'; 239 | s += encodeURIComponent(k) + ':' + encodeURIComponent(v); 240 | } 241 | if (!s) 242 | return s; 243 | return '#' + s; 244 | } 245 | function value(o) { 246 | if (o != undefined) { 247 | _previous = current; 248 | current = o; 249 | window.location.hash = objectToHash(o); 250 | } 251 | return hashToObject(); 252 | } 253 | HASH.value = value; 254 | function set(key, value) { 255 | var o = hashToObject(); 256 | o.kv[key] = value; 257 | return HASH.value(o); 258 | } 259 | HASH.set = set; 260 | function scrollToHash() { 261 | for (var i = 0; i < current.p.length; i++) { 262 | var p = current.p[i]; 263 | if (!p) 264 | continue; 265 | var $e = $('#' + p, document); 266 | if ($e.length > 0) { 267 | $e[0].scrollIntoView(); 268 | break; 269 | } 270 | } 271 | } 272 | ; 273 | $(document).ready(function () { return scrollToHash(); }); 274 | })(HASH || (HASH = {})); 275 | var Vue; 276 | (function (Vue) { 277 | function watcher(data, property, callback) { 278 | var options = { 279 | data: data, 280 | watch: {} 281 | }; 282 | options.watch[property] = function (value) { 283 | callback(value); 284 | }; 285 | new Vue(options); 286 | } 287 | Vue.watcher = watcher; 288 | })(Vue || (Vue = {})); 289 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Utils.js","sourceRoot":"","sources":["Utils.ts"],"names":["LoaderType","loader","loader.CacheData","loader.CacheData.constructor","loader.CacheData.then","loader.CacheData.reload","loader.CacheData.handle","guid","createHTML","HASH","HASH.handle","HASH.on","HASH.off","HASH.hashToObject","HASH.objectToHash","HASH.value","HASH.set","HASH.scrollToHash","Vue","Vue.watcher"],"mappings":"AAAA,8DAA8D;AAE9D,IAAK,UAKJ;AALD,WAAK,UAAU;IACXA,mDAAQA,CAAAA;IACRA,yDAAWA,CAAAA;IACXA,mDAAQA,CAAAA;IACRA,qDAASA,CAAAA;AACbA,CAACA,EALI,UAAU,KAAV,UAAU,QAKd;AAOD,gBAAgB,SAAkC;IAC9CC,IAAIA,OAAuBA,CAACA;IAC5BA,EAAEA,CAACA,CAACA,OAAOA,SAASA,KAAKA,QAAQA,CAACA,CAACA,CAACA;QAChCA,OAAOA,GAAGA;YACNA,GAAGA,EAAEA,SAASA;SACjBA,CAACA;IACNA,CAACA;IACDA,IAAIA,CAACA,CAACA;QACFA,OAAOA,GAAGA,SAASA,CAACA;IACxBA,CAACA;IAEDA,IAAIA,MAAMA,GAAGA,CAACA,CAACA,QAAQA,EAAUA,CAACA;IAClCA,EAAEA,CAACA,CAACA,CAACA,OAAOA,CAACA,GAA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BAC7CA,KAAIA,CAACA,SAASA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;gBACzBA,CAACA;gBACDA,KAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,CAACA,EAAEA,KAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,CAACA;YACpDA,CAACA,CAACA;iBACDA,IAAIA,CAACA,UAAAA,GAAGA;gBACLA,KAAIA,CAACA,IAAIA,GAAGA,IAAIA,CAACA;gBACjBA,KAAIA,CAACA,IAAIA,GAAGA,IAAIA,CAACA;gBACjBA,KAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,CAACA,EAAEA,KAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,CAACA;gBAChDA,KAAKA,CAACA,kBAAkBA,GAAGA,KAAIA,CAACA,GAAGA,GAAGA,IAAIA,GAAGA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,CAACA,CAACA;YACtEA,CAACA,CAACA,CAACA;YACPA,CAACA;QACNA,CAACA;QAEAH,0BAAMA,GAANA,UAAOA,OAAuBA;YAC1BI,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,IAAIA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA;gBACzBA,MAAMA,CAACA;YACXA,EAAEA,CAACA,CAACA,OAAOA,CAACA,IAAIA,KAAKA,SAASA,CAACA;gBAC3BA,OAAOA,CAACA,IAAIA,GAAGA,UAAUA,CAACA,QAAQA,CAACA;YACvCA,MAAMA,CAACA,CAACA,OAAOA,CAACA,IAAIA,CAACA,CAACA,CAACA;gBACnBA,KAAKA,UAAUA,CAACA,WAAWA;oBACvBA,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA,CAACA;wBACfA,IAAIA,CAACA,MAAMA,GAAGA,QAAQA,CAACA,aAAaA,CAACA,QAAQA,CAACA,CAACA;wBAC/CA,EAAEA,CAACA,CAACA,OAAOA,CAACA,OAAOA,IAAIA,SAASA,CAACA;4BA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GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAClCA,IAAIA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACfA,EAAEA,CAACA,CAACA,CAACA,CAACA,CAACA;gBACHA,QAAQA,CAACA;YACbA,EAAEA,CAACA,CAACA,CAACA,CAACA;gBACFA,CAACA,IAAIA,GAAGA,CAACA;YACbA,CAACA,IAAIA,kBAAkBA,CAACA,CAACA,CAACA,CAACA;QAC/BA,CAACA;QACDA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;YACjBA,IAAIA,CAACA,GAAGA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA;YAChBA,EAAEA,CAACA,CAACA,CAACA,IAAIA,SAASA,IAAIA,CAACA,IAAIA,IAAIA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;gBACvCA,QAAQA,CAACA;YACbA,EAAEA,CAACA,CAACA,CAACA,CAACA;gBACFA,CAACA,IAAIA,GAAGA,CAACA;YACbA,CAACA,IAAIA,kBAAkBA,CAACA,CAACA,CAACA,GAAGA,GAAGA,GAAGA,kBAAkBA,CAACA,CAACA,CAACA,CAACA;QAC7DA,CAACA;QACDA,EAAEA,CAACA,CAACA,CAACA,CAACA,CAACA;YACHA,MAAMA,CAACA,CAACA,CAACA;QACbA,MAAMA,CAACA,GAAGA,GAAGA,CAACA,CAACA;IACnBA,CAACA;IAEDL,eAAsBA,CAAaA;QAC/BM,EAAEA,CAACA,CAACA,CAACA,IAAIA,SAASA,CAACA,CAACA,CAACA;YACjBA,SAASA,GAAGA,OAAOA,CAACA;YACpBA,OAAOA,GAAGA,CAACA,CAACA;YACZA,MAAMA,CAACA,QAAQA,CAACA,IAAIA,GAAGA,YAAYA,CAACA,CAACA,CAACA,CAACA;QAC3CA,CAACA;QACD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A,IAAIA;YACVA,KAAKA,EAAOA,EAAEA;SACjBA,CAACA;QACFA,OAAOA,CAACA,KAAKA,CAACA,QAAQA,CAACA,GAAGA,UAAUA,KAAKA;YACrC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAACA;QACFA,IAAIA,GAAGA,CAACA,OAAOA,CAACA,CAACA;IACrBA,CAACA;IATeD,WAAOA,UAStBA,CAAAA;AACLA,CAACA,EAXM,GAAG,KAAH,GAAG,QAWT"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/Utils.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | enum LoaderType { 4 | AsString, 5 | AsScriptTag, 6 | AsCssTag, 7 | AsContent, 8 | } 9 | interface ILoaderOptions { 10 | url: string; 11 | type?: LoaderType, 12 | tagType?: string, 13 | cached?: boolean, 14 | } 15 | function loader(urlOrArgs: string | ILoaderOptions): JQueryPromise { 16 | var options: ILoaderOptions; 17 | if (typeof urlOrArgs === "string") { 18 | options = { 19 | url: urlOrArgs, 20 | }; 21 | } 22 | else { 23 | options = urlOrArgs; 24 | } 25 | 26 | var result = $.Deferred(); 27 | if (!options.url) { 28 | result.reject('No URL'); 29 | return result; 30 | } 31 | if (options.url[0] != '/') 32 | options.url = '/' + options.url; 33 | var useCache = options.cached == undefined ? loader.useCache : options.cached; 34 | var cache = loader.cache[options.url]; 35 | if (!cache) { 36 | cache = new loader.CacheData(options); 37 | loader.cache[options.url] = cache; 38 | } 39 | else if (!useCache) { 40 | cache.reload(false); 41 | } 42 | cache.then(s => { 43 | cache.handle(options); 44 | result.resolve(s); 45 | }); 46 | return result; 47 | } 48 | module loader { 49 | export class CacheData { 50 | constructor(options: ILoaderOptions) { 51 | this.url = options.url; 52 | this.reload(options.cached); 53 | } 54 | private query: JQueryXHR; 55 | private done = false; 56 | private url: string; 57 | private text: string; 58 | private CSS: HTMLStyleElement; 59 | private CONTENT: HTMLDivElement; 60 | private Script: HTMLScriptElement; 61 | private callbacks: ((s: string) => void)[] = []; 62 | 63 | then(doneFilter: (value: string) => void) { 64 | if (this.done) { 65 | if (this.text) { 66 | doneFilter(this.text); 67 | } 68 | } 69 | else { 70 | this.callbacks.push(doneFilter); 71 | } 72 | } 73 | 74 | reload(useCache?: boolean) { 75 | if (useCache === undefined) 76 | useCache = true; 77 | this.done = false 78 | this.text = null; 79 | this.query = $.ajax({ 80 | url: loader.baseURL + this.url, 81 | cache: useCache, 82 | }); 83 | this.query 84 | .then(s => { 85 | this.done = true; 86 | this.text = s; 87 | for (var i = 0; i < this.callbacks.length; i++) { 88 | this.callbacks[i](s); 89 | } 90 | this.callbacks.splice(0, this.callbacks.length); 91 | }) 92 | .fail(err => { 93 | this.done = true; 94 | this.text = null; 95 | this.callbacks.splice(0, this.callbacks.length); 96 | alert('Problem loading ' + this.url + ', ' + JSON.stringify(err)); 97 | }); 98 | ; 99 | } 100 | 101 | handle(options: ILoaderOptions) { 102 | if (!this.done || !this.text) 103 | return; 104 | if (options.type === undefined) 105 | options.type = LoaderType.AsString; 106 | switch (options.type) { 107 | case LoaderType.AsScriptTag: 108 | if (!this.Script) { 109 | this.Script = document.createElement('script'); 110 | if (options.tagType == undefined) 111 | options.tagType = "text/javascript"; 112 | document.appendChild(this.Script); 113 | } 114 | this.Script.type = options.tagType; 115 | this.Script.text = this.text; 116 | break; 117 | case LoaderType.AsCssTag: 118 | if (!this.CSS) { 119 | this.CSS = document.createElement('style'); 120 | if (options.tagType == undefined) 121 | options.tagType = "text/css"; 122 | document.appendChild(this.CSS); 123 | } 124 | this.CSS.type = options.tagType; 125 | this.CSS.style.cssText = this.text; 126 | break; 127 | case LoaderType.AsContent: 128 | if (!this.CONTENT) { 129 | this.CONTENT = document.createElement('div'); 130 | document.appendChild(this.CONTENT); 131 | } 132 | this.CONTENT.innerHTML = this.text; 133 | break; 134 | } 135 | } 136 | } 137 | export var cache: { [key: string]: CacheData } = {}; 138 | export var baseURL: string = ""; 139 | export var useCache: boolean = true; 140 | } 141 | 142 | 143 | // extra utilities 144 | interface Array { 145 | contains(item: T): boolean; 146 | remove(item: T): boolean; 147 | removeWhere(predicate: (item: T) => boolean, max?: number): void; 148 | } 149 | /** check an array contains an item */ 150 | Array.prototype.contains = function (item: T): boolean { 151 | for (var i = this.length; i-- > 0;) { 152 | var ti = this[i]; 153 | if (ti === item) 154 | return true; 155 | } 156 | return false; 157 | } 158 | /** remove one instance of the item and returns whether it was in the array or not */ 159 | Array.prototype.remove = function (item: T): boolean { 160 | for (var i = this.length; i-- > 0;) { 161 | var ti = this[i]; 162 | if (ti === item) { 163 | this.splice(i, 1); 164 | return true; 165 | } 166 | } 167 | return false; 168 | } 169 | /** remove one instance of the item and returns whether it was in the array or not */ 170 | Array.prototype.removeWhere = function (predicate: (item: T) => boolean, max?: number): void { 171 | var rc = 0; 172 | for (var i = this.length; i-- > 0;) { 173 | if (predicate(this[i])) { 174 | this.splice(i, 1); 175 | if (max && max > 0) { 176 | rc++; 177 | if (rc >= max) break; 178 | } 179 | } 180 | } 181 | } 182 | 183 | function guid(): string { 184 | var d = Date.now(); 185 | var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 186 | var r = (d + Math.random() * 16) % 16 | 0; 187 | d = Math.floor(d / 16); 188 | return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); 189 | }); 190 | return uuid; 191 | } 192 | function createHTML(name: string, attributes: any): HTMLElement { 193 | var res = document.createElement(name); 194 | for (var k in attributes) { 195 | res.setAttribute(k, attributes[k]); 196 | } 197 | return res; 198 | } 199 | 200 | // a module which help to do routing / hash navigation, 100 lines for full flexibility and no mystery! :P 201 | module HASH { 202 | export interface ILocation { 203 | p: string[]; 204 | kv: { [key: string]: string; } 205 | } 206 | 207 | var handlers: Array<(previous: ILocation, current: ILocation) => void> = []; 208 | var _previous: ILocation = { p: [], kv: {} }; 209 | var current: ILocation = hashToObject(); 210 | 211 | function handle(e: Event) { 212 | _previous = current; 213 | current = hashToObject(); 214 | for (var i = 0; i < handlers.length; i++) { 215 | var data = handlers[i]; 216 | data(_previous, current); 217 | } 218 | } 219 | window.onhashchange = function (e: Event) { handle(e); }; 220 | 221 | export function on(handler: (previous: ILocation, current: ILocation) => void) { 222 | if (!handler) 223 | return; 224 | handlers.push(handler); 225 | } 226 | export function off(handler: (previous: ILocation, current: ILocation) => void) { 227 | if (!handler) 228 | return; 229 | handlers.remove(handler); 230 | } 231 | 232 | function hashToObject(hash?: string): ILocation { 233 | if (hash == undefined) hash = window.location.hash; 234 | var jo: any = { p: [], kv: {} }; 235 | if (hash == null || hash.substr(0, 1) != "#") 236 | return jo; 237 | var s = hash.substr(1); 238 | var ss = s.split(';'); 239 | for (var i = 0; i < ss.length; i++) { 240 | var sss = ss[i].split(':'); 241 | if (sss.length == 2) jo.kv[decodeURIComponent(sss[0])] = decodeURIComponent(sss[1]); 242 | else jo.p.push(decodeURIComponent(ss[i])); 243 | } 244 | return jo; 245 | } 246 | function objectToHash(o: ILocation): string { 247 | var s = ''; 248 | for (var i = 0; i < o.p.length; i++) { 249 | var p = o.p[i]; 250 | if (!p) 251 | continue; 252 | if (s) 253 | s += ';'; 254 | s += encodeURIComponent(p); 255 | } 256 | for (var k in o.kv) { 257 | var v = o.kv[k]; 258 | if (v == undefined || v == null || v == '') 259 | continue; 260 | if (s) 261 | s += ';'; 262 | s += encodeURIComponent(k) + ':' + encodeURIComponent(v); 263 | } 264 | if (!s) 265 | return s; 266 | return '#' + s; 267 | } 268 | 269 | export function value(o?: ILocation) { 270 | if (o != undefined) { 271 | _previous = current; 272 | current = o; 273 | window.location.hash = objectToHash(o); 274 | } 275 | return hashToObject(); 276 | } 277 | export function set(key: string, value: string): ILocation { 278 | var o = hashToObject(); 279 | o.kv[key] = value; 280 | return HASH.value(o); 281 | } 282 | 283 | function scrollToHash() { 284 | for (var i = 0; i < current.p.length; i++) { 285 | var p = current.p[i]; 286 | if (!p) 287 | continue; 288 | var $e = $('#' + p, document); 289 | if ($e.length > 0) { 290 | $e[0].scrollIntoView(); 291 | break; 292 | } 293 | } 294 | }; 295 | $(document).ready(() => scrollToHash()); 296 | } 297 | 298 | module Vue { 299 | export function watcher(data: any, property, callback: (value) => void) { 300 | var options = { 301 | data: data, 302 | watch: {} 303 | }; 304 | options.watch[property] = function (value) { 305 | callback(value); 306 | }; 307 | new Vue(options); 308 | } 309 | } 310 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/chosen.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Chosen.JQuery 1.4.2 2 | // Project: http://harvesthq.github.com/chosen/ 3 | // Definitions by: Boris Yankov 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | interface ChosenOptions { 8 | allow_single_deselect?: boolean; 9 | disable_search?: boolean; 10 | disable_search_threshold?: number; 11 | enable_split_word_search?: boolean; 12 | inherit_select_classes?: boolean; 13 | max_selected_options?: number; 14 | no_results_text?: string; 15 | placeholder_text_multiple?: string; 16 | placeholder_text_single?: string; 17 | search_contains?: boolean; 18 | single_backstroke_delete?: boolean; 19 | width?: number | string; 20 | display_disabled_options?: boolean; 21 | display_selected_options?: boolean; 22 | include_group_label_in_selected?: boolean; 23 | } 24 | 25 | interface JQuery { 26 | chosen(): JQuery; 27 | chosen(options: ChosenOptions): JQuery; 28 | } -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/GoogleMap.js: -------------------------------------------------------------------------------- 1 | var GoogleMapInitDeferred = $.Deferred(); 2 | function gmapInitialized() { 3 | // Map component, i.e. 'google-map' tag 4 | // include gmap API after this script: 5 | // 6 | GoogleMapInitDeferred.resolve(); 7 | } 8 | Vue.component('google-map', function (resolve, reject) { 9 | GoogleMapInitDeferred.done(function (tpl) { 10 | resolve({ 11 | template: '
', 12 | data: function () { 13 | return { 14 | map: null, 15 | mapMarkers: [], 16 | }; 17 | }, 18 | props: { 19 | id: { 20 | type: String, 21 | required: true, 22 | }, 23 | lat: { 24 | type: Number, 25 | required: false, 26 | }, 27 | lng: { 28 | type: Number, 29 | required: false, 30 | }, 31 | zoom: { 32 | type: Number, 33 | required: false, 34 | }, 35 | width: { 36 | type: String, 37 | required: false, 38 | default: '510pt', 39 | }, 40 | height: { 41 | type: String, 42 | required: false, 43 | default: '340pt', 44 | }, 45 | markers: null, 46 | }, 47 | attached: function () { 48 | var getv = function (x, y) { return x == undefined ? y : x; }; 49 | var mm = this.$el; 50 | mm.style.width = this.width; 51 | mm.style.height = this.height; 52 | var map = new google.maps.Map(this.$el, { 53 | center: new google.maps.LatLng(getv(this.lat, -27.468), getv(this.lng, 153.025)), 54 | zoom: getv(this.zoom, 10), 55 | }); 56 | this.map = map; 57 | }, 58 | watch: { 59 | 'markers': function (newVal, oldVal) { 60 | var prev = this.mapMarkers; 61 | $.each(prev, function (i, x) { return x.setMap(null); }); 62 | if (!newVal) { 63 | this.mapMarkers = []; 64 | return; 65 | } 66 | if (newVal.length === undefined) { 67 | newVal = [newVal]; 68 | } 69 | var map = this.map; 70 | var na = newVal; 71 | this.mapMarkers = na.map(function (value, index, array) { 72 | var m = new google.maps.Marker({ 73 | position: value, 74 | map: map, 75 | title: 'Hello World!' 76 | }); 77 | return m; 78 | }); 79 | }, 80 | } 81 | }); 82 | }); 83 | }); 84 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/GoogleMap.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"GoogleMap.js","sourceRoot":"","sources":["GoogleMap.ts"],"names":["gmapInitialized"],"mappings":"AAAA,IAAI,qBAAqB,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;AACzC;IACIA,uCAAuCA;IACvCA,2CAA2CA;IAC3CA,wGAAwGA;IACxGA,qBAAqBA,CAACA,OAAOA,EAAEA,CAACA;AACpCA,CAACA;AAED,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE,UAAU,OAAO,EAAE,MAAM;IACjD,qBAAqB,CAAC,IAAI,CAAC,UAAA,GAAG;QAC1B,OAAO,CAAC;YACJ,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AI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;oBAChF,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;iBAC5B,CAAC,CAAC;gBACH,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;YACnB,CAAC;YACD,KAAK,EAAE;gBACH,SAAS,EAAE,UAAU,MAAM,EAAE,MAAM;oBAC/B,IAAI,IAAI,GAAyB,IAAI,CAAC,UAAU,CAAC;oBACjD,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAd,CAAc,CAAC,CAAC;oBACvC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBACV,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;wBACrB,MAAM,CAAC;oBACX,CAAC;oBACD,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;wBAC9B,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;oBACtB,CAAC;oBACD,IAAI,GAAG,GAAoB,IAAI,CAAC,GAAG,CAAC;oBACpC,IAAI,EAAE,GAAyB,MAAM,CAAC;oBACtC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,EAAE,KAAK;wBACzC,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;4BAC3B,QAAQ,EAAE,KAAK;4BACf,GAAG,EAAE,GAAG;4BACR,KAAK,EAAE,cAAc;yBACxB,CAAC,CAAC;wBACH,MAAM,CAAC,CAAC,CAAC;oBACb,CAAC,CAAC,CAAC;gBACP,CAAC;aACJ;SACJ,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAA"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/GoogleMap.ts: -------------------------------------------------------------------------------- 1 | var GoogleMapInitDeferred = $.Deferred(); 2 | function gmapInitialized() { 3 | // Map component, i.e. 'google-map' tag 4 | // include gmap API after this script: 5 | // 6 | GoogleMapInitDeferred.resolve(); 7 | } 8 | 9 | Vue.component('google-map', function (resolve, reject) { 10 | GoogleMapInitDeferred.done(tpl => { 11 | resolve({ 12 | template: '
', 13 | data: function () { 14 | return { 15 | map: null, 16 | mapMarkers: [], 17 | }; 18 | }, 19 | props: { 20 | id: { 21 | type: String, 22 | required: true, 23 | }, 24 | lat: { 25 | type: Number, 26 | required: false, 27 | }, 28 | lng: { 29 | type: Number, 30 | required: false, 31 | }, 32 | zoom: { 33 | type: Number, 34 | required: false, 35 | }, 36 | width: { 37 | type: String, 38 | required: false, 39 | default: '510pt', 40 | }, 41 | height: { 42 | type: String, 43 | required: false, 44 | default: '340pt', 45 | }, 46 | markers: null, // google.maps.LatLng | google.maps.LatLng[] 47 | }, 48 | attached: function () { 49 | var getv = (x, y) => x == undefined ? y : x; 50 | var mm: HTMLElement = this.$el; 51 | mm.style.width = this.width; 52 | mm.style.height = this.height; 53 | var map = new google.maps.Map(this.$el, { 54 | center: new google.maps.LatLng(getv(this.lat, -27.468), getv(this.lng, 153.025)), 55 | zoom: getv(this.zoom, 10), 56 | }); 57 | this.map = map; 58 | }, 59 | watch: { 60 | 'markers': function (newVal, oldVal) { 61 | var prev = this.mapMarkers; 62 | $.each(prev, (i, x) => x.setMap(null)); 63 | if (!newVal) { 64 | this.mapMarkers = []; 65 | return; 66 | } 67 | if (newVal.length === undefined) { 68 | newVal = [newVal]; 69 | } 70 | var map = this.map; 71 | var na = newVal; 72 | this.mapMarkers = na.map((value, index, array) => { 73 | var m = new google.maps.Marker({ 74 | position: value, 75 | map: map, 76 | title: 'Hello World!' 77 | }); 78 | return m; 79 | }); 80 | }, 81 | } 82 | }); 83 | }); 84 | }) 85 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Grid.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Grid.js: -------------------------------------------------------------------------------- 1 | //ewew 2 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Grid.ts: -------------------------------------------------------------------------------- 1 | //ewew -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Modal.html: -------------------------------------------------------------------------------- 1 |  27 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Modal.js: -------------------------------------------------------------------------------- 1 | Vue.component('modal', function (resolve, reject) { 2 | loader('ScriptsLocal/components/Modal.html') 3 | .then(function (s) { 4 | resolve({ 5 | template: s, 6 | props: { 7 | show: { 8 | type: Boolean, 9 | required: true, 10 | twoWay: true 11 | } 12 | }, 13 | ready: function () { 14 | var _this = this; 15 | $(this.$el).on('shown.bs.modal', function () { return _this.show = true; }); 16 | $(this.$el).on('hidden.bs.modal', function () { return _this.show = false; }); 17 | this.showModal(this.show); 18 | }, 19 | methods: { 20 | showModal: function (value) { 21 | $(this.$el).modal(value ? 'show' : 'hide'); 22 | }, 23 | }, 24 | watch: { 25 | show: function (val) { 26 | this.showModal(val); 27 | } 28 | }, 29 | }); 30 | }) 31 | .fail(function (x) { return reject(); }); 32 | }); 33 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Modal.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Modal.js","sourceRoot":"","sources":["Modal.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,OAAiC,EAAE,MAAkB;IAClF,MAAM,CAAC,oCAAoC,CAAC;SACvC,IAAI,CAAC,UAAA,CAAC;QACH,OAAO,CAAC;YACJ,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE;gBACH,IAAI,EAAE;oBACF,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,IAAI;iBACf;aACJ;YACD,KAAK,EAAE;gBAAA,iBAIN;gBAHG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,gBAAgB,EAAE,cAAM,OAAA,KAAI,CAAC,IAAI,GAAG,IAAI,EAAhB,CAAgB,CAAC,CAAC;gBACzD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,iBAAiB,EAAE,cAAM,OAAA,KAAI,CAAC,IAAI,GAAG,KAAK,EAAjB,CAAiB,CAAC,CAAC;gBAC3D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;YACD,OAAO,EAAE;gBACL,SAAS,EAAE,UAAU,KAAc;oBAC/B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;gBAC/C,CAAC;aACJ;YACD,KAAK,EAAE;gBACH,IAAI,EAAE,UAAU,GAAG;oBACf,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;gBACxB,CAAC;aACJ;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;SACD,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,MAAM,EAAE,EAAR,CAAQ,CAAC,CACvB;AACL,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/Modal.ts: -------------------------------------------------------------------------------- 1 | Vue.component('modal', function (resolve: (vueOptions:any) => void, reject: () => void) { 2 | loader('ScriptsLocal/components/Modal.html') 3 | .then(s => { 4 | resolve({ 5 | template: s, 6 | props: { 7 | show: { 8 | type: Boolean, 9 | required: true, 10 | twoWay: true 11 | } 12 | }, 13 | ready: function () { 14 | $(this.$el).on('shown.bs.modal', () => this.show = true); 15 | $(this.$el).on('hidden.bs.modal', () => this.show = false); 16 | this.showModal(this.show); 17 | }, 18 | methods: { 19 | showModal: function (value: boolean) { 20 | $(this.$el).modal(value ? 'show' : 'hide'); 21 | }, 22 | }, 23 | watch: { 24 | show: function (val) { 25 | this.showModal(val); 26 | } 27 | }, 28 | }); 29 | }) 30 | .fail(x => reject()) 31 | ; 32 | }); -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/SourceView.js: -------------------------------------------------------------------------------- 1 | Vue.component('source-view', { 2 | template: '

{{ title }}

', 3 | props: { 4 | url: { 5 | type: String, 6 | required: false, 7 | }, 8 | selector: { 9 | type: String, 10 | required: false, 11 | }, 12 | title: { 13 | type: String, 14 | required: true, 15 | }, 16 | text: { 17 | type: String, 18 | required: false, 19 | } 20 | }, 21 | ready: function () { 22 | var _this = this; 23 | if (this.text) 24 | return; 25 | if (this.selector) { 26 | if (htmlSample) { 27 | this.text = htmlSample; 28 | return; 29 | } 30 | var eHtml = $(this.selector); 31 | if (eHtml && eHtml.length) 32 | this.text = eHtml.html(); 33 | } 34 | else if (this.url) { 35 | loader({ url: this.url, cached: false }).then(function (x) { return _this.text = x; }); 36 | } 37 | }, 38 | }); 39 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/SourceView.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"SourceView.js","sourceRoot":"","sources":["SourceView.ts"],"names":[],"mappings":"AACA,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE;IACzB,QAAQ,EAAE,uEAAuE;IACjF,KAAK,EAAE;QACH,GAAG,EAAE;YACD,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;SAClB;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;SAClB;QACD,KAAK,EAAE;YACH,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACjB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,KAAK;SAClB;KACJ;IACD,KAAK,EAAE;QAAA,iBAeN;QAdG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACV,MAAM,CAAC;QACX,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChB,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;gBACb,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;gBACvB,MAAM,CAAC;YACX,CAAC;YACD,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC7B,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC;gBACtB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,IAAI,GAAG,CAAC,EAAb,CAAa,CAAC,CAAC;QACtE,CAAC;IACL,CAAC;CACJ,CAAC,CAAC"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/SourceView.ts: -------------------------------------------------------------------------------- 1 | declare var htmlSample: string; 2 | Vue.component('source-view', { 3 | template: '

{{ title }}

', 4 | props: { 5 | url: { 6 | type: String, 7 | required: false, 8 | }, 9 | selector: { 10 | type: String, 11 | required: false, 12 | }, 13 | title: { 14 | type: String, 15 | required: true, 16 | }, 17 | text: { 18 | type: String, 19 | required: false, 20 | } 21 | }, 22 | ready: function () { 23 | if (this.text) 24 | return; 25 | if (this.selector) { 26 | if (htmlSample) { 27 | this.text = htmlSample; 28 | return; 29 | } 30 | var eHtml = $(this.selector); 31 | if (eHtml && eHtml.length) 32 | this.text = eHtml.html(); 33 | } 34 | else if (this.url) { 35 | loader({ url: this.url, cached: false }).then(x => this.text = x); 36 | } 37 | }, 38 | }); -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/TabControl.js: -------------------------------------------------------------------------------- 1 | Vue.directive('tabcontrol', { 2 | bind: function () { 3 | var el = this.el; 4 | var myAId = el.attributes.getNamedItem('id'); 5 | var myId = myAId ? myAId.value : 'TAB' + guid(); 6 | if (el.children.length > 0) { 7 | var panel = createHTML('div', { role: 'tabpanel', class: 'panel panel-default' }); 8 | var headers = createHTML('ul', { role: 'tablist', class: 'nav nav-tabs' }); 9 | var contents = createHTML('div', { class: 'tab-content panel-body' }); 10 | for (var i = 0; i < el.children.length; i++) { 11 | var item = el.children[i]; 12 | var header, body; 13 | if (item.getAttribute('header')) { 14 | header = item.getAttribute('header'); 15 | body = item.innerHTML; 16 | } 17 | else { 18 | var h = item.children.item(0); 19 | header = h.innerHTML; 20 | var c = item.children.item(1); 21 | body = c.innerHTML; 22 | } 23 | var aid = item.attributes.getNamedItem('id'); 24 | var uid = aid != null ? aid.value : 'tabItem-' + myId + '-' + i; 25 | var isActive = (i == 0); 26 | var attrs = { role: 'presentation' }; 27 | if (isActive) 28 | attrs['class'] = 'active'; 29 | var he = createHTML('li', attrs); 30 | var heLink = createHTML('a', { href: '#' + uid, role: "tab", 'data-toggle': 'tab' }); 31 | heLink.innerHTML = header; 32 | he.appendChild(heLink); 33 | attrs = { role: 'tabpanel', class: 'tab-pane', id: uid }; 34 | if (isActive) 35 | attrs['class'] += ' active'; 36 | var ce = createHTML('li', attrs); 37 | ce.innerHTML = body; 38 | headers.appendChild(he); 39 | contents.appendChild(ce); 40 | } 41 | panel.appendChild(headers); 42 | panel.appendChild(contents); 43 | //el.innerHTML = panel.outerHTML; //this doesn't work with IE!! 44 | while (el.childNodes.length > 0) 45 | el.removeChild(el.childNodes[0]); 46 | el.appendChild(panel); 47 | } 48 | // synchronize current Tab with the HASH 49 | var activate = function (previous, current) { 50 | var tab = current.kv[myId]; 51 | if (tab) 52 | $('a[href="#' + tab + '"]', el).tab('show'); 53 | }; 54 | HASH.on(activate); 55 | $(document).ready(function () { activate(null, HASH.value()); }); 56 | $('a[data-toggle="tab"]', el).on('shown.bs.tab', function (e) { 57 | HASH.set(myId, e.target.attributes.getNamedItem('href').value.substr(1)); 58 | }); 59 | } 60 | }); 61 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/TabControl.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"TabControl.js","sourceRoot":"","sources":["TabControl.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE;IACxB,IAAI,EAAE;QACF,IAAI,EAAE,GAAgB,IAAI,CAAC,EAAE,CAAC;QAC9B,IAAI,KAAK,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC;QAChD,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YAEzB,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,qBAAqB,EAAE,CAAC,CAAC;YACjF,IAAI,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC;YAC3E,IAAI,QAAQ,GAAG,UAAU,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;YAEtE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1C,IAAI,IAAI,GAA2C,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAClE,IAAI,MAAc,EAAE,IAAY,CAAC;gBACjC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAA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AC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/TabControl.ts: -------------------------------------------------------------------------------- 1 | Vue.directive('tabcontrol', { 2 | bind: function () { 3 | var el: HTMLElement = this.el; 4 | var myAId = el.attributes.getNamedItem('id'); 5 | var myId = myAId ? myAId.value : 'TAB' + guid(); 6 | if (el.children.length > 0) { 7 | 8 | var panel = createHTML('div', { role: 'tabpanel', class:'panel panel-default' }); 9 | var headers = createHTML('ul', { role: 'tablist', class: 'nav nav-tabs' }); 10 | var contents = createHTML('div', { class: 'tab-content panel-body' }); 11 | 12 | for (var i = 0; i < el.children.length; i++) { 13 | var item: HTMLUnknownElement = el.children[i]; 14 | var header: string, body: string; 15 | if (item.getAttribute('header')) { 16 | header = item.getAttribute('header'); 17 | body = item.innerHTML; 18 | } 19 | else { 20 | var h: HTMLUnknownElement = item.children.item(0); 21 | header = h.innerHTML; 22 | var c: HTMLUnknownElement = item.children.item(1); 23 | body = c.innerHTML; 24 | } 25 | 26 | var aid = item.attributes.getNamedItem('id'); 27 | var uid = aid != null ? aid.value : 'tabItem-' + myId + '-' + i; 28 | var isActive = (i == 0); 29 | 30 | var attrs: any = { role: 'presentation' }; 31 | if (isActive) attrs['class'] = 'active'; 32 | var he = createHTML('li', attrs); 33 | var heLink = createHTML('a', { href: '#' + uid, role: "tab", 'data-toggle': 'tab' }); 34 | heLink.innerHTML = header; 35 | he.appendChild(heLink); 36 | 37 | attrs = { role: 'tabpanel', class: 'tab-pane', id: uid }; 38 | if (isActive) attrs['class'] += ' active'; 39 | var ce = createHTML('li', attrs); 40 | ce.innerHTML = body; 41 | 42 | headers.appendChild(he); 43 | contents.appendChild(ce); 44 | } 45 | 46 | panel.appendChild(headers); 47 | panel.appendChild(contents); 48 | //el.innerHTML = panel.outerHTML; //this doesn't work with IE!! 49 | while (el.childNodes.length > 0) 50 | el.removeChild(el.childNodes[0]); 51 | el.appendChild(panel); 52 | } 53 | 54 | // synchronize current Tab with the HASH 55 | var activate = (previous: HASH.ILocation, current: HASH.ILocation) => { 56 | var tab = current.kv[myId]; 57 | if (tab) 58 | $('a[href="#' + tab + '"]', el).tab('show'); 59 | }; 60 | HASH.on(activate); 61 | $(document).ready(() => { activate(null, HASH.value()); }); 62 | $('a[data-toggle="tab"]', el).on('shown.bs.tab', function (e) { 63 | HASH.set(myId, e.target.attributes.getNamedItem('href').value.substr(1)); 64 | }) 65 | } 66 | }) 67 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/VueChosen.js: -------------------------------------------------------------------------------- 1 | Vue.component('chosen', { 2 | template: '', 6 | data: function () { 7 | return { 8 | changing: false, 9 | }; 10 | }, 11 | directives: { 12 | jData: function (value) { 13 | var el = this.el; 14 | $(el).data('chosen', value); 15 | }, 16 | }, 17 | props: { 18 | options: null, 19 | 'v-model': { twoWay: true, default: null }, 20 | 'selected-options': { twoWay: true, default: [], type: Array }, 21 | chosen: null, 22 | 'text-key': null, 23 | placeholder: null, 24 | multiple: { type: Boolean, required: false, } 25 | }, 26 | filters: { 27 | toOptionData: function (val) { 28 | if (!val) 29 | return val; 30 | var key = this.textKey; 31 | if (!(val instanceof Array)) 32 | return val; 33 | return val.map(function (x) { 34 | if (key) 35 | return { text: x[key], value: x }; 36 | else 37 | return { text: (x ? x : '').toString(), value: x }; 38 | }); 39 | }, 40 | }, 41 | methods: { 42 | select: function (objs) { 43 | if (!objs) 44 | objs = []; 45 | this.changing = true; 46 | try { 47 | $(this.$el).find('option').each(function (i, e) { 48 | var data = $(e).data('chosen'); 49 | if (!data) 50 | return; 51 | if (objs.contains(data.value)) 52 | $(e).attr('selected', 'selected'); 53 | else 54 | $(e).removeAttr('selected'); 55 | }); 56 | $(this.$el).trigger("chosen:updated"); 57 | } 58 | finally { 59 | this.changing = false; 60 | } 61 | } 62 | }, 63 | ready: function () { 64 | var _this = this; 65 | // initialize 66 | var coptions = $.extend({}, { width: '10em' }, this.chosen); 67 | $(this.$el).chosen(coptions); 68 | // initialize selection 69 | if (this.vModel) 70 | this.select([this.vModel]); 71 | else 72 | this.select(this.selectedOptions); 73 | // track changes 74 | $(this.$el).on('change', function () { 75 | if (_this.changing) 76 | return; 77 | _this.changing = true; 78 | try { 79 | var target = _this.selectedOptions; 80 | if (!target) { 81 | target = []; 82 | _this.selectedOptions = target; 83 | } 84 | target.splice(0, target.length); 85 | $(_this.$el).find(':selected').each(function (i, e) { 86 | var data = $(e).data('chosen'); 87 | if (data) 88 | target.push(data.value); 89 | }); 90 | _this.vModel = target.length > 0 ? target[0] : null; 91 | } 92 | finally { 93 | _this.changing = false; 94 | } 95 | }); 96 | }, 97 | watch: { 98 | 'vModel': function (value) { 99 | if (this.changing) 100 | return; 101 | if (value) 102 | this.select([value]); 103 | else 104 | this.select([]); 105 | }, 106 | 'selectedOptions': function (value) { 107 | if (this.changing) 108 | return; 109 | if (value) 110 | this.select(value); 111 | else 112 | this.select([]); 113 | }, 114 | }, 115 | }); 116 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/VueChosen.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"VueChosen.js","sourceRoot":"","sources":["VueChosen.ts"],"names":["select"],"mappings":"AAAA,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE;IACpB,QAAQ,EAAE,iGAAiG;QAC3G,uCAAuC;QACvC,wFAAwF;QACxF,YAAY;IAEZ,IAAI,EAAE;QACF,MAAM,CAAC;YACH,QAAQ,EAAE,KAAK;SAClB,CAAC;IACN,CAAC;IACD,UAAU,EAAE;QACR,KAAK,EAAE,UAAU,KAAK;YAClB,IAAI,EAAE,GAAgB,IAAI,CAAC,EAAE,CAAC;YAC9B,CAAC,CAAC,EAAE,CAAC,CAAC,IA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AC,CAAC,CAAC;YAChC,IAAI;gBAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;QACD,iBAAiB,EAAE,UAAU,KAAY;YACrC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACd,MAAM,CAAC;YACX,EAAE,CAAC,CAAC,KAAK,CAAC;gBAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,IAAI;gBAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;KACJ;CACJ,CAAC,CAAC"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/VueChosen.ts: -------------------------------------------------------------------------------- 1 | Vue.component('chosen', { 2 | template: '' 6 | , 7 | data: function () { 8 | return { 9 | changing: false, 10 | }; 11 | }, 12 | directives: { 13 | jData: function (value) { 14 | var el: HTMLElement = this.el; 15 | $(el).data('chosen', value); 16 | }, 17 | }, 18 | props: { 19 | options: null, // select data 20 | 'v-model': { twoWay: true, default: null }, // bind to single selection 21 | 'selected-options': { twoWay: true, default: [], type: Array }, // bind to multi-selection 22 | chosen: null, // chosen option 23 | 'text-key': null, // item[text] will be displayed as text, or obj.toString() if text is undefined 24 | placeholder: null, // optional placeholder string 25 | multiple: { type: Boolean, required: false, } 26 | }, 27 | filters: { 28 | toOptionData: function (val) { 29 | if (!val) 30 | return val; 31 | var key = this.textKey; 32 | if (!(val instanceof Array)) //??? 33 | return val; 34 | return val.map(x => { 35 | if (key) return { text: x[key], value: x }; 36 | else return { text: (x ? x : '').toString(), value: x }; 37 | }); 38 | }, 39 | }, 40 | methods: { 41 | select(objs: any[]) { 42 | if (!objs) objs = []; 43 | this.changing = true; 44 | try { 45 | $(this.$el).find('option').each((i, e) => { 46 | var data = $(e).data('chosen'); 47 | if (!data) 48 | return; 49 | if (objs.contains(data.value)) $(e).attr('selected', 'selected'); 50 | else $(e).removeAttr('selected'); 51 | }); 52 | $(this.$el).trigger("chosen:updated"); 53 | } 54 | finally { 55 | this.changing = false; 56 | } 57 | } 58 | }, 59 | ready: function () { 60 | // initialize 61 | var coptions = $.extend({}, { width: '10em' }, this.chosen); 62 | $(this.$el).chosen(coptions); 63 | // initialize selection 64 | if (this.vModel) this.select([this.vModel]); 65 | else this.select(this.selectedOptions); 66 | // track changes 67 | $(this.$el).on('change', () => { 68 | if (this.changing) 69 | return; 70 | this.changing = true; 71 | try { 72 | var target: any[] = this.selectedOptions; 73 | if (!target) { 74 | target = []; 75 | this.selectedOptions = target; 76 | } 77 | target.splice(0, target.length); 78 | $(this.$el).find(':selected').each((i, e) => { 79 | var data = $(e).data('chosen'); 80 | if (data) 81 | target.push(data.value) 82 | }); 83 | this.vModel = target.length > 0 ? target[0] : null; 84 | } 85 | finally { 86 | this.changing = false; 87 | } 88 | }); 89 | }, 90 | watch: { 91 | 'vModel': function (value) { 92 | if (this.changing) 93 | return; 94 | if (value) this.select([value]); 95 | else this.select([]); 96 | }, 97 | 'selectedOptions': function (value: any[]) { 98 | if (this.changing) 99 | return; 100 | if (value) this.select(value); 101 | else this.select([]); 102 | }, 103 | }, 104 | }); 105 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/directives.js: -------------------------------------------------------------------------------- 1 | Vue.directive('enable', { 2 | bind: function () { 3 | }, 4 | update: function (newValue, oldValue) { 5 | var el = this.el; 6 | if (newValue) { 7 | el.removeAttribute("disabled"); 8 | } 9 | else { 10 | el.disabled = true; 11 | } 12 | }, 13 | unbind: function () { 14 | } 15 | }); 16 | Vue.directive('disable', { 17 | bind: function () { 18 | }, 19 | update: function (newValue, oldValue) { 20 | var el = this.el; 21 | if (newValue) { 22 | el.disabled = true; 23 | } 24 | else { 25 | el.removeAttribute("disabled"); 26 | } 27 | }, 28 | unbind: function () { 29 | } 30 | }); 31 | // async load of pic! use the 'v-img' for src tag 32 | // thanks: http://codepen.io/pespantelis/pen/RWVZxL 33 | Vue.directive('img', function (url) { 34 | var img = new Image(); 35 | img.src = url; 36 | this.el.src = 'http://www.arabianbusiness.com/skins/ab.main/gfx/loading_spinner.gif'; 37 | img.onload = function () { 38 | this.el.src = url; 39 | $(this.el) 40 | .css('opacity', 0) 41 | .animate({ opacity: 1 }, 1000); 42 | }.bind(this); 43 | }); 44 | -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/directives.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"directives.js","sourceRoot":"","sources":["directives.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE;IACpB,IAAI,EAAE;IACN,CAAC;IACD,MAAM,EAAE,UAAU,QAAQ,EAAE,QAAQ;QAChC,IAAI,EAAE,GAAgB,IAAI,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,CAAC;YACI,EAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC9B,CAAC;IACL,CAAC;IACD,MAAM,EAAE;IACR,CAAC;CACJ,CAAC,CAAA;AACF,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE;IACrB,IAAI,EAAE;IACN,CAAC;IACD,MAAM,EAAE,UAAU,QAAQ,EAAE,QAAQ;QAChC,IAAI,EAAE,GAAgB,IAAI,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACL,EAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,CAAC;YACF,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;IACL,CAAC;IACD,MAAM,EAAE;IACR,CAAC;CACJ,CAAC,CAAA;AAEF,iDAAiD;AACjD,mDAAmD;AACnD,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG;IAC9B,IAAI,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;IACtB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,sEAAsE,CAAC;IAErF,GAAG,CAAC,MAAM,GAAG;QACT,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;QAClB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;aACL,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;aACjB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /TestApp/ScriptsLocal/components/directives.ts: -------------------------------------------------------------------------------- 1 | Vue.directive('enable', { 2 | bind: function () { 3 | }, 4 | update: function (newValue, oldValue) { 5 | var el: HTMLElement = this.el; 6 | if (newValue) { 7 | el.removeAttribute("disabled"); 8 | } 9 | else { 10 | (el).disabled = true; 11 | } 12 | }, 13 | unbind: function () { 14 | } 15 | }) 16 | Vue.directive('disable', { 17 | bind: function () { 18 | }, 19 | update: function (newValue, oldValue) { 20 | var el: HTMLElement = this.el; 21 | if (newValue) { 22 | (el).disabled = true; 23 | } 24 | else { 25 | el.removeAttribute("disabled"); 26 | } 27 | }, 28 | unbind: function () { 29 | } 30 | }) 31 | 32 | // async load of pic! use the 'v-img' for src tag 33 | // thanks: http://codepen.io/pespantelis/pen/RWVZxL 34 | Vue.directive('img', function (url) { 35 | var img = new Image(); 36 | img.src = url; 37 | this.el.src = 'http://www.arabianbusiness.com/skins/ab.main/gfx/loading_spinner.gif'; 38 | 39 | img.onload = function () { 40 | this.el.src = url; 41 | $(this.el) 42 | .css('opacity', 0) 43 | .animate({ opacity: 1 }, 1000) 44 | }.bind(this); 45 | }); 46 | -------------------------------------------------------------------------------- /TestApp/TestApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Debug 9 | AnyCPU 10 | 11 | 12 | 2.0 13 | {16DDA46F-318E-475F-A5DF-F6AD0099BB4D} 14 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 15 | Library 16 | Properties 17 | TestApp 18 | TestApp 19 | v4.5.2 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 1.6 29 | 30 | 31 | true 32 | full 33 | false 34 | bin\ 35 | DEBUG;TRACE 36 | prompt 37 | 4 38 | 39 | 40 | pdbonly 41 | true 42 | bin\ 43 | TRACE 44 | prompt 45 | 4 46 | 47 | 48 | 49 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 50 | True 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll 74 | 75 | 76 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 77 | 78 | 79 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll 80 | 81 | 82 | ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll 83 | 84 | 85 | 86 | 87 | samples.less 88 | 89 | 90 | samples.css 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Global.asax 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | compilerconfig.json 124 | 125 | 126 | 127 | Web.config 128 | 129 | 130 | Web.config 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 10.0 171 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | True 182 | True 183 | 1916 184 | / 185 | http://localhost:1916/ 186 | False 187 | False 188 | 189 | 190 | False 191 | 192 | 193 | 194 | 195 | 196 | 197 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 198 | 199 | 200 | 201 | 202 | 209 | -------------------------------------------------------------------------------- /TestApp/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /TestApp/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /TestApp/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /TestApp/WebUtils/BrowserJsonFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.Http.Formatting; 5 | using System.Net.Http.Headers; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace TestApp.WebUtils 10 | { 11 | public class BrowserJsonFormatter : JsonMediaTypeFormatter 12 | { 13 | public BrowserJsonFormatter() 14 | { 15 | this.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html")); 16 | //this.SupportedMediaTypes.Add(new MediaTypeHeaderValue("*/*")); 17 | #if DEBUG 18 | this.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented; 19 | #endif 20 | // no need for that 21 | //this.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects; 22 | } 23 | 24 | public override void SetDefaultContentHeaders(Type type, HttpContentHeaders headers, MediaTypeHeaderValue mediaType) 25 | { 26 | base.SetDefaultContentHeaders(type, headers, mediaType); 27 | headers.ContentType = new MediaTypeHeaderValue("application/json"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /TestApp/compilerconfig.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "outputFile": "Content/samples.css", 4 | "inputFile": "Content/samples.less" 5 | } 6 | ] -------------------------------------------------------------------------------- /TestApp/compilerconfig.json.defaults: -------------------------------------------------------------------------------- 1 | { 2 | "compilers": { 3 | "less": { 4 | "autoPrefix": "", 5 | "ieCompat": true, 6 | "strictMath": false, 7 | "strictUnits": false, 8 | "relativeUrls": true, 9 | "rootPath": "" 10 | }, 11 | "sass": { 12 | "indentType": "space", 13 | "indentWidth": 2, 14 | "outputStyle": "nested", 15 | "Precision": 5, 16 | "relativeUrls": true 17 | }, 18 | "coffeescript": { 19 | "bare": false, 20 | "runtimeMode": "node" 21 | } 22 | }, 23 | "minifiers": { 24 | "css": { 25 | "enabled": true, 26 | "termSemicolons": true, 27 | "gzip": false 28 | }, 29 | "javascript": { 30 | "enabled": true, 31 | "termSemicolons": true, 32 | "gzip": false 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /TestApp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /VueTests.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5CD0DB28-642D-4C5D-97D0-9BB0E46CB832}" 7 | ProjectSection(SolutionItems) = preProject 8 | README.txt = README.txt 9 | EndProjectSection 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{16DDA46F-318E-475F-A5DF-F6AD0099BB4D}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {16DDA46F-318E-475F-A5DF-F6AD0099BB4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {16DDA46F-318E-475F-A5DF-F6AD0099BB4D}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {16DDA46F-318E-475F-A5DF-F6AD0099BB4D}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {16DDA46F-318E-475F-A5DF-F6AD0099BB4D}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | --------------------------------------------------------------------------------