diff --git a/.gitignore b/.gitignore index 2ff56870..36d54d4d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,11 @@ plugins/*/obj packages web/avatars web/users -build +dist bower_components node_modules svg .nuget .gitignore +web/bfiles diff --git a/ChangeLog b/ChangeLog index 7fecf2e5..5a340de1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,32 +1,4 @@ -2015-10-04 Paul Schneider +2015-10-09 Paul Schneider - * Makefile: adds a new line to the end of file - -2015-10-04 Paul Schneider - - * Makefile: my deploy config - -2015-08-20 Paul Schneider - - * Yavsc.sln: Adds the `Presta` project - -2015-08-14 Paul Schneider - - * README.md: blanked: not clear enough - -2015-07-17 Paul Schneider - - * Yavsc.sln: - -2015-06-09 Paul Schneider - - * Yavsc.sln: creates a packaging project - -2015-06-07 Paul Schneider - - * Makefile: cleans the StyleCop cache - -2015-06-06 Paul Schneider - - * Yavsc.sln: modifies the Version control integration + * Makefile: reloads config after each rsync call diff --git a/ITContentProvider/ChangeLog b/ITContentProvider/ChangeLog deleted file mode 100644 index a7345d8d..00000000 --- a/ITContentProvider/ChangeLog +++ /dev/null @@ -1,18 +0,0 @@ -2015-10-04 Paul Schneider - - * packages.config: - * ITContentProvider.csproj: Npgsql package update - -2015-07-15 Paul Schneider - - * ITContentProvider.csproj: Moves to Mono framework - -2015-06-10 Paul Schneider - - * ITContentProvider.csproj: - -2015-06-09 Paul Schneider - - * ITContentProvider.csproj: Helps to fix packaging, and cleans - dependencies - diff --git a/Makefile b/Makefile index fbdcb10a..78d390ba 100644 --- a/Makefile +++ b/Makefile @@ -3,25 +3,17 @@ VERSION=1.1 CONFIG=Debug LDYDESTDIR=dist/web/$(CONFIG) COPYUNCHANGED="false" - -HOST_rsync_yavsc=lua.pschneider.fr -DESTDIR_rsync_yavsc=/srv/www/yavsc - -HOST_rsync_lua=lua.pschneider.fr -DESTDIR_rsync_lua=/srv/www/lua - -HOST_rsync_pre=lua.pschneider.fr -DESTDIR_rsync_pre=/srv/www/yavscpre - -HOST_rsync_prod=lua.pschneider.fr -DESTDIR_rsync_prod=/srv/www/yavsc - +RSYNCCMD=rsync -ravu --chown=www-data:www-data +HOST_rsync_dev=totemdev.localdomain +DESTDIR_rsync_dev=/srv/www/totemdev +HOST_rsync_pre=totempre.localdomain +DESTDIR_rsync_pre=/srv/www/totempre +HOST_rsync_prod=totemprod.pschneider.fr +DESTDIR_rsync_prod=/srv/www/totemprod DOCASSBS=NpgsqlBlogProvider.dll WorkFlowProvider.dll Yavsc.WebControls.dll ITContentProvider.dll NpgsqlMRPProviders.dll Yavsc.dll SalesCatalog.dll YavscModel.dll -RSYNCCMD=rsync -ravu --chown=www-data:www-data - all: deploy - + ddir: mkdir -p $(LDYDESTDIR) @@ -30,17 +22,17 @@ deploy: ddir build xbuild /p:Configuration=$(CONFIG) /p:SkipCopyUnchangedFiles=$(COPYUNCHANGED) /p:DeployDir=../$(LDYDESTDIR) /t:Deploy web/Web.csproj mv $(LDYDESTDIR)/Web.config $(LDYDESTDIR)/Web.config.new - rsync_% : HOST = $(HOST_$@) - + rsync_% : DESTDIR = $(DESTDIR_$@) - + rsync_% : deploy echo "!Deploying to $(HOST)!" $(RSYNCCMD) dist/web/$(CONFIG)/ root@$(HOST):$(DESTDIR) + ssh root@$(HOST) "service apache2 reload" build: - xbuild /p:Configuration=$(CONFIG) /t:Build Yavsc.sln + xbuild /p:Configuration=$(CONFIG) /t:Build Totem.sln clean: xbuild /t:Clean @@ -64,12 +56,9 @@ htmldoc: xmldoc docdeploy-prod: htmldoc rsync -ravu web/htmldoc root@$(PRODHOSTDIR) -rsync_lua: - -rsync_yavsc: +rsync_dev: rsync_pre: rsync_prod: - diff --git a/NpgsqlBlogProvider/ChangeLog b/NpgsqlBlogProvider/ChangeLog index fe331901..8dd72661 100644 --- a/NpgsqlBlogProvider/ChangeLog +++ b/NpgsqlBlogProvider/ChangeLog @@ -1,40 +1,27 @@ -2015-10-07 Paul Schneider +2015-10-19 Paul Schneider - * NpgsqlBlogProvider.cs: Fixes usage of Npgsql upgrade to - latest version + * NpgsqlTagInfo.cs: Fixes the photo retreival -2015-10-04 Paul Schneider +2015-10-17 Paul Schneider - * packages.config: - * NpgsqlBlogProvider.csproj: Npgsql package update + * NpgsqlTagInfo.cs: + * NpgsqlBlogProvider.cs: -2015-09-27 Paul Schneider - - * NpgsqlBlogProvider.cs: Fixes the sql command preparation - -2015-09-23 Paul Schneider - - * NpgsqlBlogProvider.cs: refactoring: The `UserName` property - from the `BlogEntry` class is renamed to `Author` - -2015-08-04 Paul Schneider - - * NpgsqlBlogProvider.cs: * Remove post by id - * Manage collections of entries on a couple (user,title), not - a single post - - -2015-07-15 Paul Schneider - - * NpgsqlBlogProvider.csproj: Moves to Mono framework - -2015-07-02 Paul Schneider +2015-10-17 Paul Schneider + * NpgsqlTagInfo.cs: * NpgsqlBlogProvider.cs: * NpgsqlBlogProvider.csproj: -2015-06-09 Paul Schneider +2015-10-17 Paul Schneider - * NpgsqlBlogProvider.csproj: Helps to fix packaging, and - cleans dependencies + * NpgsqlBlogProvider.cs: + +2015-10-13 Paul Schneider + + * NpgsqlBlogProvider.cs: implements the tag methods on db + +2015-10-10 Paul Schneider + + * NpgsqlBlogProvider.cs: diff --git a/NpgsqlBlogProvider/NpgsqlBlogProvider.cs b/NpgsqlBlogProvider/NpgsqlBlogProvider.cs index a5825052..b6d14820 100644 --- a/NpgsqlBlogProvider/NpgsqlBlogProvider.cs +++ b/NpgsqlBlogProvider/NpgsqlBlogProvider.cs @@ -7,6 +7,7 @@ using Yavsc.Model.Blogs; using Yavsc.Model.Circles; using System.Web.Mvc; using NpgsqlTypes; +using System.Linq; namespace Npgsql.Web.Blog { @@ -15,40 +16,70 @@ namespace Npgsql.Web.Blog /// public class NpgsqlBlogProvider : BlogProvider { + string applicationName; string connectionString; #region implemented abstract members of BlogProvider /// - /// Tag the specified postid and tag. + /// Gets the tag info. + /// + /// The tag info. + /// Tagname. + public override TagInfo GetTagInfo (string tagname) + { + return new NpgsqlTagInfo (connectionString, tagname); + } + + /// + /// Tag the specified post by identifier + /// using the given tag. /// /// Postid. - /// Tag. - public override long Tag (long postid, string tag) + /// Tag name. + public override long Tag (long postid, string tagname) { + long tid = GetOrCreateTagId (tagname); using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "insert into bltag (blid,tag) values (@postid,@tag) returning _id"; - cmd.Parameters.AddWithValue("@tag",tag); - cmd.Parameters.AddWithValue("@postid",postid); + cmd.CommandText = "INSERT INTO tagged (tagid,postid) VALUES (:tid,:pid)"; + cmd.Parameters.AddWithValue ("tid", tid); + cmd.Parameters.AddWithValue ("pid", postid); cnx.Open (); - return (long) cmd.ExecuteScalar (); + cmd.ExecuteNonQuery (); + return tid; } } + /// - /// Removes the tag. + /// Uns the tag. /// + /// Postid. /// Tagid. - public override void RemoveTag (long tagid) + /// Name. + override public void Untag (long postid, string name) + { + Untag (postid, GetTagId (name)); + } + + /// + /// Uns the tag. + /// + /// Postid. + /// Tagid. + /// Tid. + override public void Untag (long postid, long tid) { using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "delete from bltag where _id = @tagid"; - cmd.Parameters.AddWithValue("@tagid",tagid); + cmd.CommandText = "DELETE FROM tagged WHERE postid = :pid AND tagid = :tid"; + cmd.Parameters.AddWithValue ("pid", postid); + cmd.Parameters.AddWithValue ("tid", tid); cnx.Open (); - cmd.ExecuteNonQuery (); + cmd.ExecuteNonQuery (); } } + /// /// Gets the comments. /// @@ -59,32 +90,33 @@ namespace Npgsql.Web.Blog { List cmts = new List (); - using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand()) { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { cmd.CommandText = "select _id, username, bcontent, modified, posted, visible from comment " + - "where applicationname = @appname and postid = @id" + - ((getHidden) ? " and visible = true ":" ") + - "order by posted asc" ; - cmd.Parameters.AddWithValue ("@appname", applicationName); - cmd.Parameters.AddWithValue ("@id", postid); + "where applicationname = :appname and postid = :id" + + ((getHidden) ? " and visible = true " : " ") + + "order by posted asc"; + cmd.Parameters.AddWithValue ("appname", applicationName); + cmd.Parameters.AddWithValue ("id", postid); cnx.Open (); - using (NpgsqlDataReader rdr = cmd.ExecuteReader()) { + using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) { while (rdr.Read ()) { - Comment c = new Comment(); + Comment c = new Comment (); c.CommentText = rdr.GetString (rdr.GetOrdinal ("bcontent")); c.From = rdr.GetString (rdr.GetOrdinal ("username")); c.Modified = rdr.GetDateTime (rdr.GetOrdinal ("modified")); c.Posted = rdr.GetDateTime (rdr.GetOrdinal ("posted")); c.Visible = rdr.GetBoolean (rdr.GetOrdinal ("visible")); c.PostId = postid; - c.Id = rdr.GetInt64(rdr.GetOrdinal("_id")); + c.Id = rdr.GetInt64 (rdr.GetOrdinal ("_id")); cmts.Add (c); } } } - return cmts.ToArray(); + return cmts.ToArray (); } + /// /// Updates the post. /// @@ -94,29 +126,30 @@ namespace Npgsql.Web.Blog /// If set to true visible. /// Circle identifiers public override void UpdatePost (long postid, string title, string content, - bool visible, long [] cids) + bool visible, long[] cids) { - using (NpgsqlConnection cnx = new NpgsqlConnection(connectionString)) { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) { using (NpgsqlCommand cmd = cnx.CreateCommand ()) { DateTime now = DateTime.Now; cmd.CommandText = - "update blog set modified=@now," + - " title = @title," + - " bcontent=@content, " + - " visible = @visible " + - "where _id = @id"; - cmd.Parameters.AddWithValue ("@now", now); - cmd.Parameters.AddWithValue ("@title", title); - cmd.Parameters.AddWithValue ("@content", content); - cmd.Parameters.AddWithValue ("@visible", visible); - cmd.Parameters.AddWithValue ("@id", postid); + "update blog set modified=:now," + + " title = :title," + + " bcontent=:content, " + + " visible = :visible " + + "where _id = :id"; + cmd.Parameters.AddWithValue ("now", now); + cmd.Parameters.AddWithValue ("title", title); + cmd.Parameters.AddWithValue ("content", content); + cmd.Parameters.AddWithValue ("visible", visible); + cmd.Parameters.AddWithValue ("id", postid); cnx.Open (); cmd.ExecuteNonQuery (); } - cnx.Close(); + cnx.Close (); } UpdatePostCircles (postid, cids); } + /// /// Removes the post. /// @@ -125,12 +158,13 @@ namespace Npgsql.Web.Blog { using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "delete from blog where _id = @id"; + cmd.CommandText = "delete from blog where _id = :id"; cmd.Parameters.AddWithValue ("id", postid); cnx.Open (); - cmd.ExecuteNonQuery(); + cmd.ExecuteNonQuery (); } } + /// /// Comment the specified from, postid and content. /// @@ -140,29 +174,30 @@ namespace Npgsql.Web.Blog public override long Comment (string from, long postid, string content) { if (from == null) - throw new ArgumentNullException("from"); + throw new ArgumentNullException ("from"); if (content == null) - throw new ArgumentNullException("content"); + throw new ArgumentNullException ("content"); bool visible = AutoValidatesComments; - using (NpgsqlConnection cnx= - new NpgsqlConnection(connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand()) { + using (NpgsqlConnection cnx = + new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { cmd.CommandText = "insert into comment (postid,bcontent," + - "modified,posted,visible,username,applicationname)" + - "values (@postid,@bcontent,@modified,@posted," + - "@visible,@username,@appname) returning _id"; - cmd.Parameters.AddWithValue ("@postid", postid); - cmd.Parameters.AddWithValue ("@bcontent", content); + "modified,posted,visible,username,applicationname)" + + "values (:postid,:bcontent,:modified,:posted," + + ":visible,:username,:appname) returning _id"; + cmd.Parameters.AddWithValue ("postid", postid); + cmd.Parameters.AddWithValue ("bcontent", content); DateTime now = DateTime.Now; - cmd.Parameters.AddWithValue ("@modified", now); - cmd.Parameters.AddWithValue ("@posted", now); - cmd.Parameters.AddWithValue ("@visible", visible); - cmd.Parameters.AddWithValue ("@username", from); - cmd.Parameters.AddWithValue ("@appname", applicationName); + cmd.Parameters.AddWithValue ("modified", now); + cmd.Parameters.AddWithValue ("posted", now); + cmd.Parameters.AddWithValue ("visible", visible); + cmd.Parameters.AddWithValue ("username", from); + cmd.Parameters.AddWithValue ("appname", applicationName); cnx.Open (); - return (long) cmd.ExecuteScalar(); + return (long)cmd.ExecuteScalar (); } } + /// /// Validates the comment. /// @@ -171,6 +206,7 @@ namespace Npgsql.Web.Blog { throw new NotImplementedException (); } + /// /// Updates the comment. /// @@ -184,6 +220,7 @@ namespace Npgsql.Web.Blog } private bool autoValidateComment = true; + /// /// Gets or sets a value indicating whether this auto validate comment. /// @@ -193,7 +230,7 @@ namespace Npgsql.Web.Blog return autoValidateComment; } set { - autoValidateComment=value; + autoValidateComment = value; } } @@ -209,6 +246,7 @@ namespace Npgsql.Web.Blog } #endregion + /// /// Initialize the specified name and config. /// @@ -222,10 +260,12 @@ namespace Npgsql.Web.Blog config.Remove ("connectionStringName"); applicationName = config ["applicationName"]; config.Remove ("applicationName"); - defaultPageSize = int.Parse ( config ["pageLen"] ?? "10") ; + defaultPageSize = int.Parse (config ["pageLen"] ?? "10"); base.Initialize (name, config); } + #region implemented abstract members of BlogProvider + /// /// Gets the post. /// @@ -234,14 +274,14 @@ namespace Npgsql.Web.Blog public override BlogEntry GetPost (long postid) { BlogEntry be = null; - using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand()) { - cmd.CommandText = "select username, title, bcontent, modified, posted, visible from blog " + - "where applicationname = @appname and _id = @id"; - cmd.Parameters.AddWithValue ("@appname", applicationName); - cmd.Parameters.AddWithValue ("@id", postid); + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "select username, title, bcontent, modified, posted, visible, photo from blog " + + "where applicationname = :appname and _id = :id"; + cmd.Parameters.AddWithValue ("appname", applicationName); + cmd.Parameters.AddWithValue ("id", postid); cnx.Open (); - using (NpgsqlDataReader rdr = cmd.ExecuteReader()) { + using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) { if (rdr.Read ()) { be = new BlogEntry (); be.Title = rdr.GetString (rdr.GetOrdinal ("title")); @@ -250,13 +290,19 @@ namespace Npgsql.Web.Blog be.Modified = rdr.GetDateTime (rdr.GetOrdinal ("modified")); be.Posted = rdr.GetDateTime (rdr.GetOrdinal ("posted")); be.Visible = rdr.GetBoolean (rdr.GetOrdinal ("visible")); + int oph = rdr.GetOrdinal ("photo"); + if (!rdr.IsDBNull (oph)) + be.Photo = rdr.GetString (oph); be.Id = postid; } } } - if (be!=null) SetCirclesOn (be); + if (be != null) + Populate (be); return be; + } + /// /// Removes the comment. /// @@ -267,13 +313,14 @@ namespace Npgsql.Web.Blog long postid = 0; using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "delete from comment where _id = @id returning postid"; + cmd.CommandText = "delete from comment where _id = :id returning postid"; cmd.Parameters.AddWithValue ("id", cmtid); cnx.Open (); - postid = (long) cmd.ExecuteScalar (); + postid = (long)cmd.ExecuteScalar (); } return postid; } + /// /// Gets the post. /// @@ -282,13 +329,13 @@ namespace Npgsql.Web.Blog /// Title. public override UUTBlogEntryCollection GetPost (string username, string title) { - UUTBlogEntryCollection bec = new UUTBlogEntryCollection (username,title); + UUTBlogEntryCollection bec = new UUTBlogEntryCollection (username, title); using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) { using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "select _id,bcontent,modified,posted,visible from blog " + + cmd.CommandText = "select _id,bcontent,modified,posted,visible,photo from blog " + "where applicationname = :appname and username = :username and title = :title"; cmd.Parameters.AddWithValue ("appname", NpgsqlDbType.Varchar, applicationName); - cmd.Parameters.AddWithValue ("username", NpgsqlDbType.Varchar ,username); + cmd.Parameters.AddWithValue ("username", NpgsqlDbType.Varchar, username); cmd.Parameters.AddWithValue ("title", NpgsqlDbType.Varchar, title); cnx.Open (); cmd.Prepare (); @@ -302,6 +349,11 @@ namespace Npgsql.Web.Blog be.Posted = rdr.GetDateTime (rdr.GetOrdinal ("posted")); be.Visible = rdr.GetBoolean (rdr.GetOrdinal ("visible")); be.Id = rdr.GetInt64 (rdr.GetOrdinal ("_id")); + { + int oph = rdr.GetOrdinal ("photo"); + if (!rdr.IsDBNull (oph)) + be.Photo = rdr.GetString (oph); + } bec.Add (be); } rdr.Close (); @@ -325,20 +377,20 @@ namespace Npgsql.Web.Blog be.Tags = tags.ToArray (); } } - - SetCirclesOn (bec); + if (bec != null) + Populate (bec); } } return bec; } - private void SetCirclesOn(BlogEntry be) + private void SetCirclesOn (BlogEntry be) { List circles = new List (); using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) using (NpgsqlCommand cmdcircles = cnx.CreateCommand ()) { cmdcircles.CommandText = "select a.circle_id from blog_access a " + - "where a.post_id = :pid"; + "where a.post_id = :pid"; cmdcircles.Parameters.AddWithValue ("pid", be.Id); cnx.Open (); using (NpgsqlDataReader rdr = cmdcircles.ExecuteReader ()) { @@ -350,12 +402,122 @@ namespace Npgsql.Web.Blog be.AllowedCircles = circles.ToArray (); } - private void SetCirclesOn(BlogEntryCollection bec) - { - foreach (BlogEntry be in bec) { - SetCirclesOn (be); + /// + /// Removes the tag. + /// + /// Tagid. + public override void DropTag (long tagid) + { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "DELETE from public.tag where _id = :tid"; + cmd.Parameters.AddWithValue ("tagid", tagid); + cnx.Open (); + cmd.ExecuteNonQuery (); + cnx.Close (); } } + + private static string SelectTagsSql = "SELECT tag.name, tag._id FROM public.tag WHERE name like :name"; + + private IEnumerable GetSuggestion (string pattern) + { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = SelectTagsSql; + throw new NotImplementedException (); + } + } + + private static string InsertTagSql = "INSERT INTO tag (name) VALUES (:name) returning _id"; + + private void InsertTag (long postid, long tagid) + { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = InsertTagSql; + throw new NotImplementedException (); + } + } + + private long GetTagId (string tagname) + { + long id = 0; + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "SELECT tag._id FROM public.tag WHERE name = :name"; + cmd.Parameters.AddWithValue ("name", tagname); + cnx.Open (); + id = (long)cmd.ExecuteScalar (); + } + return id; + } + + private long GetOrCreateTagId (string tagname) + { + long id = 0; + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) { + try { + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "SELECT tag._id FROM public.tag WHERE name = :name"; + cmd.Parameters.AddWithValue ("name", tagname); + cnx.Open (); + id = (long)cmd.ExecuteScalar (); + } + } catch (NullReferenceException) { + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "INSERT INTO public.tag(name) VALUES (:name) RETURNING _id"; + cmd.Parameters.AddWithValue ("name", tagname); + cnx.Open (); + id = (long)cmd.ExecuteScalar (); + } + } + } + return id; + } + + + + private static string SelectPostTagsSql = "SELECT tag.name FROM public.tag, public.tagged\n" + + "WHERE tag._id = tagged.tagid AND tagged.postid = :pid \n"; + + private void SetTagsOn (BlogEntryCollection bec) + { + foreach (BlogEntry be in bec) { + SetTagsOn (be); + } + } + + private void SetTagsOn (BlogEntry be) + { + List tags = new List (); + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmdtags = cnx.CreateCommand ()) { + cmdtags.CommandText = SelectPostTagsSql; + cmdtags.Parameters.AddWithValue ("pid", be.Id); + cnx.Open (); + using (NpgsqlDataReader rdr = cmdtags.ExecuteReader ()) { + while (rdr.Read ()) { + tags.Add (rdr.GetString (0)); + } + } + } + be.Tags = tags.ToArray (); + } + + // Assert(bec!=null); + private void Populate (BlogEntryCollection bec) + { + foreach (BlogEntry be in bec) + Populate (be); + } + + private void Populate (BlogEntry be) + { + SetTagsOn (be); + SetCirclesOn (be); + } + /// /// Post the specified username, title, content and visible. /// @@ -364,15 +526,15 @@ namespace Npgsql.Web.Blog /// Content. /// If set to true visible. /// . - public override long Post (string username, string title, string content, bool visible, long [] circles) + public override long Post (string username, string title, string content, bool visible, long[] circles) { long pid = 0; if (username == null) - throw new ArgumentNullException("username"); + throw new ArgumentNullException ("username"); if (title == null) - throw new ArgumentNullException("title"); + throw new ArgumentNullException ("title"); if (content == null) - throw new ArgumentNullException("content"); + throw new ArgumentNullException ("content"); using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) { using (NpgsqlCommand cmd = cnx.CreateCommand ()) { cmd.CommandText = "insert into blog (title,bcontent,modified,posted,visible,username,applicationname)" + @@ -394,7 +556,26 @@ namespace Npgsql.Web.Blog return pid; } - private void UpdatePostCircles( long pid, long[] circles) + /// + /// Updates the post photo. + /// + /// Pid. + /// Photo. + public override void UpdatePostPhoto (long pid, string photo) + { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) { + cnx.Open (); + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "update blog set photo = :photo where _id = :pid"; + cmd.Parameters.AddWithValue ("pid", pid); + cmd.Parameters.AddWithValue ("photo", photo); + cmd.ExecuteNonQuery (); + } + cnx.Close (); + } + } + + private void UpdatePostCircles (long pid, long[] circles) { using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) { cnx.Open (); @@ -403,21 +584,22 @@ namespace Npgsql.Web.Blog cmd.Parameters.AddWithValue ("pid", pid); cmd.ExecuteNonQuery (); } - if (circles!=null) - if (circles.Length>0) - using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "insert into blog_access (post_id,circle_id) values (:pid,:cid)"; - cmd.Parameters.AddWithValue ("pid", NpgsqlTypes.NpgsqlDbType.Bigint, pid); - cmd.Parameters.Add ("cid", NpgsqlTypes.NpgsqlDbType.Bigint); - cmd.Prepare (); - foreach (long ci in circles) { - cmd.Parameters ["cid"].Value = ci; - cmd.ExecuteNonQuery (); + if (circles != null) + if (circles.Length > 0) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "insert into blog_access (post_id,circle_id) values (:pid,:cid)"; + cmd.Parameters.AddWithValue ("pid", NpgsqlTypes.NpgsqlDbType.Bigint, pid); + cmd.Parameters.Add ("cid", NpgsqlTypes.NpgsqlDbType.Bigint); + cmd.Prepare (); + foreach (long ci in circles) { + cmd.Parameters ["cid"].Value = ci; + cmd.ExecuteNonQuery (); + } } - } cnx.Close (); } } + /// /// Finds the post. /// @@ -432,43 +614,55 @@ namespace Npgsql.Web.Blog { BlogEntryCollection c = new BlogEntryCollection (); totalRecords = 0; - using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand()) { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { if (readersName != null) { - cmd.CommandText = "select _id, title,bcontent,modified," + - "posted,username,visible " + - "from blog b left outer join " + - "(select count(*)>0 acc, a.post_id pid " + - "from blog_access a," + - " circle_members m, users u where m.circle_id = a.circle_id " + - " and m.member = u.pkid and u.username = :uname " + - " and u.applicationname = :appname " + - " group by a.post_id) ma on (ma.pid = b._id) " + - "where ( ma.acc IS NULL or ma.acc = TRUE or b.username = :uname) "; + cmd.CommandText = "select _id, title,bcontent, modified," + + "posted,username,visible,photo " + + "from blog b left outer join " + + "(select count(*)>0 acc, a.post_id pid " + + "from blog_access a," + + " circle_members m, users u where m.circle_id = a.circle_id " + + " and m.member = u.username and u.username = :uname " + + " and u.applicationname = :appname " + + " group by a.post_id) ma on (ma.pid = b._id) " + + "where ( ((ma.acc IS NULL or ma.acc = TRUE) and b.Visible IS TRUE ) or b.username = :uname) "; cmd.Parameters.AddWithValue ("uname", readersName); } else { cmd.CommandText = "select _id, title,bcontent,modified," + - "posted,username,visible " + - "from blog b left outer join " + - "(select count(*)>0 acc, a.post_id pid " + - "from blog_access a" + - " group by a.post_id) ma on (ma.pid = b._id)" + - " where " + - " ma.acc IS NULL and " + - " applicationname = :appname"; + "posted,username,visible,photo " + + "from blog b left outer join " + + "(select count(*)>0 acc, a.post_id pid " + + "from blog_access a" + + " group by a.post_id) ma on (ma.pid = b._id)" + + " where " + + " ma.acc IS NULL and " + + " b.Visible IS TRUE and " + + " applicationname = :appname"; } - cmd.Parameters.AddWithValue ("@appname", applicationName); - if ((searchflags & FindBlogEntryFlags.MatchContent) > 0) { - cmd.CommandText += " and bcontent like :bcontent"; - cmd.Parameters.AddWithValue (":bcontent", pattern); - } - if ((searchflags & FindBlogEntryFlags.MatchTitle) > 0) { - cmd.CommandText += " and title like :title"; - cmd.Parameters.AddWithValue (":title", pattern); - } - if ((searchflags & FindBlogEntryFlags.MatchUserName) > 0) { - cmd.CommandText += " and username like :username"; - cmd.Parameters.AddWithValue (":username", pattern); + cmd.Parameters.AddWithValue ("appname", applicationName); + if (pattern != null) { + if ((searchflags & FindBlogEntryFlags.MatchTag) > 0) { + cmd.CommandText += + "AND EXISTS (SELECT tag._id FROM public.tag, public.tagged WHERE " + + "public.tag._id = public.tagged.tagid " + + "AND public.tagged.postid = a.post_id " + + "public.tag.name like :tagname) "; + cmd.Parameters.AddWithValue ("tagname", pattern); + } + + if ((searchflags & FindBlogEntryFlags.MatchContent) > 0) { + cmd.CommandText += " and bcontent like :bcontent"; + cmd.Parameters.AddWithValue ("bcontent", pattern); + } + if ((searchflags & FindBlogEntryFlags.MatchTitle) > 0) { + cmd.CommandText += " and title like :title"; + cmd.Parameters.AddWithValue ("title", pattern); + } + if ((searchflags & FindBlogEntryFlags.MatchUserName) > 0) { + cmd.CommandText += " and username like :username"; + cmd.Parameters.AddWithValue ("username", pattern); + } } if ((searchflags & FindBlogEntryFlags.MatchInvisible) == 0) { cmd.CommandText += " and visible = true"; @@ -476,11 +670,11 @@ namespace Npgsql.Web.Blog cmd.CommandText += " order by posted desc"; cnx.Open (); - using (NpgsqlDataReader rdr = cmd.ExecuteReader()) { + using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) { // pageIndex became one based int firstrec = pageIndex * pageSize; int lastrec = firstrec + pageSize - 1; - while (rdr.Read()) { + while (rdr.Read ()) { if (totalRecords >= firstrec && totalRecords <= lastrec) { BlogEntry be = new BlogEntry (); be.Title = rdr.GetString (rdr.GetOrdinal ("title")); @@ -489,7 +683,12 @@ namespace Npgsql.Web.Blog be.Author = rdr.GetString (rdr.GetOrdinal ("username")); be.Posted = rdr.GetDateTime (rdr.GetOrdinal ("posted")); be.Modified = rdr.GetDateTime (rdr.GetOrdinal ("modified")); - be.Visible = rdr.GetBoolean (rdr.GetOrdinal ("visible")); + be.Visible = rdr.GetBoolean (rdr.GetOrdinal ("visible")); + { + int oph = rdr.GetOrdinal ("photo"); + if (!rdr.IsDBNull (oph)) + be.Photo = rdr.GetString (oph); + } c.Add (be); } totalRecords++; @@ -497,11 +696,12 @@ namespace Npgsql.Web.Blog rdr.Close (); } } - foreach (BlogEntry be in c) - SetCirclesOn (be); + if (c != null) + Populate (c); return c; } + /// /// Removes the post. /// @@ -509,20 +709,21 @@ namespace Npgsql.Web.Blog /// Title. public override void RemoveTitle (string username, string title) { - using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand()) { - cmd.CommandText = "delete from blog where username = @username and applicationname = @appname and title=@title"; - cmd.Parameters.AddWithValue ("@username",username); - cmd.Parameters.AddWithValue ("@appname", applicationName); - cmd.Parameters.AddWithValue ("@title",title); + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "delete from blog where username = :username and applicationname = :appname and title=:title"; + cmd.Parameters.AddWithValue ("username", username); + cmd.Parameters.AddWithValue ("appname", applicationName); + cmd.Parameters.AddWithValue ("title", title); cnx.Open (); cmd.ExecuteNonQuery (); - cnx.Close(); + cnx.Close (); } } int defaultPageSize = 10; + /// /// Lasts the posts. /// @@ -530,30 +731,23 @@ namespace Npgsql.Web.Blog /// Page index. /// Page size. /// Total records. - public override BlogEntryCollection LastPosts(int pageIndex, int pageSize, out int totalRecords) + public override BlogEntryCollection LastPosts (int pageIndex, int pageSize, out int totalRecords) { BlogEntryCollection c = new BlogEntryCollection (); - using (NpgsqlConnection cnx=new NpgsqlConnection(connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand()) { - - /*cmd.CommandText = "select blog.* from blog, " + - "(select max(posted) lpost, username " + - "from blog where applicationname = @appname " + - "group by username) as lblog " + - "where blog.posted = lblog.lpost and blog.username = lblog.username " ; - */ + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { cmd.CommandText = "select * " + - "from blog where applicationname = :appname and visible = true " + - " order by posted desc limit :len" ; + "from blog where applicationname = :appname and visible = true " + + " order by modified desc limit :len"; cmd.Parameters.AddWithValue ("appname", applicationName); - cmd.Parameters.AddWithValue ("len", defaultPageSize*10); + cmd.Parameters.AddWithValue ("len", defaultPageSize * 10); cnx.Open (); - using (NpgsqlDataReader rdr = cmd.ExecuteReader()) { + using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) { totalRecords = 0; int firstrec = pageIndex * pageSize; int lastrec = firstrec + pageSize - 1; - while (rdr.Read()) { + while (rdr.Read ()) { if (totalRecords >= firstrec && totalRecords <= lastrec) { BlogEntry be = new BlogEntry (); be.Id = rdr.GetInt64 (rdr.GetOrdinal ("_id")); @@ -563,16 +757,22 @@ namespace Npgsql.Web.Blog be.Posted = rdr.GetDateTime (rdr.GetOrdinal ("posted")); be.Modified = rdr.GetDateTime (rdr.GetOrdinal ("modified")); be.Visible = true; // because of sql code used + { + int oph = rdr.GetOrdinal ("photo"); + if (!rdr.IsDBNull (oph)) + be.Photo = rdr.GetString (oph); + } c.Add (be); } totalRecords++; } } } - foreach (BlogEntry be in c) - SetCirclesOn (be); + if (c != null) + Populate (c); return c; } + #endregion } } diff --git a/NpgsqlBlogProvider/NpgsqlBlogProvider.csproj b/NpgsqlBlogProvider/NpgsqlBlogProvider.csproj index 80491104..22b1b709 100644 --- a/NpgsqlBlogProvider/NpgsqlBlogProvider.csproj +++ b/NpgsqlBlogProvider/NpgsqlBlogProvider.csproj @@ -34,6 +34,7 @@ + diff --git a/NpgsqlBlogProvider/NpgsqlTagInfo.cs b/NpgsqlBlogProvider/NpgsqlTagInfo.cs new file mode 100644 index 00000000..f68aa3d6 --- /dev/null +++ b/NpgsqlBlogProvider/NpgsqlTagInfo.cs @@ -0,0 +1,103 @@ +// +// NpgsqlTagInfo.cs +// +// Author: +// Paul Schneider +// +// 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 . +using System; +using Yavsc.Model.Blogs; +using System.Collections.Generic; + +namespace Npgsql.Web.Blog +{ + /// + /// Npgsql tag info. + /// + public class NpgsqlTagInfo: TagInfo + { + /// + /// Initializes a new instance of the class. + /// + /// Connection string. + /// Tagname. + public NpgsqlTagInfo (string connectionString, string tagname): base(tagname) + { + titles = new List(); + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = + "SELECT \n" + + " blog.username, \n" + + " blog.posted, \n" + + " blog.modified, \n" + + " blog.title, \n" + + " blog.bcontent, \n" + + " blog.visible, \n" + + " blog._id, \n" + + " blog.photo, \n" + + " tag.name\n" + + "FROM \n" + + " public.blog, \n" + + " public.tagged, \n" + + " public.tag\n" + + "WHERE \n" + + " tagged.postid = blog._id AND \n" + + " tag._id = tagged.tagid AND \n" + + " public.tag.name = :name"; + cmd.Parameters.AddWithValue ("name", tagname); + cnx.Open (); + using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) { + while (rdr.Read ()) { + bool truncated; + int oph = rdr.GetOrdinal ("photo"); + string photo = null; + if (!rdr.IsDBNull (oph)) + photo = rdr.GetString (oph); + var pi = new BasePostInfo { + Title = rdr.GetString(3), + Author = rdr.GetString (0), + Id = rdr.GetInt64 (6), + Intro = MarkdownHelper.MarkdownIntro ( + rdr.GetString (4), + out truncated), + Visible = rdr.GetBoolean(5), + Photo = photo, + Modified = rdr.GetDateTime(2), + Posted = rdr.GetDateTime(1) + }; + titles.Add (pi); + } + } + } + } + + List titles; + + #region implemented abstract members of TagInfo + /// + /// Gets the titles. + /// + /// The titles. + public override System.Collections.Generic.IEnumerable Titles { + get { + return titles; + } + } + #endregion + } +} + diff --git a/NpgsqlContentProvider/ChangeLog b/NpgsqlContentProvider/ChangeLog deleted file mode 100644 index 84021525..00000000 --- a/NpgsqlContentProvider/ChangeLog +++ /dev/null @@ -1,62 +0,0 @@ -2015-10-04 Paul Schneider - - * packages.config: - * NpgsqlContentProvider.csproj: Npgsql package update - -2015-09-27 Paul Schneider - - * NpgsqlCircleProvider.cs: Fixes the sql command preparation - -2015-09-10 Paul Schneider - - * NpgsqlCircleProvider.cs: - -2015-09-10 Paul Schneider - - * NpgsqlCircleProvider.cs: * refactoring - * updates the circle - -2015-08-20 Paul Schneider - - * NpgsqlCircleProvider.cs: circle members are now stored in bd - upon their user's name - -2015-08-04 Paul Schneider - - * NpgsqlCircleProvider.cs: Fixes the "Match" method. - - * NpgsqlContentProvider.cs: refactoring - -2015-07-15 Paul Schneider - - * NpgsqlCircleProvider.cs: Makes Circles private, or not - - * NpgsqlContentProvider.cs: Impacts htmldoc - - * NpgsqlContentProvider.csproj: Moves to Mono framework - -2015-07-02 Paul Schneider - - * NpgsqlCircleProvider.cs: - -2015-06-18 Paul Schneider - - * NpgsqlCircleProvider.cs: Fixes the Circle creation - - * NpgsqlContentProvider.cs: code formatting - -2015-06-10 Paul Schneider - - * NpgsqlCircleProvider.cs: - -2015-06-10 Paul Schneider - - * NpgsqlCircleProvider.cs: implements a Circle provider - - * NpgsqlContentProvider.csproj: new circle provider - -2015-06-09 Paul Schneider - - * NpgsqlContentProvider.csproj: Helps to fix packaging, and - cleans dependencies - diff --git a/NpgsqlMRPProviders/ChangeLog b/NpgsqlMRPProviders/ChangeLog deleted file mode 100644 index 69e1408d..00000000 --- a/NpgsqlMRPProviders/ChangeLog +++ /dev/null @@ -1,49 +0,0 @@ -2015-10-04 Paul Schneider - - * packages.config: - * NpgsqlMRPProviders.csproj: Npgsql package update - -2015-10-04 Paul Schneider - - * NpgsqlMembershipProvider.cs: Fixes a Bug introduced by - Npgsql driver upgrade - -2015-08-04 Paul Schneider - - * NpgsqlMRPProviders.csproj: new NpgsqlUserName provider - - * NpgsqlRoleProvider.cs: simpler init method - - * NpgsqlUserNameProvider.cs: impements a UserNameProvider - -2015-08-01 Paul Schneider - - * NpgsqlMembershipProvider.cs: Fixes the membership update. - -2015-07-15 Paul Schneider - - * 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 - - * NpgsqlMembershipProvider.cs: should fix a bug at resetting - the password - -2015-06-10 Paul Schneider - - * NpgsqlMembershipProvider.cs: Fixes the Google registration - since usage of NuGet for Npgsql - -2015-06-09 Paul Schneider - - * NpgsqlCircleProvider.cs: Refactoring: Npgsql prefix - - * NpgsqlMRPProviders.csproj: Helps to fix packaging, and - cleans dependencies - diff --git a/NpgsqlMRPProviders/NpgsqlProfileProvider.cs b/NpgsqlMRPProviders/NpgsqlProfileProvider.cs index 7db4faac..49d7011e 100644 --- a/NpgsqlMRPProviders/NpgsqlProfileProvider.cs +++ b/NpgsqlMRPProviders/NpgsqlProfileProvider.cs @@ -202,7 +202,7 @@ namespace Npgsql.Web return c; using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "SELECT * from profiledata,profiles where " + + cmd.CommandText = "SELECT * from profiledata, profiles where " + "profiledata.uniqueid = profiles.uniqueid " + "and profiles.username = @username " + "and profiles.applicationname = @appname"; diff --git a/TestAPI/AllTests.cs b/TestAPI/AllTests.cs new file mode 100644 index 00000000..35580461 --- /dev/null +++ b/TestAPI/AllTests.cs @@ -0,0 +1,52 @@ +// +// AllTests.cs +// +// Author: +// Paul Schneider +// +// 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 . + +using NUnit.Framework; +using System; +using Yavsc.Model.Blogs; +using Yavsc.Controllers; +using System.Web.Mvc; +using System.Web.Security; +using System.Web.Configuration; +using System.Configuration; +using System.IO; +using System.Web.Http; +using Mono.WebServer; +using System.Net; +using System.Collections; + +namespace Yavsc +{ + public class AllTests + { + [Suite] + public static IEnumerable Suite + { + get + { + ArrayList suite = new ArrayList (); + suite.Add(new BlogUnitTestCase()); + return suite; + } + } + } + +} diff --git a/TestAPI/BlogUnitTest.cs b/TestAPI/BlogUnitTest.cs deleted file mode 100644 index be591a08..00000000 --- a/TestAPI/BlogUnitTest.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// BlogUnitTest.cs -// -// Author: -// Paul Schneider -// -// 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 . -using NUnit.Framework; -using System; -using Yavsc.Model.Blogs; -using Yavsc.Controllers; -using System.Web.Mvc; -using System.Web.Security; - -namespace TestAPI -{ - [TestFixture ()] - public class BlogUnitTest - { - - public string UserName { get; set; } - public string Email { get; set; } - public string Password { get; set; } - - - AccountController accountController; - [TestFixtureSetUp] - public void Init() - { - accountController = new AccountController (); - } - - [Test ()] - public void Register () - { - ViewResult actionResult = accountController.Register ( - new Yavsc.Model.RolesAndMembers.RegisterViewModel () { - UserName = UserName, Email = Email, - Password = "tpwd", ConfirmPassword = Password, - IsApprouved = true - }, - "/testreturnurl") as ViewResult; - Assert.AreEqual (actionResult.ViewName, "RegistrationPending"); - MembershipUser u = Membership.GetUser (UserName, false); - Assert.NotNull (u); - Assert.False (u.IsApproved); - // TODO : check mail for test, - // get the validation key from its body, - // and use the accountController.Validate(username,key) - u.IsApproved = true; - Membership.UpdateUser (u); - Assert.True (u.IsApproved); - } - [TestFixtureTearDown()] - public void Unregister() - { - ViewResult actionResult = - accountController.Unregister (UserName, true) as ViewResult; - Assert.AreEqual (actionResult.ViewName, "Index"); - } - } -} - diff --git a/TestAPI/BlogUnitTestCase.cs b/TestAPI/BlogUnitTestCase.cs new file mode 100644 index 00000000..386d3fbe --- /dev/null +++ b/TestAPI/BlogUnitTestCase.cs @@ -0,0 +1,52 @@ +// +// TagTestCases.cs +// +// Author: +// Paul Schneider +// +// 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 . +using NUnit.Framework; +using System; +using Yavsc.Model.Blogs; + +namespace Yavsc +{ + [TestFixture ()] + public class BlogUnitTestCase: ServerTestCase + { + + [TestFixtureSetUp] + void NeedAPost() + { + Register (); + } + + [Test ()] + public void TestCase () + { + long pid = BlogManager.Post (UserName, "BlogUnitTestCase", "content", true, null); + BlogManager.Tag (pid, "test"); + + } + + [TestFixtureTearDown()] + void Cleanup() + { + Unregister (); + } + } +} + diff --git a/TestAPI/ChangeLog b/TestAPI/ChangeLog index 74fc3d9e..62d6bb37 100644 --- a/TestAPI/ChangeLog +++ b/TestAPI/ChangeLog @@ -1,20 +1,11 @@ -2015-10-07 Paul Schneider - - * BlogUnitTest.cs: Should test the user registration - - * TestAPI.csproj: switch to .Net framework 4.5.1 - -2015-10-04 Paul Schneider +2015-10-17 Paul Schneider + * AllTests.cs: + * HelloWorld.cs: + * DebugServer.cs: * TestAPI.csproj: - * packages.config: Npgsql package update - -2015-07-17 Paul Schneider - - * TestAPI.csproj: - * AssemblyInfo.cs: - - * TestAutomate.cs: Tests an Automate - - * packages.config: using Machine.Specifications + * TestAutomate.cs: + * ServerTestCase.cs: + * BlogUnitTestCase.cs: + * test-domain-TestAPI.config: diff --git a/TestAPI/DebugServer.cs b/TestAPI/DebugServer.cs new file mode 100644 index 00000000..536c0cf7 --- /dev/null +++ b/TestAPI/DebugServer.cs @@ -0,0 +1,51 @@ +// +// DebugServer.cs +// +// Author: +// Paul Schneider +// +// 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 . + +using System; +using NUnit.Framework; +using System.Net; +using Mono.WebServer.XSP; + +namespace Mono.WebServer.Test +{ + + public class DebugServer : IDisposable + { + #region IDisposable implementation + + public void Dispose () + { + // would have a sense when managing the Xsp server instance: + // server.Stop(); + } + + #endregion + + string physicalPath = @"/home/paul/workspace/totem/web/"; + + public int Run () + { + + return Server.Main (new [] { "--applications", "/:"+physicalPath, "--port", "8080", "--nonstop" }); + } + } + +} \ No newline at end of file diff --git a/TestAPI/HelloWorld.cs b/TestAPI/HelloWorld.cs new file mode 100644 index 00000000..f6703cc7 --- /dev/null +++ b/TestAPI/HelloWorld.cs @@ -0,0 +1,73 @@ +// +// HelloWorld.cs +// +// +// HelloWorld.cs +// +// Author: +// Leonardo Taglialegne +// +// Copyright (c) 2013 Leonardo Taglialegne. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using NUnit.Framework; +using System.Net; +using Mono.WebServer.XSP; + +namespace Mono.WebServer.Test +{ + + + [TestFixture] + public class HelloWorld + { + + [Test] + public void TestCase () + { + using (var server = new DebugServer()) { + Assert.AreEqual (0, server.Run ()); + var wc = new WebClient (); + try { + string downloaded = wc.DownloadString ("http://localhost:8080/"); + //Assert.AreEqual (Environment.CurrentDirectory, downloaded); + // ResponseHeaders { + // Date: Thu, 15 Oct 2015 16:12:00 GMT + // Server: Mono.WebServer.XSP/3.8.0.0 Linux + // X-AspNetMvc-Version: 3.0 + // X-AspNet-Version: 4.0.30319 + // Content-Length: 2180 + // Cache-Control: private + // Content-Type: text/html + // Set-Cookie: ASP.NET_SessionId=ED208D636A4312B9745E396D; path=/ + // Keep-Alive: timeout=15, max=100 + // Connection: Keep-Alive } System.Net.WebHeaderCollection + Assert.Greater(wc.ResponseHeaders["Set-Cookie"].Length, 10); + + } catch (WebException e) { + Assert.Fail (e.Message); + } + } + } + } +} \ No newline at end of file diff --git a/TestAPI/ServerTestCase.cs b/TestAPI/ServerTestCase.cs new file mode 100644 index 00000000..02359035 --- /dev/null +++ b/TestAPI/ServerTestCase.cs @@ -0,0 +1,151 @@ +// +// BlogUnitTest.cs +// +// Author: +// Paul Schneider +// +// 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 . +using NUnit.Framework; +using System; +using Yavsc.Model.Blogs; +using Yavsc.Controllers; +using System.Web.Mvc; +using System.Web.Security; +using System.Web.Configuration; +using System.Configuration; +using System.IO; +using System.Web.Http; +using Mono.WebServer; +using System.Net; +using System.Web.Hosting; +using Mono.Web.Util; +using Mono.WebServer.Options; + +namespace Yavsc +{ + + [TestFixture ()] + public class ServerTestCase + { + + public string UserName { get; set; } + public string Email { get; set; } + public string Password { get; set; } + + AccountController accountController; + + public AccountController AccountController { + get { + return accountController; + } + } + + ApplicationServer WebAppServer; + + string defaultMembershipProvider = null; + + [Test] + public virtual void Start() + { + // get the web config + string physicalPath = @"/home/paul/workspace/totem/web/"; + string physicalPathToConfig = physicalPath + "/Web.config"; + ExeConfigurationFileMap exemap = new ExeConfigurationFileMap (); + exemap.ExeConfigFilename = physicalPathToConfig ; + Configuration config = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration (exemap, ConfigurationUserLevel.None); + + + string basedir = AppDomain.CurrentDomain.BaseDirectory; + string curdir = Directory.GetCurrentDirectory (); + string dummyVirtualPath = "/"; + int Port=8080; + XSPWebSource websource=new XSPWebSource(IPAddress.Any,Port); + WebAppServer=new ApplicationServer(websource,physicalPath); + + var broker = new XSPRequestBroker (); + var host = new XSPApplicationHost (); + + host.RequestBroker = broker; + host.Server = WebAppServer; + broker.InitializeLifetimeService (); + host.InitializeLifetimeService (); + // ApplicationHost h = new XSPApplicationHost(); + + //"[[hostname:]port:]VPath:realpath" + string cmdLine=Port+":/:"+physicalPath; + WebAppServer.AddApplicationsFromCommandLine (cmdLine); + + WebAppServer.Broker = broker; + WebAppServer.AppHost = host; + // WebAppServer.AddApplicationsFromConfigFile (physicalPath+"/Web.config"); +// WebConfigurationFileMap map = new WebConfigurationFileMap (); +// map.VirtualDirectories.Add (dummyVirtualPath, new VirtualDirectoryMapping (physicalPath, true)); +// TODO why not? Configuration configuration = WebConfigurationManager.OpenMappedWebConfiguration (map, dummyVirtualPath); + +// string da = (string)config.AppSettings.Settings ["DefaultAvatar"].Value; +// MembershipSection s = config.GetSection ("system.web/membership") as MembershipSection; +// defaultMembershipProvider = s.DefaultProvider; + // ??? WebConfigurationManager.ConfigPath + Configuration cfg = WebConfigurationManager.OpenWebConfiguration (dummyVirtualPath); +// WebConfigurationManager.AppSettings.Clear (); +// WebConfigurationManager.ConnectionStrings.Clear (); +// var mbrssect = WebConfigurationManager.GetWebApplicationSection ("system.web/membership") as MembershipSection; +// +// mbrssect.Providers.Clear (); + var syswebcfg = WebConfigurationManager.GetWebApplicationSection ("system.web") as ConfigurationSection; + + WebAppServer.Start (true,2000); +// System.Threading.Thread.Sleep(30000); + } + + [Test ()] + public virtual void Register () + { + accountController = new AccountController (); + + ViewResult actionResult = accountController.Register ( + new Yavsc.Model.RolesAndMembers.RegisterViewModel () { + UserName = UserName, Email = Email, + Password = "tpwd", ConfirmPassword = Password, + IsApprouved = true + }, + "/testreturnurl") as ViewResult; + Assert.AreSame ("",actionResult.ViewName); + MembershipUser u = Membership.GetUser (UserName, false); + Assert.NotNull (u); + Assert.False (u.IsApproved); + // TODO : check mail for test, + // get the validation key from its body, + // and use the accountController.Validate(username,key) + u.IsApproved = true; + Membership.UpdateUser (u); + Assert.True (u.IsApproved); + } + + [Test()] + public virtual void Stop() { + WebAppServer.Stop(); + } + + public virtual void Unregister() + { + ViewResult actionResult = + accountController.Unregister (UserName, true) as ViewResult; + Assert.AreEqual (actionResult.ViewName, "Index"); + } + } +} + diff --git a/TestAPI/TestAPI.csproj b/TestAPI/TestAPI.csproj index 8e601b4c..0668c673 100644 --- a/TestAPI/TestAPI.csproj +++ b/TestAPI/TestAPI.csproj @@ -58,11 +58,37 @@ + + + + + + + + ..\..\..\..\..\usr\lib\mono\4.5\Mono.WebServer2.dll + + + ..\..\..\..\..\usr\lib\mono\4.5\xsp4.exe + + + nunit + + + nunit + + + nunit + - + + + + + + @@ -74,8 +100,28 @@ {77044C92-D2F1-45BD-80DD-AA25B311B027} Web + + {C6E9E91B-97D3-48D9-8AA7-05356929E162} + NpgsqlBlogProvider + + + {821FF72D-9F4B-4A2C-B95C-7B965291F119} + NpgsqlContentProvider + + + {BBA7175D-7F92-4278-96FC-84C495A2B5A6} + NpgsqlMRPProviders + + + {90BF2234-7252-4CD5-B2A4-17501B19279B} + SalesCatalog + + + False + PreserveNewest + - \ No newline at end of file + diff --git a/TestAPI/TestAutomate.cs b/TestAPI/TestAutomate.cs index ea9a9efb..b83313a4 100644 --- a/TestAPI/TestAutomate.cs +++ b/TestAPI/TestAutomate.cs @@ -55,7 +55,9 @@ namespace TestAPI [Test] public void DoTheTest() { + // Establish context.Invoke (); + // Because of.Invoke (); should_be_in_state_0.Invoke (); should_not_be_in_state_1.Invoke (); diff --git a/web/Test/TestByteA.cs b/TestAPI/TestByteA.cs similarity index 100% rename from web/Test/TestByteA.cs rename to TestAPI/TestByteA.cs diff --git a/TestAPI/test-domain-TestAPI.config b/TestAPI/test-domain-TestAPI.config new file mode 100644 index 00000000..dcc7e6c2 --- /dev/null +++ b/TestAPI/test-domain-TestAPI.config @@ -0,0 +1,124 @@ + + + + + +
+ +
+
+
+
+ + + +
+ +
+
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Yavsc.sln b/Totem.sln similarity index 100% rename from Yavsc.sln rename to Totem.sln diff --git a/WebControls/ChangeLog b/WebControls/ChangeLog index efe3e9e7..0289448f 100644 --- a/WebControls/ChangeLog +++ b/WebControls/ChangeLog @@ -1,3 +1,8 @@ +2015-10-13 Paul Schneider + + * ResultPages.cs: A multi-pages result meta info when one page + only + 2015-10-04 Paul Schneider * ResultPages.cs: . diff --git a/WebControls/ResultPages.cs b/WebControls/ResultPages.cs index f3232106..46e756fb 100644 --- a/WebControls/ResultPages.cs +++ b/WebControls/ResultPages.cs @@ -91,6 +91,21 @@ namespace Yavsc.WebControls } } + /// + /// Gets or sets the Single page message. + /// + /// The none. + [Bindable (true)] + [DefaultValue("1")] + public string SinglePage { + get { + return (string) ViewState["SinglePage"]; + } + set { + ViewState["SinglePage"] = value; + } + } + /// /// Gets or sets the none. /// @@ -105,7 +120,20 @@ namespace Yavsc.WebControls ViewState["None"] = value; } } - + /// + /// Gets or sets the none. + /// + /// The none. + [Bindable (true)] + [DefaultValue("Pages: ")] + public string PagesLabel { + get { + return (string) ViewState["PagesLabel"]; + } + set { + ViewState["PagesLabel"] = value; + } + } /// /// Gets or sets the current page. /// @@ -132,6 +160,7 @@ namespace Yavsc.WebControls writer.WriteEncodedText (Text); int pageCount = ((ResultCount-1) / PageSize) + 1; if ( pageCount > 1 ) { + writer.Write (PagesLabel); for (int pi = (PageIndex < 5) ? 0 : PageIndex - 5; pi < pageCount && pi < PageIndex + 5; pi++) { if (PageIndex == pi) writer.RenderBeginTag ("b"); @@ -144,6 +173,9 @@ namespace Yavsc.WebControls writer.RenderEndTag (); writer.Write (" "); } + } + else { + writer.Write (SinglePage); } } if (ResultCount == 0) { diff --git a/totem-banner.xxs.xcf b/totem-banner.xxs.xcf new file mode 100644 index 00000000..d07a0c0f Binary files /dev/null and b/totem-banner.xxs.xcf differ diff --git a/totem.xcf b/totem.xcf new file mode 100644 index 00000000..ea4a62a3 Binary files /dev/null and b/totem.xcf differ diff --git a/web/ApiControllers/AccountController.cs b/web/ApiControllers/AccountController.cs index 1a7e2362..a9180291 100644 --- a/web/ApiControllers/AccountController.cs +++ b/web/ApiControllers/AccountController.cs @@ -39,10 +39,11 @@ namespace Yavsc.ApiControllers /// Register the specified model. /// /// Model. - [Authorize()] + [Authorize ()] [ValidateAjaxAttribute] public HttpResponseMessage Register ([FromBody] RegisterClientModel model) { + if (ModelState.IsValid) { if (model.IsApprouved) if (!Roles.IsUserInRole ("Admin")) @@ -54,32 +55,32 @@ namespace Yavsc.ApiControllers } MembershipCreateStatus mcs; var user = Membership.CreateUser ( - model.UserName, - model.Password, - model.Email, - model.Question, - model.Answer, - model.IsApprouved, - out mcs); + model.UserName, + model.Password, + model.Email, + model.Question, + model.Answer, + model.IsApprouved, + out mcs); switch (mcs) { case MembershipCreateStatus.DuplicateEmail: ModelState.AddModelError ("Email", "Cette adresse e-mail correspond " + - "à un compte utilisateur existant"); + "à un compte utilisateur existant"); break; case MembershipCreateStatus.DuplicateUserName: ModelState.AddModelError ("UserName", "Ce nom d'utilisateur est " + - "déjà enregistré"); + "déjà enregistré"); break; case MembershipCreateStatus.Success: if (!model.IsApprouved) Url.SendActivationMessage (user); ProfileBase prtu = ProfileBase.Create (model.UserName); - prtu.SetPropertyValue("Name",model.Name); - prtu.SetPropertyValue("Address",model.Address); - prtu.SetPropertyValue("CityAndState",model.CityAndState); - prtu.SetPropertyValue("Mobile",model.Mobile); - prtu.SetPropertyValue("Phone",model.Phone); - prtu.SetPropertyValue("ZipCode",model.ZipCode); + prtu.SetPropertyValue ("Name", model.Name); + prtu.SetPropertyValue ("Address", model.Address); + prtu.SetPropertyValue ("CityAndState", model.CityAndState); + prtu.SetPropertyValue ("Mobile", model.Mobile); + prtu.SetPropertyValue ("Phone", model.Phone); + prtu.SetPropertyValue ("ZipCode", model.ZipCode); break; default: break; @@ -88,15 +89,12 @@ namespace Yavsc.ApiControllers return DefaultResponse (); } - - - /// /// Resets the password. /// /// Model. [ValidateAjax] - public void ResetPassword(LostPasswordModel model) + public void ResetPassword (LostPasswordModel model) { StringDictionary errors; MembershipUser user; @@ -108,4 +106,3 @@ namespace Yavsc.ApiControllers } } } - diff --git a/web/ApiControllers/BlogsController.cs b/web/ApiControllers/BlogsController.cs index 6b60ec28..9c72be98 100644 --- a/web/ApiControllers/BlogsController.cs +++ b/web/ApiControllers/BlogsController.cs @@ -21,28 +21,38 @@ namespace Yavsc.ApiControllers /// public class BlogsController : YavscApiController { - private const string adminRoleName = "Admin"; - /// - /// Initialize the specified controllerContext. + /// Tag the specified model. /// - /// Controller context. - protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext) - { - base.Initialize (controllerContext); - if (!Roles.RoleExists (adminRoleName)) { - Roles.CreateRole (adminRoleName); + /// Model. + [Authorize, + AcceptVerbs ("POST")] + public void Tag (PostTag model) { + if (ModelState.IsValid) { + BlogManager.GetForEditing (model.PostId); + BlogManager.Tag (model.PostId, model.Tag); } } + static string [] officalTags = new string[] { "Artistes", "Accueil", "Actualités", "Mentions légales", "Admin", "Web" } ; + /// + /// Tags the specified pattern. + /// + /// Pattern. + [ValidateAjaxAttribute] + public IEnumerable Tags(string pattern) + { + return officalTags; + } /// - /// Tag the specified postid and tag. + /// Untag the specified postid and tag. /// - /// Postid. + /// Postid. /// Tag. - public long Tag (long postid,string tag) { - BlogManager.GetForEditing (postid); - return BlogManager.Tag (postid, tag); + [Authorize, ValidateAjaxAttribute, HttpPost] + public void Untag (long id, [FromBody] string tag) { + BlogManager.GetForEditing (id); + BlogManager.Untag (id, tag); } /// @@ -50,21 +60,24 @@ namespace Yavsc.ApiControllers /// /// User. /// Title. - [Authorize] - public void RemoveTitle(string user, string title) { + [Authorize, ValidateAjaxAttribute, HttpPost] + public void RemoveTitle(string user, string title) { if (Membership.GetUser ().UserName != user) if (!Roles.IsUserInRole("Admin")) throw new AuthorizationDenied (user); BlogManager.RemoveTitle (user, title); } + /// /// Removes the tag. /// /// Tagid. - public void RemoveTag(long tagid) { + [Authorize, ValidateAjaxAttribute, HttpPost] + public void RemoveTag([FromBody] long tagid) { throw new NotImplementedException (); } + /// /// The allowed media types. /// @@ -84,7 +97,7 @@ namespace Yavsc.ApiControllers /// Posts the file. /// /// The file. - [Authorize,HttpPost] + [Authorize, HttpPost] public async Task PostFile(long id) { if (!(Request.Content.Headers.ContentType.MediaType=="multipart/form-data")) throw new HttpRequestException ("not a multipart/form-data request"); @@ -125,20 +138,40 @@ namespace Yavsc.ApiControllers } } - [Authorize,HttpGet] - public async Task SearchFile(long postid, string terms) { + + /// + /// Searchs the file. + /// + /// The file. + /// Postid. + /// Terms. + [HttpGet] + public async Task SearchFile(long id, string terms) { throw new NotImplementedException (); } + + /// + /// Sets the photo. + /// + /// Identifier. + /// Photo. + [Authorize, HttpPost, ValidateAjaxAttribute] + public void SetPhoto(long id, [FromBody] string photo) + { + BlogManager.Provider.UpdatePostPhoto (id, photo); + } + /// /// Import the specified id. /// /// Identifier. + [Authorize, HttpPost, ValidateAjaxAttribute] public async Task Import(long id) { if (!(Request.Content.Headers.ContentType.MediaType=="multipart/form-data")) throw new HttpRequestException ("not a multipart/form-data request"); BlogEntry be = BlogManager.GetPost (id); if (be.Author != Membership.GetUser ().UserName) - throw new AuthorizationDenied ("b"+id); + throw new AuthorizationDenied ("post: "+id); string root = HttpContext.Current.Server.MapPath("~/bfiles/"+id); DirectoryInfo di = new DirectoryInfo (root); if (!di.Exists) di.Create (); @@ -146,26 +179,13 @@ namespace Yavsc.ApiControllers try { // Read the form data. - IEnumerable data = await Request.Content.ReadAsMultipartAsync(provider) ; + //IEnumerable data = + await Request.Content.ReadAsMultipartAsync(provider) ; var invalidChars = Path.GetInvalidFileNameChars(); - List parts = new List(); - List text = new List(); - - // filter files on their mime type - foreach ( var httpAudioContent in data - ) { - string [] mimetype = httpAudioContent.Headers.ContentType.MediaType.Split('/'); - switch (mimetype[0]) { - case "application": break; - case "text": break; - case "image": break; - case "audio": break; - case "video": break; - } - } - - foreach (string fkey in text) + List bodies = new List(); + + foreach (string fkey in provider.BodyPartFileNames.Keys) { string filename = provider.BodyPartFileNames[fkey]; @@ -177,10 +197,7 @@ namespace Yavsc.ApiControllers FileInfo fp = new FileInfo (Path.Combine(root,filename)); if (fi.Exists) fi.Delete(); fp.MoveTo(fi.FullName); - // Get the mime type - - - + // TODO Get the mime type using (Process p = new Process ()) { p.StartInfo.WorkingDirectory = root; p.StartInfo = new ProcessStartInfo (); @@ -203,14 +220,14 @@ namespace Yavsc.ApiControllers ); } } - parts.Add(fo.OpenText().ReadToEnd()); + bodies.Add(fo.OpenText().ReadToEnd()); fi.Delete(); fo.Delete(); } - return Request.CreateResponse(HttpStatusCode.OK,string.Join("---\n",parts),new SimpleFormatter("text/plain")); + return Request.CreateResponse(HttpStatusCode.OK,string.Join("---\n",bodies),new SimpleFormatter("text/plain")); } catch (System.Exception e) diff --git a/web/instdbws.sql b/web/App_Data/instdbws.sql similarity index 91% rename from web/instdbws.sql rename to web/App_Data/instdbws.sql index 60ff98df..7a9fc945 100644 --- a/web/instdbws.sql +++ b/web/App_Data/instdbws.sql @@ -97,31 +97,31 @@ WITH ( CREATE TABLE profiledata ( - uniqueid integer, - "address.zipcode" character varying(10), - "address.cityandstate" character varying(255), + uniqueid integer, + zipcode character varying(10), + cityandstate character varying(255), blogtitle character varying(255), -- Blog Title - "address.address" character varying(2048), -- Postal address - "address.country" character varying(100), + address character varying(2048), -- Postal address + country character varying(100), website character varying(256), blogvisible boolean, name character varying(1024), phone character varying(15), mobile character varying(15), - "bank.accountnumber" character varying(15), -- Numero de compte - "bank.key" integer, -- clé RIB - "bank.code" character varying(5), -- Code banque - "bank.wicketcode" character varying(5), - "bank.iban" character varying(33), - "bank.bic" character varying(15), - "google.token" character varying(512), -- Google authentification token - "google.refreshtoken" character varying(512), -- Google refresh token - "google.tokentype" character varying(256), -- Google access token type - "google.calid" character varying(255), -- Google calendar identifier - "google.tokenexpir" timestamp with time zone, -- Google access token expiration date + accountnumber character varying(15), -- Numero de compte + bankedkey integer, -- clé RIB + bankcode character varying(5), -- Code banque + wicketcode character varying(5), + iban character varying(33), + bic character varying(15), + gtoken character varying(512), -- Google authentification token + grefreshtoken character varying(512), -- Google refresh token + gtokentype character varying(256), -- Google access token type + gcalid character varying(255), -- Google calendar identifier + gtokenexpir timestamp with time zone, -- Google access token expiration date avatar character varying(512), -- url for an avatar - "google.calapi" boolean NOT NULL DEFAULT false, - "google.regid" character varying(1024), -- Google Cloud Message registration identifier + gcalapi boolean NOT NULL DEFAULT false, + gregid character varying(1024), -- Google Cloud Message registration identifier CONSTRAINT fkprofiles2 FOREIGN KEY (uniqueid) REFERENCES profiles (uniqueid) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE @@ -129,12 +129,9 @@ CREATE TABLE profiledata WITH ( OIDS=FALSE ); -ALTER TABLE profiledata - OWNER TO yavscdev; COMMENT ON COLUMN profiledata."address.address" IS 'Postal address'; COMMENT ON COLUMN profiledata.blogtitle IS 'Blog Title'; COMMENT ON COLUMN profiledata.avatar IS 'url for an avatar'; -COMMENT ON COLUMN profiledata.hasavatar IS 'True when user has specified an image for avatar'; COMMENT ON COLUMN profiledata."bank.accountnumber" IS 'Numero de compte'; COMMENT ON COLUMN profiledata."bank.key" IS 'clé RIB'; COMMENT ON COLUMN profiledata."bank.code" IS 'Code banque'; @@ -174,6 +171,7 @@ CREATE TABLE blog bcontent text NOT NULL, visible boolean NOT NULL, _id bigserial NOT NULL, + photo character varying(512), CONSTRAINT blog_pkey PRIMARY KEY (_id), CONSTRAINT bloguser FOREIGN KEY (applicationname, username) REFERENCES users (applicationname, username) MATCH SIMPLE @@ -183,23 +181,22 @@ WITH ( OIDS=FALSE ); - -- Table: blfiles +COMMENT ON COLUMN blog.photo IS 'a photo url, supposed to be the main photo +related to this post'; + CREATE TABLE blfiles ( _id bigserial NOT NULL, -- Identifier name character varying(2048), -- File Name, relative to the user home directory, must not begin with a slash. - blid bigint, -- Blog entry identifier (foreign key) - CONSTRAINT blfiles_pkey PRIMARY KEY (_id), - CONSTRAINT blfiles_blid_fkey FOREIGN KEY (blid) - REFERENCES blog (_id) MATCH SIMPLE - ON UPDATE CASCADE ON DELETE CASCADE + alt_text character varying(512), + CONSTRAINT bltags_pkey PRIMARY KEY (_id) ) WITH ( OIDS=FALSE ); COMMENT ON COLUMN blfiles._id IS 'Identifier'; COMMENT ON COLUMN blfiles.name IS 'File Name, relative to the user home directory, must not begin with a slash.'; -COMMENT ON COLUMN blfiles.blid IS 'Blog entry identifier (foreign key)'; + -- Table: commandes @@ -259,7 +256,7 @@ CREATE TABLE comment CONSTRAINT comment_pkey PRIMARY KEY (_id), CONSTRAINT fkey_blog FOREIGN KEY (postid) REFERENCES blog (_id) MATCH SIMPLE - ON UPDATE CASCADE ON DELETE , + ON UPDATE CASCADE ON DELETE CASCADE, CONSTRAINT fkey_users FOREIGN KEY (username, applicationname) REFERENCES users (username, applicationname) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE @@ -670,8 +667,7 @@ CREATE TABLE circle WITH ( OIDS=FALSE ); -ALTER TABLE circle - OWNER TO yavscdev; + 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'; @@ -735,3 +731,23 @@ WITH ( OIDS=FALSE ); +-- Table: postheader + +-- DROP TABLE postheader; + +CREATE TABLE postheader +( + postid bigserial NOT NULL, -- Blog post identifier, to which will be associated this head image + url character varying(512), -- Url for this header image,... + CONSTRAINT postheader_pkey PRIMARY KEY (postid), + CONSTRAINT postheader_postid_fkey FOREIGN KEY (postid) + REFERENCES blog (_id) MATCH SIMPLE + ON UPDATE CASCADE ON DELETE CASCADE +) +WITH ( + OIDS=FALSE +); +COMMENT ON COLUMN postheader.postid IS 'Blog post identifier, to which will be associated this head image'; +COMMENT ON COLUMN postheader.url IS 'Url for this header image, if relative, it will be on the path "~/bfiles/"'; + + diff --git a/web/App_Themes/desert.css b/web/App_Themes/desert.css new file mode 100644 index 00000000..3723668d --- /dev/null +++ b/web/App_Themes/desert.css @@ -0,0 +1,34 @@ +/* desert scheme ported from vim to google prettify */ +pre.prettyprint { display: block; background-color: #333 } +pre .nocode { background-color: none; color: #000 } +pre .str { color: #ffa0a0 } /* string - pink */ +pre .kwd { color: #f0e68c; font-weight: bold } +pre .com { color: #87ceeb } /* comment - skyblue */ +pre .typ { color: #98fb98 } /* type - lightgreen */ +pre .lit { color: #cd5c5c } /* literal - darkred */ +pre .pun { color: #fff } /* punctuation */ +pre .pln { color: #fff } /* plaintext */ +pre .tag { color: #f0e68c; font-weight: bold } /* html/xml tag - lightyellow */ +pre .atn { color: #bdb76b; font-weight: bold } /* attribute name - khaki */ +pre .atv { color: #ffa0a0 } /* attribute value - pink */ +pre .dec { color: #98fb98 } /* decimal - lightgreen */ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1,li.L3,li.L5,li.L7,li.L9 { } + +@media print { + pre.prettyprint { background-color: none } + pre .str, code .str { color: #060 } + pre .kwd, code .kwd { color: #006; font-weight: bold } + pre .com, code .com { color: #600; font-style: italic } + pre .typ, code .typ { color: #404; font-weight: bold } + pre .lit, code .lit { color: #044 } + pre .pun, code .pun { color: #440 } + pre .pln, code .pln { color: #000 } + pre .tag, code .tag { color: #006; font-weight: bold } + pre .atn, code .atn { color: #404 } + pre .atv, code .atv { color: #060 } +} diff --git a/web/App_Themes/doxy.css b/web/App_Themes/doxy.css new file mode 100644 index 00000000..b0e89161 --- /dev/null +++ b/web/App_Themes/doxy.css @@ -0,0 +1,64 @@ +/* Doxy pretty-printing styles. Used with prettify.js. */ + +pre .str, code .str { color: #fec243; } /* string - eggyolk gold */ +pre .kwd, code .kwd { color: #8470FF; } /* keyword - light slate blue */ +pre .com, code .com { color: #32cd32; font-style: italic; } /* comment - green */ +pre .typ, code .typ { color: #6ecbcc; } /* type - turq green */ +pre .lit, code .lit { color: #d06; } /* literal - cherry red */ +pre .pun, code .pun { color: #8B8970; } /* punctuation - lemon chiffon4 */ +pre .pln, code .pln { color: #f0f0f0; } /* plaintext - white */ +pre .tag, code .tag { color: #9c9cff; } /* html/xml tag (bluey) */ +pre .htm, code .htm { color: #dda0dd; } /* html tag light purply*/ +pre .xsl, code .xsl { color: #d0a0d0; } /* xslt tag light purply*/ +pre .atn, code .atn { color: #46eeee; font-weight: normal;} /* html/xml attribute name - lt turquoise */ +pre .atv, code .atv { color: #EEB4B4; } /* html/xml attribute value - rosy brown2 */ +pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ + +a { + text-decoration: none; +} +pre.prettyprint, code.prettyprint { + font-family:'Droid Sans Mono','CPMono_v07 Bold','Droid Sans'; + font-weight: bold; + font-size: 9pt; + background-color: #0f0f0f; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -o-border-radius: 8px; + -ms-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px; +} /* background is black (well, just a tad less dark ) */ + +pre.prettyprint { + width: 95%; + margin: 1em auto; + padding: 1em; + white-space: pre-wrap; +} + +pre.prettyprint a, code.prettyprint a { + text-decoration:none; +} +/* Specify class=linenums on a pre to get line numbering; line numbers themselves are the same color as punctuation */ +ol.linenums { margin-top: 0; margin-bottom: 0; color: #8B8970; } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1,li.L3,li.L5,li.L7,li.L9 { } + +/* print is mostly unchanged from default at present */ +@media print { + pre.prettyprint, code.prettyprint { background-color: #fff; } + pre .str, code .str { color: #088; } + pre .kwd, code .kwd { color: #006; font-weight: bold; } + pre .com, code .com { color: #oc3; font-style: italic; } + pre .typ, code .typ { color: #404; font-weight: bold; } + pre .lit, code .lit { color: #044; } + pre .pun, code .pun { color: #440; } + pre .pln, code .pln { color: #000; } + pre .tag, code .tag { color: #b66ff7; font-weight: bold; } + pre .htm, code .htm { color: #606; font-weight: bold; } + pre .xsl, code .xsl { color: #606; font-weight: bold; } + pre .atn, code .atn { color: #c71585; font-weight: normal; } + pre .atv, code .atv { color: #088; font-weight: normal; } +} diff --git a/web/App_Themes/prettify.css b/web/App_Themes/prettify.css new file mode 100644 index 00000000..d44b3a22 --- /dev/null +++ b/web/App_Themes/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/web/App_Themes/sons-of-obsidian.css b/web/App_Themes/sons-of-obsidian.css new file mode 100644 index 00000000..567c5cb2 --- /dev/null +++ b/web/App_Themes/sons-of-obsidian.css @@ -0,0 +1,118 @@ +/* + * Derived from einaros's Sons of Obsidian theme at + * http://studiostyl.es/schemes/son-of-obsidian by + * Alex Ford of CodeTunnel: + * http://CodeTunnel.com/blog/post/71/google-code-prettify-obsidian-theme + */ + +.str +{ + color: #EC7600; +} +.kwd +{ + color: #93C763; +} +.com +{ + color: #66747B; +} +.typ +{ + color: #678CB1; +} +.lit +{ + color: #FACD22; +} +.pun +{ + color: #F1F2F3; +} +.pln +{ + color: #F1F2F3; +} +.tag +{ + color: #8AC763; +} +.atn +{ + color: #E0E2E4; +} +.atv +{ + color: #EC7600; +} +.dec +{ + color: purple; +} +pre.prettyprint +{ + border: 0px solid #888; +} +ol.linenums +{ + margin-top: 0; + margin-bottom: 0; +} +.prettyprint { + background: #000; +} +li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9 +{ + color: #555; + list-style-type: decimal; +} +li.L1, li.L3, li.L5, li.L7, li.L9 { + background: #111; +} +@media print +{ + .str + { + color: #060; + } + .kwd + { + color: #006; + font-weight: bold; + } + .com + { + color: #600; + font-style: italic; + } + .typ + { + color: #404; + font-weight: bold; + } + .lit + { + color: #044; + } + .pun + { + color: #440; + } + .pln + { + color: #000; + } + .tag + { + color: #006; + font-weight: bold; + } + .atn + { + color: #404; + } + .atv + { + color: #060; + } +} \ No newline at end of file diff --git a/web/App_Themes/style.css b/web/App_Themes/style.css index 5d484951..31032385 100644 --- a/web/App_Themes/style.css +++ b/web/App_Themes/style.css @@ -4,78 +4,112 @@ body { background-color: black; color: #D0FFD0; font-family: 'Arial', cursive; - padding:2em; - margin:2em; + padding: 0; + margin: 0; +} +/* Start by setting display:none to make this hidden. + Then we position it in relation to the viewport window + with position:fixed. Width, height, top and left speak + for themselves. Background we set to 80% white with + our animation centered, and no-repeating */ +.modal { + display: none; + position: fixed; + z-index: 1000; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: rgba( 255, 255, 255, .8 ) + url('http://i.stack.imgur.com/FhHRx.gif') + 50% 50% + no-repeat; } +/* When the body has the loading class, we turn + the scrollbar off with overflow:hidden */ +body.loading { + overflow: hidden; +} + +/* Anytime the body has the loading class, our + modal element will be visible */ +body.loading .modal { + display: block; +} .iconsmall { max-height: 1.3em; max-width: 1.3em; } -input, textarea, checkbox { - color: #FFFFA0; - background: black; - } - +.photo { width: 100%; } +.blogbanner { float: left; top:0; } +.subtitle { font-size:small; font-style: italic; } header { + padding: 0; + margin: 0; + padding-top: 201px; + padding-bottom:2em; display: block; - border-radius:1em; - margin: 1em; - padding: 3em; - min-height: 8em; - background: url("/images/star-939235_1280.jpg") 0 0 no-repeat fixed; + background: url("/images/totem-banner.xs.jpg") 0 0 no-repeat fixed; } +header h1, header a { +background-color: rgba(0,0,0,.5); +margin:0; padding:1em; +} nav { - border-radius:1em; - margin: 1em; - padding: 1em; + margin: 2em; + padding: 2em; display: block; - background: url("/images/helix-nebula-1400x1400.s.jpg") 50% 10% repeat fixed ; - min-height: 10em; + border-radius:1em; + background: url("/images/live-concert-388160_1280.jpg") 50% 10em repeat fixed ; + justify-content: space-around; } main { - border-radius:1em; - margin: 1em; - padding: 1em; + margin: 2em; + padding: 2em; display: block; - background: url("/images/p8-av4.png") 50% 20em no-repeat fixed ; - min-height: 10em; + border-radius:1em; + background: url("/images/musician-923526_1.nbb.jpg") 50% 20em repeat fixed ; } footer { - border-radius:1em; - margin: 1em; - padding: 1em; + background: url("/images/drummer-652345_1280.s.jpg") 50% 30em repeat fixed ; + margin: 0; + margin-top: 2em; + padding: 2em; display: block; - background: url("/images/helix-nebula-1400x1400.s.jpg") 50% 90% repeat fixed ; - min-height: 10em; clear: both; font-size: smaller; - justify-content: center; + justify-content: space-around; } footer a { - background-color: rgba(0,0,40,.8); - border-radius:5px; - margin:.5em; + border-radius:1em; padding:1em; } +legend { + border-radius:5px; + padding:.5em; + background-color: rgba(0,0,32,.5); + } +#copyr { text-align: center; display: block; background-color: rgba(20,20,20,.8); } +footer p { display:inline-block; } -footer img { max-height: 2em; vertical-align: middle; } -a.actionlink img, h1 img, .menuitem img { vertical-align: middle; } +footer img { max-height: 3em; vertical-align: middle; } +a img, h1 img, .menuitem img { vertical-align: middle; } #gspacer { - background-color: rgba(0,0,40,.8); - border-radius:5px; - margin:.5em; padding:1em; display: inline-block } + background-color: rgba(20,20,20,.8); + border-radius:1em; + margin:1em; padding:1em; display: inline-block } fieldset { - background-color: rgba(32,16,16,0.8); + background-color: rgba(16,16,64,0.8); border-radius:5px; border: solid 1px #000060; } -video, img { +main video, main img { max-width:100%; max-height:75%; - padding: .5em; + padding: 1em; } aside { @@ -87,10 +121,9 @@ aside { .postpreview { display: inline-block; max-width: 40em; - padding: .5em; - margin: .5em; - background-color: rgba(32,32,32,0.8); - border-radius:10px; + padding: 1em; + background-color: rgba(0,0,32,0.8); + border-radius:1em; } .postpreview video, .postpreview img { max-width:100%; @@ -98,11 +131,10 @@ aside { } .post { display:block; - margin:1em; - padding:1em; - background-color: rgba(32,32,32,0.8); - color: #aaa; - border-radius:10px; + padding: 1em; + background-color: rgba(0,0,32,0.8); + color: #eee; + border-radius:1em; } .hiddenpost { background-color: rgba(16,16,16,0.5); } .fullwidth { width: 100%; } @@ -118,12 +150,25 @@ textarea.fullwidth { min-height:10em; } } .panel,.bshpanel, aside { - background-color: rgba(32,32,16,0.8); - border-radius:5px; - margin:.5em; - padding: .5em; + background-color: rgba(20,20,20,.8); + border-radius: 1em; + padding: 1em; +} +.spanel { + max-width: 24em; + display: inline-block; + padding: .3em; +} +.xspanel { + max-width:13em; + display: inline-block; + padding:.2em; +} +.xxspanel { + max-width:7em; + display: inline-block; + padding:.1em; } - .hint { display: inline; font-style: italic; @@ -137,32 +182,32 @@ content: ")"; } -a { - text-decoration: none; - color: #B0B080; - background-color:rgba(20,20,20,0.5); - text-decoration: none; -} .usertitleref { - color: #B0B080; - border-radius: 5px; + border-radius: 1em; background-color:rgba(0,0,32,0.6); font-family: 'Arial', cursive; padding: 1em; } -a:hover { - text-decoration: underline; -} a:visited { - color: #90B090; + color: #E0E0E0; } label { font-size: medium; } +.editable { + margin 1em; + min-height:1em; + border-radius: 1em; + border: dashed rgb(020,20,256) 2px; +} +#notifications { + padding: 1em; + } -.message, #message { +.notification { font-size: large; background-color: rgba(64,64,0,0.5); + border: solid green 1px; } .dirty { background-color: rgba(128,128,0,0.5); @@ -177,7 +222,6 @@ label { background-color: rgba(256,0,0,0.5); } - .hidden { display:none; } ul.preview li:nth-child(-n+10) { @@ -193,54 +237,53 @@ ul.preview li:nth-child(n) { color: #f88; } -.actionlink { - color: #B0B080; - border-radius: 5px; - background-color:rgba(0,0,32,0.5); +a { + text-decoration: none; +} + +.actionlink, .menuitem, a { + display:inline-block; + color: white; + border-radius:1em; + border: solid black 1px; + background-color: rgba(20,20,20,.8); cursor: pointer; font-family: 'Arial', cursive; - padding: .2em; + padding: 1em; } -input, select { - color: #B0B080; +input, select, textarea { + color: white; + background-color:rgba(0,0,64,0.8); border: solid 1px rgb(128,128,128); - border-radius:5px; - background-color:rgba(0,0,32,0.8); - font-family: 'Arial', cursive; + border-radius:1em; + font-family: 'Arial', cursive; } - -.actionlink:hover { +.actionlink:hover, fa:hover, .menuitem:hover, a:hover { background-color:rgba(30,0,124,0.9); - text-decoration: underline; + border: solid green 1px; +} + input:hover, textarea:hover { + color: white; + background-color:rgba(64,64,64,0.8); } - .code { font-family: "monospace"; background-color: rgba(0,0,256,0.1); border-radius:25px; white-space: pre-wrap; } - -.avatar { - max-width: 64px; - max-height: 64px; -} +#avatar { + float: left; + margin:1em; + } .comment { border-radius:25px; font-size: smaller; } - -.menuitem { - border-radius:5px; - margin:.5em; - padding:.5em; - display: inline-block; -} - .onhover { display:none; position: absolute; @@ -258,11 +301,9 @@ input, select { .c2 { font-size: small; font-style: italic; } .c3 { font-size: x-small; font-style: italic; } - @media print { body {background-color:white;color:black;} - header,footer,.postcomment,.actionlink,nav - { display:none;} + .control, .actionlink, .menuitem, nav { display:none;} } .bshpanel { display:block; } @@ -271,36 +312,37 @@ input, select { .c3-alt { display:none; } @media all and (max-width: 640px) { -body { padding: 1em; margin: 1em;} - header {min-height: 5em;} - } +header { + padding-bottom:1em; + } + +#avatar { + margin:.5em; + } + +header h1, header a , .actionlink, .menuitem, a { padding:.5em;} -@media all and (max-width: 460px) { -body { padding: .5em; margin:.5;} - header { - margin: .5em; - padding: .5em; - min-height: 3em; - background: url("/images/star-939235_1280.xxs.jpg") 0 0 no-repeat fixed; - } nav { - margin: .5em; - padding: .5em; - min-height: 3em; - background: url("/images/helix-nebula-1400x1400.xxs.jpg") 50% 10% repeat fixed ; + margin: 1em; + padding: 1em; + background: url("/images/live-concert-388160_1280.s.jpg") 50% 10% repeat fixed ; } main { - margin: .5em; - padding: .5em; - min-height: 7em; - background: url("/images/p8-av4.xxs.jpg") 50% 20em no-repeat fixed ; + margin: 1em; + padding: 1em; + background: url("/images/musician-923526_1.nbb.xs.jpg") 50% 20em repeat fixed ; } footer { - margin: .5em; - padding: .5em; - min-height: 3em; - background: url("/images/helix-nebula-1400x1400.xxs.jpg") 50% 90% repeat fixed ; + background: url("/images/drummer-652345_1280.s.jpg") 50% 90% repeat fixed ; } + footer a { + border-radius:.5em; + margin:.5em; + padding:.5em; + } + #notifications { + padding: .5em; + } .menuitem { display: block; } @@ -312,7 +354,6 @@ body { padding: .5em; margin:.5;} padding:.3em; } .bshpanel { cursor:zoom-in; } - footer { clear:both; } .c2 { display:initial; } .c2-alt { display:none; } @@ -321,7 +362,31 @@ body { padding: .5em; margin:.5;} } @media all and (max-width: 350px) { -body { padding: 0em; margin:0; } +header { + padding-top: 101px; + padding-bottom:1em; + background: url("/images/totem-banner.xxs.jpg") 0 0 no-repeat fixed; + } +header h1, header a { padding:.2em;} + + nav { + margin: .5em; + padding: .5em; + background: url("/images/live-concert-388160_1280.xxs.jpg") 50% 10% repeat fixed ; + } + main { + margin: .5em; + padding: .5em; + background: url("/images/musician-923526_1.nbb.xxs.jpg") 50% 20em repeat fixed ; + } + footer { + background: url("/images/drummer-652345_1280.xxs.jpg") 50% 90% repeat fixed ; + } + footer a { + border-radius:.2em; + margin:.2em; + padding:.2em; + } .c2 { display:none; } .c2-alt { display:initial; } } diff --git a/web/App_Themes/sunburst.css b/web/App_Themes/sunburst.css new file mode 100644 index 00000000..011d33e2 --- /dev/null +++ b/web/App_Themes/sunburst.css @@ -0,0 +1,51 @@ +/* Pretty printing styles. Used with prettify.js. */ +/* Vim sunburst theme by David Leibovic */ + +pre .str, code .str { color: #65B042; } /* string - green */ +pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ +pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ +pre .typ, code .typ { color: #89bdff; } /* type - light blue */ +pre .lit, code .lit { color: #3387CC; } /* literal - blue */ +pre .pun, code .pun { color: #fff; } /* punctuation - white */ +pre .pln, code .pln { color: #fff; } /* plaintext - white */ +pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ +pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ +pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ +pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ + +pre.prettyprint, code.prettyprint { + background-color: #000; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -o-border-radius: 8px; + -ms-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px; +} + +pre.prettyprint { + width: 95%; + margin: 1em auto; + padding: 1em; + white-space: pre-wrap; +} + + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1,li.L3,li.L5,li.L7,li.L9 { } + +@media print { + pre .str, code .str { color: #060; } + pre .kwd, code .kwd { color: #006; font-weight: bold; } + pre .com, code .com { color: #600; font-style: italic; } + pre .typ, code .typ { color: #404; font-weight: bold; } + pre .lit, code .lit { color: #044; } + pre .pun, code .pun { color: #440; } + pre .pln, code .pln { color: #000; } + pre .tag, code .tag { color: #006; font-weight: bold; } + pre .atn, code .atn { color: #404; } + pre .atv, code .atv { color: #060; } +} diff --git a/web/ChangeLog b/web/ChangeLog index d3d7badb..a512c2df 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,1027 +1,166 @@ -2015-10-07 Paul Schneider - - * AccountController.cs: refactoring password validation - - * CalendarController.cs: - * WorkFlowController.cs: SendActivationMessage became an - extension method - - * style.css: menu items already have a background and color, - since they're `` tags - - * Unregister.aspx: - * AccountController.cs: refactoring user registration - - * BlogsController.cs: Fixes a confusion between Author and - reader ... - - * YavscHelpers.cs: refactoring the password reset - - * App.master: no more + diff --git a/web/Scripts/Prettify/lang-apollo.js b/web/Scripts/Prettify/lang-apollo.js new file mode 100644 index 00000000..99e4a97a --- /dev/null +++ b/web/Scripts/Prettify/lang-apollo.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, +null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); diff --git a/web/Scripts/Prettify/lang-basic.js b/web/Scripts/Prettify/lang-basic.js new file mode 100644 index 00000000..6b784d43 --- /dev/null +++ b/web/Scripts/Prettify/lang-basic.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun", +/^.[^\s\w"$%.]*/,a]]),["basic","cbm"]); diff --git a/web/Scripts/Prettify/lang-clj.js b/web/Scripts/Prettify/lang-clj.js new file mode 100644 index 00000000..1bb539cd --- /dev/null +++ b/web/Scripts/Prettify/lang-clj.js @@ -0,0 +1,18 @@ +/* + Copyright (C) 2011 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], +["typ",/^:[\dA-Za-z-]+/]]),["clj"]); diff --git a/web/Scripts/Prettify/lang-css.js b/web/Scripts/Prettify/lang-css.js new file mode 100644 index 00000000..d7a4640c --- /dev/null +++ b/web/Scripts/Prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], +["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/web/Scripts/Prettify/lang-dart.js b/web/Scripts/Prettify/lang-dart.js new file mode 100644 index 00000000..eefccc91 --- /dev/null +++ b/web/Scripts/Prettify/lang-dart.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], +["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), +["dart"]); diff --git a/web/Scripts/Prettify/lang-erlang.js b/web/Scripts/Prettify/lang-erlang.js new file mode 100644 index 00000000..27214a50 --- /dev/null +++ b/web/Scripts/Prettify/lang-erlang.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], +["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); diff --git a/web/Scripts/Prettify/lang-go.js b/web/Scripts/Prettify/lang-go.js new file mode 100644 index 00000000..1caca231 --- /dev/null +++ b/web/Scripts/Prettify/lang-go.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/web/Scripts/Prettify/lang-hs.js b/web/Scripts/Prettify/lang-hs.js new file mode 100644 index 00000000..ff3729bb --- /dev/null +++ b/web/Scripts/Prettify/lang-hs.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, +null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/web/Scripts/Prettify/lang-lisp.js b/web/Scripts/Prettify/lang-lisp.js new file mode 100644 index 00000000..9c8cfa57 --- /dev/null +++ b/web/Scripts/Prettify/lang-lisp.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], +["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); diff --git a/web/Scripts/Prettify/lang-llvm.js b/web/Scripts/Prettify/lang-llvm.js new file mode 100644 index 00000000..16fade29 --- /dev/null +++ b/web/Scripts/Prettify/lang-llvm.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); diff --git a/web/Scripts/Prettify/lang-lua.js b/web/Scripts/Prettify/lang-lua.js new file mode 100644 index 00000000..7e44cca0 --- /dev/null +++ b/web/Scripts/Prettify/lang-lua.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], +["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/web/Scripts/Prettify/lang-matlab.js b/web/Scripts/Prettify/lang-matlab.js new file mode 100644 index 00000000..d0d35164 --- /dev/null +++ b/web/Scripts/Prettify/lang-matlab.js @@ -0,0 +1,6 @@ +var a=null,b=window.PR,c=[[b.PR_PLAIN,/^[\t-\r \xa0]+/,a," \t\r\n\u000b\u000c\u00a0"],[b.PR_COMMENT,/^%{[^%]*%+(?:[^%}][^%]*%+)*}/,a],[b.PR_COMMENT,/^%[^\n\r]*/,a,"%"],["syscmd",/^![^\n\r]*/,a,"!"]],d=[["linecont",/^\.\.\.\s*[\n\r]/,a],["err",/^\?\?\? [^\n\r]*/,a],["wrn",/^Warning: [^\n\r]*/,a],["codeoutput",/^>>\s+/,a],["codeoutput",/^octave:\d+>\s+/,a],["lang-matlab-operators",/^((?:[A-Za-z]\w*(?:\.[A-Za-z]\w*)*|[).\]}])')/,a],["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)(?!')/,a], +[b.PR_STRING,/^'(?:[^']|'')*'/,a],[b.PR_LITERAL,/^[+-]?\.?\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?[ij]?/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a]],e=[["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a],["transpose",/^'/,a]]; +b.registerLangHandler(b.createSimpleLexer([],[[b.PR_KEYWORD,/^\b(?:break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while)\b/,a],["const",/^\b(?:true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout)\b/,a],[b.PR_TYPE,/^\b(?:cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse)\b/,a],["fun",/^\b(?:abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan[2dh]?|audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|bessel[h-ky]|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:.(?:close|closeVar|computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers.Map|contour(?:[3cf]|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab.io.MatFile|matlab.mixin.(?:Copyable|Heterogeneous(?:.getDefaultScalarElement)?)|matlabrc|matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta.(?:class(?:.fromName)?|DynamicProperty|EnumeratedValue|event|MetaData|method|package(?:.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|ncwriteschema|ndgrid|ndims|ne|NET(?:.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|NetException|setStaticProperty))?|netcdf.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:.(?:create|getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:.isPlatformSupported)?|VideoWriter(?:.getProfiles)?|view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|ylabel|ylim|zeros|zip|zlabel|zlim|zoom)\b/, +a],["fun_tbx",/^\b(?:addedvarplot|andrewsplot|anova[12n]|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|cholcov|Classification(?:BaggedEnsemble|Discriminant(?:.(?:fit|make|template))?|Ensemble|KNN(?:.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:.fit)?|geo(?:cdf|inv|mean|pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|LinearModel(?:.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:.fit)?|nan(?:cov|max|mean|median|min|std|sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|regstats|relieff|ridge|robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest)\b/, +a],["fun_tbx",/^\b(?:adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|reflect|regionprops|registration.metric.(?:MattesMutualInformation|MeanSquares)|registration.optimizer.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb)\b/, +a],["fun_tbx",/^\b(?:bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog)\b/,a],["ident",/^[A-Za-z]\w*(?:\.[A-Za-z]\w*)*/,a]]),["matlab-identifiers"]);b.registerLangHandler(b.createSimpleLexer([],e),["matlab-operators"]);b.registerLangHandler(b.createSimpleLexer(c,d),["matlab"]); diff --git a/web/Scripts/Prettify/lang-ml.js b/web/Scripts/Prettify/lang-ml.js new file mode 100644 index 00000000..8ed2b0ce --- /dev/null +++ b/web/Scripts/Prettify/lang-ml.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], +["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/web/Scripts/Prettify/lang-mumps.js b/web/Scripts/Prettify/lang-mumps.js new file mode 100644 index 00000000..8a6b3fd6 --- /dev/null +++ b/web/Scripts/Prettify/lang-mumps.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, +null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); diff --git a/web/Scripts/Prettify/lang-n.js b/web/Scripts/Prettify/lang-n.js new file mode 100644 index 00000000..27812a58 --- /dev/null +++ b/web/Scripts/Prettify/lang-n.js @@ -0,0 +1,4 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, +a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, +a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/web/Scripts/Prettify/lang-pascal.js b/web/Scripts/Prettify/lang-pascal.js new file mode 100644 index 00000000..8435fad3 --- /dev/null +++ b/web/Scripts/Prettify/lang-pascal.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], +["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); diff --git a/web/Scripts/Prettify/lang-proto.js b/web/Scripts/Prettify/lang-proto.js new file mode 100644 index 00000000..f006ad8c --- /dev/null +++ b/web/Scripts/Prettify/lang-proto.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/web/Scripts/Prettify/lang-r.js b/web/Scripts/Prettify/lang-r.js new file mode 100644 index 00000000..99af8f85 --- /dev/null +++ b/web/Scripts/Prettify/lang-r.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], +["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); diff --git a/web/Scripts/Prettify/lang-rd.js b/web/Scripts/Prettify/lang-rd.js new file mode 100644 index 00000000..7a7e43fd --- /dev/null +++ b/web/Scripts/Prettify/lang-rd.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); diff --git a/web/Scripts/Prettify/lang-scala.js b/web/Scripts/Prettify/lang-scala.js new file mode 100644 index 00000000..3f97dba5 --- /dev/null +++ b/web/Scripts/Prettify/lang-scala.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], +["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/web/Scripts/Prettify/lang-sql.js b/web/Scripts/Prettify/lang-sql.js new file mode 100644 index 00000000..8ec4280b --- /dev/null +++ b/web/Scripts/Prettify/lang-sql.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, +null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/web/Scripts/Prettify/lang-tcl.js b/web/Scripts/Prettify/lang-tcl.js new file mode 100644 index 00000000..490f562c --- /dev/null +++ b/web/Scripts/Prettify/lang-tcl.js @@ -0,0 +1,3 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", +/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); diff --git a/web/Scripts/Prettify/lang-tex.js b/web/Scripts/Prettify/lang-tex.js new file mode 100644 index 00000000..dcfdadd0 --- /dev/null +++ b/web/Scripts/Prettify/lang-tex.js @@ -0,0 +1 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/web/Scripts/Prettify/lang-vb.js b/web/Scripts/Prettify/lang-vb.js new file mode 100644 index 00000000..ddde4643 --- /dev/null +++ b/web/Scripts/Prettify/lang-vb.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, +null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/web/Scripts/Prettify/lang-vhdl.js b/web/Scripts/Prettify/lang-vhdl.js new file mode 100644 index 00000000..51f30170 --- /dev/null +++ b/web/Scripts/Prettify/lang-vhdl.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, +null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], +["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/web/Scripts/Prettify/lang-wiki.js b/web/Scripts/Prettify/lang-wiki.js new file mode 100644 index 00000000..96c1e34f --- /dev/null +++ b/web/Scripts/Prettify/lang-wiki.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); +PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/web/Scripts/Prettify/lang-xq.js b/web/Scripts/Prettify/lang-xq.js new file mode 100644 index 00000000..e323ae32 --- /dev/null +++ b/web/Scripts/Prettify/lang-xq.js @@ -0,0 +1,3 @@ +PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], +["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], +["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/web/Scripts/Prettify/lang-yaml.js b/web/Scripts/Prettify/lang-yaml.js new file mode 100644 index 00000000..c38729b6 --- /dev/null +++ b/web/Scripts/Prettify/lang-yaml.js @@ -0,0 +1,2 @@ +var a=null; +PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/web/Scripts/Prettify/prettify.js b/web/Scripts/Prettify/prettify.js new file mode 100644 index 00000000..7b990496 --- /dev/null +++ b/web/Scripts/Prettify/prettify.js @@ -0,0 +1,30 @@ +!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= +b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", +/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ +s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, +q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= +c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), +["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); +return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i=0;){var M=A[m],T=M.src.match(/^[^#?]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D= +[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]- +a[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y, +g),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\S\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, +r,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/, +r,"#"]),h.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):d.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\/\/[^\n\r]*/,r]),h.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\n\r")?".":"[\\S\\s]";h.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ +("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+e+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+e+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),r]);d.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, +r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}} +function e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], +L=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +N=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, +S=/\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", +/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], +["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}), +["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N, +hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); +i(C([],[["str",/^[\S\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML}, +prettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p").attr('id', this.options.uuid + "-insert-image-dialog").html(dialog_html); - $buttonset = jQuery("").addClass(this.widgetName); - $buttonHolder = jQuery(''); - $buttonHolder.hallobutton({ - label: this.texts.title_insert, - icon: 'fa-picture-o', - editable: this.options.editable, - command: null, - queryState: false, - uuid: this.options.uuid, - cssClass: this.options.buttonCssClass - }); - $buttonset.append($buttonHolder); - this.button = $buttonHolder; - this.button.click(function() { - if (widget.options.dialog.dialog("isOpen")) { - widget._closeDialog(); - } else { - widget.lastSelection = widget.options.editable.getSelection(); - widget._openDialog(); - } - return false; - }); - this.options.editable.element.on("halloselected, hallounselected", function() { - if (widget.options.dialog.dialog("isOpen")) { - return widget.lastSelection = widget.options.editable.getSelection(); - } - }); - this.options.editable.element.on("hallodeactivated", function() { - return widget._closeDialog(); - }); - jQuery(this.options.editable.element).on("click", "img", function(e) { - widget._openDialog(jQuery(this)); - return false; - }); - this.options.editable.element.on('halloselected', function(event, data) { - var toolbar_option; - toolbar_option = widget.options.editable.options.toolbar; - if (toolbar_option === "halloToolbarContextual" && jQuery(data.originalEvent.target).is('img')) { - $toolbar.hide(); - return false; - } - }); - $toolbar.append($buttonset); - return this.options.dialog.dialog(this.options.dialogOpts); - }, - _openDialog: function($image) { - var $editableEl, widget, xposition, yposition; - this.$image = $image; - widget = this; - $editableEl = jQuery(this.options.editable.element); - xposition = $editableEl.offset().left + $editableEl.outerWidth() + 10; - if (this.$image) { - yposition = this.$image.offset().top - jQuery(document).scrollTop(); - } else { - yposition = this.options.toolbar.offset().top - jQuery(document).scrollTop(); - } - this.options.dialog.dialog("option", "position", [xposition, yposition]); - this.options.editable.keepActivated(true); - this.options.dialog.dialog("open"); - if (this.$image) { - this.options.dialog.dialog("option", "title", this.texts.title_properties); - jQuery(document).keyup(function(e) { - if (e.keyCode === 46 || e.keyCode === 8) { - jQuery(document).off(); - widget._closeDialog(); - widget.$image.remove(); - widget.$image = null; - } - return e.preventDefault(); - }); - this.options.editable.element.on("click", function() { - widget.$image = null; - return widget._closeDialog(); - }); - } else { - this.options.dialog.children('#hallo_img_properties').hide(); - this.options.dialog.dialog("option", "title", this.texts.title_insert); - if (jQuery('#hallo_img_file_select_title').length > 0) { - jQuery('#hallo_img_file_select_title').text(''); - } - } - this._load_dialog_image_properties_ui(); - this.options.dialog.on('dialogclose', (function(_this) { - return function() { - var scrollbar_pos; - jQuery('label', _this.button).removeClass('ui-state-active'); - scrollbar_pos = jQuery(document).scrollTop(); - _this.options.editable.element.focus(); - jQuery(document).scrollTop(scrollbar_pos); - return _this.options.editable.keepActivated(false); - }; - })(this)); - if (this.options.insert_file_dialog_ui_url && !this.dialog_image_selection_ui_loaded) { - this.options.dialog.on('click', ".reload_link", function() { - widget._load_dialog_image_selection_ui(); - return false; - }); - this.options.dialog.on('click', '.file_preview img', function() { - var new_source; - if (widget.$image) { - new_source = jQuery(this).attr('src').replace(/-thumb/, ''); - widget.$image.attr('src', new_source); - jQuery('#hallo_img_source').val(new_source); - } else { - widget._insert_image(jQuery(this).attr('src').replace(/-thumb/, '')); - } - return false; - }); - return this._load_dialog_image_selection_ui(); - } - }, - _insert_image: function(source) { - this.options.editable.restoreSelection(this.lastSelection); - document.execCommand("insertImage", null, source); - this.options.editable.element.trigger('change'); - this.options.editable.removeAllSelections(); - return this._closeDialog(); - }, - _closeDialog: function() { - return this.options.dialog.dialog("close"); - }, - _load_dialog_image_selection_ui: function() { - var widget; - widget = this; - return jQuery.ajax({ - url: this.options.insert_file_dialog_ui_url, - success: function(data, textStatus, jqXHR) { - var $properties, file_select_title, t; - file_select_title = ''; - $properties = widget.options.dialog.children('#hallo_img_properties'); - if ($properties.is(':visible')) { - file_select_title = widget.texts.change_image; - } - t = "
" + file_select_title + "
"; - widget.options.dialog.children('#hallo_img_file_select_ui').html(t + data); - return widget.dialog_image_selection_ui_loaded = true; - }, - beforeSend: function() { - return widget.options.dialog.children('#hallo_img_file_select_ui').html('
'); - } - }); - }, - _load_dialog_image_properties_ui: function() { - var $img_properties, button, height, html, widget, width; - widget = this; - $img_properties = this.options.dialog.children('#hallo_img_properties'); - if (this.$image) { - width = this.$image.is('[width]') ? this.$image.attr('width') : ''; - height = this.$image.is('[height]') ? this.$image.attr('height') : ''; - html = this._property_input_html('source', this.$image.attr('src'), { - label: this.texts.source - }) + this._property_input_html('alt', this.$image.attr('alt') || '', { - label: this.texts.alt - }) + this._property_row_html(this._property_input_html('width', width, { - label: this.texts.width, - row: false - }) + this._property_input_html('height', height, { - label: this.texts.height, - row: false - })) + this._property_input_html('padding', this.$image.css('padding'), { - label: this.texts.padding - }) + this._property_row_html(this._property_cb_html('float_left', this.$image.css('float') === 'left', { - label: this.texts.float_left, - row: false - }) + this._property_cb_html('float_right', this.$image.css('float') === 'right', { - label: this.texts.float_right, - row: false - }) + this._property_cb_html('unfloat', this.$image.css('float') === 'none', { - label: this.texts.float_none, - row: false - }), this.texts.txt_float); - $img_properties.html(html); - $img_properties.show(); - } else { - if (!this.options.insert_file_dialog_ui_url) { - $img_properties.html(this._property_input_html('source', '', { - label: this.texts.source - })); - $img_properties.show(); - } - } - if (this.$image) { - if (!this.options.insert_file_dialog_ui_url) { - jQuery('#insert_image_btn').remove(); - } - if (jQuery('#hallo_img_file_select_title').length > 0) { - jQuery('#hallo_img_file_select_title').text(this.texts.chage_image); - } - jQuery('#hallo_img_properties #hallo_img_source').keyup(function() { - return widget.$image.attr('src', this.value); - }); - jQuery('#hallo_img_properties #hallo_img_alt').keyup(function() { - return widget.$image.attr('alt', this.value); - }); - jQuery('#hallo_img_properties #hallo_img_padding').keyup(function() { - return widget.$image.css('padding', this.value); - }); - jQuery('#hallo_img_properties #hallo_img_height').keyup(function() { - widget.$image.css('height', this.value); - return widget.$image.attr('height', this.value); - }); - jQuery('#hallo_img_properties #hallo_img_width').keyup(function() { - widget.$image.css('width', this.value); - return widget.$image.attr('width', this.value); - }); - jQuery('#hallo_img_properties #hallo_img_float_left').click(function() { - if (!this.checked) { - return false; - } - widget.$image.css('float', 'left'); - jQuery('#hallo_img_properties #hallo_img_float_right').removeAttr('checked'); - return jQuery('#hallo_img_properties #hallo_img_unfloat').removeAttr('checked'); - }); - jQuery('#hallo_img_properties #hallo_img_float_right').click(function() { - if (!this.checked) { - return false; - } - widget.$image.css('float', 'right'); - jQuery('#hallo_img_properties #hallo_img_unfloat').removeAttr('checked'); - return jQuery('#hallo_img_properties #hallo_img_float_left').removeAttr('checked'); - }); - return jQuery('#hallo_img_properties #hallo_img_unfloat').click(function() { - if (!this.checked) { - return false; - } - widget.$image.css('float', 'none'); - jQuery('#hallo_img_properties #hallo_img_float_right').removeAttr('checked'); - return jQuery('#hallo_img_properties #hallo_img_float_left').removeAttr('checked'); - }); - } else { - if (!this.options.insert_file_dialog_ui_url) { - button = ""; - $img_properties.after(button); - return jQuery('#insert_image_btn').click(function() { - var $img_source; - $img_source = jQuery('#hallo_img_properties #hallo_img_source'); - return widget._insert_image($img_source.val()); - }); - } - } - }, - _property_col_html: function(col_html) { - return "
" + col_html + "
"; - }, - _property_row_html: function(row_html, label) { - if (label == null) { - label = ''; - } - row_html = this._property_col_html(label) + this._property_col_html(row_html); - return "
" + row_html + "
"; - }, - _property_html: function(property_html, options) { - var entry; - if (options == null) { - options = {}; - } - if (options.row === false) { - if (options.label) { - entry = options.label + " " + property_html; - property_html = "" + entry + ""; - } - return property_html; - } else { - entry = "" + property_html + ""; - return this._property_row_html(entry, options.label); - } - }, - _property_input_html: function(id, value, options) { - var text_field; - if (options == null) { - options = {}; - } - text_field = ""; - return this._property_html(text_field, options); - }, - _property_cb_html: function(id, checked, options) { - var cb, checked_attr; - if (options == null) { - options = {}; - } - checked_attr = checked ? 'checked=checked' : ''; - cb = ""; - return this._property_html(cb, options); - } - }); - })(jQuery); - (function(jQuery) { return jQuery.widget('IKS.halloindicator', { options: { @@ -3183,4 +2816,367 @@ http://hallojs.org }); })(jQuery); + (function(jQuery) { + return jQuery.widget("IKS.hallo-image-insert-edit", { + options: { + editable: null, + toolbar: null, + uuid: "", + insert_file_dialog_ui_url: null, + lang: 'en', + dialogOpts: { + autoOpen: false, + width: 560, + height: 'auto', + modal: false, + resizable: true, + draggable: true, + dialogClass: 'insert-image-dialog' + }, + dialog: null, + buttonCssClass: null + }, + translations: { + en: { + title_insert: 'Insert Image', + title_properties: 'Image Properties', + insert: 'Insert', + chage_image: 'Change Image:', + source: 'URL', + width: 'Width', + height: 'Height', + alt: 'Alt Text', + padding: 'Padding', + txt_float: 'Float', + float_left: 'left', + float_right: 'right', + float_none: 'No' + }, + de: { + title_insert: 'Bild einfügen', + title_properties: 'Bildeigenschaften', + insert: 'Einfügen', + chage_image: 'Bild ändern:', + source: 'URL', + width: 'Breite', + height: 'Höhe', + alt: 'Alt Text', + padding: 'Padding', + txt_float: 'Float', + float_left: 'Links', + float_right: 'Rechts', + float_none: 'Nein' + }, + fr: { + title_insert: 'Inserer une image', + title_properties: 'Propriétés de l\'image', + insert: 'Inserer', + chage_image: 'Changer d\'image:', + source: 'URL', + width: 'Largeur', + height: 'Hauteur', + alt: 'Texte alternatif', + padding: 'Encadrement', + txt_float: 'Flotaison', + float_left: 'gauche', + float_right: 'droite', + float_none: 'non' + } + }, + texts: null, + dialog_image_selection_ui_loaded: false, + $image: null, + populateToolbar: function($toolbar) { + var $buttonHolder, $buttonset, dialog_html, widget; + widget = this; + this.texts = this.translations[this.options.lang]; + this.options.toolbar = $toolbar; + dialog_html = "
"; + if (this.options.insert_file_dialog_ui_url) { + dialog_html += "
"; + } + this.options.dialog = jQuery("
").attr('id', this.options.uuid + "-insert-image-dialog").html(dialog_html); + $buttonset = jQuery("").addClass(this.widgetName); + $buttonHolder = jQuery(''); + $buttonHolder.hallobutton({ + label: this.texts.title_insert, + icon: 'fa-picture-o', + editable: this.options.editable, + command: null, + queryState: false, + uuid: this.options.uuid, + cssClass: this.options.buttonCssClass + }); + $buttonset.append($buttonHolder); + this.button = $buttonHolder; + this.button.click(function() { + if (widget.options.dialog.dialog("isOpen")) { + widget._closeDialog(); + } else { + widget.lastSelection = widget.options.editable.getSelection(); + widget._openDialog(); + } + return false; + }); + this.options.editable.element.on("halloselected, hallounselected", function() { + if (widget.options.dialog.dialog("isOpen")) { + return widget.lastSelection = widget.options.editable.getSelection(); + } + }); + this.options.editable.element.on("hallodeactivated", function() { + return widget._closeDialog(); + }); + jQuery(this.options.editable.element).on("click", "img", function(e) { + widget._openDialog(jQuery(this)); + return false; + }); + this.options.editable.element.on('halloselected', function(event, data) { + var toolbar_option; + toolbar_option = widget.options.editable.options.toolbar; + if (toolbar_option === "halloToolbarContextual" && jQuery(data.originalEvent.target).is('img')) { + $toolbar.hide(); + return false; + } + }); + $toolbar.append($buttonset); + return this.options.dialog.dialog(this.options.dialogOpts); + }, + _openDialog: function($image) { + var $editableEl, widget, xposition, yposition; + this.$image = $image; + widget = this; + $editableEl = jQuery(this.options.editable.element); + xposition = $editableEl.offset().left + $editableEl.outerWidth() + 10; + if (this.$image) { + yposition = this.$image.offset().top - jQuery(document).scrollTop(); + } else { + yposition = this.options.toolbar.offset().top - jQuery(document).scrollTop(); + } + this.options.dialog.dialog("option", "position", [xposition, yposition]); + this.options.editable.keepActivated(true); + this.options.dialog.dialog("open"); + if (this.$image) { + this.options.dialog.dialog("option", "title", this.texts.title_properties); + this.options.editable.element.on("click", function() { + widget.$image = null; + return widget._closeDialog(); + }); + } else { + this.options.dialog.children('#hallo_img_properties').hide(); + this.options.dialog.dialog("option", "title", this.texts.title_insert); + if (jQuery('#hallo_img_file_select_title').length > 0) { + jQuery('#hallo_img_file_select_title').text(''); + } + } + this._load_dialog_image_properties_ui(); + this.options.dialog.on('dialogclose', (function(_this) { + return function() { + var scrollbar_pos; + jQuery('label', _this.button).removeClass('ui-state-active'); + scrollbar_pos = jQuery(document).scrollTop(); + _this.options.editable.element.focus(); + jQuery(document).scrollTop(scrollbar_pos); + return _this.options.editable.keepActivated(false); + }; + })(this)); + if (this.options.insert_file_dialog_ui_url && !this.dialog_image_selection_ui_loaded) { + this.options.dialog.on('click', ".reload_link", function() { + widget._load_dialog_image_selection_ui(); + return false; + }); + this.options.dialog.on('click', '.file_preview img', function() { + var new_source; + if (widget.$image) { + new_source = jQuery(this).attr('src').replace(/-thumb/, ''); + widget.$image.attr('src', new_source); + jQuery('#hallo_img_source').val(new_source); + } else { + widget._insert_image(jQuery(this).attr('src').replace(/-thumb/, '')); + } + return false; + }); + return this._load_dialog_image_selection_ui(); + } + }, + _insert_image: function(source) { + this.options.editable.restoreSelection(this.lastSelection); + document.execCommand("insertImage", null, source); + this.options.editable.element.trigger('change'); + this.options.editable.removeAllSelections(); + return this._closeDialog(); + }, + _closeDialog: function() { + return this.options.dialog.dialog("close"); + }, + _load_dialog_image_selection_ui: function() { + var widget; + widget = this; + return jQuery.ajax({ + url: this.options.insert_file_dialog_ui_url, + success: function(data, textStatus, jqXHR) { + var $properties, file_select_title, t; + file_select_title = ''; + $properties = widget.options.dialog.children('#hallo_img_properties'); + if ($properties.is(':visible')) { + file_select_title = widget.texts.change_image; + } + t = "
" + file_select_title + "
"; + widget.options.dialog.children('#hallo_img_file_select_ui').html(t + data); + return widget.dialog_image_selection_ui_loaded = true; + }, + beforeSend: function() { + return widget.options.dialog.children('#hallo_img_file_select_ui').html('
'); + } + }); + }, + _load_dialog_image_properties_ui: function() { + var $img_properties, button, height, html, widget, width; + widget = this; + $img_properties = this.options.dialog.children('#hallo_img_properties'); + if (this.$image) { + width = this.$image.is('[width]') ? this.$image.attr('width') : ''; + height = this.$image.is('[height]') ? this.$image.attr('height') : ''; + html = this._property_input_html('source', this.$image.attr('src'), { + label: this.texts.source + }) + this._property_input_html('alt', this.$image.attr('alt') || '', { + label: this.texts.alt + }) + this._property_row_html(this._property_input_html('width', width, { + label: this.texts.width, + row: false + }) + this._property_input_html('height', height, { + label: this.texts.height, + row: false + })) + this._property_input_html('padding', this.$image.css('padding'), { + label: this.texts.padding + }) + this._property_row_html(this._property_cb_html('float_left', this.$image.css('float') === 'left', { + label: this.texts.float_left, + row: false + }) + this._property_cb_html('float_right', this.$image.css('float') === 'right', { + label: this.texts.float_right, + row: false + }) + this._property_cb_html('unfloat', this.$image.css('float') === 'none', { + label: this.texts.float_none, + row: false + }), this.texts.txt_float); + $img_properties.html(html); + $img_properties.show(); + } else { + if (!this.options.insert_file_dialog_ui_url) { + $img_properties.html(this._property_input_html('source', '', { + label: this.texts.source + })); + $img_properties.show(); + } + } + if (this.$image) { + if (!this.options.insert_file_dialog_ui_url) { + jQuery('#insert_image_btn').remove(); + } + if (jQuery('#hallo_img_file_select_title').length > 0) { + jQuery('#hallo_img_file_select_title').text(this.texts.chage_image); + } + jQuery('#hallo_img_properties #hallo_img_source').keyup(function() { + widget.$image.attr('src', this.value); + return widget.options.editable.element.trigger('change'); + }); + jQuery('#hallo_img_properties #hallo_img_alt').keyup(function() { + widget.$image.attr('alt', this.value); + return widget.options.editable.element.trigger('change'); + }); + jQuery('#hallo_img_properties #hallo_img_padding').keyup(function() { + widget.$image.css('padding', this.value); + return widget.options.editable.element.trigger('change'); + }); + jQuery('#hallo_img_properties #hallo_img_height').keyup(function() { + widget.$image.css('height', this.value); + widget.$image.attr('height', this.value); + return widget.options.editable.element.trigger('change'); + }); + jQuery('#hallo_img_properties #hallo_img_width').keyup(function() { + widget.$image.css('width', this.value); + widget.$image.attr('width', this.value); + return widget.options.editable.element.trigger('change'); + }); + jQuery('#hallo_img_properties #hallo_img_float_left').click(function() { + if (!this.checked) { + return false; + } + widget.$image.css('float', 'left'); + jQuery('#hallo_img_properties #hallo_img_float_right').removeAttr('checked'); + return jQuery('#hallo_img_properties #hallo_img_unfloat').removeAttr('checked'); + }); + jQuery('#hallo_img_properties #hallo_img_float_right').click(function() { + if (!this.checked) { + return false; + } + widget.$image.css('float', 'right'); + jQuery('#hallo_img_properties #hallo_img_unfloat').removeAttr('checked'); + return jQuery('#hallo_img_properties #hallo_img_float_left').removeAttr('checked'); + }); + return jQuery('#hallo_img_properties #hallo_img_unfloat').click(function() { + if (!this.checked) { + return false; + } + widget.$image.css('float', 'none'); + jQuery('#hallo_img_properties #hallo_img_float_right').removeAttr('checked'); + return jQuery('#hallo_img_properties #hallo_img_float_left').removeAttr('checked'); + }); + } else { + if (!this.options.insert_file_dialog_ui_url) { + button = ""; + $img_properties.after(button); + return jQuery('#insert_image_btn').click(function() { + var $img_source; + $img_source = jQuery('#hallo_img_properties #hallo_img_source'); + return widget._insert_image($img_source.val()); + }); + } + } + }, + _property_col_html: function(col_html) { + return "
" + col_html + "
"; + }, + _property_row_html: function(row_html, label) { + if (label == null) { + label = ''; + } + row_html = this._property_col_html(label) + this._property_col_html(row_html); + return "
" + row_html + "
"; + }, + _property_html: function(property_html, options) { + var entry; + if (options == null) { + options = {}; + } + if (options.row === false) { + if (options.label) { + entry = options.label + " " + property_html; + property_html = "" + entry + ""; + } + return property_html; + } else { + entry = "" + property_html + ""; + return this._property_row_html(entry, options.label); + } + }, + _property_input_html: function(id, value, options) { + var text_field; + if (options == null) { + options = {}; + } + text_field = ""; + return this._property_html(text_field, options); + }, + _property_cb_html: function(id, checked, options) { + var cb, checked_attr; + if (options == null) { + options = {}; + } + checked_attr = checked ? 'checked=checked' : ''; + cb = ""; + return this._property_html(cb, options); + } + }); + })(jQuery); + }).call(this); diff --git a/web/Scripts/knockout-jqAutocomplete.js b/web/Scripts/knockout-jqAutocomplete.js new file mode 100644 index 00000000..c7e56054 --- /dev/null +++ b/web/Scripts/knockout-jqAutocomplete.js @@ -0,0 +1,189 @@ +// knockout-jqAutocomplete 0.4.3 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +;(function(factory) { + if (typeof define === "function" && define.amd) { + // AMD anonymous module + define(["knockout", "jquery", "jquery-ui/autocomplete"], factory); + } else { + // No module loader - put directly in global namespace + factory(window.ko, jQuery); + } +})(function(ko, $) { + var JqAuto = function() { + var self = this, + unwrap = ko.utils.unwrapObservable; //support older KO versions that did not have ko.unwrap + + //binding's init function + this.init = function(element, valueAccessor, allBindings, data, context) { + var existingSelect, existingChange, + options = unwrap(valueAccessor()), + config = {}, + filter = typeof options.filter === "function" ? options.filter : self.defaultFilter; + + //extend with global options + ko.utils.extend(config, self.options); + //override with options passed in binding + ko.utils.extend(config, options.options); + + //get source from a function (can be remote call) + if (typeof options.source === "function" && !ko.isObservable(options.source)) { + config.source = function(request, response) { + //provide a wrapper to the normal response callback + var callback = function(data) { + self.processOptions(valueAccessor, null, data, request, response); + }; + + //call the provided function for retrieving data + options.source.call(context.$data, request.term, callback); + }; + } + else { + //process local data + config.source = self.processOptions.bind(self, valueAccessor, filter, options.source); + } + + //save any passed in select/change calls + existingSelect = typeof config.select === "function" && config.select; + existingChange = typeof config.change === "function" && config.change; + + //handle updating the actual value + config.select = function(event, ui) { + if (ui.item && ui.item.actual) { + options.value(ui.item.actual); + + if (ko.isWriteableObservable(options.dataValue)) { + options.dataValue(ui.item.data); + } + } + + if (existingSelect) { + existingSelect.apply(this, arguments); + } + }; + + //user made a change without selecting a value from the list + config.change = function(event, ui) { + if (!ui.item || !ui.item.actual) { + options.value(event.target && event.target.value); + + if (ko.isWriteableObservable(options.dataValue)) { + options.dataValue(null); + } + } + + if (existingChange) { + existingChange.apply(this, arguments); + } + }; + + //initialize the widget + var widget = $(element).autocomplete(config).data("ui-autocomplete"); + + //render a template for the items + if (options.template) { + widget._renderItem = self.renderItem.bind(self, options.template, context); + } + + //destroy the widget if KO removes the element + ko.utils.domNodeDisposal.addDisposeCallback(element, function() { + if (widget && typeof widget.destroy === "function") { + widget.destroy(); + widget = null; + } + }); + }; + + //the binding's update function. keep value in sync with model + this.update = function(element, valueAccessor) { + var propNames, sources, + options = unwrap(valueAccessor()), + value = unwrap(options && options.value); + + if (!value && value !== 0) { + value = ""; + } + + // find the appropriate value for the input + sources = unwrap(options.source); + propNames = self.getPropertyNames(valueAccessor); + + // if there is local data, then try to determine the appropriate value for the input + if ($.isArray(sources) && propNames.value) { + value = ko.utils.arrayFirst(sources, function (opt) { + return opt[propNames.value] == value; + } + ) || value; + } + + if (propNames.input && value && typeof value === "object") { + element.value = value[propNames.input]; + } + else { + element.value = value; + } + }; + + //if dealing with local data, the default filtering function + this.defaultFilter = function(item, term) { + term = term && term.toLowerCase(); + return (item || item === 0) && ko.toJSON(item).toLowerCase().indexOf(term) > -1; + }; + + //filter/map options to be in a format that autocomplete requires + this.processOptions = function(valueAccessor, filter, data, request, response) { + var item, index, length, + items = unwrap(data) || [], + results = [], + props = this.getPropertyNames(valueAccessor); + + //filter/map items + for (index = 0, length = items.length; index < length; index++) { + item = items[index]; + + if (!filter || filter(item, request.term)) { + results.push({ + label: props.label ? item[props.label] : item.toString(), + value: props.input ? item[props.input] : item.toString(), + actual: props.value ? item[props.value] : item, + data: item + }); + } + } + + //call autocomplete callback to display list + response(results); + }; + + //if specified, use a template to render an item + this.renderItem = function(templateName, context, ul, item) { + var $li = $("
  • ").appendTo(ul), + itemContext = context.createChildContext(item.data); + + //apply the template binding + ko.applyBindingsToNode($li[0], { template: templateName }, itemContext); + + //clean up + $li.one("remove", ko.cleanNode.bind(ko, $li[0])); + + return $li; + }; + + //retrieve the property names to use for the label, input, and value + this.getPropertyNames = function(valueAccessor) { + var options = ko.toJS(valueAccessor()); + + return { + label: options.labelProp || options.valueProp, + input: options.inputProp || options.labelProp || options.valueProp, + value: options.valueProp + }; + }; + + //default global options passed into autocomplete widget + this.options = { + autoFocus: true, + delay: 50 + }; + }; + + ko.bindingHandlers.jqAuto = new JqAuto(); +}); diff --git a/web/Scripts/knockout-jqAutocomplete.min.js b/web/Scripts/knockout-jqAutocomplete.min.js new file mode 100644 index 00000000..00652e5d --- /dev/null +++ b/web/Scripts/knockout-jqAutocomplete.min.js @@ -0,0 +1,2 @@ +// knockout-jqAutocomplete 0.4.3 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +!function(a){"function"==typeof define&&define.amd?define(["knockout","jquery","jquery-ui/autocomplete"],a):a(window.ko,jQuery)}(function(a,b){var c=function(){var c=this,d=a.utils.unwrapObservable;this.init=function(e,f,g,h,i){var j,k,l=d(f()),m={},n="function"==typeof l.filter?l.filter:c.defaultFilter;a.utils.extend(m,c.options),a.utils.extend(m,l.options),m.source="function"!=typeof l.source||a.isObservable(l.source)?c.processOptions.bind(c,f,n,l.source):function(a,b){var d=function(d){c.processOptions(f,null,d,a,b)};l.source.call(i.$data,a.term,d)},j="function"==typeof m.select&&m.select,k="function"==typeof m.change&&m.change,m.select=function(b,c){c.item&&c.item.actual&&(l.value(c.item.actual),a.isWriteableObservable(l.dataValue)&&l.dataValue(c.item.data)),j&&j.apply(this,arguments)},m.change=function(b,c){c.item&&c.item.actual||(l.value(b.target&&b.target.value),a.isWriteableObservable(l.dataValue)&&l.dataValue(null)),k&&k.apply(this,arguments)};var o=b(e).autocomplete(m).data("ui-autocomplete");l.template&&(o._renderItem=c.renderItem.bind(c,l.template,i)),a.utils.domNodeDisposal.addDisposeCallback(e,function(){o&&"function"==typeof o.destroy&&(o.destroy(),o=null)})},this.update=function(e,f){var g,h,i=d(f()),j=d(i&&i.value);j||0===j||(j=""),h=d(i.source),g=c.getPropertyNames(f),b.isArray(h)&&g.value&&(j=a.utils.arrayFirst(h,function(a){return a[g.value]==j})||j),e.value=g.input&&j&&"object"==typeof j?j[g.input]:j},this.defaultFilter=function(b,c){return c=c&&c.toLowerCase(),(b||0===b)&&a.toJSON(b).toLowerCase().indexOf(c)>-1},this.processOptions=function(a,b,c,e,f){var g,h,i,j=d(c)||[],k=[],l=this.getPropertyNames(a);for(h=0,i=j.length;i>h;h++)g=j[h],(!b||b(g,e.term))&&k.push({label:l.label?g[l.label]:g.toString(),value:l.input?g[l.input]:g.toString(),actual:l.value?g[l.value]:g,data:g});f(k)},this.renderItem=function(c,d,e,f){var g=b("
  • ").appendTo(e),h=d.createChildContext(f.data);return a.applyBindingsToNode(g[0],{template:c},h),g.one("remove",a.cleanNode.bind(a,g[0])),g},this.getPropertyNames=function(b){var c=a.toJS(b());return{label:c.labelProp||c.valueProp,input:c.inputProp||c.labelProp||c.valueProp,value:c.valueProp}},this.options={autoFocus:!0,delay:50}};a.bindingHandlers.jqAuto=new c}); \ No newline at end of file diff --git a/web/Scripts/parralax.js b/web/Scripts/parralax.js new file mode 100644 index 00000000..a8bc5966 --- /dev/null +++ b/web/Scripts/parralax.js @@ -0,0 +1,74 @@ +// +// parralax.js +// +// Author: +// Paul Schneider +// +// 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 . + +$(document).ready(function(){ + var $window = $(window); + + $('[data-type="background"]').each(function(){ + var $bgobj = $(this); // assigning the object + // get the initial background position, assumes a "X% Yem" ? + var orgpos = $bgobj.css('backgroundPosition'); + var bgpos = orgpos.split(" "); + + var bgposx = bgpos[0]; + var bgposy = bgpos[1]; + if (/%$/.test(bgposx)){ + bgposx = bgposx.substr(0,bgposx.length-1); + $bgobj.attr('orgbgpxu','% '); + } + else if (/em$/.test(bgposx)){ + bgposx = bgposx.substr(0,bgposx.length-2); + $bgobj.attr('orgbgpxu','em '); + } + else if (/px$/.test(bgposx)){ + bgposx = bgposx.substr(0,bgposx.length-2); + $bgobj.attr('orgbgpxu','px '); + } + else { $bgobj.attr('orgbgpxu','px '); } + + if (/%$/.test(bgposy)){ + bgposy = bgposy.substr(0,bgposy.length-1); + $bgobj.attr('orgbgpyu','% '); + } + else if (/em$/.test(bgposy)){ + bgposy = bgposy.substr(0,bgposy.length-2); + $bgobj.attr('orgbgpyu','em '); + } + else if (/px$/.test(bgposy)){ + bgposy = bgposy.substr(0,bgposy.length-2); + $bgobj.attr('orgbgpyu','px '); + } + else { $bgobj.attr('orgbgpyu','px '); } + $bgobj.attr('orgbgpx',parseInt(bgposx)); + $bgobj.attr('orgbgpy',parseInt(bgposy)); + + $(window).scroll(function() { + var speed = $bgobj.data('speed'); + var xPos = $bgobj.attr('orgbgpx') - Math.round($window.scrollLeft() / speed); + var yPos = $bgobj.attr('orgbgpy') - Math.round($window.scrollTop() / speed); + // Put together our final background position + var coords = '' + xPos + $bgobj.attr('orgbgpxu') + yPos + $bgobj.attr('orgbgpyu'); + // Move the background + $bgobj.css({ backgroundPosition: coords }); + // console.log($bgobj.get()[0].localName+' backgroundPosition: '+coords); + }); + }); +}); diff --git a/web/Scripts/to-markdown.js b/web/Scripts/to-markdown.js index eec23641..4cab24eb 100644 --- a/web/Scripts/to-markdown.js +++ b/web/Scripts/to-markdown.js @@ -507,9 +507,9 @@ module.exports = [ { filter: 'img', replacement: function(content, node) { - var alt = node.alt || ''; + var alt = node.getAttribute("alt") || ''; var src = node.getAttribute('src') || ''; - var title = node.title || ''; + var title = node.getAttribute('title') || ''; var titlePart = title ? ' "'+ title +'"' : ''; return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : ''; } diff --git a/web/Scripts/yavsc.circles.js b/web/Scripts/yavsc.circles.js index 5de80b85..bd4e7304 100644 --- a/web/Scripts/yavsc.circles.js +++ b/web/Scripts/yavsc.circles.js @@ -31,7 +31,7 @@ function onCircleChanged() { $('#fncirc').addClass("dirty"); } function removeCircle() { - Yavsc.message(false); + Yavsc.notice(false); var id = $(this).attr('cid'); $.ajax({ url: CirclesApiUrl+"/Delete/"+id, @@ -44,12 +44,13 @@ function removeCircle() { 400: onAjaxBadInput, error: function (xhr, ajaxOptions, thrownError) { if (xhr.status!=400) - Yavsc.message(xhr.status+" : "+xhr.responseText); - else Yavsc.message(false); + Yavsc.notice(xhr.status+" : "+xhr.responseText); + else Yavsc.notice(false); }}}); } + function modifyCircle() { - Yavsc.message(false); + Yavsc.notice(false); var id = $('#id').val(); var circle = { title: $("#title").val(), id: id} ; $.ajax({ @@ -69,7 +70,7 @@ function removeCircle() { function addCircle() { - Yavsc.message(false); + Yavsc.notice(false); var circle = { title: $("#title").val() } ; $("#title").text(''); $.ajax({ diff --git a/web/Scripts/yavsc.js b/web/Scripts/yavsc.js index 49d73fb6..388c4e25 100644 --- a/web/Scripts/yavsc.js +++ b/web/Scripts/yavsc.js @@ -1,6 +1,13 @@ var Yavsc = (function(apiBaseUrl){ var self = {}; +function dumpprops(obj) { +var str = ""; +for(var k in obj) + if (obj.hasOwnProperty(k)) + str += k + " = " + obj[k] + "\n"; + return (str); } + self.apiBaseUrl = (apiBaseUrl || '/api'); self.showHide = function () { @@ -33,8 +40,11 @@ self.notice = function (msg, msgok) { self.onAjaxBadInput = function (data) { + if (!data) { Yavsc.notice('no data'); return; } + if (!data.responseJSON) { Yavsc.notice('no json data:'+data); return; } + if (!Array.isArray(data.responseJSON)) { Yavsc.notice('Bad Input: '+data.responseJSON); return; } $.each(data.responseJSON, function (key, value) { - var errspanid = "Err_cr_" + value.key.replace("model.",""); + var errspanid = "Err_" + value.key; var errspan = document.getElementById(errspanid); if (errspan==null) alert('enoent '+errspanid); @@ -47,9 +57,34 @@ self.notice = function (msg, msgok) { self.onAjaxError = function (xhr, ajaxOptions, thrownError) { if (xhr.status!=400) Yavsc.notice(xhr.status+" : "+xhr.responseText); - else Yavsc.notice(false); }; return self; })(); +<<<<<<< HEAD +======= +$(document).ready(function(){ + +$body = $("body"); +$(document).on({ + ajaxStart: function() { $body.addClass("loading"); }, + ajaxStop: function() { $body.removeClass("loading"); } +}); + + var $window = $(window); + $(window).scroll(function() { + var $ns = $('#notifications'); + if ($ns.has('*').length>0) { + if ($window.scrollTop()>375) { + $ns.css('position','fixed'); + $ns.css('z-index',2); + $ns.css('top',0); + } + else { + $ns.css('position','static'); + $ns.css('z-index',1); + }} + }); +}); +>>>>>>> 5cb90afe2ce804d06034b0e0aa52e73c33baff83 diff --git a/web/Scripts/yavsc.tags.js b/web/Scripts/yavsc.tags.js new file mode 100644 index 00000000..110856d6 --- /dev/null +++ b/web/Scripts/yavsc.tags.js @@ -0,0 +1,32 @@ +var Tags = (function(apiBaseUrl){ +var self = {}; +self.blogsApiUrl = (apiBaseUrl || '/api') + "/Blogs"; + +self.tag = function (postid,tagname,callback) { + $.ajax({ + url: CirclesApiUrl+"/Tag", + type: "POST", + data: { postid: postid, tag: tagname }, + success: function () { + if (callback) callback(postid,tagname); + }, + statusCode: { + 400: Yavsc.onAjaxBadInput + }, + error: Yavsc.onAjaxError}); + } +self.untag = function (postid,tagname,callback) { + $.ajax({ + url: CirclesApiUrl+"/Untag", + type: "POST", + data: { postid: postid, tag: tagname }, + success: function () { + if (callback) callback(postid,tagname); + }, + statusCode: { + 400: Yavsc.onAjaxBadInput + }, + error: Yavsc.onAjaxError}); + } +return self; +})(); diff --git a/web/Views/Account/Login.aspx b/web/Views/Account/Login.aspx index ba09a7da..d94c1672 100644 --- a/web/Views/Account/Login.aspx +++ b/web/Views/Account/Login.aspx @@ -20,7 +20,7 @@ <% } %>
    -<%= Html.ActionLink("S'enregistrer","RegisterForm",new {returnUrl=ViewData["returnUrl"]}, new { @class="actionlink" }) %> +<%= Html.ActionLink("S'enregistrer","GetRegister",new {returnUrl=ViewData["returnUrl"]}, new { @class="actionlink" }) %>
    ?returnUrl=<%=ViewData["returnUrl"]==null?Request.Url.PathAndQuery:(string)ViewData["returnUrl"]%>" class="actionlink"> diff --git a/web/Views/Account/Profile.aspx b/web/Views/Account/Profile.aspx index 9c016311..e783b526 100644 --- a/web/Views/Account/Profile.aspx +++ b/web/Views/Account/Profile.aspx @@ -1,7 +1,7 @@ -<%@ Page Title="Profile" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> +<%@ Page Title="Profile_edition" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> -<% Title = ViewData["UserName"]+" at "+ YavscHelpers.SiteName +" - profile edition" ; %> +<% Title = ViewData["UserName"] + " : " +Html.Translate("Profile_edition"); %> @@ -28,84 +28,89 @@ table.layout TR TD { max-width:40%; } <%= Html.ValidationMessage("WebSite", "*") %>
    -Avatar : +Avatar : avatar + <%= Html.ValidationMessage("AvatarFile", "*") %>
    Blog - +
    <%= Html.LabelFor(model => model.BlogVisible) %> : <%= Html.CheckBox("BlogVisible") %> <%= Html.ValidationMessage("BlogVisible", "*") %> -
    +
    <%= Html.LabelFor(model => model.BlogTitle) %> : <%= Html.TextBox("BlogTitle") %> <%= Html.ValidationMessage("BlogTitle", "*") %> - +
    Contact - +
    <%= Html.LabelFor(model => model.Phone) %> <%= Html.TextBox("Phone") %> <%= Html.ValidationMessage("Phone", "*") %> - +
    <%= Html.LabelFor(model => model.Mobile) %> <%= Html.TextBox("Mobile") %> <%= Html.ValidationMessage("Mobile", "*") %> - +
    <%= Html.LabelFor(model => model.Address) %> <%= Html.TextBox("Address") %> <%= Html.ValidationMessage("Address", "*") %> - +
    <%= Html.LabelFor(model => model.CityAndState) %> <%= Html.TextBox("CityAndState") %> <%= Html.ValidationMessage("CityAndState", "*") %> - +
    <%= Html.LabelFor(model => model.ZipCode) %> <%= Html.TextBox("ZipCode") %> <%= Html.ValidationMessage("ZipCode", "*") %> - +
    <%= Html.LabelFor(model => model.Country) %> <%= Html.TextBox("Country") %> <%= Html.ValidationMessage("Country", "*") %> +
    Disponibilité +
    <%= Html.LabelFor(model => model.GoogleCalendar) %> : <%= Html.Encode(Model.GoogleCalendar) %> <%= Html.ActionLink("Choisir l'agenda","ChooseCalendar","Google",new { returnUrl= Request.Url.AbsolutePath }, new { @class="actionlink" }) %> -
    +
    Informations de facturation - + +
    <%= Html.LabelFor(model => model.BankCode) %> : <%= Html.TextBox("BankCode") %> <%= Html.ValidationMessage("BankCode", "*") %> -
    +
    <%= Html.LabelFor(model => model.WicketCode) %> : <%= Html.TextBox("WicketCode") %> <%= Html.ValidationMessage("WicketCode", "*") %> -
    +
    <%= Html.LabelFor(model => model.AccountNumber) %> : <%= Html.TextBox("AccountNumber") %> <%= Html.ValidationMessage("AccountNumber", "*") %> -
    +
    <%= Html.LabelFor(model => model.BankedKey) %> : <%= Html.TextBox("BankedKey") %> <%= Html.ValidationMessage("BankedKey", "*") %> -
    +
    <%= Html.LabelFor(model => model.BIC) %> : <%= Html.TextBox("BIC") %> <%= Html.ValidationMessage("BIC", "*") %> -
    +
    <%= Html.LabelFor(model => model.IBAN) %> : <%= Html.TextBox("IBAN") %> <%= Html.ValidationMessage("IBAN", "*") %> +
    @@ -118,13 +123,13 @@ Avatar : This user is Admin. <% } %> - HasBankAccount:<%= Model.HasBankAccount %> - <% if (!Model.HasBankAccount) { %> - (IBAN+BIC ou Codes banque, guichet, compte et clé RIB) - <% } %>, IsBillable:<%=Model.IsBillable%> + HasBankAccount:<%= Model.HasBankAccount %> + <% if (!Model.HasBankAccount) { %> + IBAN+BIC ou Codes banque, guichet, compte et clé RIB + <% } %>, IsBillable:<%=Model.IsBillable%> <% if (!Model.IsBillable) { %> - (un nom et au choix, une adresse postale valide, - ou un téléphone, ou un email, ou un Mobile) <% } %> + un nom et au choix, une adresse postale valide, + ou un téléphone, ou un email, ou un Mobile <% } %> diff --git a/web/Views/Blogs/Edit.aspx b/web/Views/Blogs/Edit.aspx index 83c813f1..653043f8 100644 --- a/web/Views/Blogs/Edit.aspx +++ b/web/Views/Blogs/Edit.aspx @@ -11,45 +11,36 @@ -
    -<% using(Html.BeginForm("ValidateEdit","Blogs")) { %> -
    -Billet -<%= Html.LabelFor(model => model.Title) %> <%= Html.ValidationMessage("Title") %> :
    - -
    -<%= Html.LabelFor(model => model.Content) %> -<%= Html.ValidationMessage("Content") %>:
    - -
    - -<%= Html.CheckBox( "Visible" ) %> -<%= Html.LabelFor(model => model.Visible) %> - -<%= Html.ValidationMessage("Visible", "*") %> -
    - -<%= Html.LabelFor(model => model.AllowedCircles) %> -<%= Html.ListBox("AllowedCircles") %> - -<%= Html.ValidationMessage("AllowedCircles", "*") %> - -<%=Html.Hidden("Author")%> -<%=Html.Hidden("Id")%> - -
    -<% } %> -
    -
    -

    <%=Html.Markdown(Model.Title)%>

    -
    + +photo + + +

    <%=Html.Markdown(Model.Title)%>

    +
    <%=Html.Markdown(Model.Content,"/bfiles/"+Model.Id+"/")%>
    -
    +

    Fichiers attachées

    +<%= Html.FileList("~/bfiles/"+Model.Id) %> +
    @@ -152,8 +148,8 @@ var updateHtml = function(id,content) { function submitFilesTo(method) { - var data = new FormData($('#uploads').get()[0]); - Yavsc.message('Submitting via '+method); + var data = new FormData($('#frmajax').get()[0]); + Yavsc.notice('Submitting via '+method); $.ajax({ url: apiBaseUrl+'/Blogs/'+method+'/'+$('#Id').val(), type: "POST", @@ -162,7 +158,7 @@ function submitFilesTo(method) contentType: false, success: function(data) { $('#Content').val(data+"\n"+$('#Content').val()); - Yavsc.message(false); + Yavsc.notice(false); }, error: Yavsc.onAjaxError, }); @@ -173,20 +169,70 @@ function submitImport() function submitFile() { submitFilesTo('PostFile'); } + +function submitBaseDoc() +{ +var data = new FormData($('#frmajax').get()[0]); + Yavsc.notice('Submitting via '+method); + $.ajax({ + url: apiBaseUrl+'/Blogs/'+method+'/'+$('#Id').val(), + type: "POST", + data: data, + processData: false, + contentType: false, + success: function(data) { + $('#Content').val(data+"\n"+$('#Content').val()); + Yavsc.notice('Posted updated'); + }, + error: Yavsc.onAjaxError, + }); +} + -
    +
    -Fichiers attachés +Attacher des fichiers
    +<% using(Html.BeginForm("ValidateEdit","Blogs")) { %> +
    +Contrôle d'accès au Billet +<%= Html.LabelFor(model => model.Visible) %> : <%= Html.CheckBox( "Visible" ) %> +Note: Si un ou plusieurs cercles sont séléctionnés ici, + le billet ne sera visible qu'aux membres de ces cercles. +<%= Html.ValidationMessage("Visible", "*") %> +<%= Html.LabelFor(model => model.AllowedCircles) %> +<%= Html.ListBox("AllowedCircles") %> +<%= Html.ValidationMessage("AllowedCircles", "*") %> +
    + +<%=Html.Translate("View_source")%> + + + +<% } %> + \ No newline at end of file diff --git a/web/Views/Blogs/Error.aspx b/web/Views/Blogs/Error.aspx deleted file mode 100644 index 739b5216..00000000 --- a/web/Views/Blogs/Error.aspx +++ /dev/null @@ -1,9 +0,0 @@ -<%@ Page Title="Comptes utilisateur - Erreur" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> - - -
    -<%= Html.Encode(ViewData["Message"]) %>
    -Your UID : -<%= Html.Encode(ViewData ["UID"]) %>
    -
    ">Retour - diff --git a/web/Views/Blogs/Index.aspx b/web/Views/Blogs/Index.aspx index 3877671c..d452d7cc 100644 --- a/web/Views/Blogs/Index.aspx +++ b/web/Views/Blogs/Index.aspx @@ -1,38 +1,16 @@ -<%@ Page Title="Blogs - Index" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" EnableTheming="True" StylesheetTheme="dark" %> +<%@ Page Title="Articles" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" EnableTheming="True" StylesheetTheme="dark" %> <%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %>
    -<% foreach (var g in Model.GroupByUser()) { %> -

    " class="actionlink userref"> -<%=g.Key%>

    +<% foreach (var g in Model.GroupByTitle()) { %> +

    " class="usertitleref"><%=Html.Encode(g.Key)%>

    <% foreach (var p in g) { %>
    -<%= Html.ActionLink(p.Title, "UserPost", - new { user = g.Key, title = p.Title }, new { @class = "usertitleref" } ) %>

    <%= Html.Markdown(p.Intro,"/bfiles/"+p.Id+"/") %>

    - + <%= Html.Partial("PostActions",p)%>
    <% } %> <% } %>
    -
    -<% rp1.ResultCount = (int) ViewData["ResultCount"]; - rp1.PageSize = (int) ViewData ["PageSize"]; - rp1.PageIndex = (int) ViewData["PageIndex"]; - rp1.None = Html.Translate("no content"); -%> - - Aucun résultat - -
    + <%= Html.RenderPageLinks((int)ViewData["PageIndex"],(int)ViewData["PageSize"],(int)ViewData["ResultCount"])%>
    - diff --git a/web/Views/Blogs/PostActions.ascx b/web/Views/Blogs/PostActions.ascx new file mode 100644 index 00000000..7e976e30 --- /dev/null +++ b/web/Views/Blogs/PostActions.ascx @@ -0,0 +1,15 @@ +<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> + diff --git a/web/Views/Blogs/TagControl.ascx b/web/Views/Blogs/TagControl.ascx new file mode 100644 index 00000000..06de2fdc --- /dev/null +++ b/web/Views/Blogs/TagControl.ascx @@ -0,0 +1,97 @@ +<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> + +
      +<% if (Model.Tags != null) foreach (string tagname in Model.Tags) { %> +
    • <%= tagname %>
    • +<% } %> +
    +<% if (Membership.GetUser()!=null) { %> +<% if (Membership.GetUser().UserName==Model.Author || Roles.IsUserInRole("Admin")) +{ // grant all permissions: to choose a given set of tags, also create some new tags %> + + +<%=Html.Translate("DoTag")%> + + + +<% } %> +<% } %> diff --git a/web/Views/Blogs/TagPanel.ascx b/web/Views/Blogs/TagPanel.ascx new file mode 100644 index 00000000..33782b69 --- /dev/null +++ b/web/Views/Blogs/TagPanel.ascx @@ -0,0 +1,10 @@ +<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> +
    +<%=Model.Name%> +
      +<% foreach (BasePostInfo be in Model.Titles) { %> +
    • <%= be.Title %> +<%= be.Intro %> +
    • +<% } %>
    +
    \ No newline at end of file diff --git a/web/Views/Blogs/Title.aspx b/web/Views/Blogs/Title.aspx new file mode 100644 index 00000000..4fb1912f --- /dev/null +++ b/web/Views/Blogs/Title.aspx @@ -0,0 +1,34 @@ +<%@ Page Title="Titre" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> +<%@ Register Assembly="Yavsc.WebControls" TagPrefix="yavsc" Namespace="Yavsc.WebControls" %> + +<% Title = Model.Title + " - " + YavscHelpers.SiteName; %> + + + +

    +<%=Html.ActionLink(Model.Title, "Title", new{title=Model.Title}, null)%> +- "><%= YavscHelpers.SiteName %> +

    +
    + + +<% foreach (BlogEntry e in this.Model) { %> +
    +<% if (e.Photo!=null) { %><% } %> +<%= Html.Markdown(e.Content,"/bfiles/"+e.Id+"/") %> +<%= Html.Partial("PostActions",e)%> +
    +<% } %> +<% +if (((int) ViewData["RecordCount"]) > ((int) ViewData["PageSize"])) { + rp1.ResultCount = (int) ViewData["RecordCount"]; + rp1.PageIndex = (int) ViewData["PageIndex"]; + rp1.PageSize = (int) ViewData["PageSize"]; +%> +<% } %> +
    diff --git a/web/Views/Blogs/UserPost.aspx b/web/Views/Blogs/UserPost.aspx index f4b6961b..e0e75770 100644 --- a/web/Views/Blogs/UserPost.aspx +++ b/web/Views/Blogs/UserPost.aspx @@ -3,41 +3,49 @@ <% Title = Model.Title+ " - " + ViewData ["BlogTitle"] ; %> -

    <% if (ViewData["Avatar"]!=null) { %> -" alt="" id="logo"/> -<% } %> -<%= Html.ActionLink(Model.Title,"UserPost", new{user=Model.Author, title = Model.Title}, null) %> - - <%= Html.ActionLink((string)ViewData ["BlogTitle"] ,"UserPosts",new{user=Model.Author}, null) %> - - - -"><%= YavscHelpers.SiteName %> - + +<% if (!string.IsNullOrEmpty((string)ViewData["Avatar"])) { %> +" id="avatar"> +" /> + +<% } %> +

    +"> +<%=Model.Title%> + + - <%= Html.ActionLink((string)ViewData ["BlogTitle"] ,"UserPosts",new{user=Model.Author}, null) %> + - +"><%= YavscHelpers.SiteName %>

    <% foreach (var be in Model) { %>
    +<% if (be.Photo != null) { %> + <%=be.Title%> +<% } %> + <%= Html.Markdown(be.Content,"/bfiles/"+be.Id+"/") %> <% string username = Membership.GetUser()==null ? null : Membership.GetUser().UserName; %> <% foreach (var c in (Comment[]) BlogManager.GetComments(be.Id)) { %> -
    " alt="<%=c.From%>"/> +
    +" alt="<%=c.From%>"/> <%= Html.Markdown(c.CommentText) %> <% if (Model.Author == username || c.From == username ) { %> <%= Html.ActionLink("Supprimer","RemoveComment", new { cmtid = c.Id } , new { @class="actionlink" })%> <% } %>
    <% } %> - - <% if (Membership.GetUser()!=null) { if (Membership.GetUser().UserName==be.Author) - { %>
    + { %>
    <%= Html.ActionLink("Editer","Edit", new { id = be.Id }, new { @class="actionlink" }) %> <%= Html.ActionLink("Supprimer","RemovePost", new { id = be.Id }, new { @class="actionlink" } ) %> + Tagger
    <% } %> -