* cldr.js:
* Web.config: * ListItem.cs: * styles.json: * globalize.js: * event.js: * Auth.aspx: * Book.aspx: * Login.aspx: * jquery-2.1.4.js: * map-load.gif: * Book.aspx: * Circle.cs: * Auth.aspx: * mapstyle.css: * date.js: * Login.aspx: * mdd_help.htm: * BlogHelper.cs: * fit-bounds.png: * unresolved.js: * jquery-2.1.4.min.js: * mapstyle-ie.css: * FreeDate.cs: * BookEdit.cs: * number.js: * BlogManager.cs: * plural.js: * jquery-2.1.4.min.map: * jquery.googlemaps.js: * supplemental.js: * BlogProvider.cs: * mapstyle.min.css: * pin-pink.png: * message.js: * ChooseADate.aspx: * pin-azure.png: * currency.js: * jquery-2.1.4-vsdoc.js: * pin-green.png: * MarkdownDeepLib.min.js: * flag-azure.png: * flag-green.png: * needle-pink.png: * ChooseADate.aspx: * niddle-green.png: * ChooseCalendar.aspx: * current-location.png: * jquery.googlemaps.min.js: * ErrorMessage.aspx: * ChooseCalendar.aspx: * relative-time.js: * GoogleErrorMessage.aspx: * popup-template-marker.html: * popup-template-circle.html: * popup-template-polygon.html: * popup-template-polyline.html: * popup-template-rectangle.html: * Web.csproj: * YavscModel.csproj: * YavscClient.csproj: * fortune.csproj: * WebControls.csproj: * SalesCatalog.csproj: * ITContentProvider.csproj: * NpgsqlMRPProviders.csproj: * NpgsqlBlogProvider.csproj: * NpgsqlContentProvider.csproj: Moves to Mono framework * NpgsqlCircleProvider.cs: Makes Circles private, or not * OAuth2.cs: * CircleController.cs: * AccountController.cs: * NpgsqlContentProvider.cs: Impacts htmldoc * NpgsqlMembershipProvider.cs: Makes possible to change the UserName * NpgsqlRoleProvider.cs: Drops this SQL code, which is actually maintained in Web/instdbws.sql * PeopleApi.cs: * GoogleController.cs: * PaypalController.cs: Refactoring * Global.asax.cs: Dropped an useless url mapping * MarkdownHelper.cs: Package update * App.master: * NoLogin.master: Site's favicon update * Circles.aspx: TO BE FIXED :-D * UserPost.aspx: Comment only when logged in * instdbws.sql: Circle public * packages.config: package update
@ -1,3 +1,7 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* ITContentProvider.csproj: Moves to Mono framework
|
||||
|
||||
2015-06-10 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* ITContentProvider.csproj:
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>ITContentProvider</RootNamespace>
|
||||
<AssemblyName>ITContentProvider</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlBlogProvider.csproj: Moves to Mono framework
|
||||
|
||||
2015-07-02 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlBlogProvider.cs:
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Npgsql.Web.Blog</RootNamespace>
|
||||
<AssemblyName>NpgsqlBlogProvider</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -1,3 +1,11 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlCircleProvider.cs: Makes Circles private, or not
|
||||
|
||||
* NpgsqlContentProvider.cs: Impacts htmldoc
|
||||
|
||||
* NpgsqlContentProvider.csproj: Moves to Mono framework
|
||||
|
||||
2015-07-02 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlCircleProvider.cs:
|
||||
|
@ -19,15 +19,15 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
using Yavsc.Model.Circles;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using Npgsql;
|
||||
using NpgsqlTypes;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Security;
|
||||
using System.Web.Mvc;
|
||||
using Yavsc.Model;
|
||||
using Yavsc.Model.Circles;
|
||||
|
||||
namespace WorkFlowProvider
|
||||
{
|
||||
@ -117,7 +117,7 @@ namespace WorkFlowProvider
|
||||
using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) {
|
||||
cnx.Open ();
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText = "select title, owner from circle where _id = :cid";
|
||||
cmd.CommandText = "select title, owner, public from circle where _id = :cid";
|
||||
cmd.Parameters.AddWithValue ("cid", id);
|
||||
using (NpgsqlDataReader dr = cmd.ExecuteReader ()) {
|
||||
if (dr.Read ()) {
|
||||
@ -127,6 +127,8 @@ namespace WorkFlowProvider
|
||||
dr.GetOrdinal ("title"));
|
||||
circ.Owner = dr.GetString (
|
||||
dr.GetOrdinal ("owner"));
|
||||
circ.IsPrivate = !dr.GetBoolean(dr.GetOrdinal("public"));
|
||||
|
||||
}
|
||||
dr.Close ();
|
||||
}
|
||||
@ -164,7 +166,7 @@ namespace WorkFlowProvider
|
||||
using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) {
|
||||
cnx.Open ();
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText = "insert into circle (owner,title,applicationname) values (:wnr,:tit,:app) returning _id";
|
||||
cmd.CommandText = "insert into circle (owner,title,applicationname,public) values (:wnr,:tit,:app,FALSE) returning _id";
|
||||
cmd.Parameters.AddWithValue ("wnr", owner);
|
||||
cmd.Parameters.AddWithValue ("tit", title);
|
||||
cmd.Parameters.AddWithValue ("app", applicationName);
|
||||
@ -209,7 +211,7 @@ namespace WorkFlowProvider
|
||||
/// <param name="user">User.</param>
|
||||
public override IEnumerable<ListItem> List (string user)
|
||||
{
|
||||
List<ListItem> cc = null;
|
||||
List<ListItem> cc = new List<ListItem> ();
|
||||
using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString))
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText = "select _id, title from circle where owner = :wnr";
|
||||
@ -218,7 +220,7 @@ namespace WorkFlowProvider
|
||||
cmd.Prepare ();
|
||||
using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) {
|
||||
if (rdr.HasRows) {
|
||||
cc = new List<ListItem> ();
|
||||
|
||||
while (rdr.Read ()) {
|
||||
string title = null;
|
||||
int ottl = rdr.GetOrdinal ("title");
|
||||
|
@ -154,14 +154,14 @@ namespace Yavsc
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases all resource used by the <see cref="WorkFlowProvider.NpgsqlContentProvider"/> object.
|
||||
/// Releases all resource used by the <see cref="Yavsc.NpgsqlContentProvider"/> object.
|
||||
/// </summary>
|
||||
/// <remarks>Call <see cref="Dispose"/> when you are finished using the <see cref="WorkFlowProvider.NpgsqlContentProvider"/>.
|
||||
/// The <see cref="Dispose"/> method leaves the <see cref="WorkFlowProvider.NpgsqlContentProvider"/> in an unusable
|
||||
/// state. After calling <see cref="Dispose"/>, you must release all references to the
|
||||
/// <see cref="WorkFlowProvider.NpgsqlContentProvider"/> so the garbage collector can reclaim the memory that the
|
||||
/// <see cref="WorkFlowProvider.NpgsqlContentProvider"/> was occupying.</remarks>
|
||||
/// <remarks>Call <see cref="Dispose"/> when you are finished using the <see cref="Yavsc.NpgsqlContentProvider"/>. The
|
||||
/// <see cref="Dispose"/> method leaves the <see cref="Yavsc.NpgsqlContentProvider"/> in an unusable state. After
|
||||
/// calling <see cref="Dispose"/>, you must release all references to the <see cref="Yavsc.NpgsqlContentProvider"/> so
|
||||
/// the garbage collector can reclaim the memory that the <see cref="Yavsc.NpgsqlContentProvider"/> was occupying.</remarks>
|
||||
public void Dispose ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
@ -197,8 +197,9 @@ namespace Yavsc
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="WorkFlowProvider.NpgsqlContentProvider"/> is active.
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.NpgsqlContentProvider"/> is active.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if active; otherwise, <c>false</c>.</value>
|
||||
public bool Active {
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>WorkFlowProvider</RootNamespace>
|
||||
<AssemblyName>NpgsqlContentProvider</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -1,3 +1,13 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlMRPProviders.csproj: Moves to Mono framework
|
||||
|
||||
* NpgsqlMembershipProvider.cs: Makes possible to change the
|
||||
UserName
|
||||
|
||||
* NpgsqlRoleProvider.cs: Drops this SQL code, which is
|
||||
actually maintained in Web/instdbws.sql
|
||||
|
||||
2015-06-18 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlMembershipProvider.cs: should fix a bug at resetting
|
||||
|
@ -1,32 +0,0 @@
|
||||
//
|
||||
// CircleProvider.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
|
||||
namespace Npgsql.Web
|
||||
{
|
||||
public class NpgsqlCircleProvider
|
||||
{
|
||||
public NpgsqlCircleProvider ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Npgsql.Web</RootNamespace>
|
||||
<AssemblyName>NpgsqlMRPProviders</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -36,7 +36,6 @@
|
||||
<Compile Include="NpgsqlRoleProvider.cs" />
|
||||
<Compile Include="NpgsqlProfileProvider.cs" />
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="NpgsqlCircleProvider.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
@ -71,4 +70,10 @@
|
||||
<None Include="Sql\StockSymbols.sql" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\yavscModel\YavscModel.csproj">
|
||||
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
|
||||
<Name>YavscModel</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -931,15 +931,16 @@ namespace Npgsql.Web
|
||||
public override void UpdateUser (MembershipUser user)
|
||||
{
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection (connectionString)) {
|
||||
using (NpgsqlCommand cmd = new NpgsqlCommand ("UPDATE Users " +
|
||||
" SET Email = @Email, Comment = @Comment," +
|
||||
" IsApproved = @IsApproved" +
|
||||
" WHERE Username = @Username AND ApplicationName = @ApplicationName", conn)) {
|
||||
cmd.Parameters.AddWithValue ("@Email", NpgsqlDbType.Varchar, 128).Value = user.Email;
|
||||
cmd.Parameters.AddWithValue ("@Comment", NpgsqlDbType.Varchar, 255).Value = user.Comment;
|
||||
cmd.Parameters.AddWithValue ("@IsApproved", NpgsqlDbType.Bit).Value = user.IsApproved;
|
||||
cmd.Parameters.AddWithValue ("@Username", NpgsqlDbType.Varchar, 255).Value = user.UserName;
|
||||
cmd.Parameters.AddWithValue ("@ApplicationName", NpgsqlDbType.Varchar, 255).Value = pApplicationName;
|
||||
using (NpgsqlCommand cmd = new NpgsqlCommand ("UPDATE users " +
|
||||
" SET :username = :username, email = :email, comment = :comment," +
|
||||
" isapproved = :isapproved" +
|
||||
" WHERE pkid = :pkid and applicationname = :appname", conn)) {
|
||||
cmd.Parameters.AddWithValue ("email", user.Email);
|
||||
cmd.Parameters.AddWithValue ("comment", user.Comment);
|
||||
cmd.Parameters.AddWithValue ("isapproved", user.IsApproved);
|
||||
cmd.Parameters.AddWithValue ("username", user.UserName);
|
||||
cmd.Parameters.AddWithValue ("pkid", user.ProviderUserKey);
|
||||
cmd.Parameters.AddWithValue ("appname", pApplicationName);
|
||||
conn.Open ();
|
||||
cmd.ExecuteNonQuery ();
|
||||
conn.Close ();
|
||||
|
@ -5,37 +5,7 @@ using System.Configuration;
|
||||
using Npgsql;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/*
|
||||
*
|
||||
CREATE TABLE roles
|
||||
(
|
||||
rolename character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
comment character varying(255) NOT NULL,
|
||||
CONSTRAINT roles_pkey PRIMARY KEY (rolename , applicationname )
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE usersroles
|
||||
(
|
||||
applicationname character varying(255) NOT NULL,
|
||||
rolename character varying(255) NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
CONSTRAINT attrroles_pkey PRIMARY KEY (applicationname , rolename , username ),
|
||||
CONSTRAINT usersroles_fk_role FOREIGN KEY (applicationname, rolename)
|
||||
REFERENCES roles (applicationname, rolename) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT usersroles_fk_user FOREIGN KEY (applicationname, username)
|
||||
REFERENCES users (applicationname, username) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
*/
|
||||
using System.Linq;
|
||||
|
||||
|
||||
|
4
SalesCatalog/ChangeLog
Normal file
@ -0,0 +1,4 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* SalesCatalog.csproj: Moves to Mono framework
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>SalesCatalog</RootNamespace>
|
||||
<AssemblyName>SalesCatalog</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* WebControls.csproj: Moves to Mono framework
|
||||
|
||||
2015-07-02 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* UserCard.cs:
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>WebControls</RootNamespace>
|
||||
<AssemblyName>Yavsc.WebControls</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
4
plugins/fortune/ChangeLog
Normal file
@ -0,0 +1,4 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* fortune.csproj: Moves to Mono framework
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>fortune</RootNamespace>
|
||||
<AssemblyName>fortune</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -29,6 +29,9 @@ using System.Collections.Specialized;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Account controller.
|
||||
/// </summary>
|
||||
public class AccountController : ApiController
|
||||
{
|
||||
|
||||
|
@ -29,9 +29,25 @@ using Yavsc.Model;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
/// <summary>
|
||||
/// New circle.
|
||||
/// </summary>
|
||||
public class NewCircle {
|
||||
/// <summary>
|
||||
/// Gets or sets the title.
|
||||
/// </summary>
|
||||
/// <value>The title.</value>
|
||||
public string title { get ; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the users.
|
||||
/// </summary>
|
||||
/// <value>The users.</value>
|
||||
public string [] users { get ; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Yavsc.ApiControllers.NewCircle"/> is private.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if is private; otherwise, <c>false</c>.</value>
|
||||
public bool isPrivate { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -39,11 +55,11 @@ namespace Yavsc.ApiControllers
|
||||
/// </summary>
|
||||
public class CircleController : ApiController
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Creates the specified circle using the given title and user list.
|
||||
/// Create the specified circle.
|
||||
/// </summary>
|
||||
/// <param name="title">Identifier.</param>
|
||||
/// <param name="users">Users.</param>
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
public long Create(NewCircle model)
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace Yavsc.ApiControllers
|
||||
/// <summary>
|
||||
/// Paypal API controller.
|
||||
/// </summary>
|
||||
public class PaypalApiController: ApiController
|
||||
public class PaypalController: ApiController
|
||||
{
|
||||
PayPalAPIInterfaceServiceService service = null;
|
||||
/// <summary>
|
||||
@ -60,7 +60,10 @@ namespace Yavsc.ApiControllers
|
||||
BMCreateButtonResponseType btcrere = service.BMCreateButton (btcrerq);
|
||||
return btcrere;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search the specified str.
|
||||
/// </summary>
|
||||
/// <param name="str">String.</param>
|
||||
public BMButtonSearchResponseType Search(string str)
|
||||
{
|
||||
BMButtonSearchReq req = new BMButtonSearchReq ();
|
@ -1,3 +1,82 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* cldr.js:
|
||||
* Web.config:
|
||||
* styles.json:
|
||||
* globalize.js:
|
||||
* event.js:
|
||||
* Auth.aspx:
|
||||
* Book.aspx:
|
||||
* jquery-2.1.4.js:
|
||||
* Login.aspx:
|
||||
* map-load.gif:
|
||||
* Book.aspx:
|
||||
* Auth.aspx:
|
||||
* mapstyle.css:
|
||||
* mdd_help.htm:
|
||||
* date.js:
|
||||
* Login.aspx:
|
||||
* unresolved.js:
|
||||
* fit-bounds.png:
|
||||
* plural.js:
|
||||
* number.js:
|
||||
* mapstyle-ie.css:
|
||||
* jquery-2.1.4.min.js:
|
||||
* supplemental.js:
|
||||
* jquery-2.1.4.min.map:
|
||||
* jquery.googlemaps.js:
|
||||
* pin-pink.png:
|
||||
* message.js:
|
||||
* mapstyle.min.css:
|
||||
* jquery-2.1.4-vsdoc.js:
|
||||
* ChooseADate.aspx:
|
||||
* pin-green.png:
|
||||
* pin-azure.png:
|
||||
* currency.js:
|
||||
* flag-green.png:
|
||||
* flag-azure.png:
|
||||
* MarkdownDeepLib.min.js:
|
||||
* ChooseADate.aspx:
|
||||
* needle-pink.png:
|
||||
* current-location.png:
|
||||
* jquery.googlemaps.min.js:
|
||||
* niddle-green.png:
|
||||
* ChooseCalendar.aspx:
|
||||
* ErrorMessage.aspx:
|
||||
* relative-time.js:
|
||||
* ChooseCalendar.aspx:
|
||||
* GoogleErrorMessage.aspx:
|
||||
* popup-template-circle.html:
|
||||
* popup-template-marker.html:
|
||||
* popup-template-polygon.html:
|
||||
* popup-template-polyline.html:
|
||||
* popup-template-rectangle.html:
|
||||
|
||||
* OAuth2.cs:
|
||||
* CircleController.cs:
|
||||
* AccountController.cs: Impacts htmldoc
|
||||
|
||||
* PeopleApi.cs:
|
||||
* GoogleController.cs:
|
||||
* PaypalController.cs: Refactoring
|
||||
|
||||
* Global.asax.cs: Dropped an useless url mapping
|
||||
|
||||
* MarkdownHelper.cs: Package update
|
||||
|
||||
* App.master:
|
||||
* NoLogin.master: Site's favicon update
|
||||
|
||||
* Circles.aspx: TO BE FIXED :-D
|
||||
|
||||
* UserPost.aspx: Comment only when logged in
|
||||
|
||||
* Web.csproj: Moves to Mono framework
|
||||
|
||||
* instdbws.sql: Circle public
|
||||
|
||||
* packages.config: package update
|
||||
|
||||
2015-07-02 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* Web.csproj:
|
||||
|
@ -16,6 +16,7 @@ using Yavsc.Model;
|
||||
using Yavsc.Model.Google;
|
||||
using Yavsc.Model.RolesAndMembers;
|
||||
using Yavsc.Helpers.Google;
|
||||
using Yavsc.Model.Calendar;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
@ -288,7 +289,7 @@ namespace Yavsc.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult DateQuery ()
|
||||
{
|
||||
return View (new AskForADate ());
|
||||
return View (new BookEdit ());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -298,7 +299,7 @@ namespace Yavsc.Controllers
|
||||
/// <param name="model">Model.</param>
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult DateQuery (AskForADate model)
|
||||
public ActionResult DateQuery (BookEdit model)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
|
||||
|
@ -55,11 +55,11 @@ namespace Yavsc
|
||||
"Blogs/{action}/{user}/{title}",
|
||||
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional }
|
||||
);
|
||||
routes.MapRoute (
|
||||
/*routes.MapRoute (
|
||||
"Account",
|
||||
"Account/{action}/{user}",
|
||||
new { controller = "Account", action = "Index", user=UrlParameter.Optional }
|
||||
);
|
||||
); */
|
||||
routes.MapRoute (
|
||||
"Default",
|
||||
"{controller}/{action}/{user}/{title}",
|
||||
|
@ -28,40 +28,10 @@ using System.Web.Profile;
|
||||
using System.Web;
|
||||
using Yavsc.Model;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using Yavsc.Helpers.Google;
|
||||
|
||||
namespace Yavsc.Helpers.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Google People API.
|
||||
/// </summary>
|
||||
public class PeopleApi: ApiClient
|
||||
{
|
||||
private static string getPeopleUri = "https://www.googleapis.com/plus/v1/people";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the People object associated to the given Google Access Token
|
||||
/// </summary>
|
||||
/// <returns>The me.</returns>
|
||||
/// <param name="gat">The Google Access Token object <see cref="AuthToken"/> class.</param>
|
||||
public static People GetMe (AuthToken gat)
|
||||
{
|
||||
People me;
|
||||
DataContractJsonSerializer ppser = new DataContractJsonSerializer (typeof(People));
|
||||
HttpWebRequest webreppro = WebRequest.CreateHttp (getPeopleUri + "/me");
|
||||
webreppro.ContentType = "application/http";
|
||||
webreppro.Headers.Add (HttpRequestHeader.Authorization, gat.token_type + " " + gat.access_token);
|
||||
webreppro.Method = "GET";
|
||||
using (WebResponse proresp = webreppro.GetResponse ()) {
|
||||
using (Stream prresponseStream = proresp.GetResponseStream ()) {
|
||||
me = (People) ppser.ReadObject (prresponseStream);
|
||||
prresponseStream.Close ();
|
||||
}
|
||||
proresp.Close ();
|
||||
}
|
||||
webreppro.Abort ();
|
||||
return me;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Google O auth2 client.
|
||||
@ -108,6 +78,7 @@ namespace Yavsc.Helpers.Google
|
||||
CLIENT_ID, RedirectUri, scope, state);
|
||||
GetAuthResponse (bresp, prms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cal authorization.
|
||||
/// </summary>
|
||||
@ -157,6 +128,7 @@ namespace Yavsc.Helpers.Google
|
||||
HttpUtility.UrlEncode (code));
|
||||
return postdata;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Google Authorization token.
|
||||
/// </summary>
|
||||
@ -188,7 +160,7 @@ namespace Yavsc.Helpers.Google
|
||||
AuthToken gat = null;
|
||||
using (WebResponse response = webreq.GetResponse ()) {
|
||||
using (Stream responseStream = response.GetResponseStream ()) {
|
||||
gat = (AuthToken) new DataContractJsonSerializer(typeof(AuthToken)).ReadObject (responseStream);
|
||||
gat = (AuthToken)new DataContractJsonSerializer (typeof(AuthToken)).ReadObject (responseStream);
|
||||
responseStream.Close ();
|
||||
}
|
||||
response.Close ();
|
||||
@ -224,6 +196,28 @@ namespace Yavsc.Helpers.Google
|
||||
return code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invalid O auth2 refresh token.
|
||||
/// </summary>
|
||||
public class InvalidOAuth2RefreshToken: Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Helpers.Google.OAuth2.InvalidOAuth2RefreshToken"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">Message.</param>
|
||||
public InvalidOAuth2RefreshToken(string message):base(message)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Helpers.Google.OAuth2.InvalidOAuth2RefreshToken"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">Message.</param>
|
||||
/// <param name="innerException">Inner exception.</param>
|
||||
public InvalidOAuth2RefreshToken(string message,Exception innerException):base(message,innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets fresh google credential.
|
||||
/// </summary>
|
||||
@ -235,11 +229,18 @@ namespace Yavsc.Helpers.Google
|
||||
string token_type = (string)pr.GetPropertyValue ("gtokentype");
|
||||
DateTime token_exp = (DateTime)pr.GetPropertyValue ("gtokenexpir");
|
||||
if (token_exp < DateTime.Now) {
|
||||
string refresh_token = (string)pr.GetPropertyValue ("grefreshtoken");
|
||||
AuthToken gat = OAuth2.GetTokenPosting (
|
||||
string.Format ("grant_type=refresh_token&client_id={0}&client_secret={1}&refresh_token={2}",
|
||||
CLIENT_ID, CLIENT_SECRET, refresh_token));
|
||||
token = gat.access_token;
|
||||
object ort = pr.GetPropertyValue ("grefreshtoken");
|
||||
if (ort == null) {
|
||||
throw new InvalidOAuth2RefreshToken ("Google");
|
||||
}
|
||||
else {
|
||||
string refresh_token = ort as string;
|
||||
|
||||
AuthToken gat = OAuth2.GetTokenPosting (
|
||||
string.Format ("grant_type=refresh_token&client_id={0}&client_secret={1}&refresh_token={2}",
|
||||
CLIENT_ID, CLIENT_SECRET, refresh_token));
|
||||
token = gat.access_token;
|
||||
}
|
||||
pr.SetPropertyValue ("gtoken", token);
|
||||
pr.Save ();
|
||||
// ASSERT gat.token_type == pr.GetPropertyValue("token_type")
|
||||
|
68
web/Helpers/Google/PeopleApi.cs
Normal file
@ -0,0 +1,68 @@
|
||||
//
|
||||
// PeopleApi.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Model.Google;
|
||||
using System.Web.Profile;
|
||||
using System.Web;
|
||||
using Yavsc.Model;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using Yavsc.Helpers.Google;
|
||||
|
||||
namespace Yavsc.Helpers.Google
|
||||
{
|
||||
/// <summary>
|
||||
/// Google People API.
|
||||
/// </summary>
|
||||
public class PeopleApi: ApiClient
|
||||
{
|
||||
private static string getPeopleUri = "https://www.googleapis.com/plus/v1/people";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the People object associated to the given Google Access Token
|
||||
/// </summary>
|
||||
/// <returns>The me.</returns>
|
||||
/// <param name="gat">The Google Access Token object <see cref="AuthToken"/> class.</param>
|
||||
public static People GetMe (AuthToken gat)
|
||||
{
|
||||
People me;
|
||||
DataContractJsonSerializer ppser = new DataContractJsonSerializer (typeof(People));
|
||||
HttpWebRequest webreppro = WebRequest.CreateHttp (getPeopleUri + "/me");
|
||||
webreppro.ContentType = "application/http";
|
||||
webreppro.Headers.Add (HttpRequestHeader.Authorization, gat.token_type + " " + gat.access_token);
|
||||
webreppro.Method = "GET";
|
||||
using (WebResponse proresp = webreppro.GetResponse ()) {
|
||||
using (Stream prresponseStream = proresp.GetResponseStream ()) {
|
||||
me = (People)ppser.ReadObject (prresponseStream);
|
||||
prresponseStream.Close ();
|
||||
}
|
||||
proresp.Close ();
|
||||
}
|
||||
webreppro.Abort ();
|
||||
return me;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +1,39 @@
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using MarkdownDeep;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for transforming Markdown.
|
||||
/// </summary>
|
||||
public static partial class MarkdownHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(string text)
|
||||
{
|
||||
// Transform the supplied text (Markdown) into HTML.
|
||||
var markdownTransformer = new Markdown();
|
||||
string html = markdownTransformer.Transform(text);
|
||||
|
||||
// Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :(
|
||||
return new MvcHtmlString(html);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="helper">HtmlHelper - Not used, but required to make this an extension method.</param>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(this HtmlHelper helper, string text)
|
||||
{
|
||||
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).
|
||||
return Markdown(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using MarkdownDeep;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for transforming Markdown.
|
||||
/// </summary>
|
||||
public static partial class MarkdownHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(string text)
|
||||
{
|
||||
// Transform the supplied text (Markdown) into HTML.
|
||||
var markdownTransformer = new Markdown();
|
||||
string html = markdownTransformer.Transform(text);
|
||||
|
||||
// Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :(
|
||||
return new MvcHtmlString(html);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transforms a string of Markdown into HTML.
|
||||
/// </summary>
|
||||
/// <param name="helper">HtmlHelper - Not used, but required to make this an extension method.</param>
|
||||
/// <param name="text">The Markdown that should be transformed.</param>
|
||||
/// <returns>The HTML representation of the supplied Markdown.</returns>
|
||||
public static IHtmlString Markdown(this HtmlHelper helper, string text)
|
||||
{
|
||||
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).
|
||||
return Markdown(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="/Theme/style.css" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png?v=2" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png?v=3" />
|
||||
<script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery-2.1.4.js")%>"></script>
|
||||
<asp:ContentPlaceHolder id="head" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
|
@ -10,7 +10,7 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="/Theme/style.css" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png?v=2" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png?v=3" />
|
||||
<script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery-2.1.4.js")%>"></script>
|
||||
<asp:ContentPlaceHolder id="head" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
|
443
web/Scripts/MarkdownDeepLib.min.js
vendored
@ -1,443 +0,0 @@
|
||||
// MarkdownDeep - http://www.toptensoftware.com/markdowndeep
|
||||
// Copyright (C) 2010-2011 Topten Software
|
||||
// Minified by MiniME from toptensoftware.com
|
||||
var MarkdownDeep=new(function(){function S(b,e){if(b.indexOf!==undefined)return b.indexOf(e);for(var c=0;c<b.length;c++)
|
||||
if(b[c]===e)return c;return-1}function i(){this.bz=new E(this);this.bC=[];this.bE=new F();this.bF=new F()}i.prototype={
|
||||
SafeMode:false,ExtraMode:false,MarkdownInHtml:false,AutoHeadingIDs:false,UrlBaseLocation:null,UrlRootLocation:null,
|
||||
NewWindowForExternalLinks:false,NewWindowForLocalLinks:false,NoFollowLinks:false,HtmlClassFootnotes:"footnotes",
|
||||
HtmlClassTitledImages:null,RenderingTitledImage:false,FormatCodeBlockAttributes:null,FormatCodeBlock:null,
|
||||
ExtractHeadBlocks:false,HeadBlockContent:""};var a=i.prototype;function ao(b,c,e,g){return b.slice(0,c).concat(g).concat
|
||||
(b.slice(c+e))}i.prototype.GetListItems=function(k,n){var c=this.aE(k),b;for(b=0;b<c.length;b++){var e=c[b];if((e.v==23
|
||||
||e.v==15||e.v==22)&&e.C){c=ao(c,b,1,e.C);b--;continue}if(n<e.ay)break}b--;if(b<0)return null;var h=c[b];if(h.v!=21&&h.v
|
||||
!=20)return null;var g=[],m=h.C;for(var j=0;j<m.length;j++)g.push(m[j].ay);b++;if(b<c.length)g.push(c[b].ay);else g.push
|
||||
(k.length);return g};i.prototype.Transform=function(c){var n=c.indexOf("\r");if(n>=0){var m=c.indexOf("\n");if(m>=0)if(m
|
||||
<n)c=c.replace(/\n\r/g,"\n");else c=c.replace(/\r\n/g,"\n");c=c.replace(/\r/g,"\n")}this.HeadBlockContent="";var k=this.
|
||||
aE(c);if(this.bn!=null){var j=[];for(var r in this.bn)j.push(this.bn[r]);j.sort(function(p,q){return q.Abbr.length-p.
|
||||
Abbr.length});this.bn=j}var b=this.bF;b.K();for(var g=0;g<k.length;g++){var s=k[g];s.l(this,b)}if(this.bI.length>0){b.x(
|
||||
'\n<div class="');b.x(this.HtmlClassFootnotes);b.x('">\n');b.x("<hr />\n");b.x("<ol>\n");for(var g=0;g<this.bI.length;
|
||||
g++){var h=this.bI[g];b.x('<li id="fn:');b.x(h.X);b.x('">\n');var o='<a href="#fnref:'+h.X+
|
||||
'" rev="footnote">↩</a>',e=h.C[h.C.length-1];if(e.v==12){e.v=29;e.X=o}else{e=new B();e.N=0;e.v=29;e.X=o;h.C.push(e
|
||||
)}h.l(this,b);b.x("</li>\n")}b.x("</ol>\n");b.x("</div>\n")}return b.bh()};i.prototype.OnQualifyUrl=function(b){if(aj(b)
|
||||
)return b;if(au(b,"/")){var e=this.UrlRootLocation;if(!e){if(!this.UrlBaseLocation)return b;var c=this.UrlBaseLocation.
|
||||
indexOf("://");if(c==-1)c=0;else c+=3;c=this.UrlBaseLocation.indexOf("/",c);e=c<0?this.UrlBaseLocation:this.
|
||||
UrlBaseLocation.substr(0,c)}return e+b}else{if(!this.UrlBaseLocation)return b;if(!T(this.UrlBaseLocation,"/"))
|
||||
return this.UrlBaseLocation+"/"+b;else return this.UrlBaseLocation+b}};i.prototype.OnGetImageSize=function(b,c){
|
||||
return null};i.prototype.OnPrepareLink=function(b){var c=b.attributes.href;if(this.NoFollowLinks)b.attributes.rel=
|
||||
"nofollow";if(this.NewWindowForExternalLinks&&aj(c)||this.NewWindowForLocalLinks&&!aj(c))b.attributes.target="_blank";b.
|
||||
attributes.href=this.OnQualifyUrl(c)};i.prototype.OnPrepareImage=function(b,e){var c=this.OnGetImageSize(b.attributes.
|
||||
src,e);if(c!=null){b.attributes.width=c.width;b.attributes.height=c.height}b.attributes.src=this.OnQualifyUrl(b.
|
||||
attributes.src)};i.prototype.GetLinkDefinition=function(c){var b=this.bv[c];if(b==undefined)return null;else return b};a
|
||||
.aE=function(b){this.bv=[];this.bs=[];this.bI=[];this.bJ=[];this.bn=null;return new D(this,this.MarkdownInHtml).aH(b)};a
|
||||
.A=function(b){this.bv[b.id]=b};a.z=function(b){this.bs[b.X]=b};a.Q=function(c){var b=this.bs[c];if(b!=undefined){this.
|
||||
bI.push(b);delete this.bs[c];return this.bI.length-1}else return-1};a.y=function(b,c){if(this.bn==null)this.bn=[];this.
|
||||
bn[b]={Abbr:b,Title:c}};a.am=function(){return this.bn};a.aC=function(j,h,g){if(!this.AutoHeadingIDs)return null;var b=
|
||||
this.bz.aB(j,h,g);if(!b)b="section";var c=b,e=1;while(this.bJ[c]!=undefined){c=b+"-"+e.toString();e++}this.bJ[c]=true;
|
||||
return c};a.as=function(){this.bE.K();return this.bE};function X(b){return b>="0"&&b<="9"}function af(b){return b>="0"&&
|
||||
b<="9"||b>="a"&&b<="f"||b>="A"&&b<="F"}function ac(b){return b>="a"&&b<="z"||b>="A"&&b<="Z"}function R(b){return b>="a"
|
||||
&&b<="z"||b>="A"&&b<="Z"||b>="0"&&b<="9"}function ad(b){return b==" "||b=="\t"||b=="\r"||b=="\n"}function ab(b){return b
|
||||
==" "||b=="\t"}function Y(b){return b=="\r"||b=="\n"}function ae(b){return b=="*"||b=="_"}function U(b,c){switch(b){case
|
||||
"\\":case"`":case"*":case"_":case"{":case"}":case"[":case"]":case"(":case")":case">":case"#":case"+":case"-":case".":
|
||||
case"!":return true;case":":case"|":case"=":case"<":return c}return false}function as(c,b){if(c.charAt(b)!="&")return-1;
|
||||
var g=b;b++;var e;if(c.charAt(b)=="#"){b++;if(c.charAt(b)=="x"||c.charAt(b)=="X"){b++;e=af}else e=X}else e=R;if(e(c.
|
||||
charAt(b))){b++;while(e(c.charAt(b)))b++;if(c.charAt(b)==";"){b++;return b}}b=g;return-1}function az(c,h){var b=c.
|
||||
indexOf("\\");if(b<0)return c;var g=new F(),e=0;while(b>=0){if(U(c.charAt(b+1),h)){if(b>e)g.x(c.substr(e,b-e));e=b+1}b=c
|
||||
.indexOf("\\",b+1)}if(e<c.length)g.x(c.substr(e,c.length-e));return g.bh()}function ay(e){var b=0,c=e.length;while(b<c&&
|
||||
ad(e.charAt(b)))b++;while(c-1>b&&ad(e.charAt(c-1)))c--;return e.substr(b,c-b)}function ah(c){var b=c.indexOf("@");if(b<0
|
||||
)return false;var e=c.lastIndexOf(".");if(e<b)return false;return true}function al(b){b=b.toLowerCase();if(b.substr(0,7)
|
||||
=="http://")return true;if(b.substr(0,8)=="https://")return true;if(b.substr(0,6)=="ftp://")return true;if(b.substr(0,7)
|
||||
=="file://")return true;return false}function ak(c){if(!c)return false;if(!ac(c.charAt(0)))return false;for(var e=0;e<c.
|
||||
length;e++){var b=c.charAt(e);if(R(b)||b=="_"||b=="-"||b==":"||b==".")continue;return false}return true}function at(c,e,
|
||||
j){var b=j-1;while(b>=e&&ad(c.charAt(b)))b--;if(b<e||c.charAt(b)!="}")return null;var k=b;b--;while(b>=e&&c.charAt(b)!=
|
||||
"{")b--;if(b<e||c.charAt(b+1)!="#")return null;var g=b+2,h=c.substr(g,k-g);if(!ak(h))return null;while(b>e&&ad(c.charAt(
|
||||
b-1)))b--;return{id:h,end:b}}function au(c,b){return c.substr(0,b.length)==b}function T(c,b){return c.substr(-b.length)
|
||||
==b}function aj(b){return b.indexOf("://")>=0||au(b,"mailto:")}function F(){this.bq=[]}a=F.prototype;a.x=function(b){if(
|
||||
b)this.bq.push(b)};a.K=function(){this.bq.length=0};a.bh=function(){return this.bq.join("")};a.aw=function(c){var g=c.
|
||||
length;for(var b=0;b<g;b++){var e=Math.random();if(e>0.90&&c.charAt(b)!="@")this.x(c.charAt(b));else if(e>0.45){this.x(
|
||||
"&#");this.x(c.charCodeAt(b).toString());this.x(";")}else{this.x("&#x");this.x(c.charCodeAt(b).toString(16));this.x(";")
|
||||
}}};a.au=function(e,g,j){var h=g+j,b=g,c;for(c=g;c<h;c++)switch(e.charAt(c)){case"&":if(c>b)this.x(e.substr(b,c-b));this
|
||||
.x("&");b=c+1;break;case"<":if(c>b)this.x(e.substr(b,c-b));this.x("<");b=c+1;break;case">":if(c>b)this.x(e.substr
|
||||
(b,c-b));this.x(">");b=c+1;break;case'"':if(c>b)this.x(e.substr(b,c-b));this.x(""");b=c+1;break}if(c>b)this.x(e.
|
||||
substr(b,c-b))};a.bf=function(e,g,k){var j=g+k,c=g,b;for(b=g;b<j;b++)switch(e.charAt(b)){case"&":var h=as(e,b);if(h<0){
|
||||
if(b>c)this.x(e.substr(c,b-c));this.x("&");c=b+1}else b=h-1;break;case"<":if(b>c)this.x(e.substr(c,b-c));this.x(
|
||||
"<");c=b+1;break;case">":if(b>c)this.x(e.substr(c,b-c));this.x(">");c=b+1;break;case'"':if(b>c)this.x(e.substr(c,b
|
||||
-c));this.x(""");c=b+1;break}if(b>c)this.x(e.substr(c,b-c))};a.be=function(e,g,k){var j=g+k,c=g,b;for(b=g;b<j;b++)
|
||||
switch(e.charAt(b)){case"&":var h=as(e,b);if(h<0){if(b>c)this.x(e.substr(c,b-c));this.x("&");c=b+1}else b=h-1;break}
|
||||
if(b>c)this.x(e.substr(c,b-c))};a.av=function(e,h,k){var j=h+k,b=h,g=0,c;for(c=h;c<j;c++){switch(e.charAt(c)){case"\t":
|
||||
if(c>b)this.x(e.substr(b,c-b));b=c+1;this.x(" ");g++;while(g%4!=0){this.x(" ");g++}g--;break;case"\r":case"\n":if(c>b)
|
||||
this.x(e.substr(b,c-b));this.x("\n");b=c+1;continue;case"&":if(c>b)this.x(e.substr(b,c-b));this.x("&");b=c+1;break;
|
||||
case"<":if(c>b)this.x(e.substr(b,c-b));this.x("<");b=c+1;break;case">":if(c>b)this.x(e.substr(b,c-b));this.x(">");
|
||||
b=c+1;break;case'"':if(c>b)this.x(e.substr(b,c-b));this.x(""");b=c+1;break}g++}if(c>b)this.x(e.substr(b,c-b))};
|
||||
function G(){this.aU.apply(this,arguments)}a=G.prototype;a.D=function(){return this.by==this.start};a.J=function(){
|
||||
return this.by>=this.end};a.Y=function(){if(this.by>=this.end)return true;var b=this.E.charAt(this.by);return b=="\r"||b
|
||||
=="\n"||b==undefined||b==""};a.aU=function(){this.E=arguments.length>0?arguments[0]:null;this.start=arguments.length>1?
|
||||
arguments[1]:0;this.end=arguments.length>2?this.start+arguments[2]:this.E==null?0:this.E.length;this.by=this.start;this.
|
||||
charset_offsets={}};a.H=function(){if(this.by>=this.end)return"\x00";return this.E.charAt(this.by)};a.aM=function(){
|
||||
return this.E.substr(this.by)};a.ba=function(){this.by=this.end};a.a5=function(b){this.by+=b};a.bb=function(){this.by=
|
||||
this.E.indexOf("\n",this.by);if(this.by<0)this.by=this.end};a.aZ=function(){var b=this.by;if(this.E.charAt(this.by)==
|
||||
"\r")this.by++;if(this.E.charAt(this.by)=="\n")this.by++;return this.by!=b};a.bc=function(){this.bb();this.aZ()};a.F=
|
||||
function(b){if(this.by+b>=this.end)return"\x00";return this.E.charAt(this.by+b)};a.aW=function(b){if(this.E.charAt(this.
|
||||
by)==b){this.by++;return true}return false};a.a9=function(b){if(this.E.substr(this.by,b.length)==b){this.by+=b.length;
|
||||
return true}return false};a.bd=function(){var c=this.by;while(true){var b=this.E.charAt(this.by);if(b!=" "&&b!="\t"&&b!=
|
||||
"\r"&&b!="\n")break;this.by++}return this.by!=c};a.a8=function(){var c=this.by;while(true){var b=this.E.charAt(this.by);
|
||||
if(b!=" "&&b!="\t")break;this.by++}return this.by!=c};a.aa=function(c){c.lastIndex=this.by;var b=c.exec(this.E);if(b==
|
||||
null){this.by=this.end;return false}if(b.index+b[0].length>this.end){this.by=this.end;return false}this.by=b.index;
|
||||
return true};a.ad=function(g){var c=-1;for(var e in g){var b=g[e];if(b==null){b={};b.bD=-1;b.bt=-1;g[e]=b}if(b.bD==-1||
|
||||
this.by<b.bD||this.by>=b.bt&&b.bt!=-1){b.bD=this.by;b.bt=this.E.indexOf(e,this.by)}if(c==-1||b.bt<c)c=b.bt}if(c==-1){c=
|
||||
this.end;return false}a.by=c;return true};a.Z=function(b){this.by=this.E.indexOf(b,this.by);if(this.by<0){this.by=this.
|
||||
end;return false}return true};a.az=function(){this.mark=this.by};a.W=function(){if(this.mark>=this.by)return"";else
|
||||
return this.E.substr(this.mark,this.by-this.mark)};a.a7=function(){var b=this.E.charAt(this.by);if(b>="a"&&b<="z"||b>=
|
||||
"A"&&b<="Z"||b=="_"){this.by++;while(true){b=this.E.charAt(this.by);if(b>="a"&&b<="z"||b>="A"&&b<="Z"||b=="_"||b>="0"&&b
|
||||
<="9")this.by++;else return true}}return false};a.a4=function(){var e=this.by;this.a8();this.az();while(true){var b=this
|
||||
.H();if(R(b)||b=="-"||b=="_"||b==":"||b=="."||b==" ")this.a5(1);else break}if(this.by>this.mark){var c=ay(this.W());if(c
|
||||
.length>0){this.a8();return c}}this.by=e;return null};a.a6=function(){if(this.E.charAt(this.by)!="&")return false;var b=
|
||||
as(this.E,this.by);if(b<0)return false;this.by=b;return true};a.a2=function(b){if(this.E.charAt(this.by)=="\\"&&U(this.E
|
||||
.charAt(this.by+1),b)){this.by+=2;return true}else{if(this.by<this.end)this.by++;return false}};function w(b){this.name=
|
||||
b;this.attributes={};this.flags=0;this.closed=false;this.closing=false}a=w.prototype;a.B=function(){if(!this.attributes)
|
||||
return 0;var b=0;for(var c in this.attributes)b++;return b};a.ap=function(){if(this.flags==0){this.flags=aw[this.name.
|
||||
toLowerCase()];if(this.flags==undefined)this.flags=2}return this.flags};a.at=function(){var c=this.name.toLowerCase();
|
||||
if(!Q[c])return false;var b=O[c];if(!b)return this.B()==0;if(!this.attributes)return true;for(var e in this.attributes)
|
||||
if(!b[e.toLowerCase()])return false;if(this.attributes.href)if(!ai(this.attributes.href))return false;if(this.attributes
|
||||
.src)if(!ai(this.attributes.src))return false;return true};a.aS=function(b){b.x("<");b.x(this.name);for(var c in this.
|
||||
attributes){b.x(" ");b.x(c);b.x('="');b.x(this.attributes[c]);b.x('"')}if(this.closed)b.x(" />");else b.x(">")};a.aO=
|
||||
function(b){b.x("</");b.x(this.name);b.x(">")};function ai(b){b=b.toLowerCase();return b.substr(0,7)=="http://"||b.
|
||||
substr(0,8)=="https://"||b.substr(0,6)=="ftp://"}function ag(b){var e=b.by,c=ap(b);if(c!=null)return c;b.by=e;
|
||||
return null}function ap(b){if(b.H()!="<")return null;b.a5(1);if(b.a9("!--")){b.az();if(b.Z("-->")){var g=new w("!");g.
|
||||
attributes.content=b.W();g.closed=true;b.a5(3);return g}}var h=b.aW("/");b.az();if(!b.a7())return null;var c=new w(b.W()
|
||||
);c.closing=h;if(h){if(b.H()!=">")return null;b.a5(1);return c}while(!b.J()){b.bd();if(b.a9("/>")){c.closed=true;
|
||||
return c}if(b.aW(">"))return c;b.az();if(!b.a7())return null;var e=b.W();b.bd();if(b.aW("=")){b.bd();if(b.aW('"')){b.az(
|
||||
);if(!b.Z('"'))return null;c.attributes[e]=b.W();b.a5(1)}else{b.az();while(!b.J()&&!ad(b.H())&&b.H()!=">"&&b.H()!="/")b.
|
||||
a5(1);if(!b.J())c.attributes[e]=b.W()}}else c.attributes[e]=""}return null}var Q={b:1,blockquote:1,code:1,dd:1,dt:1,dl:1
|
||||
,del:1,em:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,i:1,kbd:1,li:1,ol:1,ul:1,p:1,pre:1,s:1,sub:1,sup:1,strong:1,strike:1,img:1,a:1
|
||||
},O={a:{href:1,title:1,"class":1},img:{src:1,width:1,height:1,alt:1,title:1,"class":1}},d=1,l=2,u=4,f=8,aw={p:d|f,div:d,
|
||||
h1:d|f,h2:d|f,h3:d|f,h4:d|f,h5:d|f,h6:d|f,blockquote:d,pre:d,table:d,dl:d,ol:d,ul:d,form:d,fieldset:d,iframe:d,script:d|
|
||||
l,noscript:d|l,math:d|l,ins:d|l,del:d|l,img:d|l,li:f,dd:f,dt:f,td:f,th:f,legend:f,address:f,hr:d|u,"!":d|u,head:d};
|
||||
delete d;delete l;delete u;function C(c,e,b){this.id=c;this.url=e;if(b==undefined)this.title=null;else this.title=b}a=C.
|
||||
prototype;a.aR=function(h,b,g){if(this.url.substr(0,7).toLowerCase()=="mailto:"){b.x('<a href="');b.aw(this.url);b.x('"'
|
||||
);if(this.title){b.x(' title="');b.bf(this.title,0,this.title.length);b.x('"')}b.x(">");b.aw(g);b.x("</a>")}else{var e=
|
||||
new w("a"),c=h.as();c.bf(this.url,0,this.url.length);e.attributes.href=c.bh();if(this.title){c.K();c.bf(this.title,0,
|
||||
this.title.length);e.attributes.title=c.bh()}h.OnPrepareLink(e);e.aS(b);b.x(g);b.x("</a>")}};a.aP=function(g,h,e){var c=
|
||||
new w("img"),b=g.as();b.bf(this.url,0,this.url.length);c.attributes.src=b.bh();if(e){b.K();b.bf(e,0,e.length);c.
|
||||
attributes.alt=b.bh()}if(this.title){b.K();b.bf(this.title,0,this.title.length);c.attributes.title=b.bh()}c.closed=true;
|
||||
g.OnPrepareImage(c,g.RenderingTitledImage);c.aS(h)};function an(b,e){var g=b.by,c=aq(b,e);if(c==null)b.by=g;return c}
|
||||
function aq(b,e){b.bd();if(!b.aW("["))return null;b.az();if(!b.Z("]"))return null;var c=b.W();if(c.length==0)return null
|
||||
;if(!b.a9("]:"))return null;var g=ar(b,c,e);b.a8();if(!b.Y())return null;return g}function ar(b,h,c){b.bd();if(b.Y())
|
||||
return null;var e=new C(h);if(b.aW("<")){b.az();while(b.H()!=">"){if(b.J())return null;b.a2(c)}var p=b.W();if(!b.aW(">")
|
||||
)return null;e.url=az(ay(p),c);b.bd()}else{b.az();var k=1;while(!b.Y()){var j=b.H();if(ad(j))break;if(h==null)if(j=="(")
|
||||
k++;else if(j==")"){k--;if(k==0)break}b.a2(c)}e.url=az(ay(b.W()),c)}b.a8();if(b.H()==")")return e;var m=b.Y(),n=b.by;if(
|
||||
b.Y()){b.aZ();b.a8()}var g;switch(b.H()){case"'":case'"':g=b.H();break;case"(":g=")";break;default:if(m){b.by=n;return e
|
||||
}else return null}b.a5(1);b.az();while(true){if(b.Y())return null;if(b.H()==g){if(g!=")"){var o=b.by;b.a5(1);b.a8();if(h
|
||||
==null&&b.H()!=")"||h!=null&&!b.Y())continue;b.by=o}break}b.a2(c)}e.title=az(b.W(),c);b.a5(1);return e}function am(b,c){
|
||||
this.def=b;this.link_text=c}function ax(e,c,b){this.type=e;this.startOffset=c;this.length=b;this.X=null}function E(b){
|
||||
this.bw=b;this.bB=new G();this.bG=[];this.br=false;this.bH=[]}a=E.prototype;a.ah=function(b,e,h,g){this.bj(e,h,g);if(
|
||||
this.bH.length==1&&this.bw.HtmlClassTitledImages!=null&&this.bH[0].type==10){var c=this.bH[0].X;b.x('<div class="');b.x(
|
||||
this.bw.HtmlClassTitledImages);b.x('">\n');this.bw.RenderingTitledImage=true;this.l(b,e);this.bw.RenderingTitledImage=
|
||||
false;b.x("\n");if(c.def.title){b.x("<p>");b.bf(c.def.title,0,c.def.title.length);b.x("</p>\n")}b.x("</div>\n")}else{b.x
|
||||
("<p>");this.l(b,e);b.x("</p>\n")}};a.af=function(c,b){this.ae(c,b,0,b.length)};a.ae=function(c,b,g,e){this.bj(b,g,e);
|
||||
this.l(c,b)};a.ag=function(c){var b=new F();this.ae(b,c,0,c.length);return b.bh()};a.aB=function(j,n,m){this.bj(j,n,m);
|
||||
var k=this.bH,c=new F();for(var h=0;h<k.length;h++){var g=k[h];switch(g.type){case 0:c.x(j.substr(g.startOffset,g.length
|
||||
));break;case 9:c.x(g.X.link_text);break}this.ak(g)}var b=this.bB;b.aU(c.bh());while(!b.J()){if(ac(b.H()))break;b.a5(1)}
|
||||
c.K();while(!b.J()){var e=b.H();if(R(e)||e=="_"||e=="-"||e==".")c.x(e.toLowerCase());else if(e==" ")c.x("-");else if(Y(e
|
||||
)){c.x("-");b.aZ();continue}b.a5(1)}return c.bh()};a.l=function(b,h){var n=this.bH,o=n.length;for(var j=0;j<o;j++){var c
|
||||
=n[j];switch(c.type){case 0:b.au(h,c.startOffset,c.length);break;case 1:b.be(h,c.startOffset,c.length);break;case 2:case
|
||||
11:case 12:case 13:b.x(h.substr(c.startOffset,c.length));break;case 8:b.x("<br />\n");break;case 3:b.x("<em>");break;
|
||||
case 4:b.x("</em>");break;case 5:b.x("<strong>");break;case 6:b.x("</strong>");break;case 7:b.x("<code>");b.au(h,c.
|
||||
startOffset,c.length);b.x("</code>");break;case 9:var g=c.X,m=new E(this.bw);m.br=true;g.def.aR(this.bw,b,m.ag(g.
|
||||
link_text));break;case 10:var g=c.X;g.def.aP(this.bw,b,g.link_text);break;case 14:var k=c.X;b.x('<sup id="fnref:');b.x(k
|
||||
.id);b.x('"><a href="#fn:');b.x(k.id);b.x('" rel="footnote">');b.x(k.index+1);b.x("</a></sup>");break;case 15:var e=c.X;
|
||||
b.x("<abbr");if(e.Title){b.x(' title="');b.au(e.Title,0,e.Title.length);b.x('"')}b.x(">");b.au(e.Abbr,0,e.Abbr.length);b
|
||||
.x("</abbr>");break}this.ak(c)}};a.bj=function(y,x,s){var b=this.bB;b.aU(y,x,s);var j=this.bH;j.length=0;var h=null,k=
|
||||
this.bw.am(),o=k==null?/[\*\_\`\[\!\<\&\ \\]/g:null,q=this.bw.ExtraMode,g=b.by;while(!b.J()){if(o!=null&&!b.aa(o))break;
|
||||
var m=b.by,c=null;switch(b.H()){case"*":case"_":c=this.P();if(c!=null)switch(c.type){case 13:case 11:case 12:if(h==null)
|
||||
h=[];h.push(c);break}break;case"`":c=this.aF();break;case"[":case"!":var t=b.by;c=this.aI();if(c==null)b.by=t;break;case
|
||||
"<":var e=b.by,p=ag(b);if(p!=null)if(!this.bw.SafeMode||p.at())c=this.U(1,e,b.by-e);else b.by=e;else{b.by=e;c=this.aD();
|
||||
if(c==null)b.by=e}break;case"&":var e=b.by;if(b.a6())c=this.U(2,e,b.by-e);break;case" ":if(b.F(1)==" "&&Y(b.F(2))){b.a5(
|
||||
2);if(!b.J()){b.aZ();c=this.U(8,m,0)}}break;case"\\":if(U(b.F(1),q)){c=this.U(0,b.by+1,1);b.a5(2)}break}if(c==null&&k!=
|
||||
null&&!R(b.F(-1))){var v=b.by;for(var r in k){var n=k[r];if(b.a9(n.Abbr)&&!R(b.H())){c=this.O(15,n);break}b.bK=v}}if(c!=
|
||||
null){if(m>g)j.push(this.U(0,g,m-g));j.push(c);g=b.by}else b.a5(1)}if(b.by>g)j.push(this.U(0,g,b.by-g));if(h!=null)this.
|
||||
aV(j,h)};a.P=function(){var b=this.bB,e=b.H(),k=e=="*"?"_":"*",c=b.by;if(b.D()||ad(b.F(-1))){while(ae(b.H()))b.a5(1);if(
|
||||
b.J()||ad(b.H()))return this.U(2,c,b.by-c);b.by=c}while(ae(b.F(-1)))b.a5(-1);var h=b.D()||ad(b.F(-1));b.by=c;while(b.H()
|
||||
==e)b.a5(1);var j=b.by-c;while(ae(b.F(1)))b.a5(1);var g=b.J()||ad(b.H());b.by=c+j;if(h)return this.U(11,c,b.by-c);if(g)
|
||||
return this.U(12,c,b.by-c);if(this.bw.ExtraMode&&e=="_")return null;return this.U(13,c,b.by-c)};a.bg=function(h,g,b,c){
|
||||
var e=this.U(b.type,b.startOffset+c,b.length-c);b.length=c;g.splice(S(g,b)+1,0,e);h.splice(S(h,b)+1,0,e);return e};a.aV=
|
||||
function(n,b){var m=this.bB.E,j=true;while(j){j=false;for(var h=0;h<b.length;h++){var c=b[h];if(c.type!=11&&c.type!=13)
|
||||
continue;for(var k=h+1;k<b.length;k++){var g=b[k];if(g.type!=12&&g.type!=13)break;if(m.charAt(c.startOffset)!=m.charAt(g
|
||||
.startOffset))continue;var e=Math.min(c.length,g.length);if(e>=3)e=e%2==1?1:2;if(c.length>e){c=this.bg(n,b,c,c.length-e)
|
||||
;h--}if(g.length>e)this.bg(n,b,g,e);c.type=e==1?3:5;g.type=e==1?4:6;b.splice(S(b,c),1);b.splice(S(b,g),1);j=true;break}}
|
||||
}};a.aD=function(){if(this.br)return null;var c=this.bB;c.a5(1);c.az();var j=this.bw.ExtraMode;while(!c.J()){var h=c.H()
|
||||
;if(ad(h))break;if(h==">"){var b=az(c.W(),j),e=null;if(ah(b)){var g;if(b.toLowerCase().substr(0,7)=="mailto:")g=b.substr
|
||||
(7);else{g=b;b="mailto:"+b}e=new am(new C("auto",b,null),g)}else if(al(b))e=new am(new C("auto",b,null),b);if(e!=null){c
|
||||
.a5(1);return this.O(9,e)}return null}c.a2(j)}return null};a.aI=function(){var b=this.bB,h=b.aW("!")?10:9;if(!b.aW("["))
|
||||
return null;var o=this.by;if(this.bw.ExtraMode&&h==9&&b.aW("^")){b.a8();b.az();var m=b.a4();if(m!=null&&b.aW("]")){var s
|
||||
=this.bw.Q(m);if(s>=0)return this.O(14,{index:s,id:m})}this.by=o}if(this.br&&h==9)return null;var r=this.bw.ExtraMode;b.
|
||||
az();var j=1;while(!b.J()){var p=b.H();if(p=="[")j++;else if(p=="]"){j--;if(j==0)break}b.a2(r)}if(b.J())return null;var
|
||||
n=az(b.W(),r);b.a5(1);o=b.by;if(b.aW("(")){var t=ar(b,null,this.bw.ExtraMode);if(t==null)return null;b.bd();if(!b.aW(")"
|
||||
))return null;return this.O(h,new am(t,n))}if(!b.aW(" "))b.aW("\t");if(b.Y()){b.aZ();b.a8()}var c=null;if(b.H()=="["){b.
|
||||
a5(1);b.az();if(!b.Z("]"))return null;c=b.W();b.a5(1)}else b.by=o;if(!c){c=n;while(true){var k=c.indexOf("\n");if(k<0)
|
||||
break;var g=k;while(g>0&&ad(c.charAt(g-1)))g--;var e=k;while(e<c.length&&ad(c.charAt(e)))e++;c=c.substr(0,g)+" "+c.
|
||||
substr(e)}}var q=this.bw.GetLinkDefinition(c);if(q==null)return null;return this.O(h,new am(q,n))};a.aF=function(){var b
|
||||
=this.bB,c=b.by,e=0;while(b.aW("`"))e++;b.bd();if(b.J())return this.U(0,c,b.by-c);var g=b.by;if(!b.Z(b.E.substr(c,e)))
|
||||
return this.U(0,c,b.by-c);var h=b.by+e;while(ad(b.F(-1)))b.a5(-1);var j=this.U(7,g,b.by-g);b.by=h;return j};a.U=function
|
||||
(g,e,c){if(this.bG.length!=0){var b=this.bG.pop();b.type=g;b.startOffset=e;b.length=c;b.X=null;return b}else return new
|
||||
ax(g,e,c)};a.O=function(e,c){if(this.bG.length!=0){var b=this.bG.pop();b.type=e;b.X=c;return b}else{var b=new ax(e,0,0);
|
||||
b.X=c;return b}};a.ak=function(b){b.X=null;this.bG.push(b)};function B(){}a=B.prototype;a.E=null;a.v=0;a.R=0;a.N=0;a.ay=
|
||||
0;a.aA=0;a.C=null;a.X=null;a.an=function(){if(this.E==null)return null;if(this.R==-1)return this.E;return this.E.substr(
|
||||
this.R,this.N)};a.al=function(){var c=new F();for(var b=0;b<this.C.length;b++){c.x(this.C[b].an());c.x("\n")}return c.bh
|
||||
()};a.aN=function(e,c){for(var b=0;b<this.C.length;b++)this.C[b].l(e,c)};a.aX=function(e){if(this.X!=null)return this.X;
|
||||
var c=at(this.E,this.R,this.ao()),b=null;if(c!=null){this.a3(c.end);b=c.id}else b=e.aC(this.E,this.R,this.N);this.X=b;
|
||||
return b};a.l=function(c,b){switch(this.v){case 0:return;case 12:c.bz.ah(b,this.E,this.R,this.N);break;case 17:c.bz.ae(b
|
||||
,this.E,this.R,this.N);b.x("\n");break;case 1:case 2:case 3:case 4:case 5:case 6:if(c.ExtraMode&&!c.SafeMode){b.x("<h"+(
|
||||
this.v-1+1).toString());var k=this.aX(c);if(k){b.x(' id="');b.x(k);b.x('">')}else b.x(">")}else b.x("<h"+(this.v-1+1).
|
||||
toString()+">");c.bz.ae(b,this.E,this.R,this.N);b.x("</h"+(this.v-1+1).toString()+">\n");break;case 14:b.x("<hr />\n");
|
||||
return;case 10:case 11:b.x("<li>");c.bz.ae(b,this.E,this.R,this.N);b.x("</li>\n");break;case 15:b.x(this.E.substr(this.R
|
||||
,this.N));return;case 16:b.au(this.E,this.R,this.N);return;case 18:b.x("<pre");if(c.FormatCodeBlockAttributes!=null)b.x(
|
||||
c.FormatCodeBlockAttributes(this.X));b.x("><code>");var h=b;if(c.FormatCodeBlock){h=b;b=new F()}for(var e=0;e<this.C.
|
||||
length;e++){var j=this.C[e];b.av(j.E,j.R,j.N);b.x("\n")}if(c.FormatCodeBlock){h.x(c.FormatCodeBlock(b.bh(),this.X));b=h}
|
||||
b.x("</code></pre>\n\n");return;case 9:b.x("<blockquote>\n");this.aN(c,b);b.x("</blockquote>\n");return;case 19:b.x(
|
||||
"<li>\n");this.aN(c,b);b.x("</li>\n");return;case 20:b.x("<ol>\n");this.aN(c,b);b.x("</ol>\n");return;case 21:b.x(
|
||||
"<ul>\n");this.aN(c,b);b.x("</ul>\n");return;case 22:var g=this.X,n=g.name.toLowerCase();if(n=="a")c.OnPrepareLink(g);
|
||||
else if(n=="img")c.OnPrepareImage(g,c.RenderingTitledImage);g.aS(b);b.x("\n");this.aN(c,b);g.aO(b);b.x("\n");return;case
|
||||
23:case 28:this.aN(c,b);return;case 24:this.X.l(c,b);return;case 25:b.x("<dd>");if(this.C!=null){b.x("\n");this.aN(c,b)
|
||||
}else c.bz.ae(b,this.E,this.R,this.N);b.x("</dd>\n");break;case 26:if(this.C==null){var m=this.an().split("\n");for(var
|
||||
e=0;e<m.length;e++){var o=m[e];b.x("<dt>");c.bz.af(b,ay(o));b.x("</dt>\n")}}else{b.x("<dt>\n");this.aN(c,b);b.x(
|
||||
"</dt>\n")}break;case 27:b.x("<dl>\n");this.aN(c,b);b.x("</dl>\n");return;case 29:b.x("<p>");if(this.N>0){c.bz.ae(b,this
|
||||
.E,this.R,this.N);b.x(" ")}b.x(this.X);b.x("</p>\n");break}};a.aY=function(){this.v=12;this.R=this.ay;this.N=this.
|
||||
aA};a.ao=function(){return this.R+this.N};a.a3=function(b){this.N=b-this.R};a.aq=function(){var c=0;for(var b=this.ay;b<
|
||||
this.ay+this.aA;b++)if(this.E.charAt(b)==" ")c++;else break;return c};a.V=function(b){this.v=b.v;this.E=b.E;this.R=b.R;
|
||||
this.N=b.N;this.ay=b.ay;this.aA=b.aA;return this};function D(b,c){this.bw=b;this.bx=0;this.bo=c}a=D.prototype;a.aH=
|
||||
function(c){var b=new G(c);return this.a1(b)};a.aL=function(g,e,b){var c=new G(g,e,b);return this.a1(c)};a.bi=function(b
|
||||
,c,e){if(e.length>1)return false;if(e.length==1){var g=b.by;b.by=e[0].ay;c.bu=c.aG(b);if(c.bu==null)return false;b.by=g;
|
||||
e.length=0}while(true){var g=b.by,h=c.aG(b);if(h!=null){c.bA.push(h);continue}b.by=g;break}return true};a.a1=function(j)
|
||||
{var e=[],c=[],k=-1;while(!j.J()){var m=k==0,b=this.ab(j);k=b.v;if(b.v==25)b.X=m;if(b.v==7||b.v==8){if(c.length>0){var g
|
||||
=c.pop();this.S(e,c);if(g.v!=0){g.aY();g.v=b.v==7?1:2;e.push(g);continue}}if(b.v==7){b.aY();c.push(b)}else if(b.N>=3){b.
|
||||
v=14;e.push(b)}else{b.aY();c.push(b)}continue}var h=c.length>0?c[0].v:0;if(b.v==24){var o=b.X,n=j.by;if(!this.bi(j,o,c))
|
||||
{j.by=n;b.aY()}else{e.push(b);continue}}switch(b.v){case 0:switch(h){case 0:this.ai(b);break;case 12:this.S(e,c);this.ai
|
||||
(b);break;case 9:case 10:case 11:case 25:case 28:case 13:c.push(b);break}break;case 12:switch(h){case 0:case 12:c.push(b
|
||||
);break;case 9:case 10:case 11:case 25:case 28:var g=c[c.length-1];if(g.v==0){this.S(e,c);c.push(b)}else c.push(b);break
|
||||
;case 13:this.S(e,c);c.push(b);break}break;case 13:switch(h){case 0:c.push(b);break;case 12:case 9:var g=c[c.length-1];
|
||||
if(g.v==0){this.S(e,c);c.push(b)}else{b.aY();c.push(b)}break;case 10:case 11:case 13:case 25:case 28:c.push(b);break}
|
||||
break;case 9:if(h!=9)this.S(e,c);c.push(b);break;case 10:case 11:switch(h){case 0:c.push(b);break;case 12:case 9:var g=c
|
||||
[c.length-1];if(g.v==0||this.bx==10||this.bx==11||this.bx==25){this.S(e,c);c.push(b)}else{b.aY();c.push(b)}break;case 10
|
||||
:case 11:if(b.v!=10&&b.v!=11)this.S(e,c);c.push(b);break;case 25:case 28:if(b.v!=h)this.S(e,c);c.push(b);break;case 13:
|
||||
this.S(e,c);c.push(b);break}break;case 25:case 28:switch(h){case 0:case 12:case 25:case 28:this.S(e,c);c.push(b);break;
|
||||
default:b.aY();c.push(b);break}break;default:this.S(e,c);e.push(b);break}}this.S(e,c);if(this.bw.ExtraMode)this.I(e);
|
||||
return e};a.T=function(c){var b;if(this.bw.bC.length>1)b=this.bw.bC.pop();else b=new B();b.ay=c;return b};a.ai=function(
|
||||
b){this.bw.bC.push(b)};a.aj=function(b){for(var c=0;c<b.length;c++)this.bw.bC.push(b[c]);b.length=0};a.aQ=function(g){
|
||||
var b=this.bw.as();for(var c=0;c<g.length;c++){var e=g[c];b.x(e.E.substr(e.R,e.N));b.x("\n")}return b.bh()};a.S=function
|
||||
(c,b){while(b.length>0&&b[b.length-1].v==0)this.ai(b.pop());if(b.length==0)return;switch(b[0].v){case 12:var h=this.T(b[
|
||||
0].ay);h.v=12;h.E=b[0].E;h.R=b[0].R;h.a3(b[b.length-1].ao());c.push(h);this.aj(b);break;case 9:var p=this.aQ(b),o=new D(
|
||||
this.bw,this.bo);o.bx=9;var n=this.T(b[0].ay);n.v=9;n.C=o.aH(p);this.aj(b);c.push(n);break;case 10:case 11:c.push(this.M
|
||||
(b));break;case 25:if(c.length>0){var j=c[c.length-1];switch(j.v){case 12:j.v=26;break;case 25:break;default:var k=this.
|
||||
T(j.ay);k.v=26;k.C=[];k.C.push(j);c.pop();c.push(k);break}}c.push(this.G(b));break;case 28:this.bw.z(this.L(b));break;
|
||||
case 13:var e=this.T(b[0].ay);e.v=18;e.C=[];var g=b[0].an();if(g.substr(0,2)=="{{"&&g.substr(g.length-2,2)=="}}"){e.X=g.
|
||||
substr(2,g.length-4);b.splice(0,1)}for(var m=0;m<b.length;m++)e.C.push(b[m]);c.push(e);b.length=0;break}};a.ab=function(
|
||||
c){var b=this.T(c.by);b.E=c.E;b.R=c.by;b.N=-1;b.v=this.ac(c,b);if(b.N<0){c.bb();b.N=c.by-b.R}b.aA=c.by-b.ay;c.aZ();
|
||||
return b};a.ac=function(b,c){if(b.Y())return 0;var h=b.by,e=b.H();if(e=="#"){var j=1;b.a5(1);while(b.H()=="#"){j++;b.a5(
|
||||
1)}if(j>6)j=6;b.a8();c.R=b.by;b.bb();if(this.bw.ExtraMode&&!this.bw.SafeMode){var m=at(b.E,c.R,b.by);if(m!=null){c.X=m.
|
||||
id;b.by=m.end}}while(b.by>c.R&&b.F(-1)=="#")b.a5(-1);while(b.by>c.R&&ad(b.F(-1)))b.a5(-1);c.N=b.by-c.R;b.bb();return 1+j
|
||||
-1}if(e=="-"||e=="="){var k=e;while(b.H()==k)b.a5(1);b.a8();if(b.Y())return k=="="?7:8;b.by=h}if(this.bw.ExtraMode){var
|
||||
s=av(b);if(s!=null){c.X=s;return 24}b.by=h;if(e=="~"){if(this.aJ(b,c))return c.v;b.by=h}}var g=-1,r=0;while(!b.Y()){if(b
|
||||
.H()==" "){if(g<0)r++}else if(b.H()=="\t"){if(g<0)g=b.by}else break;b.a5(1)}if(b.Y()){c.N=0;return 0}if(r>=4){c.R=h+4;
|
||||
return 13}if(g>=0&&g-h<4){c.R=g+1;return 13}c.R=b.by;e=b.H();if(e=="<"){if(this.a0(b,c))return c.v;b.by=c.R}if(e==">"){
|
||||
if(ab(b.F(1))){b.a5(2);c.R=b.by;return 9}b.a5(1);c.R=b.by;return 9}if(e=="-"||e=="_"||e=="*"){var o=0;while(!b.Y()){var
|
||||
k=b.H();if(b.H()==e){o++;b.a5(1);continue}if(ab(b.H())){b.a5(1);continue}break}if(b.Y()&&o>=3)return 14;b.by=c.R}if(this
|
||||
.bw.ExtraMode&&e=="*"&&b.F(1)=="["){b.a5(2);b.a8();b.az();while(!b.Y()&&b.H()!="]")b.a5(1);var n=ay(b.W());if(b.H()=="]"
|
||||
&&b.F(1)==":"&&n){b.a5(2);b.a8();b.az();b.bb();var v=b.W();this.bw.y(n,v);return 0}b.by=c.R}if((e=="*"||e=="+"||e=="-")
|
||||
&&ab(b.F(1))){b.a5(1);b.a8();c.R=b.by;return 11}if(e==":"&&this.bw.ExtraMode&&ab(b.F(1))){b.a5(1);b.a8();c.R=b.by;
|
||||
return 25}if(X(e)){b.a5(1);while(X(b.H()))b.a5(1);if(b.aW(".")&&b.a8()){c.R=b.by;return 10}b.by=c.R}if(e=="["){if(this.
|
||||
bw.ExtraMode&&b.F(1)=="^"){var t=b.by;b.a5(2);var p=b.a4();if(p!=null&&b.aW("]")&&b.aW(":")){b.a8();c.R=b.by;c.X=p;
|
||||
return 28}b.by=t}var q=an(b,this.bw.ExtraMode);if(q!=null){this.bw.A(q);return 0}}return 12};a.ar=function(c){var b=c.
|
||||
attributes.markdown;if(b==undefined)if(this.bo)return 3;else return 0;delete c.attributes.markdown;if(b=="1")return(c.ap
|
||||
()&8)!=0?2:1;if(b=="block")return 1;if(b=="deep")return 3;if(b=="span")return 2;return 4};a.aK=function(b,e,o,m){var g=b
|
||||
.by,k=1,j=false;while(!b.J()){if(!b.Z("<"))break;var n=b.by,h=ag(b);if(h==null){b.a5(1);continue}if(this.bw.SafeMode&&m
|
||||
==4&&!j)if(!h.at())j=true;if(h.closed)continue;if(h.name==o.name)if(h.closing){k--;if(k==0){b.a8();b.aZ();e.v=22;e.X=o;e
|
||||
.a3(b.by);switch(m){case 2:var c=this.T(g);c.E=b.E;c.v=17;c.R=g;c.N=n-g;e.C=[];e.C.push(c);break;case 1:case 3:var p=new
|
||||
D(this.bw,m==3);e.C=p.aL(b.E,g,n-g);break;case 4:if(j){e.v=16;e.a3(b.by)}else{var c=this.T(g);c.E=b.E;c.v=15;c.R=g;c.N=
|
||||
n-g;e.C=[];e.C.push(c)}break}return true}}else k++}return false};a.a0=function(b,c){var g=b.by,h=ag(b);if(h==null)
|
||||
return false;if(h.closing)return false;var m=false;if(this.bw.SafeMode&&!h.at())m=true;var q=h.ap();if((q&1)==0)
|
||||
return false;if((q&4)!=0||h.closed){b.a8();b.aZ();c.N=b.by-c.R;c.v=m?16:15;return true}if((q&2)!=0){b.a8();if(!b.Y())
|
||||
return false}var o=this.bw.ExtractHeadBlocks&&h.name.toLowerCase()=="head",t=b.by;if(!o&&this.bw.ExtraMode){var n=this.
|
||||
ar(h);if(n!=0)return this.aK(b,c,h,n)}var k=null,p=1;while(!b.J()){if(!b.Z("<"))break;var s=b.by,j=ag(b);if(j==null){b.
|
||||
a5(1);continue}if(this.bw.SafeMode&&!j.at())m=true;if(j.closed)continue;if(!o&&!j.closing&&this.bw.ExtraMode&&!m){var n=
|
||||
this.ar(j);if(n!=0){var r=this.T(g);if(this.aK(b,r,j,n)){if(k==null)k=[];if(s>g){var e=this.T(g);e.E=b.E;e.v=15;e.R=g;e.
|
||||
N=s-g;k.push(e)}k.push(r);g=b.by;continue}else this.ai(r)}}if(j.name==h.name&&!j.closed)if(j.closing){p--;if(p==0){b.a8(
|
||||
);b.aZ();if(m){c.v=16;c.a3(b.by);return true}if(k!=null){if(b.by>g){var e=this.T(g);e.E=b.E;e.v=15;e.R=g;e.N=b.by-g;k.
|
||||
push(e)}c.v=23;c.a3(b.by);c.C=k;return true}if(o){var v=b.E.substr(t,s-t);this.bw.HeadBlockContent=this.bw.
|
||||
HeadBlockContent+ay(v)+"\n";c.v=15;c.R=b.bK;c.contentEnd=b.bK;c.ay=b.bK;return true}c.v=15;c.N=b.by-c.R;return true}}
|
||||
else p++}return 0};a.M=function(b){var r=b[0].v,t=b[0].aq();for(var c=1;c<b.length;c++){if(b[c].v==12&&(b[c-1].v==12||b[
|
||||
c-1].v==11||b[c-1].v==10)){b[c-1].a3(b[c].ao());this.ai(b[c]);b.splice(c,1);c--;continue}if(b[c].v!=13&&b[c].v!=0){var s
|
||||
=b[c].aq();if(s>t){b[c].v=13;var v=b[c].ao();b[c].R=b[c].ay+s;b[c].a3(v)}}}var h=this.T(0);h.v=r==11?21:20;h.C=[];for(
|
||||
var c=0;c<b.length;c++){var k=c;while(k>0&&b[k-1].v==0)k--;var g=c;while(g<b.length-1&&b[g+1].v!=11&&b[g+1].v!=10)g++;
|
||||
if(k==g)h.C.push(this.T().V(b[c]));else{var o=false,n=this.bw.as();for(var e=k;e<=g;e++){var m=b[e];n.x(m.E.substr(m.R,m
|
||||
.N));n.x("\n");if(b[e].v==0)o=true}var j=this.T();j.v=19;j.ay=b[k].ay;var p=new D(this.bw);p.bx=r;j.C=p.aH(n.bh());if(!o
|
||||
)for(var e=0;e<j.C.length;e++){var q=j.C[e];if(q.v==12)q.v=17}h.C.push(j)}c=g}h.ay=h.C[0].ay;this.aj(b);b.length=0;
|
||||
return h};a.G=function(b){for(var c=1;c<b.length;c++)if(b[c].v==12&&(b[c-1].v==12||b[c-1].v==25)){b[c-1].a3(b[c].ao());
|
||||
this.ai(b[c]);b.splice(c,1);c--;continue}var k=b[0].X;if(b.length==1&&!k){var m=b[0];b.length=0;return m}var h=this.bw.
|
||||
as();for(var c=0;c<b.length;c++){var g=b[c];h.x(g.E.substr(g.R,g.N));h.x("\n")}var e=this.T(b[0].ay);e.v=25;var j=new D(
|
||||
this.bw);j.bx=25;e.C=j.aH(h.bh());this.aj(b);b.length=0;return e};a.I=function(e){var c=null;for(var b=0;b<e.length;b++)
|
||||
switch(e[b].v){case 26:case 25:if(c==null){c=this.T(e[b].ay);c.v=27;c.C=[];e.splice(b,0,c);b++}c.C.push(e[b]);e.splice(b
|
||||
,1);b--;break;default:c=null;break}};a.L=function(c){for(var b=1;b<c.length;b++)if(c[b].v==12&&(c[b-1].v==12||c[b-1].v==
|
||||
28)){c[b-1].a3(c[b].ao());this.ai(c[b]);c.splice(b,1);b--;continue}var h=this.bw.as();for(var b=0;b<c.length;b++){var g=
|
||||
c[b];h.x(g.E.substr(g.R,g.N));h.x("\n")}var j=new D(this.bw);j.bx=28;var e=this.T(c[0].ay);e.v=28;e.X=c[0].X;e.C=j.aH(h.
|
||||
bh());this.aj(c);c.length=0;return e};a.aJ=function(b,e){var k=b.by;b.az();while(b.H()=="~")b.a5(1);var g=b.W();if(g.
|
||||
length<3)return false;b.a8();if(!b.Y())return false;b.aZ();var j=b.by;if(!b.Z(g))return false;if(!Y(b.F(-1)))
|
||||
return false;var h=b.by;b.a5(g.length);b.a8();if(!b.Y())return false;e.v=18;e.C=[];h--;var c=this.T(k);c.v=13;c.E=b.E;c.
|
||||
R=j;c.N=h-j;e.C.push(c);return true};function H(){this.bp=[];this.bu=null;this.bA=[]}a=H.prototype;a.ax=false;a.bk=false
|
||||
;a.aG=function(b){b.a8();if(b.Y())return null;var e=this.ax;if(this.ax&&!b.aW("|")){e=true;return null}var c=[];while(!b
|
||||
.Y()){b.az();while(!b.Y()&&b.H()!="|")b.a5(1);c.push(ay(b.W()));e|=b.aW("|")}if(!e)return null;while(c.length<this.bp.
|
||||
length)c.push(" ");b.aZ();return c};a.aT=function(h,b,e,g){for(var c=0;c<e.length;c++){b.x("\t<");b.x(g);if(c<this.
|
||||
bp.length)switch(this.bp[c]){case 1:b.x(' align="left"');break;case 2:b.x(' align="right"');break;case 3:b.x(
|
||||
' align="center"');break}b.x(">");h.bz.af(b,e[c]);b.x("</");b.x(g);b.x(">\n")}};a.l=function(e,b){b.x("<table>\n");if(
|
||||
this.bu!=null){b.x("<thead>\n<tr>\n");this.aT(e,b,this.bu,"th");b.x("</tr>\n</thead>\n")}b.x("<tbody>\n");for(var c=0;c<
|
||||
this.bA.length;c++){var g=this.bA[c];b.x("<tr>\n");this.aT(e,b,g,"td");b.x("</tr>\n")}b.x("</tbody>\n");b.x("</table>\n"
|
||||
)};function av(b){b.a8();if(b.H()!="|"&&b.H()!=":"&&b.H()!="-")return null;var c=null;if(b.aW("|")){c=new H();c.ax=true}
|
||||
while(true){b.a8();if(b.H()=="|")return null;var g=b.aW(":");while(b.H()=="-")b.a5(1);var h=b.aW(":");b.a8();var e=0;if(
|
||||
g&&h)e=3;else if(g)e=1;else if(h)e=2;if(b.Y()){if(c==null)return null;c.bp.push(e);return c}if(!b.aW("|"))return null;
|
||||
if(c==null)c=new H();c.bp.push(e);b.a8();if(b.Y()){c.bk=true;return c}}}this.Markdown=i;this.HtmlTag=w})();
|
||||
// MarkdownDeep - http://www.toptensoftware.com/markdowndeep
|
||||
// Copyright (C) 2010-2011 Topten Software
|
||||
var MarkdownDeepEditor=new(function(){var q=false,w={Z:"undo",Y:"redo",B:"bold",I:"italic",H:"heading",K:"code",U:
|
||||
"ullist",O:"ollist",Q:"indent",E:"outdent",L:"link",G:"img",R:"hr","0":"h0","1":"h1","2":"h2","3":"h3","4":"h4","5":"h5"
|
||||
,"6":"h6"};function A(d,b){return d.substr(0,b.length)==b}function t(d,b){return d.substr(-b.length)==b}function v(b){
|
||||
return b==" "||b=="\t"||b=="\r"||b=="\n"}function x(b){return b=="\r"||b=="\n"}function y(e){var b=0,d=e.length;while(b<
|
||||
d&&v(e.charAt(b)))b++;while(d-1>b&&v(e.charAt(d-1)))d--;return e.substr(b,d-b)}function s(b,d,e){if(b.addEventListener)b
|
||||
.addEventListener(d,e,false);else if(b.attachEvent)b.attachEvent("on"+d,e)}function B(b,d,e){if(b.removeEventListener)b.
|
||||
removeEventListener(d,e,false);else if(b.detachEvent)b.detachEvent("on"+d,e)}function u(b){if(b.preventDefault)b.
|
||||
preventDefault();if(b.cancelBubble!==undefined){b.cancelBubble=true;b.keyCode=0;b.returnValue=false}return false}
|
||||
function z(d,b){return b-d.value.slice(0,b).split("\r\n").length+1}function p(){}a=p.prototype;a.D=function(b){this.aa=b
|
||||
;if(q){var d=document.selection.createRange(),f=d.duplicate();f.moveToElementText(b);var e=-f.moveStart("character",-
|
||||
10000000);this.Z=-d.moveStart("character",-10000000)-e;this.Y=-d.moveEnd("character",-10000000)-e;this.ad=b.value.
|
||||
replace(/\r\n/gm,"\n")}else{this.Z=b.selectionStart;this.Y=b.selectionEnd;this.ad=b.value}};a.u=function(){var b=new p()
|
||||
;b.aa=this.aa;b.Y=this.Y;b.Z=this.Z;b.ad=this.ad;return b};a.m=function(){if(q){this.aa.value=this.ad;this.aa.focus();
|
||||
var b=this.aa.createTextRange();b.collapse(true);b.moveEnd("character",this.Y);b.moveStart("character",this.Z);b.select(
|
||||
)}else{var d=this.aa.scrollTop;this.aa.value=this.ad;this.aa.focus();this.aa.setSelectionRange(this.Z,this.Y);this.aa.
|
||||
scrollTop=d}};a.J=function(b){this.ad=this.ad.substr(0,this.Z)+b+this.ad.substr(this.Y);this.Y=this.Z+b.length};function
|
||||
r(b,d,e,f){if(b<d)return b;return b<d+e?d:b+f-e}a.I=function(b,d,e){this.ad=this.ad.substr(0,b)+e+this.ad.substr(b+d);
|
||||
this.Z=r(this.Z,b,d,e.length);this.Y=r(this.Y,b,d,e.length)};a.t=function(){return this.ad.substr(this.Z,this.Y-this.Z)}
|
||||
;a.C=function(d,b){this.Y+=b;this.Z-=d};a.G=function(b){return this.Z>=b.length&&this.ad.substr(this.Z-b.length,b.length
|
||||
)==b};a.s=function(b){return this.ad.substr(this.Y,b.length)==b};a.U=function(){while(v(this.ad.charAt(this.Z)))this.Z++
|
||||
;while(this.Y>this.Z&&v(this.ad.charAt(this.Y-1)))this.Y--};a.E=function(b){return b==0||x(this.ad.charAt(b-1))};a.p=
|
||||
function(b){while(b>0&&!x(this.ad.charAt(b-1)))b--;return b};a.r=function(b){while(b<this.ad.length&&!x(this.ad.charAt(b
|
||||
)))b++;return b};a.w=function(b){return this.P(this.r(b))};a.T=function(b){while(b<this.ad.length&&v(this.ad.charAt(b)))
|
||||
b++;return b};a.P=function(b){if(this.ad.substr(b,2)=="\r\n")return b+2;if(x(this.ad.charAt(b)))return b+1;return b};a.R
|
||||
=function(b){if(b>2&&this.ad.substr(b-2,2)=="\r\n")return b-2;if(b>1&&x(this.ad.charAt(b-1)))return b-1;return b};a.M=
|
||||
function(){this.Z=this.p(this.Z);if(!this.E(this.Y))this.Y=this.P(this.r(this.Y))};a.S=function(b){while(b>0&&v(this.ad.
|
||||
charAt(b-1)))b--;return b};a.Q=function(b){while(v(this.ad.charAt(b)))b++;return b};a.L=function(){this.Z=this.S(this.Z)
|
||||
;this.Y=this.Q(this.Y)};a.o=function(){var d=this.t(),b=d.match(/\n[ \t\r]*\n/);if(b){alert(
|
||||
"Please make a selection that doesn't include a paragraph break");return false}return true};a.B=function(f){var e=this.
|
||||
ad.length;for(var b=f;b<e;b++){var d=this.ad[b];if(x(d))return true;if(!v(this.ad.charAt(b)))return false}return true};a
|
||||
.y=function(b){var e=b;b=this.p(b);if(this.B(b))return b;while(b>0){var d=this.p(this.R(b));if(d==0)break;if(this.B(d))
|
||||
break;b=d}if(this.q(b).af!=0){b=this.p(e);while(b>0){if(this.q(b).af!=0)return b;b=this.p(this.R(b))}}return b};a.v=
|
||||
function(b){while(b<this.ad.length){if(this.B(b))break;b=this.w(b)}return b};a.K=function(){this.Z=this.y(this.Z);this.Y
|
||||
=this.v(this.Z)};a.q=function(d){var e=this.ad.substr(d,10),b=e.match(/^\s{0,3}(\*|\d+\.)(?:\ |\t)*/);if(!b)return{ab:""
|
||||
,af:0};if(b[1]=="*")return{ab:"*",af:b[0].length};else return{ab:"1",af:b[0].length}};function l(b,e){if(!b.
|
||||
setSelectionRange)q=true;this.X=null;this.ag=[];this.ae=0;this.ac=3;this.Markdown=new MarkdownDeep.Markdown();this.
|
||||
Markdown.SafeMode=false;this.Markdown.ExtraMode=true;this.Markdown.NewWindowForLocalLinks=true;this.Markdown.
|
||||
NewWindowForExternalLinks=true;this.aa=b;this.W=e;var f=this;s(b,"keyup",function(){f.H()});s(b,"keydown",function(d){
|
||||
return f.F(d)});s(b,"paste",function(){f.H()});s(b,"input",function(){f.H()});s(b,"mousedown",function(){f.O(3)});this.H
|
||||
()}var a=l.prototype,c=l.prototype;a.F=function(b){var d=null,f=true;if(b.ctrlKey||b.metaKey){var e=String.fromCharCode(
|
||||
b.charCode||b.keyCode);if(!this.disableShortCutKeys&&w[e]!=undefined){this.InvokeCommand(w[e]);return u(b)}switch(e){
|
||||
case"V":d=1;break;case"X":d=2;break}}else switch(b.keyCode){case 9:if(!this.disableTabHandling){this.InvokeCommand(b.
|
||||
shiftKey?"untab":"tab");return u(b)}else d=1;break;case 37:case 39:case 38:case 40:case 36:case 35:case 33:case 34:d=3;
|
||||
break;case 8:case 46:d=2;break;case 13:d=4;break;default:d=1}if(d!=null)this.O(d);if(!this.disableAutoIndent)if(b.
|
||||
keyCode==13&&(!q||b.ctrlKey))this.IndentNewLine()};a.O=function(b){if(this.ac==b)return;this.ac=b;this.n()};a.n=function
|
||||
(){var b=new p();b.D(this.aa);this.ag.splice(this.ae,this.ag.length-this.ae,b);this.ae=this.ag.length};a.H=function(e){
|
||||
var b=this.aa.value;if(b===this.X&&this.X!==null)return;if(this.onPreTransform)this.onPreTransform(this,b);var d=this.
|
||||
Markdown.Transform(b);if(this.onPostTransform)this.onPostTransform(this,d);if(this.W)this.W.innerHTML=d;if(this.
|
||||
onPostUpdateDom)this.onPostUpdateDom(this);this.X=b};c.onOptionsChanged=function(){this.X=null;this.H()};c.cmd_undo=
|
||||
function(){if(this.ae>0){if(this.ae==this.ag.length){this.n();this.ae--}this.ae--;this.ag[this.ae].m();this.ac=0;this.H(
|
||||
)}};c.cmd_redo=function(){if(this.ae+1<this.ag.length){this.ae++;this.ag[this.ae].m();this.ac=0;this.H();if(this.ae==
|
||||
this.ag.length-1)this.ag.pop()}};a.N=function(d,f){d.K();d.L();var b=d.t();b=y(b);var g=0,e=b.match(/^(\#+)(.*?)(\#+)?$/
|
||||
);if(e){b=y(e[2]);g=e[1].length}else{e=b.match(/^(.*?)(?:\r\n|\n|\r)\s*(\-*|\=*)$/);if(e){b=y(e[1]);g=e[2].charAt(0)==
|
||||
"="?1:0}else{b=b.replace(/(\r\n|\n|\r)/gm,"");g=0}}if(f==-1)f=(g+1)%4;var h=0,j=0;if(f==0){if(b=="Heading"){d.J("");
|
||||
return true}j=b.length;h=0}else{if(b=="")b="Heading";h=f+1;j=b.length;var i="";for(var k=0;k<f;k++)i+="#";b=i+" "+b+" "+
|
||||
i}b+="\n\n";if(d.Z!=0){b="\n\n"+b;h+=2}d.J(b);d.Z+=h;d.Y=d.Z+j;return true};c.cmd_heading=function(b){return this.N(b,-1
|
||||
)};c.cmd_h0=function(b){return this.N(b,0)};c.cmd_h1=function(b){return this.N(b,1)};c.cmd_h2=function(b){return this.N(
|
||||
b,2)};c.cmd_h3=function(b){return this.N(b,3)};c.cmd_h4=function(b){return this.N(b,4)};c.cmd_h5=function(b){return this
|
||||
.N(b,5)};c.cmd_h6=function(b){return this.N(b,6)};a.x=function(j,h){j.M();var d=j.t().split("\n");for(var b=0;b<d.length
|
||||
;b++)if(d[b].charAt(0)=="\t"){var f="",e=0;while(d[b].charAt(e)=="\t"){f+=" ";e++}var i=f+d[b].substr(e);d.splice(b,1
|
||||
,i)}if(h===null){var b;for(b=0;b<d.length;b++){if(y(d[b])=="")continue;if(d[b].charAt(0)=="\t"){var f="",e=0;while(d[b].
|
||||
charAt(e)=="\t"){f+=" ";e++}var i=f+d[b].substr(b);d.splice(b,1,i)}if(!A(d[b]," "))break}h=b!=d.length}for(var b=0
|
||||
;b<d.length;b++){if(y(d[b])=="")continue;var g=d[b];if(h)g=" "+d[b];else if(A(d[b],"\t"))g=d[b].substr(1);else if(A(d
|
||||
[b]," "))g=d[b].substr(4);d.splice(b,1,g)}j.J(d.join("\n"))};c.cmd_code=function(b){if(b.Z==b.Y){var d=b.p(b.Z);if(b.
|
||||
B(d)){b.L();b.J("\n\n Code\n\n");b.Z+=6;b.Y=b.Z+4;return true}}if(b.t().indexOf("\n")<0){b.U();if(b.G("`"))b.Z--;if(b
|
||||
.s("`"))b.Y++;return this.k(b,"`")}this.x(b,null);return true};c.cmd_tab=function(b){if(b.t().indexOf("\n")>0)this.x(b,
|
||||
true);else{var e=b.p(b.Z),d;for(d=e;d<b.Z;d++)if(b.ad.charAt(d)!=" ")break;if(d==b.Z){var f=4-(d-e)%4;b.J(" ".substr(
|
||||
0,f))}else b.J("\t");b.Z=b.Y}return true};c.cmd_untab=function(b){if(b.t().indexOf("\n")>0){this.x(b,false);return true}
|
||||
return false};a.k=function(d,e){var g=d.ad,f=e.length,b=d.t();if(A(b,e)&&t(b,e))d.J(b.substr(f,b.length-f*2));else{d.U()
|
||||
;b=d.t();if(!b)b="text";else b=b.replace(/(\r\n|\n|\r)/gm,"");d.J(e+b+e);d.C(-f,-f)}return true};c.cmd_bold=function(b){
|
||||
if(!b.o())return false;b.U();if(b.G("**"))b.Z-=2;if(b.s("**"))b.Y+=2;return this.k(b,"**")};c.cmd_italic=function(b){if(
|
||||
!b.o())return false;b.U();if(b.G("*")&&!b.G("**")||b.G("***"))b.Z-=1;if(b.s("*")&&!b.G("**")||b.s("***"))b.Y+=1;
|
||||
return this.k(b,"*")};a.A=function(b,g){if(false&&b.Z==b.Y){b.L();b.J("\n\n> Quote\n\n");b.Z+=4;b.Y=b.Z+5;return true}b.
|
||||
M();var e=b.t().split("\n");for(var d=0;d<e.length-1;d++){var f=e[d];if(g){if(A(e[d],"> "))f=e[d].substr(2)}else f="> "+
|
||||
e[d];e.splice(d,1,f)}b.J(e.join("\n"));return true};c.cmd_indent=function(b){return this.A(b,false)};c.cmd_outdent=
|
||||
function(b){return this.A(b,true)};a.z=function(b,o){var g=[];if(b.t().indexOf("\n")>0){b.M();var f=b.Z;g.push(f);while(
|
||||
true){f=b.w(f);if(f>=b.Y)break;g.push(f)}}else g.push(b.p(b.Z));var n=o=="*"?"* ":"1. ";for(var d=0;d<g.length;d++){var
|
||||
h=b.q(g[d]);if(h.ab==o){n="";break}}for(var d=g.length-1;d>=0;d--){var f=g[d],h=b.q(f);b.I(f,h.af,n)}var j=new
|
||||
MarkdownDeep.Markdown();j.ExtraMode=true;var e=j.GetListItems(b.ad,b.Z);while(e!=null){var i=0;for(var d=0;d<e.length-1;
|
||||
d++){var h=b.q(e[d]+i);if(h.ab!="1")break;var m=(d+1).toString()+". ";b.I(e[d]+i,h.af,m);i+=m.length-h.af}var k=j.
|
||||
GetListItems(b.ad,e[e.length-1]+i);if(k!=null&&k[0]!=e[0])e=k;else e=null}if(g.length>1)b.M();return true};c.cmd_ullist=
|
||||
function(b){return this.z(b,"*")};c.cmd_ollist=function(b){return this.z(b,"1")};c.cmd_link=function(b){b.U();if(!b.o())
|
||||
return false;var e=prompt("Enter the target URL:");if(e===null)return false;var d=b.t();if(d.length==0)d="link text";var
|
||||
f="["+d+"]("+e+")";b.J(f);b.Z++;b.Y=b.Z+d.length;return true};c.cmd_img=function(b){b.U();if(!b.o())return false;var e=
|
||||
prompt("Enter the image URL");if(e===null)return false;var d=b.t();if(d.length==0)d="Image Text";var f=""
|
||||
;b.J(f);b.Z+=2;b.Y=b.Z+d.length;return true};c.cmd_hr=function(b){b.L();if(b.Z==0)b.J("----------\n\n");else b.J(
|
||||
"\n\n----------\n\n");b.Z=b.Y;return true};c.IndentNewLine=function(){var i=this,g,h=function(){window.clearInterval(g);
|
||||
var b=new p();b.D(i.aa);var e=b.p(b.R(b.Z)),d=e;while(true){var f=b.ad.charAt(d);if(f!=" "&&f!="\t")break;d++}if(d>e){b.
|
||||
J(b.ad.substr(e,d-e));b.Z=b.Y}b.m()};g=window.setInterval(h,1);return false};c.cmd_indented_newline=function(b){b.J("\n"
|
||||
);b.Z=b.Y;var e=b.p(b.R(b.Z)),d=e;while(true){var f=b.ad.charAt(d);if(f!=" "&&f!="\t")break;d++}if(d>e){b.J(b.ad.substr(
|
||||
e,d-e));b.Z=b.Y}return true};c.InvokeCommand=function(b){if(b=="undo"||b=="redo"){this["cmd_"+b]();this.aa.focus();
|
||||
return}var d=new p();d.D(this.aa);var e=d.u();if(this["cmd_"+b](d)){this.ac=0;this.ag.splice(this.ae,this.ag.length-this
|
||||
.ae,e);this.ae++;d.m();this.H();return true}else{this.aa.focus();return false}};delete a;delete c;this.Editor=l})();
|
||||
// MarkdownDeep - http://www.toptensoftware.com/markdowndeep
|
||||
// Copyright (C) 2010-2011 Topten Software
|
||||
var MarkdownDeepEditorUI=new(function(){this.HelpHtmlWritten=false;this.HelpHtml=function(b){var a="";a+=
|
||||
'<div class="mdd_modal" id="mdd_syntax_container" style="display:none">\n';a+='<div class="mdd_modal_frame">\n';a+=
|
||||
'<div class="mdd_modal_button">\n';a+='<a href="'+b+'" id="mdd_help_location" style="display:none"></a>\n';a+=
|
||||
'<a href="#" id="mdd_close_help">Close</a>\n';a+="</div>\n";a+='<div class="mdd_modal_content">\n';a+=
|
||||
'<div class="mdd_syntax" id="mdd_syntax">\n';a+='<div class="mdd_ajax_loader"></div>\n';a+="</div>\n";a+="</div>\n";a+=
|
||||
"</div>\n";a+="</div>\n";return a};this.ToolbarHtml=function(){var a="";a+='<div class="mdd_links">\n';a+=
|
||||
'<a href="#" class="mdd_help" tabindex=-1>How to Format</a>\n';a+="</div>\n";a+="<ul>\n";a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_undo" title="Undo (Ctrl+Z)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_redo" title="Redo (Ctrl+Y)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><span class="mdd_sep"></span></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_heading" title="Change Heading Style (Ctrl+H, or Ctrl+0 to Ctrl+6)" tabindex=-1></a></li>\n'
|
||||
;a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_code" title="Preformatted Code (Ctrl+K or Tab/Shift+Tab on multiline selection)" tabindex=-1></a></li>\n'
|
||||
;a+='<li><span class="mdd_sep"></span></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_bold" title="Bold (Ctrl+B)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_italic" title="Italic (Ctrl+I)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><span class="mdd_sep"></span></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_ullist" title="Bullets (Ctrl+U)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_ollist" title="Numbering (Ctrl+O)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_outdent" title="Unquote (Ctrl+W)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_indent" title="Quote (Ctrl+Q)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><span class="mdd_sep"></span></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_link" title="Insert Hyperlink (Ctrl+L)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_img" title="Insert Image (Ctrl+G)" tabindex=-1></a></li>\n';a+=
|
||||
'<li><a href="#" class="mdd_button" id="mdd_hr" title="Insert Horizontal Rule (Ctrl+R)" tabindex=-1></a></li>\n';a+=
|
||||
"</ul>\n";a+='<div style="clear:both"></div>\n';return a};this.onResizerMouseDown=function(a){var h=window.event?a.
|
||||
srcElement:a.target,f=$(h).closest(".mdd_resizer_wrap").prev(".mdd_editor_wrap").children("textarea")[0],l=a.clientY,k=$
|
||||
(f).height();$(document).bind("mousemove.mdd",e);$(document).bind("mouseup.mdd",g);return false;function g(b){$(document
|
||||
).unbind("mousemove.mdd");$(document).unbind("mouseup.mdd");return false}function e(c){var b=k+c.clientY-l;if(b<50)b=50;
|
||||
$(f).height(b);return false}};var j=0,i=false;this.onShowHelpPopup=function(){$("#mdd_syntax_container").fadeIn("fast");
|
||||
$(".modal_content").scrollTop(j);$(document).bind("keydown.mdd",function(k){if(k.keyCode==27){MarkdownDeepEditorUI.
|
||||
onCloseHelpPopup();return false}});if(!i){i=true;var a=$("#mdd_help_location").attr("href");if(!a)a="mdd_help.htm";$(
|
||||
"#mdd_syntax").load(a)}return false};this.onCloseHelpPopup=function(){j=$(".modal_content").scrollTop();$(
|
||||
"#mdd_syntax_container").fadeOut("fast");$(document).unbind("keydown.mdd");$(document).unbind("scroll.mdd");return false
|
||||
};this.onToolbarButton=function(a){var b=$(a.target).closest("div.mdd_toolbar_wrap").next(".mdd_editor_wrap").children(
|
||||
"textarea").data("mdd");b.InvokeCommand($(a.target).attr("id").substr(4));return false}})();(function(a){a.fn.
|
||||
MarkdownDeep=function(f){var h={resizebar:true,toolbar:true,help_location:"mdd_help.html"};if(f)a.extend(h,f);
|
||||
return this.each(function(){var d=a(this).parent(".mdd_editor_wrap");if(d.length==0)d=a(this).wrap(
|
||||
'<div class="mdd_editor_wrap" />').parent();if(h.toolbar){var k=d.prev(".mdd_toolbar_wrap"),c=d.prev(".mdd_toolbar");if(
|
||||
k.length==0){if(c.length==0){c=a('<div class="mdd_toolbar" />');c.insertBefore(d)}k=c.wrap(
|
||||
'<div class="mdd_toolbar_wrap" />').parent()}else if(c.length==0){c=a('<div class="mdd_toolbar" />');k.html(c)}c.append(
|
||||
a(MarkdownDeepEditorUI.ToolbarHtml()));a("a.mdd_button",c).click(MarkdownDeepEditorUI.onToolbarButton);a("a.mdd_help",c)
|
||||
.click(MarkdownDeepEditorUI.onShowHelpPopup);if(!MarkdownDeepEditorUI.HelpHtmlWritten){var l=a(MarkdownDeepEditorUI.
|
||||
HelpHtml(h.help_location));l.appendTo(a("body"));a("#mdd_close_help").click(MarkdownDeepEditorUI.onCloseHelpPopup);
|
||||
MarkdownDeepEditorUI.HelpHtmlWritten=true}}var b,e;if(h.resizebar){e=d.next(".mdd_resizer_wrap"),b=e.length==0?d.next(
|
||||
".mdd_resizer"):e.children(".mdd_resizer");if(e.length==0){if(b.length==0){b=a('<div class="mdd_resizer" />');b.
|
||||
insertAfter(d)}e=b.wrap('<div class="mdd_resizer_wrap" />').parent()}else if(b.length==0){b=a(
|
||||
'<div class="mdd_resizer" />');e.html(b)}e.bind("mousedown",MarkdownDeepEditorUI.onResizerMouseDown)}var j=a(this).attr(
|
||||
"data-mdd-preview");if(!j)j=".mdd_preview";var i=a(j)[0];if(!i){a('<div class="mdd_preview"></div>').insertAfter(b?b:
|
||||
this);i=a(".mdd_preview")[0]}var g=new MarkdownDeepEditor.Editor(this,i);if(f){jQuery.extend(g.Markdown,f);jQuery.extend
|
||||
(g,f)}g.onOptionsChanged();a(this).data("mdd",g)})}})(jQuery)
|
@ -1,667 +0,0 @@
|
||||
/**
|
||||
* CLDR JavaScript Library v0.4.1
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2013 Rafael Xavier de Souza
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-02-25T13:51Z
|
||||
*/
|
||||
/*!
|
||||
* CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier
|
||||
* http://git.io/h4lmVg
|
||||
*/
|
||||
(function( root, factory ) {
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
// AMD.
|
||||
define( factory );
|
||||
} else if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||
// Node. CommonJS.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
// Global
|
||||
root.Cldr = factory();
|
||||
}
|
||||
|
||||
}( this, function() {
|
||||
|
||||
|
||||
var arrayIsArray = Array.isArray || function( obj ) {
|
||||
return Object.prototype.toString.call( obj ) === "[object Array]";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var pathNormalize = function( path, attributes ) {
|
||||
if ( arrayIsArray( path ) ) {
|
||||
path = path.join( "/" );
|
||||
}
|
||||
if ( typeof path !== "string" ) {
|
||||
throw new Error( "invalid path \"" + path + "\"" );
|
||||
}
|
||||
// 1: Ignore leading slash `/`
|
||||
// 2: Ignore leading `cldr/`
|
||||
path = path
|
||||
.replace( /^\// , "" ) /* 1 */
|
||||
.replace( /^cldr\// , "" ); /* 2 */
|
||||
|
||||
// Replace {attribute}'s
|
||||
path = path.replace( /{[a-zA-Z]+}/g, function( name ) {
|
||||
name = name.replace( /^{([^}]*)}$/, "$1" );
|
||||
return attributes[ name ];
|
||||
});
|
||||
|
||||
return path.split( "/" );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var arraySome = function( array, callback ) {
|
||||
var i, length;
|
||||
if ( array.some ) {
|
||||
return array.some( callback );
|
||||
}
|
||||
for ( i = 0, length = array.length; i < length; i++ ) {
|
||||
if ( callback( array[ i ], i, array ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the maximized language id as defined in
|
||||
* http://www.unicode.org/reports/tr35/#Likely_Subtags
|
||||
* 1. Canonicalize.
|
||||
* 1.1 Make sure the input locale is in canonical form: uses the right
|
||||
* separator, and has the right casing.
|
||||
* TODO Right casing? What df? It seems languages are lowercase, scripts are
|
||||
* Capitalized, territory is uppercase. I am leaving this as an exercise to
|
||||
* the user.
|
||||
*
|
||||
* 1.2 Replace any deprecated subtags with their canonical values using the
|
||||
* <alias> data in supplemental metadata. Use the first value in the
|
||||
* replacement list, if it exists. Language tag replacements may have multiple
|
||||
* parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the
|
||||
* original script and/or region are retained if there is one. Thus
|
||||
* "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
|
||||
* TODO What <alias> data?
|
||||
*
|
||||
* 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
|
||||
* type="choice"> in the supplemental data), then return it.
|
||||
* TODO grandfathered?
|
||||
*
|
||||
* 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
|
||||
* 1.5 Get the components of the cleaned-up source tag (languages, scripts,
|
||||
* and regions), plus any variants and extensions.
|
||||
* 2. Lookup. Lookup each of the following in order, and stop on the first
|
||||
* match:
|
||||
* 2.1 languages_scripts_regions
|
||||
* 2.2 languages_regions
|
||||
* 2.3 languages_scripts
|
||||
* 2.4 languages
|
||||
* 2.5 und_scripts
|
||||
* 3. Return
|
||||
* 3.1 If there is no match, either return an error value, or the match for
|
||||
* "und" (in APIs where a valid language tag is required).
|
||||
* 3.2 Otherwise there is a match = languagem_scriptm_regionm
|
||||
* 3.3 Let xr = xs if xs is not empty, and xm otherwise.
|
||||
* 3.4 Return the language tag composed of languager _ scriptr _ regionr +
|
||||
* variants + extensions.
|
||||
*
|
||||
* @subtags [Array] normalized language id subtags tuple (see init.js).
|
||||
*/
|
||||
var coreLikelySubtags = function( Cldr, cldr, subtags, options ) {
|
||||
var match, matchFound,
|
||||
language = subtags[ 0 ],
|
||||
script = subtags[ 1 ],
|
||||
sep = Cldr.localeSep,
|
||||
territory = subtags[ 2 ];
|
||||
options = options || {};
|
||||
|
||||
// Skip if (language, script, territory) is not empty [3.3]
|
||||
if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) {
|
||||
return [ language, script, territory ];
|
||||
}
|
||||
|
||||
// Skip if no supplemental likelySubtags data is present
|
||||
if ( typeof cldr.get( "supplemental/likelySubtags" ) === "undefined" ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// [2]
|
||||
matchFound = arraySome([
|
||||
[ language, script, territory ],
|
||||
[ language, territory ],
|
||||
[ language, script ],
|
||||
[ language ],
|
||||
[ "und", script ]
|
||||
], function( test ) {
|
||||
return match = !(/\b(Zzzz|ZZ)\b/).test( test.join( sep ) ) /* [1.4] */ && cldr.get( [ "supplemental/likelySubtags", test.join( sep ) ] );
|
||||
});
|
||||
|
||||
// [3]
|
||||
if ( matchFound ) {
|
||||
// [3.2 .. 3.4]
|
||||
match = match.split( sep );
|
||||
return [
|
||||
language !== "und" ? language : match[ 0 ],
|
||||
script !== "Zzzz" ? script : match[ 1 ],
|
||||
territory !== "ZZ" ? territory : match[ 2 ]
|
||||
];
|
||||
} else if ( options.force ) {
|
||||
// [3.1.2]
|
||||
return cldr.get( "supplemental/likelySubtags/und" ).split( sep );
|
||||
} else {
|
||||
// [3.1.1]
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Given a locale, remove any fields that Add Likely Subtags would add.
|
||||
* http://www.unicode.org/reports/tr35/#Likely_Subtags
|
||||
* 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
|
||||
* return it.
|
||||
* 2. Remove the variants from max.
|
||||
* 3. Then for trial in {language, language _ region, language _ script}. If
|
||||
* AddLikelySubtags(trial) = max, then return trial + variants.
|
||||
* 4. If you do not get a match, return max + variants.
|
||||
*
|
||||
* @maxLanguageId [Array] maxLanguageId tuple (see init.js).
|
||||
*/
|
||||
var coreRemoveLikelySubtags = function( Cldr, cldr, maxLanguageId ) {
|
||||
var match, matchFound,
|
||||
language = maxLanguageId[ 0 ],
|
||||
script = maxLanguageId[ 1 ],
|
||||
territory = maxLanguageId[ 2 ];
|
||||
|
||||
// [3]
|
||||
matchFound = arraySome([
|
||||
[ [ language, "Zzzz", "ZZ" ], [ language ] ],
|
||||
[ [ language, "Zzzz", territory ], [ language, territory ] ],
|
||||
[ [ language, script, "ZZ" ], [ language, script ] ]
|
||||
], function( test ) {
|
||||
var result = coreLikelySubtags( Cldr, cldr, test[ 0 ] );
|
||||
match = test[ 1 ];
|
||||
return result && result[ 0 ] === maxLanguageId[ 0 ] &&
|
||||
result[ 1 ] === maxLanguageId[ 1 ] &&
|
||||
result[ 2 ] === maxLanguageId[ 2 ];
|
||||
});
|
||||
|
||||
// [4]
|
||||
return matchFound ? match : maxLanguageId;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* subtags( locale )
|
||||
*
|
||||
* @locale [String]
|
||||
*/
|
||||
var coreSubtags = function( locale ) {
|
||||
var aux, unicodeLanguageId,
|
||||
subtags = [];
|
||||
|
||||
locale = locale.replace( /_/, "-" );
|
||||
|
||||
// Unicode locale extensions.
|
||||
aux = locale.split( "-u-" );
|
||||
if ( aux[ 1 ] ) {
|
||||
aux[ 1 ] = aux[ 1 ].split( "-t-" );
|
||||
locale = aux[ 0 ] + ( aux[ 1 ][ 1 ] ? "-t-" + aux[ 1 ][ 1 ] : "");
|
||||
subtags[ 4 /* unicodeLocaleExtensions */ ] = aux[ 1 ][ 0 ];
|
||||
}
|
||||
|
||||
// TODO normalize transformed extensions. Currently, skipped.
|
||||
// subtags[ x ] = locale.split( "-t-" )[ 1 ];
|
||||
unicodeLanguageId = locale.split( "-t-" )[ 0 ];
|
||||
|
||||
// unicode_language_id = "root"
|
||||
// | unicode_language_subtag
|
||||
// (sep unicode_script_subtag)?
|
||||
// (sep unicode_region_subtag)?
|
||||
// (sep unicode_variant_subtag)* ;
|
||||
//
|
||||
// Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
|
||||
aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)(-[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3})*$|^(root)$/ );
|
||||
if ( aux === null ) {
|
||||
return [ "und", "Zzzz", "ZZ" ];
|
||||
}
|
||||
subtags[ 0 /* language */ ] = aux[ 9 ] /* root */ || aux[ 2 ] || "und";
|
||||
subtags[ 1 /* script */ ] = aux[ 4 ] || "Zzzz";
|
||||
subtags[ 2 /* territory */ ] = aux[ 6 ] || "ZZ";
|
||||
subtags[ 3 /* variant */ ] = aux[ 7 ];
|
||||
|
||||
// 0: language
|
||||
// 1: script
|
||||
// 2: territory (aka region)
|
||||
// 3: variant
|
||||
// 4: unicodeLocaleExtensions
|
||||
return subtags;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var arrayForEach = function( array, callback ) {
|
||||
var i, length;
|
||||
if ( array.forEach ) {
|
||||
return array.forEach( callback );
|
||||
}
|
||||
for ( i = 0, length = array.length; i < length; i++ ) {
|
||||
callback( array[ i ], i, array );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* bundleLookup( minLanguageId )
|
||||
*
|
||||
* @Cldr [Cldr class]
|
||||
*
|
||||
* @cldr [Cldr instance]
|
||||
*
|
||||
* @minLanguageId [String] requested languageId after applied remove likely subtags.
|
||||
*/
|
||||
var bundleLookup = function( Cldr, cldr, minLanguageId ) {
|
||||
var availableBundleMap = Cldr._availableBundleMap,
|
||||
availableBundleMapQueue = Cldr._availableBundleMapQueue;
|
||||
|
||||
if ( availableBundleMapQueue.length ) {
|
||||
arrayForEach( availableBundleMapQueue, function( bundle ) {
|
||||
var existing, maxBundle, minBundle, subtags;
|
||||
subtags = coreSubtags( bundle );
|
||||
maxBundle = coreLikelySubtags( Cldr, cldr, subtags, { force: true } ) || subtags;
|
||||
minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle );
|
||||
minBundle = minBundle.join( Cldr.localeSep );
|
||||
existing = availableBundleMapQueue[ minBundle ];
|
||||
if ( existing && existing.length < bundle.length ) {
|
||||
return;
|
||||
}
|
||||
availableBundleMap[ minBundle ] = bundle;
|
||||
});
|
||||
Cldr._availableBundleMapQueue = [];
|
||||
}
|
||||
|
||||
return availableBundleMap[ minLanguageId ] || null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var objectKeys = function( object ) {
|
||||
var i,
|
||||
result = [];
|
||||
|
||||
if ( Object.keys ) {
|
||||
return Object.keys( object );
|
||||
}
|
||||
|
||||
for ( i in object ) {
|
||||
result.push( i );
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var createError = function( code, attributes ) {
|
||||
var error, message;
|
||||
|
||||
message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" );
|
||||
error = new Error( message );
|
||||
error.code = code;
|
||||
|
||||
// extend( error, attributes );
|
||||
arrayForEach( objectKeys( attributes ), function( attribute ) {
|
||||
error[ attribute ] = attributes[ attribute ];
|
||||
});
|
||||
|
||||
return error;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validate = function( code, check, attributes ) {
|
||||
if ( !check ) {
|
||||
throw createError( code, attributes );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validatePresence = function( value, name ) {
|
||||
validate( "E_MISSING_PARAMETER", typeof value !== "undefined", {
|
||||
name: name
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateType = function( value, name, check, expected ) {
|
||||
validate( "E_INVALID_PAR_TYPE", check, {
|
||||
expected: expected,
|
||||
name: name,
|
||||
value: value
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateTypePath = function( value, name ) {
|
||||
validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function inspired by jQuery Core, but reduced to our use case.
|
||||
*/
|
||||
var isPlainObject = function( obj ) {
|
||||
return obj !== null && "" + obj === "[object Object]";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateTypePlainObject = function( value, name ) {
|
||||
validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateTypeString = function( value, name ) {
|
||||
validateType( value, name, typeof value === "string", "a string" );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// @path: normalized path
|
||||
var resourceGet = function( data, path ) {
|
||||
var i,
|
||||
node = data,
|
||||
length = path.length;
|
||||
|
||||
for ( i = 0; i < length - 1; i++ ) {
|
||||
node = node[ path[ i ] ];
|
||||
if ( !node ) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
return node[ path[ i ] ];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* setAvailableBundles( Cldr, json )
|
||||
*
|
||||
* @Cldr [Cldr class]
|
||||
*
|
||||
* @json resolved/unresolved cldr data.
|
||||
*
|
||||
* Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
|
||||
*/
|
||||
var coreSetAvailableBundles = function( Cldr, json ) {
|
||||
var bundle,
|
||||
availableBundleMapQueue = Cldr._availableBundleMapQueue,
|
||||
main = resourceGet( json, [ "main" ] );
|
||||
|
||||
if ( main ) {
|
||||
for ( bundle in main ) {
|
||||
if ( main.hasOwnProperty( bundle ) && bundle !== "root" ) {
|
||||
availableBundleMapQueue.push( bundle );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var alwaysArray = function( somethingOrArray ) {
|
||||
return arrayIsArray( somethingOrArray ) ? somethingOrArray : [ somethingOrArray ];
|
||||
};
|
||||
|
||||
|
||||
var jsonMerge = (function() {
|
||||
|
||||
// Returns new deeply merged JSON.
|
||||
//
|
||||
// Eg.
|
||||
// merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
|
||||
// -> { a: { b: 3, c: 2, d: 4 } }
|
||||
//
|
||||
// @arguments JSON's
|
||||
//
|
||||
var merge = function() {
|
||||
var destination = {},
|
||||
sources = [].slice.call( arguments, 0 );
|
||||
arrayForEach( sources, function( source ) {
|
||||
var prop;
|
||||
for ( prop in source ) {
|
||||
if ( prop in destination && arrayIsArray( destination[ prop ] ) ) {
|
||||
|
||||
// Concat Arrays
|
||||
destination[ prop ] = destination[ prop ].concat( source[ prop ] );
|
||||
|
||||
} else if ( prop in destination && typeof destination[ prop ] === "object" ) {
|
||||
|
||||
// Merge Objects
|
||||
destination[ prop ] = merge( destination[ prop ], source[ prop ] );
|
||||
|
||||
} else {
|
||||
|
||||
// Set new values
|
||||
destination[ prop ] = source[ prop ];
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
return destination;
|
||||
};
|
||||
|
||||
return merge;
|
||||
|
||||
}());
|
||||
|
||||
|
||||
/**
|
||||
* load( Cldr, source, jsons )
|
||||
*
|
||||
* @Cldr [Cldr class]
|
||||
*
|
||||
* @source [Object]
|
||||
*
|
||||
* @jsons [arguments]
|
||||
*/
|
||||
var coreLoad = function( Cldr, source, jsons ) {
|
||||
var i, j, json;
|
||||
|
||||
validatePresence( jsons[ 0 ], "json" );
|
||||
|
||||
// Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
|
||||
for ( i = 0; i < jsons.length; i++ ) {
|
||||
|
||||
// Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
|
||||
json = alwaysArray( jsons[ i ] );
|
||||
|
||||
for ( j = 0; j < json.length; j++ ) {
|
||||
validateTypePlainObject( json[ j ], "json" );
|
||||
source = jsonMerge( source, json[ j ] );
|
||||
coreSetAvailableBundles( Cldr, json[ j ] );
|
||||
}
|
||||
}
|
||||
|
||||
return source;
|
||||
};
|
||||
|
||||
|
||||
|
||||
var itemGetResolved = function( Cldr, path, attributes ) {
|
||||
// Resolve path
|
||||
var normalizedPath = pathNormalize( path, attributes );
|
||||
|
||||
return resourceGet( Cldr._resolved, normalizedPath );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* new Cldr()
|
||||
*/
|
||||
var Cldr = function( locale ) {
|
||||
this.init( locale );
|
||||
};
|
||||
|
||||
// Build optimization hack to avoid duplicating functions across modules.
|
||||
Cldr._alwaysArray = alwaysArray;
|
||||
Cldr._coreLoad = coreLoad;
|
||||
Cldr._createError = createError;
|
||||
Cldr._itemGetResolved = itemGetResolved;
|
||||
Cldr._jsonMerge = jsonMerge;
|
||||
Cldr._pathNormalize = pathNormalize;
|
||||
Cldr._resourceGet = resourceGet;
|
||||
Cldr._validatePresence = validatePresence;
|
||||
Cldr._validateType = validateType;
|
||||
Cldr._validateTypePath = validateTypePath;
|
||||
Cldr._validateTypePlainObject = validateTypePlainObject;
|
||||
|
||||
Cldr._availableBundleMap = {};
|
||||
Cldr._availableBundleMapQueue = [];
|
||||
Cldr._resolved = {};
|
||||
|
||||
// Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
|
||||
Cldr.localeSep = "-";
|
||||
|
||||
/**
|
||||
* Cldr.load( json [, json, ...] )
|
||||
*
|
||||
* @json [JSON] CLDR data or [Array] Array of @json's.
|
||||
*
|
||||
* Load resolved cldr data.
|
||||
*/
|
||||
Cldr.load = function() {
|
||||
Cldr._resolved = coreLoad( Cldr, Cldr._resolved, arguments );
|
||||
};
|
||||
|
||||
/**
|
||||
* .init() automatically run on instantiation/construction.
|
||||
*/
|
||||
Cldr.prototype.init = function( locale ) {
|
||||
var attributes, language, maxLanguageId, minLanguageId, script, subtags, territory, unicodeLocaleExtensions, variant,
|
||||
sep = Cldr.localeSep;
|
||||
|
||||
validatePresence( locale, "locale" );
|
||||
validateTypeString( locale, "locale" );
|
||||
|
||||
subtags = coreSubtags( locale );
|
||||
|
||||
unicodeLocaleExtensions = subtags[ 4 ];
|
||||
variant = subtags[ 3 ];
|
||||
|
||||
// Normalize locale code.
|
||||
// Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
|
||||
// Get the variant subtags (calendar, collation, currency, etc).
|
||||
// refs:
|
||||
// - http://www.unicode.org/reports/tr35/#Field_Definitions
|
||||
// - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
|
||||
// - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
|
||||
|
||||
// When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
|
||||
maxLanguageId = coreLikelySubtags( Cldr, this, subtags, { force: true } ) || subtags;
|
||||
language = maxLanguageId[ 0 ];
|
||||
script = maxLanguageId[ 1 ];
|
||||
territory = maxLanguageId[ 2 ];
|
||||
|
||||
minLanguageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep );
|
||||
|
||||
// Set attributes
|
||||
this.attributes = attributes = {
|
||||
bundle: bundleLookup( Cldr, this, minLanguageId ),
|
||||
|
||||
// Unicode Language Id
|
||||
minlanguageId: minLanguageId,
|
||||
maxLanguageId: maxLanguageId.join( sep ),
|
||||
|
||||
// Unicode Language Id Subtabs
|
||||
language: language,
|
||||
script: script,
|
||||
territory: territory,
|
||||
region: territory, /* alias */
|
||||
variant: variant
|
||||
};
|
||||
|
||||
// Unicode locale extensions.
|
||||
unicodeLocaleExtensions && ( "-" + unicodeLocaleExtensions ).replace( /-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function( attribute, key, type ) {
|
||||
|
||||
if ( key ) {
|
||||
|
||||
// Extension is in the `keyword` form.
|
||||
attributes[ "u" + key ] = type;
|
||||
} else {
|
||||
|
||||
// Extension is in the `attribute` form.
|
||||
attributes[ "u" + attribute ] = true;
|
||||
}
|
||||
});
|
||||
|
||||
this.locale = locale;
|
||||
};
|
||||
|
||||
/**
|
||||
* .get()
|
||||
*/
|
||||
Cldr.prototype.get = function( path ) {
|
||||
|
||||
validatePresence( path, "path" );
|
||||
validateTypePath( path, "path" );
|
||||
|
||||
return itemGetResolved( Cldr, path, this.attributes );
|
||||
};
|
||||
|
||||
/**
|
||||
* .main()
|
||||
*/
|
||||
Cldr.prototype.main = function( path ) {
|
||||
validatePresence( path, "path" );
|
||||
validateTypePath( path, "path" );
|
||||
|
||||
validate( "E_MISSING_BUNDLE", this.attributes.bundle !== null, {
|
||||
locale: this.locale
|
||||
});
|
||||
|
||||
path = alwaysArray( path );
|
||||
return this.get( [ "main/{bundle}" ].concat( path ) );
|
||||
};
|
||||
|
||||
return Cldr;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,585 +0,0 @@
|
||||
/**
|
||||
* CLDR JavaScript Library v0.4.1
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2013 Rafael Xavier de Souza
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-02-25T13:51Z
|
||||
*/
|
||||
/*!
|
||||
* CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier
|
||||
* http://git.io/h4lmVg
|
||||
*/
|
||||
(function( factory ) {
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
// AMD.
|
||||
define( [ "../cldr" ], factory );
|
||||
} else if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||
// Node. CommonJS.
|
||||
module.exports = factory( require( "cldrjs" ) );
|
||||
} else {
|
||||
// Global
|
||||
factory( Cldr );
|
||||
}
|
||||
|
||||
}(function( Cldr ) {
|
||||
|
||||
// Build optimization hack to avoid duplicating functions across modules.
|
||||
var pathNormalize = Cldr._pathNormalize,
|
||||
validatePresence = Cldr._validatePresence,
|
||||
validateType = Cldr._validateType;
|
||||
|
||||
/*!
|
||||
* EventEmitter v4.2.7 - git.io/ee
|
||||
* Oliver Caldwell
|
||||
* MIT license
|
||||
* @preserve
|
||||
*/
|
||||
|
||||
var EventEmitter;
|
||||
/* jshint ignore:start */
|
||||
EventEmitter = (function () {
|
||||
|
||||
|
||||
/**
|
||||
* Class for managing events.
|
||||
* Can be extended to provide event functionality in other classes.
|
||||
*
|
||||
* @class EventEmitter Manages event registering and emitting.
|
||||
*/
|
||||
function EventEmitter() {}
|
||||
|
||||
// Shortcuts to improve speed and size
|
||||
var proto = EventEmitter.prototype;
|
||||
var exports = this;
|
||||
var originalGlobalValue = exports.EventEmitter;
|
||||
|
||||
/**
|
||||
* Finds the index of the listener for the event in it's storage array.
|
||||
*
|
||||
* @param {Function[]} listeners Array of listeners to search through.
|
||||
* @param {Function} listener Method to look for.
|
||||
* @return {Number} Index of the specified listener, -1 if not found
|
||||
* @api private
|
||||
*/
|
||||
function indexOfListener(listeners, listener) {
|
||||
var i = listeners.length;
|
||||
while (i--) {
|
||||
if (listeners[i].listener === listener) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias a method while keeping the context correct, to allow for overwriting of target method.
|
||||
*
|
||||
* @param {String} name The name of the target method.
|
||||
* @return {Function} The aliased method
|
||||
* @api private
|
||||
*/
|
||||
function alias(name) {
|
||||
return function aliasClosure() {
|
||||
return this[name].apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the listener array for the specified event.
|
||||
* Will initialise the event object and listener arrays if required.
|
||||
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
|
||||
* Each property in the object response is an array of listener functions.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to return the listeners from.
|
||||
* @return {Function[]|Object} All listener functions for the event.
|
||||
*/
|
||||
proto.getListeners = function getListeners(evt) {
|
||||
var events = this._getEvents();
|
||||
var response;
|
||||
var key;
|
||||
|
||||
// Return a concatenated array of all matching events if
|
||||
// the selector is a regular expression.
|
||||
if (evt instanceof RegExp) {
|
||||
response = {};
|
||||
for (key in events) {
|
||||
if (events.hasOwnProperty(key) && evt.test(key)) {
|
||||
response[key] = events[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
response = events[evt] || (events[evt] = []);
|
||||
}
|
||||
|
||||
return response;
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes a list of listener objects and flattens it into a list of listener functions.
|
||||
*
|
||||
* @param {Object[]} listeners Raw listener objects.
|
||||
* @return {Function[]} Just the listener functions.
|
||||
*/
|
||||
proto.flattenListeners = function flattenListeners(listeners) {
|
||||
var flatListeners = [];
|
||||
var i;
|
||||
|
||||
for (i = 0; i < listeners.length; i += 1) {
|
||||
flatListeners.push(listeners[i].listener);
|
||||
}
|
||||
|
||||
return flatListeners;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to return the listeners from.
|
||||
* @return {Object} All listener functions for an event in an object.
|
||||
*/
|
||||
proto.getListenersAsObject = function getListenersAsObject(evt) {
|
||||
var listeners = this.getListeners(evt);
|
||||
var response;
|
||||
|
||||
if (listeners instanceof Array) {
|
||||
response = {};
|
||||
response[evt] = listeners;
|
||||
}
|
||||
|
||||
return response || listeners;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds a listener function to the specified event.
|
||||
* The listener will not be added if it is a duplicate.
|
||||
* If the listener returns true then it will be removed after it is called.
|
||||
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to attach the listener to.
|
||||
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.addListener = function addListener(evt, listener) {
|
||||
var listeners = this.getListenersAsObject(evt);
|
||||
var listenerIsWrapped = typeof listener === 'object';
|
||||
var key;
|
||||
|
||||
for (key in listeners) {
|
||||
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
|
||||
listeners[key].push(listenerIsWrapped ? listener : {
|
||||
listener: listener,
|
||||
once: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias of addListener
|
||||
*/
|
||||
proto.on = alias('addListener');
|
||||
|
||||
/**
|
||||
* Semi-alias of addListener. It will add a listener that will be
|
||||
* automatically removed after it's first execution.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to attach the listener to.
|
||||
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.addOnceListener = function addOnceListener(evt, listener) {
|
||||
return this.addListener(evt, {
|
||||
listener: listener,
|
||||
once: true
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias of addOnceListener.
|
||||
*/
|
||||
proto.once = alias('addOnceListener');
|
||||
|
||||
/**
|
||||
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
|
||||
* You need to tell it what event names should be matched by a regex.
|
||||
*
|
||||
* @param {String} evt Name of the event to create.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.defineEvent = function defineEvent(evt) {
|
||||
this.getListeners(evt);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Uses defineEvent to define multiple events.
|
||||
*
|
||||
* @param {String[]} evts An array of event names to define.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.defineEvents = function defineEvents(evts) {
|
||||
for (var i = 0; i < evts.length; i += 1) {
|
||||
this.defineEvent(evts[i]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a listener function from the specified event.
|
||||
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to remove the listener from.
|
||||
* @param {Function} listener Method to remove from the event.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.removeListener = function removeListener(evt, listener) {
|
||||
var listeners = this.getListenersAsObject(evt);
|
||||
var index;
|
||||
var key;
|
||||
|
||||
for (key in listeners) {
|
||||
if (listeners.hasOwnProperty(key)) {
|
||||
index = indexOfListener(listeners[key], listener);
|
||||
|
||||
if (index !== -1) {
|
||||
listeners[key].splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias of removeListener
|
||||
*/
|
||||
proto.off = alias('removeListener');
|
||||
|
||||
/**
|
||||
* Adds listeners in bulk using the manipulateListeners method.
|
||||
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
|
||||
* You can also pass it a regular expression to add the array of listeners to all events that match it.
|
||||
* Yeah, this function does quite a bit. That's probably a bad thing.
|
||||
*
|
||||
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
|
||||
* @param {Function[]} [listeners] An optional array of listener functions to add.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.addListeners = function addListeners(evt, listeners) {
|
||||
// Pass through to manipulateListeners
|
||||
return this.manipulateListeners(false, evt, listeners);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes listeners in bulk using the manipulateListeners method.
|
||||
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
|
||||
* You can also pass it an event name and an array of listeners to be removed.
|
||||
* You can also pass it a regular expression to remove the listeners from all events that match it.
|
||||
*
|
||||
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
|
||||
* @param {Function[]} [listeners] An optional array of listener functions to remove.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.removeListeners = function removeListeners(evt, listeners) {
|
||||
// Pass through to manipulateListeners
|
||||
return this.manipulateListeners(true, evt, listeners);
|
||||
};
|
||||
|
||||
/**
|
||||
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
|
||||
* The first argument will determine if the listeners are removed (true) or added (false).
|
||||
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
|
||||
* You can also pass it an event name and an array of listeners to be added/removed.
|
||||
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
|
||||
*
|
||||
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
|
||||
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
|
||||
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
|
||||
var i;
|
||||
var value;
|
||||
var single = remove ? this.removeListener : this.addListener;
|
||||
var multiple = remove ? this.removeListeners : this.addListeners;
|
||||
|
||||
// If evt is an object then pass each of it's properties to this method
|
||||
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
|
||||
for (i in evt) {
|
||||
if (evt.hasOwnProperty(i) && (value = evt[i])) {
|
||||
// Pass the single listener straight through to the singular method
|
||||
if (typeof value === 'function') {
|
||||
single.call(this, i, value);
|
||||
}
|
||||
else {
|
||||
// Otherwise pass back to the multiple function
|
||||
multiple.call(this, i, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// So evt must be a string
|
||||
// And listeners must be an array of listeners
|
||||
// Loop over it and pass each one to the multiple method
|
||||
i = listeners.length;
|
||||
while (i--) {
|
||||
single.call(this, evt, listeners[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes all listeners from a specified event.
|
||||
* If you do not specify an event then all listeners will be removed.
|
||||
* That means every event will be emptied.
|
||||
* You can also pass a regex to remove all events that match it.
|
||||
*
|
||||
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.removeEvent = function removeEvent(evt) {
|
||||
var type = typeof evt;
|
||||
var events = this._getEvents();
|
||||
var key;
|
||||
|
||||
// Remove different things depending on the state of evt
|
||||
if (type === 'string') {
|
||||
// Remove all listeners for the specified event
|
||||
delete events[evt];
|
||||
}
|
||||
else if (evt instanceof RegExp) {
|
||||
// Remove all events matching the regex.
|
||||
for (key in events) {
|
||||
if (events.hasOwnProperty(key) && evt.test(key)) {
|
||||
delete events[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Remove all listeners in all events
|
||||
delete this._events;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias of removeEvent.
|
||||
*
|
||||
* Added to mirror the node API.
|
||||
*/
|
||||
proto.removeAllListeners = alias('removeEvent');
|
||||
|
||||
/**
|
||||
* Emits an event of your choice.
|
||||
* When emitted, every listener attached to that event will be executed.
|
||||
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
|
||||
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
|
||||
* So they will not arrive within the array on the other side, they will be separate.
|
||||
* You can also pass a regular expression to emit to all events that match it.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
|
||||
* @param {Array} [args] Optional array of arguments to be passed to each listener.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.emitEvent = function emitEvent(evt, args) {
|
||||
var listeners = this.getListenersAsObject(evt);
|
||||
var listener;
|
||||
var i;
|
||||
var key;
|
||||
var response;
|
||||
|
||||
for (key in listeners) {
|
||||
if (listeners.hasOwnProperty(key)) {
|
||||
i = listeners[key].length;
|
||||
|
||||
while (i--) {
|
||||
// If the listener returns true then it shall be removed from the event
|
||||
// The function is executed either with a basic call or an apply if there is an args array
|
||||
listener = listeners[key][i];
|
||||
|
||||
if (listener.once === true) {
|
||||
this.removeListener(evt, listener.listener);
|
||||
}
|
||||
|
||||
response = listener.listener.apply(this, args || []);
|
||||
|
||||
if (response === this._getOnceReturnValue()) {
|
||||
this.removeListener(evt, listener.listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias of emitEvent
|
||||
*/
|
||||
proto.trigger = alias('emitEvent');
|
||||
|
||||
/**
|
||||
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
|
||||
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
|
||||
*
|
||||
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
|
||||
* @param {...*} Optional additional arguments to be passed to each listener.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.emit = function emit(evt) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return this.emitEvent(evt, args);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the current value to check against when executing listeners. If a
|
||||
* listeners return value matches the one set here then it will be removed
|
||||
* after execution. This value defaults to true.
|
||||
*
|
||||
* @param {*} value The new value to check for when executing listeners.
|
||||
* @return {Object} Current instance of EventEmitter for chaining.
|
||||
*/
|
||||
proto.setOnceReturnValue = function setOnceReturnValue(value) {
|
||||
this._onceReturnValue = value;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetches the current value to check against when executing listeners. If
|
||||
* the listeners return value matches this one then it should be removed
|
||||
* automatically. It will return true by default.
|
||||
*
|
||||
* @return {*|Boolean} The current value to check for or the default, true.
|
||||
* @api private
|
||||
*/
|
||||
proto._getOnceReturnValue = function _getOnceReturnValue() {
|
||||
if (this.hasOwnProperty('_onceReturnValue')) {
|
||||
return this._onceReturnValue;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetches the events object and creates one if required.
|
||||
*
|
||||
* @return {Object} The events storage object.
|
||||
* @api private
|
||||
*/
|
||||
proto._getEvents = function _getEvents() {
|
||||
return this._events || (this._events = {});
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
|
||||
*
|
||||
* @return {Function} Non conflicting EventEmitter class.
|
||||
*/
|
||||
EventEmitter.noConflict = function noConflict() {
|
||||
exports.EventEmitter = originalGlobalValue;
|
||||
return EventEmitter;
|
||||
};
|
||||
|
||||
return EventEmitter;
|
||||
}());
|
||||
/* jshint ignore:end */
|
||||
|
||||
|
||||
|
||||
var validateTypeFunction = function( value, name ) {
|
||||
validateType( value, name, typeof value === "undefined" || typeof value === "function", "Function" );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var superGet, superInit,
|
||||
globalEe = new EventEmitter();
|
||||
|
||||
function validateTypeEvent( value, name ) {
|
||||
validateType( value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp" );
|
||||
}
|
||||
|
||||
function validateThenCall( method, self ) {
|
||||
return function( event, listener ) {
|
||||
validatePresence( event, "event" );
|
||||
validateTypeEvent( event, "event" );
|
||||
|
||||
validatePresence( listener, "listener" );
|
||||
validateTypeFunction( listener, "listener" );
|
||||
|
||||
return self[ method ].apply( self, arguments );
|
||||
};
|
||||
}
|
||||
|
||||
function off( self ) {
|
||||
return validateThenCall( "off", self );
|
||||
}
|
||||
|
||||
function on( self ) {
|
||||
return validateThenCall( "on", self );
|
||||
}
|
||||
|
||||
function once( self ) {
|
||||
return validateThenCall( "once", self );
|
||||
}
|
||||
|
||||
Cldr.off = off( globalEe );
|
||||
Cldr.on = on( globalEe );
|
||||
Cldr.once = once( globalEe );
|
||||
|
||||
/**
|
||||
* Overload Cldr.prototype.init().
|
||||
*/
|
||||
superInit = Cldr.prototype.init;
|
||||
Cldr.prototype.init = function() {
|
||||
var ee;
|
||||
this.ee = ee = new EventEmitter();
|
||||
this.off = off( ee );
|
||||
this.on = on( ee );
|
||||
this.once = once( ee );
|
||||
superInit.apply( this, arguments );
|
||||
};
|
||||
|
||||
/**
|
||||
* getOverload is encapsulated, because of cldr/unresolved. If it's loaded
|
||||
* after cldr/event (and note it overwrites .get), it can trigger this
|
||||
* overload again.
|
||||
*/
|
||||
function getOverload() {
|
||||
|
||||
/**
|
||||
* Overload Cldr.prototype.get().
|
||||
*/
|
||||
superGet = Cldr.prototype.get;
|
||||
Cldr.prototype.get = function( path ) {
|
||||
var value = superGet.apply( this, arguments );
|
||||
path = pathNormalize( path, this.attributes ).join( "/" );
|
||||
globalEe.trigger( "get", [ path, value ] );
|
||||
this.ee.trigger( "get", [ path, value ] );
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
Cldr._eventInit = getOverload;
|
||||
getOverload();
|
||||
|
||||
return Cldr;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,101 +0,0 @@
|
||||
/**
|
||||
* CLDR JavaScript Library v0.4.1
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2013 Rafael Xavier de Souza
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-02-25T13:51Z
|
||||
*/
|
||||
/*!
|
||||
* CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier
|
||||
* http://git.io/h4lmVg
|
||||
*/
|
||||
(function( factory ) {
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
// AMD.
|
||||
define( [ "../cldr" ], factory );
|
||||
} else if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||
// Node. CommonJS.
|
||||
module.exports = factory( require( "cldrjs" ) );
|
||||
} else {
|
||||
// Global
|
||||
factory( Cldr );
|
||||
}
|
||||
|
||||
}(function( Cldr ) {
|
||||
|
||||
// Build optimization hack to avoid duplicating functions across modules.
|
||||
var alwaysArray = Cldr._alwaysArray;
|
||||
|
||||
|
||||
|
||||
var supplementalMain = function( cldr ) {
|
||||
|
||||
var prepend, supplemental;
|
||||
|
||||
prepend = function( prepend ) {
|
||||
return function( path ) {
|
||||
path = alwaysArray( path );
|
||||
return cldr.get( [ prepend ].concat( path ) );
|
||||
};
|
||||
};
|
||||
|
||||
supplemental = prepend( "supplemental" );
|
||||
|
||||
// Week Data
|
||||
// http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
|
||||
supplemental.weekData = prepend( "supplemental/weekData" );
|
||||
|
||||
supplemental.weekData.firstDay = function() {
|
||||
return cldr.get( "supplemental/weekData/firstDay/{territory}" ) ||
|
||||
cldr.get( "supplemental/weekData/firstDay/001" );
|
||||
};
|
||||
|
||||
supplemental.weekData.minDays = function() {
|
||||
var minDays = cldr.get( "supplemental/weekData/minDays/{territory}" ) ||
|
||||
cldr.get( "supplemental/weekData/minDays/001" );
|
||||
return parseInt( minDays, 10 );
|
||||
};
|
||||
|
||||
// Time Data
|
||||
// http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
|
||||
supplemental.timeData = prepend( "supplemental/timeData" );
|
||||
|
||||
supplemental.timeData.allowed = function() {
|
||||
return cldr.get( "supplemental/timeData/{territory}/_allowed" ) ||
|
||||
cldr.get( "supplemental/timeData/001/_allowed" );
|
||||
};
|
||||
|
||||
supplemental.timeData.preferred = function() {
|
||||
return cldr.get( "supplemental/timeData/{territory}/_preferred" ) ||
|
||||
cldr.get( "supplemental/timeData/001/_preferred" );
|
||||
};
|
||||
|
||||
return supplemental;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var initSuper = Cldr.prototype.init;
|
||||
|
||||
/**
|
||||
* .init() automatically ran on construction.
|
||||
*
|
||||
* Overload .init().
|
||||
*/
|
||||
Cldr.prototype.init = function() {
|
||||
initSuper.apply( this, arguments );
|
||||
this.supplemental = supplementalMain( this );
|
||||
};
|
||||
|
||||
return Cldr;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,164 +0,0 @@
|
||||
/**
|
||||
* CLDR JavaScript Library v0.4.1
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2013 Rafael Xavier de Souza
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-02-25T13:51Z
|
||||
*/
|
||||
/*!
|
||||
* CLDR JavaScript Library v0.4.1 2015-02-25T13:51Z MIT license © Rafael Xavier
|
||||
* http://git.io/h4lmVg
|
||||
*/
|
||||
(function( factory ) {
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
// AMD.
|
||||
define( [ "../cldr" ], factory );
|
||||
} else if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||
// Node. CommonJS.
|
||||
module.exports = factory( require( "cldrjs" ) );
|
||||
} else {
|
||||
// Global
|
||||
factory( Cldr );
|
||||
}
|
||||
|
||||
}(function( Cldr ) {
|
||||
|
||||
// Build optimization hack to avoid duplicating functions across modules.
|
||||
var coreLoad = Cldr._coreLoad;
|
||||
var jsonMerge = Cldr._jsonMerge;
|
||||
var pathNormalize = Cldr._pathNormalize;
|
||||
var resourceGet = Cldr._resourceGet;
|
||||
var validatePresence = Cldr._validatePresence;
|
||||
var validateTypePath = Cldr._validateTypePath;
|
||||
|
||||
|
||||
|
||||
var bundleParentLookup = function( Cldr, locale ) {
|
||||
var normalizedPath, parent;
|
||||
|
||||
if ( locale === "root" ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// First, try to find parent on supplemental data.
|
||||
normalizedPath = pathNormalize( [ "supplemental/parentLocales/parentLocale", locale ] );
|
||||
parent = resourceGet( Cldr._resolved, normalizedPath ) || resourceGet( Cldr._raw, normalizedPath );
|
||||
if ( parent ) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
// Or truncate locale.
|
||||
parent = locale.substr( 0, locale.lastIndexOf( Cldr.localeSep ) );
|
||||
if ( !parent ) {
|
||||
return "root";
|
||||
}
|
||||
|
||||
return parent;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// @path: normalized path
|
||||
var resourceSet = function( data, path, value ) {
|
||||
var i,
|
||||
node = data,
|
||||
length = path.length;
|
||||
|
||||
for ( i = 0; i < length - 1; i++ ) {
|
||||
if ( !node[ path[ i ] ] ) {
|
||||
node[ path[ i ] ] = {};
|
||||
}
|
||||
node = node[ path[ i ] ];
|
||||
}
|
||||
node[ path[ i ] ] = value;
|
||||
};
|
||||
|
||||
|
||||
var itemLookup = (function() {
|
||||
|
||||
var lookup;
|
||||
|
||||
lookup = function( Cldr, locale, path, attributes, childLocale ) {
|
||||
var normalizedPath, parent, value;
|
||||
|
||||
// 1: Finish recursion
|
||||
// 2: Avoid infinite loop
|
||||
if ( typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */ ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Resolve path
|
||||
normalizedPath = pathNormalize( path, attributes );
|
||||
|
||||
// Check resolved (cached) data first
|
||||
// 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
|
||||
// represent its leafs in its entirety.
|
||||
value = resourceGet( Cldr._resolved, normalizedPath );
|
||||
if ( value && typeof value !== "object" /* 1 */ ) {
|
||||
return value;
|
||||
}
|
||||
|
||||
// Check raw data
|
||||
value = resourceGet( Cldr._raw, normalizedPath );
|
||||
|
||||
if ( !value ) {
|
||||
// Or, lookup at parent locale
|
||||
parent = bundleParentLookup( Cldr, locale );
|
||||
value = lookup( Cldr, parent, path, jsonMerge( attributes, { bundle: parent }), locale );
|
||||
}
|
||||
|
||||
if ( value ) {
|
||||
// Set resolved (cached)
|
||||
resourceSet( Cldr._resolved, normalizedPath, value );
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
return lookup;
|
||||
|
||||
}());
|
||||
|
||||
|
||||
Cldr._raw = {};
|
||||
|
||||
/**
|
||||
* Cldr.load( json [, json, ...] )
|
||||
*
|
||||
* @json [JSON] CLDR data or [Array] Array of @json's.
|
||||
*
|
||||
* Load resolved or unresolved cldr data.
|
||||
* Overwrite Cldr.load().
|
||||
*/
|
||||
Cldr.load = function() {
|
||||
Cldr._raw = coreLoad( Cldr, Cldr._raw, arguments );
|
||||
};
|
||||
|
||||
/**
|
||||
* Overwrite Cldr.prototype.get().
|
||||
*/
|
||||
Cldr.prototype.get = function( path ) {
|
||||
validatePresence( path, "path" );
|
||||
validateTypePath( path, "path" );
|
||||
|
||||
// 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
|
||||
// 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
|
||||
return itemLookup( Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes );
|
||||
};
|
||||
|
||||
// In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
|
||||
if ( Cldr._eventInit ) {
|
||||
Cldr._eventInit();
|
||||
}
|
||||
|
||||
return Cldr;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,3 +0,0 @@
|
||||
.popup-content input[type=color] {
|
||||
display:none;
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
.google-map, .map-overlay
|
||||
{
|
||||
background-color: #DBDBDB;
|
||||
background-image: url('../../src/img/map-load.gif');
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.map-overlay
|
||||
{
|
||||
background-color: rgba(219,219,219,0.5);
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.map-overlay .btn-close
|
||||
{
|
||||
top: 50%;
|
||||
margin-top: 80px;
|
||||
margin-left: calc(50% - 40px);
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
|
||||
.popup-content input[type=color]
|
||||
{
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
/*border: 1px solid #ccc;*/
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
height: 25px;
|
||||
padding: 0px !important;
|
||||
vertical-align: middle;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.popup-content .btn-popup-delete, .popup-content .btn-popup-save, .popup-content .btn-popup-cancel, .map-overlay .btn-close
|
||||
{
|
||||
border: 1px solid #df0909;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
padding: 5px 5px 5px 5px;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
background-color: #f62b2b;
|
||||
min-width: 85px;
|
||||
background-image: linear-gradient(to bottom, #f62b2b, #d20202);
|
||||
}
|
||||
|
||||
.popup-content .btn-popup-delete:hover, .map-overlay .btn-close:hover
|
||||
{
|
||||
border: 1px solid #b30808;
|
||||
background-color: #e40a0a;
|
||||
background-image: linear-gradient(to bottom, #e40a0a, #9f0202);
|
||||
}
|
||||
|
||||
.popup-content .btn-popup-cancel
|
||||
{
|
||||
color: #fef4e9;
|
||||
border: solid 1px #da7c0c;
|
||||
background: #f78d1d;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
|
||||
background: -moz-linear-gradient(top, #faa51a, #f47a20);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.popup-content .btn-popup-cancel:hover
|
||||
{
|
||||
background: #f47c20;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
|
||||
background: -moz-linear-gradient(top, #f88e11, #f06015);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
|
||||
}
|
||||
|
||||
.popup-content .btn-popup-save
|
||||
{
|
||||
color: #e8f0de;
|
||||
border: solid 1px #538312;
|
||||
background: #64991e;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e));
|
||||
background: -moz-linear-gradient(top, #7db72f, #4e7d0e);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e');
|
||||
}
|
||||
|
||||
.popup-content .btn-popup-save:hover
|
||||
{
|
||||
background: #538018;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c));
|
||||
background: -moz-linear-gradient(top, #6b9d28, #436b0c);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c');
|
||||
}
|
||||
|
||||
.popup-content input[type=text], .popup-content input[type=number], .popup-content select, .popup-content textarea
|
||||
{
|
||||
border: 1px solid #CCCCCC;
|
||||
border-radius: 3px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.popup-content textarea
|
||||
{
|
||||
height: 100px;
|
||||
width: 530px;
|
||||
}
|
||||
|
||||
.popup-content textarea.richtext-fix
|
||||
{
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
|
||||
.popup-content input[type=text], .popup-content input[type=number], .popup-content select
|
||||
{
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.popup-content table tr
|
||||
{
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
.error-icon
|
||||
{
|
||||
margin-left: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
.fit-bound, .current-location, .map-style
|
||||
{
|
||||
margin-left: -4px;
|
||||
margin-top: 5px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
z-index: 999;
|
||||
background-image: url(../img/fit-bounds.png);
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.map-style
|
||||
{
|
||||
min-width:100px;
|
||||
background-image:none;
|
||||
width:auto !important;
|
||||
}
|
||||
|
||||
.current-location
|
||||
{
|
||||
background-image: url(../img/current-location.png);
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.fit-bound:hover, .current-location:hover
|
||||
{
|
||||
background-color: #EBEBEB;
|
||||
}
|
||||
|
||||
/*JQuery simple color picker*/
|
||||
html, body
|
||||
{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div.color-picker
|
||||
{
|
||||
border-left: 1px solid #000;
|
||||
border-top: 1px solid #000;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div.color-picker ul
|
||||
{
|
||||
list-style: none;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.color-picker ul li
|
||||
{
|
||||
display: block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
margin: 0px;
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
}
|
1
web/Scripts/css/mapstyle.min.css
vendored
@ -1 +0,0 @@
|
||||
.google-map,.map-overlay{background-color:#DBDBDB;background-image:url(../../src/img/map-load.gif);background-position:center center;background-repeat:no-repeat}.map-overlay{background-color:rgba(219,219,219,.5);position:absolute;display:none}.map-overlay .btn-close{top:50%;margin-top:80px;margin-left:calc(50% - 40px);position:absolute}.popup-content input[type=color]{-webkit-appearance:none;-moz-appearance:none;border:none;border-radius:3px;display:inline-block;height:25px;padding:0!important;vertical-align:middle;width:25px}.map-overlay .btn-close,.popup-content .btn-popup-cancel,.popup-content .btn-popup-delete,.popup-content .btn-popup-save{border:1px solid #df0909;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;font-size:12px;font-family:arial,helvetica,sans-serif;padding:5px;text-decoration:none;display:inline-block;text-shadow:-1px -1px 0 rgba(0,0,0,.3);font-weight:700;color:#FFF;background-color:#f62b2b;min-width:85px;background-image:linear-gradient(to bottom,#f62b2b,#d20202)}.map-overlay .btn-close:hover,.popup-content .btn-popup-delete:hover{border:1px solid #b30808;background-color:#e40a0a;background-image:linear-gradient(to bottom,#e40a0a,#9f0202)}.popup-content .btn-popup-cancel{color:#fef4e9;border:1px solid #da7c0c;background:#f78d1d;background:-webkit-gradient(linear,left top,left bottom,from(#faa51a),to(#f47a20));background:-moz-linear-gradient(top,#faa51a,#f47a20);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');margin-right:30px}.popup-content .btn-popup-cancel:hover{background:#f47c20;background:-webkit-gradient(linear,left top,left bottom,from(#f88e11),to(#f06015));background:-moz-linear-gradient(top,#f88e11,#f06015);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015')}.popup-content .btn-popup-save{color:#e8f0de;border:1px solid #538312;background:#64991e;background:-webkit-gradient(linear,left top,left bottom,from(#7db72f),to(#4e7d0e));background:-moz-linear-gradient(top,#7db72f,#4e7d0e);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e')}.popup-content .btn-popup-save:hover{background:#538018;background:-webkit-gradient(linear,left top,left bottom,from(#6b9d28),to(#436b0c));background:-moz-linear-gradient(top,#6b9d28,#436b0c);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c')}.popup-content input[type=number],.popup-content input[type=text],.popup-content select,.popup-content textarea{border:1px solid #CCC;border-radius:3px;padding:3px}.popup-content textarea{height:100px;width:530px}.popup-content textarea.richtext-fix{margin-bottom:35px}.popup-content input[type=number],.popup-content input[type=text],.popup-content select{width:150px}.popup-content table tr{padding-top:6px;padding-bottom:6px}.error-icon{margin-left:4px;vertical-align:middle}.current-location,.fit-bound,.map-style{margin-left:-4px;margin-top:5px;background-color:#fff;border:1px solid rgba(0,0,0,.15);border-radius:2px;box-shadow:0 1px 4px -1px rgba(0,0,0,.3);width:26px;height:26px;z-index:999;background-image:url(../img/fit-bounds.png);background-position:center center;background-repeat:no-repeat;cursor:pointer}.map-style{min-width:100px;background-image:none;width:auto!important}.current-location{background-image:url(../img/current-location.png);margin-left:0}.current-location:hover,.fit-bound:hover{background-color:#EBEBEB}body,html{height:100%}div.color-picker{border-left:1px solid #000;border-top:1px solid #000;position:absolute;left:0;top:0;padding:0}div.color-picker ul{list-style:none;padding:0;margin:0;float:left}div.color-picker ul li{display:block;width:15px;height:15px;border-right:1px solid #000;border-bottom:1px solid #000;margin:0;float:left;cursor:pointer}
|
@ -1,355 +0,0 @@
|
||||
/**
|
||||
* Globalize v1.0.0
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-04-23T12:02Z
|
||||
*/
|
||||
/*!
|
||||
* Globalize v1.0.0 2015-04-23T12:02Z Released under the MIT license
|
||||
* http://git.io/TrdQbw
|
||||
*/
|
||||
(function( root, factory ) {
|
||||
|
||||
// UMD returnExports
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD
|
||||
define([
|
||||
"cldr",
|
||||
"cldr/event"
|
||||
], factory );
|
||||
} else if ( typeof exports === "object" ) {
|
||||
|
||||
// Node, CommonJS
|
||||
module.exports = factory( require( "cldrjs" ) );
|
||||
} else {
|
||||
|
||||
// Global
|
||||
root.Globalize = factory( root.Cldr );
|
||||
}
|
||||
}( this, function( Cldr ) {
|
||||
|
||||
|
||||
/**
|
||||
* A toString method that outputs meaningful values for objects or arrays and
|
||||
* still performs as fast as a plain string in case variable is string, or as
|
||||
* fast as `"" + number` in case variable is a number.
|
||||
* Ref: http://jsperf.com/my-stringify
|
||||
*/
|
||||
var toString = function( variable ) {
|
||||
return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" +
|
||||
variable : JSON.stringify( variable ) );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* formatMessage( message, data )
|
||||
*
|
||||
* @message [String] A message with optional {vars} to be replaced.
|
||||
*
|
||||
* @data [Array or JSON] Object with replacing-variables content.
|
||||
*
|
||||
* Return the formatted message. For example:
|
||||
*
|
||||
* - formatMessage( "{0} second", [ 1 ] ); // 1 second
|
||||
*
|
||||
* - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s
|
||||
*
|
||||
* - formatMessage( "{name} <{email}>", {
|
||||
* name: "Foo",
|
||||
* email: "bar@baz.qux"
|
||||
* }); // Foo <bar@baz.qux>
|
||||
*/
|
||||
var formatMessage = function( message, data ) {
|
||||
|
||||
// Replace {attribute}'s
|
||||
message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) {
|
||||
name = name.replace( /^{([^}]*)}$/, "$1" );
|
||||
return toString( data[ name ] );
|
||||
});
|
||||
|
||||
return message;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var objectExtend = function() {
|
||||
var destination = arguments[ 0 ],
|
||||
sources = [].slice.call( arguments, 1 );
|
||||
|
||||
sources.forEach(function( source ) {
|
||||
var prop;
|
||||
for ( prop in source ) {
|
||||
destination[ prop ] = source[ prop ];
|
||||
}
|
||||
});
|
||||
|
||||
return destination;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var createError = function( code, message, attributes ) {
|
||||
var error;
|
||||
|
||||
message = code + ( message ? ": " + formatMessage( message, attributes ) : "" );
|
||||
error = new Error( message );
|
||||
error.code = code;
|
||||
|
||||
objectExtend( error, attributes );
|
||||
|
||||
return error;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validate = function( code, message, check, attributes ) {
|
||||
if ( !check ) {
|
||||
throw createError( code, message, attributes );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var alwaysArray = function( stringOrArray ) {
|
||||
return Array.isArray( stringOrArray ) ? stringOrArray : stringOrArray ? [ stringOrArray ] : [];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateCldr = function( path, value, options ) {
|
||||
var skipBoolean;
|
||||
options = options || {};
|
||||
|
||||
skipBoolean = alwaysArray( options.skip ).some(function( pathRe ) {
|
||||
return pathRe.test( path );
|
||||
});
|
||||
|
||||
validate( "E_MISSING_CLDR", "Missing required CLDR content `{path}`.", value || skipBoolean, {
|
||||
path: path
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateDefaultLocale = function( value ) {
|
||||
validate( "E_DEFAULT_LOCALE_NOT_DEFINED", "Default locale has not been defined.",
|
||||
value !== undefined, {} );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateParameterPresence = function( value, name ) {
|
||||
validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.",
|
||||
value !== undefined, { name: name });
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* range( value, name, minimum, maximum )
|
||||
*
|
||||
* @value [Number].
|
||||
*
|
||||
* @name [String] name of variable.
|
||||
*
|
||||
* @minimum [Number]. The lowest valid value, inclusive.
|
||||
*
|
||||
* @maximum [Number]. The greatest valid value, inclusive.
|
||||
*/
|
||||
var validateParameterRange = function( value, name, minimum, maximum ) {
|
||||
validate(
|
||||
"E_PAR_OUT_OF_RANGE",
|
||||
"Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].",
|
||||
value === undefined || value >= minimum && value <= maximum,
|
||||
{
|
||||
maximum: maximum,
|
||||
minimum: minimum,
|
||||
name: name,
|
||||
value: value
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateParameterType = function( value, name, check, expected ) {
|
||||
validate(
|
||||
"E_INVALID_PAR_TYPE",
|
||||
"Invalid `{name}` parameter ({value}). {expected} expected.",
|
||||
check,
|
||||
{
|
||||
expected: expected,
|
||||
name: name,
|
||||
value: value
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateParameterTypeLocale = function( value, name ) {
|
||||
validateParameterType(
|
||||
value,
|
||||
name,
|
||||
value === undefined || typeof value === "string" || value instanceof Cldr,
|
||||
"String or Cldr instance"
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function inspired by jQuery Core, but reduced to our use case.
|
||||
*/
|
||||
var isPlainObject = function( obj ) {
|
||||
return obj !== null && "" + obj === "[object Object]";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateParameterTypePlainObject = function( value, name ) {
|
||||
validateParameterType(
|
||||
value,
|
||||
name,
|
||||
value === undefined || isPlainObject( value ),
|
||||
"Plain Object"
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var alwaysCldr = function( localeOrCldr ) {
|
||||
return localeOrCldr instanceof Cldr ? localeOrCldr : new Cldr( localeOrCldr );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions
|
||||
var regexpEscape = function( string ) {
|
||||
return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var stringPad = function( str, count, right ) {
|
||||
var length;
|
||||
if ( typeof str !== "string" ) {
|
||||
str = String( str );
|
||||
}
|
||||
for ( length = str.length; length < count; length += 1 ) {
|
||||
str = ( right ? ( str + "0" ) : ( "0" + str ) );
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
function validateLikelySubtags( cldr ) {
|
||||
cldr.once( "get", validateCldr );
|
||||
cldr.get( "supplemental/likelySubtags" );
|
||||
}
|
||||
|
||||
/**
|
||||
* [new] Globalize( locale|cldr )
|
||||
*
|
||||
* @locale [String]
|
||||
*
|
||||
* @cldr [Cldr instance]
|
||||
*
|
||||
* Create a Globalize instance.
|
||||
*/
|
||||
function Globalize( locale ) {
|
||||
if ( !( this instanceof Globalize ) ) {
|
||||
return new Globalize( locale );
|
||||
}
|
||||
|
||||
validateParameterPresence( locale, "locale" );
|
||||
validateParameterTypeLocale( locale, "locale" );
|
||||
|
||||
this.cldr = alwaysCldr( locale );
|
||||
|
||||
validateLikelySubtags( this.cldr );
|
||||
}
|
||||
|
||||
/**
|
||||
* Globalize.load( json, ... )
|
||||
*
|
||||
* @json [JSON]
|
||||
*
|
||||
* Load resolved or unresolved cldr data.
|
||||
* Somewhat equivalent to previous Globalize.addCultureInfo(...).
|
||||
*/
|
||||
Globalize.load = function() {
|
||||
// validations are delegated to Cldr.load().
|
||||
Cldr.load.apply( Cldr, arguments );
|
||||
};
|
||||
|
||||
/**
|
||||
* Globalize.locale( [locale|cldr] )
|
||||
*
|
||||
* @locale [String]
|
||||
*
|
||||
* @cldr [Cldr instance]
|
||||
*
|
||||
* Set default Cldr instance if locale or cldr argument is passed.
|
||||
*
|
||||
* Return the default Cldr instance.
|
||||
*/
|
||||
Globalize.locale = function( locale ) {
|
||||
validateParameterTypeLocale( locale, "locale" );
|
||||
|
||||
if ( arguments.length ) {
|
||||
this.cldr = alwaysCldr( locale );
|
||||
validateLikelySubtags( this.cldr );
|
||||
}
|
||||
return this.cldr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Optimization to avoid duplicating some internal functions across modules.
|
||||
*/
|
||||
Globalize._alwaysArray = alwaysArray;
|
||||
Globalize._createError = createError;
|
||||
Globalize._formatMessage = formatMessage;
|
||||
Globalize._isPlainObject = isPlainObject;
|
||||
Globalize._objectExtend = objectExtend;
|
||||
Globalize._regexpEscape = regexpEscape;
|
||||
Globalize._stringPad = stringPad;
|
||||
Globalize._validate = validate;
|
||||
Globalize._validateCldr = validateCldr;
|
||||
Globalize._validateDefaultLocale = validateDefaultLocale;
|
||||
Globalize._validateParameterPresence = validateParameterPresence;
|
||||
Globalize._validateParameterRange = validateParameterRange;
|
||||
Globalize._validateParameterTypePlainObject = validateParameterTypePlainObject;
|
||||
Globalize._validateParameterType = validateParameterType;
|
||||
|
||||
return Globalize;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,413 +0,0 @@
|
||||
/*!
|
||||
* Globalize v1.0.0
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-04-23T12:02Z
|
||||
*/
|
||||
(function( root, factory ) {
|
||||
|
||||
// UMD returnExports
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD
|
||||
define([
|
||||
"cldr",
|
||||
"../globalize",
|
||||
"./number",
|
||||
"cldr/event",
|
||||
"cldr/supplemental"
|
||||
], factory );
|
||||
} else if ( typeof exports === "object" ) {
|
||||
|
||||
// Node, CommonJS
|
||||
module.exports = factory( require( "cldrjs" ), require( "globalize" ) );
|
||||
} else {
|
||||
|
||||
// Global
|
||||
factory( root.Cldr, root.Globalize );
|
||||
}
|
||||
}(this, function( Cldr, Globalize ) {
|
||||
|
||||
var alwaysArray = Globalize._alwaysArray,
|
||||
formatMessage = Globalize._formatMessage,
|
||||
numberNumberingSystem = Globalize._numberNumberingSystem,
|
||||
numberPattern = Globalize._numberPattern,
|
||||
stringPad = Globalize._stringPad,
|
||||
validate = Globalize._validate,
|
||||
validateCldr = Globalize._validateCldr,
|
||||
validateDefaultLocale = Globalize._validateDefaultLocale,
|
||||
validateParameterPresence = Globalize._validateParameterPresence,
|
||||
validateParameterType = Globalize._validateParameterType,
|
||||
validateParameterTypeNumber = Globalize._validateParameterTypeNumber,
|
||||
validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject;
|
||||
|
||||
|
||||
var validateParameterTypeCurrency = function( value, name ) {
|
||||
validateParameterType(
|
||||
value,
|
||||
name,
|
||||
value === undefined || typeof value === "string" && ( /^[A-Za-z]{3}$/ ).test( value ),
|
||||
"3-letter currency code string as defined by ISO 4217"
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validatePluralModulePresence = function() {
|
||||
validate( "E_MISSING_PLURAL_MODULE", "Plural module not loaded.",
|
||||
Globalize.plural !== undefined, {} );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* supplementalOverride( currency, pattern, cldr )
|
||||
*
|
||||
* Return pattern with fraction digits overriden by supplemental currency data.
|
||||
*/
|
||||
var currencySupplementalOverride = function( currency, pattern, cldr ) {
|
||||
var digits,
|
||||
fraction = cldr.supplemental([ "currencyData/fractions", currency ]) ||
|
||||
cldr.supplemental( "currencyData/fractions/DEFAULT" );
|
||||
|
||||
digits = +fraction._digits;
|
||||
|
||||
if ( digits ) {
|
||||
fraction = "." + stringPad( "0", digits ).slice( 0, -1 ) + fraction._rounding;
|
||||
} else {
|
||||
fraction = "";
|
||||
}
|
||||
|
||||
return pattern.replace( /\.(#+|0*[0-9]|0+[0-9]?)/g, fraction );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var objectFilter = function( object, testRe ) {
|
||||
var key,
|
||||
copy = {};
|
||||
|
||||
for ( key in object ) {
|
||||
if ( testRe.test( key ) ) {
|
||||
copy[ key ] = object[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
return copy;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var currencyUnitPatterns = function( cldr ) {
|
||||
return objectFilter( cldr.main([
|
||||
"numbers",
|
||||
"currencyFormats-numberSystem-" + numberNumberingSystem( cldr )
|
||||
]), /^unitPattern/ );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* codeProperties( currency, cldr )
|
||||
*
|
||||
* Return number pattern with the appropriate currency code in as literal.
|
||||
*/
|
||||
var currencyCodeProperties = function( currency, cldr ) {
|
||||
var pattern = numberPattern( "decimal", cldr );
|
||||
|
||||
// The number of decimal places and the rounding for each currency is not locale-specific. Those
|
||||
// values overridden by Supplemental Currency Data.
|
||||
pattern = currencySupplementalOverride( currency, pattern, cldr );
|
||||
|
||||
return {
|
||||
currency: currency,
|
||||
pattern: pattern,
|
||||
unitPatterns: currencyUnitPatterns( cldr )
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* nameFormat( formattedNumber, pluralForm, properties )
|
||||
*
|
||||
* Return the appropriate name form currency format.
|
||||
*/
|
||||
var currencyNameFormat = function( formattedNumber, pluralForm, properties ) {
|
||||
var displayName, unitPattern,
|
||||
displayNames = properties.displayNames || {},
|
||||
unitPatterns = properties.unitPatterns;
|
||||
|
||||
displayName = displayNames[ "displayName-count-" + pluralForm ] ||
|
||||
displayNames[ "displayName-count-other" ] ||
|
||||
displayNames.displayName ||
|
||||
properties.currency;
|
||||
unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] ||
|
||||
unitPatterns[ "unitPattern-count-other" ];
|
||||
|
||||
return formatMessage( unitPattern, [ formattedNumber, displayName ]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* nameProperties( currency, cldr )
|
||||
*
|
||||
* Return number pattern with the appropriate currency code in as literal.
|
||||
*/
|
||||
var currencyNameProperties = function( currency, cldr ) {
|
||||
var properties = currencyCodeProperties( currency, cldr );
|
||||
|
||||
properties.displayNames = objectFilter( cldr.main([
|
||||
"numbers/currencies",
|
||||
currency
|
||||
]), /^displayName/ );
|
||||
|
||||
return properties;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Unicode regular expression for: everything except math symbols, currency signs, dingbats, and
|
||||
* box-drawing characters.
|
||||
*
|
||||
* Generated by:
|
||||
*
|
||||
* regenerate()
|
||||
* .addRange( 0x0, 0x10FFFF )
|
||||
* .remove( require( "unicode-7.0.0/categories/S/symbols" ) ).toString();
|
||||
*
|
||||
* https://github.com/mathiasbynens/regenerate
|
||||
* https://github.com/mathiasbynens/unicode-7.0.0
|
||||
*/
|
||||
var regexpNotS = /[\0-#%-\*,-;\?-\]_a-\{\}\x7F-\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-\xB7\xB9-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0383\u0386-\u03F5\u03F7-\u0481\u0483-\u058C\u0590-\u0605\u0609\u060A\u060C\u060D\u0610-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF-\u07F5\u07F7-\u09F1\u09F4-\u09F9\u09FC-\u0AF0\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C7E\u0C80-\u0D78\u0D7A-\u0E3E\u0E40-\u0F00\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39-\u0FBD\u0FC6\u0FCD\u0FD0-\u0FD4\u0FD9-\u109D\u10A0-\u138F\u139A-\u17DA\u17DC-\u193F\u1941-\u19DD\u1A00-\u1B60\u1B6B-\u1B73\u1B7D-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF-\u2043\u2045-\u2051\u2053-\u2079\u207D-\u2089\u208D-\u209F\u20BE-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u218F\u2308-\u230B\u2329\u232A\u23FB-\u23FF\u2427-\u243F\u244B-\u249B\u24EA-\u24FF\u2768-\u2793\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2CE4\u2CEB-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u3003\u3005-\u3011\u3014-\u301F\u3021-\u3035\u3038-\u303D\u3040-\u309A\u309D-\u318F\u3192-\u3195\u31A0-\u31BF\u31E4-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u32FF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uAA76\uAA7A-\uAB5A\uAB5C-\uD7FF\uDC00-\uFB28\uFB2A-\uFBB1\uFBC2-\uFDFB\uFDFE-\uFE61\uFE63\uFE67\uFE68\uFE6A-\uFF03\uFF05-\uFF0A\uFF0C-\uFF1B\uFF1F-\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5F-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8D-\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDFFF]|[\uD801\uD803-\uD819\uD81B-\uD82E\uD830-\uD833\uD836-\uD83A\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDC76\uDC79-\uDEC7\uDEC9-\uDFFF]|\uD81A[\uDC00-\uDF3B\uDF40-\uDF44\uDF46-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDDE-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD83B[\uDC00-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF2D-\uDF2F\uDF7E\uDF7F\uDFCF-\uDFD3\uDFF8-\uDFFF]|\uD83D[\uDCFF\uDD4B-\uDD4F\uDD7A\uDDA4\uDE43\uDE44\uDED0-\uDEDF\uDEED-\uDEEF\uDEF4-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDFFF]|[\uD800-\uDBFF]/;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* symbolProperties( currency, cldr )
|
||||
*
|
||||
* Return pattern replacing `¤` with the appropriate currency symbol literal.
|
||||
*/
|
||||
var currencySymbolProperties = function( currency, cldr, options ) {
|
||||
var currencySpacing, pattern,
|
||||
regexp = {
|
||||
"[:digit:]": /\d/,
|
||||
"[:^S:]": regexpNotS
|
||||
},
|
||||
symbol = cldr.main([
|
||||
"numbers/currencies",
|
||||
currency,
|
||||
"symbol"
|
||||
]);
|
||||
|
||||
currencySpacing = [ "beforeCurrency", "afterCurrency" ].map(function( position ) {
|
||||
return cldr.main([
|
||||
"numbers",
|
||||
"currencyFormats-numberSystem-" + numberNumberingSystem( cldr ),
|
||||
"currencySpacing",
|
||||
position
|
||||
]);
|
||||
});
|
||||
|
||||
pattern = cldr.main([
|
||||
"numbers",
|
||||
"currencyFormats-numberSystem-" + numberNumberingSystem( cldr ),
|
||||
options.style === "accounting" ? "accounting" : "standard"
|
||||
]);
|
||||
|
||||
pattern =
|
||||
|
||||
// The number of decimal places and the rounding for each currency is not locale-specific.
|
||||
// Those values are overridden by Supplemental Currency Data.
|
||||
currencySupplementalOverride( currency, pattern, cldr )
|
||||
|
||||
// Replace "¤" (\u00A4) with the appropriate symbol literal.
|
||||
.split( ";" ).map(function( pattern ) {
|
||||
|
||||
return pattern.split( "\u00A4" ).map(function( part, i ) {
|
||||
var currencyMatch = regexp[ currencySpacing[ i ].currencyMatch ],
|
||||
surroundingMatch = regexp[ currencySpacing[ i ].surroundingMatch ],
|
||||
insertBetween = "";
|
||||
|
||||
// For currencyMatch and surroundingMatch definitions, read [1].
|
||||
// When i === 0, beforeCurrency is being handled. Otherwise, afterCurrency.
|
||||
// 1: http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies
|
||||
currencyMatch = currencyMatch.test( symbol.charAt( i ? symbol.length - 1 : 0 ) );
|
||||
surroundingMatch = surroundingMatch.test(
|
||||
part.charAt( i ? 0 : part.length - 1 ).replace( /[#@,.]/g, "0" )
|
||||
);
|
||||
|
||||
if ( currencyMatch && part && surroundingMatch ) {
|
||||
insertBetween = currencySpacing[ i ].insertBetween;
|
||||
}
|
||||
|
||||
return ( i ? insertBetween : "" ) + part + ( i ? "" : insertBetween );
|
||||
}).join( "'" + symbol + "'" );
|
||||
}).join( ";" );
|
||||
|
||||
return {
|
||||
pattern: pattern
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* objectOmit( object, keys )
|
||||
*
|
||||
* Return a copy of the object, filtered to omit the blacklisted key or array of keys.
|
||||
*/
|
||||
var objectOmit = function( object, keys ) {
|
||||
var key,
|
||||
copy = {};
|
||||
|
||||
keys = alwaysArray( keys );
|
||||
|
||||
for ( key in object ) {
|
||||
if ( keys.indexOf( key ) === -1 ) {
|
||||
copy[ key ] = object[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
return copy;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
function validateRequiredCldr( path, value ) {
|
||||
validateCldr( path, value, {
|
||||
skip: [ /supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/ ]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* .currencyFormatter( currency [, options] )
|
||||
*
|
||||
* @currency [String] 3-letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @options [Object]:
|
||||
* - style: [String] "symbol" (default), "accounting", "code" or "name".
|
||||
* - see also number/format options.
|
||||
*
|
||||
* Return a function that formats a currency according to the given options and default/instance
|
||||
* locale.
|
||||
*/
|
||||
Globalize.currencyFormatter =
|
||||
Globalize.prototype.currencyFormatter = function( currency, options ) {
|
||||
var cldr, numberFormatter, plural, properties, style;
|
||||
|
||||
validateParameterPresence( currency, "currency" );
|
||||
validateParameterTypeCurrency( currency, "currency" );
|
||||
|
||||
validateParameterTypePlainObject( options, "options" );
|
||||
|
||||
options = options || {};
|
||||
style = options.style || "symbol";
|
||||
cldr = this.cldr;
|
||||
|
||||
validateDefaultLocale( cldr );
|
||||
|
||||
// Get properties given style ("symbol" default, "code" or "name").
|
||||
cldr.on( "get", validateRequiredCldr );
|
||||
properties = ({
|
||||
accounting: currencySymbolProperties,
|
||||
code: currencyCodeProperties,
|
||||
name: currencyNameProperties,
|
||||
symbol: currencySymbolProperties
|
||||
}[ style ] )( currency, cldr, options );
|
||||
cldr.off( "get", validateRequiredCldr );
|
||||
|
||||
// options = options minus style, plus raw pattern.
|
||||
options = objectOmit( options, "style" );
|
||||
options.raw = properties.pattern;
|
||||
|
||||
// Return formatter when style is "symbol" or "accounting".
|
||||
if ( style === "symbol" || style === "accounting" ) {
|
||||
return this.numberFormatter( options );
|
||||
}
|
||||
|
||||
// Return formatter when style is "code" or "name".
|
||||
validatePluralModulePresence();
|
||||
numberFormatter = this.numberFormatter( options );
|
||||
plural = this.pluralGenerator();
|
||||
return function( value ) {
|
||||
validateParameterPresence( value, "value" );
|
||||
validateParameterTypeNumber( value, "value" );
|
||||
return currencyNameFormat( numberFormatter( value ), plural( value ), properties );
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* .currencyParser( currency [, options] )
|
||||
*
|
||||
* @currency [String] 3-letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @options [Object] see currencyFormatter.
|
||||
*
|
||||
* Return the currency parser according to the given options and the default/instance locale.
|
||||
*/
|
||||
Globalize.currencyParser =
|
||||
Globalize.prototype.currencyParser = function( /* currency, options */ ) {
|
||||
|
||||
// TODO implement parser.
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* .formatCurrency( value, currency [, options] )
|
||||
*
|
||||
* @value [Number] number to be formatted.
|
||||
*
|
||||
* @currency [String] 3-letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @options [Object] see currencyFormatter.
|
||||
*
|
||||
* Format a currency according to the given options and the default/instance locale.
|
||||
*/
|
||||
Globalize.formatCurrency =
|
||||
Globalize.prototype.formatCurrency = function( value, currency, options ) {
|
||||
validateParameterPresence( value, "value" );
|
||||
validateParameterTypeNumber( value, "value" );
|
||||
|
||||
return this.currencyFormatter( currency, options )( value );
|
||||
};
|
||||
|
||||
/**
|
||||
* .parseCurrency( value, currency [, options] )
|
||||
*
|
||||
* @value [String]
|
||||
*
|
||||
* @currency [String] 3-letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @options [Object]: See currencyFormatter.
|
||||
*
|
||||
* Return the parsed currency or NaN when value is invalid.
|
||||
*/
|
||||
Globalize.parseCurrency =
|
||||
Globalize.prototype.parseCurrency = function( /* value, currency, options */ ) {
|
||||
};
|
||||
|
||||
return Globalize;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,359 +0,0 @@
|
||||
/**
|
||||
* Globalize v1.0.0
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-04-23T12:02Z
|
||||
*/
|
||||
/*!
|
||||
* Globalize v1.0.0 2015-04-23T12:02Z Released under the MIT license
|
||||
* http://git.io/TrdQbw
|
||||
*/
|
||||
(function( root, factory ) {
|
||||
|
||||
// UMD returnExports
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD
|
||||
define([
|
||||
"cldr",
|
||||
"../globalize",
|
||||
"cldr/event",
|
||||
"cldr/supplemental"
|
||||
], factory );
|
||||
} else if ( typeof exports === "object" ) {
|
||||
|
||||
// Node, CommonJS
|
||||
module.exports = factory( require( "cldrjs" ), require( "globalize" ) );
|
||||
} else {
|
||||
|
||||
// Global
|
||||
factory( root.Cldr, root.Globalize );
|
||||
}
|
||||
}(this, function( Cldr, Globalize ) {
|
||||
|
||||
var validateCldr = Globalize._validateCldr,
|
||||
validateDefaultLocale = Globalize._validateDefaultLocale,
|
||||
validateParameterPresence = Globalize._validateParameterPresence,
|
||||
validateParameterType = Globalize._validateParameterType,
|
||||
validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject;
|
||||
var MakePlural;
|
||||
/* jshint ignore:start */
|
||||
MakePlural = (function() {
|
||||
|
||||
|
||||
var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); };
|
||||
|
||||
var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
|
||||
|
||||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
|
||||
/**
|
||||
* make-plural.js -- https://github.com/eemeli/make-plural.js/
|
||||
* Copyright (c) 2014-2015 by Eemeli Aro <eemeli@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* The software is provided "as is" and the author disclaims all warranties
|
||||
* with regard to this software including all implied warranties of
|
||||
* merchantability and fitness. In no event shall the author be liable for
|
||||
* any special, direct, indirect, or consequential damages or any damages
|
||||
* whatsoever resulting from loss of use, data or profits, whether in an
|
||||
* action of contract, negligence or other tortious action, arising out of
|
||||
* or in connection with the use or performance of this software.
|
||||
*/
|
||||
|
||||
var Parser = (function () {
|
||||
function Parser() {
|
||||
_classCallCheck(this, Parser);
|
||||
}
|
||||
|
||||
_createClass(Parser, [{
|
||||
key: 'parse',
|
||||
value: function parse(cond) {
|
||||
var _this = this;
|
||||
|
||||
if (cond === 'i = 0 or n = 1') {
|
||||
return 'n >= 0 && n <= 1';
|
||||
}if (cond === 'i = 0,1') {
|
||||
return 'n >= 0 && n < 2';
|
||||
}if (cond === 'i = 1 and v = 0') {
|
||||
this.v0 = 1;
|
||||
return 'n == 1 && v0';
|
||||
}
|
||||
return cond.replace(/([tv]) (!?)= 0/g, function (m, sym, noteq) {
|
||||
var sn = sym + '0';
|
||||
_this[sn] = 1;
|
||||
return noteq ? '!' + sn : sn;
|
||||
}).replace(/\b[fintv]\b/g, function (m) {
|
||||
_this[m] = 1;
|
||||
return m;
|
||||
}).replace(/([fin]) % (10+)/g, function (m, sym, num) {
|
||||
var sn = sym + num;
|
||||
_this[sn] = 1;
|
||||
return sn;
|
||||
}).replace(/n10+ = 0/g, 't0 && $&').replace(/(\w+ (!?)= )([0-9.]+,[0-9.,]+)/g, function (m, se, noteq, x) {
|
||||
if (m === 'n = 0,1') return '(n == 0 || n == 1)';
|
||||
if (noteq) return se + x.split(',').join(' && ' + se);
|
||||
return '(' + se + x.split(',').join(' || ' + se) + ')';
|
||||
}).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g, function (m, sym, noteq, x0, x1) {
|
||||
if (Number(x0) + 1 === Number(x1)) {
|
||||
if (noteq) return '' + sym + ' != ' + x0 + ' && ' + sym + ' != ' + x1;
|
||||
return '(' + sym + ' == ' + x0 + ' || ' + sym + ' == ' + x1 + ')';
|
||||
}
|
||||
if (noteq) return '(' + sym + ' < ' + x0 + ' || ' + sym + ' > ' + x1 + ')';
|
||||
if (sym === 'n') {
|
||||
_this.t0 = 1;return '(t0 && n >= ' + x0 + ' && n <= ' + x1 + ')';
|
||||
}
|
||||
return '(' + sym + ' >= ' + x0 + ' && ' + sym + ' <= ' + x1 + ')';
|
||||
}).replace(/ and /g, ' && ').replace(/ or /g, ' || ').replace(/ = /g, ' == ');
|
||||
}
|
||||
}, {
|
||||
key: 'vars',
|
||||
value: (function (_vars) {
|
||||
function vars() {
|
||||
return _vars.apply(this, arguments);
|
||||
}
|
||||
|
||||
vars.toString = function () {
|
||||
return _vars.toString();
|
||||
};
|
||||
|
||||
return vars;
|
||||
})(function () {
|
||||
var vars = [];
|
||||
if (this.i) vars.push('i = s[0]');
|
||||
if (this.f || this.v) vars.push('f = s[1] || \'\'');
|
||||
if (this.t) vars.push('t = (s[1] || \'\').replace(/0+$/, \'\')');
|
||||
if (this.v) vars.push('v = f.length');
|
||||
if (this.v0) vars.push('v0 = !s[1]');
|
||||
if (this.t0 || this.n10 || this.n100) vars.push('t0 = Number(s[0]) == n');
|
||||
for (var k in this) {
|
||||
if (/^.10+$/.test(k)) {
|
||||
var k0 = k[0] === 'n' ? 't0 && s[0]' : k[0];
|
||||
vars.push('' + k + ' = ' + k0 + '.slice(-' + k.substr(2).length + ')');
|
||||
}
|
||||
}if (!vars.length) return '';
|
||||
return 'var ' + ['s = String(n).split(\'.\')'].concat(vars).join(', ');
|
||||
})
|
||||
}]);
|
||||
|
||||
return Parser;
|
||||
})();
|
||||
|
||||
|
||||
|
||||
var MakePlural = (function () {
|
||||
function MakePlural(lc) {
|
||||
var _ref = arguments[1] === undefined ? MakePlural : arguments[1];
|
||||
|
||||
var cardinals = _ref.cardinals;
|
||||
var ordinals = _ref.ordinals;
|
||||
|
||||
_classCallCheck(this, MakePlural);
|
||||
|
||||
if (!cardinals && !ordinals) throw new Error('At least one type of plural is required');
|
||||
this.lc = lc;
|
||||
this.categories = { cardinal: [], ordinal: [] };
|
||||
this.parser = new Parser();
|
||||
|
||||
this.fn = this.buildFunction(cardinals, ordinals);
|
||||
this.fn._obj = this;
|
||||
this.fn.categories = this.categories;
|
||||
|
||||
this.fn.toString = this.fnToString.bind(this);
|
||||
return this.fn;
|
||||
}
|
||||
|
||||
_createClass(MakePlural, [{
|
||||
key: 'compile',
|
||||
value: function compile(type, req) {
|
||||
var cases = [];
|
||||
var rules = MakePlural.rules[type][this.lc];
|
||||
if (!rules) {
|
||||
if (req) throw new Error('Locale "' + this.lc + '" ' + type + ' rules not found');
|
||||
this.categories[type] = ['other'];
|
||||
return '\'other\'';
|
||||
}
|
||||
for (var r in rules) {
|
||||
var _rules$r$trim$split = rules[r].trim().split(/\s*@\w*/);
|
||||
|
||||
var _rules$r$trim$split2 = _toArray(_rules$r$trim$split);
|
||||
|
||||
var cond = _rules$r$trim$split2[0];
|
||||
var examples = _rules$r$trim$split2.slice(1);
|
||||
var cat = r.replace('pluralRule-count-', '');
|
||||
if (cond) cases.push([this.parser.parse(cond), cat]);
|
||||
|
||||
}
|
||||
this.categories[type] = cases.map(function (c) {
|
||||
return c[1];
|
||||
}).concat('other');
|
||||
if (cases.length === 1) {
|
||||
return '(' + cases[0][0] + ') ? \'' + cases[0][1] + '\' : \'other\'';
|
||||
} else {
|
||||
return [].concat(_toConsumableArray(cases.map(function (c) {
|
||||
return '(' + c[0] + ') ? \'' + c[1] + '\'';
|
||||
})), ['\'other\'']).join('\n : ');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'buildFunction',
|
||||
value: function buildFunction(cardinals, ordinals) {
|
||||
var _this3 = this;
|
||||
|
||||
var compile = function compile(c) {
|
||||
return c ? (c[1] ? 'return ' : 'if (ord) return ') + _this3.compile.apply(_this3, _toConsumableArray(c)) : '';
|
||||
},
|
||||
fold = { vars: function vars(str) {
|
||||
return (' ' + str + ';').replace(/(.{1,78})(,|$) ?/g, '$1$2\n ');
|
||||
},
|
||||
cond: function cond(str) {
|
||||
return (' ' + str + ';').replace(/(.{1,78}) (\|\| |$) ?/gm, '$1\n $2');
|
||||
} },
|
||||
cond = [ordinals && ['ordinal', !cardinals], cardinals && ['cardinal', true]].map(compile).map(fold.cond),
|
||||
body = [fold.vars(this.parser.vars())].concat(_toConsumableArray(cond)).join('\n').replace(/\s+$/gm, '').replace(/^[\s;]*[\r\n]+/gm, ''),
|
||||
args = ordinals && cardinals ? 'n, ord' : 'n';
|
||||
return new Function(args, body);
|
||||
}
|
||||
}, {
|
||||
key: 'fnToString',
|
||||
value: function fnToString(name) {
|
||||
return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/, name ? 'function ' + name : 'function').replace('\n/**/', '');
|
||||
}
|
||||
}], [{
|
||||
key: 'load',
|
||||
value: function load() {
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
args.forEach(function (cldr) {
|
||||
var data = cldr && cldr.supplemental || null;
|
||||
if (!data) throw new Error('Data does not appear to be CLDR data');
|
||||
MakePlural.rules = {
|
||||
cardinal: data['plurals-type-cardinal'] || MakePlural.rules.cardinal,
|
||||
ordinal: data['plurals-type-ordinal'] || MakePlural.rules.ordinal
|
||||
};
|
||||
});
|
||||
return MakePlural;
|
||||
}
|
||||
}]);
|
||||
|
||||
return MakePlural;
|
||||
})();
|
||||
|
||||
|
||||
|
||||
MakePlural.cardinals = true;
|
||||
MakePlural.ordinals = false;
|
||||
MakePlural.rules = { cardinal: {}, ordinal: {} };
|
||||
|
||||
|
||||
return MakePlural;
|
||||
}());
|
||||
/* jshint ignore:end */
|
||||
|
||||
|
||||
var validateParameterTypeNumber = function( value, name ) {
|
||||
validateParameterType(
|
||||
value,
|
||||
name,
|
||||
value === undefined || typeof value === "number",
|
||||
"Number"
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var validateParameterTypePluralType = function( value, name ) {
|
||||
validateParameterType(
|
||||
value,
|
||||
name,
|
||||
value === undefined || value === "cardinal" || value === "ordinal",
|
||||
"String \"cardinal\" or \"ordinal\""
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* .plural( value )
|
||||
*
|
||||
* @value [Number]
|
||||
*
|
||||
* Return the corresponding form (zero | one | two | few | many | other) of a
|
||||
* value given locale.
|
||||
*/
|
||||
Globalize.plural =
|
||||
Globalize.prototype.plural = function( value, options ) {
|
||||
validateParameterPresence( value, "value" );
|
||||
validateParameterTypeNumber( value, "value" );
|
||||
return this.pluralGenerator( options )( value );
|
||||
};
|
||||
|
||||
/**
|
||||
* .pluralGenerator( [options] )
|
||||
*
|
||||
* Return a plural function (of the form below).
|
||||
*
|
||||
* fn( value )
|
||||
*
|
||||
* @value [Number]
|
||||
*
|
||||
* Return the corresponding form (zero | one | two | few | many | other) of a value given the
|
||||
* default/instance locale.
|
||||
*/
|
||||
Globalize.pluralGenerator =
|
||||
Globalize.prototype.pluralGenerator = function( options ) {
|
||||
var cldr, isOrdinal, plural, type;
|
||||
|
||||
validateParameterTypePlainObject( options, "options" );
|
||||
|
||||
options = options || {};
|
||||
type = options.type || "cardinal";
|
||||
cldr = this.cldr;
|
||||
|
||||
validateParameterTypePluralType( options.type, "options.type" );
|
||||
|
||||
validateDefaultLocale( cldr );
|
||||
|
||||
isOrdinal = type === "ordinal";
|
||||
|
||||
cldr.on( "get", validateCldr );
|
||||
cldr.supplemental([ "plurals-type-" + type, "{language}" ]);
|
||||
cldr.off( "get", validateCldr );
|
||||
|
||||
MakePlural.rules = {};
|
||||
MakePlural.rules[ type ] = cldr.supplemental( "plurals-type-" + type );
|
||||
|
||||
plural = new MakePlural( cldr.attributes.language, {
|
||||
"ordinals": isOrdinal,
|
||||
"cardinals": !isOrdinal
|
||||
});
|
||||
|
||||
return function( value ) {
|
||||
validateParameterPresence( value, "value" );
|
||||
validateParameterTypeNumber( value, "value" );
|
||||
|
||||
return plural( value );
|
||||
};
|
||||
};
|
||||
|
||||
return Globalize;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,187 +0,0 @@
|
||||
/**
|
||||
* Globalize v1.0.0
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Date: 2015-04-23T12:02Z
|
||||
*/
|
||||
/*!
|
||||
* Globalize v1.0.0 2015-04-23T12:02Z Released under the MIT license
|
||||
* http://git.io/TrdQbw
|
||||
*/
|
||||
(function( root, factory ) {
|
||||
|
||||
// UMD returnExports
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD
|
||||
define([
|
||||
"cldr",
|
||||
"../globalize",
|
||||
"./number",
|
||||
"./plural",
|
||||
"cldr/event",
|
||||
"cldr/supplemental"
|
||||
], factory );
|
||||
} else if ( typeof exports === "object" ) {
|
||||
|
||||
// Node, CommonJS
|
||||
module.exports = factory( require( "cldrjs" ), require( "globalize" ) );
|
||||
} else {
|
||||
|
||||
// Extend global
|
||||
factory( root.Cldr, root.Globalize );
|
||||
}
|
||||
}(this, function( Cldr, Globalize ) {
|
||||
|
||||
var formatMessage = Globalize._formatMessage,
|
||||
validateCldr = Globalize._validateCldr,
|
||||
validateDefaultLocale = Globalize._validateDefaultLocale,
|
||||
validateParameterPresence = Globalize._validateParameterPresence,
|
||||
validateParameterTypeString = Globalize._validateParameterTypeString,
|
||||
validateParameterTypeNumber = Globalize._validateParameterTypeNumber;
|
||||
|
||||
|
||||
/**
|
||||
* format( value, numberFormatter, pluralGenerator, properties )
|
||||
*
|
||||
* @value [Number] The number to format
|
||||
*
|
||||
* @numberFormatter [String] A numberFormatter from Globalize.numberFormatter
|
||||
*
|
||||
* @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator
|
||||
*
|
||||
* @properties [Object] containing relative time plural message.
|
||||
*
|
||||
* Format relative time.
|
||||
*/
|
||||
var relativeTimeFormat = function( value, numberFormatter, pluralGenerator, properties ) {
|
||||
|
||||
var relativeTime,
|
||||
message = properties[ "relative-type-" + value ];
|
||||
|
||||
if ( message ) {
|
||||
return message;
|
||||
}
|
||||
|
||||
relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ]
|
||||
: properties[ "relativeTime-type-future" ];
|
||||
|
||||
value = Math.abs( value );
|
||||
|
||||
message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ];
|
||||
return formatMessage( message, [ numberFormatter( value ) ] );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* properties( unit, cldr, options )
|
||||
*
|
||||
* @unit [String] eg. "day", "week", "month", etc.
|
||||
*
|
||||
* @cldr [Cldr instance].
|
||||
*
|
||||
* @options [Object]
|
||||
* - form: [String] eg. "short" or "narrow". Or falsy for default long form.
|
||||
*
|
||||
* Return relative time properties.
|
||||
*/
|
||||
var relativeTimeProperties = function( unit, cldr, options ) {
|
||||
|
||||
var form = options.form,
|
||||
raw, properties, key, match;
|
||||
|
||||
if ( form ) {
|
||||
unit = unit + "-" + form;
|
||||
}
|
||||
|
||||
raw = cldr.main( [ "dates", "fields", unit ] );
|
||||
properties = {
|
||||
"relativeTime-type-future": raw[ "relativeTime-type-future" ],
|
||||
"relativeTime-type-past": raw[ "relativeTime-type-past" ]
|
||||
};
|
||||
for ( key in raw ) {
|
||||
if ( raw.hasOwnProperty( key ) ) {
|
||||
match = /relative-type-(-?[0-9]+)/.exec( key );
|
||||
if ( match ) {
|
||||
properties[ key ] = raw[ key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return properties;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* .formatRelativeTime( value, unit [, options] )
|
||||
*
|
||||
* @value [Number] The number of unit to format.
|
||||
*
|
||||
* @unit [String] see .relativeTimeFormatter() for details.
|
||||
*
|
||||
* @options [Object] see .relativeTimeFormatter() for details.
|
||||
*
|
||||
* Formats a relative time according to the given unit, options, and the default/instance locale.
|
||||
*/
|
||||
Globalize.formatRelativeTime =
|
||||
Globalize.prototype.formatRelativeTime = function( value, unit, options ) {
|
||||
|
||||
validateParameterPresence( value, "value" );
|
||||
validateParameterTypeNumber( value, "value" );
|
||||
|
||||
return this.relativeTimeFormatter( unit, options )( value );
|
||||
};
|
||||
|
||||
/**
|
||||
* .relativeTimeFormatter( unit [, options ])
|
||||
*
|
||||
* @unit [String] String value indicating the unit to be formatted. eg. "day", "week", "month", etc.
|
||||
*
|
||||
* @options [Object]
|
||||
* - form: [String] eg. "short" or "narrow". Or falsy for default long form.
|
||||
*
|
||||
* Returns a function that formats a relative time according to the given unit, options, and the
|
||||
* default/instance locale.
|
||||
*/
|
||||
Globalize.relativeTimeFormatter =
|
||||
Globalize.prototype.relativeTimeFormatter = function( unit, options ) {
|
||||
var cldr, numberFormatter, pluralGenerator, properties;
|
||||
|
||||
validateParameterPresence( unit, "unit" );
|
||||
validateParameterTypeString( unit, "unit" );
|
||||
|
||||
cldr = this.cldr;
|
||||
options = options || {};
|
||||
|
||||
validateDefaultLocale( cldr );
|
||||
|
||||
cldr.on( "get", validateCldr );
|
||||
properties = relativeTimeProperties( unit, cldr, options );
|
||||
cldr.off( "get", validateCldr );
|
||||
|
||||
numberFormatter = this.numberFormatter( options );
|
||||
pluralGenerator = this.pluralGenerator();
|
||||
|
||||
return function( value ) {
|
||||
validateParameterPresence( value, "value" );
|
||||
validateParameterTypeNumber( value, "value" );
|
||||
|
||||
return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties );
|
||||
};
|
||||
};
|
||||
|
||||
return Globalize;
|
||||
|
||||
|
||||
|
||||
|
||||
}));
|
@ -1,166 +0,0 @@
|
||||
<h2>Markdown Formatting</h2>
|
||||
<p><a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a> turns plain text formatting into fancy HTML formatting.</p>
|
||||
<h3>Phrase Emphasis</h3>
|
||||
<pre><code>*italic* **bold**
|
||||
_italic_ __bold__
|
||||
</code></pre>
|
||||
|
||||
<h3>Links</h3>
|
||||
<p>Inline:</p>
|
||||
<pre><code>An [example](http://url.com/ "Title")
|
||||
</code></pre>
|
||||
|
||||
<p>Reference-style labels (titles are optional):</p>
|
||||
<pre><code>An [example][id]. Then, anywhere
|
||||
else in the doc, define the link:
|
||||
|
||||
[id]: http://example.com/ "Title"
|
||||
</code></pre>
|
||||
|
||||
<h3>Images</h3>
|
||||
<p>Inline (titles are optional):</p>
|
||||
<pre><code>
|
||||
</code></pre>
|
||||
|
||||
<p>Reference-style:</p>
|
||||
<pre><code>![alt text][id]
|
||||
|
||||
[id]: /url/to/img.jpg "Title"
|
||||
</code></pre>
|
||||
|
||||
<h3>Headers</h3>
|
||||
<p>Setext-style:</p>
|
||||
<pre><code>Header 1
|
||||
========
|
||||
|
||||
Header 2
|
||||
--------
|
||||
</code></pre>
|
||||
|
||||
<p>atx-style (closing #'s are optional):</p>
|
||||
<pre><code># Header 1 #
|
||||
|
||||
## Header 2 ##
|
||||
|
||||
###### Header 6
|
||||
</code></pre>
|
||||
|
||||
<h3>Lists</h3>
|
||||
<p>Ordered, without paragraphs:</p>
|
||||
<pre><code>1. Foo
|
||||
2. Bar
|
||||
</code></pre>
|
||||
|
||||
<p>Unordered, with paragraphs:</p>
|
||||
<pre><code>* A list item.
|
||||
|
||||
With multiple paragraphs.
|
||||
|
||||
* Bar
|
||||
</code></pre>
|
||||
|
||||
<p>You can nest them:</p>
|
||||
<pre><code>* Abacus
|
||||
* answer
|
||||
* Bubbles
|
||||
1. bunk
|
||||
2. bupkis
|
||||
* BELITTLER
|
||||
3. burper
|
||||
* Cunning
|
||||
</code></pre>
|
||||
|
||||
<h3>Blockquotes</h3>
|
||||
<pre><code>> Email-style angle brackets
|
||||
> are used for blockquotes.
|
||||
|
||||
> > And, they can be nested.
|
||||
|
||||
> #### Headers in blockquotes
|
||||
>
|
||||
> * You can quote a list.
|
||||
> * Etc.
|
||||
</code></pre>
|
||||
|
||||
<h3>Code Spans</h3>
|
||||
<pre><code>`<code>` spans are delimited
|
||||
by backticks.
|
||||
|
||||
You can include literal backticks
|
||||
like `` `this` ``.
|
||||
</code></pre>
|
||||
|
||||
<h3>Preformatted Code Blocks</h3>
|
||||
<p>Indent every line of a code block by at least 4 spaces or 1 tab.</p>
|
||||
<pre><code>This is a normal paragraph.
|
||||
|
||||
This is a preformatted
|
||||
code block.
|
||||
</code></pre>
|
||||
|
||||
<h3>Horizontal Rules</h3>
|
||||
<p>Three or more dashes or asterisks:</p>
|
||||
<pre><code>---
|
||||
|
||||
* * *
|
||||
|
||||
- - - -
|
||||
</code></pre>
|
||||
|
||||
<h3>Manual Line Breaks</h3>
|
||||
<p>End a line with two or more spaces:</p>
|
||||
<pre><code>Roses are red,
|
||||
Violets are blue.
|
||||
</code></pre>
|
||||
|
||||
<h2>Extra Mode</h2>
|
||||
|
||||
These formatting features are only available when Extra Mode is enabled.
|
||||
|
||||
<h3>Markdown In Html</h3>
|
||||
<p>Enable markdown in HTML block level elements:</p>
|
||||
<pre><code><div markdown="1">
|
||||
Markdown **still** works.
|
||||
</div>
|
||||
</code></pre>
|
||||
|
||||
<h3>Fenced Code Blocks</h3>
|
||||
<p>Code blocks delimited by 3 or more tildas:</p>
|
||||
<pre><code>~~~
|
||||
This is a preformatted
|
||||
code block
|
||||
~~~
|
||||
</code></pre>
|
||||
|
||||
<h3>Header IDs</h3>
|
||||
<p>Set the id of headings with <code>{#<id>}</code> at end of heading line:</p>
|
||||
<pre><code>## My Heading {#myheading}
|
||||
</code></pre>
|
||||
|
||||
<h3>Tables</h3>
|
||||
|
||||
<pre><code>Fruit |Color
|
||||
---------|----------
|
||||
Apples |Red
|
||||
Pears |Green
|
||||
Bananas |Yellow</code></pre>
|
||||
<h3>Definition Lists</h3>
|
||||
<pre><code>Term 1
|
||||
: Definition 1
|
||||
|
||||
Term 2
|
||||
: Definition 2</code></pre>
|
||||
|
||||
<h3>Footnotes</h3>
|
||||
<pre><code>Body text with a footnote [^1]
|
||||
|
||||
[^1]: Footnote text here
|
||||
</code></pre>
|
||||
|
||||
<h3>Abbreviations</h3>
|
||||
<pre><code>MDD <- will have title
|
||||
|
||||
*[MDD]: MarkdownDeep
|
||||
</code></pre>
|
||||
<p> </p>
|
||||
|
@ -1,40 +0,0 @@
|
||||
<div class="popup-content">
|
||||
<textarea cols="75" rows="10" class="richtext-fix"></textarea>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Center coordinates</td>
|
||||
<td><input type="number" min="1" step="any" name="centerLat" /> <input type="number" min="1" step="any" name="centerLng" /></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Radius</td>
|
||||
<td><input type="number" min="1" step="any" name="radius" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Border width</td>
|
||||
<td><input type="number" min="1" name="borderWidth" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Border color</td>
|
||||
<td>
|
||||
<input type="text" name="strokeColor" id="strokeColor" />
|
||||
<input type="color" name="strokeColorPicker" id="strokeColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fill color</td>
|
||||
<td>
|
||||
<input type="text" name="fillColor" id="fillColor" />
|
||||
<input type="color" name="fillColorPicker" id="fillColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<input type="button" class="btn-popup-save" value="Save" />
|
||||
<input type="button" class="btn-popup-cancel" value="Cancel" />
|
||||
<input type="button" class="btn-popup-delete" value="Delete" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="changed" value="false" />
|
||||
</div>
|
@ -1,32 +0,0 @@
|
||||
<div class="popup-content">
|
||||
<textarea cols="75" rows="10" class="richtext-fix"></textarea>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Coordinates</td>
|
||||
<td>
|
||||
<input type="number" min="1" name="locationLat" step="any" /> <input type="number" name="locationLng" step="any" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Icon
|
||||
</td>
|
||||
<td>
|
||||
<select name="icon">
|
||||
<option value="">default</option>
|
||||
|
||||
</select>
|
||||
<select name="hover-icon">
|
||||
<option value="">none</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<input type="button" class="btn-popup-save" value="Save" />
|
||||
<input type="button" class="btn-popup-cancel" value="Cancel" />
|
||||
<input type="button" class="btn-popup-delete" value="Delete" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="changed" value="false" />
|
||||
</div>
|
@ -1,32 +0,0 @@
|
||||
<div class="popup-content">
|
||||
<textarea cols="75" rows="10" class="richtext-fix"></textarea>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Border width</td>
|
||||
<td>
|
||||
<input type="number" min="1" name="borderWidth" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Border color</td>
|
||||
<td>
|
||||
<input type="text" name="strokeColor" id="strokeColor" />
|
||||
<input type="color" name="strokeColorPicker" id="strokeColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fill color</td>
|
||||
<td>
|
||||
<input type="text" name="fillColor" id="fillColor" />
|
||||
<input type="color" name="fillColorPicker" id="fillColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<input type="button" class="btn-popup-save" value="Save" />
|
||||
<input type="button" class="btn-popup-cancel" value="Cancel" />
|
||||
<input type="button" class="btn-popup-delete" value="Delete" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="changed" value="false" />
|
||||
</div>
|
@ -1,24 +0,0 @@
|
||||
<div class="popup-content">
|
||||
<textarea cols="75" rows="10" class="richtext-fix"></textarea>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Line width</td>
|
||||
<td><input type="number" min="1" name="borderWidth" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Line color</td>
|
||||
<td>
|
||||
<input type="text" name="strokeColor" id="strokeColor" />
|
||||
<input type="color" name="strokeColorPicker" id="strokeColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<input type="button" class="btn-popup-save" value="Save" />
|
||||
<input type="button" class="btn-popup-cancel" value="Cancel" />
|
||||
<input type="button" class="btn-popup-delete" value="Delete" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="changed" value="false" />
|
||||
</div>
|
@ -1,31 +0,0 @@
|
||||
<div class="popup-content">
|
||||
<textarea cols="75" rows="10" class="richtext-fix"></textarea>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Border width</td>
|
||||
<td><input type="number" min="1" name="borderWidth" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Border color</td>
|
||||
<td>
|
||||
<input type="text" name="strokeColor" id="strokeColor" />
|
||||
<input type="color" name="strokeColorPicker" id="strokeColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fill color</td>
|
||||
<td>
|
||||
<input type="text" name="fillColor" id="fillColor" />
|
||||
<input type="color" name="fillColorPicker" id="fillColorPicker" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<input type="button" class="btn-popup-save" value="Save" />
|
||||
<input type="button" class="btn-popup-cancel" value="Cancel" />
|
||||
<input type="button" class="btn-popup-delete" value="Delete" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="changed" value="false" />
|
||||
</div>
|
Before Width: | Height: | Size: 430 B |
Before Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 836 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB |
6632
web/Scripts/jquery-2.1.4-vsdoc.js
vendored
9210
web/Scripts/jquery-2.1.4.js
vendored
5
web/Scripts/jquery-2.1.4.min.js
vendored
1
web/Scripts/jquery.googlemaps.min.js
vendored
@ -13,7 +13,7 @@
|
||||
</thead>
|
||||
<tbody id="tbcb">
|
||||
<% int lc=0;
|
||||
foreach (SelectListItem ci in ViewData["Circles"]) { lc++; %>
|
||||
foreach (SelectListItem ci in Model) { lc++; %>
|
||||
<tr class="<%= (lc%2==0)?"even ":"odd " %>row" id="c_<%=ci.Value%>">
|
||||
<td><%=ci.Text%></td>
|
||||
<td>
|
||||
|
@ -34,6 +34,11 @@
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MASContent" ID="mas1" runat="server">
|
||||
<% if (Membership.GetUser()!=null) {
|
||||
%>
|
||||
<div class="postcomment">
|
||||
<% using (Html.BeginForm("Comment","Blogs")) { %>
|
||||
<%=Html.Hidden("UserName")%>
|
||||
@ -43,15 +48,13 @@
|
||||
<input type="submit" value="Poster un commentaire"/>
|
||||
<% } %>
|
||||
</div>
|
||||
<%
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MASContent" ID="mas1" runat="server">
|
||||
<% if (Membership.GetUser()!=null)
|
||||
if (Membership.GetUser().UserName==Model.UserName)
|
||||
{ %>
|
||||
<aside>
|
||||
<%= Html.ActionLink("Editer","Edit", new { user = Model.UserName, title = Model.Title }, new { @class="actionlink" }) %>
|
||||
<%= Html.ActionLink("Supprimer","RemovePost", new { user = Model.UserName, title = Model.Title }, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
<% } } %>
|
||||
</aside>
|
||||
</asp:Content>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<%@ Page Title="Date search" Language="C#" Inherits="System.Web.Mvc.ViewPage<AskForADate>" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
|
||||
<%@ Page Title="Booking" Language="C#" Inherits="System.Web.Mvc.ViewPage<BookEdit>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
<link rel='stylesheet' href='/Scripts/fullcalendar/fullcalendar.css' />
|
||||
<script type="text/javascript" src="/Scripts/jquery-2.1.3.min.js"></script>
|
@ -3,10 +3,12 @@
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<% using ( Html.BeginForm("SetCalendar","Google") ) { %>
|
||||
<input type="radio" name="calchoice" id ="c0" value="0" >
|
||||
<label for="c0">Calendrier intégré</label><br>
|
||||
<% foreach (CalendarListEntry e in Model.items.Where(x=>x.accessRole=="owner")) { %>
|
||||
<input type="radio" name="calchoice" id="calchoice" value="<%=e.id%>" >
|
||||
<%=Html.Encode(e.summary)%> <br>
|
||||
<i><%=Html.Encode(e.description)%></i> <br>
|
||||
<input type="radio" name="calchoice" id="c<%=e.id%>" value="<%=e.id%>" />
|
||||
<label for="c<%=e.id%>"><%=Html.Encode(e.summary)%> <br>
|
||||
<i><%=Html.Encode(e.description)%></i></label> <br>
|
||||
<% } %>
|
||||
<input type="hidden" name="returnUrl" id="returnUrl" value="<%=Html.Encode(ViewData["returnUrl"])%>">
|
||||
<input type="submit">
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
@ -11,10 +11,7 @@
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages validateRequest="true"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<pages validateRequest="true" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
<add tagPrefix="yavsc" namespace="Yavsc.WebControls" assembly="Yavsc.WebControls" />
|
||||
@ -34,16 +31,9 @@
|
||||
</pages>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<defaultDocument enabled="true"> <!-- this line enables default documents for a directory -->
|
||||
<files>
|
||||
<!-- <clear/> removes the existing default document list -->
|
||||
<add value="Index"/>
|
||||
</files>
|
||||
</defaultDocument>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler" />
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
</system.webServer></configuration>
|
117
web/Web.csproj
@ -9,7 +9,7 @@
|
||||
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{603C0E0B-DB56-11DC-BE95-000D561079B0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Yavsc</RootNamespace>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -75,29 +75,38 @@
|
||||
<Reference Include="System.Net.Http.Formatting" />
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Web.WebPages.Razor" />
|
||||
<Reference Include="Npgsql">
|
||||
<HintPath>..\packages\Npgsql.2.2.5\lib\net45\Npgsql.dll</HintPath>
|
||||
<Reference Include="nunit.framework">
|
||||
<Package>nunit</Package>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MarkdownDeep">
|
||||
<HintPath>..\packages\MarkdownDeep.NET.1.5\lib\.NetFramework 3.5\MarkdownDeep.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<Package>nunit</Package>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Security">
|
||||
<HintPath>..\packages\Npgsql.2.2.5\lib\net45\Mono.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Npgsql">
|
||||
<HintPath>..\packages\Npgsql.2.2.5\lib\net45\Npgsql.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalButtonManagerSDK">
|
||||
<HintPath>..\packages\PayPalButtonManagerSDK.2.9.109\lib\net20\PayPalButtonManagerSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalCoreSDK">
|
||||
<HintPath>..\packages\PayPalCoreSDK.1.6.2\lib\net45\PayPalCoreSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.abstractions">
|
||||
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.core">
|
||||
<HintPath>..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.assert">
|
||||
<HintPath>..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalCoreSDK">
|
||||
<HintPath>..\packages\PayPalCoreSDK.1.6.2\lib\net451\PayPalCoreSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalButtonManagerSDK">
|
||||
<HintPath>..\packages\PayPalButtonManagerSDK.2.9.109\lib\net20\PayPalButtonManagerSDK.dll</HintPath>
|
||||
<Reference Include="xunit.core">
|
||||
<HintPath>..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -122,7 +131,6 @@
|
||||
<Folder Include="Theme\dark\" />
|
||||
<Folder Include="templates\" />
|
||||
<Folder Include="Formatters\" />
|
||||
<Folder Include="Views\Google\" />
|
||||
<Folder Include="Settings\" />
|
||||
<Folder Include="Views\BackOffice\" />
|
||||
<Folder Include="Helpers\Google\" />
|
||||
@ -132,6 +140,7 @@
|
||||
<Folder Include="Views\PayPal\" />
|
||||
<Folder Include="ApiControllers\" />
|
||||
<Folder Include="Views\Modules\" />
|
||||
<Folder Include="Views\Calendar\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
@ -171,14 +180,12 @@
|
||||
<Compile Include="Helpers\SimpleJsonPostMethod.cs" />
|
||||
<Compile Include="Helpers\Google\Entity.cs" />
|
||||
<Compile Include="Helpers\Google\MapTracks.cs" />
|
||||
<Compile Include="Helpers\Google\OAuth2.cs" />
|
||||
<Compile Include="Helpers\Google\EntityQuery.cs" />
|
||||
<Compile Include="Helpers\Google\ApiClient.cs" />
|
||||
<Compile Include="Helpers\Google\CalendarApi.cs" />
|
||||
<Compile Include="Formatters\ErrorHtmlFormatter.cs" />
|
||||
<Compile Include="Formatters\RssFeedsFormatter.cs" />
|
||||
<Compile Include="Formatters\TexToPdfFormatter.cs" />
|
||||
<Compile Include="ApiControllers\PaypalApiController.cs" />
|
||||
<Compile Include="WebApiConfig.cs" />
|
||||
<Compile Include="IValueProvider.cs" />
|
||||
<Compile Include="Formatters\EstimToPdfFormatter.MSAN.cs" />
|
||||
@ -196,6 +203,12 @@
|
||||
<Compile Include="ApiControllers\GCMController.cs" />
|
||||
<Compile Include="ApiControllers\AccountController.cs" />
|
||||
<Compile Include="Helpers\ThanksHelper.cs" />
|
||||
<Compile Include="Web References\sms.diamondcard.us\Reference.cs">
|
||||
<DependentUpon>Reference.map</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\Google\OAuth2.cs" />
|
||||
<Compile Include="Helpers\Google\PeopleApi.cs" />
|
||||
<Compile Include="ApiControllers\PaypalController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Web.config" />
|
||||
@ -265,14 +278,10 @@
|
||||
<Content Include="Catalog.xml" />
|
||||
<Content Include="RegistrationMail.txt" />
|
||||
<Content Include="Views\FrontOffice\Writting.ascx" />
|
||||
<Content Include="Views\Google\Login.aspx" />
|
||||
<Content Include="Views\Google\Auth.aspx" />
|
||||
<Content Include="Scripts\jquery.metadata.js" />
|
||||
<Content Include="Scripts\rangyinputs-jquery-1.1.2.js" />
|
||||
<Content Include="images\sign-in-with-google.png" />
|
||||
<Content Include="Views\Account\Unregister.aspx" />
|
||||
<Content Include="Views\Google\ChooseCalendar.aspx" />
|
||||
<Content Include="Views\Google\DateQuery.aspx" />
|
||||
<Content Include="Scripts\GruntFile.js" />
|
||||
<Content Include="Scripts\jquery.timepicker.js" />
|
||||
<Content Include="Scripts\jquery.timepicker.min.js" />
|
||||
@ -286,36 +295,14 @@
|
||||
<Content Include="images\sign-in-with-google-s.png" />
|
||||
<Content Include="Scripts\datepicker-en-GB.js" />
|
||||
<Content Include="Scripts\datepicker-fr.js" />
|
||||
<Content Include="Views\Google\GoogleErrorMessage.aspx" />
|
||||
<Content Include="Views\Home\Contact.aspx" />
|
||||
<Content Include="Views\Home\AssemblyInfo.aspx" />
|
||||
<Content Include="Views\Admin\Created.aspx" />
|
||||
<Content Include="Views\Admin\InitDb.aspx" />
|
||||
<Content Include="favicon.png" />
|
||||
<Content Include="Models\NoLogin.master" />
|
||||
<Content Include="Scripts\css\mapstyle-ie.css" />
|
||||
<Content Include="Scripts\css\mapstyle.css" />
|
||||
<Content Include="Scripts\css\mapstyle.min.css" />
|
||||
<Content Include="Scripts\html\popup-template-circle.html" />
|
||||
<Content Include="Scripts\html\popup-template-marker.html" />
|
||||
<Content Include="Scripts\html\popup-template-polygon.html" />
|
||||
<Content Include="Scripts\html\popup-template-polyline.html" />
|
||||
<Content Include="Scripts\html\popup-template-rectangle.html" />
|
||||
<Content Include="Scripts\img\pin\flag-azure.png" />
|
||||
<Content Include="Scripts\img\pin\flag-green.png" />
|
||||
<Content Include="Scripts\img\pin\needle-pink.png" />
|
||||
<Content Include="Scripts\img\pin\niddle-green.png" />
|
||||
<Content Include="Scripts\img\pin\pin-azure.png" />
|
||||
<Content Include="Scripts\img\pin\pin-green.png" />
|
||||
<Content Include="Scripts\img\pin\pin-pink.png" />
|
||||
<Content Include="Scripts\img\current-location.png" />
|
||||
<Content Include="Scripts\img\fit-bounds.png" />
|
||||
<Content Include="Scripts\img\map-load.gif" />
|
||||
<Content Include="Scripts\jquery.googlemaps.js" />
|
||||
<Content Include="Scripts\jquery.googlemaps.min.js" />
|
||||
<Content Include="Views\FrontOffice\Basket.aspx" />
|
||||
<Content Include="Theme\dark\rect.png" />
|
||||
<Content Include="Views\Google\ChooseADate.aspx" />
|
||||
<Content Include="Scripts\stupidtable.js" />
|
||||
<Content Include="Scripts\jquery-ui.js" />
|
||||
<Content Include="Views\Account\Profile.aspx" />
|
||||
@ -325,21 +312,6 @@
|
||||
<Content Include="Theme\dark\croix.png" />
|
||||
<Content Include="Views\Admin\RemoveRole..aspx" />
|
||||
<Content Include="Views\FrontOffice\EventPub.aspx" />
|
||||
<Content Include="Scripts\cldr\event.js" />
|
||||
<Content Include="Scripts\cldr\supplemental.js" />
|
||||
<Content Include="Scripts\cldr\unresolved.js" />
|
||||
<Content Include="Scripts\cldr.js" />
|
||||
<Content Include="Scripts\globalize\currency.js" />
|
||||
<Content Include="Scripts\globalize\date.js" />
|
||||
<Content Include="Scripts\globalize\message.js" />
|
||||
<Content Include="Scripts\globalize\number.js" />
|
||||
<Content Include="Scripts\globalize\plural.js" />
|
||||
<Content Include="Scripts\globalize\relative-time.js" />
|
||||
<Content Include="Scripts\globalize.js" />
|
||||
<Content Include="Scripts\jquery-2.1.4-vsdoc.js" />
|
||||
<Content Include="Scripts\jquery-2.1.4.js" />
|
||||
<Content Include="Scripts\jquery-2.1.4.min.js" />
|
||||
<Content Include="Scripts\MarkdownDeepLib.min.js" />
|
||||
<Content Include="Theme\md\mdd_toolbar.png" />
|
||||
<Content Include="Theme\md\mdd_ajax_loader.gif" />
|
||||
<Content Include="Theme\md\mdd_gripper.png" />
|
||||
@ -349,6 +321,18 @@
|
||||
<Content Include="Views\Account\Register.ascx" />
|
||||
<Content Include="Views\Account\ResetPassword.aspx" />
|
||||
<Content Include="Views\Blogs\NotAuthorized.aspx" />
|
||||
<Content Include="Scripts\mdd_ajax_loader.gif" />
|
||||
<Content Include="Scripts\mdd_gripper.png" />
|
||||
<Content Include="Scripts\mdd_help.htm" />
|
||||
<Content Include="Scripts\mdd_modal_background.png" />
|
||||
<Content Include="Scripts\mdd_styles.css" />
|
||||
<Content Include="Scripts\mdd_toolbar.png" />
|
||||
<Content Include="Views\Calendar\Login.aspx" />
|
||||
<Content Include="Views\Calendar\Auth.aspx" />
|
||||
<Content Include="Views\Calendar\ChooseCalendar.aspx" />
|
||||
<Content Include="Views\Calendar\Book.aspx" />
|
||||
<Content Include="Views\Calendar\ChooseADate.aspx" />
|
||||
<Content Include="Views\Calendar\ErrorMessage.aspx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
@ -370,8 +354,13 @@
|
||||
<LastGenOutput>Estim.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Scripts\styles.json" />
|
||||
<None Include="Scripts\jquery-2.1.4.min.map" />
|
||||
<None Include="Web References\sms.diamondcard.us\smsapi.wsdl" />
|
||||
<None Include="Web References\sms.diamondcard.us\Reference.map">
|
||||
<Generator>MSDiscoCodeGenerator</Generator>
|
||||
<LastGenOutput>Reference.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Scripts\MarkdownDeep Quick Reference.txt" />
|
||||
<None Include="Scripts\MarkdownDeep License.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\NpgsqlMRPProviders\NpgsqlMRPProviders.csproj">
|
||||
@ -410,4 +399,14 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="instdbws.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WebReferences Include="Web References" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WebReferenceUrl Include="http://sms.diamondcard.us/doc/sms-api.wsdl">
|
||||
<UrlBehavior>Dynamic</UrlBehavior>
|
||||
<RelPath>Web References\sms.diamondcard.us</RelPath>
|
||||
<UpdateFromURL>http://sms.diamondcard.us/doc/sms-api.wsdl</UpdateFromURL>
|
||||
</WebReferenceUrl>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -652,25 +652,28 @@ WITH (
|
||||
-- Table: circle
|
||||
|
||||
-- DROP TABLE circle;
|
||||
|
||||
CREATE TABLE circle
|
||||
(
|
||||
_id serial NOT NULL, -- Circle identifier
|
||||
owner character varying(255), -- creator of this circle
|
||||
applicationname character varying(255), -- Application name
|
||||
title character varying(512),
|
||||
_id bigserial NOT NULL, -- Circle identifier
|
||||
owner character varying(255) NOT NULL, -- creator of this circle
|
||||
applicationname character varying(255) NOT NULL, -- Application name
|
||||
title character varying(512) NOT NULL,
|
||||
public boolean, -- true when this circle is a public circle, from which the title would be available from an anonymous access to the owner's profile
|
||||
CONSTRAINT circle_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT circle_owner_fkey FOREIGN KEY (owner, applicationname)
|
||||
REFERENCES users (username, applicationname) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT circle_owner_title_key UNIQUE (owner, title)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN circle._id IS 'Circle identifier';
|
||||
COMMENT ON COLUMN circle.owner IS 'creator of this circle';
|
||||
COMMENT ON COLUMN circle.applicationname IS 'Application name';
|
||||
COMMENT ON COLUMN circle.public IS 'true when this circle is a public circle, from which the title would be available from an anonymous access to the owner''s profile';
|
||||
|
||||
|
||||
-- Table: circle_members
|
||||
|
||||
-- DROP TABLE circle_members;
|
||||
|
@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cldrjs" version="0.4.1" targetFramework="net451" />
|
||||
<package id="jQuery" version="2.1.4" targetFramework="net451" />
|
||||
<package id="JQuery.GoogleMaps" version="2.2.4" targetFramework="net451" />
|
||||
<package id="jquery-globalize" version="1.0.0" targetFramework="net451" />
|
||||
<package id="log4net" version="2.0.3" targetFramework="net40" />
|
||||
<package id="MarkdownDeep.Full" version="1.5" targetFramework="net451" />
|
||||
<package id="MarkdownDeep.NET" version="1.5" targetFramework="net451" />
|
||||
<package id="MarkdownHelper" version="1.3" targetFramework="net451" />
|
||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" />
|
||||
<package id="Npgsql" version="2.2.5" targetFramework="net451" />
|
||||
<package id="PayPalButtonManagerSDK" version="2.9.109" targetFramework="net451" />
|
||||
<package id="PayPalCoreSDK" version="1.6.2" targetFramework="net451" />
|
||||
<package id="xunit" version="2.0.0" targetFramework="net451" />
|
||||
<package id="xunit.abstractions" version="2.0.0" targetFramework="net451" />
|
||||
<package id="xunit.assert" version="2.0.0" targetFramework="net451" />
|
||||
<package id="xunit.core" version="2.0.0" targetFramework="net451" />
|
||||
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net451" />
|
||||
<package id="cldrjs" version="0.4.1" targetFramework="net45" />
|
||||
<package id="jQuery" version="2.1.4" targetFramework="net45" />
|
||||
<package id="JQuery.GoogleMaps" version="2.2.4" targetFramework="net45" />
|
||||
<package id="jquery-globalize" version="1.0.0" targetFramework="net45" />
|
||||
<package id="log4net" version="2.0.3" targetFramework="net45" />
|
||||
<package id="MarkdownDeep.Full" version="1.5" targetFramework="net45" />
|
||||
<package id="MarkdownDeep.NET" version="1.5" targetFramework="net45" />
|
||||
<package id="MarkdownHelper" version="1.3" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
|
||||
<package id="Npgsql" version="2.2.5" targetFramework="net45" />
|
||||
<package id="PayPalButtonManagerSDK" version="2.9.109" targetFramework="net45" />
|
||||
<package id="PayPalCoreSDK" version="1.6.2" targetFramework="net45" />
|
||||
<package id="xunit" version="2.0.0" targetFramework="net45" />
|
||||
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
|
||||
<package id="xunit.assert" version="2.0.0" targetFramework="net45" />
|
||||
<package id="xunit.core" version="2.0.0" targetFramework="net45" />
|
||||
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" />
|
||||
</packages>
|
@ -25,7 +25,6 @@ namespace Yavsc.Model.Blogs
|
||||
throw new ConfigurationErrorsException("The default blog provider was not found");
|
||||
ConstructorInfo ci = Type.GetType (celt.Type).GetConstructor (Type.EmptyTypes);
|
||||
BlogProvider bp = ci.Invoke (Type.EmptyTypes) as BlogProvider;
|
||||
NameValueCollection c = new NameValueCollection ();
|
||||
bp.Initialize (celt.Name, celt.Parameters);
|
||||
return bp;
|
||||
}
|
||||
|
@ -97,10 +97,12 @@ namespace Yavsc.Model.Blogs
|
||||
Provider.UpdatePost (postid, title, content, visible,cids);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Finds the post.
|
||||
/// </summary>
|
||||
/// <returns>The post.</returns>
|
||||
/// <param name="readersName">Readers name.</param>
|
||||
/// <param name="pattern">Pattern.</param>
|
||||
/// <param name="searchflags">Searchflags.</param>
|
||||
/// <param name="pageIndex">Page index.</param>
|
||||
|
@ -28,14 +28,16 @@ namespace Yavsc.Model.Blogs
|
||||
public abstract BlogEntry GetPost (string username, string title);
|
||||
|
||||
/// <summary>
|
||||
/// Post the specified username, title, content and visible.
|
||||
/// Post the specified username, title, content, visible and allowedCircles.
|
||||
/// </summary>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="content">Content.</param>
|
||||
/// <param name="visible">If set to <c>true</c> visible.</param>
|
||||
/// <param name="allowedCircles">Allowed circles.</param>
|
||||
public abstract long Post (string username, string title, string content, bool visible, long[] allowedCircles);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates the post.
|
||||
/// </summary>
|
||||
@ -43,12 +45,15 @@ namespace Yavsc.Model.Blogs
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="content">Content.</param>
|
||||
/// <param name="visible">If set to <c>true</c> visible.</param>
|
||||
/// <param name="allowedCircles">Allowed circles.</param>
|
||||
public abstract void UpdatePost (long postid, string title, string content, bool visible, long[] allowedCircles);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Finds the post.
|
||||
/// </summary>
|
||||
/// <returns>The post.</returns>
|
||||
/// <param name="readersName">Readers name.</param>
|
||||
/// <param name="pattern">Pattern.</param>
|
||||
/// <param name="searchflags">Searchflags.</param>
|
||||
/// <param name="pageIndex">Page index.</param>
|
||||
|
@ -22,12 +22,12 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Model.Google
|
||||
namespace Yavsc.Model.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Ask for A date.
|
||||
/// </summary>
|
||||
public class AskForADate
|
||||
public class BookEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
@ -1,5 +1,4 @@
|
||||
//
|
||||
// FreeDate.cs
|
||||
// FreeDate.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paulschneider@free.fr>
|
||||
@ -19,8 +18,9 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
using Yavsc.Model.Google;
|
||||
|
||||
namespace Yavsc.Model.Google
|
||||
namespace Yavsc.Model.Calendar
|
||||
{
|
||||
/// <summary>
|
||||
/// Free date.
|
||||
@ -48,7 +48,7 @@ namespace Yavsc.Model.Google
|
||||
/// <value>The location.</value>
|
||||
public string Location { get; set; }
|
||||
|
||||
static FreeDateSet CreateFromCalAndQuery(CalendarEventList cal, AskForADate query)
|
||||
static FreeDateSet CreateFromCalAndQuery(CalendarEventList cal, BookEdit query)
|
||||
{
|
||||
|
||||
throw new NotImplementedException ();
|
@ -1,3 +1,15 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* ListItem.cs:
|
||||
* Circle.cs:
|
||||
* BlogHelper.cs:
|
||||
* BlogManager.cs:
|
||||
* BookEdit.cs:
|
||||
* FreeDate.cs:
|
||||
* BlogProvider.cs:
|
||||
|
||||
* YavscModel.csproj: Moves to Mono framework
|
||||
|
||||
2015-07-02 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* ListItem.cs:
|
||||
|
@ -52,7 +52,8 @@ namespace Yavsc.Model.Circles
|
||||
public string [] Members { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Union the specified that.
|
||||
/// Merge the specified circle array into
|
||||
/// an user name list.
|
||||
/// </summary>
|
||||
/// <param name="those">Those circle about to be merged.</param>
|
||||
public static string [] Union (Circle []those)
|
||||
@ -66,6 +67,11 @@ namespace Yavsc.Model.Circles
|
||||
}
|
||||
return content.ToArray ();
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is private.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is private; otherwise, <c>false</c>.</value>
|
||||
public bool IsPrivate { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,10 +22,25 @@ using System;
|
||||
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// List item.
|
||||
/// </summary>
|
||||
public class ListItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public string Value { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the text.
|
||||
/// </summary>
|
||||
/// <value>The text.</value>
|
||||
public string Text { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the icon.
|
||||
/// </summary>
|
||||
/// <value>The icon.</value>
|
||||
public string Icon { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Yavsc.Model</RootNamespace>
|
||||
<AssemblyName>YavscModel</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -74,7 +74,6 @@
|
||||
<Compile Include="Google\SignIn.cs" />
|
||||
<Compile Include="Google\CalendarList.cs" />
|
||||
<Compile Include="Google\CalendarListEntry.cs" />
|
||||
<Compile Include="Google\AskForADate.cs" />
|
||||
<Compile Include="IRenderer.cs" />
|
||||
<Compile Include="ITagHandler.cs" />
|
||||
<Compile Include="IViewRenderer.cs" />
|
||||
@ -124,7 +123,6 @@
|
||||
<Compile Include="FrontOffice\Catalog\Billing\Price.cs" />
|
||||
<Compile Include="OtherWebException.cs" />
|
||||
<Compile Include="WorkFlow\Automate.cs" />
|
||||
<Compile Include="Google\FreeDate.cs" />
|
||||
<Compile Include="Google\CalendarEventList.cs" />
|
||||
<Compile Include="Google\GDate.cs" />
|
||||
<Compile Include="Google\Resource.cs" />
|
||||
@ -160,6 +158,8 @@
|
||||
<Compile Include="RolesAndMembers\LostPasswordModel.cs" />
|
||||
<Compile Include="Messaging\SimpleMessage.cs" />
|
||||
<Compile Include="ListItem.cs" />
|
||||
<Compile Include="Calendar\BookEdit.cs" />
|
||||
<Compile Include="Calendar\FreeDate.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-07-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* YavscClient.csproj: Moves to Mono framework
|
||||
|
||||
2015-06-09 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* YavscClient.csproj: Helps to fix packaging, and cleans
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>maeclient</RootNamespace>
|
||||
<AssemblyName>yavscclient</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|