diff --git a/.gitignore b/.gitignore index 1bc915c..d7e0959 100644 --- a/.gitignore +++ b/.gitignore @@ -154,3 +154,6 @@ $RECYCLE.BIN/ # Mac desktop service store files .DS_Store +/.vs +/src/RemoteLab/.vs +/src/RemoteLab/RemoteLab/Properties/PublishProfiles/Project Release Folder.pubxml diff --git a/readme.md b/readme.md index 20694f3..cd2f032 100644 --- a/readme.md +++ b/readme.md @@ -2,16 +2,15 @@ ## Welcome -+ If you're here to download the latest binary version of RemoteLab to set it up within your organization, visit this project's GitHub Page [http://mafudge.github.io/remotelab/](http://mafudge.github.io/remotelab/). + If you'd like to contribute to the source code, then read on... ## Prerequisites In order to contribute to the source code of Remote Lab, you'll need -+ Visual Studio 2013 -+ .Net Framework 4.5 ++ Visual Studio 2017 ++ .Net Framework 4.7.2 + SQL Server LocalDb -A Standard installation of VS 2013 should include these components. +A Standard installation of VS 2017 should include these components. diff --git a/src/RemoteLab/RemoteLab.DirectoryServices/App.config b/src/RemoteLab/RemoteLab.DirectoryServices/App.config new file mode 100644 index 0000000..3b94bb5 --- /dev/null +++ b/src/RemoteLab/RemoteLab.DirectoryServices/App.config @@ -0,0 +1,20 @@ + + + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab.DirectoryServices/RemoteLab.DirectoryServices.csproj b/src/RemoteLab/RemoteLab.DirectoryServices/RemoteLab.DirectoryServices.csproj index 8a32013..4399c4c 100644 --- a/src/RemoteLab/RemoteLab.DirectoryServices/RemoteLab.DirectoryServices.csproj +++ b/src/RemoteLab/RemoteLab.DirectoryServices/RemoteLab.DirectoryServices.csproj @@ -1,5 +1,6 @@  + Debug @@ -11,6 +12,8 @@ RemoteLab.DirectoryServices v4.5 512 + + true @@ -39,7 +42,14 @@ MinimumRecommendedRules.ruleset + + ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll + + @@ -54,7 +64,19 @@ + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEANVazW7jNhC+F+g7CDq1RdayEwS7DexdpE6yMDZOgji77S1gJNohSpGqSLl2iz5ZD32kvkKH+hf1Y8lRku0tFslvhsOZ4Qy//Pv3P+MPG5caa+wLwtnEHA2GpoGZzR3CVhMzkMs378wP77/9ZnzuuBvjSzLvSM2DlUxMzEcpvRPLEvYjdpEYuMT2ueBLObC5ayGHW4fD4Y/WaGRhgDAByzDGtwGTxMXhD/g55czGngwQnXMHUxF/h5FFiGpcIRcLD9l4Yt5il0t8iR4G0VzTOKUEgR4LTJemgRjjEknQ8uSzwAvpc7ZaePAB0buth2HeElGBY+1PsultNzI8VBuxsoUJlB0Iyd2OgKOj2DKWvnwv+5qp5cB252BjuVW7Du03Mafc9QKJfdPQhZ1Mqa8mls07SBYdGOnQQeoIh4Ph4O3Ru7eDo9HweHhgTAMqAx9PGA6kj+iBcRM8UGJ/wts7/itmExZQmtcRtISxwgf4dONzD/tye4uXmubql2lYRQRLh0gBKldH+wTPABc3jTnaXGK2ko8T8xh8+oJssJN8iD3lMyMQELBG+gH8vII9oAeK03GrUTh4YU+Cm+XcYhC0xk4i5wxJfEcqzKWtu+Qr5WwdFyEhwT/IklQJ3GWhK7Qmq9DvNNgbzqkJfkbDQfFIvCisUye8j2Zc+Ny95TR3tOHA/YIHvq0szatG75C/wrKozdjKoqQxdiLBHeJGLXjVmFEK7Bcv2coXjpVTW5I1PiM+tiX3typ0Pvo88BoUGQ37CB5N8KnjEvYyks9dROgVl2S5vSRCPru8W8e7s70b7qeiZkweHXY+qinFiAXejM0JgxATT0OLwiQ0uzr0BiscHh8/h+flFLhBQvzOfefllfgZU7jT8RwLgVZN0Qd/Pof8GSOqTiJ/hLntSxgLPVhhr3x7vsZMdkq44YpXzbgzp3uunTm7Iie3+QUcCP6IGfbhrnVukIS7jSkMHJpvZ65RFvqfF0Fd09Rrln6vdo+eyYVErtexMquLzVMhuE1CD9SsGpVjRVXOmWM01maRKfJVHVgEIpJ4EIMgfmL+UNpfHWhS0uVAo0KtCDgcDEb6XnO7KiciaEglIhBnhesBkooawJuqxAQuHucmEZ+avgUFvMBSsyHcnJnZS4Yp2aEIojZbBRAZYcfiMB1UrY5zr7Y8Z7DyLuLCPDensnLXc+guZ0lVLtjLaguTuEcOJraYnqaLm6sIitQjsrcJK3qcSB4xrJpXjPEceR7Efe5VI/5iLKInjembRfdu340wLFtUNP2ptqkkuDmgptBGlb0cfEF8ISFHoAekUsLUcUvTSv5f41mJON3FyweWuFyyQv2txZr+AqGjZIa8gL254LPhNnGF05SXhm9LiCK/8cKYchq4bPcbRBNidvfl0bKv7ZGyFj+PlH1tjxQ3/XmY+FMHjMIbQAGqMFJGHFvauenuYZX8QwtX3eFauWMU+k9yxaok1sINq5fVGTYrG/JGrWvnm5Dq++k8cv2svSXlG+gGUflp7WWVWua8hNJgh/DKtcaFAMt9b49WbpALyaQ02iUNaM1yMRtog3vhZj1wDXY2oT2+3t7mofWx9qjVTWseu3rGV5OW4jLsSXkpqti6J6aadbW21hyi3PA2rc61n4WIzT6/xqXa/4XfX/5O+7g8UPrx5T24WCVXF3txJ9Cinotntq3ZVJVfc3aFar9slY6ndF9/VMpAqRJd9Yubmpb67euXjSpC+e6QsJGfCfUWkL4DtLaB3iqV/aTUMelTUi9NOyetQxrH3cpuMrjUvkRTTAMMsCaOal0WWyGxO1ATBovf6JSSsLlNJswRI0ssZPTyZx4OR4cao/z1sLuWEA5tSfF+FSQrWyPffkR+6cnric+HLXD3oUwdJLHU3sna4BQo1L1BKijVKqzWL4/3+vNjZrXS49WMOXgzMf8Ml58Ys1/uCwgHxrUPsXJiDI2/Otm8G736qiRnX766i8OslBNye938ZSdl2ZegGoayL/gyIUlUfu6JjtwHq4aMrNxwyIH1xzX2JqOaSkzgv3PR5vte6cE2ij+ZDXxxSi70np2kW0czlli4V7wl9+bQ+sJ+riysMWAtL9K+GbCsFepETlUyGnsyZxAK2FeeiigU5EL6UJKX2sIbnzCbeIjm9S73Ke2vX2XKFFQfOcMeZip69B22ldjYoKXoWtTvMkRHRrBMnLSj+xrZvqh7AXd94HDckZvW8l6VZGAtF1gFXc2FVdKE9SxhFXDCLL4og5jffvbq3oYsrOQZn4cjLHe24Jm5f4aG4BBklUGojp3BTZv3yXTOjC15EiGaRskULS3OsUSQC9GpD+UcsiUM21AihP+V8AXRICz3HrAzY9eBBDPAlrH7QAv/WaJCrEl+SIQWdR5fe+E/dPaxBVCTqHR+zX4KCHVSvS8q0nkNhIrd+EJXZynVxb7apkhXnLUEis2Xppw77HoUwMQ1W6A13kc3uMQv8QrZ2+SBoh5k90EUzT4+I2jlI1fEGNl6+Ak+7Lib9/8BGqRIUxMwAAA= + + + dbo + + \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.Designer.cs b/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.Designer.cs new file mode 100644 index 0000000..379f3ce --- /dev/null +++ b/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.Designer.cs @@ -0,0 +1,29 @@ +// +namespace RemoteLab.Migrations +{ + using System.CodeDom.Compiler; + using System.Data.Entity.Migrations; + using System.Data.Entity.Migrations.Infrastructure; + using System.Resources; + + [GeneratedCode("EntityFramework.Migrations", "6.1.0-30225")] + public sealed partial class PoolSortOrder : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(PoolSortOrder)); + + string IMigrationMetadata.Id + { + get { return "202003241448422_PoolSortOrder"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.cs b/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.cs new file mode 100644 index 0000000..043fd27 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.cs @@ -0,0 +1,46 @@ +namespace RemoteLab.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class PoolSortOrder : DbMigration + { + public override void Up() + { + AddColumn("dbo.Pools", "SortOrder", c => c.Byte(nullable: true)); + Sql(@"ALTER view [dbo].[PoolSummary] + as + select p.PoolName, p.ActiveDirectoryUserGroup, p.ActiveDirectoryAdminGroup, + p.EmailNotifyList, p.RdpTcpPort, p.CleanupInMinutes, + p.RemoteAdminUser, p.RemoteAdminPassword, p.WelcomeMessage, + count(c.ComputerName) as PoolCount, + count(c.UserName) as PoolInUse, + count(c.ComputerName) - count(c.UserName) as PoolAvailable, p.SortOrder + + from Pools p left + join Computers c on c.Pool_PoolName = p.PoolName + + group by p.PoolName, p.ActiveDirectoryUserGroup, p.ActiveDirectoryAdminGroup, + p.EmailNotifyList, p.RdpTcpPort, p.CleanupInMinutes, + p.RemoteAdminUser, p.RemoteAdminPassword, p.WelcomeMessage, p.SortOrder + order by SortOrder offset 0 rows"); + } + + public override void Down() + { + DropColumn("dbo.Pools", "SortOrder"); + Sql(@"ALTER view [dbo].[PoolSummary] + as + select p.PoolName, p.ActiveDirectoryUserGroup, p.ActiveDirectoryAdminGroup, + p.EmailNotifyList, p.RdpTcpPort, p.CleanupInMinutes, + p.RemoteAdminUser, p.RemoteAdminPassword, p.WelcomeMessage, + count(c.ComputerName) as PoolCount, + count(c.UserName) as PoolInUse, + count(c.ComputerName) - count(c.UserName) as PoolAvailable + from Pools p left join Computers c on c.Pool_PoolName=p.PoolName + group by p.PoolName, p.ActiveDirectoryUserGroup, p.ActiveDirectoryAdminGroup, + p.EmailNotifyList, p.RdpTcpPort, p.CleanupInMinutes, + p.RemoteAdminUser, p.RemoteAdminPassword, p.WelcomeMessage"); + } + } +} diff --git a/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.resx b/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.resx new file mode 100644 index 0000000..4a5ad73 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Migrations/202003241448422_PoolSortOrder.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEANVa227jNhB9L9B/EPTUFlnLSRp0N7B3kTrJwmhuiLPbvgWMRDtEKVIVKddu0S/rQz+pv9ChrhR1seQ4yfbN4uXMcDgznIv//fuf0YeVT60lDgXhbGzvD4a2hZnLPcIWYzuS8zdv7Q/vv/5qdOb5K+tztu5QrYOdTIztRymDY8cR7iP2kRj4xA254HM5cLnvII87B8PhO2d/38EAYQOWZY1uIyaJj+MP+Jxw5uJARohecg9TkY7DzCxGta6Qj0WAXDy2b7HPJb5AD4NkrW2dUIKAjxmmc9tCjHGJJHB5/EngmQw5W8wCGED0bh1gWDdHVOCU++NiedeDDA/UQZxiYwblRkJyvyfg/mEqGcfcvpV87VxyILszkLFcq1PH8hvbE+4HkcShbZnEjic0VAur4h1km/asfGovV4SDwXDww+Hbt4P9d98fvduzJhGVUYjHDEcyRHTPuokeKHF/wus7/itmYxZRqvMIXMJcaQCGbkIe4FCub/Hc4Fx92ZZTRnBMiBygdndyTtAMUHHbukSrC8wW8nFsH4FOn5MV9rKBVFM+MQIGAXtkGMHnFZwBPVCczzutxEELd0S4nc4tBkJL7GV0TpHEd6RGXMa+C75QytZzExIS9IPMSR3BTRK6QkuyiPXOgL3hnNqgZzSeFI8kSMw6V8L7ZMV5yP1bTrWrjSfuZzwKXSVpXjd7h8IFlmVuRk5hJa22kxDuYTdqw6vajGJgO3spdr6wrZy4kizxKQmxK3m4VqbzMeRR0MLI/nAXxmMQPvF8wl6G8pmPCL3ikszXF0TIZ6d36wV3bnDDw5zUlMnDg95XNaEYsSiYskvCwMTE09ASM4nFri69RQoHR0fPoXkaAzdIiN956L08Ez9jCm86vsRCoEWb9cHP56A/ZUTFSeSP2Ld9jm1hB1JoJzoDVbwOveLSf1zLTax39tpnS8xkL7cd73hVvz31+nvsqbfJ/rTDz+Ba8UfMcAgvtneDJLyQTGHgWHwbPZaS0P88lOrr7F4zgHy11/hUziTyg57xXZNtngjBXRJroCHVJKgrs3LGPKs1wktEoceGIBGwSBKADQL5sf1d5XxNoFlgqIEm4V4ZcDgY7Jtn1U5VdUSQ1kpEwM5Kjww4FTWBV3WOCVQ89U0ivTXzCAp4hqUhQ3h/C7FXBFORQxlEHbYOIBHChs2xO6jbnfpeY7smsOop0vBeW1Mb/5s+dJOy5CyX5OV0hcnUQ4NJJWa66fLhaowi14iiwuEkJY6sFOI01EJGlygIwO612kg6Ys2Swsjkzax/zcBPMBxX1JQOcm5zSvByQGRizCp5efichEKCj0APSLmEiedXllX0v0GzMnKmilcvLFO5bIf6bdiaWccwUQpBnsPZfNDZ+Ji4RmmqW+MKFaIobH0wJpxGPttcyWhDLN4+Ha0Y7Y5UFAp0pGK0O1JaOtBh0qEeGKVKQgmqNFNFHDnGvZnq4VT0wzBXU+E6qWNi+k9SxTon1kEN67c1CbYIG3ShNhUF2pCas3IduXnV1pT0NLyFlL6sO61K4q1TqEz2MC8twS4ZmDbeHa2aZpecSWW2jxswUu6yNzAmt8ItMukG7GJBd3wzSdahzbnuqPWpr45dv6I7BS3P1WG14S/GxaUh3ZN8XBL99XdyDfsa781Qrmry3LZbS2VL1l8Mv8YDvfvgYXdvQZ4T6kD54MtrcDnirg8c06yiQ2yYruwa/6mMoeHuSplDVSo9b+m++aqUgHIm+vKXJkgd+dtWL1tZhFTAI3FRYCpUXSGvKXSWgZl2VfWkkn2ZS3ItzbMwI9sapZnP5vZ0JRVKltgWCGBJPJUGzdZCYn+gFgxmv9EJJXGinC24RIzMsZBJFdE+GO4fGD3uL6ff7Ajh0Y5N5y+i7cuWKHQfUVgpnz2xFNkBd5smrocklkbNrQtOqam7NUhNk7cOq3MV894sZRZSqxTCpszDq7H9Z7z92Jr+cl9C2LPioOnYGlp/9ZJ5v4bvq7Zdd6Wrm7qqtXTibmM/fdnYRN0VoYae6a7gqy1Sovzzjhqk22A1tEdrDxx35XbX/dwZjfrmZgb/jY9W3+60YdmF8a36k5Kw9eZL7NmifPE+YXyCjZ3AnvdRaQ2+4nO7dWNvV9jP5c6NtlzHF3nXbbkip+rVMatts2zZzgNTwKHSVEQhshcyhNi+kl/ehIS5JEBU57ua8HR/x5Uoc1Bz5hQHmCnrMU/YlWJrppejG1a/SRA925TVbk63HmRrCzJJg0BdHzhcd6Kmjc242g5lY4OyDrq+QVfbu2xuXdYBZ+3OF21r6scvWgFdOpi1zc/naVxWU2TQTO1/3mAcgiwKCJX6M3iydZ3M10zZnGcWYnCULTHc4iWWCHwhOgkhLkSuhGkXYo34rxKfEY3iuPEBe1N2HUkQAxwZ+w+09HcXZWJt9OPubJnn0XUQ/1d1F0cANoly59fsx4hQL+f7vMadN0Ao200fdHWXUj3si3WOdMVZR6BUfLnLucN+QAFMXLMZWuJteINH/AIvkLvOKh3NIJsvoiz20SlBixD5IsUo9sMn6LDnr97/B1bI/hruMAAA + + + dbo + + \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Migrations/Configuration.cs b/src/RemoteLab/RemoteLab/Migrations/Configuration.cs index 4f1c732..75870f4 100644 --- a/src/RemoteLab/RemoteLab/Migrations/Configuration.cs +++ b/src/RemoteLab/RemoteLab/Migrations/Configuration.cs @@ -35,6 +35,8 @@ private void DataCleanup(RemoteLabContext context) private void DataInit( RemoteLabContext context ) { + return; + PasswordUtility Pass = new PasswordUtility(Properties.Settings.Default.EncryptionKeyForPasswords); var stringVector = Pass.NewInitializationVector(); var prodPool = context.Pools.Add(new Pool() @@ -173,7 +175,7 @@ private void DataInit( RemoteLabContext context ) protected override void Seed(RemoteLabContext context) { - + return; #if (DEBUG) DataCleanup(context); DataInit(context); diff --git a/src/RemoteLab/RemoteLab/Models/Computer.cs b/src/RemoteLab/RemoteLab/Models/Computer.cs index 3f71f6d..9adfb1a 100644 --- a/src/RemoteLab/RemoteLab/Models/Computer.cs +++ b/src/RemoteLab/RemoteLab/Models/Computer.cs @@ -25,5 +25,8 @@ public class Computer public DateTime? Logon { get; set; } public Pool Pool { get; set; } + + [Display(Name = "Record Last Modified", ShortName = "LastMod")] + public DateTime LastModified { get; set; } } } \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Models/Pool.cs b/src/RemoteLab/RemoteLab/Models/Pool.cs index a1f3bdb..6ae2271 100644 --- a/src/RemoteLab/RemoteLab/Models/Pool.cs +++ b/src/RemoteLab/RemoteLab/Models/Pool.cs @@ -59,5 +59,8 @@ public class Pool [MaxLength(255)] public string InitializationVector {get; set;} + + [Display( Name = "Sort Order", ShortName = "Sort")] + public Byte SortOrder {get; set;} } } \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Models/PoolSummary.cs b/src/RemoteLab/RemoteLab/Models/PoolSummary.cs index a64a3b3..a2a0be9 100644 --- a/src/RemoteLab/RemoteLab/Models/PoolSummary.cs +++ b/src/RemoteLab/RemoteLab/Models/PoolSummary.cs @@ -59,6 +59,8 @@ public class PoolSummary : IDbAsyncEnumerable [Display(Name = "Avaliable", ShortName = "Available")] public int PoolAvailable { get; set; } + [Display(Name = "Sort Order", ShortName = "Sort")] + public Byte SortOrder { get; set; } public IDbAsyncEnumerator GetAsyncEnumerator() { diff --git a/src/RemoteLab/RemoteLab/Properties/Resources.Designer.cs b/src/RemoteLab/RemoteLab/Properties/Resources.Designer.cs index d2f85bd..e733b43 100644 --- a/src/RemoteLab/RemoteLab/Properties/Resources.Designer.cs +++ b/src/RemoteLab/RemoteLab/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace RemoteLab.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { diff --git a/src/RemoteLab/RemoteLab/Properties/Settings.Designer.cs b/src/RemoteLab/RemoteLab/Properties/Settings.Designer.cs index a36378e..35ae1c5 100644 --- a/src/RemoteLab/RemoteLab/Properties/Settings.Designer.cs +++ b/src/RemoteLab/RemoteLab/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace RemoteLab.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -34,158 +34,222 @@ public string Database { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("IST-Users-ITServices")] - public string AdministratorADGroup { + [global::System.Configuration.DefaultSettingValueAttribute("Password")] + public string LoginFormPasswordLabel { get { - return ((string)(this["AdministratorADGroup"])); + return ((string)(this["LoginFormPasswordLabel"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("ad.syr.edu")] - public string ActiveDirectoryDNSDomain { + [global::System.Configuration.DefaultSettingValueAttribute("https://www.youtube.com/embed/fyM2OHUS6O4?autoplay=1")] + public string RemoteLabIntroVideoLink { get { - return ((string)(this["ActiveDirectoryDNSDomain"])); + return ((string)(this["RemoteLabIntroVideoLink"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("smtp-host.syr.edu")] - public string SmtpServer { + [global::System.Configuration.DefaultSettingValueAttribute("https://answers.syr.edu/display/ischool/iSchool+Remote+Lab")] + public string OfficialDocumentationLink { get { - return ((string)(this["SmtpServer"])); + return ((string)(this["OfficialDocumentationLink"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("remotelabadmin@syr.edu")] - public string SmtpMessageFromAddress { + [global::System.Configuration.DefaultSettingValueAttribute("https://www.microsoft.com/en-us/p/microsoft-remote-desktop/9wzdncrfj3ps")] + public string WindowsClientDownload { get { - return ((string)(this["SmtpMessageFromAddress"])); + return ((string)(this["WindowsClientDownload"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("AD")] - public string ActiveDirectoryDomain { + [global::System.Configuration.DefaultSettingValueAttribute("https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417?mt=12")] + public string MacClientDownload { get { - return ((string)(this["ActiveDirectoryDomain"])); + return ((string)(this["MacClientDownload"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("NetID")] - public string LoginFormUsernameLabel { + [global::System.Configuration.DefaultSettingValueAttribute("\r\n on error resume next\r\n dim connstr, remotepowershelluser, po" + + "olName\r\n connstr = \"{0}\"\r\n remotepowershelluser = \"{1}\"\r\n " + + " poolName = \"{2}\"\r\n ")] + public string RemoteLabSettingsFileContent { get { - return ((string)(this["LoginFormUsernameLabel"])); + return ((string)(this["RemoteLabSettingsFileContent"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Password")] - public string LoginFormPasswordLabel { + [global::System.Configuration.DefaultSettingValueAttribute("50")] + public int DashboardMaxEvents { get { - return ((string)(this["LoginFormPasswordLabel"])); + return ((int)(this["DashboardMaxEvents"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("https://www.youtube.com/embed/fyM2OHUS6O4?autoplay=1")] - public string RemoteLabIntroVideoLink { + [global::System.Configuration.DefaultSettingValueAttribute("https://play.google.com/store/apps/details?id=com.microsoft.rdc.android&hl=en_US")] + public string AndroidClientDownload { get { - return ((string)(this["RemoteLabIntroVideoLink"])); + return ((string)(this["AndroidClientDownload"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("https://answers.syr.edu/display/ischool/iSchool+Remote+Lab")] - public string OfficialDocumentationLink { + [global::System.Configuration.DefaultSettingValueAttribute("https://apps.apple.com/us/app/microsoft-remote-desktop/id714464092")] + public string IosClientDownload { get { - return ((string)(this["OfficialDocumentationLink"])); + return ((string)(this["IosClientDownload"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("http://support.microsoft.com/kb/2592687")] - public string WindowsClientDownload { + [global::System.Configuration.DefaultSettingValueAttribute("maine.edu")] + public string UserPrincipleDomain { get { - return ((string)(this["WindowsClientDownload"])); + return ((string)(this["UserPrincipleDomain"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417?mt=12")] - public string MacClientDownload { + [global::System.Configuration.DefaultSettingValueAttribute("SCCM-UMS-LAB-ADMINS")] + public string AdministratorADGroup { get { - return ((string)(this["MacClientDownload"])); + return ((string)(this["AdministratorADGroup"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("240, 148, 233, 7, 112, 207, 116, 14, 177, 66, 198, 200, 41, 180, 156, 143, 151, 2" + - "26, 75, 247, 115, 68, 85, 107, 143, 156, 5, 226, 191, 225, 247, 162")] - public string EncryptionKeyForPasswords { + [global::System.Configuration.DefaultSettingValueAttribute("uad.maine.edu")] + public string ActiveDirectoryDNSDomain { get { - return ((string)(this["EncryptionKeyForPasswords"])); + return ((string)(this["ActiveDirectoryDNSDomain"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n screen mode id:i:2\r\n desktopwidth:i: {0}\r\n desktoph" + - "eight:i: {1}\r\n session bpp:i:32\r\n winposstr:s:0,1,614,156,1654" + - ",963\r\n full address:s: {2}\r\n username:s: {3}\r\n compre" + - "ssion:i:1\r\n keyboardhook:i:2\r\n audiomode:i:0\r\n redire" + - "ctprinters:i:1\r\n redirectcomports:i:0\r\n redirectsmartcards:i:0" + - "\r\n redirectclipboard:i:1\r\n redirectposdevices:i:0\r\n r" + - "edirectdrives:i:1\r\n drivestoredirect: s()\r\n displayconnectionb" + - "ar:i:1\r\n pinconnectionbar:i:1\r\n autoreconnection enabled:i:1\r\n" + - " authentication level:i:0\r\n prompt for credentials:i:0\r\n " + - " negotiate security layer:i:1\r\n remoteapplicationmode:i:0\r\n " + - " alternate shell:s:\r\n shell working directory:s:\r\n disable wal" + - "lpaper:i:1\r\n disable full window drag:i:0\r\n allow desktop comp" + - "osition:i:1\r\n allow font smoothing:i:1\r\n disable menu anims:i:" + - "1\r\n disable themes:i:0\r\n disable cursor setting:i:0\r\n " + - " bitmapcachepersistenable:i:1\r\n gatewayhostname:s:\r\n gatewayus" + - "agemethod:i:0\r\n gatewaycredentialssource:i:4\r\n gatewayprofileu" + - "sagemethod:i:0\r\n promptcredentialonce:i:1\r\n use multimon:i:0\r\n" + - " audiocapturemode:i:0\r\n videoplaybackmode:i:1\r\n conne" + - "ction type:i:6\r\n redirectdirectx:i:1\r\n use redirection server " + - "name:i:0\r\n devicestoredirect:s:*\r\n smart sizing:i:1\r\n ")] - public string RdpFileSettings { + [global::System.Configuration.DefaultSettingValueAttribute("smarthost.maine.edu")] + public string SmtpServer { get { - return ((string)(this["RdpFileSettings"])); + return ((string)(this["SmtpServer"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n on error resume next\r\n dim connstr, remotepowershelluser, po" + - "olName\r\n connstr = \"{0}\"\r\n remotepowershelluser = \"{1}\"\r\n " + - " poolName = \"{2}\"\r\n ")] - public string RemoteLabSettingsFileContent { + [global::System.Configuration.DefaultSettingValueAttribute("remotelab@maine.edu")] + public string SmtpMessageFromAddress { get { - return ((string)(this["RemoteLabSettingsFileContent"])); + return ((string)(this["SmtpMessageFromAddress"])); } } [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("50")] - public int DashboardMaxEvents { + [global::System.Configuration.DefaultSettingValueAttribute("uad")] + public string ActiveDirectoryDomain { get { - return ((int)(this["DashboardMaxEvents"])); + return ((string)(this["ActiveDirectoryDomain"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("User Name")] + public string LoginFormUsernameLabel { + get { + return ((string)(this["LoginFormUsernameLabel"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("39, 171, 235, 213, 64, 123, 65, 159, 99, 178, 89, 60, 120, 219, 155, 60, 229, 111" + + ", 32, 230, 167, 160, 224, 121, 35, 163, 22, 124, 141, 219, 216, 56")] + public string EncryptionKeyForPasswords { + get { + return ((string)(this["EncryptionKeyForPasswords"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute(@"screen mode id:i:2 +desktopwidth:i:{0} +desktopheight:i:{1} +session bpp:i:32 +winposstr:s:0,1,614,156,1654,963 +full address:s:{2} +username:s:{3} +compression:i:1 +keyboardhook:i:2 +audiomode:i:0 +redirectprinters:i:1 +redirectcomports:i:0 +redirectsmartcards:i:0 +redirectclipboard:i:1 +redirectposdevices:i:0 +redirectdrives:i:1 +drivestoredirect:s() +displayconnectionbar:i:1 +pinconnectionbar:i:1 +autoreconnection enabled:i:1 +authentication level:i:0 +prompt for credentials:i:0 +negotiate security layer:i:1 +remoteapplicationmode:i:0 +alternate shell:s: +shell working directory:s: +disable wallpaper:i:1 +disable full window drag:i:0 +allow desktop composition:i:1 +allow font smoothing:i:1 +disable menu anims:i:1 +disable themes:i:0 +disable cursor setting:i:0 +bitmapcachepersistenable:i:1 +gatewayhostname:s: +gatewayusagemethod:i:0 +gatewaycredentialssource:i:4 +gatewayprofileusagemethod:i:0 +promptcredentialonce:i:1 +use multimon:i:0 +audiocapturemode:i:0 +videoplaybackmode:i:1 +connection type:i:6 +redirectdirectx:i:1 +use redirection server name:i:0 +devicestoredirect:s:* +smart sizing:i:1 + ")] + public string RdpFileSettings { + get { + return ((string)(this["RdpFileSettings"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool PerformReboots { + get { + return ((bool)(this["PerformReboots"])); } } } diff --git a/src/RemoteLab/RemoteLab/Properties/Settings.settings b/src/RemoteLab/RemoteLab/Properties/Settings.settings index 07f303a..f1dd06b 100644 --- a/src/RemoteLab/RemoteLab/Properties/Settings.settings +++ b/src/RemoteLab/RemoteLab/Properties/Settings.settings @@ -6,24 +6,6 @@ - - IST-Users-ITServices - - - ad.syr.edu - - - smtp-host.syr.edu - - - remotelabadmin@syr.edu - - - AD - - - NetID - Password @@ -34,65 +16,11 @@ https://answers.syr.edu/display/ischool/iSchool+Remote+Lab - http://support.microsoft.com/kb/2592687 + https://www.microsoft.com/en-us/p/microsoft-remote-desktop/9wzdncrfj3ps https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417?mt=12 - - 240, 148, 233, 7, 112, 207, 116, 14, 177, 66, 198, 200, 41, 180, 156, 143, 151, 226, 75, 247, 115, 68, 85, 107, 143, 156, 5, 226, 191, 225, 247, 162 - - - - screen mode id:i:2 - desktopwidth:i: {0} - desktopheight:i: {1} - session bpp:i:32 - winposstr:s:0,1,614,156,1654,963 - full address:s: {2} - username:s: {3} - compression:i:1 - keyboardhook:i:2 - audiomode:i:0 - redirectprinters:i:1 - redirectcomports:i:0 - redirectsmartcards:i:0 - redirectclipboard:i:1 - redirectposdevices:i:0 - redirectdrives:i:1 - drivestoredirect: s() - displayconnectionbar:i:1 - pinconnectionbar:i:1 - autoreconnection enabled:i:1 - authentication level:i:0 - prompt for credentials:i:0 - negotiate security layer:i:1 - remoteapplicationmode:i:0 - alternate shell:s: - shell working directory:s: - disable wallpaper:i:1 - disable full window drag:i:0 - allow desktop composition:i:1 - allow font smoothing:i:1 - disable menu anims:i:1 - disable themes:i:0 - disable cursor setting:i:0 - bitmapcachepersistenable:i:1 - gatewayhostname:s: - gatewayusagemethod:i:0 - gatewaycredentialssource:i:4 - gatewayprofileusagemethod:i:0 - promptcredentialonce:i:1 - use multimon:i:0 - audiocapturemode:i:0 - videoplaybackmode:i:1 - connection type:i:6 - redirectdirectx:i:1 - use redirection server name:i:0 - devicestoredirect:s:* - smart sizing:i:1 - - on error resume next @@ -105,5 +33,88 @@ 50 + + https://play.google.com/store/apps/details?id=com.microsoft.rdc.android&hl=en_US + + + https://apps.apple.com/us/app/microsoft-remote-desktop/id714464092 + + + maine.edu + + + SCCM-UMS-LAB-ADMINS + + + uad.maine.edu + + + smarthost.maine.edu + + + remotelab@maine.edu + + + uad + + + User Name + + + 39, 171, 235, 213, 64, 123, 65, 159, 99, 178, 89, 60, 120, 219, 155, 60, 229, 111, 32, 230, 167, 160, 224, 121, 35, 163, 22, 124, 141, 219, 216, 56 + + + screen mode id:i:2 +desktopwidth:i:{0} +desktopheight:i:{1} +session bpp:i:32 +winposstr:s:0,1,614,156,1654,963 +full address:s:{2} +username:s:{3} +compression:i:1 +keyboardhook:i:2 +audiomode:i:0 +redirectprinters:i:1 +redirectcomports:i:0 +redirectsmartcards:i:0 +redirectclipboard:i:1 +redirectposdevices:i:0 +redirectdrives:i:1 +drivestoredirect:s() +displayconnectionbar:i:1 +pinconnectionbar:i:1 +autoreconnection enabled:i:1 +authentication level:i:0 +prompt for credentials:i:0 +negotiate security layer:i:1 +remoteapplicationmode:i:0 +alternate shell:s: +shell working directory:s: +disable wallpaper:i:1 +disable full window drag:i:0 +allow desktop composition:i:1 +allow font smoothing:i:1 +disable menu anims:i:1 +disable themes:i:0 +disable cursor setting:i:0 +bitmapcachepersistenable:i:1 +gatewayhostname:s: +gatewayusagemethod:i:0 +gatewaycredentialssource:i:4 +gatewayprofileusagemethod:i:0 +promptcredentialonce:i:1 +use multimon:i:0 +audiocapturemode:i:0 +videoplaybackmode:i:1 +connection type:i:6 +redirectdirectx:i:1 +use redirection server name:i:0 +devicestoredirect:s:* +smart sizing:i:1 + + + + False + \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/RemoteLab.csproj b/src/RemoteLab/RemoteLab/RemoteLab.csproj index f5d4a8e..051e4f9 100644 --- a/src/RemoteLab/RemoteLab/RemoteLab.csproj +++ b/src/RemoteLab/RemoteLab/RemoteLab.csproj @@ -1,5 +1,6 @@  + Debug @@ -13,13 +14,18 @@ Properties RemoteLab RemoteLab - v4.5 + v4.7.2 false true + + + + + true @@ -49,53 +55,43 @@ ..\packages\elmah.corelibrary.1.2.2\lib\Elmah.dll - - ..\packages\Elmah.MVC.2.1.1\lib\net40\Elmah.Mvc.dll + + ..\packages\Elmah.Mvc.2.1.2\lib\net40\Elmah.Mvc.dll - False - ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.dll + ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll - False - ..\packages\EntityFramework.6.1.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll - False - ..\packages\Microsoft.AspNet.Identity.Core.2.0.1\lib\net45\Microsoft.AspNet.Identity.Core.dll + ..\packages\Microsoft.AspNet.Identity.Core.2.2.3\lib\net45\Microsoft.AspNet.Identity.Core.dll - False - ..\packages\Microsoft.AspNet.Identity.Owin.2.0.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll + ..\packages\Microsoft.AspNet.Identity.Owin.2.2.3\lib\net45\Microsoft.AspNet.Identity.Owin.dll - - False - ..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll + + ..\packages\Microsoft.Owin.4.1.0\lib\net45\Microsoft.Owin.dll - - False - ..\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll + + ..\packages\Microsoft.Owin.Host.SystemWeb.4.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll - - False - ..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll + + ..\packages\Microsoft.Owin.Security.4.1.0\lib\net45\Microsoft.Owin.Security.dll - - False - ..\packages\Microsoft.Owin.Security.Cookies.2.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll + + ..\packages\Microsoft.Owin.Security.Cookies.4.1.0\lib\net45\Microsoft.Owin.Security.Cookies.dll - - False - ..\packages\Microsoft.Owin.Security.OAuth.2.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll + + ..\packages\Microsoft.Owin.Security.OAuth.4.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll False ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - False - ..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\structuremap.3.0.3.116\lib\net40\StructureMap.dll @@ -109,60 +105,49 @@ + - - False - ..\packages\Microsoft.AspNet.WebApi.Client.5.1.2\lib\net45\System.Net.Http.Formatting.dll + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll - - + - False - ..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.Helpers.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll - - False - ..\packages\Microsoft.AspNet.WebApi.Core.5.1.2\lib\net45\System.Web.Http.dll + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll - - False - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.1.2\lib\net45\System.Web.Http.WebHost.dll + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll - - False - ..\packages\Microsoft.AspNet.Mvc.5.1.2\lib\net45\System.Web.Mvc.dll + + ..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll False ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll + + - False - ..\packages\Microsoft.AspNet.Razor.3.1.2\lib\net45\System.Web.Razor.dll + ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll + - False - ..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.WebPages.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll - False - ..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.WebPages.Deployment.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll - False - ..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.WebPages.Razor.dll + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll - - - - - @@ -175,9 +160,9 @@ + - False - ..\packages\WebActivatorEx.2.0.5\lib\net40\WebActivatorEx.dll + ..\packages\WebActivatorEx.2.2.0\lib\net40\WebActivatorEx.dll False @@ -228,6 +213,14 @@ 201405212004414_PoolChanges.cs + + + 202003240114562_ComputersLastModified.cs + + + + 202003241448422_PoolSortOrder.cs + @@ -292,33 +285,35 @@ - - - - + + + + + + PublicSettingsSingleFileGenerator Settings.Designer.cs - - - - - + + + + + @@ -327,6 +322,7 @@ + @@ -342,71 +338,42 @@ + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - + + + + - - - @@ -415,77 +382,70 @@ - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -528,21 +488,14 @@ - - - - - - - - - - + + + Web.config @@ -551,7 +504,9 @@ - + + Designer + @@ -569,6 +524,12 @@ 201405212004414_PoolChanges.cs + + 202003240114562_ComputersLastModified.cs + + + 202003241448422_PoolSortOrder.cs + PublicResXFileCodeGenerator Resources.Designer.cs @@ -621,6 +582,14 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + /, + 'prolog': /<\?[\s\S]+?\?>/, + 'doctype': { + pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i, + greedy: true + }, + 'cdata': //i, + 'tag': { + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i, + greedy: true, + inside: { + 'tag': { + pattern: /^<\/?[^\s>\/]+/i, + inside: { + 'punctuation': /^<\/?/, + 'namespace': /^[^\s>\/:]+:/ + } + }, + 'attr-value': { + pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i, + inside: { + 'punctuation': [ + /^=/, + { + pattern: /^(\s*)["']|["']$/, + lookbehind: true + } + ] + } + }, + 'punctuation': /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { 'namespace': /^[^\s>\/:]+:/ } + } + } + }, + 'entity': /&#?[\da-z]{1,8};/i + }; + Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; + Prism.hooks.add('wrap', function (env) { + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } + }); + Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { + value: function addInlined(tagName, lang) { + var includedCdataInside = {}; + includedCdataInside['language-' + lang] = { + pattern: /(^$)/i, + lookbehind: true, + inside: Prism.languages[lang] + }; + includedCdataInside['cdata'] = /^$/i; + var inside = { + 'included-cdata': { + pattern: //i, + inside: includedCdataInside + } + }; + inside['language-' + lang] = { + pattern: /[\s\S]+/, + inside: Prism.languages[lang] + }; + var def = {}; + def[tagName] = { + pattern: RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, tagName), 'i'), + lookbehind: true, + greedy: true, + inside: inside + }; + Prism.languages.insertBefore('markup', 'cdata', def); + } + }); + Prism.languages.xml = Prism.languages.extend('markup', {}); + Prism.languages.html = Prism.languages.markup; + Prism.languages.mathml = Prism.languages.markup; + Prism.languages.svg = Prism.languages.markup; + }, + {} + ], + 11: [ + function (require, module, exports) { + (function (Prism) { + Prism.languages.php = Prism.languages.extend('clike', { + 'keyword': /\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i, + 'boolean': { + pattern: /\b(?:false|true)\b/i, + alias: 'constant' + }, + 'constant': [ + /\b[A-Z_][A-Z0-9_]*\b/, + /\b(?:null)\b/i + ], + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, + lookbehind: true + } + }); + Prism.languages.insertBefore('php', 'string', { + 'shell-comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + alias: 'comment' + } + }); + Prism.languages.insertBefore('php', 'comment', { + 'delimiter': { + pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, + alias: 'important' + } + }); + Prism.languages.insertBefore('php', 'keyword', { + 'variable': /\$+(?:\w+\b|(?={))/i, + 'package': { + pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, + lookbehind: true, + inside: { punctuation: /\\/ } + } + }); + Prism.languages.insertBefore('php', 'operator', { + 'property': { + pattern: /(->)[\w]+/, + lookbehind: true + } + }); + var string_interpolation = { + pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/, + lookbehind: true, + inside: Prism.languages.php + }; + Prism.languages.insertBefore('php', 'string', { + 'nowdoc-string': { + pattern: /<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/, + greedy: true, + alias: 'string', + inside: { + 'delimiter': { + pattern: /^<<<'[^']+'|[a-z_]\w*;$/i, + alias: 'symbol', + inside: { 'punctuation': /^<<<'?|[';]$/ } + } + } + }, + 'heredoc-string': { + pattern: /<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i, + greedy: true, + alias: 'string', + inside: { + 'delimiter': { + pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i, + alias: 'symbol', + inside: { 'punctuation': /^<<<"?|[";]$/ } + }, + 'interpolation': string_interpolation + } + }, + 'single-quoted-string': { + pattern: /'(?:\\[\s\S]|[^\\'])*'/, + greedy: true, + alias: 'string' + }, + 'double-quoted-string': { + pattern: /"(?:\\[\s\S]|[^\\"])*"/, + greedy: true, + alias: 'string', + inside: { 'interpolation': string_interpolation } + } + }); + delete Prism.languages.php['string']; + Prism.hooks.add('before-tokenize', function (env) { + if (!/<\?/.test(env.code)) { + return; + } + var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig; + Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern); + }); + Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php'); + }); + }(Prism)); + }, + {} + ], + 12: [ + function (require, module, exports) { + Prism.languages.python = { + 'comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true + }, + 'string-interpolation': { + pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, + greedy: true, + inside: { + 'interpolation': { + pattern: /((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/, + lookbehind: true, + inside: { + 'format-spec': { + pattern: /(:)[^:(){}]+(?=}$)/, + lookbehind: true + }, + 'conversion-option': { + pattern: /![sra](?=[:}]$)/, + alias: 'punctuation' + }, + rest: null + } + }, + 'string': /[\s\S]+/ + } + }, + 'triple-quoted-string': { + pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i, + greedy: true, + alias: 'string' + }, + 'string': { + pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, + greedy: true + }, + 'function': { + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, + lookbehind: true + }, + 'class-name': { + pattern: /(\bclass\s+)\w+/i, + lookbehind: true + }, + 'decorator': { + pattern: /(^\s*)@\w+(?:\.\w+)*/im, + lookbehind: true, + alias: [ + 'annotation', + 'punctuation' + ], + inside: { 'punctuation': /\./ } + }, + 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, + 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, + 'boolean': /\b(?:True|False|None)\b/, + 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, + 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + 'punctuation': /[{}[\];(),.:]/ + }; + Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python; + Prism.languages.py = Prism.languages.python; + }, + {} + ], + 13: [ + function (require, module, exports) { + (function (Prism) { + Prism.languages.ruby = Prism.languages.extend('clike', { + 'comment': [ + /#.*/, + { + pattern: /^=begin\s[\s\S]*?^=end/m, + greedy: true + } + ], + 'class-name': { + pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { 'punctuation': /[.\\]/ } + }, + 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/ + }); + var interpolation = { + pattern: /#\{[^}]+\}/, + inside: { + 'delimiter': { + pattern: /^#\{|\}$/, + alias: 'tag' + }, + rest: Prism.languages.ruby + } + }; + delete Prism.languages.ruby.function; + Prism.languages.insertBefore('ruby', 'keyword', { + 'regex': [ + { + pattern: /%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/, + lookbehind: true, + greedy: true + } + ], + 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/, + 'symbol': { + pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/, + lookbehind: true + }, + 'method-definition': { + pattern: /(\bdef\s+)[\w.]+/, + lookbehind: true, + inside: { + 'function': /\w+$/, + rest: Prism.languages.ruby + } + } + }); + Prism.languages.insertBefore('ruby', 'number', { + 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, + 'constant': /\b[A-Z]\w*(?:[?!]|\b)/ + }); + Prism.languages.ruby.string = [ + { + pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + inside: { 'interpolation': interpolation } + } + ]; + Prism.languages.rb = Prism.languages.ruby; + }(Prism)); + }, + {} + ], + 14: [ + function (require, module, exports) { + var Prism = require('prismjs/components/prism-core'); + require('prismjs/components/prism-clike'); + require('prismjs/components/prism-markup-templating'); + require('prismjs/components/prism-c'); + require('prismjs/components/prism-cpp'); + require('prismjs/components/prism-csharp'); + require('prismjs/components/prism-css'); + require('prismjs/components/prism-java'); + require('prismjs/components/prism-javascript'); + require('prismjs/components/prism-markup'); + require('prismjs/components/prism-php'); + require('prismjs/components/prism-python'); + require('prismjs/components/prism-ruby'); + module.exports = { boltExport: Prism }; + }, + { + 'prismjs/components/prism-c': 1, + 'prismjs/components/prism-clike': 2, + 'prismjs/components/prism-core': 3, + 'prismjs/components/prism-cpp': 4, + 'prismjs/components/prism-csharp': 5, + 'prismjs/components/prism-css': 6, + 'prismjs/components/prism-java': 7, + 'prismjs/components/prism-javascript': 8, + 'prismjs/components/prism-markup': 10, + 'prismjs/components/prism-markup-templating': 9, + 'prismjs/components/prism-php': 11, + 'prismjs/components/prism-python': 12, + 'prismjs/components/prism-ruby': 13 + } + ] + }, {}, [14])(14); + })); + var prism = window.Prism; + window.Prism = oldprism; + return prism; + }(undefined, exports$1, module, undefined)); + var Prism$1 = module.exports.boltExport; + + var getLanguages = function (editor) { + return editor.getParam('codesample_languages'); + }; + var useGlobalPrismJS = function (editor) { + return editor.getParam('codesample_global_prismjs', false, 'boolean'); + }; + var Settings = { + getLanguages: getLanguages, + useGlobalPrismJS: useGlobalPrismJS + }; + + var get = function (editor) { + return Global.Prism && Settings.useGlobalPrismJS(editor) ? Global.Prism : Prism$1; + }; + var Prism$2 = { get: get }; + + var getSelectedCodeSample = function (editor) { + var node = editor.selection ? editor.selection.getNode() : null; + if (Utils.isCodeSample(node)) { + return Option.some(node); + } + return Option.none(); + }; + var insertCodeSample = function (editor, language, code) { + editor.undoManager.transact(function () { + var node = getSelectedCodeSample(editor); + code = global$1.DOM.encode(code); + return node.fold(function () { + editor.insertContent('
' + code + '
'); + editor.selection.select(editor.$('#__new').removeAttr('id')[0]); + }, function (n) { + editor.dom.setAttrib(n, 'class', 'language-' + language); + n.innerHTML = code; + Prism$2.get(editor).highlightElement(n); + editor.selection.select(n); + }); + }); + }; + var getCurrentCode = function (editor) { + var node = getSelectedCodeSample(editor); + return node.fold(function () { + return ''; + }, function (n) { + return n.textContent; + }); + }; + var CodeSample = { + getSelectedCodeSample: getSelectedCodeSample, + insertCodeSample: insertCodeSample, + getCurrentCode: getCurrentCode + }; + + var getLanguages$1 = function (editor) { + var defaultLanguages = [ + { + text: 'HTML/XML', + value: 'markup' + }, + { + text: 'JavaScript', + value: 'javascript' + }, + { + text: 'CSS', + value: 'css' + }, + { + text: 'PHP', + value: 'php' + }, + { + text: 'Ruby', + value: 'ruby' + }, + { + text: 'Python', + value: 'python' + }, + { + text: 'Java', + value: 'java' + }, + { + text: 'C', + value: 'c' + }, + { + text: 'C#', + value: 'csharp' + }, + { + text: 'C++', + value: 'cpp' + } + ]; + var customLanguages = Settings.getLanguages(editor); + return customLanguages ? customLanguages : defaultLanguages; + }; + var getCurrentLanguage = function (editor, fallback) { + var node = CodeSample.getSelectedCodeSample(editor); + return node.fold(function () { + return fallback; + }, function (n) { + var matches = n.className.match(/language-(\w+)/); + return matches ? matches[1] : fallback; + }); + }; + var Languages = { + getLanguages: getLanguages$1, + getCurrentLanguage: getCurrentLanguage + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var open = function (editor) { + var languages = Languages.getLanguages(editor); + var defaultLanguage = head(languages).fold(function () { + return ''; + }, function (l) { + return l.value; + }); + var currentLanguage = Languages.getCurrentLanguage(editor, defaultLanguage); + var currentCode = CodeSample.getCurrentCode(editor); + editor.windowManager.open({ + title: 'Insert/Edit Code Sample', + size: 'large', + body: { + type: 'panel', + items: [ + { + type: 'selectbox', + name: 'language', + label: 'Language', + items: languages + }, + { + type: 'textarea', + name: 'code', + label: 'Code view' + } + ] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: { + language: currentLanguage, + code: currentCode + }, + onSubmit: function (api) { + var data = api.getData(); + CodeSample.insertCodeSample(editor, data.language, data.code); + api.close(); + } + }); + }; + var Dialog = { open: open }; + + var register = function (editor) { + editor.addCommand('codesample', function () { + var node = editor.selection.getNode(); + if (editor.selection.isCollapsed() || Utils.isCodeSample(node)) { + Dialog.open(editor); + } else { + editor.formatter.toggle('code'); + } + }); + }; + var Commands = { register: register }; + + var setup = function (editor) { + var $ = editor.$; + editor.on('PreProcess', function (e) { + $('pre[contenteditable=false]', e.node).filter(Utils.trimArg(Utils.isCodeSample)).each(function (idx, elm) { + var $elm = $(elm), code = elm.textContent; + $elm.attr('class', $.trim($elm.attr('class'))); + $elm.removeAttr('contentEditable'); + $elm.empty().append($('').each(function () { + this.textContent = code; + })); + }); + }); + editor.on('SetContent', function () { + var unprocessedCodeSamples = $('pre').filter(Utils.trimArg(Utils.isCodeSample)).filter(function (idx, elm) { + return elm.contentEditable !== 'false'; + }); + if (unprocessedCodeSamples.length) { + editor.undoManager.transact(function () { + unprocessedCodeSamples.each(function (idx, elm) { + $(elm).find('br').each(function (idx, elm) { + elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm); + }); + elm.contentEditable = 'false'; + elm.innerHTML = editor.dom.encode(elm.textContent); + Prism$2.get(editor).highlightElement(elm); + elm.className = $.trim(elm.className); + }); + }); + } + }); + }; + var FilterContent = { setup: setup }; + + var isCodeSampleSelection = function (editor) { + var node = editor.selection.getStart(); + return editor.dom.is(node, 'pre[class*="language-"]'); + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('codesample', { + icon: 'code-sample', + tooltip: 'Insert/edit code sample', + onAction: function () { + return Dialog.open(editor); + }, + onSetup: function (api) { + var nodeChangeHandler = function () { + api.setActive(isCodeSampleSelection(editor)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + } + }); + editor.ui.registry.addMenuItem('codesample', { + text: 'Code sample...', + icon: 'code-sample', + onAction: function () { + return Dialog.open(editor); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('codesample', function (editor) { + FilterContent.setup(editor); + Buttons.register(editor); + Commands.register(editor); + editor.on('dblclick', function (ev) { + if (Utils.isCodeSample(ev.target)) { + Dialog.open(editor); + } + }); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/codesample/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/codesample/plugin.min.js new file mode 100644 index 0000000..a29767f --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/codesample/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(e){"use strict";function n(){}function i(e){return function(){return e}}function t(){return l}var r,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=i(!1),o=i(!0),l=(r={fold:function(e,n){return e()},is:s,isSome:s,isNone:o,getOr:p,getOrThunk:c,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:p,orThunk:c,map:t,each:n,bind:t,exists:s,forall:o,filter:t,equals:u,equals_:u,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r);function u(e){return e.isNone()}function c(e){return e()}function p(e){return e}var d=function(t){function e(){return a}function n(e){return e(t)}var r=i(t),a={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:o,isNone:s,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return d(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?a:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,function(e){return n(t,e)})}};return a},g={some:d,none:t,from:function(e){return null===e||e===undefined?l:d(e)}},m=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");var f={isCodeSample:function q(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function I(t){return function(e,n){return t(n)}}},h="undefined"!=typeof e.window?e.window:Function("return this;")(),b={},y={exports:b},w={};!function(n,t,r,p){var e=window.Prism;window.Prism={manual:!0},function(e){if("object"==typeof t&&void 0!==r)r.exports=e();else if("function"==typeof n&&n.amd)n([],e);else{("undefined"!=typeof window?window:void 0!==w?w:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}}(function(){return function c(i,s,o){function l(n,e){if(!s[n]){if(!i[n]){var t="function"==typeof p&&p;if(!e&&t)return t(n,!0);if(u)return u(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var a=s[n]={exports:{}};i[n][0].call(a.exports,function(e){return l(i[n][1][e]||e)},a,a.exports,c,i,s,o)}return s[n].exports}for(var u="function"==typeof p&&p,e=0;e>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c["boolean"]},{}],2:[function(e,n,t){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(?:true|false)\b/,"function":/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},{}],3:[function(e,t,n){(function(e){var n=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,E={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof O?new O(e.type,E.util.encode(e.content),e.alias):Array.isArray(e)?e.map(E.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof O)){if(g&&b!=n.length-1){if(c.lastIndex=y,!(F=c.exec(e)))break;for(var v=F.index+(d&&F[1]?F[1].length:0),k=F.index+F[0].length,x=b,_=y,A=n.length;x"+t.content+""},!u.document)return u.addEventListener&&(E.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,r=n.code,a=n.immediateClose;u.postMessage(E.highlight(r,E.languages[t],t)),a&&u.close()},!1)),E;var e=E.util.currentScript();if(e&&(E.filename=e.src,e.hasAttribute("data-manual")&&(E.manual=!0)),!E.manual){var t=function(){E.manual||E.highlightAll()},r=document.readyState;"loading"===r||"interactive"===r&&e&&e.defer?document.addEventListener("DOMContentLoaded",t):window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,16)}return E}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});void 0!==t&&t.exports&&(t.exports=n),void 0!==e&&(e.Prism=n)}).call(this,void 0!==w?w:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){Prism.languages.cpp=Prism.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,"boolean":/\b(?:true|false)\b/}),Prism.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}})},{}],5:[function(e,n,t){Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(?:abstract|add|alias|as|ascending|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|descending|do|double|dynamic|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|from|get|global|goto|group|if|implicit|in|int|interface|internal|into|is|join|let|lock|long|namespace|new|null|object|operator|orderby|out|override|params|partial|private|protected|public|readonly|ref|remove|return|sbyte|sealed|select|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|value|var|virtual|void|volatile|where|while|yield)\b/,string:[{pattern:/@("|')(?:\1\1|\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*?\1/,greedy:!0}],"class-name":[{pattern:/\b[A-Z]\w*(?:\.\w+)*\b(?=\s+\w+)/,inside:{punctuation:/\./}},{pattern:/(\[)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/((?:\b(?:class|interface|new)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}}],number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i,operator:/>>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),Prism.languages.insertBefore("csharp","class-name",{"generic-method":{pattern:/\w+\s*<[^>\r\n]+?>\s*(?=\()/,inside:{"function":/^\w+/,"class-name":{pattern:/\b[A-Z]\w*(?:\.\w+)*\b/,inside:{punctuation:/\./}},keyword:Prism.languages.csharp.keyword,punctuation:/[<>(),.:]/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}}),Prism.languages.dotnet=Prism.languages.cs=Prism.languages.csharp},{}],6:[function(e,n,t){!function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/@[\w-]+/}},url:{pattern:RegExp("url\\((?:"+n.source+"|[^\n\r()]*)\\)","i"),inside:{"function":/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+n.source+")*?(?=\\s*\\{)"),string:{pattern:n,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var t=e.languages.markup;t&&(t.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:t.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},t.tag))}(Prism)},{}],7:[function(e,n,t){var r,a,i;r=Prism,a=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,i=/\b[A-Z](?:\w*[a-z]\w*)?\b/,r.languages.java=r.languages.extend("clike",{"class-name":[i,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:a,"function":[r.languages.clike["function"],{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),r.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),r.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})},{}],8:[function(e,n,t){Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,"function":/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript},{}],9:[function(e,n,t){function b(e,n){return"___"+e.toUpperCase()+n+"___"}var y;y=Prism,Object.defineProperties(y.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,e,i){if(r.language===a){var s=r.tokenStack=[];r.code=r.code.replace(e,function(e){if("function"==typeof i&&!i(e))return e;for(var n,t=s.length;-1!==r.code.indexOf(n=b(a,t));)++t;return s[t]=e,n}),r.grammar=y.languages.markup}}},tokenizePlaceholders:{value:function(d,g){if(d.language===g&&d.tokenStack){d.grammar=y.languages[g];var m=0,f=Object.keys(d.tokenStack);!function h(e){for(var n=0;n=f.length);n++){var t=e[n];if("string"==typeof t||t.content&&"string"==typeof t.content){var r=f[m],a=d.tokenStack[r],i="string"==typeof t?t:t.content,s=b(g,r),o=i.indexOf(s);if(-1/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i,greedy:!0},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var t={};t["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[n]},t.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:t}};r["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var a={};a[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g,e),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",a)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup},{}],11:[function(e,n,t){!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,"boolean":{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism)},{}],12:[function(e,n,t){Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,"boolean":/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},{}],13:[function(e,n,t){!function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};delete e.languages.ruby["function"],e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{"function":/\w+$/,rest:e.languages.ruby}}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:n}}],e.languages.rb=e.languages.ruby}(Prism)},{}],14:[function(e,n,t){var r=e("prismjs/components/prism-core");e("prismjs/components/prism-clike"),e("prismjs/components/prism-markup-templating"),e("prismjs/components/prism-c"),e("prismjs/components/prism-cpp"),e("prismjs/components/prism-csharp"),e("prismjs/components/prism-css"),e("prismjs/components/prism-java"),e("prismjs/components/prism-javascript"),e("prismjs/components/prism-markup"),e("prismjs/components/prism-php"),e("prismjs/components/prism-python"),e("prismjs/components/prism-ruby"),n.exports={boltExport:r}},{"prismjs/components/prism-c":1,"prismjs/components/prism-clike":2,"prismjs/components/prism-core":3,"prismjs/components/prism-cpp":4,"prismjs/components/prism-csharp":5,"prismjs/components/prism-css":6,"prismjs/components/prism-java":7,"prismjs/components/prism-javascript":8,"prismjs/components/prism-markup":10,"prismjs/components/prism-markup-templating":9,"prismjs/components/prism-php":11,"prismjs/components/prism-python":12,"prismjs/components/prism-ruby":13}]},{},[14])(14)});var a=window.Prism;window.Prism=e}(undefined,b,y,undefined);function v(e){var n=e.selection?e.selection.getNode():null;return f.isCodeSample(n)?g.some(n):g.none()}var k,x=y.exports.boltExport,_=function(e){return e.getParam("codesample_languages")},A=function(e){return e.getParam("codesample_global_prismjs",!1,"boolean")},F=function(e){return h.Prism&&A(e)?h.Prism:x},P=v,S=function(n,t,r){n.undoManager.transact(function(){var e=v(n);return r=m.DOM.encode(r),e.fold(function(){n.insertContent('
'+r+"
"),n.selection.select(n.$("#__new").removeAttr("id")[0])},function(e){n.dom.setAttrib(e,"class","language-"+t),e.innerHTML=r,F(n).highlightElement(e),n.selection.select(e)})})},j=function(e){return v(e).fold(function(){return""},function(e){return e.textContent})},$=function(e){var n=_(e);return n||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},C=function(e,t){return P(e).fold(function(){return t},function(e){var n=e.className.match(/language-(\w+)/);return n?n[1]:t})},E=(k="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===k}),O=Array.prototype.slice,z=(E(Array.from)&&Array.from,function(t){var e=$(t),n=function(e){return 0===e.length?g.none():g.some(e[0])}(e).fold(function(){return""},function(e){return e.value}),r=C(t,n),a=j(t);t.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:e},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:a},onSubmit:function(e){var n=e.getData();S(t,n.language,n.code),e.close()}})}),N=function(n){n.addCommand("codesample",function(){var e=n.selection.getNode();n.selection.isCollapsed()||f.isCodeSample(e)?z(n):n.formatter.toggle("code")})},T=function(t){var a=t.$;t.on("PreProcess",function(e){a("pre[contenteditable=false]",e.node).filter(f.trimArg(f.isCodeSample)).each(function(e,n){var t=a(n),r=n.textContent;t.attr("class",a.trim(t.attr("class"))),t.removeAttr("contentEditable"),t.empty().append(a("").each(function(){this.textContent=r}))})}),t.on("SetContent",function(){var e=a("pre").filter(f.trimArg(f.isCodeSample)).filter(function(e,n){return"false"!==n.contentEditable});e.length&&t.undoManager.transact(function(){e.each(function(e,n){a(n).find("br").each(function(e,n){n.parentNode.replaceChild(t.getDoc().createTextNode("\n"),n)}),n.contentEditable="false",n.innerHTML=t.dom.encode(n.textContent),F(t).highlightElement(n),n.className=a.trim(n.className)})})})},B=function(t){t.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return z(t)},onSetup:function(e){function n(){e.setActive(function(e){var n=e.selection.getStart();return e.dom.is(n,'pre[class*="language-"]')}(t))}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}),t.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return z(t)}})};!function M(){a.add("codesample",function(n){T(n),B(n),N(n),n.on("dblclick",function(e){f.isCodeSample(e.target)&&z(n)})})}()}(window); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/colorpicker/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/colorpicker/plugin.js new file mode 100644 index 0000000..4ef91dd --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/colorpicker/plugin.js @@ -0,0 +1,22 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + function Plugin () { + global.add('colorpicker', function () { + domGlobals.console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration'); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/colorpicker/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/colorpicker/plugin.min.js new file mode 100644 index 0000000..b0d2b5e --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/colorpicker/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/css/dialog.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/css/dialog.css deleted file mode 100644 index aa2a518..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/css/dialog.css +++ /dev/null @@ -1,118 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(../img/buttons.png) 0 -52px} -#cancel {background:url(../img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../img/icons.gif) -20px 0 no-repeat; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../img/icons.gif) 0 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px} -#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline} -#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/buttons.png b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/buttons.png deleted file mode 100644 index 1e53560..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/buttons.png and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/icons.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/icons.gif deleted file mode 100644 index ca22249..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/icons.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/items.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/items.gif deleted file mode 100644 index d2f9367..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/items.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/menu_arrow.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/menu_arrow.gif deleted file mode 100644 index 85e31df..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/menu_arrow.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/menu_check.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/menu_check.gif deleted file mode 100644 index adfdddc..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/menu_check.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/progress.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/progress.gif deleted file mode 100644 index 5bb90fd..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/progress.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/tabs.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/tabs.gif deleted file mode 100644 index 06812cb..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/img/tabs.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/plugin.js deleted file mode 100644 index 97f985b..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/plugin.js +++ /dev/null @@ -1,294 +0,0 @@ -/** - * plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global tinymce:true, console:true */ -/*eslint no-console:0, new-cap:0 */ - -/** - * This plugin adds missing events form the 4.x API back. Not every event is - * properly supported but most things should work. - * - * Unsupported things: - * - No editor.onEvent - * - Can't cancel execCommands with beforeExecCommand - */ -(function(tinymce) { - var reported; - - function noop() {} - - function log(apiCall) { - if (!reported && window && window.console) { - reported = true; - console.log("Deprecated TinyMCE API call: " + apiCall); - } - } - - function Dispatcher(target, newEventName, argsMap, defaultScope) { - target = target || this; - - if (!newEventName) { - this.add = this.addToTop = this.remove = this.dispatch = noop; - return; - } - - this.add = function(callback, scope, prepend) { - log('.on' + newEventName + ".add(..)"); - - // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2) - function patchedEventCallback(e) { - var callbackArgs = []; - - if (typeof argsMap == "string") { - argsMap = argsMap.split(" "); - } - - if (argsMap && typeof argsMap != "function") { - for (var i = 0; i < argsMap.length; i++) { - callbackArgs.push(e[argsMap[i]]); - } - } - - if (typeof argsMap == "function") { - callbackArgs = argsMap(newEventName, e, target); - if (!callbackArgs) { - return; - } - } - - if (!argsMap) { - callbackArgs = [e]; - } - - callbackArgs.unshift(defaultScope || target); - - if (callback.apply(scope || defaultScope || target, callbackArgs) === false) { - e.stopImmediatePropagation(); - } - } - - target.on(newEventName, patchedEventCallback, prepend); - - return patchedEventCallback; - }; - - this.addToTop = function(callback, scope) { - this.add(callback, scope, true); - }; - - this.remove = function(callback) { - return target.off(newEventName, callback); - }; - - this.dispatch = function() { - target.fire(newEventName); - - return true; - }; - } - - tinymce.util.Dispatcher = Dispatcher; - tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload"); - tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor"); - tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor"); - - tinymce.util.Cookie = { - get: noop, getHash: noop, remove: noop, set: noop, setHash: noop - }; - - function patchEditor(editor) { - function patchEditorEvents(oldEventNames, argsMap) { - tinymce.each(oldEventNames.split(" "), function(oldName) { - editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap); - }); - } - - function convertUndoEventArgs(type, event, target) { - return [ - event.level, - target - ]; - } - - function filterSelectionEvents(needsSelection) { - return function(type, e) { - if ((!e.selection && !needsSelection) || e.selection == needsSelection) { - return [e]; - } - }; - } - - if (editor.controlManager) { - return; - } - - function cmNoop() { - var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' + - 'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' + - 'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' + - 'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update'; - - log('editor.controlManager.*'); - - function _noop() { - return cmNoop(); - } - - tinymce.each(methods.split(' '), function(method) { - obj[method] = _noop; - }); - - return obj; - } - - editor.controlManager = { - buttons: {}, - - setDisabled: function(name, state) { - log("controlManager.setDisabled(..)"); - - if (this.buttons[name]) { - this.buttons[name].disabled(state); - } - }, - - setActive: function(name, state) { - log("controlManager.setActive(..)"); - - if (this.buttons[name]) { - this.buttons[name].active(state); - } - }, - - onAdd: new Dispatcher(), - onPostRender: new Dispatcher(), - - add: function(obj) { return obj; }, - createButton: cmNoop, - createColorSplitButton: cmNoop, - createControl: cmNoop, - createDropMenu: cmNoop, - createListBox: cmNoop, - createMenuButton: cmNoop, - createSeparator: cmNoop, - createSplitButton: cmNoop, - createToolbar: cmNoop, - createToolbarGroup: cmNoop, - destroy: noop, - get: noop, - setControlType: cmNoop - }; - - patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor"); - patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"); - patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported - patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change"); - patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false)); - patchEditorEvents("SetProgressState", "state time"); - patchEditorEvents("VisualAid", "element hasVisual"); - patchEditorEvents("Undo Redo", convertUndoEventArgs); - - patchEditorEvents("NodeChange", function(type, e) { - return [ - editor.controlManager, - e.element, - editor.selection.isCollapsed(), - e - ]; - }); - - var originalAddButton = editor.addButton; - editor.addButton = function(name, settings) { - var originalOnPostRender; - - function patchedPostRender() { - editor.controlManager.buttons[name] = this; - - if (originalOnPostRender) { - return originalOnPostRender.call(this); - } - } - - for (var key in settings) { - if (key.toLowerCase() === "onpostrender") { - originalOnPostRender = settings[key]; - settings.onPostRender = patchedPostRender; - } - } - - if (!originalOnPostRender) { - settings.onPostRender = patchedPostRender; - } - - if (settings.title) { - settings.title = tinymce.i18n.translate((editor.settings.language || "en") + "." + settings.title); - } - - return originalAddButton.call(this, name, settings); - }; - - editor.on('init', function() { - var undoManager = editor.undoManager, selection = editor.selection; - - undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager); - undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager); - undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager); - undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager); - - selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection); - selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection); - selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection); - selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection); - }); - - editor.on('BeforeRenderUI', function() { - var windowManager = editor.windowManager; - - windowManager.onOpen = new Dispatcher(); - windowManager.onClose = new Dispatcher(); - windowManager.createInstance = function(className, a, b, c, d, e) { - log("windowManager.createInstance(..)"); - - var constr = tinymce.resolve(className); - return new constr(a, b, c, d, e); - }; - }); - } - - tinymce.on('SetupEditor', patchEditor); - tinymce.PluginManager.add("compat3x", patchEditor); - - tinymce.addI18n = function(prefix, o) { - var I18n = tinymce.util.I18n, each = tinymce.each; - - if (typeof(prefix) == "string" && prefix.indexOf('.') === -1) { - I18n.add(prefix, o); - return; - } - - if (!tinymce.is(prefix, 'string')) { - each(prefix, function(o, lc) { - each(o, function(o, g) { - each(o, function(o, k) { - if (g === 'common') { - I18n.data[lc + '.' + k] = o; - } else { - I18n.data[lc + '.' + g + '.' + k] = o; - } - }); - }); - }); - } else { - each(o, function(o, k) { - I18n.data[prefix + '.' + k] = o; - }); - } - }; -})(tinymce); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/plugin.min.js deleted file mode 100644 index b77c7cb..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){function t(){}function n(e){!i&&window&&window.console&&(i=!0,console.log("Deprecated TinyMCE API call: "+e))}function o(e,o,r,i){return e=e||this,o?(this.add=function(t,a,d){function s(n){var d=[];if("string"==typeof r&&(r=r.split(" ")),r&&"function"!=typeof r)for(var s=0;s.on"+o+".add(..)"),e.on(o,s,d),s},this.addToTop=function(e,t){this.add(e,t,!0)},this.remove=function(t){return e.off(o,t)},void(this.dispatch=function(){return e.fire(o),!0})):void(this.add=this.addToTop=this.remove=this.dispatch=t)}function r(r){function i(t,n){e.each(t.split(" "),function(e){r["on"+e]=new o(r,e,n)})}function a(e,t,n){return[t.level,n]}function d(e){return function(t,n){return!n.selection&&!e||n.selection==e?[n]:void 0}}function s(){function t(){return s()}var o={},r="add addMenu addSeparator collapse createMenu destroy displayColor expand focus getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex setActive setAriaProperty setColor setDisabled setSelected setState showMenu update";return n("editor.controlManager.*"),e.each(r.split(" "),function(e){o[e]=t}),o}if(!r.controlManager){r.controlManager={buttons:{},setDisabled:function(e,t){n("controlManager.setDisabled(..)"),this.buttons[e]&&this.buttons[e].disabled(t)},setActive:function(e,t){n("controlManager.setActive(..)"),this.buttons[e]&&this.buttons[e].active(t)},onAdd:new o,onPostRender:new o,add:function(e){return e},createButton:s,createColorSplitButton:s,createControl:s,createDropMenu:s,createListBox:s,createMenuButton:s,createSeparator:s,createSplitButton:s,createToolbar:s,createToolbarGroup:s,destroy:t,get:t,setControlType:s},i("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),i("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),i("BeforeExecCommand ExecCommand","command ui value args"),i("PreProcess PostProcess LoadContent SaveContent Change"),i("BeforeSetContent BeforeGetContent SetContent GetContent",d(!1)),i("SetProgressState","state time"),i("VisualAid","element hasVisual"),i("Undo Redo",a),i("NodeChange",function(e,t){return[r.controlManager,t.element,r.selection.isCollapsed(),t]});var c=r.addButton;r.addButton=function(t,n){function o(){return r.controlManager.buttons[t]=this,i?i.call(this):void 0}var i;for(var a in n)"onpostrender"===a.toLowerCase()&&(i=n[a],n.onPostRender=o);return i||(n.onPostRender=o),n.title&&(n.title=e.i18n.translate((r.settings.language||"en")+"."+n.title)),c.call(this,t,n)},r.on("init",function(){var e=r.undoManager,t=r.selection;e.onUndo=new o(r,"Undo",a,null,e),e.onRedo=new o(r,"Redo",a,null,e),e.onBeforeAdd=new o(r,"BeforeAddUndo",null,e),e.onAdd=new o(r,"AddUndo",null,e),t.onBeforeGetContent=new o(r,"BeforeGetContent",d(!0),t),t.onGetContent=new o(r,"GetContent",d(!0),t),t.onBeforeSetContent=new o(r,"BeforeSetContent",d(!0),t),t.onSetContent=new o(r,"SetContent",d(!0),t)}),r.on("BeforeRenderUI",function(){var t=r.windowManager;t.onOpen=new o,t.onClose=new o,t.createInstance=function(t,o,r,i,a,d){n("windowManager.createInstance(..)");var s=e.resolve(t);return new s(o,r,i,a,d)}})}}var i;e.util.Dispatcher=o,e.onBeforeUnload=new o(e,"BeforeUnload"),e.onAddEditor=new o(e,"AddEditor","editor"),e.onRemoveEditor=new o(e,"RemoveEditor","editor"),e.util.Cookie={get:t,getHash:t,remove:t,set:t,setHash:t},e.on("SetupEditor",r),e.PluginManager.add("compat3x",r),e.addI18n=function(t,n){var o=e.util.I18n,r=e.each;return"string"==typeof t&&-1===t.indexOf(".")?void o.add(t,n):void(e.is(t,"string")?r(n,function(e,n){o.data[t+"."+n]=e}):r(t,function(e,t){r(e,function(e,n){r(e,function(e,r){"common"===n?o.data[t+"."+r]=e:o.data[t+"."+n+"."+r]=e})})}))}}(tinymce); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/tiny_mce_popup.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/tiny_mce_popup.js deleted file mode 100644 index 9150f86..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/tiny_mce_popup.js +++ /dev/null @@ -1,539 +0,0 @@ -/** - * Popup.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -var tinymce, tinyMCE; - -/** - * TinyMCE popup/dialog helper class. This gives you easy access to the - * parent editor instance and a bunch of other things. It's higly recommended - * that you load this script into your dialogs. - * - * @static - * @class tinyMCEPopup - */ -var tinyMCEPopup = { - /** - * Initializes the popup this will be called automatically. - * - * @method init - */ - init: function() { - var self = this, parentWin, settings, uiWindow; - - // Find window & API - parentWin = self.getWin(); - tinymce = tinyMCE = parentWin.tinymce; - self.editor = tinymce.EditorManager.activeEditor; - self.params = self.editor.windowManager.getParams(); - - uiWindow = self.editor.windowManager.windows[self.editor.windowManager.windows.length - 1]; - self.features = uiWindow.features; - self.uiWindow = uiWindow; - - settings = self.editor.settings; - - // Setup popup CSS path(s) - if (settings.popup_css !== false) { - if (settings.popup_css) { - settings.popup_css = self.editor.documentBaseURI.toAbsolute(settings.popup_css); - } else { - settings.popup_css = self.editor.baseURI.toAbsolute("plugins/compat3x/css/dialog.css"); - } - } - - if (settings.popup_css_add) { - settings.popup_css += ',' + self.editor.documentBaseURI.toAbsolute(settings.popup_css_add); - } - - // Setup local DOM - self.dom = self.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document, { - ownEvents: true, - proxy: tinyMCEPopup._eventProxy - }); - - self.dom.bind(window, 'ready', self._onDOMLoaded, self); - - // Enables you to skip loading the default css - if (self.features.popup_css !== false) { - self.dom.loadCSS(self.features.popup_css || self.editor.settings.popup_css); - } - - // Setup on init listeners - self.listeners = []; - - /** - * Fires when the popup is initialized. - * - * @event onInit - * @param {tinymce.Editor} editor Editor instance. - * @example - * // Alerts the selected contents when the dialog is loaded - * tinyMCEPopup.onInit.add(function(ed) { - * alert(ed.selection.getContent()); - * }); - * - * // Executes the init method on page load in some object using the SomeObject scope - * tinyMCEPopup.onInit.add(SomeObject.init, SomeObject); - */ - self.onInit = { - add: function(func, scope) { - self.listeners.push({func : func, scope : scope}); - } - }; - - self.isWindow = !self.getWindowArg('mce_inline'); - self.id = self.getWindowArg('mce_window_id'); - }, - - /** - * Returns the reference to the parent window that opened the dialog. - * - * @method getWin - * @return {Window} Reference to the parent window that opened the dialog. - */ - getWin: function() { - // Added frameElement check to fix bug: #2817583 - return (!window.frameElement && window.dialogArguments) || opener || parent || top; - }, - - /** - * Returns a window argument/parameter by name. - * - * @method getWindowArg - * @param {String} name Name of the window argument to retrive. - * @param {String} defaultValue Optional default value to return. - * @return {String} Argument value or default value if it wasn't found. - */ - getWindowArg : function(name, defaultValue) { - var value = this.params[name]; - - return tinymce.is(value) ? value : defaultValue; - }, - - /** - * Returns a editor parameter/config option value. - * - * @method getParam - * @param {String} name Name of the editor config option to retrive. - * @param {String} defaultValue Optional default value to return. - * @return {String} Parameter value or default value if it wasn't found. - */ - getParam : function(name, defaultValue) { - return this.editor.getParam(name, defaultValue); - }, - - /** - * Returns a language item by key. - * - * @method getLang - * @param {String} name Language item like mydialog.something. - * @param {String} defaultValue Optional default value to return. - * @return {String} Language value for the item like "my string" or the default value if it wasn't found. - */ - getLang : function(name, defaultValue) { - return this.editor.getLang(name, defaultValue); - }, - - /** - * Executed a command on editor that opened the dialog/popup. - * - * @method execCommand - * @param {String} cmd Command to execute. - * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not. - * @param {Object} val Optional value to pass with the comman like an URL. - * @param {Object} a Optional arguments object. - */ - execCommand : function(cmd, ui, val, args) { - args = args || {}; - args.skip_focus = 1; - - this.restoreSelection(); - return this.editor.execCommand(cmd, ui, val, args); - }, - - /** - * Resizes the dialog to the inner size of the window. This is needed since various browsers - * have different border sizes on windows. - * - * @method resizeToInnerSize - */ - resizeToInnerSize : function() { - /*var self = this; - - // Detach it to workaround a Chrome specific bug - // https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281 - setTimeout(function() { - var vp = self.dom.getViewPort(window); - - self.editor.windowManager.resizeBy( - self.getWindowArg('mce_width') - vp.w, - self.getWindowArg('mce_height') - vp.h, - self.id || window - ); - }, 10);*/ - }, - - /** - * Will executed the specified string when the page has been loaded. This function - * was added for compatibility with the 2.x branch. - * - * @method executeOnLoad - * @param {String} evil String to evalutate on init. - */ - executeOnLoad : function(evil) { - this.onInit.add(function() { - eval(evil); - }); - }, - - /** - * Stores the current editor selection for later restoration. This can be useful since some browsers - * looses it's selection if a control element is selected/focused inside the dialogs. - * - * @method storeSelection - */ - storeSelection : function() { - this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1); - }, - - /** - * Restores any stored selection. This can be useful since some browsers - * looses it's selection if a control element is selected/focused inside the dialogs. - * - * @method restoreSelection - */ - restoreSelection : function() { - var self = tinyMCEPopup; - - if (!self.isWindow && tinymce.isIE) { - self.editor.selection.moveToBookmark(self.editor.windowManager.bookmark); - } - }, - - /** - * Loads a specific dialog language pack. If you pass in plugin_url as a argument - * when you open the window it will load the /langs/_dlg.js lang pack file. - * - * @method requireLangPack - */ - requireLangPack : function() { - var self = this, url = self.getWindowArg('plugin_url') || self.getWindowArg('theme_url'), settings = self.editor.settings, lang; - - if (settings.language !== false) { - lang = settings.language || "en"; - } - - if (url && lang && self.features.translate_i18n !== false && settings.language_load !== false) { - url += '/langs/' + lang + '_dlg.js'; - - if (!tinymce.ScriptLoader.isDone(url)) { - document.write(''); - tinymce.ScriptLoader.markDone(url); - } - } - }, - - /** - * Executes a color picker on the specified element id. When the user - * then selects a color it will be set as the value of the specified element. - * - * @method pickColor - * @param {DOMEvent} e DOM event object. - * @param {string} element_id Element id to be filled with the color value from the picker. - */ - pickColor : function(e, element_id) { - this.execCommand('mceColorPicker', true, { - color : document.getElementById(element_id).value, - func : function(c) { - document.getElementById(element_id).value = c; - - try { - document.getElementById(element_id).onchange(); - } catch (ex) { - // Try fire event, ignore errors - } - } - }); - }, - - /** - * Opens a filebrowser/imagebrowser this will set the output value from - * the browser as a value on the specified element. - * - * @method openBrowser - * @param {string} element_id Id of the element to set value in. - * @param {string} type Type of browser to open image/file/flash. - * @param {string} option Option name to get the file_broswer_callback function name from. - */ - openBrowser : function(element_id, type) { - tinyMCEPopup.restoreSelection(); - this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); - }, - - /** - * Creates a confirm dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method confirm - * @param {String} t Title for the new confirm dialog. - * @param {function} cb Callback function to be executed after the user has selected ok or cancel. - * @param {Object} s Optional scope to execute the callback in. - */ - confirm : function(t, cb, s) { - this.editor.windowManager.confirm(t, cb, s, window); - }, - - /** - * Creates a alert dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method alert - * @param {String} tx Title for the new alert dialog. - * @param {function} cb Callback function to be executed after the user has selected ok. - * @param {Object} s Optional scope to execute the callback in. - */ - alert : function(tx, cb, s) { - this.editor.windowManager.alert(tx, cb, s, window); - }, - - /** - * Closes the current window. - * - * @method close - */ - close : function() { - var t = this; - - // To avoid domain relaxing issue in Opera - function close() { - t.editor.windowManager.close(window); - tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup - } - - if (tinymce.isOpera) { - t.getWin().setTimeout(close, 0); - } else { - close(); - } - }, - - // Internal functions - - _restoreSelection : function() { - var e = window.event.srcElement; - - if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) { - tinyMCEPopup.restoreSelection(); - } - }, - -/* _restoreSelection : function() { - var e = window.event.srcElement; - - // If user focus a non text input or textarea - if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') - tinyMCEPopup.restoreSelection(); - },*/ - - _onDOMLoaded : function() { - var t = tinyMCEPopup, ti = document.title, h, nv; - - // Translate page - if (t.features.translate_i18n !== false) { - var map = { - "update": "Ok", - "insert": "Ok", - "cancel": "Cancel", - "not_set": "--", - "class_name": "Class name", - "browse": "Browse" - }; - - var langCode = tinymce.settings.language || 'en'; - for (var key in map) { - tinymce.i18n.data[langCode + "." + key] = tinymce.i18n.translate(map[key]); - } - - h = document.body.innerHTML; - - // Replace a=x with a="x" in IE - if (tinymce.isIE) { - h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"'); - } - - document.dir = t.editor.getParam('directionality',''); - - if ((nv = t.editor.translate(h)) && nv != h) { - document.body.innerHTML = nv; - } - - if ((nv = t.editor.translate(ti)) && nv != ti) { - document.title = ti = nv; - } - } - - if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow) { - t.dom.addClass(document.body, 'forceColors'); - } - - document.body.style.display = ''; - - // Restore selection in IE when focus is placed on a non textarea or input element of the type text - if (tinymce.Env.ie) { - if (tinymce.Env.ie < 11) { - document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); - - // Add base target element for it since it would fail with modal dialogs - t.dom.add(t.dom.select('head')[0], 'base', {target: '_self'}); - } else { - document.addEventListener('mouseup', tinyMCEPopup._restoreSelection, false); - } - } - - t.restoreSelection(); - t.resizeToInnerSize(); - - // Set inline title - if (!t.isWindow) { - t.editor.windowManager.setTitle(window, ti); - } else { - window.focus(); - } - - if (!tinymce.isIE && !t.isWindow) { - t.dom.bind(document, 'focus', function() { - t.editor.windowManager.focus(t.id); - }); - } - - // Patch for accessibility - tinymce.each(t.dom.select('select'), function(e) { - e.onkeydown = tinyMCEPopup._accessHandler; - }); - - // Call onInit - // Init must be called before focus so the selection won't get lost by the focus call - tinymce.each(t.listeners, function(o) { - o.func.call(o.scope, t.editor); - }); - - // Move focus to window - if (t.getWindowArg('mce_auto_focus', true)) { - window.focus(); - - // Focus element with mceFocus class - tinymce.each(document.forms, function(f) { - tinymce.each(f.elements, function(e) { - if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { - e.focus(); - return false; // Break loop - } - }); - }); - } - - document.onkeyup = tinyMCEPopup._closeWinKeyHandler; - - if ('textContent' in document) { - t.uiWindow.getEl('head').firstChild.textContent = document.title; - } else { - t.uiWindow.getEl('head').firstChild.innerText = document.title; - } - }, - - _accessHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 13 || e.keyCode == 32) { - var elm = e.target || e.srcElement; - - if (elm.onchange) { - elm.onchange(); - } - - return tinymce.dom.Event.cancel(e); - } - }, - - _closeWinKeyHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 27) { - tinyMCEPopup.close(); - } - }, - - _eventProxy: function(id) { - return function(evt) { - tinyMCEPopup.dom.events.callNativeHandler(id, evt); - }; - } -}; - -tinyMCEPopup.init(); - -tinymce.util.Dispatcher = function(scope) { - this.scope = scope || this; - this.listeners = []; - - this.add = function(callback, scope) { - this.listeners.push({cb : callback, scope : scope || this.scope}); - - return callback; - }; - - this.addToTop = function(callback, scope) { - var self = this, listener = {cb : callback, scope : scope || self.scope}; - - // Create new listeners if addToTop is executed in a dispatch loop - if (self.inDispatch) { - self.listeners = [listener].concat(self.listeners); - } else { - self.listeners.unshift(listener); - } - - return callback; - }; - - this.remove = function(callback) { - var listeners = this.listeners, output = null; - - tinymce.each(listeners, function(listener, i) { - if (callback == listener.cb) { - output = listener; - listeners.splice(i, 1); - return false; - } - }); - - return output; - }; - - this.dispatch = function() { - var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener; - - self.inDispatch = true; - - // Needs to be a real loop since the listener count might change while looping - // And this is also more efficient - for (i = 0; i < listeners.length; i++) { - listener = listeners[i]; - returnValue = listener.cb.apply(listener.scope, args.length > 0 ? args : [listener.scope]); - - if (returnValue === false) { - break; - } - } - - self.inDispatch = false; - - return returnValue; - }; -}; diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/utils/editable_selects.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/utils/editable_selects.js deleted file mode 100644 index 8d30787..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/compat3x/utils/editable_selects.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * editable_selects.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -var TinyMCE_EditableSelects = { - editSelectElm : null, - - init : function() { - var nl = document.getElementsByTagName("select"), i, d = document, o; - - for (i=0; i'; - h += ' '; - - return h; -} - -function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; -} - -function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); - - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCEPopup.dom.addClass(img, 'disabled'); - } else { - if (lnk.getAttribute("realhref")) - lnk.setAttribute("href", lnk.getAttribute("realhref")); - - tinyMCEPopup.dom.removeClass(img, 'disabled'); - } - } -} - -function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback", cb, html; - - cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); - - if (!cb) - return ""; - - html = ""; - html += ''; - html += ' '; - - return html; -} - -function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - - if (img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); -} - -function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - if (!value) - value = ""; - - var sel = form_obj.elements[field_name]; - - var found = false; - for (var i=0; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - n.setAttribute('aria-invalid', 'true'); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; i 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType$1(TEXT); + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + + var get = function (element, property) { + var dom = element.dom(); + var styles = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + + var getDirection = function (element) { + return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + var getNodeChangeHandler = function (editor, dir) { + return function (api) { + var nodeChangeHandler = function (e) { + var element = Element.fromDom(e.element); + api.setActive(getDirection(element) === dir); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('ltr', { + tooltip: 'Left to right', + icon: 'ltr', + onAction: function () { + return editor.execCommand('mceDirectionLTR'); + }, + onSetup: getNodeChangeHandler(editor, 'ltr') + }); + editor.ui.registry.addToggleButton('rtl', { + tooltip: 'Right to left', + icon: 'rtl', + onAction: function () { + return editor.execCommand('mceDirectionRTL'); + }, + onSetup: getNodeChangeHandler(editor, 'rtl') + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('directionality', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('directionality', function(editor) { - function setDir(dir) { - var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks(); - - if (blocks.length) { - curDir = dom.getAttrib(blocks[0], "dir"); - - tinymce.each(blocks, function(block) { - // Add dir to block if the parent block doesn't already have that dir - if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { - if (curDir != dir) { - dom.setAttrib(block, "dir", dir); - } else { - dom.setAttrib(block, "dir", null); - } - } - }); - - editor.nodeChanged(); - } - } - - function generateSelector(dir) { - var selector = []; - - tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) { - selector.push(name + '[dir=' + dir + ']'); - }); - - return selector.join(','); - } - - editor.addCommand('mceDirectionLTR', function() { - setDir("ltr"); - }); - - editor.addCommand('mceDirectionRTL', function() { - setDir("rtl"); - }); - - editor.addButton('ltr', { - title: 'Left to right', - cmd: 'mceDirectionLTR', - stateSelector: generateSelector('ltr') - }); - - editor.addButton('rtl', { - title: 'Right to left', - cmd: 'mceDirectionRTL', - stateSelector: generateSelector('rtl') - }); -}); \ No newline at end of file +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/directionality/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/directionality/plugin.min.js index 2994eb6..08f0a6a 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/directionality/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/directionality/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("directionality",function(t){function e(e){var i,n=t.dom,r=t.selection.getSelectedBlocks();r.length&&(i=n.getAttrib(r[0],"dir"),tinymce.each(r,function(t){n.getParent(t.parentNode,"*[dir='"+e+"']",n.getRoot())||(i!=e?n.setAttrib(t,"dir",e):n.setAttrib(t,"dir",null))}),t.nodeChanged())}function i(t){var e=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(i){e.push(i+"[dir="+t+"]")}),e.join(",")}t.addCommand("mceDirectionLTR",function(){e("ltr")}),t.addCommand("mceDirectionRTL",function(){e("rtl")}),t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:i("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:i("rtl")})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(i){"use strict";function n(){}function u(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){n.addCommand("mceDirectionLTR",function(){o(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){o(n,"rtl")})},f=u(!1),l=u(!0),a=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:l,getOr:s,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:s,orThunk:N,map:t,each:n,bind:t,exists:f,forall:l,filter:t,equals:m,equals_:m,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(e),e);function m(n){return n.isNone()}function N(n){return n()}function s(n){return n}function g(n,t){var e=n.dom(),r=i.window.getComputedStyle(e).getPropertyValue(t),o=""!==r||function(n){var t=A(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}(n)?r:w(e,t);return null===o?undefined:o}function T(t,r){return function(e){function n(n){var t=p.fromDom(n.element);e.setActive(function(n){return"rtl"===g(n,"direction")?"rtl":"ltr"}(t)===r)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}var E,O,y=function(e){function n(){return o}function t(n){return n(e)}var r=u(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return y(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return o},D=function(n){return null===n||n===undefined?a:y(n)},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},p={fromHtml:function(n,t){var e=(t||i.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1= max; + }; + }); + for (var i = 0; i < list.length; i++) { + if (pattern.length === 0 || emojiMatches(list[i], lowerCasePattern)) { + matches.push({ + value: list[i].char, + text: list[i].title, + icon: list[i].char + }); + if (reachedLimit(matches.length)) { + break; + } + } + } + return matches; + }; + + var init = function (editor, database) { + editor.ui.registry.addAutocompleter('emoticons', { + ch: ':', + columns: 'auto', + minChars: 2, + fetch: function (pattern, maxResults) { + return database.waitForLoad().then(function () { + var candidates = database.listAll(); + return emojisFrom(candidates, pattern, Option.some(maxResults)); + }); + }, + onAction: function (autocompleteApi, rng, value) { + editor.selection.setRng(rng); + editor.insertContent(value); + autocompleteApi.hide(); + } + }); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var last = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var insertEmoticon = function (editor, ch) { + editor.insertContent(ch); + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return nu; + }; + var baseMerge = function (merger) { + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var merge = baseMerge(shallow); + + var keys = Object.keys; + var hasOwnProperty$1 = Object.hasOwnProperty; + var each = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var map$1 = function (obj, f) { + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); + }; + var tupleMap = function (obj, f) { + var r = {}; + each(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var has = function (obj, key) { + return hasOwnProperty$1.call(obj, key); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.Resource'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var DEFAULT_ID = 'tinymce.plugins.emoticons'; + var getEmoticonDatabaseUrl = function (editor, pluginUrl) { + return editor.getParam('emoticons_database_url', pluginUrl + '/js/emojis' + editor.suffix + '.js'); + }; + var getEmoticonDatabaseId = function (editor) { + return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string'); + }; + var getAppendedEmoticons = function (editor) { + return editor.getParam('emoticons_append', {}, 'object'); + }; + var Settings = { + getEmoticonDatabaseUrl: getEmoticonDatabaseUrl, + getEmoticonDatabaseId: getEmoticonDatabaseId, + getAppendedEmoticons: getAppendedEmoticons + }; + + var ALL_CATEGORY = 'All'; + var categoryNameMap = { + symbols: 'Symbols', + people: 'People', + animals_and_nature: 'Animals and Nature', + food_and_drink: 'Food and Drink', + activity: 'Activity', + travel_and_places: 'Travel and Places', + objects: 'Objects', + flags: 'Flags', + user: 'User Defined' + }; + var translateCategory = function (categories, name) { + return has(categories, name) ? categories[name] : name; + }; + var getUserDefinedEmoticons = function (editor) { + var userDefinedEmoticons = Settings.getAppendedEmoticons(editor); + return map$1(userDefinedEmoticons, function (value) { + return __assign({ + keywords: [], + category: 'user' + }, value); + }); + }; + var initDatabase = function (editor, databaseUrl, databaseId) { + var categories = Cell(Option.none()); + var all = Cell(Option.none()); + var processEmojis = function (emojis) { + var cats = {}; + var everything = []; + each(emojis, function (lib, title) { + var entry = { + title: title, + keywords: lib.keywords, + char: lib.char, + category: translateCategory(categoryNameMap, lib.category) + }; + var current = cats[entry.category] !== undefined ? cats[entry.category] : []; + cats[entry.category] = current.concat([entry]); + everything.push(entry); + }); + categories.set(Option.some(cats)); + all.set(Option.some(everything)); + }; + editor.on('init', function () { + global$1.load(databaseId, databaseUrl).then(function (emojis) { + var userEmojis = getUserDefinedEmoticons(editor); + processEmojis(merge(emojis, userEmojis)); + }, function (err) { + domGlobals.console.log('Failed to load emoticons: ' + err); + categories.set(Option.some({})); + all.set(Option.some([])); + }); + }); + var listCategory = function (category) { + if (category === ALL_CATEGORY) { + return listAll(); + } + return categories.get().bind(function (cats) { + return Option.from(cats[category]); + }).getOr([]); + }; + var listAll = function () { + return all.get().getOr([]); + }; + var listCategories = function () { + return [ALL_CATEGORY].concat(keys(categories.get().getOr({}))); + }; + var waitForLoad = function () { + if (hasLoaded()) { + return global$3.resolve(true); + } else { + return new global$3(function (resolve, reject) { + var numRetries = 15; + var interval = global$2.setInterval(function () { + if (hasLoaded()) { + global$2.clearInterval(interval); + resolve(true); + } else { + numRetries--; + if (numRetries < 0) { + domGlobals.console.log('Could not load emojis from url: ' + databaseUrl); + global$2.clearInterval(interval); + reject(false); + } + } + }, 100); + }); + } + }; + var hasLoaded = function () { + return categories.get().isSome() && all.get().isSome(); + }; + return { + listCategories: listCategories, + hasLoaded: hasLoaded, + waitForLoad: waitForLoad, + listAll: listAll, + listCategory: listCategory + }; + }; + + var patternName = 'pattern'; + var open = function (editor, database) { + var initialState = { + pattern: '', + results: emojisFrom(database.listAll(), '', Option.some(300)) + }; + var currentTab = Cell(ALL_CATEGORY); + var scan = function (dialogApi) { + var dialogData = dialogApi.getData(); + var category = currentTab.get(); + var candidates = database.listCategory(category); + var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Option.some(300) : Option.none()); + dialogApi.setData({ results: results }); + }; + var updateFilter = last(function (dialogApi) { + scan(dialogApi); + }, 200); + var searchField = { + label: 'Search', + type: 'input', + name: patternName + }; + var resultsField = { + type: 'collection', + name: 'results' + }; + var getInitialState = function () { + var body = { + type: 'tabpanel', + tabs: map(database.listCategories(), function (cat) { + return { + title: cat, + name: cat, + items: [ + searchField, + resultsField + ] + }; + }) + }; + return { + title: 'Emoticons', + size: 'normal', + body: body, + initialData: initialState, + onTabChange: function (dialogApi, details) { + currentTab.set(details.newTabName); + updateFilter.throttle(dialogApi); + }, + onChange: updateFilter.throttle, + onAction: function (dialogApi, actionData) { + if (actionData.name === 'results') { + insertEmoticon(editor, actionData.value); + dialogApi.close(); + } + }, + buttons: [{ + type: 'cancel', + text: 'Close', + primary: true + }] + }; + }; + var dialogApi = editor.windowManager.open(getInitialState()); + dialogApi.focus(patternName); + if (!database.hasLoaded()) { + dialogApi.block('Loading emoticons...'); + database.waitForLoad().then(function () { + dialogApi.redial(getInitialState()); + updateFilter.throttle(dialogApi); + dialogApi.focus(patternName); + dialogApi.unblock(); + }).catch(function (err) { + dialogApi.redial({ + title: 'Emoticons', + body: { + type: 'panel', + items: [{ + type: 'alertbanner', + level: 'error', + icon: 'warning', + text: '

Could not load emoticons

' + }] + }, + buttons: [{ + type: 'cancel', + text: 'Close', + primary: true + }], + initialData: { + pattern: '', + results: [] + } + }); + dialogApi.focus(patternName); + dialogApi.unblock(); + }); + } + }; + var Dialog = { open: open }; + + var register = function (editor, database) { + var onAction = function () { + return Dialog.open(editor, database); + }; + editor.ui.registry.addButton('emoticons', { + tooltip: 'Emoticons', + icon: 'emoji', + onAction: onAction + }); + editor.ui.registry.addMenuItem('emoticons', { + text: 'Emoticons...', + icon: 'emoji', + onAction: onAction + }); + }; + var Buttons = { register: register }; + + function Plugin () { + global.add('emoticons', function (editor, pluginUrl) { + var databaseUrl = Settings.getEmoticonDatabaseUrl(editor, pluginUrl); + var databaseId = Settings.getEmoticonDatabaseId(editor); + var database = initDatabase(editor, databaseUrl, databaseId); + Buttons.register(editor, database); + init(editor, database); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('emoticons', function(editor, url) { - var emoticons = [ - ["cool", "cry", "embarassed", "foot-in-mouth"], - ["frown", "innocent", "kiss", "laughing"], - ["money-mouth", "sealed", "smile", "surprised"], - ["tongue-out", "undecided", "wink", "yell"] - ]; - - function getHtml() { - var emoticonsHtml; - - emoticonsHtml = ''; - - tinymce.each(emoticons, function(row) { - emoticonsHtml += ''; - - tinymce.each(row, function(icon) { - var emoticonUrl = url + '/img/smiley-' + icon + '.gif'; - - emoticonsHtml += ''; - }); - - emoticonsHtml += ''; - }); - - emoticonsHtml += '
'; - - return emoticonsHtml; - } - - editor.addButton('emoticons', { - type: 'panelbutton', - panel: { - role: 'application', - autohide: true, - html: getHtml, - onclick: function(e) { - var linkElm = editor.dom.getParent(e.target, 'a'); - - if (linkElm) { - editor.insertContent( - '' + linkElm.getAttribute('data-mce-alt') + '' - ); - - this.hide(); - } - } - }, - tooltip: 'Emoticons' - }); -}); +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/emoticons/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/emoticons/plugin.min.js index 737083f..5b94cac 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/emoticons/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/emoticons/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("emoticons",function(t,e){function a(){var t;return t='',tinymce.each(i,function(a){t+="",tinymce.each(a,function(a){var i=e+"/img/smiley-"+a+".gif";t+=''}),t+=""}),t+="
"}var i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];t.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:a,onclick:function(e){var a=t.dom.getParent(e.target,"a");a&&(t.insertContent(''+a.getAttribute('),this.hide())}},tooltip:"Emoticons"})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(l){"use strict";function n(){}function i(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=i(!1),u=i(!0),a=(e={fold:function(n,t){return n()},is:c,isSome:c,isNone:u,getOr:f,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:f,orThunk:s,map:t,each:n,bind:t,exists:c,forall:u,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(e),e);function o(n){return n.isNone()}function s(n){return n()}function f(n){return n}function m(n,t){return-1!==n.indexOf(t)}function g(n,t){return m(n.title.toLowerCase(),t)||function(n,t){for(var e=0,r=n.length;eCould not load emoticons

"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),a.focus(U),a.unblock()}))},B=function(n,t){function e(){return R(n,t)}n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function G(){r.add("emoticons",function(n,t){var e=F(n,t),r=q(n),o=h(n,e,r);B(n,o),function(r,o){r.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return d(n,t,A.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})}(n,o)})}()}(window); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/dialog.html b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/dialog.html deleted file mode 100644 index 565f06f..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/dialog.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -

Custom dialog

- Input some text: - - - \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/plugin.js deleted file mode 100644 index b3497cc..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/plugin.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint unused:false */ -/*global tinymce:true */ - -/** - * Example plugin that adds a toolbar button and menu item. - */ -tinymce.PluginManager.add('example', function(editor, url) { - // Add a button that opens a window - editor.addButton('example', { - text: 'My button', - icon: false, - onclick: function() { - // Open window - editor.windowManager.open({ - title: 'Example plugin', - body: [ - {type: 'textbox', name: 'title', label: 'Title'} - ], - onsubmit: function(e) { - // Insert content when the window form is submitted - editor.insertContent('Title: ' + e.data.title); - } - }); - } - }); - - // Adds a menu item to the tools menu - editor.addMenuItem('example', { - text: 'Example plugin', - context: 'tools', - onclick: function() { - // Open window with a specific url - editor.windowManager.open({ - title: 'TinyMCE site', - url: url + '/dialog.html', - width: 600, - height: 400, - buttons: [ - { - text: 'Insert', - onclick: function() { - // Top most window object - var win = editor.windowManager.getWindows()[0]; - - // Insert the contents of the dialog.html textarea into the editor - editor.insertContent(win.getContentWindow().document.getElementById('content').value); - - // Close the window - win.close(); - } - }, - - {text: 'Close', onclick: 'close'} - ] - }); - } - }); -}); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/plugin.min.js deleted file mode 100644 index 00a262e..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("example",function(t,e){t.addButton("example",{text:"My button",icon:!1,onclick:function(){t.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(e){t.insertContent("Title: "+e.data.title)}})}}),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:e+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var e=t.windowManager.getWindows()[0];t.insertContent(e.getContentWindow().document.getElementById("content").value),e.close()}},{text:"Close",onclick:"close"}]})}})}); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example_dependency/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example_dependency/plugin.js deleted file mode 100644 index 0e08a84..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example_dependency/plugin.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint unused:false */ -/*global tinymce:true */ - -/** - * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, - * with the list loaded in order. plugins in this list will be initialised when this plugin is initialized. (before the - * init method is called). plugins in a depends list should typically be specified using the short name). If necessary - * this can be done with an object which has the url to the plugin and the shortname. - */ -tinymce.PluginManager.add('example_dependency', function() { - // Example logic here -}, ['example']); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example_dependency/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example_dependency/plugin.min.js deleted file mode 100644 index e61bf47..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/example_dependency/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("example_dependency",function(){},["example"]); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.js index 4b071d4..5f6463b 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.js @@ -1,485 +1,568 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ - -/*global tinymce:true */ - -tinymce.PluginManager.add('fullpage', function(editor) { - var each = tinymce.each, Node = tinymce.html.Node; - var head, foot; - - function showDialog() { - var data = htmlToData(); - - editor.windowManager.open({ - title: 'Document properties', - data: data, - defaults: {type: 'textbox', size: 40}, - body: [ - {name: 'title', label: 'Title'}, - {name: 'keywords', label: 'Keywords'}, - {name: 'description', label: 'Description'}, - {name: 'robots', label: 'Robots'}, - {name: 'author', label: 'Author'}, - {name: 'docencoding', label: 'Encoding'} - ], - onSubmit: function(e) { - dataToHtml(tinymce.extend(data, e.data)); - } - }); - } - - function htmlToData() { - var headerFragment = parseHeader(), data = {}, elm, matches; - - function getAttr(elm, name) { - var value = elm.attr(name); - - return value || ''; - } - - // Default some values - data.fontface = editor.getParam("fullpage_default_fontface", ""); - data.fontsize = editor.getParam("fullpage_default_fontsize", ""); - - // Parse XML PI - elm = headerFragment.firstChild; - if (elm.type == 7) { - data.xml_pi = true; - matches = /encoding="([^"]+)"/.exec(elm.value); - if (matches) { - data.docencoding = matches[1]; - } - } - - // Parse doctype - elm = headerFragment.getAll('#doctype')[0]; - if (elm) { - data.doctype = '"; - } - - // Parse title element - elm = headerFragment.getAll('title')[0]; - if (elm && elm.firstChild) { - data.title = elm.firstChild.value; - } - - // Parse meta elements - each(headerFragment.getAll('meta'), function(meta) { - var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; - - if (name) { - data[name.toLowerCase()] = meta.attr('content'); - } else if (httpEquiv == "Content-Type") { - matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); - - if (matches) { - data.docencoding = matches[1]; - } - } - }); - - // Parse html attribs - elm = headerFragment.getAll('html')[0]; - if (elm) { - data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); - } - - // Parse stylesheets - data.stylesheets = []; - tinymce.each(headerFragment.getAll('link'), function(link) { - if (link.attr('rel') == 'stylesheet') { - data.stylesheets.push(link.attr('href')); - } - }); - - // Parse body parts - elm = headerFragment.getAll('body')[0]; - if (elm) { - data.langdir = getAttr(elm, 'dir'); - data.style = getAttr(elm, 'style'); - data.visited_color = getAttr(elm, 'vlink'); - data.link_color = getAttr(elm, 'link'); - data.active_color = getAttr(elm, 'alink'); - } - - return data; - } - - function dataToHtml(data) { - var headerFragment, headElement, html, elm, value, dom = editor.dom; - - function setAttr(elm, name, value) { - elm.attr(name, value ? value : undefined); - } - - function addHeadNode(node) { - if (headElement.firstChild) { - headElement.insert(node, headElement.firstChild); - } else { - headElement.append(node); - } - } - - headerFragment = parseHeader(); - headElement = headerFragment.getAll('head')[0]; - if (!headElement) { - elm = headerFragment.getAll('html')[0]; - headElement = new Node('head', 1); - - if (elm.firstChild) { - elm.insert(headElement, elm.firstChild, true); - } else { - elm.append(headElement); - } - } - - // Add/update/remove XML-PI - elm = headerFragment.firstChild; - if (data.xml_pi) { - value = 'version="1.0"'; - - if (data.docencoding) { - value += ' encoding="' + data.docencoding + '"'; - } - - if (elm.type != 7) { - elm = new Node('xml', 7); - headerFragment.insert(elm, headerFragment.firstChild, true); - } - - elm.value = value; - } else if (elm && elm.type == 7) { - elm.remove(); - } - - // Add/update/remove doctype - elm = headerFragment.getAll('#doctype')[0]; - if (data.doctype) { - if (!elm) { - elm = new Node('#doctype', 10); - - if (data.xml_pi) { - headerFragment.insert(elm, headerFragment.firstChild); - } else { - addHeadNode(elm); - } - } - - elm.value = data.doctype.substring(9, data.doctype.length - 1); - } else if (elm) { - elm.remove(); - } - - // Add meta encoding - elm = null; - each(headerFragment.getAll('meta'), function(meta) { - if (meta.attr('http-equiv') == 'Content-Type') { - elm = meta; - } - }); - - if (data.docencoding) { - if (!elm) { - elm = new Node('meta', 1); - elm.attr('http-equiv', 'Content-Type'); - elm.shortEnded = true; - addHeadNode(elm); - } - - elm.attr('content', 'text/html; charset=' + data.docencoding); - } else { - elm.remove(); - } - - // Add/update/remove title - elm = headerFragment.getAll('title')[0]; - if (data.title) { - if (!elm) { - elm = new Node('title', 1); - addHeadNode(elm); - } else { - elm.empty(); - } - - elm.append(new Node('#text', 3)).value = data.title; - } else if (elm) { - elm.remove(); - } - - // Add/update/remove meta - each('keywords,description,author,copyright,robots'.split(','), function(name) { - var nodes = headerFragment.getAll('meta'), i, meta, value = data[name]; - - for (i = 0; i < nodes.length; i++) { - meta = nodes[i]; - - if (meta.attr('name') == name) { - if (value) { - meta.attr('content', value); - } else { - meta.remove(); - } - - return; - } - } - - if (value) { - elm = new Node('meta', 1); - elm.attr('name', name); - elm.attr('content', value); - elm.shortEnded = true; - - addHeadNode(elm); - } - }); - - var currentStyleSheetsMap = {}; - tinymce.each(headerFragment.getAll('link'), function(stylesheet) { - if (stylesheet.attr('rel') == 'stylesheet') { - currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet; - } - }); - - // Add new - tinymce.each(data.stylesheets, function(stylesheet) { - if (!currentStyleSheetsMap[stylesheet]) { - elm = new Node('link', 1); - elm.attr({ - rel: 'stylesheet', - text: 'text/css', - href: stylesheet - }); - elm.shortEnded = true; - addHeadNode(elm); - } - - delete currentStyleSheetsMap[stylesheet]; - }); - - // Delete old - tinymce.each(currentStyleSheetsMap, function(stylesheet) { - stylesheet.remove(); - }); - - // Update body attributes - elm = headerFragment.getAll('body')[0]; - if (elm) { - setAttr(elm, 'dir', data.langdir); - setAttr(elm, 'style', data.style); - setAttr(elm, 'vlink', data.visited_color); - setAttr(elm, 'link', data.link_color); - setAttr(elm, 'alink', data.active_color); - - // Update iframe body as well - dom.setAttribs(editor.getBody(), { - style : data.style, - dir : data.dir, - vLink : data.visited_color, - link : data.link_color, - aLink : data.active_color - }); - } - - // Set html attributes - elm = headerFragment.getAll('html')[0]; - if (elm) { - setAttr(elm, 'lang', data.langcode); - setAttr(elm, 'xml:lang', data.langcode); - } - - // No need for a head element - if (!headElement.firstChild) { - headElement.remove(); - } - - // Serialize header fragment and crop away body part - html = new tinymce.html.Serializer({ - validate: false, - indent: true, - apply_source_formatting : true, - indent_before: 'head,html,body,meta,title,script,link,style', - indent_after: 'head,html,body,meta,title,script,link,style' - }).serialize(headerFragment); - - head = html.substring(0, html.indexOf('')); - } - - function parseHeader() { - // Parse the contents with a DOM parser - return new tinymce.html.DomParser({ - validate: false, - root_name: '#document' - }).parse(head); - } - - function setContent(evt) { - var startPos, endPos, content = evt.content, headerFragment, styles = '', dom = editor.dom, elm; - - if (evt.selection) { - return; - } - - function low(s) { - return s.replace(/<\/?[A-Z]+/g, function(a) { - return a.toLowerCase(); - }); - } - - // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (evt.format == 'raw' && head) { - return; - } - - if (evt.source_view && editor.getParam('fullpage_hide_in_source_view')) { - return; - } - - // Parse out head, body and footer - content = content.replace(/<(\/?)BODY/gi, '<$1body'); - startPos = content.indexOf('', startPos); - head = low(content.substring(0, startPos + 1)); - - endPos = content.indexOf('\n'; - } - - header += editor.getParam('fullpage_default_doctype', ''); - header += '\n\n\n'; - - if ((value = editor.getParam('fullpage_default_title'))) { - header += '' + value + '\n'; - } - - if ((value = editor.getParam('fullpage_default_encoding'))) { - header += '\n'; - } - - if ((value = editor.getParam('fullpage_default_font_family'))) { - styles += 'font-family: ' + value + ';'; - } - - if ((value = editor.getParam('fullpage_default_font_size'))) { - styles += 'font-size: ' + value + ';'; - } - - if ((value = editor.getParam('fullpage_default_text_color'))) { - styles += 'color: ' + value + ';'; - } - - header += '\n\n'; - - return header; - } - - function getContent(evt) { - if (!evt.selection && (!evt.source_view || !editor.getParam('fullpage_hide_in_source_view'))) { - evt.content = tinymce.trim(head) + '\n' + tinymce.trim(evt.content) + '\n' + tinymce.trim(foot); - } - } - - editor.addCommand('mceFullPageProperties', showDialog); - - editor.addButton('fullpage', { - title: 'Document properties', - cmd : 'mceFullPageProperties' - }); - - editor.addMenuItem('fullpage', { - text: 'Document properties', - cmd : 'mceFullPageProperties', - context: 'file' - }); - - editor.on('BeforeSetContent', setContent); - editor.on('GetContent', getContent); -}); +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.html.Serializer'); + + var shouldHideInSourceView = function (editor) { + return editor.getParam('fullpage_hide_in_source_view'); + }; + var getDefaultXmlPi = function (editor) { + return editor.getParam('fullpage_default_xml_pi'); + }; + var getDefaultEncoding = function (editor) { + return editor.getParam('fullpage_default_encoding'); + }; + var getDefaultFontFamily = function (editor) { + return editor.getParam('fullpage_default_font_family'); + }; + var getDefaultFontSize = function (editor) { + return editor.getParam('fullpage_default_font_size'); + }; + var getDefaultTextColor = function (editor) { + return editor.getParam('fullpage_default_text_color'); + }; + var getDefaultTitle = function (editor) { + return editor.getParam('fullpage_default_title'); + }; + var getDefaultDocType = function (editor) { + return editor.getParam('fullpage_default_doctype', ''); + }; + var Settings = { + shouldHideInSourceView: shouldHideInSourceView, + getDefaultXmlPi: getDefaultXmlPi, + getDefaultEncoding: getDefaultEncoding, + getDefaultFontFamily: getDefaultFontFamily, + getDefaultFontSize: getDefaultFontSize, + getDefaultTextColor: getDefaultTextColor, + getDefaultTitle: getDefaultTitle, + getDefaultDocType: getDefaultDocType + }; + + var parseHeader = function (head) { + return global$2({ + validate: false, + root_name: '#document' + }).parse(head, { format: 'xhtml' }); + }; + var htmlToData = function (editor, head) { + var headerFragment = parseHeader(head); + var data = {}; + var elm, matches; + function getAttr(elm, name) { + var value = elm.attr(name); + return value || ''; + } + data.fontface = Settings.getDefaultFontFamily(editor); + data.fontsize = Settings.getDefaultFontSize(editor); + elm = headerFragment.firstChild; + if (elm.type === 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) { + data.docencoding = matches[1]; + } + } + elm = headerFragment.getAll('#doctype')[0]; + if (elm) { + data.doctype = ''; + } + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.title = elm.firstChild.value; + } + global$1.each(headerFragment.getAll('meta'), function (meta) { + var name = meta.attr('name'); + var httpEquiv = meta.attr('http-equiv'); + var matches; + if (name) { + data[name.toLowerCase()] = meta.attr('content'); + } else if (httpEquiv === 'Content-Type') { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + if (matches) { + data.docencoding = matches[1]; + } + } + }); + elm = headerFragment.getAll('html')[0]; + if (elm) { + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + } + data.stylesheets = []; + global$1.each(headerFragment.getAll('link'), function (link) { + if (link.attr('rel') === 'stylesheet') { + data.stylesheets.push(link.attr('href')); + } + }); + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + return data; + }; + var dataToHtml = function (editor, data, head) { + var headerFragment, headElement, html, elm, value; + var dom = editor.dom; + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + } + function addHeadNode(node) { + if (headElement.firstChild) { + headElement.insert(node, headElement.firstChild); + } else { + headElement.append(node); + } + } + headerFragment = parseHeader(head); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new global$3('head', 1); + if (elm.firstChild) { + elm.insert(headElement, elm.firstChild, true); + } else { + elm.append(headElement); + } + } + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + if (data.docencoding) { + value += ' encoding="' + data.docencoding + '"'; + } + if (elm.type !== 7) { + elm = new global$3('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + elm.value = value; + } else if (elm && elm.type === 7) { + elm.remove(); + } + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new global$3('#doctype', 10); + if (data.xml_pi) { + headerFragment.insert(elm, headerFragment.firstChild); + } else { + addHeadNode(elm); + } + } + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) { + elm.remove(); + } + elm = null; + global$1.each(headerFragment.getAll('meta'), function (meta) { + if (meta.attr('http-equiv') === 'Content-Type') { + elm = meta; + } + }); + if (data.docencoding) { + if (!elm) { + elm = new global$3('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + elm.attr('content', 'text/html; charset=' + data.docencoding); + } else if (elm) { + elm.remove(); + } + elm = headerFragment.getAll('title')[0]; + if (data.title) { + if (!elm) { + elm = new global$3('title', 1); + addHeadNode(elm); + } else { + elm.empty(); + } + elm.append(new global$3('#text', 3)).value = data.title; + } else if (elm) { + elm.remove(); + } + global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) { + var nodes = headerFragment.getAll('meta'); + var i, meta; + var value = data[name]; + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + if (meta.attr('name') === name) { + if (value) { + meta.attr('content', value); + } else { + meta.remove(); + } + return; + } + } + if (value) { + elm = new global$3('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + addHeadNode(elm); + } + }); + var currentStyleSheetsMap = {}; + global$1.each(headerFragment.getAll('link'), function (stylesheet) { + if (stylesheet.attr('rel') === 'stylesheet') { + currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet; + } + }); + global$1.each(data.stylesheets, function (stylesheet) { + if (!currentStyleSheetsMap[stylesheet]) { + elm = new global$3('link', 1); + elm.attr({ + rel: 'stylesheet', + text: 'text/css', + href: stylesheet + }); + elm.shortEnded = true; + addHeadNode(elm); + } + delete currentStyleSheetsMap[stylesheet]; + }); + global$1.each(currentStyleSheetsMap, function (stylesheet) { + stylesheet.remove(); + }); + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + dom.setAttribs(editor.getBody(), { + style: data.style, + dir: data.dir, + vLink: data.visited_color, + link: data.link_color, + aLink: data.active_color + }); + } + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + if (!headElement.firstChild) { + headElement.remove(); + } + html = global$4({ + validate: false, + indent: true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + return html.substring(0, html.indexOf('')); + }; + var Parser = { + parseHeader: parseHeader, + htmlToData: htmlToData, + dataToHtml: dataToHtml + }; + + var open = function (editor, headState) { + var data = Parser.htmlToData(editor, headState.get()); + var defaultData = { + title: '', + keywords: '', + description: '', + robots: '', + author: '', + docencoding: '' + }; + var initialData = __assign(__assign({}, defaultData), data); + editor.windowManager.open({ + title: 'Metadata and Document Properties', + size: 'normal', + body: { + type: 'panel', + items: [ + { + name: 'title', + type: 'input', + label: 'Title' + }, + { + name: 'keywords', + type: 'input', + label: 'Keywords' + }, + { + name: 'description', + type: 'input', + label: 'Description' + }, + { + name: 'robots', + type: 'input', + label: 'Robots' + }, + { + name: 'author', + type: 'input', + label: 'Author' + }, + { + name: 'docencoding', + type: 'input', + label: 'Encoding' + } + ] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onSubmit: function (api) { + var nuData = api.getData(); + var headHtml = Parser.dataToHtml(editor, global$1.extend(data, nuData), headState.get()); + headState.set(headHtml); + api.close(); + } + }); + }; + var Dialog = { open: open }; + + var register = function (editor, headState) { + editor.addCommand('mceFullPageProperties', function () { + Dialog.open(editor, headState); + }); + }; + var Commands = { register: register }; + + var protectHtml = function (protect, html) { + global$1.each(protect, function (pattern) { + html = html.replace(pattern, function (str) { + return ''; + }); + }); + return html; + }; + var unprotectHtml = function (html) { + return html.replace(//g, function (a, m) { + return unescape(m); + }); + }; + var Protect = { + protectHtml: protectHtml, + unprotectHtml: unprotectHtml + }; + + var each = global$1.each; + var low = function (s) { + return s.replace(/<\/?[A-Z]+/g, function (a) { + return a.toLowerCase(); + }); + }; + var handleSetContent = function (editor, headState, footState, evt) { + var startPos, endPos, content, headerFragment, styles = ''; + var dom = editor.dom; + if (evt.selection) { + return; + } + content = Protect.protectHtml(editor.settings.protect, evt.content); + if (evt.format === 'raw' && headState.get()) { + return; + } + if (evt.source_view && Settings.shouldHideInSourceView(editor)) { + return; + } + if (content.length === 0 && !evt.source_view) { + content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get()); + } + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + headState.set(low(content.substring(0, startPos + 1))); + endPos = content.indexOf('\n'); + } + headerFragment = Parser.parseHeader(headState.get()); + each(headerFragment.getAll('style'), function (node) { + if (node.firstChild) { + styles += node.firstChild.value; + } + }); + var bodyElm = headerFragment.getAll('body')[0]; + if (bodyElm) { + dom.setAttribs(editor.getBody(), { + style: bodyElm.attr('style') || '', + dir: bodyElm.attr('dir') || '', + vLink: bodyElm.attr('vlink') || '', + link: bodyElm.attr('link') || '', + aLink: bodyElm.attr('alink') || '' + }); + } + dom.remove('fullpage_styles'); + var headElm = editor.getDoc().getElementsByTagName('head')[0]; + if (styles) { + var styleElm = dom.add(headElm, 'style', { id: 'fullpage_styles' }); + styleElm.appendChild(domGlobals.document.createTextNode(styles)); + } + var currentStyleSheetsMap = {}; + global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) { + if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) { + currentStyleSheetsMap[stylesheet.href] = stylesheet; + } + }); + global$1.each(headerFragment.getAll('link'), function (stylesheet) { + var href = stylesheet.attr('href'); + if (!href) { + return true; + } + if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') { + dom.add(headElm, 'link', { + 'rel': 'stylesheet', + 'text': 'text/css', + 'href': href, + 'data-mce-fullpage': '1' + }); + } + delete currentStyleSheetsMap[href]; + }); + global$1.each(currentStyleSheetsMap, function (stylesheet) { + stylesheet.parentNode.removeChild(stylesheet); + }); + }; + var getDefaultHeader = function (editor) { + var header = '', value, styles = ''; + if (Settings.getDefaultXmlPi(editor)) { + var piEncoding = Settings.getDefaultEncoding(editor); + header += '\n'; + } + header += Settings.getDefaultDocType(editor); + header += '\n\n\n'; + if (value = Settings.getDefaultTitle(editor)) { + header += '' + value + '\n'; + } + if (value = Settings.getDefaultEncoding(editor)) { + header += '\n'; + } + if (value = Settings.getDefaultFontFamily(editor)) { + styles += 'font-family: ' + value + ';'; + } + if (value = Settings.getDefaultFontSize(editor)) { + styles += 'font-size: ' + value + ';'; + } + if (value = Settings.getDefaultTextColor(editor)) { + styles += 'color: ' + value + ';'; + } + header += '\n\n'; + return header; + }; + var handleGetContent = function (editor, head, foot, evt) { + if (!evt.selection && (!evt.source_view || !Settings.shouldHideInSourceView(editor))) { + evt.content = Protect.unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot)); + } + }; + var setup = function (editor, headState, footState) { + editor.on('BeforeSetContent', function (evt) { + handleSetContent(editor, headState, footState, evt); + }); + editor.on('GetContent', function (evt) { + handleGetContent(editor, headState.get(), footState.get(), evt); + }); + }; + var FilterContent = { setup: setup }; + + var register$1 = function (editor) { + editor.ui.registry.addButton('fullpage', { + tooltip: 'Metadata and document properties', + icon: 'document-properties', + onAction: function () { + editor.execCommand('mceFullPageProperties'); + } + }); + editor.ui.registry.addMenuItem('fullpage', { + text: 'Metadata and document properties', + icon: 'document-properties', + onAction: function () { + editor.execCommand('mceFullPageProperties'); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('fullpage', function (editor) { + var headState = Cell(''), footState = Cell(''); + Commands.register(editor, headState); + Buttons.register(editor); + FilterContent.setup(editor, headState, footState); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.min.js index 1da17c9..da5f5bf 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullpage/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){l(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,l,a=i(),r={};return r.fontface=e.getParam("fullpage_default_fontface",""),r.fontsize=e.getParam("fullpage_default_fontsize",""),n=a.firstChild,7==n.type&&(r.xml_pi=!0,l=/encoding="([^"]+)"/.exec(n.value),l&&(r.docencoding=l[1])),n=a.getAll("#doctype")[0],n&&(r.doctype=""),n=a.getAll("title")[0],n&&n.firstChild&&(r.title=n.firstChild.value),s(a.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?r[n.toLowerCase()]=e.attr("content"):"Content-Type"==l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(r.docencoding=t[1]))}),n=a.getAll("html")[0],n&&(r.langcode=t(n,"lang")||t(n,"xml:lang")),r.stylesheets=[],tinymce.each(a.getAll("link"),function(e){"stylesheet"==e.attr("rel")&&r.stylesheets.push(e.attr("href"))}),n=a.getAll("body")[0],n&&(r.langdir=t(n,"dir"),r.style=t(n,"style"),r.visited_color=t(n,"vlink"),r.link_color=t(n,"link"),r.active_color=t(n,"alink")),r}function l(t){function n(e,t,n){e.attr(t,n?n:void 0)}function l(e){r.firstChild?r.insert(e,r.firstChild):r.append(e)}var a,r,o,c,u,f=e.dom;a=i(),r=a.getAll("head")[0],r||(c=a.getAll("html")[0],r=new m("head",1),c.firstChild?c.insert(r,c.firstChild,!0):c.append(r)),c=a.firstChild,t.xml_pi?(u='version="1.0"',t.docencoding&&(u+=' encoding="'+t.docencoding+'"'),7!=c.type&&(c=new m("xml",7),a.insert(c,a.firstChild,!0)),c.value=u):c&&7==c.type&&c.remove(),c=a.getAll("#doctype")[0],t.doctype?(c||(c=new m("#doctype",10),t.xml_pi?a.insert(c,a.firstChild):l(c)),c.value=t.doctype.substring(9,t.doctype.length-1)):c&&c.remove(),c=null,s(a.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(c=e)}),t.docencoding?(c||(c=new m("meta",1),c.attr("http-equiv","Content-Type"),c.shortEnded=!0,l(c)),c.attr("content","text/html; charset="+t.docencoding)):c.remove(),c=a.getAll("title")[0],t.title?(c?c.empty():(c=new m("title",1),l(c)),c.append(new m("#text",3)).value=t.title):c&&c.remove(),s("keywords,description,author,copyright,robots".split(","),function(e){var n,i,r=a.getAll("meta"),o=t[e];for(n=0;n"))}function i(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(d)}function a(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var l,a,o,m,u=t.content,f="",g=e.dom;if(!t.selection&&!("raw"==t.format&&d||t.source_view&&e.getParam("fullpage_hide_in_source_view"))){u=u.replace(/<(\/?)BODY/gi,"<$1body"),l=u.indexOf("",l),d=n(u.substring(0,l+1)),a=u.indexOf("\n"),o=i(),s(o.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),m=o.getAll("body")[0],m&&g.setAttribs(e.getBody(),{style:m.attr("style")||"",dir:m.attr("dir")||"",vLink:m.attr("vlink")||"",link:m.attr("link")||"",aLink:m.attr("alink")||""}),g.remove("fullpage_styles");var y=e.getDoc().getElementsByTagName("head")[0];f&&(g.add(y,"style",{id:"fullpage_styles"},f),m=g.get("fullpage_styles"),m.styleSheet&&(m.styleSheet.cssText=f));var h={};tinymce.each(y.getElementsByTagName("link"),function(e){"stylesheet"==e.rel&&e.getAttribute("data-mce-fullpage")&&(h[e.href]=e)}),tinymce.each(o.getAll("link"),function(e){var t=e.attr("href");h[t]||"stylesheet"!=e.attr("rel")||g.add(y,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete h[t]}),tinymce.each(h,function(e){e.parentNode.removeChild(e)})}}function r(){var t,n="",l="";return e.getParam("fullpage_default_xml_pi")&&(n+='\n'),n+=e.getParam("fullpage_default_doctype",""),n+="\n\n\n",(t=e.getParam("fullpage_default_title"))&&(n+=""+t+"\n"),(t=e.getParam("fullpage_default_encoding"))&&(n+='\n'),(t=e.getParam("fullpage_default_font_family"))&&(l+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+="\n\n"}function o(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(d)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(c))}var d,c,s=tinymce.each,m=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",a),e.on("GetContent",o)}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(m){"use strict";function f(t){return n({validate:!1,root_name:"#document"}).parse(t,{format:"xhtml"})}function g(t){return t.replace(/<\/?[A-Z]+/g,function(t){return t.toLowerCase()})}var i=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return i(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return(e=Object.assign||function(t){for(var e,n=1,i=arguments.length;n")},_=f,b=function(t,e){var n,i,l=f(e),r={};function o(t,e){return t.attr(e)||""}return r.fontface=a(t),r.fontsize=c(t),7===(n=l.firstChild).type&&(r.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(n.value))&&(r.docencoding=i[1])),(n=l.getAll("#doctype")[0])&&(r.doctype=""),(n=l.getAll("title")[0])&&n.firstChild&&(r.title=n.firstChild.value),p.each(l.getAll("meta"),function(t){var e,n=t.attr("name"),i=t.attr("http-equiv");n?r[n.toLowerCase()]=t.attr("content"):"Content-Type"===i&&(e=/charset\s*=\s*(.*)\s*/gi.exec(t.attr("content")))&&(r.docencoding=e[1])}),(n=l.getAll("html")[0])&&(r.langcode=o(n,"lang")||o(n,"xml:lang")),r.stylesheets=[],p.each(l.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&r.stylesheets.push(t.attr("href"))}),(n=l.getAll("body")[0])&&(r.langdir=o(n,"dir"),r.style=o(n,"style"),r.visited_color=o(n,"vlink"),r.link_color=o(n,"link"),r.active_color=o(n,"alink")),r},x=function(t,r,e){var o,n,i,a,l,c=t.dom;function s(t,e,n){t.attr(e,n||undefined)}function u(t){n.firstChild?n.insert(t,n.firstChild):n.append(t)}o=f(e),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new y("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,r.xml_pi?(l='version="1.0"',r.docencoding&&(l+=' encoding="'+r.docencoding+'"'),7!==a.type&&(a=new y("xml",7),o.insert(a,o.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],r.doctype?(a||(a=new y("#doctype",10),r.xml_pi?o.insert(a,o.firstChild):u(a)),a.value=r.doctype.substring(9,r.doctype.length-1)):a&&a.remove(),a=null,p.each(o.getAll("meta"),function(t){"Content-Type"===t.attr("http-equiv")&&(a=t)}),r.docencoding?(a||((a=new y("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,u(a)),a.attr("content","text/html; charset="+r.docencoding)):a&&a.remove(),a=o.getAll("title")[0],r.title?(a?a.empty():u(a=new y("title",1)),a.append(new y("#text",3)).value=r.title):a&&a.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(t){var e,n,i=o.getAll("meta"),l=r[t];for(e=0;e"))},l=function(i,l){var r=b(i,l.get()),t=e(e({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),r);i.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:t,onSubmit:function(t){var e=t.getData(),n=x(i,p.extend(r,e),l.get());l.set(n),t.close()}})},k=function(t,e){t.addCommand("mceFullPageProperties",function(){l(t,e)})},C=function(t,e){return p.each(t,function(t){e=e.replace(t,function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"})}),e},A=function(t){return t.replace(//g,function(t,e){return unescape(e)})},w=p.each,P=function(t){var e,n="",i="";if(r(t)){var l=o(t);n+='\n'}return n+=d(t),n+="\n\n\n",(e=u(t))&&(n+=""+e+"\n"),(e=o(t))&&(n+='\n'),(e=a(t))&&(i+="font-family: "+e+";"),(e=c(t))&&(i+="font-size: "+e+";"),(e=s(t))&&(i+="color: "+e+";"),n+="\n\n"},T=function(e,n,i){e.on("BeforeSetContent",function(t){!function(t,e,n,i){var l,r,o,a,c="",s=t.dom;if(!(i.selection||(o=C(t.settings.protect,i.content),"raw"===i.format&&e.get()||i.source_view&&v(t)))){0!==o.length||i.source_view||(o=p.trim(e.get())+"\n"+p.trim(o)+"\n"+p.trim(n.get())),-1!==(l=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",l),e.set(g(o.substring(0,l+1))),-1===(r=o.indexOf("\n")),a=_(e.get()),w(a.getAll("style"),function(t){t.firstChild&&(c+=t.firstChild.value)});var u=a.getAll("body")[0];u&&s.setAttribs(t.getBody(),{style:u.attr("style")||"",dir:u.attr("dir")||"",vLink:u.attr("vlink")||"",link:u.attr("link")||"",aLink:u.attr("alink")||""}),s.remove("fullpage_styles");var d=t.getDoc().getElementsByTagName("head")[0];if(c)s.add(d,"style",{id:"fullpage_styles"}).appendChild(m.document.createTextNode(c));var f={};p.each(d.getElementsByTagName("link"),function(t){"stylesheet"===t.rel&&t.getAttribute("data-mce-fullpage")&&(f[t.href]=t)}),p.each(a.getAll("link"),function(t){var e=t.attr("href");if(!e)return!0;f[e]||"stylesheet"!==t.attr("rel")||s.add(d,"link",{rel:"stylesheet",text:"text/css",href:e,"data-mce-fullpage":"1"}),delete f[e]}),p.each(f,function(t){t.parentNode.removeChild(t)})}}(e,n,i,t)}),e.on("GetContent",function(t){!function(t,e,n,i){i.selection||i.source_view&&v(t)||(i.content=A(p.trim(e)+"\n"+p.trim(i.content)+"\n"+p.trim(n)))}(e,n.get(),i.get(),t)})},O=function(t){t.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),t.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}})};!function D(){t.add("fullpage",function(t){var e=i(""),n=i("");k(t,e),O(t),T(t,e,n)})}()}(window); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.js index e518701..4be4ade 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.js @@ -1,136 +1,1192 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var get = function (fullscreenState) { + return { + isFullscreen: function () { + return fullscreenState.get() !== null; + } + }; + }; + var Api = { get: get }; + + var noop = function () { + }; + var compose = function (fa, fb) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var revocable = function (doRevoke) { + var subject = Cell(Option.none()); + var revoke = function () { + subject.get().each(doRevoke); + }; + var clear = function () { + revoke(); + subject.set(Option.none()); + }; + var set = function (s) { + revoke(); + subject.set(Option.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + isSet: isSet, + set: set + }; + }; + var unbindable = function () { + return revocable(function (s) { + s.unbind(); + }); + }; + var value = function () { + var subject = Cell(Option.none()); + var clear = function () { + subject.set(Option.none()); + }; + var set = function (s) { + subject.set(Option.some(s)); + }; + var on = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var keys = Object.keys; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + + var contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType$1(TEXT); + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom(), key, value); + }; + var get$1 = function (element, key) { + var v = element.dom().getAttribute(key); + return v === null ? undefined : v; + }; + var remove = function (element, key) { + element.dom().removeAttribute(key); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } + }; + var setAll = function (element, css) { + var dom = element.dom(); + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$2 = function (element, property) { + var dom = element.dom(); + var styles = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: constant(target), + x: constant(x), + y: constant(y), + stop: stop, + prevent: prevent, + kill: kill, + raw: constant(raw) + }; + }; + var fromRawEvent = function (rawEvent) { + var target = Element.fromDom(rawEvent.target); + var stop = function () { + rawEvent.stopPropagation(); + }; + var prevent = function () { + rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var isOS = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains(uastring, 'msie') || contains(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains(uastring, 'iphone') || contains(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var ELEMENT$1 = ELEMENT; + var DOCUMENT$1 = DOCUMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + var bypassSelector = function (dom) { + return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.fromDom); + }; + + var eq = function (e1, e2) { + return e1.dom() === e2.dom(); + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom(); + var d2 = e2.dom(); + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$1 = browser.isIE() ? ieContains : regularContains; + + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.fromDom); + }; + var parents = function (element, isRoot) { + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom(); + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = Element.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var siblings = function (element) { + var filterSelf = function (elements) { + return filter(elements, function (x) { + return !eq(element, x); + }); + }; + return parent(element).map(children).map(filterSelf).getOr([]); + }; + var children = function (element) { + return map(element.dom().childNodes, Element.fromDom); + }; + var spot = Immutable('element', 'offset'); + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: constant(left), + top: constant(top), + translate: translate + }; + }; + var Position = r; + + var isSafari = detect$3().browser.isSafari(); + var get$3 = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return Position(x, y); + }; + + var get$4 = function (_win) { + var win = _win === undefined ? domGlobals.window : _win; + return Option.from(win['visualViewport']); + }; + var bounds = function (x, y, width, height) { + return { + x: constant(x), + y: constant(y), + width: constant(width), + height: constant(height), + right: constant(x + width), + bottom: constant(y + height) + }; + }; + var getBounds = function (_win) { + var win = _win === undefined ? domGlobals.window : _win; + var doc = win.document; + var scroll = get$3(Element.fromDom(doc)); + return get$4(win).fold(function () { + var html = win.document.documentElement; + var width = html.clientWidth; + var height = html.clientHeight; + return bounds(scroll.left(), scroll.top(), width, height); + }, function (visualViewport) { + return bounds(Math.max(visualViewport.pageLeft, scroll.left()), Math.max(visualViewport.pageTop, scroll.top()), visualViewport.width, visualViewport.height); + }); + }; + var bind$1 = function (name, callback, _win) { + return get$4(_win).map(function (visualViewport) { + var handler = function (e) { + return fromRawEvent(e); + }; + visualViewport.addEventListener(name, handler); + return { + unbind: function () { + return visualViewport.removeEventListener(name, handler); + } + }; + }).getOrThunk(function () { + return { unbind: noop }; + }); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var fireFullscreenStateChanged = function (editor, state) { + editor.fire('FullscreenStateChanged', { state: state }); + }; + var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged }; + + var ancestors = function (scope, predicate, isRoot) { + return filter(parents(scope, isRoot), predicate); + }; + var siblings$1 = function (scope, predicate) { + return filter(siblings(scope), predicate); + }; + + var all$1 = function (selector) { + return all(selector); + }; + var ancestors$1 = function (scope, selector, isRoot) { + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var siblings$2 = function (scope, selector) { + return siblings$1(scope, function (e) { + return is(e, selector); + }); + }; + + var attr = 'data-ephox-mobile-fullscreen-style'; + var siblingStyles = 'display:none!important;'; + var ancestorPosition = 'position:absolute!important;'; + var ancestorStyles = 'top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;'; + var bgFallback = 'background-color:rgb(255,255,255)!important;'; + var isAndroid = global$2.os.isAndroid(); + var matchColor = function (editorBody) { + var color = get$2(editorBody, 'background-color'); + return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; + }; + var clobberStyles = function (dom, container, editorBody) { + var gatherSibilings = function (element) { + return siblings$2(element, '*:not(.tox-silver-sink)'); + }; + var clobber = function (clobberStyle) { + return function (element) { + var styles = get$1(element, 'style'); + var backup = styles === undefined ? 'no-styles' : styles.trim(); + if (backup === clobberStyle) { + return; + } else { + set(element, attr, backup); + setAll(element, dom.parseStyle(clobberStyle)); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSibilings); + var bgColor = matchColor(editorBody); + each(siblings, clobber(siblingStyles)); + each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); + var containerStyles = isAndroid === true ? '' : ancestorPosition; + clobber(containerStyles + ancestorStyles + bgColor)(container); + }; + var restoreStyles = function (dom) { + var clobberedEls = all$1('[' + attr + ']'); + each(clobberedEls, function (element) { + var restore = get$1(element, attr); + if (restore !== 'no-styles') { + setAll(element, dom.parseStyle(restore)); + } else { + remove(element, 'style'); + } + remove(element, attr); + }); + }; + var Thor = { + clobberStyles: clobberStyles, + restoreStyles: restoreStyles + }; + + var DOM = global$1.DOM; + var getScrollPos = function () { + var vp = getBounds(domGlobals.window); + return { + x: vp.x(), + y: vp.y() + }; + }; + var setScrollPos = function (pos) { + domGlobals.window.scrollTo(pos.x, pos.y); + }; + var viewportUpdate = get$4().fold(function () { + return { + bind: noop, + unbind: noop + }; + }, function (visualViewport) { + var editorContainer = value(); + var resizeBinder = unbindable(); + var scrollBinder = unbindable(); + var refreshScroll = function () { + domGlobals.document.body.scrollTop = 0; + domGlobals.document.documentElement.scrollTop = 0; + }; + var refreshVisualViewport = function () { + domGlobals.window.requestAnimationFrame(function () { + editorContainer.on(function (container) { + return setAll(container, { + top: visualViewport.offsetTop + 'px', + left: visualViewport.offsetLeft + 'px', + height: visualViewport.height + 'px', + width: visualViewport.width + 'px' + }); + }); + }); + }; + var update = global$3.throttle(function () { + refreshScroll(); + refreshVisualViewport(); + }, 50); + var bind = function (element) { + editorContainer.set(element); + update(); + resizeBinder.set(bind$1('resize')); + scrollBinder.set(bind$1('scroll')); + }; + var unbind = function () { + editorContainer.on(function () { + resizeBinder.clear(); + scrollBinder.clear(); + }); + editorContainer.clear(); + }; + return { + bind: bind, + unbind: unbind + }; + }); + var toggleFullscreen = function (editor, fullscreenState) { + var body = domGlobals.document.body; + var documentElement = domGlobals.document.documentElement; + var editorContainerStyle; + var editorContainer, iframe, iframeStyle; + editorContainer = editor.getContainer(); + var editorContainerS = Element.fromDom(editorContainer); + var fullscreenInfo = fullscreenState.get(); + var editorBody = Element.fromDom(editor.getBody()); + var isTouch = global$2.deviceType.isTouch(); + editorContainerStyle = editorContainer.style; + iframe = editor.getContentAreaContainer().firstChild; + iframeStyle = iframe.style; + if (!fullscreenInfo) { + var newFullScreenInfo = { + scrollPos: getScrollPos(), + containerWidth: editorContainerStyle.width, + containerHeight: editorContainerStyle.height, + containerTop: editorContainerStyle.top, + containerLeft: editorContainerStyle.left, + iframeWidth: iframeStyle.width, + iframeHeight: iframeStyle.height + }; + if (isTouch) { + Thor.clobberStyles(editor.dom, editorContainerS, editorBody); + } + iframeStyle.width = iframeStyle.height = '100%'; + editorContainerStyle.width = editorContainerStyle.height = ''; + DOM.addClass(body, 'tox-fullscreen'); + DOM.addClass(documentElement, 'tox-fullscreen'); + DOM.addClass(editorContainer, 'tox-fullscreen'); + viewportUpdate.bind(editorContainerS); + editor.on('remove', viewportUpdate.unbind); + fullscreenState.set(newFullScreenInfo); + Events.fireFullscreenStateChanged(editor, true); + } else { + iframeStyle.width = fullscreenInfo.iframeWidth; + iframeStyle.height = fullscreenInfo.iframeHeight; + editorContainerStyle.width = fullscreenInfo.containerWidth; + editorContainerStyle.height = fullscreenInfo.containerHeight; + editorContainerStyle.top = fullscreenInfo.containerTop; + editorContainerStyle.left = fullscreenInfo.containerLeft; + if (isTouch) { + Thor.restoreStyles(editor.dom); + } + DOM.removeClass(body, 'tox-fullscreen'); + DOM.removeClass(documentElement, 'tox-fullscreen'); + DOM.removeClass(editorContainer, 'tox-fullscreen'); + setScrollPos(fullscreenInfo.scrollPos); + fullscreenState.set(null); + Events.fireFullscreenStateChanged(editor, false); + viewportUpdate.unbind(); + editor.off('remove', viewportUpdate.unbind); + } + }; + var Actions = { toggleFullscreen: toggleFullscreen }; + + var register = function (editor, fullscreenState) { + editor.addCommand('mceFullScreen', function () { + Actions.toggleFullscreen(editor, fullscreenState); + }); + }; + var Commands = { register: register }; + + var makeSetupHandler = function (editor, fullscreenState) { + return function (api) { + api.setActive(fullscreenState.get() !== null); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('FullscreenStateChanged', editorEventCallback); + return function () { + return editor.off('FullscreenStateChanged', editorEventCallback); + }; + }; + }; + var register$1 = function (editor, fullscreenState) { + editor.ui.registry.addToggleMenuItem('fullscreen', { + text: 'Fullscreen', + shortcut: 'Meta+Shift+F', + onAction: function () { + return editor.execCommand('mceFullScreen'); + }, + onSetup: makeSetupHandler(editor, fullscreenState) + }); + editor.ui.registry.addToggleButton('fullscreen', { + tooltip: 'Fullscreen', + icon: 'fullscreen', + onAction: function () { + return editor.execCommand('mceFullScreen'); + }, + onSetup: makeSetupHandler(editor, fullscreenState) + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('fullscreen', function (editor) { + var fullscreenState = Cell(null); + if (editor.settings.inline) { + return Api.get(fullscreenState); + } + Commands.register(editor, fullscreenState); + Buttons.register(editor, fullscreenState); + editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen'); + return Api.get(fullscreenState); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('fullscreen', function(editor) { - var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler; - var containerWidth, containerHeight; - - if (editor.settings.inline) { - return; - } - - function getWindowSize() { - var w, h, win = window, doc = document; - var body = doc.body; - - // Old IE - if (body.offsetWidth) { - w = body.offsetWidth; - h = body.offsetHeight; - } - - // Modern browsers - if (win.innerWidth && win.innerHeight) { - w = win.innerWidth; - h = win.innerHeight; - } - - return {w: w, h: h}; - } - - function toggleFullscreen() { - var body = document.body, documentElement = document.documentElement, editorContainerStyle; - var editorContainer, iframe, iframeStyle; - - function resize() { - DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); - } - - fullscreenState = !fullscreenState; - - editorContainer = editor.getContainer(); - editorContainerStyle = editorContainer.style; - iframe = editor.getContentAreaContainer().firstChild; - iframeStyle = iframe.style; - - if (fullscreenState) { - iframeWidth = iframeStyle.width; - iframeHeight = iframeStyle.height; - iframeStyle.width = iframeStyle.height = '100%'; - containerWidth = editorContainerStyle.width; - containerHeight = editorContainerStyle.height; - editorContainerStyle.width = editorContainerStyle.height = ''; - - DOM.addClass(body, 'mce-fullscreen'); - DOM.addClass(documentElement, 'mce-fullscreen'); - DOM.addClass(editorContainer, 'mce-fullscreen'); - - DOM.bind(window, 'resize', resize); - resize(); - resizeHandler = resize; - } else { - iframeStyle.width = iframeWidth; - iframeStyle.height = iframeHeight; - - if (containerWidth) { - editorContainerStyle.width = containerWidth; - } - - if (containerHeight) { - editorContainerStyle.height = containerHeight; - } - - DOM.removeClass(body, 'mce-fullscreen'); - DOM.removeClass(documentElement, 'mce-fullscreen'); - DOM.removeClass(editorContainer, 'mce-fullscreen'); - DOM.unbind(window, 'resize', resizeHandler); - } - - editor.fire('FullscreenStateChanged', {state: fullscreenState}); - } - - editor.on('init', function() { - editor.addShortcut('Ctrl+Alt+F', '', toggleFullscreen); - }); - - editor.on('remove', function() { - if (resizeHandler) { - DOM.unbind(window, 'resize', resizeHandler); - } - }); - - editor.addCommand('mceFullScreen', toggleFullscreen); - - editor.addMenuItem('fullscreen', { - text: 'Fullscreen', - shortcut: 'Ctrl+Alt+F', - selectable: true, - onClick: toggleFullscreen, - onPostRender: function() { - var self = this; - - editor.on('FullscreenStateChanged', function(e) { - self.active(e.state); - }); - }, - context: 'view' - }); - - editor.addButton('fullscreen', { - tooltip: 'Fullscreen', - shortcut: 'Ctrl+Alt+F', - onClick: toggleFullscreen, - onPostRender: function() { - var self = this; - - editor.on('FullscreenStateChanged', function(e) { - self.active(e.state); - }); - } - }); - - return { - isFullscreen: function() { - return fullscreenState; - } - }; -}); \ No newline at end of file +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.min.js index 1bb1940..60c3fa6 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/fullscreen/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,l=i.body;return l.offsetWidth&&(e=l.offsetWidth,t=l.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){d.setStyle(a,"height",t().h-(h.clientHeight-a.clientHeight))}var u,h,a,f,m=document.body,g=document.documentElement;s=!s,h=e.getContainer(),u=h.style,a=e.getContentAreaContainer().firstChild,f=a.style,s?(i=f.width,l=f.height,f.width=f.height="100%",c=u.width,o=u.height,u.width=u.height="",d.addClass(m,"mce-fullscreen"),d.addClass(g,"mce-fullscreen"),d.addClass(h,"mce-fullscreen"),d.bind(window,"resize",n),n(),r=n):(f.width=i,f.height=l,c&&(u.width=c),o&&(u.height=o),d.removeClass(m,"mce-fullscreen"),d.removeClass(g,"mce-fullscreen"),d.removeClass(h,"mce-fullscreen"),d.unbind(window,"resize",r)),e.fire("FullscreenStateChanged",{state:s})}var i,l,r,c,o,s=!1,d=tinymce.DOM;return e.settings.inline?void 0:(e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.on("remove",function(){r&&d.unbind(window,"resize",r)}),e.addCommand("mceFullScreen",n),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return s}})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(d){"use strict";function t(){}function m(n){return function(){return n}}function n(){return f}var e,u=function(n){function e(){return r}var r=n;return{get:e,set:function(n){r=n},clone:function(){return u(e())}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){return{isFullscreen:function(){return null!==n.get()}}},c=m(!1),i=m(!0),f=(e={fold:function(n,e){return n()},is:c,isSome:c,isNone:i,getOr:l,getOrThunk:a,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(undefined),or:l,orThunk:a,map:n,each:t,bind:n,exists:c,forall:i,filter:n,equals:s,equals_:s,toArray:function(){return[]},toString:m("none()")},Object.freeze&&Object.freeze(e),e);function s(n){return n.isNone()}function a(n){return n()}function l(n){return n}function h(){return function(n){function e(){r.get().each(n)}var r=u(Y.none());return{clear:function(){e(),r.set(Y.none())},isSet:function(){return r.get().isSome()},set:function(n){e(),r.set(Y.some(n))}}}(function(n){n.unbind()})}function v(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}}function g(n,e){for(var r=n.length,t=new Array(r),o=0;o -1; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var get$1 = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + + var getHelpTabs = function (editor) { + return Option.from(editor.getParam('help_tabs')); + }; + + var shortcuts = [ + { + shortcuts: ['Meta + B'], + action: 'Bold' + }, + { + shortcuts: ['Meta + I'], + action: 'Italic' + }, + { + shortcuts: ['Meta + U'], + action: 'Underline' + }, + { + shortcuts: ['Meta + A'], + action: 'Select all' + }, + { + shortcuts: [ + 'Meta + Y', + 'Meta + Shift + Z' + ], + action: 'Redo' + }, + { + shortcuts: ['Meta + Z'], + action: 'Undo' + }, + { + shortcuts: ['Access + 1'], + action: 'Header 1' + }, + { + shortcuts: ['Access + 2'], + action: 'Header 2' + }, + { + shortcuts: ['Access + 3'], + action: 'Header 3' + }, + { + shortcuts: ['Access + 4'], + action: 'Header 4' + }, + { + shortcuts: ['Access + 5'], + action: 'Header 5' + }, + { + shortcuts: ['Access + 6'], + action: 'Header 6' + }, + { + shortcuts: ['Access + 7'], + action: 'Paragraph' + }, + { + shortcuts: ['Access + 8'], + action: 'Div' + }, + { + shortcuts: ['Access + 9'], + action: 'Address' + }, + { + shortcuts: ['Alt + 0'], + action: 'Open help dialog' + }, + { + shortcuts: ['Alt + F9'], + action: 'Focus to menubar' + }, + { + shortcuts: ['Alt + F10'], + action: 'Focus to toolbar' + }, + { + shortcuts: ['Alt + F11'], + action: 'Focus to element path' + }, + { + shortcuts: ['Ctrl + F9'], + action: 'Focus to contextual toolbar' + }, + { + shortcuts: ['Shift + Enter'], + action: 'Open popup menu for split buttons' + }, + { + shortcuts: ['Meta + K'], + action: 'Insert link (if link plugin activated)' + }, + { + shortcuts: ['Meta + S'], + action: 'Save (if save plugin activated)' + }, + { + shortcuts: ['Meta + F'], + action: 'Find (if searchreplace plugin activated)' + }, + { + shortcuts: ['Meta + Shift + F'], + action: 'Switch to or from fullscreen mode' + } + ]; + var KeyboardShortcuts = { shortcuts: shortcuts }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); + + var convertText = function (source) { + var mac = { + alt: '⌥', + ctrl: '⌃', + shift: '⇧', + meta: '⌘', + access: '⌃⌥' + }; + var other = { + meta: 'Ctrl ', + access: 'Shift + Alt ' + }; + var replace = global$1.mac ? mac : other; + var shortcut = source.split('+'); + var updated = map(shortcut, function (segment) { + var search = segment.toLowerCase().trim(); + return has(replace, search) ? replace[search] : segment; + }); + return global$1.mac ? updated.join('').replace(/\s/, '') : updated.join('+'); + }; + var ConvertShortcut = { convertText: convertText }; + + var tab = function () { + var shortcutList = map(KeyboardShortcuts.shortcuts, function (shortcut) { + var shortcutText = map(shortcut.shortcuts, ConvertShortcut.convertText).join(' or '); + return [ + shortcut.action, + shortcutText + ]; + }); + var tablePanel = { + type: 'table', + header: [ + 'Action', + 'Shortcut' + ], + cells: shortcutList + }; + return { + name: 'shortcuts', + title: 'Handy Shortcuts', + items: [tablePanel] + }; + }; + var KeyboardShortcutsTab = { tab: tab }; + + var supplant = function (str, obj) { + var isStringOrNumber = function (a) { + var t = typeof a; + return t === 'string' || t === 'number'; + }; + return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) { + var value = obj[key]; + return isStringOrNumber(value) ? value.toString() : fullMatch; + }); + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n'); + + var urls = [ + { + key: 'advlist', + name: 'Advanced List' + }, + { + key: 'anchor', + name: 'Anchor' + }, + { + key: 'autolink', + name: 'Autolink' + }, + { + key: 'autoresize', + name: 'Autoresize' + }, + { + key: 'autosave', + name: 'Autosave' + }, + { + key: 'bbcode', + name: 'BBCode' + }, + { + key: 'charmap', + name: 'Character Map' + }, + { + key: 'code', + name: 'Code' + }, + { + key: 'codesample', + name: 'Code Sample' + }, + { + key: 'colorpicker', + name: 'Color Picker' + }, + { + key: 'directionality', + name: 'Directionality' + }, + { + key: 'emoticons', + name: 'Emoticons' + }, + { + key: 'fullpage', + name: 'Full Page' + }, + { + key: 'fullscreen', + name: 'Full Screen' + }, + { + key: 'help', + name: 'Help' + }, + { + key: 'hr', + name: 'Horizontal Rule' + }, + { + key: 'image', + name: 'Image' + }, + { + key: 'imagetools', + name: 'Image Tools' + }, + { + key: 'importcss', + name: 'Import CSS' + }, + { + key: 'insertdatetime', + name: 'Insert Date/Time' + }, + { + key: 'legacyoutput', + name: 'Legacy Output' + }, + { + key: 'link', + name: 'Link' + }, + { + key: 'lists', + name: 'Lists' + }, + { + key: 'media', + name: 'Media' + }, + { + key: 'nonbreaking', + name: 'Nonbreaking' + }, + { + key: 'noneditable', + name: 'Noneditable' + }, + { + key: 'pagebreak', + name: 'Page Break' + }, + { + key: 'paste', + name: 'Paste' + }, + { + key: 'preview', + name: 'Preview' + }, + { + key: 'print', + name: 'Print' + }, + { + key: 'save', + name: 'Save' + }, + { + key: 'searchreplace', + name: 'Search and Replace' + }, + { + key: 'spellchecker', + name: 'Spell Checker' + }, + { + key: 'tabfocus', + name: 'Tab Focus' + }, + { + key: 'table', + name: 'Table' + }, + { + key: 'template', + name: 'Template' + }, + { + key: 'textcolor', + name: 'Text Color' + }, + { + key: 'textpattern', + name: 'Text Pattern' + }, + { + key: 'toc', + name: 'Table of Contents' + }, + { + key: 'visualblocks', + name: 'Visual Blocks' + }, + { + key: 'visualchars', + name: 'Visual Characters' + }, + { + key: 'wordcount', + name: 'Word Count' + }, + { + key: 'advcode', + name: 'Advanced Code Editor*' + }, + { + key: 'formatpainter', + name: 'Format Painter*' + }, + { + key: 'powerpaste', + name: 'PowerPaste*' + }, + { + key: 'tinydrive', + name: 'Tiny Drive*' + }, + { + key: 'tinymcespellchecker', + name: 'Spell Checker Pro*' + }, + { + key: 'a11ychecker', + name: 'Accessibility Checker*' + }, + { + key: 'linkchecker', + name: 'Link Checker*' + }, + { + key: 'mentions', + name: 'Mentions*' + }, + { + key: 'mediaembed', + name: 'Enhanced Media Embed*' + }, + { + key: 'checklist', + name: 'Checklist*' + }, + { + key: 'casechange', + name: 'Case Change*' + }, + { + key: 'permanentpen', + name: 'Permanent Pen*' + }, + { + key: 'pageembed', + name: 'Page Embed*' + }, + { + key: 'tinycomments', + name: 'Tiny Comments*' + }, + { + key: 'advtable', + name: 'Advanced Tables*' + }, + { + key: 'autocorrect', + name: 'Autocorrect*' + } + ]; + var PluginUrls = { urls: urls }; + + var tab$1 = function (editor) { + var availablePlugins = function () { + var premiumPlugins = [ + 'Accessibility Checker', + 'Advanced Code Editor', + 'Advanced Tables', + 'Case Change', + 'Checklist', + 'Tiny Comments', + 'Tiny Drive', + 'Enhanced Media Embed', + 'Format Painter', + 'Link Checker', + 'Mentions', + 'MoxieManager', + 'Page Embed', + 'Permanent Pen', + 'PowerPaste', + 'Spell Checker Pro' + ]; + var premiumPluginList = map(premiumPlugins, function (plugin) { + return '
  • ' + global$2.translate(plugin) + '
  • '; + }).join(''); + return '
    ' + '

    ' + global$2.translate('Premium plugins:') + '

    ' + '' + '
    '; + }; + var makeLink = curry(supplant, '${name}'); + var maybeUrlize = function (editor, key) { + return find(PluginUrls.urls, function (x) { + return x.key === key; + }).fold(function () { + var getMetadata = editor.plugins[key].getMetadata; + return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key; + }, function (x) { + return makeLink({ + name: x.name, + url: 'https://www.tiny.cloud/docs/plugins/' + x.key + }); + }); + }; + var getPluginKeys = function (editor) { + var keys$1 = keys(editor.plugins); + return editor.settings.forced_plugins === undefined ? keys$1 : filter(keys$1, not(curry(contains, editor.settings.forced_plugins))); + }; + var pluginLister = function (editor) { + var pluginKeys = getPluginKeys(editor); + var pluginLis = map(pluginKeys, function (key) { + return '
  • ' + maybeUrlize(editor, key) + '
  • '; + }); + var count = pluginLis.length; + var pluginsString = pluginLis.join(''); + var html = '

    ' + global$2.translate([ + 'Plugins installed ({0}):', + count + ]) + '

    ' + '
      ' + pluginsString + '
    '; + return html; + }; + var installedPlugins = function (editor) { + if (editor == null) { + return ''; + } + return '
    ' + pluginLister(editor) + '
    '; + }; + var htmlPanel = { + type: 'htmlpanel', + presets: 'document', + html: [ + installedPlugins(editor), + availablePlugins() + ].join('') + }; + return { + name: 'plugins', + title: 'Plugins', + items: [htmlPanel] + }; + }; + var PluginsTab = { tab: tab$1 }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var tab$2 = function () { + var getVersion = function (major, minor) { + return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor; + }; + var version = getVersion(global$3.majorVersion, global$3.minorVersion); + var changeLogLink = 'TinyMCE ' + version + ''; + var htmlPanel = { + type: 'htmlpanel', + html: '

    ' + global$2.translate([ + 'You are using {0}', + changeLogLink + ]) + '

    ', + presets: 'document' + }; + return { + name: 'versions', + title: 'Version', + items: [htmlPanel] + }; + }; + var VersionTab = { tab: tab$2 }; + + var description = '

    Editor UI keyboard navigation

    \n\n

    Activating keyboard navigation

    \n\n

    The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

    \n
      \n
    • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
    • \n
    • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
    • \n
    • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
    • \n
    \n\n

    Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

    \n\n

    Moving between UI sections

    \n\n

    When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

    \n
      \n
    • the menubar
    • \n
    • each group of the toolbar
    • \n
    • the sidebar
    • \n
    • the element path in the footer
    • \n
    • the wordcount toggle button in the footer
    • \n
    • the branding link in the footer
    • \n
    \n\n

    Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

    \n\n

    Moving within UI sections

    \n\n

    Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

    \n
      \n
    • moving between menus in the menubar
    • \n
    • moving between buttons in a toolbar group
    • \n
    • moving between items in the element path
    • \n
    \n\n

    In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

    \n\n

    Executing buttons

    \n\n

    To execute a button, navigate the selection to the desired button and hit space or enter.

    \n\n

    Opening, navigating and closing menus

    \n\n

    When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

    \n\n

    To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

    \n\n

    Context toolbars and menus

    \n\n

    To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

    \n\n

    Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

    \n\n

    Dialog navigation

    \n\n

    There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

    \n\n

    When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

    \n\n

    When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

    '; + var tab$3 = function () { + var body = { + type: 'htmlpanel', + presets: 'document', + html: description + }; + return { + name: 'keyboardnav', + title: 'Keyboard Navigation', + items: [body] + }; + }; + var KeyboardNavTab = { tab: tab$3 }; + + var parseHelpTabsSetting = function (tabsFromSettings, tabs) { + var newTabs = {}; + var names = map(tabsFromSettings, function (t) { + if (typeof t === 'string') { + if (has(tabs, t)) { + newTabs[t] = tabs[t]; + } + return t; + } else { + newTabs[t.name] = t; + return t.name; + } + }); + return { + tabs: newTabs, + names: names + }; + }; + var getNamesFromTabs = function (tabs) { + var names = keys(tabs); + var versionsIdx = indexOf(names, 'versions'); + versionsIdx.each(function (idx) { + names.splice(idx, 1); + names.push('versions'); + }); + return { + tabs: tabs, + names: names + }; + }; + var parseCustomTabs = function (editor, customTabs) { + var _a; + var shortcuts = KeyboardShortcutsTab.tab(); + var nav = KeyboardNavTab.tab(); + var plugins = PluginsTab.tab(editor); + var versions = VersionTab.tab(); + var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get()); + return getHelpTabs(editor).fold(function () { + return getNamesFromTabs(tabs); + }, function (tabsFromSettings) { + return parseHelpTabsSetting(tabsFromSettings, tabs); + }); + }; + var init = function (editor, customTabs) { + return function () { + var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names; + var foundTabs = map(names, function (name) { + return get$1(tabs, name); + }); + var dialogTabs = cat(foundTabs); + var body = { + type: 'tabpanel', + tabs: dialogTabs + }; + editor.windowManager.open({ + title: 'Help', + size: 'medium', + body: body, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: {} + }); + }; + }; + + function Plugin () { + global.add('help', function (editor) { + var customTabs = Cell({}); + var api = get(customTabs); + var dialogOpener = init(editor, customTabs); + Buttons.register(editor, dialogOpener); + Commands.register(editor, dialogOpener); + editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp'); + return api; + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/help/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/help/plugin.min.js new file mode 100644 index 0000000..620dec9 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/help/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function e(){}function r(e){return function(){return e}}var a=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return a(t())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.addCommand("mceHelp",t)},s=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})},c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n${name}');return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'
    '+function(t){var e=function(e){var t=F(e.plugins);return e.settings.forced_plugins===undefined?t:function(e,t){for(var n=[],o=0,a=e.length;o"+r(t,e)+""}),o=n.length,a=n.join("");return"

    "+U.translate(["Plugins installed ({0}):",o])+"

      "+a+"
    "}(n)+"
    "),(t=y(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"
  • "+U.translate(e)+"
  • "}).join(""),'

    '+U.translate("Premium plugins:")+"

    ")].join("")}]}},N=tinymce.util.Tools.resolve("tinymce.EditorManager"),L=function(){var e,t,n='TinyMCE '+(e=N.majorVersion,t=N.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+U.translate(["You are using {0}",n])+"

    ",presets:"document"}]}},B=function(){return{name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"

    Editor UI keyboard navigation

    \n\n

    Activating keyboard navigation

    \n\n

    The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

    \n
      \n
    • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
    • \n
    • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
    • \n
    • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
    • \n
    \n\n

    Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

    \n\n

    Moving between UI sections

    \n\n

    When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

    \n
      \n
    • the menubar
    • \n
    • each group of the toolbar
    • \n
    • the sidebar
    • \n
    • the element path in the footer
    • \n
    • the wordcount toggle button in the footer
    • \n
    • the branding link in the footer
    • \n
    \n\n

    Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

    \n\n

    Moving within UI sections

    \n\n

    Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

    \n
      \n
    • moving between menus in the menubar
    • \n
    • moving between buttons in a toolbar group
    • \n
    • moving between items in the element path
    • \n
    \n\n

    In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

    \n\n

    Executing buttons

    \n\n

    To execute a button, navigate the selection to the desired button and hit space or enter.

    \n\n

    Opening, navigating and closing menus

    \n\n

    When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

    \n\n

    To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

    \n\n

    Context toolbars and menus

    \n\n

    To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

    \n\n

    Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

    \n\n

    Dialog navigation

    \n\n

    There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

    \n\n

    When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

    \n\n

    When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

    "}]}};!function z(){t.add("help",function(e){var t=a({}),n=function(n){return{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}}(t),o=A(e,t);return s(e,o),i(e,o),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),n})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.js index 915a563..4c750f0 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.js @@ -1,30 +1,48 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var register = function (editor) { + editor.addCommand('InsertHorizontalRule', function () { + editor.execCommand('mceInsertContent', false, '
    '); + }); + }; + var Commands = { register: register }; -/*global tinymce:true */ + var register$1 = function (editor) { + editor.ui.registry.addButton('hr', { + icon: 'horizontal-rule', + tooltip: 'Horizontal line', + onAction: function () { + return editor.execCommand('InsertHorizontalRule'); + } + }); + editor.ui.registry.addMenuItem('hr', { + icon: 'horizontal-rule', + text: 'Horizontal line', + onAction: function () { + return editor.execCommand('InsertHorizontalRule'); + } + }); + }; + var Buttons = { register: register$1 }; -tinymce.PluginManager.add('hr', function(editor) { - editor.addCommand('InsertHorizontalRule', function() { - editor.execCommand('mceInsertContent', false, '
    '); - }); + function Plugin () { + global.add('hr', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } - editor.addButton('hr', { - icon: 'hr', - tooltip: 'Horizontal line', - cmd: 'InsertHorizontalRule' - }); + Plugin(); - editor.addMenuItem('hr', { - icon: 'hr', - text: 'Horizontal line', - cmd: 'InsertHorizontalRule', - context: 'insert' - }); -}); +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.min.js index e5ff6f3..5a23dd7 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/hr/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("hr",function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
    ")}),n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
    ")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.js index b924122..06107d9 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.js @@ -1,419 +1,2519 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ - -/*global tinymce:true */ - -tinymce.PluginManager.add('image', function(editor) { - function getImageSize(url, callback) { - var img = document.createElement('img'); - - function done(width, height) { - if (img.parentNode) { - img.parentNode.removeChild(img); - } - - callback({width: width, height: height}); - } - - img.onload = function() { - done(img.clientWidth, img.clientHeight); - }; - - img.onerror = function() { - done(); - }; - - var style = img.style; - style.visibility = 'hidden'; - style.position = 'fixed'; - style.bottom = style.left = 0; - style.width = style.height = 'auto'; - - document.body.appendChild(img); - img.src = url; - } - - function applyPreview(items) { - tinymce.each(items, function(item) { - item.textStyle = function() { - return editor.formatter.getCssText({inline: 'img', classes: [item.value]}); - }; - }); - - return items; - } - - function createImageList(callback) { - return function() { - var imageList = editor.settings.image_list; - - if (typeof(imageList) == "string") { - tinymce.util.XHR.send({ - url: imageList, - success: function(text) { - callback(tinymce.util.JSON.parse(text)); - } - }); - } else if (typeof(imageList) == "function") { - imageList(callback); - } else { - callback(imageList); - } - }; - } - - function showDialog(imageList) { - var win, data = {}, dom = editor.dom, imgElm = editor.selection.getNode(); - var width, height, imageListCtrl, classListCtrl; - - function buildValues(listSettingName, dataItemName, defaultItems) { - var selectedItem, items = []; - - tinymce.each(editor.settings[listSettingName] || defaultItems, function(target) { - var item = { - text: target.text || target.title, - value: target.value - }; - - items.push(item); - - if (data[dataItemName] === target.value || (!selectedItem && target.selected)) { - selectedItem = item; - } - }); - - if (selectedItem && !data[dataItemName]) { - data[dataItemName] = selectedItem.value; - selectedItem.selected = true; - } - - return items; - } - - function buildImageList() { - var imageListItems = [{text: 'None', value: ''}]; - - tinymce.each(imageList, function(image) { - imageListItems.push({ - text: image.text || image.title, - value: editor.convertURL(image.value || image.url, 'src'), - menu: image.menu - }); - }); - - return imageListItems; - } - - function recalcSize() { - var widthCtrl, heightCtrl, newWidth, newHeight; - - widthCtrl = win.find('#width')[0]; - heightCtrl = win.find('#height')[0]; - - newWidth = widthCtrl.value(); - newHeight = heightCtrl.value(); - - if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) { - if (width != newWidth) { - newHeight = Math.round((newWidth / width) * newHeight); - heightCtrl.value(newHeight); - } else { - newWidth = Math.round((newHeight / height) * newWidth); - widthCtrl.value(newWidth); - } - } - - width = newWidth; - height = newHeight; - } - - function onSubmitForm() { - function waitLoad(imgElm) { - function selectImage() { - imgElm.onload = imgElm.onerror = null; - editor.selection.select(imgElm); - editor.nodeChanged(); - } - - imgElm.onload = function() { - if (!data.width && !data.height) { - dom.setAttribs(imgElm, { - width: imgElm.clientWidth, - height: imgElm.clientHeight - }); - } - - selectImage(); - }; - - imgElm.onerror = selectImage; - } - - updateStyle(); - recalcSize(); - - data = tinymce.extend(data, win.toJSON()); - - if (!data.alt) { - data.alt = ''; - } - - if (data.width === '') { - data.width = null; - } - - if (data.height === '') { - data.height = null; - } - - if (!data.style) { - data.style = null; - } - - data = { - src: data.src, - alt: data.alt, - width: data.width, - height: data.height, - style: data.style, - "class": data["class"] - }; - - if (!data["class"]) { - delete data["class"]; - } - - editor.undoManager.transact(function() { - if (!data.src) { - if (imgElm) { - dom.remove(imgElm); - editor.focus(); - editor.nodeChanged(); - } - - return; - } - - if (!imgElm) { - data.id = '__mcenew'; - editor.focus(); - editor.selection.setContent(dom.createHTML('img', data)); - imgElm = dom.get('__mcenew'); - dom.setAttrib(imgElm, 'id', null); - } else { - dom.setAttribs(imgElm, data); - } - - waitLoad(imgElm); - }); - } - - function removePixelSuffix(value) { - if (value) { - value = value.replace(/px$/, ''); - } - - return value; - } - - function srcChange() { - if (imageListCtrl) { - imageListCtrl.value(editor.convertURL(this.value(), 'src')); - } - - getImageSize(this.value(), function(data) { - if (data.width && data.height) { - width = data.width; - height = data.height; - - win.find('#width').value(width); - win.find('#height').value(height); - } - }); - } - - width = dom.getAttrib(imgElm, 'width'); - height = dom.getAttrib(imgElm, 'height'); - - if (imgElm.nodeName == 'IMG' && !imgElm.getAttribute('data-mce-object') && !imgElm.getAttribute('data-mce-placeholder')) { - data = { - src: dom.getAttrib(imgElm, 'src'), - alt: dom.getAttrib(imgElm, 'alt'), - "class": dom.getAttrib(imgElm, 'class'), - width: width, - height: height - }; - } else { - imgElm = null; - } - - if (imageList) { - imageListCtrl = { - type: 'listbox', - label: 'Image list', - values: buildImageList(), - value: data.src && editor.convertURL(data.src, 'src'), - onselect: function(e) { - var altCtrl = win.find('#alt'); - - if (!altCtrl.value() || (e.lastControl && altCtrl.value() == e.lastControl.text())) { - altCtrl.value(e.control.text()); - } - - win.find('#src').value(e.control.value()); - }, - onPostRender: function() { - imageListCtrl = this; - } - }; - } - - if (editor.settings.image_class_list) { - classListCtrl = { - name: 'class', - type: 'listbox', - label: 'Class', - values: applyPreview(buildValues('image_class_list', 'class')) - }; - } - - // General settings shared between simple and advanced dialogs - var generalFormItems = [ - {name: 'src', type: 'filepicker', filetype: 'image', label: 'Source', autofocus: true, onchange: srcChange}, - imageListCtrl - ]; - - if (editor.settings.image_description !== false) { - generalFormItems.push({name: 'alt', type: 'textbox', label: 'Image description'}); - } - - if (editor.settings.image_dimensions !== false) { - generalFormItems.push({ - type: 'container', - label: 'Dimensions', - layout: 'flex', - direction: 'row', - align: 'center', - spacing: 5, - items: [ - {name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width'}, - {type: 'label', text: 'x'}, - {name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height'}, - {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'} - ] - }); - } - - generalFormItems.push(classListCtrl); - - function updateStyle() { - function addPixelSuffix(value) { - if (value.length > 0 && /^[0-9]+$/.test(value)) { - value += 'px'; - } - - return value; - } - - if (!editor.settings.image_advtab) { - return; - } - - var data = win.toJSON(); - var css = dom.parseStyle(data.style); - - delete css.margin; - css['margin-top'] = css['margin-bottom'] = addPixelSuffix(data.vspace); - css['margin-left'] = css['margin-right'] = addPixelSuffix(data.hspace); - css['border-width'] = addPixelSuffix(data.border); - - win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); - } - - if (editor.settings.image_advtab) { - // Parse styles from img - if (imgElm) { - data.hspace = removePixelSuffix(imgElm.style.marginLeft || imgElm.style.marginRight); - data.vspace = removePixelSuffix(imgElm.style.marginTop || imgElm.style.marginBottom); - data.border = removePixelSuffix(imgElm.style.borderWidth); - data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style'))); - } - - // Advanced dialog shows general+advanced tabs - win = editor.windowManager.open({ - title: 'Insert/edit image', - data: data, - bodyType: 'tabpanel', - body: [ - { - title: 'General', - type: 'form', - items: generalFormItems - }, - - { - title: 'Advanced', - type: 'form', - pack: 'start', - items: [ - { - label: 'Style', - name: 'style', - type: 'textbox' - }, - { - type: 'form', - layout: 'grid', - packV: 'start', - columns: 2, - padding: 0, - alignH: ['left', 'right'], - defaults: { - type: 'textbox', - maxWidth: 50, - onchange: updateStyle - }, - items: [ - {label: 'Vertical space', name: 'vspace'}, - {label: 'Horizontal space', name: 'hspace'}, - {label: 'Border', name: 'border'} - ] - } - ] - } - ], - onSubmit: onSubmitForm - }); - } else { - // Simple default dialog - win = editor.windowManager.open({ - title: 'Insert/edit image', - data: data, - body: generalFormItems, - onSubmit: onSubmitForm - }); - } - } - - editor.addButton('image', { - icon: 'image', - tooltip: 'Insert/edit image', - onclick: createImageList(showDialog), - stateSelector: 'img:not([data-mce-object],[data-mce-placeholder])' - }); - - editor.addMenuItem('image', { - icon: 'image', - text: 'Insert image', - onclick: createImageList(showDialog), - context: 'insert', - prependToContext: true - }); -}); +(function (domGlobals) { + 'use strict'; + + var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Option.none(); + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var exports$1 = {}, module = { exports: exports$1 }; + (function (define, exports, module, require) { + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); + }(undefined, exports$1, module, undefined)); + var Promise = module.exports.boltExport; + + var nu = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.some(x); + run(callbacks); + callbacks = []; + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu, + pure: pure + }; + + var errorReporter = function (err) { + domGlobals.setTimeout(function () { + throw err; + }, 0); + }; + var make = function (run) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { + return make(function () { + return run().then(fab); + }); + }; + var bind = function (aFutureB) { + return make(function () { + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); + }); + }; + var anonBind = function (futureB) { + return make(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$1 = function (baseFn) { + return make(function () { + return new Promise(baseFn); + }); + }; + var pure$1 = function (a) { + return make(function () { + return Promise.resolve(a); + }); + }; + var Future = { + nu: nu$1, + pure: pure$1 + }; + + var value = function (o) { + var is = function (v) { + return o === v; + }; + var or = function (opt) { + return value(o); + }; + var orThunk = function (f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOption = function () { + return Option.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOption: toOption + }; + }; + var error = function (message) { + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOption: Option.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var wrap = function (delegate) { + var toCached = function () { + return wrap(delegate.toCached()); + }; + var bindFuture = function (f) { + return wrap(delegate.bind(function (resA) { + return resA.fold(function (err) { + return Future.pure(Result.error(err)); + }, function (a) { + return f(a); + }); + })); + }; + var bindResult = function (f) { + return wrap(delegate.map(function (resA) { + return resA.bind(f); + })); + }; + var mapResult = function (f) { + return wrap(delegate.map(function (resA) { + return resA.map(f); + })); + }; + var mapError = function (f) { + return wrap(delegate.map(function (resA) { + return resA.mapError(f); + })); + }; + var foldResult = function (whenError, whenValue) { + return delegate.map(function (res) { + return res.fold(whenError, whenValue); + }); + }; + var withTimeout = function (timeout, errorThunk) { + return wrap(Future.nu(function (callback) { + var timedOut = false; + var timer = domGlobals.setTimeout(function () { + timedOut = true; + callback(Result.error(errorThunk())); + }, timeout); + delegate.get(function (result) { + if (!timedOut) { + domGlobals.clearTimeout(timer); + callback(result); + } + }); + })); + }; + return __assign(__assign({}, delegate), { + toCached: toCached, + bindFuture: bindFuture, + bindResult: bindResult, + mapResult: mapResult, + mapError: mapError, + foldResult: foldResult, + withTimeout: withTimeout + }); + }; + var nu$2 = function (worker) { + return wrap(Future.nu(worker)); + }; + var value$1 = function (value) { + return wrap(Future.pure(Result.value(value))); + }; + var error$1 = function (error) { + return wrap(Future.pure(Result.error(error))); + }; + var fromResult = function (result) { + return wrap(Future.pure(result)); + }; + var fromFuture = function (future) { + return wrap(future.map(Result.value)); + }; + var fromPromise = function (promise) { + return nu$2(function (completer) { + promise.then(function (value) { + completer(Result.value(value)); + }, function (error) { + completer(Result.error(error)); + }); + }); + }; + var FutureResult = { + nu: nu$2, + wrap: wrap, + pure: value$1, + value: value$1, + error: error$1, + fromResult: fromResult, + fromFuture: fromFuture, + fromPromise: fromPromise + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var deep = function (old, nu) { + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; + }; + var baseMerge = function (merger) { + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var deepMerge = baseMerge(deep); + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom(), key, value); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var hasDimensions = function (editor) { + return editor.getParam('image_dimensions', true, 'boolean'); + }; + var hasAdvTab = function (editor) { + return editor.getParam('image_advtab', false, 'boolean'); + }; + var hasUploadTab = function (editor) { + return editor.getParam('image_uploadtab', true, 'boolean'); + }; + var getPrependUrl = function (editor) { + return editor.getParam('image_prepend_url', '', 'string'); + }; + var getClassList = function (editor) { + return editor.getParam('image_class_list'); + }; + var hasDescription = function (editor) { + return editor.getParam('image_description', true, 'boolean'); + }; + var hasImageTitle = function (editor) { + return editor.getParam('image_title', false, 'boolean'); + }; + var hasImageCaption = function (editor) { + return editor.getParam('image_caption', false, 'boolean'); + }; + var getImageList = function (editor) { + return editor.getParam('image_list', false); + }; + var hasUploadUrl = function (editor) { + return !!getUploadUrl(editor); + }; + var hasUploadHandler = function (editor) { + return !!getUploadHandler(editor); + }; + var getUploadUrl = function (editor) { + return editor.getParam('images_upload_url', '', 'string'); + }; + var getUploadHandler = function (editor) { + return editor.getParam('images_upload_handler', undefined, 'function'); + }; + var getUploadBasePath = function (editor) { + return editor.getParam('images_upload_base_path', undefined, 'string'); + }; + var getUploadCredentials = function (editor) { + return editor.getParam('images_upload_credentials', false, 'boolean'); + }; + var showAccessibilityOptions = function (editor) { + return editor.getParam('a11y_advanced_options', false, 'boolean'); + }; + var isAutomaticUploadsEnabled = function (editor) { + return editor.getParam('automatic_uploads', true, 'boolean'); + }; + var Settings = { + hasDimensions: hasDimensions, + hasUploadTab: hasUploadTab, + hasAdvTab: hasAdvTab, + getPrependUrl: getPrependUrl, + getClassList: getClassList, + hasDescription: hasDescription, + hasImageTitle: hasImageTitle, + hasImageCaption: hasImageCaption, + getImageList: getImageList, + hasUploadUrl: hasUploadUrl, + hasUploadHandler: hasUploadHandler, + getUploadUrl: getUploadUrl, + getUploadHandler: getUploadHandler, + getUploadBasePath: getUploadBasePath, + getUploadCredentials: getUploadCredentials, + showAccessibilityOptions: showAccessibilityOptions, + isAutomaticUploadsEnabled: isAutomaticUploadsEnabled + }; + + var parseIntAndGetMax = function (val1, val2) { + return Math.max(parseInt(val1, 10), parseInt(val2, 10)); + }; + var getImageSize = function (url, callback) { + var img = domGlobals.document.createElement('img'); + var done = function (dimensions) { + if (img.parentNode) { + img.parentNode.removeChild(img); + } + callback(dimensions); + }; + img.onload = function () { + var width = parseIntAndGetMax(img.width, img.clientWidth); + var height = parseIntAndGetMax(img.height, img.clientHeight); + var dimensions = { + width: width, + height: height + }; + done(Result.value(dimensions)); + }; + img.onerror = function () { + done(Result.error('Failed to get image dimensions for: ' + url)); + }; + var style = img.style; + style.visibility = 'hidden'; + style.position = 'fixed'; + style.bottom = style.left = '0px'; + style.width = style.height = 'auto'; + domGlobals.document.body.appendChild(img); + img.src = url; + }; + var removePixelSuffix = function (value) { + if (value) { + value = value.replace(/px$/, ''); + } + return value; + }; + var addPixelSuffix = function (value) { + if (value.length > 0 && /^[0-9]+$/.test(value)) { + value += 'px'; + } + return value; + }; + var mergeMargins = function (css) { + if (css.margin) { + var splitMargin = String(css.margin).split(' '); + switch (splitMargin.length) { + case 1: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[0]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; + css['margin-left'] = css['margin-left'] || splitMargin[0]; + break; + case 2: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; + css['margin-left'] = css['margin-left'] || splitMargin[1]; + break; + case 3: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; + css['margin-left'] = css['margin-left'] || splitMargin[1]; + break; + case 4: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; + css['margin-left'] = css['margin-left'] || splitMargin[3]; + } + delete css.margin; + } + return css; + }; + var createImageList = function (editor, callback) { + var imageList = Settings.getImageList(editor); + if (typeof imageList === 'string') { + global$4.send({ + url: imageList, + success: function (text) { + callback(JSON.parse(text)); + } + }); + } else if (typeof imageList === 'function') { + imageList(callback); + } else { + callback(imageList); + } + }; + var waitLoadImage = function (editor, data, imgElm) { + var selectImage = function () { + imgElm.onload = imgElm.onerror = null; + if (editor.selection) { + editor.selection.select(imgElm); + editor.nodeChanged(); + } + }; + imgElm.onload = function () { + if (!data.width && !data.height && Settings.hasDimensions(editor)) { + editor.dom.setAttribs(imgElm, { + width: String(imgElm.clientWidth), + height: String(imgElm.clientHeight) + }); + } + selectImage(); + }; + imgElm.onerror = selectImage; + }; + var blobToDataUri = function (blob) { + return new global$3(function (resolve, reject) { + var reader = new domGlobals.FileReader(); + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error.message); + }; + reader.readAsDataURL(blob); + }); + }; + var isPlaceholderImage = function (imgElm) { + return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder')); + }; + var Utils = { + getImageSize: getImageSize, + removePixelSuffix: removePixelSuffix, + addPixelSuffix: addPixelSuffix, + mergeMargins: mergeMargins, + createImageList: createImageList, + waitLoadImage: waitLoadImage, + blobToDataUri: blobToDataUri, + isPlaceholderImage: isPlaceholderImage + }; + + var DOM = global$2.DOM; + var getHspace = function (image) { + if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { + return Utils.removePixelSuffix(image.style.marginLeft); + } else { + return ''; + } + }; + var getVspace = function (image) { + if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { + return Utils.removePixelSuffix(image.style.marginTop); + } else { + return ''; + } + }; + var getBorder = function (image) { + if (image.style.borderWidth) { + return Utils.removePixelSuffix(image.style.borderWidth); + } else { + return ''; + } + }; + var getAttrib = function (image, name) { + if (image.hasAttribute(name)) { + return image.getAttribute(name); + } else { + return ''; + } + }; + var getStyle = function (image, name) { + return image.style[name] ? image.style[name] : ''; + }; + var hasCaption = function (image) { + return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE'; + }; + var setAttrib = function (image, name, value) { + image.setAttribute(name, value); + }; + var wrapInFigure = function (image) { + var figureElm = DOM.create('figure', { class: 'image' }); + DOM.insertAfter(figureElm, image); + figureElm.appendChild(image); + figureElm.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption')); + figureElm.contentEditable = 'false'; + }; + var removeFigure = function (image) { + var figureElm = image.parentNode; + DOM.insertAfter(image, figureElm); + DOM.remove(figureElm); + }; + var toggleCaption = function (image) { + if (hasCaption(image)) { + removeFigure(image); + } else { + wrapInFigure(image); + } + }; + var normalizeStyle = function (image, normalizeCss) { + var attrValue = image.getAttribute('style'); + var value = normalizeCss(attrValue !== null ? attrValue : ''); + if (value.length > 0) { + image.setAttribute('style', value); + image.setAttribute('data-mce-style', value); + } else { + image.removeAttribute('style'); + } + }; + var setSize = function (name, normalizeCss) { + return function (image, name, value) { + if (image.style[name]) { + image.style[name] = Utils.addPixelSuffix(value); + normalizeStyle(image, normalizeCss); + } else { + setAttrib(image, name, value); + } + }; + }; + var getSize = function (image, name) { + if (image.style[name]) { + return Utils.removePixelSuffix(image.style[name]); + } else { + return getAttrib(image, name); + } + }; + var setHspace = function (image, value) { + var pxValue = Utils.addPixelSuffix(value); + image.style.marginLeft = pxValue; + image.style.marginRight = pxValue; + }; + var setVspace = function (image, value) { + var pxValue = Utils.addPixelSuffix(value); + image.style.marginTop = pxValue; + image.style.marginBottom = pxValue; + }; + var setBorder = function (image, value) { + var pxValue = Utils.addPixelSuffix(value); + image.style.borderWidth = pxValue; + }; + var setBorderStyle = function (image, value) { + image.style.borderStyle = value; + }; + var getBorderStyle = function (image) { + return getStyle(image, 'borderStyle'); + }; + var isFigure = function (elm) { + return elm.nodeName === 'FIGURE'; + }; + var isImage = function (elm) { + return elm.nodeName === 'IMG'; + }; + var getIsDecorative = function (image) { + return DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation'; + }; + var getAlt = function (image) { + if (getIsDecorative(image)) { + return ''; + } else { + return getAttrib(image, 'alt'); + } + }; + var defaultData = function () { + return { + src: '', + alt: '', + title: '', + width: '', + height: '', + class: '', + style: '', + caption: false, + hspace: '', + vspace: '', + border: '', + borderStyle: '', + isDecorative: false + }; + }; + var getStyleValue = function (normalizeCss, data) { + var image = domGlobals.document.createElement('img'); + setAttrib(image, 'style', data.style); + if (getHspace(image) || data.hspace !== '') { + setHspace(image, data.hspace); + } + if (getVspace(image) || data.vspace !== '') { + setVspace(image, data.vspace); + } + if (getBorder(image) || data.border !== '') { + setBorder(image, data.border); + } + if (getBorderStyle(image) || data.borderStyle !== '') { + setBorderStyle(image, data.borderStyle); + } + return normalizeCss(image.getAttribute('style')); + }; + var create = function (normalizeCss, data, info) { + var image = domGlobals.document.createElement('img'); + write(normalizeCss, __assign(__assign({}, data), { caption: false }), image, info); + setAlt(image, data.alt, data.isDecorative, info); + if (data.caption) { + var figure = DOM.create('figure', { class: 'image' }); + figure.appendChild(image); + figure.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption')); + figure.contentEditable = 'false'; + return figure; + } else { + return image; + } + }; + var read = function (normalizeCss, image) { + return { + src: getAttrib(image, 'src'), + alt: getAlt(image), + title: getAttrib(image, 'title'), + width: getSize(image, 'width'), + height: getSize(image, 'height'), + class: getAttrib(image, 'class'), + style: normalizeCss(getAttrib(image, 'style')), + caption: hasCaption(image), + hspace: getHspace(image), + vspace: getVspace(image), + border: getBorder(image), + borderStyle: getStyle(image, 'borderStyle'), + isDecorative: getIsDecorative(image) + }; + }; + var updateProp = function (image, oldData, newData, name, set) { + if (newData[name] !== oldData[name]) { + set(image, name, newData[name]); + } + }; + var setAlt = function (image, alt, isDecorative, info) { + if (isDecorative) { + DOM.setAttrib(image, 'role', 'presentation'); + var sugarImage = Element.fromDom(image); + set(sugarImage, 'alt', ''); + } else { + if (info.hasAccessibilityOptions) { + DOM.setAttrib(image, 'alt', alt); + } else { + var sugarImage = Element.fromDom(image); + set(sugarImage, 'alt', alt); + } + if (DOM.getAttrib(image, 'role') === 'presentation') { + DOM.setAttrib(image, 'role', ''); + } + } + }; + var updateAlt = function (image, oldData, newData, info) { + if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) { + setAlt(image, newData.alt, newData.isDecorative, info); + } + }; + var normalized = function (set, normalizeCss) { + return function (image, name, value) { + set(image, value); + normalizeStyle(image, normalizeCss); + }; + }; + var write = function (normalizeCss, newData, image, info) { + var oldData = read(normalizeCss, image); + updateProp(image, oldData, newData, 'caption', function (image, _name, _value) { + return toggleCaption(image); + }); + updateProp(image, oldData, newData, 'src', setAttrib); + updateProp(image, oldData, newData, 'title', setAttrib); + updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); + updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); + updateProp(image, oldData, newData, 'class', setAttrib); + updateProp(image, oldData, newData, 'style', normalized(function (image, value) { + return setAttrib(image, 'style', value); + }, normalizeCss)); + updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss)); + updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss)); + updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss)); + updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss)); + updateAlt(image, oldData, newData, info); + }; + + var normalizeCss = function (editor, cssText) { + var css = editor.dom.styles.parse(cssText); + var mergedCss = Utils.mergeMargins(css); + var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss)); + return editor.dom.styles.serialize(compressed); + }; + var getSelectedImage = function (editor) { + var imgElm = editor.selection.getNode(); + var figureElm = editor.dom.getParent(imgElm, 'figure.image'); + if (figureElm) { + return editor.dom.select('img', figureElm)[0]; + } + if (imgElm && (imgElm.nodeName !== 'IMG' || Utils.isPlaceholderImage(imgElm))) { + return null; + } + return imgElm; + }; + var splitTextBlock = function (editor, figure) { + var dom = editor.dom; + var textBlock = dom.getParent(figure.parentNode, function (node) { + return !!editor.schema.getTextBlockElements()[node.nodeName]; + }, editor.getBody()); + if (textBlock) { + return dom.split(textBlock, figure); + } else { + return figure; + } + }; + var readImageDataFromSelection = function (editor) { + var image = getSelectedImage(editor); + return image ? read(function (css) { + return normalizeCss(editor, css); + }, image) : defaultData(); + }; + var insertImageAtCaret = function (editor, data, info) { + var elm = create(function (css) { + return normalizeCss(editor, css); + }, data, info); + editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew'); + editor.focus(); + editor.selection.setContent(elm.outerHTML); + var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0]; + editor.dom.setAttrib(insertedElm, 'data-mce-id', null); + if (isFigure(insertedElm)) { + var figure = splitTextBlock(editor, insertedElm); + editor.selection.select(figure); + } else { + editor.selection.select(insertedElm); + } + }; + var syncSrcAttr = function (editor, image) { + editor.dom.setAttrib(image, 'src', image.getAttribute('src')); + }; + var deleteImage = function (editor, image) { + if (image) { + var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image; + editor.dom.remove(elm); + editor.focus(); + editor.nodeChanged(); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } + } + }; + var writeImageDataToSelection = function (editor, data, info) { + var image = getSelectedImage(editor); + write(function (css) { + return normalizeCss(editor, css); + }, data, image, info); + syncSrcAttr(editor, image); + if (isFigure(image.parentNode)) { + var figure = image.parentNode; + splitTextBlock(editor, figure); + editor.selection.select(image.parentNode); + } else { + editor.selection.select(image); + Utils.waitLoadImage(editor, data, image); + } + }; + var insertOrUpdateImage = function (editor, data, info) { + var image = getSelectedImage(editor); + if (image) { + if (data.src) { + writeImageDataToSelection(editor, data, info); + } else { + deleteImage(editor, image); + } + } else if (data.src) { + insertImageAtCaret(editor, data, info); + } + }; + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getValue = function (item) { + return isString(item.value) ? item.value : ''; + }; + var sanitizeList = function (list, extractValue) { + var out = []; + global$5.each(list, function (item) { + var text = isString(item.text) ? item.text : isString(item.title) ? item.title : ''; + if (item.menu !== undefined) { + var items = sanitizeList(item.menu, extractValue); + out.push({ + text: text, + items: items + }); + } else { + var value = extractValue(item); + out.push({ + text: text, + value: value + }); + } + }); + return out; + }; + var sanitizer = function (extracter) { + if (extracter === void 0) { + extracter = getValue; + } + return function (list) { + if (list) { + return Option.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + } else { + return Option.none(); + } + }; + }; + var sanitize = function (list) { + return sanitizer(getValue)(list); + }; + var isGroup = function (item) { + return Object.prototype.hasOwnProperty.call(item, 'items'); + }; + var findEntryDelegate = function (list, value) { + return findMap(list, function (item) { + if (isGroup(item)) { + return findEntryDelegate(item.items, value); + } else if (item.value === value) { + return Option.some(item); + } else { + return Option.none(); + } + }); + }; + var findEntry = function (optList, value) { + return optList.bind(function (list) { + return findEntryDelegate(list, value); + }); + }; + var ListUtils = { + sanitizer: sanitizer, + sanitize: sanitize, + findEntry: findEntry + }; + + var pathJoin = function (path1, path2) { + if (path1) { + return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); + } + return path2; + }; + function Uploader (settings) { + var defaultHandler = function (blobInfo, success, failure, progress) { + var xhr, formData; + xhr = new domGlobals.XMLHttpRequest(); + xhr.open('POST', settings.url); + xhr.withCredentials = settings.credentials; + xhr.upload.onprogress = function (e) { + progress(e.loaded / e.total * 100); + }; + xhr.onerror = function () { + failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); + }; + xhr.onload = function () { + var json; + if (xhr.status < 200 || xhr.status >= 300) { + failure('HTTP Error: ' + xhr.status); + return; + } + json = JSON.parse(xhr.responseText); + if (!json || typeof json.location !== 'string') { + failure('Invalid JSON: ' + xhr.responseText); + return; + } + success(pathJoin(settings.basePath, json.location)); + }; + formData = new domGlobals.FormData(); + formData.append('file', blobInfo.blob(), blobInfo.filename()); + xhr.send(formData); + }; + var uploadBlob = function (blobInfo, handler) { + return new global$3(function (resolve, reject) { + try { + handler(blobInfo, resolve, reject, noop); + } catch (ex) { + reject(ex.message); + } + }); + }; + var isDefaultHandler = function (handler) { + return handler === defaultHandler; + }; + var upload = function (blobInfo) { + return !settings.url && isDefaultHandler(settings.handler) ? global$3.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); + }; + settings = global$5.extend({ + credentials: false, + handler: defaultHandler + }, settings); + return { upload: upload }; + } + + var makeTab = function (info) { + return { + title: 'Advanced', + name: 'advanced', + items: [ + { + type: 'input', + label: 'Style', + name: 'style' + }, + { + type: 'grid', + columns: 2, + items: [ + { + type: 'input', + label: 'Vertical space', + name: 'vspace', + inputMode: 'numeric' + }, + { + type: 'input', + label: 'Horizontal space', + name: 'hspace', + inputMode: 'numeric' + }, + { + type: 'input', + label: 'Border width', + name: 'border', + inputMode: 'numeric' + }, + { + type: 'selectbox', + name: 'borderstyle', + label: 'Border style', + items: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, + { + text: 'Outset', + value: 'outset' + }, + { + text: 'None', + value: 'none' + }, + { + text: 'Hidden', + value: 'hidden' + } + ] + } + ] + } + ] + }; + }; + var AdvTab = { makeTab: makeTab }; + + var collect = function (editor) { + var urlListSanitizer = ListUtils.sanitizer(function (item) { + return editor.convertURL(item.value || item.url, 'src'); + }); + var futureImageList = Future.nu(function (completer) { + Utils.createImageList(editor, function (imageList) { + completer(urlListSanitizer(imageList).map(function (items) { + return flatten([ + [{ + text: 'None', + value: '' + }], + items + ]); + })); + }); + }); + var classList = ListUtils.sanitize(Settings.getClassList(editor)); + var hasAdvTab = Settings.hasAdvTab(editor); + var hasUploadTab = Settings.hasUploadTab(editor); + var hasUploadUrl = Settings.hasUploadUrl(editor); + var hasUploadHandler = Settings.hasUploadHandler(editor); + var image = readImageDataFromSelection(editor); + var hasDescription = Settings.hasDescription(editor); + var hasImageTitle = Settings.hasImageTitle(editor); + var hasDimensions = Settings.hasDimensions(editor); + var hasImageCaption = Settings.hasImageCaption(editor); + var hasAccessibilityOptions = Settings.showAccessibilityOptions(editor); + var url = Settings.getUploadUrl(editor); + var basePath = Settings.getUploadBasePath(editor); + var credentials = Settings.getUploadCredentials(editor); + var handler = Settings.getUploadHandler(editor); + var automaticUploads = Settings.isAutomaticUploadsEnabled(editor); + var prependURL = Option.some(Settings.getPrependUrl(editor)).filter(function (preUrl) { + return isString(preUrl) && preUrl.length > 0; + }); + return futureImageList.map(function (imageList) { + return { + image: image, + imageList: imageList, + classList: classList, + hasAdvTab: hasAdvTab, + hasUploadTab: hasUploadTab, + hasUploadUrl: hasUploadUrl, + hasUploadHandler: hasUploadHandler, + hasDescription: hasDescription, + hasImageTitle: hasImageTitle, + hasDimensions: hasDimensions, + hasImageCaption: hasImageCaption, + url: url, + basePath: basePath, + credentials: credentials, + handler: handler, + prependURL: prependURL, + hasAccessibilityOptions: hasAccessibilityOptions, + automaticUploads: automaticUploads + }; + }); + }; + + var makeItems = function (info) { + var imageUrl = { + name: 'src', + type: 'urlinput', + filetype: 'image', + label: 'Source' + }; + var imageList = info.imageList.map(function (items) { + return { + name: 'images', + type: 'selectbox', + label: 'Image list', + items: items + }; + }); + var imageDescription = { + name: 'alt', + type: 'input', + label: 'Alternative description', + disabled: info.hasAccessibilityOptions && info.image.isDecorative + }; + var imageTitle = { + name: 'title', + type: 'input', + label: 'Image title' + }; + var imageDimensions = { + name: 'dimensions', + type: 'sizeinput' + }; + var isDecorative = { + type: 'label', + label: 'Accessibility', + items: [{ + name: 'isDecorative', + type: 'checkbox', + label: 'Image is decorative' + }] + }; + var classList = info.classList.map(function (items) { + return { + name: 'classes', + type: 'selectbox', + label: 'Class', + items: items + }; + }); + var caption = { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + }; + return flatten([ + [imageUrl], + imageList.toArray(), + info.hasAccessibilityOptions && info.hasDescription ? [isDecorative] : [], + info.hasDescription ? [imageDescription] : [], + info.hasImageTitle ? [imageTitle] : [], + info.hasDimensions ? [imageDimensions] : [], + [{ + type: 'grid', + columns: 2, + items: flatten([ + classList.toArray(), + info.hasImageCaption ? [caption] : [] + ]) + }] + ]); + }; + var makeTab$1 = function (info) { + return { + title: 'General', + name: 'general', + items: makeItems(info) + }; + }; + var MainTab = { + makeTab: makeTab$1, + makeItems: makeItems + }; + + var makeTab$2 = function (info) { + var items = [{ + type: 'dropzone', + name: 'fileinput' + }]; + return { + title: 'Upload', + name: 'upload', + items: items + }; + }; + var UploadTab = { makeTab: makeTab$2 }; + + var createState = function (info) { + return { + prevImage: ListUtils.findEntry(info.imageList, info.image.src), + prevAlt: info.image.alt, + open: true + }; + }; + var fromImageData = function (image) { + return { + src: { + value: image.src, + meta: {} + }, + images: image.src, + alt: image.alt, + title: image.title, + dimensions: { + width: image.width, + height: image.height + }, + classes: image.class, + caption: image.caption, + style: image.style, + vspace: image.vspace, + border: image.border, + hspace: image.hspace, + borderstyle: image.borderStyle, + fileinput: [], + isDecorative: image.isDecorative + }; + }; + var toImageData = function (data) { + return { + src: data.src.value, + alt: data.alt, + title: data.title, + width: data.dimensions.width, + height: data.dimensions.height, + class: data.classes, + style: data.style, + caption: data.caption, + hspace: data.hspace, + vspace: data.vspace, + border: data.border, + borderStyle: data.borderstyle, + isDecorative: data.isDecorative + }; + }; + var addPrependUrl2 = function (info, srcURL) { + if (!/^(?:[a-zA-Z]+:)?\/\//.test(srcURL)) { + return info.prependURL.bind(function (prependUrl) { + if (srcURL.substring(0, prependUrl.length) !== prependUrl) { + return Option.some(prependUrl + srcURL); + } + return Option.none(); + }); + } + return Option.none(); + }; + var addPrependUrl = function (info, api) { + var data = api.getData(); + addPrependUrl2(info, data.src.value).each(function (srcURL) { + api.setData({ + src: { + value: srcURL, + meta: data.src.meta + } + }); + }); + }; + var formFillFromMeta2 = function (info, data, meta) { + if (info.hasDescription && isString(meta.alt)) { + data.alt = meta.alt; + } + if (info.hasAccessibilityOptions) { + data.isDecorative = meta.isDecorative || data.isDecorative || false; + } + if (info.hasImageTitle && isString(meta.title)) { + data.title = meta.title; + } + if (info.hasDimensions) { + if (isString(meta.width)) { + data.dimensions.width = meta.width; + } + if (isString(meta.height)) { + data.dimensions.height = meta.height; + } + } + if (isString(meta.class)) { + ListUtils.findEntry(info.classList, meta.class).each(function (entry) { + data.classes = entry.value; + }); + } + if (info.hasImageCaption) { + if (isBoolean(meta.caption)) { + data.caption = meta.caption; + } + } + if (info.hasAdvTab) { + if (isString(meta.style)) { + data.style = meta.style; + } + if (isString(meta.vspace)) { + data.vspace = meta.vspace; + } + if (isString(meta.border)) { + data.border = meta.border; + } + if (isString(meta.hspace)) { + data.hspace = meta.hspace; + } + if (isString(meta.borderstyle)) { + data.borderstyle = meta.borderstyle; + } + } + }; + var formFillFromMeta = function (info, api) { + var data = api.getData(); + var meta = data.src.meta; + if (meta !== undefined) { + var newData = deepMerge({}, data); + formFillFromMeta2(info, newData, meta); + api.setData(newData); + } + }; + var calculateImageSize = function (helpers, info, state, api) { + var data = api.getData(); + var url = data.src.value; + var meta = data.src.meta || {}; + if (!meta.width && !meta.height && info.hasDimensions) { + helpers.imageSize(url).get(function (result) { + result.each(function (size) { + if (state.open) { + api.setData({ dimensions: size }); + } + }); + }); + } + }; + var updateImagesDropdown = function (info, state, api) { + var data = api.getData(); + var image = ListUtils.findEntry(info.imageList, data.src.value); + state.prevImage = image; + api.setData({ + images: image.map(function (entry) { + return entry.value; + }).getOr('') + }); + }; + var changeSrc = function (helpers, info, state, api) { + addPrependUrl(info, api); + formFillFromMeta(info, api); + calculateImageSize(helpers, info, state, api); + updateImagesDropdown(info, state, api); + }; + var changeImages = function (helpers, info, state, api) { + var data = api.getData(); + var image = ListUtils.findEntry(info.imageList, data.images); + image.each(function (img) { + var updateAlt = data.alt === '' || state.prevImage.map(function (image) { + return image.text === data.alt; + }).getOr(false); + if (updateAlt) { + if (img.value === '') { + api.setData({ + src: img, + alt: state.prevAlt + }); + } else { + api.setData({ + src: img, + alt: img.text + }); + } + } else { + api.setData({ src: img }); + } + }); + state.prevImage = image; + changeSrc(helpers, info, state, api); + }; + var calcVSpace = function (css) { + var matchingTopBottom = css['margin-top'] && css['margin-bottom'] && css['margin-top'] === css['margin-bottom']; + return matchingTopBottom ? Utils.removePixelSuffix(String(css['margin-top'])) : ''; + }; + var calcHSpace = function (css) { + var matchingLeftRight = css['margin-right'] && css['margin-left'] && css['margin-right'] === css['margin-left']; + return matchingLeftRight ? Utils.removePixelSuffix(String(css['margin-right'])) : ''; + }; + var calcBorderWidth = function (css) { + return css['border-width'] ? Utils.removePixelSuffix(String(css['border-width'])) : ''; + }; + var calcBorderStyle = function (css) { + return css['border-style'] ? String(css['border-style']) : ''; + }; + var calcStyle = function (parseStyle, serializeStyle, css) { + return serializeStyle(parseStyle(serializeStyle(css))); + }; + var changeStyle2 = function (parseStyle, serializeStyle, data) { + var css = Utils.mergeMargins(parseStyle(data.style)); + var dataCopy = deepMerge({}, data); + dataCopy.vspace = calcVSpace(css); + dataCopy.hspace = calcHSpace(css); + dataCopy.border = calcBorderWidth(css); + dataCopy.borderstyle = calcBorderStyle(css); + dataCopy.style = calcStyle(parseStyle, serializeStyle, css); + return dataCopy; + }; + var changeStyle = function (helpers, api) { + var data = api.getData(); + var newData = changeStyle2(helpers.parseStyle, helpers.serializeStyle, data); + api.setData(newData); + }; + var changeAStyle = function (helpers, info, api) { + var data = deepMerge(fromImageData(info.image), api.getData()); + var style = getStyleValue(helpers.normalizeCss, toImageData(data)); + api.setData({ style: style }); + }; + var changeFileInput = function (helpers, info, state, api) { + var data = api.getData(); + api.block('Uploading image'); + head(data.fileinput).fold(function () { + api.unblock(); + }, function (file) { + var blobUri = domGlobals.URL.createObjectURL(file); + var uploader = Uploader({ + url: info.url, + basePath: info.basePath, + credentials: info.credentials, + handler: info.handler + }); + var finalize = function () { + api.unblock(); + domGlobals.URL.revokeObjectURL(blobUri); + }; + var updateSrcAndSwitchTab = function (url) { + api.setData({ + src: { + value: url, + meta: {} + } + }); + api.showTab('general'); + changeSrc(helpers, info, state, api); + }; + Utils.blobToDataUri(file).then(function (dataUrl) { + var blobInfo = helpers.createBlobCache(file, blobUri, dataUrl); + if (info.automaticUploads) { + uploader.upload(blobInfo).then(function (url) { + updateSrcAndSwitchTab(url); + finalize(); + }).catch(function (err) { + finalize(); + helpers.alertErr(api, err); + }); + } else { + helpers.addToBlobCache(blobInfo); + updateSrcAndSwitchTab(blobInfo.blobUri()); + api.unblock(); + } + }); + }); + }; + var changeHandler = function (helpers, info, state) { + return function (api, evt) { + if (evt.name === 'src') { + changeSrc(helpers, info, state, api); + } else if (evt.name === 'images') { + changeImages(helpers, info, state, api); + } else if (evt.name === 'alt') { + state.prevAlt = api.getData().alt; + } else if (evt.name === 'style') { + changeStyle(helpers, api); + } else if (evt.name === 'vspace' || evt.name === 'hspace' || evt.name === 'border' || evt.name === 'borderstyle') { + changeAStyle(helpers, info, api); + } else if (evt.name === 'fileinput') { + changeFileInput(helpers, info, state, api); + } else if (evt.name === 'isDecorative') { + if (api.getData().isDecorative) { + api.disable('alt'); + } else { + api.enable('alt'); + } + } + }; + }; + var closeHandler = function (state) { + return function () { + state.open = false; + }; + }; + var makeDialogBody = function (info) { + if (info.hasAdvTab || info.hasUploadUrl || info.hasUploadHandler) { + var tabPanel = { + type: 'tabpanel', + tabs: flatten([ + [MainTab.makeTab(info)], + info.hasAdvTab ? [AdvTab.makeTab(info)] : [], + info.hasUploadTab && (info.hasUploadUrl || info.hasUploadHandler) ? [UploadTab.makeTab(info)] : [] + ]) + }; + return tabPanel; + } else { + var panel = { + type: 'panel', + items: MainTab.makeItems(info) + }; + return panel; + } + }; + var makeDialog = function (helpers) { + return function (info) { + var state = createState(info); + return { + title: 'Insert/Edit Image', + size: 'normal', + body: makeDialogBody(info), + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: fromImageData(info.image), + onSubmit: helpers.onSubmit(info), + onChange: changeHandler(helpers, info, state), + onClose: closeHandler(state) + }; + }; + }; + var submitHandler = function (editor) { + return function (info) { + return function (api) { + var data = deepMerge(fromImageData(info.image), api.getData()); + editor.undoManager.transact(function () { + insertOrUpdateImage(editor, toImageData(data), info); + }); + editor.editorUpload.uploadImagesAuto(); + api.close(); + }; + }; + }; + var imageSize = function (editor) { + return function (url) { + return FutureResult.nu(function (completer) { + Utils.getImageSize(editor.documentBaseURI.toAbsolute(url), function (data) { + var result = data.map(function (dimensions) { + return { + width: String(dimensions.width), + height: String(dimensions.height) + }; + }); + completer(result); + }); + }); + }; + }; + var createBlobCache = function (editor) { + return function (file, blobUri, dataUrl) { + return editor.editorUpload.blobCache.create({ + blob: file, + blobUri: blobUri, + name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, + base64: dataUrl.split(',')[1] + }); + }; + }; + var addToBlobCache = function (editor) { + return function (blobInfo) { + editor.editorUpload.blobCache.add(blobInfo); + }; + }; + var alertErr = function (editor) { + return function (api, message) { + editor.windowManager.alert(message, api.close); + }; + }; + var normalizeCss$1 = function (editor) { + return function (cssText) { + return normalizeCss(editor, cssText); + }; + }; + var parseStyle = function (editor) { + return function (cssText) { + return editor.dom.parseStyle(cssText); + }; + }; + var serializeStyle = function (editor) { + return function (stylesArg, name) { + return editor.dom.serializeStyle(stylesArg, name); + }; + }; + var Dialog = function (editor) { + var helpers = { + onSubmit: submitHandler(editor), + imageSize: imageSize(editor), + addToBlobCache: addToBlobCache(editor), + createBlobCache: createBlobCache(editor), + alertErr: alertErr(editor), + normalizeCss: normalizeCss$1(editor), + parseStyle: parseStyle(editor), + serializeStyle: serializeStyle(editor) + }; + var open = function () { + return collect(editor).map(makeDialog(helpers)).get(function (spec) { + editor.windowManager.open(spec); + }); + }; + return { open: open }; + }; + + var register = function (editor) { + editor.addCommand('mceImage', Dialog(editor).open); + }; + var Commands = { register: register }; + + var hasImageClass = function (node) { + var className = node.attr('class'); + return className && /\bimage\b/.test(className); + }; + var toggleContentEditableState = function (state) { + return function (nodes) { + var i = nodes.length; + var toggleContentEditable = function (node) { + node.attr('contenteditable', state ? 'true' : null); + }; + while (i--) { + var node = nodes[i]; + if (hasImageClass(node)) { + node.attr('contenteditable', state ? 'false' : null); + global$5.each(node.getAll('figcaption'), toggleContentEditable); + } + } + }; + }; + var setup = function (editor) { + editor.on('PreInit', function () { + editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); + editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); + }); + }; + var FilterContent = { setup: setup }; + + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('image', { + icon: 'image', + tooltip: 'Insert/edit image', + onAction: Dialog(editor).open, + onSetup: function (buttonApi) { + return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object],[data-mce-placeholder]),figure.image', buttonApi.setActive).unbind; + } + }); + editor.ui.registry.addMenuItem('image', { + icon: 'image', + text: 'Image...', + onAction: Dialog(editor).open + }); + editor.ui.registry.addContextMenu('image', { + update: function (element) { + return isFigure(element) || isImage(element) && !Utils.isPlaceholderImage(element) ? ['image'] : []; + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global$1.add('image', function (editor) { + FilterContent.setup(editor); + Buttons.register(editor); + Commands.register(editor); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.min.js index 60adce7..f85686c 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/image/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("image",function(e){function t(e,t){function i(e,i){n.parentNode&&n.parentNode.removeChild(n),t({width:e,height:i})}var n=document.createElement("img");n.onload=function(){i(n.clientWidth,n.clientHeight)},n.onerror=function(){i()};var a=n.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(n),n.src=e}function i(t){return tinymce.each(t,function(t){t.textStyle=function(){return e.formatter.getCssText({inline:"img",classes:[t.value]})}}),t}function n(t){return function(){var i=e.settings.image_list;"string"==typeof i?tinymce.util.XHR.send({url:i,success:function(e){t(tinymce.util.JSON.parse(e))}}):"function"==typeof i?i(t):t(i)}}function a(n){function a(t,i,n){var a,l=[];return tinymce.each(e.settings[t]||n,function(e){var t={text:e.text||e.title,value:e.value};l.push(t),(f[i]===e.value||!a&&e.selected)&&(a=t)}),a&&!f[i]&&(f[i]=a.value,a.selected=!0),l}function l(){var t=[{text:"None",value:""}];return tinymce.each(n,function(i){t.push({text:i.text||i.title,value:e.convertURL(i.value||i.url,"src"),menu:i.menu})}),t}function o(){var e,t,i,n;e=u.find("#width")[0],t=u.find("#height")[0],i=e.value(),n=t.value(),u.find("#constrain")[0].checked()&&g&&h&&i&&n&&(g!=i?(n=Math.round(i/g*n),t.value(n)):(i=Math.round(n/h*i),e.value(i))),g=i,h=n}function s(){function t(t){function i(){t.onload=t.onerror=null,e.selection.select(t),e.nodeChanged()}t.onload=function(){f.width||f.height||y.setAttribs(t,{width:t.clientWidth,height:t.clientHeight}),i()},t.onerror=i}d(),o(),f=tinymce.extend(f,u.toJSON()),f.alt||(f.alt=""),""===f.width&&(f.width=null),""===f.height&&(f.height=null),f.style||(f.style=null),f={src:f.src,alt:f.alt,width:f.width,height:f.height,style:f.style,"class":f["class"]},f["class"]||delete f["class"],e.undoManager.transact(function(){return f.src?(v?y.setAttribs(v,f):(f.id="__mcenew",e.focus(),e.selection.setContent(y.createHTML("img",f)),v=y.get("__mcenew"),y.setAttrib(v,"id",null)),void t(v)):void(v&&(y.remove(v),e.focus(),e.nodeChanged()))})}function r(e){return e&&(e=e.replace(/px$/,"")),e}function c(){m&&m.value(e.convertURL(this.value(),"src")),t(this.value(),function(e){e.width&&e.height&&(g=e.width,h=e.height,u.find("#width").value(g),u.find("#height").value(h))})}function d(){function t(e){return e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e}if(e.settings.image_advtab){var i=u.toJSON(),n=y.parseStyle(i.style);delete n.margin,n["margin-top"]=n["margin-bottom"]=t(i.vspace),n["margin-left"]=n["margin-right"]=t(i.hspace),n["border-width"]=t(i.border),u.find("#style").value(y.serializeStyle(y.parseStyle(y.serializeStyle(n))))}}var u,g,h,m,p,f={},y=e.dom,v=e.selection.getNode();g=y.getAttrib(v,"width"),h=y.getAttrib(v,"height"),"IMG"!=v.nodeName||v.getAttribute("data-mce-object")||v.getAttribute("data-mce-placeholder")?v=null:f={src:y.getAttrib(v,"src"),alt:y.getAttrib(v,"alt"),"class":y.getAttrib(v,"class"),width:g,height:h},n&&(m={type:"listbox",label:"Image list",values:l(),value:f.src&&e.convertURL(f.src,"src"),onselect:function(e){var t=u.find("#alt");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),u.find("#src").value(e.control.value())},onPostRender:function(){m=this}}),e.settings.image_class_list&&(p={name:"class",type:"listbox",label:"Class",values:i(a("image_class_list","class"))});var b=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:c},m];e.settings.image_description!==!1&&b.push({name:"alt",type:"textbox",label:"Image description"}),e.settings.image_dimensions!==!1&&b.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:o,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:o,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),b.push(p),e.settings.image_advtab?(v&&(f.hspace=r(v.style.marginLeft||v.style.marginRight),f.vspace=r(v.style.marginTop||v.style.marginBottom),f.border=r(v.style.borderWidth),f.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(v,"style")))),u=e.windowManager.open({title:"Insert/edit image",data:f,bodyType:"tabpanel",body:[{title:"General",type:"form",items:b},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:d},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:s})):u=e.windowManager.open({title:"Insert/edit image",data:f,body:b,onSubmit:s})}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:n(a),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),e.addMenuItem("image",{icon:"image",text:"Insert image",onclick:n(a),context:"insert",prependToContext:!0})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(s){"use strict";function o(){}function a(t){return function(){return t}}function t(t){return t}function e(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=a(!1),c=a(!0),l=(n={fold:function(t,e){return t()},is:u,isSome:u,isNone:c,getOr:d,getOrThunk:f,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:d,orThunk:f,map:e,each:o,bind:e,exists:u,forall:c,filter:e,equals:i,equals_:i,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(n),n);function i(t){return t.isNone()}function f(t){return t()}function d(t){return t}function m(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}}function T(t){for(var e=[],n=0,r=t.length;n= 300 ? Errors.handleServiceErrorResponse(result.status, result.blob) : global$3.resolve(result.blob); + }); + }; + function requestBlob(url, withCredentials) { + return Utils.requestUrlAsBlob(url, {}, withCredentials).then(function (result) { + return result.status < 200 || result.status >= 300 ? Errors.handleHttpError(result.status) : global$3.resolve(result.blob); + }); + } + var getUrl = function (url, apiKey, withCredentials) { + return apiKey ? requestServiceBlob(url, apiKey) : requestBlob(url, withCredentials); + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var isOS = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains(uastring, 'msie') || contains(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains(uastring, 'iphone') || contains(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var ELEMENT$1 = ELEMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + + var regularContains = function (e1, e2) { + var d1 = e1.dom(); + var d2 = e2.dom(); + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$1 = browser.isIE() ? ieContains : regularContains; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var child = function (scope, predicate) { + var pred = function (node) { + return predicate(Element.fromDom(node)); + }; + var result = find(scope.dom().childNodes, pred); + return result.map(Element.fromDom); + }; + + var child$1 = function (scope, selector) { + return child(scope, function (e) { + return is(e, selector); + }); + }; + + var count = 0; + var getFigureImg = function (elem) { + return child$1(Element.fromDom(elem), 'img'); + }; + var isFigure = function (editor, elem) { + return editor.dom.is(elem, 'figure'); + }; + var getEditableImage = function (editor, elem) { + var isImage = function (imgNode) { + return editor.dom.is(imgNode, 'img:not([data-mce-object],[data-mce-placeholder])'); + }; + var isEditable = function (imgNode) { + return isImage(imgNode) && (isLocalImage(editor, imgNode) || isCorsImage(editor, imgNode) || editor.settings.imagetools_proxy); + }; + if (isFigure(editor, elem)) { + var imgOpt = getFigureImg(elem); + return imgOpt.map(function (img) { + return isEditable(img.dom()) ? Option.some(img.dom()) : Option.none(); + }); + } + return isEditable(elem) ? Option.some(elem) : Option.none(); + }; + var displayError = function (editor, error) { + editor.notificationManager.open({ + text: error, + type: 'error' + }); + }; + var getSelectedImage = function (editor) { + var elem = editor.selection.getNode(); + if (isFigure(editor, elem)) { + return getFigureImg(elem); + } else { + return Option.some(Element.fromDom(elem)); + } + }; + var extractFilename = function (editor, url) { + var m = url.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i); + if (m) { + return editor.dom.encode(m[1]); + } + return null; + }; + var createId = function () { + return 'imagetools' + count++; + }; + var isLocalImage = function (editor, img) { + var url = img.src; + return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$4(url).host === editor.documentBaseURI.host; + }; + var isCorsImage = function (editor, img) { + return global$1.inArray(getCorsHosts(editor), new global$4(img.src).host) !== -1; + }; + var isCorsWithCredentialsImage = function (editor, img) { + return global$1.inArray(getCredentialsHosts(editor), new global$4(img.src).host) !== -1; + }; + var defaultFetchImage = function (editor, img) { + var src = img.src, apiKey; + if (isCorsImage(editor, img)) { + return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img)); + } + if (!isLocalImage(editor, img)) { + src = getProxyUrl(editor); + src += (src.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src); + apiKey = getApiKey(editor); + return getUrl(src, apiKey, false); + } + return imageToBlob$1(img); + }; + var imageToBlob$2 = function (editor, img) { + return getFetchImage(editor).fold(function () { + return defaultFetchImage(editor, img); + }, function (customFetchImage) { + return customFetchImage(img); + }); + }; + var findBlob = function (editor, img) { + var blobInfo; + blobInfo = editor.editorUpload.blobCache.getByUri(img.src); + if (blobInfo) { + return global$3.resolve(blobInfo.blob()); + } + return imageToBlob$2(editor, img); + }; + var startTimedUpload = function (editor, imageUploadTimerState) { + var imageUploadTimer = global$2.setEditorTimeout(editor, function () { + editor.editorUpload.uploadImagesAuto(); + }, getUploadTimeout(editor)); + imageUploadTimerState.set(imageUploadTimer); + }; + var cancelTimedUpload = function (imageUploadTimerState) { + global$2.clearTimeout(imageUploadTimerState.get()); + }; + var updateSelectedImage = function (editor, ir, uploadImmediately, imageUploadTimerState, selectedImage, size) { + return ir.toBlob().then(function (blob) { + var uri, name, blobCache, blobInfo; + blobCache = editor.editorUpload.blobCache; + uri = selectedImage.src; + if (shouldReuseFilename(editor)) { + blobInfo = blobCache.getByUri(uri); + if (blobInfo) { + uri = blobInfo.uri(); + name = blobInfo.name(); + } else { + name = extractFilename(editor, uri); + } + } + blobInfo = blobCache.create({ + id: createId(), + blob: blob, + base64: ir.toBase64(), + uri: uri, + name: name + }); + blobCache.add(blobInfo); + editor.undoManager.transact(function () { + function imageLoadedHandler() { + editor.$(selectedImage).off('load', imageLoadedHandler); + editor.nodeChanged(); + if (uploadImmediately) { + editor.editorUpload.uploadImagesAuto(); + } else { + cancelTimedUpload(imageUploadTimerState); + startTimedUpload(editor, imageUploadTimerState); + } + } + editor.$(selectedImage).on('load', imageLoadedHandler); + if (size) { + editor.$(selectedImage).attr({ + width: size.w, + height: size.h + }); + } + editor.$(selectedImage).attr({ src: blobInfo.blobUri() }).removeAttr('data-mce-src'); + }); + return blobInfo; + }); + }; + var selectedImageOperation = function (editor, imageUploadTimerState, fn, size) { + return function () { + var imgOpt = getSelectedImage(editor); + return imgOpt.fold(function () { + displayError(editor, 'Could not find selected image'); + }, function (img) { + return editor._scanForImages().then(function () { + return findBlob(editor, img.dom()); + }).then(blobToImageResult).then(fn).then(function (imageResult) { + return updateSelectedImage(editor, imageResult, false, imageUploadTimerState, img.dom(), size); + }, function (error) { + displayError(editor, error); + }); + }); + }; + }; + var rotate$2 = function (editor, imageUploadTimerState, angle) { + return function () { + var imgOpt = getSelectedImage(editor); + var flippedSize = imgOpt.fold(function () { + return null; + }, function (img) { + var size = ImageSize.getImageSize(img.dom()); + return size ? { + w: size.h, + h: size.w + } : null; + }); + return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { + return rotate$1(imageResult, angle); + }, flippedSize)(); + }; + }; + var flip$2 = function (editor, imageUploadTimerState, axis) { + return function () { + return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { + return flip$1(imageResult, axis); + })(); + }; + }; + var handleDialogBlob = function (editor, imageUploadTimerState, img, originalSize, blob) { + return new global$3(function (resolve) { + blobToImage$1(blob).then(function (newImage) { + var newSize = ImageSize.getNaturalImageSize(newImage); + if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) { + if (ImageSize.getImageSize(img)) { + ImageSize.setImageSize(img, newSize); + } + } + domGlobals.URL.revokeObjectURL(newImage.src); + return blob; + }).then(blobToImageResult).then(function (imageResult) { + return updateSelectedImage(editor, imageResult, true, imageUploadTimerState, img); + }, function () { + }); + }); + }; + var Actions = { + rotate: rotate$2, + flip: flip$2, + getEditableImage: getEditableImage, + cancelTimedUpload: cancelTimedUpload, + findBlob: findBlob, + getSelectedImage: getSelectedImage, + handleDialogBlob: handleDialogBlob + }; + + var saveState = constant('save-state'); + var disable = constant('disable'); + var enable = constant('enable'); + + var createState = function (blob) { + return { + blob: blob, + url: domGlobals.URL.createObjectURL(blob) + }; + }; + var makeOpen = function (editor, imageUploadTimerState) { + return function () { + var getLoadedSpec = function (currentState) { + return { + title: 'Edit Image', + size: 'large', + body: { + type: 'panel', + items: [{ + type: 'imagetools', + name: 'imagetools', + label: 'Edit Image', + currentState: currentState + }] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true, + disabled: true + } + ], + onSubmit: function (api) { + var blob = api.getData().imagetools.blob; + originalImgOpt.each(function (originalImg) { + originalSizeOpt.each(function (originalSize) { + Actions.handleDialogBlob(editor, imageUploadTimerState, originalImg.dom(), originalSize, blob); + }); + }); + api.close(); + }, + onCancel: function () { + }, + onAction: function (api, details) { + switch (details.name) { + case saveState(): + if (details.value) { + api.enable('save'); + } else { + api.disable('save'); + } + break; + case disable(): + api.disable('save'); + api.disable('cancel'); + break; + case enable(): + api.enable('cancel'); + break; + } + } + }; + }; + var originalImgOpt = Actions.getSelectedImage(editor); + var originalSizeOpt = originalImgOpt.map(function (origImg) { + return ImageSize.getNaturalImageSize(origImg.dom()); + }); + var imgOpt = Actions.getSelectedImage(editor); + imgOpt.each(function (img) { + Actions.getEditableImage(editor, img.dom()).each(function (_) { + Actions.findBlob(editor, img.dom()).then(function (blob) { + var state = createState(blob); + editor.windowManager.open(getLoadedSpec(state)); + }); + }); + }); + }; + }; + var Dialog = { makeOpen: makeOpen }; + + var register = function (editor, imageUploadTimerState) { + global$1.each({ + mceImageRotateLeft: Actions.rotate(editor, imageUploadTimerState, -90), + mceImageRotateRight: Actions.rotate(editor, imageUploadTimerState, 90), + mceImageFlipVertical: Actions.flip(editor, imageUploadTimerState, 'v'), + mceImageFlipHorizontal: Actions.flip(editor, imageUploadTimerState, 'h'), + mceEditImage: Dialog.makeOpen(editor, imageUploadTimerState) + }, function (fn, cmd) { + editor.addCommand(cmd, fn); + }); + }; + var Commands = { register: register }; + + var setup = function (editor, imageUploadTimerState, lastSelectedImageState) { + editor.on('NodeChange', function (e) { + var lastSelectedImage = lastSelectedImageState.get(); + if (lastSelectedImage && lastSelectedImage.src !== e.element.src) { + Actions.cancelTimedUpload(imageUploadTimerState); + editor.editorUpload.uploadImagesAuto(); + lastSelectedImageState.set(null); + } + Actions.getEditableImage(editor, e.element).each(lastSelectedImageState.set); + }); + }; + var UploadSelectedImage = { setup: setup }; + + var register$1 = function (editor) { + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + editor.ui.registry.addButton('rotateleft', { + tooltip: 'Rotate counterclockwise', + icon: 'rotate-left', + onAction: cmd('mceImageRotateLeft') + }); + editor.ui.registry.addButton('rotateright', { + tooltip: 'Rotate clockwise', + icon: 'rotate-right', + onAction: cmd('mceImageRotateRight') + }); + editor.ui.registry.addButton('flipv', { + tooltip: 'Flip vertically', + icon: 'flip-vertically', + onAction: cmd('mceImageFlipVertical') + }); + editor.ui.registry.addButton('fliph', { + tooltip: 'Flip horizontally', + icon: 'flip-horizontally', + onAction: cmd('mceImageFlipHorizontal') + }); + editor.ui.registry.addButton('editimage', { + tooltip: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage'), + onSetup: function (buttonApi) { + var setDisabled = function () { + var elementOpt = Actions.getSelectedImage(editor); + elementOpt.each(function (element) { + var disabled = Actions.getEditableImage(editor, element.dom()).isNone(); + buttonApi.setDisabled(disabled); + }); + }; + editor.on('NodeChange', setDisabled); + return function () { + editor.off('NodeChange', setDisabled); + }; + } + }); + editor.ui.registry.addButton('imageoptions', { + tooltip: 'Image options', + icon: 'image-options', + onAction: cmd('mceImage') + }); + editor.ui.registry.addContextMenu('imagetools', { + update: function (element) { + return Actions.getEditableImage(editor, element).fold(function () { + return []; + }, function (_) { + return [{ + text: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage') + }]; + }); + } + }); + }; + var Buttons = { register: register$1 }; + + var register$2 = function (editor) { + editor.ui.registry.addContextToolbar('imagetools', { + items: getToolbarItems(editor), + predicate: function (elem) { + return Actions.getEditableImage(editor, elem).isSome(); + }, + position: 'node', + scope: 'node' + }); + }; + var ContextToolbar = { register: register$2 }; + + function Plugin () { + global.add('imagetools', function (editor) { + var imageUploadTimerState = Cell(0); + var lastSelectedImageState = Cell(null); + Commands.register(editor, imageUploadTimerState); + Buttons.register(editor); + ContextToolbar.register(editor); + UploadSelectedImage.setup(editor, imageUploadTimerState, lastSelectedImageState); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/imagetools/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/imagetools/plugin.min.js new file mode 100644 index 0000000..751f13b --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/imagetools/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(v){"use strict";function e(){}function n(){return c}var t,r=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return function(){return e}},u=d(!1),a=d(!0),c=(t={fold:function(e,n){return e()},is:u,isSome:u,isNone:a,getOr:l,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:l,orThunk:f,map:n,each:e,bind:n,exists:u,forall:a,filter:n,equals:s,equals_:s,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(t),t);function s(e){return e.isNone()}function f(e){return e()}function l(e){return e}var m=function(t){function e(){return o}function n(e){return e(t)}var r=d(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return m(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:c},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,function(e){return n(t,e)})}};return o},p={some:m,none:n,from:function(e){return null===e||e===undefined?c:m(e)}};function h(e,n){return y(v.document.createElement("canvas"),e,n)}function g(e){var n=h(e.width,e.height);return w(n).drawImage(e,0,0),n}function w(e){return e.getContext("2d")}function y(e,n,t){return e.width=n,e.height=t,e}var b,O,E=window.Promise?window.Promise:(b=T.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){v.setTimeout(e,1)},O=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},T.prototype["catch"]=function(e){return this.then(null,e)},T.prototype.then=function(t,r){var o=this;return new T(function(e,n){N.call(o,new R(t,r,e,n))})},T.all=function(){for(var e=[],n=0;n 0) { + global$4.each(selectorGroups, function (group) { + var menuItem = processSelector(selector, group); + if (menuItem) { + model.addItemToGroup(group.title, menuItem); + } + }); + } else { + var menuItem = processSelector(selector, null); + if (menuItem) { + model.addItem(menuItem); + } + } + } + } + }); + var items = model.toFormats(); + editor.fire('addStyleModifications', { + items: items, + replace: !Settings.shouldAppend(editor) + }); + }); + }; + var ImportCss = { + defaultConvertSelectorToFormat: defaultConvertSelectorToFormat, + setup: setup + }; + + var get = function (editor) { + var convertSelectorToFormat = function (selectorText) { + return ImportCss.defaultConvertSelectorToFormat(editor, selectorText); + }; + return { convertSelectorToFormat: convertSelectorToFormat }; + }; + var Api = { get: get }; + + function Plugin () { + global.add('importcss', function (editor) { + ImportCss.setup(editor); + return Api.get(editor); + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/importcss/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/importcss/plugin.min.js index 5dd1d44..903fc5d 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/importcss/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/importcss/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("importcss",function(t){function e(t){return"string"==typeof t?function(e){return-1!==e.indexOf(t)}:t instanceof RegExp?function(e){return t.test(e)}:t}function n(e,n){function i(t,e){var c,o=t.href;if(o&&n(o,e)){s(t.imports,function(t){i(t,!0)});try{c=t.cssRules||t.rules}catch(a){}s(c,function(t){t.styleSheet?i(t.styleSheet,!0):t.selectorText&&s(t.selectorText.split(","),function(t){r.push(tinymce.trim(t))})})}}var r=[],c={};s(t.contentCSS,function(t){c[t]=!0}),n||(n=function(t,e){return e||c[t]});try{s(e.styleSheets,function(t){i(t)})}catch(o){}return r}function i(e){var n,i=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(i){var r=i[1],s=i[2].substr(1).split(".").join(" "),c=tinymce.makeMap("a,img");return i[1]?(n={title:e},t.schema.getTextBlockElements()[r]?n.block=r:t.schema.getBlockElements()[r]||c[r.toLowerCase()]?n.selector=r:n.inline=r):i[2]&&(n={inline:"span",title:e.substr(1),classes:s}),t.settings.importcss_merge_classes!==!1?n.classes=s:n.attributes={"class":s},n}}var r=this,s=tinymce.each;t.on("renderFormatsMenu",function(c){var o=t.settings,a={},l=o.importcss_selector_converter||i,f=e(o.importcss_selector_filter),m=c.control;t.settings.importcss_append||m.items().remove();var u=[];tinymce.each(o.importcss_groups,function(t){t=tinymce.extend({},t),t.filter=e(t.filter),u.push(t)}),s(n(c.doc||t.getDoc(),e(o.importcss_file_filter)),function(e){if(-1===e.indexOf(".mce-")&&!a[e]&&(!f||f(e))){var n,i=l.call(r,e);if(i){var s=i.name||tinymce.DOM.uniqueId();if(u)for(var c=0;c' + html + ''; - - var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); - if (timeElm) { - editor.dom.setOuterHTML(timeElm, html); - return; - } - } - - editor.insertContent(html); - } - - editor.addCommand('mceInsertDate', function() { - insertDateTime(editor.getParam("insertdatetime_dateformat", editor.translate("%Y-%m-%d"))); - }); - - editor.addCommand('mceInsertTime', function() { - insertDateTime(editor.getParam("insertdatetime_timeformat", editor.translate('%H:%M:%S'))); - }); - - editor.addButton('insertdatetime', { - type: 'splitbutton', - title: 'Insert date/time', - onclick: function() { - insertDateTime(lastFormat || defaultButtonTimeFormat); - }, - menu: menuItems - }); - - tinymce.each(editor.settings.insertdatetime_formats || [ - "%H:%M:%S", - "%Y-%m-%d", - "%I:%M:%S %p", - "%D" - ], function(fmt) { - if (!defaultButtonTimeFormat) { - defaultButtonTimeFormat = fmt; - } - - menuItems.push({ - text: getDateTime(fmt), - onclick: function() { - lastFormat = fmt; - insertDateTime(fmt); - } - }); - }); - - editor.addMenuItem('insertdatetime', { - icon: 'date', - text: 'Insert date/time', - menu: menuItems, - context: 'insert' - }); -}); +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var getDateFormat = function (editor) { + return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d')); + }; + var getTimeFormat = function (editor) { + return editor.getParam('insertdatetime_timeformat', editor.translate('%H:%M:%S')); + }; + var getFormats = function (editor) { + return editor.getParam('insertdatetime_formats', [ + '%H:%M:%S', + '%Y-%m-%d', + '%I:%M:%S %p', + '%D' + ]); + }; + var getDefaultDateTime = function (editor) { + var formats = getFormats(editor); + return formats.length > 0 ? formats[0] : getTimeFormat(editor); + }; + var shouldInsertTimeElement = function (editor) { + return editor.getParam('insertdatetime_element', false); + }; + var Settings = { + getDateFormat: getDateFormat, + getTimeFormat: getTimeFormat, + getFormats: getFormats, + getDefaultDateTime: getDefaultDateTime, + shouldInsertTimeElement: shouldInsertTimeElement + }; + + var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); + var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' '); + var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); + var monthsLong = 'January February March April May June July August September October November December'.split(' '); + var addZeros = function (value, len) { + value = '' + value; + if (value.length < len) { + for (var i = 0; i < len - value.length; i++) { + value = '0' + value; + } + } + return value; + }; + var getDateTime = function (editor, fmt, date) { + date = date || new Date(); + fmt = fmt.replace('%D', '%m/%d/%Y'); + fmt = fmt.replace('%r', '%I:%M:%S %p'); + fmt = fmt.replace('%Y', '' + date.getFullYear()); + fmt = fmt.replace('%y', '' + date.getYear()); + fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); + fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); + fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); + fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); + fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); + fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); + fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); + fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); + fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); + fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); + fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); + fmt = fmt.replace('%%', '%'); + return fmt; + }; + var updateElement = function (editor, timeElm, computerTime, userTime) { + var newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime); + timeElm.parentNode.insertBefore(newTimeElm, timeElm); + editor.dom.remove(timeElm); + editor.selection.select(newTimeElm, true); + editor.selection.collapse(false); + }; + var insertDateTime = function (editor, format) { + if (Settings.shouldInsertTimeElement(editor)) { + var userTime = getDateTime(editor, format); + var computerTime = void 0; + if (/%[HMSIp]/.test(format)) { + computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M'); + } else { + computerTime = getDateTime(editor, '%Y-%m-%d'); + } + var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); + if (timeElm) { + updateElement(editor, timeElm, computerTime, userTime); + } else { + editor.insertContent(''); + } + } else { + editor.insertContent(getDateTime(editor, format)); + } + }; + var Actions = { + insertDateTime: insertDateTime, + getDateTime: getDateTime + }; + + var register = function (editor) { + editor.addCommand('mceInsertDate', function () { + Actions.insertDateTime(editor, Settings.getDateFormat(editor)); + }); + editor.addCommand('mceInsertTime', function () { + Actions.insertDateTime(editor, Settings.getTimeFormat(editor)); + }); + }; + var Commands = { register: register }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var register$1 = function (editor) { + var formats = Settings.getFormats(editor); + var defaultFormat = Cell(Settings.getDefaultDateTime(editor)); + editor.ui.registry.addSplitButton('insertdatetime', { + icon: 'insert-time', + tooltip: 'Insert date/time', + select: function (value) { + return value === defaultFormat.get(); + }, + fetch: function (done) { + done(global$1.map(formats, function (format) { + return { + type: 'choiceitem', + text: Actions.getDateTime(editor, format), + value: format + }; + })); + }, + onAction: function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + Actions.insertDateTime(editor, defaultFormat.get()); + }, + onItemAction: function (_, value) { + defaultFormat.set(value); + Actions.insertDateTime(editor, value); + } + }); + var makeMenuItemHandler = function (format) { + return function () { + defaultFormat.set(format); + Actions.insertDateTime(editor, format); + }; + }; + editor.ui.registry.addNestedMenuItem('insertdatetime', { + icon: 'insert-time', + text: 'Date/time', + getSubmenuItems: function () { + return global$1.map(formats, function (format) { + return { + type: 'menuitem', + text: Actions.getDateTime(editor, format), + onAction: makeMenuItemHandler(format) + }; + }); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('insertdatetime', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/insertdatetime/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/insertdatetime/plugin.min.js index 6b17008..74143b8 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/insertdatetime/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/insertdatetime/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("insertdatetime",function(e){function t(t,a){function n(e,t){if(e=""+e,e.length'+n+"";var i=e.dom.getParent(e.selection.getStart(),"time");if(i)return void e.dom.setOuterHTML(i,n)}e.insertContent(n)}var n,r,i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),u=[];e.addCommand("mceInsertDate",function(){a(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){a(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){a(n||r)},menu:u}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){r||(r=e),u.push({text:t(e),onclick:function(){n=e,a(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:u,context:"insert"})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function n(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function r(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function a(e,t){if((e=""+e).length'+n+"")}else e.insertContent(i(e,t))},g=i,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,o(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},v=function(n){var t=u(n),r=S(c(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - if (z[ci] > 0) { - nl[ci].style.zIndex = z[ci] - 1; - } - } - } else { - // Move forward - - // Try find a higher one - for (i = 0; i < z.length; i++) { - if (z[i] > z[ci]) { - fi = i; - break; - } - } - - if (fi > -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - nl[ci].style.zIndex = z[ci] + 1; - } - } - - editor.execCommand('mceRepaint'); - } - - function insertLayer() { - var dom = editor.dom, p = dom.getPos(dom.getParent(editor.selection.getNode(), '*')); - var body = editor.getBody(); - - editor.dom.add(body, 'div', { - style: { - position: 'absolute', - left: p.x, - top: (p.y > 20 ? p.y : 20), - width: 100, - height: 100 - }, - 'class': 'mceItemVisualAid mceItemLayer' - }, editor.selection.getContent() || editor.getLang('layer.content')); - - // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 - if (tinymce.Env.ie) { - dom.setHTML(body, body.innerHTML); - } - } - - function toggleAbsolute() { - var le = getParentLayer(editor.selection.getNode()); - - if (!le) { - le = editor.dom.getParent(editor.selection.getNode(), 'DIV,P,IMG'); - } - - if (le) { - if (le.style.position.toLowerCase() == "absolute") { - editor.dom.setStyles(le, { - position: '', - left: '', - top: '', - width: '', - height: '' - }); - - editor.dom.removeClass(le, 'mceItemVisualAid'); - editor.dom.removeClass(le, 'mceItemLayer'); - } else { - if (!le.style.left) { - le.style.left = 20 + 'px'; - } - - if (!le.style.top) { - le.style.top = 20 + 'px'; - } - - if (!le.style.width) { - le.style.width = le.width ? (le.width + 'px') : '100px'; - } - - if (!le.style.height) { - le.style.height = le.height ? (le.height + 'px') : '100px'; - } - - le.style.position = "absolute"; - - editor.dom.setAttrib(le, 'data-mce-style', ''); - editor.addVisual(editor.getBody()); - } - - editor.execCommand('mceRepaint'); - editor.nodeChanged(); - } - } - - // Register commands - editor.addCommand('mceInsertLayer', insertLayer); - - editor.addCommand('mceMoveForward', function() { - move(1); - }); - - editor.addCommand('mceMoveBackward', function() { - move(-1); - }); - - editor.addCommand('mceMakeAbsolute', function() { - toggleAbsolute(); - }); - - // Register buttons - editor.addButton('moveforward', {title: 'layer.forward_desc', cmd: 'mceMoveForward'}); - editor.addButton('movebackward', {title: 'layer.backward_desc', cmd: 'mceMoveBackward'}); - editor.addButton('absolute', {title: 'layer.absolute_desc', cmd: 'mceMakeAbsolute'}); - editor.addButton('insertlayer', {title: 'layer.insertlayer_desc', cmd: 'mceInsertLayer'}); - - editor.on('init', function() { - if (tinymce.Env.ie) { - editor.getDoc().execCommand('2D-Position', false, true); - } - }); - - // Remove serialized styles when selecting a layer since it might be changed by a drag operation - editor.on('mouseup', function(e) { - var layer = getParentLayer(e.target); - - if (layer) { - editor.dom.setAttrib(layer, 'data-mce-style', ''); - } - }); - - // Fixes edit focus issues with layers on Gecko - // This will enable designMode while inside a layer and disable it when outside - editor.on('mousedown', function(e) { - var node = e.target, doc = editor.getDoc(), parent; - - if (tinymce.Env.gecko) { - if (getParentLayer(node)) { - if (doc.designMode !== 'on') { - doc.designMode = 'on'; - - // Repaint caret - node = doc.body; - parent = node.parentNode; - parent.removeChild(node); - parent.appendChild(node); - } - } else if (doc.designMode == 'on') { - doc.designMode = 'off'; - } - } - }); - - editor.on('NodeChange', visualAid); -}); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/layer/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/layer/plugin.min.js deleted file mode 100644 index f100292..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/layer/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function o(t){var o=e.dom;tinymce.each(o.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?o.addClass(e,"mceItemVisualAid"):o.removeClass(e,"mceItemVisualAid"),o.addClass(e,"mceItemLayer"))})}function d(o){var d,n,a=[],i=t(e.selection.getNode()),s=-1,l=-1;for(n=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&n.push(e)},"childNodes"),d=0;ds&&n[d]==i&&(s=d);if(0>o){for(d=0;d-1?(n[s].style.zIndex=a[l],n[l].style.zIndex=a[s]):a[s]>0&&(n[s].style.zIndex=a[s]-1)}else{for(d=0;da[s]){l=d;break}l>-1?(n[s].style.zIndex=a[l],n[l].style.zIndex=a[s]):n[s].style.zIndex=a[s]+1}e.execCommand("mceRepaint")}function n(){var t=e.dom,o=t.getPos(t.getParent(e.selection.getNode(),"*")),d=e.getBody();e.dom.add(d,"div",{style:{position:"absolute",left:o.x,top:o.y>20?o.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(d,d.innerHTML)}function a(){var o=t(e.selection.getNode());o||(o=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),o&&("absolute"==o.style.position.toLowerCase()?(e.dom.setStyles(o,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(o,"mceItemVisualAid"),e.dom.removeClass(o,"mceItemLayer")):(o.style.left||(o.style.left="20px"),o.style.top||(o.style.top="20px"),o.style.width||(o.style.width=o.width?o.width+"px":"100px"),o.style.height||(o.style.height=o.height?o.height+"px":"100px"),o.style.position="absolute",e.dom.setAttrib(o,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",n),e.addCommand("mceMoveForward",function(){d(1)}),e.addCommand("mceMoveBackward",function(){d(-1)}),e.addCommand("mceMakeAbsolute",function(){a()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(o){var d=t(o.target);d&&e.dom.setAttrib(d,"data-mce-style","")}),e.on("mousedown",function(o){var d,n=o.target,a=e.getDoc();tinymce.Env.gecko&&(t(n)?"on"!==a.designMode&&(a.designMode="on",n=a.body,d=n.parentNode,d.removeChild(n),d.appendChild(n)):"on"==a.designMode&&(a.designMode="off"))}),e.on("NodeChange",o)}); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.js index 20939bd..0f20826 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.js @@ -1,110 +1,184 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align - * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash - * - * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are - * not apart of the newer specifications for HTML and XHTML. + * Version: 5.2.1 (2020-03-25) */ +(function () { + 'use strict'; -/*global tinymce:true */ - -(function(tinymce) { - // Override inline_styles setting to force TinyMCE to produce deprecated contents - tinymce.on('AddEditor', function(e) { - e.editor.settings.inline_styles = false; - }); - - tinymce.PluginManager.add('legacyoutput', function(editor) { - editor.on('init', function() { - var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', - fontSizes = tinymce.explode(editor.settings.font_size_style_values), - schema = editor.schema; - - // Override some internal formats to produce legacy elements and attributes - editor.formatter.register({ - // Change alignment formats to use the deprecated align attribute - alignleft: {selector: alignElements, attributes: {align: 'left'}}, - aligncenter: {selector: alignElements, attributes: {align: 'center'}}, - alignright: {selector: alignElements, attributes: {align: 'right'}}, - alignjustify: {selector: alignElements, attributes: {align: 'justify'}}, - - // Change the basic formatting elements to use deprecated element types - bold: [ - {inline: 'b', remove: 'all'}, - {inline: 'strong', remove: 'all'}, - {inline: 'span', styles: {fontWeight: 'bold'}} - ], - italic: [ - {inline: 'i', remove: 'all'}, - {inline: 'em', remove: 'all'}, - {inline: 'span', styles: {fontStyle: 'italic'}} - ], - underline: [ - {inline: 'u', remove: 'all'}, - {inline: 'span', styles: {textDecoration: 'underline'}, exact: true} - ], - strikethrough: [ - {inline: 'strike', remove: 'all'}, - {inline: 'span', styles: {textDecoration: 'line-through'}, exact: true} - ], - - // Change font size and font family to use the deprecated font element - fontname: {inline: 'font', attributes: {face: '%value'}}, - fontsize: { - inline: 'font', - attributes: { - size: function(vars) { - return tinymce.inArray(fontSizes, vars.value) + 1; - } - } - }, - - // Setup font elements for colors as well - forecolor: {inline: 'font', attributes: {color: '%value'}}, - hilitecolor: {inline: 'font', styles: {backgroundColor: '%value'}} - }); + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - // Check that deprecated elements are allowed if not add them - tinymce.each('b,i,u,strike'.split(','), function(name) { - schema.addValidElements(name + '[*]'); - }); + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - // Add font element if it's missing - if (!schema.getElementRule("font")) { - schema.addValidElements("font[face|size|color|style]"); - } + var getFontSizeFormats = function (editor) { + return editor.getParam('fontsize_formats'); + }; + var setFontSizeFormats = function (editor, fontsize_formats) { + editor.settings.fontsize_formats = fontsize_formats; + }; + var getFontFormats = function (editor) { + return editor.getParam('font_formats'); + }; + var setFontFormats = function (editor, font_formats) { + editor.settings.font_formats = font_formats; + }; + var getFontSizeStyleValues = function (editor) { + return editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large'); + }; + var setInlineStyles = function (editor, inline_styles) { + editor.settings.inline_styles = inline_styles; + }; + var Settings = { + getFontFormats: getFontFormats, + getFontSizeFormats: getFontSizeFormats, + setFontSizeFormats: setFontSizeFormats, + setFontFormats: setFontFormats, + getFontSizeStyleValues: getFontSizeStyleValues, + setInlineStyles: setInlineStyles + }; - // Add the missing and depreacted align attribute for the serialization engine - tinymce.each(alignElements.split(','), function(name) { - var rule = schema.getElementRule(name); + var overrideFormats = function (editor) { + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global$1.explode(Settings.getFontSizeStyleValues(editor)), schema = editor.schema; + editor.formatter.register({ + alignleft: { + selector: alignElements, + attributes: { align: 'left' } + }, + aligncenter: { + selector: alignElements, + attributes: { align: 'center' } + }, + alignright: { + selector: alignElements, + attributes: { align: 'right' } + }, + alignjustify: { + selector: alignElements, + attributes: { align: 'justify' } + }, + bold: [ + { + inline: 'b', + remove: 'all' + }, + { + inline: 'strong', + remove: 'all' + }, + { + inline: 'span', + styles: { fontWeight: 'bold' } + } + ], + italic: [ + { + inline: 'i', + remove: 'all' + }, + { + inline: 'em', + remove: 'all' + }, + { + inline: 'span', + styles: { fontStyle: 'italic' } + } + ], + underline: [ + { + inline: 'u', + remove: 'all' + }, + { + inline: 'span', + styles: { textDecoration: 'underline' }, + exact: true + } + ], + strikethrough: [ + { + inline: 'strike', + remove: 'all' + }, + { + inline: 'span', + styles: { textDecoration: 'line-through' }, + exact: true + } + ], + fontname: { + inline: 'font', + toggle: false, + attributes: { face: '%value' } + }, + fontsize: { + inline: 'font', + toggle: false, + attributes: { + size: function (vars) { + return String(global$1.inArray(fontSizes, vars.value) + 1); + } + } + }, + forecolor: { + inline: 'font', + attributes: { color: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + hilitecolor: { + inline: 'font', + styles: { backgroundColor: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + } + }); + global$1.each('b,i,u,strike'.split(','), function (name) { + schema.addValidElements(name + '[*]'); + }); + if (!schema.getElementRule('font')) { + schema.addValidElements('font[face|size|color|style]'); + } + global$1.each(alignElements.split(','), function (name) { + var rule = schema.getElementRule(name); + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); + }; + var overrideSettings = function (editor) { + var defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7'; + var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats'; + Settings.setInlineStyles(editor, false); + if (!Settings.getFontSizeFormats(editor)) { + Settings.setFontSizeFormats(editor, defaultFontsizeFormats); + } + if (!Settings.getFontFormats(editor)) { + Settings.setFontFormats(editor, defaultFontsFormats); + } + }; + var setup = function (editor) { + overrideSettings(editor); + editor.on('PreInit', function () { + return overrideFormats(editor); + }); + }; + var Formats = { setup: setup }; - if (rule) { - if (!rule.attributes.align) { - rule.attributes.align = {}; - rule.attributesOrder.push('align'); - } - } - }); + function Plugin () { + global.add('legacyoutput', function (editor) { + Formats.setup(editor); + }); + } - // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes - /*editor.on('NodeChange', function() { - var fontElm, fontName, fontSize; + Plugin(); - // Find font element get it's name and size - fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); - if (fontElm) { - fontName = fontElm.face; - fontSize = fontElm.size; - } - });*/ - }); - }); -})(tinymce); +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.min.js index f77d8e8..f484d1a 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/legacyoutput/plugin.min.js @@ -1 +1,9 @@ -!function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t){t.on("init",function(){var i="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",n=e.explode(t.settings.font_size_style_values),l=t.schema;t.formatter.register({alignleft:{selector:i,attributes:{align:"left"}},aligncenter:{selector:i,attributes:{align:"center"}},alignright:{selector:i,attributes:{align:"right"}},alignjustify:{selector:i,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(n,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){l.addValidElements(e+"[*]")}),l.getElementRule("font")||l.addValidElements("font[face|size|color|style]"),e.each(i.split(","),function(e){var t=l.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}(tinymce); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},l=function(e,t){e.settings.font_formats=t},s=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},r=function(e,t){e.settings.inline_styles=t},o=function(e){!function(e){r(e,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||l(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats")}(e),e.on("PreInit",function(){return function(e){var t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=a.explode(s(e)),n=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(a.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),a.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),a.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}(e)})};!function c(){e.add("legacyoutput",function(e){o(e)})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.js index 3e5de1e..5c35889 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.js @@ -1,373 +1,1843 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ +(function (domGlobals) { + 'use strict'; + + var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + + var assumeExternalTargets = function (editor) { + var externalTargets = editor.getParam('link_assume_external_targets', false); + if (isBoolean(externalTargets) && externalTargets) { + return 1; + } else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) { + return externalTargets; + } + return 0; + }; + var hasContextToolbar = function (editor) { + return editor.getParam('link_context_toolbar', false, 'boolean'); + }; + var getLinkList = function (editor) { + return editor.getParam('link_list'); + }; + var getDefaultLinkTarget = function (editor) { + return editor.getParam('default_link_target'); + }; + var getTargetList = function (editor) { + return editor.getParam('target_list', true); + }; + var getRelList = function (editor) { + return editor.getParam('rel_list', [], 'array'); + }; + var getLinkClassList = function (editor) { + return editor.getParam('link_class_list', [], 'array'); + }; + var shouldShowLinkTitle = function (editor) { + return editor.getParam('link_title', true, 'boolean'); + }; + var allowUnsafeLinkTarget = function (editor) { + return editor.getParam('allow_unsafe_link_target', false, 'boolean'); + }; + var useQuickLink = function (editor) { + return editor.getParam('link_quicklink', false, 'boolean'); + }; + var getDefaultLinkProtocol = function (editor) { + return editor.getParam('link_default_protocol', 'http', 'string'); + }; + var Settings = { + assumeExternalTargets: assumeExternalTargets, + hasContextToolbar: hasContextToolbar, + getLinkList: getLinkList, + getDefaultLinkTarget: getDefaultLinkTarget, + getTargetList: getTargetList, + getRelList: getRelList, + getLinkClassList: getLinkClassList, + shouldShowLinkTitle: shouldShowLinkTitle, + allowUnsafeLinkTarget: allowUnsafeLinkTarget, + useQuickLink: useQuickLink, + getDefaultLinkProtocol: getDefaultLinkProtocol + }; + + var appendClickRemove = function (link, evt) { + domGlobals.document.body.appendChild(link); + link.dispatchEvent(evt); + domGlobals.document.body.removeChild(link); + }; + var open = function (url) { + var link = domGlobals.document.createElement('a'); + link.target = '_blank'; + link.href = url; + link.rel = 'noreferrer noopener'; + var evt = domGlobals.document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, domGlobals.window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + appendClickRemove(link, evt); + }; + var OpenUrl = { open: open }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var nativePush = Array.prototype.push; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -1; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Option.none(); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var hasProtocol = function (url) { + return /^\w+:/i.test(url); + }; + var getHref = function (elm) { + var href = elm.getAttribute('data-mce-href'); + return href ? href : elm.getAttribute('href'); + }; + var applyRelTargetRules = function (rel, isUnsafe) { + var rules = ['noopener']; + var rels = rel ? rel.split(/\s+/) : []; + var toString = function (rels) { + return global$3.trim(rels.sort().join(' ')); + }; + var addTargetRules = function (rels) { + rels = removeTargetRules(rels); + return rels.length > 0 ? rels.concat(rules) : rules; + }; + var removeTargetRules = function (rels) { + return rels.filter(function (val) { + return global$3.inArray(rules, val) === -1; + }); + }; + var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels); + return newRels.length > 0 ? toString(newRels) : ''; + }; + var trimCaretContainers = function (text) { + return text.replace(/\uFEFF/g, ''); + }; + var getAnchorElement = function (editor, selectedElm) { + selectedElm = selectedElm || editor.selection.getNode(); + if (isImageFigure(selectedElm)) { + return editor.dom.select('a[href]', selectedElm)[0]; + } else { + return editor.dom.getParent(selectedElm, 'a[href]'); + } + }; + var getAnchorText = function (selection, anchorElm) { + var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' }); + return trimCaretContainers(text); + }; + var isLink = function (elm) { + return elm && elm.nodeName === 'A' && !!getHref(elm); + }; + var hasLinks = function (elements) { + return global$3.grep(elements, isLink).length > 0; + }; + var isOnlyTextSelected = function (html) { + if (/]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) { + return false; + } + return true; + }; + var isImageFigure = function (elm) { + return elm && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className); + }; + var getLinkAttrs = function (data) { + return foldl([ + 'title', + 'rel', + 'class', + 'target' + ], function (acc, key) { + data[key].each(function (value) { + acc[key] = value.length > 0 ? value : null; + }); + return acc; + }, { href: data.href }); + }; + var handleExternalTargets = function (href, assumeExternalTargets) { + if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) { + return assumeExternalTargets + '://' + href; + } + return href; + }; + var applyLinkOverrides = function (editor, linkAttrs) { + var newLinkAttrs = __assign({}, linkAttrs); + if (!(Settings.getRelList(editor).length > 0) && Settings.allowUnsafeLinkTarget(editor) === false) { + var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank'); + newLinkAttrs.rel = newRel ? newRel : null; + } + if (Option.from(newLinkAttrs.target).isNone() && Settings.getTargetList(editor) === false) { + newLinkAttrs.target = Settings.getDefaultLinkTarget(editor); + } + newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, Settings.assumeExternalTargets(editor)); + return newLinkAttrs; + }; + var updateLink = function (editor, anchorElm, text, linkAttrs) { + text.each(function (text) { + if (anchorElm.hasOwnProperty('innerText')) { + anchorElm.innerText = text; + } else { + anchorElm.textContent = text; + } + }); + editor.dom.setAttribs(anchorElm, linkAttrs); + editor.selection.select(anchorElm); + }; + var createLink = function (editor, selectedElm, text, linkAttrs) { + if (isImageFigure(selectedElm)) { + linkImageFigure(editor, selectedElm, linkAttrs); + } else { + text.fold(function () { + editor.execCommand('mceInsertLink', false, linkAttrs); + }, function (text) { + editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(text))); + }); + } + }; + var link = function (editor, attachState, data) { + var selectedElm = editor.selection.getNode(); + var anchorElm = getAnchorElement(editor, selectedElm); + var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data)); + editor.undoManager.transact(function () { + if (data.href === attachState.href) { + attachState.attach(); + } + if (anchorElm) { + editor.focus(); + updateLink(editor, anchorElm, data.text, linkAttrs); + } else { + createLink(editor, selectedElm, data.text, linkAttrs); + } + }); + }; + var unlink = function (editor) { + editor.undoManager.transact(function () { + var node = editor.selection.getNode(); + if (isImageFigure(node)) { + unlinkImageFigure(editor, node); + } else { + var anchorElm = editor.dom.getParent(node, 'a[href]', editor.getBody()); + if (anchorElm) { + editor.dom.remove(anchorElm, true); + } + } + editor.focus(); + }); + }; + var unlinkImageFigure = function (editor, fig) { + var img = editor.dom.select('img', fig)[0]; + if (img) { + var a = editor.dom.getParents(img, 'a[href]', fig)[0]; + if (a) { + a.parentNode.insertBefore(img, a); + editor.dom.remove(a); + } + } + }; + var linkImageFigure = function (editor, fig, attrs) { + var img = editor.dom.select('img', fig)[0]; + if (img) { + var a = editor.dom.create('a', attrs); + img.parentNode.insertBefore(a, img); + a.appendChild(img); + } + }; + var Utils = { + link: link, + unlink: unlink, + isLink: isLink, + hasLinks: hasLinks, + getHref: getHref, + isOnlyTextSelected: isOnlyTextSelected, + getAnchorElement: getAnchorElement, + getAnchorText: getAnchorText, + applyRelTargetRules: applyRelTargetRules, + hasProtocol: hasProtocol + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + + var getValue = function (item) { + return isString(item.value) ? item.value : ''; + }; + var sanitizeList = function (list, extractValue) { + var out = []; + global$3.each(list, function (item) { + var text = isString(item.text) ? item.text : isString(item.title) ? item.title : ''; + if (item.menu !== undefined) ; else { + var value = extractValue(item); + out.push({ + text: text, + value: value + }); + } + }); + return out; + }; + var sanitizeWith = function (extracter) { + if (extracter === void 0) { + extracter = getValue; + } + return function (list) { + return Option.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + }; + }; + var sanitize = function (list) { + return sanitizeWith(getValue)(list); + }; + var createUi = function (name, label) { + return function (items) { + return { + name: name, + type: 'selectbox', + label: label, + items: items + }; + }; + }; + var ListOptions = { + sanitize: sanitize, + sanitizeWith: sanitizeWith, + createUi: createUi, + getValue: getValue + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var findTextByValue = function (value, catalog) { + return findMap(catalog, function (item) { + return Option.some(item).filter(function (i) { + return i.value === value; + }); + }); + }; + var getDelta = function (persistentText, fieldName, catalog, data) { + var value = data[fieldName]; + var hasPersistentText = persistentText.length > 0; + return value !== undefined ? findTextByValue(value, catalog).map(function (i) { + return { + url: { + value: i.value, + meta: { + text: hasPersistentText ? persistentText : i.text, + attach: noop + } + }, + text: hasPersistentText ? persistentText : i.text + }; + }) : Option.none(); + }; + var findCatalog = function (settings, fieldName) { + if (fieldName === 'link') { + return settings.catalogs.link; + } else if (fieldName === 'anchor') { + return settings.catalogs.anchor; + } else { + return Option.none(); + } + }; + var init = function (initialData, linkSettings) { + var persistentText = Cell(initialData.text); + var onUrlChange = function (data) { + if (persistentText.get().length <= 0) { + var urlText = data.url.meta.text !== undefined ? data.url.meta.text : data.url.value; + var urlTitle = data.url.meta.title !== undefined ? data.url.meta.title : ''; + return Option.some({ + text: urlText, + title: urlTitle + }); + } else { + return Option.none(); + } + }; + var onCatalogChange = function (data, change) { + var catalog = findCatalog(linkSettings, change.name).getOr([]); + return getDelta(persistentText.get(), change.name, catalog, data); + }; + var onChange = function (getData, change) { + if (change.name === 'url') { + return onUrlChange(getData()); + } else if (contains([ + 'anchor', + 'link' + ], change.name)) { + return onCatalogChange(getData(), change); + } else if (change.name === 'text') { + persistentText.set(getData().text); + return Option.none(); + } else { + return Option.none(); + } + }; + return { onChange: onChange }; + }; + var DialogChanges = { + init: init, + getDelta: getDelta + }; + + var exports$1 = {}, module = { exports: exports$1 }; + (function (define, exports, module, require) { + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); + }(undefined, exports$1, module, undefined)); + var Promise = module.exports.boltExport; + + var nu = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.some(x); + run(callbacks); + callbacks = []; + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu, + pure: pure + }; + + var errorReporter = function (err) { + domGlobals.setTimeout(function () { + throw err; + }, 0); + }; + var make = function (run) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { + return make(function () { + return run().then(fab); + }); + }; + var bind = function (aFutureB) { + return make(function () { + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); + }); + }; + var anonBind = function (futureB) { + return make(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$1 = function (baseFn) { + return make(function () { + return new Promise(baseFn); + }); + }; + var pure$1 = function (a) { + return make(function () { + return Promise.resolve(a); + }); + }; + var Future = { + nu: nu$1, + pure: pure$1 + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var delayedConfirm = function (editor, message, callback) { + var rng = editor.selection.getRng(); + global$4.setEditorTimeout(editor, function () { + editor.windowManager.confirm(message, function (state) { + editor.selection.setRng(rng); + callback(state); + }); + }); + }; + var tryEmailTransform = function (data) { + var url = data.href; + var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('//') === -1 && url.indexOf('mailto:') === -1; + return suggestMailTo ? Option.some({ + message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: 'mailto:' + url }); + } + }) : Option.none(); + }; + var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { + return function (data) { + var url = data.href; + var suggestProtocol = assumeExternalTargets === 1 && !Utils.hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www[\.|\d\.]/i.test(url); + return suggestProtocol ? Option.some({ + message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url }); + } + }) : Option.none(); + }; + }; + var preprocess = function (editor, data) { + return findMap([ + tryEmailTransform, + tryProtocolTransform(Settings.assumeExternalTargets(editor), Settings.getDefaultLinkProtocol(editor)) + ], function (f) { + return f(data); + }).fold(function () { + return Future.pure(data); + }, function (transform) { + return Future.nu(function (callback) { + delayedConfirm(editor, transform.message, function (state) { + callback(state ? transform.preprocess(data) : data); + }); + }); + }); + }; + var DialogConfirms = { preprocess: preprocess }; + + var getAnchors = function (editor) { + var anchorNodes = editor.dom.select('a:not([href])'); + var anchors = bind(anchorNodes, function (anchor) { + var id = anchor.name || anchor.id; + return id ? [{ + text: id, + value: '#' + id + }] : []; + }); + return anchors.length > 0 ? Option.some([{ + text: 'None', + value: '' + }].concat(anchors)) : Option.none(); + }; + var AnchorListOptions = { getAnchors: getAnchors }; + + var getClasses = function (editor) { + var list = Settings.getLinkClassList(editor); + if (list.length > 0) { + return ListOptions.sanitize(list); + } + return Option.none(); + }; + var ClassListOptions = { getClasses: getClasses }; + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var parseJson = function (text) { + try { + return Option.some(JSON.parse(text)); + } catch (err) { + return Option.none(); + } + }; + var getLinks = function (editor) { + var extractor = function (item) { + return editor.convertURL(item.value || item.url, 'href'); + }; + var linkList = Settings.getLinkList(editor); + return Future.nu(function (callback) { + if (isString(linkList)) { + global$5.send({ + url: linkList, + success: function (text) { + return callback(parseJson(text)); + }, + error: function (_) { + return callback(Option.none()); + } + }); + } else if (isFunction(linkList)) { + linkList(function (output) { + return callback(Option.some(output)); + }); + } else { + callback(Option.from(linkList)); + } + }).map(function (optItems) { + return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) { + if (items.length > 0) { + return [{ + text: 'None', + value: '' + }].concat(items); + } else { + return items; + } + }); + }); + }; + var LinkListOptions = { getLinks: getLinks }; + + var getRels = function (editor, initialTarget) { + var list = Settings.getRelList(editor); + if (list.length > 0) { + var isTargetBlank_1 = initialTarget.is('_blank'); + var enforceSafe = Settings.allowUnsafeLinkTarget(editor) === false; + var safeRelExtractor = function (item) { + return Utils.applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); + }; + var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize; + return sanitizer(list); + } + return Option.none(); + }; + var RelOptions = { getRels: getRels }; + + var fallbacks = [ + { + text: 'Current window', + value: '' + }, + { + text: 'New window', + value: '_blank' + } + ]; + var getTargets = function (editor) { + var list = Settings.getTargetList(editor); + if (isArray(list)) { + return ListOptions.sanitize(list).orThunk(function () { + return Option.some(fallbacks); + }); + } else if (list === false) { + return Option.none(); + } + return Option.some(fallbacks); + }; + var TargetOptions = { getTargets: getTargets }; + + var nonEmptyAttr = function (dom, elem, name) { + var val = dom.getAttrib(elem, name); + return val !== null && val.length > 0 ? Option.some(val) : Option.none(); + }; + var extractFromAnchor = function (editor, anchor) { + var dom = editor.dom; + var onlyText = Utils.isOnlyTextSelected(editor.selection.getContent()); + var text = onlyText ? Option.some(Utils.getAnchorText(editor.selection, anchor)) : Option.none(); + var url = anchor ? Option.some(dom.getAttrib(anchor, 'href')) : Option.none(); + var target = anchor ? Option.from(dom.getAttrib(anchor, 'target')) : Option.none(); + var rel = nonEmptyAttr(dom, anchor, 'rel'); + var linkClass = nonEmptyAttr(dom, anchor, 'class'); + var title = nonEmptyAttr(dom, anchor, 'title'); + return { + url: url, + text: text, + title: title, + target: target, + rel: rel, + linkClass: linkClass + }; + }; + var collect = function (editor, linkNode) { + return LinkListOptions.getLinks(editor).map(function (links) { + var anchor = extractFromAnchor(editor, linkNode); + return { + anchor: anchor, + catalogs: { + targets: TargetOptions.getTargets(editor), + rels: RelOptions.getRels(editor, anchor.target), + classes: ClassListOptions.getClasses(editor), + anchor: AnchorListOptions.getAnchors(editor), + link: links + }, + optNode: Option.from(linkNode), + flags: { titleEnabled: Settings.shouldShowLinkTitle(editor) } + }; + }); + }; + var DialogInfo = { collect: collect }; + + var handleSubmit = function (editor, info) { + return function (api) { + var data = api.getData(); + if (!data.url.value) { + Utils.unlink(editor); + api.close(); + return; + } + var getChangedValue = function (key) { + return Option.from(data[key]).filter(function (value) { + return !info.anchor[key].is(value); + }); + }; + var changedData = { + href: data.url.value, + text: getChangedValue('text'), + target: getChangedValue('target'), + rel: getChangedValue('rel'), + class: getChangedValue('linkClass'), + title: getChangedValue('title') + }; + var attachState = { + href: data.url.value, + attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : function () { + } + }; + DialogConfirms.preprocess(editor, changedData).get(function (pData) { + Utils.link(editor, attachState, pData); + }); + api.close(); + }; + }; + var collectData = function (editor) { + var anchorNode = Utils.getAnchorElement(editor); + return DialogInfo.collect(editor, anchorNode); + }; + var getInitialData = function (info, defaultTarget) { + return { + url: { + value: info.anchor.url.getOr(''), + meta: { + attach: function () { + }, + text: info.anchor.url.fold(function () { + return ''; + }, function () { + return info.anchor.text.getOr(''); + }), + original: { value: info.anchor.url.getOr('') } + } + }, + text: info.anchor.text.getOr(''), + title: info.anchor.title.getOr(''), + anchor: info.anchor.url.getOr(''), + link: info.anchor.url.getOr(''), + rel: info.anchor.rel.getOr(''), + target: info.anchor.target.or(defaultTarget).getOr(''), + linkClass: info.anchor.linkClass.getOr('') + }; + }; + var makeDialog = function (settings, onSubmit, editor) { + var urlInput = [{ + name: 'url', + type: 'urlinput', + filetype: 'file', + label: 'URL' + }]; + var displayText = settings.anchor.text.map(function () { + return { + name: 'text', + type: 'input', + label: 'Text to display' + }; + }).toArray(); + var titleText = settings.flags.titleEnabled ? [{ + name: 'title', + type: 'input', + label: 'Title' + }] : []; + var defaultTarget = Option.from(Settings.getDefaultLinkTarget(editor)); + var initialData = getInitialData(settings, defaultTarget); + var dialogDelta = DialogChanges.init(initialData, settings); + var catalogs = settings.catalogs; + var body = { + type: 'panel', + items: flatten([ + urlInput, + displayText, + titleText, + cat([ + catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')), + catalogs.rels.map(ListOptions.createUi('rel', 'Rel')), + catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')), + catalogs.link.map(ListOptions.createUi('link', 'Link list')), + catalogs.classes.map(ListOptions.createUi('linkClass', 'Class')) + ]) + ]) + }; + return { + title: 'Insert/Edit Link', + size: 'normal', + body: body, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onChange: function (api, _a) { + var name = _a.name; + dialogDelta.onChange(api.getData, { name: name }).each(function (newData) { + api.setData(newData); + }); + }, + onSubmit: onSubmit + }; + }; + var open$1 = function (editor) { + var data = collectData(editor); + data.map(function (info) { + var onSubmit = handleSubmit(editor, info); + return makeDialog(info, onSubmit, editor); + }).get(function (spec) { + editor.windowManager.open(spec); + }); + }; + var Dialog = { open: open$1 }; + + var getLink = function (editor, elm) { + return editor.dom.getParent(elm, 'a[href]'); + }; + var getSelectedLink = function (editor) { + return getLink(editor, editor.selection.getStart()); + }; + var hasOnlyAltModifier = function (e) { + return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false; + }; + var gotoLink = function (editor, a) { + if (a) { + var href = Utils.getHref(a); + if (/^#/.test(href)) { + var targetEl = editor.$(href); + if (targetEl.length) { + editor.selection.scrollIntoView(targetEl[0], true); + } + } else { + OpenUrl.open(a.href); + } + } + }; + var openDialog = function (editor) { + return function () { + Dialog.open(editor); + }; + }; + var gotoSelectedLink = function (editor) { + return function () { + gotoLink(editor, getSelectedLink(editor)); + }; + }; + var leftClickedOnAHref = function (editor) { + return function (elm) { + var sel, rng, node; + if (Settings.hasContextToolbar(editor) && Utils.isLink(elm)) { + sel = editor.selection; + rng = sel.getRng(); + node = rng.startContainer; + if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) { + return true; + } + } + return false; + }; + }; + var setupGotoLinks = function (editor) { + editor.on('click', function (e) { + var link = getLink(editor, e.target); + if (link && global$2.metaKeyPressed(e)) { + e.preventDefault(); + gotoLink(editor, link); + } + }); + editor.on('keydown', function (e) { + var link = getSelectedLink(editor); + if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) { + e.preventDefault(); + gotoLink(editor, link); + } + }); + }; + var toggleActiveState = function (editor) { + return function (api) { + var nodeChangeHandler = function (e) { + return api.setActive(!editor.mode.isReadOnly() && !!Utils.getAnchorElement(editor, e.element)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var toggleEnabledState = function (editor) { + return function (api) { + var parents = editor.dom.getParents(editor.selection.getStart()); + api.setDisabled(!Utils.hasLinks(parents)); + var nodeChangeHandler = function (e) { + return api.setDisabled(!Utils.hasLinks(e.parents)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var Actions = { + openDialog: openDialog, + gotoSelectedLink: gotoSelectedLink, + leftClickedOnAHref: leftClickedOnAHref, + setupGotoLinks: setupGotoLinks, + toggleActiveState: toggleActiveState, + toggleEnabledState: toggleEnabledState + }; + + var register = function (editor) { + editor.addCommand('mceLink', function () { + if (Settings.useQuickLink(editor)) { + editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' }); + } else { + Actions.openDialog(editor)(); + } + }); + }; + var Commands = { register: register }; + + var setup = function (editor) { + editor.addShortcut('Meta+K', '', function () { + editor.execCommand('mceLink'); + }); + }; + var Keyboard = { setup: setup }; + + var setupButtons = function (editor) { + editor.ui.registry.addToggleButton('link', { + icon: 'link', + tooltip: 'Insert/edit link', + onAction: Actions.openDialog(editor), + onSetup: Actions.toggleActiveState(editor) + }); + editor.ui.registry.addButton('openlink', { + icon: 'new-tab', + tooltip: 'Open link', + onAction: Actions.gotoSelectedLink(editor), + onSetup: Actions.toggleEnabledState(editor) + }); + editor.ui.registry.addButton('unlink', { + icon: 'unlink', + tooltip: 'Remove link', + onAction: function () { + return Utils.unlink(editor); + }, + onSetup: Actions.toggleEnabledState(editor) + }); + }; + var setupMenuItems = function (editor) { + editor.ui.registry.addMenuItem('openlink', { + text: 'Open link', + icon: 'new-tab', + onAction: Actions.gotoSelectedLink(editor), + onSetup: Actions.toggleEnabledState(editor) + }); + editor.ui.registry.addMenuItem('link', { + icon: 'link', + text: 'Link...', + shortcut: 'Meta+K', + onAction: Actions.openDialog(editor) + }); + editor.ui.registry.addMenuItem('unlink', { + icon: 'unlink', + text: 'Remove link', + onAction: function () { + return Utils.unlink(editor); + }, + onSetup: Actions.toggleEnabledState(editor) + }); + }; + var setupContextMenu = function (editor) { + var inLink = 'link unlink openlink'; + var noLink = 'link'; + editor.ui.registry.addContextMenu('link', { + update: function (element) { + return Utils.hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink; + } + }); + }; + var setupContextToolbars = function (editor) { + var collapseSelectionToEnd = function (editor) { + editor.selection.collapse(false); + }; + var onSetupLink = function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setDisabled(!Utils.getAnchorElement(editor, node)); + return function () { + }; + }; + editor.ui.registry.addContextForm('quicklink', { + launch: { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + onSetup: Actions.toggleActiveState(editor) + }, + label: 'Link', + predicate: function (node) { + return !!Utils.getAnchorElement(editor, node) && Settings.hasContextToolbar(editor); + }, + initValue: function () { + var elm = Utils.getAnchorElement(editor); + return !!elm ? Utils.getHref(elm) : ''; + }, + commands: [ + { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + primary: true, + onSetup: function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setActive(!!Utils.getAnchorElement(editor, node)); + return Actions.toggleActiveState(editor)(buttonApi); + }, + onAction: function (formApi) { + var anchor = Utils.getAnchorElement(editor); + var value = formApi.getValue(); + if (!anchor) { + var attachState = { + href: value, + attach: function () { + } + }; + var onlyText = Utils.isOnlyTextSelected(editor.selection.getContent()); + var text = onlyText ? Option.some(Utils.getAnchorText(editor.selection, anchor)).filter(function (t) { + return t.length > 0; + }).or(Option.from(value)) : Option.none(); + Utils.link(editor, attachState, { + href: value, + text: text, + title: Option.none(), + rel: Option.none(), + target: Option.none(), + class: Option.none() + }); + formApi.hide(); + } else { + editor.dom.setAttrib(anchor, 'href', value); + collapseSelectionToEnd(editor); + formApi.hide(); + } + } + }, + { + type: 'contextformbutton', + icon: 'unlink', + tooltip: 'Remove link', + onSetup: onSetupLink, + onAction: function (formApi) { + Utils.unlink(editor); + formApi.hide(); + } + }, + { + type: 'contextformbutton', + icon: 'new-tab', + tooltip: 'Open link', + onSetup: onSetupLink, + onAction: function (formApi) { + Actions.gotoSelectedLink(editor)(); + formApi.hide(); + } + } + ] + }); + }; + var Controls = { + setupButtons: setupButtons, + setupMenuItems: setupMenuItems, + setupContextMenu: setupContextMenu, + setupContextToolbars: setupContextToolbars + }; + + function Plugin () { + global$1.add('link', function (editor) { + Controls.setupButtons(editor); + Controls.setupMenuItems(editor); + Controls.setupContextMenu(editor); + Controls.setupContextToolbars(editor); + Actions.setupGotoLinks(editor); + Commands.register(editor); + Keyboard.setup(editor); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('link', function(editor) { - function createLinkList(callback) { - return function() { - var linkList = editor.settings.link_list; - - if (typeof(linkList) == "string") { - tinymce.util.XHR.send({ - url: linkList, - success: function(text) { - callback(tinymce.util.JSON.parse(text)); - } - }); - } else if (typeof(linkList) == "function") { - linkList(callback); - } else { - callback(linkList); - } - }; - } - - function showDialog(linkList) { - var data = {}, selection = editor.selection, dom = editor.dom, selectedElm, anchorElm, initialText; - var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl; - - function linkListChangeHandler(e) { - var textCtrl = win.find('#text'); - - if (!textCtrl.value() || (e.lastControl && textCtrl.value() == e.lastControl.text())) { - textCtrl.value(e.control.text()); - } - - win.find('#href').value(e.control.value()); - } - - function buildLinkList() { - var linkListItems = [{text: 'None', value: ''}]; - - tinymce.each(linkList, function(link) { - linkListItems.push({ - text: link.text || link.title, - value: editor.convertURL(link.value || link.url, 'href'), - menu: link.menu - }); - }); - - return linkListItems; - } - - function applyPreview(items) { - tinymce.each(items, function(item) { - item.textStyle = function() { - return editor.formatter.getCssText({inline: 'a', classes: [item.value]}); - }; - }); - - return items; - } - - function buildValues(listSettingName, dataItemName, defaultItems) { - var selectedItem, items = []; - - tinymce.each(editor.settings[listSettingName] || defaultItems, function(target) { - var item = { - text: target.text || target.title, - value: target.value - }; - - items.push(item); - - if (data[dataItemName] === target.value || (!selectedItem && target.selected)) { - selectedItem = item; - } - }); - - if (selectedItem && !data[dataItemName]) { - data[dataItemName] = selectedItem.value; - selectedItem.selected = true; - } - - return items; - } - - function buildAnchorListControl(url) { - var anchorList = []; - - tinymce.each(editor.dom.select('a:not([href])'), function(anchor) { - var id = anchor.name || anchor.id; - - if (id) { - anchorList.push({ - text: id, - value: '#' + id, - selected: url.indexOf('#' + id) != -1 - }); - } - }); - - if (anchorList.length) { - anchorList.unshift({text: 'None', value: ''}); - - return { - name: 'anchor', - type: 'listbox', - label: 'Anchors', - values: anchorList, - onselect: linkListChangeHandler - }; - } - } - - function urlChange() { - if (linkListCtrl) { - linkListCtrl.value(editor.convertURL(this.value(), 'href')); - } - - if (!initialText && data.text.length === 0 && onlyText) { - this.parent().parent().find('#text')[0].value(this.value()); - } - } - - function isOnlyTextSelected(anchorElm) { - var html = selection.getContent(); - - // Partial html and not a fully selected anchor element - if (/]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') == -1)) { - return false; - } - - if (anchorElm) { - var nodes = anchorElm.childNodes, i; - - if (nodes.length === 0) { - return false; - } - - for (i = nodes.length - 1; i >= 0; i--) { - if (nodes[i].nodeType != 3) { - return false; - } - } - } - - return true; - } - - selectedElm = selection.getNode(); - anchorElm = dom.getParent(selectedElm, 'a[href]'); - onlyText = isOnlyTextSelected(); - - data.text = initialText = anchorElm ? (anchorElm.innerText || anchorElm.textContent) : selection.getContent({format: 'text'}); - data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : ''; - data.target = anchorElm ? dom.getAttrib(anchorElm, 'target') : (editor.settings.default_link_target || null); - data.rel = anchorElm ? dom.getAttrib(anchorElm, 'rel') : null; - data['class'] = anchorElm ? dom.getAttrib(anchorElm, 'class') : null; - data.title = anchorElm ? dom.getAttrib(anchorElm, 'title') : ''; - - if (onlyText) { - textListCtrl = { - name: 'text', - type: 'textbox', - size: 40, - label: 'Text to display', - onchange: function() { - data.text = this.value(); - } - }; - } - - if (linkList) { - linkListCtrl = { - type: 'listbox', - label: 'Link list', - values: buildLinkList(), - onselect: linkListChangeHandler, - value: editor.convertURL(data.href, 'href'), - onPostRender: function() { - linkListCtrl = this; - } - }; - } - - if (editor.settings.target_list !== false) { - targetListCtrl = { - name: 'target', - type: 'listbox', - label: 'Target', - values: buildValues('target_list', 'target', [{text: 'None', value: ''}, {text: 'New window', value: '_blank'}]) - }; - } - - if (editor.settings.rel_list) { - relListCtrl = { - name: 'rel', - type: 'listbox', - label: 'Rel', - values: buildValues('rel_list', 'rel', [{text: 'None', value: ''}]) - }; - } - - if (editor.settings.link_class_list) { - classListCtrl = { - name: 'class', - type: 'listbox', - label: 'Class', - values: applyPreview(buildValues('link_class_list', 'class')) - }; - } - - if (editor.settings.link_title !== false) { - linkTitleCtrl = { - name: 'title', - type: 'textbox', - label: 'Title', - value: data.title - }; - } - - win = editor.windowManager.open({ - title: 'Insert link', - data: data, - body: [ - { - name: 'href', - type: 'filepicker', - filetype: 'file', - size: 40, - autofocus: true, - label: 'Url', - onchange: urlChange, - onkeyup: urlChange - }, - textListCtrl, - linkTitleCtrl, - buildAnchorListControl(data.href), - linkListCtrl, - relListCtrl, - targetListCtrl, - classListCtrl - ], - onSubmit: function(e) { - var href; - - data = tinymce.extend(data, e.data); - href = data.href; - - // Delay confirm since onSubmit will move focus - function delayedConfirm(message, callback) { - var rng = editor.selection.getRng(); - - window.setTimeout(function() { - editor.windowManager.confirm(message, function(state) { - editor.selection.setRng(rng); - callback(state); - }); - }, 0); - } - - function insertLink() { - var linkAttrs = { - href: href, - target: data.target ? data.target : null, - rel: data.rel ? data.rel : null, - "class": data["class"] ? data["class"] : null, - title: data.title ? data.title : null - }; - - if (anchorElm) { - editor.focus(); - - if (onlyText && data.text != initialText) { - if ("innerText" in anchorElm) { - anchorElm.innerText = data.text; - } else { - anchorElm.textContent = data.text; - } - } - - dom.setAttribs(anchorElm, linkAttrs); - - selection.select(anchorElm); - editor.undoManager.add(); - } else { - if (onlyText) { - editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(data.text))); - } else { - editor.execCommand('mceInsertLink', false, linkAttrs); - } - } - } - - if (!href) { - editor.execCommand('unlink'); - return; - } - - // Is email and not //user@domain.com - if (href.indexOf('@') > 0 && href.indexOf('//') == -1 && href.indexOf('mailto:') == -1) { - delayedConfirm( - 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', - function(state) { - if (state) { - href = 'mailto:' + href; - } - - insertLink(); - } - ); - - return; - } - - // Is www. prefixed - if (/^\s*www\./i.test(href)) { - delayedConfirm( - 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', - function(state) { - if (state) { - href = 'http://' + href; - } - - insertLink(); - } - ); - - return; - } - - insertLink(); - } - }); - } - - editor.addButton('link', { - icon: 'link', - tooltip: 'Insert/edit link', - shortcut: 'Ctrl+K', - onclick: createLinkList(showDialog), - stateSelector: 'a[href]' - }); - - editor.addButton('unlink', { - icon: 'unlink', - tooltip: 'Remove link', - cmd: 'unlink', - stateSelector: 'a[href]' - }); - - editor.addShortcut('Ctrl+K', '', createLinkList(showDialog)); - - this.showDialog = showDialog; - - editor.addMenuItem('link', { - icon: 'link', - text: 'Insert link', - shortcut: 'Ctrl+K', - onclick: createLinkList(showDialog), - stateSelector: 'a[href]', - context: 'insert', - prependToContext: true - }); -}); +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.min.js index eb9c1f6..a9017b1 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/link/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("link",function(t){function e(e){return function(){var n=t.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(t){e(tinymce.util.JSON.parse(t))}}):"function"==typeof n?n(e):e(n)}}function n(e){function n(t){var e=d.find("#text");(!e.value()||t.lastControl&&e.value()==t.lastControl.text())&&e.value(t.control.text()),d.find("#href").value(t.control.value())}function l(){var n=[{text:"None",value:""}];return tinymce.each(e,function(e){n.push({text:e.text||e.title,value:t.convertURL(e.value||e.url,"href"),menu:e.menu})}),n}function i(e){return tinymce.each(e,function(e){e.textStyle=function(){return t.formatter.getCssText({inline:"a",classes:[e.value]})}}),e}function a(e,n,l){var i,a=[];return tinymce.each(t.settings[e]||l,function(t){var e={text:t.text||t.title,value:t.value};a.push(e),(b[n]===t.value||!i&&t.selected)&&(i=e)}),i&&!b[n]&&(b[n]=i.value,i.selected=!0),a}function r(e){var l=[];return tinymce.each(t.dom.select("a:not([href])"),function(t){var n=t.name||t.id;n&&l.push({text:n,value:"#"+n,selected:-1!=e.indexOf("#"+n)})}),l.length?(l.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:l,onselect:n}):void 0}function o(){h&&h.value(t.convertURL(this.value(),"href")),!f&&0===b.text.length&&x&&this.parent().parent().find("#text")[0].value(this.value())}function s(t){var e=k.getContent();if(/]+>[^<]+<\/a>$/.test(e)||-1==e.indexOf("href=")))return!1;if(t){var n,l=t.childNodes;if(0===l.length)return!1;for(n=l.length-1;n>=0;n--)if(3!=l[n].nodeType)return!1}return!0}var u,c,f,d,x,v,h,g,m,p,y,b={},k=t.selection,w=t.dom;u=k.getNode(),c=w.getParent(u,"a[href]"),x=s(),b.text=f=c?c.innerText||c.textContent:k.getContent({format:"text"}),b.href=c?w.getAttrib(c,"href"):"",b.target=c?w.getAttrib(c,"target"):t.settings.default_link_target||null,b.rel=c?w.getAttrib(c,"rel"):null,b["class"]=c?w.getAttrib(c,"class"):null,b.title=c?w.getAttrib(c,"title"):"",x&&(v={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){b.text=this.value()}}),e&&(h={type:"listbox",label:"Link list",values:l(),onselect:n,value:t.convertURL(b.href,"href"),onPostRender:function(){h=this}}),t.settings.target_list!==!1&&(m={name:"target",type:"listbox",label:"Target",values:a("target_list","target",[{text:"None",value:""},{text:"New window",value:"_blank"}])}),t.settings.rel_list&&(g={name:"rel",type:"listbox",label:"Rel",values:a("rel_list","rel",[{text:"None",value:""}])}),t.settings.link_class_list&&(p={name:"class",type:"listbox",label:"Class",values:i(a("link_class_list","class"))}),t.settings.link_title!==!1&&(y={name:"title",type:"textbox",label:"Title",value:b.title}),d=t.windowManager.open({title:"Insert link",data:b,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:o,onkeyup:o},v,y,r(b.href),h,g,m,p],onSubmit:function(e){function n(e,n){var l=t.selection.getRng();window.setTimeout(function(){t.windowManager.confirm(e,function(e){t.selection.setRng(l),n(e)})},0)}function l(){var e={href:i,target:b.target?b.target:null,rel:b.rel?b.rel:null,"class":b["class"]?b["class"]:null,title:b.title?b.title:null};c?(t.focus(),x&&b.text!=f&&("innerText"in c?c.innerText=b.text:c.textContent=b.text),w.setAttribs(c,e),k.select(c),t.undoManager.add()):x?t.insertContent(w.createHTML("a",e,w.encode(b.text))):t.execCommand("mceInsertLink",!1,e)}var i;return b=tinymce.extend(b,e.data),(i=b.href)?i.indexOf("@")>0&&-1==i.indexOf("//")&&-1==i.indexOf("mailto:")?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(i="mailto:"+i),l()}):/^\s*www\./i.test(i)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(i="http://"+i),l()}):void l():void t.execCommand("unlink")}})}t.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:e(n),stateSelector:"a[href]"}),t.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),t.addShortcut("Ctrl+K","",e(n)),this.showDialog=n,t.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:e(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(c){"use strict";function n(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===t}}function u(){}function i(n){return function(){return n}}function t(){return C}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=n("string"),f=n("array"),l=n("boolean"),s=n("function"),d=function(n){var t=n.getParam("link_assume_external_targets",!1);return l(t)&&t?1:!a(t)||"http"!==t&&"https"!==t?0:t},m=function(n){return n.getParam("link_context_toolbar",!1,"boolean")},h=function(n){return n.getParam("link_list")},p=function(n){return n.getParam("default_link_target")},g=function(n){return n.getParam("target_list",!0)},v=function(n){return n.getParam("rel_list",[],"array")},y=function(n){return n.getParam("link_class_list",[],"array")},w=function(n){return n.getParam("link_title",!0,"boolean")},k=function(n){return n.getParam("allow_unsafe_link_target",!1,"boolean")},x=function(n){return n.getParam("link_quicklink",!1,"boolean")},b=function(n){return n.getParam("link_default_protocol","http","string")},_=function(n){var t=c.document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=c.document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,c.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(n,t){c.document.body.appendChild(n),n.dispatchEvent(t),c.document.body.removeChild(n)}(t,e)},T=function(){return(T=Object.assign||function(n){for(var t,e=1,r=arguments.length;e]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},sn=M,dn=function(n,t){return function(n){return n.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:n.getContent({format:"text"}))},mn=U,hn=R,pn={sanitize:function(n){return V(B)(n)},sanitizeWith:V,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:B},gn=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return gn(t())}}},vn=function(n,r){function e(n,t){var e=function(n,t){return"link"===t?n.catalogs.link:"anchor"===t?n.catalogs.anchor:Q.none()}(r,t.name).getOr([]);return W(o.get(),t.name,e,n)}var o=gn(n.text);return{onChange:function(n,t){return"url"===t.name?function(n){if(o.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value,e=n.url.meta.title!==undefined?n.url.meta.title:"";return Q.some({text:t,title:e})}return Q.none()}(n()):I(["anchor","link"],t.name)?e(n(),t):("text"===t.name&&o.set(n().text),Q.none())}}},yn={},wn={exports:yn};H=undefined,$=yn,G=wn,J=undefined,function(n){"object"==typeof $&&void 0!==G?G.exports=n():"function"==typeof H&&H.amd?H([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function l(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof J&&J;if(!n&&e)return e(t,!0);if(f)return f(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,l,i,u,c)}return u[t].exports}for(var f="function"==typeof J&&J,n=0;n||

    - * becomes:

    ||

    - * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - function createBookmark(rng) { - var bookmark = {}; - - function setupEndPoint(start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - offsetNode = dom.create('span', {'data-mce-type': 'bookmark'}); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - dom.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - } - - /** - * Moves the selection to the current bookmark and removes any selection container wrappers. - * - * @param {Object} bookmark Bookmark object to move selection to. - */ - function moveToBookmark(bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - function nodeIndex(container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node == container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - } - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType == 1) { - offset = nodeIndex(container); - container = container.parentNode; - dom.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = dom.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - selection.setRng(rng); - } - - function createNewTextBlock(contentNode, blockName) { - var node, textBlock, fragment = dom.createFragment(), hasContentNode; - var blockElements = editor.schema.getBlockElements(); - - if (editor.settings.forced_root_block) { - blockName = blockName || editor.settings.forced_root_block; - } - - if (blockName) { - textBlock = dom.create(blockName); - - if (textBlock.tagName === editor.settings.forced_root_block) { - dom.setAttribs(textBlock, editor.settings.forced_root_block_attrs); - } - - fragment.appendChild(textBlock); - } - - if (contentNode) { - while ((node = contentNode.firstChild)) { - var nodeName = node.nodeName; - - if (!hasContentNode && (nodeName != 'SPAN' || node.getAttribute('data-mce-type') != 'bookmark')) { - hasContentNode = true; - } - - if (blockElements[nodeName]) { - fragment.appendChild(node); - textBlock = null; - } else { - if (blockName) { - if (!textBlock) { - textBlock = dom.create(blockName); - fragment.appendChild(textBlock); - } - - textBlock.appendChild(node); - } else { - fragment.appendChild(node); - } - } - } - } - - if (!editor.settings.forced_root_block) { - fragment.appendChild(dom.create('br')); - } else { - // BR is needed in empty blocks on non IE browsers - if (!hasContentNode && (!tinymce.Env.ie || tinymce.Env.ie > 10)) { - textBlock.appendChild(dom.create('br', {'data-mce-bogus': '1'})); - } - } - - return fragment; - } - - function getSelectedListItems() { - return tinymce.grep(selection.getSelectedBlocks(), function(block) { - return block.nodeName == 'LI'; - }); - } - - function splitList(ul, li, newBlock) { - var tmpRng, fragment; - - var bookmarks = dom.select('span[data-mce-type="bookmark"]', ul); - - newBlock = newBlock || createNewTextBlock(li); - tmpRng = dom.createRng(); - tmpRng.setStartAfter(li); - tmpRng.setEndAfter(ul); - fragment = tmpRng.extractContents(); - - if (!dom.isEmpty(fragment)) { - dom.insertAfter(fragment, ul); - } - - dom.insertAfter(newBlock, ul); - - if (dom.isEmpty(li.parentNode)) { - tinymce.each(bookmarks, function(node) { - li.parentNode.parentNode.insertBefore(node, li.parentNode); - }); - - dom.remove(li.parentNode); - } - - dom.remove(li); - } - - function mergeWithAdjacentLists(listBlock) { - var sibling, node; - - sibling = listBlock.nextSibling; - if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName) { - while ((node = sibling.firstChild)) { - listBlock.appendChild(node); - } - - dom.remove(sibling); - } - - sibling = listBlock.previousSibling; - if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName) { - while ((node = sibling.firstChild)) { - listBlock.insertBefore(node, listBlock.firstChild); - } - - dom.remove(sibling); - } - } - - /** - * Normalizes the all lists in the specified element. - */ - function normalizeList(element) { - tinymce.each(tinymce.grep(dom.select('ol,ul', element)), function(ul) { - var sibling, parentNode = ul.parentNode; - - // Move UL/OL to previous LI if it's the only child of a LI - if (parentNode.nodeName == 'LI' && parentNode.firstChild == ul) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - sibling.appendChild(ul); - - if (dom.isEmpty(parentNode)) { - dom.remove(parentNode); - } - } - } - - // Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4 - if (isListNode(parentNode)) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - sibling.appendChild(ul); - } - } - }); - } - - function outdent(li) { - var ul = li.parentNode, ulParent = ul.parentNode, newBlock; - - function removeEmptyLi(li) { - if (dom.isEmpty(li)) { - dom.remove(li); - } - } - - if (isFirstChild(li) && isLastChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - removeEmptyLi(ulParent); - dom.remove(ul); - } else if (isListNode(ulParent)) { - dom.remove(ul, true); - } else { - ulParent.insertBefore(createNewTextBlock(li), ul); - dom.remove(ul); - } - - return true; - } else if (isFirstChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - li.appendChild(ul); - removeEmptyLi(ulParent); - } else if (isListNode(ulParent)) { - ulParent.insertBefore(li, ul); - } else { - ulParent.insertBefore(createNewTextBlock(li), ul); - dom.remove(li); - } - - return true; - } else if (isLastChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - } else if (isListNode(ulParent)) { - dom.insertAfter(li, ul); - } else { - dom.insertAfter(createNewTextBlock(li), ul); - dom.remove(li); - } - - return true; - } else { - if (ulParent.nodeName == 'LI') { - ul = ulParent; - newBlock = createNewTextBlock(li, 'LI'); - } else if (isListNode(ulParent)) { - newBlock = createNewTextBlock(li, 'LI'); - } else { - newBlock = createNewTextBlock(li); - } - - splitList(ul, li, newBlock); - normalizeList(ul.parentNode); - - return true; - } - - return false; - } - - function indent(li) { - var sibling, newList; - - function mergeLists(from, to) { - var node; - - if (isListNode(from)) { - while ((node = li.lastChild.firstChild)) { - to.appendChild(node); - } - - dom.remove(from); - } - } - - sibling = li.previousSibling; - - if (sibling && isListNode(sibling)) { - sibling.appendChild(li); - return true; - } - - if (sibling && sibling.nodeName == 'LI' && isListNode(sibling.lastChild)) { - sibling.lastChild.appendChild(li); - mergeLists(li.lastChild, sibling.lastChild); - return true; - } - - sibling = li.nextSibling; - - if (sibling && isListNode(sibling)) { - sibling.insertBefore(li, sibling.firstChild); - return true; - } - - if (sibling && sibling.nodeName == 'LI' && isListNode(li.lastChild)) { - return false; - } - - sibling = li.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - newList = dom.create(li.parentNode.nodeName); - sibling.appendChild(newList); - newList.appendChild(li); - mergeLists(li.lastChild, newList); - return true; - } - - return false; - } - - function indentSelection() { - var listElements = getSelectedListItems(); - - if (listElements.length) { - var bookmark = createBookmark(selection.getRng(true)); - - for (var i = 0; i < listElements.length; i++) { - if (!indent(listElements[i]) && i === 0) { - break; - } - } - - moveToBookmark(bookmark); - editor.nodeChanged(); - - return true; - } - } - - function outdentSelection() { - var listElements = getSelectedListItems(); - - if (listElements.length) { - var bookmark = createBookmark(selection.getRng(true)); - var i, y, root = editor.getBody(); - - i = listElements.length; - while (i--) { - var node = listElements[i].parentNode; - - while (node && node != root) { - y = listElements.length; - while (y--) { - if (listElements[y] === node) { - listElements.splice(i, 1); - break; - } - } - - node = node.parentNode; - } - } - - for (i = 0; i < listElements.length; i++) { - if (!outdent(listElements[i]) && i === 0) { - break; - } - } - - moveToBookmark(bookmark); - editor.nodeChanged(); - - return true; - } - } - - function applyList(listName) { - var rng = selection.getRng(true), bookmark = createBookmark(rng); - - function getSelectedTextBlocks() { - var textBlocks = [], root = editor.getBody(); - - function getEndPointNode(start) { - var container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - // Resolve node index - if (container.nodeType == 1) { - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - } - - while (container.parentNode != root) { - if (isTextBlock(container)) { - return container; - } - - if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { - return container; - } - - container = container.parentNode; - } - - return container; - } - - var startNode = getEndPointNode(true); - var endNode = getEndPointNode(); - var block, siblings = []; - - for (var node = startNode; node; node = node.nextSibling) { - siblings.push(node); - - if (node == endNode) { - break; - } - } - - tinymce.each(siblings, function(node) { - if (isTextBlock(node)) { - textBlocks.push(node); - block = null; - return; - } - - if (dom.isBlock(node) || node.nodeName == 'BR') { - if (node.nodeName == 'BR') { - dom.remove(node); - } - - block = null; - return; - } - - var nextSibling = node.nextSibling; - if (isBookmarkNode(node)) { - if (isTextBlock(nextSibling) || (!nextSibling && node.parentNode == root)) { - block = null; - return; - } - } - - if (!block) { - block = dom.create('p'); - node.parentNode.insertBefore(block, node); - textBlocks.push(block); - } - - block.appendChild(node); - }); - - return textBlocks; - } - - var textBlocks = getSelectedTextBlocks(); - - tinymce.each(textBlocks, function(block) { - var listBlock, sibling; - - sibling = block.previousSibling; - if (sibling && isListNode(sibling) && sibling.nodeName == listName) { - listBlock = sibling; - block = dom.rename(block, 'LI'); - sibling.appendChild(block); - } else { - listBlock = dom.create(listName); - block.parentNode.insertBefore(listBlock, block); - listBlock.appendChild(block); - block = dom.rename(block, 'LI'); - } - - mergeWithAdjacentLists(listBlock); - }); - - moveToBookmark(bookmark); - } - - function removeList() { - var bookmark = createBookmark(selection.getRng(true)), root = editor.getBody(); - - tinymce.each(getSelectedListItems(), function(li) { - var node, rootList; - - if (dom.isEmpty(li)) { - outdent(li); - return; - } - - for (node = li; node && node != root; node = node.parentNode) { - if (isListNode(node)) { - rootList = node; - } - } - - splitList(rootList, li); - }); - - moveToBookmark(bookmark); - } - - function toggleList(listName) { - var parentList = dom.getParent(selection.getStart(), 'OL,UL'); - - if (parentList) { - if (parentList.nodeName == listName) { - removeList(listName); - } else { - var bookmark = createBookmark(selection.getRng(true)); - mergeWithAdjacentLists(dom.rename(parentList, listName)); - moveToBookmark(bookmark); - } - } else { - applyList(listName); - } - } - - self.backspaceDelete = function(isForward) { - function findNextCaretContainer(rng, isForward) { - var node = rng.startContainer, offset = rng.startOffset; - - if (node.nodeType == 3 && (isForward ? offset < node.data.length : offset > 0)) { - return node; - } - - var walker = new tinymce.dom.TreeWalker(rng.startContainer); - while ((node = walker[isForward ? 'next' : 'prev']())) { - if (node.nodeType == 3 && node.data.length > 0) { - return node; - } - } - } - - function mergeLiElements(fromElm, toElm) { - var node, listNode, ul = fromElm.parentNode; - - if (isListNode(toElm.lastChild)) { - listNode = toElm.lastChild; - } - - node = toElm.lastChild; - if (node && node.nodeName == 'BR' && fromElm.hasChildNodes()) { - dom.remove(node); - } - - while ((node = fromElm.firstChild)) { - toElm.appendChild(node); - } - - if (listNode) { - toElm.appendChild(listNode); - } - - dom.remove(fromElm); - - if (dom.isEmpty(ul)) { - dom.remove(ul); - } - } - - if (selection.isCollapsed()) { - var li = dom.getParent(selection.getStart(), 'LI'); - - if (li) { - var rng = selection.getRng(true); - var otherLi = dom.getParent(findNextCaretContainer(rng, isForward), 'LI'); - - if (otherLi && otherLi != li) { - var bookmark = createBookmark(rng); - - if (isForward) { - mergeLiElements(otherLi, li); - } else { - mergeLiElements(li, otherLi); - } - - moveToBookmark(bookmark); - - return true; - } else if (!otherLi) { - if (!isForward && removeList(li.parentNode.nodeName)) { - return true; - } - } - } - } - }; - - editor.addCommand('Indent', function() { - if (!indentSelection()) { - return true; - } - }); - - editor.addCommand('Outdent', function() { - if (!outdentSelection()) { - return true; - } - }); - - editor.addCommand('InsertUnorderedList', function() { - toggleList('UL'); - }); - - editor.addCommand('InsertOrderedList', function() { - toggleList('OL'); - }); - - editor.on('keydown', function(e) { - if (e.keyCode == 9 && editor.dom.getParent(editor.selection.getStart(), 'LI')) { - e.preventDefault(); - - if (e.shiftKey) { - outdentSelection(); - } else { - indentSelection(); - } - } - }); - }); - - editor.addButton('indent', { - icon: 'indent', - title: 'Increase indent', - cmd: 'Indent', - onPostRender: function() { - var ctrl = this; - - editor.on('nodechange', function() { - var blocks = editor.selection.getSelectedBlocks(); - var disable = false; - - for (var i = 0, l = blocks.length; !disable && i < l; i++) { - var tag = blocks[i].nodeName; - - disable = (tag == 'LI' && isFirstChild(blocks[i]) || tag == 'UL' || tag == 'OL'); - } - - ctrl.disabled(disable); - }); - } - }); - - editor.on('keydown', function(e) { - if (e.keyCode == tinymce.util.VK.BACKSPACE) { - if (self.backspaceDelete()) { - e.preventDefault(); - } - } else if (e.keyCode == tinymce.util.VK.DELETE) { - if (self.backspaceDelete(true)) { - e.preventDefault(); - } - } - }); -}); +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var not = function (f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !f.apply(null, args); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var groupBy = function (xs, f) { + if (xs.length === 0) { + return []; + } else { + var wasType = f(xs[0]); + var r = []; + var group = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var type = f(x); + if (type !== wasType) { + r.push(group); + group = []; + } + wasType = type; + group.push(x); + } + if (group.length !== 0) { + r.push(group); + } + return r; + } + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var last = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var isOS = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains(uastring, 'msie') || contains(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains(uastring, 'iphone') || contains(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var ELEMENT$1 = ELEMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + + var eq = function (e1, e2) { + return e1.dom() === e2.dom(); + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom(); + var d2 = e2.dom(); + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$1 = browser.isIE() ? ieContains : regularContains; + var is$1 = is; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var lift2 = function (oa, ob, f) { + return oa.isSome() && ob.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie())) : Option.none(); + }; + + var fromElements = function (elements, scope) { + var doc = scope || domGlobals.document; + var fragment = doc.createDocumentFragment(); + each(elements, function (element) { + fragment.appendChild(element.dom()); + }); + return Element.fromDom(fragment); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + var keys = Object.keys; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.fromDom); + }; + var children = function (element) { + return map(element.dom().childNodes, Element.fromDom); + }; + var child = function (element, index) { + var cs = element.dom().childNodes; + return Option.from(cs[index]).map(Element.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var lastChild = function (element) { + return child(element, element.dom().childNodes.length - 1); + }; + var spot = Immutable('element', 'offset'); + + var before = function (marker, element) { + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom().insertBefore(element.dom(), marker.dom()); + }); + }; + var append = function (parent, element) { + parent.dom().appendChild(element.dom()); + }; + + var before$1 = function (marker, elements) { + each(elements, function (x) { + before(marker, x); + }); + }; + var append$1 = function (parent, elements) { + each(elements, function (x) { + append(parent, x); + }); + }; + + var remove = function (element) { + var dom = element.dom(); + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + + var fireListEvent = function (editor, action, element) { + return editor.fire('ListMutation', { + action: action, + element: element + }); + }; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var path = function (parts, scope) { + var o = scope !== undefined && scope !== null ? scope : Global; + for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) { + o = o[parts[i]]; + } + return o; + }; + var resolve = function (p, scope) { + var parts = p.split('.'); + return path(parts, scope); + }; + + var unsafe = function (name, scope) { + return resolve(name, scope); + }; + var getOrDie = function (name, scope) { + var actual = unsafe(name, scope); + if (actual === undefined || actual === null) { + throw new Error(name + ' not available on this browser'); + } + return actual; + }; + var Global$1 = { getOrDie: getOrDie }; + + var htmlElement = function (scope) { + return Global$1.getOrDie('HTMLElement', scope); + }; + var isPrototypeOf = function (x) { + var scope = resolve('ownerDocument.defaultView', x); + return htmlElement(scope).prototype.isPrototypeOf(x); + }; + var HTMLElement = { isPrototypeOf: isPrototypeOf }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var isTextNode = function (node) { + return node && node.nodeType === 3; + }; + var isListNode = function (node) { + return node && /^(OL|UL|DL)$/.test(node.nodeName); + }; + var isOlUlNode = function (node) { + return node && /^(OL|UL)$/.test(node.nodeName); + }; + var isListItemNode = function (node) { + return node && /^(LI|DT|DD)$/.test(node.nodeName); + }; + var isDlItemNode = function (node) { + return node && /^(DT|DD)$/.test(node.nodeName); + }; + var isTableCellNode = function (node) { + return node && /^(TH|TD)$/.test(node.nodeName); + }; + var isBr = function (node) { + return node && node.nodeName === 'BR'; + }; + var isFirstChild = function (node) { + return node.parentNode.firstChild === node; + }; + var isLastChild = function (node) { + return node.parentNode.lastChild === node; + }; + var isTextBlock = function (editor, node) { + return node && !!editor.schema.getTextBlockElements()[node.nodeName]; + }; + var isBlock = function (node, blockElements) { + return node && node.nodeName in blockElements; + }; + var isBogusBr = function (dom, node) { + if (!isBr(node)) { + return false; + } + if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) { + return true; + } + return false; + }; + var isEmpty = function (dom, elm, keepBookmarks) { + var empty = dom.isEmpty(elm); + if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) { + return false; + } + return empty; + }; + var isChildOfBody = function (dom, elm) { + return dom.isChildOf(elm, dom.getRoot()); + }; + var NodeType = { + isTextNode: isTextNode, + isListNode: isListNode, + isOlUlNode: isOlUlNode, + isDlItemNode: isDlItemNode, + isListItemNode: isListItemNode, + isTableCellNode: isTableCellNode, + isBr: isBr, + isFirstChild: isFirstChild, + isLastChild: isLastChild, + isTextBlock: isTextBlock, + isBlock: isBlock, + isBogusBr: isBogusBr, + isEmpty: isEmpty, + isChildOfBody: isChildOfBody + }; + + var getParentList = function (editor) { + var selectionStart = editor.selection.getStart(true); + return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart)); + }; + var isParentListSelected = function (parentList, selectedBlocks) { + return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList; + }; + var findSubLists = function (parentList) { + return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) { + return NodeType.isListNode(elm); + }); + }; + var getSelectedSubLists = function (editor) { + var parentList = getParentList(editor); + var selectedBlocks = editor.selection.getSelectedBlocks(); + if (isParentListSelected(parentList, selectedBlocks)) { + return findSubLists(parentList); + } else { + return global$5.grep(selectedBlocks, function (elm) { + return NodeType.isListNode(elm) && parentList !== elm; + }); + } + }; + var findParentListItemsNodes = function (editor, elms) { + var listItemsElms = global$5.map(elms, function (elm) { + var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm)); + return parentLi ? parentLi : elm; + }); + return global$4.unique(listItemsElms); + }; + var getSelectedListItems = function (editor) { + var selectedBlocks = editor.selection.getSelectedBlocks(); + return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { + return NodeType.isListItemNode(block); + }); + }; + var getSelectedDlItems = function (editor) { + return filter(getSelectedListItems(editor), NodeType.isDlItemNode); + }; + var getClosestListRootElm = function (editor, elm) { + var parentTableCell = editor.dom.getParents(elm, 'TD,TH'); + var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody(); + return root; + }; + var findLastParentListNode = function (editor, elm) { + var parentLists = editor.dom.getParents(elm, 'ol,ul', getClosestListRootElm(editor, elm)); + return last(parentLists); + }; + var getSelectedLists = function (editor) { + var firstList = findLastParentListNode(editor, editor.selection.getStart()); + var subsequentLists = filter(editor.selection.getSelectedBlocks(), NodeType.isOlUlNode); + return firstList.toArray().concat(subsequentLists); + }; + var getSelectedListRoots = function (editor) { + var selectedLists = getSelectedLists(editor); + return getUniqueListRoots(editor, selectedLists); + }; + var getUniqueListRoots = function (editor, lists) { + var listRoots = map(lists, function (list) { + return findLastParentListNode(editor, list).getOr(list); + }); + return global$4.unique(listRoots); + }; + var isList = function (editor) { + var list = getParentList(editor); + return HTMLElement.isPrototypeOf(list); + }; + var Selection = { + isList: isList, + getParentList: getParentList, + getSelectedSubLists: getSelectedSubLists, + getSelectedListItems: getSelectedListItems, + getClosestListRootElm: getClosestListRootElm, + getSelectedDlItems: getSelectedDlItems, + getSelectedListRoots: getSelectedListRoots + }; + + var shouldIndentOnTab = function (editor) { + return editor.getParam('lists_indent_on_tab', true); + }; + var getForcedRootBlock = function (editor) { + var block = editor.getParam('forced_root_block', 'p'); + if (block === false) { + return ''; + } else if (block === true) { + return 'p'; + } else { + return block; + } + }; + var getForcedRootBlockAttrs = function (editor) { + return editor.getParam('forced_root_block_attrs', {}); + }; + var Settings = { + shouldIndentOnTab: shouldIndentOnTab, + getForcedRootBlock: getForcedRootBlock, + getForcedRootBlockAttrs: getForcedRootBlockAttrs + }; + + var createTextBlock = function (editor, contentNode) { + var dom = editor.dom; + var blockElements = editor.schema.getBlockElements(); + var fragment = dom.createFragment(); + var blockName = Settings.getForcedRootBlock(editor); + var node, textBlock, hasContentNode; + if (blockName) { + textBlock = dom.create(blockName); + if (textBlock.tagName === blockName.toUpperCase()) { + dom.setAttribs(textBlock, Settings.getForcedRootBlockAttrs(editor)); + } + if (!NodeType.isBlock(contentNode.firstChild, blockElements)) { + fragment.appendChild(textBlock); + } + } + if (contentNode) { + while (node = contentNode.firstChild) { + var nodeName = node.nodeName; + if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) { + hasContentNode = true; + } + if (NodeType.isBlock(node, blockElements)) { + fragment.appendChild(node); + textBlock = null; + } else { + if (blockName) { + if (!textBlock) { + textBlock = dom.create(blockName); + fragment.appendChild(textBlock); + } + textBlock.appendChild(node); + } else { + fragment.appendChild(node); + } + } + } + } + if (!blockName) { + fragment.appendChild(dom.create('br')); + } else { + if (!hasContentNode) { + textBlock.appendChild(dom.create('br', { 'data-mce-bogus': '1' })); + } + } + return fragment; + }; + + var name = function (element) { + var r = element.dom().nodeName; + return r.toLowerCase(); + }; + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isElement = isType$1(ELEMENT); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var setAll = function (element, attrs) { + var dom = element.dom(); + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var clone = function (element) { + return foldl(element.dom().attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } + }; + var set = function (element, property, value) { + var dom = element.dom(); + internalSet(dom, property, value); + }; + + var clone$1 = function (original, isDeep) { + return Element.fromDom(original.dom().cloneNode(isDeep)); + }; + var deep = function (original) { + return clone$1(original, true); + }; + var shallowAs = function (original, tag) { + var nu = Element.fromTag(tag); + var attributes = clone(original); + setAll(nu, attributes); + return nu; + }; + var mutate = function (original, tag) { + var nu = shallowAs(original, tag); + before(original, nu); + var children$1 = children(original); + append$1(nu, children$1); + remove(original); + return nu; + }; + + var joinSegment = function (parent, child) { + append(parent.item, child.list); + }; + var joinSegments = function (segments) { + for (var i = 1; i < segments.length; i++) { + joinSegment(segments[i - 1], segments[i]); + } + }; + var appendSegments = function (head$1, tail) { + lift2(last(head$1), head(tail), joinSegment); + }; + var createSegment = function (scope, listType) { + var segment = { + list: Element.fromTag(listType, scope), + item: Element.fromTag('li', scope) + }; + append(segment.list, segment.item); + return segment; + }; + var createSegments = function (scope, entry, size) { + var segments = []; + for (var i = 0; i < size; i++) { + segments.push(createSegment(scope, entry.listType)); + } + return segments; + }; + var populateSegments = function (segments, entry) { + for (var i = 0; i < segments.length - 1; i++) { + set(segments[i].item, 'list-style-type', 'none'); + } + last(segments).each(function (segment) { + setAll(segment.list, entry.listAttributes); + setAll(segment.item, entry.itemAttributes); + append$1(segment.item, entry.content); + }); + }; + var normalizeSegment = function (segment, entry) { + if (name(segment.list) !== entry.listType) { + segment.list = mutate(segment.list, entry.listType); + } + setAll(segment.list, entry.listAttributes); + }; + var createItem = function (scope, attr, content) { + var item = Element.fromTag('li', scope); + setAll(item, attr); + append$1(item, content); + return item; + }; + var appendItem = function (segment, item) { + append(segment.list, item); + segment.item = item; + }; + var writeShallow = function (scope, cast, entry) { + var newCast = cast.slice(0, entry.depth); + last(newCast).each(function (segment) { + var item = createItem(scope, entry.itemAttributes, entry.content); + appendItem(segment, item); + normalizeSegment(segment, entry); + }); + return newCast; + }; + var writeDeep = function (scope, cast, entry) { + var segments = createSegments(scope, entry, entry.depth - cast.length); + joinSegments(segments); + populateSegments(segments, entry); + appendSegments(cast, segments); + return cast.concat(segments); + }; + var composeList = function (scope, entries) { + var cast = foldl(entries, function (cast, entry) { + return entry.depth > cast.length ? writeDeep(scope, cast, entry) : writeShallow(scope, cast, entry); + }, []); + return head(cast).map(function (segment) { + return segment.list; + }); + }; + + var isList$1 = function (el) { + return is$1(el, 'OL,UL'); + }; + var hasFirstChildList = function (el) { + return firstChild(el).map(isList$1).getOr(false); + }; + var hasLastChildList = function (el) { + return lastChild(el).map(isList$1).getOr(false); + }; + + var isIndented = function (entry) { + return entry.depth > 0; + }; + var isSelected = function (entry) { + return entry.isSelected; + }; + var cloneItemContent = function (li) { + var children$1 = children(li); + var content = hasLastChildList(li) ? children$1.slice(0, -1) : children$1; + return map(content, deep); + }; + var createEntry = function (li, depth, isSelected) { + return parent(li).filter(isElement).map(function (list) { + return { + depth: depth, + isSelected: isSelected, + content: cloneItemContent(li), + itemAttributes: clone(li), + listAttributes: clone(list), + listType: name(list) + }; + }); + }; + + var indentEntry = function (indentation, entry) { + switch (indentation) { + case 'Indent': + entry.depth++; + break; + case 'Outdent': + entry.depth--; + break; + case 'Flatten': + entry.depth = 0; + } + }; + + var cloneListProperties = function (target, source) { + target.listType = source.listType; + target.listAttributes = __assign({}, source.listAttributes); + }; + var previousSiblingEntry = function (entries, start) { + var depth = entries[start].depth; + for (var i = start - 1; i >= 0; i--) { + if (entries[i].depth === depth) { + return Option.some(entries[i]); + } + if (entries[i].depth < depth) { + break; + } + } + return Option.none(); + }; + var normalizeEntries = function (entries) { + each(entries, function (entry, i) { + previousSiblingEntry(entries, i).each(function (matchingEntry) { + cloneListProperties(entry, matchingEntry); + }); + }); + }; + + var parseItem = function (depth, itemSelection, selectionState, item) { + return firstChild(item).filter(isList$1).fold(function () { + itemSelection.each(function (selection) { + if (eq(selection.start, item)) { + selectionState.set(true); + } + }); + var currentItemEntry = createEntry(item, depth, selectionState.get()); + itemSelection.each(function (selection) { + if (eq(selection.end, item)) { + selectionState.set(false); + } + }); + var childListEntries = lastChild(item).filter(isList$1).map(function (list) { + return parseList(depth, itemSelection, selectionState, list); + }).getOr([]); + return currentItemEntry.toArray().concat(childListEntries); + }, function (list) { + return parseList(depth, itemSelection, selectionState, list); + }); + }; + var parseList = function (depth, itemSelection, selectionState, list) { + return bind(children(list), function (element) { + var parser = isList$1(element) ? parseList : parseItem; + var newDepth = depth + 1; + return parser(newDepth, itemSelection, selectionState, element); + }); + }; + var parseLists = function (lists, itemSelection) { + var selectionState = Cell(false); + var initialDepth = 0; + return map(lists, function (list) { + return { + sourceList: list, + entries: parseList(initialDepth, itemSelection, selectionState, list) + }; + }); + }; + + var outdentedComposer = function (editor, entries) { + return map(entries, function (entry) { + var content = fromElements(entry.content); + return Element.fromDom(createTextBlock(editor, content.dom())); + }); + }; + var indentedComposer = function (editor, entries) { + normalizeEntries(entries); + return composeList(editor.contentDocument, entries).toArray(); + }; + var composeEntries = function (editor, entries) { + return bind(groupBy(entries, isIndented), function (entries) { + var groupIsIndented = head(entries).map(isIndented).getOr(false); + return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries); + }); + }; + var indentSelectedEntries = function (entries, indentation) { + each(filter(entries, isSelected), function (entry) { + return indentEntry(indentation, entry); + }); + }; + var getItemSelection = function (editor) { + var selectedListItems = map(Selection.getSelectedListItems(editor), Element.fromDom); + return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), function (start, end) { + return { + start: start, + end: end + }; + }); + }; + var listIndentation = function (editor, lists, indentation) { + var entrySets = parseLists(lists, getItemSelection(editor)); + each(entrySets, function (entrySet) { + indentSelectedEntries(entrySet.entries, indentation); + var composedLists = composeEntries(editor, entrySet.entries); + each(composedLists, function (composedList) { + fireListEvent(editor, indentation === 'Indent' ? 'IndentList' : 'OutdentList', composedList.dom()); + }); + before$1(entrySet.sourceList, composedLists); + remove(entrySet.sourceList); + }); + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var DOM = global$6.DOM; + var splitList = function (editor, ul, li) { + var tmpRng, fragment, bookmarks, node, newBlock; + var removeAndKeepBookmarks = function (targetNode) { + global$5.each(bookmarks, function (node) { + targetNode.parentNode.insertBefore(node, li.parentNode); + }); + DOM.remove(targetNode); + }; + bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul); + newBlock = createTextBlock(editor, li); + tmpRng = DOM.createRng(); + tmpRng.setStartAfter(li); + tmpRng.setEndAfter(ul); + fragment = tmpRng.extractContents(); + for (node = fragment.firstChild; node; node = node.firstChild) { + if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) { + DOM.remove(node); + break; + } + } + if (!editor.dom.isEmpty(fragment)) { + DOM.insertAfter(fragment, ul); + } + DOM.insertAfter(newBlock, ul); + if (NodeType.isEmpty(editor.dom, li.parentNode)) { + removeAndKeepBookmarks(li.parentNode); + } + DOM.remove(li); + if (NodeType.isEmpty(editor.dom, ul)) { + DOM.remove(ul); + } + }; + var SplitList = { splitList: splitList }; + + var outdentDlItem = function (editor, item) { + if (is$1(item, 'dd')) { + mutate(item, 'dt'); + } else if (is$1(item, 'dt')) { + parent(item).each(function (dl) { + return SplitList.splitList(editor, dl.dom(), item.dom()); + }); + } + }; + var indentDlItem = function (item) { + if (is$1(item, 'dt')) { + mutate(item, 'dd'); + } + }; + var dlIndentation = function (editor, indentation, dlItems) { + if (indentation === 'Indent') { + each(dlItems, indentDlItem); + } else { + each(dlItems, function (item) { + return outdentDlItem(editor, item); + }); + } + }; + + var getNormalizedPoint = function (container, offset) { + if (NodeType.isTextNode(container)) { + return { + container: container, + offset: offset + }; + } + var node = global$1.getNode(container, offset); + if (NodeType.isTextNode(node)) { + return { + container: node, + offset: offset >= container.childNodes.length ? node.data.length : 0 + }; + } else if (node.previousSibling && NodeType.isTextNode(node.previousSibling)) { + return { + container: node.previousSibling, + offset: node.previousSibling.data.length + }; + } else if (node.nextSibling && NodeType.isTextNode(node.nextSibling)) { + return { + container: node.nextSibling, + offset: 0 + }; + } + return { + container: container, + offset: offset + }; + }; + var normalizeRange = function (rng) { + var outRng = rng.cloneRange(); + var rangeStart = getNormalizedPoint(rng.startContainer, rng.startOffset); + outRng.setStart(rangeStart.container, rangeStart.offset); + var rangeEnd = getNormalizedPoint(rng.endContainer, rng.endOffset); + outRng.setEnd(rangeEnd.container, rangeEnd.offset); + return outRng; + }; + var Range = { + getNormalizedPoint: getNormalizedPoint, + normalizeRange: normalizeRange + }; + + var selectionIndentation = function (editor, indentation) { + var lists = map(Selection.getSelectedListRoots(editor), Element.fromDom); + var dlItems = map(Selection.getSelectedDlItems(editor), Element.fromDom); + var isHandled = false; + if (lists.length || dlItems.length) { + var bookmark = editor.selection.getBookmark(); + listIndentation(editor, lists, indentation); + dlIndentation(editor, indentation, dlItems); + editor.selection.moveToBookmark(bookmark); + editor.selection.setRng(Range.normalizeRange(editor.selection.getRng())); + editor.nodeChanged(); + isHandled = true; + } + return isHandled; + }; + var indentListSelection = function (editor) { + return selectionIndentation(editor, 'Indent'); + }; + var outdentListSelection = function (editor) { + return selectionIndentation(editor, 'Outdent'); + }; + var flattenListSelection = function (editor) { + return selectionIndentation(editor, 'Flatten'); + }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager'); + + var DOM$1 = global$6.DOM; + var createBookmark = function (rng) { + var bookmark = {}; + var setupEndPoint = function (start) { + var offsetNode, container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + offsetNode = DOM$1.create('span', { 'data-mce-type': 'bookmark' }); + if (container.hasChildNodes()) { + offset = Math.min(offset, container.childNodes.length - 1); + if (start) { + container.insertBefore(offsetNode, container.childNodes[offset]); + } else { + DOM$1.insertAfter(offsetNode, container.childNodes[offset]); + } + } else { + container.appendChild(offsetNode); + } + container = offsetNode; + offset = 0; + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + }; + setupEndPoint(true); + if (!rng.collapsed) { + setupEndPoint(); + } + return bookmark; + }; + var resolveBookmark = function (bookmark) { + function restoreEndPoint(start) { + var container, offset, node; + var nodeIndex = function (container) { + var node = container.parentNode.firstChild, idx = 0; + while (node) { + if (node === container) { + return idx; + } + if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { + idx++; + } + node = node.nextSibling; + } + return -1; + }; + container = node = bookmark[start ? 'startContainer' : 'endContainer']; + offset = bookmark[start ? 'startOffset' : 'endOffset']; + if (!container) { + return; + } + if (container.nodeType === 1) { + offset = nodeIndex(container); + container = container.parentNode; + DOM$1.remove(node); + if (!container.hasChildNodes() && DOM$1.isBlock(container)) { + container.appendChild(DOM$1.create('br')); + } + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + } + restoreEndPoint(true); + restoreEndPoint(); + var rng = DOM$1.createRng(); + rng.setStart(bookmark.startContainer, bookmark.startOffset); + if (bookmark.endContainer) { + rng.setEnd(bookmark.endContainer, bookmark.endOffset); + } + return Range.normalizeRange(rng); + }; + var Bookmark = { + createBookmark: createBookmark, + resolveBookmark: resolveBookmark + }; + + var isCustomList = function (list) { + return /\btox\-/.test(list.className); + }; + + var listToggleActionFromListName = function (listName) { + switch (listName) { + case 'UL': + return 'ToggleUlList'; + case 'OL': + return 'ToggleOlList'; + case 'DL': + return 'ToggleDLList'; + } + }; + + var updateListStyle = function (dom, el, detail) { + var type = detail['list-style-type'] ? detail['list-style-type'] : null; + dom.setStyle(el, 'list-style-type', type); + }; + var setAttribs = function (elm, attrs) { + global$5.each(attrs, function (value, key) { + elm.setAttribute(key, value); + }); + }; + var updateListAttrs = function (dom, el, detail) { + setAttribs(el, detail['list-attributes']); + global$5.each(dom.select('li', el), function (li) { + setAttribs(li, detail['list-item-attributes']); + }); + }; + var updateListWithDetails = function (dom, el, detail) { + updateListStyle(dom, el, detail); + updateListAttrs(dom, el, detail); + }; + var removeStyles = function (dom, element, styles) { + global$5.each(styles, function (style) { + var _a; + return dom.setStyle(element, (_a = {}, _a[style] = '', _a)); + }); + }; + var getEndPointNode = function (editor, rng, start, root) { + var container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + } + if (!start && NodeType.isBr(container.nextSibling)) { + container = container.nextSibling; + } + while (container.parentNode !== root) { + if (NodeType.isTextBlock(editor, container)) { + return container; + } + if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { + return container; + } + container = container.parentNode; + } + return container; + }; + var getSelectedTextBlocks = function (editor, rng, root) { + var textBlocks = [], dom = editor.dom; + var startNode = getEndPointNode(editor, rng, true, root); + var endNode = getEndPointNode(editor, rng, false, root); + var block; + var siblings = []; + for (var node = startNode; node; node = node.nextSibling) { + siblings.push(node); + if (node === endNode) { + break; + } + } + global$5.each(siblings, function (node) { + if (NodeType.isTextBlock(editor, node)) { + textBlocks.push(node); + block = null; + return; + } + if (dom.isBlock(node) || NodeType.isBr(node)) { + if (NodeType.isBr(node)) { + dom.remove(node); + } + block = null; + return; + } + var nextSibling = node.nextSibling; + if (global$7.isBookmarkNode(node)) { + if (NodeType.isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) { + block = null; + return; + } + } + if (!block) { + block = dom.create('p'); + node.parentNode.insertBefore(block, node); + textBlocks.push(block); + } + block.appendChild(node); + }); + return textBlocks; + }; + var hasCompatibleStyle = function (dom, sib, detail) { + var sibStyle = dom.getStyle(sib, 'list-style-type'); + var detailStyle = detail ? detail['list-style-type'] : ''; + detailStyle = detailStyle === null ? '' : detailStyle; + return sibStyle === detailStyle; + }; + var applyList = function (editor, listName, detail) { + if (detail === void 0) { + detail = {}; + } + var rng = editor.selection.getRng(true); + var bookmark; + var listItemName = 'LI'; + var root = Selection.getClosestListRootElm(editor, editor.selection.getStart(true)); + var dom = editor.dom; + if (dom.getContentEditable(editor.selection.getNode()) === 'false') { + return; + } + listName = listName.toUpperCase(); + if (listName === 'DL') { + listItemName = 'DT'; + } + bookmark = Bookmark.createBookmark(rng); + global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) { + var listBlock, sibling; + sibling = block.previousSibling; + if (sibling && NodeType.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) { + listBlock = sibling; + block = dom.rename(block, listItemName); + sibling.appendChild(block); + } else { + listBlock = dom.create(listName); + block.parentNode.insertBefore(listBlock, block); + listBlock.appendChild(block); + block = dom.rename(block, listItemName); + } + removeStyles(dom, block, [ + 'margin', + 'margin-right', + 'margin-bottom', + 'margin-left', + 'margin-top', + 'padding', + 'padding-right', + 'padding-bottom', + 'padding-left', + 'padding-top' + ]); + updateListWithDetails(dom, listBlock, detail); + mergeWithAdjacentLists(editor.dom, listBlock); + }); + editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); + }; + var isValidLists = function (list1, list2) { + return list1 && list2 && NodeType.isListNode(list1) && list1.nodeName === list2.nodeName; + }; + var hasSameListStyle = function (dom, list1, list2) { + var targetStyle = dom.getStyle(list1, 'list-style-type', true); + var style = dom.getStyle(list2, 'list-style-type', true); + return targetStyle === style; + }; + var hasSameClasses = function (elm1, elm2) { + return elm1.className === elm2.className; + }; + var shouldMerge = function (dom, list1, list2) { + return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2); + }; + var mergeWithAdjacentLists = function (dom, listBlock) { + var sibling, node; + sibling = listBlock.nextSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.firstChild) { + listBlock.appendChild(node); + } + dom.remove(sibling); + } + sibling = listBlock.previousSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.lastChild) { + listBlock.insertBefore(node, listBlock.firstChild); + } + dom.remove(sibling); + } + }; + var updateList = function (editor, list, listName, detail) { + if (list.nodeName !== listName) { + var newList = editor.dom.rename(list, listName); + updateListWithDetails(editor.dom, newList, detail); + fireListEvent(editor, listToggleActionFromListName(listName), newList); + } else { + updateListWithDetails(editor.dom, list, detail); + fireListEvent(editor, listToggleActionFromListName(listName), list); + } + }; + var toggleMultipleLists = function (editor, parentList, lists, listName, detail) { + if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { + flattenListSelection(editor); + } else { + var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)); + global$5.each([parentList].concat(lists), function (elm) { + updateList(editor, elm, listName, detail); + }); + editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); + } + }; + var hasListStyleDetail = function (detail) { + return 'list-style-type' in detail; + }; + var toggleSingleList = function (editor, parentList, listName, detail) { + if (parentList === editor.getBody()) { + return; + } + if (parentList) { + if (parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) { + flattenListSelection(editor); + } else { + var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)); + updateListWithDetails(editor.dom, parentList, detail); + var newList = editor.dom.rename(parentList, listName); + mergeWithAdjacentLists(editor.dom, newList); + editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); + fireListEvent(editor, listToggleActionFromListName(listName), newList); + } + } else { + applyList(editor, listName, detail); + fireListEvent(editor, listToggleActionFromListName(listName), parentList); + } + }; + var toggleList = function (editor, listName, detail) { + var parentList = Selection.getParentList(editor); + var selectedSubLists = Selection.getSelectedSubLists(editor); + detail = detail ? detail : {}; + if (parentList && selectedSubLists.length > 0) { + toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); + } else { + toggleSingleList(editor, parentList, listName, detail); + } + }; + var ToggleList = { + toggleList: toggleList, + mergeWithAdjacentLists: mergeWithAdjacentLists + }; + + var DOM$2 = global$6.DOM; + var normalizeList = function (dom, ul) { + var sibling; + var parentNode = ul.parentNode; + if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + if (NodeType.isEmpty(dom, parentNode)) { + DOM$2.remove(parentNode); + } + } else { + DOM$2.setStyle(parentNode, 'listStyleType', 'none'); + } + } + if (NodeType.isListNode(parentNode)) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + } + } + }; + var normalizeLists = function (dom, element) { + global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) { + normalizeList(dom, ul); + }); + }; + var NormalizeLists = { + normalizeList: normalizeList, + normalizeLists: normalizeLists + }; + + var findNextCaretContainer = function (editor, rng, isForward, root) { + var node = rng.startContainer; + var offset = rng.startOffset; + if (NodeType.isTextNode(node) && (isForward ? offset < node.data.length : offset > 0)) { + return node; + } + var nonEmptyBlocks = editor.schema.getNonEmptyElements(); + if (node.nodeType === 1) { + node = global$1.getNode(node, offset); + } + var walker = new global$2(node, root); + if (isForward) { + if (NodeType.isBogusBr(editor.dom, node)) { + walker.next(); + } + } + while (node = walker[isForward ? 'next' : 'prev2']()) { + if (node.nodeName === 'LI' && !node.hasChildNodes()) { + return node; + } + if (nonEmptyBlocks[node.nodeName]) { + return node; + } + if (NodeType.isTextNode(node) && node.data.length > 0) { + return node; + } + } + }; + var hasOnlyOneBlockChild = function (dom, elm) { + var childNodes = elm.childNodes; + return childNodes.length === 1 && !NodeType.isListNode(childNodes[0]) && dom.isBlock(childNodes[0]); + }; + var unwrapSingleBlockChild = function (dom, elm) { + if (hasOnlyOneBlockChild(dom, elm)) { + dom.remove(elm.firstChild, true); + } + }; + var moveChildren = function (dom, fromElm, toElm) { + var node, targetElm; + targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; + unwrapSingleBlockChild(dom, fromElm); + if (!NodeType.isEmpty(dom, fromElm, true)) { + while (node = fromElm.firstChild) { + targetElm.appendChild(node); + } + } + }; + var mergeLiElements = function (dom, fromElm, toElm) { + var node, listNode; + var ul = fromElm.parentNode; + if (!NodeType.isChildOfBody(dom, fromElm) || !NodeType.isChildOfBody(dom, toElm)) { + return; + } + if (NodeType.isListNode(toElm.lastChild)) { + listNode = toElm.lastChild; + } + if (ul === toElm.lastChild) { + if (NodeType.isBr(ul.previousSibling)) { + dom.remove(ul.previousSibling); + } + } + node = toElm.lastChild; + if (node && NodeType.isBr(node) && fromElm.hasChildNodes()) { + dom.remove(node); + } + if (NodeType.isEmpty(dom, toElm, true)) { + dom.$(toElm).empty(); + } + moveChildren(dom, fromElm, toElm); + if (listNode) { + toElm.appendChild(listNode); + } + var contains = contains$1(Element.fromDom(toElm), Element.fromDom(fromElm)); + var nestedLists = contains ? dom.getParents(fromElm, NodeType.isListNode, toElm) : []; + dom.remove(fromElm); + each(nestedLists, function (list) { + if (NodeType.isEmpty(dom, list) && list !== dom.getRoot()) { + dom.remove(list); + } + }); + }; + var mergeIntoEmptyLi = function (editor, fromLi, toLi) { + editor.dom.$(toLi).empty(); + mergeLiElements(editor.dom, fromLi, toLi); + editor.selection.setCursorLocation(toLi); + }; + var mergeForward = function (editor, rng, fromLi, toLi) { + var dom = editor.dom; + if (dom.isEmpty(toLi)) { + mergeIntoEmptyLi(editor, fromLi, toLi); + } else { + var bookmark = Bookmark.createBookmark(rng); + mergeLiElements(dom, fromLi, toLi); + editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); + } + }; + var mergeBackward = function (editor, rng, fromLi, toLi) { + var bookmark = Bookmark.createBookmark(rng); + mergeLiElements(editor.dom, fromLi, toLi); + var resolvedBookmark = Bookmark.resolveBookmark(bookmark); + editor.selection.setRng(resolvedBookmark); + }; + var backspaceDeleteFromListToListCaret = function (editor, isForward) { + var dom = editor.dom, selection = editor.selection; + var selectionStartElm = selection.getStart(); + var root = Selection.getClosestListRootElm(editor, selectionStartElm); + var li = dom.getParent(selection.getStart(), 'LI', root); + if (li) { + var ul = li.parentNode; + if (ul === editor.getBody() && NodeType.isEmpty(dom, ul)) { + return true; + } + var rng_1 = Range.normalizeRange(selection.getRng()); + var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng_1, isForward, root), 'LI', root); + if (otherLi_1 && otherLi_1 !== li) { + editor.undoManager.transact(function () { + if (isForward) { + mergeForward(editor, rng_1, otherLi_1, li); + } else { + if (NodeType.isFirstChild(li)) { + outdentListSelection(editor); + } else { + mergeBackward(editor, rng_1, li, otherLi_1); + } + } + }); + return true; + } else if (!otherLi_1) { + if (!isForward && rng_1.startOffset === 0 && rng_1.endOffset === 0) { + editor.undoManager.transact(function () { + flattenListSelection(editor); + }); + return true; + } + } + } + return false; + }; + var removeBlock = function (dom, block, root) { + var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root); + dom.remove(block); + if (parentBlock && dom.isEmpty(parentBlock)) { + dom.remove(parentBlock); + } + }; + var backspaceDeleteIntoListCaret = function (editor, isForward) { + var dom = editor.dom; + var selectionStartElm = editor.selection.getStart(); + var root = Selection.getClosestListRootElm(editor, selectionStartElm); + var block = dom.getParent(selectionStartElm, dom.isBlock, root); + if (block && dom.isEmpty(block)) { + var rng = Range.normalizeRange(editor.selection.getRng()); + var otherLi_2 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root); + if (otherLi_2) { + editor.undoManager.transact(function () { + removeBlock(dom, block, root); + ToggleList.mergeWithAdjacentLists(dom, otherLi_2.parentNode); + editor.selection.select(otherLi_2, true); + editor.selection.collapse(isForward); + }); + return true; + } + } + return false; + }; + var backspaceDeleteCaret = function (editor, isForward) { + return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward); + }; + var backspaceDeleteRange = function (editor) { + var selectionStartElm = editor.selection.getStart(); + var root = Selection.getClosestListRootElm(editor, selectionStartElm); + var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root); + if (startListParent || Selection.getSelectedListItems(editor).length > 0) { + editor.undoManager.transact(function () { + editor.execCommand('Delete'); + NormalizeLists.normalizeLists(editor.dom, editor.getBody()); + }); + return true; + } + return false; + }; + var backspaceDelete = function (editor, isForward) { + return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor); + }; + var setup = function (editor) { + editor.on('keydown', function (e) { + if (e.keyCode === global$3.BACKSPACE) { + if (backspaceDelete(editor, false)) { + e.preventDefault(); + } + } else if (e.keyCode === global$3.DELETE) { + if (backspaceDelete(editor, true)) { + e.preventDefault(); + } + } + }); + }; + var Delete = { + setup: setup, + backspaceDelete: backspaceDelete + }; + + var get = function (editor) { + return { + backspaceDelete: function (isForward) { + Delete.backspaceDelete(editor, isForward); + } + }; + }; + var Api = { get: get }; + + var queryListCommandState = function (editor, listName) { + return function () { + var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL'); + return parentList && parentList.nodeName === listName; + }; + }; + var register = function (editor) { + editor.on('BeforeExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd === 'indent') { + indentListSelection(editor); + } else if (cmd === 'outdent') { + outdentListSelection(editor); + } + }); + editor.addCommand('InsertUnorderedList', function (ui, detail) { + ToggleList.toggleList(editor, 'UL', detail); + }); + editor.addCommand('InsertOrderedList', function (ui, detail) { + ToggleList.toggleList(editor, 'OL', detail); + }); + editor.addCommand('InsertDefinitionList', function (ui, detail) { + ToggleList.toggleList(editor, 'DL', detail); + }); + editor.addCommand('RemoveList', function () { + flattenListSelection(editor); + }); + editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); + editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); + editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); + }; + var Commands = { register: register }; + + var setupTabKey = function (editor) { + editor.on('keydown', function (e) { + if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) { + return; + } + editor.undoManager.transact(function () { + if (e.shiftKey ? outdentListSelection(editor) : indentListSelection(editor)) { + e.preventDefault(); + } + }); + }); + }; + var setup$1 = function (editor) { + if (Settings.shouldIndentOnTab(editor)) { + setupTabKey(editor); + } + Delete.setup(editor); + }; + var Keyboard = { setup: setup$1 }; + + var findIndex = function (list, predicate) { + for (var index = 0; index < list.length; index++) { + var element = list[index]; + if (predicate(element)) { + return index; + } + } + return -1; + }; + var listState = function (editor, listName) { + return function (buttonApi) { + var nodeChangeHandler = function (e) { + var tableCellIndex = findIndex(e.parents, NodeType.isTableCellNode); + var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; + var lists = global$5.grep(parents, NodeType.isListNode); + buttonApi.setActive(lists.length > 0 && lists[0].nodeName === listName && !isCustomList(lists[0])); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var register$1 = function (editor) { + var hasPlugin = function (editor, plugin) { + var plugins = editor.settings.plugins ? editor.settings.plugins : ''; + return global$5.inArray(plugins.split(/[ ,]/), plugin) !== -1; + }; + var exec = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + if (!hasPlugin(editor, 'advlist')) { + editor.ui.registry.addToggleButton('numlist', { + icon: 'ordered-list', + active: false, + tooltip: 'Numbered list', + onAction: exec('InsertOrderedList'), + onSetup: listState(editor, 'OL') + }); + editor.ui.registry.addToggleButton('bullist', { + icon: 'unordered-list', + active: false, + tooltip: 'Bullet list', + onAction: exec('InsertUnorderedList'), + onSetup: listState(editor, 'UL') + }); + } + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('lists', function (editor) { + Keyboard.setup(editor); + Buttons.register(editor); + Commands.register(editor); + return Api.get(editor); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/lists/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/lists/plugin.min.js index 21f1808..04684a5 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/lists/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/lists/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("lists",function(e){function t(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function n(e){return e.parentNode.firstChild==e}function r(e){return e.parentNode.lastChild==e}function o(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}function i(e){return e&&"SPAN"===e.nodeName&&"bookmark"===e.getAttribute("data-mce-type")}var a=this;e.on("init",function(){function d(e){function t(t){var r,o,i;o=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],1==o.nodeType&&(r=b.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),t?o.insertBefore(r,o.childNodes[i]):b.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),n[t?"startContainer":"endContainer"]=o,n[t?"startOffset":"endOffset"]=i}var n={};return t(!0),e.collapsed||t(),n}function s(e){function t(t){function n(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;(1!=t.nodeType||"bookmark"!=t.getAttribute("data-mce-type"))&&n++,t=t.nextSibling}return-1}var r,o,i;r=i=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],r&&(1==r.nodeType&&(o=n(r),r=r.parentNode,b.remove(i)),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=o)}t(!0),t();var n=b.createRng();n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),k.setRng(n)}function f(t,n){var r,o,i,a=b.createFragment(),d=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&(o=b.create(n),o.tagName===e.settings.forced_root_block&&b.setAttribs(o,e.settings.forced_root_block_attrs),a.appendChild(o)),t)for(;r=t.firstChild;){var s=r.nodeName;i||"SPAN"==s&&"bookmark"==r.getAttribute("data-mce-type")||(i=!0),d[s]?(a.appendChild(r),o=null):n?(o||(o=b.create(n),a.appendChild(o)),o.appendChild(r)):a.appendChild(r)}return e.settings.forced_root_block?i||tinymce.Env.ie&&!(tinymce.Env.ie>10)||o.appendChild(b.create("br",{"data-mce-bogus":"1"})):a.appendChild(b.create("br")),a}function l(){return tinymce.grep(k.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function c(e,t,n){var r,o,i=b.select('span[data-mce-type="bookmark"]',e);n=n||f(t),r=b.createRng(),r.setStartAfter(t),r.setEndAfter(e),o=r.extractContents(),b.isEmpty(o)||b.insertAfter(o,e),b.insertAfter(n,e),b.isEmpty(t.parentNode)&&(tinymce.each(i,function(e){t.parentNode.parentNode.insertBefore(e,t.parentNode)}),b.remove(t.parentNode)),b.remove(t)}function p(e){var n,r;if(n=e.nextSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.appendChild(r);b.remove(n)}if(n=e.previousSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.insertBefore(r,e.firstChild);b.remove(n)}}function u(e){tinymce.each(tinymce.grep(b.select("ol,ul",e)),function(e){var n,r=e.parentNode;"LI"==r.nodeName&&r.firstChild==e&&(n=r.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),b.isEmpty(r)&&b.remove(r))),t(r)&&(n=r.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function o(e){b.isEmpty(e)&&b.remove(e)}var i,a=e.parentNode,d=a.parentNode;return n(e)&&r(e)?("LI"==d.nodeName?(b.insertAfter(e,d),o(d),b.remove(a)):t(d)?b.remove(a,!0):(d.insertBefore(f(e),a),b.remove(a)),!0):n(e)?("LI"==d.nodeName?(b.insertAfter(e,d),e.appendChild(a),o(d)):t(d)?d.insertBefore(e,a):(d.insertBefore(f(e),a),b.remove(e)),!0):r(e)?("LI"==d.nodeName?b.insertAfter(e,d):t(d)?b.insertAfter(e,a):(b.insertAfter(f(e),a),b.remove(e)),!0):("LI"==d.nodeName?(a=d,i=f(e,"LI")):i=t(d)?f(e,"LI"):f(e),c(a,e,i),u(a.parentNode),!0)}function h(e){function n(n,r){var o;if(t(n)){for(;o=e.lastChild.firstChild;)r.appendChild(o);b.remove(n)}}var r,o;return r=e.previousSibling,r&&t(r)?(r.appendChild(e),!0):r&&"LI"==r.nodeName&&t(r.lastChild)?(r.lastChild.appendChild(e),n(e.lastChild,r.lastChild),!0):(r=e.nextSibling,r&&t(r)?(r.insertBefore(e,r.firstChild),!0):r&&"LI"==r.nodeName&&t(e.lastChild)?!1:(r=e.previousSibling,r&&"LI"==r.nodeName?(o=b.create(e.parentNode.nodeName),r.appendChild(o),o.appendChild(e),n(e.lastChild,o),!0):!1))}function v(){var t=l();if(t.length){for(var n=d(k.getRng(!0)),r=0;r0))return n;for(var o=new tinymce.dom.TreeWalker(e.startContainer);n=o[t?"next":"prev"]();)if(3==n.nodeType&&n.data.length>0)return n}function r(e,n){var r,o,i=e.parentNode;for(t(n.lastChild)&&(o=n.lastChild),r=n.lastChild,r&&"BR"==r.nodeName&&e.hasChildNodes()&&b.remove(r);r=e.firstChild;)n.appendChild(r);o&&n.appendChild(o),b.remove(e),b.isEmpty(i)&&b.remove(i)}if(k.isCollapsed()){var o=b.getParent(k.getStart(),"LI");if(o){var i=k.getRng(!0),a=b.getParent(n(i,e),"LI");if(a&&a!=o){var f=d(i);return e?r(a,o):r(o,a),s(f),!0}if(!a&&!e&&N(o.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return v()?void 0:!0}),e.addCommand("Outdent",function(){return C()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){y("UL")}),e.addCommand("InsertOrderedList",function(){y("OL")}),e.on("keydown",function(t){9==t.keyCode&&e.dom.getParent(e.selection.getStart(),"LI")&&(t.preventDefault(),t.shiftKey?C():v())})}),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var t=this;e.on("nodechange",function(){for(var r=e.selection.getSelectedBlocks(),o=!1,i=0,a=r.length;!o&&a>i;i++){var d=r[i].nodeName;o="LI"==d&&n(r[i])||"UL"==d||"OL"==d}t.disabled(o)})}}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?a.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&a.backspaceDelete(!0)&&e.preventDefault()})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(r){"use strict";function e(){}function l(e){return function(){return e}}function t(t){return function(){for(var e=[],n=0;ne.length?ne(t,e,n):ee(t,e,n)},[]);return S(n).map(function(e){return e.list})}(e.contentDocument,n).toArray()}function de(e){var n=g(Zn.getSelectedListItems(e),Ln.fromDom);return A(N(n,t(re)),N(function(e){var n=Xe.call(e,0);return n.reverse(),n}(n),t(re)),function(e,n){return{start:e,end:n}})}function le(t,e,r){var n=function(e,n){var t=Ge(!1);return g(e,function(e){return{sourceList:e,entries:ot(0,n,t,e)}})}(e,de(t));p(n,function(e){!function(e,n){p(v(e,ie),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(n,e)})}(e.entries,r);var n=function(n,e){return y(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i=e.childNodes.length?t.data.length:0}:t.previousSibling&&Un(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&Un(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}}function ve(e,n){var t=g(Zn.getSelectedListRoots(e),Ln.fromDom),r=g(Zn.getSelectedDlItems(e),Ln.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();le(e,t,n),ge(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(st(e.selection.getRng())),e.nodeChanged(),o=!0}return o}function he(e){return ve(e,"Indent")}function Ne(e){return ve(e,"Outdent")}function ye(e){return ve(e,"Flatten")}function Se(e){return/\btox\-/.test(e.className)}function Oe(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}}function Ce(t,e){Mn.each(e,function(e,n){t.setAttribute(n,e)})}function be(e,n,t){!function(e,n,t){var r=t["list-style-type"]?t["list-style-type"]:null;e.setStyle(n,"list-style-type",r)}(e,n,t),function(e,n,t){Ce(n,t["list-attributes"]),Mn.each(e.select("li",n),function(e){Ce(e,t["list-item-attributes"])})}(e,n,t)}function Le(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&Wn(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Kn(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function Te(r,o,i){void 0===i&&(i={});var e,n=r.selection.getRng(!0),u="LI",t=Zn.getClosestListRootElm(r,r.selection.getStart(!0)),a=r.dom;"false"!==a.getContentEditable(r.selection.getNode())&&("DL"===(o=o.toUpperCase())&&(u="DT"),e=dt(n),Mn.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Le(t,e,!0,r),a=Le(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return Mn.each(s,function(e){if(Kn(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||Wn(e))return Wn(e)&&u.remove(e),void(o=null);var n=e.nextSibling;ct.isBookmarkNode(e)&&(Kn(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(r,n,t),function(e){var n,t;(t=e.previousSibling)&&Fn(t)&&t.nodeName===o&&function(e,n,t){var r=e.getStyle(n,"list-style-type"),o=t?t["list-style-type"]:"";return r===(o=null===o?"":o)}(a,t,i)?(n=t,e=a.rename(e,u),t.appendChild(e)):(n=a.create(o),e.parentNode.insertBefore(n,e),n.appendChild(e),e=a.rename(e,u)),function(t,r,e){Mn.each(e,function(e){var n;return t.setStyle(r,((n={})[e]="",n))})}(a,e,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),be(a,n,i),mt(r.dom,n)}),r.selection.setRng(lt(e)))}function De(e,n,t){return function(e,n){return e&&n&&Fn(e)&&e.nodeName===n.nodeName}(n,t)&&function(e,n,t){return e.getStyle(n,"list-style-type",!0)===e.getStyle(t,"list-style-type",!0)}(e,n,t)&&function(e,n){return e.className===n.className}(n,t)}function Ee(n,e,t,r,o){if(e.nodeName!==r||gt(o)){var i=dt(n.selection.getRng(!0));Mn.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);be(e.dom,o,r),j(e,Oe(t),o)}else be(e.dom,n,r),j(e,Oe(t),n)}(n,e,r,o)}),n.selection.setRng(lt(i))}else ye(n)}function we(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),Qn(e,r)&&vt.remove(r)):vt.setStyle(r,"listStyleType","none")),Fn(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)}function ke(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(Un(o)&&(t?i'; - } else if (data.source1mime == "application/x-shockwave-flash") { - html += ''; - - if (data.poster) { - html += ''; - } - - html += ''; - } else if (data.source1mime.indexOf('audio') != -1) { - if (editor.settings.audio_template_callback) { - html = editor.settings.audio_template_callback(data); - } else { - html += ( - '' - ); - } - } else if (data.type == "script") { - html += ''; - } else { - if (editor.settings.video_template_callback) { - html = editor.settings.video_template_callback(data); - } else { - html = ( - '' - ); - } - } - } - - return html; - } - - function htmlToData(html) { - var data = {}; - - new tinymce.html.SaxParser({ - validate: false, - allow_conditional_comments: true, - special: 'script,noscript', - start: function(name, attrs) { - if (!data.source1 && name == "param") { - data.source1 = attrs.map.movie; - } - - if (name == "iframe" || name == "object" || name == "embed" || name == "video" || name == "audio") { - if (!data.type) { - data.type = name; - } - - data = tinymce.extend(attrs.map, data); - } - - if (name == "script") { - var videoScript = getVideoScriptMatch(attrs.map.src); - if (!videoScript) { - return; - } - - data = { - type: "script", - source1: attrs.map.src, - width: videoScript.width, - height: videoScript.height - }; - } - - if (name == "source") { - if (!data.source1) { - data.source1 = attrs.map.src; - } else if (!data.source2) { - data.source2 = attrs.map.src; - } - } - - if (name == "img" && !data.poster) { - data.poster = attrs.map.src; - } - } - }).parse(html); - - data.source1 = data.source1 || data.src || data.data; - data.source2 = data.source2 || ''; - data.poster = data.poster || ''; - - return data; - } - - function getData(element) { - if (element.getAttribute('data-mce-object')) { - return htmlToData(editor.serializer.serialize(element, {selection: true})); - } - - return {}; - } - - function updateHtml(html, data, updateAll) { - var writer = new tinymce.html.Writer(); - var sourceCount = 0, hasImage; - - function setAttributes(attrs, updatedAttrs) { - var name, i, value, attr; - - for (name in updatedAttrs) { - value = "" + updatedAttrs[name]; - - if (attrs.map[name]) { - i = attrs.length; - while (i--) { - attr = attrs[i]; - - if (attr.name == name) { - if (value) { - attrs.map[name] = value; - attr.value = value; - } else { - delete attrs.map[name]; - attrs.splice(i, 1); - } - } - } - } else if (value) { - attrs.push({ - name: name, - value: value - }); - - attrs.map[name] = value; - } - } - } - - new tinymce.html.SaxParser({ - validate: false, - allow_conditional_comments: true, - special: 'script,noscript', - - comment: function(text) { - writer.comment(text); - }, - - cdata: function(text) { - writer.cdata(text); - }, - - text: function(text, raw) { - writer.text(text, raw); - }, - - start: function(name, attrs, empty) { - switch (name) { - case "video": - case "object": - case "embed": - case "img": - case "iframe": - setAttributes(attrs, { - width: data.width, - height: data.height - }); - break; - } - - if (updateAll) { - switch (name) { - case "video": - setAttributes(attrs, { - poster: data.poster, - src: "" - }); - - if (data.source2) { - setAttributes(attrs, { - src: "" - }); - } - break; - - case "iframe": - setAttributes(attrs, { - src: data.source1 - }); - break; - - case "source": - sourceCount++; - - if (sourceCount <= 2) { - setAttributes(attrs, { - src: data["source" + sourceCount], - type: data["source" + sourceCount + "mime"] - }); - - if (!data["source" + sourceCount]) { - return; - } - } - break; - - case "img": - if (!data.poster) { - return; - } - - hasImage = true; - break; - } - } - - writer.start(name, attrs, empty); - }, - - end: function(name) { - if (name == "video" && updateAll) { - for (var index = 1; index <= 2; index++) { - if (data["source" + index]) { - var attrs = []; - attrs.map = {}; - - if (sourceCount < index) { - setAttributes(attrs, { - src: data["source" + index], - type: data["source" + index + "mime"] - }); - - writer.start("source", attrs, true); - } - } - } - } - - if (data.poster && name == "object" && updateAll && !hasImage) { - var imgAttrs = []; - imgAttrs.map = {}; - - setAttributes(imgAttrs, { - src: data.poster, - width: data.width, - height: data.height - }); - - writer.start("img", imgAttrs, true); - } - - writer.end(name); - } - }, new tinymce.html.Schema({})).parse(html); - - return writer.getContent(); - } - - editor.on('ResolveName', function(e) { - var name; - - if (e.target.nodeType == 1 && (name = e.target.getAttribute("data-mce-object"))) { - e.name = name; - } - }); - - editor.on('preInit', function() { - // Make sure that any messy HTML is retained inside these - var specialElements = editor.schema.getSpecialElements(); - tinymce.each('video audio iframe object'.split(' '), function(name) { - specialElements[name] = new RegExp('<\/' + name + '[^>]*>','gi'); - }); - - // Allow elements - //editor.schema.addValidElements('object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]'); - - // Set allowFullscreen attribs as boolean - var boolAttrs = editor.schema.getBoolAttrs(); - tinymce.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function(name) { - boolAttrs[name] = {}; - }); - - // Converts iframe, video etc into placeholder images - editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', function(nodes, name) { - var i = nodes.length, ai, node, placeHolder, attrName, attrValue, attribs, innerHtml; - var videoScript; - - while (i--) { - node = nodes[i]; - if (!node.parent) { - continue; - } - - if (node.name == 'script') { - videoScript = getVideoScriptMatch(node.attr('src')); - if (!videoScript) { - continue; - } - } - - placeHolder = new tinymce.html.Node('img', 1); - placeHolder.shortEnded = true; - - if (videoScript) { - if (videoScript.width) { - node.attr('width', videoScript.width.toString()); - } - - if (videoScript.height) { - node.attr('height', videoScript.height.toString()); - } - } - - // Prefix all attributes except width, height and style since we - // will add these to the placeholder - attribs = node.attributes; - ai = attribs.length; - while (ai--) { - attrName = attribs[ai].name; - attrValue = attribs[ai].value; - - if (attrName !== "width" && attrName !== "height" && attrName !== "style") { - if (attrName == "data" || attrName == "src") { - attrValue = editor.convertURL(attrValue, attrName); - } - - placeHolder.attr('data-mce-p-' + attrName, attrValue); - } - } - - // Place the inner HTML contents inside an escaped attribute - // This enables us to copy/paste the fake object - innerHtml = node.firstChild && node.firstChild.value; - if (innerHtml) { - placeHolder.attr("data-mce-html", escape(innerHtml)); - placeHolder.firstChild = null; - } - - placeHolder.attr({ - width: node.attr('width') || "300", - height: node.attr('height') || (name == "audio" ? "30" : "150"), - style: node.attr('style'), - src: tinymce.Env.transparentSrc, - "data-mce-object": name, - "class": "mce-object mce-object-" + name - }); - - node.replace(placeHolder); - } - }); - - // Replaces placeholder images with real elements for video, object, iframe etc - editor.serializer.addAttributeFilter('data-mce-object', function(nodes, name) { - var i = nodes.length, node, realElm, ai, attribs, innerHtml, innerNode, realElmName; - - while (i--) { - node = nodes[i]; - if (!node.parent) { - continue; - } - - realElmName = node.attr(name); - realElm = new tinymce.html.Node(realElmName, 1); - - // Add width/height to everything but audio - if (realElmName != "audio" && realElmName != "script") { - realElm.attr({ - width: node.attr('width'), - height: node.attr('height') - }); - } - - realElm.attr({ - style: node.attr('style') - }); - - // Unprefix all placeholder attributes - attribs = node.attributes; - ai = attribs.length; - while (ai--) { - var attrName = attribs[ai].name; - - if (attrName.indexOf('data-mce-p-') === 0) { - realElm.attr(attrName.substr(11), attribs[ai].value); - } - } - - if (realElmName == "script") { - realElm.attr('type', 'text/javascript'); - } - - // Inject innerhtml - innerHtml = node.attr('data-mce-html'); - if (innerHtml) { - innerNode = new tinymce.html.Node('#text', 3); - innerNode.raw = true; - innerNode.value = unescape(innerHtml); - realElm.append(innerNode); - } - - node.replace(realElm); - } - }); - }); - - editor.on('ObjectSelected', function(e) { - var objectType = e.target.getAttribute('data-mce-object'); - - if (objectType == "audio" || objectType == "script") { - e.preventDefault(); - } - }); - - editor.on('objectResized', function(e) { - var target = e.target, html; - - if (target.getAttribute('data-mce-object')) { - html = target.getAttribute('data-mce-html'); - if (html) { - html = unescape(html); - target.setAttribute('data-mce-html', escape( - updateHtml(html, { - width: e.width, - height: e.height - }) - )); - } - } - }); - - editor.addButton('media', { - tooltip: 'Insert/edit video', - onclick: showDialog, - stateSelector: ['img[data-mce-object=video]', 'img[data-mce-object=iframe]'] - }); - - editor.addMenuItem('media', { - icon: 'media', - text: 'Insert video', - onclick: showDialog, - context: 'insert', - prependToContext: true - }); -}); +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var hasOwnProperty = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var getScripts = function (editor) { + return editor.getParam('media_scripts'); + }; + var getAudioTemplateCallback = function (editor) { + return editor.getParam('audio_template_callback'); + }; + var getVideoTemplateCallback = function (editor) { + return editor.getParam('video_template_callback'); + }; + var hasLiveEmbeds = function (editor) { + return editor.getParam('media_live_embeds', true); + }; + var shouldFilterHtml = function (editor) { + return editor.getParam('media_filter_html', true); + }; + var getUrlResolver = function (editor) { + return editor.getParam('media_url_resolver'); + }; + var hasAltSource = function (editor) { + return editor.getParam('media_alt_source', true); + }; + var hasPoster = function (editor) { + return editor.getParam('media_poster', true); + }; + var hasDimensions = function (editor) { + return editor.getParam('media_dimensions', true); + }; + var Settings = { + getScripts: getScripts, + getAudioTemplateCallback: getAudioTemplateCallback, + getVideoTemplateCallback: getVideoTemplateCallback, + hasLiveEmbeds: hasLiveEmbeds, + shouldFilterHtml: shouldFilterHtml, + getUrlResolver: getUrlResolver, + hasAltSource: hasAltSource, + hasPoster: hasPoster, + hasDimensions: hasDimensions + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.html.SaxParser'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var trimPx = function (value) { + return value.replace(/px$/, ''); + }; + var addPx = function (value) { + return /^[0-9.]+$/.test(value) ? value + 'px' : value; + }; + var getSize = function (name) { + return function (elm) { + return elm ? trimPx(elm.style[name]) : ''; + }; + }; + var setSize = function (name) { + return function (elm, value) { + if (elm) { + elm.style[name] = addPx(value); + } + }; + }; + var Size = { + getMaxWidth: getSize('maxWidth'), + getMaxHeight: getSize('maxHeight'), + setMaxWidth: setSize('maxWidth'), + setMaxHeight: setSize('maxHeight') + }; + + var getVideoScriptMatch = function (prefixes, src) { + if (prefixes) { + for (var i = 0; i < prefixes.length; i++) { + if (src.indexOf(prefixes[i].filter) !== -1) { + return prefixes[i]; + } + } + } + }; + + var DOM = global$3.DOM; + var getEphoxEmbedIri = function (elm) { + return DOM.getAttrib(elm, 'data-ephox-embed-iri'); + }; + var isEphoxEmbed = function (html) { + var fragment = DOM.createFragment(html); + return getEphoxEmbedIri(fragment.firstChild) !== ''; + }; + var htmlToDataSax = function (prefixes, html) { + var data = {}; + global$2({ + validate: false, + allow_conditional_comments: true, + start: function (name, attrs) { + if (!data.source && name === 'param') { + data.source = attrs.map.movie; + } + if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') { + if (!data.type) { + data.type = name; + } + data = global$1.extend(attrs.map, data); + } + if (name === 'script') { + var videoScript = getVideoScriptMatch(prefixes, attrs.map.src); + if (!videoScript) { + return; + } + data = { + type: 'script', + source: attrs.map.src, + width: String(videoScript.width), + height: String(videoScript.height) + }; + } + if (name === 'source') { + if (!data.source) { + data.source = attrs.map.src; + } else if (!data.altsource) { + data.altsource = attrs.map.src; + } + } + if (name === 'img' && !data.poster) { + data.poster = attrs.map.src; + } + } + }).parse(html); + data.source = data.source || data.src || data.data; + data.altsource = data.altsource || ''; + data.poster = data.poster || ''; + return data; + }; + var ephoxEmbedHtmlToData = function (html) { + var fragment = DOM.createFragment(html); + var div = fragment.firstChild; + return { + type: 'ephox-embed-iri', + source: getEphoxEmbedIri(div), + altsource: '', + poster: '', + width: Size.getMaxWidth(div), + height: Size.getMaxHeight(div) + }; + }; + var htmlToData = function (prefixes, html) { + return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html); + }; + + var guess = function (url) { + var mimes = { + mp3: 'audio/mpeg', + m4a: 'audio/x-m4a', + wav: 'audio/wav', + mp4: 'video/mp4', + webm: 'video/webm', + ogg: 'video/ogg', + swf: 'application/x-shockwave-flash' + }; + var fileEnd = url.toLowerCase().split('.').pop(); + var mime = mimes[fileEnd]; + return mime ? mime : ''; + }; + var Mime = { guess: guess }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.html.Writer'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.html.Schema'); + + var DOM$1 = global$3.DOM; + var setAttributes = function (attrs, updatedAttrs) { + var name; + var i; + var value; + var attr; + for (name in updatedAttrs) { + value = '' + updatedAttrs[name]; + if (attrs.map[name]) { + i = attrs.length; + while (i--) { + attr = attrs[i]; + if (attr.name === name) { + if (value) { + attrs.map[name] = value; + attr.value = value; + } else { + delete attrs.map[name]; + attrs.splice(i, 1); + } + } + } + } else if (value) { + attrs.push({ + name: name, + value: value + }); + attrs.map[name] = value; + } + } + }; + var normalizeHtml = function (html) { + var writer = global$4(); + var parser = global$2(writer); + parser.parse(html); + return writer.getContent(); + }; + var sources = [ + 'source', + 'altsource' + ]; + var updateHtmlSax = function (html, data, updateAll) { + var writer = global$4(); + var sourceCount = 0; + var hasImage; + global$2({ + validate: false, + allow_conditional_comments: true, + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + switch (name) { + case 'video': + case 'object': + case 'embed': + case 'img': + case 'iframe': + if (data.height !== undefined && data.width !== undefined) { + setAttributes(attrs, { + width: data.width, + height: data.height + }); + } + break; + } + if (updateAll) { + switch (name) { + case 'video': + setAttributes(attrs, { + poster: data.poster, + src: '' + }); + if (data.altsource) { + setAttributes(attrs, { src: '' }); + } + break; + case 'iframe': + setAttributes(attrs, { src: data.source }); + break; + case 'source': + if (sourceCount < 2) { + setAttributes(attrs, { + src: data[sources[sourceCount]], + type: data[sources[sourceCount] + 'mime'] + }); + if (!data[sources[sourceCount]]) { + return; + } + } + sourceCount++; + break; + case 'img': + if (!data.poster) { + return; + } + hasImage = true; + break; + } + } + writer.start(name, attrs, empty); + }, + end: function (name) { + if (name === 'video' && updateAll) { + for (var index = 0; index < 2; index++) { + if (data[sources[index]]) { + var attrs = []; + attrs.map = {}; + if (sourceCount < index) { + setAttributes(attrs, { + src: data[sources[index]], + type: data[sources[index] + 'mime'] + }); + writer.start('source', attrs, true); + } + } + } + } + if (data.poster && name === 'object' && updateAll && !hasImage) { + var imgAttrs = []; + imgAttrs.map = {}; + setAttributes(imgAttrs, { + src: data.poster, + width: data.width, + height: data.height + }); + writer.start('img', imgAttrs, true); + } + writer.end(name); + } + }, global$5({})).parse(html); + return writer.getContent(); + }; + var isEphoxEmbed$1 = function (html) { + var fragment = DOM$1.createFragment(html); + return DOM$1.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== ''; + }; + var updateEphoxEmbed = function (html, data) { + var fragment = DOM$1.createFragment(html); + var div = fragment.firstChild; + Size.setMaxWidth(div, data.width); + Size.setMaxHeight(div, data.height); + return normalizeHtml(div.outerHTML); + }; + var updateHtml = function (html, data, updateAll) { + return isEphoxEmbed$1(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll); + }; + var UpdateHtml = { updateHtml: updateHtml }; + + var urlPatterns = [ + { + regex: /youtu\.be\/([\w\-_\?&=.]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: 'www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i, + type: 'iframe', + w: 560, + h: 314, + url: 'www.youtube.com/embed/$2?$4', + allowFullscreen: true + }, + { + regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: 'www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/(.*)\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: 'player.vimeo.com/video/$2?title=0&byline=0', + allowFullscreen: true + }, + { + regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, + type: 'iframe', + w: 425, + h: 350, + url: 'maps.google.com/maps/ms?msid=$2&output=embed"', + allowFullscreen: false + }, + { + regex: /dailymotion\.com\/video\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: 'www.dailymotion.com/embed/video/$1', + allowFullscreen: true + }, + { + regex: /dai\.ly\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: 'www.dailymotion.com/embed/video/$1', + allowFullscreen: true + } + ]; + var getProtocol = function (url) { + var protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i); + if (protocolMatches && protocolMatches.length > 1) { + return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1]; + } else { + return 'https://'; + } + }; + var getUrl = function (pattern, url) { + var protocol = getProtocol(url); + var match = pattern.regex.exec(url); + var newUrl = protocol + pattern.url; + var _loop_1 = function (i) { + newUrl = newUrl.replace('$' + i, function () { + return match[i] ? match[i] : ''; + }); + }; + for (var i = 0; i < match.length; i++) { + _loop_1(i); + } + return newUrl.replace(/\?$/, ''); + }; + var matchPattern = function (url) { + var patterns = urlPatterns.filter(function (pattern) { + return pattern.regex.test(url); + }); + if (patterns.length > 0) { + return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) }); + } else { + return null; + } + }; + + var getIframeHtml = function (data) { + var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : ''; + return ''; + }; + var getFlashHtml = function (data) { + var html = ''; + if (data.poster) { + html += ''; + } + html += ''; + return html; + }; + var getAudioHtml = function (data, audioTemplateCallback) { + if (audioTemplateCallback) { + return audioTemplateCallback(data); + } else { + return ''; + } + }; + var getVideoHtml = function (data, videoTemplateCallback) { + if (videoTemplateCallback) { + return videoTemplateCallback(data); + } else { + return ''; + } + }; + var getScriptHtml = function (data) { + return ''; + }; + var dataToHtml = function (editor, dataIn) { + var data = global$1.extend({}, dataIn); + if (!data.source) { + global$1.extend(data, htmlToData(Settings.getScripts(editor), data.embed)); + if (!data.source) { + return ''; + } + } + if (!data.altsource) { + data.altsource = ''; + } + if (!data.poster) { + data.poster = ''; + } + data.source = editor.convertURL(data.source, 'source'); + data.altsource = editor.convertURL(data.altsource, 'source'); + data.sourcemime = Mime.guess(data.source); + data.altsourcemime = Mime.guess(data.altsource); + data.poster = editor.convertURL(data.poster, 'poster'); + var pattern = matchPattern(data.source); + if (pattern) { + data.source = pattern.url; + data.type = pattern.type; + data.allowFullscreen = pattern.allowFullscreen; + data.width = data.width || String(pattern.w); + data.height = data.height || String(pattern.h); + } + if (data.embed) { + return UpdateHtml.updateHtml(data.embed, data, true); + } else { + var videoScript = getVideoScriptMatch(Settings.getScripts(editor), data.source); + if (videoScript) { + data.type = 'script'; + data.width = String(videoScript.width); + data.height = String(videoScript.height); + } + var audioTemplateCallback = Settings.getAudioTemplateCallback(editor); + var videoTemplateCallback = Settings.getVideoTemplateCallback(editor); + data.width = data.width || '300'; + data.height = data.height || '150'; + global$1.each(data, function (value, key) { + data[key] = editor.dom.encode('' + value); + }); + if (data.type === 'iframe') { + return getIframeHtml(data); + } else if (data.sourcemime === 'application/x-shockwave-flash') { + return getFlashHtml(data); + } else if (data.sourcemime.indexOf('audio') !== -1) { + return getAudioHtml(data, audioTemplateCallback); + } else if (data.type === 'script') { + return getScriptHtml(data); + } else { + return getVideoHtml(data, videoTemplateCallback); + } + } + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var cache = {}; + var embedPromise = function (data, dataToHtml, handler) { + return new global$6(function (res, rej) { + var wrappedResolve = function (response) { + if (response.html) { + cache[data.source] = response; + } + return res({ + url: data.source, + html: response.html ? response.html : dataToHtml(data) + }); + }; + if (cache[data.source]) { + wrappedResolve(cache[data.source]); + } else { + handler({ url: data.source }, wrappedResolve, rej); + } + }); + }; + var defaultPromise = function (data, dataToHtml) { + return new global$6(function (res) { + res({ + html: dataToHtml(data), + url: data.source + }); + }); + }; + var loadedData = function (editor) { + return function (data) { + return dataToHtml(editor, data); + }; + }; + var getEmbedHtml = function (editor, data) { + var embedHandler = Settings.getUrlResolver(editor); + return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); + }; + var isCached = function (url) { + return cache.hasOwnProperty(url); + }; + var Service = { + getEmbedHtml: getEmbedHtml, + isCached: isCached + }; + + var extractMeta = function (sourceInput, data) { + return get(data, sourceInput).bind(function (mainData) { + return get(mainData, 'meta'); + }); + }; + var getValue = function (data, metaData, sourceInput) { + return function (prop) { + var _a; + var getFromData = function () { + return get(data, prop); + }; + var getFromMetaData = function () { + return get(metaData, prop); + }; + var getNonEmptyValue = function (c) { + return get(c, 'value').bind(function (v) { + return v.length > 0 ? Option.some(v) : Option.none(); + }); + }; + var getFromValueFirst = function () { + return getFromData().bind(function (child) { + return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () { + return Option.from(child); + }); + }); + }; + var getFromMetaFirst = function () { + return getFromMetaData().orThunk(function () { + return getFromData().bind(function (child) { + return isObject(child) ? getNonEmptyValue(child) : Option.from(child); + }); + }); + }; + return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a; + }; + }; + var getDimensions = function (data, metaData) { + var dimensions = {}; + get(data, 'dimensions').each(function (dims) { + each([ + 'width', + 'height' + ], function (prop) { + get(metaData, prop).orThunk(function () { + return get(dims, prop); + }).each(function (value) { + return dimensions[prop] = value; + }); + }); + }); + return dimensions; + }; + var unwrap = function (data, sourceInput) { + var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {}; + var get = getValue(data, metaData, sourceInput); + return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData)); + }; + var wrap = function (data) { + var wrapped = __assign(__assign({}, data), { + source: { value: get(data, 'source').getOr('') }, + altsource: { value: get(data, 'altsource').getOr('') }, + poster: { value: get(data, 'poster').getOr('') } + }); + each([ + 'width', + 'height' + ], function (prop) { + get(data, prop).each(function (value) { + var dimensions = wrapped.dimensions || {}; + dimensions[prop] = value; + wrapped.dimensions = dimensions; + }); + }); + return wrapped; + }; + var handleError = function (editor) { + return function (error) { + var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.'; + editor.notificationManager.open({ + type: 'error', + text: errorMessage + }); + }; + }; + var snippetToData = function (editor, embedSnippet) { + return htmlToData(Settings.getScripts(editor), embedSnippet); + }; + var isMediaElement = function (element) { + return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri'); + }; + var getEditorData = function (editor) { + var element = editor.selection.getNode(); + var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : ''; + return __assign({ embed: snippet }, htmlToData(Settings.getScripts(editor), snippet)); + }; + var addEmbedHtml = function (api, editor) { + return function (response) { + if (isString(response.url) && response.url.trim().length > 0) { + var html = response.html; + var snippetData = snippetToData(editor, html); + var nuData = __assign(__assign({}, snippetData), { + source: response.url, + embed: html + }); + api.setData(wrap(nuData)); + } + }; + }; + var selectPlaceholder = function (editor, beforeObjects) { + var afterObjects = editor.dom.select('img[data-mce-object]'); + for (var i = 0; i < beforeObjects.length; i++) { + for (var y = afterObjects.length - 1; y >= 0; y--) { + if (beforeObjects[i] === afterObjects[y]) { + afterObjects.splice(y, 1); + } + } + } + editor.selection.select(afterObjects[0]); + }; + var handleInsert = function (editor, html) { + var beforeObjects = editor.dom.select('img[data-mce-object]'); + editor.insertContent(html); + selectPlaceholder(editor, beforeObjects); + editor.nodeChanged(); + }; + var submitForm = function (prevData, newData, editor) { + newData.embed = UpdateHtml.updateHtml(newData.embed, newData); + if (newData.embed && (prevData.source === newData.source || Service.isCached(newData.source))) { + handleInsert(editor, newData.embed); + } else { + Service.getEmbedHtml(editor, newData).then(function (response) { + handleInsert(editor, response.html); + }).catch(handleError(editor)); + } + }; + var showDialog = function (editor) { + var editorData = getEditorData(editor); + var currentData = Cell(editorData); + var initialData = wrap(editorData); + var handleSource = function (prevData, api) { + var serviceData = unwrap(api.getData(), 'source'); + if (prevData.source !== serviceData.source) { + addEmbedHtml(win, editor)({ + url: serviceData.source, + html: '' + }); + Service.getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor)); + } + }; + var handleEmbed = function (api) { + var data = unwrap(api.getData()); + var dataFromEmbed = snippetToData(editor, data.embed); + api.setData(wrap(dataFromEmbed)); + }; + var handleUpdate = function (api, sourceInput) { + var data = unwrap(api.getData(), sourceInput); + var embed = dataToHtml(editor, data); + api.setData(wrap(__assign(__assign({}, data), { embed: embed }))); + }; + var mediaInput = [{ + name: 'source', + type: 'urlinput', + filetype: 'media', + label: 'Source' + }]; + var sizeInput = !Settings.hasDimensions(editor) ? [] : [{ + type: 'sizeinput', + name: 'dimensions', + label: 'Constrain proportions', + constrain: true + }]; + var generalTab = { + title: 'General', + name: 'general', + items: flatten([ + mediaInput, + sizeInput + ]) + }; + var embedTextarea = { + type: 'textarea', + name: 'embed', + label: 'Paste your embed code below:' + }; + var embedTab = { + title: 'Embed', + items: [embedTextarea] + }; + var advancedFormItems = []; + if (Settings.hasAltSource(editor)) { + advancedFormItems.push({ + name: 'altsource', + type: 'urlinput', + filetype: 'media', + label: 'Alternative source URL' + }); + } + if (Settings.hasPoster(editor)) { + advancedFormItems.push({ + name: 'poster', + type: 'urlinput', + filetype: 'image', + label: 'Media poster (Image URL)' + }); + } + var advancedTab = { + title: 'Advanced', + name: 'advanced', + items: advancedFormItems + }; + var tabs = [ + generalTab, + embedTab + ]; + if (advancedFormItems.length > 0) { + tabs.push(advancedTab); + } + var body = { + type: 'tabpanel', + tabs: tabs + }; + var win = editor.windowManager.open({ + title: 'Insert/Edit Media', + size: 'normal', + body: body, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: function (api) { + var serviceData = unwrap(api.getData()); + submitForm(currentData.get(), serviceData, editor); + api.close(); + }, + onChange: function (api, detail) { + switch (detail.name) { + case 'source': + handleSource(currentData.get(), api); + break; + case 'embed': + handleEmbed(api); + break; + case 'dimensions': + case 'altsource': + case 'poster': + handleUpdate(api, detail.name); + break; + } + currentData.set(unwrap(api.getData())); + }, + initialData: initialData + }); + }; + var Dialog = { + showDialog: showDialog, + unwrap: unwrap + }; + + var get$1 = function (editor) { + var showDialog = function () { + Dialog.showDialog(editor); + }; + return { showDialog: showDialog }; + }; + var Api = { get: get$1 }; + + var register = function (editor) { + var showDialog = function () { + Dialog.showDialog(editor); + }; + editor.addCommand('mceMedia', showDialog); + }; + var Commands = { register: register }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$8 = tinymce.util.Tools.resolve('tinymce.Env'); + + var sanitize = function (editor, html) { + if (Settings.shouldFilterHtml(editor) === false) { + return html; + } + var writer = global$4(); + var blocked; + global$2({ + validate: false, + allow_conditional_comments: false, + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + blocked = true; + if (name === 'script' || name === 'noscript') { + return; + } + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].name.indexOf('on') === 0) { + return; + } + if (attrs[i].name === 'style') { + attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); + } + } + writer.start(name, attrs, empty); + blocked = false; + }, + end: function (name) { + if (blocked) { + return; + } + writer.end(name); + } + }, global$5({})).parse(html); + return writer.getContent(); + }; + var Sanitize = { sanitize: sanitize }; + + var createPlaceholderNode = function (editor, node) { + var placeHolder; + var name = node.name; + placeHolder = new global$7('img', 1); + placeHolder.shortEnded = true; + retainAttributesAndInnerHtml(editor, node, placeHolder); + placeHolder.attr({ + 'width': node.attr('width') || '300', + 'height': node.attr('height') || (name === 'audio' ? '30' : '150'), + 'style': node.attr('style'), + 'src': global$8.transparentSrc, + 'data-mce-object': name, + 'class': 'mce-object mce-object-' + name + }); + return placeHolder; + }; + var createPreviewIframeNode = function (editor, node) { + var previewWrapper; + var previewNode; + var shimNode; + var name = node.name; + previewWrapper = new global$7('span', 1); + previewWrapper.attr({ + 'contentEditable': 'false', + 'style': node.attr('style'), + 'data-mce-object': name, + 'class': 'mce-preview-object mce-object-' + name + }); + retainAttributesAndInnerHtml(editor, node, previewWrapper); + previewNode = new global$7(name, 1); + previewNode.attr({ + src: node.attr('src'), + allowfullscreen: node.attr('allowfullscreen'), + style: node.attr('style'), + class: node.attr('class'), + width: node.attr('width'), + height: node.attr('height'), + frameborder: '0' + }); + shimNode = new global$7('span', 1); + shimNode.attr('class', 'mce-shim'); + previewWrapper.append(previewNode); + previewWrapper.append(shimNode); + return previewWrapper; + }; + var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) { + var attrName; + var attrValue; + var attribs; + var ai; + var innerHtml; + attribs = sourceNode.attributes; + ai = attribs.length; + while (ai--) { + attrName = attribs[ai].name; + attrValue = attribs[ai].value; + if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') { + if (attrName === 'data' || attrName === 'src') { + attrValue = editor.convertURL(attrValue, attrName); + } + targetNode.attr('data-mce-p-' + attrName, attrValue); + } + } + innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; + if (innerHtml) { + targetNode.attr('data-mce-html', escape(Sanitize.sanitize(editor, innerHtml))); + targetNode.firstChild = null; + } + }; + var isPageEmbedWrapper = function (node) { + var nodeClass = node.attr('class'); + return nodeClass && /\btiny-pageembed\b/.test(nodeClass); + }; + var isWithinEmbedWrapper = function (node) { + while (node = node.parent) { + if (node.attr('data-ephox-embed-iri') || isPageEmbedWrapper(node)) { + return true; + } + } + return false; + }; + var placeHolderConverter = function (editor) { + return function (nodes) { + var i = nodes.length; + var node; + var videoScript; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + if (node.parent.attr('data-mce-object')) { + continue; + } + if (node.name === 'script') { + videoScript = getVideoScriptMatch(Settings.getScripts(editor), node.attr('src')); + if (!videoScript) { + continue; + } + } + if (videoScript) { + if (videoScript.width) { + node.attr('width', videoScript.width.toString()); + } + if (videoScript.height) { + node.attr('height', videoScript.height.toString()); + } + } + if (node.name === 'iframe' && Settings.hasLiveEmbeds(editor) && global$8.ceFalse) { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPreviewIframeNode(editor, node)); + } + } else { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPlaceholderNode(editor, node)); + } + } + } + }; + }; + var Nodes = { + createPreviewIframeNode: createPreviewIframeNode, + createPlaceholderNode: createPlaceholderNode, + placeHolderConverter: placeHolderConverter + }; + + var setup = function (editor) { + editor.on('preInit', function () { + var specialElements = editor.schema.getSpecialElements(); + global$1.each('video audio iframe object'.split(' '), function (name) { + specialElements[name] = new RegExp(']*>', 'gi'); + }); + var boolAttrs = editor.schema.getBoolAttrs(); + global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { + boolAttrs[name] = {}; + }); + editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', Nodes.placeHolderConverter(editor)); + editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { + var i = nodes.length; + var node; + var realElm; + var ai; + var attribs; + var innerHtml; + var innerNode; + var realElmName; + var className; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + realElmName = node.attr(name); + realElm = new global$7(realElmName, 1); + if (realElmName !== 'audio' && realElmName !== 'script') { + className = node.attr('class'); + if (className && className.indexOf('mce-preview-object') !== -1) { + realElm.attr({ + width: node.firstChild.attr('width'), + height: node.firstChild.attr('height') + }); + } else { + realElm.attr({ + width: node.attr('width'), + height: node.attr('height') + }); + } + } + realElm.attr({ style: node.attr('style') }); + attribs = node.attributes; + ai = attribs.length; + while (ai--) { + var attrName = attribs[ai].name; + if (attrName.indexOf('data-mce-p-') === 0) { + realElm.attr(attrName.substr(11), attribs[ai].value); + } + } + if (realElmName === 'script') { + realElm.attr('type', 'text/javascript'); + } + innerHtml = node.attr('data-mce-html'); + if (innerHtml) { + innerNode = new global$7('#text', 3); + innerNode.raw = true; + innerNode.value = Sanitize.sanitize(editor, unescape(innerHtml)); + realElm.append(innerNode); + } + node.replace(realElm); + } + }); + }); + editor.on('SetContent', function () { + editor.$('span.mce-preview-object').each(function (index, elm) { + var $elm = editor.$(elm); + if ($elm.find('span.mce-shim').length === 0) { + $elm.append(''); + } + }); + }); + }; + var FilterContent = { setup: setup }; + + var setup$1 = function (editor) { + editor.on('ResolveName', function (e) { + var name; + if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) { + e.name = name; + } + }); + }; + var ResolveName = { setup: setup$1 }; + + var setup$2 = function (editor) { + editor.on('click keyup touchend', function () { + var selectedNode = editor.selection.getNode(); + if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { + if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { + selectedNode.setAttribute('data-mce-selected', '2'); + } + } + }); + editor.on('ObjectSelected', function (e) { + var objectType = e.target.getAttribute('data-mce-object'); + if (objectType === 'audio' || objectType === 'script') { + e.preventDefault(); + } + }); + editor.on('ObjectResized', function (e) { + var target = e.target; + var html; + if (target.getAttribute('data-mce-object')) { + html = target.getAttribute('data-mce-html'); + if (html) { + html = unescape(html); + target.setAttribute('data-mce-html', escape(UpdateHtml.updateHtml(html, { + width: String(e.width), + height: String(e.height) + }))); + } + } + }); + }; + var Selection = { setup: setup$2 }; + + var stateSelectorAdapter = function (editor, selector) { + return function (buttonApi) { + return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('media', { + tooltip: 'Insert/edit media', + icon: 'embed', + onAction: function () { + editor.execCommand('mceMedia'); + }, + onSetup: stateSelectorAdapter(editor, [ + 'img[data-mce-object]', + 'span[data-mce-object]', + 'div[data-ephox-embed-iri]' + ]) + }); + editor.ui.registry.addMenuItem('media', { + icon: 'embed', + text: 'Media...', + onAction: function () { + editor.execCommand('mceMedia'); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('media', function (editor) { + Commands.register(editor); + Buttons.register(editor); + ResolveName.setup(editor); + FilterContent.setup(editor); + Selection.setup(editor); + return Api.get(editor); + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/media/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/media/plugin.min.js index 7c71528..948203b 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/media/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/media/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r':"application/x-shockwave-flash"==o.source1mime?(a+='',o.poster&&(a+=''),a+=""):-1!=o.source1mime.indexOf("audio")?e.settings.audio_template_callback?a=e.settings.audio_template_callback(o):a+='":"script"==o.type?a+='':a=e.settings.video_template_callback?e.settings.video_template_callback(o):'"}return a}function s(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var o=r(i.map.src);if(!o)return;t={type:"script",source1:i.map.src,width:o.width,height:o.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function n(t){return t.getAttribute("data-mce-object")?s(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,o,a;for(i in t)if(o=""+t[i],e.map[i])for(r=e.length;r--;)a=e[r],a.name==i&&(o?(e.map[i]=o,a.value=o):(delete e.map[i],e.splice(r,1)));else o&&(e.push({name:i,value:o}),e.map[i]=o)}var o,a=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,s,n){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(s,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(s,{poster:t.poster,src:""}),t.source2&&r(s,{src:""});break;case"iframe":r(s,{src:t.source1});break;case"source":if(c++,2>=c&&(r(s,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;o=!0}a.start(e,s,n)},end:function(e){if("video"==e&&i)for(var s=1;2>=s;s++)if(t["source"+s]){var n=[];n.map={},s>c&&(r(n,{src:t["source"+s],type:t["source"+s+"mime"]}),a.start("source",n,!0))}if(t.poster&&"object"==e&&i&&!o){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),a.start("img",m,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var u=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("]*>","gi")});var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var o,a,c,s,n,m,u,d,l=t.length;l--;)if(a=t[l],a.parent&&("script"!=a.name||(d=r(a.attr("src"))))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,d&&(d.width&&a.attr("width",d.width.toString()),d.height&&a.attr("height",d.height.toString())),m=a.attributes,o=m.length;o--;)s=m[o].name,n=m[o].value,"width"!==s&&"height"!==s&&"style"!==s&&(("data"==s||"src"==s)&&(n=e.convertURL(n,s)),c.attr("data-mce-p-"+s,n));u=a.firstChild&&a.firstChild.value,u&&(c.attr("data-mce-html",escape(u)),c.firstChild=null),c.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==i?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),a.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,o,a,c,s,n,m=e.length;m--;)if(i=e[m],i.parent){for(n=i.attr(t),r=new tinymce.html.Node(n,1),"audio"!=n&&"script"!=n&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),a=i.attributes,o=a.length;o--;){var u=a[o].name;0===u.indexOf("data-mce-p-")&&r.attr(u.substr(11),a[o].value)}"script"==n&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(s=new tinymce.html.Node("#text",3),s.raw=!0,s.value=unescape(c),r.append(s)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:o,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:o,context:"insert",prependToContext:!0})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function e(){}function o(e){return function(){return e}}function t(){return u}var r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=function(){return(m=Object.assign||function(e){for(var t,r=1,n=arguments.length;r"}(n):"application/x-shockwave-flash"===n.sourcemime?function(e){var t='';return e.poster&&(t+=''),t+=""}(n):-1!==n.sourcemime.indexOf("audio")?function(e,t){return t?t(e):'"}(n,o):"script"===n.type?function(e){return'\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); - - load('classes/Utils.js'); - load('classes/Clipboard.js'); - load('classes/WordFilter.js'); - load('classes/Quirks.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: 849939b9c33a2f4c24d662ba44412575 \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.js index c55c758..fc07198 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.js @@ -1,1369 +1,2400 @@ /** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/plugins/paste/classes/Utils.js - -/** - * Utils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contails various utility functions for the paste plugin. - * - * @class tinymce.pasteplugin.Clipboard - * @private - */ -define("tinymce/pasteplugin/Utils", [ - "tinymce/util/Tools", - "tinymce/html/DomParser", - "tinymce/html/Schema" -], function(Tools, DomParser, Schema) { - function filter(content, items) { - Tools.each(items, function(v) { - if (v.constructor == RegExp) { - content = content.replace(v, ''); - } else { - content = content.replace(v[0], v[1]); - } - }); - - return content; - } - - /** - * Gets the innerText of the specified element. It will handle edge cases - * and works better than textContent on Gecko. - * - * @param {String} html HTML string to get text from. - * @return {String} String of text with line feeds. - */ - function innerText(html) { - var schema = new Schema(), domParser = new DomParser({}, schema), text = ''; - var shortEndedElements = schema.getShortEndedElements(); - var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' '); - var blockElements = schema.getBlockElements(); - - function walk(node) { - var name = node.name, currentNode = node; - - if (name === 'br') { - text += '\n'; - return; - } - - // img/input/hr - if (shortEndedElements[name]) { - text += ' '; - } - - // Ingore script, video contents - if (ignoreElements[name]) { - text += ' '; - return; - } - - if (node.type == 3) { - text += node.value; - } - - // Walk all children - if (!node.shortEnded) { - if ((node = node.firstChild)) { - do { - walk(node); - } while ((node = node.next)); - } - } - - // Add \n or \n\n for blocks or P - if (blockElements[name] && currentNode.next) { - text += '\n'; - - if (name == 'p') { - text += '\n'; - } - } - } - - walk(domParser.parse(html)); - - return text; - } - - return { - filter: filter, - innerText: innerText - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/Clipboard.js - -/** - * Clipboard.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains logic for getting HTML contents out of the clipboard. - * - * We need to make a lot of ugly hacks to get the contents out of the clipboard since - * the W3C Clipboard API is broken in all browsers that have it: Gecko/WebKit/Blink. - * We might rewrite this the way those API:s stabilize. Browsers doesn't handle pasting - * from applications like Word the same way as it does when pasting into a contentEditable area - * so we need to do lots of extra work to try to get to this clipboard data. + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Current implementation steps: - * 1. On keydown with paste keys Ctrl+V or Shift+Insert create - * a paste bin element and move focus to that element. - * 2. Wait for the browser to fire a "paste" event and get the contents out of the paste bin. - * 3. Check if the paste was successful if true, process the HTML. - * (4). If the paste was unsuccessful use IE execCommand, Clipboard API, document.dataTransfer old WebKit API etc. - * - * @class tinymce.pasteplugin.Clipboard - * @private + * Version: 5.2.1 (2020-03-25) */ -define("tinymce/pasteplugin/Clipboard", [ - "tinymce/Env", - "tinymce/util/VK", - "tinymce/pasteplugin/Utils" -], function(Env, VK, Utils) { - return function(editor) { - var self = this, pasteBinElm, lastRng, keyboardPasteTimeStamp = 0; - var pasteBinDefaultContent = '%MCEPASTEBIN%', keyboardPastePlainTextState; - - /** - * Pastes the specified HTML. This means that the HTML is filtered and then - * inserted at the current selection in the editor. It will also fire paste events - * for custom user filtering. - * - * @param {String} html HTML code to paste into the current selection. - */ - function pasteHtml(html) { - var args, dom = editor.dom; - - args = editor.fire('BeforePastePreProcess', {content: html}); // Internal event used by Quirks - args = editor.fire('PastePreProcess', args); - html = args.content; - - if (!args.isDefaultPrevented()) { - // User has bound PastePostProcess events then we need to pass it through a DOM node - // This is not ideal but we don't want to let the browser mess up the HTML for example - // some browsers add   to P tags etc - if (editor.hasEventListeners('PastePostProcess') && !args.isDefaultPrevented()) { - // We need to attach the element to the DOM so Sizzle selectors work on the contents - var tempBody = dom.add(editor.getBody(), 'div', {style: 'display:none'}, html); - args = editor.fire('PastePostProcess', {node: tempBody}); - dom.remove(tempBody); - html = args.node.innerHTML; - } - - if (!args.isDefaultPrevented()) { - editor.insertContent(html); - } - } - } - - /** - * Pastes the specified text. This means that the plain text is processed - * and converted into BR and P elements. It will fire paste events for custom filtering. - * - * @param {String} text Text to paste as the current selection location. - */ - function pasteText(text) { - text = editor.dom.encode(text).replace(/\r\n/g, '\n'); - - var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock); - - // Create start block html for example

    - var forcedRootBlockName = editor.settings.forced_root_block; - var forcedRootBlockStartHtml; - if (forcedRootBlockName) { - forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs); - forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>'; - } - - if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) { - text = Utils.filter(text, [ - [/\n/g, "
    "] - ]); - } else { - text = Utils.filter(text, [ - [/\n\n/g, "

    " + forcedRootBlockStartHtml], - [/^(.*<\/p>)(

    )$/, forcedRootBlockStartHtml + '$1'], - [/\n/g, "
    "] - ]); - - if (text.indexOf('

    ') != -1) { - text = forcedRootBlockStartHtml + text; - } - } - - pasteHtml(text); - } - - /** - * Creates a paste bin element as close as possible to the current caret location and places the focus inside that element - * so that when the real paste event occurs the contents gets inserted into this element - * instead of the current editor selection element. - */ - function createPasteBin() { - var dom = editor.dom, body = editor.getBody(); - var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20; - var scrollContainer; - - lastRng = editor.selection.getRng(); - - if (editor.inline) { - scrollContainer = editor.selection.getScrollContainer(); - - // Can't always rely on scrollTop returning a useful value. - // It returns 0 if the browser doesn't support scrollTop for the element or is non-scrollable - if (scrollContainer && scrollContainer.scrollTop > 0) { - scrollTop = scrollContainer.scrollTop; - } - } - - // Calculate top cordinate this is needed to avoid scrolling to top of document - // We want the paste bin to be as close to the caret as possible to avoid scrolling - if (lastRng.getClientRects) { - var rects = lastRng.getClientRects(); - - if (rects.length) { - // Client rects gets us closes to the actual - // caret location in for example a wrapped paragraph block - top = scrollTop + (rects[0].top - dom.getPos(body).y); - } else { - top = scrollTop; - - // Check if we can find a closer location by checking the range element - var container = lastRng.startContainer; - if (container) { - if (container.nodeType == 3 && container.parentNode != body) { - container = container.parentNode; - } - - if (container.nodeType == 1) { - top = dom.getPos(container, scrollContainer || body).y; - } - } - } - } - - // Create a pastebin - pasteBinElm = dom.add(editor.getBody(), 'div', { - id: "mcepastebin", - contentEditable: true, - "data-mce-bogus": "1", - style: 'position: absolute; top: ' + top + 'px;' + - 'width: 10px; height: 10px; overflow: hidden; opacity: 0' - }, pasteBinDefaultContent); - - // Move paste bin out of sight since the controlSelection rect gets displayed otherwise on IE and Gecko - if (Env.ie || Env.gecko) { - dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) == 'rtl' ? 0xFFFF : -0xFFFF); - } - - // Prevent focus events from bubbeling fixed FocusManager issues - dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function(e) { - e.stopPropagation(); - }); - - pasteBinElm.focus(); - editor.selection.select(pasteBinElm, true); - } - - /** - * Removes the paste bin if it exists. - */ - function removePasteBin() { - if (pasteBinElm) { - var pasteBinClone; - - // WebKit/Blink might clone the div so - // lets make sure we remove all clones - // TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it! - while ((pasteBinClone = editor.dom.get('mcepastebin'))) { - editor.dom.remove(pasteBinClone); - editor.dom.unbind(pasteBinClone); - } - - if (lastRng) { - editor.selection.setRng(lastRng); - } - } - - keyboardPastePlainTextState = false; - pasteBinElm = lastRng = null; - } - - /** - * Returns the contents of the paste bin as a HTML string. - * - * @return {String} Get the contents of the paste bin. - */ - function getPasteBinHtml() { - var html = pasteBinDefaultContent, pasteBinClones, i; - - // Since WebKit/Chrome might clone the paste bin when pasting - // for example: we need to check if any of them contains some useful html. - // TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it! - pasteBinClones = editor.dom.select('div[id=mcepastebin]'); - i = pasteBinClones.length; - while (i--) { - var cloneHtml = pasteBinClones[i].innerHTML; - - if (html == pasteBinDefaultContent) { - html = ''; - } - - if (cloneHtml.length > html.length) { - html = cloneHtml; - } - } - - return html; - } - - /** - * Gets various content types out of a datatransfer object. - * - * @param {DataTransfer} dataTransfer Event fired on paste. - * @return {Object} Object with mime types and data for those mime types. - */ - function getDataTransferItems(dataTransfer) { - var data = {}; - - if (dataTransfer && dataTransfer.types) { - // Use old WebKit API - var legacyText = dataTransfer.getData('Text'); - if (legacyText && legacyText.length > 0) { - data['text/plain'] = legacyText; - } - - for (var i = 0; i < dataTransfer.types.length; i++) { - var contentType = dataTransfer.types[i]; - data[contentType] = dataTransfer.getData(contentType); - } - } - - return data; - } - - /** - * Gets various content types out of the Clipboard API. It will also get the - * plain text using older IE and WebKit API:s. - * - * @param {ClipboardEvent} clipboardEvent Event fired on paste. - * @return {Object} Object with mime types and data for those mime types. - */ - function getClipboardContent(clipboardEvent) { - return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); - } - - /** - * Checks if the clipboard contains image data if it does it will take that data - * and convert it into a data url image and paste that image at the caret location. - * - * @param {ClipboardEvent} e Paste event object. - * @param {Object} clipboardContent Collection of clipboard contents. - * @return {Boolean} true/false if the image data was found or not. - */ - function pasteImageData(e, clipboardContent) { - function pasteImage(item) { - if (items[i].type == 'image/png') { - var reader = new FileReader(); - - reader.onload = function() { - pasteHtml(''); - }; - - reader.readAsDataURL(item.getAsFile()); - - return true; - } - } - - // If paste data images are disabled or there is HTML or plain text - // contents then proceed with the normal paste process - if (!editor.settings.paste_data_images || "text/html" in clipboardContent || "text/plain" in clipboardContent) { - return; - } - - if (e.clipboardData) { - var items = e.clipboardData.items; - - if (items) { - for (var i = 0; i < items.length; i++) { - if (pasteImage(items[i])) { - return true; - } - } - } - } - } - - function getCaretRangeFromEvent(e) { - var doc = editor.getDoc(), rng; - - if (doc.caretPositionFromPoint) { - var point = doc.caretPositionFromPoint(e.clientX, e.clientY); - rng = doc.createRange(); - rng.setStart(point.offsetNode, point.offset); - rng.collapse(true); - } else if (doc.caretRangeFromPoint) { - rng = doc.caretRangeFromPoint(e.clientX, e.clientY); - } - - return rng; - } - - function hasContentType(clipboardContent, mimeType) { - return mimeType in clipboardContent && clipboardContent[mimeType].length > 0; - } - - function registerEventHandlers() { - editor.on('keydown', function(e) { - if (e.isDefaultPrevented()) { - return; - } - - // Ctrl+V or Shift+Insert - if ((VK.metaKeyPressed(e) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) { - keyboardPastePlainTextState = e.shiftKey && e.keyCode == 86; - - // Prevent undoManager keydown handler from making an undo level with the pastebin in it - e.stopImmediatePropagation(); - - keyboardPasteTimeStamp = new Date().getTime(); - - // IE doesn't support Ctrl+Shift+V and it doesn't even produce a paste event - // so lets fake a paste event and let IE use the execCommand/dataTransfer methods - if (Env.ie && keyboardPastePlainTextState) { - e.preventDefault(); - editor.fire('paste', {ieFake: true}); - return; - } - - removePasteBin(); - createPasteBin(); - } - }); - - editor.on('paste', function(e) { - var clipboardContent = getClipboardContent(e); - var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 1000; - var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState; - - if (e.isDefaultPrevented()) { - removePasteBin(); - return; - } - - if (pasteImageData(e, clipboardContent)) { - removePasteBin(); - return; - } - - // Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs - if (!isKeyBoardPaste) { - e.preventDefault(); - } - - // Try IE only method if paste isn't a keyboard paste - if (Env.ie && (!isKeyBoardPaste || e.ieFake)) { - createPasteBin(); - - editor.dom.bind(pasteBinElm, 'paste', function(e) { - e.stopPropagation(); - }); - - editor.getDoc().execCommand('Paste', false, null); - clipboardContent["text/html"] = getPasteBinHtml(); - } - - setTimeout(function() { - var html = getPasteBinHtml(); - - // WebKit has a nice bug where it clones the paste bin if you paste from for example notepad - if (pasteBinElm && pasteBinElm.firstChild && pasteBinElm.firstChild.id === 'mcepastebin') { - plainTextMode = true; - } - - removePasteBin(); - - // Always use pastebin HTML if it's available since it contains Word contents - if (!plainTextMode && isKeyBoardPaste && html && html != pasteBinDefaultContent) { - clipboardContent['text/html'] = html; - } - - if (html == pasteBinDefaultContent || !isKeyBoardPaste) { - html = clipboardContent['text/html'] || clipboardContent['text/plain'] || pasteBinDefaultContent; - - if (html == pasteBinDefaultContent) { - if (!isKeyBoardPaste) { - editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); - } - - return; - } - } - - // Force plain text mode if we only got a text/plain content type - if (!hasContentType(clipboardContent, 'text/html') && hasContentType(clipboardContent, 'text/plain')) { - plainTextMode = true; - } - - if (plainTextMode) { - pasteText(clipboardContent['text/plain'] || Utils.innerText(html)); - } else { - pasteHtml(html); - } - }, 0); - }); - - editor.on('dragstart', function(e) { - if (e.dataTransfer.types) { - try { - e.dataTransfer.setData('mce-internal', editor.selection.getContent()); - } catch (ex) { - // IE 10 throws an error since it doesn't support custom data items - } - } - }); - - editor.on('drop', function(e) { - var rng = getCaretRangeFromEvent(e); - - if (rng && !e.isDefaultPrevented()) { - var dropContent = getDataTransferItems(e.dataTransfer); - var content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; - - if (content) { - e.preventDefault(); - - editor.undoManager.transact(function() { - if (dropContent['mce-internal']) { - editor.execCommand('Delete'); - } - - editor.selection.setRng(rng); - - if (!dropContent['text/html']) { - pasteText(content); - } else { - pasteHtml(content); - } - }); - } - } - }); - } - - self.pasteHtml = pasteHtml; - self.pasteText = pasteText; - - editor.on('preInit', function() { - registerEventHandlers(); - - // Remove all data images from paste for example from Gecko - // except internal images like video elements - editor.parser.addNodeFilter('img', function(nodes) { - if (!editor.settings.paste_data_images) { - var i = nodes.length; - - while (i--) { - var src = nodes[i].attributes.map.src; - if (src && src.indexOf('data:image') === 0) { - if (!nodes[i].attr('data-mce-object') && src !== Env.transparentSrc) { - nodes[i].remove(); - } - } - } - } - }); - }); - - // Fix for #6504 we need to remove the paste bin on IE if the user paste in a file - editor.on('PreProcess', function() { - editor.dom.remove(editor.dom.get('mcepastebin')); - }); - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/WordFilter.js - -/** - * WordFilter.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class parses word HTML into proper TinyMCE markup. - * - * @class tinymce.pasteplugin.Quirks - * @private - */ -define("tinymce/pasteplugin/WordFilter", [ - "tinymce/util/Tools", - "tinymce/html/DomParser", - "tinymce/html/Schema", - "tinymce/html/Serializer", - "tinymce/html/Node", - "tinymce/pasteplugin/Utils" -], function(Tools, DomParser, Schema, Serializer, Node, Utils) { - /** - * Checks if the specified content is from any of the following sources: MS Word/Office 365/Google docs. - */ - function isWordContent(content) { - return ( - (/ 1) { - currentListNode.attr('start', '' + start); - } - - paragraphNode.wrap(currentListNode); - } else { - currentListNode.append(paragraphNode); - } - - paragraphNode.name = 'li'; - listStartTextNode.value = ''; - - var nextNode = listStartTextNode.next; - if (nextNode && nextNode.type == 3) { - nextNode.value = nextNode.value.replace(/^\u00a0+/, ''); - } - - // Append list to previous list if it exists - if (level > lastLevel && prevListNode) { - prevListNode.lastChild.append(currentListNode); - } - - lastLevel = level; - } - - var paragraphs = node.getAll('p'); - - for (var i = 0; i < paragraphs.length; i++) { - node = paragraphs[i]; - - if (node.name == 'p' && node.firstChild) { - // Find first text node in paragraph - var nodeText = ''; - var listStartTextNode = node.firstChild; - - while (listStartTextNode) { - nodeText = listStartTextNode.value; - if (nodeText) { - break; - } - - listStartTextNode = listStartTextNode.firstChild; - } - - // Detect unordered lists look for bullets - if (/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(nodeText)) { - convertParagraphToLi(node, listStartTextNode, 'ul'); - continue; - } - - // Detect ordered lists 1., a. or ixv. - if (/^\s*\w+\.$/.test(nodeText)) { - // Parse OL start number - var matches = /([0-9])\./.exec(nodeText); - var start = 1; - if (matches) { - start = parseInt(matches[1], 10); - } - - convertParagraphToLi(node, listStartTextNode, 'ol', start); - continue; - } - - currentListNode = null; - } - } - } - - function filterStyles(node, styleValue) { - var outputStyles = {}, styles = editor.dom.parseStyle(styleValue); - - // Parse out list indent level for lists - if (node.name === 'p') { - var matches = /mso-list:\w+ \w+([0-9]+)/.exec(styleValue); - - if (matches) { - node._listLevel = parseInt(matches[1], 10); - } - } - - Tools.each(styles, function(value, name) { - // Convert various MS styles to W3C styles - switch (name) { - case "horiz-align": - name = "text-align"; - break; - - case "vert-align": - name = "vertical-align"; - break; - - case "font-color": - case "mso-foreground": - name = "color"; - break; - - case "mso-background": - case "mso-highlight": - name = "background"; - break; - - case "font-weight": - case "font-style": - if (value != "normal") { - outputStyles[name] = value; - } - return; - - case "mso-element": - // Remove track changes code - if (/^(comment|comment-list)$/i.test(value)) { - node.remove(); - return; - } - - break; - } - - if (name.indexOf('mso-comment') === 0) { - node.remove(); - return; - } - - // Never allow mso- prefixed names - if (name.indexOf('mso-') === 0) { - return; - } - - // Output only valid styles - if (retainStyleProperties == "all" || (validStyles && validStyles[name])) { - outputStyles[name] = value; - } - }); - - // Convert bold style to "b" element - if (/(bold)/i.test(outputStyles["font-weight"])) { - delete outputStyles["font-weight"]; - node.wrap(new Node("b", 1)); - } - - // Convert italic style to "i" element - if (/(italic)/i.test(outputStyles["font-style"])) { - delete outputStyles["font-style"]; - node.wrap(new Node("i", 1)); - } - - // Serialize the styles and see if there is something left to keep - outputStyles = editor.dom.serializeStyle(outputStyles, node.name); - if (outputStyles) { - return outputStyles; - } - - return null; - } - - if (settings.paste_enable_default_filters === false) { - return; - } - - // Detect is the contents is Word junk HTML - if (isWordContent(e.content)) { - e.wordContent = true; // Mark it for other processors - - // Remove basic Word junk - content = Utils.filter(content, [ - // Word comments like conditional comments etc - //gi, - - // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, - // MS Office namespaced tags, and a few other tags - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, - - // Convert into for line-though - [/<(\/?)s>/gi, "<$1strike>"], - - // Replace nsbp entites to char since it's easier to handle - [/ /gi, "\u00a0"], - - // Convert ___ to string of alternating - // breaking/non-breaking spaces of same length - [/([\s\u00a0]*)<\/span>/gi, - function(str, spaces) { - return (spaces.length > 0) ? - spaces.replace(/./, " ").slice(Math.floor(spaces.length / 2)).split("").join("\u00a0") : ""; - } - ] - ]); - - var validElements = settings.paste_word_valid_elements; - if (!validElements) { - validElements = '-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,' + - '-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,del'; - } - - // Setup strict schema - var schema = new Schema({ - valid_elements: validElements, - valid_children: '-li[p]' - }); - - // Add style/class attribute to all element rules since the user might have removed them from - // paste_word_valid_elements config option and we need to check them for properties - Tools.each(schema.elements, function(rule) { - if (!rule.attributes["class"]) { - rule.attributes["class"] = {}; - rule.attributesOrder.push("class"); - } - - if (!rule.attributes.style) { - rule.attributes.style = {}; - rule.attributesOrder.push("style"); - } - }); - - // Parse HTML into DOM structure - var domParser = new DomParser({}, schema); - - // Filter styles to remove "mso" specific styles and convert some of them - domParser.addAttributeFilter('style', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('style', filterStyles(node, node.attr('style'))); - - // Remove pointess spans - if (node.name == 'span' && node.parent && !node.attributes.length) { - node.unwrap(); - } - } - }); - - // Check the class attribute for comments or del items and remove those - domParser.addAttributeFilter('class', function(nodes) { - var i = nodes.length, node, className; - - while (i--) { - node = nodes[i]; - - className = node.attr('class'); - if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) { - node.remove(); - } - - node.attr('class', null); - } - }); - - // Remove all del elements since we don't want the track changes code in the editor - domParser.addNodeFilter('del', function(nodes) { - var i = nodes.length; - - while (i--) { - nodes[i].remove(); - } - }); - - // Keep some of the links and anchors - domParser.addNodeFilter('a', function(nodes) { - var i = nodes.length, node, href, name; - - while (i--) { - node = nodes[i]; - href = node.attr('href'); - name = node.attr('name'); - - if (href && href.indexOf('#_msocom_') != -1) { - node.remove(); - continue; - } - - if (href && href.indexOf('file://') === 0) { - href = href.split('#')[1]; - if (href) { - href = '#' + href; - } - } - - if (!href && !name) { - node.unwrap(); - } else { - // Remove all named anchors that aren't specific to TOC, Footnotes or Endnotes - if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) { - node.unwrap(); - continue; - } - - node.attr({ - href: href, - name: name - }); - } - } - }); - - // Parse into DOM structure - var rootNode = domParser.parse(content); - - // Process DOM - convertFakeListsToProperLists(rootNode); - - // Serialize DOM back to HTML - e.content = new Serializer({}, schema).serialize(rootNode); - } - }); - } - - WordFilter.isWordContent = isWordContent; - - return WordFilter; -}); - -// Included from: js/tinymce/plugins/paste/classes/Quirks.js - -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains various fixes for browsers. These issues can not be feature - * detected since we have no direct control over the clipboard. However we might be able - * to remove some of these fixes once the browsers gets updated/fixed. - * - * @class tinymce.pasteplugin.Quirks - * @private - */ -define("tinymce/pasteplugin/Quirks", [ - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/pasteplugin/WordFilter", - "tinymce/pasteplugin/Utils" -], function(Env, Tools, WordFilter, Utils) { - "use strict"; - - return function(editor) { - function addPreProcessFilter(filterFunc) { - editor.on('BeforePastePreProcess', function(e) { - e.content = filterFunc(e.content); - }); - } - - /** - * Removes WebKit fragment comments and converted-space spans. - * - * This: - * a b - * - * Becomes: - * a b - */ - function removeWebKitFragments(html) { - html = Utils.filter(html, [ - /^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g, // WebKit fragment body - /|/g, // Inner fragments (tables from excel on mac) - [/\u00a0<\/span>/g, '\u00a0'], // WebKit   - /
    $/i // Traling BR elements - ]); - - return html; - } - - /** - * Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each - * block element when pasting from word. This removes those elements. - * - * This: - *

    a


    b

    - * - * Becomes: - *

    a

    b

    - */ - function removeExplorerBrElementsAfterBlocks(html) { - // Only filter word specific content - if (!WordFilter.isWordContent(html)) { - return html; - } - - // Produce block regexp based on the block elements in schema - var blockElements = []; - - Tools.each(editor.schema.getBlockElements(), function(block, blockName) { - blockElements.push(blockName); - }); - - var explorerBlocksRegExp = new RegExp( - '(?:
     [\\s\\r\\n]+|
    )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
     [\\s\\r\\n]+|
    )*', - 'g' - ); - - // Remove BR:s from: X
    - html = Utils.filter(html, [ - [explorerBlocksRegExp, '$1'] - ]); - - // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break - html = Utils.filter(html, [ - [/

    /g, '

    '], // Replace multiple BR elements with uppercase BR to keep them intact - [/
    /g, ' '], // Replace single br elements with space since they are word wrap BR:s - [/

    /g, '
    '] // Replace back the double brs but into a single BR - ]); - - return html; - } - - /** - * WebKit has a nasty bug where the all computed styles gets added to style attributes when copy/pasting contents. - * This fix solves that by simply removing the whole style attribute. - * - * The paste_webkit_styles option can be set to specify what to keep: - * paste_webkit_styles: "none" // Keep no styles - * paste_webkit_styles: "all", // Keep all of them - * paste_webkit_styles: "font-weight color" // Keep specific ones - * - * @param {String} content Content that needs to be processed. - * @return {String} Processed contents. - */ - function removeWebKitStyles(content) { - // Passthrough all styles from Word and let the WordFilter handle that junk - if (WordFilter.isWordContent(content)) { - return content; - } - - // Filter away styles that isn't matching the target node - var webKitStyles = editor.settings.paste_webkit_styles; - - if (editor.settings.paste_remove_styles_if_webkit === false || webKitStyles == "all") { - return content; - } - - if (webKitStyles) { - webKitStyles = webKitStyles.split(/[, ]/); - } - - // Keep specific styles that doesn't match the current node computed style - if (webKitStyles) { - var dom = editor.dom, node = editor.selection.getNode(); - - content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function(all, before, value, after) { - var inputStyles = dom.parseStyle(value, 'span'), outputStyles = {}; - - if (webKitStyles === "none") { - return before + after; - } - - for (var i = 0; i < webKitStyles.length; i++) { - var inputValue = inputStyles[webKitStyles[i]], currentValue = dom.getStyle(node, webKitStyles[i], true); - - if (/color/.test(webKitStyles[i])) { - inputValue = dom.toHex(inputValue); - currentValue = dom.toHex(currentValue); - } - - if (currentValue != inputValue) { - outputStyles[webKitStyles[i]] = inputValue; - } - } - - outputStyles = dom.serializeStyle(outputStyles, 'span'); - if (outputStyles) { - return before + ' style="' + outputStyles + '"' + after; - } - - return ''; - }); - } else { - // Remove all external styles - content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3'); - } - - // Keep internal styles - content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function(all, before, value, after) { - return before + ' style="' + value + '"' + after; - }); - - return content; - } - - // Sniff browsers and apply fixes since we can't feature detect - if (Env.webkit) { - addPreProcessFilter(removeWebKitStyles); - addPreProcessFilter(removeWebKitFragments); - } - - if (Env.ie) { - addPreProcessFilter(removeExplorerBrElementsAfterBlocks); - } - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/Plugin.js - -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains the tinymce plugin logic for the paste plugin. - * - * @class tinymce.pasteplugin.Plugin - * @private - */ -define("tinymce/pasteplugin/Plugin", [ - "tinymce/PluginManager", - "tinymce/pasteplugin/Clipboard", - "tinymce/pasteplugin/WordFilter", - "tinymce/pasteplugin/Quirks" -], function(PluginManager, Clipboard, WordFilter, Quirks) { - var userIsInformed; - - PluginManager.add('paste', function(editor) { - var self = this, clipboard, settings = editor.settings; - - function togglePlainTextPaste() { - if (clipboard.pasteFormat == "text") { - this.active(false); - clipboard.pasteFormat = "html"; - } else { - clipboard.pasteFormat = "text"; - this.active(true); - - if (!userIsInformed) { - editor.windowManager.alert( - 'Paste is now in plain text mode. Contents will now ' + - 'be pasted as plain text until you toggle this option off.' - ); - - userIsInformed = true; - } - } - } - - self.clipboard = clipboard = new Clipboard(editor); - self.quirks = new Quirks(editor); - self.wordFilter = new WordFilter(editor); - - if (editor.settings.paste_as_text) { - self.clipboard.pasteFormat = "text"; - } - - if (settings.paste_preprocess) { - editor.on('PastePreProcess', function(e) { - settings.paste_preprocess.call(self, self, e); - }); - } - - if (settings.paste_postprocess) { - editor.on('PastePostProcess', function(e) { - settings.paste_postprocess.call(self, self, e); - }); - } - - editor.addCommand('mceInsertClipboardContent', function(ui, value) { - if (value.content) { - self.clipboard.pasteHtml(value.content); - } - - if (value.text) { - self.clipboard.pasteText(value.text); - } - }); - - // Block all drag/drop events - if (editor.paste_block_drop) { - editor.on('dragend dragover draggesture dragdrop drop drag', function(e) { - e.preventDefault(); - e.stopPropagation(); - }); - } - - // Prevent users from dropping data images on Gecko - if (!editor.settings.paste_data_images) { - editor.on('drop', function(e) { - var dataTransfer = e.dataTransfer; - - if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { - e.preventDefault(); - } - }); - } - - editor.addButton('pastetext', { - icon: 'pastetext', - tooltip: 'Paste as text', - onclick: togglePlainTextPaste, - active: self.clipboard.pasteFormat == "text" - }); - - editor.addMenuItem('pastetext', { - text: 'Paste as text', - selectable: true, - active: clipboard.pasteFormat, - onclick: togglePlainTextPaste - }); - }); -}); - -expose(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); -})(this); \ No newline at end of file +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var hasProPlugin = function (editor) { + if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global$1.get('powerpaste')) { + if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) { + domGlobals.window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.'); + } + return true; + } else { + return false; + } + }; + var DetectProPlugin = { hasProPlugin: hasProPlugin }; + + var get = function (clipboard, quirks) { + return { + clipboard: clipboard, + quirks: quirks + }; + }; + var Api = { get: get }; + + var firePastePreProcess = function (editor, html, internal, isWordHtml) { + return editor.fire('PastePreProcess', { + content: html, + internal: internal, + wordContent: isWordHtml + }); + }; + var firePastePostProcess = function (editor, node, internal, isWordHtml) { + return editor.fire('PastePostProcess', { + node: node, + internal: internal, + wordContent: isWordHtml + }); + }; + var firePastePlainTextToggle = function (editor, state) { + return editor.fire('PastePlainTextToggle', { state: state }); + }; + var firePaste = function (editor, ieFake) { + return editor.fire('paste', { ieFake: ieFake }); + }; + var Events = { + firePastePreProcess: firePastePreProcess, + firePastePostProcess: firePastePostProcess, + firePastePlainTextToggle: firePastePlainTextToggle, + firePaste: firePaste + }; + + var togglePlainTextPaste = function (editor, clipboard) { + if (clipboard.pasteFormat.get() === 'text') { + clipboard.pasteFormat.set('html'); + Events.firePastePlainTextToggle(editor, false); + } else { + clipboard.pasteFormat.set('text'); + Events.firePastePlainTextToggle(editor, true); + } + editor.focus(); + }; + var Actions = { togglePlainTextPaste: togglePlainTextPaste }; + + var register = function (editor, clipboard) { + editor.addCommand('mceTogglePlainTextPaste', function () { + Actions.togglePlainTextPaste(editor, clipboard); + }); + editor.addCommand('mceInsertClipboardContent', function (ui, value) { + if (value.content) { + clipboard.pasteHtml(value.content, value.internal); + } + if (value.text) { + clipboard.pasteText(value.text); + } + }); + }; + var Commands = { register: register }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var exports$1 = {}, module = { exports: exports$1 }; + (function (define, exports, module, require) { + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); + }(undefined, exports$1, module, undefined)); + var Promise = module.exports.boltExport; + + var nu = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.some(x); + run(callbacks); + callbacks = []; + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu, + pure: pure + }; + + var errorReporter = function (err) { + domGlobals.setTimeout(function () { + throw err; + }, 0); + }; + var make = function (run) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { + return make(function () { + return run().then(fab); + }); + }; + var bind = function (aFutureB) { + return make(function () { + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); + }); + }; + var anonBind = function (futureB) { + return make(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$1 = function (baseFn) { + return make(function () { + return new Promise(baseFn); + }); + }; + var pure$1 = function (a) { + return make(function () { + return Promise.resolve(a); + }); + }; + var Future = { + nu: nu$1, + pure: pure$1 + }; + + var par = function (asyncValues, nu) { + return nu(function (callback) { + var r = []; + var count = 0; + var cb = function (i) { + return function (value) { + r[i] = value; + count++; + if (count >= asyncValues.length) { + callback(r); + } + }; + }; + if (asyncValues.length === 0) { + callback([]); + } else { + each(asyncValues, function (asyncValue, i) { + asyncValue.get(cb(i)); + }); + } + }); + }; + + var par$1 = function (futures) { + return par(futures, Future.nu); + }; + var traverse = function (array, fn) { + return par$1(map(array, fn)); + }; + + var value = function () { + var subject = Cell(Option.none()); + var clear = function () { + subject.set(Option.none()); + }; + var set = function (s) { + subject.set(Option.some(s)); + }; + var on = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var internalMimeType = 'x-tinymce/html'; + var internalMark = ''; + var mark = function (html) { + return internalMark + html; + }; + var unmark = function (html) { + return html.replace(internalMark, ''); + }; + var isMarked = function (html) { + return html.indexOf(internalMark) !== -1; + }; + var InternalHtml = { + mark: mark, + unmark: unmark, + isMarked: isMarked, + internalHtmlMime: function () { + return internalMimeType; + } + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.html.Entities'); + + var isPlainText = function (text) { + return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text); + }; + var toBRs = function (text) { + return text.replace(/\r?\n/g, '
    '); + }; + var openContainer = function (rootTag, rootAttrs) { + var key; + var attrs = []; + var tag = '<' + rootTag; + if (typeof rootAttrs === 'object') { + for (key in rootAttrs) { + if (rootAttrs.hasOwnProperty(key)) { + attrs.push(key + '="' + global$6.encodeAllRaw(rootAttrs[key]) + '"'); + } + } + if (attrs.length) { + tag += ' ' + attrs.join(' '); + } + } + return tag + '>'; + }; + var toBlockElements = function (text, rootTag, rootAttrs) { + var blocks = text.split(/\n\n/); + var tagOpen = openContainer(rootTag, rootAttrs); + var tagClose = ''; + var paragraphs = global$4.map(blocks, function (p) { + return p.split(/\n/).join('
    '); + }); + var stitch = function (p) { + return tagOpen + p + tagClose; + }; + return paragraphs.length === 1 ? paragraphs[0] : global$4.map(paragraphs, stitch).join(''); + }; + var convert = function (text, rootTag, rootAttrs) { + return rootTag ? toBlockElements(text, rootTag === true ? 'p' : rootTag, rootAttrs) : toBRs(text); + }; + var Newlines = { + isPlainText: isPlainText, + convert: convert, + toBRs: toBRs, + toBlockElements: toBlockElements + }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); + + var global$8 = tinymce.util.Tools.resolve('tinymce.html.Serializer'); + + var global$9 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$a = tinymce.util.Tools.resolve('tinymce.html.Schema'); + + var shouldBlockDrop = function (editor) { + return editor.getParam('paste_block_drop', false); + }; + var shouldPasteDataImages = function (editor) { + return editor.getParam('paste_data_images', false); + }; + var shouldFilterDrop = function (editor) { + return editor.getParam('paste_filter_drop', true); + }; + var getPreProcess = function (editor) { + return editor.getParam('paste_preprocess'); + }; + var getPostProcess = function (editor) { + return editor.getParam('paste_postprocess'); + }; + var getWebkitStyles = function (editor) { + return editor.getParam('paste_webkit_styles'); + }; + var shouldRemoveWebKitStyles = function (editor) { + return editor.getParam('paste_remove_styles_if_webkit', true); + }; + var shouldMergeFormats = function (editor) { + return editor.getParam('paste_merge_formats', true); + }; + var isSmartPasteEnabled = function (editor) { + return editor.getParam('smart_paste', true); + }; + var isPasteAsTextEnabled = function (editor) { + return editor.getParam('paste_as_text', false); + }; + var getRetainStyleProps = function (editor) { + return editor.getParam('paste_retain_style_properties'); + }; + var getWordValidElements = function (editor) { + var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'; + return editor.getParam('paste_word_valid_elements', defaultValidElements); + }; + var shouldConvertWordFakeLists = function (editor) { + return editor.getParam('paste_convert_word_fake_lists', true); + }; + var shouldUseDefaultFilters = function (editor) { + return editor.getParam('paste_enable_default_filters', true); + }; + var Settings = { + shouldBlockDrop: shouldBlockDrop, + shouldPasteDataImages: shouldPasteDataImages, + shouldFilterDrop: shouldFilterDrop, + getPreProcess: getPreProcess, + getPostProcess: getPostProcess, + getWebkitStyles: getWebkitStyles, + shouldRemoveWebKitStyles: shouldRemoveWebKitStyles, + shouldMergeFormats: shouldMergeFormats, + isSmartPasteEnabled: isSmartPasteEnabled, + isPasteAsTextEnabled: isPasteAsTextEnabled, + getRetainStyleProps: getRetainStyleProps, + getWordValidElements: getWordValidElements, + shouldConvertWordFakeLists: shouldConvertWordFakeLists, + shouldUseDefaultFilters: shouldUseDefaultFilters + }; + + var nbsp = '\xA0'; + + function filter$1(content, items) { + global$4.each(items, function (v) { + if (v.constructor === RegExp) { + content = content.replace(v, ''); + } else { + content = content.replace(v[0], v[1]); + } + }); + return content; + } + function innerText(html) { + var schema = global$a(); + var domParser = global$7({}, schema); + var text = ''; + var shortEndedElements = schema.getShortEndedElements(); + var ignoreElements = global$4.makeMap('script noscript style textarea video audio iframe object', ' '); + var blockElements = schema.getBlockElements(); + function walk(node) { + var name = node.name, currentNode = node; + if (name === 'br') { + text += '\n'; + return; + } + if (name === 'wbr') { + return; + } + if (shortEndedElements[name]) { + text += ' '; + } + if (ignoreElements[name]) { + text += ' '; + return; + } + if (node.type === 3) { + text += node.value; + } + if (!node.shortEnded) { + if (node = node.firstChild) { + do { + walk(node); + } while (node = node.next); + } + } + if (blockElements[name] && currentNode.next) { + text += '\n'; + if (name === 'p') { + text += '\n'; + } + } + } + html = filter$1(html, [//g]); + walk(domParser.parse(html)); + return text; + } + function trimHtml(html) { + function trimSpaces(all, s1, s2) { + if (!s1 && !s2) { + return ' '; + } + return nbsp; + } + html = filter$1(html, [ + /^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig, + /|/g, + [ + /( ?)\u00a0<\/span>( ?)/g, + trimSpaces + ], + /
    /g, + /
    $/i + ]); + return html; + } + function createIdGenerator(prefix) { + var count = 0; + return function () { + return prefix + count++; + }; + } + var isMsEdge = function () { + return domGlobals.navigator.userAgent.indexOf(' Edge/') !== -1; + }; + var Utils = { + filter: filter$1, + innerText: innerText, + trimHtml: trimHtml, + createIdGenerator: createIdGenerator, + isMsEdge: isMsEdge + }; + + function isWordContent(content) { + return / 1) { + currentListNode.attr('start', '' + start); + } + paragraphNode.wrap(currentListNode); + } else { + currentListNode.append(paragraphNode); + } + paragraphNode.name = 'li'; + if (level > lastLevel && prevListNode) { + prevListNode.lastChild.append(currentListNode); + } + lastLevel = level; + removeIgnoredNodes(paragraphNode); + trimListStart(paragraphNode, /^\u00a0+/); + trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/); + trimListStart(paragraphNode, /^\u00a0+/); + } + var elements = []; + var child = node.firstChild; + while (typeof child !== 'undefined' && child !== null) { + elements.push(child); + child = child.walk(); + if (child !== null) { + while (typeof child !== 'undefined' && child.parent !== node) { + child = child.walk(); + } + } + } + for (var i = 0; i < elements.length; i++) { + node = elements[i]; + if (node.name === 'p' && node.firstChild) { + var nodeText = getText(node); + if (isBulletList(nodeText)) { + convertParagraphToLi(node, 'ul'); + continue; + } + if (isNumericList(nodeText)) { + var matches = /([0-9]+)\./.exec(nodeText); + var start = 1; + if (matches) { + start = parseInt(matches[1], 10); + } + convertParagraphToLi(node, 'ol', start); + continue; + } + if (node._listLevel) { + convertParagraphToLi(node, 'ul', 1); + continue; + } + currentListNode = null; + } else { + prevListNode = currentListNode; + currentListNode = null; + } + } + } + function filterStyles(editor, validStyles, node, styleValue) { + var outputStyles = {}, matches; + var styles = editor.dom.parseStyle(styleValue); + global$4.each(styles, function (value, name) { + switch (name) { + case 'mso-list': + matches = /\w+ \w+([0-9]+)/i.exec(styleValue); + if (matches) { + node._listLevel = parseInt(matches[1], 10); + } + if (/Ignore/i.test(value) && node.firstChild) { + node._listIgnore = true; + node.firstChild._listIgnore = true; + } + break; + case 'horiz-align': + name = 'text-align'; + break; + case 'vert-align': + name = 'vertical-align'; + break; + case 'font-color': + case 'mso-foreground': + name = 'color'; + break; + case 'mso-background': + case 'mso-highlight': + name = 'background'; + break; + case 'font-weight': + case 'font-style': + if (value !== 'normal') { + outputStyles[name] = value; + } + return; + case 'mso-element': + if (/^(comment|comment-list)$/i.test(value)) { + node.remove(); + return; + } + break; + } + if (name.indexOf('mso-comment') === 0) { + node.remove(); + return; + } + if (name.indexOf('mso-') === 0) { + return; + } + if (Settings.getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) { + outputStyles[name] = value; + } + }); + if (/(bold)/i.test(outputStyles['font-weight'])) { + delete outputStyles['font-weight']; + node.wrap(new global$9('b', 1)); + } + if (/(italic)/i.test(outputStyles['font-style'])) { + delete outputStyles['font-style']; + node.wrap(new global$9('i', 1)); + } + outputStyles = editor.dom.serializeStyle(outputStyles, node.name); + if (outputStyles) { + return outputStyles; + } + return null; + } + var filterWordContent = function (editor, content) { + var retainStyleProperties, validStyles; + retainStyleProperties = Settings.getRetainStyleProps(editor); + if (retainStyleProperties) { + validStyles = global$4.makeMap(retainStyleProperties.split(/[, ]/)); + } + content = Utils.filter(content, [ + /
    /gi, + /]+id="?docs-internal-[^>]*>/gi, + //gi, + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + [ + /<(\/?)s>/gi, + '<$1strike>' + ], + [ + / /gi, + nbsp + ], + [ + /([\s\u00a0]*)<\/span>/gi, + function (str, spaces) { + return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join(nbsp) : ''; + } + ] + ]); + var validElements = Settings.getWordValidElements(editor); + var schema = global$a({ + valid_elements: validElements, + valid_children: '-li[p]' + }); + global$4.each(schema.elements, function (rule) { + if (!rule.attributes.class) { + rule.attributes.class = {}; + rule.attributesOrder.push('class'); + } + if (!rule.attributes.style) { + rule.attributes.style = {}; + rule.attributesOrder.push('style'); + } + }); + var domParser = global$7({}, schema); + domParser.addAttributeFilter('style', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + node.attr('style', filterStyles(editor, validStyles, node, node.attr('style'))); + if (node.name === 'span' && node.parent && !node.attributes.length) { + node.unwrap(); + } + } + }); + domParser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, className; + while (i--) { + node = nodes[i]; + className = node.attr('class'); + if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) { + node.remove(); + } + node.attr('class', null); + } + }); + domParser.addNodeFilter('del', function (nodes) { + var i = nodes.length; + while (i--) { + nodes[i].remove(); + } + }); + domParser.addNodeFilter('a', function (nodes) { + var i = nodes.length, node, href, name; + while (i--) { + node = nodes[i]; + href = node.attr('href'); + name = node.attr('name'); + if (href && href.indexOf('#_msocom_') !== -1) { + node.remove(); + continue; + } + if (href && href.indexOf('file://') === 0) { + href = href.split('#')[1]; + if (href) { + href = '#' + href; + } + } + if (!href && !name) { + node.unwrap(); + } else { + if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) { + node.unwrap(); + continue; + } + node.attr({ + href: href, + name: name + }); + } + } + }); + var rootNode = domParser.parse(content); + if (Settings.shouldConvertWordFakeLists(editor)) { + convertFakeListsToProperLists(rootNode); + } + content = global$8({ validate: editor.settings.validate }, schema).serialize(rootNode); + return content; + }; + var preProcess = function (editor, content) { + return Settings.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content; + }; + var WordFilter = { + preProcess: preProcess, + isWordContent: isWordContent + }; + + var preProcess$1 = function (editor, html) { + var parser = global$7({}, editor.schema); + parser.addNodeFilter('meta', function (nodes) { + global$4.each(nodes, function (node) { + return node.remove(); + }); + }); + var fragment = parser.parse(html, { + forced_root_block: false, + isRootContent: true + }); + return global$8({ validate: editor.settings.validate }, editor.schema).serialize(fragment); + }; + var processResult = function (content, cancelled) { + return { + content: content, + cancelled: cancelled + }; + }; + var postProcessFilter = function (editor, html, internal, isWordHtml) { + var tempBody = editor.dom.create('div', { style: 'display:none' }, html); + var postProcessArgs = Events.firePastePostProcess(editor, tempBody, internal, isWordHtml); + return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented()); + }; + var filterContent = function (editor, content, internal, isWordHtml) { + var preProcessArgs = Events.firePastePreProcess(editor, content, internal, isWordHtml); + var filteredContent = preProcess$1(editor, preProcessArgs.content); + if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) { + return postProcessFilter(editor, filteredContent, internal, isWordHtml); + } else { + return processResult(filteredContent, preProcessArgs.isDefaultPrevented()); + } + }; + var process = function (editor, html, internal) { + var isWordHtml = WordFilter.isWordContent(html); + var content = isWordHtml ? WordFilter.preProcess(editor, html) : html; + return filterContent(editor, content, internal, isWordHtml); + }; + var ProcessFilters = { process: process }; + + var pasteHtml = function (editor, html) { + editor.insertContent(html, { + merge: Settings.shouldMergeFormats(editor), + paste: true + }); + return true; + }; + var isAbsoluteUrl = function (url) { + return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url); + }; + var isImageUrl = function (url) { + return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url); + }; + var createImage = function (editor, url, pasteHtmlFn) { + editor.undoManager.extra(function () { + pasteHtmlFn(editor, url); + }, function () { + editor.insertContent(''); + }); + return true; + }; + var createLink = function (editor, url, pasteHtmlFn) { + editor.undoManager.extra(function () { + pasteHtmlFn(editor, url); + }, function () { + editor.execCommand('mceInsertLink', false, url); + }); + return true; + }; + var linkSelection = function (editor, html, pasteHtmlFn) { + return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false; + }; + var insertImage = function (editor, html, pasteHtmlFn) { + return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false; + }; + var smartInsertContent = function (editor, html) { + global$4.each([ + linkSelection, + insertImage, + pasteHtml + ], function (action) { + return action(editor, html, pasteHtml) !== true; + }); + }; + var insertContent = function (editor, html, pasteAsText) { + if (pasteAsText || Settings.isSmartPasteEnabled(editor) === false) { + pasteHtml(editor, html); + } else { + smartInsertContent(editor, html); + } + }; + var SmartPaste = { + isImageUrl: isImageUrl, + isAbsoluteUrl: isAbsoluteUrl, + insertContent: insertContent + }; + + var isCollapsibleWhitespace = function (c) { + return ' \f\t\x0B'.indexOf(c) !== -1; + }; + var isNewLineChar = function (c) { + return c === '\n' || c === '\r'; + }; + var isNewline = function (text, idx) { + return idx < text.length && idx >= 0 ? isNewLineChar(text[idx]) : false; + }; + var normalizeWhitespace = function (text) { + var result = foldl(text, function (acc, c) { + if (isCollapsibleWhitespace(c) || c === nbsp) { + if (acc.pcIsSpace || acc.str === '' || acc.str.length === text.length - 1 || isNewline(text, acc.str.length + 1)) { + return { + pcIsSpace: false, + str: acc.str + nbsp + }; + } else { + return { + pcIsSpace: true, + str: acc.str + ' ' + }; + } + } else { + return { + pcIsSpace: isNewLineChar(c), + str: acc.str + c + }; + } + }, { + pcIsSpace: false, + str: '' + }); + return result.str; + }; + + var doPaste = function (editor, content, internal, pasteAsText) { + var args = ProcessFilters.process(editor, content, internal); + if (args.cancelled === false) { + SmartPaste.insertContent(editor, args.content, pasteAsText); + } + }; + var pasteHtml$1 = function (editor, html, internalFlag) { + var internal = internalFlag ? internalFlag : InternalHtml.isMarked(html); + doPaste(editor, InternalHtml.unmark(html), internal, false); + }; + var pasteText = function (editor, text) { + var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n'); + var normalizedText = normalizeWhitespace(encodedText); + var html = Newlines.convert(normalizedText, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs); + doPaste(editor, html, false, true); + }; + var getDataTransferItems = function (dataTransfer) { + var items = {}; + var mceInternalUrlPrefix = 'data:text/mce-internal,'; + if (dataTransfer) { + if (dataTransfer.getData) { + var legacyText = dataTransfer.getData('Text'); + if (legacyText && legacyText.length > 0) { + if (legacyText.indexOf(mceInternalUrlPrefix) === -1) { + items['text/plain'] = legacyText; + } + } + } + if (dataTransfer.types) { + for (var i = 0; i < dataTransfer.types.length; i++) { + var contentType = dataTransfer.types[i]; + try { + items[contentType] = dataTransfer.getData(contentType); + } catch (ex) { + items[contentType] = ''; + } + } + } + } + return items; + }; + var getClipboardContent = function (editor, clipboardEvent) { + var content = getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); + return Utils.isMsEdge() ? global$4.extend(content, { 'text/html': '' }) : content; + }; + var hasContentType = function (clipboardContent, mimeType) { + return mimeType in clipboardContent && clipboardContent[mimeType].length > 0; + }; + var hasHtmlOrText = function (content) { + return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain'); + }; + var getBase64FromUri = function (uri) { + var idx; + idx = uri.indexOf(','); + if (idx !== -1) { + return uri.substr(idx + 1); + } + return null; + }; + var isValidDataUriImage = function (settings, imgElm) { + return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true; + }; + var extractFilename = function (editor, str) { + var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i); + return m ? editor.dom.encode(m[1]) : null; + }; + var uniqueId = Utils.createIdGenerator('mceclip'); + var pasteImage = function (editor, imageItem) { + var base64 = getBase64FromUri(imageItem.uri); + var id = uniqueId(); + var name = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id; + var img = new domGlobals.Image(); + img.src = imageItem.uri; + if (isValidDataUriImage(editor.settings, img)) { + var blobCache = editor.editorUpload.blobCache; + var blobInfo = void 0, existingBlobInfo = void 0; + existingBlobInfo = blobCache.findFirst(function (cachedBlobInfo) { + return cachedBlobInfo.base64() === base64; + }); + if (!existingBlobInfo) { + blobInfo = blobCache.create(id, imageItem.blob, base64, name); + blobCache.add(blobInfo); + } else { + blobInfo = existingBlobInfo; + } + pasteHtml$1(editor, '', false); + } else { + pasteHtml$1(editor, '', false); + } + }; + var isClipboardEvent = function (event) { + return event.type === 'paste'; + }; + var readBlobsAsDataUris = function (items) { + return traverse(items, function (item) { + return Future.nu(function (resolve) { + var blob = item.getAsFile ? item.getAsFile() : item; + var reader = new window.FileReader(); + reader.onload = function () { + resolve({ + blob: blob, + uri: reader.result + }); + }; + reader.readAsDataURL(blob); + }); + }); + }; + var getImagesFromDataTransfer = function (dataTransfer) { + var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) { + return item.getAsFile(); + }) : []; + var files = dataTransfer.files ? from$1(dataTransfer.files) : []; + var images = filter(items.length > 0 ? items : files, function (file) { + return /^image\/(jpeg|png|gif|bmp)$/.test(file.type); + }); + return images; + }; + var pasteImageData = function (editor, e, rng) { + var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer; + if (editor.settings.paste_data_images && dataTransfer) { + var images = getImagesFromDataTransfer(dataTransfer); + if (images.length > 0) { + e.preventDefault(); + readBlobsAsDataUris(images).get(function (blobResults) { + if (rng) { + editor.selection.setRng(rng); + } + each(blobResults, function (result) { + pasteImage(editor, result); + }); + }); + return true; + } + } + return false; + }; + var isBrokenAndroidClipboardEvent = function (e) { + var clipboardData = e.clipboardData; + return domGlobals.navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0; + }; + var isKeyboardPasteEvent = function (e) { + return global$5.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45; + }; + var registerEventHandlers = function (editor, pasteBin, pasteFormat) { + var keyboardPasteEvent = value(); + var keyboardPastePlainTextState; + editor.on('keydown', function (e) { + function removePasteBinOnKeyUp(e) { + if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { + pasteBin.remove(); + } + } + if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { + keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86; + if (keyboardPastePlainTextState && global$2.webkit && domGlobals.navigator.userAgent.indexOf('Version/') !== -1) { + return; + } + e.stopImmediatePropagation(); + keyboardPasteEvent.set(e); + window.setTimeout(function () { + keyboardPasteEvent.clear(); + }, 100); + if (global$2.ie && keyboardPastePlainTextState) { + e.preventDefault(); + Events.firePaste(editor, true); + return; + } + pasteBin.remove(); + pasteBin.create(); + editor.once('keyup', removePasteBinOnKeyUp); + editor.once('paste', function () { + editor.off('keyup', removePasteBinOnKeyUp); + }); + } + }); + function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) { + var content, isPlainTextHtml, isImage; + if (hasContentType(clipboardContent, 'text/html')) { + content = clipboardContent['text/html']; + } else { + content = pasteBin.getHtml(); + internal = internal ? internal : InternalHtml.isMarked(content); + if (pasteBin.isDefaultContent(content)) { + plainTextMode = true; + } + } + content = Utils.trimHtml(content); + pasteBin.remove(); + isPlainTextHtml = internal === false && Newlines.isPlainText(content); + isImage = SmartPaste.isImageUrl(content); + if (!content.length || isPlainTextHtml && !isImage) { + plainTextMode = true; + } + if (plainTextMode || isImage) { + if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) { + content = clipboardContent['text/plain']; + } else { + content = Utils.innerText(content); + } + } + if (pasteBin.isDefaultContent(content)) { + if (!isKeyBoardPaste) { + editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); + } + return; + } + if (plainTextMode) { + pasteText(editor, content); + } else { + pasteHtml$1(editor, content, internal); + } + } + var getLastRng = function () { + return pasteBin.getLastRng() || editor.selection.getRng(); + }; + editor.on('paste', function (e) { + var isKeyBoardPaste = keyboardPasteEvent.isSet(); + var clipboardContent = getClipboardContent(editor, e); + var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState; + var internal = hasContentType(clipboardContent, InternalHtml.internalHtmlMime()); + keyboardPastePlainTextState = false; + if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) { + pasteBin.remove(); + return; + } + if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) { + pasteBin.remove(); + return; + } + if (!isKeyBoardPaste) { + e.preventDefault(); + } + if (global$2.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) { + pasteBin.create(); + editor.dom.bind(pasteBin.getEl(), 'paste', function (e) { + e.stopPropagation(); + }); + editor.getDoc().execCommand('Paste', false, null); + clipboardContent['text/html'] = pasteBin.getHtml(); + } + if (hasContentType(clipboardContent, 'text/html')) { + e.preventDefault(); + if (!internal) { + internal = InternalHtml.isMarked(clipboardContent['text/html']); + } + insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal); + } else { + global$3.setEditorTimeout(editor, function () { + insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal); + }, 0); + } + }); + }; + var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) { + registerEventHandlers(editor, pasteBin, pasteFormat); + var src; + editor.parser.addNodeFilter('img', function (nodes, name, args) { + var isPasteInsert = function (args) { + return args.data && args.data.paste === true; + }; + var remove = function (node) { + if (!node.attr('data-mce-object') && src !== global$2.transparentSrc) { + node.remove(); + } + }; + var isWebKitFakeUrl = function (src) { + return src.indexOf('webkit-fake-url') === 0; + }; + var isDataUri = function (src) { + return src.indexOf('data:') === 0; + }; + if (!editor.settings.paste_data_images && isPasteInsert(args)) { + var i = nodes.length; + while (i--) { + src = nodes[i].attr('src'); + if (!src) { + continue; + } + if (isWebKitFakeUrl(src)) { + remove(nodes[i]); + } else if (!editor.settings.allow_html_data_urls && isDataUri(src)) { + remove(nodes[i]); + } + } + } + }); + }; + + var getPasteBinParent = function (editor) { + return global$2.ie && editor.inline ? domGlobals.document.body : editor.getBody(); + }; + var isExternalPasteBin = function (editor) { + return getPasteBinParent(editor) !== editor.getBody(); + }; + var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) { + if (isExternalPasteBin(editor)) { + editor.dom.bind(pasteBinElm, 'paste keyup', function (e) { + if (!isDefault(editor, pasteBinDefaultContent)) { + editor.fire('paste'); + } + }); + } + }; + var create = function (editor, lastRngCell, pasteBinDefaultContent) { + var dom = editor.dom, body = editor.getBody(); + var pasteBinElm; + lastRngCell.set(editor.selection.getRng()); + pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', { + 'id': 'mcepastebin', + 'class': 'mce-pastebin', + 'contentEditable': true, + 'data-mce-bogus': 'all', + 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0' + }, pasteBinDefaultContent); + if (global$2.ie || global$2.gecko) { + dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535); + } + dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) { + e.stopPropagation(); + }); + delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent); + pasteBinElm.focus(); + editor.selection.select(pasteBinElm, true); + }; + var remove = function (editor, lastRngCell) { + if (getEl(editor)) { + var pasteBinClone = void 0; + var lastRng = lastRngCell.get(); + while (pasteBinClone = editor.dom.get('mcepastebin')) { + editor.dom.remove(pasteBinClone); + editor.dom.unbind(pasteBinClone); + } + if (lastRng) { + editor.selection.setRng(lastRng); + } + } + lastRngCell.set(null); + }; + var getEl = function (editor) { + return editor.dom.get('mcepastebin'); + }; + var getHtml = function (editor) { + var pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper; + var copyAndRemove = function (toElm, fromElm) { + toElm.appendChild(fromElm); + editor.dom.remove(fromElm, true); + }; + pasteBinClones = global$4.grep(getPasteBinParent(editor).childNodes, function (elm) { + return elm.id === 'mcepastebin'; + }); + pasteBinElm = pasteBinClones.shift(); + global$4.each(pasteBinClones, function (pasteBinClone) { + copyAndRemove(pasteBinElm, pasteBinClone); + }); + dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm); + for (i = dirtyWrappers.length - 1; i >= 0; i--) { + cleanWrapper = editor.dom.create('div'); + pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]); + copyAndRemove(cleanWrapper, dirtyWrappers[i]); + } + return pasteBinElm ? pasteBinElm.innerHTML : ''; + }; + var getLastRng = function (lastRng) { + return lastRng.get(); + }; + var isDefaultContent = function (pasteBinDefaultContent, content) { + return content === pasteBinDefaultContent; + }; + var isPasteBin = function (elm) { + return elm && elm.id === 'mcepastebin'; + }; + var isDefault = function (editor, pasteBinDefaultContent) { + var pasteBinElm = getEl(editor); + return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML); + }; + var PasteBin = function (editor) { + var lastRng = Cell(null); + var pasteBinDefaultContent = '%MCEPASTEBIN%'; + return { + create: function () { + return create(editor, lastRng, pasteBinDefaultContent); + }, + remove: function () { + return remove(editor, lastRng); + }, + getEl: function () { + return getEl(editor); + }, + getHtml: function () { + return getHtml(editor); + }, + getLastRng: function () { + return getLastRng(lastRng); + }, + isDefault: function () { + return isDefault(editor, pasteBinDefaultContent); + }, + isDefaultContent: function (content) { + return isDefaultContent(pasteBinDefaultContent, content); + } + }; + }; + + var Clipboard = function (editor, pasteFormat) { + var pasteBin = PasteBin(editor); + editor.on('PreInit', function () { + return registerEventsAndFilters(editor, pasteBin, pasteFormat); + }); + return { + pasteFormat: pasteFormat, + pasteHtml: function (html, internalFlag) { + return pasteHtml$1(editor, html, internalFlag); + }, + pasteText: function (text) { + return pasteText(editor, text); + }, + pasteImageData: function (e, rng) { + return pasteImageData(editor, e, rng); + }, + getDataTransferItems: getDataTransferItems, + hasHtmlOrText: hasHtmlOrText, + hasContentType: hasContentType + }; + }; + + var hasWorkingClipboardApi = function (clipboardData) { + return global$2.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && Utils.isMsEdge() !== true; + }; + var setHtml5Clipboard = function (clipboardData, html, text) { + if (hasWorkingClipboardApi(clipboardData)) { + try { + clipboardData.clearData(); + clipboardData.setData('text/html', html); + clipboardData.setData('text/plain', text); + clipboardData.setData(InternalHtml.internalHtmlMime(), html); + return true; + } catch (e) { + return false; + } + } else { + return false; + } + }; + var setClipboardData = function (evt, data, fallback, done) { + if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) { + evt.preventDefault(); + done(); + } else { + fallback(data.html, done); + } + }; + var fallback = function (editor) { + return function (html, done) { + var markedHtml = InternalHtml.mark(html); + var outer = editor.dom.create('div', { + 'contenteditable': 'false', + 'data-mce-bogus': 'all' + }); + var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml); + editor.dom.setStyles(outer, { + position: 'fixed', + top: '0', + left: '-3000px', + width: '1000px', + overflow: 'hidden' + }); + outer.appendChild(inner); + editor.dom.add(editor.getBody(), outer); + var range = editor.selection.getRng(); + inner.focus(); + var offscreenRange = editor.dom.createRng(); + offscreenRange.selectNodeContents(inner); + editor.selection.setRng(offscreenRange); + global$3.setTimeout(function () { + editor.selection.setRng(range); + outer.parentNode.removeChild(outer); + done(); + }, 0); + }; + }; + var getData = function (editor) { + return { + html: editor.selection.getContent({ contextual: true }), + text: editor.selection.getContent({ format: 'text' }) + }; + }; + var isTableSelection = function (editor) { + return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody()); + }; + var hasSelectedContent = function (editor) { + return !editor.selection.isCollapsed() || isTableSelection(editor); + }; + var cut = function (editor) { + return function (evt) { + if (hasSelectedContent(editor)) { + setClipboardData(evt, getData(editor), fallback(editor), function () { + if (global$2.browser.isChrome()) { + var rng_1 = editor.selection.getRng(); + global$3.setEditorTimeout(editor, function () { + editor.selection.setRng(rng_1); + editor.execCommand('Delete'); + }, 0); + } else { + editor.execCommand('Delete'); + } + }); + } + }; + }; + var copy = function (editor) { + return function (evt) { + if (hasSelectedContent(editor)) { + setClipboardData(evt, getData(editor), fallback(editor), function () { + }); + } + }; + }; + var register$1 = function (editor) { + editor.on('cut', cut(editor)); + editor.on('copy', copy(editor)); + }; + var CutCopy = { register: register$1 }; + + var global$b = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); + + var getCaretRangeFromEvent = function (editor, e) { + return global$b.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc()); + }; + var isPlainTextFileUrl = function (content) { + var plainTextContent = content['text/plain']; + return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false; + }; + var setFocusedRange = function (editor, rng) { + editor.focus(); + editor.selection.setRng(rng); + }; + var setup = function (editor, clipboard, draggingInternallyState) { + if (Settings.shouldBlockDrop(editor)) { + editor.on('dragend dragover draggesture dragdrop drop drag', function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + } + if (!Settings.shouldPasteDataImages(editor)) { + editor.on('drop', function (e) { + var dataTransfer = e.dataTransfer; + if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { + e.preventDefault(); + } + }); + } + editor.on('drop', function (e) { + var dropContent, rng; + rng = getCaretRangeFromEvent(editor, e); + if (e.isDefaultPrevented() || draggingInternallyState.get()) { + return; + } + dropContent = clipboard.getDataTransferItems(e.dataTransfer); + var internal = clipboard.hasContentType(dropContent, InternalHtml.internalHtmlMime()); + if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) { + return; + } + if (rng && Settings.shouldFilterDrop(editor)) { + var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; + if (content_1) { + e.preventDefault(); + global$3.setEditorTimeout(editor, function () { + editor.undoManager.transact(function () { + if (dropContent['mce-internal']) { + editor.execCommand('Delete'); + } + setFocusedRange(editor, rng); + content_1 = Utils.trimHtml(content_1); + if (!dropContent['text/html']) { + clipboard.pasteText(content_1); + } else { + clipboard.pasteHtml(content_1, internal); + } + }); + }); + } + } + }); + editor.on('dragstart', function (e) { + draggingInternallyState.set(true); + }); + editor.on('dragover dragend', function (e) { + if (Settings.shouldPasteDataImages(editor) && draggingInternallyState.get() === false) { + e.preventDefault(); + setFocusedRange(editor, getCaretRangeFromEvent(editor, e)); + } + if (e.type === 'dragend') { + draggingInternallyState.set(false); + } + }); + }; + var DragDrop = { setup: setup }; + + var setup$1 = function (editor) { + var plugin = editor.plugins.paste; + var preProcess = Settings.getPreProcess(editor); + if (preProcess) { + editor.on('PastePreProcess', function (e) { + preProcess.call(plugin, plugin, e); + }); + } + var postProcess = Settings.getPostProcess(editor); + if (postProcess) { + editor.on('PastePostProcess', function (e) { + postProcess.call(plugin, plugin, e); + }); + } + }; + var PrePostProcess = { setup: setup$1 }; + + function addPreProcessFilter(editor, filterFunc) { + editor.on('PastePreProcess', function (e) { + e.content = filterFunc(editor, e.content, e.internal, e.wordContent); + }); + } + function addPostProcessFilter(editor, filterFunc) { + editor.on('PastePostProcess', function (e) { + filterFunc(editor, e.node); + }); + } + function removeExplorerBrElementsAfterBlocks(editor, html) { + if (!WordFilter.isWordContent(html)) { + return html; + } + var blockElements = []; + global$4.each(editor.schema.getBlockElements(), function (block, blockName) { + blockElements.push(blockName); + }); + var explorerBlocksRegExp = new RegExp('(?:
     [\\s\\r\\n]+|
    )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
     [\\s\\r\\n]+|
    )*', 'g'); + html = Utils.filter(html, [[ + explorerBlocksRegExp, + '$1' + ]]); + html = Utils.filter(html, [ + [ + /

    /g, + '

    ' + ], + [ + /
    /g, + ' ' + ], + [ + /

    /g, + '
    ' + ] + ]); + return html; + } + function removeWebKitStyles(editor, content, internal, isWordHtml) { + if (isWordHtml || internal) { + return content; + } + var webKitStylesSetting = Settings.getWebkitStyles(editor); + var webKitStyles; + if (Settings.shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') { + return content; + } + if (webKitStylesSetting) { + webKitStyles = webKitStylesSetting.split(/[, ]/); + } + if (webKitStyles) { + var dom_1 = editor.dom, node_1 = editor.selection.getNode(); + content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) { + var inputStyles = dom_1.parseStyle(dom_1.decode(value)); + var outputStyles = {}; + if (webKitStyles === 'none') { + return before + after; + } + for (var i = 0; i < webKitStyles.length; i++) { + var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true); + if (/color/.test(webKitStyles[i])) { + inputValue = dom_1.toHex(inputValue); + currentValue = dom_1.toHex(currentValue); + } + if (currentValue !== inputValue) { + outputStyles[webKitStyles[i]] = inputValue; + } + } + outputStyles = dom_1.serializeStyle(outputStyles, 'span'); + if (outputStyles) { + return before + ' style="' + outputStyles + '"' + after; + } + return before + after; + }); + } else { + content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3'); + } + content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) { + return before + ' style="' + value + '"' + after; + }); + return content; + } + function removeUnderlineAndFontInAnchor(editor, root) { + editor.$('a', root).find('font,u').each(function (i, node) { + editor.dom.remove(node, true); + }); + } + var setup$2 = function (editor) { + if (global$2.webkit) { + addPreProcessFilter(editor, removeWebKitStyles); + } + if (global$2.ie) { + addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks); + addPostProcessFilter(editor, removeUnderlineAndFontInAnchor); + } + }; + var Quirks = { setup: setup$2 }; + + var makeSetupHandler = function (editor, clipboard) { + return function (api) { + api.setActive(clipboard.pasteFormat.get() === 'text'); + var pastePlainTextToggleHandler = function (e) { + return api.setActive(e.state); + }; + editor.on('PastePlainTextToggle', pastePlainTextToggleHandler); + return function () { + return editor.off('PastePlainTextToggle', pastePlainTextToggleHandler); + }; + }; + }; + var register$2 = function (editor, clipboard) { + editor.ui.registry.addToggleButton('pastetext', { + active: false, + icon: 'paste-text', + tooltip: 'Paste as text', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + editor.ui.registry.addToggleMenuItem('pastetext', { + text: 'Paste as text', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + }; + var Buttons = { register: register$2 }; + + function Plugin () { + global$1.add('paste', function (editor) { + if (DetectProPlugin.hasProPlugin(editor) === false) { + var draggingInternallyState = Cell(false); + var pasteFormat = Cell(Settings.isPasteAsTextEnabled(editor) ? 'text' : 'html'); + var clipboard = Clipboard(editor, pasteFormat); + var quirks = Quirks.setup(editor); + Buttons.register(editor, clipboard); + Commands.register(editor, clipboard); + PrePostProcess.setup(editor); + CutCopy.register(editor); + DragDrop.setup(editor, clipboard, draggingInternallyState); + return Api.get(clipboard, quirks); + } + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.min.js index c6e0221..161b79b 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/paste/plugin.min.js @@ -1 +1,9 @@ -!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!o?e=n.filter(e,[[/\n/g,"
    "]]):(e=n.filter(e,[[/\n\n/g,"

    "+a],[/^(.*<\/p>)(

    )$/,a+"$1"],[/\n/g,"
    "]]),-1!=e.indexOf("

    ")&&(e=a+e)),r(e)}function a(){var t=i.dom,n=i.getBody(),r=i.dom.getViewPort(i.getWin()),o=r.y,a=20,s;if(v=i.selection.getRng(),i.inline&&(s=i.selection.getScrollContainer(),s&&s.scrollTop>0&&(o=s.scrollTop)),v.getClientRects){var l=v.getClientRects();if(l.length)a=o+(l[0].top-t.getPos(n).y);else{a=o;var c=v.startContainer;c&&(3==c.nodeType&&c.parentNode!=n&&(c=c.parentNode),1==c.nodeType&&(a=t.getPos(c,s||n).y))}}h=t.add(i.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+a+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},y),(e.ie||e.gecko)&&t.setStyle(h,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(h,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),h.focus(),i.selection.select(h,!0)}function s(){if(h){for(var e;e=i.dom.get("mcepastebin");)i.dom.remove(e),i.dom.unbind(e);v&&i.selection.setRng(v)}x=!1,h=v=null}function l(){var e=y,t,n;for(t=i.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var r=t[n].innerHTML;e==y&&(e=""),r.length>e.length&&(e=r)}return e}function c(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var i=0;i')},t.readAsDataURL(e.getAsFile()),!0}}if(!(!i.settings.paste_data_images||"text/html"in t||"text/plain"in t)&&e.clipboardData){var o=e.clipboardData.items;if(o)for(var a=0;a0}function p(){i.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(x=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),b=(new Date).getTime(),e.ie&&x)return n.preventDefault(),void i.fire("paste",{ieFake:!0});s(),a()}}),i.on("paste",function(t){var c=d(t),f=(new Date).getTime()-b<1e3,p="text"==g.pasteFormat||x;return t.isDefaultPrevented()?void s():u(t,c)?void s():(f||t.preventDefault(),!e.ie||f&&!t.ieFake||(a(),i.dom.bind(h,"paste",function(e){e.stopPropagation()}),i.getDoc().execCommand("Paste",!1,null),c["text/html"]=l()),void setTimeout(function(){var e=l();return h&&h.firstChild&&"mcepastebin"===h.firstChild.id&&(p=!0),s(),!p&&f&&e&&e!=y&&(c["text/html"]=e),e!=y&&f||(e=c["text/html"]||c["text/plain"]||y,e!=y)?(!m(c,"text/html")&&m(c,"text/plain")&&(p=!0),void(p?o(c["text/plain"]||n.innerText(e)):r(e))):void(f||i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."))},0))}),i.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",i.selection.getContent())}catch(t){}}),i.on("drop",function(e){var t=f(e);if(t&&!e.isDefaultPrevented()){var n=c(e.dataTransfer),a=n["mce-internal"]||n["text/html"]||n["text/plain"];a&&(e.preventDefault(),i.undoManager.transact(function(){n["mce-internal"]&&i.execCommand("Delete"),i.selection.setRng(t),n["text/html"]?r(a):o(a)}))}})}var g=this,h,v,b=0,y="%MCEPASTEBIN%",x;g.pasteHtml=r,g.pasteText=o,i.on("preInit",function(){p(),i.parser.addNodeFilter("img",function(t){if(!i.settings.paste_data_images)for(var n=t.length;n--;){var r=t[n].attributes.map.src;r&&0===r.indexOf("data:image")&&(t[n].attr("data-mce-object")||r===e.transparentSrc||t[n].remove())}})}),i.on("PreProcess",function(){i.dom.remove(i.dom.get("mcepastebin"))})}}),i(g,[c,d,u,h,v,l],function(e,t,n,i,r,o){function a(e){return/l?n&&(n=n.parent.parent):(i=n,n=null)),n&&n.name==a?n.append(e):(i=i||n,n=new r(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>o&&i&&i.lastChild.append(n),o=l}for(var n,i,o=1,a=e.getAll("p"),s=0;s/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var g=l.paste_word_valid_elements;g||(g="-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,del");var h=new n({valid_elements:g,valid_children:"-li[p]"});e.each(h.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var v=new t({},h);v.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",u(n,n.attr("style"))),"span"==n.name&&n.parent&&!n.attributes.length&&n.unwrap()}),v.addAttributeFilter("class",function(e){for(var t=e.length,n,i;t--;)n=e[t],i=n.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(i)&&n.remove(),n.attr("class",null)}),v.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),v.addNodeFilter("a",function(e){for(var t=e.length,n,i,r;t--;)if(n=e[t],i=n.attr("href"),r=n.attr("name"),i&&-1!=i.indexOf("#_msocom_"))n.remove();else if(i&&0===i.indexOf("file://")&&(i=i.split("#")[1],i&&(i="#"+i)),i||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){n.unwrap();continue}n.attr({href:i,name:r})}else n.unwrap()});var b=v.parse(f);d(b),c.content=new i({},h).serialize(b)}})}return s.isWordContent=a,s}),i(b,[m,c,g,l],function(e,t,n,i){return function(r){function o(e){r.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function a(e){return e=i.filter(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/|/g,[/\u00a0<\/span>/g,"\xa0"],/
    $/i])}function s(e){if(!n.isWordContent(e))return e;var o=[];t.each(r.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:
     [\\s\\r\\n]+|
    )*(<\\/?("+o.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g");return e=i.filter(e,[[a,"$1"]]),e=i.filter(e,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}function l(e){if(n.isWordContent(e))return e;var t=r.settings.paste_webkit_styles;if(r.settings.paste_remove_styles_if_webkit===!1||"all"==t)return e;if(t&&(t=t.split(/[, ]/)),t){var i=r.dom,o=r.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,n,r,a){var s=i.parseStyle(r,"span"),l={};if("none"===t)return n+a;for(var c=0;c]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,i){return t+' style="'+n+'"'+i})}e.webkit&&(o(l),o(a)),e.ie&&o(s)}}),i(y,[x,f,g,b],function(e,t,n,i){var r;e.add("paste",function(e){function o(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),r||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),r=!0))}var a=this,s,l=e.settings;a.clipboard=s=new t(e),a.quirks=new i(e),a.wordFilter=new n(e),e.settings.paste_as_text&&(a.clipboard.pasteFormat="text"),l.paste_preprocess&&e.on("PastePreProcess",function(e){l.paste_preprocess.call(a,a,e)}),l.paste_postprocess&&e.on("PastePostProcess",function(e){l.paste_postprocess.call(a,a,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&a.clipboard.pasteHtml(t.content),t.text&&a.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:o,active:"text"==a.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:o})})}),a([l,f,g,b,y])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(f){"use strict";function t(){}function i(t){return function(){return t}}function e(){return v}var n,d=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return d(e())}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!r.get("powerpaste"))&&("undefined"!=typeof f.window.console&&f.window.console.log&&f.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)},a=function(t,e){return{clipboard:t,quirks:e}},s=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},c=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},o=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},m=function(t,e){return t.fire("paste",{ieFake:e})},l=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),o(t,!1)):(e.pasteFormat.set("text"),o(t,!0)),t.focus()},p=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){l(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},g=i(!1),h=i(!0),v=(n={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:w,getOrThunk:b,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:w,orThunk:b,map:e,each:t,bind:e,exists:g,forall:h,filter:e,equals:y,equals_:y,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(n),n);function y(t){return t.isNone()}function b(t){return t()}function w(t){return t}function x(t,e){for(var n=t.length,r=new Array(n),o=0;o=i.length&&n(r)}}(e))})})}function L(t,e){return function(t){return M(t,z)}(x(t,e))}function N(t){return t.replace(/\r?\n/g,"
    ")}function B(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+et.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="",u=q.map(r,function(t){return t.split(/\n/).join("
    ")});return 1===u.length?u[0]:q.map(u,function(t){return o+t+i}).join("")}var H=A.exports.boltExport,$=function(t){var n=S.none(),e=[],r=function(t){o()?u(t):e.push(t)},o=function(){return n.isSome()},i=function(t){_(t,u)},u=function(e){n.each(function(t){f.setTimeout(function(){e(t)},0)})};return t(function(t){n=S.some(t),i(e),e=[]}),{get:r,map:function(n){return $(function(e){r(function(t){e(n(t))})})},isReady:o}},W={nu:$,pure:function(e){return $(function(t){t(e)})}},U=function(n){function t(t){n().then(t,j)}return{map:function(t){return U(function(){return n().then(t)})},bind:function(e){return U(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return U(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return W.nu(t)},toCached:function(){var t=null;return U(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},z=function(t){return U(function(){return new H(t)})},V=tinymce.util.Tools.resolve("tinymce.Env"),K=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.util.VK"),X="x-tinymce/html",Y="\x3c!-- "+X+" --\x3e",Z=function(t){return Y+t},J=function(t){return t.replace(Y,"")},Q=function(t){return-1!==t.indexOf(Y)},tt=function(){return X},et=tinymce.util.Tools.resolve("tinymce.html.Entities"),nt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},rt=function(t,e,n){return e?B(t,!0===e?"p":e,n):N(t)},ot=tinymce.util.Tools.resolve("tinymce.html.DomParser"),it=tinymce.util.Tools.resolve("tinymce.html.Serializer"),ut=tinymce.util.Tools.resolve("tinymce.html.Node"),at=tinymce.util.Tools.resolve("tinymce.html.Schema"),st={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function ct(e,t){return q.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var lt={filter:ct,innerText:function se(t){var e=at(),n=ot({},e),r="",o=e.getShortEndedElements(),i=q.makeMap("script noscript style textarea video audio iframe object"," "),u=e.getBlockElements();return t=ct(t,[//g]),function a(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;a(t),t=t.next;);u[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function ce(t){return t=ct(t,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/
    /g,/
    $/i])},createIdGenerator:function le(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==f.navigator.userAgent.indexOf(" Edge/")}};function ft(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),q.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function dt(t){var i,u,a=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||a;r!==a&&(i=r')}),!0}(t,e,n)}function xt(t){return"\n"===t||"\r"===t}function _t(n){return function(t,e,n){return _(t,function(t){n=e(n,t)}),n}(n,function(t,e){return function(t){return-1!==" \f\t\x0B".indexOf(t)}(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===n.length-1||function(t,e){return e',!1)}else Tt(t,'',!1)}(e,t)})}),!0}return!1}function Et(t){return G.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode}function It(a,s,i){var u,c=function(){var e=d(S.none());return{clear:function(){e.set(S.none())},set:function(t){e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}}}();function l(t,e,n,r){var o,i,u;kt(t,"text/html")?o=t["text/html"]:(o=s.getHtml(),r=r||Q(o),s.isDefaultContent(o)&&(n=!0)),o=lt.trimHtml(o),s.remove(),i=!1===r&&nt(o),u=Kt(o),o.length&&(!i||u)||(n=!0),(n||u)&&(o=kt(t,"text/plain")&&i?t["text/plain"]:lt.innerText(o)),s.isDefaultContent(o)?e||a.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?Dt(a,o):Tt(a,o,r)}a.on("keydown",function(t){function e(t){Et(t)&&!t.isDefaultPrevented()&&s.remove()}if(Et(t)&&!t.isDefaultPrevented()){if((u=t.shiftKey&&86===t.keyCode)&&V.webkit&&-1!==f.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),c.set(t),window.setTimeout(function(){c.clear()},100),V.ie&&u)return t.preventDefault(),void m(a,!0);s.remove(),s.create(),a.once("keyup",e),a.once("paste",function(){a.off("keyup",e)})}}),a.on("paste",function(t){var e=c.isSet(),n=function(t,e){var n=Ct(e.clipboardData||t.getDoc().dataTransfer);return lt.isMsEdge()?q.extend(n,{"text/html":""}):n}(a,t),r="text"===i.get()||u,o=kt(n,tt());u=!1,t.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==f.navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(t)?s.remove():Ft(n)||!St(a,t,s.getLastRng()||a.selection.getRng())?(e||t.preventDefault(),!V.ie||e&&!t.ieFake||kt(n,"text/html")||(s.create(),a.dom.bind(s.getEl(),"paste",function(t){t.stopPropagation()}),a.getDoc().execCommand("Paste",!1,null),n["text/html"]=s.getHtml()),kt(n,"text/html")?(t.preventDefault(),o=o||Q(n["text/html"]),l(n,e,r,o)):K.setEditorTimeout(a,function(){l(n,e,r,o)},0)):s.remove()})}function Rt(t){return V.ie&&t.inline?f.document.body:t.getBody()}function Ot(e,t,n){!function(t){return Rt(t)!==t.getBody()}(e)||e.dom.bind(t,"paste keyup",function(t){Yt(e,n)||e.fire("paste")})}function At(t,e){return e===t}function jt(t){var e=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r,o=t.dom,i=t.getBody();e.set(t.selection.getRng()),r=t.dom.add(Rt(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(V.ie||V.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ot(t,r,n),r.focus(),t.selection.select(r,!0)}(t,e,n)},remove:function(){return function(t,e){if(Xt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Xt(t)},getHtml:function(){return function(n){function e(t,e){t.appendChild(e),n.dom.remove(e,!0)}var r,t,o,i,u;for(t=q.grep(Rt(n).childNodes,function(t){return"mcepastebin"===t.id}),r=t.shift(),q.each(t,function(t){e(r,t)}),o=(i=n.dom.select("div[id=mcepastebin]",r)).length-1;0<=o;o--)u=n.dom.create("div"),r.insertBefore(u,i[o]),e(u,i[o]);return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Yt(t,n)},isDefaultContent:function(t){return At(n,t)}}}function Mt(n,t){var e=jt(n);return n.on("PreInit",function(){return function(u,t,e){var a;It(u,t,e),u.parser.addNodeFilter("img",function(t,e,n){function r(t){t.attr("data-mce-object")||a===V.transparentSrc||t.remove()}var o;if(!u.settings.paste_data_images&&((o=n).data&&!0===o.data.paste))for(var i=t.length;i--;)(a=t[i].attr("src"))&&(0===a.indexOf("webkit-fake-url")?r(t[i]):u.settings.allow_html_data_urls||0!==a.indexOf("data:")||r(t[i]))})}(n,e,t)}),{pasteFormat:t,pasteHtml:function(t,e){return Tt(n,t,e)},pasteText:function(t){return Dt(n,t)},pasteImageData:function(t,e){return St(n,t,e)},getDataTransferItems:Ct,hasHtmlOrText:Ft,hasContentType:kt}}function Lt(t,e,n){if(!function(t){return!1===V.iOS&&t!==undefined&&"function"==typeof t.setData&&!0!==lt.isMsEdge()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(tt(),e),!0}catch(r){return!1}}function Nt(t,e,n,r){Lt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)}function Bt(a){return function(t,e){var n=Z(t),r=a.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=a.dom.create("div",{contenteditable:"true"},n);a.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),a.dom.add(a.getBody(),r);var i=a.selection.getRng();o.focus();var u=a.dom.createRng();u.selectNodeContents(o),a.selection.setRng(u),K.setTimeout(function(){a.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}}function Ht(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}}function $t(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)}function Wt(t,e){return Jt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())}function Ut(t,e){t.focus(),t.selection.setRng(e)}var zt={preProcess:function(t,e){return st.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=st.getRetainStyleProps(r))&&(o=q.makeMap(e.split(/[, ]/))),t=lt.filter(t,[/
    /gi,/]+id="?docs-internal-[^>]*>/gi,//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(t,e){return 0 [\\s\\r\\n]+|
    )*(<\\/?("+n.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g");return e=lt.filter(e,[[r,"$1"]]),e=lt.filter(e,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}function re(t,e,n,r){if(r||n)return e;var c,o=st.getWebkitStyles(t);if(!1===st.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var u=0;u]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function oe(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}function ie(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());function t(t){return e.setActive(t.state)}return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}}var ue=function(t){V.webkit&&ee(t,re),V.ie&&(ee(t,ne),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,oe))},ae=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ie(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ie(t,e)})};!function de(){r.add("paste",function(t){if(!1===u(t)){var e=d(!1),n=d(st.isPasteAsTextEnabled(t)?"text":"html"),r=Mt(t,n),o=ue(t);return ae(t,r),p(t,r),te(t),Zt(t),Qt(t,r,e),a(r,o)}})}()}(window); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.js index 0c11d8e..cf217ac 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.js @@ -1,88 +1,126 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ +(function () { + 'use strict'; -/*global tinymce:true */ - -tinymce.PluginManager.add('preview', function(editor) { - var settings = editor.settings, sandbox = !tinymce.Env.ie; + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - editor.addCommand('mcePreview', function() { - editor.windowManager.open({ - title: 'Preview', - width : parseInt(editor.getParam("plugin_preview_width", "650"), 10), - height : parseInt(editor.getParam("plugin_preview_height", "500"), 10), - html: '', - buttons: { - text: 'Close', - onclick: function() { - this.parent().parent().close(); - } - }, - onPostRender: function() { - var previewHtml, headHtml = ''; + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - headHtml += ''; + var getPreviewDialogWidth = function (editor) { + return parseInt(editor.getParam('plugin_preview_width', '650'), 10); + }; + var getPreviewDialogHeight = function (editor) { + return parseInt(editor.getParam('plugin_preview_height', '500'), 10); + }; + var getContentStyle = function (editor) { + return editor.getParam('content_style', ''); + }; + var shouldUseContentCssCors = function (editor) { + return editor.getParam('content_css_cors', false, 'boolean'); + }; + var Settings = { + getPreviewDialogWidth: getPreviewDialogWidth, + getPreviewDialogHeight: getPreviewDialogHeight, + getContentStyle: getContentStyle, + shouldUseContentCssCors: shouldUseContentCssCors + }; - tinymce.each(editor.contentCSS, function(url) { - headHtml += ''; - }); + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); - var bodyId = settings.body_id || 'tinymce'; - if (bodyId.indexOf('=') != -1) { - bodyId = editor.getParam('body_id', '', 'hash'); - bodyId = bodyId[editor.id] || bodyId; - } + var getPreviewHtml = function (editor) { + var headHtml = ''; + var encode = editor.dom.encode; + var contentStyle = Settings.getContentStyle(editor); + headHtml += ''; + if (contentStyle) { + headHtml += ''; + } + var cors = Settings.shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; + global$1.each(editor.contentCSS, function (url) { + headHtml += ''; + }); + var bodyId = editor.settings.body_id || 'tinymce'; + if (bodyId.indexOf('=') !== -1) { + bodyId = editor.getParam('body_id', '', 'hash'); + bodyId = bodyId[editor.id] || bodyId; + } + var bodyClass = editor.settings.body_class || ''; + if (bodyClass.indexOf('=') !== -1) { + bodyClass = editor.getParam('body_class', '', 'hash'); + bodyClass = bodyClass[editor.id] || ''; + } + var isMetaKeyPressed = global$2.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; + var preventClicksOnLinksScript = ' '; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + var previewHtml = '' + '' + '' + headHtml + '' + '' + editor.getContent() + preventClicksOnLinksScript + '' + ''; + return previewHtml; + }; + var IframeContent = { getPreviewHtml: getPreviewHtml }; - var bodyClass = settings.body_class || ''; - if (bodyClass.indexOf('=') != -1) { - bodyClass = editor.getParam('body_class', '', 'hash'); - bodyClass = bodyClass[editor.id] || ''; - } + var open = function (editor) { + var content = IframeContent.getPreviewHtml(editor); + var dataApi = editor.windowManager.open({ + title: 'Preview', + size: 'large', + body: { + type: 'panel', + items: [{ + name: 'preview', + type: 'iframe', + sandboxed: true + }] + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: { preview: content } + }); + dataApi.focus('close'); + }; - var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : ''; + var register = function (editor) { + editor.addCommand('mcePreview', function () { + open(editor); + }); + }; + var Commands = { register: register }; - previewHtml = ( - '' + - '' + - '' + - headHtml + - '' + - '' + - editor.getContent() + - '' + - '' - ); + var register$1 = function (editor) { + editor.ui.registry.addButton('preview', { + icon: 'preview', + tooltip: 'Preview', + onAction: function () { + return editor.execCommand('mcePreview'); + } + }); + editor.ui.registry.addMenuItem('preview', { + icon: 'preview', + text: 'Preview', + onAction: function () { + return editor.execCommand('mcePreview'); + } + }); + }; + var Buttons = { register: register$1 }; - if (!sandbox) { - // IE 6-11 doesn't support data uris on iframes - // so I guess they will have to be less secure since we can't sandbox on those - // TODO: Use sandbox if future versions of IE supports iframes with data: uris. - var doc = this.getEl('body').firstChild.contentWindow.document; - doc.open(); - doc.write(previewHtml); - doc.close(); - } else { - this.getEl('body').firstChild.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml); - } - } - }); - }); + function Plugin () { + global.add('preview', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } - editor.addButton('preview', { - title : 'Preview', - cmd : 'mcePreview' - }); + Plugin(); - editor.addMenuItem('preview', { - text : 'Preview', - cmd : 'mcePreview', - context: 'view' - }); -}); +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.min.js index 23e70ac..08c128b 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/preview/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("preview",function(e){var t=e.settings,i=!tinymce.Env.ie;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var n,a="";a+='',tinymce.each(e.contentCSS,function(t){a+=''});var r=t.body_id||"tinymce";-1!=r.indexOf("=")&&(r=e.getParam("body_id","","hash"),r=r[e.id]||r);var d=t.body_class||"";-1!=d.indexOf("=")&&(d=e.getParam("body_class","","hash"),d=d[e.id]||"");var o=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";if(n=""+a+'"+e.getContent()+"",i)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(n);else{var s=this.getEl("body").firstChild.contentWindow.document;s.open(),s.write(n),s.close()}}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e){return e.getParam("content_style","")},u=function(e){return e.getParam("content_css_cors",!1,"boolean")},y=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t){var n="",i=t.dom.encode,e=m(t);n+='',e&&(n+='");var o=u(t)?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/spellcheckerplugin/Plugin"]); - - load('classes/DomTextMatcher.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: 7c17a2f321b878b87575f7aec8b6916c \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.js index b595cc7..6f9dcf4 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.js @@ -1,935 +1,825 @@ /** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js - -/** - * DomTextMatcher.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint no-labels:0, no-constant-condition: 0 */ - -/** - * This class logic for filtering text and matching words. - * - * @class tinymce.spellcheckerplugin.TextFilter - * @private - */ -define("tinymce/spellcheckerplugin/DomTextMatcher", [], function() { - // Based on work developed by: James Padolsey http://james.padolsey.com - // released under UNLICENSE that is compatible with LGPL - // TODO: Handle contentEditable edgecase: - //

    texttexttexttexttext

    - return function(node, editor) { - var m, matches = [], text, dom = editor.dom; - var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap; - - blockElementsMap = editor.schema.getBlockElements(); // H1-H6, P, TD etc - hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT - shortEndedElementsMap = editor.schema.getShortEndedElements(); // BR, IMG, INPUT - - function createMatch(m, data) { - if (!m[0]) { - throw 'findAndReplaceDOMText cannot handle zero-length matches'; - } - - return { - start: m.index, - end: m.index + m[0].length, - text: m[0], - data: data - }; - } - - function getText(node) { - var txt; - - if (node.nodeType === 3) { - return node.data; - } - - if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) { - return ''; - } - - txt = ''; - - if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) { - txt += '\n'; - } - - if ((node = node.firstChild)) { - do { - txt += getText(node); - } while ((node = node.nextSibling)); - } - - return txt; - } - - function stepThroughMatches(node, matches, replaceFn) { - var startNode, endNode, startNodeIndex, - endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, - matchLocation, matchIndex = 0; - - matches = matches.slice(0); - matches.sort(function(a, b) { - return a.start - b.start; - }); - - matchLocation = matches.shift(); - - out: while (true) { - if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) { - atIndex++; - } - - if (curNode.nodeType === 3) { - if (!endNode && curNode.length + atIndex >= matchLocation.end) { - // We've found the ending - endNode = curNode; - endNodeIndex = matchLocation.end - atIndex; - } else if (startNode) { - // Intersecting node - innerNodes.push(curNode); - } - - if (!startNode && curNode.length + atIndex > matchLocation.start) { - // We've found the match start - startNode = curNode; - startNodeIndex = matchLocation.start - atIndex; - } - - atIndex += curNode.length; - } - - if (startNode && endNode) { - curNode = replaceFn({ - startNode: startNode, - startNodeIndex: startNodeIndex, - endNode: endNode, - endNodeIndex: endNodeIndex, - innerNodes: innerNodes, - match: matchLocation.text, - matchIndex: matchIndex - }); - - // replaceFn has to return the node that replaced the endNode - // and then we step back so we can continue from the end of the - // match: - atIndex -= (endNode.length - endNodeIndex); - startNode = null; - endNode = null; - innerNodes = []; - matchLocation = matches.shift(); - matchIndex++; - - if (!matchLocation) { - break; // no more matches - } - } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) { - // Move down - curNode = curNode.firstChild; - continue; - } else if (curNode.nextSibling) { - // Move forward: - curNode = curNode.nextSibling; - continue; - } - - // Move forward or up: - while (true) { - if (curNode.nextSibling) { - curNode = curNode.nextSibling; - break; - } else if (curNode.parentNode !== node) { - curNode = curNode.parentNode; - } else { - break out; - } - } - } - } - - /** - * Generates the actual replaceFn which splits up text nodes - * and inserts the replacement element. - */ - function genReplacer(callback) { - function makeReplacementNode(fill, matchIndex) { - var match = matches[matchIndex]; - - if (!match.stencil) { - match.stencil = callback(match); - } - - var clone = match.stencil.cloneNode(false); - clone.setAttribute('data-mce-index', matchIndex); - - if (fill) { - clone.appendChild(dom.doc.createTextNode(fill)); - } - - return clone; - } - - return function(range) { - var before, after, parentNode, startNode = range.startNode, - endNode = range.endNode, matchIndex = range.matchIndex, - doc = dom.doc; - - if (startNode === endNode) { - var node = startNode; - - parentNode = node.parentNode; - if (range.startNodeIndex > 0) { - // Add "before" text node (before the match) - before = doc.createTextNode(node.data.substring(0, range.startNodeIndex)); - parentNode.insertBefore(before, node); - } - - // Create the replacement node: - var el = makeReplacementNode(range.match, matchIndex); - parentNode.insertBefore(el, node); - if (range.endNodeIndex < node.length) { - // Add "after" text node (after the match) - after = doc.createTextNode(node.data.substring(range.endNodeIndex)); - parentNode.insertBefore(after, node); - } - - node.parentNode.removeChild(node); - - return el; - } else { - // Replace startNode -> [innerNodes...] -> endNode (in that order) - before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex)); - after = doc.createTextNode(endNode.data.substring(range.endNodeIndex)); - var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex); - var innerEls = []; - - for (var i = 0, l = range.innerNodes.length; i < l; ++i) { - var innerNode = range.innerNodes[i]; - var innerEl = makeReplacementNode(innerNode.data, matchIndex); - innerNode.parentNode.replaceChild(innerEl, innerNode); - innerEls.push(innerEl); - } - - var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex); - - parentNode = startNode.parentNode; - parentNode.insertBefore(before, startNode); - parentNode.insertBefore(elA, startNode); - parentNode.removeChild(startNode); - - parentNode = endNode.parentNode; - parentNode.insertBefore(elB, endNode); - parentNode.insertBefore(after, endNode); - parentNode.removeChild(endNode); - - return elB; - } - }; - } - - function unwrapElement(element) { - var parentNode = element.parentNode; - parentNode.insertBefore(element.firstChild, element); - element.parentNode.removeChild(element); - } - - function getWrappersByIndex(index) { - var elements = node.getElementsByTagName('*'), wrappers = []; - - index = typeof(index) == "number" ? "" + index : null; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i], dataIndex = element.getAttribute('data-mce-index'); - - if (dataIndex !== null && dataIndex.length) { - if (dataIndex === index || index === null) { - wrappers.push(element); - } - } - } - - return wrappers; - } - - /** - * Returns the index of a specific match object or -1 if it isn't found. - * - * @param {Match} match Text match object. - * @return {Number} Index of match or -1 if it isn't found. - */ - function indexOf(match) { - var i = matches.length; - while (i--) { - if (matches[i] === match) { - return i; - } - } - - return -1; - } - - /** - * Filters the matches. If the callback returns true it stays if not it gets removed. - * - * @param {Function} callback Callback to execute for each match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function filter(callback) { - var filteredMatches = []; - - each(function(match, i) { - if (callback(match, i)) { - filteredMatches.push(match); - } - }); - - matches = filteredMatches; - - /*jshint validthis:true*/ - return this; - } - - /** - * Executes the specified callback for each match. - * - * @param {Function} callback Callback to execute for each match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function each(callback) { - for (var i = 0, l = matches.length; i < l; i++) { - if (callback(matches[i], i) === false) { - break; - } - } - - /*jshint validthis:true*/ - return this; - } - - /** - * Wraps the current matches with nodes created by the specified callback. - * Multiple clones of these matches might occur on matches that are on multiple nodex. - * - * @param {Function} callback Callback to execute in order to create elements for matches. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function wrap(callback) { - if (matches.length) { - stepThroughMatches(node, matches, genReplacer(callback)); - } - - /*jshint validthis:true*/ - return this; - } - - /** - * Finds the specified regexp and adds them to the matches collection. - * - * @param {RegExp} regex Global regexp to search the current node by. - * @param {Object} [data] Optional custom data element for the match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function find(regex, data) { - if (text && regex.global) { - while ((m = regex.exec(text))) { - matches.push(createMatch(m, data)); - } - } - - return this; - } - - /** - * Unwraps the specified match object or all matches if unspecified. - * - * @param {Object} [match] Optional match object. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function unwrap(match) { - var i, elements = getWrappersByIndex(match ? indexOf(match) : null); - - i = elements.length; - while (i--) { - unwrapElement(elements[i]); - } - - return this; - } - - /** - * Returns a match object by the specified DOM element. - * - * @param {DOMElement} element Element to return match object for. - * @return {Object} Match object for the specified element. - */ - function matchFromElement(element) { - return matches[element.getAttribute('data-mce-index')]; - } - - /** - * Returns a DOM element from the specified match element. This will be the first element if it's split - * on multiple nodes. - * - * @param {Object} match Match element to get first element of. - * @return {DOMElement} DOM element for the specified match object. - */ - function elementFromMatch(match) { - return getWrappersByIndex(indexOf(match))[0]; - } - - /** - * Adds match the specified range for example a grammar line. - * - * @param {Number} start Start offset. - * @param {Number} length Length of the text. - * @param {Object} data Custom data object for match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function add(start, length, data) { - matches.push({ - start: start, - end: start + length, - text: text.substr(start, length), - data: data - }); - - return this; - } - - /** - * Returns a DOM range for the specified match. - * - * @param {Object} match Match object to get range for. - * @return {DOMRange} DOM Range for the specified match. - */ - function rangeFromMatch(match) { - var wrappers = getWrappersByIndex(indexOf(match)); - - var rng = editor.dom.createRng(); - rng.setStartBefore(wrappers[0]); - rng.setEndAfter(wrappers[wrappers.length - 1]); - - return rng; - } - - /** - * Replaces the specified match with the specified text. - * - * @param {Object} match Match object to replace. - * @param {String} text Text to replace the match with. - * @return {DOMRange} DOM range produced after the replace. - */ - function replace(match, text) { - var rng = rangeFromMatch(match); - - rng.deleteContents(); - - if (text.length > 0) { - rng.insertNode(editor.dom.doc.createTextNode(text)); - } - - return rng; - } - - /** - * Resets the DomTextMatcher instance. This will remove any wrapped nodes and remove any matches. - * - * @return {[type]} [description] - */ - function reset() { - matches.splice(0, matches.length); - unwrap(); - - return this; - } - - text = getText(node); - - return { - text: text, - matches: matches, - each: each, - filter: filter, - reset: reset, - matchFromElement: matchFromElement, - elementFromMatch: elementFromMatch, - find: find, - add: add, - wrap: wrap, - unwrap: unwrap, - replace: replace, - rangeFromMatch: rangeFromMatch, - indexOf: indexOf - }; - }; -}); - -// Included from: js/tinymce/plugins/spellchecker/classes/Plugin.js - -/** - * Plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ - -/*jshint camelcase:false */ - -/** - * This class contains all core logic for the spellchecker plugin. - * - * @class tinymce.spellcheckerplugin.Plugin - * @private - */ -define("tinymce/spellcheckerplugin/Plugin", [ - "tinymce/spellcheckerplugin/DomTextMatcher", - "tinymce/PluginManager", - "tinymce/util/Tools", - "tinymce/ui/Menu", - "tinymce/dom/DOMUtils", - "tinymce/util/XHR", - "tinymce/util/URI", - "tinymce/util/JSON" -], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, XHR, URI, JSON) { - PluginManager.add('spellchecker', function(editor, url) { - var languageMenuItems, self = this, lastSuggestions, started, suggestionsMenu, settings = editor.settings; - - function getTextMatcher() { - if (!self.textMatcher) { - self.textMatcher = new DomTextMatcher(editor.getBody(), editor); - } - - return self.textMatcher; - } - - function buildMenuItems(listName, languageValues) { - var items = []; - - Tools.each(languageValues, function(languageValue) { - items.push({ - selectable: true, - text: languageValue.name, - data: languageValue.value - }); - }); - - return items; - } - - var languagesString = settings.spellchecker_languages || - 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,' + - 'German=de,Italian=it,Polish=pl,Portuguese=pt_BR,' + - 'Spanish=es,Swedish=sv'; - - languageMenuItems = buildMenuItems('Language', - Tools.map(languagesString.split(','), - function(lang_pair) { - var lang = lang_pair.split('='); - - return { - name: lang[0], - value: lang[1] - }; - } - ) - ); - - function isEmpty(obj) { - /*jshint unused:false*/ - /*eslint no-unused-vars:0 */ - for (var name in obj) { - return false; - } - - return true; - } - - function showSuggestions(word, spans) { - var items = [], suggestions = lastSuggestions[word]; - - Tools.each(suggestions, function(suggestion) { - items.push({ - text: suggestion, - onclick: function() { - editor.insertContent(editor.dom.encode(suggestion)); - editor.dom.remove(spans); - checkIfFinished(); - } - }); - }); - - items.push.apply(items, [ - {text: '-'}, - - {text: 'Ignore', onclick: function() { - ignoreWord(word, spans); - }}, - - {text: 'Ignore all', onclick: function() { - ignoreWord(word, spans, true); - }}, - - {text: 'Finish', onclick: finish} - ]); - - // Render menu - suggestionsMenu = new Menu({ - items: items, - context: 'contextmenu', - onautohide: function(e) { - if (e.target.className.indexOf('spellchecker') != -1) { - e.preventDefault(); - } - }, - onhide: function() { - suggestionsMenu.remove(); - suggestionsMenu = null; - } - }); - - suggestionsMenu.renderTo(document.body); - - // Position menu - var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer()); - var targetPos = editor.dom.getPos(spans[0]); - var root = editor.dom.getRoot(); - - // Adjust targetPos for scrolling in the editor - if (root.nodeName == 'BODY') { - targetPos.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft; - targetPos.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop; - } else { - targetPos.x -= root.scrollLeft; - targetPos.y -= root.scrollTop; - } - - pos.x += targetPos.x; - pos.y += targetPos.y; - - suggestionsMenu.moveTo(pos.x, pos.y + spans[0].offsetHeight); - } - - function getWordCharPattern() { - // Regexp for finding word specific characters this will split words by - // spaces, quotes, copy right characters etc. It's escaped with unicode characters - // to make it easier to output scripts on servers using different encodings - // so if you add any characters outside the 128 byte range make sure to escape it - return editor.getParam('spellchecker_wordchar_pattern') || new RegExp("[^" + - "\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" + - "\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" + - "\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e" + - "]+", "g"); - } - - function spellcheck() { - if (started) { - finish(); - return; - } else { - finish(); - } - - started = true; - - function doneCallback(suggestions) { - editor.setProgressState(false); - - if (isEmpty(suggestions)) { - editor.windowManager.alert('No misspellings found'); - started = false; - return; - } - - lastSuggestions = suggestions; - - getTextMatcher().find(getWordCharPattern()).filter(function(match) { - return !!suggestions[match.text]; - }).wrap(function(match) { - return editor.dom.create('span', { - "class": 'mce-spellchecker-word', - "data-mce-bogus": 1, - "data-mce-word": match.text - }); - }); - - editor.fire('SpellcheckStart'); - } - - function errorCallback(message) { - editor.windowManager.alert(message); - editor.setProgressState(false); - finish(); - } - - function defaultSpellcheckCallback(method, text, doneCallback) { - XHR.send({ - url: new URI(url).toAbsolute(settings.spellchecker_rpc_url), - type: "post", - content_type: 'application/x-www-form-urlencoded', - data: "text=" + encodeURIComponent(text) + "&lang=" + settings.spellchecker_language, - success: function(result) { - result = JSON.parse(result); - - if (!result) { - errorCallback("Sever response wasn't proper JSON."); - } else if (result.error) { - errorCallback(result.error); - } else { - doneCallback(result.words); - } - }, - error: function(type, xhr) { - errorCallback("Spellchecker request error: " + xhr.status); - } - }); - } - - editor.setProgressState(true); - - var spellCheckCallback = settings.spellchecker_callback || defaultSpellcheckCallback; - spellCheckCallback.call(self, "spellcheck", getTextMatcher().text, doneCallback, errorCallback); - - editor.focus(); - } - - function checkIfFinished() { - if (!editor.dom.select('span.mce-spellchecker-word').length) { - finish(); - } - } - - function ignoreWord(word, spans, all) { - editor.selection.collapse(); - - if (all) { - Tools.each(editor.dom.select('span.mce-spellchecker-word'), function(span) { - if (span.getAttribute('data-mce-word') == word) { - editor.dom.remove(span, true); - } - }); - } else { - editor.dom.remove(spans, true); - } - - checkIfFinished(); - } - - function finish() { - getTextMatcher().reset(); - self.textMatcher = null; - - if (started) { - started = false; - editor.fire('SpellcheckEnd'); - } - } - - function getElmIndex(elm) { - var value = elm.getAttribute('data-mce-index'); - - if (typeof(value) == "number") { - return "" + value; - } - - return value; - } - - function findSpansByIndex(index) { - var nodes, spans = []; - - nodes = Tools.toArray(editor.getBody().getElementsByTagName('span')); - if (nodes.length) { - for (var i = 0; i < nodes.length; i++) { - var nodeIndex = getElmIndex(nodes[i]); - - if (nodeIndex === null || !nodeIndex.length) { - continue; - } - - if (nodeIndex === index.toString()) { - spans.push(nodes[i]); - } - } - } - - return spans; - } - - editor.on('click', function(e) { - var target = e.target; - - if (target.className == "mce-spellchecker-word") { - e.preventDefault(); - - var spans = findSpansByIndex(getElmIndex(target)); - - if (spans.length > 0) { - var rng = editor.dom.createRng(); - rng.setStartBefore(spans[0]); - rng.setEndAfter(spans[spans.length - 1]); - editor.selection.setRng(rng); - showSuggestions(target.getAttribute('data-mce-word'), spans); - } - } - }); - - editor.addMenuItem('spellchecker', { - text: 'Spellcheck', - context: 'tools', - onclick: spellcheck, - selectable: true, - onPostRender: function() { - var self = this; - - editor.on('SpellcheckStart SpellcheckEnd', function() { - self.active(started); - }); - } - }); - - function updateSelection(e) { - var selectedLanguage = settings.spellchecker_language; - - e.control.items().each(function(ctrl) { - ctrl.active(ctrl.settings.data === selectedLanguage); - }); - } - - var buttonArgs = { - tooltip: 'Spellcheck', - onclick: spellcheck, - onPostRender: function() { - var self = this; - - editor.on('SpellcheckStart SpellcheckEnd', function() { - self.active(started); - }); - } - }; - - if (languageMenuItems.length > 1) { - buttonArgs.type = 'splitbutton'; - buttonArgs.menu = languageMenuItems; - buttonArgs.onshow = updateSelection; - buttonArgs.onselect = function(e) { - settings.spellchecker_language = e.control.settings.data; - }; - } - - editor.addButton('spellchecker', buttonArgs); - editor.addCommand('mceSpellCheck', spellcheck); - - editor.on('remove', function() { - if (suggestionsMenu) { - suggestionsMenu.remove(); - suggestionsMenu = null; - } - }); - - editor.on('change', checkIfFinished); - - this.getTextMatcher = getTextMatcher; - this.getWordCharPattern = getWordCharPattern; - this.getLanguage = function() { - return settings.spellchecker_language; - }; - - // Set default spellchecker language if it's not specified - settings.spellchecker_language = settings.spellchecker_language || settings.language || 'en'; - }); -}); - -expose(["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/spellcheckerplugin/Plugin"]); -})(this); \ No newline at end of file +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var hasProPlugin = function (editor) { + if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.settings.plugins) && global.get('tinymcespellchecker')) { + if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) { + domGlobals.window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.'); + } + return true; + } else { + return false; + } + }; + var DetectProPlugin = { hasProPlugin: hasProPlugin }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var fireSpellcheckStart = function (editor) { + return editor.fire('SpellcheckStart'); + }; + var fireSpellcheckEnd = function (editor) { + return editor.fire('SpellcheckEnd'); + }; + var Events = { + fireSpellcheckStart: fireSpellcheckStart, + fireSpellcheckEnd: fireSpellcheckEnd + }; + + var getLanguages = function (editor) { + var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv'; + return editor.getParam('spellchecker_languages', defaultLanguages); + }; + var getLanguage = function (editor) { + var defaultLanguage = editor.getParam('language', 'en'); + return editor.getParam('spellchecker_language', defaultLanguage); + }; + var getRpcUrl = function (editor) { + return editor.getParam('spellchecker_rpc_url'); + }; + var getSpellcheckerCallback = function (editor) { + return editor.getParam('spellchecker_callback'); + }; + var getSpellcheckerWordcharPattern = function (editor) { + var defaultPattern = new RegExp('[^' + '\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' + '\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB' + '\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201D\u201C\u201E\xA0\u2002\u2003\u2009' + ']+', 'g'); + return editor.getParam('spellchecker_wordchar_pattern', defaultPattern); + }; + var Settings = { + getLanguages: getLanguages, + getLanguage: getLanguage, + getRpcUrl: getRpcUrl, + getSpellcheckerCallback: getSpellcheckerCallback, + getSpellcheckerWordcharPattern: getSpellcheckerWordcharPattern + }; + + function isContentEditableFalse(node) { + return node && node.nodeType === 1 && node.contentEditable === 'false'; + } + var DomTextMatcher = function (node, editor) { + var m, matches = [], text; + var dom = editor.dom; + var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap; + blockElementsMap = editor.schema.getBlockElements(); + hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); + shortEndedElementsMap = editor.schema.getShortEndedElements(); + function createMatch(m, data) { + if (!m[0]) { + throw new Error('findAndReplaceDOMText cannot handle zero-length matches'); + } + return { + start: m.index, + end: m.index + m[0].length, + text: m[0], + data: data + }; + } + function getText(node) { + var txt; + if (node.nodeType === 3) { + return node.data; + } + if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) { + return ''; + } + if (isContentEditableFalse(node)) { + return '\n'; + } + txt = ''; + if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) { + txt += '\n'; + } + if (node = node.firstChild) { + do { + txt += getText(node); + } while (node = node.nextSibling); + } + return txt; + } + function stepThroughMatches(node, matches, replaceFn) { + var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, matchLocation, matchIndex = 0; + matches = matches.slice(0); + matches.sort(function (a, b) { + return a.start - b.start; + }); + matchLocation = matches.shift(); + out: + while (true) { + if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) { + atIndex++; + } + if (curNode.nodeType === 3) { + if (!endNode && curNode.length + atIndex >= matchLocation.end) { + endNode = curNode; + endNodeIndex = matchLocation.end - atIndex; + } else if (startNode) { + innerNodes.push(curNode); + } + if (!startNode && curNode.length + atIndex > matchLocation.start) { + startNode = curNode; + startNodeIndex = matchLocation.start - atIndex; + } + atIndex += curNode.length; + } + if (startNode && endNode) { + curNode = replaceFn({ + startNode: startNode, + startNodeIndex: startNodeIndex, + endNode: endNode, + endNodeIndex: endNodeIndex, + innerNodes: innerNodes, + match: matchLocation.text, + matchIndex: matchIndex + }); + atIndex -= endNode.length - endNodeIndex; + startNode = null; + endNode = null; + innerNodes = []; + matchLocation = matches.shift(); + matchIndex++; + if (!matchLocation) { + break; + } + } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) { + if (!isContentEditableFalse(curNode)) { + curNode = curNode.firstChild; + continue; + } + } else if (curNode.nextSibling) { + curNode = curNode.nextSibling; + continue; + } + while (true) { + if (curNode.nextSibling) { + curNode = curNode.nextSibling; + break; + } else if (curNode.parentNode !== node) { + curNode = curNode.parentNode; + } else { + break out; + } + } + } + } + function genReplacer(callback) { + function makeReplacementNode(fill, matchIndex) { + var match = matches[matchIndex]; + if (!match.stencil) { + match.stencil = callback(match); + } + var clone = match.stencil.cloneNode(false); + clone.setAttribute('data-mce-index', matchIndex); + if (fill) { + clone.appendChild(dom.doc.createTextNode(fill)); + } + return clone; + } + return function (range) { + var before; + var after; + var parentNode; + var startNode = range.startNode; + var endNode = range.endNode; + var matchIndex = range.matchIndex; + var doc = dom.doc; + if (startNode === endNode) { + var node_1 = startNode; + parentNode = node_1.parentNode; + if (range.startNodeIndex > 0) { + before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex)); + parentNode.insertBefore(before, node_1); + } + var el = makeReplacementNode(range.match, matchIndex); + parentNode.insertBefore(el, node_1); + if (range.endNodeIndex < node_1.length) { + after = doc.createTextNode(node_1.data.substring(range.endNodeIndex)); + parentNode.insertBefore(after, node_1); + } + node_1.parentNode.removeChild(node_1); + return el; + } + before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex)); + after = doc.createTextNode(endNode.data.substring(range.endNodeIndex)); + var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex); + for (var i = 0, l = range.innerNodes.length; i < l; ++i) { + var innerNode = range.innerNodes[i]; + var innerEl = makeReplacementNode(innerNode.data, matchIndex); + innerNode.parentNode.replaceChild(innerEl, innerNode); + } + var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex); + parentNode = startNode.parentNode; + parentNode.insertBefore(before, startNode); + parentNode.insertBefore(elA, startNode); + parentNode.removeChild(startNode); + parentNode = endNode.parentNode; + parentNode.insertBefore(elB, endNode); + parentNode.insertBefore(after, endNode); + parentNode.removeChild(endNode); + return elB; + }; + } + function unwrapElement(element) { + var parentNode = element.parentNode; + while (element.childNodes.length > 0) { + parentNode.insertBefore(element.childNodes[0], element); + } + parentNode.removeChild(element); + } + function hasClass(elm) { + return elm.className.indexOf('mce-spellchecker-word') !== -1; + } + function getWrappersByIndex(index) { + var elements = node.getElementsByTagName('*'), wrappers = []; + index = typeof index === 'number' ? '' + index : null; + for (var i = 0; i < elements.length; i++) { + var element = elements[i], dataIndex = element.getAttribute('data-mce-index'); + if (dataIndex !== null && dataIndex.length && hasClass(element)) { + if (dataIndex === index || index === null) { + wrappers.push(element); + } + } + } + return wrappers; + } + function indexOf(match) { + var i = matches.length; + while (i--) { + if (matches[i] === match) { + return i; + } + } + return -1; + } + function filter(callback) { + var filteredMatches = []; + each(function (match, i) { + if (callback(match, i)) { + filteredMatches.push(match); + } + }); + matches = filteredMatches; + return this; + } + function each(callback) { + for (var i = 0, l = matches.length; i < l; i++) { + if (callback(matches[i], i) === false) { + break; + } + } + return this; + } + function wrap(callback) { + if (matches.length) { + stepThroughMatches(node, matches, genReplacer(callback)); + } + return this; + } + function find(regex, data) { + if (text && regex.global) { + while (m = regex.exec(text)) { + matches.push(createMatch(m, data)); + } + } + return this; + } + function unwrap(match) { + var i; + var elements = getWrappersByIndex(match ? indexOf(match) : null); + i = elements.length; + while (i--) { + unwrapElement(elements[i]); + } + return this; + } + function matchFromElement(element) { + return matches[element.getAttribute('data-mce-index')]; + } + function elementFromMatch(match) { + return getWrappersByIndex(indexOf(match))[0]; + } + function add(start, length, data) { + matches.push({ + start: start, + end: start + length, + text: text.substr(start, length), + data: data + }); + return this; + } + function rangeFromMatch(match) { + var wrappers = getWrappersByIndex(indexOf(match)); + var rng = editor.dom.createRng(); + rng.setStartBefore(wrappers[0]); + rng.setEndAfter(wrappers[wrappers.length - 1]); + return rng; + } + function replace(match, text) { + var rng = rangeFromMatch(match); + rng.deleteContents(); + if (text.length > 0) { + rng.insertNode(editor.dom.doc.createTextNode(text)); + } + return rng; + } + function reset() { + matches.splice(0, matches.length); + unwrap(); + return this; + } + text = getText(node); + return { + text: text, + matches: matches, + each: each, + filter: filter, + reset: reset, + matchFromElement: matchFromElement, + elementFromMatch: elementFromMatch, + find: find, + add: add, + wrap: wrap, + unwrap: unwrap, + replace: replace, + rangeFromMatch: rangeFromMatch, + indexOf: indexOf + }; + }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + + var hasOwnProperty = Object.hasOwnProperty; + var isEmpty = function (r) { + for (var x in r) { + if (hasOwnProperty.call(r, x)) { + return false; + } + } + return true; + }; + + var getTextMatcher = function (editor, textMatcherState) { + if (!textMatcherState.get()) { + var textMatcher = DomTextMatcher(editor.getBody(), editor); + textMatcherState.set(textMatcher); + } + return textMatcherState.get(); + }; + var defaultSpellcheckCallback = function (editor, pluginUrl, currentLanguageState) { + return function (method, text, doneCallback, errorCallback) { + var data = { + method: method, + lang: currentLanguageState.get() + }; + var postData = ''; + data[method === 'addToDictionary' ? 'word' : 'text'] = text; + global$1.each(data, function (value, key) { + if (postData) { + postData += '&'; + } + postData += key + '=' + encodeURIComponent(value); + }); + global$3.send({ + url: new global$2(pluginUrl).toAbsolute(Settings.getRpcUrl(editor)), + type: 'post', + content_type: 'application/x-www-form-urlencoded', + data: postData, + success: function (result) { + var parseResult = JSON.parse(result); + if (!parseResult) { + var message = editor.translate('Server response wasn\'t proper JSON.'); + errorCallback(message); + } else if (parseResult.error) { + errorCallback(parseResult.error); + } else { + doneCallback(parseResult); + } + }, + error: function () { + var message = editor.translate('The spelling service was not found: (') + Settings.getRpcUrl(editor) + editor.translate(')'); + errorCallback(message); + } + }); + }; + }; + var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) { + var userSpellcheckCallback = Settings.getSpellcheckerCallback(editor); + var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState); + spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback); + }; + var spellcheck = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { + if (finish(editor, startedState, textMatcherState)) { + return; + } + var errorCallback = function (message) { + editor.notificationManager.open({ + text: message, + type: 'error' + }); + editor.setProgressState(false); + finish(editor, startedState, textMatcherState); + }; + var successCallback = function (data) { + markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + editor.setProgressState(true); + sendRpcCall(editor, pluginUrl, currentLanguageState, 'spellcheck', getTextMatcher(editor, textMatcherState).text, successCallback, errorCallback); + editor.focus(); + }; + var checkIfFinished = function (editor, startedState, textMatcherState) { + if (!editor.dom.select('span.mce-spellchecker-word').length) { + finish(editor, startedState, textMatcherState); + } + }; + var addToDictionary = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans) { + editor.setProgressState(true); + sendRpcCall(editor, pluginUrl, currentLanguageState, 'addToDictionary', word, function () { + editor.setProgressState(false); + editor.dom.remove(spans, true); + checkIfFinished(editor, startedState, textMatcherState); + }, function (message) { + editor.notificationManager.open({ + text: message, + type: 'error' + }); + editor.setProgressState(false); + }); + }; + var ignoreWord = function (editor, startedState, textMatcherState, word, spans, all) { + editor.selection.collapse(); + if (all) { + global$1.each(editor.dom.select('span.mce-spellchecker-word'), function (span) { + if (span.getAttribute('data-mce-word') === word) { + editor.dom.remove(span, true); + } + }); + } else { + editor.dom.remove(spans, true); + } + checkIfFinished(editor, startedState, textMatcherState); + }; + var finish = function (editor, startedState, textMatcherState) { + var bookmark = editor.selection.getBookmark(); + getTextMatcher(editor, textMatcherState).reset(); + editor.selection.moveToBookmark(bookmark); + textMatcherState.set(null); + if (startedState.get()) { + startedState.set(false); + Events.fireSpellcheckEnd(editor); + return true; + } + }; + var getElmIndex = function (elm) { + var value = elm.getAttribute('data-mce-index'); + if (typeof value === 'number') { + return '' + value; + } + return value; + }; + var findSpansByIndex = function (editor, index) { + var nodes; + var spans = []; + nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); + if (nodes.length) { + for (var i = 0; i < nodes.length; i++) { + var nodeIndex = getElmIndex(nodes[i]); + if (nodeIndex === null || !nodeIndex.length) { + continue; + } + if (nodeIndex === index.toString()) { + spans.push(nodes[i]); + } + } + } + return spans; + }; + var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) { + var hasDictionarySupport = !!data.dictionary; + var suggestions = data.words; + editor.setProgressState(false); + if (isEmpty(suggestions)) { + var message = editor.translate('No misspellings found.'); + editor.notificationManager.open({ + text: message, + type: 'info' + }); + startedState.set(false); + return; + } + lastSuggestionsState.set({ + suggestions: suggestions, + hasDictionarySupport: hasDictionarySupport + }); + var bookmark = editor.selection.getBookmark(); + getTextMatcher(editor, textMatcherState).find(Settings.getSpellcheckerWordcharPattern(editor)).filter(function (match) { + return !!suggestions[match.text]; + }).wrap(function (match) { + return editor.dom.create('span', { + 'class': 'mce-spellchecker-word', + 'aria-invalid': 'spelling', + 'data-mce-bogus': 1, + 'data-mce-word': match.text + }); + }); + editor.selection.moveToBookmark(bookmark); + startedState.set(true); + Events.fireSpellcheckStart(editor); + }; + var Actions = { + spellcheck: spellcheck, + checkIfFinished: checkIfFinished, + addToDictionary: addToDictionary, + ignoreWord: ignoreWord, + findSpansByIndex: findSpansByIndex, + getElmIndex: getElmIndex, + markErrors: markErrors + }; + + var get = function (editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, url) { + var getLanguage = function () { + return currentLanguageState.get(); + }; + var getWordCharPattern = function () { + return Settings.getSpellcheckerWordcharPattern(editor); + }; + var markErrors = function (data) { + Actions.markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + var getTextMatcher = function () { + return textMatcherState.get(); + }; + return { + getTextMatcher: getTextMatcher, + getWordCharPattern: getWordCharPattern, + markErrors: markErrors, + getLanguage: getLanguage + }; + }; + var Api = { get: get }; + + var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { + editor.addCommand('mceSpellCheck', function () { + Actions.spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }); + }; + var Commands = { register: register }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var spellcheckerEvents = 'SpellcheckStart SpellcheckEnd'; + var buildMenuItems = function (listName, languageValues) { + var items = []; + global$1.each(languageValues, function (languageValue) { + items.push({ + selectable: true, + text: languageValue.name, + data: languageValue.value + }); + }); + return items; + }; + var getItems = function (editor) { + return global$1.map(Settings.getLanguages(editor).split(','), function (langPair) { + langPair = langPair.split('='); + return { + name: langPair[0], + value: langPair[1] + }; + }); + }; + var register$1 = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState) { + var languageMenuItems = buildMenuItems('Language', getItems(editor)); + var startSpellchecking = function () { + Actions.spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }; + var buttonArgs = { + tooltip: 'Spellcheck', + onAction: startSpellchecking, + icon: 'spell-check', + onSetup: function (buttonApi) { + var setButtonState = function () { + buttonApi.setActive(startedState.get()); + }; + editor.on(spellcheckerEvents, setButtonState); + return function () { + editor.off(spellcheckerEvents, setButtonState); + }; + } + }; + var splitButtonArgs = __assign(__assign({}, buttonArgs), { + type: 'splitbutton', + select: function (value) { + return value === currentLanguageState.get(); + }, + fetch: function (callback) { + var items = global$1.map(languageMenuItems, function (languageItem) { + return { + type: 'choiceitem', + value: languageItem.data, + text: languageItem.text + }; + }); + callback(items); + }, + onItemAction: function (splitButtonApi, value) { + currentLanguageState.set(value); + } + }); + if (languageMenuItems.length > 1) { + editor.ui.registry.addSplitButton('spellchecker', splitButtonArgs); + } else { + editor.ui.registry.addToggleButton('spellchecker', buttonArgs); + } + editor.ui.registry.addToggleMenuItem('spellchecker', { + text: 'Spellcheck', + onSetup: function (menuApi) { + menuApi.setActive(startedState.get()); + var setMenuItemCheck = function () { + menuApi.setActive(startedState.get()); + }; + editor.on(spellcheckerEvents, setMenuItemCheck); + return function () { + editor.off(spellcheckerEvents, setMenuItemCheck); + }; + }, + onAction: startSpellchecking + }); + }; + var Buttons = { register: register$1 }; + + var ignoreAll = true; + var getSuggestions = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, word, spans) { + var items = []; + var suggestions = lastSuggestionsState.get().suggestions[word]; + global$1.each(suggestions, function (suggestion) { + items.push({ + text: suggestion, + onAction: function () { + editor.insertContent(editor.dom.encode(suggestion)); + editor.dom.remove(spans); + Actions.checkIfFinished(editor, startedState, textMatcherState); + } + }); + }); + var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport; + if (hasDictionarySupport) { + items.push({ type: 'separator' }); + items.push({ + text: 'Add to dictionary', + onAction: function () { + Actions.addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans); + } + }); + } + items.push.apply(items, [ + { type: 'separator' }, + { + text: 'Ignore', + onAction: function () { + Actions.ignoreWord(editor, startedState, textMatcherState, word, spans); + } + }, + { + text: 'Ignore all', + onAction: function () { + Actions.ignoreWord(editor, startedState, textMatcherState, word, spans, ignoreAll); + } + } + ]); + return items; + }; + var setup = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState) { + var update = function (element) { + var target = element; + if (target.className === 'mce-spellchecker-word') { + var spans = Actions.findSpansByIndex(editor, Actions.getElmIndex(target)); + if (spans.length > 0) { + var rng = editor.dom.createRng(); + rng.setStartBefore(spans[0]); + rng.setEndAfter(spans[spans.length - 1]); + editor.selection.setRng(rng); + return getSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, target.getAttribute('data-mce-word'), spans); + } + } else { + return []; + } + }; + editor.ui.registry.addContextMenu('spellchecker', { update: update }); + }; + var SuggestionsMenu = { setup: setup }; + + function Plugin () { + global.add('spellchecker', function (editor, pluginUrl) { + if (DetectProPlugin.hasProPlugin(editor) === false) { + var startedState = Cell(false); + var currentLanguageState = Cell(Settings.getLanguage(editor)); + var textMatcherState = Cell(null); + var lastSuggestionsState = Cell(null); + Buttons.register(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState); + SuggestionsMenu.setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState); + Commands.register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + return Api.get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, pluginUrl); + } + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.min.js index f19e1e8..054c2b2 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/spellchecker/plugin.min.js @@ -1 +1,9 @@ -!function(e,t){"use strict";function n(e,t){for(var n,o=[],r=0;r=d.end?(r=c,a=d.end-s):o&&l.push(c),!o&&c.length+s>d.start&&(o=c,i=d.start-s),s+=c.length),o&&r){if(c=n({startNode:o,startNodeIndex:i,endNode:r,endNodeIndex:a,innerNodes:l,match:d.text,matchIndex:u}),s-=r.length-a,o=null,r=null,l=[],d=t.shift(),u++,!d)break}else{if((!P[c.nodeName]||S[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function i(e){function t(t,n){var o=w[n];o.stencil||(o.stencil=e(o));var r=o.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",n),t&&r.appendChild(k.doc.createTextNode(t)),r}return function(e){var n,o,r,i=e.startNode,a=e.endNode,l=e.matchIndex,s=k.doc;if(i===a){var c=i;r=c.parentNode,e.startNodeIndex>0&&(n=s.createTextNode(c.data.substring(0,e.startNodeIndex)),r.insertBefore(n,c));var d=t(e.match,l);return r.insertBefore(d,c),e.endNodeIndexm;++m){var g=e.innerNodes[m],h=t(g.data,l);g.parentNode.replaceChild(h,g),f.push(h)}var v=t(a.data.substring(0,e.endNodeIndex),l);return r=i.parentNode,r.insertBefore(n,i),r.insertBefore(u,i),r.removeChild(i),r=a.parentNode,r.insertBefore(v,a),r.insertBefore(o,a),r.removeChild(a),v}}function a(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function l(t){var n=e.getElementsByTagName("*"),o=[];t="number"==typeof t?""+t:null;for(var r=0;rt&&e(w[t],t)!==!1;t++);return this}function u(t){return w.length&&r(e,w,i(t)),this}function f(e,t){if(C&&e.global)for(;x=e.exec(C);)w.push(n(x,t));return this}function m(e){var t,n=l(e?s(e):null);for(t=n.length;t--;)a(n[t]);return this}function p(e){return w[e.getAttribute("data-mce-index")]}function g(e){return l(s(e))[0]}function h(e,t,n){return w.push({start:e,end:e+t,text:C.substr(e,t),data:n}),this}function v(e){var n=l(s(e)),o=t.dom.createRng();return o.setStartBefore(n[0]),o.setEndAfter(n[n.length-1]),o}function b(e,n){var o=v(e);return o.deleteContents(),n.length>0&&o.insertNode(t.dom.doc.createTextNode(n)),o}function y(){return w.splice(0,w.length),m(),this}var x,w=[],C,k=t.dom,S,P,N;return S=t.schema.getBlockElements(),P=t.schema.getWhiteSpaceElements(),N=t.schema.getShortEndedElements(),C=o(e),{text:C,matches:w,each:d,filter:c,reset:y,matchFromElement:p,elementFromMatch:g,find:f,add:h,wrap:u,unwrap:m,replace:b,rangeFromMatch:v,indexOf:s}}}),o(c,[s,d,u,f,m,p,g,h],function(e,t,n,o,r,i,a,l){t.add("spellchecker",function(t,s){function c(){return C.textMatcher||(C.textMatcher=new e(t.getBody(),t)),C.textMatcher}function d(e,t){var o=[];return n.each(t,function(e){o.push({selectable:!0,text:e.name,data:e.value})}),o}function u(e){for(var t in e)return!1;return!0}function f(e,i){var a=[],l=k[e];n.each(l,function(e){a.push({text:e,onclick:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(i),g()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){h(e,i)}},{text:"Ignore all",onclick:function(){h(e,i,!0)}},{text:"Finish",onclick:v}]),P=new o({items:a,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){P.remove(),P=null}}),P.renderTo(document.body);var s=r.DOM.getPos(t.getContentAreaContainer()),c=t.dom.getPos(i[0]),d=t.dom.getRoot();"BODY"==d.nodeName?(c.x-=d.ownerDocument.documentElement.scrollLeft||d.scrollLeft,c.y-=d.ownerDocument.documentElement.scrollTop||d.scrollTop):(c.x-=d.scrollLeft,c.y-=d.scrollTop),s.x+=c.x,s.y+=c.y,P.moveTo(s.x,s.y+i[0].offsetHeight)}function m(){return t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e]+',"g")}function p(){function e(e){return t.setProgressState(!1),u(e)?(t.windowManager.alert("No misspellings found"),void(S=!1)):(k=e,c().find(m()).filter(function(t){return!!e[t.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1,"data-mce-word":e.text})}),void t.fire("SpellcheckStart"))}function n(e){t.windowManager.alert(e),t.setProgressState(!1),v()}function o(e,t,o){i.send({url:new a(s).toAbsolute(N.spellchecker_rpc_url),type:"post",content_type:"application/x-www-form-urlencoded",data:"text="+encodeURIComponent(t)+"&lang="+N.spellchecker_language,success:function(e){e=l.parse(e),e?e.error?n(e.error):o(e.words):n("Sever response wasn't proper JSON.")},error:function(e,t){n("Spellchecker request error: "+t.status)}})}if(S)return void v();v(),S=!0,t.setProgressState(!0);var r=N.spellchecker_callback||o;r.call(C,"spellcheck",c().text,e,n),t.focus()}function g(){t.dom.select("span.mce-spellchecker-word").length||v()}function h(e,o,r){t.selection.collapse(),r?n.each(t.dom.select("span.mce-spellchecker-word"),function(n){n.getAttribute("data-mce-word")==e&&t.dom.remove(n,!0)}):t.dom.remove(o,!0),g()}function v(){c().reset(),C.textMatcher=null,S&&(S=!1,t.fire("SpellcheckEnd"))}function b(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function y(e){var o,r=[];if(o=n.toArray(t.getBody().getElementsByTagName("span")),o.length)for(var i=0;i0){var r=t.dom.createRng();r.setStartBefore(o[0]),r.setEndAfter(o[o.length-1]),t.selection.setRng(r),f(n.getAttribute("data-mce-word"),o)}}}),t.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:p,selectable:!0,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(S)})}});var T={tooltip:"Spellcheck",onclick:p,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(S)})}};w.length>1&&(T.type="splitbutton",T.menu=w,T.onshow=x,T.onselect=function(e){N.spellchecker_language=e.control.settings.data}),t.addButton("spellchecker",T),t.addCommand("mceSpellCheck",p),t.on("remove",function(){P&&(P.remove(),P=null)}),t.on("change",g),this.getTextMatcher=c,this.getWordCharPattern=m,this.getLanguage=function(){return N.spellchecker_language},N.spellchecker_language=N.spellchecker_language||N.language||"en"})}),a([s,c])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(t){"use strict";var c=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return c(t())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!n.get("tinymcespellchecker"))&&("undefined"!=typeof t.window.console&&t.window.console.log&&t.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=tinymce.util.Tools.resolve("tinymce.util.URI"),d=tinymce.util.Tools.resolve("tinymce.util.XHR"),f=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")},g=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},u=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},h=function(e){return e.getParam("spellchecker_rpc_url")},p=function(e){return e.getParam("spellchecker_callback")},m=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function T(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function r(c,r){var n,o,g,h,p,i=[],v=r.dom;function a(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function u(e){for(var t=e.parentNode;0=a.end?(o=l,c=a.end-s):r&&u.push(l),!r&&l.length+s>a.start&&(r=l,i=a.start-s),s+=l.length),r&&o){if(l=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:c,innerNodes:u,match:a.text,matchIndex:d}),s-=o.length-c,o=r=null,u=[],d++,!(a=t.shift()))break}else if(h[l.nodeName]&&!g[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!T(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(c,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,c=e.matchIndex,a=v.doc;if(o===i){var u=o;r=u.parentNode,0 0) { - for (i = x + 1; i < el.length; i++) { - if (canSelect(el[i])) { - return el[i]; - } - } - } else { - for (i = x - 1; i >= 0; i--) { - if (canSelect(el[i])) { - return el[i]; - } - } - } - - return null; - } - - v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') { - el = find(-1); - } else { - el = DOM.get(v[0]); - } - } else { - if (v[1] == ':next') { - el = find(1); - } else { - el = DOM.get(v[1]); - } - } - - if (el) { - var focusEditor = tinymce.get(el.id || el.name); - - if (el.id && focusEditor) { - focusEditor.focus(); - } else { - window.setTimeout(function() { - if (!tinymce.Env.webkit) { - window.focus(); - } - - el.focus(); - }, 10); - } - - e.preventDefault(); - } - } - - editor.on('init', function() { - if (editor.inline) { - // Remove default tabIndex in inline mode - tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null); - } - }); - - editor.on('keyup', tabCancel); - - if (tinymce.Env.gecko) { - editor.on('keypress keydown', tabHandler); - } else { - editor.on('keydown', tabHandler); - } -}); +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var getTabFocusElements = function (editor) { + return editor.getParam('tabfocus_elements', ':prev,:next'); + }; + var getTabFocus = function (editor) { + return editor.getParam('tab_focus', getTabFocusElements(editor)); + }; + var Settings = { getTabFocus: getTabFocus }; + + var DOM = global$1.DOM; + var tabCancel = function (e) { + if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) { + e.preventDefault(); + } + }; + var setup = function (editor) { + function tabHandler(e) { + var x, el, v, i; + if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { + return; + } + function find(direction) { + el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); + function canSelectRecursive(e) { + return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode); + } + function canSelect(el) { + return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el); + } + global$5.each(el, function (e, i) { + if (e.id === editor.id) { + x = i; + return false; + } + }); + if (direction > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) { + return el[i]; + } + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) { + return el[i]; + } + } + } + return null; + } + v = global$5.explode(Settings.getTabFocus(editor)); + if (v.length === 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + if (e.shiftKey) { + if (v[0] === ':prev') { + el = find(-1); + } else { + el = DOM.get(v[0]); + } + } else { + if (v[1] === ':next') { + el = find(1); + } else { + el = DOM.get(v[1]); + } + } + if (el) { + var focusEditor = global$2.get(el.id || el.name); + if (el.id && focusEditor) { + focusEditor.focus(); + } else { + global$4.setTimeout(function () { + if (!global$3.webkit) { + domGlobals.window.focus(); + } + el.focus(); + }, 10); + } + e.preventDefault(); + } + } + editor.on('init', function () { + if (editor.inline) { + DOM.setAttrib(editor.getBody(), 'tabIndex', null); + } + editor.on('keyup', tabCancel); + if (global$3.gecko) { + editor.on('keypress keydown', tabHandler); + } else { + editor.on('keydown', tabHandler); + } + }); + }; + var Keyboard = { setup: setup }; + + function Plugin () { + global.add('tabfocus', function (editor) { + Keyboard.setup(editor); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/tabfocus/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/tabfocus/plugin.min.js index 68fe35e..2ffd8a8 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/tabfocus/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/tabfocus/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("tabfocus",function(e){function n(e){9!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}function t(n){function t(n){function t(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&t(e.parentNode)}function r(e){return e.tabIndex||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function c(e){return!r(e)&&"-1"!=e.getAttribute("tabindex")&&t(e)}if(u=i.select(":input:enabled,*[tabindex]:not(iframe)"),o(u,function(n,t){return n.id==e.id?(a=t,!1):void 0}),n>0){for(d=a+1;d=0;d--)if(c(u[d]))return u[d];return null}var a,u,c,d;if(!(9!==n.keyCode||n.ctrlKey||n.altKey||n.metaKey)&&(c=r(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==c.length&&(c[1]=c[0],c[0]=":prev"),u=n.shiftKey?":prev"==c[0]?t(-1):i.get(c[0]):":next"==c[1]?t(1):i.get(c[1]))){var y=tinymce.get(u.id||u.name);u.id&&y?y.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),u.focus()},10),n.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,r=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null)}),e.on("keyup",n),tinymce.Env.gecko?e.on("keypress keydown",t):e.on("keydown",t)}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(c){"use strict";function t(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",function(e){return e.getParam("tabfocus_elements",":prev,:next")}(e))},v=n.DOM,i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mce-item-selected')) { - break; - } - - lastNode = node; - } - } while ((node = walker.next())); - - setPoint(lastNode); - - sel.setRng(rng); - } - - editor.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - editor.on('KeyUp Drop', function() { - clear(); - startCell = tableGrid = startTable = null; - }); - - return { - clear: clear - }; - }; -}); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/Plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/Plugin.js deleted file mode 100644 index e73407e..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/Plugin.js +++ /dev/null @@ -1,846 +0,0 @@ -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains all core logic for the table plugin. - * - * @class tinymce.tableplugin.Plugin - * @private - */ -define("tinymce/tableplugin/Plugin", [ - "tinymce/tableplugin/TableGrid", - "tinymce/tableplugin/Quirks", - "tinymce/tableplugin/CellSelection", - "tinymce/util/Tools", - "tinymce/dom/TreeWalker", - "tinymce/Env", - "tinymce/PluginManager" -], function(TableGrid, Quirks, CellSelection, Tools, TreeWalker, Env, PluginManager) { - var each = Tools.each; - - function Plugin(editor) { - var winMan, clipboardRows, self = this; // Might be selected cells on reload - - function removePxSuffix(size) { - return size ? size.replace(/px$/, '') : ""; - } - - function addSizeSuffix(size) { - if (/^[0-9]+$/.test(size)) { - size += "px"; - } - - return size; - } - - function unApplyAlign(elm) { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, elm); - }); - } - - function unApplyVAlign(elm) { - each('top middle bottom'.split(' '), function(name) { - editor.formatter.remove('valign' + name, {}, elm); - }); - } - - function tableDialog() { - var dom = editor.dom, tableElm, colsCtrl, rowsCtrl, data; - - tableElm = dom.getParent(editor.selection.getStart(), 'table'); - - data = { - width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')), - height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')), - cellspacing: tableElm ? dom.getAttrib(tableElm, 'cellspacing') : '', - cellpadding: tableElm ? dom.getAttrib(tableElm, 'cellpadding') : '', - border: tableElm ? dom.getAttrib(tableElm, 'border') : '', - caption: !!dom.select('caption', tableElm)[0] - }; - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(tableElm, 'align' + name)) { - data.align = name; - } - }); - - if (!tableElm) { - colsCtrl = {label: 'Cols', name: 'cols'}; - rowsCtrl = {label: 'Rows', name: 'rows'}; - } - - editor.windowManager.open({ - title: "Table properties", - items: { - type: 'form', - layout: 'grid', - columns: 2, - data: data, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - colsCtrl, - rowsCtrl, - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - {label: 'Cell spacing', name: 'cellspacing'}, - {label: 'Cell padding', name: 'cellpadding'}, - {label: 'Border', name: 'border'}, - {label: 'Caption', name: 'caption', type: 'checkbox'}, - { - label: 'Alignment', - minWidth: 90, - name: 'align', - type: 'listbox', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(), captionElm; - - editor.undoManager.transact(function() { - if (!tableElm) { - tableElm = insertTable(data.cols || 1, data.rows || 1); - } - - editor.dom.setAttribs(tableElm, { - cellspacing: data.cellspacing, - cellpadding: data.cellpadding, - border: data.border - }); - - editor.dom.setStyles(tableElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Toggle caption on/off - captionElm = dom.select('caption', tableElm)[0]; - - if (captionElm && !data.caption) { - dom.remove(captionElm); - } - - if (!captionElm && data.caption) { - captionElm = dom.create('caption'); - captionElm.innerHTML = !Env.ie ? '
    ' : '\u00a0'; - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - - unApplyAlign(tableElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, tableElm); - } - - editor.focus(); - editor.addVisual(); - }); - } - }); - } - - function mergeDialog(grid, cell) { - editor.windowManager.open({ - title: "Merge cells", - body: [ - {label: 'Cols', name: 'cols', type: 'textbox', size: 10}, - {label: 'Rows', name: 'rows', type: 'textbox', size: 10} - ], - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - grid.merge(cell, data.cols, data.rows); - }); - } - }); - } - - function cellDialog() { - var dom = editor.dom, cellElm, data, cells = []; - - // Get selected cells or the current cell - cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - if (!cells.length && cellElm) { - cells.push(cellElm); - } - - cellElm = cellElm || cells[0]; - - if (!cellElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')), - height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')), - scope: dom.getAttrib(cellElm, 'scope') - }; - - data.type = cellElm.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(cellElm, 'align' + name)) { - data.align = name; - } - }); - - each('top middle bottom'.split(' '), function(name) { - if (editor.formatter.matchNode(cellElm, 'valign' + name)) { - data.valign = name; - } - }); - - editor.windowManager.open({ - title: "Cell properties", - items: { - type: 'form', - data: data, - layout: 'grid', - columns: 2, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - { - label: 'Cell type', - name: 'type', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'Cell', value: 'td'}, - {text: 'Header cell', value: 'th'} - ] - }, - { - label: 'Scope', - name: 'scope', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Row', value: 'row'}, - {text: 'Column', value: 'col'}, - {text: 'Row group', value: 'rowgroup'}, - {text: 'Column group', value: 'colgroup'} - ] - }, - { - label: 'H Align', - name: 'align', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - }, - { - label: 'V Align', - name: 'valign', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Top', value: 'top'}, - {text: 'Middle', value: 'middle'}, - {text: 'Bottom', value: 'bottom'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - each(cells, function(cellElm) { - editor.dom.setAttrib(cellElm, 'scope', data.scope); - - editor.dom.setStyles(cellElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Switch cell type - if (data.type && cellElm.nodeName.toLowerCase() != data.type) { - cellElm = dom.rename(cellElm, data.type); - } - - // Apply/remove alignment - unApplyAlign(cellElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, cellElm); - } - - // Apply/remove vertical alignment - unApplyVAlign(cellElm); - if (data.valign) { - editor.formatter.apply('valign' + data.valign, {}, cellElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function rowDialog() { - var dom = editor.dom, tableElm, cellElm, rowElm, data, rows = []; - - tableElm = editor.dom.getParent(editor.selection.getStart(), 'table'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - - each(tableElm.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) { - rows.push(row); - return false; - } - }); - }); - - rowElm = rows[0]; - if (!rowElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')), - scope: dom.getAttrib(rowElm, 'scope') - }; - - data.type = rowElm.parentNode.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(rowElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Row properties", - items: { - type: 'form', - data: data, - columns: 2, - defaults: { - type: 'textbox' - }, - items: [ - { - type: 'listbox', - name: 'type', - label: 'Row type', - text: 'None', - maxWidth: null, - values: [ - {text: 'Header', value: 'thead'}, - {text: 'Body', value: 'tbody'}, - {text: 'Footer', value: 'tfoot'} - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - }, - {label: 'Height', name: 'height'} - ] - }, - - onsubmit: function() { - var data = this.toJSON(), tableElm, oldParentElm, parentElm; - - editor.undoManager.transact(function() { - var toType = data.type; - - each(rows, function(rowElm) { - editor.dom.setAttrib(rowElm, 'scope', data.scope); - - editor.dom.setStyles(rowElm, { - height: addSizeSuffix(data.height) - }); - - if (toType != rowElm.parentNode.nodeName.toLowerCase()) { - tableElm = dom.getParent(rowElm, 'table'); - - oldParentElm = rowElm.parentNode; - parentElm = dom.select(toType, tableElm)[0]; - if (!parentElm) { - parentElm = dom.create(toType); - if (tableElm.firstChild) { - tableElm.insertBefore(parentElm, tableElm.firstChild); - } else { - tableElm.appendChild(parentElm); - } - } - - parentElm.appendChild(rowElm); - - if (!oldParentElm.hasChildNodes()) { - dom.remove(oldParentElm); - } - } - - // Apply/remove alignment - unApplyAlign(rowElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, rowElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function cmd(command) { - return function() { - editor.execCommand(command); - }; - } - - function insertTable(cols, rows) { - var y, x, html; - - html = ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += '
    ' + (Env.ie ? " " : '
    ') + '
    '; - - editor.insertContent(html); - - var tableElm = editor.dom.get('__mce'); - editor.dom.setAttrib(tableElm, 'id', null); - - return tableElm; - } - - function handleDisabledState(ctrl, selector) { - function bindStateListener() { - ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector)); - - editor.selection.selectorChanged(selector, function(state) { - ctrl.disabled(!state); - }); - } - - if (editor.initialized) { - bindStateListener(); - } else { - editor.on('init', bindStateListener); - } - } - - function postRender() { - /*jshint validthis:true*/ - handleDisabledState(this, 'table'); - } - - function postRenderCell() { - /*jshint validthis:true*/ - handleDisabledState(this, 'td,th'); - } - - function generateTableGrid() { - var html = ''; - - html = ''; - - for (var y = 0; y < 10; y++) { - html += ''; - - for (var x = 0; x < 10; x++) { - html += ''; - } - - html += ''; - } - - html += '
    '; - - html += ''; - - return html; - } - - function selectGrid(tx, ty, control) { - var table = control.getEl().getElementsByTagName('table')[0]; - var x, y, focusCell, cell, active; - var rtl = control.isRtl() || control.parent().rel == 'tl-tr'; - - table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1); - - if (rtl) { - tx = 9 - tx; - } - - for (y = 0; y < 10; y++) { - for (x = 0; x < 10; x++) { - cell = table.rows[y].childNodes[x].firstChild; - active = (rtl ? x >= tx : x <= tx) && y <= ty; - - editor.dom.toggleClass(cell, 'mce-active', active); - - if (active) { - focusCell = cell; - } - } - } - - return focusCell.parentNode; - } - - if (editor.settings.table_grid === false) { - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - onclick: tableDialog - }); - } else { - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - ariaHideMenu: true, - onclick: function(e) { - if (e.aria) { - this.parent().hideAll(); - e.stopImmediatePropagation(); - tableDialog(); - } - }, - onshow: function() { - selectGrid(0, 0, this.menu.items()[0]); - }, - onhide: function() { - var elements = this.menu.items()[0].getEl().getElementsByTagName('a'); - editor.dom.removeClass(elements, 'mce-active'); - editor.dom.addClass(elements[0], 'mce-active'); - }, - menu: [ - { - type: 'container', - html: generateTableGrid(), - - onPostRender: function() { - this.lastX = this.lastY = 0; - }, - - onmousemove: function(e) { - var target = e.target, x, y; - - if (target.tagName.toUpperCase() == 'A') { - x = parseInt(target.getAttribute('data-mce-x'), 10); - y = parseInt(target.getAttribute('data-mce-y'), 10); - - if (this.isRtl() || this.parent().rel == 'tl-tr') { - x = 9 - x; - } - - if (x !== this.lastX || y !== this.lastY) { - selectGrid(x, y, e.control); - - this.lastX = x; - this.lastY = y; - } - } - }, - - onkeydown: function(e) { - var x = this.lastX, y = this.lastY, isHandled; - - switch (e.keyCode) { - case 37: // DOM_VK_LEFT - if (x > 0) { - x--; - isHandled = true; - } - break; - - case 39: // DOM_VK_RIGHT - isHandled = true; - - if (x < 9) { - x++; - } - break; - - case 38: // DOM_VK_UP - isHandled = true; - - if (y > 0) { - y--; - } - break; - - case 40: // DOM_VK_DOWN - isHandled = true; - - if (y < 9) { - y++; - } - break; - } - - if (isHandled) { - e.preventDefault(); - e.stopPropagation(); - - selectGrid(x, y, e.control).focus(); - - this.lastX = x; - this.lastY = y; - } - }, - - onclick: function(e) { - if (e.target.tagName.toUpperCase() == 'A') { - e.preventDefault(); - e.stopPropagation(); - this.parent().cancel(); - - insertTable(this.lastX + 1, this.lastY + 1); - } - } - } - ] - }); - } - - editor.addMenuItem('tableprops', { - text: 'Table properties', - context: 'table', - onPostRender: postRender, - onclick: tableDialog - }); - - editor.addMenuItem('deletetable', { - text: 'Delete table', - context: 'table', - onPostRender: postRender, - cmd: 'mceTableDelete' - }); - - editor.addMenuItem('cell', { - separator: 'before', - text: 'Cell', - context: 'table', - menu: [ - {text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell}, - {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell}, - {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('row', { - text: 'Row', - context: 'table', - menu: [ - {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell}, - {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell}, - {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell}, - {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell}, - {text: '-'}, - {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell}, - {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell}, - {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell}, - {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('column', { - text: 'Column', - context: 'table', - menu: [ - {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell}, - {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell}, - {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell} - ] - }); - - var menuItems = []; - each("inserttable tableprops deletetable | cell row column".split(' '), function(name) { - if (name == '|') { - menuItems.push({text: '-'}); - } else { - menuItems.push(editor.menuItems[name]); - } - }); - - editor.addButton("table", { - type: "menubutton", - title: "Table", - menu: menuItems - }); - - // Select whole table is a table border is clicked - if (!Env.isIE) { - editor.on('click', function(e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - editor.selection.select(e); - editor.nodeChanged(); - } - }); - } - - self.quirks = new Quirks(editor); - - editor.on('Init', function() { - winMan = editor.windowManager; - self.cellSelection = new CellSelection(editor); - }); - - // Register action commands - each({ - mceTableSplitCells: function(grid) { - grid.split(); - }, - - mceTableMergeCells: function(grid) { - var rowSpan, colSpan, cell; - - cell = editor.dom.getParent(editor.selection.getStart(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) { - mergeDialog(grid, cell); - } else { - grid.merge(); - } - }, - - mceTableInsertRowBefore: function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter: function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore: function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter: function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol: function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow: function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow: function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow: function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore: function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter: function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete: function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - editor.addCommand(name, function() { - var grid = new TableGrid(editor); - - if (grid) { - func(grid); - editor.execCommand('mceRepaint'); - self.cellSelection.clear(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable: function() { - tableDialog(); - }, - - mceTableRowProps: rowDialog, - mceTableCellProps: cellDialog - }, function(func, name) { - editor.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - - PluginManager.add('table', Plugin); -}); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/Quirks.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/Quirks.js deleted file mode 100644 index 61e2a52..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/Quirks.js +++ /dev/null @@ -1,370 +0,0 @@ -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class includes fixes for various browser quirks. - * - * @class tinymce.tableplugin.Quirks - * @private - */ -define("tinymce/tableplugin/Quirks", [ - "tinymce/util/VK", - "tinymce/Env", - "tinymce/util/Tools" -], function(VK, Env, Tools) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor) { - /** - * Fixed caret movement around tables on WebKit. - */ - function moveWebKitSelection() { - function eventHandler(e) { - var key = e.keyCode; - - function handle(upBool, sourceNode) { - var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; - var currentRow = editor.dom.getParent(sourceNode, 'tr'); - var siblingRow = currentRow[siblingDirection]; - - if (siblingRow) { - moveCursorToRow(editor, sourceNode, siblingRow, upBool); - e.preventDefault(); - return true; - } else { - var tableNode = editor.dom.getParent(currentRow, 'table'); - var middleNode = currentRow.parentNode; - var parentNodeName = middleNode.nodeName.toLowerCase(); - if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { - var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); - if (targetParent !== null) { - return moveToRowInTarget(upBool, targetParent, sourceNode); - } - } - return escapeTable(upBool, currentRow, siblingDirection, tableNode); - } - } - - function getTargetParent(upBool, topNode, secondNode, nodeName) { - var tbodies = editor.dom.select('>' + nodeName, topNode); - var position = tbodies.indexOf(secondNode); - if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { - return getFirstHeadOrFoot(upBool, topNode); - } else if (position === -1) { - var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; - return tbodies[topOrBottom]; - } else { - return tbodies[position + (upBool ? -1 : 1)]; - } - } - - function getFirstHeadOrFoot(upBool, parent) { - var tagName = upBool ? 'thead' : 'tfoot'; - var headOrFoot = editor.dom.select('>' + tagName, parent); - return headOrFoot.length !== 0 ? headOrFoot[0] : null; - } - - function moveToRowInTarget(upBool, targetParent, sourceNode) { - var targetRow = getChildForDirection(targetParent, upBool); - - if (targetRow) { - moveCursorToRow(editor, sourceNode, targetRow, upBool); - } - - e.preventDefault(); - return true; - } - - function escapeTable(upBool, currentRow, siblingDirection, table) { - var tableSibling = table[siblingDirection]; - - if (tableSibling) { - moveCursorToStartOfElement(tableSibling); - return true; - } else { - var parentCell = editor.dom.getParent(table, 'td,th'); - if (parentCell) { - return handle(upBool, parentCell, e); - } else { - var backUpSibling = getChildForDirection(currentRow, !upBool); - moveCursorToStartOfElement(backUpSibling); - e.preventDefault(); - return false; - } - } - } - - function getChildForDirection(parent, up) { - var child = parent && parent[up ? 'lastChild' : 'firstChild']; - // BR is not a valid table child to return in this case we return the table cell - return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child; - } - - function moveCursorToStartOfElement(n) { - editor.selection.setCursorLocation(n, 0); - } - - function isVerticalMovement() { - return key == VK.UP || key == VK.DOWN; - } - - function isInTable(editor) { - var node = editor.selection.getNode(); - var currentRow = editor.dom.getParent(node, 'tr'); - return currentRow !== null; - } - - function columnIndex(column) { - var colIndex = 0; - var c = column; - while (c.previousSibling) { - c = c.previousSibling; - colIndex = colIndex + getSpanVal(c, "colspan"); - } - return colIndex; - } - - function findColumn(rowElement, columnIndex) { - var c = 0, r = 0; - - each(rowElement.children, function(cell, i) { - c = c + getSpanVal(cell, "colspan"); - r = i; - if (c > columnIndex) { - return false; - } - }); - return r; - } - - function moveCursorToRow(ed, node, row, upBool) { - var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th')); - var tgtColumnIndex = findColumn(row, srcColumnIndex); - var tgtNode = row.childNodes[tgtColumnIndex]; - var rowCellTarget = getChildForDirection(tgtNode, upBool); - moveCursorToStartOfElement(rowCellTarget || tgtNode); - } - - function shouldFixCaret(preBrowserNode) { - var newNode = editor.selection.getNode(); - var newParent = editor.dom.getParent(newNode, 'td,th'); - var oldParent = editor.dom.getParent(preBrowserNode, 'td,th'); - - return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent); - } - - function checkSameParentTable(nodeOne, NodeTwo) { - return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE'); - } - - if (isVerticalMovement() && isInTable(editor)) { - var preBrowserNode = editor.selection.getNode(); - setTimeout(function() { - if (shouldFixCaret(preBrowserNode)) { - handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); - } - }, 0); - } - } - - editor.on('KeyDown', function(e) { - eventHandler(e); - }); - } - - function fixBeforeTableCaretBug() { - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0; - } - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - editor.on('KeyDown', function(e) { - var rng, table, dom = editor.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = editor.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && editor.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - editor.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - function fixTableCaretPos() { - editor.on('KeyDown SetContent VisualAid', function() { - var last; - - // Skip empty text nodes from the end - for (last = editor.getBody().lastChild; last; last = last.previousSibling) { - if (last.nodeType == 3) { - if (last.nodeValue.length > 0) { - break; - } - } else if (last.nodeType == 1 && !last.getAttribute('data-mce-bogus')) { - break; - } - } - - if (last && last.nodeName == 'TABLE') { - if (editor.settings.forced_root_block) { - editor.dom.add( - editor.getBody(), - editor.settings.forced_root_block, - editor.settings.forced_root_block_attrs, - Env.ie && Env.ie < 11 ? ' ' : '
    ' - ); - } else { - editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'}); - } - } - }); - - editor.on('PreProcess', function(o) { - var last = o.node.lastChild; - - if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && - (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && - last.previousSibling && last.previousSibling.nodeName == "TABLE") { - editor.dom.remove(last); - } - }); - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection() { - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'); - var tableParent, allOfCellSelected, tableCellSelection; - - if (table) { - tableParent = table.parentNode; - } - - allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset === 0 && - rng.endOffset === 0 && - currentCell && - (n.nodeName == "TR" || n == tableParent); - - tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell; - - return allOfCellSelected || tableCellSelection; - } - - function fixSelection() { - var rng = editor.selection.getRng(); - var n = editor.selection.getNode(); - var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH'); - - if (!tableCellSelected(editor, rng, n, currentCell)) { - return; - } - - if (!currentCell) { - currentCell = n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) { - end = end.lastChild; - } - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - editor.selection.setRng(rng); - } - - editor.on('KeyDown', function() { - fixSelection(); - }); - - editor.on('MouseDown', function(e) { - if (e.button != 2) { - fixSelection(); - } - }); - } - - /** - * Delete table if all cells are selected. - */ - function deleteTable() { - editor.on('keydown', function(e) { - if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) { - var table = editor.dom.getParent(editor.selection.getStart(), 'table'); - - if (table) { - var cells = editor.dom.select('td,th', table), i = cells.length; - while (i--) { - if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) { - return; - } - } - - e.preventDefault(); - editor.execCommand('mceTableDelete'); - } - } - }); - } - - deleteTable(); - - if (Env.webkit) { - moveWebKitSelection(); - fixTableCellSelection(); - } - - if (Env.gecko) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - - if (Env.ie > 10) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - }; -}); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/TableGrid.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/TableGrid.js deleted file mode 100644 index 14a840a..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/classes/TableGrid.js +++ /dev/null @@ -1,833 +0,0 @@ -/** - * TableGrid.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a grid out of a table element. This - * makes it a whole lot easier to handle complex tables with - * col/row spans. - * - * @class tinymce.tableplugin.TableGrid - * @private - */ -define("tinymce/tableplugin/TableGrid", [ - "tinymce/util/Tools", - "tinymce/Env" -], function(Tools, Env) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor, table) { - var grid, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom; - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) { - x++; - } - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) { - grid[y2] = []; - } - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part: part, - real: y2 == y && x2 == x, - elm: td, - rowspan: rowspan, - colspan: colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) { - return row[x]; - } - } - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val, 10); - - if (val === 1) { - td.removeAttribute(name, 1); - } else { - td.setAttribute(name, val, 1); - } - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell); - } - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) { - rows.push(row); - return false; - } - }); - }); - - return rows; - } - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - } - - function cloneCell(cell) { - var formatNode, cloneFormats = {}; - - if (editor.settings.table_clone_elements !== false) { - cloneFormats = Tools.makeMap( - (editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(), - /[ ,]/ - ); - } - - // Clone formats - Tools.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - if (!cloneFormats[node.nodeName]) { - return; - } - - node = cloneNode(node, false); - - if (!formatNode) { - formatNode = curNode = node; - } else if (curNode) { - curNode.appendChild(node); - } - - curNode = node; - }); - - // Add something to the inner node - if (curNode) { - curNode.innerHTML = Env.ie ? ' ' : '
    '; - } - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!Env.ie) { - cell.innerHTML = '
    '; - } - } - - return cell; - } - - function cleanup() { - var rng = dom.createRng(), row; - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length === 0) { - dom.remove(tr); - } - }); - - // Empty table - if (dom.select('tr', table).length === 0) { - rng.setStartBefore(table); - rng.setEndBefore(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length === 0) { - dom.remove(part); - } - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // If we have a valid startPos object - if (startPos) { - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - } - } - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) { - dom.insertAfter(cloneCell(cell), cell); - } - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) { - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - } - } - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) { - dom.insertAfter(cloneCell(cell), cell); - } - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - } - - function merge(cell, cols, rows) { - var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - startPos = endPos = null; - - // Calculate start/end pos by checking for selected cells in grid works better with context menu - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - if (!startPos) { - startPos = {x: x, y: y}; - } - - endPos = {x: x, y: y}; - } - }); - }); - - // Use selection, but make sure startPos is valid before accessing - if (startPos) { - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) { - continue; - } - - cell = grid[y][x].elm; - - /*jshint loopfunc:true */ - /*eslint no-loop-func:0 */ - if (cell != startCell) { - // Move children to startCell - children = Tools.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = Tools.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) { - startCell.removeChild(node); - } - }); - } - - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - } - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posY; - } - }); - - // If posY is undefined there is nothing for us to do here...just return to avoid crashing below - if (posY === undefined) { - return; - } - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) { - continue; - } - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) { - dom.insertAfter(newRow, rowElm); - } else { - rowElm.parentNode.insertBefore(newRow, rowElm); - } - } - } - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posX; - } - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) { - return; - } - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else { - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - } - - lastCell = cell; - } - }); - } - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) { - setSpanVal(cell, 'colSpan', colSpan - 1); - } else { - dom.remove(cell); - } - }); - - cols.push(x); - } - }); - }); - - cleanup(); - } - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) { - dom.remove(cell); - } else { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - } - - lastCell = cell; - } - }); - } - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - } - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - } - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - } - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Nothing to paste - if (!rows) { - return; - } - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell) { - if (cell.real) { - targetCellCount += cell.colspan; - } - - if (cell.elm.parentNode == targetRow) { - match = 1; - } - }); - - if (match) { - return false; - } - }); - - if (!before) { - rows.reverse(); - } - - each(rows, function(row) { - var i, cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) { - row.appendChild(cloneCell(row.cells[cellCount - 1])); - } - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) { - dom.remove(row.cells[i]); - } - - // Add before/after - if (before) { - targetRow.parentNode.insertBefore(row, targetRow); - } else { - dom.insertAfter(row, targetRow); - } - }); - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - } - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - } - - function setStartCell(cell) { - startPos = getPos(cell); - } - - function findEndPos() { - var maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) { - maxX = x; - } - - if (y > maxY) { - maxY = y; - } - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - } - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) { - startX -= cell.colspan - 1; - } - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) { - startY -= cell.rowspan - 1; - } - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) { - dom.addClass(grid[y][x].elm, 'mce-item-selected'); - } - } - } - } - } - - table = table || dom.getParent(selection.getStart(), 'table'); - - buildGrid(); - - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - Tools.extend(this, { - deleteTable: deleteTable, - split: split, - merge: merge, - insertRow: insertRow, - insertCol: insertCol, - deleteCols: deleteCols, - deleteRows: deleteRows, - cutRows: cutRows, - copyRows: copyRows, - pasteRows: pasteRows, - getPos: getPos, - setStartCell: setStartCell, - setEndCell: setEndCell - }); - }; -}); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.dev.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.dev.js deleted file mode 100644 index 1b933de..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.dev.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Inline development version. Only to be used while developing since it uses document.write to load scripts. - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports) { - "use strict"; - - var html = "", baseDir; - var modules = {}, exposedModules = [], moduleCount = 0; - - var scripts = document.getElementsByTagName('script'); - for (var i = 0; i < scripts.length; i++) { - var src = scripts[i].src; - - if (src.indexOf('/plugin.dev.js') != -1) { - baseDir = src.substring(0, src.lastIndexOf('/')); - } - } - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function register(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - - if (--moduleCount === 0) { - for (var i = 0; i < exposedModules.length; i++) { - register(exposedModules[i]); - } - } - } - - function expose(ids) { - exposedModules = ids; - } - - function writeScripts() { - document.write(html); - } - - function load(path) { - html += '\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Plugin"]); - - load('classes/TableGrid.js'); - load('classes/Quirks.js'); - load('classes/CellSelection.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: ed044cccbf194aecb0402cf42470c726 \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.js index b6fa745..67ec441 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.js @@ -1,2313 +1,9495 @@ /** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/plugins/table/classes/TableGrid.js - -/** - * TableGrid.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a grid out of a table element. This - * makes it a whole lot easier to handle complex tables with - * col/row spans. - * - * @class tinymce.tableplugin.TableGrid - * @private - */ -define("tinymce/tableplugin/TableGrid", [ - "tinymce/util/Tools", - "tinymce/Env" -], function(Tools, Env) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor, table) { - var grid, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom; - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) { - x++; - } - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) { - grid[y2] = []; - } - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part: part, - real: y2 == y && x2 == x, - elm: td, - rowspan: rowspan, - colspan: colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) { - return row[x]; - } - } - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val, 10); - - if (val === 1) { - td.removeAttribute(name, 1); - } else { - td.setAttribute(name, val, 1); - } - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell); - } - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) { - rows.push(row); - return false; - } - }); - }); - - return rows; - } - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - } - - function cloneCell(cell) { - var formatNode, cloneFormats = {}; - - if (editor.settings.table_clone_elements !== false) { - cloneFormats = Tools.makeMap( - (editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(), - /[ ,]/ - ); - } - - // Clone formats - Tools.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - if (!cloneFormats[node.nodeName]) { - return; - } - - node = cloneNode(node, false); - - if (!formatNode) { - formatNode = curNode = node; - } else if (curNode) { - curNode.appendChild(node); - } - - curNode = node; - }); - - // Add something to the inner node - if (curNode) { - curNode.innerHTML = Env.ie ? ' ' : '
    '; - } - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!Env.ie) { - cell.innerHTML = '
    '; - } - } - - return cell; - } - - function cleanup() { - var rng = dom.createRng(), row; - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length === 0) { - dom.remove(tr); - } - }); - - // Empty table - if (dom.select('tr', table).length === 0) { - rng.setStartBefore(table); - rng.setEndBefore(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length === 0) { - dom.remove(part); - } - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // If we have a valid startPos object - if (startPos) { - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - } - } - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) { - dom.insertAfter(cloneCell(cell), cell); - } - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) { - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - } - } - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) { - dom.insertAfter(cloneCell(cell), cell); - } - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - } - - function merge(cell, cols, rows) { - var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - startPos = endPos = null; - - // Calculate start/end pos by checking for selected cells in grid works better with context menu - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - if (!startPos) { - startPos = {x: x, y: y}; - } - - endPos = {x: x, y: y}; - } - }); - }); - - // Use selection, but make sure startPos is valid before accessing - if (startPos) { - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) { - continue; - } - - cell = grid[y][x].elm; - - /*jshint loopfunc:true */ - /*eslint no-loop-func:0 */ - if (cell != startCell) { - // Move children to startCell - children = Tools.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = Tools.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) { - startCell.removeChild(node); - } - }); - } - - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - } - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posY; - } - }); - - // If posY is undefined there is nothing for us to do here...just return to avoid crashing below - if (posY === undefined) { - return; - } - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) { - continue; - } - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) { - dom.insertAfter(newRow, rowElm); - } else { - rowElm.parentNode.insertBefore(newRow, rowElm); - } - } - } - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posX; - } - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) { - return; - } - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else { - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - } - - lastCell = cell; - } - }); - } - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) { - setSpanVal(cell, 'colSpan', colSpan - 1); - } else { - dom.remove(cell); - } - }); - - cols.push(x); - } - }); - }); - - cleanup(); - } - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) { - dom.remove(cell); - } else { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - } - - lastCell = cell; - } - }); - } - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - } - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - } - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - } - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Nothing to paste - if (!rows) { - return; - } - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell) { - if (cell.real) { - targetCellCount += cell.colspan; - } - - if (cell.elm.parentNode == targetRow) { - match = 1; - } - }); - - if (match) { - return false; - } - }); - - if (!before) { - rows.reverse(); - } - - each(rows, function(row) { - var i, cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) { - row.appendChild(cloneCell(row.cells[cellCount - 1])); - } - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) { - dom.remove(row.cells[i]); - } - - // Add before/after - if (before) { - targetRow.parentNode.insertBefore(row, targetRow); - } else { - dom.insertAfter(row, targetRow); - } - }); - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - } - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - } - - function setStartCell(cell) { - startPos = getPos(cell); - } - - function findEndPos() { - var maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) { - maxX = x; - } - - if (y > maxY) { - maxY = y; - } - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - } - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) { - startX -= cell.colspan - 1; - } - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) { - startY -= cell.rowspan - 1; - } - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) { - dom.addClass(grid[y][x].elm, 'mce-item-selected'); - } - } - } - } - } - - table = table || dom.getParent(selection.getStart(), 'table'); - - buildGrid(); - - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - Tools.extend(this, { - deleteTable: deleteTable, - split: split, - merge: merge, - insertRow: insertRow, - insertCol: insertCol, - deleteCols: deleteCols, - deleteRows: deleteRows, - cutRows: cutRows, - copyRows: copyRows, - pasteRows: pasteRows, - getPos: getPos, - setStartCell: setStartCell, - setEndCell: setEndCell - }); - }; -}); - -// Included from: js/tinymce/plugins/table/classes/Quirks.js - -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class includes fixes for various browser quirks. - * - * @class tinymce.tableplugin.Quirks - * @private - */ -define("tinymce/tableplugin/Quirks", [ - "tinymce/util/VK", - "tinymce/Env", - "tinymce/util/Tools" -], function(VK, Env, Tools) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor) { - /** - * Fixed caret movement around tables on WebKit. - */ - function moveWebKitSelection() { - function eventHandler(e) { - var key = e.keyCode; - - function handle(upBool, sourceNode) { - var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; - var currentRow = editor.dom.getParent(sourceNode, 'tr'); - var siblingRow = currentRow[siblingDirection]; - - if (siblingRow) { - moveCursorToRow(editor, sourceNode, siblingRow, upBool); - e.preventDefault(); - return true; - } else { - var tableNode = editor.dom.getParent(currentRow, 'table'); - var middleNode = currentRow.parentNode; - var parentNodeName = middleNode.nodeName.toLowerCase(); - if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { - var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); - if (targetParent !== null) { - return moveToRowInTarget(upBool, targetParent, sourceNode); - } - } - return escapeTable(upBool, currentRow, siblingDirection, tableNode); - } - } - - function getTargetParent(upBool, topNode, secondNode, nodeName) { - var tbodies = editor.dom.select('>' + nodeName, topNode); - var position = tbodies.indexOf(secondNode); - if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { - return getFirstHeadOrFoot(upBool, topNode); - } else if (position === -1) { - var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; - return tbodies[topOrBottom]; - } else { - return tbodies[position + (upBool ? -1 : 1)]; - } - } - - function getFirstHeadOrFoot(upBool, parent) { - var tagName = upBool ? 'thead' : 'tfoot'; - var headOrFoot = editor.dom.select('>' + tagName, parent); - return headOrFoot.length !== 0 ? headOrFoot[0] : null; - } - - function moveToRowInTarget(upBool, targetParent, sourceNode) { - var targetRow = getChildForDirection(targetParent, upBool); - - if (targetRow) { - moveCursorToRow(editor, sourceNode, targetRow, upBool); - } - - e.preventDefault(); - return true; - } - - function escapeTable(upBool, currentRow, siblingDirection, table) { - var tableSibling = table[siblingDirection]; - - if (tableSibling) { - moveCursorToStartOfElement(tableSibling); - return true; - } else { - var parentCell = editor.dom.getParent(table, 'td,th'); - if (parentCell) { - return handle(upBool, parentCell, e); - } else { - var backUpSibling = getChildForDirection(currentRow, !upBool); - moveCursorToStartOfElement(backUpSibling); - e.preventDefault(); - return false; - } - } - } - - function getChildForDirection(parent, up) { - var child = parent && parent[up ? 'lastChild' : 'firstChild']; - // BR is not a valid table child to return in this case we return the table cell - return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child; - } - - function moveCursorToStartOfElement(n) { - editor.selection.setCursorLocation(n, 0); - } - - function isVerticalMovement() { - return key == VK.UP || key == VK.DOWN; - } - - function isInTable(editor) { - var node = editor.selection.getNode(); - var currentRow = editor.dom.getParent(node, 'tr'); - return currentRow !== null; - } - - function columnIndex(column) { - var colIndex = 0; - var c = column; - while (c.previousSibling) { - c = c.previousSibling; - colIndex = colIndex + getSpanVal(c, "colspan"); - } - return colIndex; - } - - function findColumn(rowElement, columnIndex) { - var c = 0, r = 0; - - each(rowElement.children, function(cell, i) { - c = c + getSpanVal(cell, "colspan"); - r = i; - if (c > columnIndex) { - return false; - } - }); - return r; - } - - function moveCursorToRow(ed, node, row, upBool) { - var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th')); - var tgtColumnIndex = findColumn(row, srcColumnIndex); - var tgtNode = row.childNodes[tgtColumnIndex]; - var rowCellTarget = getChildForDirection(tgtNode, upBool); - moveCursorToStartOfElement(rowCellTarget || tgtNode); - } - - function shouldFixCaret(preBrowserNode) { - var newNode = editor.selection.getNode(); - var newParent = editor.dom.getParent(newNode, 'td,th'); - var oldParent = editor.dom.getParent(preBrowserNode, 'td,th'); - - return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent); - } - - function checkSameParentTable(nodeOne, NodeTwo) { - return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE'); - } - - if (isVerticalMovement() && isInTable(editor)) { - var preBrowserNode = editor.selection.getNode(); - setTimeout(function() { - if (shouldFixCaret(preBrowserNode)) { - handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); - } - }, 0); - } - } - - editor.on('KeyDown', function(e) { - eventHandler(e); - }); - } - - function fixBeforeTableCaretBug() { - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0; - } - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - editor.on('KeyDown', function(e) { - var rng, table, dom = editor.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = editor.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && editor.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - editor.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - function fixTableCaretPos() { - editor.on('KeyDown SetContent VisualAid', function() { - var last; - - // Skip empty text nodes from the end - for (last = editor.getBody().lastChild; last; last = last.previousSibling) { - if (last.nodeType == 3) { - if (last.nodeValue.length > 0) { - break; - } - } else if (last.nodeType == 1 && !last.getAttribute('data-mce-bogus')) { - break; - } - } - - if (last && last.nodeName == 'TABLE') { - if (editor.settings.forced_root_block) { - editor.dom.add( - editor.getBody(), - editor.settings.forced_root_block, - editor.settings.forced_root_block_attrs, - Env.ie && Env.ie < 11 ? ' ' : '
    ' - ); - } else { - editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'}); - } - } - }); - - editor.on('PreProcess', function(o) { - var last = o.node.lastChild; - - if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && - (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && - last.previousSibling && last.previousSibling.nodeName == "TABLE") { - editor.dom.remove(last); - } - }); - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection() { - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'); - var tableParent, allOfCellSelected, tableCellSelection; - - if (table) { - tableParent = table.parentNode; - } - - allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset === 0 && - rng.endOffset === 0 && - currentCell && - (n.nodeName == "TR" || n == tableParent); - - tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell; - - return allOfCellSelected || tableCellSelection; - } - - function fixSelection() { - var rng = editor.selection.getRng(); - var n = editor.selection.getNode(); - var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH'); - - if (!tableCellSelected(editor, rng, n, currentCell)) { - return; - } - - if (!currentCell) { - currentCell = n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) { - end = end.lastChild; - } - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - editor.selection.setRng(rng); - } - - editor.on('KeyDown', function() { - fixSelection(); - }); - - editor.on('MouseDown', function(e) { - if (e.button != 2) { - fixSelection(); - } - }); - } - - /** - * Delete table if all cells are selected. - */ - function deleteTable() { - editor.on('keydown', function(e) { - if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) { - var table = editor.dom.getParent(editor.selection.getStart(), 'table'); - - if (table) { - var cells = editor.dom.select('td,th', table), i = cells.length; - while (i--) { - if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) { - return; - } - } - - e.preventDefault(); - editor.execCommand('mceTableDelete'); - } - } - }); - } - - deleteTable(); - - if (Env.webkit) { - moveWebKitSelection(); - fixTableCellSelection(); - } - - if (Env.gecko) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - - if (Env.ie > 10) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - }; -}); - -// Included from: js/tinymce/plugins/table/classes/CellSelection.js - -/** - * CellSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles table cell selection by faking it using a css class that gets applied - * to cells when dragging the mouse from one cell to another. - * - * @class tinymce.tableplugin.CellSelection - * @private - */ -define("tinymce/tableplugin/CellSelection", [ - "tinymce/tableplugin/TableGrid", - "tinymce/dom/TreeWalker", - "tinymce/util/Tools" -], function(TableGrid, TreeWalker, Tools) { - return function(editor) { - var dom = editor.dom, tableGrid, startCell, startTable, hasCellSelection = true; - - function clear() { - // Restore selection possibilities - editor.getBody().style.webkitUserSelect = ''; - - if (hasCellSelection) { - editor.dom.removeClass( - editor.dom.select('td.mce-item-selected,th.mce-item-selected'), - 'mce-item-selected' - ); - - hasCellSelection = false; - } - } - - function cellSelectionHandler(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = new TableGrid(editor, table); - tableGrid.setStartCell(startCell); - - editor.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - hasCellSelection = true; - } - - // Remove current selection - sel = editor.selection.getSel(); - - try { - if (sel.removeAllRanges) { - sel.removeAllRanges(); - } else { - sel.empty(); - } - } catch (ex) { - // IE9 might throw errors here - } - - e.preventDefault(); - } - } - - // Add cell selection logic - editor.on('MouseDown', function(e) { - if (e.button != 2) { - clear(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - editor.on('mouseover', cellSelectionHandler); - - editor.on('remove', function() { - dom.unbind(editor.getDoc(), 'mouseover', cellSelectionHandler); - }); - - editor.on('MouseUp', function() { - var rng, sel = editor.selection, selectedCells, walker, node, lastNode, endNode; - - function setPoint(node, start) { - var walker = new TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && Tools.trim(node.nodeValue).length !== 0) { - if (start) { - rng.setStart(node, 0); - } else { - rng.setEnd(node, node.nodeValue.length); - } - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) { - rng.setStartBefore(node); - } else { - rng.setEndBefore(node); - } - - return; - } - } while ((node = (start ? walker.next() : walker.prev()))); - } - - // Move selection to startCell - if (startCell) { - if (tableGrid) { - editor.getBody().style.webkitUserSelect = ''; - } - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mce-item-selected,th.mce-item-selected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mce-item-selected')) { - break; - } - - lastNode = node; - } - } while ((node = walker.next())); - - setPoint(lastNode); - - sel.setRng(rng); - } - - editor.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - editor.on('KeyUp Drop', function() { - clear(); - startCell = tableGrid = startTable = null; - }); - - return { - clear: clear - }; - }; -}); - -// Included from: js/tinymce/plugins/table/classes/Plugin.js - -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains all core logic for the table plugin. + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * @class tinymce.tableplugin.Plugin - * @private + * Version: 5.2.1 (2020-03-25) */ -define("tinymce/tableplugin/Plugin", [ - "tinymce/tableplugin/TableGrid", - "tinymce/tableplugin/Quirks", - "tinymce/tableplugin/CellSelection", - "tinymce/util/Tools", - "tinymce/dom/TreeWalker", - "tinymce/Env", - "tinymce/PluginManager" -], function(TableGrid, Quirks, CellSelection, Tools, TreeWalker, Env, PluginManager) { - var each = Tools.each; - - function Plugin(editor) { - var winMan, clipboardRows, self = this; // Might be selected cells on reload - - function removePxSuffix(size) { - return size ? size.replace(/px$/, '') : ""; - } - - function addSizeSuffix(size) { - if (/^[0-9]+$/.test(size)) { - size += "px"; - } - - return size; - } - - function unApplyAlign(elm) { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, elm); - }); - } - - function unApplyVAlign(elm) { - each('top middle bottom'.split(' '), function(name) { - editor.formatter.remove('valign' + name, {}, elm); - }); - } - - function tableDialog() { - var dom = editor.dom, tableElm, colsCtrl, rowsCtrl, data; - - tableElm = dom.getParent(editor.selection.getStart(), 'table'); - - data = { - width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')), - height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')), - cellspacing: tableElm ? dom.getAttrib(tableElm, 'cellspacing') : '', - cellpadding: tableElm ? dom.getAttrib(tableElm, 'cellpadding') : '', - border: tableElm ? dom.getAttrib(tableElm, 'border') : '', - caption: !!dom.select('caption', tableElm)[0] - }; - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(tableElm, 'align' + name)) { - data.align = name; - } - }); - - if (!tableElm) { - colsCtrl = {label: 'Cols', name: 'cols'}; - rowsCtrl = {label: 'Rows', name: 'rows'}; - } - - editor.windowManager.open({ - title: "Table properties", - items: { - type: 'form', - layout: 'grid', - columns: 2, - data: data, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - colsCtrl, - rowsCtrl, - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - {label: 'Cell spacing', name: 'cellspacing'}, - {label: 'Cell padding', name: 'cellpadding'}, - {label: 'Border', name: 'border'}, - {label: 'Caption', name: 'caption', type: 'checkbox'}, - { - label: 'Alignment', - minWidth: 90, - name: 'align', - type: 'listbox', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(), captionElm; - - editor.undoManager.transact(function() { - if (!tableElm) { - tableElm = insertTable(data.cols || 1, data.rows || 1); - } - - editor.dom.setAttribs(tableElm, { - cellspacing: data.cellspacing, - cellpadding: data.cellpadding, - border: data.border - }); - - editor.dom.setStyles(tableElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Toggle caption on/off - captionElm = dom.select('caption', tableElm)[0]; - - if (captionElm && !data.caption) { - dom.remove(captionElm); - } - - if (!captionElm && data.caption) { - captionElm = dom.create('caption'); - captionElm.innerHTML = !Env.ie ? '
    ' : '\u00a0'; - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - - unApplyAlign(tableElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, tableElm); - } - - editor.focus(); - editor.addVisual(); - }); - } - }); - } - - function mergeDialog(grid, cell) { - editor.windowManager.open({ - title: "Merge cells", - body: [ - {label: 'Cols', name: 'cols', type: 'textbox', size: 10}, - {label: 'Rows', name: 'rows', type: 'textbox', size: 10} - ], - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - grid.merge(cell, data.cols, data.rows); - }); - } - }); - } - - function cellDialog() { - var dom = editor.dom, cellElm, data, cells = []; - - // Get selected cells or the current cell - cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - if (!cells.length && cellElm) { - cells.push(cellElm); - } - - cellElm = cellElm || cells[0]; - - if (!cellElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')), - height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')), - scope: dom.getAttrib(cellElm, 'scope') - }; - - data.type = cellElm.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(cellElm, 'align' + name)) { - data.align = name; - } - }); - - each('top middle bottom'.split(' '), function(name) { - if (editor.formatter.matchNode(cellElm, 'valign' + name)) { - data.valign = name; - } - }); - - editor.windowManager.open({ - title: "Cell properties", - items: { - type: 'form', - data: data, - layout: 'grid', - columns: 2, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - { - label: 'Cell type', - name: 'type', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'Cell', value: 'td'}, - {text: 'Header cell', value: 'th'} - ] - }, - { - label: 'Scope', - name: 'scope', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Row', value: 'row'}, - {text: 'Column', value: 'col'}, - {text: 'Row group', value: 'rowgroup'}, - {text: 'Column group', value: 'colgroup'} - ] - }, - { - label: 'H Align', - name: 'align', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - }, - { - label: 'V Align', - name: 'valign', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Top', value: 'top'}, - {text: 'Middle', value: 'middle'}, - {text: 'Bottom', value: 'bottom'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - each(cells, function(cellElm) { - editor.dom.setAttrib(cellElm, 'scope', data.scope); - - editor.dom.setStyles(cellElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Switch cell type - if (data.type && cellElm.nodeName.toLowerCase() != data.type) { - cellElm = dom.rename(cellElm, data.type); - } - - // Apply/remove alignment - unApplyAlign(cellElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, cellElm); - } - - // Apply/remove vertical alignment - unApplyVAlign(cellElm); - if (data.valign) { - editor.formatter.apply('valign' + data.valign, {}, cellElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function rowDialog() { - var dom = editor.dom, tableElm, cellElm, rowElm, data, rows = []; - - tableElm = editor.dom.getParent(editor.selection.getStart(), 'table'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - - each(tableElm.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) { - rows.push(row); - return false; - } - }); - }); - - rowElm = rows[0]; - if (!rowElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')), - scope: dom.getAttrib(rowElm, 'scope') - }; - - data.type = rowElm.parentNode.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(rowElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Row properties", - items: { - type: 'form', - data: data, - columns: 2, - defaults: { - type: 'textbox' - }, - items: [ - { - type: 'listbox', - name: 'type', - label: 'Row type', - text: 'None', - maxWidth: null, - values: [ - {text: 'Header', value: 'thead'}, - {text: 'Body', value: 'tbody'}, - {text: 'Footer', value: 'tfoot'} - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - }, - {label: 'Height', name: 'height'} - ] - }, - - onsubmit: function() { - var data = this.toJSON(), tableElm, oldParentElm, parentElm; - - editor.undoManager.transact(function() { - var toType = data.type; - - each(rows, function(rowElm) { - editor.dom.setAttrib(rowElm, 'scope', data.scope); - - editor.dom.setStyles(rowElm, { - height: addSizeSuffix(data.height) - }); - - if (toType != rowElm.parentNode.nodeName.toLowerCase()) { - tableElm = dom.getParent(rowElm, 'table'); - - oldParentElm = rowElm.parentNode; - parentElm = dom.select(toType, tableElm)[0]; - if (!parentElm) { - parentElm = dom.create(toType); - if (tableElm.firstChild) { - tableElm.insertBefore(parentElm, tableElm.firstChild); - } else { - tableElm.appendChild(parentElm); - } - } - - parentElm.appendChild(rowElm); - - if (!oldParentElm.hasChildNodes()) { - dom.remove(oldParentElm); - } - } - - // Apply/remove alignment - unApplyAlign(rowElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, rowElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function cmd(command) { - return function() { - editor.execCommand(command); - }; - } - - function insertTable(cols, rows) { - var y, x, html; - - html = ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += '
    ' + (Env.ie ? " " : '
    ') + '
    '; - - editor.insertContent(html); - - var tableElm = editor.dom.get('__mce'); - editor.dom.setAttrib(tableElm, 'id', null); - - return tableElm; - } - - function handleDisabledState(ctrl, selector) { - function bindStateListener() { - ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector)); - - editor.selection.selectorChanged(selector, function(state) { - ctrl.disabled(!state); - }); - } - - if (editor.initialized) { - bindStateListener(); - } else { - editor.on('init', bindStateListener); - } - } - - function postRender() { - /*jshint validthis:true*/ - handleDisabledState(this, 'table'); - } - - function postRenderCell() { - /*jshint validthis:true*/ - handleDisabledState(this, 'td,th'); - } - - function generateTableGrid() { - var html = ''; - - html = ''; - - for (var y = 0; y < 10; y++) { - html += ''; - - for (var x = 0; x < 10; x++) { - html += ''; - } - - html += ''; - } - - html += '
    '; - - html += ''; - - return html; - } - - function selectGrid(tx, ty, control) { - var table = control.getEl().getElementsByTagName('table')[0]; - var x, y, focusCell, cell, active; - var rtl = control.isRtl() || control.parent().rel == 'tl-tr'; - - table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1); - - if (rtl) { - tx = 9 - tx; - } - - for (y = 0; y < 10; y++) { - for (x = 0; x < 10; x++) { - cell = table.rows[y].childNodes[x].firstChild; - active = (rtl ? x >= tx : x <= tx) && y <= ty; - - editor.dom.toggleClass(cell, 'mce-active', active); - - if (active) { - focusCell = cell; - } - } - } - - return focusCell.parentNode; - } - - if (editor.settings.table_grid === false) { - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - onclick: tableDialog - }); - } else { - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - ariaHideMenu: true, - onclick: function(e) { - if (e.aria) { - this.parent().hideAll(); - e.stopImmediatePropagation(); - tableDialog(); - } - }, - onshow: function() { - selectGrid(0, 0, this.menu.items()[0]); - }, - onhide: function() { - var elements = this.menu.items()[0].getEl().getElementsByTagName('a'); - editor.dom.removeClass(elements, 'mce-active'); - editor.dom.addClass(elements[0], 'mce-active'); - }, - menu: [ - { - type: 'container', - html: generateTableGrid(), - - onPostRender: function() { - this.lastX = this.lastY = 0; - }, - - onmousemove: function(e) { - var target = e.target, x, y; - - if (target.tagName.toUpperCase() == 'A') { - x = parseInt(target.getAttribute('data-mce-x'), 10); - y = parseInt(target.getAttribute('data-mce-y'), 10); - - if (this.isRtl() || this.parent().rel == 'tl-tr') { - x = 9 - x; - } - - if (x !== this.lastX || y !== this.lastY) { - selectGrid(x, y, e.control); - - this.lastX = x; - this.lastY = y; - } - } - }, - - onkeydown: function(e) { - var x = this.lastX, y = this.lastY, isHandled; - - switch (e.keyCode) { - case 37: // DOM_VK_LEFT - if (x > 0) { - x--; - isHandled = true; - } - break; - - case 39: // DOM_VK_RIGHT - isHandled = true; - - if (x < 9) { - x++; - } - break; - - case 38: // DOM_VK_UP - isHandled = true; - - if (y > 0) { - y--; - } - break; - - case 40: // DOM_VK_DOWN - isHandled = true; - - if (y < 9) { - y++; - } - break; - } - - if (isHandled) { - e.preventDefault(); - e.stopPropagation(); - - selectGrid(x, y, e.control).focus(); - - this.lastX = x; - this.lastY = y; - } - }, - - onclick: function(e) { - if (e.target.tagName.toUpperCase() == 'A') { - e.preventDefault(); - e.stopPropagation(); - this.parent().cancel(); - - insertTable(this.lastX + 1, this.lastY + 1); - } - } - } - ] - }); - } - - editor.addMenuItem('tableprops', { - text: 'Table properties', - context: 'table', - onPostRender: postRender, - onclick: tableDialog - }); - - editor.addMenuItem('deletetable', { - text: 'Delete table', - context: 'table', - onPostRender: postRender, - cmd: 'mceTableDelete' - }); - - editor.addMenuItem('cell', { - separator: 'before', - text: 'Cell', - context: 'table', - menu: [ - {text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell}, - {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell}, - {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('row', { - text: 'Row', - context: 'table', - menu: [ - {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell}, - {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell}, - {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell}, - {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell}, - {text: '-'}, - {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell}, - {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell}, - {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell}, - {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('column', { - text: 'Column', - context: 'table', - menu: [ - {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell}, - {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell}, - {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell} - ] - }); - - var menuItems = []; - each("inserttable tableprops deletetable | cell row column".split(' '), function(name) { - if (name == '|') { - menuItems.push({text: '-'}); - } else { - menuItems.push(editor.menuItems[name]); - } - }); - - editor.addButton("table", { - type: "menubutton", - title: "Table", - menu: menuItems - }); - - // Select whole table is a table border is clicked - if (!Env.isIE) { - editor.on('click', function(e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - editor.selection.select(e); - editor.nodeChanged(); - } - }); - } - - self.quirks = new Quirks(editor); - - editor.on('Init', function() { - winMan = editor.windowManager; - self.cellSelection = new CellSelection(editor); - }); - - // Register action commands - each({ - mceTableSplitCells: function(grid) { - grid.split(); - }, - - mceTableMergeCells: function(grid) { - var rowSpan, colSpan, cell; - - cell = editor.dom.getParent(editor.selection.getStart(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) { - mergeDialog(grid, cell); - } else { - grid.merge(); - } - }, - - mceTableInsertRowBefore: function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter: function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore: function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter: function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol: function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow: function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow: function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow: function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore: function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter: function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete: function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - editor.addCommand(name, function() { - var grid = new TableGrid(editor); - - if (grid) { - func(grid); - editor.execCommand('mceRepaint'); - self.cellSelection.clear(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable: function() { - tableDialog(); - }, - - mceTableRowProps: rowDialog, - mceTableCellProps: cellDialog - }, function(func, name) { - editor.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - - PluginManager.add('table', Plugin); -}); - -expose(["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Plugin"]); -})(this); \ No newline at end of file +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var noop = function () { + }; + var compose = function (fa, fb) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + function curry(fn) { + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; + } + var not = function (f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !f.apply(null, args); + }; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var nativePush = Array.prototype.push; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -1; + }; + var exists = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; + } + } + return false; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var eachr = function (xs, f) { + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldr = function (xs, f, acc) { + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var findIndex = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(i); + } + } + return Option.none(); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var forall = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; + } + } + return true; + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var last = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Option.none(); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var map$1 = function (obj, f) { + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); + }; + var tupleMap = function (obj, f) { + var r = {}; + each$1(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + var sort = function (arr) { + return arr.slice(0).sort(); + }; + var reqMessage = function (required, keys) { + throw new Error('All required keys (' + sort(required).join(', ') + ') were not specified. Specified keys were: ' + sort(keys).join(', ') + '.'); + }; + var unsuppMessage = function (unsupported) { + throw new Error('Unsupported keys for object: ' + sort(unsupported).join(', ')); + }; + var validateStrArr = function (label, array) { + if (!isArray(array)) { + throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.'); + } + each(array, function (a) { + if (!isString(a)) { + throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.'); + } + }); + }; + var invalidTypeMessage = function (incorrect, type) { + throw new Error('All values need to be of type: ' + type + '. Keys (' + sort(incorrect).join(', ') + ') were not.'); + }; + var checkDupes = function (everything) { + var sorted = sort(everything); + var dupe = find(sorted, function (s, i) { + return i < sorted.length - 1 && s === sorted[i + 1]; + }); + dupe.each(function (d) { + throw new Error('The field: ' + d + ' occurs more than once in the combined fields: [' + sorted.join(', ') + '].'); + }); + }; + + var MixedBag = function (required, optional) { + var everything = required.concat(optional); + if (everything.length === 0) { + throw new Error('You must specify at least one required or optional field.'); + } + validateStrArr('required', required); + validateStrArr('optional', optional); + checkDupes(everything); + return function (obj) { + var keys$1 = keys(obj); + var allReqd = forall(required, function (req) { + return contains(keys$1, req); + }); + if (!allReqd) { + reqMessage(required, keys$1); + } + var unsupported = filter(keys$1, function (key) { + return !contains(everything, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } + var r = {}; + each(required, function (req) { + r[req] = constant(obj[req]); + }); + each(optional, function (opt) { + r[opt] = constant(Object.prototype.hasOwnProperty.call(obj, opt) ? Option.some(obj[opt]) : Option.none()); + }); + return r; + }; + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var name = function (element) { + var r = element.dom().nodeName; + return r.toLowerCase(); + }; + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isComment = function (element) { + return type(element) === COMMENT || name(element) === '#comment'; + }; + var isElement = isType$1(ELEMENT); + var isText = isType$1(TEXT); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom(), key, value); + }; + var setAll = function (element, attrs) { + var dom = element.dom(); + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var get$1 = function (element, key) { + var v = element.dom().getAttribute(key); + return v === null ? undefined : v; + }; + var has$1 = function (element, key) { + var dom = element.dom(); + return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; + }; + var remove = function (element, key) { + element.dom().removeAttribute(key); + }; + var clone = function (element) { + return foldl(element.dom().attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); + }; + + var checkRange = function (str, substr, start) { + if (substr === '') { + return true; + } + if (str.length < substr.length) { + return false; + } + var x = str.substr(start, start + substr.length); + return x === substr; + }; + var contains$1 = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + var startsWith = function (str, prefix) { + return checkRange(str, prefix, 0); + }; + var endsWith = function (str, suffix) { + return checkRange(str, suffix, str.length - suffix.length); + }; + var trim = function (str) { + return str.replace(/^\s+|\s+$/g, ''); + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var cached = function (f) { + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + var body = cached(function () { + return getBody(Element.fromDom(domGlobals.document)); + }); + var getBody = function (doc) { + var b = doc.dom().body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return Element.fromDom(b); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } + }; + var internalRemove = function (dom, property) { + if (isSupported(dom)) { + dom.style.removeProperty(property); + } + }; + var set$1 = function (element, property, value) { + var dom = element.dom(); + internalSet(dom, property, value); + }; + var setAll$1 = function (element, css) { + var dom = element.dom(); + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$2 = function (element, property) { + var dom = element.dom(); + var styles = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + var getRaw = function (element, property) { + var dom = element.dom(); + var raw = getUnsafeProperty(dom, property); + return Option.from(raw).filter(function (r) { + return r.length > 0; + }); + }; + var remove$1 = function (element, property) { + var dom = element.dom(); + internalRemove(dom, property); + if (has$1(element, 'style') && trim(get$1(element, 'style')) === '') { + remove(element, 'style'); + } + }; + var copy = function (source, target) { + var sourceDom = source.dom(); + var targetDom = target.dom(); + if (isSupported(sourceDom) && isSupported(targetDom)) { + targetDom.style.cssText = sourceDom.style.cssText; + } + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var isOS = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains$1(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var ELEMENT$1 = ELEMENT; + var DOCUMENT$1 = DOCUMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + var bypassSelector = function (dom) { + return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.fromDom); + }; + var one = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.fromDom); + }; + + var eq = function (e1, e2) { + return e1.dom() === e2.dom(); + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom(); + var d2 = e2.dom(); + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$2 = browser.isIE() ? ieContains : regularContains; + var is$1 = is; + + var owner = function (element) { + return Element.fromDom(element.dom().ownerDocument); + }; + var defaultView = function (element) { + return Element.fromDom(element.dom().ownerDocument.defaultView); + }; + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.fromDom); + }; + var parents = function (element, isRoot) { + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom(); + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = Element.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var prevSibling = function (element) { + return Option.from(element.dom().previousSibling).map(Element.fromDom); + }; + var nextSibling = function (element) { + return Option.from(element.dom().nextSibling).map(Element.fromDom); + }; + var children = function (element) { + return map(element.dom().childNodes, Element.fromDom); + }; + var child = function (element, index) { + var cs = element.dom().childNodes; + return Option.from(cs[index]).map(Element.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var spot = Immutable('element', 'offset'); + + var before = function (marker, element) { + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom().insertBefore(element.dom(), marker.dom()); + }); + }; + var after = function (marker, element) { + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); + }); + }, function (v) { + before(v, element); + }); + }; + var prepend = function (parent, element) { + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom().insertBefore(element.dom(), v.dom()); + }); + }; + var append = function (parent, element) { + parent.dom().appendChild(element.dom()); + }; + var wrap = function (element, wrapper) { + before(element, wrapper); + append(wrapper, element); + }; + + var before$1 = function (marker, elements) { + each(elements, function (x) { + before(marker, x); + }); + }; + var after$1 = function (marker, elements) { + each(elements, function (x, i) { + var e = i === 0 ? marker : elements[i - 1]; + after(e, x); + }); + }; + var append$1 = function (parent, elements) { + each(elements, function (x) { + append(parent, x); + }); + }; + + var empty = function (element) { + element.dom().textContent = ''; + each(children(element), function (rogue) { + remove$2(rogue); + }); + }; + var remove$2 = function (element) { + var dom = element.dom(); + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + var unwrap = function (wrapper) { + var children$1 = children(wrapper); + if (children$1.length > 0) { + before$1(wrapper, children$1); + } + remove$2(wrapper); + }; + + var dimension = Immutable('width', 'height'); + var dimensions = Immutable('width', 'height'); + var grid = Immutable('rows', 'columns'); + var address = Immutable('row', 'column'); + var coords = Immutable('x', 'y'); + var detail = Immutable('element', 'rowspan', 'colspan'); + var detailnew = Immutable('element', 'rowspan', 'colspan', 'isNew'); + var extended = Immutable('element', 'rowspan', 'colspan', 'row', 'column'); + var rowdata = Immutable('element', 'cells', 'section'); + var elementnew = Immutable('element', 'isNew'); + var rowdatanew = Immutable('element', 'cells', 'section', 'isNew'); + var rowcells = Immutable('cells', 'section'); + var rowdetails = Immutable('details', 'section'); + var bounds = Immutable('startRow', 'startCol', 'finishRow', 'finishCol'); + + var ancestors = function (scope, predicate, isRoot) { + return filter(parents(scope, isRoot), predicate); + }; + var children$1 = function (scope, predicate) { + return filter(children(scope), predicate); + }; + var descendants = function (scope, predicate) { + var result = []; + each(children(scope), function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(descendants(x, predicate)); + }); + return result; + }; + + var ancestors$1 = function (scope, selector, isRoot) { + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var children$2 = function (scope, selector) { + return children$1(scope, function (e) { + return is(e, selector); + }); + }; + var descendants$1 = function (scope, selector) { + return all(selector, scope); + }; + + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot); + } + + var ancestor = function (scope, predicate, isRoot) { + var element = scope.dom(); + var stop = isFunction(isRoot) ? isRoot : constant(false); + while (element.parentNode) { + element = element.parentNode; + var el = Element.fromDom(element); + if (predicate(el)) { + return Option.some(el); + } else if (stop(el)) { + break; + } + } + return Option.none(); + }; + var closest = function (scope, predicate, isRoot) { + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); + }; + var child$1 = function (scope, predicate) { + var pred = function (node) { + return predicate(Element.fromDom(node)); + }; + var result = find(scope.dom().childNodes, pred); + return result.map(Element.fromDom); + }; + var descendant = function (scope, predicate) { + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = Element.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Option.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Option.none(); + }; + return descend(scope.dom()); + }; + + var ancestor$1 = function (scope, selector, isRoot) { + return ancestor(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var child$2 = function (scope, selector) { + return child$1(scope, function (e) { + return is(e, selector); + }); + }; + var descendant$1 = function (scope, selector) { + return one(selector, scope); + }; + var closest$1 = function (scope, selector, isRoot) { + return ClosestOrAncestor(is, ancestor$1, scope, selector, isRoot); + }; + + var firstLayer = function (scope, selector) { + return filterFirstLayer(scope, selector, constant(true)); + }; + var filterFirstLayer = function (scope, selector, predicate) { + return bind(children(scope), function (x) { + return is(x, selector) ? predicate(x) ? [x] : [] : filterFirstLayer(x, selector, predicate); + }); + }; + var LayerSelector = { + firstLayer: firstLayer, + filterFirstLayer: filterFirstLayer + }; + + var lookup = function (tags, element, isRoot) { + if (isRoot === void 0) { + isRoot = never; + } + if (isRoot(element)) { + return Option.none(); + } + if (contains(tags, name(element))) { + return Option.some(element); + } + var isRootOrUpperTable = function (elm) { + return is(elm, 'table') || isRoot(elm); + }; + return ancestor$1(element, tags.join(','), isRootOrUpperTable); + }; + var cell = function (element, isRoot) { + return lookup([ + 'td', + 'th' + ], element, isRoot); + }; + var cells = function (ancestor) { + return LayerSelector.firstLayer(ancestor, 'th,td'); + }; + var notCell = function (element, isRoot) { + return lookup([ + 'caption', + 'tr', + 'tbody', + 'tfoot', + 'thead' + ], element, isRoot); + }; + var neighbours = function (selector, element) { + return parent(element).map(function (parent) { + return children$2(parent, selector); + }); + }; + var neighbourCells = curry(neighbours, 'th,td'); + var neighbourRows = curry(neighbours, 'tr'); + var firstCell = function (ancestor) { + return descendant$1(ancestor, 'th,td'); + }; + var table = function (element, isRoot) { + return closest$1(element, 'table', isRoot); + }; + var row = function (element, isRoot) { + return lookup(['tr'], element, isRoot); + }; + var rows = function (ancestor) { + return LayerSelector.firstLayer(ancestor, 'tr'); + }; + var attr = function (element, property) { + return parseInt(get$1(element, property), 10); + }; + var grid$1 = function (element, rowProp, colProp) { + var rowsCount = attr(element, rowProp); + var cols = attr(element, colProp); + return grid(rowsCount, cols); + }; + var TableLookup = { + cell: cell, + firstCell: firstCell, + cells: cells, + neighbourCells: neighbourCells, + table: table, + row: row, + rows: rows, + notCell: notCell, + neighbourRows: neighbourRows, + attr: attr, + grid: grid$1 + }; + + var fromTable = function (table) { + var rows = TableLookup.rows(table); + return map(rows, function (row) { + var element = row; + var parent$1 = parent(element); + var parentSection = parent$1.map(function (p) { + var parentName = name(p); + return parentName === 'tfoot' || parentName === 'thead' || parentName === 'tbody' ? parentName : 'tbody'; + }).getOr('tbody'); + var cells = map(TableLookup.cells(row), function (cell) { + var rowspan = has$1(cell, 'rowspan') ? parseInt(get$1(cell, 'rowspan'), 10) : 1; + var colspan = has$1(cell, 'colspan') ? parseInt(get$1(cell, 'colspan'), 10) : 1; + return detail(cell, rowspan, colspan); + }); + return rowdata(element, cells, parentSection); + }); + }; + var fromPastedRows = function (rows, example) { + return map(rows, function (row) { + var cells = map(TableLookup.cells(row), function (cell) { + var rowspan = has$1(cell, 'rowspan') ? parseInt(get$1(cell, 'rowspan'), 10) : 1; + var colspan = has$1(cell, 'colspan') ? parseInt(get$1(cell, 'colspan'), 10) : 1; + return detail(cell, rowspan, colspan); + }); + return rowdata(row, cells, example.section()); + }); + }; + var DetailsList = { + fromTable: fromTable, + fromPastedRows: fromPastedRows + }; + + var key = function (row, column) { + return row + ',' + column; + }; + var getAt = function (warehouse, row, column) { + var raw = warehouse.access()[key(row, column)]; + return raw !== undefined ? Option.some(raw) : Option.none(); + }; + var findItem = function (warehouse, item, comparator) { + var filtered = filterItems(warehouse, function (detail) { + return comparator(item, detail.element()); + }); + return filtered.length > 0 ? Option.some(filtered[0]) : Option.none(); + }; + var filterItems = function (warehouse, predicate) { + var all = bind(warehouse.all(), function (r) { + return r.cells(); + }); + return filter(all, predicate); + }; + var generate = function (list) { + var access = {}; + var cells = []; + var maxRows = list.length; + var maxColumns = 0; + each(list, function (details, r) { + var currentRow = []; + each(details.cells(), function (detail) { + var start = 0; + while (access[key(r, start)] !== undefined) { + start++; + } + var current = extended(detail.element(), detail.rowspan(), detail.colspan(), r, start); + for (var i = 0; i < detail.colspan(); i++) { + for (var j = 0; j < detail.rowspan(); j++) { + var cr = r + j; + var cc = start + i; + var newpos = key(cr, cc); + access[newpos] = current; + maxColumns = Math.max(maxColumns, cc + 1); + } + } + currentRow.push(current); + }); + cells.push(rowdata(details.element(), currentRow, details.section())); + }); + var grid$1 = grid(maxRows, maxColumns); + return { + grid: constant(grid$1), + access: constant(access), + all: constant(cells) + }; + }; + var justCells = function (warehouse) { + var rows = map(warehouse.all(), function (w) { + return w.cells(); + }); + return flatten(rows); + }; + var Warehouse = { + generate: generate, + getAt: getAt, + findItem: findItem, + filterItems: filterItems, + justCells: justCells + }; + + var statsStruct = Immutable('minRow', 'minCol', 'maxRow', 'maxCol'); + var findSelectedStats = function (house, isSelected) { + var totalColumns = house.grid().columns(); + var totalRows = house.grid().rows(); + var minRow = totalRows; + var minCol = totalColumns; + var maxRow = 0; + var maxCol = 0; + each$1(house.access(), function (detail) { + if (isSelected(detail)) { + var startRow = detail.row(); + var endRow = startRow + detail.rowspan() - 1; + var startCol = detail.column(); + var endCol = startCol + detail.colspan() - 1; + if (startRow < minRow) { + minRow = startRow; + } else if (endRow > maxRow) { + maxRow = endRow; + } + if (startCol < minCol) { + minCol = startCol; + } else if (endCol > maxCol) { + maxCol = endCol; + } + } + }); + return statsStruct(minRow, minCol, maxRow, maxCol); + }; + var makeCell = function (list, seenSelected, rowIndex) { + var row = list[rowIndex].element(); + var td = Element.fromTag('td'); + append(td, Element.fromTag('br')); + var f = seenSelected ? append : prepend; + f(row, td); + }; + var fillInGaps = function (list, house, stats, isSelected) { + var totalColumns = house.grid().columns(); + var totalRows = house.grid().rows(); + for (var i = 0; i < totalRows; i++) { + var seenSelected = false; + for (var j = 0; j < totalColumns; j++) { + if (!(i < stats.minRow() || i > stats.maxRow() || j < stats.minCol() || j > stats.maxCol())) { + var needCell = Warehouse.getAt(house, i, j).filter(isSelected).isNone(); + if (needCell) { + makeCell(list, seenSelected, i); + } else { + seenSelected = true; + } + } + } + } + }; + var clean = function (table, stats) { + var emptyRows = filter(LayerSelector.firstLayer(table, 'tr'), function (row) { + return row.dom().childElementCount === 0; + }); + each(emptyRows, remove$2); + if (stats.minCol() === stats.maxCol() || stats.minRow() === stats.maxRow()) { + each(LayerSelector.firstLayer(table, 'th,td'), function (cell) { + remove(cell, 'rowspan'); + remove(cell, 'colspan'); + }); + } + remove(table, 'width'); + remove(table, 'height'); + remove$1(table, 'width'); + remove$1(table, 'height'); + }; + var extract = function (table, selectedSelector) { + var isSelected = function (detail) { + return is(detail.element(), selectedSelector); + }; + var list = DetailsList.fromTable(table); + var house = Warehouse.generate(list); + var stats = findSelectedStats(house, isSelected); + var selector = 'th:not(' + selectedSelector + ')' + ',td:not(' + selectedSelector + ')'; + var unselectedCells = LayerSelector.filterFirstLayer(table, 'th,td', function (cell) { + return is(cell, selector); + }); + each(unselectedCells, remove$2); + fillInGaps(list, house, stats, isSelected); + clean(table, stats); + return table; + }; + var CopySelected = { extract: extract }; + + var nbsp = '\xA0'; + + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Option.from(element.dom().nodeValue) : Option.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom().nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; + } + + var api = NodeValue(isText, 'text'); + var get$3 = function (element) { + return api.get(element); + }; + var getOption = function (element) { + return api.getOption(element); + }; + var set$2 = function (element, value) { + api.set(element, value); + }; + + var getEnd = function (element) { + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); + }; + var isTextNodeWithCursorPosition = function (el) { + return getOption(el).filter(function (text) { + return text.trim().length !== 0 || text.indexOf(nbsp) > -1; + }).isSome(); + }; + var elementsWithCursorPosition = [ + 'img', + 'br' + ]; + var isCursorPosition = function (elem) { + var hasCursorPosition = isTextNodeWithCursorPosition(elem); + return hasCursorPosition || contains(elementsWithCursorPosition, name(elem)); + }; + + var first = function (element) { + return descendant(element, isCursorPosition); + }; + var last$1 = function (element) { + return descendantRtl(element, isCursorPosition); + }; + var descendantRtl = function (scope, predicate) { + var descend = function (element) { + var children$1 = children(element); + for (var i = children$1.length - 1; i >= 0; i--) { + var child = children$1[i]; + if (predicate(child)) { + return Option.some(child); + } + var res = descend(child); + if (res.isSome()) { + return res; + } + } + return Option.none(); + }; + return descend(scope); + }; + + var clone$1 = function (original, isDeep) { + return Element.fromDom(original.dom().cloneNode(isDeep)); + }; + var shallow = function (original) { + return clone$1(original, false); + }; + var deep = function (original) { + return clone$1(original, true); + }; + var shallowAs = function (original, tag) { + var nu = Element.fromTag(tag); + var attributes = clone(original); + setAll(nu, attributes); + return nu; + }; + var copy$1 = function (original, tag) { + var nu = shallowAs(original, tag); + var cloneChildren = children(deep(original)); + append$1(nu, cloneChildren); + return nu; + }; + + var createCell = function () { + var td = Element.fromTag('td'); + append(td, Element.fromTag('br')); + return td; + }; + var replace = function (cell, tag, attrs) { + var replica = copy$1(cell, tag); + each$1(attrs, function (v, k) { + if (v === null) { + remove(replica, k); + } else { + set(replica, k, v); + } + }); + return replica; + }; + var pasteReplace = function (cell) { + return cell; + }; + var newRow = function (doc) { + return function () { + return Element.fromTag('tr', doc.dom()); + }; + }; + var cloneFormats = function (oldCell, newCell, formats) { + var first$1 = first(oldCell); + return first$1.map(function (firstText) { + var formatSelector = formats.join(','); + var parents = ancestors$1(firstText, formatSelector, function (element) { + return eq(element, oldCell); + }); + return foldr(parents, function (last, parent) { + var clonedFormat = shallow(parent); + remove(clonedFormat, 'contenteditable'); + append(last, clonedFormat); + return clonedFormat; + }, newCell); + }).getOr(newCell); + }; + var cellOperations = function (mutate, doc, formatsToClone) { + var newCell = function (prev) { + var docu = owner(prev.element()); + var td = Element.fromTag(name(prev.element()), docu.dom()); + var formats = formatsToClone.getOr([ + 'strong', + 'em', + 'b', + 'i', + 'span', + 'font', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'p', + 'div' + ]); + var lastNode = formats.length > 0 ? cloneFormats(prev.element(), td, formats) : td; + append(lastNode, Element.fromTag('br')); + copy(prev.element(), td); + remove$1(td, 'height'); + if (prev.colspan() !== 1) { + remove$1(prev.element(), 'width'); + } + mutate(prev.element(), td); + return td; + }; + return { + row: newRow(doc), + cell: newCell, + replace: replace, + gap: createCell + }; + }; + var paste = function (doc) { + return { + row: newRow(doc), + cell: createCell, + replace: pasteReplace, + gap: createCell + }; + }; + var TableFill = { + cellOperations: cellOperations, + paste: paste + }; + + var fromHtml$1 = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(Element.fromDom(div)); + }; + + var inSelection = function (bounds, detail) { + var leftEdge = detail.column(); + var rightEdge = detail.column() + detail.colspan() - 1; + var topEdge = detail.row(); + var bottomEdge = detail.row() + detail.rowspan() - 1; + return leftEdge <= bounds.finishCol() && rightEdge >= bounds.startCol() && (topEdge <= bounds.finishRow() && bottomEdge >= bounds.startRow()); + }; + var isWithin = function (bounds, detail) { + return detail.column() >= bounds.startCol() && detail.column() + detail.colspan() - 1 <= bounds.finishCol() && detail.row() >= bounds.startRow() && detail.row() + detail.rowspan() - 1 <= bounds.finishRow(); + }; + var isRectangular = function (warehouse, bounds) { + var isRect = true; + var detailIsWithin = curry(isWithin, bounds); + for (var i = bounds.startRow(); i <= bounds.finishRow(); i++) { + for (var j = bounds.startCol(); j <= bounds.finishCol(); j++) { + isRect = isRect && Warehouse.getAt(warehouse, i, j).exists(detailIsWithin); + } + } + return isRect ? Option.some(bounds) : Option.none(); + }; + var CellBounds = { + inSelection: inSelection, + isWithin: isWithin, + isRectangular: isRectangular + }; + + var getBounds = function (detailA, detailB) { + return bounds(Math.min(detailA.row(), detailB.row()), Math.min(detailA.column(), detailB.column()), Math.max(detailA.row() + detailA.rowspan() - 1, detailB.row() + detailB.rowspan() - 1), Math.max(detailA.column() + detailA.colspan() - 1, detailB.column() + detailB.colspan() - 1)); + }; + var getAnyBox = function (warehouse, startCell, finishCell) { + var startCoords = Warehouse.findItem(warehouse, startCell, eq); + var finishCoords = Warehouse.findItem(warehouse, finishCell, eq); + return startCoords.bind(function (sc) { + return finishCoords.map(function (fc) { + return getBounds(sc, fc); + }); + }); + }; + var getBox = function (warehouse, startCell, finishCell) { + return getAnyBox(warehouse, startCell, finishCell).bind(function (bounds) { + return CellBounds.isRectangular(warehouse, bounds); + }); + }; + var CellGroup = { + getAnyBox: getAnyBox, + getBox: getBox + }; + + var moveBy = function (warehouse, cell, row, column) { + return Warehouse.findItem(warehouse, cell, eq).bind(function (detail) { + var startRow = row > 0 ? detail.row() + detail.rowspan() - 1 : detail.row(); + var startCol = column > 0 ? detail.column() + detail.colspan() - 1 : detail.column(); + var dest = Warehouse.getAt(warehouse, startRow + row, startCol + column); + return dest.map(function (d) { + return d.element(); + }); + }); + }; + var intercepts = function (warehouse, start, finish) { + return CellGroup.getAnyBox(warehouse, start, finish).map(function (bounds) { + var inside = Warehouse.filterItems(warehouse, curry(CellBounds.inSelection, bounds)); + return map(inside, function (detail) { + return detail.element(); + }); + }); + }; + var parentCell = function (warehouse, innerCell) { + var isContainedBy = function (c1, c2) { + return contains$2(c2, c1); + }; + return Warehouse.findItem(warehouse, innerCell, isContainedBy).map(function (detail) { + return detail.element(); + }); + }; + var CellFinder = { + moveBy: moveBy, + intercepts: intercepts, + parentCell: parentCell + }; + + var moveBy$1 = function (cell, deltaRow, deltaColumn) { + return TableLookup.table(cell).bind(function (table) { + var warehouse = getWarehouse(table); + return CellFinder.moveBy(warehouse, cell, deltaRow, deltaColumn); + }); + }; + var intercepts$1 = function (table, first, last) { + var warehouse = getWarehouse(table); + return CellFinder.intercepts(warehouse, first, last); + }; + var nestedIntercepts = function (table, first, firstTable, last, lastTable) { + var warehouse = getWarehouse(table); + var optStartCell = eq(table, firstTable) ? Option.some(first) : CellFinder.parentCell(warehouse, first); + var optLastCell = eq(table, lastTable) ? Option.some(last) : CellFinder.parentCell(warehouse, last); + return optStartCell.bind(function (startCell) { + return optLastCell.bind(function (lastCell) { + return CellFinder.intercepts(warehouse, startCell, lastCell); + }); + }); + }; + var getBox$1 = function (table, first, last) { + var warehouse = getWarehouse(table); + return CellGroup.getBox(warehouse, first, last); + }; + var getWarehouse = function (table) { + var list = DetailsList.fromTable(table); + return Warehouse.generate(list); + }; + var TablePositions = { + moveBy: moveBy$1, + intercepts: intercepts$1, + nestedIntercepts: nestedIntercepts, + getBox: getBox$1 + }; + + var TagBoundaries = [ + 'body', + 'p', + 'div', + 'article', + 'aside', + 'figcaption', + 'figure', + 'footer', + 'header', + 'nav', + 'section', + 'ol', + 'ul', + 'li', + 'table', + 'thead', + 'tbody', + 'tfoot', + 'caption', + 'tr', + 'td', + 'th', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'pre', + 'address' + ]; + + function DomUniverse () { + var clone$1 = function (element) { + return Element.fromDom(element.dom().cloneNode(false)); + }; + var document = function (element) { + return element.dom().ownerDocument; + }; + var isBoundary = function (element) { + if (!isElement(element)) { + return false; + } + if (name(element) === 'body') { + return true; + } + return contains(TagBoundaries, name(element)); + }; + var isEmptyTag = function (element) { + if (!isElement(element)) { + return false; + } + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], name(element)); + }; + var isNonEditable = function (element) { + return isElement(element) && get$1(element, 'contenteditable') === 'false'; + }; + var comparePosition = function (element, other) { + return element.dom().compareDocumentPosition(other.dom()); + }; + var copyAttributesTo = function (source, destination) { + var as = clone(source); + setAll(destination, as); + }; + return { + up: constant({ + selector: ancestor$1, + closest: closest$1, + predicate: ancestor, + all: parents + }), + down: constant({ + selector: descendants$1, + predicate: descendants + }), + styles: constant({ + get: get$2, + getRaw: getRaw, + set: set$1, + remove: remove$1 + }), + attrs: constant({ + get: get$1, + set: set, + remove: remove, + copyTo: copyAttributesTo + }), + insert: constant({ + before: before, + after: after, + afterAll: after$1, + append: append, + appendAll: append$1, + prepend: prepend, + wrap: wrap + }), + remove: constant({ + unwrap: unwrap, + remove: remove$2 + }), + create: constant({ + nu: Element.fromTag, + clone: clone$1, + text: Element.fromText + }), + query: constant({ + comparePosition: comparePosition, + prevSibling: prevSibling, + nextSibling: nextSibling + }), + property: constant({ + children: children, + name: name, + parent: parent, + document: document, + isText: isText, + isComment: isComment, + isElement: isElement, + getText: get$3, + setText: set$2, + isBoundary: isBoundary, + isEmptyTag: isEmptyTag, + isNonEditable: isNonEditable + }), + eq: eq, + is: is$1 + }; + } + + var leftRight = Immutable('left', 'right'); + var brokenPath = Immutable('first', 'second', 'splits'); + var bisect = function (universe, parent, child) { + var children = universe.property().children(parent); + var index = findIndex(children, curry(universe.eq, child)); + return index.map(function (ind) { + return { + before: constant(children.slice(0, ind)), + after: constant(children.slice(ind + 1)) + }; + }); + }; + var breakToRight = function (universe, parent, child) { + return bisect(universe, parent, child).map(function (parts) { + var second = universe.create().clone(parent); + universe.insert().appendAll(second, parts.after()); + universe.insert().after(parent, second); + return leftRight(parent, second); + }); + }; + var breakToLeft = function (universe, parent, child) { + return bisect(universe, parent, child).map(function (parts) { + var prior = universe.create().clone(parent); + universe.insert().appendAll(prior, parts.before().concat([child])); + universe.insert().appendAll(parent, parts.after()); + universe.insert().before(parent, prior); + return leftRight(prior, parent); + }); + }; + var breakPath = function (universe, item, isTop, breaker) { + var next = function (child, group, splits) { + var fallback = brokenPath(child, Option.none(), splits); + if (isTop(child)) { + return brokenPath(child, group, splits); + } else { + return universe.property().parent(child).bind(function (parent) { + return breaker(universe, parent, child).map(function (breakage) { + var extra = [{ + first: breakage.left, + second: breakage.right + }]; + var nextChild = isTop(parent) ? parent : breakage.left(); + return next(nextChild, Option.some(breakage.right()), splits.concat(extra)); + }); + }).getOr(fallback); + } + }; + return next(item, Option.none(), []); + }; + + var all$1 = function (universe, look, elements, f) { + var head = elements[0]; + var tail = elements.slice(1); + return f(universe, look, head, tail); + }; + var oneAll = function (universe, look, elements) { + return elements.length > 0 ? all$1(universe, look, elements, unsafeOne) : Option.none(); + }; + var unsafeOne = function (universe, look, head, tail) { + var start = look(universe, head); + return foldr(tail, function (b, a) { + var current = look(universe, a); + return commonElement(universe, b, current); + }, start); + }; + var commonElement = function (universe, start, end) { + return start.bind(function (s) { + return end.filter(curry(universe.eq, s)); + }); + }; + + var eq$1 = function (universe, item) { + return curry(universe.eq, item); + }; + var unsafeSubset = function (universe, common, ps1, ps2) { + var children = universe.property().children(common); + if (universe.eq(common, ps1[0])) { + return Option.some([ps1[0]]); + } + if (universe.eq(common, ps2[0])) { + return Option.some([ps2[0]]); + } + var finder = function (ps) { + var topDown = reverse(ps); + var index = findIndex(topDown, eq$1(universe, common)).getOr(-1); + var item = index < topDown.length - 1 ? topDown[index + 1] : topDown[index]; + return findIndex(children, eq$1(universe, item)); + }; + var startIndex = finder(ps1); + var endIndex = finder(ps2); + return startIndex.bind(function (sIndex) { + return endIndex.map(function (eIndex) { + var first = Math.min(sIndex, eIndex); + var last = Math.max(sIndex, eIndex); + return children.slice(first, last + 1); + }); + }); + }; + var ancestors$2 = function (universe, start, end, isRoot) { + if (isRoot === void 0) { + isRoot = never; + } + var ps1 = [start].concat(universe.up().all(start)); + var ps2 = [end].concat(universe.up().all(end)); + var prune = function (path) { + var index = findIndex(path, isRoot); + return index.fold(function () { + return path; + }, function (ind) { + return path.slice(0, ind + 1); + }); + }; + var pruned1 = prune(ps1); + var pruned2 = prune(ps2); + var shared = find(pruned1, function (x) { + return exists(pruned2, eq$1(universe, x)); + }); + return { + firstpath: constant(pruned1), + secondpath: constant(pruned2), + shared: constant(shared) + }; + }; + var subset = function (universe, start, end) { + var ancs = ancestors$2(universe, start, end); + return ancs.shared().bind(function (shared) { + return unsafeSubset(universe, shared, ancs.firstpath(), ancs.secondpath()); + }); + }; + var SubsetFn = { + subset: subset, + ancestors: ancestors$2 + }; + + var sharedOne = oneAll; + var subset$1 = SubsetFn.subset; + var ancestors$3 = SubsetFn.ancestors; + var breakToLeft$1 = breakToLeft; + var breakToRight$1 = breakToRight; + var breakPath$1 = breakPath; + var Parent = { + sharedOne: sharedOne, + subset: subset$1, + ancestors: ancestors$3, + breakToLeft: breakToLeft$1, + breakToRight: breakToRight$1, + breakPath: breakPath$1 + }; + + var universe = DomUniverse(); + var sharedOne$1 = function (look, elements) { + return Parent.sharedOne(universe, function (_universe, element) { + return look(element); + }, elements); + }; + var subset$2 = function (start, finish) { + return Parent.subset(universe, start, finish); + }; + var ancestors$4 = function (start, finish, isRoot) { + return Parent.ancestors(universe, start, finish, isRoot); + }; + var breakToLeft$2 = function (parent, child) { + return Parent.breakToLeft(universe, parent, child); + }; + var breakToRight$2 = function (parent, child) { + return Parent.breakToRight(universe, parent, child); + }; + var breakPath$2 = function (child, isTop, breaker) { + return Parent.breakPath(universe, child, isTop, function (u, p, c) { + return breaker(p, c); + }); + }; + var DomParent = { + sharedOne: sharedOne$1, + subset: subset$2, + ancestors: ancestors$4, + breakToLeft: breakToLeft$2, + breakToRight: breakToRight$2, + breakPath: breakPath$2 + }; + + var create = MixedBag([ + 'boxes', + 'start', + 'finish' + ], []); + var Identified = { create: create }; + + var lookupTable = function (container) { + return ancestor$1(container, 'table'); + }; + var identify = function (start, finish, isRoot) { + var getIsRoot = function (rootTable) { + return function (element) { + return isRoot !== undefined && isRoot(element) || eq(element, rootTable); + }; + }; + if (eq(start, finish)) { + return Option.some(Identified.create({ + boxes: Option.some([start]), + start: start, + finish: finish + })); + } else { + return lookupTable(start).bind(function (startTable) { + return lookupTable(finish).bind(function (finishTable) { + if (eq(startTable, finishTable)) { + return Option.some(Identified.create({ + boxes: TablePositions.intercepts(startTable, start, finish), + start: start, + finish: finish + })); + } else if (contains$2(startTable, finishTable)) { + var ancestorCells = ancestors$1(finish, 'td,th', getIsRoot(startTable)); + var finishCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : finish; + return Option.some(Identified.create({ + boxes: TablePositions.nestedIntercepts(startTable, start, startTable, finish, finishTable), + start: start, + finish: finishCell + })); + } else if (contains$2(finishTable, startTable)) { + var ancestorCells = ancestors$1(start, 'td,th', getIsRoot(finishTable)); + var startCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : start; + return Option.some(Identified.create({ + boxes: TablePositions.nestedIntercepts(finishTable, start, startTable, finish, finishTable), + start: start, + finish: startCell + })); + } else { + return DomParent.ancestors(start, finish).shared().bind(function (lca) { + return closest$1(lca, 'table', isRoot).bind(function (lcaTable) { + var finishAncestorCells = ancestors$1(finish, 'td,th', getIsRoot(lcaTable)); + var finishCell = finishAncestorCells.length > 0 ? finishAncestorCells[finishAncestorCells.length - 1] : finish; + var startAncestorCells = ancestors$1(start, 'td,th', getIsRoot(lcaTable)); + var startCell = startAncestorCells.length > 0 ? startAncestorCells[startAncestorCells.length - 1] : start; + return Option.some(Identified.create({ + boxes: TablePositions.nestedIntercepts(lcaTable, start, startTable, finish, finishTable), + start: startCell, + finish: finishCell + })); + }); + }); + } + }); + }); + } + }; + var retrieve = function (container, selector) { + var sels = descendants$1(container, selector); + return sels.length > 0 ? Option.some(sels) : Option.none(); + }; + var getLast = function (boxes, lastSelectedSelector) { + return find(boxes, function (box) { + return is(box, lastSelectedSelector); + }); + }; + var getEdges = function (container, firstSelectedSelector, lastSelectedSelector) { + return descendant$1(container, firstSelectedSelector).bind(function (first) { + return descendant$1(container, lastSelectedSelector).bind(function (last) { + return DomParent.sharedOne(lookupTable, [ + first, + last + ]).map(function (tbl) { + return { + first: constant(first), + last: constant(last), + table: constant(tbl) + }; + }); + }); + }); + }; + var expandTo = function (finish, firstSelectedSelector) { + return ancestor$1(finish, 'table').bind(function (table) { + return descendant$1(table, firstSelectedSelector).bind(function (start) { + return identify(start, finish).bind(function (identified) { + return identified.boxes().map(function (boxes) { + return { + boxes: constant(boxes), + start: constant(identified.start()), + finish: constant(identified.finish()) + }; + }); + }); + }); + }); + }; + var shiftSelection = function (boxes, deltaRow, deltaColumn, firstSelectedSelector, lastSelectedSelector) { + return getLast(boxes, lastSelectedSelector).bind(function (last) { + return TablePositions.moveBy(last, deltaRow, deltaColumn).bind(function (finish) { + return expandTo(finish, firstSelectedSelector); + }); + }); + }; + var CellSelection = { + identify: identify, + retrieve: retrieve, + shiftSelection: shiftSelection, + getEdges: getEdges + }; + + var retrieve$1 = function (container, selector) { + return CellSelection.retrieve(container, selector); + }; + var retrieveBox = function (container, firstSelectedSelector, lastSelectedSelector) { + return CellSelection.getEdges(container, firstSelectedSelector, lastSelectedSelector).bind(function (edges) { + var isRoot = function (ancestor) { + return eq(container, ancestor); + }; + var firstAncestor = ancestor$1(edges.first(), 'thead,tfoot,tbody,table', isRoot); + var lastAncestor = ancestor$1(edges.last(), 'thead,tfoot,tbody,table', isRoot); + return firstAncestor.bind(function (fA) { + return lastAncestor.bind(function (lA) { + return eq(fA, lA) ? TablePositions.getBox(edges.table(), edges.first(), edges.last()) : Option.none(); + }); + }); + }); + }; + var TableSelection = { + retrieve: retrieve$1, + retrieveBox: retrieveBox + }; + + var selected = 'data-mce-selected'; + var selectedSelector = 'td[' + selected + '],th[' + selected + ']'; + var attributeSelector = '[' + selected + ']'; + var firstSelected = 'data-mce-first-selected'; + var firstSelectedSelector = 'td[' + firstSelected + '],th[' + firstSelected + ']'; + var lastSelected = 'data-mce-last-selected'; + var lastSelectedSelector = 'td[' + lastSelected + '],th[' + lastSelected + ']'; + var Ephemera = { + selected: constant(selected), + selectedSelector: constant(selectedSelector), + attributeSelector: constant(attributeSelector), + firstSelected: constant(firstSelected), + firstSelectedSelector: constant(firstSelectedSelector), + lastSelected: constant(lastSelected), + lastSelectedSelector: constant(lastSelectedSelector) + }; + + var generate$1 = function (cases) { + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + domGlobals.console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate$1 }; + + var type$1 = Adt.generate([ + { none: [] }, + { multiple: ['elements'] }, + { single: ['selection'] } + ]); + var cata = function (subject, onNone, onMultiple, onSingle) { + return subject.fold(onNone, onMultiple, onSingle); + }; + var SelectionTypes = { + cata: cata, + none: type$1.none, + multiple: type$1.multiple, + single: type$1.single + }; + + var selection = function (cell, selections) { + return SelectionTypes.cata(selections.get(), constant([]), identity, constant([cell])); + }; + var unmergable = function (cell, selections) { + var hasSpan = function (elem) { + return has$1(elem, 'rowspan') && parseInt(get$1(elem, 'rowspan'), 10) > 1 || has$1(elem, 'colspan') && parseInt(get$1(elem, 'colspan'), 10) > 1; + }; + var candidates = selection(cell, selections); + return candidates.length > 0 && forall(candidates, hasSpan) ? Option.some(candidates) : Option.none(); + }; + var mergable = function (table, selections) { + return SelectionTypes.cata(selections.get(), Option.none, function (cells, _env) { + if (cells.length === 0) { + return Option.none(); + } + return TableSelection.retrieveBox(table, Ephemera.firstSelectedSelector(), Ephemera.lastSelectedSelector()).bind(function (bounds) { + return cells.length > 1 ? Option.some({ + bounds: constant(bounds), + cells: constant(cells) + }) : Option.none(); + }); + }, Option.none); + }; + var CellOperations = { + mergable: mergable, + unmergable: unmergable, + selection: selection + }; + + var noMenu = function (cell) { + return { + element: constant(cell), + mergable: Option.none, + unmergable: Option.none, + selection: constant([cell]) + }; + }; + var forMenu = function (selections, table, cell) { + return { + element: constant(cell), + mergable: constant(CellOperations.mergable(table, selections)), + unmergable: constant(CellOperations.unmergable(cell, selections)), + selection: constant(CellOperations.selection(cell, selections)) + }; + }; + var notCell$1 = function (element) { + return noMenu(element); + }; + var paste$1 = Immutable('element', 'clipboard', 'generators'); + var pasteRows = function (selections, table, cell, clipboard, generators) { + return { + element: constant(cell), + mergable: Option.none, + unmergable: Option.none, + selection: constant(CellOperations.selection(cell, selections)), + clipboard: constant(clipboard), + generators: constant(generators) + }; + }; + var TableTargets = { + noMenu: noMenu, + forMenu: forMenu, + notCell: notCell$1, + paste: paste$1, + pasteRows: pasteRows + }; + + var extractSelected = function (cells) { + return TableLookup.table(cells[0]).map(deep).map(function (replica) { + return [CopySelected.extract(replica, Ephemera.attributeSelector())]; + }); + }; + var serializeElements = function (editor, elements) { + return map(elements, function (elm) { + return editor.selection.serializer.serialize(elm.dom(), {}); + }).join(''); + }; + var getTextContent = function (elements) { + return map(elements, function (element) { + return element.dom().innerText; + }).join(''); + }; + var registerEvents = function (editor, selections, actions, cellSelection) { + editor.on('BeforeGetContent', function (e) { + var multiCellContext = function (cells) { + e.preventDefault(); + extractSelected(cells).each(function (elements) { + e.content = e.format === 'text' ? getTextContent(elements) : serializeElements(editor, elements); + }); + }; + if (e.selection === true) { + SelectionTypes.cata(selections.get(), noop, multiCellContext, noop); + } + }); + editor.on('BeforeSetContent', function (e) { + if (e.selection === true && e.paste === true) { + var cellOpt = Option.from(editor.dom.getParent(editor.selection.getStart(), 'th,td')); + cellOpt.each(function (domCell) { + var cell = Element.fromDom(domCell); + TableLookup.table(cell).each(function (table) { + var elements = filter(fromHtml$1(e.content), function (content) { + return name(content) !== 'meta'; + }); + if (elements.length === 1 && name(elements[0]) === 'table') { + e.preventDefault(); + var doc = Element.fromDom(editor.getDoc()); + var generators = TableFill.paste(doc); + var targets = TableTargets.paste(cell, elements[0], generators); + actions.pasteCells(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + }); + } + }); + }); + } + }); + }; + var Clipboard = { registerEvents: registerEvents }; + + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom(); + if (isSupported(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$2(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$2(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; + } + + var api$1 = Dimension('height', function (element) { + var dom = element.dom(); + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + }); + var get$4 = function (element) { + return api$1.get(element); + }; + var getOuter = function (element) { + return api$1.getOuter(element); + }; + + var api$2 = Dimension('width', function (element) { + return element.dom().offsetWidth; + }); + var get$5 = function (element) { + return api$2.get(element); + }; + var getOuter$1 = function (element) { + return api$2.getOuter(element); + }; + + var platform$1 = detect$3(); + var needManualCalc = function () { + return platform$1.browser.isIE() || platform$1.browser.isEdge(); + }; + var toNumber = function (px, fallback) { + var num = parseFloat(px); + return isNaN(num) ? fallback : num; + }; + var getProp = function (elm, name, fallback) { + return toNumber(get$2(elm, name), fallback); + }; + var getCalculatedHeight = function (cell) { + var paddingTop = getProp(cell, 'padding-top', 0); + var paddingBottom = getProp(cell, 'padding-bottom', 0); + var borderTop = getProp(cell, 'border-top-width', 0); + var borderBottom = getProp(cell, 'border-bottom-width', 0); + var height = cell.dom().getBoundingClientRect().height; + var boxSizing = get$2(cell, 'box-sizing'); + var borders = borderTop + borderBottom; + return boxSizing === 'border-box' ? height : height - paddingTop - paddingBottom - borders; + }; + var getWidth = function (cell) { + return getProp(cell, 'width', get$5(cell)); + }; + var getHeight = function (cell) { + return needManualCalc() ? getCalculatedHeight(cell) : getProp(cell, 'height', get$4(cell)); + }; + var RuntimeSize = { + getWidth: getWidth, + getHeight: getHeight + }; + + var genericSizeRegex = /(\d+(\.\d+)?)(\w|%)*/; + var percentageBasedSizeRegex = /(\d+(\.\d+)?)%/; + var pixelBasedSizeRegex = /(\d+(\.\d+)?)px|em/; + var setPixelWidth = function (cell, amount) { + set$1(cell, 'width', amount + 'px'); + }; + var setPercentageWidth = function (cell, amount) { + set$1(cell, 'width', amount + '%'); + }; + var setHeight = function (cell, amount) { + set$1(cell, 'height', amount + 'px'); + }; + var getHeightValue = function (cell) { + return getRaw(cell, 'height').getOrThunk(function () { + return RuntimeSize.getHeight(cell) + 'px'; + }); + }; + var convert = function (cell, number, getter, setter) { + var newSize = TableLookup.table(cell).map(function (table) { + var total = getter(table); + return Math.floor(number / 100 * total); + }).getOr(number); + setter(cell, newSize); + return newSize; + }; + var normalizePixelSize = function (value, cell, getter, setter) { + var number = parseInt(value, 10); + return endsWith(value, '%') && name(cell) !== 'table' ? convert(cell, number, getter, setter) : number; + }; + var getTotalHeight = function (cell) { + var value = getHeightValue(cell); + if (!value) { + return get$4(cell); + } + return normalizePixelSize(value, cell, get$4, setHeight); + }; + var get$6 = function (cell, type, f) { + var v = f(cell); + var span = getSpan(cell, type); + return v / span; + }; + var getSpan = function (cell, type) { + return has$1(cell, type) ? parseInt(get$1(cell, type), 10) : 1; + }; + var getRawWidth = function (element) { + var cssWidth = getRaw(element, 'width'); + return cssWidth.fold(function () { + return Option.from(get$1(element, 'width')); + }, function (width) { + return Option.some(width); + }); + }; + var normalizePercentageWidth = function (cellWidth, tableSize) { + return cellWidth / tableSize.pixelWidth() * 100; + }; + var choosePercentageSize = function (element, width, tableSize) { + var percentMatch = percentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + return parseFloat(percentMatch[1]); + } else { + var intWidth = get$5(element); + return normalizePercentageWidth(intWidth, tableSize); + } + }; + var getPercentageWidth = function (cell, tableSize) { + var width = getRawWidth(cell); + return width.fold(function () { + var intWidth = get$5(cell); + return normalizePercentageWidth(intWidth, tableSize); + }, function (w) { + return choosePercentageSize(cell, w, tableSize); + }); + }; + var normalizePixelWidth = function (cellWidth, tableSize) { + return cellWidth / 100 * tableSize.pixelWidth(); + }; + var choosePixelSize = function (element, width, tableSize) { + var pixelMatch = pixelBasedSizeRegex.exec(width); + if (pixelMatch !== null) { + return parseInt(pixelMatch[1], 10); + } + var percentMatch = percentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + var floatWidth = parseFloat(percentMatch[1]); + return normalizePixelWidth(floatWidth, tableSize); + } + return get$5(element); + }; + var getPixelWidth = function (cell, tableSize) { + var width = getRawWidth(cell); + return width.fold(function () { + return get$5(cell); + }, function (w) { + return choosePixelSize(cell, w, tableSize); + }); + }; + var getHeight$1 = function (cell) { + return get$6(cell, 'rowspan', getTotalHeight); + }; + var getGenericWidth = function (cell) { + var width = getRawWidth(cell); + return width.bind(function (w) { + var match = genericSizeRegex.exec(w); + if (match !== null) { + return Option.some({ + width: constant(parseFloat(match[1])), + unit: constant(match[3]) + }); + } else { + return Option.none(); + } + }); + }; + var setGenericWidth = function (cell, amount, unit) { + set$1(cell, 'width', amount + unit); + }; + var Sizes = { + percentageBasedSizeRegex: constant(percentageBasedSizeRegex), + pixelBasedSizeRegex: constant(pixelBasedSizeRegex), + setPixelWidth: setPixelWidth, + setPercentageWidth: setPercentageWidth, + setHeight: setHeight, + getPixelWidth: getPixelWidth, + getPercentageWidth: getPercentageWidth, + getGenericWidth: getGenericWidth, + setGenericWidth: setGenericWidth, + getHeight: getHeight$1, + getRawWidth: getRawWidth + }; + + var halve = function (main, other) { + var width = Sizes.getGenericWidth(main); + width.each(function (w) { + var newWidth = w.width() / 2; + Sizes.setGenericWidth(main, newWidth, w.unit()); + Sizes.setGenericWidth(other, newWidth, w.unit()); + }); + }; + var CellMutations = { halve: halve }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: constant(left), + top: constant(top), + translate: translate + }; + }; + var Position = r; + + var boxPosition = function (dom) { + var box = dom.getBoundingClientRect(); + return Position(box.left, box.top); + }; + var firstDefinedOrZero = function (a, b) { + return a !== undefined ? a : b !== undefined ? b : 0; + }; + var absolute = function (element) { + var doc = element.dom().ownerDocument; + var body = doc.body; + var win = doc.defaultView; + var html = doc.documentElement; + if (body === element.dom()) { + return Position(body.offsetLeft, body.offsetTop); + } + var scrollTop = firstDefinedOrZero(win.pageYOffset, html.scrollTop); + var scrollLeft = firstDefinedOrZero(win.pageXOffset, html.scrollLeft); + var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); + var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); + return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); + }; + var viewport = function (element) { + var dom = element.dom(); + var doc = dom.ownerDocument; + var body = doc.body; + if (body === dom) { + return Position(body.offsetLeft, body.offsetTop); + } + if (!inBody(element)) { + return Position(0, 0); + } + return boxPosition(dom); + }; + + var rowInfo = Immutable('row', 'y'); + var colInfo = Immutable('col', 'x'); + var rtlEdge = function (cell) { + var pos = absolute(cell); + return pos.left() + getOuter$1(cell); + }; + var ltrEdge = function (cell) { + return absolute(cell).left(); + }; + var getLeftEdge = function (index, cell) { + return colInfo(index, ltrEdge(cell)); + }; + var getRightEdge = function (index, cell) { + return colInfo(index, rtlEdge(cell)); + }; + var getTop = function (cell) { + return absolute(cell).top(); + }; + var getTopEdge = function (index, cell) { + return rowInfo(index, getTop(cell)); + }; + var getBottomEdge = function (index, cell) { + return rowInfo(index, getTop(cell) + getOuter(cell)); + }; + var findPositions = function (getInnerEdge, getOuterEdge, array) { + if (array.length === 0) { + return []; + } + var lines = map(array.slice(1), function (cellOption, index) { + return cellOption.map(function (cell) { + return getInnerEdge(index, cell); + }); + }); + var lastLine = array[array.length - 1].map(function (cell) { + return getOuterEdge(array.length - 1, cell); + }); + return lines.concat([lastLine]); + }; + var negate = function (step) { + return -step; + }; + var height = { + delta: identity, + positions: function (optElements) { + return findPositions(getTopEdge, getBottomEdge, optElements); + }, + edge: getTop + }; + var ltr = { + delta: identity, + edge: ltrEdge, + positions: function (optElements) { + return findPositions(getLeftEdge, getRightEdge, optElements); + } + }; + var rtl = { + delta: negate, + edge: rtlEdge, + positions: function (optElements) { + return findPositions(getRightEdge, getLeftEdge, optElements); + } + }; + var BarPositions = { + height: height, + rtl: rtl, + ltr: ltr + }; + + var ResizeDirection = { + ltr: BarPositions.ltr, + rtl: BarPositions.rtl + }; + + function TableDirection (directionAt) { + var auto = function (table) { + return directionAt(table).isRtl() ? ResizeDirection.rtl : ResizeDirection.ltr; + }; + var delta = function (amount, table) { + return auto(table).delta(amount, table); + }; + var positions = function (cols, table) { + return auto(table).positions(cols, table); + }; + var edge = function (cell) { + return auto(cell).edge(cell); + }; + return { + delta: delta, + edge: edge, + positions: positions + }; + } + + var getGridSize = function (table) { + var input = DetailsList.fromTable(table); + var warehouse = Warehouse.generate(input); + return warehouse.grid(); + }; + var TableGridSize = { getGridSize: getGridSize }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + + var setIfNot = function (element, property, value, ignore) { + if (value === ignore) { + remove(element, property); + } else { + set(element, property, value); + } + }; + var render = function (table, grid) { + var newRows = []; + var newCells = []; + var renderSection = function (gridSection, sectionName) { + var section = child$2(table, sectionName).getOrThunk(function () { + var tb = Element.fromTag(sectionName, owner(table).dom()); + append(table, tb); + return tb; + }); + empty(section); + var rows = map(gridSection, function (row) { + if (row.isNew()) { + newRows.push(row.element()); + } + var tr = row.element(); + empty(tr); + each(row.cells(), function (cell) { + if (cell.isNew()) { + newCells.push(cell.element()); + } + setIfNot(cell.element(), 'colspan', cell.colspan(), 1); + setIfNot(cell.element(), 'rowspan', cell.rowspan(), 1); + append(tr, cell.element()); + }); + return tr; + }); + append$1(section, rows); + }; + var removeSection = function (sectionName) { + child$2(table, sectionName).each(remove$2); + }; + var renderOrRemoveSection = function (gridSection, sectionName) { + if (gridSection.length > 0) { + renderSection(gridSection, sectionName); + } else { + removeSection(sectionName); + } + }; + var headSection = []; + var bodySection = []; + var footSection = []; + each(grid, function (row) { + switch (row.section()) { + case 'thead': + headSection.push(row); + break; + case 'tbody': + bodySection.push(row); + break; + case 'tfoot': + footSection.push(row); + break; + } + }); + renderOrRemoveSection(headSection, 'thead'); + renderOrRemoveSection(bodySection, 'tbody'); + renderOrRemoveSection(footSection, 'tfoot'); + return { + newRows: constant(newRows), + newCells: constant(newCells) + }; + }; + var copy$2 = function (grid) { + var rows = map(grid, function (row) { + var tr = shallow(row.element()); + each(row.cells(), function (cell) { + var clonedCell = deep(cell.element()); + setIfNot(clonedCell, 'colspan', cell.colspan(), 1); + setIfNot(clonedCell, 'rowspan', cell.rowspan(), 1); + append(tr, clonedCell); + }); + return tr; + }); + return rows; + }; + var Redraw = { + render: render, + copy: copy$2 + }; + + var read = function (element, attr) { + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add = function (element, attr, id) { + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; + }; + var remove$3 = function (element, attr, id) { + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove(element, attr); + } + return false; + }; + + var supports = function (element) { + return element.dom().classList !== undefined; + }; + var get$7 = function (element) { + return read(element, 'class'); + }; + var add$1 = function (element, clazz) { + return add(element, 'class', clazz); + }; + var remove$4 = function (element, clazz) { + return remove$3(element, 'class', clazz); + }; + + var add$2 = function (element, clazz) { + if (supports(element)) { + element.dom().classList.add(clazz); + } else { + add$1(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom().classList : get$7(element); + if (classList.length === 0) { + remove(element, 'class'); + } + }; + var remove$5 = function (element, clazz) { + if (supports(element)) { + var classList = element.dom().classList; + classList.remove(clazz); + } else { + remove$4(element, clazz); + } + cleanClass(element); + }; + var has$2 = function (element, clazz) { + return supports(element) && element.dom().classList.contains(clazz); + }; + + var repeat = function (repititions, f) { + var r = []; + for (var i = 0; i < repititions; i++) { + r.push(f(i)); + } + return r; + }; + var range = function (start, end) { + var r = []; + for (var i = start; i < end; i++) { + r.push(i); + } + return r; + }; + var deduce = function (xs, index) { + if (index < 0 || index >= xs.length - 1) { + return Option.none(); + } + var current = xs[index].fold(function () { + var rest = reverse(xs.slice(0, index)); + return findMap(rest, function (a, i) { + return a.map(function (aa) { + return { + value: aa, + delta: i + 1 + }; + }); + }); + }, function (c) { + return Option.some({ + value: c, + delta: 0 + }); + }); + var next = xs[index + 1].fold(function () { + var rest = xs.slice(index + 1); + return findMap(rest, function (a, i) { + return a.map(function (aa) { + return { + value: aa, + delta: i + 1 + }; + }); + }); + }, function (n) { + return Option.some({ + value: n, + delta: 1 + }); + }); + return current.bind(function (c) { + return next.map(function (n) { + var extras = n.delta + c.delta; + return Math.abs(n.value - c.value) / extras; + }); + }); + }; + + var columns = function (warehouse) { + var grid = warehouse.grid(); + var cols = range(0, grid.columns()); + var rowsArr = range(0, grid.rows()); + return map(cols, function (col) { + var getBlock = function () { + return bind(rowsArr, function (r) { + return Warehouse.getAt(warehouse, r, col).filter(function (detail) { + return detail.column() === col; + }).fold(constant([]), function (detail) { + return [detail]; + }); + }); + }; + var isSingle = function (detail) { + return detail.colspan() === 1; + }; + var getFallback = function () { + return Warehouse.getAt(warehouse, 0, col); + }; + return decide(getBlock, isSingle, getFallback); + }); + }; + var decide = function (getBlock, isSingle, getFallback) { + var inBlock = getBlock(); + var singleInBlock = find(inBlock, isSingle); + var detailOption = singleInBlock.orThunk(function () { + return Option.from(inBlock[0]).orThunk(getFallback); + }); + return detailOption.map(function (detail) { + return detail.element(); + }); + }; + var rows$1 = function (warehouse) { + var grid = warehouse.grid(); + var rowsArr = range(0, grid.rows()); + var cols = range(0, grid.columns()); + return map(rowsArr, function (row) { + var getBlock = function () { + return bind(cols, function (c) { + return Warehouse.getAt(warehouse, row, c).filter(function (detail) { + return detail.row() === row; + }).fold(constant([]), function (detail) { + return [detail]; + }); + }); + }; + var isSingle = function (detail) { + return detail.rowspan() === 1; + }; + var getFallback = function () { + return Warehouse.getAt(warehouse, row, 0); + }; + return decide(getBlock, isSingle, getFallback); + }); + }; + var Blocks = { + columns: columns, + rows: rows$1 + }; + + var css = function (namespace) { + var dashNamespace = namespace.replace(/\./g, '-'); + var resolve = function (str) { + return dashNamespace + '-' + str; + }; + return { resolve: resolve }; + }; + + var styles = css('ephox-snooker'); + var Styles = { resolve: styles.resolve }; + + var col = function (column, x, y, w, h) { + var bar = Element.fromTag('div'); + setAll$1(bar, { + position: 'absolute', + left: x - w / 2 + 'px', + top: y + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(bar, { + 'data-column': column, + 'role': 'presentation' + }); + return bar; + }; + var row$1 = function (r, x, y, w, h) { + var bar = Element.fromTag('div'); + setAll$1(bar, { + position: 'absolute', + left: x + 'px', + top: y - h / 2 + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(bar, { + 'data-row': r, + 'role': 'presentation' + }); + return bar; + }; + var Bar = { + col: col, + row: row$1 + }; + + var resizeBar = Styles.resolve('resizer-bar'); + var resizeRowBar = Styles.resolve('resizer-rows'); + var resizeColBar = Styles.resolve('resizer-cols'); + var BAR_THICKNESS = 7; + var destroy = function (wire) { + var previous = descendants$1(wire.parent(), '.' + resizeBar); + each(previous, remove$2); + }; + var drawBar = function (wire, positions, create) { + var origin = wire.origin(); + each(positions, function (cpOption, i) { + cpOption.each(function (cp) { + var bar = create(origin, cp); + add$2(bar, resizeBar); + append(wire.parent(), bar); + }); + }); + }; + var refreshCol = function (wire, colPositions, position, tableHeight) { + drawBar(wire, colPositions, function (origin, cp) { + var colBar = Bar.col(cp.col(), cp.x() - origin.left(), position.top() - origin.top(), BAR_THICKNESS, tableHeight); + add$2(colBar, resizeColBar); + return colBar; + }); + }; + var refreshRow = function (wire, rowPositions, position, tableWidth) { + drawBar(wire, rowPositions, function (origin, cp) { + var rowBar = Bar.row(cp.row(), position.left() - origin.left(), cp.y() - origin.top(), tableWidth, BAR_THICKNESS); + add$2(rowBar, resizeRowBar); + return rowBar; + }); + }; + var refreshGrid = function (wire, table, rows, cols, hdirection, vdirection) { + var position = absolute(table); + var rowPositions = rows.length > 0 ? hdirection.positions(rows, table) : []; + refreshRow(wire, rowPositions, position, getOuter$1(table)); + var colPositions = cols.length > 0 ? vdirection.positions(cols, table) : []; + refreshCol(wire, colPositions, position, getOuter(table)); + }; + var refresh = function (wire, table, hdirection, vdirection) { + destroy(wire); + var list = DetailsList.fromTable(table); + var warehouse = Warehouse.generate(list); + var rows = Blocks.rows(warehouse); + var cols = Blocks.columns(warehouse); + refreshGrid(wire, table, rows, cols, hdirection, vdirection); + }; + var each$2 = function (wire, f) { + var bars = descendants$1(wire.parent(), '.' + resizeBar); + each(bars, f); + }; + var hide = function (wire) { + each$2(wire, function (bar) { + set$1(bar, 'display', 'none'); + }); + }; + var show = function (wire) { + each$2(wire, function (bar) { + set$1(bar, 'display', 'block'); + }); + }; + var isRowBar = function (element) { + return has$2(element, resizeRowBar); + }; + var isColBar = function (element) { + return has$2(element, resizeColBar); + }; + var Bars = { + refresh: refresh, + hide: hide, + show: show, + destroy: destroy, + isRowBar: isRowBar, + isColBar: isColBar + }; + + var addCell = function (gridRow, index, cell) { + var cells = gridRow.cells(); + var before = cells.slice(0, index); + var after = cells.slice(index); + var newCells = before.concat([cell]).concat(after); + return setCells(gridRow, newCells); + }; + var mutateCell = function (gridRow, index, cell) { + var cells = gridRow.cells(); + cells[index] = cell; + }; + var setCells = function (gridRow, cells) { + return rowcells(cells, gridRow.section()); + }; + var mapCells = function (gridRow, f) { + var cells = gridRow.cells(); + var r = map(cells, f); + return rowcells(r, gridRow.section()); + }; + var getCell = function (gridRow, index) { + return gridRow.cells()[index]; + }; + var getCellElement = function (gridRow, index) { + return getCell(gridRow, index).element(); + }; + var cellLength = function (gridRow) { + return gridRow.cells().length; + }; + var GridRow = { + addCell: addCell, + setCells: setCells, + mutateCell: mutateCell, + getCell: getCell, + getCellElement: getCellElement, + mapCells: mapCells, + cellLength: cellLength + }; + + var getColumn = function (grid, index) { + return map(grid, function (row) { + return GridRow.getCell(row, index); + }); + }; + var getRow = function (grid, index) { + return grid[index]; + }; + var findDiff = function (xs, comp) { + if (xs.length === 0) { + return 0; + } + var first = xs[0]; + var index = findIndex(xs, function (x) { + return !comp(first.element(), x.element()); + }); + return index.fold(function () { + return xs.length; + }, function (ind) { + return ind; + }); + }; + var subgrid = function (grid, row, column, comparator) { + var restOfRow = getRow(grid, row).cells().slice(column); + var endColIndex = findDiff(restOfRow, comparator); + var restOfColumn = getColumn(grid, column).slice(row); + var endRowIndex = findDiff(restOfColumn, comparator); + return { + colspan: constant(endColIndex), + rowspan: constant(endRowIndex) + }; + }; + var TableGrid = { subgrid: subgrid }; + + var toDetails = function (grid, comparator) { + var seen = map(grid, function (row, ri) { + return map(row.cells(), function (col, ci) { + return false; + }); + }); + var updateSeen = function (ri, ci, rowspan, colspan) { + for (var r = ri; r < ri + rowspan; r++) { + for (var c = ci; c < ci + colspan; c++) { + seen[r][c] = true; + } + } + }; + return map(grid, function (row, ri) { + var details = bind(row.cells(), function (cell, ci) { + if (seen[ri][ci] === false) { + var result = TableGrid.subgrid(grid, ri, ci, comparator); + updateSeen(ri, ci, result.rowspan(), result.colspan()); + return [detailnew(cell.element(), result.rowspan(), result.colspan(), cell.isNew())]; + } else { + return []; + } + }); + return rowdetails(details, row.section()); + }); + }; + var toGrid = function (warehouse, generators, isNew) { + var grid = []; + for (var i = 0; i < warehouse.grid().rows(); i++) { + var rowCells = []; + for (var j = 0; j < warehouse.grid().columns(); j++) { + var element = Warehouse.getAt(warehouse, i, j).map(function (item) { + return elementnew(item.element(), isNew); + }).getOrThunk(function () { + return elementnew(generators.gap(), true); + }); + rowCells.push(element); + } + var row = rowcells(rowCells, warehouse.all()[i].section()); + grid.push(row); + } + return grid; + }; + var Transitions = { + toDetails: toDetails, + toGrid: toGrid + }; + + var fromWarehouse = function (warehouse, generators) { + return Transitions.toGrid(warehouse, generators, false); + }; + var deriveRows = function (rendered, generators) { + var findRow = function (details) { + var rowOfCells = findMap(details, function (detail) { + return parent(detail.element()).map(function (row) { + var isNew = parent(row).isNone(); + return elementnew(row, isNew); + }); + }); + return rowOfCells.getOrThunk(function () { + return elementnew(generators.row(), true); + }); + }; + return map(rendered, function (details) { + var row = findRow(details.details()); + return rowdatanew(row.element(), details.details(), details.section(), row.isNew()); + }); + }; + var toDetailList = function (grid, generators) { + var rendered = Transitions.toDetails(grid, eq); + return deriveRows(rendered, generators); + }; + var findInWarehouse = function (warehouse, element) { + var all = flatten(map(warehouse.all(), function (r) { + return r.cells(); + })); + return find(all, function (e) { + return eq(element, e.element()); + }); + }; + var run = function (operation, extract, adjustment, postAction, genWrappers) { + return function (wire, table, target, generators, direction) { + var input = DetailsList.fromTable(table); + var warehouse = Warehouse.generate(input); + var output = extract(warehouse, target).map(function (info) { + var model = fromWarehouse(warehouse, generators); + var result = operation(model, info, eq, genWrappers(generators)); + var grid = toDetailList(result.grid(), generators); + return { + grid: constant(grid), + cursor: result.cursor + }; + }); + return output.fold(function () { + return Option.none(); + }, function (out) { + var newElements = Redraw.render(table, out.grid()); + adjustment(table, out.grid(), direction); + postAction(table); + Bars.refresh(wire, table, BarPositions.height, direction); + return Option.some({ + cursor: out.cursor, + newRows: newElements.newRows, + newCells: newElements.newCells + }); + }); + }; + }; + var onCell = function (warehouse, target) { + return TableLookup.cell(target.element()).bind(function (cell) { + return findInWarehouse(warehouse, cell); + }); + }; + var onPaste = function (warehouse, target) { + return TableLookup.cell(target.element()).bind(function (cell) { + return findInWarehouse(warehouse, cell).map(function (details) { + var value = __assign(__assign({}, details), { + generators: target.generators, + clipboard: target.clipboard + }); + return value; + }); + }); + }; + var onPasteRows = function (warehouse, target) { + var details = map(target.selection(), function (cell) { + return TableLookup.cell(cell).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Option.some({ + cells: cells, + generators: target.generators, + clipboard: target.clipboard + }) : Option.none(); + }; + var onMergable = function (_warehouse, target) { + return target.mergable(); + }; + var onUnmergable = function (_warehouse, target) { + return target.unmergable(); + }; + var onCells = function (warehouse, target) { + var details = map(target.selection(), function (cell) { + return TableLookup.cell(cell).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Option.some(cells) : Option.none(); + }; + + var value = function (o) { + var is = function (v) { + return o === v; + }; + var or = function (opt) { + return value(o); + }; + var orThunk = function (f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOption = function () { + return Option.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOption: toOption + }; + }; + var error = function (message) { + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOption: Option.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var measure = function (startAddress, gridA, gridB) { + if (startAddress.row() >= gridA.length || startAddress.column() > GridRow.cellLength(gridA[0])) { + return Result.error('invalid start address out of table bounds, row: ' + startAddress.row() + ', column: ' + startAddress.column()); + } + var rowRemainder = gridA.slice(startAddress.row()); + var colRemainder = rowRemainder[0].cells().slice(startAddress.column()); + var colRequired = GridRow.cellLength(gridB[0]); + var rowRequired = gridB.length; + return Result.value({ + rowDelta: constant(rowRemainder.length - rowRequired), + colDelta: constant(colRemainder.length - colRequired) + }); + }; + var measureWidth = function (gridA, gridB) { + var colLengthA = GridRow.cellLength(gridA[0]); + var colLengthB = GridRow.cellLength(gridB[0]); + return { + rowDelta: constant(0), + colDelta: constant(colLengthA - colLengthB) + }; + }; + var fill = function (cells, generator) { + return map(cells, function () { + return elementnew(generator.cell(), true); + }); + }; + var rowFill = function (grid, amount, generator) { + return grid.concat(repeat(amount, function (_row) { + return GridRow.setCells(grid[grid.length - 1], fill(grid[grid.length - 1].cells(), generator)); + })); + }; + var colFill = function (grid, amount, generator) { + return map(grid, function (row) { + return GridRow.setCells(row, row.cells().concat(fill(range(0, amount), generator))); + }); + }; + var tailor = function (gridA, delta, generator) { + var fillCols = delta.colDelta() < 0 ? colFill : identity; + var fillRows = delta.rowDelta() < 0 ? rowFill : identity; + var modifiedCols = fillCols(gridA, Math.abs(delta.colDelta()), generator); + var tailoredGrid = fillRows(modifiedCols, Math.abs(delta.rowDelta()), generator); + return tailoredGrid; + }; + var Fitment = { + measure: measure, + measureWidth: measureWidth, + tailor: tailor + }; + + var merge = function (grid, bounds, comparator, substitution) { + if (grid.length === 0) { + return grid; + } + for (var i = bounds.startRow(); i <= bounds.finishRow(); i++) { + for (var j = bounds.startCol(); j <= bounds.finishCol(); j++) { + GridRow.mutateCell(grid[i], j, elementnew(substitution(), false)); + } + } + return grid; + }; + var unmerge = function (grid, target, comparator, substitution) { + var first = true; + for (var i = 0; i < grid.length; i++) { + for (var j = 0; j < GridRow.cellLength(grid[0]); j++) { + var current = GridRow.getCellElement(grid[i], j); + var isToReplace = comparator(current, target); + if (isToReplace === true && first === false) { + GridRow.mutateCell(grid[i], j, elementnew(substitution(), true)); + } else if (isToReplace === true) { + first = false; + } + } + } + return grid; + }; + var uniqueCells = function (row, comparator) { + return foldl(row, function (rest, cell) { + return exists(rest, function (currentCell) { + return comparator(currentCell.element(), cell.element()); + }) ? rest : rest.concat([cell]); + }, []); + }; + var splitRows = function (grid, index, comparator, substitution) { + if (index > 0 && index < grid.length) { + var rowPrevCells = grid[index - 1].cells(); + var cells = uniqueCells(rowPrevCells, comparator); + each(cells, function (cell) { + var replacement = Option.none(); + var _loop_1 = function (i) { + var _loop_2 = function (j) { + var current = grid[i].cells()[j]; + var isToReplace = comparator(current.element(), cell.element()); + if (isToReplace) { + if (replacement.isNone()) { + replacement = Option.some(substitution()); + } + replacement.each(function (sub) { + GridRow.mutateCell(grid[i], j, elementnew(sub, true)); + }); + } + }; + for (var j = 0; j < GridRow.cellLength(grid[0]); j++) { + _loop_2(j); + } + }; + for (var i = index; i < grid.length; i++) { + _loop_1(i); + } + }); + } + return grid; + }; + var MergingOperations = { + merge: merge, + unmerge: unmerge, + splitRows: splitRows + }; + + var isSpanning = function (grid, row, col, comparator) { + var candidate = GridRow.getCell(grid[row], col); + var matching = curry(comparator, candidate.element()); + var currentRow = grid[row]; + return grid.length > 1 && GridRow.cellLength(currentRow) > 1 && (col > 0 && matching(GridRow.getCellElement(currentRow, col - 1)) || col < currentRow.cells().length - 1 && matching(GridRow.getCellElement(currentRow, col + 1)) || row > 0 && matching(GridRow.getCellElement(grid[row - 1], col)) || row < grid.length - 1 && matching(GridRow.getCellElement(grid[row + 1], col))); + }; + var mergeTables = function (startAddress, gridA, gridB, generator, comparator) { + var startRow = startAddress.row(); + var startCol = startAddress.column(); + var mergeHeight = gridB.length; + var mergeWidth = GridRow.cellLength(gridB[0]); + var endRow = startRow + mergeHeight; + var endCol = startCol + mergeWidth; + for (var r = startRow; r < endRow; r++) { + for (var c = startCol; c < endCol; c++) { + if (isSpanning(gridA, r, c, comparator)) { + MergingOperations.unmerge(gridA, GridRow.getCellElement(gridA[r], c), comparator, generator.cell); + } + var newCell = GridRow.getCellElement(gridB[r - startRow], c - startCol); + var replacement = generator.replace(newCell); + GridRow.mutateCell(gridA[r], c, elementnew(replacement, true)); + } + } + return gridA; + }; + var merge$1 = function (startAddress, gridA, gridB, generator, comparator) { + var result = Fitment.measure(startAddress, gridA, gridB); + return result.map(function (delta) { + var fittedGrid = Fitment.tailor(gridA, delta, generator); + return mergeTables(startAddress, fittedGrid, gridB, generator, comparator); + }); + }; + var insert = function (index, gridA, gridB, generator, comparator) { + MergingOperations.splitRows(gridA, index, comparator, generator.cell); + var delta = Fitment.measureWidth(gridB, gridA); + var fittedNewGrid = Fitment.tailor(gridB, delta, generator); + var secondDelta = Fitment.measureWidth(gridA, fittedNewGrid); + var fittedOldGrid = Fitment.tailor(gridA, secondDelta, generator); + return fittedOldGrid.slice(0, index).concat(fittedNewGrid).concat(fittedOldGrid.slice(index, fittedOldGrid.length)); + }; + var TableMerge = { + merge: merge$1, + insert: insert + }; + + var insertRowAt = function (grid, index, example, comparator, substitution) { + var before = grid.slice(0, index); + var after = grid.slice(index); + var between = GridRow.mapCells(grid[example], function (ex, c) { + var withinSpan = index > 0 && index < grid.length && comparator(GridRow.getCellElement(grid[index - 1], c), GridRow.getCellElement(grid[index], c)); + var ret = withinSpan ? GridRow.getCell(grid[index], c) : elementnew(substitution(ex.element(), comparator), true); + return ret; + }); + return before.concat([between]).concat(after); + }; + var insertColumnAt = function (grid, index, example, comparator, substitution) { + return map(grid, function (row) { + var withinSpan = index > 0 && index < GridRow.cellLength(row) && comparator(GridRow.getCellElement(row, index - 1), GridRow.getCellElement(row, index)); + var sub = withinSpan ? GridRow.getCell(row, index) : elementnew(substitution(GridRow.getCellElement(row, example), comparator), true); + return GridRow.addCell(row, index, sub); + }); + }; + var splitCellIntoColumns = function (grid, exampleRow, exampleCol, comparator, substitution) { + var index = exampleCol + 1; + return map(grid, function (row, i) { + var isTargetCell = i === exampleRow; + var sub = isTargetCell ? elementnew(substitution(GridRow.getCellElement(row, exampleCol), comparator), true) : GridRow.getCell(row, exampleCol); + return GridRow.addCell(row, index, sub); + }); + }; + var splitCellIntoRows = function (grid, exampleRow, exampleCol, comparator, substitution) { + var index = exampleRow + 1; + var before = grid.slice(0, index); + var after = grid.slice(index); + var between = GridRow.mapCells(grid[exampleRow], function (ex, i) { + var isTargetCell = i === exampleCol; + return isTargetCell ? elementnew(substitution(ex.element(), comparator), true) : ex; + }); + return before.concat([between]).concat(after); + }; + var deleteColumnsAt = function (grid, start, finish) { + var rows = map(grid, function (row) { + var cells = row.cells().slice(0, start).concat(row.cells().slice(finish + 1)); + return rowcells(cells, row.section()); + }); + return filter(rows, function (row) { + return row.cells().length > 0; + }); + }; + var deleteRowsAt = function (grid, start, finish) { + return grid.slice(0, start).concat(grid.slice(finish + 1)); + }; + var ModificationOperations = { + insertRowAt: insertRowAt, + insertColumnAt: insertColumnAt, + splitCellIntoColumns: splitCellIntoColumns, + splitCellIntoRows: splitCellIntoRows, + deleteRowsAt: deleteRowsAt, + deleteColumnsAt: deleteColumnsAt + }; + + var replaceIn = function (grid, targets, comparator, substitution) { + var isTarget = function (cell) { + return exists(targets, function (target) { + return comparator(cell.element(), target.element()); + }); + }; + return map(grid, function (row) { + return GridRow.mapCells(row, function (cell) { + return isTarget(cell) ? elementnew(substitution(cell.element(), comparator), true) : cell; + }); + }); + }; + var notStartRow = function (grid, rowIndex, colIndex, comparator) { + return GridRow.getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(GridRow.getCellElement(grid[rowIndex - 1], colIndex), GridRow.getCellElement(grid[rowIndex], colIndex))); + }; + var notStartColumn = function (row, index, comparator) { + return index > 0 && comparator(GridRow.getCellElement(row, index - 1), GridRow.getCellElement(row, index)); + }; + var replaceColumn = function (grid, index, comparator, substitution) { + var targets = bind(grid, function (row, i) { + var alreadyAdded = notStartRow(grid, i, index, comparator) || notStartColumn(row, index, comparator); + return alreadyAdded ? [] : [GridRow.getCell(row, index)]; + }); + return replaceIn(grid, targets, comparator, substitution); + }; + var replaceRow = function (grid, index, comparator, substitution) { + var targetRow = grid[index]; + var targets = bind(targetRow.cells(), function (item, i) { + var alreadyAdded = notStartRow(grid, index, i, comparator) || notStartColumn(targetRow, i, comparator); + return alreadyAdded ? [] : [item]; + }); + return replaceIn(grid, targets, comparator, substitution); + }; + var TransformOperations = { + replaceColumn: replaceColumn, + replaceRow: replaceRow + }; + + var adt = Adt.generate([ + { none: [] }, + { only: ['index'] }, + { + left: [ + 'index', + 'next' + ] + }, + { + middle: [ + 'prev', + 'index', + 'next' + ] + }, + { + right: [ + 'prev', + 'index' + ] + } + ]); + var ColumnContext = __assign({}, adt); + + var neighbours$1 = function (input, index) { + if (input.length === 0) { + return ColumnContext.none(); + } + if (input.length === 1) { + return ColumnContext.only(0); + } + if (index === 0) { + return ColumnContext.left(0, 1); + } + if (index === input.length - 1) { + return ColumnContext.right(index - 1, index); + } + if (index > 0 && index < input.length - 1) { + return ColumnContext.middle(index - 1, index, index + 1); + } + return ColumnContext.none(); + }; + var determine = function (input, column, step, tableSize) { + var result = input.slice(0); + var context = neighbours$1(input, column); + var zero = function (array) { + return map(array, constant(0)); + }; + var onNone = constant(zero(result)); + var onOnly = function (index) { + return tableSize.singleColumnWidth(result[index], step); + }; + var onChange = function (index, next) { + if (step >= 0) { + var newNext = Math.max(tableSize.minCellWidth(), result[next] - step); + return zero(result.slice(0, index)).concat([ + step, + newNext - result[next] + ]).concat(zero(result.slice(next + 1))); + } else { + var newThis = Math.max(tableSize.minCellWidth(), result[index] + step); + var diffx = result[index] - newThis; + return zero(result.slice(0, index)).concat([ + newThis - result[index], + diffx + ]).concat(zero(result.slice(next + 1))); + } + }; + var onLeft = onChange; + var onMiddle = function (_prev, index, next) { + return onChange(index, next); + }; + var onRight = function (_prev, index) { + if (step >= 0) { + return zero(result.slice(0, index)).concat([step]); + } else { + var size = Math.max(tableSize.minCellWidth(), result[index] + step); + return zero(result.slice(0, index)).concat([size - result[index]]); + } + }; + return context.fold(onNone, onOnly, onLeft, onMiddle, onRight); + }; + var Deltas = { determine: determine }; + + var getSpan$1 = function (cell, type) { + return has$1(cell, type) && parseInt(get$1(cell, type), 10) > 1; + }; + var hasColspan = function (cell) { + return getSpan$1(cell, 'colspan'); + }; + var hasRowspan = function (cell) { + return getSpan$1(cell, 'rowspan'); + }; + var getInt = function (element, property) { + return parseInt(get$2(element, property), 10); + }; + var CellUtils = { + hasColspan: hasColspan, + hasRowspan: hasRowspan, + minWidth: constant(10), + minHeight: constant(10), + getInt: getInt + }; + + var getRaw$1 = function (cell, property, getter) { + return getRaw(cell, property).fold(function () { + return getter(cell) + 'px'; + }, function (raw) { + return raw; + }); + }; + var getRawW = function (cell, tableSize) { + return getRaw$1(cell, 'width', function (e) { + return Sizes.getPixelWidth(e, tableSize); + }); + }; + var getRawH = function (cell) { + return getRaw$1(cell, 'height', Sizes.getHeight); + }; + var getWidthFrom = function (warehouse, direction, getWidth, fallback, tableSize) { + var columns = Blocks.columns(warehouse); + var backups = map(columns, function (cellOption) { + return cellOption.map(direction.edge); + }); + return map(columns, function (cellOption, c) { + var columnCell = cellOption.filter(not(CellUtils.hasColspan)); + return columnCell.fold(function () { + var deduced = deduce(backups, c); + return fallback(deduced); + }, function (cell) { + return getWidth(cell, tableSize); + }); + }); + }; + var getDeduced = function (deduced) { + return deduced.map(function (d) { + return d + 'px'; + }).getOr(''); + }; + var getRawWidths = function (warehouse, direction, tableSize) { + return getWidthFrom(warehouse, direction, getRawW, getDeduced, tableSize); + }; + var getPercentageWidths = function (warehouse, direction, tableSize) { + return getWidthFrom(warehouse, direction, Sizes.getPercentageWidth, function (deduced) { + return deduced.fold(function () { + return tableSize.minCellWidth(); + }, function (cellWidth) { + return cellWidth / tableSize.pixelWidth() * 100; + }); + }, tableSize); + }; + var getPixelWidths = function (warehouse, direction, tableSize) { + return getWidthFrom(warehouse, direction, Sizes.getPixelWidth, function (deduced) { + return deduced.getOrThunk(tableSize.minCellWidth); + }, tableSize); + }; + var getHeightFrom = function (warehouse, direction, getHeight, fallback) { + var rows = Blocks.rows(warehouse); + var backups = map(rows, function (cellOption) { + return cellOption.map(direction.edge); + }); + return map(rows, function (cellOption, c) { + var rowCell = cellOption.filter(not(CellUtils.hasRowspan)); + return rowCell.fold(function () { + var deduced = deduce(backups, c); + return fallback(deduced); + }, function (cell) { + return getHeight(cell); + }); + }); + }; + var getPixelHeights = function (warehouse, direction) { + return getHeightFrom(warehouse, direction, Sizes.getHeight, function (deduced) { + return deduced.getOrThunk(CellUtils.minHeight); + }); + }; + var getRawHeights = function (warehouse, direction) { + return getHeightFrom(warehouse, direction, getRawH, getDeduced); + }; + var ColumnSizes = { + getRawWidths: getRawWidths, + getPixelWidths: getPixelWidths, + getPercentageWidths: getPercentageWidths, + getPixelHeights: getPixelHeights, + getRawHeights: getRawHeights + }; + + var total = function (start, end, measures) { + var r = 0; + for (var i = start; i < end; i++) { + r += measures[i] !== undefined ? measures[i] : 0; + } + return r; + }; + var recalculateWidth = function (warehouse, widths) { + var all = Warehouse.justCells(warehouse); + return map(all, function (cell) { + var width = total(cell.column(), cell.column() + cell.colspan(), widths); + return { + element: cell.element, + width: constant(width), + colspan: cell.colspan + }; + }); + }; + var recalculateHeight = function (warehouse, heights) { + var all = Warehouse.justCells(warehouse); + return map(all, function (cell) { + var height = total(cell.row(), cell.row() + cell.rowspan(), heights); + return { + element: cell.element, + height: constant(height), + rowspan: cell.rowspan + }; + }); + }; + var matchRowHeight = function (warehouse, heights) { + return map(warehouse.all(), function (row, i) { + return { + element: row.element, + height: constant(heights[i]) + }; + }); + }; + var Recalculations = { + recalculateWidth: recalculateWidth, + recalculateHeight: recalculateHeight, + matchRowHeight: matchRowHeight + }; + + var percentageSize = function (width, element) { + var floatWidth = parseFloat(width); + var pixelWidth = get$5(element); + var getCellDelta = function (delta) { + return delta / pixelWidth * 100; + }; + var singleColumnWidth = function (w, _delta) { + return [100 - w]; + }; + var minCellWidth = function () { + return CellUtils.minWidth() / pixelWidth * 100; + }; + var setTableWidth = function (table, _newWidths, delta) { + var ratio = delta / 100; + var change = ratio * floatWidth; + Sizes.setPercentageWidth(table, floatWidth + change); + }; + return { + width: constant(floatWidth), + pixelWidth: constant(pixelWidth), + getWidths: ColumnSizes.getPercentageWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: minCellWidth, + setElementWidth: Sizes.setPercentageWidth, + setTableWidth: setTableWidth + }; + }; + var pixelSize = function (width) { + var getCellDelta = identity; + var singleColumnWidth = function (w, delta) { + var newNext = Math.max(CellUtils.minWidth(), w + delta); + return [newNext - w]; + }; + var setTableWidth = function (table, newWidths, _delta) { + var total = foldr(newWidths, function (b, a) { + return b + a; + }, 0); + Sizes.setPixelWidth(table, total); + }; + return { + width: constant(width), + pixelWidth: constant(width), + getWidths: ColumnSizes.getPixelWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: CellUtils.minWidth, + setElementWidth: Sizes.setPixelWidth, + setTableWidth: setTableWidth + }; + }; + var chooseSize = function (element, width) { + var percentMatch = Sizes.percentageBasedSizeRegex().exec(width); + if (percentMatch !== null) { + return percentageSize(percentMatch[1], element); + } + var pixelMatch = Sizes.pixelBasedSizeRegex().exec(width); + if (pixelMatch !== null) { + var intWidth = parseInt(pixelMatch[1], 10); + return pixelSize(intWidth); + } + var fallbackWidth = get$5(element); + return pixelSize(fallbackWidth); + }; + var getTableSize = function (element) { + var width = Sizes.getRawWidth(element); + return width.fold(function () { + var fallbackWidth = get$5(element); + return pixelSize(fallbackWidth); + }, function (w) { + return chooseSize(element, w); + }); + }; + var TableSize = { getTableSize: getTableSize }; + + var getWarehouse$1 = function (list) { + return Warehouse.generate(list); + }; + var sumUp = function (newSize) { + return foldr(newSize, function (b, a) { + return b + a; + }, 0); + }; + var getTableWarehouse = function (table) { + var list = DetailsList.fromTable(table); + return getWarehouse$1(list); + }; + var adjustWidth = function (table, delta, index, direction) { + var tableSize = TableSize.getTableSize(table); + var step = tableSize.getCellDelta(delta); + var warehouse = getTableWarehouse(table); + var widths = tableSize.getWidths(warehouse, direction, tableSize); + var deltas = Deltas.determine(widths, index, step, tableSize); + var newWidths = map(deltas, function (dx, i) { + return dx + widths[i]; + }); + var newSizes = Recalculations.recalculateWidth(warehouse, newWidths); + each(newSizes, function (cell) { + tableSize.setElementWidth(cell.element(), cell.width()); + }); + if (index === warehouse.grid().columns() - 1) { + tableSize.setTableWidth(table, newWidths, step); + } + }; + var adjustHeight = function (table, delta, index, direction) { + var warehouse = getTableWarehouse(table); + var heights = ColumnSizes.getPixelHeights(warehouse, direction); + var newHeights = map(heights, function (dy, i) { + return index === i ? Math.max(delta + dy, CellUtils.minHeight()) : dy; + }); + var newCellSizes = Recalculations.recalculateHeight(warehouse, newHeights); + var newRowSizes = Recalculations.matchRowHeight(warehouse, newHeights); + each(newRowSizes, function (row) { + Sizes.setHeight(row.element(), row.height()); + }); + each(newCellSizes, function (cell) { + Sizes.setHeight(cell.element(), cell.height()); + }); + var total = sumUp(newHeights); + Sizes.setHeight(table, total); + }; + var adjustWidthTo = function (table, list, direction) { + var tableSize = TableSize.getTableSize(table); + var warehouse = getWarehouse$1(list); + var widths = tableSize.getWidths(warehouse, direction, tableSize); + var newSizes = Recalculations.recalculateWidth(warehouse, widths); + each(newSizes, function (cell) { + tableSize.setElementWidth(cell.element(), cell.width()); + }); + if (newSizes.length > 0) { + tableSize.setTableWidth(table, widths, tableSize.getCellDelta(0)); + } + }; + var Adjustments = { + adjustWidth: adjustWidth, + adjustHeight: adjustHeight, + adjustWidthTo: adjustWidthTo + }; + + var base = function (handleUnsupported, required) { + return baseWith(handleUnsupported, required, { + validate: isFunction, + label: 'function' + }); + }; + var baseWith = function (handleUnsupported, required, pred) { + if (required.length === 0) { + throw new Error('You must specify at least one required field.'); + } + validateStrArr('required', required); + checkDupes(required); + return function (obj) { + var keys$1 = keys(obj); + var allReqd = forall(required, function (req) { + return contains(keys$1, req); + }); + if (!allReqd) { + reqMessage(required, keys$1); + } + handleUnsupported(required, keys$1); + var invalidKeys = filter(required, function (key) { + return !pred.validate(obj[key], key); + }); + if (invalidKeys.length > 0) { + invalidTypeMessage(invalidKeys, pred.label); + } + return obj; + }; + }; + var handleExact = function (required, keys) { + var unsupported = filter(keys, function (key) { + return !contains(required, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } + }; + var exactly = function (required) { + return base(handleExact, required); + }; + + var verifyGenerators = exactly([ + 'cell', + 'row', + 'replace', + 'gap' + ]); + var elementToData = function (element) { + var colspan = has$1(element, 'colspan') ? parseInt(get$1(element, 'colspan'), 10) : 1; + var rowspan = has$1(element, 'rowspan') ? parseInt(get$1(element, 'rowspan'), 10) : 1; + return { + element: constant(element), + colspan: constant(colspan), + rowspan: constant(rowspan) + }; + }; + var modification = function (generators, toData) { + if (toData === void 0) { + toData = elementToData; + } + verifyGenerators(generators); + var position = Cell(Option.none()); + var nu = function (data) { + return generators.cell(data); + }; + var nuFrom = function (element) { + var data = toData(element); + return nu(data); + }; + var add = function (element) { + var replacement = nuFrom(element); + if (position.get().isNone()) { + position.set(Option.some(replacement)); + } + recent = Option.some({ + item: element, + replacement: replacement + }); + return replacement; + }; + var recent = Option.none(); + var getOrInit = function (element, comparator) { + return recent.fold(function () { + return add(element); + }, function (p) { + return comparator(element, p.item) ? p.replacement : add(element); + }); + }; + return { + getOrInit: getOrInit, + cursor: position.get + }; + }; + var transform = function (scope, tag) { + return function (generators) { + var position = Cell(Option.none()); + verifyGenerators(generators); + var list = []; + var find$1 = function (element, comparator) { + return find(list, function (x) { + return comparator(x.item, element); + }); + }; + var makeNew = function (element) { + var attrs = { scope: scope }; + var cell = generators.replace(element, tag, attrs); + list.push({ + item: element, + sub: cell + }); + if (position.get().isNone()) { + position.set(Option.some(cell)); + } + return cell; + }; + var replaceOrInit = function (element, comparator) { + return find$1(element, comparator).fold(function () { + return makeNew(element); + }, function (p) { + return comparator(element, p.item) ? p.sub : makeNew(element); + }); + }; + return { + replaceOrInit: replaceOrInit, + cursor: position.get + }; + }; + }; + var merging = function (generators) { + verifyGenerators(generators); + var position = Cell(Option.none()); + var combine = function (cell) { + if (position.get().isNone()) { + position.set(Option.some(cell)); + } + return function () { + var raw = generators.cell({ + element: constant(cell), + colspan: constant(1), + rowspan: constant(1) + }); + remove$1(raw, 'width'); + remove$1(cell, 'width'); + return raw; + }; + }; + return { + combine: combine, + cursor: position.get + }; + }; + var Generators = { + modification: modification, + transform: transform, + merging: merging + }; + + var blockList = [ + 'body', + 'p', + 'div', + 'article', + 'aside', + 'figcaption', + 'figure', + 'footer', + 'header', + 'nav', + 'section', + 'ol', + 'ul', + 'table', + 'thead', + 'tfoot', + 'tbody', + 'caption', + 'tr', + 'td', + 'th', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'pre', + 'address' + ]; + var isList = function (universe, item) { + var tagName = universe.property().name(item); + return contains([ + 'ol', + 'ul' + ], tagName); + }; + var isBlock = function (universe, item) { + var tagName = universe.property().name(item); + return contains(blockList, tagName); + }; + var isFormatting = function (universe, item) { + var tagName = universe.property().name(item); + return contains([ + 'address', + 'pre', + 'p', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6' + ], tagName); + }; + var isHeading = function (universe, item) { + var tagName = universe.property().name(item); + return contains([ + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6' + ], tagName); + }; + var isContainer = function (universe, item) { + return contains([ + 'div', + 'li', + 'td', + 'th', + 'blockquote', + 'body', + 'caption' + ], universe.property().name(item)); + }; + var isEmptyTag = function (universe, item) { + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], universe.property().name(item)); + }; + var isFrame = function (universe, item) { + return universe.property().name(item) === 'iframe'; + }; + var isInline = function (universe, item) { + return !(isBlock(universe, item) || isEmptyTag(universe, item)) && universe.property().name(item) !== 'li'; + }; + var Structure = { + isBlock: isBlock, + isList: isList, + isFormatting: isFormatting, + isHeading: isHeading, + isContainer: isContainer, + isEmptyTag: isEmptyTag, + isFrame: isFrame, + isInline: isInline + }; + + var universe$1 = DomUniverse(); + var isBlock$1 = function (element) { + return Structure.isBlock(universe$1, element); + }; + var isList$1 = function (element) { + return Structure.isList(universe$1, element); + }; + var isFormatting$1 = function (element) { + return Structure.isFormatting(universe$1, element); + }; + var isHeading$1 = function (element) { + return Structure.isHeading(universe$1, element); + }; + var isContainer$1 = function (element) { + return Structure.isContainer(universe$1, element); + }; + var isEmptyTag$1 = function (element) { + return Structure.isEmptyTag(universe$1, element); + }; + var isFrame$1 = function (element) { + return Structure.isFrame(universe$1, element); + }; + var isInline$1 = function (element) { + return Structure.isInline(universe$1, element); + }; + var DomStructure = { + isBlock: isBlock$1, + isList: isList$1, + isFormatting: isFormatting$1, + isHeading: isHeading$1, + isContainer: isContainer$1, + isEmptyTag: isEmptyTag$1, + isFrame: isFrame$1, + isInline: isInline$1 + }; + + var merge$2 = function (cells) { + var isBr = function (el) { + return name(el) === 'br'; + }; + var advancedBr = function (children) { + return forall(children, function (c) { + return isBr(c) || isText(c) && get$3(c).trim().length === 0; + }); + }; + var isListItem = function (el) { + return name(el) === 'li' || ancestor(el, DomStructure.isList).isSome(); + }; + var siblingIsBlock = function (el) { + return nextSibling(el).map(function (rightSibling) { + if (DomStructure.isBlock(rightSibling)) { + return true; + } + if (DomStructure.isEmptyTag(rightSibling)) { + return name(rightSibling) === 'img' ? false : true; + } + return false; + }).getOr(false); + }; + var markCell = function (cell) { + return last$1(cell).bind(function (rightEdge) { + var rightSiblingIsBlock = siblingIsBlock(rightEdge); + return parent(rightEdge).map(function (parent) { + return rightSiblingIsBlock === true || isListItem(parent) || isBr(rightEdge) || DomStructure.isBlock(parent) && !eq(cell, parent) ? [] : [Element.fromTag('br')]; + }); + }).getOr([]); + }; + var markContent = function () { + var content = bind(cells, function (cell) { + var children$1 = children(cell); + return advancedBr(children$1) ? [] : children$1.concat(markCell(cell)); + }); + return content.length === 0 ? [Element.fromTag('br')] : content; + }; + var contents = markContent(); + empty(cells[0]); + append$1(cells[0], contents); + }; + var TableContent = { merge: merge$2 }; + + var prune = function (table) { + var cells = TableLookup.cells(table); + if (cells.length === 0) { + remove$2(table); + } + }; + var outcome = Immutable('grid', 'cursor'); + var elementFromGrid = function (grid, row, column) { + return findIn(grid, row, column).orThunk(function () { + return findIn(grid, 0, 0); + }); + }; + var findIn = function (grid, row, column) { + return Option.from(grid[row]).bind(function (r) { + return Option.from(r.cells()[column]).bind(function (c) { + return Option.from(c.element()); + }); + }); + }; + var bundle = function (grid, row, column) { + return outcome(grid, findIn(grid, row, column)); + }; + var uniqueRows = function (details) { + return foldl(details, function (rest, detail) { + return exists(rest, function (currentDetail) { + return currentDetail.row() === detail.row(); + }) ? rest : rest.concat([detail]); + }, []).sort(function (detailA, detailB) { + return detailA.row() - detailB.row(); + }); + }; + var uniqueColumns = function (details) { + return foldl(details, function (rest, detail) { + return exists(rest, function (currentDetail) { + return currentDetail.column() === detail.column(); + }) ? rest : rest.concat([detail]); + }, []).sort(function (detailA, detailB) { + return detailA.column() - detailB.column(); + }); + }; + var insertRowBefore = function (grid, detail, comparator, genWrappers) { + var example = detail.row(); + var targetIndex = detail.row(); + var newGrid = ModificationOperations.insertRowAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, targetIndex, detail.column()); + }; + var insertRowsBefore = function (grid, details, comparator, genWrappers) { + var example = details[0].row(); + var targetIndex = details[0].row(); + var rows = uniqueRows(details); + var newGrid = foldl(rows, function (newG, _row) { + return ModificationOperations.insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column()); + }; + var insertRowAfter = function (grid, detail, comparator, genWrappers) { + var example = detail.row(); + var targetIndex = detail.row() + detail.rowspan(); + var newGrid = ModificationOperations.insertRowAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, targetIndex, detail.column()); + }; + var insertRowsAfter = function (grid, details, comparator, genWrappers) { + var rows = uniqueRows(details); + var example = rows[rows.length - 1].row(); + var targetIndex = rows[rows.length - 1].row() + rows[rows.length - 1].rowspan(); + var newGrid = foldl(rows, function (newG, _row) { + return ModificationOperations.insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column()); + }; + var insertColumnBefore = function (grid, detail, comparator, genWrappers) { + var example = detail.column(); + var targetIndex = detail.column(); + var newGrid = ModificationOperations.insertColumnAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), targetIndex); + }; + var insertColumnsBefore = function (grid, details, comparator, genWrappers) { + var columns = uniqueColumns(details); + var example = columns[0].column(); + var targetIndex = columns[0].column(); + var newGrid = foldl(columns, function (newG, _row) { + return ModificationOperations.insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row(), targetIndex); + }; + var insertColumnAfter = function (grid, detail, comparator, genWrappers) { + var example = detail.column(); + var targetIndex = detail.column() + detail.colspan(); + var newGrid = ModificationOperations.insertColumnAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), targetIndex); + }; + var insertColumnsAfter = function (grid, details, comparator, genWrappers) { + var example = details[details.length - 1].column(); + var targetIndex = details[details.length - 1].column() + details[details.length - 1].colspan(); + var columns = uniqueColumns(details); + var newGrid = foldl(columns, function (newG, _row) { + return ModificationOperations.insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row(), targetIndex); + }; + var makeRowHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceRow(grid, detail.row(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var makeColumnHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceColumn(grid, detail.column(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var unmakeRowHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceRow(grid, detail.row(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var unmakeColumnHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceColumn(grid, detail.column(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var splitCellIntoColumns$1 = function (grid, detail, comparator, genWrappers) { + var newGrid = ModificationOperations.splitCellIntoColumns(grid, detail.row(), detail.column(), comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var splitCellIntoRows$1 = function (grid, detail, comparator, genWrappers) { + var newGrid = ModificationOperations.splitCellIntoRows(grid, detail.row(), detail.column(), comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var eraseColumns = function (grid, details, _comparator, _genWrappers) { + var columns = uniqueColumns(details); + var newGrid = ModificationOperations.deleteColumnsAt(grid, columns[0].column(), columns[columns.length - 1].column()); + var cursor = elementFromGrid(newGrid, details[0].row(), details[0].column()); + return outcome(newGrid, cursor); + }; + var eraseRows = function (grid, details, _comparator, _genWrappers) { + var rows = uniqueRows(details); + var newGrid = ModificationOperations.deleteRowsAt(grid, rows[0].row(), rows[rows.length - 1].row()); + var cursor = elementFromGrid(newGrid, details[0].row(), details[0].column()); + return outcome(newGrid, cursor); + }; + var mergeCells = function (grid, mergable, comparator, _genWrappers) { + var cells = mergable.cells(); + TableContent.merge(cells); + var newGrid = MergingOperations.merge(grid, mergable.bounds(), comparator, constant(cells[0])); + return outcome(newGrid, Option.from(cells[0])); + }; + var unmergeCells = function (grid, unmergable, comparator, genWrappers) { + var newGrid = foldr(unmergable, function (b, cell) { + return MergingOperations.unmerge(b, cell, comparator, genWrappers.combine(cell)); + }, grid); + return outcome(newGrid, Option.from(unmergable[0])); + }; + var pasteCells = function (grid, pasteDetails, comparator, _genWrappers) { + var gridify = function (table, generators) { + var list = DetailsList.fromTable(table); + var wh = Warehouse.generate(list); + return Transitions.toGrid(wh, generators, true); + }; + var gridB = gridify(pasteDetails.clipboard(), pasteDetails.generators()); + var startAddress = address(pasteDetails.row(), pasteDetails.column()); + var mergedGrid = TableMerge.merge(startAddress, grid, gridB, pasteDetails.generators(), comparator); + return mergedGrid.fold(function () { + return outcome(grid, Option.some(pasteDetails.element())); + }, function (nuGrid) { + var cursor = elementFromGrid(nuGrid, pasteDetails.row(), pasteDetails.column()); + return outcome(nuGrid, cursor); + }); + }; + var gridifyRows = function (rows, generators, example) { + var pasteDetails = DetailsList.fromPastedRows(rows, example); + var wh = Warehouse.generate(pasteDetails); + return Transitions.toGrid(wh, generators, true); + }; + var pasteRowsBefore = function (grid, pasteDetails, comparator, _genWrappers) { + var example = grid[pasteDetails.cells[0].row()]; + var index = pasteDetails.cells[0].row(); + var gridB = gridifyRows(pasteDetails.clipboard(), pasteDetails.generators(), example); + var mergedGrid = TableMerge.insert(index, grid, gridB, pasteDetails.generators(), comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row(), pasteDetails.cells[0].column()); + return outcome(mergedGrid, cursor); + }; + var pasteRowsAfter = function (grid, pasteDetails, comparator, _genWrappers) { + var example = grid[pasteDetails.cells[0].row()]; + var index = pasteDetails.cells[pasteDetails.cells.length - 1].row() + pasteDetails.cells[pasteDetails.cells.length - 1].rowspan(); + var gridB = gridifyRows(pasteDetails.clipboard(), pasteDetails.generators(), example); + var mergedGrid = TableMerge.insert(index, grid, gridB, pasteDetails.generators(), comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row(), pasteDetails.cells[0].column()); + return outcome(mergedGrid, cursor); + }; + var resize = Adjustments.adjustWidthTo; + var TableOperations = { + insertRowBefore: run(insertRowBefore, onCell, noop, noop, Generators.modification), + insertRowsBefore: run(insertRowsBefore, onCells, noop, noop, Generators.modification), + insertRowAfter: run(insertRowAfter, onCell, noop, noop, Generators.modification), + insertRowsAfter: run(insertRowsAfter, onCells, noop, noop, Generators.modification), + insertColumnBefore: run(insertColumnBefore, onCell, resize, noop, Generators.modification), + insertColumnsBefore: run(insertColumnsBefore, onCells, resize, noop, Generators.modification), + insertColumnAfter: run(insertColumnAfter, onCell, resize, noop, Generators.modification), + insertColumnsAfter: run(insertColumnsAfter, onCells, resize, noop, Generators.modification), + splitCellIntoColumns: run(splitCellIntoColumns$1, onCell, resize, noop, Generators.modification), + splitCellIntoRows: run(splitCellIntoRows$1, onCell, noop, noop, Generators.modification), + eraseColumns: run(eraseColumns, onCells, resize, prune, Generators.modification), + eraseRows: run(eraseRows, onCells, noop, prune, Generators.modification), + makeColumnHeader: run(makeColumnHeader, onCell, noop, noop, Generators.transform('row', 'th')), + unmakeColumnHeader: run(unmakeColumnHeader, onCell, noop, noop, Generators.transform(null, 'td')), + makeRowHeader: run(makeRowHeader, onCell, noop, noop, Generators.transform('col', 'th')), + unmakeRowHeader: run(unmakeRowHeader, onCell, noop, noop, Generators.transform(null, 'td')), + mergeCells: run(mergeCells, onMergable, noop, noop, Generators.merging), + unmergeCells: run(unmergeCells, onUnmergable, resize, noop, Generators.merging), + pasteCells: run(pasteCells, onPaste, resize, noop, Generators.modification), + pasteRowsBefore: run(pasteRowsBefore, onPasteRows, noop, noop, Generators.modification), + pasteRowsAfter: run(pasteRowsAfter, onPasteRows, noop, noop, Generators.modification) + }; + + var getBody$1 = function (editor) { + return Element.fromDom(editor.getBody()); + }; + var getPixelWidth$1 = function (elm) { + return elm.getBoundingClientRect().width; + }; + var getPixelHeight = function (elm) { + return elm.getBoundingClientRect().height; + }; + var getIsRoot = function (editor) { + return function (element) { + return eq(element, getBody$1(editor)); + }; + }; + var removePxSuffix = function (size) { + return size ? size.replace(/px$/, '') : ''; + }; + var addSizeSuffix = function (size) { + if (/^[0-9]+$/.test(size)) { + size += 'px'; + } + return size; + }; + var removeDataStyle = function (table) { + var dataStyleCells = descendants$1(table, 'td[data-mce-style],th[data-mce-style]'); + remove(table, 'data-mce-style'); + each(dataStyleCells, function (cell) { + remove(cell, 'data-mce-style'); + }); + }; + + var getDirection = function (element) { + return get$2(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + var ltr$1 = { isRtl: constant(false) }; + var rtl$1 = { isRtl: constant(true) }; + var directionAt = function (element) { + var dir = getDirection(element); + return dir === 'rtl' ? rtl$1 : ltr$1; + }; + var Direction = { directionAt: directionAt }; + + var defaultTableToolbar = 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol'; + var defaultStyles = { + 'border-collapse': 'collapse', + 'width': '100%' + }; + var defaultAttributes = { border: '1' }; + var getDefaultAttributes = function (editor) { + return editor.getParam('table_default_attributes', defaultAttributes, 'object'); + }; + var getDefaultStyles = function (editor) { + return editor.getParam('table_default_styles', defaultStyles, 'object'); + }; + var hasTableResizeBars = function (editor) { + return editor.getParam('table_resize_bars', true, 'boolean'); + }; + var hasTabNavigation = function (editor) { + return editor.getParam('table_tab_navigation', true, 'boolean'); + }; + var hasAdvancedCellTab = function (editor) { + return editor.getParam('table_cell_advtab', true, 'boolean'); + }; + var hasAdvancedRowTab = function (editor) { + return editor.getParam('table_row_advtab', true, 'boolean'); + }; + var hasAdvancedTableTab = function (editor) { + return editor.getParam('table_advtab', true, 'boolean'); + }; + var hasAppearanceOptions = function (editor) { + return editor.getParam('table_appearance_options', true, 'boolean'); + }; + var hasTableGrid = function (editor) { + return editor.getParam('table_grid', true, 'boolean'); + }; + var shouldStyleWithCss = function (editor) { + return editor.getParam('table_style_by_css', false, 'boolean'); + }; + var getCellClassList = function (editor) { + return editor.getParam('table_cell_class_list', [], 'array'); + }; + var getRowClassList = function (editor) { + return editor.getParam('table_row_class_list', [], 'array'); + }; + var getTableClassList = function (editor) { + return editor.getParam('table_class_list', [], 'array'); + }; + var isPercentagesForced = function (editor) { + return editor.getParam('table_responsive_width') === true; + }; + var isPixelsForced = function (editor) { + return editor.getParam('table_responsive_width') === false; + }; + var getToolbar = function (editor) { + return editor.getParam('table_toolbar', defaultTableToolbar); + }; + var getCloneElements = function (editor) { + var cloneElements = editor.getParam('table_clone_elements'); + if (isString(cloneElements)) { + return Option.some(cloneElements.split(/[ ,]/)); + } else if (Array.isArray(cloneElements)) { + return Option.some(cloneElements); + } else { + return Option.none(); + } + }; + var hasObjectResizing = function (editor) { + var objectResizing = editor.getParam('object_resizing', true); + return isString(objectResizing) ? objectResizing === 'table' : objectResizing; + }; + + var fireNewRow = function (editor, row) { + return editor.fire('newrow', { node: row }); + }; + var fireNewCell = function (editor, cell) { + return editor.fire('newcell', { node: cell }); + }; + var fireObjectResizeStart = function (editor, target, width, height) { + editor.fire('ObjectResizeStart', { + target: target, + width: width, + height: height + }); + }; + var fireObjectResized = function (editor, target, width, height) { + editor.fire('ObjectResized', { + target: target, + width: width, + height: height + }); + }; + var fireTableSelectionChange = function (editor, cells, start, finish, otherCells) { + editor.fire('TableSelectionChange', { + cells: cells, + start: start, + finish: finish, + otherCells: otherCells + }); + }; + var fireTableSelectionClear = function (editor) { + editor.fire('TableSelectionClear'); + }; + + var point = Immutable('element', 'offset'); + var delta = Immutable('element', 'deltaOffset'); + var range$1 = Immutable('element', 'start', 'finish'); + var points = Immutable('begin', 'end'); + var text = Immutable('element', 'text'); + + var scan = function (universe, element, direction) { + if (universe.property().isText(element) && universe.property().getText(element).trim().length === 0 || universe.property().isComment(element)) { + return direction(element).bind(function (elem) { + return scan(universe, elem, direction).orThunk(function () { + return Option.some(elem); + }); + }); + } else { + return Option.none(); + } + }; + var toEnd = function (universe, element) { + if (universe.property().isText(element)) { + return universe.property().getText(element).length; + } + var children = universe.property().children(element); + return children.length; + }; + var freefallRtl = function (universe, element) { + var candidate = scan(universe, element, universe.query().prevSibling).getOr(element); + if (universe.property().isText(candidate)) { + return point(candidate, toEnd(universe, candidate)); + } + var children = universe.property().children(candidate); + return children.length > 0 ? freefallRtl(universe, children[children.length - 1]) : point(candidate, toEnd(universe, candidate)); + }; + + var freefallRtl$1 = freefallRtl; + + var universe$2 = DomUniverse(); + var freefallRtl$2 = function (element) { + return freefallRtl$1(universe$2, element); + }; + + var TableActions = function (editor, lazyWire) { + var isTableBody = function (editor) { + return name(getBody$1(editor)) === 'table'; + }; + var lastRowGuard = function (table) { + var size = TableGridSize.getGridSize(table); + return isTableBody(editor) === false || size.rows() > 1; + }; + var lastColumnGuard = function (table) { + var size = TableGridSize.getGridSize(table); + return isTableBody(editor) === false || size.columns() > 1; + }; + var cloneFormats = getCloneElements(editor); + var execute = function (operation, guard, mutate, lazyWire) { + return function (table, target) { + removeDataStyle(table); + var wire = lazyWire(); + var doc = Element.fromDom(editor.getDoc()); + var direction = TableDirection(Direction.directionAt); + var generators = TableFill.cellOperations(mutate, doc, cloneFormats); + return guard(table) ? operation(wire, table, target, generators, direction).bind(function (result) { + each(result.newRows(), function (row) { + fireNewRow(editor, row.dom()); + }); + each(result.newCells(), function (cell) { + fireNewCell(editor, cell.dom()); + }); + return result.cursor().map(function (cell) { + var des = freefallRtl$2(cell); + var rng = editor.dom.createRng(); + rng.setStart(des.element().dom(), des.offset()); + rng.setEnd(des.element().dom(), des.offset()); + return rng; + }); + }) : Option.none(); + }; + }; + var deleteRow = execute(TableOperations.eraseRows, lastRowGuard, noop, lazyWire); + var deleteColumn = execute(TableOperations.eraseColumns, lastColumnGuard, noop, lazyWire); + var insertRowsBefore = execute(TableOperations.insertRowsBefore, always, noop, lazyWire); + var insertRowsAfter = execute(TableOperations.insertRowsAfter, always, noop, lazyWire); + var insertColumnsBefore = execute(TableOperations.insertColumnsBefore, always, CellMutations.halve, lazyWire); + var insertColumnsAfter = execute(TableOperations.insertColumnsAfter, always, CellMutations.halve, lazyWire); + var mergeCells = execute(TableOperations.mergeCells, always, noop, lazyWire); + var unmergeCells = execute(TableOperations.unmergeCells, always, noop, lazyWire); + var pasteRowsBefore = execute(TableOperations.pasteRowsBefore, always, noop, lazyWire); + var pasteRowsAfter = execute(TableOperations.pasteRowsAfter, always, noop, lazyWire); + var pasteCells = execute(TableOperations.pasteCells, always, noop, lazyWire); + return { + deleteRow: deleteRow, + deleteColumn: deleteColumn, + insertRowsBefore: insertRowsBefore, + insertRowsAfter: insertRowsAfter, + insertColumnsBefore: insertColumnsBefore, + insertColumnsAfter: insertColumnsAfter, + mergeCells: mergeCells, + unmergeCells: unmergeCells, + pasteRowsBefore: pasteRowsBefore, + pasteRowsAfter: pasteRowsAfter, + pasteCells: pasteCells + }; + }; + + var copyRows = function (table, target, generators) { + var list = DetailsList.fromTable(table); + var house = Warehouse.generate(list); + var details = onCells(house, target); + return details.map(function (selectedCells) { + var grid = Transitions.toGrid(house, generators, false); + var slicedGrid = grid.slice(selectedCells[0].row(), selectedCells[selectedCells.length - 1].row() + selectedCells[selectedCells.length - 1].rowspan()); + var slicedDetails = toDetailList(slicedGrid, generators); + return Redraw.copy(slicedDetails); + }); + }; + var CopyRows = { copyRows: copyRows }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getTDTHOverallStyle = function (dom, elm, name) { + var cells = dom.select('td,th', elm); + var firstChildStyle; + var checkChildren = function (firstChildStyle, elms) { + for (var i = 0; i < elms.length; i++) { + var currentStyle = dom.getStyle(elms[i], name); + if (typeof firstChildStyle === 'undefined') { + firstChildStyle = currentStyle; + } + if (firstChildStyle !== currentStyle) { + return ''; + } + } + return firstChildStyle; + }; + firstChildStyle = checkChildren(firstChildStyle, cells); + return firstChildStyle; + }; + var applyAlign = function (editor, elm, name) { + if (name) { + editor.formatter.apply('align' + name, {}, elm); + } + }; + var applyVAlign = function (editor, elm, name) { + if (name) { + editor.formatter.apply('valign' + name, {}, elm); + } + }; + var unApplyAlign = function (editor, elm) { + global$1.each('left center right'.split(' '), function (name) { + editor.formatter.remove('align' + name, {}, elm); + }); + }; + var unApplyVAlign = function (editor, elm) { + global$1.each('top middle bottom'.split(' '), function (name) { + editor.formatter.remove('valign' + name, {}, elm); + }); + }; + var Styles$1 = { + applyAlign: applyAlign, + applyVAlign: applyVAlign, + unApplyAlign: unApplyAlign, + unApplyVAlign: unApplyVAlign, + getTDTHOverallStyle: getTDTHOverallStyle + }; + + var buildListItems = function (inputList, itemCallback, startItems) { + var appendItems = function (values, output) { + output = output || []; + global$1.each(values, function (item) { + var menuItem = { text: item.text || item.title }; + if (item.menu) { + menuItem.menu = appendItems(item.menu); + } else { + menuItem.value = item.value; + if (itemCallback) { + itemCallback(menuItem); + } + } + output.push(menuItem); + }); + return output; + }; + return appendItems(inputList, startItems || []); + }; + var extractAdvancedStyles = function (dom, elm) { + var rgbToHex = function (value) { + return startsWith(value, 'rgb') ? dom.toHex(value) : value; + }; + var borderWidth = getRaw(Element.fromDom(elm), 'border-width').getOr(''); + var borderStyle = getRaw(Element.fromDom(elm), 'border-style').getOr(''); + var borderColor = getRaw(Element.fromDom(elm), 'border-color').map(rgbToHex).getOr(''); + var bgColor = getRaw(Element.fromDom(elm), 'background-color').map(rgbToHex).getOr(''); + return { + borderwidth: borderWidth, + borderstyle: borderStyle, + bordercolor: borderColor, + backgroundcolor: bgColor + }; + }; + var getSharedValues = function (data) { + var baseData = data[0]; + var comparisonData = data.slice(1); + var keys$1 = keys(baseData); + each(comparisonData, function (items) { + each(keys$1, function (key) { + each$1(items, function (itemValue, itemKey) { + var comparisonValue = baseData[key]; + if (comparisonValue !== '' && key === itemKey) { + if (comparisonValue !== itemValue) { + baseData[key] = ''; + } + } + }); + }); + }); + return baseData; + }; + var getAdvancedTab = function (dialogName) { + var advTabItems = [ + { + name: 'borderstyle', + type: 'selectbox', + label: 'Border style', + items: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, + { + text: 'Outset', + value: 'outset' + }, + { + text: 'None', + value: 'none' + }, + { + text: 'Hidden', + value: 'hidden' + } + ] + }, + { + name: 'bordercolor', + type: 'colorinput', + label: 'Border color' + }, + { + name: 'backgroundcolor', + type: 'colorinput', + label: 'Background color' + } + ]; + var borderWidth = { + name: 'borderwidth', + type: 'input', + label: 'Border width' + }; + var items = dialogName === 'cell' ? [borderWidth].concat(advTabItems) : advTabItems; + return { + title: 'Advanced', + name: 'advanced', + items: items + }; + }; + var getAlignment = function (alignments, formatName, dataName, editor, elm) { + var alignmentData = {}; + global$1.each(alignments.split(' '), function (name) { + if (editor.formatter.matchNode(elm, formatName + name)) { + alignmentData[dataName] = name; + } + }); + if (!alignmentData[dataName]) { + alignmentData[dataName] = ''; + } + return alignmentData; + }; + var getHAlignment = curry(getAlignment, 'left center right'); + var getVAlignment = curry(getAlignment, 'top middle bottom'); + var extractDataFromSettings = function (editor, hasAdvTableTab) { + var style = getDefaultStyles(editor); + var attrs = getDefaultAttributes(editor); + var extractAdvancedStyleData = function (dom) { + var rgbToHex = function (value) { + return startsWith(value, 'rgb') ? dom.toHex(value) : value; + }; + var borderStyle = get(style, 'border-style').getOr(''); + var borderColor = get(style, 'border-color').getOr(''); + var bgColor = get(style, 'background-color').getOr(''); + return { + borderstyle: borderStyle, + bordercolor: rgbToHex(borderColor), + backgroundcolor: rgbToHex(bgColor) + }; + }; + var defaultData = { + height: '', + width: '100%', + cellspacing: '', + cellpadding: '', + caption: false, + class: '', + align: '', + border: '' + }; + var getBorder = function () { + var borderWidth = style['border-width']; + if (shouldStyleWithCss(editor) && borderWidth) { + return { border: borderWidth }; + } + return get(attrs, 'border').fold(function () { + return {}; + }, function (border) { + return { border: border }; + }); + }; + var dom = editor.dom; + var advStyle = hasAdvTableTab ? extractAdvancedStyleData(dom) : {}; + var getCellPaddingCellSpacing = function () { + var spacing = get(style, 'border-spacing').or(get(attrs, 'cellspacing')).fold(function () { + return {}; + }, function (cellspacing) { + return { cellspacing: cellspacing }; + }); + var padding = get(style, 'border-padding').or(get(attrs, 'cellpadding')).fold(function () { + return {}; + }, function (cellpadding) { + return { cellpadding: cellpadding }; + }); + return __assign(__assign({}, spacing), padding); + }; + var data = __assign(__assign(__assign(__assign(__assign(__assign({}, defaultData), style), attrs), advStyle), getBorder()), getCellPaddingCellSpacing()); + return data; + }; + var extractDataFromTableElement = function (editor, elm, hasAdvTableTab) { + var getBorder = function (dom, elm) { + var optBorderWidth = getRaw(Element.fromDom(elm), 'border-width'); + if (shouldStyleWithCss(editor) && optBorderWidth.isSome()) { + return optBorderWidth.getOr(''); + } + return dom.getAttrib(elm, 'border') || Styles$1.getTDTHOverallStyle(editor.dom, elm, 'border-width') || Styles$1.getTDTHOverallStyle(editor.dom, elm, 'border'); + }; + var dom = editor.dom; + var data = __assign(__assign({ + width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'), + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + cellspacing: dom.getStyle(elm, 'border-spacing') || dom.getAttrib(elm, 'cellspacing'), + cellpadding: dom.getAttrib(elm, 'cellpadding') || Styles$1.getTDTHOverallStyle(editor.dom, elm, 'padding'), + border: getBorder(dom, elm), + caption: !!dom.select('caption', elm)[0], + class: dom.getAttrib(elm, 'class', '') + }, getHAlignment('align', 'align', editor, elm)), hasAdvTableTab ? extractAdvancedStyles(dom, elm) : {}); + return data; + }; + var extractDataFromRowElement = function (editor, elm, hasAdvancedRowTab) { + var dom = editor.dom; + var data = __assign(__assign({ + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + scope: dom.getAttrib(elm, 'scope'), + class: dom.getAttrib(elm, 'class', ''), + align: '', + type: elm.parentNode.nodeName.toLowerCase() + }, getHAlignment('align', 'align', editor, elm)), hasAdvancedRowTab ? extractAdvancedStyles(dom, elm) : {}); + return data; + }; + var extractDataFromCellElement = function (editor, elm, hasAdvancedCellTab) { + var dom = editor.dom; + var data = __assign(__assign(__assign({ + width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'), + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + scope: dom.getAttrib(elm, 'scope'), + celltype: elm.nodeName.toLowerCase(), + class: dom.getAttrib(elm, 'class', '') + }, getHAlignment('align', 'halign', editor, elm)), getVAlignment('valign', 'valign', editor, elm)), hasAdvancedCellTab ? extractAdvancedStyles(dom, elm) : {}); + return data; + }; + var Helpers = { + buildListItems: buildListItems, + extractAdvancedStyles: extractAdvancedStyles, + getSharedValues: getSharedValues, + getAdvancedTab: getAdvancedTab, + extractDataFromTableElement: extractDataFromTableElement, + extractDataFromRowElement: extractDataFromRowElement, + extractDataFromCellElement: extractDataFromCellElement, + extractDataFromSettings: extractDataFromSettings + }; + + var getClassList = function (editor) { + var rowClassList = getCellClassList(editor); + var classes = Helpers.buildListItems(rowClassList, function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + block: 'tr', + classes: [item.value] + }); + }; + } + }); + if (rowClassList.length > 0) { + return Option.some({ + name: 'class', + type: 'selectbox', + label: 'Class', + items: classes + }); + } + return Option.none(); + }; + var children$3 = [ + { + name: 'width', + type: 'input', + label: 'Width' + }, + { + name: 'height', + type: 'input', + label: 'Height' + }, + { + name: 'celltype', + type: 'selectbox', + label: 'Cell type', + items: [ + { + text: 'Cell', + value: 'td' + }, + { + text: 'Header cell', + value: 'th' + } + ] + }, + { + name: 'scope', + type: 'selectbox', + label: 'Scope', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Row', + value: 'row' + }, + { + text: 'Column', + value: 'col' + }, + { + text: 'Row group', + value: 'rowgroup' + }, + { + text: 'Column group', + value: 'colgroup' + } + ] + }, + { + name: 'halign', + type: 'selectbox', + label: 'H Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + name: 'valign', + type: 'selectbox', + label: 'V Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Top', + value: 'top' + }, + { + text: 'Middle', + value: 'middle' + }, + { + text: 'Bottom', + value: 'bottom' + } + ] + } + ]; + var getItems = function (editor) { + return getClassList(editor).fold(function () { + return children$3; + }, function (classlist) { + return children$3.concat(classlist); + }); + }; + var CellDialogGeneralTab = { getItems: getItems }; + + var normal = function (dom, node) { + var setAttrib = function (attr, value) { + dom.setAttrib(node, attr, value); + }; + var setStyle = function (prop, value) { + dom.setStyle(node, prop, value); + }; + return { + setAttrib: setAttrib, + setStyle: setStyle + }; + }; + var ifTruthy = function (dom, node) { + var setAttrib = function (attr, value) { + if (value) { + dom.setAttrib(node, attr, value); + } + }; + var setStyle = function (prop, value) { + if (value) { + dom.setStyle(node, prop, value); + } + }; + return { + setAttrib: setAttrib, + setStyle: setStyle + }; + }; + var DomModifier = { + normal: normal, + ifTruthy: ifTruthy + }; + + var updateSimpleProps = function (modifiers, data) { + modifiers.setAttrib('scope', data.scope); + modifiers.setAttrib('class', data.class); + modifiers.setStyle('width', addSizeSuffix(data.width)); + modifiers.setStyle('height', addSizeSuffix(data.height)); + }; + var updateAdvancedProps = function (modifiers, data) { + modifiers.setStyle('background-color', data.backgroundcolor); + modifiers.setStyle('border-color', data.bordercolor); + modifiers.setStyle('border-style', data.borderstyle); + modifiers.setStyle('border-width', addSizeSuffix(data.borderwidth)); + }; + var applyToSingle = function (editor, cells, data) { + var dom = editor.dom; + var cellElm = data.celltype && cells[0].nodeName.toLowerCase() !== data.celltype ? dom.rename(cells[0], data.celltype) : cells[0]; + var modifiers = DomModifier.normal(dom, cellElm); + updateSimpleProps(modifiers, data); + if (hasAdvancedCellTab(editor)) { + updateAdvancedProps(modifiers, data); + } + Styles$1.unApplyAlign(editor, cellElm); + Styles$1.unApplyVAlign(editor, cellElm); + if (data.halign) { + Styles$1.applyAlign(editor, cellElm, data.halign); + } + if (data.valign) { + Styles$1.applyVAlign(editor, cellElm, data.valign); + } + }; + var applyToMultiple = function (editor, cells, data) { + var dom = editor.dom; + global$1.each(cells, function (cellElm) { + if (data.celltype && cellElm.nodeName.toLowerCase() !== data.celltype) { + cellElm = dom.rename(cellElm, data.celltype); + } + var modifiers = DomModifier.ifTruthy(dom, cellElm); + updateSimpleProps(modifiers, data); + if (hasAdvancedCellTab(editor)) { + updateAdvancedProps(modifiers, data); + } + if (data.halign) { + Styles$1.applyAlign(editor, cellElm, data.halign); + } + if (data.valign) { + Styles$1.applyVAlign(editor, cellElm, data.valign); + } + }); + }; + var onSubmitCellForm = function (editor, cells, api) { + var data = api.getData(); + api.close(); + editor.undoManager.transact(function () { + var applicator = cells.length === 1 ? applyToSingle : applyToMultiple; + applicator(editor, cells, data); + editor.focus(); + }); + }; + var open = function (editor) { + var cellElm, cells = []; + cells = editor.dom.select('td[data-mce-selected],th[data-mce-selected]'); + cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); + if (!cells.length && cellElm) { + cells.push(cellElm); + } + cellElm = cellElm || cells[0]; + if (!cellElm) { + return; + } + var cellsData = global$1.map(cells, function (cellElm) { + return Helpers.extractDataFromCellElement(editor, cellElm, hasAdvancedCellTab(editor)); + }); + var data = Helpers.getSharedValues(cellsData); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: CellDialogGeneralTab.getItems(editor) + }, + Helpers.getAdvancedTab('cell') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: CellDialogGeneralTab.getItems(editor) + }] + }; + editor.windowManager.open({ + title: 'Cell Properties', + size: 'normal', + body: hasAdvancedCellTab(editor) ? dialogTabPanel : dialogPanel, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data, + onSubmit: curry(onSubmitCellForm, editor, cells) + }); + }; + var CellDialog = { open: open }; + + var getClassList$1 = function (editor) { + var rowClassList = getRowClassList(editor); + var classes = Helpers.buildListItems(rowClassList, function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + block: 'tr', + classes: [item.value] + }); + }; + } + }); + if (rowClassList.length > 0) { + return Option.some({ + name: 'class', + type: 'selectbox', + label: 'Class', + items: classes + }); + } + return Option.none(); + }; + var formChildren = [ + { + type: 'selectbox', + name: 'type', + label: 'Row type', + items: [ + { + text: 'Header', + value: 'thead' + }, + { + text: 'Body', + value: 'tbody' + }, + { + text: 'Footer', + value: 'tfoot' + } + ] + }, + { + type: 'selectbox', + name: 'align', + label: 'Alignment', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + label: 'Height', + name: 'height', + type: 'input' + } + ]; + var getItems$1 = function (editor) { + return getClassList$1(editor).fold(function () { + return formChildren; + }, function (classes) { + return formChildren.concat(classes); + }); + }; + var RowDialogGeneralTab = { getItems: getItems$1 }; + + var switchRowType = function (dom, rowElm, toType) { + var tableElm = dom.getParent(rowElm, 'table'); + var oldParentElm = rowElm.parentNode; + var parentElm = dom.select(toType, tableElm)[0]; + if (!parentElm) { + parentElm = dom.create(toType); + if (tableElm.firstChild) { + if (tableElm.firstChild.nodeName === 'CAPTION') { + dom.insertAfter(parentElm, tableElm.firstChild); + } else { + tableElm.insertBefore(parentElm, tableElm.firstChild); + } + } else { + tableElm.appendChild(parentElm); + } + } + if (toType === 'tbody' && oldParentElm.nodeName === 'THEAD' && parentElm.firstChild) { + parentElm.insertBefore(rowElm, parentElm.firstChild); + } else { + parentElm.appendChild(rowElm); + } + if (!oldParentElm.hasChildNodes()) { + dom.remove(oldParentElm); + } + }; + var updateAdvancedProps$1 = function (modifier, data) { + modifier.setStyle('background-color', data.backgroundcolor); + modifier.setStyle('border-color', data.bordercolor); + modifier.setStyle('border-style', data.borderstyle); + }; + var onSubmitRowForm = function (editor, rows, oldData, api) { + var dom = editor.dom; + var data = api.getData(); + api.close(); + var createModifier = rows.length === 1 ? DomModifier.normal : DomModifier.ifTruthy; + editor.undoManager.transact(function () { + global$1.each(rows, function (rowElm) { + if (data.type !== rowElm.parentNode.nodeName.toLowerCase()) { + switchRowType(editor.dom, rowElm, data.type); + } + var modifier = createModifier(dom, rowElm); + modifier.setAttrib('scope', data.scope); + modifier.setAttrib('class', data.class); + modifier.setStyle('height', addSizeSuffix(data.height)); + if (hasAdvancedRowTab(editor)) { + updateAdvancedProps$1(modifier, data); + } + if (data.align !== oldData.align) { + Styles$1.unApplyAlign(editor, rowElm); + Styles$1.applyAlign(editor, rowElm, data.align); + } + }); + editor.focus(); + }); + }; + var open$1 = function (editor) { + var dom = editor.dom; + var tableElm, cellElm, rowElm; + var rows = []; + tableElm = dom.getParent(editor.selection.getStart(), 'table'); + if (!tableElm) { + return; + } + cellElm = dom.getParent(editor.selection.getStart(), 'td,th'); + global$1.each(tableElm.rows, function (row) { + global$1.each(row.cells, function (cell) { + if ((dom.getAttrib(cell, 'data-mce-selected') || cell === cellElm) && rows.indexOf(row) < 0) { + rows.push(row); + return false; + } + }); + }); + rowElm = rows[0]; + if (!rowElm) { + return; + } + var rowsData = global$1.map(rows, function (rowElm) { + return Helpers.extractDataFromRowElement(editor, rowElm, hasAdvancedRowTab(editor)); + }); + var data = Helpers.getSharedValues(rowsData); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: RowDialogGeneralTab.getItems(editor) + }, + Helpers.getAdvancedTab('row') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: RowDialogGeneralTab.getItems(editor) + }] + }; + editor.windowManager.open({ + title: 'Row Properties', + size: 'normal', + body: hasAdvancedRowTab(editor) ? dialogTabPanel : dialogPanel, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data, + onSubmit: curry(onSubmitRowForm, editor, rows, data) + }); + }; + var RowDialog = { open: open$1 }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var DefaultRenderOptions = { + styles: { + 'border-collapse': 'collapse', + 'width': '100%' + }, + attributes: { border: '1' }, + percentages: true + }; + var makeTable = function () { + return Element.fromTag('table'); + }; + var tableBody = function () { + return Element.fromTag('tbody'); + }; + var tableRow = function () { + return Element.fromTag('tr'); + }; + var tableHeaderCell = function () { + return Element.fromTag('th'); + }; + var tableCell = function () { + return Element.fromTag('td'); + }; + var render$1 = function (rows, columns, rowHeaders, columnHeaders, renderOpts) { + if (renderOpts === void 0) { + renderOpts = DefaultRenderOptions; + } + var table = makeTable(); + setAll$1(table, renderOpts.styles); + setAll(table, renderOpts.attributes); + var tbody = tableBody(); + append(table, tbody); + var trs = []; + for (var i = 0; i < rows; i++) { + var tr = tableRow(); + for (var j = 0; j < columns; j++) { + var td = i < rowHeaders || j < columnHeaders ? tableHeaderCell() : tableCell(); + if (j < columnHeaders) { + set(td, 'scope', 'row'); + } + if (i < rowHeaders) { + set(td, 'scope', 'col'); + } + append(td, Element.fromTag('br')); + if (renderOpts.percentages) { + set$1(td, 'width', 100 / columns + '%'); + } + append(tr, td); + } + trs.push(tr); + } + append$1(tbody, trs); + return table; + }; + + var get$8 = function (element) { + return element.dom().innerHTML; + }; + var getOuter$2 = function (element) { + var container = Element.fromTag('div'); + var clone = Element.fromDom(element.dom().cloneNode(true)); + append(container, clone); + return get$8(container); + }; + + var placeCaretInCell = function (editor, cell) { + editor.selection.select(cell.dom(), true); + editor.selection.collapse(true); + }; + var selectFirstCellInTable = function (editor, tableElm) { + descendant$1(tableElm, 'td,th').each(curry(placeCaretInCell, editor)); + }; + var fireEvents = function (editor, table) { + each(descendants$1(table, 'tr'), function (row) { + fireNewRow(editor, row.dom()); + each(descendants$1(row, 'th,td'), function (cell) { + fireNewCell(editor, cell.dom()); + }); + }); + }; + var isPercentage = function (width) { + return isString(width) && width.indexOf('%') !== -1; + }; + var insert$1 = function (editor, columns, rows) { + var defaultStyles = getDefaultStyles(editor); + var options = { + styles: defaultStyles, + attributes: getDefaultAttributes(editor), + percentages: isPercentage(defaultStyles.width) && !isPixelsForced(editor) + }; + var table = render$1(rows, columns, 0, 0, options); + set(table, 'data-mce-id', '__mce'); + var html = getOuter$2(table); + editor.insertContent(html); + return descendant$1(getBody$1(editor), 'table[data-mce-id="__mce"]').map(function (table) { + if (isPixelsForced(editor)) { + set$1(table, 'width', get$2(table, 'width')); + } + remove(table, 'data-mce-id'); + fireEvents(editor, table); + selectFirstCellInTable(editor, table); + return table.dom(); + }).getOr(null); + }; + var InsertTable = { insert: insert$1 }; + + var getItems$2 = function (editor, hasClasses, insertNewTable) { + var rowColCountItems = !insertNewTable ? [] : [ + { + type: 'input', + name: 'cols', + label: 'Cols', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'rows', + label: 'Rows', + inputMode: 'numeric' + } + ]; + var alwaysItems = [ + { + type: 'input', + name: 'width', + label: 'Width' + }, + { + type: 'input', + name: 'height', + label: 'Height' + } + ]; + var appearanceItems = hasAppearanceOptions(editor) ? [ + { + type: 'input', + name: 'cellspacing', + label: 'Cell spacing', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'cellpadding', + label: 'Cell padding', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'border', + label: 'Border width' + }, + { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + } + ] : []; + var alignmentItem = [{ + type: 'selectbox', + name: 'align', + label: 'Alignment', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }]; + var classListItem = hasClasses ? [{ + type: 'selectbox', + name: 'class', + label: 'Class', + items: Helpers.buildListItems(getTableClassList(editor), function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + block: 'table', + classes: [item.value] + }); + }; + } + }) + }] : []; + return rowColCountItems.concat(alwaysItems).concat(appearanceItems).concat(alignmentItem).concat(classListItem); + }; + var TableDialogGeneralTab = { getItems: getItems$2 }; + + var styleTDTH = function (dom, elm, name, value) { + if (elm.tagName === 'TD' || elm.tagName === 'TH') { + if (isString(name)) { + dom.setStyle(elm, name, value); + } else { + dom.setStyle(elm, name); + } + } else { + if (elm.children) { + for (var i = 0; i < elm.children.length; i++) { + styleTDTH(dom, elm.children[i], name, value); + } + } + } + }; + var applyDataToElement = function (editor, tableElm, data) { + var dom = editor.dom; + var attrs = {}; + var styles = {}; + attrs.class = data.class; + styles.height = addSizeSuffix(data.height); + if (dom.getAttrib(tableElm, 'width') && !shouldStyleWithCss(editor)) { + attrs.width = removePxSuffix(data.width); + } else { + styles.width = addSizeSuffix(data.width); + } + if (shouldStyleWithCss(editor)) { + styles['border-width'] = addSizeSuffix(data.border); + styles['border-spacing'] = addSizeSuffix(data.cellspacing); + } else { + attrs.border = data.border; + attrs.cellpadding = data.cellpadding; + attrs.cellspacing = data.cellspacing; + } + if (shouldStyleWithCss(editor) && tableElm.children) { + for (var i = 0; i < tableElm.children.length; i++) { + styleTDTH(dom, tableElm.children[i], { + 'border-width': addSizeSuffix(data.border), + 'padding': addSizeSuffix(data.cellpadding) + }); + if (hasAdvancedTableTab(editor)) { + styleTDTH(dom, tableElm.children[i], { 'border-color': data.bordercolor }); + } + } + } + if (hasAdvancedTableTab(editor)) { + styles['background-color'] = data.backgroundcolor; + styles['border-color'] = data.bordercolor; + styles['border-style'] = data.borderstyle; + } + attrs.style = dom.serializeStyle(__assign(__assign({}, getDefaultStyles(editor)), styles)); + dom.setAttribs(tableElm, __assign(__assign({}, getDefaultAttributes(editor)), attrs)); + }; + var onSubmitTableForm = function (editor, tableElm, api) { + var dom = editor.dom; + var captionElm; + var data = api.getData(); + api.close(); + if (data.class === '') { + delete data.class; + } + editor.undoManager.transact(function () { + if (!tableElm) { + var cols = parseInt(data.cols, 10) || 1; + var rows = parseInt(data.rows, 10) || 1; + tableElm = InsertTable.insert(editor, cols, rows); + } + applyDataToElement(editor, tableElm, data); + captionElm = dom.select('caption', tableElm)[0]; + if (captionElm && !data.caption) { + dom.remove(captionElm); + } + if (!captionElm && data.caption) { + captionElm = dom.create('caption'); + captionElm.innerHTML = !global$2.ie ? '
    ' : nbsp; + tableElm.insertBefore(captionElm, tableElm.firstChild); + } + if (data.align === '') { + Styles$1.unApplyAlign(editor, tableElm); + } else { + Styles$1.applyAlign(editor, tableElm, data.align); + } + editor.focus(); + editor.addVisual(); + }); + }; + var open$2 = function (editor, insertNewTable) { + var dom = editor.dom; + var tableElm; + var data = Helpers.extractDataFromSettings(editor, hasAdvancedTableTab(editor)); + if (insertNewTable === false) { + tableElm = dom.getParent(editor.selection.getStart(), 'table'); + if (tableElm) { + data = Helpers.extractDataFromTableElement(editor, tableElm, hasAdvancedTableTab(editor)); + } else { + if (hasAdvancedTableTab(editor)) { + data.borderstyle = ''; + data.bordercolor = ''; + data.backgroundcolor = ''; + } + } + } else { + data.cols = '1'; + data.rows = '1'; + if (hasAdvancedTableTab(editor)) { + data.borderstyle = ''; + data.bordercolor = ''; + data.backgroundcolor = ''; + } + } + var hasClasses = getTableClassList(editor).length > 0; + if (hasClasses) { + if (data.class) { + data.class = data.class.replace(/\s*mce\-item\-table\s*/g, ''); + } + } + var generalPanel = { + type: 'grid', + columns: 2, + items: TableDialogGeneralTab.getItems(editor, hasClasses, insertNewTable) + }; + var nonAdvancedForm = function () { + return { + type: 'panel', + items: [generalPanel] + }; + }; + var advancedForm = function () { + return { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: [generalPanel] + }, + Helpers.getAdvancedTab('table') + ] + }; + }; + var dialogBody = hasAdvancedTableTab(editor) ? advancedForm() : nonAdvancedForm(); + editor.windowManager.open({ + title: 'Table Properties', + size: 'normal', + body: dialogBody, + onSubmit: curry(onSubmitTableForm, editor, tableElm), + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data + }); + }; + var TableDialog = { open: open$2 }; + + var getSelectionStartFromSelector = function (selector) { + return function (editor) { + return Option.from(editor.dom.getParent(editor.selection.getStart(), selector)).map(Element.fromDom); + }; + }; + var getSelectionStartCell = getSelectionStartFromSelector('th,td'); + var getSelectionStartCellOrCaption = getSelectionStartFromSelector('th,td,caption'); + + var each$3 = global$1.each; + var registerCommands = function (editor, actions, cellSelection, selections, clipboardRows) { + var isRoot = getIsRoot(editor); + var eraseTable = function () { + getSelectionStartCellOrCaption(editor).each(function (cellOrCaption) { + var tableOpt = TableLookup.table(cellOrCaption, isRoot); + tableOpt.filter(not(isRoot)).each(function (table) { + var cursor = Element.fromText(''); + after(table, cursor); + remove$2(table); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } else { + var rng = editor.dom.createRng(); + rng.setStart(cursor.dom(), 0); + rng.setEnd(cursor.dom(), 0); + editor.selection.setRng(rng); + editor.nodeChanged(); + } + }); + }); + }; + var getTableFromCell = function (cell) { + return TableLookup.table(cell, isRoot); + }; + var getSize = function (table) { + return { + width: getPixelWidth$1(table.dom()), + height: getPixelWidth$1(table.dom()) + }; + }; + var resizeChange = function (editor, oldSize, table) { + var newSize = getSize(table); + if (oldSize.width !== newSize.width || oldSize.height !== newSize.height) { + fireObjectResizeStart(editor, table.dom(), oldSize.width, oldSize.height); + fireObjectResized(editor, table.dom(), newSize.width, newSize.height); + } + }; + var actOnSelection = function (execute) { + getSelectionStartCell(editor).each(function (cell) { + getTableFromCell(cell).each(function (table) { + var targets = TableTargets.forMenu(selections, table, cell); + var beforeSize = getSize(table); + execute(table, targets).each(function (rng) { + resizeChange(editor, beforeSize, table); + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + removeDataStyle(table); + }); + }); + }); + }; + var copyRowSelection = function (execute) { + return getSelectionStartCell(editor).map(function (cell) { + return getTableFromCell(cell).bind(function (table) { + var doc = Element.fromDom(editor.getDoc()); + var targets = TableTargets.forMenu(selections, table, cell); + var generators = TableFill.cellOperations(noop, doc, Option.none()); + return CopyRows.copyRows(table, targets, generators); + }); + }); + }; + var pasteOnSelection = function (execute) { + clipboardRows.get().each(function (rows) { + var clonedRows = map(rows, function (row) { + return deep(row); + }); + getSelectionStartCell(editor).each(function (cell) { + getTableFromCell(cell).each(function (table) { + var doc = Element.fromDom(editor.getDoc()); + var generators = TableFill.paste(doc); + var targets = TableTargets.pasteRows(selections, table, cell, clonedRows, generators); + execute(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + }); + }); + }); + }); + }; + each$3({ + mceTableSplitCells: function () { + actOnSelection(actions.unmergeCells); + }, + mceTableMergeCells: function () { + actOnSelection(actions.mergeCells); + }, + mceTableInsertRowBefore: function () { + actOnSelection(actions.insertRowsBefore); + }, + mceTableInsertRowAfter: function () { + actOnSelection(actions.insertRowsAfter); + }, + mceTableInsertColBefore: function () { + actOnSelection(actions.insertColumnsBefore); + }, + mceTableInsertColAfter: function () { + actOnSelection(actions.insertColumnsAfter); + }, + mceTableDeleteCol: function () { + actOnSelection(actions.deleteColumn); + }, + mceTableDeleteRow: function () { + actOnSelection(actions.deleteRow); + }, + mceTableCutRow: function (grid) { + copyRowSelection().each(function (selection) { + clipboardRows.set(selection); + actOnSelection(actions.deleteRow); + }); + }, + mceTableCopyRow: function (grid) { + copyRowSelection().each(function (selection) { + clipboardRows.set(selection); + }); + }, + mceTablePasteRowBefore: function (grid) { + pasteOnSelection(actions.pasteRowsBefore); + }, + mceTablePasteRowAfter: function (grid) { + pasteOnSelection(actions.pasteRowsAfter); + }, + mceTableDelete: eraseTable + }, function (func, name) { + editor.addCommand(name, func); + }); + each$3({ + mceInsertTable: curry(TableDialog.open, editor, true), + mceTableProps: curry(TableDialog.open, editor, false), + mceTableRowProps: curry(RowDialog.open, editor), + mceTableCellProps: curry(CellDialog.open, editor) + }, function (func, name) { + editor.addCommand(name, function () { + func(); + }); + }); + }; + var Commands = { registerCommands: registerCommands }; + + var only = function (element) { + var parent = Option.from(element.dom().documentElement).map(Element.fromDom).getOr(element); + return { + parent: constant(parent), + view: constant(element), + origin: constant(Position(0, 0)) + }; + }; + var detached = function (editable, chrome) { + var origin = function () { + return absolute(chrome); + }; + return { + parent: constant(chrome), + view: constant(editable), + origin: origin + }; + }; + var body$1 = function (editable, chrome) { + return { + parent: constant(chrome), + view: constant(editable), + origin: constant(Position(0, 0)) + }; + }; + var ResizeWire = { + only: only, + detached: detached, + body: body$1 + }; + + var Event = function (fields) { + var struct = Immutable.apply(null, fields); + var handlers = []; + var bind = function (handler) { + if (handler === undefined) { + throw new Error('Event bind error: undefined handler'); + } + handlers.push(handler); + }; + var unbind = function (handler) { + handlers = filter(handlers, function (h) { + return h !== handler; + }); + }; + var trigger = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var event = struct.apply(null, args); + each(handlers, function (handler) { + handler(event); + }); + }; + return { + bind: bind, + unbind: unbind, + trigger: trigger + }; + }; + + var create$1 = function (typeDefs) { + var registry = map$1(typeDefs, function (event) { + return { + bind: event.bind, + unbind: event.unbind + }; + }); + var trigger = map$1(typeDefs, function (event) { + return event.trigger; + }); + return { + registry: registry, + trigger: trigger + }; + }; + var Events = { create: create$1 }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: constant(target), + x: constant(x), + y: constant(y), + stop: stop, + prevent: prevent, + kill: kill, + raw: constant(raw) + }; + }; + var fromRawEvent = function (rawEvent) { + var target = Element.fromDom(rawEvent.target); + var stop = function () { + rawEvent.stopPropagation(); + }; + var prevent = function () { + rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + }; + var handle = function (filter, handler) { + return function (rawEvent) { + if (!filter(rawEvent)) { + return; + } + handler(fromRawEvent(rawEvent)); + }; + }; + var binder = function (element, event, filter, handler, useCapture) { + var wrapped = handle(filter, handler); + element.dom().addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; + }; + var bind$1 = function (element, event, filter, handler) { + return binder(element, event, filter, handler, false); + }; + var unbind = function (element, event, handler, useCapture) { + element.dom().removeEventListener(event, handler, useCapture); + }; + + var filter$1 = constant(true); + var bind$2 = function (element, event, handler) { + return bind$1(element, event, filter$1, handler); + }; + var fromRawEvent$1 = fromRawEvent; + + var styles$1 = css('ephox-dragster'); + var Styles$2 = { resolve: styles$1.resolve }; + + var Blocker = function (options) { + var settings = __assign({ layerClass: Styles$2.resolve('blocker') }, options); + var div = Element.fromTag('div'); + set(div, 'role', 'presentation'); + setAll$1(div, { + position: 'fixed', + left: '0px', + top: '0px', + width: '100%', + height: '100%' + }); + add$2(div, Styles$2.resolve('blocker')); + add$2(div, settings.layerClass); + var element = function () { + return div; + }; + var destroy = function () { + remove$2(div); + }; + return { + element: element, + destroy: destroy + }; + }; + + var DragMode = exactly([ + 'compare', + 'extract', + 'mutate', + 'sink' + ]); + var DragSink = exactly([ + 'element', + 'start', + 'stop', + 'destroy' + ]); + var DragApi = exactly([ + 'forceDrop', + 'drop', + 'move', + 'delayDrop' + ]); + + var compare = function (old, nu) { + return Position(nu.left() - old.left(), nu.top() - old.top()); + }; + var extract$1 = function (event) { + return Option.some(Position(event.x(), event.y())); + }; + var mutate = function (mutation, info) { + mutation.mutate(info.left(), info.top()); + }; + var sink = function (dragApi, settings) { + var blocker = Blocker(settings); + var mdown = bind$2(blocker.element(), 'mousedown', dragApi.forceDrop); + var mup = bind$2(blocker.element(), 'mouseup', dragApi.drop); + var mmove = bind$2(blocker.element(), 'mousemove', dragApi.move); + var mout = bind$2(blocker.element(), 'mouseout', dragApi.delayDrop); + var destroy = function () { + blocker.destroy(); + mup.unbind(); + mmove.unbind(); + mout.unbind(); + mdown.unbind(); + }; + var start = function (parent) { + append(parent, blocker.element()); + }; + var stop = function () { + remove$2(blocker.element()); + }; + return DragSink({ + element: blocker.element, + start: start, + stop: stop, + destroy: destroy + }); + }; + var MouseDrag = DragMode({ + compare: compare, + extract: extract$1, + sink: sink, + mutate: mutate + }); + + var last$2 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + function InDrag () { + var previous = Option.none(); + var reset = function () { + previous = Option.none(); + }; + var update = function (mode, nu) { + var result = previous.map(function (old) { + return mode.compare(old, nu); + }); + previous = Option.some(nu); + return result; + }; + var onEvent = function (event, mode) { + var dataOption = mode.extract(event); + dataOption.each(function (data) { + var offset = update(mode, data); + offset.each(function (d) { + events.trigger.move(d); + }); + }); + }; + var events = Events.create({ move: Event(['info']) }); + return { + onEvent: onEvent, + reset: reset, + events: events.registry + }; + } + + function NoDrag () { + return { + onEvent: noop, + reset: noop + }; + } + + function Movement () { + var noDragState = NoDrag(); + var inDragState = InDrag(); + var dragState = noDragState; + var on = function () { + dragState.reset(); + dragState = inDragState; + }; + var off = function () { + dragState.reset(); + dragState = noDragState; + }; + var onEvent = function (event, mode) { + dragState.onEvent(event, mode); + }; + var isOn = function () { + return dragState === inDragState; + }; + return { + on: on, + off: off, + isOn: isOn, + onEvent: onEvent, + events: inDragState.events + }; + } + + var setup = function (mutation, mode, settings) { + var active = false; + var events = Events.create({ + start: Event([]), + stop: Event([]) + }); + var movement = Movement(); + var drop = function () { + sink.stop(); + if (movement.isOn()) { + movement.off(); + events.trigger.stop(); + } + }; + var throttledDrop = last$2(drop, 200); + var go = function (parent) { + sink.start(parent); + movement.on(); + events.trigger.start(); + }; + var mousemove = function (event) { + throttledDrop.cancel(); + movement.onEvent(event, mode); + }; + movement.events.move.bind(function (event) { + mode.mutate(mutation, event.info()); + }); + var on = function () { + active = true; + }; + var off = function () { + active = false; + }; + var runIfActive = function (f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (active) { + f.apply(null, args); + } + }; + }; + var sink = mode.sink(DragApi({ + forceDrop: drop, + drop: runIfActive(drop), + move: runIfActive(mousemove), + delayDrop: runIfActive(throttledDrop.throttle) + }), settings); + var destroy = function () { + sink.destroy(); + }; + return { + element: sink.element, + go: go, + on: on, + off: off, + destroy: destroy, + events: events.registry + }; + }; + var Dragging = { setup: setup }; + + var transform$1 = function (mutation, settings) { + if (settings === void 0) { + settings = {}; + } + var mode = settings.mode !== undefined ? settings.mode : MouseDrag; + return Dragging.setup(mutation, mode, settings); + }; + var Dragger = { transform: transform$1 }; + + var Mutation = function () { + var events = Events.create({ + drag: Event([ + 'xDelta', + 'yDelta' + ]) + }); + var mutate = function (x, y) { + events.trigger.drag(x, y); + }; + return { + mutate: mutate, + events: events.registry + }; + }; + + var BarMutation = function () { + var events = Events.create({ + drag: Event([ + 'xDelta', + 'yDelta', + 'target' + ]) + }); + var target = Option.none(); + var delegate = Mutation(); + delegate.events.drag.bind(function (event) { + target.each(function (t) { + events.trigger.drag(event.xDelta(), event.yDelta(), t); + }); + }); + var assign = function (t) { + target = Option.some(t); + }; + var get = function () { + return target; + }; + return { + assign: assign, + get: get, + mutate: delegate.mutate, + events: events.registry + }; + }; + + var isContentEditableTrue = function (elm) { + return get$1(elm, 'contenteditable') === 'true'; + }; + var findClosestContentEditable = function (target, isRoot) { + return closest$1(target, '[contenteditable]', isRoot); + }; + + var resizeBarDragging = Styles.resolve('resizer-bar-dragging'); + var BarManager = function (wire, direction, hdirection) { + var mutation = BarMutation(); + var resizing = Dragger.transform(mutation, {}); + var hoverTable = Option.none(); + var getResizer = function (element, type) { + return Option.from(get$1(element, type)); + }; + mutation.events.drag.bind(function (event) { + getResizer(event.target(), 'data-row').each(function (_dataRow) { + var currentRow = CellUtils.getInt(event.target(), 'top'); + set$1(event.target(), 'top', currentRow + event.yDelta() + 'px'); + }); + getResizer(event.target(), 'data-column').each(function (_dataCol) { + var currentCol = CellUtils.getInt(event.target(), 'left'); + set$1(event.target(), 'left', currentCol + event.xDelta() + 'px'); + }); + }); + var getDelta = function (target, dir) { + var newX = CellUtils.getInt(target, dir); + var oldX = parseInt(get$1(target, 'data-initial-' + dir), 10); + return newX - oldX; + }; + resizing.events.stop.bind(function () { + mutation.get().each(function (target) { + hoverTable.each(function (table) { + getResizer(target, 'data-row').each(function (row) { + var delta = getDelta(target, 'top'); + remove(target, 'data-initial-top'); + events.trigger.adjustHeight(table, delta, parseInt(row, 10)); + }); + getResizer(target, 'data-column').each(function (column) { + var delta = getDelta(target, 'left'); + remove(target, 'data-initial-left'); + events.trigger.adjustWidth(table, delta, parseInt(column, 10)); + }); + Bars.refresh(wire, table, hdirection, direction); + }); + }); + }); + var handler = function (target, dir) { + events.trigger.startAdjust(); + mutation.assign(target); + set(target, 'data-initial-' + dir, parseInt(get$2(target, dir), 10)); + add$2(target, resizeBarDragging); + set$1(target, 'opacity', '0.2'); + resizing.go(wire.parent()); + }; + var mousedown = bind$2(wire.parent(), 'mousedown', function (event) { + if (Bars.isRowBar(event.target())) { + handler(event.target(), 'top'); + } + if (Bars.isColBar(event.target())) { + handler(event.target(), 'left'); + } + }); + var isRoot = function (e) { + return eq(e, wire.view()); + }; + var findClosestEditableTable = function (target) { + return closest$1(target, 'table', isRoot).filter(function (table) { + return findClosestContentEditable(table, isRoot).exists(isContentEditableTrue); + }); + }; + var mouseover = bind$2(wire.view(), 'mouseover', function (event) { + findClosestEditableTable(event.target()).fold(function () { + if (inBody(event.target())) { + Bars.destroy(wire); + } + }, function (table) { + hoverTable = Option.some(table); + Bars.refresh(wire, table, hdirection, direction); + }); + }); + var destroy = function () { + mousedown.unbind(); + mouseover.unbind(); + resizing.destroy(); + Bars.destroy(wire); + }; + var refresh = function (tbl) { + Bars.refresh(wire, tbl, hdirection, direction); + }; + var events = Events.create({ + adjustHeight: Event([ + 'table', + 'delta', + 'row' + ]), + adjustWidth: Event([ + 'table', + 'delta', + 'column' + ]), + startAdjust: Event([]) + }); + return { + destroy: destroy, + refresh: refresh, + on: resizing.on, + off: resizing.off, + hideBars: curry(Bars.hide, wire), + showBars: curry(Bars.show, wire), + events: events.registry + }; + }; + + var create$2 = function (wire, vdirection) { + var hdirection = BarPositions.height; + var manager = BarManager(wire, vdirection, hdirection); + var events = Events.create({ + beforeResize: Event(['table']), + afterResize: Event(['table']), + startDrag: Event([]) + }); + manager.events.adjustHeight.bind(function (event) { + events.trigger.beforeResize(event.table()); + var delta = hdirection.delta(event.delta(), event.table()); + Adjustments.adjustHeight(event.table(), delta, event.row(), hdirection); + events.trigger.afterResize(event.table()); + }); + manager.events.startAdjust.bind(function (event) { + events.trigger.startDrag(); + }); + manager.events.adjustWidth.bind(function (event) { + events.trigger.beforeResize(event.table()); + var delta = vdirection.delta(event.delta(), event.table()); + Adjustments.adjustWidth(event.table(), delta, event.column(), vdirection); + events.trigger.afterResize(event.table()); + }); + return { + on: manager.on, + off: manager.off, + hideBars: manager.hideBars, + showBars: manager.showBars, + destroy: manager.destroy, + events: events.registry + }; + }; + var TableResize = { create: create$2 }; + + var createContainer = function () { + var container = Element.fromTag('div'); + setAll$1(container, { + position: 'static', + height: '0', + width: '0', + padding: '0', + margin: '0', + border: '0' + }); + append(body(), container); + return container; + }; + var get$9 = function (editor, container) { + return editor.inline ? ResizeWire.body(getBody$1(editor), createContainer()) : ResizeWire.only(Element.fromDom(editor.getDoc())); + }; + var remove$6 = function (editor, wire) { + if (editor.inline) { + remove$2(wire.parent()); + } + }; + var TableWire = { + get: get$9, + remove: remove$6 + }; + + var calculatePercentageWidth = function (element, parent) { + return getPixelWidth$1(element.dom()) / getPixelWidth$1(parent.dom()) * 100 + '%'; + }; + var enforcePercentage = function (rawTable) { + var table = Element.fromDom(rawTable); + parent(table).map(function (parent) { + return calculatePercentageWidth(table, parent); + }).each(function (tablePercentage) { + set$1(table, 'width', tablePercentage); + each(descendants$1(table, 'tr'), function (tr) { + each(children(tr), function (td) { + set$1(td, 'width', calculatePercentageWidth(td, tr)); + }); + }); + }); + }; + var enforcePixels = function (table) { + set$1(Element.fromDom(table), 'width', getPixelWidth$1(table).toString() + 'px'); + }; + + var getResizeHandler = function (editor) { + var selectionRng = Option.none(); + var resize = Option.none(); + var wire = Option.none(); + var percentageBasedSizeRegex = /(\d+(\.\d+)?)%/; + var startW; + var startRawW; + var isTable = function (elm) { + return elm.nodeName === 'TABLE'; + }; + var getRawWidth = function (elm) { + var raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width'); + return Option.from(raw).filter(function (s) { + return s.length > 0; + }); + }; + var lazyResize = function () { + return resize; + }; + var lazyWire = function () { + return wire.getOr(ResizeWire.only(Element.fromDom(editor.getBody()))); + }; + var destroy = function () { + resize.each(function (sz) { + sz.destroy(); + }); + wire.each(function (w) { + TableWire.remove(editor, w); + }); + }; + editor.on('init', function () { + var direction = TableDirection(Direction.directionAt); + var rawWire = TableWire.get(editor); + wire = Option.some(rawWire); + if (hasObjectResizing(editor) && hasTableResizeBars(editor)) { + var sz = TableResize.create(rawWire, direction); + sz.on(); + sz.events.startDrag.bind(function (event) { + selectionRng = Option.some(editor.selection.getRng()); + }); + sz.events.beforeResize.bind(function (event) { + var rawTable = event.table().dom(); + fireObjectResizeStart(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable)); + }); + sz.events.afterResize.bind(function (event) { + var table = event.table(); + var rawTable = table.dom(); + removeDataStyle(table); + selectionRng.each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + }); + fireObjectResized(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable)); + editor.undoManager.add(); + }); + resize = Option.some(sz); + } + }); + editor.on('ObjectResizeStart', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var tableHasPercentage = getRawWidth(targetElm).map(function (w) { + return percentageBasedSizeRegex.test(w); + }).getOr(false); + if (tableHasPercentage && isPixelsForced(editor)) { + enforcePixels(targetElm); + } else if (!tableHasPercentage && isPercentagesForced(editor)) { + enforcePercentage(targetElm); + } + startW = e.width; + startRawW = getRawWidth(targetElm).getOr(''); + } + }); + editor.on('ObjectResized', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var table = targetElm; + if (percentageBasedSizeRegex.test(startRawW)) { + var percentW = parseFloat(percentageBasedSizeRegex.exec(startRawW)[1]); + var targetPercentW = e.width * percentW / startW; + editor.dom.setStyle(table, 'width', targetPercentW + '%'); + } else { + var newCellSizes_1 = []; + global$1.each(table.rows, function (row) { + global$1.each(row.cells, function (cell) { + var width = editor.dom.getStyle(cell, 'width', true); + newCellSizes_1.push({ + cell: cell, + width: width + }); + }); + }); + global$1.each(newCellSizes_1, function (newCellSize) { + editor.dom.setStyle(newCellSize.cell, 'width', newCellSize.width); + editor.dom.setAttrib(newCellSize.cell, 'width', null); + }); + } + } + }); + editor.on('SwitchMode', function () { + lazyResize().each(function (resize) { + if (editor.mode.isReadOnly()) { + resize.hideBars(); + } else { + resize.showBars(); + } + }); + }); + return { + lazyResize: lazyResize, + lazyWire: lazyWire, + destroy: destroy + }; + }; + + var adt$1 = Adt.generate([ + { none: ['current'] }, + { first: ['current'] }, + { + middle: [ + 'current', + 'target' + ] + }, + { last: ['current'] } + ]); + var none$1 = function (current) { + if (current === void 0) { + current = undefined; + } + return adt$1.none(current); + }; + var CellLocation = __assign(__assign({}, adt$1), { none: none$1 }); + + var detect$4 = function (current, isRoot) { + return TableLookup.table(current, isRoot).bind(function (table) { + var all = TableLookup.cells(table); + var index = findIndex(all, function (x) { + return eq(current, x); + }); + return index.map(function (ind) { + return { + index: constant(ind), + all: constant(all) + }; + }); + }); + }; + var next = function (current, isRoot) { + var detection = detect$4(current, isRoot); + return detection.fold(function () { + return CellLocation.none(current); + }, function (info) { + return info.index() + 1 < info.all().length ? CellLocation.middle(current, info.all()[info.index() + 1]) : CellLocation.last(current); + }); + }; + var prev = function (current, isRoot) { + var detection = detect$4(current, isRoot); + return detection.fold(function () { + return CellLocation.none(); + }, function (info) { + return info.index() - 1 >= 0 ? CellLocation.middle(current, info.all()[info.index() - 1]) : CellLocation.first(current); + }); + }; + var CellNavigation = { + next: next, + prev: prev + }; + + var create$3 = Immutable('start', 'soffset', 'finish', 'foffset'); + var SimRange = { create: create$3 }; + + var adt$2 = Adt.generate([ + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } + ]); + var cata$1 = function (subject, onBefore, onOn, onAfter) { + return subject.fold(onBefore, onOn, onAfter); + }; + var getStart = function (situ) { + return situ.fold(identity, identity, identity); + }; + var before$2 = adt$2.before; + var on = adt$2.on; + var after$2 = adt$2.after; + var Situ = { + before: before$2, + on: on, + after: after$2, + cata: cata$1, + getStart: getStart + }; + + var adt$3 = Adt.generate([ + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var exactFromRange = function (simRange) { + return adt$3.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset()); + }; + var getStart$1 = function (selection) { + return selection.match({ + domRange: function (rng) { + return Element.fromDom(rng.startContainer); + }, + relative: function (startSitu, finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, soffset, finish, foffset) { + return start; + } + }); + }; + var domRange = adt$3.domRange; + var relative = adt$3.relative; + var exact = adt$3.exact; + var getWin = function (selection) { + var start = getStart$1(selection); + return defaultView(start); + }; + var range$2 = SimRange.create; + var Selection = { + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$2 + }; + + var selectNodeContents = function (win, element) { + var rng = win.document.createRange(); + selectNodeContentsUsing(rng, element); + return rng; + }; + var selectNodeContentsUsing = function (rng, element) { + rng.selectNodeContents(element.dom()); + }; + var setStart = function (rng, situ) { + situ.fold(function (e) { + rng.setStartBefore(e.dom()); + }, function (e, o) { + rng.setStart(e.dom(), o); + }, function (e) { + rng.setStartAfter(e.dom()); + }); + }; + var setFinish = function (rng, situ) { + situ.fold(function (e) { + rng.setEndBefore(e.dom()); + }, function (e, o) { + rng.setEnd(e.dom(), o); + }, function (e) { + rng.setEndAfter(e.dom()); + }); + }; + var relativeToNative = function (win, startSitu, finishSitu) { + var range = win.document.createRange(); + setStart(range, startSitu); + setFinish(range, finishSitu); + return range; + }; + var exactToNative = function (win, start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom(), soffset); + rng.setEnd(finish.dom(), foffset); + return rng; + }; + var toRect = function (rect) { + return { + left: constant(rect.left), + top: constant(rect.top), + right: constant(rect.right), + bottom: constant(rect.bottom), + width: constant(rect.width), + height: constant(rect.height) + }; + }; + var getFirstRect = function (rng) { + var rects = rng.getClientRects(); + var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect) : Option.none(); + }; + + var adt$4 = Adt.generate([ + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var fromRange = function (win, type, range) { + return type(Element.fromDom(range.startContainer), range.startOffset, Element.fromDom(range.endContainer), range.endOffset); + }; + var getRanges = function (win, selection) { + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Option.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Option.some(relativeToNative(win, finishSitu, startSitu)); + }) + }; + }, + exact: function (start, soffset, finish, foffset) { + return { + ltr: cached(function () { + return exactToNative(win, start, soffset, finish, foffset); + }), + rtl: cached(function () { + return Option.some(exactToNative(win, finish, foffset, start, soffset)); + }) + }; + } + }); + }; + var doDiagnose = function (win, ranges) { + var rng = ranges.ltr(); + if (rng.collapsed) { + var reversed = ranges.rtl().filter(function (rev) { + return rev.collapsed === false; + }); + return reversed.map(function (rev) { + return adt$4.rtl(Element.fromDom(rev.endContainer), rev.endOffset, Element.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$4.ltr, rng); + }); + } else { + return fromRange(win, adt$4.ltr, rng); + } + }; + var diagnose = function (win, selection) { + var ranges = getRanges(win, selection); + return doDiagnose(win, ranges); + }; + var asLtrRange = function (win, selection) { + var diagnosis = diagnose(win, selection); + return diagnosis.match({ + ltr: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom(), soffset); + rng.setEnd(finish.dom(), foffset); + return rng; + }, + rtl: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(finish.dom(), foffset); + rng.setEnd(start.dom(), soffset); + return rng; + } + }); + }; + var ltr$2 = adt$4.ltr; + var rtl$2 = adt$4.rtl; + + var searchForPoint = function (rectForOffset, x, y, maxX, length) { + if (length === 0) { + return 0; + } else if (x === maxX) { + return length - 1; + } + var xDelta = maxX; + for (var i = 1; i < length; i++) { + var rect = rectForOffset(i); + var curDeltaX = Math.abs(x - rect.left); + if (y <= rect.bottom) { + if (y < rect.top || curDeltaX > xDelta) { + return i - 1; + } else { + xDelta = curDeltaX; + } + } + } + return 0; + }; + var inRect = function (rect, x, y) { + return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom; + }; + + var locateOffset = function (doc, textnode, x, y, rect) { + var rangeForOffset = function (o) { + var r = doc.dom().createRange(); + r.setStart(textnode.dom(), o); + r.collapse(true); + return r; + }; + var rectForOffset = function (o) { + var r = rangeForOffset(o); + return r.getBoundingClientRect(); + }; + var length = get$3(textnode).length; + var offset = searchForPoint(rectForOffset, x, y, rect.right, length); + return rangeForOffset(offset); + }; + var locate = function (doc, node, x, y) { + var r = doc.dom().createRange(); + r.selectNode(node.dom()); + var rects = r.getClientRects(); + var foundRect = findMap(rects, function (rect) { + return inRect(rect, x, y) ? Option.some(rect) : Option.none(); + }); + return foundRect.map(function (rect) { + return locateOffset(doc, node, x, y, rect); + }); + }; + + var searchInChildren = function (doc, node, x, y) { + var r = doc.dom().createRange(); + var nodes = children(node); + return findMap(nodes, function (n) { + r.selectNode(n.dom()); + return inRect(r.getBoundingClientRect(), x, y) ? locateNode(doc, n, x, y) : Option.none(); + }); + }; + var locateNode = function (doc, node, x, y) { + return isText(node) ? locate(doc, node, x, y) : searchInChildren(doc, node, x, y); + }; + var locate$1 = function (doc, node, x, y) { + var r = doc.dom().createRange(); + r.selectNode(node.dom()); + var rect = r.getBoundingClientRect(); + var boundedX = Math.max(rect.left, Math.min(rect.right, x)); + var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); + return locateNode(doc, node, boundedX, boundedY); + }; + + var COLLAPSE_TO_LEFT = true; + var COLLAPSE_TO_RIGHT = false; + var getCollapseDirection = function (rect, x) { + return x - rect.left < rect.right - x ? COLLAPSE_TO_LEFT : COLLAPSE_TO_RIGHT; + }; + var createCollapsedNode = function (doc, target, collapseDirection) { + var r = doc.dom().createRange(); + r.selectNode(target.dom()); + r.collapse(collapseDirection); + return r; + }; + var locateInElement = function (doc, node, x) { + var cursorRange = doc.dom().createRange(); + cursorRange.selectNode(node.dom()); + var rect = cursorRange.getBoundingClientRect(); + var collapseDirection = getCollapseDirection(rect, x); + var f = collapseDirection === COLLAPSE_TO_LEFT ? first : last$1; + return f(node).map(function (target) { + return createCollapsedNode(doc, target, collapseDirection); + }); + }; + var locateInEmpty = function (doc, node, x) { + var rect = node.dom().getBoundingClientRect(); + var collapseDirection = getCollapseDirection(rect, x); + return Option.some(createCollapsedNode(doc, node, collapseDirection)); + }; + var search = function (doc, node, x) { + var f = children(node).length === 0 ? locateInEmpty : locateInElement; + return f(doc, node, x); + }; + + var caretPositionFromPoint = function (doc, x, y) { + return Option.from(doc.dom().caretPositionFromPoint(x, y)).bind(function (pos) { + if (pos.offsetNode === null) { + return Option.none(); + } + var r = doc.dom().createRange(); + r.setStart(pos.offsetNode, pos.offset); + r.collapse(); + return Option.some(r); + }); + }; + var caretRangeFromPoint = function (doc, x, y) { + return Option.from(doc.dom().caretRangeFromPoint(x, y)); + }; + var searchTextNodes = function (doc, node, x, y) { + var r = doc.dom().createRange(); + r.selectNode(node.dom()); + var rect = r.getBoundingClientRect(); + var boundedX = Math.max(rect.left, Math.min(rect.right, x)); + var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); + return locate$1(doc, node, boundedX, boundedY); + }; + var searchFromPoint = function (doc, x, y) { + return Element.fromPoint(doc, x, y).bind(function (elem) { + var fallback = function () { + return search(doc, elem, x); + }; + return children(elem).length === 0 ? fallback() : searchTextNodes(doc, elem, x, y).orThunk(fallback); + }); + }; + var availableSearch = document.caretPositionFromPoint ? caretPositionFromPoint : document.caretRangeFromPoint ? caretRangeFromPoint : searchFromPoint; + var fromPoint$1 = function (win, x, y) { + var doc = Element.fromDom(win.document); + return availableSearch(doc, x, y).map(function (rng) { + return SimRange.create(Element.fromDom(rng.startContainer), rng.startOffset, Element.fromDom(rng.endContainer), rng.endOffset); + }); + }; + + var beforeSpecial = function (element, offset) { + var name$1 = name(element); + if ('input' === name$1) { + return Situ.after(element); + } else if (!contains([ + 'br', + 'img' + ], name$1)) { + return Situ.on(element, offset); + } else { + return offset === 0 ? Situ.before(element) : Situ.after(element); + } + }; + var preprocessRelative = function (startSitu, finishSitu) { + var start = startSitu.fold(Situ.before, beforeSpecial, Situ.after); + var finish = finishSitu.fold(Situ.before, beforeSpecial, Situ.after); + return Selection.relative(start, finish); + }; + var preprocessExact = function (start, soffset, finish, foffset) { + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return Selection.relative(startSitu, finishSitu); + }; + var preprocess = function (selection) { + return selection.match({ + domRange: function (rng) { + var start = Element.fromDom(rng.startContainer); + var finish = Element.fromDom(rng.endContainer); + return preprocessExact(start, rng.startOffset, finish, rng.endOffset); + }, + relative: preprocessRelative, + exact: preprocessExact + }); + }; + + var makeRange = function (start, soffset, finish, foffset) { + var doc = owner(start); + var rng = doc.dom().createRange(); + rng.setStart(start.dom(), soffset); + rng.setEnd(finish.dom(), foffset); + return rng; + }; + var after$3 = function (start, soffset, finish, foffset) { + var r = makeRange(start, soffset, finish, foffset); + var same = eq(start, finish) && soffset === foffset; + return r.collapsed && !same; + }; + + var doSetNativeRange = function (win, rng) { + Option.from(win.getSelection()).each(function (selection) { + selection.removeAllRanges(); + selection.addRange(rng); + }); + }; + var doSetRange = function (win, start, soffset, finish, foffset) { + var rng = exactToNative(win, start, soffset, finish, foffset); + doSetNativeRange(win, rng); + }; + var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) { + selection.collapse(start.dom(), soffset); + selection.extend(finish.dom(), foffset); + }; + var setRangeFromRelative = function (win, relative) { + return diagnose(win, relative).match({ + ltr: function (start, soffset, finish, foffset) { + doSetRange(win, start, soffset, finish, foffset); + }, + rtl: function (start, soffset, finish, foffset) { + var selection = win.getSelection(); + if (selection.setBaseAndExtent) { + selection.setBaseAndExtent(start.dom(), soffset, finish.dom(), foffset); + } else if (selection.extend) { + try { + setLegacyRtlRange(win, selection, start, soffset, finish, foffset); + } catch (e) { + doSetRange(win, finish, foffset, start, soffset); + } + } else { + doSetRange(win, finish, foffset, start, soffset); + } + } + }); + }; + var setExact = function (win, start, soffset, finish, foffset) { + var relative = preprocessExact(start, soffset, finish, foffset); + setRangeFromRelative(win, relative); + }; + var setRelative = function (win, startSitu, finishSitu) { + var relative = preprocessRelative(startSitu, finishSitu); + setRangeFromRelative(win, relative); + }; + var toNative = function (selection) { + var win = Selection.getWin(selection).dom(); + var getDomRange = function (start, soffset, finish, foffset) { + return exactToNative(win, start, soffset, finish, foffset); + }; + var filtered = preprocess(selection); + return diagnose(win, filtered).match({ + ltr: getDomRange, + rtl: getDomRange + }); + }; + var readRange = function (selection) { + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Option.some(SimRange.create(Element.fromDom(firstRng.startContainer), firstRng.startOffset, Element.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Option.none(); + } + }; + var doGetExact = function (selection) { + var anchor = Element.fromDom(selection.anchorNode); + var focus = Element.fromDom(selection.focusNode); + return after$3(anchor, selection.anchorOffset, focus, selection.focusOffset) ? Option.some(SimRange.create(anchor, selection.anchorOffset, focus, selection.focusOffset)) : readRange(selection); + }; + var setToElement = function (win, element) { + var rng = selectNodeContents(win, element); + doSetNativeRange(win, rng); + }; + var getExact = function (win) { + return Option.from(win.getSelection()).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); + }; + var get$a = function (win) { + return getExact(win).map(function (range) { + return Selection.exact(range.start(), range.soffset(), range.finish(), range.foffset()); + }); + }; + var getFirstRect$1 = function (win, selection) { + var rng = asLtrRange(win, selection); + return getFirstRect(rng); + }; + var getAtPoint = function (win, x, y) { + return fromPoint$1(win, x, y); + }; + var clear = function (win) { + var selection = win.getSelection(); + selection.removeAllRanges(); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var forward = function (editor, isRoot, cell, lazyWire) { + return go(editor, isRoot, CellNavigation.next(cell), lazyWire); + }; + var backward = function (editor, isRoot, cell, lazyWire) { + return go(editor, isRoot, CellNavigation.prev(cell), lazyWire); + }; + var getCellFirstCursorPosition = function (editor, cell) { + var selection = Selection.exact(cell, 0, cell, 0); + return toNative(selection); + }; + var getNewRowCursorPosition = function (editor, table) { + var rows = descendants$1(table, 'tr'); + return last(rows).bind(function (last) { + return descendant$1(last, 'td,th').map(function (first) { + return getCellFirstCursorPosition(editor, first); + }); + }); + }; + var go = function (editor, isRoot, cell, actions, lazyWire) { + return cell.fold(Option.none, Option.none, function (current, next) { + return first(next).map(function (cell) { + return getCellFirstCursorPosition(editor, cell); + }); + }, function (current) { + return TableLookup.table(current, isRoot).bind(function (table) { + var targets = TableTargets.noMenu(current); + editor.undoManager.transact(function () { + actions.insertRowsAfter(table, targets); + }); + return getNewRowCursorPosition(editor, table); + }); + }); + }; + var rootElements = [ + 'table', + 'li', + 'dl' + ]; + var handle$1 = function (event, editor, actions, lazyWire) { + if (event.keyCode === global$3.TAB) { + var body_1 = getBody$1(editor); + var isRoot_1 = function (element) { + var name$1 = name(element); + return eq(element, body_1) || contains(rootElements, name$1); + }; + var rng = editor.selection.getRng(); + if (rng.collapsed) { + var start = Element.fromDom(rng.startContainer); + TableLookup.cell(start, isRoot_1).each(function (cell) { + event.preventDefault(); + var navigation = event.shiftKey ? backward : forward; + var rng = navigation(editor, isRoot_1, cell, actions, lazyWire); + rng.each(function (range) { + editor.selection.setRng(range); + }); + }); + } + } + }; + var TabContext = { handle: handle$1 }; + + var create$4 = Immutable('selection', 'kill'); + var Response = { create: create$4 }; + + var create$5 = function (start, soffset, finish, foffset) { + return { + start: constant(Situ.on(start, soffset)), + finish: constant(Situ.on(finish, foffset)) + }; + }; + var Situs = { create: create$5 }; + + var convertToRange = function (win, selection) { + var rng = asLtrRange(win, selection); + return SimRange.create(Element.fromDom(rng.startContainer), rng.startOffset, Element.fromDom(rng.endContainer), rng.endOffset); + }; + var makeSitus = Situs.create; + var Util = { + convertToRange: convertToRange, + makeSitus: makeSitus + }; + + var sync = function (container, isRoot, start, soffset, finish, foffset, selectRange) { + if (!(eq(start, finish) && soffset === foffset)) { + return closest$1(start, 'td,th', isRoot).bind(function (s) { + return closest$1(finish, 'td,th', isRoot).bind(function (f) { + return detect$5(container, isRoot, s, f, selectRange); + }); + }); + } else { + return Option.none(); + } + }; + var detect$5 = function (container, isRoot, start, finish, selectRange) { + if (!eq(start, finish)) { + return CellSelection.identify(start, finish, isRoot).bind(function (cellSel) { + var boxes = cellSel.boxes().getOr([]); + if (boxes.length > 0) { + selectRange(container, boxes, cellSel.start(), cellSel.finish()); + return Option.some(Response.create(Option.some(Util.makeSitus(start, 0, start, getEnd(start))), true)); + } else { + return Option.none(); + } + }); + } else { + return Option.none(); + } + }; + var update = function (rows, columns, container, selected, annotations) { + var updateSelection = function (newSels) { + annotations.clearBeforeUpdate(container); + annotations.selectRange(container, newSels.boxes(), newSels.start(), newSels.finish()); + return newSels.boxes(); + }; + return CellSelection.shiftSelection(selected, rows, columns, annotations.firstSelectedSelector(), annotations.lastSelectedSelector()).map(updateSelection); + }; + var KeySelection = { + sync: sync, + detect: detect$5, + update: update + }; + + var traverse = Immutable('item', 'mode'); + var backtrack = function (universe, item, _direction, transition) { + if (transition === void 0) { + transition = sidestep; + } + return universe.property().parent(item).map(function (p) { + return traverse(p, transition); + }); + }; + var sidestep = function (universe, item, direction, transition) { + if (transition === void 0) { + transition = advance; + } + return direction.sibling(universe, item).map(function (p) { + return traverse(p, transition); + }); + }; + var advance = function (universe, item, direction, transition) { + if (transition === void 0) { + transition = advance; + } + var children = universe.property().children(item); + var result = direction.first(children); + return result.map(function (r) { + return traverse(r, transition); + }); + }; + var successors = [ + { + current: backtrack, + next: sidestep, + fallback: Option.none() + }, + { + current: sidestep, + next: advance, + fallback: Option.some(backtrack) + }, + { + current: advance, + next: advance, + fallback: Option.some(sidestep) + } + ]; + var go$1 = function (universe, item, mode, direction, rules) { + if (rules === void 0) { + rules = successors; + } + var ruleOpt = find(rules, function (succ) { + return succ.current === mode; + }); + return ruleOpt.bind(function (rule) { + return rule.current(universe, item, direction, rule.next).orThunk(function () { + return rule.fallback.bind(function (fb) { + return go$1(universe, item, fb, direction); + }); + }); + }); + }; + + var left = function () { + var sibling = function (universe, item) { + return universe.query().prevSibling(item); + }; + var first = function (children) { + return children.length > 0 ? Option.some(children[children.length - 1]) : Option.none(); + }; + return { + sibling: sibling, + first: first + }; + }; + var right = function () { + var sibling = function (universe, item) { + return universe.query().nextSibling(item); + }; + var first = function (children) { + return children.length > 0 ? Option.some(children[0]) : Option.none(); + }; + return { + sibling: sibling, + first: first + }; + }; + var Walkers = { + left: left, + right: right + }; + + var hone = function (universe, item, predicate, mode, direction, isRoot) { + var next = go$1(universe, item, mode, direction); + return next.bind(function (n) { + if (isRoot(n.item())) { + return Option.none(); + } else { + return predicate(n.item()) ? Option.some(n.item()) : hone(universe, n.item(), predicate, n.mode(), direction, isRoot); + } + }); + }; + var left$1 = function (universe, item, predicate, isRoot) { + return hone(universe, item, predicate, sidestep, Walkers.left(), isRoot); + }; + var right$1 = function (universe, item, predicate, isRoot) { + return hone(universe, item, predicate, sidestep, Walkers.right(), isRoot); + }; + + var isLeaf = function (universe) { + return function (element) { + return universe.property().children(element).length === 0; + }; + }; + var before$3 = function (universe, item, isRoot) { + return seekLeft(universe, item, isLeaf(universe), isRoot); + }; + var after$4 = function (universe, item, isRoot) { + return seekRight(universe, item, isLeaf(universe), isRoot); + }; + var seekLeft = left$1; + var seekRight = right$1; + + var universe$3 = DomUniverse(); + var before$4 = function (element, isRoot) { + return before$3(universe$3, element, isRoot); + }; + var after$5 = function (element, isRoot) { + return after$4(universe$3, element, isRoot); + }; + var seekLeft$1 = function (element, predicate, isRoot) { + return seekLeft(universe$3, element, predicate, isRoot); + }; + var seekRight$1 = function (element, predicate, isRoot) { + return seekRight(universe$3, element, predicate, isRoot); + }; + + var ancestor$2 = function (scope, predicate, isRoot) { + return ancestor(scope, predicate, isRoot).isSome(); + }; + + var adt$5 = Adt.generate([ + { none: ['message'] }, + { success: [] }, + { failedUp: ['cell'] }, + { failedDown: ['cell'] } + ]); + var isOverlapping = function (bridge, before, after) { + var beforeBounds = bridge.getRect(before); + var afterBounds = bridge.getRect(after); + return afterBounds.right > beforeBounds.left && afterBounds.left < beforeBounds.right; + }; + var isRow = function (elem) { + return closest$1(elem, 'tr'); + }; + var verify = function (bridge, before, beforeOffset, after, afterOffset, failure, isRoot) { + return closest$1(after, 'td,th', isRoot).bind(function (afterCell) { + return closest$1(before, 'td,th', isRoot).map(function (beforeCell) { + if (!eq(afterCell, beforeCell)) { + return DomParent.sharedOne(isRow, [ + afterCell, + beforeCell + ]).fold(function () { + return isOverlapping(bridge, beforeCell, afterCell) ? adt$5.success() : failure(beforeCell); + }, function (_sharedRow) { + return failure(beforeCell); + }); + } else { + return eq(after, afterCell) && getEnd(afterCell) === afterOffset ? failure(beforeCell) : adt$5.none('in same cell'); + } + }); + }).getOr(adt$5.none('default')); + }; + var cata$2 = function (subject, onNone, onSuccess, onFailedUp, onFailedDown) { + return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown); + }; + var BeforeAfter = __assign(__assign({}, adt$5), { + verify: verify, + cata: cata$2 + }); + + var inAncestor = Immutable('ancestor', 'descendants', 'element', 'index'); + var inParent = Immutable('parent', 'children', 'element', 'index'); + var indexInParent = function (element) { + return parent(element).bind(function (parent) { + var children$1 = children(parent); + return indexOf(children$1, element).map(function (index) { + return inParent(parent, children$1, element, index); + }); + }); + }; + var indexOf = function (elements, element) { + return findIndex(elements, curry(eq, element)); + }; + + var isBr = function (elem) { + return name(elem) === 'br'; + }; + var gatherer = function (cand, gather, isRoot) { + return gather(cand, isRoot).bind(function (target) { + return isText(target) && get$3(target).trim().length === 0 ? gatherer(target, gather, isRoot) : Option.some(target); + }); + }; + var handleBr = function (isRoot, element, direction) { + return direction.traverse(element).orThunk(function () { + return gatherer(element, direction.gather, isRoot); + }).map(direction.relative); + }; + var findBr = function (element, offset) { + return child(element, offset).filter(isBr).orThunk(function () { + return child(element, offset - 1).filter(isBr); + }); + }; + var handleParent = function (isRoot, element, offset, direction) { + return findBr(element, offset).bind(function (br) { + return direction.traverse(br).fold(function () { + return gatherer(br, direction.gather, isRoot).map(direction.relative); + }, function (adjacent) { + return indexInParent(adjacent).map(function (info) { + return Situ.on(info.parent(), info.index()); + }); + }); + }); + }; + var tryBr = function (isRoot, element, offset, direction) { + var target = isBr(element) ? handleBr(isRoot, element, direction) : handleParent(isRoot, element, offset, direction); + return target.map(function (tgt) { + return { + start: constant(tgt), + finish: constant(tgt) + }; + }); + }; + var process = function (analysis) { + return BeforeAfter.cata(analysis, function (message) { + return Option.none(); + }, function () { + return Option.none(); + }, function (cell) { + return Option.some(point(cell, 0)); + }, function (cell) { + return Option.some(point(cell, getEnd(cell))); + }); + }; + var BrTags = { + tryBr: tryBr, + process: process + }; + + var nu$3 = MixedBag([ + 'left', + 'top', + 'right', + 'bottom' + ], []); + var moveDown = function (caret, amount) { + return nu$3({ + left: caret.left(), + top: caret.top() + amount, + right: caret.right(), + bottom: caret.bottom() + amount + }); + }; + var moveUp = function (caret, amount) { + return nu$3({ + left: caret.left(), + top: caret.top() - amount, + right: caret.right(), + bottom: caret.bottom() - amount + }); + }; + var moveBottomTo = function (caret, bottom) { + var height = caret.bottom() - caret.top(); + return nu$3({ + left: caret.left(), + top: bottom - height, + right: caret.right(), + bottom: bottom + }); + }; + var moveTopTo = function (caret, top) { + var height = caret.bottom() - caret.top(); + return nu$3({ + left: caret.left(), + top: top, + right: caret.right(), + bottom: top + height + }); + }; + var translate = function (caret, xDelta, yDelta) { + return nu$3({ + left: caret.left() + xDelta, + top: caret.top() + yDelta, + right: caret.right() + xDelta, + bottom: caret.bottom() + yDelta + }); + }; + var getTop$1 = function (caret) { + return caret.top(); + }; + var getBottom = function (caret) { + return caret.bottom(); + }; + var toString = function (caret) { + return '(' + caret.left() + ', ' + caret.top() + ') -> (' + caret.right() + ', ' + caret.bottom() + ')'; + }; + var Carets = { + nu: nu$3, + moveUp: moveUp, + moveDown: moveDown, + moveBottomTo: moveBottomTo, + moveTopTo: moveTopTo, + getTop: getTop$1, + getBottom: getBottom, + translate: translate, + toString: toString + }; + + var getPartialBox = function (bridge, element, offset) { + if (offset >= 0 && offset < getEnd(element)) { + return bridge.getRangedRect(element, offset, element, offset + 1); + } else if (offset > 0) { + return bridge.getRangedRect(element, offset - 1, element, offset); + } + return Option.none(); + }; + var toCaret = function (rect) { + return Carets.nu({ + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom + }); + }; + var getElemBox = function (bridge, element) { + return Option.some(bridge.getRect(element)); + }; + var getBoxAt = function (bridge, element, offset) { + if (isElement(element)) { + return getElemBox(bridge, element).map(toCaret); + } else if (isText(element)) { + return getPartialBox(bridge, element, offset).map(toCaret); + } else { + return Option.none(); + } + }; + var getEntireBox = function (bridge, element) { + if (isElement(element)) { + return getElemBox(bridge, element).map(toCaret); + } else if (isText(element)) { + return bridge.getRangedRect(element, 0, element, getEnd(element)).map(toCaret); + } else { + return Option.none(); + } + }; + var Rectangles = { + getBoxAt: getBoxAt, + getEntireBox: getEntireBox + }; + + var JUMP_SIZE = 5; + var NUM_RETRIES = 100; + var adt$6 = Adt.generate([ + { none: [] }, + { retry: ['caret'] } + ]); + var isOutside = function (caret, box) { + return caret.left() < box.left() || Math.abs(box.right() - caret.left()) < 1 || caret.left() > box.right(); + }; + var inOutsideBlock = function (bridge, element, caret) { + return closest(element, DomStructure.isBlock).fold(constant(false), function (cell) { + return Rectangles.getEntireBox(bridge, cell).exists(function (box) { + return isOutside(caret, box); + }); + }); + }; + var adjustDown = function (bridge, element, guessBox, original, caret) { + var lowerCaret = Carets.moveDown(caret, JUMP_SIZE); + if (Math.abs(guessBox.bottom() - original.bottom()) < 1) { + return adt$6.retry(lowerCaret); + } else if (guessBox.top() > caret.bottom()) { + return adt$6.retry(lowerCaret); + } else if (guessBox.top() === caret.bottom()) { + return adt$6.retry(Carets.moveDown(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$6.retry(Carets.translate(lowerCaret, JUMP_SIZE, 0)) : adt$6.none(); + } + }; + var adjustUp = function (bridge, element, guessBox, original, caret) { + var higherCaret = Carets.moveUp(caret, JUMP_SIZE); + if (Math.abs(guessBox.top() - original.top()) < 1) { + return adt$6.retry(higherCaret); + } else if (guessBox.bottom() < caret.top()) { + return adt$6.retry(higherCaret); + } else if (guessBox.bottom() === caret.top()) { + return adt$6.retry(Carets.moveUp(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$6.retry(Carets.translate(higherCaret, JUMP_SIZE, 0)) : adt$6.none(); + } + }; + var upMovement = { + point: Carets.getTop, + adjuster: adjustUp, + move: Carets.moveUp, + gather: before$4 + }; + var downMovement = { + point: Carets.getBottom, + adjuster: adjustDown, + move: Carets.moveDown, + gather: after$5 + }; + var isAtTable = function (bridge, x, y) { + return bridge.elementFromPoint(x, y).filter(function (elm) { + return name(elm) === 'table'; + }).isSome(); + }; + var adjustForTable = function (bridge, movement, original, caret, numRetries) { + return adjustTil(bridge, movement, original, movement.move(caret, JUMP_SIZE), numRetries); + }; + var adjustTil = function (bridge, movement, original, caret, numRetries) { + if (numRetries === 0) { + return Option.some(caret); + } + if (isAtTable(bridge, caret.left(), movement.point(caret))) { + return adjustForTable(bridge, movement, original, caret, numRetries - 1); + } + return bridge.situsFromPoint(caret.left(), movement.point(caret)).bind(function (guess) { + return guess.start().fold(Option.none, function (element) { + return Rectangles.getEntireBox(bridge, element).bind(function (guessBox) { + return movement.adjuster(bridge, element, guessBox, original, caret).fold(Option.none, function (newCaret) { + return adjustTil(bridge, movement, original, newCaret, numRetries - 1); + }); + }).orThunk(function () { + return Option.some(caret); + }); + }, Option.none); + }); + }; + var ieTryDown = function (bridge, caret) { + return bridge.situsFromPoint(caret.left(), caret.bottom() + JUMP_SIZE); + }; + var ieTryUp = function (bridge, caret) { + return bridge.situsFromPoint(caret.left(), caret.top() - JUMP_SIZE); + }; + var checkScroll = function (movement, adjusted, bridge) { + if (movement.point(adjusted) > bridge.getInnerHeight()) { + return Option.some(movement.point(adjusted) - bridge.getInnerHeight()); + } else if (movement.point(adjusted) < 0) { + return Option.some(-movement.point(adjusted)); + } else { + return Option.none(); + } + }; + var retry = function (movement, bridge, caret) { + var moved = movement.move(caret, JUMP_SIZE); + var adjusted = adjustTil(bridge, movement, caret, moved, NUM_RETRIES).getOr(moved); + return checkScroll(movement, adjusted, bridge).fold(function () { + return bridge.situsFromPoint(adjusted.left(), movement.point(adjusted)); + }, function (delta) { + bridge.scrollBy(0, delta); + return bridge.situsFromPoint(adjusted.left(), movement.point(adjusted) - delta); + }); + }; + var Retries = { + tryUp: curry(retry, upMovement), + tryDown: curry(retry, downMovement), + ieTryUp: ieTryUp, + ieTryDown: ieTryDown, + getJumpSize: constant(JUMP_SIZE) + }; + + var MAX_RETRIES = 20; + var platform$2 = detect$3(); + var findSpot = function (bridge, isRoot, direction) { + return bridge.getSelection().bind(function (sel) { + return BrTags.tryBr(isRoot, sel.finish(), sel.foffset(), direction).fold(function () { + return Option.some(point(sel.finish(), sel.foffset())); + }, function (brNeighbour) { + var range = bridge.fromSitus(brNeighbour); + var analysis = BeforeAfter.verify(bridge, sel.finish(), sel.foffset(), range.finish(), range.foffset(), direction.failure, isRoot); + return BrTags.process(analysis); + }); + }); + }; + var scan$1 = function (bridge, isRoot, element, offset, direction, numRetries) { + if (numRetries === 0) { + return Option.none(); + } + return tryCursor(bridge, isRoot, element, offset, direction).bind(function (situs) { + var range = bridge.fromSitus(situs); + var analysis = BeforeAfter.verify(bridge, element, offset, range.finish(), range.foffset(), direction.failure, isRoot); + return BeforeAfter.cata(analysis, function () { + return Option.none(); + }, function () { + return Option.some(situs); + }, function (cell) { + if (eq(element, cell) && offset === 0) { + return tryAgain(bridge, element, offset, Carets.moveUp, direction); + } else { + return scan$1(bridge, isRoot, cell, 0, direction, numRetries - 1); + } + }, function (cell) { + if (eq(element, cell) && offset === getEnd(cell)) { + return tryAgain(bridge, element, offset, Carets.moveDown, direction); + } else { + return scan$1(bridge, isRoot, cell, getEnd(cell), direction, numRetries - 1); + } + }); + }); + }; + var tryAgain = function (bridge, element, offset, move, direction) { + return Rectangles.getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, move(box, Retries.getJumpSize())); + }); + }; + var tryAt = function (bridge, direction, box) { + if (platform$2.browser.isChrome() || platform$2.browser.isSafari() || platform$2.browser.isFirefox() || platform$2.browser.isEdge()) { + return direction.otherRetry(bridge, box); + } else if (platform$2.browser.isIE()) { + return direction.ieRetry(bridge, box); + } else { + return Option.none(); + } + }; + var tryCursor = function (bridge, isRoot, element, offset, direction) { + return Rectangles.getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, box); + }); + }; + var handle$2 = function (bridge, isRoot, direction) { + return findSpot(bridge, isRoot, direction).bind(function (spot) { + return scan$1(bridge, isRoot, spot.element(), spot.offset(), direction, MAX_RETRIES).map(bridge.fromSitus); + }); + }; + var TableKeys = { handle: handle$2 }; + + var detection = detect$3(); + var inSameTable = function (elem, table) { + return ancestor$2(elem, function (e) { + return parent(e).exists(function (p) { + return eq(p, table); + }); + }); + }; + var simulate = function (bridge, isRoot, direction, initial, anchor) { + return closest$1(initial, 'td,th', isRoot).bind(function (start) { + return closest$1(start, 'table', isRoot).bind(function (table) { + if (!inSameTable(anchor, table)) { + return Option.none(); + } + return TableKeys.handle(bridge, isRoot, direction).bind(function (range) { + return closest$1(range.finish(), 'td,th', isRoot).map(function (finish) { + return { + start: constant(start), + finish: constant(finish), + range: constant(range) + }; + }); + }); + }); + }); + }; + var navigate = function (bridge, isRoot, direction, initial, anchor, precheck) { + if (detection.browser.isIE()) { + return Option.none(); + } else { + return precheck(initial, isRoot).orThunk(function () { + return simulate(bridge, isRoot, direction, initial, anchor).map(function (info) { + var range = info.range(); + return Response.create(Option.some(Util.makeSitus(range.start(), range.soffset(), range.finish(), range.foffset())), true); + }); + }); + } + }; + var firstUpCheck = function (initial, isRoot) { + return closest$1(initial, 'tr', isRoot).bind(function (startRow) { + return closest$1(startRow, 'table', isRoot).bind(function (table) { + var rows = descendants$1(table, 'tr'); + if (eq(startRow, rows[0])) { + return seekLeft$1(table, function (element) { + return last$1(element).isSome(); + }, isRoot).map(function (last) { + var lastOffset = getEnd(last); + return Response.create(Option.some(Util.makeSitus(last, lastOffset, last, lastOffset)), true); + }); + } else { + return Option.none(); + } + }); + }); + }; + var lastDownCheck = function (initial, isRoot) { + return closest$1(initial, 'tr', isRoot).bind(function (startRow) { + return closest$1(startRow, 'table', isRoot).bind(function (table) { + var rows = descendants$1(table, 'tr'); + if (eq(startRow, rows[rows.length - 1])) { + return seekRight$1(table, function (element) { + return first(element).isSome(); + }, isRoot).map(function (first) { + return Response.create(Option.some(Util.makeSitus(first, 0, first, 0)), true); + }); + } else { + return Option.none(); + } + }); + }); + }; + var select = function (bridge, container, isRoot, direction, initial, anchor, selectRange) { + return simulate(bridge, isRoot, direction, initial, anchor).bind(function (info) { + return KeySelection.detect(container, isRoot, info.start(), info.finish(), selectRange); + }); + }; + var VerticalMovement = { + navigate: navigate, + select: select, + firstUpCheck: firstUpCheck, + lastDownCheck: lastDownCheck + }; + + var findCell = function (target, isRoot) { + return closest$1(target, 'td,th', isRoot); + }; + function MouseSelection (bridge, container, isRoot, annotations) { + var cursor = Option.none(); + var clearState = function () { + cursor = Option.none(); + }; + var mousedown = function (event) { + annotations.clear(container); + cursor = findCell(event.target(), isRoot); + }; + var mouseover = function (event) { + cursor.each(function (start) { + annotations.clearBeforeUpdate(container); + findCell(event.target(), isRoot).each(function (finish) { + CellSelection.identify(start, finish, isRoot).each(function (cellSel) { + var boxes = cellSel.boxes().getOr([]); + if (boxes.length > 1 || boxes.length === 1 && !eq(start, finish)) { + annotations.selectRange(container, boxes, cellSel.start(), cellSel.finish()); + bridge.selectContents(finish); + } + }); + }); + }); + }; + var mouseup = function (_event) { + cursor.each(clearState); + }; + return { + mousedown: mousedown, + mouseover: mouseover, + mouseup: mouseup + }; + } + + var down = { + traverse: nextSibling, + gather: after$5, + relative: Situ.before, + otherRetry: Retries.tryDown, + ieRetry: Retries.ieTryDown, + failure: BeforeAfter.failedDown + }; + var up = { + traverse: prevSibling, + gather: before$4, + relative: Situ.before, + otherRetry: Retries.tryUp, + ieRetry: Retries.ieTryUp, + failure: BeforeAfter.failedUp + }; + var KeyDirection = { + down: down, + up: up + }; + + var isKey = function (key) { + return function (keycode) { + return keycode === key; + }; + }; + var isUp = isKey(38); + var isDown = isKey(40); + var isNavigation = function (keycode) { + return keycode >= 37 && keycode <= 40; + }; + var SelectionKeys = { + ltr: { + isBackward: isKey(37), + isForward: isKey(39) + }, + rtl: { + isBackward: isKey(39), + isForward: isKey(37) + }, + isUp: isUp, + isDown: isDown, + isNavigation: isNavigation + }; + + var toRaw = function (sr) { + return { + left: sr.left(), + top: sr.top(), + right: sr.right(), + bottom: sr.bottom(), + width: sr.width(), + height: sr.height() + }; + }; + var Rect = { toRaw: toRaw }; + + var isSafari = detect$3().browser.isSafari(); + var get$b = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return Position(x, y); + }; + var by = function (x, y, _DOC) { + var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document; + var win = doc.defaultView; + win.scrollBy(x, y); + }; + + var WindowBridge = function (win) { + var elementFromPoint = function (x, y) { + return Element.fromPoint(Element.fromDom(win.document), x, y); + }; + var getRect = function (element) { + return element.dom().getBoundingClientRect(); + }; + var getRangedRect = function (start, soffset, finish, foffset) { + var sel = Selection.exact(start, soffset, finish, foffset); + return getFirstRect$1(win, sel).map(Rect.toRaw); + }; + var getSelection = function () { + return get$a(win).map(function (exactAdt) { + return Util.convertToRange(win, exactAdt); + }); + }; + var fromSitus = function (situs) { + var relative = Selection.relative(situs.start(), situs.finish()); + return Util.convertToRange(win, relative); + }; + var situsFromPoint = function (x, y) { + return getAtPoint(win, x, y).map(function (exact) { + return Situs.create(exact.start(), exact.soffset(), exact.finish(), exact.foffset()); + }); + }; + var clearSelection = function () { + clear(win); + }; + var collapseSelection = function (toStart) { + if (toStart === void 0) { + toStart = false; + } + get$a(win).each(function (sel) { + return sel.fold(function (rng) { + return rng.collapse(toStart); + }, function (startSitu, finishSitu) { + var situ = toStart ? startSitu : finishSitu; + setRelative(win, situ, situ); + }, function (start, soffset, finish, foffset) { + var node = toStart ? start : finish; + var offset = toStart ? soffset : foffset; + setExact(win, node, offset, node, offset); + }); + }); + }; + var selectContents = function (element) { + setToElement(win, element); + }; + var setSelection = function (sel) { + setExact(win, sel.start(), sel.soffset(), sel.finish(), sel.foffset()); + }; + var setRelativeSelection = function (start, finish) { + setRelative(win, start, finish); + }; + var getInnerHeight = function () { + return win.innerHeight; + }; + var getScrollY = function () { + var pos = get$b(Element.fromDom(win.document)); + return pos.top(); + }; + var scrollBy = function (x, y) { + by(x, y, Element.fromDom(win.document)); + }; + return { + elementFromPoint: elementFromPoint, + getRect: getRect, + getRangedRect: getRangedRect, + getSelection: getSelection, + fromSitus: fromSitus, + situsFromPoint: situsFromPoint, + clearSelection: clearSelection, + collapseSelection: collapseSelection, + setSelection: setSelection, + setRelativeSelection: setRelativeSelection, + selectContents: selectContents, + getInnerHeight: getInnerHeight, + getScrollY: getScrollY, + scrollBy: scrollBy + }; + }; + + var rc = Immutable('rows', 'cols'); + var mouse = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + var handlers = MouseSelection(bridge, container, isRoot, annotations); + return { + mousedown: handlers.mousedown, + mouseover: handlers.mouseover, + mouseup: handlers.mouseup + }; + }; + var keyboard = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + var clearToNavigate = function () { + annotations.clear(container); + return Option.none(); + }; + var keydown = function (event, start, soffset, finish, foffset, direction) { + var realEvent = event.raw(); + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + var handler = CellSelection.retrieve(container, annotations.selectedSelector()).fold(function () { + if (SelectionKeys.isDown(keycode) && shiftKey) { + return curry(VerticalMovement.select, bridge, container, isRoot, KeyDirection.down, finish, start, annotations.selectRange); + } else if (SelectionKeys.isUp(keycode) && shiftKey) { + return curry(VerticalMovement.select, bridge, container, isRoot, KeyDirection.up, finish, start, annotations.selectRange); + } else if (SelectionKeys.isDown(keycode)) { + return curry(VerticalMovement.navigate, bridge, isRoot, KeyDirection.down, finish, start, VerticalMovement.lastDownCheck); + } else if (SelectionKeys.isUp(keycode)) { + return curry(VerticalMovement.navigate, bridge, isRoot, KeyDirection.up, finish, start, VerticalMovement.firstUpCheck); + } else { + return Option.none; + } + }, function (selected) { + var update = function (attempts) { + return function () { + var navigation = findMap(attempts, function (delta) { + return KeySelection.update(delta.rows(), delta.cols(), container, selected, annotations); + }); + return navigation.fold(function () { + return CellSelection.getEdges(container, annotations.firstSelectedSelector(), annotations.lastSelectedSelector()).map(function (edges) { + var relative = SelectionKeys.isDown(keycode) || direction.isForward(keycode) ? Situ.after : Situ.before; + bridge.setRelativeSelection(Situ.on(edges.first(), 0), relative(edges.table())); + annotations.clear(container); + return Response.create(Option.none(), true); + }); + }, function (_) { + return Option.some(Response.create(Option.none(), true)); + }); + }; + }; + if (SelectionKeys.isDown(keycode) && shiftKey) { + return update([rc(+1, 0)]); + } else if (SelectionKeys.isUp(keycode) && shiftKey) { + return update([rc(-1, 0)]); + } else if (direction.isBackward(keycode) && shiftKey) { + return update([ + rc(0, -1), + rc(-1, 0) + ]); + } else if (direction.isForward(keycode) && shiftKey) { + return update([ + rc(0, +1), + rc(+1, 0) + ]); + } else if (SelectionKeys.isNavigation(keycode) && shiftKey === false) { + return clearToNavigate; + } else { + return Option.none; + } + }); + return handler(); + }; + var keyup = function (event, start, soffset, finish, foffset) { + return CellSelection.retrieve(container, annotations.selectedSelector()).fold(function () { + var realEvent = event.raw(); + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + if (shiftKey === false) { + return Option.none(); + } + if (SelectionKeys.isNavigation(keycode)) { + return KeySelection.sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange); + } else { + return Option.none(); + } + }, Option.none); + }; + return { + keydown: keydown, + keyup: keyup + }; + }; + var external = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + return function (start, finish) { + annotations.clearBeforeUpdate(container); + CellSelection.identify(start, finish, isRoot).each(function (cellSel) { + var boxes = cellSel.boxes().getOr([]); + annotations.selectRange(container, boxes, cellSel.start(), cellSel.finish()); + bridge.selectContents(finish); + bridge.collapseSelection(); + }); + }; + }; + var InputHandlers = { + mouse: mouse, + keyboard: keyboard, + external: external + }; + + var remove$7 = function (element, classes) { + each(classes, function (x) { + remove$5(element, x); + }); + }; + + var addClass = function (clazz) { + return function (element) { + add$2(element, clazz); + }; + }; + var removeClasses = function (classes) { + return function (element) { + remove$7(element, classes); + }; + }; + + var byClass = function (ephemera) { + var addSelectionClass = addClass(ephemera.selected()); + var removeSelectionClasses = removeClasses([ + ephemera.selected(), + ephemera.lastSelected(), + ephemera.firstSelected() + ]); + var clear = function (container) { + var sels = descendants$1(container, ephemera.selectedSelector()); + each(sels, removeSelectionClasses); + }; + var selectRange = function (container, cells, start, finish) { + clear(container); + each(cells, addSelectionClass); + add$2(start, ephemera.firstSelected()); + add$2(finish, ephemera.lastSelected()); + }; + return { + clearBeforeUpdate: clear, + clear: clear, + selectRange: selectRange, + selectedSelector: ephemera.selectedSelector, + firstSelectedSelector: ephemera.firstSelectedSelector, + lastSelectedSelector: ephemera.lastSelectedSelector + }; + }; + var byAttr = function (ephemera, onSelection, onClear) { + var removeSelectionAttributes = function (element) { + remove(element, ephemera.selected()); + remove(element, ephemera.firstSelected()); + remove(element, ephemera.lastSelected()); + }; + var addSelectionAttribute = function (element) { + set(element, ephemera.selected(), '1'); + }; + var clear = function (container) { + clearBeforeUpdate(container); + onClear(); + }; + var clearBeforeUpdate = function (container) { + var sels = descendants$1(container, ephemera.selectedSelector()); + each(sels, removeSelectionAttributes); + }; + var selectRange = function (container, cells, start, finish) { + clear(container); + each(cells, addSelectionAttribute); + set(start, ephemera.firstSelected(), '1'); + set(finish, ephemera.lastSelected(), '1'); + onSelection(cells, start, finish); + }; + return { + clearBeforeUpdate: clearBeforeUpdate, + clear: clear, + selectRange: selectRange, + selectedSelector: ephemera.selectedSelector, + firstSelectedSelector: ephemera.firstSelectedSelector, + lastSelectedSelector: ephemera.lastSelectedSelector + }; + }; + var SelectionAnnotation = { + byClass: byClass, + byAttr: byAttr + }; + + var getUpOrLeftCells = function (grid, selectedCells, generators) { + var upGrid = grid.slice(0, selectedCells[selectedCells.length - 1].row() + 1); + var upDetails = toDetailList(upGrid, generators); + return bind(upDetails, function (detail) { + var slicedCells = detail.cells().slice(0, selectedCells[selectedCells.length - 1].column() + 1); + return map(slicedCells, function (cell) { + return cell.element(); + }); + }); + }; + var getDownOrRightCells = function (grid, selectedCells, generators) { + var downGrid = grid.slice(selectedCells[0].row() + selectedCells[0].rowspan() - 1, grid.length); + var downDetails = toDetailList(downGrid, generators); + return bind(downDetails, function (detail) { + var slicedCells = detail.cells().slice(selectedCells[0].column() + selectedCells[0].colspan() - 1, +detail.cells().length); + return map(slicedCells, function (cell) { + return cell.element(); + }); + }); + }; + var getOtherCells = function (table, target, generators) { + var list = DetailsList.fromTable(table); + var house = Warehouse.generate(list); + var details = onCells(house, target); + return details.map(function (selectedCells) { + var grid = Transitions.toGrid(house, generators, false); + var upOrLeftCells = getUpOrLeftCells(grid, selectedCells, generators); + var downOrRightCells = getDownOrRightCells(grid, selectedCells, generators); + return { + upOrLeftCells: upOrLeftCells, + downOrRightCells: downOrRightCells + }; + }); + }; + var OtherCells = { getOtherCells: getOtherCells }; + + var hasInternalTarget = function (e) { + return has$2(Element.fromDom(e.target), 'ephox-snooker-resizer-bar') === false; + }; + function CellSelection$1 (editor, lazyResize, selectionTargets) { + var handlerStruct = MixedBag([ + 'mousedown', + 'mouseover', + 'mouseup', + 'keyup', + 'keydown' + ], []); + var handlers = Option.none(); + var cloneFormats = getCloneElements(editor); + var onSelection = function (cells, start, finish) { + selectionTargets.targets().each(function (targets) { + var tableOpt = TableLookup.table(start); + tableOpt.each(function (table) { + var doc = Element.fromDom(editor.getDoc()); + var generators = TableFill.cellOperations(noop, doc, cloneFormats); + var otherCells = OtherCells.getOtherCells(table, targets, generators); + fireTableSelectionChange(editor, cells, start, finish, otherCells); + }); + }); + }; + var onClear = function () { + fireTableSelectionClear(editor); + }; + var annotations = SelectionAnnotation.byAttr(Ephemera, onSelection, onClear); + editor.on('init', function (e) { + var win = editor.getWin(); + var body = getBody$1(editor); + var isRoot = getIsRoot(editor); + var syncSelection = function () { + var sel = editor.selection; + var start = Element.fromDom(sel.getStart()); + var end = Element.fromDom(sel.getEnd()); + var shared = DomParent.sharedOne(TableLookup.table, [ + start, + end + ]); + shared.fold(function () { + annotations.clear(body); + }, noop); + }; + var mouseHandlers = InputHandlers.mouse(win, body, isRoot, annotations); + var keyHandlers = InputHandlers.keyboard(win, body, isRoot, annotations); + var external = InputHandlers.external(win, body, isRoot, annotations); + var hasShiftKey = function (event) { + return event.raw().shiftKey === true; + }; + editor.on('TableSelectorChange', function (e) { + external(e.start, e.finish); + }); + var handleResponse = function (event, response) { + if (!hasShiftKey(event)) { + return; + } + if (response.kill()) { + event.kill(); + } + response.selection().each(function (ns) { + var relative = Selection.relative(ns.start(), ns.finish()); + var rng = asLtrRange(win, relative); + editor.selection.setRng(rng); + }); + }; + var keyup = function (event) { + var wrappedEvent = fromRawEvent$1(event); + if (wrappedEvent.raw().shiftKey && SelectionKeys.isNavigation(wrappedEvent.raw().which)) { + var rng = editor.selection.getRng(); + var start = Element.fromDom(rng.startContainer); + var end = Element.fromDom(rng.endContainer); + keyHandlers.keyup(wrappedEvent, start, rng.startOffset, end, rng.endOffset).each(function (response) { + handleResponse(wrappedEvent, response); + }); + } + }; + var keydown = function (event) { + var wrappedEvent = fromRawEvent$1(event); + lazyResize().each(function (resize) { + resize.hideBars(); + }); + var rng = editor.selection.getRng(); + var startContainer = Element.fromDom(editor.selection.getStart()); + var start = Element.fromDom(rng.startContainer); + var end = Element.fromDom(rng.endContainer); + var direction = Direction.directionAt(startContainer).isRtl() ? SelectionKeys.rtl : SelectionKeys.ltr; + keyHandlers.keydown(wrappedEvent, start, rng.startOffset, end, rng.endOffset, direction).each(function (response) { + handleResponse(wrappedEvent, response); + }); + lazyResize().each(function (resize) { + resize.showBars(); + }); + }; + var isLeftMouse = function (raw) { + return raw.button === 0; + }; + var isLeftButtonPressed = function (raw) { + if (raw.buttons === undefined) { + return true; + } + if (global$2.browser.isEdge() && raw.buttons === 0) { + return true; + } + return (raw.buttons & 1) !== 0; + }; + var mouseDown = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mousedown(fromRawEvent$1(e)); + } + }; + var mouseOver = function (e) { + if (isLeftButtonPressed(e) && hasInternalTarget(e)) { + mouseHandlers.mouseover(fromRawEvent$1(e)); + } + }; + var mouseUp = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mouseup(fromRawEvent$1(e)); + } + }; + var getDoubleTap = function () { + var lastTarget = Cell(Element.fromDom(body)); + var lastTimeStamp = Cell(0); + var touchEnd = function (t) { + var target = Element.fromDom(t.target); + if (name(target) === 'td' || name(target) === 'th') { + var lT = lastTarget.get(); + var lTS = lastTimeStamp.get(); + if (eq(lT, target) && t.timeStamp - lTS < 300) { + t.preventDefault(); + external(target, target); + } + } + lastTarget.set(target); + lastTimeStamp.set(t.timeStamp); + }; + return { touchEnd: touchEnd }; + }; + var doubleTap = getDoubleTap(); + editor.on('mousedown', mouseDown); + editor.on('mouseover', mouseOver); + editor.on('mouseup', mouseUp); + editor.on('touchend', doubleTap.touchEnd); + editor.on('keyup', keyup); + editor.on('keydown', keydown); + editor.on('NodeChange', syncSelection); + handlers = Option.some(handlerStruct({ + mousedown: mouseDown, + mouseover: mouseOver, + mouseup: mouseUp, + keyup: keyup, + keydown: keydown + })); + }); + var destroy = function () { + handlers.each(function (handlers) { + }); + }; + return { + clear: annotations.clear, + destroy: destroy + }; + } + + var Selections = function (editor) { + var get = function () { + var body = getBody$1(editor); + return TableSelection.retrieve(body, Ephemera.selectedSelector()).fold(function () { + if (editor.selection.getStart() === undefined) { + return SelectionTypes.none(); + } else { + return SelectionTypes.single(editor.selection); + } + }, function (cells) { + return SelectionTypes.multiple(cells); + }); + }; + return { get: get }; + }; + + var getSelectionTargets = function (editor, selections) { + var targets = Cell(Option.none()); + var changeHandlers = Cell([]); + var findTargets = function () { + return getSelectionStartCellOrCaption(editor).bind(function (cellOrCaption) { + var table = TableLookup.table(cellOrCaption); + return table.map(function (table) { + if (name(cellOrCaption) === 'caption') { + return TableTargets.notCell(cellOrCaption); + } else { + return TableTargets.forMenu(selections, table, cellOrCaption); + } + }); + }); + }; + var resetTargets = function () { + targets.set(cached(findTargets)()); + each(changeHandlers.get(), function (handler) { + return handler(); + }); + }; + var onSetup = function (api, isDisabled) { + var handler = function () { + return targets.get().fold(function () { + api.setDisabled(true); + }, function (targets) { + api.setDisabled(isDisabled(targets)); + }); + }; + handler(); + changeHandlers.set(changeHandlers.get().concat([handler])); + return function () { + changeHandlers.set(filter(changeHandlers.get(), function (h) { + return h !== handler; + })); + }; + }; + var onSetupTable = function (api) { + return onSetup(api, function (_) { + return false; + }); + }; + var onSetupCellOrRow = function (api) { + return onSetup(api, function (targets) { + return name(targets.element()) === 'caption'; + }); + }; + var onSetupMergeable = function (api) { + return onSetup(api, function (targets) { + return targets.mergable().isNone(); + }); + }; + var onSetupUnmergeable = function (api) { + return onSetup(api, function (targets) { + return targets.unmergable().isNone(); + }); + }; + editor.on('NodeChange TableSelectorChange', resetTargets); + return { + onSetupTable: onSetupTable, + onSetupCellOrRow: onSetupCellOrRow, + onSetupMergeable: onSetupMergeable, + onSetupUnmergeable: onSetupUnmergeable, + resetTargets: resetTargets, + targets: function () { + return targets.get(); + } + }; + }; + + var addButtons = function (editor, selectionTargets) { + editor.ui.registry.addMenuButton('table', { + tooltip: 'Table', + icon: 'table', + fetch: function (callback) { + return callback('inserttable | cell row column | advtablesort | tableprops deletetable'); + } + }); + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + editor.ui.registry.addButton('tableprops', { + tooltip: 'Table properties', + onAction: cmd('mceTableProps'), + icon: 'table', + onSetup: selectionTargets.onSetupTable + }); + editor.ui.registry.addButton('tabledelete', { + tooltip: 'Delete table', + onAction: cmd('mceTableDelete'), + icon: 'table-delete-table', + onSetup: selectionTargets.onSetupTable + }); + editor.ui.registry.addButton('tablecellprops', { + tooltip: 'Cell properties', + onAction: cmd('mceTableCellProps'), + icon: 'table-cell-properties', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablemergecells', { + tooltip: 'Merge cells', + onAction: cmd('mceTableMergeCells'), + icon: 'table-merge-cells', + onSetup: selectionTargets.onSetupMergeable + }); + editor.ui.registry.addButton('tablesplitcells', { + tooltip: 'Split cell', + onAction: cmd('mceTableSplitCells'), + icon: 'table-split-cells', + onSetup: selectionTargets.onSetupUnmergeable + }); + editor.ui.registry.addButton('tableinsertrowbefore', { + tooltip: 'Insert row before', + onAction: cmd('mceTableInsertRowBefore'), + icon: 'table-insert-row-above', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertrowafter', { + tooltip: 'Insert row after', + onAction: cmd('mceTableInsertRowAfter'), + icon: 'table-insert-row-after', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tabledeleterow', { + tooltip: 'Delete row', + onAction: cmd('mceTableDeleteRow'), + icon: 'table-delete-row', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablerowprops', { + tooltip: 'Row properties', + onAction: cmd('mceTableRowProps'), + icon: 'table-row-properties', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertcolbefore', { + tooltip: 'Insert column before', + onAction: cmd('mceTableInsertColBefore'), + icon: 'table-insert-column-before', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertcolafter', { + tooltip: 'Insert column after', + onAction: cmd('mceTableInsertColAfter'), + icon: 'table-insert-column-after', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tabledeletecol', { + tooltip: 'Delete column', + onAction: cmd('mceTableDeleteCol'), + icon: 'table-delete-column', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecutrow', { + tooltip: 'Cut row', + onAction: cmd('mceTableCutRow'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecopyrow', { + tooltip: 'Copy row', + onAction: cmd('mceTableCopyRow'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepasterowbefore', { + tooltip: 'Paste row before', + onAction: cmd('mceTablePasteRowBefore'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepasterowafter', { + tooltip: 'Paste row after', + onAction: cmd('mceTablePasteRowAfter'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertdialog', { + tooltip: 'Insert table', + onAction: cmd('mceInsertTable'), + icon: 'table' + }); + }; + var addToolbars = function (editor) { + var isTable = function (table) { + return editor.dom.is(table, 'table') && editor.getBody().contains(table); + }; + var toolbar = getToolbar(editor); + if (toolbar.length > 0) { + editor.ui.registry.addContextToolbar('table', { + predicate: isTable, + items: toolbar, + scope: 'node', + position: 'node' + }); + } + }; + var Buttons = { + addButtons: addButtons, + addToolbars: addToolbars + }; + + var addMenuItems = function (editor, selectionTargets) { + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + var insertTableAction = function (_a) { + var numRows = _a.numRows, numColumns = _a.numColumns; + editor.undoManager.transact(function () { + InsertTable.insert(editor, numColumns, numRows); + }); + editor.addVisual(); + }; + var tableProperties = { + text: 'Table properties', + onSetup: selectionTargets.onSetupTable, + onAction: cmd('mceTableProps') + }; + var deleteTable = { + text: 'Delete table', + icon: 'table-delete-table', + onSetup: selectionTargets.onSetupTable, + onAction: cmd('mceTableDelete') + }; + var rowItems = [ + { + type: 'menuitem', + text: 'Insert row before', + icon: 'table-insert-row-above', + onAction: cmd('mceTableInsertRowBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Insert row after', + icon: 'table-insert-row-after', + onAction: cmd('mceTableInsertRowAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Delete row', + icon: 'table-delete-row', + onAction: cmd('mceTableDeleteRow'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Row properties', + icon: 'table-row-properties', + onAction: cmd('mceTableRowProps'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { type: 'separator' }, + { + type: 'menuitem', + text: 'Cut row', + onAction: cmd('mceTableCutRow'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Copy row', + onAction: cmd('mceTableCopyRow'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Paste row before', + onAction: cmd('mceTablePasteRowBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Paste row after', + onAction: cmd('mceTablePasteRowAfter'), + onSetup: selectionTargets.onSetupCellOrRow + } + ]; + var row = { + type: 'nestedmenuitem', + text: 'Row', + getSubmenuItems: function () { + return rowItems; + } + }; + var columnItems = [ + { + type: 'menuitem', + text: 'Insert column before', + icon: 'table-insert-column-before', + onAction: cmd('mceTableInsertColBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Insert column after', + icon: 'table-insert-column-after', + onAction: cmd('mceTableInsertColAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Delete column', + icon: 'table-delete-column', + onAction: cmd('mceTableDeleteCol'), + onSetup: selectionTargets.onSetupCellOrRow + } + ]; + var column = { + type: 'nestedmenuitem', + text: 'Column', + getSubmenuItems: function () { + return columnItems; + } + }; + var cellItems = [ + { + type: 'menuitem', + text: 'Cell properties', + icon: 'table-cell-properties', + onAction: cmd('mceTableCellProps'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Merge cells', + icon: 'table-merge-cells', + onAction: cmd('mceTableMergeCells'), + onSetup: selectionTargets.onSetupMergeable + }, + { + type: 'menuitem', + text: 'Split cell', + icon: 'table-split-cells', + onAction: cmd('mceTableSplitCells'), + onSetup: selectionTargets.onSetupUnmergeable + } + ]; + var cell = { + type: 'nestedmenuitem', + text: 'Cell', + getSubmenuItems: function () { + return cellItems; + } + }; + if (hasTableGrid(editor) === false) { + editor.ui.registry.addMenuItem('inserttable', { + text: 'Table', + icon: 'table', + onAction: cmd('mceInsertTable') + }); + } else { + editor.ui.registry.addNestedMenuItem('inserttable', { + text: 'Table', + icon: 'table', + getSubmenuItems: function () { + return [{ + type: 'fancymenuitem', + fancytype: 'inserttable', + onAction: insertTableAction + }]; + } + }); + } + editor.ui.registry.addMenuItem('inserttabledialog', { + text: 'Insert table', + icon: 'table', + onAction: cmd('mceInsertTable') + }); + editor.ui.registry.addMenuItem('tableprops', tableProperties); + editor.ui.registry.addMenuItem('deletetable', deleteTable); + editor.ui.registry.addNestedMenuItem('row', row); + editor.ui.registry.addNestedMenuItem('column', column); + editor.ui.registry.addNestedMenuItem('cell', cell); + editor.ui.registry.addContextMenu('table', { + update: function () { + selectionTargets.resetTargets(); + return selectionTargets.targets().fold(function () { + return ''; + }, function (targets) { + if (name(targets.element()) === 'caption') { + return 'tableprops deletetable'; + } else { + return 'cell row column | advtablesort | tableprops deletetable'; + } + }); + } + }); + }; + var MenuItems = { addMenuItems: addMenuItems }; + + var getClipboardRows = function (clipboardRows) { + return clipboardRows.get().fold(function () { + return; + }, function (rows) { + return map(rows, function (row) { + return row.dom(); + }); + }); + }; + var setClipboardRows = function (rows, clipboardRows) { + var sugarRows = map(rows, Element.fromDom); + clipboardRows.set(Option.from(sugarRows)); + }; + var getApi = function (editor, clipboardRows, resizeHandler, selectionTargets) { + return { + insertTable: function (columns, rows) { + return InsertTable.insert(editor, columns, rows); + }, + setClipboardRows: function (rows) { + return setClipboardRows(rows, clipboardRows); + }, + getClipboardRows: function () { + return getClipboardRows(clipboardRows); + }, + resizeHandler: resizeHandler, + selectionTargets: selectionTargets + }; + }; + + function Plugin(editor) { + var selections = Selections(editor); + var selectionTargets = getSelectionTargets(editor, selections); + var resizeHandler = getResizeHandler(editor); + var cellSelection = CellSelection$1(editor, resizeHandler.lazyResize, selectionTargets); + var actions = TableActions(editor, resizeHandler.lazyWire); + var clipboardRows = Cell(Option.none()); + Commands.registerCommands(editor, actions, cellSelection, selections, clipboardRows); + Clipboard.registerEvents(editor, selections, actions, cellSelection); + MenuItems.addMenuItems(editor, selectionTargets); + Buttons.addButtons(editor, selectionTargets); + Buttons.addToolbars(editor); + editor.on('PreInit', function () { + editor.serializer.addTempAttr(Ephemera.firstSelected()); + editor.serializer.addTempAttr(Ephemera.lastSelected()); + }); + if (hasTabNavigation(editor)) { + editor.on('keydown', function (e) { + TabContext.handle(e, editor, actions, resizeHandler.lazyWire); + }); + } + editor.on('remove', function () { + resizeHandler.destroy(); + cellSelection.destroy(); + }); + return getApi(editor, clipboardRows, resizeHandler, selectionTargets); + } + function Plugin$1 () { + global.add('table', Plugin); + } + + Plugin$1(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.min.js index 51896fd..631ee92 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/table/plugin.min.js @@ -1 +1,9 @@ -!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i "+t+" tr",a);i(n,function(n,r){r+=e,i(I.select("> td, > th",n),function(e,n){var i,a,l,s;if(A[r])for(;A[r][n];)n++;for(l=o(e,"rowspan"),s=o(e,"colspan"),a=r;r+l>a;a++)for(A[a]||(A[a]=[]),i=n;n+s>i;i++)A[a][i]={part:t,real:a==r&&i==n,elm:e,rowspan:l,colspan:s}})}),e+=n.length})}function s(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,t){var n;return n=A[t],n?n[e]:void 0}function d(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function u(e){return e&&(I.hasClass(e.elm,"mce-item-selected")||e==M)}function f(){var e=[];return i(a.rows,function(t){i(t.cells,function(n){return I.hasClass(n,"mce-item-selected")||M&&n==M.elm?(e.push(t),!1):void 0})}),e}function m(){var e=I.createRng();e.setStartAfter(a),e.setEndAfter(a),E.setRng(e),I.remove(a)}function p(t){var o,a={};return r.settings.table_clone_elements!==!1&&(a=e.makeMap((r.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(t,function(e){var r;return 3==e.nodeType?(i(I.getParents(e.parentNode,null,t).reverse(),function(e){a[e.nodeName]&&(e=s(e,!1),o?r&&r.appendChild(e):o=r=e,r=e)}),r&&(r.innerHTML=n.ie?" ":'
    '),!1):void 0},"childNodes"),t=s(t,!1),d(t,"rowSpan",1),d(t,"colSpan",1),o?t.appendChild(o):n.ie||(t.innerHTML='
    '),t}function g(){var e=I.createRng(),t;return i(I.select("tr",a),function(e){0===e.cells.length&&I.remove(e)}),0===I.select("tr",a).length?(e.setStartBefore(a),e.setEndBefore(a),E.setRng(e),void I.remove(a)):(i(I.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&I.remove(e)}),l(),void(B&&(t=A[Math.min(A.length-1,B.y)],t&&(E.select(t[Math.min(t.length-1,B.x)].elm,!0),E.collapse(!0)))))}function h(e,t,n,o){var i,r,a,l,s;for(i=A[t][e].elm.parentNode,a=1;n>=a;a++)if(i=I.getNext(i,"tr")){for(r=e;r>=0;r--)if(s=A[t+a][r].elm,s.parentNode==i){for(l=1;o>=l;l++)I.insertAfter(p(s),s);break}if(-1==r)for(l=1;o>=l;l++)i.insertBefore(p(i.cells[0]),i.cells[0])}}function v(){i(A,function(e,t){i(e,function(e,n){var i,r,a;if(u(e)&&(e=e.elm,i=o(e,"colspan"),r=o(e,"rowspan"),i>1||r>1)){for(d(e,"rowSpan",1),d(e,"colSpan",1),a=0;i-1>a;a++)I.insertAfter(p(e),e);h(n,t,r-1,i)}})})}function b(t,n,o){var r,a,s,f,m,p,h,b,y,w,x;if(t?(r=T(t),a=r.x,s=r.y,f=a+(n-1),m=s+(o-1)):(B=D=null,i(A,function(e,t){i(e,function(e,n){u(e)&&(B||(B={x:n,y:t}),D={x:n,y:t})})}),B&&(a=B.x,s=B.y,f=D.x,m=D.y)),b=c(a,s),y=c(f,m),b&&y&&b.part==y.part){for(v(),l(),b=c(a,s).elm,d(b,"colSpan",f-a+1),d(b,"rowSpan",m-s+1),h=s;m>=h;h++)for(p=a;f>=p;p++)A[h]&&A[h][p]&&(t=A[h][p].elm,t!=b&&(w=e.grep(t.childNodes),i(w,function(e){b.appendChild(e)}),w.length&&(w=e.grep(b.childNodes),x=0,i(w,function(e){"BR"==e.nodeName&&I.getAttrib(e,"data-mce-bogus")&&x++0&&A[n-1][l]&&(g=A[n-1][l].elm,h=o(g,"rowSpan"),h>1)){d(g,"rowSpan",h+1);continue}}else if(h=o(r,"rowspan"),h>1){d(r,"rowSpan",h+1);continue}m=p(r),d(m,"colSpan",r.colSpan),f.appendChild(m),a=r}f.hasChildNodes()&&(e?c.parentNode.insertBefore(f,c):I.insertAfter(f,c))}}function w(e){var t,n;i(A,function(n){return i(n,function(n,o){return u(n)&&(t=o,e)?!1:void 0}),e?!t:void 0}),i(A,function(i,r){var a,l,s;i[t]&&(a=i[t].elm,a!=n&&(s=o(a,"colspan"),l=o(a,"rowspan"),1==s?e?(a.parentNode.insertBefore(p(a),a),h(t,r,l-1,s)):(I.insertAfter(p(a),a),h(t,r,l-1,s)):d(a,"colSpan",a.colSpan+1),n=a))})}function x(){var t=[];i(A,function(n){i(n,function(n,r){u(n)&&-1===e.inArray(t,r)&&(i(A,function(e){var t=e[r].elm,n;n=o(t,"colSpan"),n>1?d(t,"colSpan",n-1):I.remove(t)}),t.push(r))})}),g()}function C(){function e(e){var t,n,r;t=I.getNext(e,"tr"),i(e.cells,function(e){var t=o(e,"rowSpan");t>1&&(d(e,"rowSpan",t-1),n=T(e),h(n.x,n.y,1,1))}),n=T(e.cells[0]),i(A[n.y],function(e){var t;e=e.elm,e!=r&&(t=o(e,"rowSpan"),1>=t?I.remove(e):d(e,"rowSpan",t-1),r=e)})}var t;t=f(),i(t.reverse(),function(t){e(t)}),g()}function P(){var e=f();return I.remove(e),g(),e}function S(){var e=f();return i(e,function(t,n){e[n]=s(t,!0)}),e}function R(e,t){var n=f(),o=n[t?0:n.length-1],r=o.cells.length;e&&(i(A,function(e){var t;return r=0,i(e,function(e){e.real&&(r+=e.colspan),e.elm.parentNode==o&&(t=1)}),t?!1:void 0}),t||e.reverse(),i(e,function(e){var n,i=e.cells.length,a;for(n=0;i>n;n++)a=e.cells[n],d(a,"colSpan",1),d(a,"rowSpan",1);for(n=i;r>n;n++)e.appendChild(p(e.cells[i-1]));for(n=r;i>n;n++)I.remove(e.cells[n]);t?o.parentNode.insertBefore(e,o):I.insertAfter(e,o)}),I.removeClass(I.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function T(e){var t;return i(A,function(n,o){return i(n,function(n,i){return n.elm==e?(t={x:i,y:o},!1):void 0}),!t}),t}function k(e){B=T(e)}function N(){var e,t;return e=t=0,i(A,function(n,o){i(n,function(n,i){var r,a;u(n)&&(n=A[o][i],i>e&&(e=i),o>t&&(t=o),n.real&&(r=n.colspan-1,a=n.rowspan-1,r&&i+r>e&&(e=i+r),a&&o+a>t&&(t=o+a)))})}),{x:e,y:t}}function _(e){var t,n,o,i,r,a,l,s,c,d;if(D=T(e),B&&D){for(t=Math.min(B.x,D.x),n=Math.min(B.y,D.y),o=Math.max(B.x,D.x),i=Math.max(B.y,D.y),r=o,a=i,d=n;a>=d;d++)e=A[d][t],e.real||t-(e.colspan-1)=c;c++)e=A[n][c],e.real||n-(e.rowspan-1)=d;d++)for(c=t;o>=c;c++)e=A[d][c],e.real&&(l=e.colspan-1,s=e.rowspan-1,l&&c+l>r&&(r=c+l),s&&d+s>a&&(a=d+s));for(I.removeClass(I.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;a>=d;d++)for(c=t;r>=c;c++)A[d][c]&&I.addClass(A[d][c].elm,"mce-item-selected")}}var A,B,D,M,E=r.selection,I=E.dom;a=a||I.getParent(E.getStart(),"table"),l(),M=I.getParent(E.getStart(),"th,td"),M&&(B=T(M),D=N(),M=c(B.x,B.y)),e.extend(this,{deleteTable:m,split:v,merge:b,insertRow:y,insertCol:w,deleteCols:x,deleteRows:C,cutRows:P,copyRows:S,pasteRows:R,getPos:T,setStartCell:k,setEndCell:_})}}),o(u,[f,d,c],function(e,t,n){function o(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function r(){function t(t){function r(e,o){var i=e?"previousSibling":"nextSibling",r=n.dom.getParent(o,"tr"),l=r[i];if(l)return h(n,o,l,e),t.preventDefault(),!0;var d=n.dom.getParent(r,"table"),u=r.parentNode,f=u.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var m=a(e,d,u,"tbody");if(null!==m)return s(e,m,o)}return c(e,r,i,d)}function a(e,t,o,i){var r=n.dom.select(">"+i,t),a=r.indexOf(o);if(e&&0===a||!e&&a===r.length-1)return l(e,t);if(-1===a){var s="thead"===o.tagName.toLowerCase()?0:r.length-1;return r[s]}return r[a+(e?-1:1)]}function l(e,t){var o=e?"thead":"tfoot",i=n.dom.select(">"+o,t);return 0!==i.length?i[0]:null}function s(e,o,i){var r=d(o,e);return r&&h(n,i,r,e),t.preventDefault(),!0}function c(e,o,i,a){var l=a[i];if(l)return u(l),!0;var s=n.dom.getParent(a,"td,th");if(s)return r(e,s,t);var c=d(o,!e);return u(c),t.preventDefault(),!1}function d(e,t){var o=e&&e[t?"lastChild":"firstChild"];return o&&"BR"===o.nodeName?n.dom.getParent(o,"td,th"):o}function u(e){n.selection.setCursorLocation(e,0)}function f(){return y==e.UP||y==e.DOWN}function m(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function p(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=o(n,"colspan");return t}function g(e,t){var n=0,r=0;return i(e.children,function(e,i){return n+=o(e,"colspan"),r=i,n>t?!1:void 0}),r}function h(e,t,o,i){var r=p(n.dom.getParent(t,"td,th")),a=g(o,r),l=o.childNodes[a],s=d(l,i);u(s||l)}function v(e){var t=n.selection.getNode(),o=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return o&&o!==i&&b(o,i)}function b(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var y=t.keyCode;if(f()&&m(n)){var w=n.selection.getNode();setTimeout(function(){v(w)&&r(!t.shiftKey&&y===e.UP,w,t)},0)}}n.on("KeyDown",function(e){t(e)})}function a(){function e(e,t){var n=t.ownerDocument,o=n.createRange(),i;return o.setStartBefore(t),o.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(o.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var o,i,r=n.dom;(37==t.keyCode||38==t.keyCode)&&(o=n.selection.getRng(),i=r.getParent(o.startContainer,"table"),i&&n.getBody().firstChild==i&&e(o,i)&&(o=r.createRng(),o.setStartBefore(i),o.setEndBefore(i),n.selection.setRng(o),t.preventDefault()))})}function l(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&!e.getAttribute("data-mce-bogus"))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs,t.ie&&t.ie<11?" ":'
    '):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function s(){function e(e,t,n,o){var i=3,r=e.dom.getParent(t.startContainer,"TABLE"),a,l,s;return r&&(a=r.parentNode),l=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==a),s=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,l||s}function t(){var t=n.selection.getRng(),o=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,o,i)){i||(i=o);for(var r=i.lastChild;r.lastChild;)r=r.lastChild;t.setEnd(r,r.nodeValue.length),n.selection.setRng(t)}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}function c(){n.on("keydown",function(t){if((t.keyCode==e.DELETE||t.keyCode==e.BACKSPACE)&&!t.isDefaultPrevented()){var o=n.dom.getParent(n.selection.getStart(),"table");if(o){for(var i=n.dom.select("td,th",o),r=i.length;r--;)if(!n.dom.hasClass(i[r],"mce-item-selected"))return;t.preventDefault(),n.execCommand("mceTableDelete")}}})}c(),t.webkit&&(r(),s()),t.gecko&&(a(),l()),t.ie>10&&(a(),l())}}),o(m,[s,p,c],function(e,t,n){return function(o){function i(){o.getBody().style.webkitUserSelect="",d&&(o.dom.removeClass(o.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function r(t){var n,i,r=t.target;if(s&&(l||r!=s)&&("TD"==r.nodeName||"TH"==r.nodeName)){i=a.getParent(r,"table"),i==c&&(l||(l=new e(o,i),l.setStartCell(s),o.getBody().style.webkitUserSelect="none"),l.setEndCell(r),d=!0),n=o.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var a=o.dom,l,s,c,d=!0;return o.on("MouseDown",function(e){2!=e.button&&(i(),s=a.getParent(e.target,"td,th"),c=a.getParent(s,"table"))}),o.on("mouseover",r),o.on("remove",function(){a.unbind(o.getDoc(),"mouseover",r)}),o.on("MouseUp",function(){function e(e,o){var r=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return void(o?i.setStart(e,0):i.setEnd(e,e.nodeValue.length));if("BR"==e.nodeName)return void(o?i.setStartBefore(e):i.setEndBefore(e))}while(e=o?r.next():r.prev())}var i,r=o.selection,d,u,f,m,p;if(s){if(l&&(o.getBody().style.webkitUserSelect=""),d=a.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=a.createRng(),f=d[0],p=d[d.length-1],i.setStartBefore(f),i.setEndAfter(f),e(f,1),u=new t(f,a.getParent(d[0],"table"));do if("TD"==f.nodeName||"TH"==f.nodeName){if(!a.hasClass(f,"mce-item-selected"))break;m=f}while(f=u.next());e(m),r.setRng(i)}o.nodeChanged(),s=l=c=null}}),o.on("KeyUp Drop",function(){i(),s=l=c=null}),{clear:i}}}),o(g,[s,u,m,c,p,d,h],function(e,t,n,o,i,r,a){function l(o){function i(e){return e?e.replace(/px$/,""):""}function a(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(e){s("left center right".split(" "),function(t){o.formatter.remove("align"+t,{},e)})}function c(e){s("top middle bottom".split(" "),function(t){o.formatter.remove("valign"+t,{},e)})}function d(){var e=o.dom,t,n,c,d;t=e.getParent(o.selection.getStart(),"table"),d={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:t?e.getAttrib(t,"cellspacing"):"",cellpadding:t?e.getAttrib(t,"cellpadding"):"",border:t?e.getAttrib(t,"border"):"",caption:!!e.select("caption",t)[0]},s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(d.align=e)}),t||(n={label:"Cols",name:"cols"},c={label:"Rows",name:"rows"}),o.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:d,defaults:{type:"textbox",maxWidth:50},items:[n,c,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),i;o.undoManager.transact(function(){t||(t=g(n.cols||1,n.rows||1)),o.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),o.dom.setStyles(t,{width:a(n.width),height:a(n.height)}),i=e.select("caption",t)[0],i&&!n.caption&&e.remove(i),!i&&n.caption&&(i=e.create("caption"),i.innerHTML=r.ie?"\xa0":'
    ',t.insertBefore(i,t.firstChild)),l(t),n.align&&o.formatter.apply("align"+n.align,{},t),o.focus(),o.addVisual()})}})}function u(e,t){o.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();o.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function f(){var e=o.dom,t,n,r=[];r=o.dom.select("td.mce-item-selected,th.mce-item-selected"),t=o.dom.getParent(o.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],t&&(n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),s("top middle bottom".split(" "),function(e){o.formatter.matchNode(t,"valign"+e)&&(n.valign=e)}),o.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},onsubmit:function(){var t=this.toJSON();o.undoManager.transact(function(){s(r,function(n){o.dom.setAttrib(n,"scope",t.scope),o.dom.setStyles(n,{width:a(t.width),height:a(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),l(n),t.align&&o.formatter.apply("align"+t.align,{},n),c(n),t.valign&&o.formatter.apply("valign"+t.valign,{},n)}),o.focus()})}}))}function m(){var e=o.dom,t,n,r,c,d=[];t=o.dom.getParent(o.selection.getStart(),"table"),n=o.dom.getParent(o.selection.getStart(),"td,th"),s(t.rows,function(t){s(t.cells,function(o){return e.hasClass(o,"mce-item-selected")||o==n?(d.push(t),!1):void 0})}),r=d[0],r&&(c={height:i(e.getStyle(r,"height")||e.getAttrib(r,"height")),scope:e.getAttrib(r,"scope")},c.type=r.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(r,"align"+e)&&(c.align=e)}),o.windowManager.open({title:"Row properties",items:{type:"form",data:c,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,i,r;o.undoManager.transact(function(){var c=t.type;s(d,function(s){o.dom.setAttrib(s,"scope",t.scope),o.dom.setStyles(s,{height:a(t.height)}),c!=s.parentNode.nodeName.toLowerCase()&&(n=e.getParent(s,"table"),i=s.parentNode,r=e.select(c,n)[0],r||(r=e.create(c),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.appendChild(s),i.hasChildNodes()||e.remove(i)),l(s),t.align&&o.formatter.apply("align"+t.align,{},s)}),o.focus()})}}))}function p(e){return function(){o.execCommand(e)}}function g(e,t){var n,i,a;for(a='',n=0;t>n;n++){for(a+="",i=0;e>i;i++)a+="";a+=""}a+="
    "+(r.ie?" ":"
    ")+"
    ",o.insertContent(a);var l=o.dom.get("__mce");return o.dom.setAttrib(l,"id",null),l}function h(e,t){function n(){e.disabled(!o.dom.getParent(o.selection.getStart(),t)),o.selection.selectorChanged(t,function(t){e.disabled(!t)})}o.initialized?n():o.on("init",n)}function v(){h(this,"table")}function b(){h(this,"td,th")}function y(){var e="";e='';for(var t=0;10>t;t++){e+="";for(var n=0;10>n;n++)e+='';e+=""}return e+="
    ",e+=''}function w(e,t,n){var i=n.getEl().getElementsByTagName("table")[0],r,a,l,s,c,d=n.isRtl()||"tl-tr"==n.parent().rel;for(i.nextSibling.innerHTML=e+1+" x "+(t+1),d&&(e=9-e),a=0;10>a;a++)for(r=0;10>r;r++)s=i.rows[a].childNodes[r].firstChild,c=(d?r>=e:e>=r)&&t>=a,o.dom.toggleClass(s,"mce-active",c),c&&(l=s);return l.parentNode}var x,C,P=this;o.settings.table_grid===!1?o.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onclick:d}):o.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),d())},onshow:function(){w(0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:y(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t=e.target,n,o;"A"==t.tagName.toUpperCase()&&(n=parseInt(t.getAttribute("data-mce-x"),10),o=parseInt(t.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"==this.parent().rel)&&(n=9-n),(n!==this.lastX||o!==this.lastY)&&(w(n,o,e.control),this.lastX=n,this.lastY=o))},onkeydown:function(e){var t=this.lastX,n=this.lastY,o;switch(e.keyCode){case 37:t>0&&(t--,o=!0);break;case 39:o=!0,9>t&&t++;break;case 38:o=!0,n>0&&n--;break;case 40:o=!0,9>n&&n++}o&&(e.preventDefault(),e.stopPropagation(),w(t,n,e.control).focus(),this.lastX=t,this.lastY=n)},onclick:function(e){"A"==e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),this.parent().cancel(),g(this.lastX+1,this.lastY+1))}}]}),o.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:v,onclick:d}),o.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:v,cmd:"mceTableDelete"}),o.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:p("mceTableCellProps"),onPostRender:b},{text:"Merge cells",onclick:p("mceTableMergeCells"),onPostRender:b},{text:"Split cell",onclick:p("mceTableSplitCells"),onPostRender:b}]}),o.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:p("mceTableInsertRowBefore"),onPostRender:b},{text:"Insert row after",onclick:p("mceTableInsertRowAfter"),onPostRender:b},{text:"Delete row",onclick:p("mceTableDeleteRow"),onPostRender:b},{text:"Row properties",onclick:p("mceTableRowProps"),onPostRender:b},{text:"-"},{text:"Cut row",onclick:p("mceTableCutRow"),onPostRender:b},{text:"Copy row",onclick:p("mceTableCopyRow"),onPostRender:b},{text:"Paste row before",onclick:p("mceTablePasteRowBefore"),onPostRender:b},{text:"Paste row after",onclick:p("mceTablePasteRowAfter"),onPostRender:b}]}),o.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:p("mceTableInsertColBefore"),onPostRender:b},{text:"Insert column after",onclick:p("mceTableInsertColAfter"),onPostRender:b},{text:"Delete column",onclick:p("mceTableDeleteCol"),onPostRender:b}]});var S=[];s("inserttable tableprops deletetable | cell row column".split(" "),function(e){S.push("|"==e?{text:"-"}:o.menuItems[e])}),o.addButton("table",{type:"menubutton",title:"Table",menu:S}),r.isIE||o.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(o.selection.select(e),o.nodeChanged())}),P.quirks=new t(o),o.on("Init",function(){x=o.windowManager,P.cellSelection=new n(o)}),s({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,i;i=o.dom.getParent(o.selection.getStart(),"th,td"),i&&(t=i.rowSpan,n=i.colSpan),o.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():u(e,i)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){C=e.cutRows()},mceTableCopyRow:function(e){C=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(C,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(C)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){o.addCommand(n,function(){var n=new e(o);n&&(t(n),o.execCommand("mceRepaint"),P.cellSelection.clear())})}),s({mceInsertTable:function(){d()},mceTableRowProps:m,mceTableCellProps:f},function(e,t){o.addCommand(t,function(t,n){e(n)})})}var s=o.each;a.add("table",l)}),a([s,u,m,g])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(f){"use strict";function d(e){return function(){return e}}function o(e){return e}var S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},x=function(){};function b(r){for(var o=[],e=1;en.maxRow()||sn.maxCol()))gn.getAt(t,l,s).filter(r).isNone()?(o=f,void 0,i=e[l].element(),u=ot.fromTag("td"),Mt(u,ot.fromTag("br")),(o?Mt:Te)(i,u)):f=!0}}(r,o,i,n),function(e,t){var n=v(cn.firstLayer(e,"tr"),function(e){return 0===e.dom().childElementCount});h(n,Wt),t.minCol()!==t.maxCol()&&t.minRow()!==t.maxRow()||h(cn.firstLayer(e,"th,td"),function(e){Y(e,"rowspan"),Y(e,"colspan")}),Y(e,"width"),Y(e,"height"),ue(e,"width"),ue(e,"height")}(e,i),e};function vn(e){return Pn.get(e)}function bn(e){return Pn.getOption(e)}function wn(e,t){Pn.set(e,t)}function yn(e){return"img"===et(e)?1:bn(e).fold(function(){return Ce(e).length},function(e){return e.length})}function Cn(e){return function(e){return bn(e).filter(function(e){return 0!==e.trim().length||-1=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()}function Bn(e,t,n){var r=gn.findItem(e,t,It),o=gn.findItem(e,n,It);return r.bind(function(t){return o.map(function(e){return function(e,t){return Yt(Math.min(e.row(),t.row()),Math.min(e.column(),t.column()),Math.max(e.row()+e.rowspan()-1,t.row()+t.rowspan()-1),Math.max(e.column()+e.colspan()-1,t.column()+t.colspan()-1))}(t,e)})})}var Pn=function ts(n,r){var t=function(e){return n(e)?Me.from(e.dom().nodeValue):Me.none()};return{get:function(e){if(!n(e))throw new Error("Can only get "+r+" value of a "+r+" node");return t(e).getOr("")},getOption:t,set:function(e,t){if(!n(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=t}}}(nt,"text"),Mn=["img","br"],Wn=function(e,i){var u=function(e){for(var t=Ce(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return Me.some(r);var o=u(r);if(o.isSome())return o}return Me.none()};return u(e)},_n={cellOperations:function(i,e,u){return{row:kn(e),cell:function(e){var t=he(e.element()),n=ot.fromTag(et(e.element()),t.dom()),r=u.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),o=0=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},jn=function(e,t){for(var n=!0,r=b(In,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&gn.getAt(e,o,i).exists(r);return n?Me.some(t):Me.none()},zn=Bn,Hn=function(t,e,n){return Bn(t,e,n).bind(function(e){return jn(t,e)})},Fn=function(r,e,o,i){return gn.findItem(r,e,It).bind(function(e){var t=0=t.length-1)return Me.none();var e=t[n].fold(function(){var e=A(t.slice(0,n));return E(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return Me.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return E(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return Me.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})}function Eo(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}}function No(e){var t=Be(e.parent(),"."+iu);h(t,Wt)}function ko(n,e,r){var o=n.origin();h(e,function(e,t){e.each(function(e){var t=r(o,e);Ro(t,iu),Mt(n.parent(),t)})})}function Io(e,t,n,r,o,i){var u=qr(t);!function(e,t,r,o){ko(e,t,function(e,t){var n=ou(t.row(),r.left()-e.left(),t.y()-e.top(),o,7);return Ro(n,uu),n})}(e,0',r.insertBefore(o,r.firstChild)),""===u.align?Mc(n,r):Bc(n,r,u.align),n.focus(),n.addVisual()})}function Gi(t){return function(e){return Me.from(e.dom.getParent(e.selection.getStart(),t)).map(ot.fromDom)}}function Yi(e){function t(){e.stopPropagation()}function n(){e.preventDefault()}var r=ot.fromDom(e.target),o=function(n,r){return function(){for(var e=[],t=0;t=t.length||e.column()>pu.cellLength(t[0]))return Cu.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=pu.cellLength(n[0]),u=n.length;return Cu.value({rowDelta:d(r.length-u),colDelta:d(o.length-i)})},xu=function(e,t){var n=pu.cellLength(e[0]),r=pu.cellLength(t[0]);return{rowDelta:d(0),colDelta:d(n-r)}},Ru=function(e,t,n){var r=t.colDelta()<0?Vo:o;return(t.rowDelta()<0?qo:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},Tu=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)pu.mutateCell(e[o],i,Ut(r(),!1));return e},Ou=function(e,t,n,r){for(var o=!0,i=0;i=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}function Ma(n,r,e,t,o){function i(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t}var u=vn(r).length,c=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;ut.right()}(n,e)})})}function hl(t,n,e){var r=t.move(e,5),o=Sf(n,t,e,r,100).getOr(r);return function(e,t,n){return e.point(t)>n.getInnerHeight()?Me.some(e.point(t)-n.getInnerHeight()):e.point(t)<0?Me.some(-e.point(t)):Me.none()}(t,o,n).fold(function(){return n.situsFromPoint(o.left(),t.point(o))},function(e){return n.scrollBy(0,e),n.situsFromPoint(o.left(),t.point(o)-e)})}function vl(e,t){return function(e,t,n){return $t(e,t,n).isSome()}(e,function(e){return ve(e).exists(function(e){return It(e,t)})})}function bl(t,r,o,e,i){return en(e,"td,th",r).bind(function(n){return en(n,"table",r).bind(function(e){return vl(i,e)?Ef(t,r,o).bind(function(t){return en(t.finish(),"td,th",r).map(function(e){return{start:d(n),finish:d(e),range:d(t)}})}):Me.none()})})}function wl(e,t){return en(e,"td,th",t)}var yl=function(t,n,e){function r(){l.stop(),u.isOn()&&(u.off(),i.trigger.stop())}var o=!1,i=ma.create({start:da([]),stop:da([])}),u=xa(),c=function(n,r){var o=null;return{cancel:function(){null!==o&&(f.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;tr.left&&o.left ("+e.right()+", "+e.bottom()+")"}},vf=function(e,t,n){return tt(t)?gl(e,t).map(ml):nt(t)?function(e,t,n){return 0<=n&&no.bottom()?wf.retry(i):n.top()===o.bottom()?wf.retry(hf.moveDown(o,1)):pl(e,t,o)?wf.retry(hf.translate(i,5,0)):wf.none()},move:hf.moveDown,gather:ll},Sf=function(n,r,o,i,u){return 0===u?Me.some(i):function(e,t,n){return e.elementFromPoint(t,n).filter(function(e){return"table"===et(e)}).isSome()}(n,i.left(),r.point(i))?function(e,t,n,r,o){return Sf(e,t,n,t.move(r,5),o)}(n,r,o,i,u-1):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(Me.none,function(t){return bf(n,t).bind(function(e){return r.adjuster(n,t,e,o,i).fold(Me.none,function(e){return Sf(n,r,o,e,u-1)})}).orThunk(function(){return Me.some(i)})},Me.none)})},xf={tryUp:b(hl,yf),tryDown:b(hl,Cf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:d(5)},Rf=me(),Tf=function(r,o,i,u,c,a){return 0===a?Me.none():Af(r,o,i,u,c).bind(function(e){var t=r.fromSitus(e),n=lf.verify(r,i,u,t.finish(),t.foffset(),c.failure,o);return lf.cata(n,function(){return Me.none()},function(){return Me.some(e)},function(e){return It(i,e)&&0===u?Of(r,i,u,hf.moveUp,c):Tf(r,o,e,0,c,a-1)},function(e){return It(i,e)&&u===yn(e)?Of(r,i,u,hf.moveDown,c):Tf(r,o,e,yn(e),c,a-1)})})},Of=function(t,e,n,r,o){return vf(t,e,n).bind(function(e){return Df(t,o,r(e,xf.getJumpSize()))})},Df=function(e,t,n){return Rf.browser.isChrome()||Rf.browser.isSafari()||Rf.browser.isFirefox()||Rf.browser.isEdge()?t.otherRetry(e,n):Rf.browser.isIE()?t.ieRetry(e,n):Me.none()},Af=function(t,e,n,r,o){return vf(t,n,r).bind(function(e){return Df(t,o,e)})},Ef=function(t,n,r){return function(o,i,u){return o.getSelection().bind(function(r){return mf(i,r.finish(),r.foffset(),u).fold(function(){return Me.some(Tc(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=lf.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return gf(n)})})}(t,n,r).bind(function(e){return Tf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)})},Nf=me(),kf=function(e,t,n,r,o,i){return Nf.browser.isIE()?Me.none():i(r,t).orThunk(function(){return bl(e,t,n,r,o).map(function(e){var t=e.range();return Vl.create(Me.some(Yl.makeSitus(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},If=function(e,t,n,r,o,i,u){return bl(e,n,r,o,i).bind(function(e){return Xl.detect(t,n,e.start(),e.finish(),u)})},Bf=function(e,r){return en(e,"tr",r).bind(function(n){return en(n,"table",r).bind(function(e){var t=Be(e,"tr");return It(n,t[0])?function(e,t,n){return of(cf,e,t,n)}(e,function(e){return xn(e).isSome()},r).map(function(e){var t=yn(e);return Vl.create(Me.some(Yl.makeSitus(e,t,e,t)),!0)}):Me.none()})})},Pf=function(e,r){return en(e,"tr",r).bind(function(n){return en(n,"table",r).bind(function(e){var t=Be(e,"tr");return It(n,t[t.length-1])?function(e,t,n){return uf(cf,e,t,n)}(e,function(e){return Sn(e).isSome()},r).map(function(e){return Vl.create(Me.some(Yl.makeSitus(e,0,e,0)),!0)}):Me.none()})})};function Mf(t){return function(e){return e===t}}function Wf(c){return{elementFromPoint:function(e,t){return ot.fromPoint(ot.fromDom(c.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=Ml.exact(e,t,n,r);return el(c,o).map(Ff)},getSelection:function(){return Za(c).map(function(e){return Yl.convertToRange(c,e)})},fromSitus:function(e){var t=Ml.relative(e.start(),e.finish());return Yl.convertToRange(c,t)},situsFromPoint:function(e,t){return tl(c,e,t).map(function(e){return Gl(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){!function(e){e.getSelection().removeAllRanges()}(c)},collapseSelection:function(u){void 0===u&&(u=!1),Za(c).each(function(e){return e.fold(function(e){return e.collapse(u)},function(e,t){var n=u?e:t;Xa(c,n,n)},function(e,t,n,r){var o=u?e:n,i=u?t:r;Ka(c,o,i,o,i)})})},setSelection:function(e){Ka(c,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,t){Xa(c,e,t)},selectContents:function(e){Qa(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){return function(e){var t=e!==undefined?e.dom():f.document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return fo(n,r)}(ot.fromDom(c.document)).top()},scrollBy:function(e,t){!function(e,t,n){(n!==undefined?n.dom():f.document).defaultView.scrollBy(e,t)}(e,t,ot.fromDom(c.document))}}}function _f(t,e){h(e,function(e){!function(e,t){Co(e)?e.dom().classList.remove(t):xo(e,t);To(e)}(t,e)})}var Lf={down:{traverse:ye,gather:ll,relative:Bl.before,otherRetry:xf.tryDown,ieRetry:xf.ieTryDown,failure:lf.failedDown},up:{traverse:we,gather:al,relative:Bl.before,otherRetry:xf.tryUp,ieRetry:xf.ieTryUp,failure:lf.failedUp}},jf=Mf(38),zf=Mf(40),Hf={ltr:{isBackward:Mf(37),isForward:Mf(39)},rtl:{isBackward:Mf(39),isForward:Mf(37)},isUp:jf,isDown:zf,isNavigation:function(e){return 37<=e&&e<=40}},Ff=function(e){return{left:e.left(),top:e.top(),right:e.right(),bottom:e.bottom(),width:e.width(),height:e.height()}},Uf=(me().browser.isSafari(),B("rows","cols")),qf={mouse:function(e,t,n,r){var o=function c(o,i,t,u){function n(){r=Me.none()}var r=Me.none();return{mousedown:function(e){u.clear(i),r=wl(e.target(),t)},mouseover:function(e){r.each(function(r){u.clearBeforeUpdate(i),wl(e.target(),t).each(function(n){mr(r,n,t).each(function(e){var t=e.boxes().getOr([]);(1') == -1) { - var contentCssLinks = ''; - - tinymce.each(editor.contentCSS, function(url) { - contentCssLinks += ''; - }); - - html = ( - '' + - '' + - '' + - contentCssLinks + - '' + - '' + - html + - '' + - '' - ); - } - - html = replaceTemplateValues(html, 'template_preview_replace_values'); - - var doc = win.find('iframe')[0].getEl().contentWindow.document; - doc.open(); - doc.write(html); - doc.close(); - } - - if (value.url) { - tinymce.util.XHR.send({ - url: value.url, - success: function(html) { - templateHtml = html; - insertIframeHtml(templateHtml); - } - }); - } else { - templateHtml = value.content; - insertIframeHtml(templateHtml); - } - - win.find('#description')[0].text(e.control.value().description); - } - - win = editor.windowManager.open({ - title: 'Insert template', - layout: 'flex', - direction: 'column', - align: 'stretch', - padding: 15, - spacing: 10, - - items: [ - {type: 'form', flex: 0, padding: 0, items: [ - {type: 'container', label: 'Templates', items: { - type: 'listbox', label: 'Templates', name: 'template', values: values, onselect: onSelectTemplate - }} - ]}, - {type: 'label', name: 'description', label: 'Description', text: '\u00a0'}, - {type: 'iframe', flex: 1, border: 1} - ], - - onsubmit: function() { - insertTemplate(false, templateHtml); - }, - - width: editor.getParam('template_popup_width', 600), - height: editor.getParam('template_popup_height', 500) - }); - - win.find('listbox')[0].fire('select'); - } - - function getDateTime(fmt, date) { - var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' '); - var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' '); - var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' '); - var monthsLong = "January February March April May June July August September October November December".split(' '); - - function addZeros(value, len) { - value = "" + value; - - if (value.length < len) { - for (var i = 0; i < (len - value.length); i++) { - value = "0" + value; - } - } - - return value; - } - - date = date || new Date(); - - fmt = fmt.replace("%D", "%m/%d/%Y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + date.getFullYear()); - fmt = fmt.replace("%y", "" + date.getYear()); - fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2)); - fmt = fmt.replace("%d", addZeros(date.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()])); - fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()])); - fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()])); - fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()])); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - - function replaceVals(e) { - var dom = editor.dom, vl = editor.getParam('template_replace_values'); - - each(dom.select('*', e), function(e) { - each(vl, function(v, k) { - if (dom.hasClass(e, k)) { - if (typeof(vl[k]) == 'function') { - vl[k](e); - } - } - }); - }); - } - - function replaceTemplateValues(html, templateValuesOptionName) { - each(editor.getParam(templateValuesOptionName), function(v, k) { - if (typeof(v) != 'function') { - html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); - } - }); - - return html; - } - - function insertTemplate(ui, html) { - var el, n, dom = editor.dom, sel = editor.selection.getContent(); - - html = replaceTemplateValues(html, 'template_replace_values'); - el = dom.create('div', null, html); - - // Find template element within div - n = dom.select('.mceTmpl', el); - if (n && n.length > 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - } - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, editor.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) { - n.innerHTML = getDateTime(editor.getParam("template_cdate_format", editor.getLang("template.cdate_format"))); - } - - // Replace mdate - if (hasClass(n, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) { - n.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format"))); - } - - // Replace selection - if (hasClass(n, editor.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) { - n.innerHTML = sel; - } - }); - - replaceVals(el); - - editor.execCommand('mceInsertContent', false, el.innerHTML); - editor.addVisual(); - } - - editor.addCommand('mceInsertTemplate', insertTemplate); - - editor.addButton('template', { - title: 'Insert template', - onclick: createTemplateList(showDialog) - }); - - editor.addMenuItem('template', { - text: 'Insert template', - onclick: createTemplateList(showDialog), - context: 'insert' - }); - - editor.on('PreProcess', function(o) { - var dom = editor.dom; - - each(dom.select('div', o.node), function(e) { - if (dom.hasClass(e, 'mceTmpl')) { - each(dom.select('*', e), function(e) { - if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) { - e.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format"))); - } - }); - - replaceVals(e); - } - }); - }); -}); \ No newline at end of file +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + function curry(fn) { + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; + } + var never = constant(false); + var always = constant(true); + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var getCreationDateClasses = function (editor) { + return editor.getParam('template_cdate_classes', 'cdate'); + }; + var getModificationDateClasses = function (editor) { + return editor.getParam('template_mdate_classes', 'mdate'); + }; + var getSelectedContentClasses = function (editor) { + return editor.getParam('template_selected_content_classes', 'selcontent'); + }; + var getPreviewReplaceValues = function (editor) { + return editor.getParam('template_preview_replace_values'); + }; + var getTemplateReplaceValues = function (editor) { + return editor.getParam('template_replace_values'); + }; + var getTemplates = function (editorSettings) { + return editorSettings.templates; + }; + var getCdateFormat = function (editor) { + return editor.getParam('template_cdate_format', editor.translate('%Y-%m-%d')); + }; + var getMdateFormat = function (editor) { + return editor.getParam('template_mdate_format', editor.translate('%Y-%m-%d')); + }; + var Settings = { + getCreationDateClasses: getCreationDateClasses, + getModificationDateClasses: getModificationDateClasses, + getSelectedContentClasses: getSelectedContentClasses, + getPreviewReplaceValues: getPreviewReplaceValues, + getTemplateReplaceValues: getTemplateReplaceValues, + getTemplates: getTemplates, + getCdateFormat: getCdateFormat, + getMdateFormat: getMdateFormat + }; + + var addZeros = function (value, len) { + value = '' + value; + if (value.length < len) { + for (var i = 0; i < len - value.length; i++) { + value = '0' + value; + } + } + return value; + }; + var getDateTime = function (editor, fmt, date) { + var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); + var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' '); + var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); + var monthsLong = 'January February March April May June July August September October November December'.split(' '); + date = date || new Date(); + fmt = fmt.replace('%D', '%m/%d/%Y'); + fmt = fmt.replace('%r', '%I:%M:%S %p'); + fmt = fmt.replace('%Y', '' + date.getFullYear()); + fmt = fmt.replace('%y', '' + date.getYear()); + fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); + fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); + fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); + fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); + fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); + fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); + fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); + fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); + fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); + fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); + fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); + fmt = fmt.replace('%%', '%'); + return fmt; + }; + var DateTimeHelper = { getDateTime: getDateTime }; + + var createTemplateList = function (editorSettings, callback) { + return function () { + var templateList = Settings.getTemplates(editorSettings); + if (typeof templateList === 'function') { + templateList(callback); + return; + } + if (typeof templateList === 'string') { + global$2.send({ + url: templateList, + success: function (text) { + callback(JSON.parse(text)); + } + }); + } else { + callback(templateList); + } + }; + }; + var replaceTemplateValues = function (html, templateValues) { + global$1.each(templateValues, function (v, k) { + if (typeof v === 'function') { + v = v(k); + } + html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); + }); + return html; + }; + var replaceVals = function (editor, e) { + var dom = editor.dom, vl = Settings.getTemplateReplaceValues(editor); + global$1.each(dom.select('*', e), function (e) { + global$1.each(vl, function (v, k) { + if (dom.hasClass(e, k)) { + if (typeof vl[k] === 'function') { + vl[k](e); + } + } + }); + }); + }; + var hasClass = function (n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + var insertTemplate = function (editor, ui, html) { + var el; + var n; + var dom = editor.dom; + var sel = editor.selection.getContent(); + html = replaceTemplateValues(html, Settings.getTemplateReplaceValues(editor)); + el = dom.create('div', null, html); + n = dom.select('.mceTmpl', el); + if (n && n.length > 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + global$1.each(dom.select('*', el), function (n) { + if (hasClass(n, Settings.getCreationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = DateTimeHelper.getDateTime(editor, Settings.getCdateFormat(editor)); + } + if (hasClass(n, Settings.getModificationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = DateTimeHelper.getDateTime(editor, Settings.getMdateFormat(editor)); + } + if (hasClass(n, Settings.getSelectedContentClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = sel; + } + }); + replaceVals(editor, el); + editor.execCommand('mceInsertContent', false, el.innerHTML); + editor.addVisual(); + }; + var Templates = { + createTemplateList: createTemplateList, + replaceTemplateValues: replaceTemplateValues, + replaceVals: replaceVals, + insertTemplate: insertTemplate + }; + + var register = function (editor) { + editor.addCommand('mceInsertTemplate', curry(Templates.insertTemplate, editor)); + }; + var Commands = { register: register }; + + var setup = function (editor) { + editor.on('PreProcess', function (o) { + var dom = editor.dom, dateFormat = Settings.getMdateFormat(editor); + global$1.each(dom.select('div', o.node), function (e) { + if (dom.hasClass(e, 'mceTmpl')) { + global$1.each(dom.select('*', e), function (e) { + if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) { + e.innerHTML = DateTimeHelper.getDateTime(editor, dateFormat); + } + }); + Templates.replaceVals(editor, e); + } + }); + }); + }; + var FilterContent = { setup: setup }; + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var hasOwnProperty = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var entitiesAttr = { + '"': '"', + '<': '<', + '>': '>', + '&': '&', + '\'': ''' + }; + var htmlEscape = function (html) { + return html.replace(/["'<>&]/g, function (match) { + return get(entitiesAttr, match).getOr(match); + }); + }; + + var getPreviewContent = function (editor, html) { + if (html.indexOf('') === -1) { + var contentCssLinks_1 = ''; + global$1.each(editor.contentCSS, function (url) { + contentCssLinks_1 += ''; + }); + var bodyClass = editor.settings.body_class || ''; + if (bodyClass.indexOf('=') !== -1) { + bodyClass = editor.getParam('body_class', '', 'hash'); + bodyClass = bodyClass[editor.id] || ''; + } + var encode = editor.dom.encode; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + html = '' + '' + '' + contentCssLinks_1 + '' + '' + html + '' + ''; + } + return Templates.replaceTemplateValues(html, Settings.getPreviewReplaceValues(editor)); + }; + var open = function (editor, templateList) { + var createTemplates = function () { + if (!templateList || templateList.length === 0) { + var message = editor.translate('No templates defined.'); + editor.notificationManager.open({ + text: message, + type: 'info' + }); + return Option.none(); + } + return Option.from(global$1.map(templateList, function (template, index) { + var isUrlTemplate = function (t) { + return t.url !== undefined; + }; + return { + selected: index === 0, + text: template.title, + value: { + url: isUrlTemplate(template) ? Option.from(template.url) : Option.none(), + content: !isUrlTemplate(template) ? Option.from(template.content) : Option.none(), + description: template.description + } + }; + })); + }; + var createSelectBoxItems = function (templates) { + return map(templates, function (t) { + return { + text: t.text, + value: t.text + }; + }); + }; + var findTemplate = function (templates, templateTitle) { + return find(templates, function (t) { + return t.text === templateTitle; + }); + }; + var loadFailedAlert = function (api) { + editor.windowManager.alert('Could not load the specified template.', function () { + return api.focus('template'); + }); + }; + var getTemplateContent = function (t) { + return new global$3(function (resolve, reject) { + t.value.url.fold(function () { + return resolve(t.value.content.getOr('')); + }, function (url) { + return global$2.send({ + url: url, + success: function (html) { + resolve(html); + }, + error: function (e) { + reject(e); + } + }); + }); + }); + }; + var onChange = function (templates, updateDialog) { + return function (api, change) { + if (change.name === 'template') { + var newTemplateTitle = api.getData().template; + findTemplate(templates, newTemplateTitle).each(function (t) { + api.block('Loading...'); + getTemplateContent(t).then(function (previewHtml) { + updateDialog(api, t, previewHtml); + }).catch(function () { + updateDialog(api, t, ''); + api.disable('save'); + loadFailedAlert(api); + }); + }); + } + }; + }; + var onSubmit = function (templates) { + return function (api) { + var data = api.getData(); + findTemplate(templates, data.template).each(function (t) { + getTemplateContent(t).then(function (previewHtml) { + Templates.insertTemplate(editor, false, previewHtml); + api.close(); + }).catch(function () { + api.disable('save'); + loadFailedAlert(api); + }); + }); + }; + }; + var openDialog = function (templates) { + var selectBoxItems = createSelectBoxItems(templates); + var buildDialogSpec = function (bodyItems, initialData) { + return { + title: 'Insert Template', + size: 'large', + body: { + type: 'panel', + items: bodyItems + }, + initialData: initialData, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: onSubmit(templates), + onChange: onChange(templates, updateDialog) + }; + }; + var updateDialog = function (dialogApi, template, previewHtml) { + var content = getPreviewContent(editor, previewHtml); + var bodyItems = [ + { + type: 'selectbox', + name: 'template', + label: 'Templates', + items: selectBoxItems + }, + { + type: 'htmlpanel', + html: '

    ' + htmlEscape(template.value.description) + '

    ' + }, + { + label: 'Preview', + type: 'iframe', + name: 'preview', + sandboxed: false + } + ]; + var initialData = { + template: template.text, + preview: content + }; + dialogApi.unblock(); + dialogApi.redial(buildDialogSpec(bodyItems, initialData)); + dialogApi.focus('template'); + }; + var dialogApi = editor.windowManager.open(buildDialogSpec([], { + template: '', + preview: '' + })); + dialogApi.block('Loading...'); + getTemplateContent(templates[0]).then(function (previewHtml) { + updateDialog(dialogApi, templates[0], previewHtml); + }).catch(function () { + updateDialog(dialogApi, templates[0], ''); + dialogApi.disable('save'); + loadFailedAlert(dialogApi); + }); + }; + var optTemplates = createTemplates(); + optTemplates.each(openDialog); + }; + var Dialog = { open: open }; + + var showDialog = function (editor) { + return function (templates) { + Dialog.open(editor, templates); + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addButton('template', { + icon: 'template', + tooltip: 'Insert template', + onAction: Templates.createTemplateList(editor.settings, showDialog(editor)) + }); + editor.ui.registry.addMenuItem('template', { + icon: 'template', + text: 'Insert template...', + onAction: Templates.createTemplateList(editor.settings, showDialog(editor)) + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('template', function (editor) { + Buttons.register(editor); + Commands.register(editor); + FilterContent.setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/template/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/template/plugin.min.js index cee38af..3813eba 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/template/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/template/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("template",function(e){function t(t){return function(){var a=e.settings.templates;"string"==typeof a?tinymce.util.XHR.send({url:a,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(a)}}function a(t){function a(t){function a(t){if(-1==t.indexOf("")){var a="";tinymce.each(e.contentCSS,function(t){a+=''}),t=""+a+""+t+""}t=r(t,"template_preview_replace_values");var l=n.find("iframe")[0].getEl().contentWindow.document;l.open(),l.write(t),l.close()}var c=t.control.value();c.url?tinymce.util.XHR.send({url:c.url,success:function(e){l=e,a(l)}}):(l=c.content,a(l)),n.find("#description")[0].text(t.control.value().description)}var n,l,i=[];return t&&0!==t.length?(tinymce.each(t,function(e){i.push({selected:!i.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),n=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:i,onselect:a}}]},{type:"label",name:"description",label:"Description",text:" "},{type:"iframe",flex:1,border:1}],onsubmit:function(){c(!1,l)},width:e.getParam("template_popup_width",600),height:e.getParam("template_popup_height",500)}),void n.find("listbox")[0].fire("select")):void e.windowManager.alert("No templates defined")}function n(t,a){function n(e,t){if(e=""+e,e.length0&&(o=p.create("div",null),o.appendChild(s[0].cloneNode(!0))),i(p.select("*",o),function(t){c(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),c(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),c(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=m)}),l(o),e.execCommand("mceInsertContent",!1,o.innerHTML),e.addVisual()}var i=tinymce.each;e.addCommand("mceInsertTemplate",c),e.addButton("template",{title:"Insert template",onclick:t(a)}),e.addMenuItem("template",{text:"Insert template",onclick:t(a),context:"insert"}),e.on("PreProcess",function(t){var a=e.dom;i(a.select("div",t.node),function(t){a.hasClass(t,"mceTmpl")&&(i(a.select("*",t),function(t){a.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),l(t))})})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function e(){}function o(e){return function(){return e}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function c(e,t){if((e=""+e).length&]/g,function(e){return function(e,t){return B(e,t)?L.from(e[t]):L.none()}(E,e).getOr(e)})}function I(t){return function(e){R(t,e)}}var k,J=function(n){function e(){return a}function t(e){return e(n)}var r=o(n),a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return J(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?a:A},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(u,function(e){return t(n,e)})}};return a},L={some:J,none:n,from:function(e){return null===e||e===undefined?A:J(e)}},Y=(k="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===k}),j=Array.prototype.slice,q=(Y(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),F=Object.hasOwnProperty,B=function(e,t){return F.call(e,t)},E={'"':""","<":"<",">":">","&":"&","'":"'"},R=function(i,t){function e(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a")){var n="";p.each(t.contentCSS,function(e){n+=''});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var a=t.dom.encode,o=t.getBody().dir,u=o?' dir="'+a(o)+'"':"";e=""+n+'"+e+""}return S(e,y(t))}(i,n),a=[{type:"selectbox",name:"template",label:"Templates",items:c},{type:"htmlpanel",html:'

    '+H(t.value.description)+"

    "},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],o={template:t.text,preview:r};e.unblock(),e.redial(u(a,o)),e.focus("template")},t=i.windowManager.open(u([],{template:"",preview:""}));t.block("Loading..."),s(n[0]).then(function(e){r(t,n[0],e)})["catch"](function(){r(t,n[0],""),t.disable("save"),l(t)})})},z=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:T(e.settings,I(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:T(e.settings,I(e))})};!function U(){t.add("template",function(e){z(e),P(e),w(e)})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.js index 26a1470..13c4780 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.js @@ -1,164 +1,22 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ +(function (domGlobals) { + 'use strict'; -/*global tinymce:true */ -/*eslint consistent-this:0 */ - -tinymce.PluginManager.add('textcolor', function(editor) { - function mapColors() { - var i, colors = [], colorMap; - - colorMap = editor.settings.textcolor_map || [ - "000000", "Black", - "993300", "Burnt orange", - "333300", "Dark olive", - "003300", "Dark green", - "003366", "Dark azure", - "000080", "Navy Blue", - "333399", "Indigo", - "333333", "Very dark gray", - "800000", "Maroon", - "FF6600", "Orange", - "808000", "Olive", - "008000", "Green", - "008080", "Teal", - "0000FF", "Blue", - "666699", "Grayish blue", - "808080", "Gray", - "FF0000", "Red", - "FF9900", "Amber", - "99CC00", "Yellow green", - "339966", "Sea green", - "33CCCC", "Turquoise", - "3366FF", "Royal blue", - "800080", "Purple", - "999999", "Medium gray", - "FF00FF", "Magenta", - "FFCC00", "Gold", - "FFFF00", "Yellow", - "00FF00", "Lime", - "00FFFF", "Aqua", - "00CCFF", "Sky blue", - "993366", "Red violet", - "C0C0C0", "Silver", - "FF99CC", "Pink", - "FFCC99", "Peach", - "FFFF99", "Light yellow", - "CCFFCC", "Pale green", - "CCFFFF", "Pale cyan", - "99CCFF", "Light sky blue", - "CC99FF", "Plum", - "FFFFFF", "White" - ]; - - for (i = 0; i < colorMap.length; i += 2) { - colors.push({ - text: colorMap[i + 1], - color: colorMap[i] - }); - } - - return colors; - } - - function renderColorPicker() { - var ctrl = this, colors, color, html, last, rows, cols, x, y, i; - - colors = mapColors(); - - html = ''; - last = colors.length - 1; - rows = editor.settings.textcolor_rows || 5; - cols = editor.settings.textcolor_cols || 8; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - i = y * cols + x; - - if (i > last) { - html += ''; - } else { - color = colors[i]; - html += ( - '' - ); - } - } - - html += ''; - } - - html += '
    ' + - '
    ' + - '
    ' + - '
    '; - - return html; - } - - function onPanelClick(e) { - var buttonCtrl = this.parent(), value; - - if ((value = e.target.getAttribute('data-mce-color'))) { - if (this.lastId) { - document.getElementById(this.lastId).setAttribute('aria-selected', false); - } - - e.target.setAttribute('aria-selected', true); - this.lastId = e.target.id; - - buttonCtrl.hidePanel(); - value = '#' + value; - buttonCtrl.color(value); - editor.execCommand(buttonCtrl.settings.selectcmd, false, value); - } - } - - function onButtonClick() { - var self = this; + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - if (self._color) { - editor.execCommand(self.settings.selectcmd, false, self._color); - } - } + function Plugin () { + global.add('textcolor', function () { + domGlobals.console.warn('Text color plugin is now built in to the core editor, please remove it from your editor configuration'); + }); + } - editor.addButton('forecolor', { - type: 'colorbutton', - tooltip: 'Text color', - selectcmd: 'ForeColor', - panel: { - role: 'application', - ariaRemember: true, - html: renderColorPicker, - onclick: onPanelClick - }, - onclick: onButtonClick - }); + Plugin(); - editor.addButton('backcolor', { - type: 'colorbutton', - tooltip: 'Background color', - selectcmd: 'HiliteColor', - panel: { - role: 'application', - ariaRemember: true, - html: renderColorPicker, - onclick: onPanelClick - }, - onclick: onButtonClick - }); -}); +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.min.js index a42de76..9b08009 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textcolor/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("textcolor",function(e){function t(){var t,o,l=[];for(o=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],t=0;t',a=o.length-1,c=e.settings.textcolor_rows||5,i=e.settings.textcolor_cols||8,F=0;c>F;F++){for(r+="",n=0;i>n;n++)d=F*i+n,d>a?r+="":(l=o[d],r+='
    ');r+=""}return r+=""}function l(t){var o,l=this.parent();(o=t.target.getAttribute("data-mce-color"))&&(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,l.hidePanel(),o="#"+o,l.color(o),e.execCommand(l.settings.selectcmd,!1,o))}function r(){var t=this;t._color&&e.execCommand(t.settings.selectcmd,!1,t._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",selectcmd:"ForeColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:l},onclick:r}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",selectcmd:"HiliteColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:l},onclick:r})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textpattern/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textpattern/plugin.js new file mode 100644 index 0000000..2626f4a --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textpattern/plugin.js @@ -0,0 +1,1417 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + } + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -1; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var eachr = function (xs, f) { + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldr = function (xs, f, acc) { + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var forall = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; + } + } + return true; + }; + var sort = function (xs, comparator) { + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; + }; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var generate = function (cases) { + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + domGlobals.console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate }; + + var comparison = Adt.generate([ + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } + ]); + var partition = function (results) { + var errors = []; + var values = []; + each(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); + }); + }); + return { + errors: errors, + values: values + }; + }; + + var value = function (o) { + var is = function (v) { + return o === v; + }; + var or = function (opt) { + return value(o); + }; + var orThunk = function (f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOption = function () { + return Option.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOption: toOption + }; + }; + var error = function (message) { + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOption: Option.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var isInlinePattern = function (pattern) { + return pattern.type === 'inline-command' || pattern.type === 'inline-format'; + }; + var isBlockPattern = function (pattern) { + return pattern.type === 'block-command' || pattern.type === 'block-format'; + }; + var sortPatterns = function (patterns) { + return sort(patterns, function (a, b) { + if (a.start.length === b.start.length) { + return 0; + } + return a.start.length > b.start.length ? -1 : 1; + }); + }; + var normalizePattern = function (pattern) { + var err = function (message) { + return Result.error({ + message: message, + pattern: pattern + }); + }; + var formatOrCmd = function (name, onFormat, onCommand) { + if (pattern.format !== undefined) { + var formats = void 0; + if (isArray(pattern.format)) { + if (!forall(pattern.format, isString)) { + return err(name + ' pattern has non-string items in the `format` array'); + } + formats = pattern.format; + } else if (isString(pattern.format)) { + formats = [pattern.format]; + } else { + return err(name + ' pattern has non-string `format` parameter'); + } + return Result.value(onFormat(formats)); + } else if (pattern.cmd !== undefined) { + if (!isString(pattern.cmd)) { + return err(name + ' pattern has non-string `cmd` parameter'); + } + return Result.value(onCommand(pattern.cmd, pattern.value)); + } else { + return err(name + ' pattern is missing both `format` and `cmd` parameters'); + } + }; + if (!isObject(pattern)) { + return err('Raw pattern is not an object'); + } + if (!isString(pattern.start)) { + return err('Raw pattern is missing `start` parameter'); + } + if (pattern.end !== undefined) { + if (!isString(pattern.end)) { + return err('Inline pattern has non-string `end` parameter'); + } + if (pattern.start.length === 0 && pattern.end.length === 0) { + return err('Inline pattern has empty `start` and `end` parameters'); + } + var start_1 = pattern.start; + var end_1 = pattern.end; + if (end_1.length === 0) { + end_1 = start_1; + start_1 = ''; + } + return formatOrCmd('Inline', function (format) { + return { + type: 'inline-format', + start: start_1, + end: end_1, + format: format + }; + }, function (cmd, value) { + return { + type: 'inline-command', + start: start_1, + end: end_1, + cmd: cmd, + value: value + }; + }); + } else if (pattern.replacement !== undefined) { + if (!isString(pattern.replacement)) { + return err('Replacement pattern has non-string `replacement` parameter'); + } + if (pattern.start.length === 0) { + return err('Replacement pattern has empty `start` parameter'); + } + return Result.value({ + type: 'inline-command', + start: '', + end: pattern.start, + cmd: 'mceInsertContent', + value: pattern.replacement + }); + } else { + if (pattern.start.length === 0) { + return err('Block pattern has empty `start` parameter'); + } + return formatOrCmd('Block', function (formats) { + return { + type: 'block-format', + start: pattern.start, + format: formats[0] + }; + }, function (command, commandValue) { + return { + type: 'block-command', + start: pattern.start, + cmd: command, + value: commandValue + }; + }); + } + }; + var denormalizePattern = function (pattern) { + if (pattern.type === 'block-command') { + return { + start: pattern.start, + cmd: pattern.cmd, + value: pattern.value + }; + } else if (pattern.type === 'block-format') { + return { + start: pattern.start, + format: pattern.format + }; + } else if (pattern.type === 'inline-command') { + if (pattern.cmd === 'mceInsertContent' && pattern.start === '') { + return { + start: pattern.end, + replacement: pattern.value + }; + } else { + return { + start: pattern.start, + end: pattern.end, + cmd: pattern.cmd, + value: pattern.value + }; + } + } else if (pattern.type === 'inline-format') { + return { + start: pattern.start, + end: pattern.end, + format: pattern.format.length === 1 ? pattern.format[0] : pattern.format + }; + } + }; + var createPatternSet = function (patterns) { + return { + inlinePatterns: filter(patterns, isInlinePattern), + blockPatterns: sortPatterns(filter(patterns, isBlockPattern)) + }; + }; + + var get$1 = function (patternsState) { + var setPatterns = function (newPatterns) { + var normalized = partition(map(newPatterns, normalizePattern)); + if (normalized.errors.length > 0) { + var firstError = normalized.errors[0]; + throw new Error(firstError.message + ':\n' + JSON.stringify(firstError.pattern, null, 2)); + } + patternsState.set(createPatternSet(normalized.values)); + }; + var getPatterns = function () { + return __spreadArrays(map(patternsState.get().inlinePatterns, denormalizePattern), map(patternsState.get().blockPatterns, denormalizePattern)); + }; + return { + setPatterns: setPatterns, + getPatterns: getPatterns + }; + }; + var Api = { get: get$1 }; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var error$1 = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var console = Global.console; + if (console) { + if (console.error) { + console.error.apply(console, args); + } else { + console.log.apply(console, args); + } + } + }; + var defaultPatterns = [ + { + start: '*', + end: '*', + format: 'italic' + }, + { + start: '**', + end: '**', + format: 'bold' + }, + { + start: '#', + format: 'h1' + }, + { + start: '##', + format: 'h2' + }, + { + start: '###', + format: 'h3' + }, + { + start: '####', + format: 'h4' + }, + { + start: '#####', + format: 'h5' + }, + { + start: '######', + format: 'h6' + }, + { + start: '1. ', + cmd: 'InsertOrderedList' + }, + { + start: '* ', + cmd: 'InsertUnorderedList' + }, + { + start: '- ', + cmd: 'InsertUnorderedList' + } + ]; + var getPatternSet = function (editorSettings) { + var patterns = get(editorSettings, 'textpattern_patterns').getOr(defaultPatterns); + if (!isArray(patterns)) { + error$1('The setting textpattern_patterns should be an array'); + return { + inlinePatterns: [], + blockPatterns: [] + }; + } + var normalized = partition(map(patterns, normalizePattern)); + each(normalized.errors, function (err) { + return error$1(err.message, err.pattern); + }); + return createPatternSet(normalized.values); + }; + var getForcedRootBlock = function (editor) { + var block = editor.getParam('forced_root_block', 'p'); + if (block === false) { + return ''; + } else if (block === true) { + return 'p'; + } else { + return block; + } + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var zeroWidth = '\uFEFF'; + var nbsp = '\xA0'; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker'); + + var point = function (container, offset) { + return { + container: container, + offset: offset + }; + }; + + var isText = function (node) { + return node.nodeType === domGlobals.Node.TEXT_NODE; + }; + var cleanEmptyNodes = function (dom, node, isRoot) { + if (node && dom.isEmpty(node) && !isRoot(node)) { + var parent_1 = node.parentNode; + dom.remove(node); + cleanEmptyNodes(dom, parent_1, isRoot); + } + }; + var deleteRng = function (dom, rng, isRoot, clean) { + if (clean === void 0) { + clean = true; + } + var startParent = rng.startContainer.parentNode; + var endParent = rng.endContainer.parentNode; + rng.deleteContents(); + if (clean && !isRoot(rng.startContainer)) { + if (isText(rng.startContainer) && rng.startContainer.data.length === 0) { + dom.remove(rng.startContainer); + } + if (isText(rng.endContainer) && rng.endContainer.data.length === 0) { + dom.remove(rng.endContainer); + } + cleanEmptyNodes(dom, startParent, isRoot); + if (startParent !== endParent) { + cleanEmptyNodes(dom, endParent, isRoot); + } + } + }; + var isBlockFormatName = function (name, formatter) { + var formatSet = formatter.get(name); + return isArray(formatSet) && head(formatSet).exists(function (format) { + return has(format, 'block'); + }); + }; + var isReplacementPattern = function (pattern) { + return pattern.start.length === 0; + }; + var getParentBlock = function (editor, rng) { + var parentBlockOpt = Option.from(editor.dom.getParent(rng.startContainer, editor.dom.isBlock)); + if (getForcedRootBlock(editor) === '') { + return parentBlockOpt.orThunk(function () { + return Option.some(editor.getBody()); + }); + } else { + return parentBlockOpt; + } + }; + + var DOM = global$4.DOM; + var alwaysNext = function (startNode) { + return function (node) { + return startNode === node ? -1 : 0; + }; + }; + var isBoundary = function (dom) { + return function (node) { + return dom.isBlock(node) || contains([ + 'BR', + 'IMG', + 'HR', + 'INPUT' + ], node.nodeName) || dom.getContentEditable(node) === 'false'; + }; + }; + var textBefore = function (node, offset, rootNode) { + if (isText(node) && offset >= 0) { + return Option.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Option.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) { + return point(prev.container, prev.container.data.length); + }); + } + }; + var textAfter = function (node, offset, rootNode) { + if (isText(node) && offset >= node.length) { + return Option.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Option.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) { + return point(prev.container, 0); + }); + } + }; + var scanLeft = function (node, offset, rootNode) { + if (!isText(node)) { + return Option.none(); + } + var text = node.textContent; + if (offset >= 0 && offset <= text.length) { + return Option.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Option.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).bind(function (prev) { + var prevText = prev.container.data; + return scanLeft(prev.container, offset + prevText.length, rootNode); + }); + } + }; + var scanRight = function (node, offset, rootNode) { + if (!isText(node)) { + return Option.none(); + } + var text = node.textContent; + if (offset <= text.length) { + return Option.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Option.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).bind(function (next) { + return scanRight(next.container, offset - text.length, rootNode); + }); + } + }; + var repeatLeft = function (dom, node, offset, process, rootNode) { + var search = global$5(dom, isBoundary(dom)); + return Option.from(search.backwards(node, offset, process, rootNode)); + }; + + var generatePath = function (root, node, offset) { + if (isText(node) && (offset < 0 || offset > node.data.length)) { + return []; + } + var p = [offset]; + var current = node; + while (current !== root && current.parentNode) { + var parent_1 = current.parentNode; + for (var i = 0; i < parent_1.childNodes.length; i++) { + if (parent_1.childNodes[i] === current) { + p.push(i); + break; + } + } + current = parent_1; + } + return current === root ? p.reverse() : []; + }; + var generatePathRange = function (root, startNode, startOffset, endNode, endOffset) { + var start = generatePath(root, startNode, startOffset); + var end = generatePath(root, endNode, endOffset); + return { + start: start, + end: end + }; + }; + var resolvePath = function (root, path) { + var nodePath = path.slice(); + var offset = nodePath.pop(); + return foldl(nodePath, function (optNode, index) { + return optNode.bind(function (node) { + return Option.from(node.childNodes[index]); + }); + }, Option.some(root)).bind(function (node) { + if (isText(node) && offset >= 0 && offset <= node.data.length) { + return Option.some({ + node: node, + offset: offset + }); + } else { + return Option.some({ + node: node, + offset: offset + }); + } + }); + }; + var resolvePathRange = function (root, range) { + return resolvePath(root, range.start).bind(function (_a) { + var startNode = _a.node, startOffset = _a.offset; + return resolvePath(root, range.end).map(function (_a) { + var endNode = _a.node, endOffset = _a.offset; + var rng = domGlobals.document.createRange(); + rng.setStart(startNode, startOffset); + rng.setEnd(endNode, endOffset); + return rng; + }); + }); + }; + var generatePathRangeFromRange = function (root, range) { + return generatePathRange(root, range.startContainer, range.startOffset, range.endContainer, range.endOffset); + }; + + var stripPattern = function (dom, block, pattern) { + var firstTextNode = textAfter(block, 0, block); + firstTextNode.each(function (spot) { + var node = spot.container; + scanRight(node, pattern.start.length, block).each(function (end) { + var rng = dom.createRng(); + rng.setStart(node, 0); + rng.setEnd(end.container, end.offset); + deleteRng(dom, rng, function (e) { + return e === block; + }); + }); + }); + }; + var applyPattern = function (editor, match) { + var dom = editor.dom; + var pattern = match.pattern; + var rng = resolvePathRange(dom.getRoot(), match.range).getOrDie('Unable to resolve path range'); + getParentBlock(editor, rng).each(function (block) { + if (pattern.type === 'block-format') { + if (isBlockFormatName(pattern.format, editor.formatter)) { + editor.undoManager.transact(function () { + stripPattern(editor.dom, block, pattern); + editor.formatter.apply(pattern.format); + }); + } + } else if (pattern.type === 'block-command') { + editor.undoManager.transact(function () { + stripPattern(editor.dom, block, pattern); + editor.execCommand(pattern.cmd, false, pattern.value); + }); + } + }); + return true; + }; + var findPattern = function (patterns, text) { + var nuText = text.replace(nbsp, ' '); + return find(patterns, function (pattern) { + if (text.indexOf(pattern.start) !== 0 && nuText.indexOf(pattern.start) !== 0) { + return false; + } + return true; + }); + }; + var findPatterns = function (editor, patterns) { + var dom = editor.dom; + var rng = editor.selection.getRng(); + return getParentBlock(editor, rng).filter(function (block) { + var forcedRootBlock = getForcedRootBlock(editor); + var matchesForcedRootBlock = forcedRootBlock === '' && dom.is(block, 'body') || dom.is(block, forcedRootBlock); + return block !== null && matchesForcedRootBlock; + }).bind(function (block) { + var blockText = block.textContent; + var matchedPattern = findPattern(patterns, blockText); + return matchedPattern.map(function (pattern) { + if (global$3.trim(blockText).length === pattern.start.length) { + return []; + } + return [{ + pattern: pattern, + range: generatePathRange(dom.getRoot(), block, 0, block, 0) + }]; + }); + }).getOr([]); + }; + var applyMatches = function (editor, matches) { + if (matches.length === 0) { + return; + } + var bookmark = editor.selection.getBookmark(); + each(matches, function (match) { + return applyPattern(editor, match); + }); + editor.selection.moveToBookmark(bookmark); + }; + + var unique = 0; + var generate$1 = function (prefix) { + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); + }; + + var checkRange = function (str, substr, start) { + if (substr === '') { + return true; + } + if (str.length < substr.length) { + return false; + } + var x = str.substr(start, start + substr.length); + return x === substr; + }; + var endsWith = function (str, suffix) { + return checkRange(str, suffix, str.length - suffix.length); + }; + + var newMarker = function (dom, id) { + return dom.create('span', { + 'data-mce-type': 'bookmark', + 'id': id + }); + }; + var rangeFromMarker = function (dom, marker) { + var rng = dom.createRng(); + rng.setStartAfter(marker.start); + rng.setEndBefore(marker.end); + return rng; + }; + var createMarker = function (dom, markerPrefix, pathRange) { + var rng = resolvePathRange(dom.getRoot(), pathRange).getOrDie('Unable to resolve path range'); + var startNode = rng.startContainer; + var endNode = rng.endContainer; + var textEnd = rng.endOffset === 0 ? endNode : endNode.splitText(rng.endOffset); + var textStart = rng.startOffset === 0 ? startNode : startNode.splitText(rng.startOffset); + return { + prefix: markerPrefix, + end: textEnd.parentNode.insertBefore(newMarker(dom, markerPrefix + '-end'), textEnd), + start: textStart.parentNode.insertBefore(newMarker(dom, markerPrefix + '-start'), textStart) + }; + }; + var removeMarker = function (dom, marker, isRoot) { + cleanEmptyNodes(dom, dom.get(marker.prefix + '-end'), isRoot); + cleanEmptyNodes(dom, dom.get(marker.prefix + '-start'), isRoot); + }; + + var matchesPattern = function (dom, block, patternContent) { + return function (element, offset) { + var text = element.data; + var searchText = text.substring(0, offset); + var startEndIndex = searchText.lastIndexOf(patternContent.charAt(patternContent.length - 1)); + var startIndex = searchText.lastIndexOf(patternContent); + if (startIndex !== -1) { + return startIndex + patternContent.length; + } else if (startEndIndex !== -1) { + return startEndIndex + 1; + } else { + return -1; + } + }; + }; + var findPatternStartFromSpot = function (dom, pattern, block, spot) { + var startPattern = pattern.start; + var startSpot = repeatLeft(dom, spot.container, spot.offset, matchesPattern(dom, block, startPattern), block); + return startSpot.bind(function (spot) { + if (spot.offset >= startPattern.length) { + var rng = dom.createRng(); + rng.setStart(spot.container, spot.offset - startPattern.length); + rng.setEnd(spot.container, spot.offset); + return Option.some(rng); + } else { + var offset = spot.offset - startPattern.length; + return scanLeft(spot.container, offset, block).map(function (nextSpot) { + var rng = dom.createRng(); + rng.setStart(nextSpot.container, nextSpot.offset); + rng.setEnd(spot.container, spot.offset); + return rng; + }).filter(function (rng) { + return rng.toString() === startPattern; + }).orThunk(function () { + return findPatternStartFromSpot(dom, pattern, block, point(spot.container, 0)); + }); + } + }); + }; + var findPatternStart = function (dom, pattern, node, offset, block, requireGap) { + if (requireGap === void 0) { + requireGap = false; + } + if (pattern.start.length === 0 && !requireGap) { + var rng = dom.createRng(); + rng.setStart(node, offset); + rng.setEnd(node, offset); + return Option.some(rng); + } + return textBefore(node, offset, block).bind(function (spot) { + var start = findPatternStartFromSpot(dom, pattern, block, spot); + return start.bind(function (startRange) { + if (requireGap) { + if (startRange.endContainer === spot.container && startRange.endOffset === spot.offset) { + return Option.none(); + } else if (spot.offset === 0 && startRange.endContainer.textContent.length === startRange.endOffset) { + return Option.none(); + } + } + return Option.some(startRange); + }); + }); + }; + var findPattern$1 = function (editor, block, details) { + var dom = editor.dom; + var root = dom.getRoot(); + var pattern = details.pattern; + var endNode = details.position.container; + var endOffset = details.position.offset; + return scanLeft(endNode, endOffset - details.pattern.end.length, block).bind(function (spot) { + var endPathRng = generatePathRange(root, spot.container, spot.offset, endNode, endOffset); + if (isReplacementPattern(pattern)) { + return Option.some({ + matches: [{ + pattern: pattern, + startRng: endPathRng, + endRng: endPathRng + }], + position: spot + }); + } else { + var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.container, spot.offset, block); + var results_1 = resultsOpt.getOr({ + matches: [], + position: spot + }); + var pos = results_1.position; + var start = findPatternStart(dom, pattern, pos.container, pos.offset, block, resultsOpt.isNone()); + return start.map(function (startRng) { + var startPathRng = generatePathRangeFromRange(root, startRng); + return { + matches: results_1.matches.concat([{ + pattern: pattern, + startRng: startPathRng, + endRng: endPathRng + }]), + position: point(startRng.startContainer, startRng.startOffset) + }; + }); + } + }); + }; + var findPatternsRec = function (editor, patterns, node, offset, block) { + var dom = editor.dom; + return textBefore(node, offset, dom.getRoot()).bind(function (endSpot) { + var rng = dom.createRng(); + rng.setStart(block, 0); + rng.setEnd(node, offset); + var text = rng.toString(); + for (var i = 0; i < patterns.length; i++) { + var pattern = patterns[i]; + if (!endsWith(text, pattern.end)) { + continue; + } + var patternsWithoutCurrent = patterns.slice(); + patternsWithoutCurrent.splice(i, 1); + var result = findPattern$1(editor, block, { + pattern: pattern, + remainingPatterns: patternsWithoutCurrent, + position: endSpot + }); + if (result.isSome()) { + return result; + } + } + return Option.none(); + }); + }; + var applyPattern$1 = function (editor, pattern, patternRange) { + editor.selection.setRng(patternRange); + if (pattern.type === 'inline-format') { + each(pattern.format, function (format) { + editor.formatter.apply(format); + }); + } else { + editor.execCommand(pattern.cmd, false, pattern.value); + } + }; + var applyReplacementPattern = function (editor, pattern, marker, isRoot) { + var markerRange = rangeFromMarker(editor.dom, marker); + deleteRng(editor.dom, markerRange, isRoot); + applyPattern$1(editor, pattern, markerRange); + }; + var applyPatternWithContent = function (editor, pattern, startMarker, endMarker, isRoot) { + var dom = editor.dom; + var markerEndRange = rangeFromMarker(dom, endMarker); + var markerStartRange = rangeFromMarker(dom, startMarker); + deleteRng(dom, markerStartRange, isRoot); + deleteRng(dom, markerEndRange, isRoot); + var patternMarker = { + prefix: startMarker.prefix, + start: startMarker.end, + end: endMarker.start + }; + var patternRange = rangeFromMarker(dom, patternMarker); + applyPattern$1(editor, pattern, patternRange); + }; + var addMarkers = function (dom, matches) { + var markerPrefix = generate$1('mce_textpattern'); + var matchesWithEnds = foldr(matches, function (acc, match) { + var endMarker = createMarker(dom, markerPrefix + ('_end' + acc.length), match.endRng); + return acc.concat([__assign(__assign({}, match), { endMarker: endMarker })]); + }, []); + return foldr(matchesWithEnds, function (acc, match) { + var idx = matchesWithEnds.length - acc.length - 1; + var startMarker = isReplacementPattern(match.pattern) ? match.endMarker : createMarker(dom, markerPrefix + ('_start' + idx), match.startRng); + return acc.concat([__assign(__assign({}, match), { startMarker: startMarker })]); + }, []); + }; + var findPatterns$1 = function (editor, patterns, space) { + var rng = editor.selection.getRng(); + if (rng.collapsed === false) { + return []; + } + return getParentBlock(editor, rng).bind(function (block) { + var offset = rng.startOffset - (space ? 1 : 0); + return findPatternsRec(editor, patterns, rng.startContainer, offset, block); + }).fold(function () { + return []; + }, function (result) { + return result.matches; + }); + }; + var applyMatches$1 = function (editor, matches) { + if (matches.length === 0) { + return; + } + var dom = editor.dom; + var bookmark = editor.selection.getBookmark(); + var matchesWithMarkers = addMarkers(dom, matches); + each(matchesWithMarkers, function (match) { + var block = dom.getParent(match.startMarker.start, dom.isBlock); + var isRoot = function (node) { + return node === block; + }; + if (isReplacementPattern(match.pattern)) { + applyReplacementPattern(editor, match.pattern, match.endMarker, isRoot); + } else { + applyPatternWithContent(editor, match.pattern, match.startMarker, match.endMarker, isRoot); + } + removeMarker(dom, match.endMarker, isRoot); + removeMarker(dom, match.startMarker, isRoot); + }); + editor.selection.moveToBookmark(bookmark); + }; + + var handleEnter = function (editor, patternSet) { + if (!editor.selection.isCollapsed()) { + return false; + } + var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, false); + var blockMatches = findPatterns(editor, patternSet.blockPatterns); + if (blockMatches.length > 0 || inlineMatches.length > 0) { + editor.undoManager.add(); + editor.undoManager.extra(function () { + editor.execCommand('mceInsertNewLine'); + }, function () { + editor.insertContent(zeroWidth); + applyMatches$1(editor, inlineMatches); + applyMatches(editor, blockMatches); + var range = editor.selection.getRng(); + var spot = textBefore(range.startContainer, range.startOffset, editor.dom.getRoot()); + editor.execCommand('mceInsertNewLine'); + spot.each(function (s) { + var node = s.container; + if (node.data.charAt(s.offset - 1) === zeroWidth) { + node.deleteData(s.offset - 1, 1); + cleanEmptyNodes(editor.dom, node.parentNode, function (e) { + return e === editor.dom.getRoot(); + }); + } + }); + }); + return true; + } + return false; + }; + var handleInlineKey = function (editor, patternSet) { + var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, true); + if (inlineMatches.length > 0) { + editor.undoManager.transact(function () { + applyMatches$1(editor, inlineMatches); + }); + } + }; + var checkKeyEvent = function (codes, event, predicate) { + for (var i = 0; i < codes.length; i++) { + if (predicate(codes[i], event)) { + return true; + } + } + }; + var checkKeyCode = function (codes, event) { + return checkKeyEvent(codes, event, function (code, event) { + return code === event.keyCode && global$2.modifierPressed(event) === false; + }); + }; + var checkCharCode = function (chars, event) { + return checkKeyEvent(chars, event, function (chr, event) { + return chr.charCodeAt(0) === event.charCode; + }); + }; + var KeyHandler = { + handleEnter: handleEnter, + handleInlineKey: handleInlineKey, + checkCharCode: checkCharCode, + checkKeyCode: checkKeyCode + }; + + var setup = function (editor, patternsState) { + var charCodes = [ + ',', + '.', + ';', + ':', + '!', + '?' + ]; + var keyCodes = [32]; + editor.on('keydown', function (e) { + if (e.keyCode === 13 && !global$2.modifierPressed(e)) { + if (KeyHandler.handleEnter(editor, patternsState.get())) { + e.preventDefault(); + } + } + }, true); + editor.on('keyup', function (e) { + if (KeyHandler.checkKeyCode(keyCodes, e)) { + KeyHandler.handleInlineKey(editor, patternsState.get()); + } + }); + editor.on('keypress', function (e) { + if (KeyHandler.checkCharCode(charCodes, e)) { + global$1.setEditorTimeout(editor, function () { + KeyHandler.handleInlineKey(editor, patternsState.get()); + }); + } + }); + }; + var Keyboard = { setup: setup }; + + function Plugin () { + global.add('textpattern', function (editor) { + var patternsState = Cell(getPatternSet(editor.settings)); + Keyboard.setup(editor, patternsState); + return Api.get(patternsState); + }); + } + + Plugin(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textpattern/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textpattern/plugin.min.js new file mode 100644 index 0000000..7622ec3 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/textpattern/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(f){"use strict";var e=function(t){function n(){return r}var r=t;return{get:n,set:function(t){r=t},clone:function(){return e(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(var n,r=1,e=arguments.length;rn.start.length?-1:1})}function R(o){function a(t){return vt.error({message:t,pattern:o})}function t(t,n,r){if(o.format===undefined)return o.cmd!==undefined?it(o.cmd)?vt.value(r(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var e=void 0;if(ft(o.format)){if(!O(o.format,it))return a(t+" pattern has non-string items in the `format` array");e=o.format}else{if(!it(o.format))return a(t+" pattern has non-string `format` parameter");e=[o.format]}return vt.value(n(e))}if(!ut(o))return a("Raw pattern is not an object");if(!it(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?it(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):vt.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!it(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var r=o.start,e=o.end;return 0===e.length&&(e=r,r=""),t("Inline",function(t){return{type:"inline-format",start:r,end:e,format:t}},function(t,n){return{type:"inline-command",start:r,end:e,cmd:t,value:n}})}function T(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0}function N(t){return{inlinePatterns:b(t,C),blockPatterns:x(b(t,E))}}function P(){for(var t=[],n=0;nn.data.length))return[];for(var e=[r],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i=t.length)return at.some(A(t,n));var e=xt(Tt);return at.from(e.forwards(t,n,U(t),r)).map(function(t){return A(t.container,0)})})(o,0,o).each(function(t){var r=t.container;Pt(r,n.start.length,o).each(function(t){var n=e.createRng();n.setStart(r,0),n.setEnd(t.container,t.offset),B(e,n,function(t){return t===o})})})}function H(t,n){var r=n.replace("\xa0"," ");return function(t,n){for(var r=0,e=t.length;r=i.length){var t=e.createRng();return t.setStart(r.container,r.offset-i.length),t.setEnd(r.container,r.offset),at.some(t)}var n=r.offset-i.length;return Nt(r.container,n,a).map(function(t){var n=e.createRng();return n.setStart(t.container,t.offset),n.setEnd(r.container,r.offset),n}).filter(function(t){return t.toString()===i}).orThunk(function(){return Mt(e,o,a,A(r.container,0))})})},At=function(c,s,l,d,m){var g=c.dom;return q(l,d,g.getRoot()).bind(function(t){var n=g.createRng();n.setStart(m,0),n.setEnd(l,d);for(var r,e,o=n.toString(),a=0;a= 1 && depth <= 9 ? depth : 3; + }; + var Settings = { + getTocClass: getTocClass, + getTocHeader: getTocHeader, + getTocDepth: getTocDepth + }; + + var create = function (prefix) { + var counter = 0; + return function () { + var guid = new Date().getTime().toString(32); + return prefix + guid + (counter++).toString(32); + }; + }; + var Guid = { create: create }; + + var tocId = Guid.create('mcetoc_'); + var generateSelector = function generateSelector(depth) { + var i; + var selector = []; + for (i = 1; i <= depth; i++) { + selector.push('h' + i); + } + return selector.join(','); + }; + var hasHeaders = function (editor) { + return readHeaders(editor).length > 0; + }; + var readHeaders = function (editor) { + var tocClass = Settings.getTocClass(editor); + var headerTag = Settings.getTocHeader(editor); + var selector = generateSelector(Settings.getTocDepth(editor)); + var headers = editor.$(selector); + if (headers.length && /^h[1-9]$/i.test(headerTag)) { + headers = headers.filter(function (i, el) { + return !editor.dom.hasClass(el.parentNode, tocClass); + }); + } + return global$3.map(headers, function (h) { + return { + id: h.id ? h.id : tocId(), + level: parseInt(h.nodeName.replace(/^H/i, ''), 10), + title: editor.$.text(h), + element: h + }; + }); + }; + var getMinLevel = function (headers) { + var i, minLevel = 9; + for (i = 0; i < headers.length; i++) { + if (headers[i].level < minLevel) { + minLevel = headers[i].level; + } + if (minLevel === 1) { + return minLevel; + } + } + return minLevel; + }; + var generateTitle = function (tag, title) { + var openTag = '<' + tag + ' contenteditable="true">'; + var closeTag = ''; + return openTag + global$1.DOM.encode(title) + closeTag; + }; + var generateTocHtml = function (editor) { + var html = generateTocContentHtml(editor); + return '
    ' + html + '
    '; + }; + var generateTocContentHtml = function (editor) { + var html = ''; + var headers = readHeaders(editor); + var prevLevel = getMinLevel(headers) - 1; + var i, ii, h, nextLevel; + if (!headers.length) { + return ''; + } + html += generateTitle(Settings.getTocHeader(editor), global$2.translate('Table of Contents')); + for (i = 0; i < headers.length; i++) { + h = headers[i]; + h.element.id = h.id; + nextLevel = headers[i + 1] && headers[i + 1].level; + if (prevLevel === h.level) { + html += '
  • '; + } else { + for (ii = prevLevel; ii < h.level; ii++) { + html += '
    • '; + } + } + html += '' + h.title + ''; + if (nextLevel === h.level || !nextLevel) { + html += '
    • '; + if (!nextLevel) { + html += '
    '; + } + } else { + for (ii = h.level; ii > nextLevel; ii--) { + html += '
  • '; + } + } + prevLevel = h.level; + } + return html; + }; + var isEmptyOrOffscren = function (editor, nodes) { + return !nodes.length || editor.dom.getParents(nodes[0], '.mce-offscreen-selection').length > 0; + }; + var insertToc = function (editor) { + var tocClass = Settings.getTocClass(editor); + var $tocElm = editor.$('.' + tocClass); + if (isEmptyOrOffscren(editor, $tocElm)) { + editor.insertContent(generateTocHtml(editor)); + } else { + updateToc(editor); + } + }; + var updateToc = function (editor) { + var tocClass = Settings.getTocClass(editor); + var $tocElm = editor.$('.' + tocClass); + if ($tocElm.length) { + editor.undoManager.transact(function () { + $tocElm.html(generateTocContentHtml(editor)); + }); + } + }; + var Toc = { + hasHeaders: hasHeaders, + insertToc: insertToc, + updateToc: updateToc + }; + + var register = function (editor) { + editor.addCommand('mceInsertToc', function () { + Toc.insertToc(editor); + }); + editor.addCommand('mceUpdateToc', function () { + Toc.updateToc(editor); + }); + }; + var Commands = { register: register }; + + var setup = function (editor) { + var $ = editor.$, tocClass = Settings.getTocClass(editor); + editor.on('PreProcess', function (e) { + var $tocElm = $('.' + tocClass, e.node); + if ($tocElm.length) { + $tocElm.removeAttr('contentEditable'); + $tocElm.find('[contenteditable]').removeAttr('contentEditable'); + } + }); + editor.on('SetContent', function () { + var $tocElm = $('.' + tocClass); + if ($tocElm.length) { + $tocElm.attr('contentEditable', false); + $tocElm.children(':first-child').attr('contentEditable', true); + } + }); + }; + var FilterContent = { setup: setup }; + + var toggleState = function (editor) { + return function (api) { + var toggleDisabledState = function () { + return api.setDisabled(editor.mode.isReadOnly() || !Toc.hasHeaders(editor)); + }; + toggleDisabledState(); + editor.on('LoadContent SetContent change', toggleDisabledState); + return function () { + return editor.on('LoadContent SetContent change', toggleDisabledState); + }; + }; + }; + var isToc = function (editor) { + return function (elm) { + return elm && editor.dom.is(elm, '.' + Settings.getTocClass(editor)) && editor.getBody().contains(elm); + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addButton('toc', { + icon: 'toc', + tooltip: 'Table of contents', + onAction: function () { + return editor.execCommand('mceInsertToc'); + }, + onSetup: toggleState(editor) + }); + editor.ui.registry.addButton('tocupdate', { + icon: 'reload', + tooltip: 'Update', + onAction: function () { + return editor.execCommand('mceUpdateToc'); + } + }); + editor.ui.registry.addMenuItem('toc', { + icon: 'toc', + text: 'Table of contents', + onAction: function () { + return editor.execCommand('mceInsertToc'); + }, + onSetup: toggleState(editor) + }); + editor.ui.registry.addContextToolbar('toc', { + items: 'tocupdate', + predicate: isToc(editor), + scope: 'node', + position: 'node' + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('toc', function (editor) { + Commands.register(editor); + Buttons.register(editor); + FilterContent.setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/toc/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/toc/plugin.min.js new file mode 100644 index 0000000..4be8ebb --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/toc/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function e(n){return function(t){function e(){return t.setDisabled(n.mode.isReadOnly()||!v.hasHeaders(n))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("toc_class","mce-toc")},d=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},s=function(e){var n=0;return function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}}("mcetoc_"),f=function f(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},m=function(n){var o=c(n),t=d(n),e=f(a(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:s(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},o=function(t){var e,n,o,r,i="",c=m(t),a=function(t){var e,n=9;for(e=0;e";return"<"+t+' contenteditable="true">'+u.DOM.encode(e)+n}(d(t),l.translate("Table of Contents")),e=0;e";else for(n=a;n
  • ";if(i+=''+o.title+"",r!==o.level&&r)for(n=o.level;r
  • ";else i+="
  • ",r||(i+="");a=o.level}return i},r=function(t){var e=c(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(o(t))})},v={hasHeaders:function(t){return 0'+e+""}(t))},updateToc:r},n=function(t){t.addCommand("mceInsertToc",function(){v.insertToc(t)}),t.addCommand("mceUpdateToc",function(){v.updateToc(t)})},g=function(t){var n=t.$,o=c(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},h=function(t){t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:function(e){return function(t){return t&&e.dom.is(t,"."+c(e))&&e.getBody().contains(t)}}(t),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){n(t),h(t),g(t)})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/css/visualblocks.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/css/visualblocks.css deleted file mode 100644 index fe6fa93..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/css/visualblocks.css +++ /dev/null @@ -1,128 +0,0 @@ -.mce-visualblocks p { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); -} - -.mce-visualblocks h1 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); -} - -.mce-visualblocks h2 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); -} - -.mce-visualblocks h3 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); -} - -.mce-visualblocks h4 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); -} - -.mce-visualblocks h5 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); -} - -.mce-visualblocks h6 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); -} - -.mce-visualblocks div { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); -} - -.mce-visualblocks section { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); -} - -.mce-visualblocks article { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); -} - -.mce-visualblocks blockquote { - padding-top: 10px; - border: 1px dashed #BBB; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); -} - -.mce-visualblocks address { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); -} - -.mce-visualblocks pre { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); -} - -.mce-visualblocks figure { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); -} - -.mce-visualblocks hgroup { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); -} - -.mce-visualblocks aside { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); -} - -.mce-visualblocks figcaption { - border: 1px dashed #BBB; -} - -.mce-visualblocks ul { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==) -} - -.mce-visualblocks ol { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); -} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/address.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/address.gif deleted file mode 100644 index 87c4bff..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/address.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/article.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/article.gif deleted file mode 100644 index da2dbde..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/article.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/aside.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/aside.gif deleted file mode 100644 index 5f034c6..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/aside.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/blockquote.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/blockquote.gif deleted file mode 100644 index a9ae911..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/blockquote.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/div.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/div.gif deleted file mode 100644 index 41754ae..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/div.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/figure.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/figure.gif deleted file mode 100644 index 88e7b35..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/figure.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h1.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h1.gif deleted file mode 100644 index a050710..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h1.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h2.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h2.gif deleted file mode 100644 index 75d8f54..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h2.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h3.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h3.gif deleted file mode 100644 index 11a1054..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h3.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h4.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h4.gif deleted file mode 100644 index c6f2a76..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h4.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h5.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h5.gif deleted file mode 100644 index e2cc8c7..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h5.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h6.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h6.gif deleted file mode 100644 index 5ea288f..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/h6.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/hgroup.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/hgroup.gif deleted file mode 100644 index 7151919..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/hgroup.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/ol.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/ol.gif deleted file mode 100644 index 680282f..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/ol.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/p.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/p.gif deleted file mode 100644 index 04645bf..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/p.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/pre.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/pre.gif deleted file mode 100644 index 0699b51..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/pre.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/section.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/section.gif deleted file mode 100644 index 7e2ebe8..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/section.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/ul.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/ul.gif deleted file mode 100644 index 0fc1063..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/img/ul.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.js index 444a87f..6b0f85a 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.js @@ -1,86 +1,116 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright 2012, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ - -/*global tinymce:true */ - -tinymce.PluginManager.add('visualblocks', function(editor, url) { - var cssId, visualBlocksMenuItem, enabled; - - // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects - if (!window.NodeList) { - return; - } - - function toggleActiveState() { - var self = this; - - self.active(enabled); - - editor.on('VisualBlocks', function() { - self.active(editor.dom.hasClass(editor.getBody(), 'mce-visualblocks')); - }); - } - - editor.addCommand('mceVisualBlocks', function() { - var dom = editor.dom, linkElm; - - if (!cssId) { - cssId = dom.uniqueId(); - linkElm = dom.create('link', { - id: cssId, - rel: 'stylesheet', - href: url + '/css/visualblocks.css' - }); - - editor.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); - } - - // Toggle on/off visual blocks while computing previews - editor.on("PreviewFormats AfterPreviewFormats", function(e) { - if (enabled) { - dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type == "afterpreviewformats"); - } - }); - - dom.toggleClass(editor.getBody(), 'mce-visualblocks'); - enabled = editor.dom.hasClass(editor.getBody(), 'mce-visualblocks'); - - if (visualBlocksMenuItem) { - visualBlocksMenuItem.active(dom.hasClass(editor.getBody(), 'mce-visualblocks')); - } - - editor.fire('VisualBlocks'); - }); - - editor.addButton('visualblocks', { - title: 'Show blocks', - cmd: 'mceVisualBlocks', - onPostRender: toggleActiveState - }); - - editor.addMenuItem('visualblocks', { - text: 'Show blocks', - cmd: 'mceVisualBlocks', - onPostRender: toggleActiveState, - selectable: true, - context: 'view', - prependToContext: true - }); - - editor.on('init', function() { - if (editor.settings.visualblocks_default_state) { - editor.execCommand('mceVisualBlocks', false, null, {skip_focus: true}); - } - }); - - editor.on('remove', function() { - editor.dom.removeClass(editor.getBody(), 'mce-visualblocks'); - }); -}); +(function () { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var fireVisualBlocks = function (editor, state) { + editor.fire('VisualBlocks', { state: state }); + }; + var Events = { fireVisualBlocks: fireVisualBlocks }; + + var toggleVisualBlocks = function (editor, pluginUrl, enabledState) { + var dom = editor.dom; + dom.toggleClass(editor.getBody(), 'mce-visualblocks'); + enabledState.set(!enabledState.get()); + Events.fireVisualBlocks(editor, enabledState.get()); + }; + var VisualBlocks = { toggleVisualBlocks: toggleVisualBlocks }; + + var register = function (editor, pluginUrl, enabledState) { + editor.addCommand('mceVisualBlocks', function () { + VisualBlocks.toggleVisualBlocks(editor, pluginUrl, enabledState); + }); + }; + var Commands = { register: register }; + + var isEnabledByDefault = function (editor) { + return editor.getParam('visualblocks_default_state', false, 'boolean'); + }; + var Settings = { isEnabledByDefault: isEnabledByDefault }; + + var setup = function (editor, pluginUrl, enabledState) { + editor.on('PreviewFormats AfterPreviewFormats', function (e) { + if (enabledState.get()) { + editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats'); + } + }); + editor.on('init', function () { + if (Settings.isEnabledByDefault(editor)) { + VisualBlocks.toggleVisualBlocks(editor, pluginUrl, enabledState); + } + }); + editor.on('remove', function () { + editor.dom.removeClass(editor.getBody(), 'mce-visualblocks'); + }); + }; + var Bindings = { setup: setup }; + + var toggleActiveState = function (editor, enabledState) { + return function (api) { + api.setActive(enabledState.get()); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('VisualBlocks', editorEventCallback); + return function () { + return editor.off('VisualBlocks', editorEventCallback); + }; + }; + }; + var register$1 = function (editor, enabledState) { + editor.ui.registry.addToggleButton('visualblocks', { + icon: 'visualblocks', + tooltip: 'Show blocks', + onAction: function () { + return editor.execCommand('mceVisualBlocks'); + }, + onSetup: toggleActiveState(editor, enabledState) + }); + editor.ui.registry.addToggleMenuItem('visualblocks', { + text: 'Show blocks', + onAction: function () { + return editor.execCommand('mceVisualBlocks'); + }, + onSetup: toggleActiveState(editor, enabledState) + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('visualblocks', function (editor, pluginUrl) { + var enabledState = Cell(false); + Commands.register(editor, pluginUrl, enabledState); + Buttons.register(editor, enabledState); + Bindings.setup(editor, pluginUrl, enabledState); + }); + } + + Plugin(); + +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.min.js index 8c48ed0..6abc451 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualblocks/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("visualblocks",function(e,s){function o(){var s=this;s.active(a),e.on("VisualBlocks",function(){s.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}var l,t,a;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var o,c=e.dom;l||(l=c.uniqueId(),o=c.create("link",{id:l,rel:"stylesheet",href:s+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(o)),e.on("PreviewFormats AfterPreviewFormats",function(s){a&&c.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==s.type)}),c.toggleClass(e.getBody(),"mce-visualblocks"),a=e.dom.hasClass(e.getBody(),"mce-visualblocks"),t&&t.active(c.hasClass(e.getBody(),"mce-visualblocks")),e.fire("VisualBlocks")}),e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o,selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")}))}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function n(n,e){return function(o){o.setActive(e.get());function t(t){return o.setActive(t.state)}return n.on("VisualBlocks",t),function(){return n.off("VisualBlocks",t)}}}var e=function(t){function o(){return n}var n=t;return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,o){t.fire("VisualBlocks",{state:o})},u=function(t,o,n){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),n.set(!n.get()),i(t,n.get())},c=function(t,o,n){t.addCommand("mceVisualBlocks",function(){u(t,o,n)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},l=function(o,t,n){o.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&o.dom.toggleClass(o.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),o.on("init",function(){s(o)&&u(o,t,n)}),o.on("remove",function(){o.dom.removeClass(o.getBody(),"mce-visualblocks")})},r=function(t,o){t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)})};!function o(){t.add("visualblocks",function(t,o){var n=e(!1);c(t,o,n),r(t,n),l(t,o,n)})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.js index 5de8d2a..5c7c048 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.js @@ -1,88 +1,571 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.2.1 (2020-03-25) */ +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var get = function (toggleState) { + var isEnabled = function () { + return toggleState.get(); + }; + return { isEnabled: isEnabled }; + }; + var Api = { get: get }; + + var fireVisualChars = function (editor, state) { + return editor.fire('VisualChars', { state: state }); + }; + var Events = { fireVisualChars: fireVisualChars }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + var nativeSlice = Array.prototype.slice; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var type = function (element) { + return element.dom().nodeType; + }; + var value = function (element) { + return element.dom().nodeValue; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType$1(TEXT); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom(), key, value); + }; + var get$1 = function (element, key) { + var v = element.dom().getAttribute(key); + return v === null ? undefined : v; + }; + var remove = function (element, key) { + element.dom().removeAttribute(key); + }; + + var read = function (element, attr) { + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add = function (element, attr, id) { + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; + }; + var remove$1 = function (element, attr, id) { + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove(element, attr); + } + return false; + }; + + var supports = function (element) { + return element.dom().classList !== undefined; + }; + var get$2 = function (element) { + return read(element, 'class'); + }; + var add$1 = function (element, clazz) { + return add(element, 'class', clazz); + }; + var remove$2 = function (element, clazz) { + return remove$1(element, 'class', clazz); + }; + + var add$2 = function (element, clazz) { + if (supports(element)) { + element.dom().classList.add(clazz); + } else { + add$1(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom().classList : get$2(element); + if (classList.length === 0) { + remove(element, 'class'); + } + }; + var remove$3 = function (element, clazz) { + if (supports(element)) { + var classList = element.dom().classList; + classList.remove(clazz); + } else { + remove$2(element, clazz); + } + cleanClass(element); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var charMap = { + '\xA0': 'nbsp', + '\xAD': 'shy' + }; + var charMapToRegExp = function (charMap, global) { + var key, regExp = ''; + for (key in charMap) { + regExp += key; + } + return new RegExp('[' + regExp + ']', global ? 'g' : ''); + }; + var charMapToSelector = function (charMap) { + var key, selector = ''; + for (key in charMap) { + if (selector) { + selector += ','; + } + selector += 'span.mce-' + charMap[key]; + } + return selector; + }; + var Data = { + charMap: charMap, + regExp: charMapToRegExp(charMap), + regExpGlobal: charMapToRegExp(charMap, true), + selector: charMapToSelector(charMap), + nbspClass: 'mce-nbsp', + charMapToRegExp: charMapToRegExp, + charMapToSelector: charMapToSelector + }; + + var wrapCharWithSpan = function (value) { + return '' + value + ''; + }; + var Html = { wrapCharWithSpan: wrapCharWithSpan }; + + var isMatch = function (n) { + var value$1 = value(n); + return isText(n) && value$1 !== undefined && Data.regExp.test(value$1); + }; + var filterDescendants = function (scope, predicate) { + var result = []; + var dom = scope.dom(); + var children = map(dom.childNodes, Element.fromDom); + each(children, function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(filterDescendants(x, predicate)); + }); + return result; + }; + var findParentElm = function (elm, rootElm) { + while (elm.parentNode) { + if (elm.parentNode === rootElm) { + return elm; + } + elm = elm.parentNode; + } + }; + var replaceWithSpans = function (text) { + return text.replace(Data.regExpGlobal, Html.wrapCharWithSpan); + }; + var Nodes = { + isMatch: isMatch, + filterDescendants: filterDescendants, + findParentElm: findParentElm, + replaceWithSpans: replaceWithSpans + }; + + var isWrappedNbsp = function (node) { + return node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap'); + }; + var show = function (editor, rootElm) { + var nodeList = Nodes.filterDescendants(Element.fromDom(rootElm), Nodes.isMatch); + each(nodeList, function (n) { + var parent = n.dom().parentNode; + if (isWrappedNbsp(parent)) { + add$2(Element.fromDom(parent), Data.nbspClass); + } else { + var withSpans = Nodes.replaceWithSpans(editor.dom.encode(value(n))); + var div = editor.dom.create('div', null, withSpans); + var node = void 0; + while (node = div.lastChild) { + editor.dom.insertAfter(node, n.dom()); + } + editor.dom.remove(n.dom()); + } + }); + }; + var hide = function (editor, rootElm) { + var nodeList = editor.dom.select(Data.selector, rootElm); + each(nodeList, function (node) { + if (isWrappedNbsp(node)) { + remove$3(Element.fromDom(node), Data.nbspClass); + } else { + editor.dom.remove(node, true); + } + }); + }; + var toggle = function (editor) { + var body = editor.getBody(); + var bookmark = editor.selection.getBookmark(); + var parentNode = Nodes.findParentElm(editor.selection.getNode(), body); + parentNode = parentNode !== undefined ? parentNode : body; + hide(editor, parentNode); + show(editor, parentNode); + editor.selection.moveToBookmark(bookmark); + }; + var VisualChars = { + show: show, + hide: hide, + toggle: toggle + }; + + var toggleVisualChars = function (editor, toggleState) { + var body = editor.getBody(); + var selection = editor.selection; + var bookmark; + toggleState.set(!toggleState.get()); + Events.fireVisualChars(editor, toggleState.get()); + bookmark = selection.getBookmark(); + if (toggleState.get() === true) { + VisualChars.show(editor, body); + } else { + VisualChars.hide(editor, body); + } + selection.moveToBookmark(bookmark); + }; + var Actions = { toggleVisualChars: toggleVisualChars }; + + var register = function (editor, toggleState) { + editor.addCommand('mceVisualChars', function () { + Actions.toggleVisualChars(editor, toggleState); + }); + }; + var Commands = { register: register }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var setup = function (editor, toggleState) { + var debouncedToggle = global$1.debounce(function () { + VisualChars.toggle(editor); + }, 300); + if (editor.settings.forced_root_block !== false) { + editor.on('keydown', function (e) { + if (toggleState.get() === true) { + e.keyCode === 13 ? VisualChars.toggle(editor) : debouncedToggle(); + } + }); + } + }; + var Keyboard = { setup: setup }; + + var isEnabledByDefault = function (editor) { + return editor.getParam('visualchars_default_state', false); + }; + var Settings = { isEnabledByDefault: isEnabledByDefault }; + + var setup$1 = function (editor, toggleState) { + editor.on('init', function () { + var valueForToggling = !Settings.isEnabledByDefault(editor); + toggleState.set(valueForToggling); + Actions.toggleVisualChars(editor, toggleState); + }); + }; + var Bindings = { setup: setup$1 }; + + var toggleActiveState = function (editor, enabledStated) { + return function (api) { + api.setActive(enabledStated.get()); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('VisualChars', editorEventCallback); + return function () { + return editor.off('VisualChars', editorEventCallback); + }; + }; + }; + var register$1 = function (editor, toggleState) { + editor.ui.registry.addToggleButton('visualchars', { + tooltip: 'Show invisible characters', + icon: 'visualchars', + onAction: function () { + return editor.execCommand('mceVisualChars'); + }, + onSetup: toggleActiveState(editor, toggleState) + }); + editor.ui.registry.addToggleMenuItem('visualchars', { + text: 'Show invisible characters', + onAction: function () { + return editor.execCommand('mceVisualChars'); + }, + onSetup: toggleActiveState(editor, toggleState) + }); + }; + + function Plugin () { + global.add('visualchars', function (editor) { + var toggleState = Cell(false); + Commands.register(editor, toggleState); + register$1(editor, toggleState); + Keyboard.setup(editor, toggleState); + Bindings.setup(editor, toggleState); + return Api.get(toggleState); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('visualchars', function(editor) { - var self = this, state; - - function toggleVisualChars(addBookmark) { - var node, nodeList, i, body = editor.getBody(), nodeValue, selection = editor.selection, div, bookmark; - - state = !state; - self.state = state; - editor.fire('VisualChars', {state: state}); - - if (addBookmark) { - bookmark = selection.getBookmark(); - } - - if (state) { - nodeList = []; - tinymce.walk(body, function(n) { - if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) { - nodeList.push(n); - } - }, 'childNodes'); - - for (i = 0; i < nodeList.length; i++) { - nodeValue = nodeList[i].nodeValue; - nodeValue = nodeValue.replace(/(\u00a0)/g, '$1'); - - div = editor.dom.create('div', null, nodeValue); - while ((node = div.lastChild)) { - editor.dom.insertAfter(node, nodeList[i]); - } - - editor.dom.remove(nodeList[i]); - } - } else { - nodeList = editor.dom.select('span.mce-nbsp', body); - - for (i = nodeList.length - 1; i >= 0; i--) { - editor.dom.remove(nodeList[i], 1); - } - } - - selection.moveToBookmark(bookmark); - } - - function toggleActiveState() { - var self = this; - - editor.on('VisualChars', function(e) { - self.active(e.state); - }); - } - - editor.addCommand('mceVisualChars', toggleVisualChars); - - editor.addButton('visualchars', { - title: 'Show invisible characters', - cmd: 'mceVisualChars', - onPostRender: toggleActiveState - }); - - editor.addMenuItem('visualchars', { - text: 'Show invisible characters', - cmd: 'mceVisualChars', - onPostRender: toggleActiveState, - selectable: true, - context: 'view', - prependToContext: true - }); - - editor.on('beforegetcontent', function(e) { - if (state && e.format != 'raw' && !e.draft) { - state = true; - toggleVisualChars(false); - } - }); -}); +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.min.js index fc7e109..ac9b73d 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/visualchars/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("visualchars",function(e){function a(a){var t,s,i,r,c,d,l=e.getBody(),m=e.selection;if(n=!n,o.state=n,e.fire("VisualChars",{state:n}),a&&(d=m.getBookmark()),n)for(s=[],tinymce.walk(l,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&s.push(e)},"childNodes"),i=0;i$1
    '),c=e.dom.create("div",null,r);t=c.lastChild;)e.dom.insertAfter(t,s[i]);e.dom.remove(s[i])}else for(s=e.dom.select("span.mce-nbsp",l),i=s.length-1;i>=0;i--)e.dom.remove(s[i],1);m.moveToBookmark(d)}function t(){var a=this;e.on("VisualChars",function(e){a.active(e.state)})}var n,o=this;e.addCommand("mceVisualChars",a),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:t}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:t,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){n&&"raw"!=e.format&&!e.draft&&(n=!0,a(!1))})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(r){"use strict";function n(){}function u(n){return function(){return n}}function e(){return l}var t,o=function(n){function e(){return t}var t=n;return{get:e,set:function(n){t=n},clone:function(){return o(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return{isEnabled:function(){return n.get()}}},a=function(n,e){return n.fire("VisualChars",{state:e})},f=u(!1),s=u(!0),l=(t={fold:function(n,e){return n()},is:f,isSome:f,isNone:s,getOr:g,getOrThunk:m,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:g,orThunk:m,map:e,each:n,bind:e,exists:f,forall:s,filter:e,equals:d,equals_:d,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(t),t);function d(n){return n.isNone()}function m(n){return n()}function g(n){return n}function N(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}}function v(n,e){for(var t=0,r=n.length;t'+n+""},z=function(n,e){var t=[],r=function(n,e){for(var t=n.length,r=new Array(t),o=0;o]', + punctuation: punctuationStr + }; + var characterIndices = { + ALETTER: 0, + MIDNUMLET: 1, + MIDLETTER: 2, + MIDNUM: 3, + NUMERIC: 4, + CR: 5, + LF: 6, + NEWLINE: 7, + EXTEND: 8, + FORMAT: 9, + KATAKANA: 10, + EXTENDNUMLET: 11, + AT: 12, + OTHER: 13 + }; + var SETS = [ + new RegExp(regExps.aletter), + new RegExp(regExps.midnumlet), + new RegExp(regExps.midletter), + new RegExp(regExps.midnum), + new RegExp(regExps.numeric), + new RegExp(regExps.cr), + new RegExp(regExps.lf), + new RegExp(regExps.newline), + new RegExp(regExps.extend), + new RegExp(regExps.format), + new RegExp(regExps.katakana), + new RegExp(regExps.extendnumlet), + new RegExp('@') + ]; + var EMPTY_STRING = ''; + var PUNCTUATION = new RegExp('^' + regExps.punctuation + '$'); + var WHITESPACE = /^\s+$/; + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var from = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var SETS$1 = SETS; + var OTHER = characterIndices.OTHER; + var getType = function (char) { + var type = OTHER; + var setsLength = SETS$1.length; + for (var j = 0; j < setsLength; ++j) { + var set = SETS$1[j]; + if (set && set.test(char)) { + type = j; + break; + } + } + return type; + }; + var memoize = function (func) { + var cache = {}; + return function (char) { + if (cache[char]) { + return cache[char]; + } else { + var result = func(char); + cache[char] = result; + return result; + } + }; + }; + var classify = function (characters) { + var memoized = memoize(getType); + return map(characters, memoized); + }; + + var isWordBoundary = function (map, index) { + var prevType; + var type = map[index]; + var nextType = map[index + 1]; + var nextNextType; + if (index < 0 || index > map.length - 1 && index !== 0) { + return false; + } + if (type === characterIndices.ALETTER && nextType === characterIndices.ALETTER) { + return false; + } + nextNextType = map[index + 2]; + if (type === characterIndices.ALETTER && (nextType === characterIndices.MIDLETTER || nextType === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextNextType === characterIndices.ALETTER) { + return false; + } + prevType = map[index - 1]; + if ((type === characterIndices.MIDLETTER || type === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextType === characterIndices.ALETTER && prevType === characterIndices.ALETTER) { + return false; + } + if ((type === characterIndices.NUMERIC || type === characterIndices.ALETTER) && (nextType === characterIndices.NUMERIC || nextType === characterIndices.ALETTER)) { + return false; + } + if ((type === characterIndices.MIDNUM || type === characterIndices.MIDNUMLET) && nextType === characterIndices.NUMERIC && prevType === characterIndices.NUMERIC) { + return false; + } + if (type === characterIndices.NUMERIC && (nextType === characterIndices.MIDNUM || nextType === characterIndices.MIDNUMLET) && nextNextType === characterIndices.NUMERIC) { + return false; + } + if (type === characterIndices.EXTEND || type === characterIndices.FORMAT || prevType === characterIndices.EXTEND || prevType === characterIndices.FORMAT || nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT) { + return false; + } + if (type === characterIndices.CR && nextType === characterIndices.LF) { + return false; + } + if (type === characterIndices.NEWLINE || type === characterIndices.CR || type === characterIndices.LF) { + return true; + } + if (nextType === characterIndices.NEWLINE || nextType === characterIndices.CR || nextType === characterIndices.LF) { + return true; + } + if (type === characterIndices.KATAKANA && nextType === characterIndices.KATAKANA) { + return false; + } + if (nextType === characterIndices.EXTENDNUMLET && (type === characterIndices.ALETTER || type === characterIndices.NUMERIC || type === characterIndices.KATAKANA || type === characterIndices.EXTENDNUMLET)) { + return false; + } + if (type === characterIndices.EXTENDNUMLET && (nextType === characterIndices.ALETTER || nextType === characterIndices.NUMERIC || nextType === characterIndices.KATAKANA)) { + return false; + } + if (type === characterIndices.AT) { + return false; + } + return true; + }; + + var zeroWidth = '\uFEFF'; + + var EMPTY_STRING$1 = EMPTY_STRING; + var WHITESPACE$1 = WHITESPACE; + var PUNCTUATION$1 = PUNCTUATION; + var isProtocol = function (str) { + return str === 'http' || str === 'https'; + }; + var findWordEnd = function (characters, startIndex) { + var i; + for (i = startIndex; i < characters.length; i++) { + if (WHITESPACE$1.test(characters[i])) { + break; + } + } + return i; + }; + var findUrlEnd = function (characters, startIndex) { + var endIndex = findWordEnd(characters, startIndex + 1); + var peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING$1); + return peakedWord.substr(0, 3) === '://' ? endIndex : startIndex; + }; + var findWords = function (chars, sChars, characterMap, options) { + var words = []; + var word = []; + for (var i = 0; i < characterMap.length; ++i) { + word.push(chars[i]); + if (isWordBoundary(characterMap, i)) { + var ch = sChars[i]; + if ((options.includeWhitespace || !WHITESPACE$1.test(ch)) && (options.includePunctuation || !PUNCTUATION$1.test(ch))) { + var startOfWord = i - word.length + 1; + var endOfWord = i + 1; + var str = sChars.slice(startOfWord, endOfWord).join(EMPTY_STRING$1); + if (isProtocol(str)) { + var endOfUrl = findUrlEnd(sChars, i); + var url = chars.slice(endOfWord, endOfUrl); + Array.prototype.push.apply(word, url); + i = endOfUrl; + } + words.push(word); + } + word = []; + } + } + return words; + }; + var getDefaultOptions = function () { + return { + includeWhitespace: false, + includePunctuation: false + }; + }; + var getWords = function (chars, extract, options) { + options = __assign(__assign({}, getDefaultOptions()), options); + var filteredChars = []; + var extractedChars = []; + for (var i = 0; i < chars.length; i++) { + var ch = extract(chars[i]); + if (ch !== zeroWidth) { + filteredChars.push(chars[i]); + extractedChars.push(ch); + } + } + var characterMap = classify(extractedChars); + return findWords(filteredChars, extractedChars, characterMap, options); + }; + + var getWords$1 = getWords; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); + + var getText = function (node, schema) { + var blockElements = schema.getBlockElements(); + var shortEndedElements = schema.getShortEndedElements(); + var isNewline = function (node) { + return blockElements[node.nodeName] || shortEndedElements[node.nodeName]; + }; + var textBlocks = []; + var txt = ''; + var treeWalker = new global$1(node, node); + while (node = treeWalker.next()) { + if (node.nodeType === 3) { + txt += node.data; + } else if (isNewline(node) && txt.length) { + textBlocks.push(txt); + txt = ''; + } + } + if (txt.length) { + textBlocks.push(txt); + } + return textBlocks; + }; + + var strLen = function (str) { + return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; + }; + var countWords = function (node, schema) { + var text = getText(node, schema).join('\n'); + return getWords$1(text.split(''), identity).length; + }; + var countCharacters = function (node, schema) { + var text = getText(node, schema).join(''); + return strLen(text); + }; + var countCharactersWithoutSpaces = function (node, schema) { + var text = getText(node, schema).join('').replace(/\s/g, ''); + return strLen(text); + }; + + var createBodyCounter = function (editor, count) { + return function () { + return count(editor.getBody(), editor.schema); + }; + }; + var createSelectionCounter = function (editor, count) { + return function () { + return count(editor.selection.getRng().cloneContents(), editor.schema); + }; + }; + var createBodyWordCounter = function (editor) { + return createBodyCounter(editor, countWords); + }; + var get = function (editor) { + return { + body: { + getWordCount: createBodyWordCounter(editor), + getCharacterCount: createBodyCounter(editor, countCharacters), + getCharacterCountWithoutSpaces: createBodyCounter(editor, countCharactersWithoutSpaces) + }, + selection: { + getWordCount: createSelectionCounter(editor, countWords), + getCharacterCount: createSelectionCounter(editor, countCharacters), + getCharacterCountWithoutSpaces: createSelectionCounter(editor, countCharactersWithoutSpaces) + }, + getCount: createBodyWordCounter(editor) + }; + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var fireWordCountUpdate = function (editor, api) { + editor.fire('wordCountUpdate', { + wordCount: { + words: api.body.getWordCount(), + characters: api.body.getCharacterCount(), + charactersWithoutSpaces: api.body.getCharacterCountWithoutSpaces() + } + }); + }; + + var updateCount = function (editor, api) { + fireWordCountUpdate(editor, api); + }; + var setup = function (editor, api, delay) { + var debouncedUpdate = global$2.debounce(function () { + return updateCount(editor, api); + }, delay); + editor.on('init', function () { + updateCount(editor, api); + global$2.setEditorTimeout(editor, function () { + editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate); + }, 0); + }); + }; + + var open = function (editor, api) { + editor.windowManager.open({ + title: 'Word Count', + body: { + type: 'panel', + items: [{ + type: 'table', + header: [ + 'Count', + 'Document', + 'Selection' + ], + cells: [ + [ + 'Words', + String(api.body.getWordCount()), + String(api.selection.getWordCount()) + ], + [ + 'Characters (no spaces)', + String(api.body.getCharacterCountWithoutSpaces()), + String(api.selection.getCharacterCountWithoutSpaces()) + ], + [ + 'Characters', + String(api.body.getCharacterCount()), + String(api.selection.getCharacterCount()) + ] + ] + }] + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }] + }); + }; + + var register = function (editor, api) { + editor.ui.registry.addButton('wordcount', { + tooltip: 'Word count', + icon: 'character-count', + onAction: function () { + return open(editor, api); + } + }); + editor.ui.registry.addMenuItem('wordcount', { + text: 'Word count', + icon: 'character-count', + onAction: function () { + return open(editor, api); + } + }); + }; + + function Plugin (delay) { + if (delay === void 0) { + delay = 300; + } + global.add('wordcount', function (editor) { + var api = get(editor); + register(editor, api); + setup(editor, api, delay); + return api; + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('wordcount', function(editor) { - var self = this, countre, cleanre; - - // Included most unicode blocks see: http://en.wikipedia.org/wiki/Unicode_block - // Latin-1_Supplement letters, a-z, u2019 == ’ - countre = editor.getParam('wordcount_countregex', /[\w\u2019\x27\-\u00C0-\u1FFF]+/g); - cleanre = editor.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g); - - function update() { - editor.theme.panel.find('#wordcount').text(['Words: {0}', self.getCount()]); - } - - editor.on('init', function() { - var statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0]; - - if (statusbar) { - window.setTimeout(function() { - statusbar.insert({ - type: 'label', - name: 'wordcount', - text: ['Words: {0}', self.getCount()], - classes: 'wordcount', - disabled: editor.settings.readonly - }, 0); - - editor.on('setcontent beforeaddundo', update); - - editor.on('keyup', function(e) { - if (e.keyCode == 32) { - update(); - } - }); - }, 0); - } - }); - - self.getCount = function() { - var tx = editor.getContent({format: 'raw'}); - var tc = 0; - - if (tx) { - tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - - // deal with html entities - tx = tx.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i, "$1$3").replace(/&.+?;/g, ' '); - tx = tx.replace(cleanre, ''); // remove numbers and punctuation - - var wordArray = tx.match(countre); - if (wordArray) { - tc = wordArray.length; - } - } - - return tc; - }; -}); \ No newline at end of file +}()); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/wordcount/plugin.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/wordcount/plugin.min.js index 1fd1518..2a8824e 100644 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/wordcount/plugin.min.js +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/plugins/wordcount/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",a.getCount()])}var n,o,a=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),o=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&window.setTimeout(function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",a.getCount()],classes:"wordcount",disabled:e.settings.readonly},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),a.getCount=function(){var t=e.getContent({format:"raw"}),a=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),t=t.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),t=t.replace(o,"");var r=t.match(n);r&&(a=r.length)}return a}}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(){"use strict";function t(){}function n(t){return function(){return t}}function r(t){return t}function e(){return U}var o,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=n(!1),c=n(!0),a=function(){return(a=Object.assign||function(t){for(var n,e=1,r=arguments.length;eu.length-1&&0!==i||f===b&&s===b||(a=u[i+2],f===b&&(s===S||s===E||s===P)&&a===b||(c=u[i-1],(f===S||f===E||s===P)&&s===b&&c===b||!(f!==W&&f!==b||s!==W&&s!==b)||(f===x||f===E)&&s===W&&c===W||f===W&&(s===x||s===E)&&a===W||f===j||f===D||c===j||c===D||s===j||s===D||f===R&&s===O||f!==A&&f!==R&&f!==O&&s!==A&&s!==R&&s!==O&&(f===T&&s===T||s===k&&(f===b||f===W||f===T||f===k)||f===k&&(s===b||s===W||s===T)||f===P))))){var d=n[p];if((r.includeWhitespace||!ut.test(d))&&(r.includePunctuation||!it.test(d))){var h=p-g.length+1,y=p+1,C=n.slice(h,y).join("");if("http"===(o=C)||"https"===o){var v=I(n,p),w=t.slice(y,v);Array.prototype.push.apply(g,w),p=v}l.push(g)}g=[]}return l}(r,o,$(o),e)},at=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ft=tinymce.util.Tools.resolve("tinymce.util.Delay");!function st(e){void 0===e&&(e=300),u.add("wordcount",function(t){var n=function(t){return{body:{getWordCount:V(t),getCharacterCount:L(t,J),getCharacterCountWithoutSpaces:L(t,K)},selection:{getWordCount:Q(t,H),getCharacterCount:Q(t,J),getCharacterCountWithoutSpaces:Q(t,K)},getCount:V(t)}}(t);return function(t,n){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return Y(t,n)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return Y(t,n)}})}(t,n),function(t,n,e){var r=ft.debounce(function(){return X(t,n)},e);t.on("init",function(){X(t,n),ft.setEditorTimeout(t,function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)},0)})}(t,n,e),n})}()}(); \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/dark/content.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/dark/content.css new file mode 100644 index 0000000..10ce487 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/dark/content.css @@ -0,0 +1,59 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +body { + background-color: #2f3742; + color: #dfe0e4; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem; +} +a { + color: #4099ff; +} +table { + border-collapse: collapse; +} +table th, +table td { + border: 1px solid #6d737b; + padding: 0.4rem; +} +figure { + display: table; + margin: 1rem auto; +} +figure figcaption { + color: #8a8f97; + display: block; + margin-top: 0.25rem; + text-align: center; +} +hr { + border-color: #6d737b; + border-style: solid; + border-width: 1px 0 0 0; +} +code { + background-color: #6d737b; + border-radius: 3px; + padding: 0.1rem 0.2rem; +} +/* Make text in selected cells in tables dark and readable */ +td[data-mce-selected], +th[data-mce-selected] { + color: #333; +} +.mce-content-body:not([dir=rtl]) blockquote { + border-left: 2px solid #6d737b; + margin-left: 1.5rem; + padding-left: 1rem; +} +.mce-content-body[dir=rtl] blockquote { + border-right: 2px solid #6d737b; + margin-right: 1.5rem; + padding-right: 1rem; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/dark/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/dark/content.min.css new file mode 100644 index 0000000..545b265 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/dark/content.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table td,table th{border:1px solid #6d737b;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}td[data-mce-selected],th[data-mce-selected]{color:#333}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem} +/*# sourceMappingURL=content.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/default/content.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/default/content.css new file mode 100644 index 0000000..e57e839 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/default/content.css @@ -0,0 +1,49 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem; +} +table { + border-collapse: collapse; +} +table th, +table td { + border: 1px solid #ccc; + padding: 0.4rem; +} +figure { + display: table; + margin: 1rem auto; +} +figure figcaption { + color: #999; + display: block; + margin-top: 0.25rem; + text-align: center; +} +hr { + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; +} +code { + background-color: #e8e8e8; + border-radius: 3px; + padding: 0.1rem 0.2rem; +} +.mce-content-body:not([dir=rtl]) blockquote { + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; +} +.mce-content-body[dir=rtl] blockquote { + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/default/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/default/content.min.css new file mode 100644 index 0000000..9134641 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/default/content.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} +/*# sourceMappingURL=content.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/document/content.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/document/content.css new file mode 100644 index 0000000..5c5eb76 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/document/content.css @@ -0,0 +1,53 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +@media screen { + html { + background: #f4f4f4; + } +} +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; +} +@media screen { + body { + background-color: #fff; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.15); + box-sizing: border-box; + margin: 1rem auto 0; + max-width: 820px; + min-height: calc(100vh - 1rem); + padding: 4rem 6rem 6rem 6rem; + } +} +table { + border-collapse: collapse; +} +table th, +table td { + border: 1px solid #ccc; + padding: 0.4rem; +} +figure figcaption { + color: #999; + margin-top: 0.25rem; + text-align: center; +} +hr { + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; +} +.mce-content-body:not([dir=rtl]) blockquote { + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; +} +.mce-content-body[dir=rtl] blockquote { + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/document/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/document/content.min.css new file mode 100644 index 0000000..f28c378 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/document/content.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +@media screen{html{background:#f4f4f4}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} +/*# sourceMappingURL=content.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/writer/content.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/writer/content.css new file mode 100644 index 0000000..00ae0fb --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/writer/content.css @@ -0,0 +1,50 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem auto; + max-width: 900px; +} +table { + border-collapse: collapse; +} +table th, +table td { + border: 1px solid #ccc; + padding: 0.4rem; +} +figure { + display: table; + margin: 1rem auto; +} +figure figcaption { + color: #999; + display: block; + margin-top: 0.25rem; + text-align: center; +} +hr { + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; +} +code { + background-color: #e8e8e8; + border-radius: 3px; + padding: 0.1rem 0.2rem; +} +.mce-content-body:not([dir=rtl]) blockquote { + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; +} +.mce-content-body[dir=rtl] blockquote { + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/writer/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/writer/content.min.css new file mode 100644 index 0000000..549450d --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/content/writer/content.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} +/*# sourceMappingURL=content.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/content.inline.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/content.inline.min.css deleted file mode 100644 index 9f194f6..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/content.inline.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/content.min.css deleted file mode 100644 index ea08c68..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/content.min.css +++ /dev/null @@ -1 +0,0 @@ -body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0px}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/readme.md b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/readme.md deleted file mode 100644 index fa5d639..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/readme.md +++ /dev/null @@ -1 +0,0 @@ -Icons are generated and provided by the http://icomoon.io service. diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.eot b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.eot deleted file mode 100644 index 60e2d2e..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.eot and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.json b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.json deleted file mode 100644 index 32ca265..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.json +++ /dev/null @@ -1,1043 +0,0 @@ -{ - "IcoMoonType": "selection", - "icons": [ - { - "icon": { - "paths": [ - "M704 832v-37.004c151.348-61.628 256-193.82 256-346.996 0-212.078-200.576-384-448-384s-448 171.922-448 384c0 153.176 104.654 285.368 256 346.996v37.004h-192l-64-96v224h320v-222.812c-100.9-51.362-170.666-161.54-170.666-289.188 0-176.732 133.718-320 298.666-320 164.948 0 298.666 143.268 298.666 320 0 127.648-69.766 237.826-170.666 289.188v222.812h320v-224l-64 96h-192z" - ], - "defaultCode": 57376, - "grid": 0 - }, - "properties": { - "id": 0, - "order": 1, - "prevSize": 32, - "code": 57376, - "name": "charmap", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 0 - }, - { - "icon": { - "paths": [ - "M256 64v896l256-256 256 256v-896h-512zM704 789.49l-192-192-192 192v-661.49h384v661.49z" - ], - "defaultCode": 57363, - "grid": 0 - }, - "properties": { - "id": 1, - "order": 2, - "prevSize": 32, - "code": 57363, - "name": "bookmark", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 1 - }, - { - "icon": { - "paths": [ - "M927.274 230.216l-133.49-133.488c-21.104-21.104-49.232-32.728-79.198-32.728s-58.094 11.624-79.196 32.726l-165.492 165.49c-43.668 43.668-43.668 114.724 0 158.392l2.746 2.746 67.882-67.882-2.746-2.746c-6.132-6.132-6.132-16.494 0-22.626l165.492-165.492c4.010-4.008 8.808-4.608 11.312-4.608s7.302 0.598 11.312 4.61l133.49 133.488c6.132 6.134 6.132 16.498 0.002 22.628l-165.494 165.494c-4.008 4.008-8.806 4.608-11.31 4.608s-7.302-0.6-11.312-4.612l-2.746-2.746-67.88 67.884 2.742 2.742c21.106 21.108 49.23 32.728 79.2 32.728s58.094-11.624 79.196-32.726l165.494-165.492c43.662-43.666 43.662-114.72-0.004-158.39zM551.356 600.644l-67.882 67.882 2.746 2.746c4.008 4.008 4.61 8.806 4.61 11.31 0 2.506-0.598 7.302-4.606 11.314l-165.494 165.49c-4.010 4.010-8.81 4.61-11.314 4.61s-7.304-0.6-11.314-4.61l-133.492-133.486c-4.010-4.010-4.61-8.81-4.61-11.314s0.598-7.3 4.61-11.312l165.49-165.488c4.010-4.012 8.81-4.612 11.314-4.612s7.304 0.6 11.314 4.612l2.746 2.742 67.882-67.88-2.746-2.746c-21.104-21.104-49.23-32.726-79.196-32.726s-58.092 11.624-79.196 32.726l-165.488 165.486c-21.106 21.104-32.73 49.234-32.73 79.198s11.624 58.094 32.726 79.198l133.49 133.49c21.106 21.102 49.232 32.726 79.198 32.726s58.092-11.624 79.196-32.726l165.494-165.492c21.104-21.104 32.722-49.23 32.722-79.196s-11.624-58.094-32.726-79.196l-2.744-2.746zM800 838c-9.724 0-19.45-3.708-26.87-11.13l-128-127.998c-14.844-14.84-14.844-38.898 0-53.738 14.84-14.844 38.896-14.844 53.736 0l128 128c14.844 14.84 14.844 38.896 0 53.736-7.416 7.422-17.142 11.13-26.866 11.13zM608 960c-17.674 0-32-14.326-32-32v-128c0-17.674 14.326-32 32-32s32 14.326 32 32v128c0 17.674-14.326 32-32 32zM928 640h-128c-17.674 0-32-14.326-32-32s14.326-32 32-32h128c17.674 0 32 14.326 32 32s-14.326 32-32 32zM224 186c9.724 0 19.45 3.708 26.87 11.13l128 128c14.842 14.84 14.842 38.898 0 53.738-14.84 14.844-38.898 14.844-53.738 0l-128-128c-14.842-14.84-14.842-38.898 0-53.738 7.418-7.422 17.144-11.13 26.868-11.13zM416 64c17.674 0 32 14.326 32 32v128c0 17.674-14.326 32-32 32s-32-14.326-32-32v-128c0-17.674 14.326-32 32-32zM96 384h128c17.674 0 32 14.326 32 32s-14.326 32-32 32h-128c-17.674 0-32-14.326-32-32s14.326-32 32-32z" - ], - "defaultCode": 57362, - "grid": 0 - }, - "properties": { - "id": 2, - "order": 3, - "prevSize": 32, - "code": 57362, - "name": "link", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 2 - }, - { - "icon": { - "paths": [ - "M927.274 230.216l-133.49-133.488c-21.104-21.104-49.232-32.728-79.198-32.728s-58.094 11.624-79.196 32.726l-165.492 165.49c-43.668 43.668-43.668 114.724 0 158.392l2.746 2.746 67.882-67.882-2.746-2.746c-6.132-6.132-6.132-16.494 0-22.626l165.492-165.492c4.010-4.008 8.808-4.608 11.312-4.608s7.302 0.598 11.312 4.61l133.49 133.488c6.132 6.134 6.132 16.498 0.002 22.628l-165.494 165.494c-4.008 4.008-8.806 4.608-11.31 4.608s-7.302-0.6-11.312-4.612l-2.746-2.746-67.88 67.884 2.742 2.742c21.106 21.108 49.23 32.728 79.2 32.728s58.094-11.624 79.196-32.726l165.494-165.492c43.662-43.666 43.662-114.72-0.004-158.39zM551.356 600.644l-67.882 67.882 2.746 2.746c4.008 4.008 4.61 8.806 4.61 11.31 0 2.506-0.598 7.302-4.606 11.314l-165.494 165.49c-4.010 4.010-8.81 4.61-11.314 4.61s-7.304-0.6-11.314-4.61l-133.492-133.486c-4.010-4.010-4.61-8.81-4.61-11.314s0.598-7.3 4.61-11.312l165.49-165.488c4.010-4.012 8.81-4.612 11.314-4.612s7.304 0.6 11.314 4.612l2.746 2.742 67.882-67.88-2.746-2.746c-21.104-21.104-49.23-32.726-79.196-32.726s-58.092 11.624-79.196 32.726l-165.488 165.486c-21.106 21.104-32.73 49.234-32.73 79.198s11.624 58.094 32.726 79.198l133.49 133.49c21.106 21.102 49.232 32.726 79.198 32.726s58.092-11.624 79.196-32.726l165.494-165.492c21.104-21.104 32.722-49.23 32.722-79.196s-11.624-58.094-32.726-79.196l-2.744-2.746zM352 710c-9.724 0-19.45-3.71-26.87-11.128-14.84-14.84-14.84-38.898 0-53.738l320-320c14.84-14.84 38.896-14.84 53.736 0 14.844 14.84 14.844 38.9 0 53.74l-320 320c-7.416 7.416-17.142 11.126-26.866 11.126z" - ], - "defaultCode": 57361, - "grid": 0 - }, - "properties": { - "id": 3, - "order": 4, - "prevSize": 32, - "code": 57361, - "name": "unlink", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 3 - }, - { - "icon": { - "paths": [ - "M576 281.326v-217.326l336.002 336-336.002 336v-222.096c-390.906-9.17-315 247.096-256 446.096-288-320-212.092-690.874 256-678.674z" - ], - "defaultCode": 57360, - "grid": 0 - }, - "properties": { - "id": 4, - "order": 5, - "prevSize": 32, - "code": 57360, - "name": "redo", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 4 - }, - { - "icon": { - "paths": [ - "M704 960c59-199 134.906-455.266-256-446.096v222.096l-336.002-336 336.002-336v217.326c468.092-12.2 544 358.674 256 678.674z" - ], - "defaultCode": 57359, - "grid": 0 - }, - "properties": { - "id": 5, - "order": 6, - "prevSize": 32, - "code": 57359, - "name": "undo", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 5 - }, - { - "icon": { - "paths": [ - "M256.428 424.726c105.8 0 191.572 91.17 191.572 203.638 0 112.464-85.772 203.636-191.572 203.636-105.802 0-191.572-91.17-191.572-203.636l-0.856-29.092c0-224.93 171.54-407.272 383.144-407.272v116.364c-73.1 0-141.826 30.26-193.516 85.204-9.954 10.578-19.034 21.834-27.224 33.656 9.784-1.64 19.806-2.498 30.024-2.498zM768.428 424.726c105.8 0 191.572 91.17 191.572 203.638 0 112.464-85.772 203.636-191.572 203.636-105.802 0-191.572-91.17-191.572-203.636l-0.856-29.092c0-224.93 171.54-407.272 383.144-407.272v116.364c-73.1 0-141.826 30.26-193.516 85.204-9.956 10.578-19.036 21.834-27.224 33.656 9.784-1.64 19.806-2.498 30.024-2.498z" - ], - "defaultCode": 57358, - "grid": 0 - }, - "properties": { - "id": 6, - "order": 7, - "prevSize": 32, - "code": 57358, - "name": "blockquote", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 6 - }, - { - "icon": { - "paths": [ - "M64 192h896v128h-896zM384 576h576v128h-576zM384 384h576v128h-576zM64 768h896v128h-896zM64 384l224 160-224 160z" - ], - "defaultCode": 57356, - "grid": 0 - }, - "properties": { - "id": 7, - "order": 8, - "prevSize": 32, - "code": 57356, - "name": "indent", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 7 - }, - { - "icon": { - "paths": [ - "M64 192h896v128h-896zM64 576h576v128h-576zM64 384h576v128h-576zM64 768h896v128h-896zM960 384l-224 160 224 160z" - ], - "defaultCode": 57357, - "grid": 0 - }, - "properties": { - "id": 8, - "order": 9, - "prevSize": 32, - "code": 57357, - "name": "outdent", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 8 - }, - { - "icon": { - "paths": [ - "M384 128h576v128h-576zM384 448h576v128h-576zM384 768h576v128h-576zM320 530v-146h-64v-320h-128v64h64v256h-64v64h128v50l-128 60v146h128v64h-128v64h128v64h-128v64h192v-320h-128v-50z" - ], - "defaultCode": 57355, - "grid": 0 - }, - "properties": { - "id": 9, - "order": 10, - "prevSize": 32, - "code": 57355, - "name": "numlist", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 9 - }, - { - "icon": { - "paths": [ - "M384 128h576v128h-576zM384 448h576v128h-576zM384 768h576v128h-576zM128 192c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM128 512c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM128 832c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64z" - ], - "defaultCode": 57354, - "grid": 0 - }, - "properties": { - "id": 10, - "order": 11, - "prevSize": 32, - "code": 57354, - "name": "bullist", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 10 - }, - { - "icon": { - "paths": [ - "M888 384h-56v-256h64v-64h-320v64h64v256h-256v-256h64v-64h-320v64h64v256h-56c-39.6 0-72 32.4-72 72v432c0 39.6 32.4 72 72 72h240c39.6 0 72-32.4 72-72v-312h128v312c0 39.6 32.4 72 72 72h240c39.6 0 72-32.4 72-72v-432c0-39.6-32.4-72-72-72zM348 896h-184c-19.8 0-36-14.4-36-32s16.2-32 36-32h184c19.8 0 36 14.4 36 32s-16.2 32-36 32zM544 512h-64c-17.6 0-32-14.4-32-32s14.4-32 32-32h64c17.6 0 32 14.4 32 32s-14.4 32-32 32zM860 896h-184c-19.8 0-36-14.4-36-32s16.2-32 36-32h184c19.8 0 36 14.4 36 32s-16.2 32-36 32z" - ], - "defaultCode": 57353, - "grid": 0 - }, - "properties": { - "id": 11, - "order": 12, - "prevSize": 32, - "code": 57353, - "name": "searchreplace", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 11 - }, - { - "icon": { - "paths": [ - "M704 384v-160c0-17.6-14.4-32-32-32h-160v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-160c-17.602 0-32 14.4-32 32v512c0 17.6 14.398 32 32 32h224v192h384l192-192v-384h-192zM320 128.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 320v-64h384v64h-384zM704 869.49v-101.49h101.49l-101.49 101.49zM832 704h-192v192h-256v-448h448v256z" - ], - "defaultCode": 57352, - "grid": 0 - }, - "properties": { - "id": 12, - "order": 13, - "prevSize": 32, - "code": 57352, - "name": "paste", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 12 - }, - { - "icon": { - "paths": [ - "M832 320h-192v-64l-192-192h-384v704h384v192h576v-448l-192-192zM832 410.51l101.49 101.49h-101.49v-101.49zM448 154.51l101.49 101.49h-101.49v-101.49zM128 128h256v192h192v384h-448v-576zM960 896h-448v-128h128v-384h128v192h192v320z" - ], - "defaultCode": 57393, - "grid": 0 - }, - "properties": { - "id": 13, - "order": 14, - "prevSize": 32, - "code": 57393, - "name": "copy", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 13 - }, - { - "icon": { - "paths": [ - "M960 512h-265.876c-50.078-35.42-114.43-54.86-182.124-54.86-89.206 0-164.572-50.242-164.572-109.712 0-59.47 75.366-109.714 164.572-109.714 75.058 0 140.308 35.576 159.12 82.286h113.016c-7.93-50.644-37.58-97.968-84.058-132.826-50.88-38.16-117.676-59.174-188.078-59.174-70.404 0-137.196 21.014-188.074 59.174-54.788 41.090-86.212 99.502-86.212 160.254s31.424 119.164 86.212 160.254c1.956 1.466 3.942 2.898 5.946 4.316h-265.872v64h512.532c58.208 17.106 100.042 56.27 100.042 100.572 0 59.468-75.368 109.71-164.572 109.71-75.060 0-140.308-35.574-159.118-82.286h-113.016c7.93 50.64 37.582 97.968 84.060 132.826 50.876 38.164 117.668 59.18 188.072 59.18 70.402 0 137.198-21.016 188.074-59.174 54.79-41.090 86.208-99.502 86.208-160.254 0-35.298-10.654-69.792-30.294-100.572h204.012v-64z" - ], - "defaultCode": 57389, - "grid": 0 - }, - "properties": { - "id": 19, - "order": 15, - "prevSize": 32, - "code": 57389, - "name": "strikethrough", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 19 - }, - { - "icon": { - "paths": [ - "M192 832h576v64h-576v-64zM640 128v384c0 31.312-14.7 61.624-41.39 85.352-30.942 27.502-73.068 42.648-118.61 42.648-45.544 0-87.668-15.146-118.608-42.648-26.692-23.728-41.392-54.040-41.392-85.352v-384h-128v384c0 141.382 128.942 256 288 256s288-114.618 288-256v-384h-128z" - ], - "defaultCode": 57388, - "grid": 0 - }, - "properties": { - "id": 20, - "order": 16, - "prevSize": 32, - "code": 57388, - "name": "underline", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 20 - }, - { - "icon": { - "paths": [ - "M832 128v64h-144l-256 640h144v64h-448v-64h144l256-640h-144v-64h448z" - ], - "defaultCode": 57387, - "grid": 0 - }, - "properties": { - "id": 21, - "order": 17, - "prevSize": 32, - "code": 57387, - "name": "italic", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 21 - }, - { - "icon": { - "paths": [ - "M625.442 494.182c48.074-38.15 78.558-94.856 78.558-158.182 0-114.876-100.29-208-224-208h-224v768h288c123.712 0 224-93.124 224-208 0-88.196-59.118-163.562-142.558-193.818zM384 304c0-26.51 21.49-48 48-48h67.204c42.414 0 76.796 42.98 76.796 96s-34.382 96-76.796 96h-115.204v-144zM547.2 768h-115.2c-26.51 0-48-21.49-48-48v-144h163.2c42.418 0 76.8 42.98 76.8 96s-34.382 96-76.8 96z" - ], - "defaultCode": 57386, - "grid": 0 - }, - "properties": { - "id": 22, - "order": 18, - "prevSize": 32, - "code": 57386, - "name": "bold", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 22 - }, - { - "icon": { - "paths": [ - "M850.746 242.746l-133.492-133.49c-24.888-24.892-74.054-45.256-109.254-45.256h-416c-35.2 0-64 28.8-64 64v768c0 35.2 28.8 64 64 64h640c35.2 0 64-28.8 64-64v-544c0-35.2-20.366-84.364-45.254-109.254zM805.49 287.998c6.792 6.796 13.792 19.162 18.894 32.002h-184.384v-184.386c12.84 5.1 25.204 12.1 32 18.896l133.49 133.488zM831.884 896h-639.77c-0.040-0.034-0.082-0.076-0.114-0.116v-767.77c0.034-0.040 0.076-0.082 0.114-0.114h383.886v256h256v511.884c-0.034 0.040-0.076 0.082-0.116 0.116z" - ], - "defaultCode": 57345, - "grid": 0 - }, - "properties": { - "id": 23, - "order": 19, - "prevSize": 32, - "code": 57345, - "name": "newdocument", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 23 - }, - { - "icon": { - "paths": [ - "M960 880v-591.938l-223.938-224.062h-592.062c-44.182 0-80 35.816-80 80v736c0 44.184 35.818 80 80 80h736c44.184 0 80-35.816 80-80zM576 192h64v192h-64v-192zM704 832h-384v-255.882c0.034-0.042 0.076-0.082 0.116-0.118h383.77c0.040 0.036 0.082 0.076 0.116 0.118l-0.002 255.882zM832 832h-64v-256c0-35.2-28.8-64-64-64h-384c-35.2 0-64 28.8-64 64v256h-64v-640h64v192c0 35.2 28.8 64 64 64h320c35.2 0 64-28.8 64-64v-171.010l128 128.072v490.938z" - ], - "defaultCode": 57344, - "grid": 0 - }, - "properties": { - "id": 24, - "order": 20, - "prevSize": 32, - "code": 57344, - "name": "save", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 24 - }, - { - "icon": { - "paths": [ - "M64 192v704h896v-704h-896zM384 640v-128h256v128h-256zM640 704v128h-256v-128h256zM640 320v128h-256v-128h256zM320 320v128h-192v-128h192zM128 512h192v128h-192v-128zM704 512h192v128h-192v-128zM704 448v-128h192v128h-192zM128 704h192v128h-192v-128zM704 832v-128h192v128h-192z" - ], - "defaultCode": 57371, - "grid": 0 - }, - "properties": { - "id": 25, - "order": 21, - "prevSize": 32, - "code": 57371, - "name": "table", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 25 - }, - { - "icon": { - "paths": [ - "M512 140c99.366 0 192.782 38.694 263.042 108.956s108.958 163.678 108.958 263.044-38.696 192.782-108.958 263.042-163.676 108.958-263.042 108.958-192.782-38.696-263.044-108.958-108.956-163.676-108.956-263.042 38.694-192.782 108.956-263.044 163.678-108.956 263.044-108.956zM512 64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448v0zM320 384c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM576 384c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64-35.346 0-64 28.654-64 64zM512 656c-101.84 0-192.56-36.874-251.166-94.328 23.126 117.608 126.778 206.328 251.166 206.328 124.388 0 228.040-88.72 251.168-206.328-58.608 57.454-149.328 94.328-251.168 94.328z" - ], - "defaultCode": 57377, - "grid": 0 - }, - "properties": { - "id": 26, - "order": 22, - "prevSize": 32, - "code": 57377, - "name": "emoticons", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 26 - }, - { - "icon": { - "paths": [ - "M480 384l-192-192 128-128h-352v352l128-128 192 192zM640 480l192-192 128 128v-352h-352l128 128-192 192zM544 640l192 192-128 128h352v-352l-128 128-192-192zM384 544l-192 192-128-128v352h352l-128-128 192-192z" - ], - "defaultCode": 57379, - "grid": 0 - }, - "properties": { - "id": 27, - "order": 23, - "prevSize": 32, - "code": 57379, - "name": "fullscreen", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 27 - }, - { - "icon": { - "paths": [ - "M64 448h896v128h-896z" - ], - "defaultCode": 57372, - "grid": 0 - }, - "properties": { - "id": 28, - "order": 24, - "prevSize": 32, - "code": 57372, - "name": "hr", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 28 - }, - { - "icon": { - "paths": [ - "M64 768h512v128h-512v-128zM768 192h-220.558l-183.766 512h-132.288l183.762-512h-223.15v-128h576v128zM929.774 896l-129.774-129.774-129.774 129.774-62.226-62.226 129.774-129.774-129.774-129.774 62.226-62.226 129.774 129.774 129.774-129.774 62.226 62.226-129.774 129.774 129.774 129.774-62.226 62.226z" - ], - "defaultCode": 57373, - "grid": 0 - }, - "properties": { - "id": 29, - "order": 25, - "prevSize": 32, - "code": 57373, - "name": "removefromat", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 29 - }, - { - "icon": { - "paths": [ - "M256 128h512v128h-512v-128zM896 320h-768c-35.2 0-64 28.8-64 64v256c0 35.2 28.796 64 64 64h128v192h512v-192h128c35.2 0 64-28.8 64-64v-256c0-35.2-28.8-64-64-64zM704 832h-384v-256h384v256zM910.4 416c0 25.626-20.774 46.4-46.398 46.4s-46.402-20.774-46.402-46.4 20.778-46.4 46.402-46.4c25.626 0 46.398 20.774 46.398 46.4z" - ], - "defaultCode": 57378, - "grid": 0 - }, - "properties": { - "id": 30, - "order": 26, - "prevSize": 32, - "code": 57378, - "name": "print", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 30 - }, - { - "icon": { - "paths": [ - "M384 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448z" - ], - "defaultCode": 57390, - "grid": 0 - }, - "properties": { - "id": 31, - "order": 27, - "prevSize": 32, - "code": 57390, - "name": "visualchars", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 31 - }, - { - "icon": { - "paths": [ - "M448 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448zM64 896l224-192-224-192z" - ], - "defaultCode": 57391, - "grid": 0 - }, - "properties": { - "id": 32, - "order": 28, - "prevSize": 32, - "code": 57391, - "name": "ltr", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 32 - }, - { - "icon": { - "paths": [ - "M416 704l-192-192 192-192-64-64-256 256 256 256zM672 256l-64 64 192 192-192 192 64 64 256-256z" - ], - "defaultCode": 57367, - "grid": 0 - }, - "properties": { - "id": 38, - "order": 29, - "prevSize": 32, - "code": 57367, - "name": "code", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 38 - }, - { - "icon": { - "paths": [ - "M448 704h128v128h-128v-128zM704 256c35.346 0 64 28.654 64 64v166l-228 154h-92v-64l192-128v-64h-320v-128h384zM512 64c-119.666 0-232.166 46.6-316.784 131.216-84.614 84.618-131.216 197.118-131.216 316.784 0 119.664 46.602 232.168 131.216 316.784 84.618 84.616 197.118 131.216 316.784 131.216 119.664 0 232.168-46.6 316.784-131.216 84.616-84.616 131.216-197.12 131.216-316.784 0-119.666-46.6-232.166-131.216-316.784-84.616-84.616-197.12-131.216-316.784-131.216z" - ], - "defaultCode": 57366, - "grid": 0 - }, - "properties": { - "id": 39, - "order": 30, - "prevSize": 32, - "code": 57366, - "name": "help", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 39 - }, - { - "icon": { - "paths": [ - "M896 128h-768c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64v-640c0-35.2-28.8-64-64-64zM896 831.884c-0.012 0.014-0.030 0.028-0.042 0.042l-191.958-319.926-160 128-224-288-191.968 479.916c-0.010-0.010-0.022-0.022-0.032-0.032v-639.77c0.034-0.040 0.076-0.082 0.114-0.114h767.77c0.040 0.034 0.082 0.076 0.116 0.116v639.768zM640 352c0 53.019 42.981 96 96 96s96-42.981 96-96c0-53.019-42.981-96-96-96-53.019 0-96 42.981-96 96z" - ], - "defaultCode": 57364, - "grid": 0 - }, - "properties": { - "id": 40, - "order": 31, - "prevSize": 32, - "code": 57364, - "name": "image", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 40 - }, - { - "icon": { - "paths": [ - "M896 128h-768c-35.2 0-64 28.8-64 64v640c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64v-640c0-35.2-28.8-64-64-64zM256 832h-128v-128h128v128zM256 576h-128v-128h128v128zM256 320h-128v-128h128v128zM704 832h-384v-640h384v640zM896 832h-128v-128h128v128zM896 576h-128v-128h128v128zM896 320h-128v-128h128v128zM384 320v384l288-192z" - ], - "defaultCode": 57365, - "grid": 0 - }, - "properties": { - "id": 41, - "order": 32, - "prevSize": 32, - "code": 57365, - "name": "media", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 41 - }, - { - "icon": { - "paths": [ - "M77.798 304.624l81.414 50.882c50.802-81.114 128.788-143.454 221.208-174.246l-30.366-91.094c-113.748 37.898-209.728 114.626-272.256 214.458zM673.946 90.166l-30.366 91.094c92.422 30.792 170.404 93.132 221.208 174.248l81.412-50.882c-62.526-99.834-158.506-176.562-272.254-214.46zM607.974 704.008c-4.808 0-9.692-1.090-14.286-3.386l-145.688-72.844v-211.778c0-17.672 14.328-32 32-32s32 14.328 32 32v172.222l110.31 55.156c15.806 7.902 22.214 27.124 14.31 42.932-5.604 11.214-16.908 17.696-28.646 17.698zM512 192c-212.078 0-384 171.922-384 384s171.922 384 384 384c212.078 0 384-171.922 384-384 0-212.078-171.922-384-384-384zM512 864c-159.058 0-288-128.942-288-288s128.942-288 288-288c159.058 0 288 128.942 288 288 0 159.058-128.942 288-288 288z" - ], - "defaultCode": 57368, - "grid": 0 - }, - "properties": { - "id": 42, - "order": 33, - "prevSize": 32, - "code": 57368, - "name": "insertdatetime", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 42 - }, - { - "icon": { - "paths": [ - "M64 455.746c45.318-49.92 97.162-92.36 153.272-125.124 90.332-52.744 192.246-80.622 294.728-80.622 102.48 0 204.396 27.878 294.726 80.624 56.112 32.764 107.956 75.204 153.274 125.124v-117.432c-33.010-28.118-68.124-53.14-104.868-74.594-105.006-61.314-223.658-93.722-343.132-93.722s-238.128 32.408-343.134 93.72c-36.742 21.454-71.856 46.478-104.866 74.596v117.43zM512 320c-183.196 0-345.838 100.556-448 256 102.162 155.448 264.804 256 448 256 183.196 0 345.838-100.552 448-256-102.162-155.444-264.804-256-448-256zM512 512c0 35.346-28.654 64-64 64s-64-28.654-64-64c0-35.348 28.654-64 64-64s64 28.652 64 64zM728.066 696.662c-67.434 39.374-140.128 59.338-216.066 59.338s-148.632-19.964-216.066-59.338c-51.554-30.104-98.616-71.31-138.114-120.662 39.498-49.35 86.56-90.558 138.116-120.66 13.276-7.752 26.758-14.74 40.426-20.982-10.512 23.742-16.362 50.008-16.362 77.642 0 106.040 85.962 192 192 192 106.040 0 192-85.96 192-192 0-27.634-5.85-53.9-16.36-77.642 13.668 6.244 27.15 13.23 40.426 20.982 51.554 30.102 98.616 71.31 138.116 120.66-39.498 49.352-86.56 90.558-138.116 120.662z" - ], - "defaultCode": 57369, - "grid": 0 - }, - "properties": { - "id": 43, - "order": 34, - "prevSize": 32, - "code": 57369, - "name": "preview", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 43 - }, - { - "icon": { - "paths": [ - "M651.168 283.834c-24.612-81.962-28.876-91.834-107.168-91.834h-64c-79.618 0-82.664 10.152-108.418 96 0 0.002 0 0.002-0.002 0.004l-143.998 479.996h113.636l57.6-192h226.366l57.6 192h113.63l-145.246-484.166zM437.218 448l38.4-136c10.086-33.618 36.38-30 36.38-30s26.294-3.618 36.38 30h0.004l38.4 136h-149.564z" - ], - "defaultCode": 57370, - "grid": 0 - }, - "properties": { - "id": 44, - "order": 35, - "prevSize": 32, - "code": 57370, - "name": "forecolor", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 44 - }, - { - "icon": { - "paths": [ - "M576 64c247.424 0 448 200.576 448 448s-200.576 448-448 448v-96c94.024 0 182.418-36.614 248.902-103.098 66.484-66.484 103.098-154.878 103.098-248.902 0-94.022-36.614-182.418-103.098-248.902-66.484-66.484-154.878-103.098-248.902-103.098-94.022 0-182.418 36.614-248.902 103.098-51.14 51.138-84.582 115.246-97.306 184.902h186.208l-224 256-224-256h164.57c31.060-217.102 217.738-384 443.43-384zM768 448v128h-256v-320h128v192z" - ], - "defaultCode": 57384, - "grid": 0 - }, - "properties": { - "id": 45, - "order": 36, - "prevSize": 32, - "code": 57384, - "name": "restoredraft", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 45 - }, - { - "icon": { - "paths": [ - "M1024 592.458v-160.916l-159.144-15.914c-8.186-30.042-20.088-58.548-35.21-84.98l104.596-127.838-113.052-113.050-127.836 104.596c-26.434-15.124-54.942-27.026-84.982-35.208l-15.914-159.148h-160.916l-15.914 159.146c-30.042 8.186-58.548 20.086-84.98 35.208l-127.838-104.594-113.050 113.050 104.596 127.836c-15.124 26.432-27.026 54.94-35.21 84.98l-159.146 15.916v160.916l159.146 15.914c8.186 30.042 20.086 58.548 35.21 84.982l-104.596 127.836 113.048 113.048 127.838-104.596c26.432 15.124 54.94 27.028 84.98 35.21l15.916 159.148h160.916l15.914-159.144c30.042-8.186 58.548-20.088 84.982-35.21l127.836 104.596 113.048-113.048-104.596-127.836c15.124-26.434 27.028-54.942 35.21-84.98l159.148-15.92zM704 576l-128 128h-128l-128-128v-128l128-128h128l128 128v128z" - ], - "defaultCode": 57346, - "grid": 0 - }, - "properties": { - "id": 46, - "order": 37, - "prevSize": 32, - "code": 57346, - "name": "fullpage", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 46 - }, - { - "icon": { - "paths": [ - "M768 206v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" - ], - "defaultCode": 57375, - "grid": 0 - }, - "properties": { - "id": 47, - "order": 38, - "prevSize": 32, - "code": 57375, - "name": "superscript", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 47 - }, - { - "icon": { - "paths": [ - "M768 910v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" - ], - "defaultCode": 57374, - "grid": 0 - }, - "properties": { - "id": 48, - "order": 39, - "prevSize": 32, - "code": 57374, - "name": "subscript", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 48 - }, - { - "icon": { - "paths": [ - "M704 384v-160c0-17.6-14.4-32-32-32h-160v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-160c-17.602 0-32 14.4-32 32v512c0 17.6 14.398 32 32 32h224v192h576v-576h-192zM320 128.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 320v-64h384v64h-384zM832 896h-448v-448h448v448zM448 512v128h32l32-64h64v192h-48v64h160v-64h-48v-192h64l32 64h32v-128z" - ], - "tags": [ - "pastetext" - ], - "defaultCode": 57397, - "grid": 0 - }, - "properties": { - "id": 49, - "order": 40, - "prevSize": 32, - "code": 57397, - "name": "pastetext", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 49 - }, - { - "icon": { - "paths": [ - "M768 256h64v64h-64zM640 384h64v64h-64zM640 512h64v64h-64zM640 640h64v64h-64zM512 512h64v64h-64zM512 640h64v64h-64zM384 640h64v64h-64zM768 384h64v64h-64zM768 512h64v64h-64zM768 640h64v64h-64zM768 768h64v64h-64zM640 768h64v64h-64zM512 768h64v64h-64zM384 768h64v64h-64zM256 768h64v64h-64z" - ], - "tags": [ - "resize", - "dots" - ], - "defaultCode": 57394, - "grid": 0 - }, - "properties": { - "id": 50, - "order": 41, - "prevSize": 32, - "code": 57394, - "name": "resize", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 50 - }, - { - "icon": { - "paths": [ - "M928 128h-416l-32-64h-352l-64 128h896zM840.34 704h87.66l32-448h-896l64 640h356.080c-104.882-37.776-180.080-138.266-180.080-256 0-149.982 122.018-272 272-272 149.98 0 272 122.018 272 272 0 21.678-2.622 43.15-7.66 64zM874.996 849.75l-134.496-110.692c17.454-28.922 27.5-62.814 27.5-99.058 0-106.040-85.96-192-192-192s-192 85.96-192 192 85.96 192 192 192c36.244 0 70.138-10.046 99.058-27.5l110.692 134.496c22.962 26.678 62.118 28.14 87.006 3.252l5.492-5.492c24.888-24.888 23.426-64.044-3.252-87.006zM576 764c-68.484 0-124-55.516-124-124s55.516-124 124-124 124 55.516 124 124-55.516 124-124 124z" - ], - "tags": [ - "browse" - ], - "defaultCode": 57396, - "grid": 0 - }, - "properties": { - "id": 51, - "order": 42, - "prevSize": 32, - "code": 57396, - "name": "browse", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 51 - }, - { - "icon": { - "paths": [ - "M864.408 670.132c-46.47-46.47-106.938-68.004-161.082-62.806l-63.326-63.326 192-192c0 0 128-128 0-256l-320 320-320-320c-128 128 0 256 0 256l192 192-63.326 63.326c-54.144-5.198-114.61 16.338-161.080 62.806-74.98 74.98-85.112 186.418-22.626 248.9 62.482 62.482 173.92 52.354 248.9-22.626 46.47-46.468 68.002-106.938 62.806-161.080l63.326-63.326 63.328 63.328c-5.196 54.144 16.336 114.61 62.806 161.078 74.978 74.98 186.418 85.112 248.898 22.626 62.488-62.482 52.356-173.918-22.624-248.9zM353.124 758.578c-2.212 24.332-15.020 49.826-35.14 69.946-22.212 22.214-51.080 35.476-77.218 35.476-10.524 0-25.298-2.228-35.916-12.848-21.406-21.404-17.376-73.132 22.626-113.136 22.212-22.214 51.080-35.476 77.218-35.476 10.524 0 25.298 2.228 35.916 12.848 13.112 13.11 13.47 32.688 12.514 43.19zM512 608c-35.346 0-64-28.654-64-64s28.654-64 64-64 64 28.654 64 64-28.654 64-64 64zM819.152 851.152c-10.62 10.62-25.392 12.848-35.916 12.848-26.138 0-55.006-13.262-77.218-35.476-20.122-20.12-32.928-45.614-35.138-69.946-0.958-10.502-0.6-30.080 12.514-43.192 10.618-10.622 25.39-12.848 35.916-12.848 26.136 0 55.006 13.262 77.216 35.474 40.004 40.008 44.032 91.736 22.626 113.14z" - ], - "defaultCode": 57351, - "grid": 0 - }, - "properties": { - "id": 14, - "order": 43, - "prevSize": 32, - "code": 57351, - "name": "cut", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 14 - }, - { - "icon": { - "paths": [ - "M64 192h896v128h-896zM64 576h896v128h-896zM64 384h896v128h-896zM64 768h896v128h-896z" - ], - "defaultCode": 57350, - "grid": 0 - }, - "properties": { - "id": 15, - "order": 44, - "prevSize": 32, - "code": 57350, - "name": "alignjustify", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 15 - }, - { - "icon": { - "paths": [ - "M64 192h896v128h-896zM64 576h896v128h-896zM256 384h512v128h-512zM256 768h512v128h-512z" - ], - "defaultCode": 57348, - "grid": 0 - }, - "properties": { - "id": 16, - "order": 45, - "prevSize": 32, - "code": 57348, - "name": "aligncenter", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 16 - }, - { - "icon": { - "paths": [ - "M64 192h896v128h-896zM64 576h896v128h-896zM384 384h576v128h-576zM384 768h576v128h-576z" - ], - "defaultCode": 57349, - "grid": 0 - }, - "properties": { - "id": 17, - "order": 46, - "prevSize": 32, - "code": 57349, - "name": "alignright", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 17 - }, - { - "icon": { - "paths": [ - "M64 192h896v128h-896zM64 576h896v128h-896zM64 384h576v128h-576zM64 768h576v128h-576z" - ], - "defaultCode": 57347, - "grid": 0 - }, - "properties": { - "id": 18, - "order": 47, - "prevSize": 32, - "code": 57347, - "name": "alignleft", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 18 - }, - { - "icon": { - "paths": [ - "M320 128c-123.712 0-224 100.288-224 224s100.288 224 224 224v320h128v-640h64v640h128v-640h128v-128h-448zM960 512l-224 192 224 192z" - ], - "defaultCode": 57392, - "grid": 0 - }, - "properties": { - "id": 33, - "order": 48, - "prevSize": 32, - "code": 57392, - "name": "rtl", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 33 - }, - { - "icon": { - "paths": [ - "M512 384h128v64h-128zM512 768h128v64h-128zM576 576h128v64h-128zM768 576v192h-64v64h128v-256zM384 576h128v64h-128zM320 768h128v64h-128zM320 384h128v64h-128zM192 192v256h64v-192h64v-64zM704 448h128v-256h-64v192h-64zM64 64v896h896v-896h-896zM896 896h-768v-768h768v768zM192 576v256h64v-192h64v-64zM576 192h128v64h-128zM384 192h128v64h-128z" - ], - "defaultCode": 57382, - "grid": 0 - }, - "properties": { - "id": 34, - "order": 49, - "prevSize": 32, - "code": 57382, - "name": "template", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 34 - }, - { - "icon": { - "paths": [ - "M816 64l16 384h-640l16-384h32l16 320h512l16-320h32zM208 960l-16-320h640l-16 320h-32l-16-256h-512l-16 256h-32zM64 512h128v64h-128zM256 512h128v64h-128zM448 512h128v64h-128zM640 512h128v64h-128zM832 512h128v64h-128z" - ], - "defaultCode": 57383, - "grid": 0 - }, - "properties": { - "id": 35, - "order": 50, - "prevSize": 32, - "code": 57383, - "name": "pagebreak", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 35 - }, - { - "icon": { - "paths": [ - "M960 128v-64h-192c-35.202 0-64 28.8-64 64v320c0 15.856 5.858 30.402 15.496 41.614l-303.496 260.386-142-148-82 70 224 288 416-448h128v-64h-192v-320h192zM256 512h64v-384c0-35.2-28.8-64-64-64h-128c-35.2 0-64 28.8-64 64v384h64v-192h128v192zM128 256v-128h128v128h-128zM640 448v-96c0-35.2-8.8-64-44-64 35.2 0 44-28.8 44-64v-96c0-35.2-28.8-64-64-64h-192v448h192c35.2 0 64-28.8 64-64zM448 128h128v128h-128v-128zM448 320h128v128h-128v-128z" - ], - "defaultCode": 57380, - "grid": 0 - }, - "properties": { - "id": 36, - "order": 51, - "prevSize": 32, - "code": 57380, - "name": "spellcheck", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 36 - }, - { - "icon": { - "paths": [ - "M448 512h-128v-128h128v-128h128v128h128v128h-128v128h-128v-128zM960 576v320h-896v-320h128v192h640v-192h128z" - ], - "defaultCode": 57381, - "grid": 0 - }, - "properties": { - "id": 37, - "order": 52, - "prevSize": 32, - "code": 57381, - "name": "nonbreaking", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 37 - } - ], - "height": 1024, - "metadata": { - "name": "tinymce-small" - }, - "preferences": { - "fontPref": { - "prefix": "icon-", - "metadata": { - "fontFamily": "tinymce-small", - "majorVersion": 1, - "minorVersion": 0 - }, - "showGlyphs": true, - "metrics": { - "emSize": 512, - "baseline": 6.25, - "whitespace": 50 - }, - "resetPoint": 58880, - "showQuickUse": true, - "quickUsageToken": false, - "showMetrics": true, - "showMetadata": false - }, - "imagePref": { - "color": 0, - "height": 32, - "columns": 16, - "margin": 16, - "png": false, - "sprites": true - }, - "historySize": 100, - "showCodes": true, - "gridSize": 16, - "showLiga": false, - "showGrid": true, - "showGlyphs": true, - "showQuickUse": true - } -} \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.svg b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.svg deleted file mode 100644 index 930c48d..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.ttf b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.ttf deleted file mode 100644 index afc6ec4..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.ttf and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.woff b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.woff deleted file mode 100644 index fa72c74..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce-small.woff and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.eot b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.eot deleted file mode 100644 index c1085bf..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.eot and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.json b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.json deleted file mode 100644 index c0b9916..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.json +++ /dev/null @@ -1,1191 +0,0 @@ -{ - "IcoMoonType": "selection", - "icons": [ - { - "icon": { - "paths": [ - "M928 128h-416l-32-64h-352l-64 128h896zM904.34 704h74.86l44.8-448h-1024l64 640h484.080c-104.882-37.776-180.080-138.266-180.080-256 0-149.982 122.018-272 272-272 149.98 0 272 122.018 272 272 0 21.678-2.622 43.15-7.66 64zM1002.996 913.75l-198.496-174.692c17.454-28.92 27.5-62.814 27.5-99.058 0-106.040-85.96-192-192-192s-192 85.96-192 192 85.96 192 192 192c36.244 0 70.138-10.046 99.058-27.5l174.692 198.496c22.962 26.678 62.118 28.14 87.006 3.252l5.492-5.492c24.888-24.888 23.426-64.044-3.252-87.006zM640 764c-68.484 0-124-55.516-124-124s55.516-124 124-124 124 55.516 124 124-55.516 124-124 124z" - ], - "defaultCode": 57396, - "grid": 0 - }, - "properties": { - "id": 0, - "order": 1, - "prevSize": 32, - "code": 57396, - "name": "browse", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 0 - }, - { - "icon": { - "paths": [ - "M768 256h64v64h-64zM640 384h64v64h-64zM640 512h64v64h-64zM640 640h64v64h-64zM512 512h64v64h-64zM512 640h64v64h-64zM384 640h64v64h-64zM768 384h64v64h-64zM768 512h64v64h-64zM768 640h64v64h-64zM768 768h64v64h-64zM640 768h64v64h-64zM512 768h64v64h-64zM384 768h64v64h-64zM256 768h64v64h-64z" - ], - "tags": [ - "resize", - "dots" - ], - "defaultCode": 57394, - "grid": 0 - }, - "properties": { - "id": 1, - "order": 2, - "prevSize": 32, - "code": 57394, - "name": "resize", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 1 - }, - { - "icon": { - "paths": [ - "M832 256h-192v-64l-192-192h-448v768h384v256h640v-576l-192-192zM832 346.51l101.49 101.49h-101.49v-101.49zM448 90.51l101.49 101.49h-101.49v-101.49zM64 64h320v192h192v448h-512v-640zM960 960h-512v-192h192v-448h128v192h192v448z" - ], - "tags": [ - "copy" - ], - "defaultCode": 57393, - "grid": 0 - }, - "properties": { - "id": 2, - "order": 3, - "prevSize": 32, - "code": 57393, - "name": "copy", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 2 - }, - { - "icon": { - "paths": [ - "M256 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM960 896l-256-224 256-224z" - ], - "tags": [ - "rtl" - ], - "defaultCode": 57392, - "grid": 0 - }, - "properties": { - "id": 3, - "order": 4, - "prevSize": 32, - "code": 57392, - "name": "rtl", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 3 - }, - { - "icon": { - "paths": [ - "M448 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM64 448l256 224-256 224z" - ], - "tags": [ - "ltr" - ], - "defaultCode": 57391, - "grid": 0 - }, - "properties": { - "id": 4, - "order": 5, - "prevSize": 32, - "code": 57391, - "name": "ltr", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 4 - }, - { - "icon": { - "paths": [ - "M384 64h512v128h-128v768h-128v-768h-128v768h-128v-448c-123.712 0-224-100.288-224-224s100.288-224 224-224z" - ], - "tags": [ - "visualchars" - ], - "defaultCode": 57390, - "grid": 0 - }, - "properties": { - "id": 5, - "order": 6, - "prevSize": 32, - "code": 57390, - "name": "visualchars", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 5 - }, - { - "icon": { - "paths": [ - "M731.42 517.036c63.92 47.938 100.58 116.086 100.58 186.964s-36.66 139.026-100.58 186.964c-59.358 44.518-137.284 69.036-219.42 69.036-82.138 0-160.062-24.518-219.42-69.036-63.92-47.938-100.58-116.086-100.58-186.964h128c0 69.382 87.926 128 192 128 104.074 0 192-58.618 192-128 0-69.382-87.926-128-192-128-82.138 0-160.062-24.518-219.42-69.036-63.92-47.94-100.58-116.086-100.58-186.964 0-70.878 36.66-139.024 100.58-186.964 59.358-44.518 137.282-69.036 219.42-69.036 82.136 0 160.062 24.518 219.42 69.036 63.92 47.94 100.58 116.086 100.58 186.964h-128c0-69.382-87.926-128-192-128-104.074 0-192 58.618-192 128 0 69.382 87.926 128 192 128 82.136 0 160.062 24.518 219.42 69.036zM0 512h1024v64h-1024z" - ], - "tags": [ - "strikethrough" - ], - "defaultCode": 57389, - "grid": 0 - }, - "properties": { - "id": 6, - "order": 7, - "prevSize": 32, - "code": 57389, - "name": "strikethrough", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 6 - }, - { - "icon": { - "paths": [ - "M704 64h128v416c0 159.058-143.268 288-320 288-176.73 0-320-128.942-320-288v-416h128v416c0 40.166 18.238 78.704 51.354 108.506 36.896 33.204 86.846 51.494 140.646 51.494 53.8 0 103.75-18.29 140.646-51.494 33.116-29.802 51.354-68.34 51.354-108.506v-416zM192 832h640v128h-640z" - ], - "tags": [ - "underline" - ], - "defaultCode": 57388, - "grid": 0 - }, - "properties": { - "id": 7, - "order": 8, - "prevSize": 32, - "code": 57388, - "name": "underline", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 7 - }, - { - "icon": { - "paths": [ - "M896 64v64h-128l-320 768h128v64h-448v-64h128l320-768h-128v-64z" - ], - "tags": [ - "italic" - ], - "defaultCode": 57387, - "grid": 0 - }, - "properties": { - "id": 8, - "order": 9, - "prevSize": 32, - "code": 57387, - "name": "italic", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 8 - }, - { - "icon": { - "paths": [ - "M707.88 484.652c37.498-44.542 60.12-102.008 60.12-164.652 0-141.16-114.842-256-256-256h-320v896h384c141.158 0 256-114.842 256-256 0-92.956-49.798-174.496-124.12-219.348zM384 192h101.5c55.968 0 101.5 57.42 101.5 128s-45.532 128-101.5 128h-101.5v-256zM543 832h-159v-256h159c58.45 0 106 57.42 106 128s-47.55 128-106 128z" - ], - "tags": [ - "bold0" - ], - "defaultCode": 57386, - "grid": 0 - }, - "properties": { - "id": 9, - "order": 10, - "prevSize": 32, - "code": 57386, - "name": "bold", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 9 - }, - { - "icon": { - "paths": [ - "M576 64c247.424 0 448 200.576 448 448s-200.576 448-448 448v-96c94.024 0 182.418-36.614 248.902-103.098 66.484-66.484 103.098-154.878 103.098-248.902 0-94.022-36.614-182.418-103.098-248.902-66.484-66.484-154.878-103.098-248.902-103.098-94.022 0-182.418 36.614-248.902 103.098-51.14 51.138-84.582 115.246-97.306 184.902h186.208l-224 256-224-256h164.57c31.060-217.102 217.738-384 443.43-384zM768 448v128h-256v-320h128v192z" - ], - "tags": [ - "restoredraft" - ], - "defaultCode": 57384, - "grid": 0 - }, - "properties": { - "id": 11, - "order": 11, - "prevSize": 32, - "code": 57384, - "name": "restoredraft", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 11 - }, - { - "icon": { - "paths": [ - "M0 512h128v64h-128zM192 512h192v64h-192zM448 512h128v64h-128zM640 512h192v64h-192zM896 512h128v64h-128zM880 0l16 448h-768l16-448h32l16 384h640l16-384zM144 1024l-16-384h768l-16 384h-32l-16-320h-640l-16 320z" - ], - "tags": [ - "pagebreak" - ], - "defaultCode": 57383, - "grid": 0 - }, - "properties": { - "id": 12, - "order": 12, - "prevSize": 32, - "code": 57383, - "name": "pagebreak", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 12 - }, - { - "icon": { - "paths": [ - "M384 192h128v64h-128zM576 192h128v64h-128zM896 192v256h-192v-64h128v-128h-64v-64zM320 384h128v64h-128zM512 384h128v64h-128zM192 256v128h64v64h-128v-256h192v64zM384 576h128v64h-128zM576 576h128v64h-128zM896 576v256h-192v-64h128v-128h-64v-64zM320 768h128v64h-128zM512 768h128v64h-128zM192 640v128h64v64h-128v-256h192v64zM960 64h-896v896h896v-896zM1024 0v0 1024h-1024v-1024h1024z" - ], - "tags": [ - "template" - ], - "defaultCode": 57382, - "grid": 0 - }, - "properties": { - "id": 13, - "order": 13, - "prevSize": 32, - "code": 57382, - "name": "template", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 13 - }, - { - "icon": { - "paths": [ - "M448 576h-192v-128h192v-192h128v192h192v128h-192v192h-128zM1024 640v384h-1024v-384h128v256h768v-256z" - ], - "tags": [ - "nonbreaking" - ], - "defaultCode": 57381, - "grid": 0 - }, - "properties": { - "id": 14, - "order": 14, - "prevSize": 32, - "code": 57381, - "name": "nonbreaking", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 14 - }, - { - "icon": { - "paths": [ - "M128 256h128v192h64v-384c0-35.2-28.8-64-64-64h-128c-35.2 0-64 28.8-64 64v384h64v-192zM128 64h128v128h-128v-128zM960 64v-64h-192c-35.202 0-64 28.8-64 64v320c0 35.2 28.798 64 64 64h192v-64h-192v-320h192zM640 160v-96c0-35.2-28.8-64-64-64h-192v448h192c35.2 0 64-28.8 64-64v-96c0-35.2-8.8-64-44-64 35.2 0 44-28.8 44-64zM576 384h-128v-128h128v128zM576 192h-128v-128h128v128zM832 576l-416 448-224-288 82-70 142 148 352-302z" - ], - "tags": [ - "spellchecker" - ], - "defaultCode": 57380, - "grid": 0 - }, - "properties": { - "id": 15, - "order": 15, - "prevSize": 32, - "code": 57380, - "name": "spellchecker", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 15 - }, - { - "icon": { - "paths": [ - "M704 896h256l64-128v256h-384v-214.214c131.112-56.484 224-197.162 224-361.786 0-214.432-157.598-382.266-352-382.266-194.406 0-352 167.832-352 382.266 0 164.624 92.886 305.302 224 361.786v214.214h-384v-256l64 128h256v-32.59c-187.63-66.46-320-227.402-320-415.41 0-247.424 229.23-448 512-448 282.77 0 512 200.576 512 448 0 188.008-132.37 348.95-320 415.41v32.59z" - ], - "tags": [ - "charmap" - ], - "defaultCode": 57376, - "grid": 0 - }, - "properties": { - "id": 19, - "order": 16, - "prevSize": 32, - "code": 57376, - "name": "charmap", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 19 - }, - { - "icon": { - "paths": [ - "M768 206v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" - ], - "tags": [ - "sup" - ], - "defaultCode": 57375, - "grid": 0 - }, - "properties": { - "id": 20, - "order": 17, - "prevSize": 32, - "code": 57375, - "name": "sup", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 20 - }, - { - "icon": { - "paths": [ - "M768 910v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM676 256h-136l-188 188-188-188h-136l256 256-256 256h136l188-188 188 188h136l-256-256z" - ], - "tags": [ - "sub" - ], - "defaultCode": 57374, - "grid": 0 - }, - "properties": { - "id": 21, - "order": 18, - "prevSize": 32, - "code": 57374, - "name": "sub", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 21 - }, - { - "icon": { - "paths": [ - "M0 896h576v128h-576zM192 0h704v128h-704zM277.388 832l204.688-784.164 123.85 32.328-196.25 751.836zM929.774 1024l-129.774-129.774-129.774 129.774-62.226-62.226 129.774-129.774-129.774-129.774 62.226-62.226 129.774 129.774 129.774-129.774 62.226 62.226-129.774 129.774 129.774 129.774z" - ], - "tags": [ - "removeformat" - ], - "defaultCode": 57373, - "grid": 0 - }, - "properties": { - "id": 22, - "order": 19, - "prevSize": 32, - "code": 57373, - "name": "removeformat", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 22 - }, - { - "icon": { - "paths": [ - "M0 448h1024v128h-1024z" - ], - "tags": [ - "hr" - ], - "defaultCode": 57372, - "grid": 0 - }, - "properties": { - "id": 23, - "order": 20, - "prevSize": 32, - "code": 57372, - "name": "hr", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 23 - }, - { - "icon": { - "paths": [ - "M0 64v896h1024v-896h-1024zM384 640v-192h256v192h-256zM640 704v192h-256v-192h256zM640 192v192h-256v-192h256zM320 192v192h-256v-192h256zM64 448h256v192h-256v-192zM704 448h256v192h-256v-192zM704 384v-192h256v192h-256zM64 704h256v192h-256v-192zM704 896v-192h256v192h-256z" - ], - "tags": [ - "table" - ], - "defaultCode": 57371, - "grid": 0 - }, - "properties": { - "id": 24, - "order": 21, - "prevSize": 32, - "code": 57371, - "name": "table", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 24 - }, - { - "icon": { - "paths": [ - "M322.018 832l57.6-192h264.764l57.6 192h113.632l-191.996-640h-223.236l-192 640h113.636zM475.618 320h72.764l57.6 192h-187.964l57.6-192z" - ], - "tags": [ - "forecolor" - ], - "defaultCode": 57370, - "grid": 0 - }, - "properties": { - "id": 25, - "order": 22, - "prevSize": 32, - "code": 57370, - "name": "forecolor", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 25 - }, - { - "icon": { - "paths": [ - "M512 320c-209.368 0-395.244 100.556-512 256 116.756 155.446 302.632 256 512 256 209.368 0 395.244-100.554 512-256-116.756-155.444-302.632-256-512-256zM448 448c35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64 28.654-64 64-64zM773.616 705.296c-39.648 20.258-81.652 35.862-124.846 46.376-44.488 10.836-90.502 16.328-136.77 16.328-46.266 0-92.282-5.492-136.768-16.324-43.194-10.518-85.198-26.122-124.846-46.376-63.020-32.202-120.222-76.41-167.64-129.298 47.418-52.888 104.62-97.1 167.64-129.298 32.336-16.522 66.242-29.946 101.082-40.040-19.888 30.242-31.468 66.434-31.468 105.336 0 106.040 85.962 192 192 192 106.038 0 192-85.96 192-192 0-38.902-11.582-75.094-31.466-105.34 34.838 10.096 68.744 23.52 101.082 40.042 63.022 32.198 120.218 76.408 167.638 129.298-47.42 52.886-104.618 97.1-167.638 129.296zM860.918 243.722c-108.72-55.554-226.112-83.722-348.918-83.722-122.806 0-240.198 28.168-348.918 83.722-58.772 30.032-113.732 67.904-163.082 112.076v109.206c55.338-58.566 120.694-107.754 192.194-144.29 99.62-50.904 207.218-76.714 319.806-76.714s220.186 25.81 319.804 76.716c71.502 36.536 136.858 85.724 192.196 144.29v-109.206c-49.35-44.174-104.308-82.046-163.082-112.078z" - ], - "tags": [ - "preview" - ], - "defaultCode": 57369, - "grid": 0 - }, - "properties": { - "id": 26, - "order": 23, - "prevSize": 32, - "code": 57369, - "name": "preview", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 26 - }, - { - "icon": { - "paths": [ - "M512 192c-212.076 0-384 171.922-384 384s171.922 384 384 384c212.074 0 384-171.922 384-384s-171.926-384-384-384zM715.644 779.646c-54.392 54.396-126.716 84.354-203.644 84.354s-149.25-29.958-203.646-84.354c-54.396-54.394-84.354-126.718-84.354-203.646s29.958-149.25 84.354-203.646c54.396-54.396 126.718-84.354 203.646-84.354s149.252 29.958 203.642 84.354c54.402 54.396 84.358 126.718 84.358 203.646s-29.958 149.252-84.356 203.646zM325.93 203.862l-42.94-85.878c-98.874 49.536-179.47 130.132-229.006 229.008l85.876 42.94c40.248-80.336 105.732-145.822 186.070-186.070zM884.134 389.93l85.878-42.938c-49.532-98.876-130.126-179.472-229.004-229.008l-42.944 85.878c80.338 40.248 145.824 105.732 186.070 186.068zM512 384h-64v192c0 10.11 4.7 19.11 12.022 24.972l-0.012 0.016 160 128 39.976-49.976-147.986-118.39v-176.622z" - ], - "tags": [ - "inserttime" - ], - "defaultCode": 57368, - "grid": 0 - }, - "properties": { - "id": 27, - "order": 24, - "prevSize": 32, - "code": 57368, - "name": "inserttime", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 27 - }, - { - "icon": { - "paths": [ - "M320 256l-256 256 256 256h128l-256-256 256-256zM704 256h-128l256 256-256 256h128l256-256z" - ], - "tags": [ - "code" - ], - "defaultCode": 57367, - "grid": 0 - }, - "properties": { - "id": 28, - "order": 25, - "prevSize": 32, - "code": 57367, - "name": "code", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 28 - }, - { - "icon": { - "paths": [ - "M448 704h128v128h-128zM704 256c35.346 0 64 28.654 64 64v192l-192 128h-128v-64l192-128v-64h-320v-128h384zM512 96c-111.118 0-215.584 43.272-294.156 121.844s-121.844 183.038-121.844 294.156c0 111.118 43.272 215.584 121.844 294.156 78.572 78.572 183.038 121.844 294.156 121.844 111.118 0 215.584-43.272 294.156-121.844 78.572-78.572 121.844-183.038 121.844-294.156 0-111.118-43.272-215.584-121.844-294.156-78.572-78.572-183.038-121.844-294.156-121.844zM512 0v0c282.77 0 512 229.23 512 512s-229.23 512-512 512c-282.77 0-512-229.23-512-512 0-282.77 229.23-512 512-512z" - ], - "tags": [ - "help" - ], - "defaultCode": 57366, - "grid": 0 - }, - "properties": { - "id": 29, - "order": 26, - "prevSize": 32, - "code": 57366, - "name": "help", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 29 - }, - { - "icon": { - "paths": [ - "M0 128v768h1024v-768h-1024zM192 832h-128v-128h128v128zM192 576h-128v-128h128v128zM192 320h-128v-128h128v128zM768 832h-512v-640h512v640zM960 832h-128v-128h128v128zM960 576h-128v-128h128v128zM960 320h-128v-128h128v128zM384 320v384l256-192z" - ], - "tags": [ - "media" - ], - "defaultCode": 57365, - "grid": 0 - }, - "properties": { - "id": 30, - "order": 27, - "prevSize": 32, - "code": 57365, - "name": "media", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 30 - }, - { - "icon": { - "paths": [ - "M0 128v832h1024v-832h-1024zM960 896h-896v-704h896v704zM704 352c0-53.019 42.981-96 96-96s96 42.981 96 96c0 53.019-42.981 96-96 96-53.019 0-96-42.981-96-96zM896 832h-768l192-512 256 320 128-96z" - ], - "tags": [ - "image" - ], - "defaultCode": 57364, - "grid": 0 - }, - "properties": { - "id": 31, - "order": 28, - "prevSize": 32, - "code": 57364, - "name": "image", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 31 - }, - { - "icon": { - "paths": [ - "M192 0v1024l320-320 320 320v-1024h-640zM768 869.49l-256-256-256 256v-805.49h512v805.49z" - ], - "tags": [ - "anchor" - ], - "defaultCode": 57363, - "grid": 0 - }, - "properties": { - "id": 32, - "order": 29, - "prevSize": 32, - "code": 57363, - "name": "anchor", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 32 - }, - { - "icon": { - "paths": [ - "M476.888 675.114c4.56 9.048 6.99 19.158 6.99 29.696 0 17.616-6.744 34.058-18.992 46.308l-163.38 163.38c-12.248 12.248-28.696 18.992-46.308 18.992s-34.060-6.744-46.308-18.992l-99.38-99.38c-12.248-12.25-18.992-28.696-18.992-46.308s6.744-34.060 18.992-46.308l163.38-163.382c12.248-12.246 28.696-18.992 46.308-18.992 10.538 0 20.644 2.43 29.696 6.988l65.338-65.336c-27.87-21.41-61.44-32.16-95.034-32.16-39.986 0-79.972 15.166-110.308 45.502l-163.38 163.382c-60.67 60.67-60.67 159.95 0 220.618l99.38 99.382c30.334 30.332 70.32 45.5 110.306 45.5 39.988 0 79.974-15.168 110.308-45.502l163.38-163.38c55.82-55.82 60.238-144.298 13.344-205.346l-65.34 65.338zM978.496 144.884l-99.38-99.382c-30.334-30.336-70.32-45.502-110.308-45.502-39.986 0-79.97 15.166-110.306 45.502l-163.382 163.382c-55.82 55.82-60.238 144.298-13.342 205.342l65.338-65.34c-4.558-9.050-6.988-19.16-6.988-29.694 0-17.616 6.744-34.060 18.992-46.308l163.382-163.382c12.246-12.248 28.694-18.994 46.306-18.994 17.616 0 34.060 6.746 46.308 18.994l99.38 99.382c12.248 12.248 18.992 28.694 18.992 46.308s-6.744 34.060-18.992 46.308l-163.38 163.382c-12.248 12.248-28.694 18.992-46.308 18.992-10.536 0-20.644-2.43-29.696-6.99l-65.338 65.338c27.872 21.41 61.44 32.16 95.034 32.16 39.988 0 79.974-15.168 110.308-45.504l163.38-163.38c60.672-60.666 60.672-159.944 0-220.614zM233.368 278.624l-191.994-191.994 45.256-45.256 191.994 191.994zM384 0h64v192h-64zM0 384h192v64h-192zM790.632 745.376l191.996 191.996-45.256 45.256-191.996-191.996zM576 832h64v192h-64zM832 576h192v64h-192z" - ], - "tags": [ - "unlink" - ], - "defaultCode": 57362, - "grid": 0 - }, - "properties": { - "id": 33, - "order": 30, - "prevSize": 32, - "code": 57362, - "name": "unlink", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 33 - }, - { - "icon": { - "paths": [ - "M320 704c17.6 17.6 47.274 16.726 65.942-1.942l316.118-316.116c18.668-18.668 19.54-48.342 1.94-65.942s-47.274-16.726-65.942 1.942l-316.116 316.116c-18.668 18.668-19.542 48.342-1.942 65.942zM476.888 675.112c4.56 9.050 6.99 19.16 6.99 29.696 0 17.616-6.744 34.060-18.992 46.308l-163.382 163.382c-12.248 12.248-28.694 18.992-46.308 18.992s-34.060-6.744-46.308-18.992l-99.382-99.382c-12.248-12.248-18.992-28.694-18.992-46.308s6.744-34.060 18.992-46.308l163.382-163.382c12.248-12.248 28.694-18.994 46.308-18.994 10.536 0 20.644 2.43 29.696 6.99l65.338-65.338c-27.87-21.41-61.44-32.16-95.034-32.16-39.986 0-79.972 15.166-110.308 45.502l-163.382 163.382c-60.67 60.67-60.67 159.948 0 220.618l99.382 99.382c30.334 30.332 70.32 45.5 110.306 45.5 39.988 0 79.974-15.168 110.308-45.502l163.382-163.382c55.82-55.82 60.238-144.298 13.344-205.344l-65.34 65.34zM978.498 144.884l-99.382-99.382c-30.334-30.336-70.32-45.502-110.308-45.502-39.986 0-79.972 15.166-110.308 45.502l-163.382 163.382c-55.82 55.82-60.238 144.298-13.342 205.342l65.338-65.34c-4.558-9.050-6.988-19.16-6.988-29.694 0-17.616 6.744-34.060 18.992-46.308l163.382-163.382c12.248-12.248 28.694-18.994 46.308-18.994s34.060 6.746 46.308 18.994l99.382 99.382c12.248 12.248 18.992 28.694 18.992 46.308s-6.744 34.060-18.992 46.308l-163.382 163.382c-12.248 12.248-28.694 18.992-46.308 18.992-10.536 0-20.644-2.43-29.696-6.99l-65.338 65.338c27.872 21.41 61.44 32.16 95.034 32.16 39.988 0 79.974-15.168 110.308-45.502l163.382-163.382c60.67-60.666 60.67-159.944 0-220.614z" - ], - "tags": [ - "link" - ], - "defaultCode": 57361, - "grid": 0 - }, - "properties": { - "id": 34, - "order": 31, - "prevSize": 32, - "code": 57361, - "name": "link", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 34 - }, - { - "icon": { - "paths": [ - "M0 64h1024v128h-1024zM384 256h640v128h-640zM384 448h640v128h-640zM384 640h640v128h-640zM0 832h1024v128h-1024zM256 320v384l-256-192z" - ], - "tags": [ - "outdent" - ], - "defaultCode": 57357, - "grid": 0 - }, - "properties": { - "id": 38, - "order": 32, - "prevSize": 32, - "code": 57357, - "name": "outdent", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 38 - }, - { - "icon": { - "paths": [ - "M0 64h1024v128h-1024zM384 256h640v128h-640zM384 448h640v128h-640zM384 640h640v128h-640zM0 832h1024v128h-1024zM0 704v-384l256 192z" - ], - "tags": [ - "indent" - ], - "defaultCode": 57356, - "grid": 0 - }, - "properties": { - "id": 39, - "order": 33, - "prevSize": 32, - "code": 57356, - "name": "indent", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 39 - }, - { - "icon": { - "paths": [ - "M384 832h640v128h-640zM384 448h640v128h-640zM384 64h640v128h-640zM192 0v256h-64v-192h-64v-64zM128 526v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM256 704v320h-192v-64h128v-64h-128v-64h128v-64h-128v-64z" - ], - "tags": [ - "numlist" - ], - "defaultCode": 57355, - "grid": 0 - }, - "properties": { - "id": 40, - "order": 34, - "prevSize": 32, - "code": 57355, - "name": "numlist", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 40 - }, - { - "icon": { - "paths": [ - "M384 64h640v128h-640v-128zM384 448h640v128h-640v-128zM384 832h640v128h-640v-128zM0 128c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 512c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 896c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128z" - ], - "tags": [ - "bullist" - ], - "defaultCode": 57354, - "grid": 0 - }, - "properties": { - "id": 41, - "order": 35, - "prevSize": 32, - "code": 57354, - "name": "bullist", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 41 - }, - { - "icon": { - "paths": [ - "M64 0h384v64h-384zM576 0h384v64h-384zM952 320h-56v-256h-256v256h-256v-256h-256v256h-56c-39.6 0-72 32.4-72 72v560c0 39.6 32.4 72 72 72h304c39.6 0 72-32.4 72-72v-376h128v376c0 39.6 32.4 72 72 72h304c39.6 0 72-32.4 72-72v-560c0-39.6-32.4-72-72-72zM348 960h-248c-19.8 0-36-14.4-36-32s16.2-32 36-32h248c19.8 0 36 14.4 36 32s-16.2 32-36 32zM544 512h-64c-17.6 0-32-14.4-32-32s14.4-32 32-32h64c17.6 0 32 14.4 32 32s-14.4 32-32 32zM924 960h-248c-19.8 0-36-14.4-36-32s16.2-32 36-32h248c19.8 0 36 14.4 36 32s-16.2 32-36 32z" - ], - "tags": [ - "searchreplace" - ], - "defaultCode": 57353, - "grid": 0 - }, - "properties": { - "id": 42, - "order": 36, - "prevSize": 32, - "code": 57353, - "name": "searchreplace", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 42 - }, - { - "icon": { - "paths": [ - "M832 320v-160c0-17.6-14.4-32-32-32h-224v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-224c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h448l192-192v-512h-192zM384 64.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 256v-64h512v64h-512zM832 933.49v-101.49h101.49l-101.49 101.49zM960 768h-192v192h-320v-576h512v384z" - ], - "tags": [ - "paste" - ], - "defaultCode": 57352, - "grid": 0 - }, - "properties": { - "id": 43, - "order": 37, - "prevSize": 32, - "code": 57352, - "name": "paste", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 43 - }, - { - "icon": { - "paths": [ - "M890.774 709.154c-45.654-45.556-103.728-69.072-157.946-69.072h-29.112l-63.904-64.008 255.62-256.038c63.904-64.010 63.904-192.028 0-256.038l-383.43 384.056-383.432-384.054c-63.904 64.008-63.904 192.028 0 256.038l255.622 256.034-63.906 64.008h-29.114c-54.22 0-112.292 23.518-157.948 69.076-81.622 81.442-92.65 202.484-24.63 270.35 29.97 29.902 70.288 44.494 112.996 44.494 54.216 0 112.29-23.514 157.946-69.072 53.584-53.464 76.742-124 67.084-185.348l65.384-65.488 65.376 65.488c-9.656 61.348 13.506 131.882 67.084 185.348 45.662 45.558 103.732 69.072 157.948 69.072 42.708 0 83.024-14.592 112.994-44.496 68.020-67.866 56.988-188.908-24.632-270.35zM353.024 845.538c-7.698 17.882-19.010 34.346-33.626 48.926-14.636 14.604-31.172 25.918-49.148 33.624-16.132 6.916-32.96 10.568-48.662 10.568-15.146 0-36.612-3.402-52.862-19.612-16.136-16.104-19.52-37.318-19.52-52.288 0-15.542 3.642-32.21 10.526-48.212 7.7-17.884 19.014-34.346 33.626-48.926 14.634-14.606 31.172-25.914 49.15-33.624 16.134-6.914 32.96-10.568 48.664-10.568 15.146 0 36.612 3.4 52.858 19.614 16.134 16.098 19.522 37.316 19.522 52.284 0.002 15.542-3.638 32.216-10.528 48.214zM512.004 666.596c-49.914 0-90.376-40.532-90.376-90.526 0-49.992 40.462-90.52 90.376-90.52s90.372 40.528 90.372 90.52c0 49.998-40.46 90.526-90.372 90.526zM855.272 919.042c-16.248 16.208-37.712 19.612-52.86 19.612-15.704 0-32.53-3.652-48.666-10.568-17.972-7.706-34.508-19.020-49.142-33.624-14.614-14.58-25.926-31.042-33.626-48.926-6.886-15.998-10.526-32.672-10.526-48.212 0-14.966 3.384-36.188 19.52-52.286 16.246-16.208 37.712-19.614 52.86-19.614 15.7 0 32.53 3.654 48.66 10.568 17.978 7.708 34.516 19.018 49.15 33.624 14.61 14.58 25.924 31.042 33.626 48.926 6.884 15.998 10.526 32.67 10.526 48.212-0.002 14.97-3.39 36.186-19.522 52.288z" - ], - "tags": [ - "cut" - ], - "defaultCode": 57351, - "grid": 0 - }, - "properties": { - "id": 44, - "order": 38, - "prevSize": 32, - "code": 57351, - "name": "cut", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 44 - }, - { - "icon": { - "paths": [ - "M0 64h1024v128h-1024zM0 256h1024v128h-1024zM0 448h1024v128h-1024zM0 640h1024v128h-1024zM0 832h1024v128h-1024z" - ], - "tags": [ - "alignjustify" - ], - "defaultCode": 57350, - "grid": 0 - }, - "properties": { - "id": 45, - "order": 39, - "prevSize": 32, - "code": 57350, - "name": "alignjustify", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 45 - }, - { - "icon": { - "paths": [ - "M0 64h1024v128h-1024zM384 256h640v128h-640zM384 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z" - ], - "tags": [ - "alignright" - ], - "defaultCode": 57349, - "grid": 0 - }, - "properties": { - "id": 46, - "order": 40, - "prevSize": 32, - "code": 57349, - "name": "alignright", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 46 - }, - { - "icon": { - "paths": [ - "M0 64h1024v128h-1024zM192 256h640v128h-640zM192 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z" - ], - "tags": [ - "aligncenter" - ], - "defaultCode": 57348, - "grid": 0 - }, - "properties": { - "id": 47, - "order": 41, - "prevSize": 32, - "code": 57348, - "name": "aligncenter", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 47 - }, - { - "icon": { - "paths": [ - "M0 64h1024v128h-1024zM0 256h640v128h-640zM0 640h640v128h-640zM0 448h1024v128h-1024zM0 832h1024v128h-1024z" - ], - "tags": [ - "alignleft" - ], - "defaultCode": 57347, - "grid": 0 - }, - "properties": { - "id": 48, - "order": 42, - "prevSize": 32, - "code": 57347, - "name": "alignleft", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 48 - }, - { - "icon": { - "paths": [ - "M1024 592.458v-160.916l-159.144-15.914c-8.186-30.042-20.088-58.548-35.21-84.98l104.596-127.838-113.052-113.050-127.836 104.596c-26.434-15.124-54.942-27.026-84.982-35.208l-15.914-159.148h-160.916l-15.914 159.146c-30.042 8.186-58.548 20.086-84.98 35.208l-127.838-104.594-113.050 113.050 104.596 127.836c-15.124 26.432-27.026 54.94-35.21 84.98l-159.146 15.916v160.916l159.146 15.914c8.186 30.042 20.086 58.548 35.21 84.982l-104.596 127.836 113.048 113.048 127.838-104.596c26.432 15.124 54.94 27.028 84.98 35.21l15.916 159.148h160.916l15.914-159.144c30.042-8.186 58.548-20.088 84.982-35.21l127.836 104.596 113.048-113.048-104.596-127.836c15.124-26.434 27.028-54.942 35.21-84.98l159.148-15.92zM704 576l-128 128h-128l-128-128v-128l128-128h128l128 128v128z" - ], - "tags": [ - "fullpage" - ], - "defaultCode": 57346, - "grid": 0 - }, - "properties": { - "id": 49, - "order": 43, - "prevSize": 32, - "code": 57346, - "name": "fullpage", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 49 - }, - { - "icon": { - "paths": [ - "M903.432 199.43l-142.864-142.862c-31.112-31.112-92.568-56.568-136.568-56.568h-480c-44 0-80 36-80 80v864c0 44 36 80 80 80h736c44 0 80-36 80-80v-608c0-44-25.456-105.458-56.568-136.57zM858.178 244.686c3.13 3.13 6.25 6.974 9.28 11.314h-163.458v-163.456c4.34 3.030 8.184 6.15 11.314 9.28l142.864 142.862zM896 944c0 8.672-7.328 16-16 16h-736c-8.672 0-16-7.328-16-16v-864c0-8.672 7.328-16 16-16h480c4.832 0 10.254 0.61 16 1.704v254.296h254.296c1.094 5.746 1.704 11.166 1.704 16v608z" - ], - "tags": [ - "newdocument" - ], - "defaultCode": 57345, - "grid": 0 - }, - "properties": { - "id": 50, - "order": 44, - "prevSize": 32, - "code": 57345, - "name": "newdocument", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 50 - }, - { - "icon": { - "paths": [ - "M896 0h-896v1024h1024v-896l-128-128zM512 128h128v256h-128v-256zM896 896h-768v-768h64v320h576v-320h74.978l53.022 53.018v714.982z" - ], - "tags": [ - "save" - ], - "defaultCode": 57344, - "grid": 0 - }, - "properties": { - "id": 51, - "order": 45, - "prevSize": 32, - "code": 57344, - "name": "save", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 51 - }, - { - "icon": { - "paths": [ - "M128 544l288 288 480-480-128-128-352 352-160-160z" - ], - "defaultCode": 57395, - "grid": 0 - }, - "properties": { - "id": 52, - "order": 46, - "prevSize": 32, - "code": 57395, - "name": "checkbox", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 52 - }, - { - "icon": { - "paths": [ - "M512 512v128h32l32-64h64v256h-48v64h224v-64h-48v-256h64l32 64h32v-128zM832 320v-160c0-17.6-14.4-32-32-32h-224v-64c0-35.2-28.8-64-64-64h-128c-35.204 0-64 28.8-64 64v64h-224c-17.602 0-32 14.4-32 32v640c0 17.6 14.398 32 32 32h288v192h640v-704h-192zM384 64.114c0.034-0.038 0.072-0.078 0.114-0.114h127.768c0.042 0.036 0.082 0.076 0.118 0.114l0 63.886h-128v-63.886zM192 256v-64h512v64h-512zM960 960h-512v-576h512v576z" - ], - "tags": [ - "pastetext" - ], - "defaultCode": 57397, - "grid": 0 - }, - "properties": { - "id": 53, - "order": 47, - "prevSize": 32, - "code": 57397, - "name": "pastetext", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 53 - }, - { - "icon": { - "paths": [ - "M1024 0v384l-138.26-138.26-212 212-107.48-107.48 212-212-138.26-138.26zM245.74 138.26l212 212-107.48 107.48-212-212-138.26 138.26v-384h384zM885.74 778.26l138.26-138.26v384h-384l138.26-138.26-212-212 107.48-107.48zM457.74 673.74l-212 212 138.26 138.26h-384v-384l138.26 138.26 212-212z" - ], - "tags": [ - "fullscreen" - ], - "defaultCode": 57379, - "grid": 0 - }, - "properties": { - "id": 16, - "order": 48, - "prevSize": 32, - "code": 57379, - "name": "fullscreen", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 16 - }, - { - "icon": { - "paths": [ - "M256 64h512v128h-512zM960 256h-896c-35.2 0-64 28.8-64 64v320c0 35.2 28.796 64 64 64h192v256h512v-256h192c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64zM704 896h-384v-320h384v320zM974.4 352c0 25.626-20.774 46.4-46.398 46.4-25.626 0-46.402-20.774-46.402-46.4s20.776-46.4 46.402-46.4c25.626 0 46.398 20.774 46.398 46.4z" - ], - "tags": [ - "print" - ], - "defaultCode": 57378, - "grid": 0 - }, - "properties": { - "id": 17, - "order": 49, - "prevSize": 32, - "code": 57378, - "name": "print", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 17 - }, - { - "icon": { - "paths": [ - "M512 0c-282.77 0-512 229.228-512 512 0 282.77 229.228 512 512 512 282.77 0 512-229.23 512-512 0-282.772-229.23-512-512-512zM512 944c-238.586 0-432-193.412-432-432 0-238.586 193.414-432 432-432 238.59 0 432 193.414 432 432 0 238.588-193.41 432-432 432zM384 320c0 35.346-28.654 64-64 64s-64-28.654-64-64 28.654-64 64-64 64 28.654 64 64zM768 320c0 35.346-28.652 64-64 64s-64-28.654-64-64 28.652-64 64-64 64 28.654 64 64zM512 652c141.074 0 262.688-57.532 318.462-123.192-20.872 171.22-156.288 303.192-318.462 303.192-162.118 0-297.498-132.026-318.444-303.168 55.786 65.646 177.386 123.168 318.444 123.168z" - ], - "tags": [ - "emoticons" - ], - "defaultCode": 57377, - "grid": 0 - }, - "properties": { - "id": 18, - "order": 50, - "prevSize": 32, - "code": 57377, - "name": "emoticons", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 18 - }, - { - "icon": { - "paths": [ - "M225 448c123.712 0 224 100.29 224 224 0 123.712-100.288 224-224 224-123.712 0-224-100.288-224-224l-1-32c0-247.424 200.576-448 448-448v128c-85.474 0-165.834 33.286-226.274 93.726-11.634 11.636-22.252 24.016-31.83 37.020 11.438-1.8 23.16-2.746 35.104-2.746zM801 448c123.71 0 224 100.29 224 224 0 123.712-100.29 224-224 224-123.71 0-224-100.288-224-224l-1-32c0-247.424 200.576-448 448-448v128c-85.474 0-165.834 33.286-226.274 93.726-11.636 11.636-22.254 24.016-31.832 37.020 11.44-1.8 23.16-2.746 35.106-2.746z" - ], - "tags": [ - "blockquote" - ], - "defaultCode": 57358, - "grid": 0 - }, - "properties": { - "id": 37, - "order": 51, - "prevSize": 32, - "code": 57358, - "name": "blockquote", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 37 - }, - { - "icon": { - "paths": [ - "M761.862 1024c113.726-206.032 132.888-520.306-313.862-509.824v253.824l-384-384 384-384v248.372c534.962-13.942 594.57 472.214 313.862 775.628z" - ], - "tags": [ - "undo" - ], - "defaultCode": 57359, - "grid": 0 - }, - "properties": { - "id": 36, - "order": 52, - "prevSize": 32, - "code": 57359, - "name": "undo", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 36 - }, - { - "icon": { - "paths": [ - "M576 248.372v-248.372l384 384-384 384v-253.824c-446.75-10.482-427.588 303.792-313.86 509.824-280.712-303.414-221.1-789.57 313.86-775.628z" - ], - "tags": [ - "redo" - ], - "defaultCode": 57360, - "grid": 0 - }, - "properties": { - "id": 35, - "order": 53, - "prevSize": 32, - "code": 57360, - "name": "redo", - "ligatures": "" - }, - "setIdx": 0, - "iconIdx": 35 - } - ], - "height": 1024, - "metadata": { - "name": "tinymce" - }, - "preferences": { - "showGlyphs": true, - "showQuickUse": true, - "fontPref": { - "prefix": "icon-", - "metadata": { - "fontFamily": "tinymce", - "majorVersion": 1, - "minorVersion": 0 - }, - "metrics": { - "emSize": 512, - "baseline": 6.25, - "whitespace": 50 - } - }, - "imagePref": {}, - "historySize": 100, - "showCodes": true, - "showLiga": false - } -} \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.svg b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.svg deleted file mode 100644 index feb9ba3..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.ttf b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.ttf deleted file mode 100644 index 58103c2..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.ttf and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.woff b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.woff deleted file mode 100644 index ad1ae39..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/fonts/tinymce.woff and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/anchor.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/anchor.gif deleted file mode 100644 index 606348c..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/anchor.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/loader.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/loader.gif deleted file mode 100644 index c69e937..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/loader.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/object.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/object.gif deleted file mode 100644 index cccd7f0..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/object.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/trans.gif b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/trans.gif deleted file mode 100644 index 3884865..0000000 Binary files a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/img/trans.gif and /dev/null differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/skin.ie7.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/skin.ie7.min.css deleted file mode 100644 index cd2bbdf..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/skin.ie7.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:focus{border-color:#a1a1a1}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-insertdatetime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB} \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/skin.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/skin.min.css deleted file mode 100644 index 284ac1d..0000000 --- a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/lightgray/skin.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:focus{border-color:#a1a1a1}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-toolbar-grp{padding-bottom:2px}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fdfdfd, #ddd);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fdfdfd), to(#ddd));background-image:-webkit-linear-gradient(top, #fdfdfd, #ddd);background-image:-o-linear-gradient(top, #fdfdfd, #ddd);background-image:linear-gradient(to bottom, #fdfdfd, #ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd', endColorstr='#ffdddddd', GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;background-image:-moz-linear-gradient(top, #f2f2f2, #ccc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ccc));background-image:-webkit-linear-gradient(top, #f2f2f2, #ccc);background-image:-o-linear-gradient(top, #f2f2f2, #ccc);background-image:linear-gradient(to bottom, #f2f2f2, #ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffcccccc', GradientType=0);zoom:1}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#d6d6d6;background-image:-moz-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#c0c0c0));background-image:-webkit-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:-o-linear-gradient(top, #e6e6e6, #c0c0c0);background-image:linear-gradient(to bottom, #e6e6e6, #c0c0c0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc0c0c0', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{min-width:50px;color:#fff;border:1px solid #b1b1b1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25) rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #08c, #04c);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));background-image:-webkit-linear-gradient(top, #08c, #04c);background-image:-o-linear-gradient(top, #08c, #04c);background-image:linear-gradient(to bottom, #08c, #04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);zoom:1}.mce-primary:hover,.mce-primary:focus{background-color:#005fb3;background-image:-moz-linear-gradient(top, #0077b3, #003cb3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0077b3), to(#003cb3));background-image:-webkit-linear-gradient(top, #0077b3, #003cb3);background-image:-o-linear-gradient(top, #0077b3, #003cb3);background-image:linear-gradient(to bottom, #0077b3, #003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3', endColorstr='#ff003cb3', GradientType=0);zoom:1}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#005299;background-image:-moz-linear-gradient(top, #069, #039);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#069), to(#039));background-image:-webkit-linear-gradient(top, #069, #039);background-image:-o-linear-gradient(top, #069, #039);background-image:linear-gradient(to bottom, #069, #039);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006699', endColorstr='#ff003399', GradientType=0);zoom:1;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #b1b1b1;border-left:1px solid rgba(0,0,0,0.25);-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #b1b1b1;border-right:1px solid rgba(0,0,0,0.1);-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#f0f0f0;background-image:-moz-linear-gradient(top, #fff, #d9d9d9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#d9d9d9));background-image:-webkit-linear-gradient(top, #fff, #d9d9d9);background-image:-o-linear-gradient(top, #fff, #d9d9d9);background-image:linear-gradient(to bottom, #fff, #d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffd9d9d9', GradientType=0);zoom:1;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:4px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-error{color:#a00}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn span{color:#333;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #08c, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#0077b3));background-image:-webkit-linear-gradient(top, #08c, #0077b3);background-image:-o-linear-gradient(top, #08c, #0077b3);background-image:linear-gradient(to bottom, #08c, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);zoom:1}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#bdbdbd;border-right-color:#bdbdbd}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e3e3e3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.65)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#333}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-insertdatetime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb} \ No newline at end of file diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.css new file mode 100644 index 0000000..798b779 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.css @@ -0,0 +1,600 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} +.mce-content-body .mce-item-anchor[data-mce-selected] { + outline-offset: 1px; +} +.tox-comments-visible .tox-comment { + background-color: #fff0b7; +} +.tox-comments-visible .tox-comment--active { + background-color: #ffe168; +} +.tox-checklist > li:not(.tox-checklist--hidden) { + list-style: none; + margin: 0.25em 0; +} +.tox-checklist > li:not(.tox-checklist--hidden)::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + background-size: 100%; + content: ''; + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); +} +[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { + margin-left: 0; + margin-right: -1.5em; +} +/* stylelint-disable */ +/* http://prismjs.com/ */ +/** + * Dracula Theme originally by Zeno Rocha [@zenorocha] + * https://draculatheme.com/ + * + * Ported for PrismJS by Albert Vallverdu [@byverdu] + */ +code[class*="language-"], +pre[class*="language-"] { + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; +} +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #282a36; +} +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #6272a4; +} +.token.punctuation { + color: #f8f8f2; +} +.namespace { + opacity: 0.7; +} +.token.property, +.token.tag, +.token.constant, +.token.symbol, +.token.deleted { + color: #ff79c6; +} +.token.boolean, +.token.number { + color: #bd93f9; +} +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #50fa7b; +} +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable { + color: #f8f8f2; +} +.token.atrule, +.token.attr-value, +.token.function, +.token.class-name { + color: #f1fa8c; +} +.token.keyword { + color: #8be9fd; +} +.token.regex, +.token.important { + color: #ffb86c; +} +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} +.token.entity { + cursor: help; +} +/* stylelint-enable */ +.mce-content-body { + overflow-wrap: break-word; + word-wrap: break-word; +} +.mce-content-body .mce-visual-caret { + background-color: black; + background-color: currentcolor; + position: absolute; +} +.mce-content-body .mce-visual-caret-hidden { + display: none; +} +.mce-content-body *[data-mce-caret] { + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} +.mce-content-body .mce-offscreen-selection { + left: -2000000px; + max-width: 1000000px; + position: absolute; +} +.mce-content-body *[contentEditable=false] { + cursor: default; +} +.mce-content-body *[contentEditable=true] { + cursor: text; +} +.tox-cursor-format-painter { + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; +} +.mce-content-body figure.align-left { + float: left; +} +.mce-content-body figure.align-right { + float: right; +} +.mce-content-body figure.image.align-center { + display: table; + margin-left: auto; + margin-right: auto; +} +.mce-preview-object { + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; +} +.mce-preview-object .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-preview-object[data-mce-selected="2"] .mce-shim { + display: none; +} +.mce-object { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; +} +.mce-pagebreak { + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} +@media print { + .mce-pagebreak { + border: 0; + } +} +.tiny-pageembed .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.tiny-pageembed[data-mce-selected="2"] .mce-shim { + display: none; +} +.tiny-pageembed { + display: inline-block; + position: relative; +} +.tiny-pageembed--21by9, +.tiny-pageembed--16by9, +.tiny-pageembed--4by3, +.tiny-pageembed--1by1 { + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; +} +.tiny-pageembed--21by9 { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9 { + padding-top: 56.25%; +} +.tiny-pageembed--4by3 { + padding-top: 75%; +} +.tiny-pageembed--1by1 { + padding-top: 100%; +} +.tiny-pageembed--21by9 iframe, +.tiny-pageembed--16by9 iframe, +.tiny-pageembed--4by3 iframe, +.tiny-pageembed--1by1 iframe { + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-content-body[data-mce-placeholder] { + position: relative; +} +.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; +} +.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { + left: 1px; +} +.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { + right: 1px; +} +.mce-content-body div.mce-resizehandle { + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} +.mce-content-body div.mce-resizehandle:hover { + background-color: #4099ff; +} +.mce-content-body div.mce-resizehandle:nth-of-type(1) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(2) { + cursor: nesw-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(3) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(4) { + cursor: nesw-resize; +} +.mce-content-body .mce-clonedresizable { + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; +} +.mce-content-body .mce-resize-helper { + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[data-mce-selected], +.mce-content-body table[data-mce-selected] { + outline: 3px solid #4099ff; +} +.mce-content-body hr[data-mce-selected] { + outline: 3px solid #4099ff; + outline-offset: 1px; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { + outline: 3px solid #4099ff; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { + outline: 3px solid #4099ff; +} +.mce-content-body *[contentEditable=false][data-mce-selected] { + cursor: not-allowed; + outline: 3px solid #4099ff; +} +.mce-content-body.mce-content-readonly *[contentEditable=true]:focus, +.mce-content-body.mce-content-readonly *[contentEditable=true]:hover { + outline: none; +} +.mce-content-body *[data-mce-selected="inline-boundary"] { + background-color: #4099ff; +} +.mce-content-body .mce-edit-focus { + outline: 3px solid #4099ff; +} +.mce-content-body td[data-mce-selected], +.mce-content-body th[data-mce-selected] { + background-color: #b4d7ff !important; +} +.mce-content-body td[data-mce-selected]::-moz-selection, +.mce-content-body th[data-mce-selected]::-moz-selection { + background: none; +} +.mce-content-body td[data-mce-selected]::selection, +.mce-content-body th[data-mce-selected]::selection { + background: none; +} +.mce-content-body td[data-mce-selected] *, +.mce-content-body th[data-mce-selected] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #4099ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ephox-snooker-resizer-cols { + cursor: col-resize; +} +.ephox-snooker-resizer-rows { + cursor: row-resize; +} +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { + opacity: 1; +} +.mce-spellchecker-word { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} +.mce-spellchecker-grammar { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; +} +.mce-toc { + border: 1px solid gray; +} +.mce-toc h2 { + margin: 4px; +} +.mce-toc li { + list-style-type: none; +} +.mce-item-table, +.mce-item-table td, +.mce-item-table th, +.mce-item-table caption { + border: 1px dashed #bbb; +} +.mce-visualblocks p, +.mce-visualblocks h1, +.mce-visualblocks h2, +.mce-visualblocks h3, +.mce-visualblocks h4, +.mce-visualblocks h5, +.mce-visualblocks h6, +.mce-visualblocks div:not([data-mce-bogus]), +.mce-visualblocks section, +.mce-visualblocks article, +.mce-visualblocks blockquote, +.mce-visualblocks address, +.mce-visualblocks pre, +.mce-visualblocks figure, +.mce-visualblocks figcaption, +.mce-visualblocks hgroup, +.mce-visualblocks aside, +.mce-visualblocks ul, +.mce-visualblocks ol, +.mce-visualblocks dl { + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; +} +.mce-visualblocks p { + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); +} +.mce-visualblocks h1 { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); +} +.mce-visualblocks h2 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); +} +.mce-visualblocks h3 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); +} +.mce-visualblocks h4 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); +} +.mce-visualblocks h5 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); +} +.mce-visualblocks h6 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); +} +.mce-visualblocks div:not([data-mce-bogus]) { + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); +} +.mce-visualblocks section { + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); +} +.mce-visualblocks article { + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); +} +.mce-visualblocks blockquote { + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); +} +.mce-visualblocks address { + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); +} +.mce-visualblocks pre { + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); +} +.mce-visualblocks figure { + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); +} +.mce-visualblocks figcaption { + border: 1px dashed #bbb; +} +.mce-visualblocks hgroup { + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); +} +.mce-visualblocks aside { + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); +} +.mce-visualblocks ul { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); +} +.mce-visualblocks ol { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); +} +.mce-visualblocks dl { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); +} +.mce-visualblocks:not([dir=rtl]) p, +.mce-visualblocks:not([dir=rtl]) h1, +.mce-visualblocks:not([dir=rtl]) h2, +.mce-visualblocks:not([dir=rtl]) h3, +.mce-visualblocks:not([dir=rtl]) h4, +.mce-visualblocks:not([dir=rtl]) h5, +.mce-visualblocks:not([dir=rtl]) h6, +.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]), +.mce-visualblocks:not([dir=rtl]) section, +.mce-visualblocks:not([dir=rtl]) article, +.mce-visualblocks:not([dir=rtl]) blockquote, +.mce-visualblocks:not([dir=rtl]) address, +.mce-visualblocks:not([dir=rtl]) pre, +.mce-visualblocks:not([dir=rtl]) figure, +.mce-visualblocks:not([dir=rtl]) figcaption, +.mce-visualblocks:not([dir=rtl]) hgroup, +.mce-visualblocks:not([dir=rtl]) aside, +.mce-visualblocks:not([dir=rtl]) ul, +.mce-visualblocks:not([dir=rtl]) ol, +.mce-visualblocks:not([dir=rtl]) dl { + margin-left: 3px; +} +.mce-visualblocks[dir=rtl] p, +.mce-visualblocks[dir=rtl] h1, +.mce-visualblocks[dir=rtl] h2, +.mce-visualblocks[dir=rtl] h3, +.mce-visualblocks[dir=rtl] h4, +.mce-visualblocks[dir=rtl] h5, +.mce-visualblocks[dir=rtl] h6, +.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]), +.mce-visualblocks[dir=rtl] section, +.mce-visualblocks[dir=rtl] article, +.mce-visualblocks[dir=rtl] blockquote, +.mce-visualblocks[dir=rtl] address, +.mce-visualblocks[dir=rtl] pre, +.mce-visualblocks[dir=rtl] figure, +.mce-visualblocks[dir=rtl] figcaption, +.mce-visualblocks[dir=rtl] hgroup, +.mce-visualblocks[dir=rtl] aside, +.mce-visualblocks[dir=rtl] ul, +.mce-visualblocks[dir=rtl] ol, +.mce-visualblocks[dir=rtl] dl { + background-position-x: right; + margin-right: 3px; +} +.mce-nbsp, +.mce-shy { + background: #aaa; +} +.mce-shy::after { + content: '-'; +} +body { + font-family: sans-serif; +} +table { + border-collapse: collapse; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.inline.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.inline.css new file mode 100644 index 0000000..1a040d5 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.inline.css @@ -0,0 +1,612 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} +.mce-content-body .mce-item-anchor[data-mce-selected] { + outline-offset: 1px; +} +.tox-comments-visible .tox-comment { + background-color: #fff0b7; +} +.tox-comments-visible .tox-comment--active { + background-color: #ffe168; +} +.tox-checklist > li:not(.tox-checklist--hidden) { + list-style: none; + margin: 0.25em 0; +} +.tox-checklist > li:not(.tox-checklist--hidden)::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + background-size: 100%; + content: ''; + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); +} +[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { + margin-left: 0; + margin-right: -1.5em; +} +/* stylelint-disable */ +/* http://prismjs.com/ */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} +.token.punctuation { + color: #999; +} +.namespace { + opacity: 0.7; +} +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); +} +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} +.token.function, +.token.class-name { + color: #DD4A68; +} +.token.regex, +.token.important, +.token.variable { + color: #e90; +} +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} +.token.entity { + cursor: help; +} +/* stylelint-enable */ +.mce-content-body { + overflow-wrap: break-word; + word-wrap: break-word; +} +.mce-content-body .mce-visual-caret { + background-color: black; + background-color: currentcolor; + position: absolute; +} +.mce-content-body .mce-visual-caret-hidden { + display: none; +} +.mce-content-body *[data-mce-caret] { + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} +.mce-content-body .mce-offscreen-selection { + left: -2000000px; + max-width: 1000000px; + position: absolute; +} +.mce-content-body *[contentEditable=false] { + cursor: default; +} +.mce-content-body *[contentEditable=true] { + cursor: text; +} +.tox-cursor-format-painter { + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; +} +.mce-content-body figure.align-left { + float: left; +} +.mce-content-body figure.align-right { + float: right; +} +.mce-content-body figure.image.align-center { + display: table; + margin-left: auto; + margin-right: auto; +} +.mce-preview-object { + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; +} +.mce-preview-object .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-preview-object[data-mce-selected="2"] .mce-shim { + display: none; +} +.mce-object { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; +} +.mce-pagebreak { + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} +@media print { + .mce-pagebreak { + border: 0; + } +} +.tiny-pageembed .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.tiny-pageembed[data-mce-selected="2"] .mce-shim { + display: none; +} +.tiny-pageembed { + display: inline-block; + position: relative; +} +.tiny-pageembed--21by9, +.tiny-pageembed--16by9, +.tiny-pageembed--4by3, +.tiny-pageembed--1by1 { + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; +} +.tiny-pageembed--21by9 { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9 { + padding-top: 56.25%; +} +.tiny-pageembed--4by3 { + padding-top: 75%; +} +.tiny-pageembed--1by1 { + padding-top: 100%; +} +.tiny-pageembed--21by9 iframe, +.tiny-pageembed--16by9 iframe, +.tiny-pageembed--4by3 iframe, +.tiny-pageembed--1by1 iframe { + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-content-body[data-mce-placeholder] { + position: relative; +} +.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; +} +.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { + left: 1px; +} +.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { + right: 1px; +} +.mce-content-body div.mce-resizehandle { + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} +.mce-content-body div.mce-resizehandle:hover { + background-color: #4099ff; +} +.mce-content-body div.mce-resizehandle:nth-of-type(1) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(2) { + cursor: nesw-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(3) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(4) { + cursor: nesw-resize; +} +.mce-content-body .mce-clonedresizable { + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; +} +.mce-content-body .mce-resize-helper { + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[data-mce-selected], +.mce-content-body table[data-mce-selected] { + outline: 3px solid #b4d7ff; +} +.mce-content-body hr[data-mce-selected] { + outline: 3px solid #b4d7ff; + outline-offset: 1px; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { + outline: 3px solid #b4d7ff; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { + outline: 3px solid #b4d7ff; +} +.mce-content-body *[contentEditable=false][data-mce-selected] { + cursor: not-allowed; + outline: 3px solid #b4d7ff; +} +.mce-content-body.mce-content-readonly *[contentEditable=true]:focus, +.mce-content-body.mce-content-readonly *[contentEditable=true]:hover { + outline: none; +} +.mce-content-body *[data-mce-selected="inline-boundary"] { + background-color: #b4d7ff; +} +.mce-content-body .mce-edit-focus { + outline: 3px solid #b4d7ff; +} +.mce-content-body td[data-mce-selected], +.mce-content-body th[data-mce-selected] { + background-color: #b4d7ff !important; +} +.mce-content-body td[data-mce-selected]::-moz-selection, +.mce-content-body th[data-mce-selected]::-moz-selection { + background: none; +} +.mce-content-body td[data-mce-selected]::selection, +.mce-content-body th[data-mce-selected]::selection { + background: none; +} +.mce-content-body td[data-mce-selected] *, +.mce-content-body th[data-mce-selected] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #b4d7ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ephox-snooker-resizer-cols { + cursor: col-resize; +} +.ephox-snooker-resizer-rows { + cursor: row-resize; +} +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { + opacity: 1; +} +.mce-spellchecker-word { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} +.mce-spellchecker-grammar { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; +} +.mce-toc { + border: 1px solid gray; +} +.mce-toc h2 { + margin: 4px; +} +.mce-toc li { + list-style-type: none; +} +.mce-item-table, +.mce-item-table td, +.mce-item-table th, +.mce-item-table caption { + border: 1px dashed #bbb; +} +.mce-visualblocks p, +.mce-visualblocks h1, +.mce-visualblocks h2, +.mce-visualblocks h3, +.mce-visualblocks h4, +.mce-visualblocks h5, +.mce-visualblocks h6, +.mce-visualblocks div:not([data-mce-bogus]), +.mce-visualblocks section, +.mce-visualblocks article, +.mce-visualblocks blockquote, +.mce-visualblocks address, +.mce-visualblocks pre, +.mce-visualblocks figure, +.mce-visualblocks figcaption, +.mce-visualblocks hgroup, +.mce-visualblocks aside, +.mce-visualblocks ul, +.mce-visualblocks ol, +.mce-visualblocks dl { + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; +} +.mce-visualblocks p { + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); +} +.mce-visualblocks h1 { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); +} +.mce-visualblocks h2 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); +} +.mce-visualblocks h3 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); +} +.mce-visualblocks h4 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); +} +.mce-visualblocks h5 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); +} +.mce-visualblocks h6 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); +} +.mce-visualblocks div:not([data-mce-bogus]) { + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); +} +.mce-visualblocks section { + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); +} +.mce-visualblocks article { + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); +} +.mce-visualblocks blockquote { + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); +} +.mce-visualblocks address { + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); +} +.mce-visualblocks pre { + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); +} +.mce-visualblocks figure { + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); +} +.mce-visualblocks figcaption { + border: 1px dashed #bbb; +} +.mce-visualblocks hgroup { + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); +} +.mce-visualblocks aside { + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); +} +.mce-visualblocks ul { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); +} +.mce-visualblocks ol { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); +} +.mce-visualblocks dl { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); +} +.mce-visualblocks:not([dir=rtl]) p, +.mce-visualblocks:not([dir=rtl]) h1, +.mce-visualblocks:not([dir=rtl]) h2, +.mce-visualblocks:not([dir=rtl]) h3, +.mce-visualblocks:not([dir=rtl]) h4, +.mce-visualblocks:not([dir=rtl]) h5, +.mce-visualblocks:not([dir=rtl]) h6, +.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]), +.mce-visualblocks:not([dir=rtl]) section, +.mce-visualblocks:not([dir=rtl]) article, +.mce-visualblocks:not([dir=rtl]) blockquote, +.mce-visualblocks:not([dir=rtl]) address, +.mce-visualblocks:not([dir=rtl]) pre, +.mce-visualblocks:not([dir=rtl]) figure, +.mce-visualblocks:not([dir=rtl]) figcaption, +.mce-visualblocks:not([dir=rtl]) hgroup, +.mce-visualblocks:not([dir=rtl]) aside, +.mce-visualblocks:not([dir=rtl]) ul, +.mce-visualblocks:not([dir=rtl]) ol, +.mce-visualblocks:not([dir=rtl]) dl { + margin-left: 3px; +} +.mce-visualblocks[dir=rtl] p, +.mce-visualblocks[dir=rtl] h1, +.mce-visualblocks[dir=rtl] h2, +.mce-visualblocks[dir=rtl] h3, +.mce-visualblocks[dir=rtl] h4, +.mce-visualblocks[dir=rtl] h5, +.mce-visualblocks[dir=rtl] h6, +.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]), +.mce-visualblocks[dir=rtl] section, +.mce-visualblocks[dir=rtl] article, +.mce-visualblocks[dir=rtl] blockquote, +.mce-visualblocks[dir=rtl] address, +.mce-visualblocks[dir=rtl] pre, +.mce-visualblocks[dir=rtl] figure, +.mce-visualblocks[dir=rtl] figcaption, +.mce-visualblocks[dir=rtl] hgroup, +.mce-visualblocks[dir=rtl] aside, +.mce-visualblocks[dir=rtl] ul, +.mce-visualblocks[dir=rtl] ol, +.mce-visualblocks[dir=rtl] dl { + background-position-x: right; + margin-right: 3px; +} +.mce-nbsp, +.mce-shy { + background: #aaa; +} +.mce-shy::after { + content: '-'; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.inline.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.inline.min.css new file mode 100644 index 0000000..e1eb7ca --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.inline.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size:100%;content:'';cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentcolor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color:#b4d7ff!important}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'} +/*# sourceMappingURL=content.inline.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.min.css new file mode 100644 index 0000000..838e549 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size:100%;content:'';cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#282a36}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6272a4}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#ff79c6}.token.boolean,.token.number{color:#bd93f9}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#50fa7b}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#f1fa8c}.token.keyword{color:#8be9fd}.token.important,.token.regex{color:#ffb86c}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentcolor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline:3px solid #4099ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #4099ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #4099ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #4099ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #4099ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#4099ff}.mce-content-body .mce-edit-focus{outline:3px solid #4099ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color:#b4d7ff!important}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#4099ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'}body{font-family:sans-serif}table{border-collapse:collapse} +/*# sourceMappingURL=content.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.mobile.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.mobile.css new file mode 100644 index 0000000..4bdb8ba --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.mobile.css @@ -0,0 +1,29 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { + /* Note: this file is used inside the content, so isn't part of theming */ + background-color: green; + display: inline-block; + opacity: 0.5; + position: absolute; +} +body { + -webkit-text-size-adjust: none; +} +body img { + /* this is related to the content margin */ + max-width: 96vw; +} +body table img { + max-width: 95%; +} +body { + font-family: sans-serif; +} +table { + border-collapse: collapse; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.mobile.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.mobile.min.css new file mode 100644 index 0000000..627f693 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/content.mobile.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} +/*# sourceMappingURL=content.mobile.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff new file mode 100644 index 0000000..1e3be03 Binary files /dev/null and b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.css new file mode 100644 index 0000000..4cfe15d --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.css @@ -0,0 +1,2884 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tox { + box-sizing: content-box; + color: #2A3746; + cursor: auto; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: normal; + -webkit-tap-highlight-color: transparent; + text-decoration: none; + text-shadow: none; + text-transform: none; + vertical-align: initial; + white-space: normal; +} +.tox *:not(svg):not(rect) { + box-sizing: inherit; + color: inherit; + cursor: inherit; + direction: inherit; + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; + line-height: inherit; + -webkit-tap-highlight-color: inherit; + text-align: inherit; + text-decoration: inherit; + text-shadow: inherit; + text-transform: inherit; + vertical-align: inherit; + white-space: inherit; +} +.tox *:not(svg):not(rect) { + /* stylelint-disable-line no-duplicate-selectors */ + background: transparent; + border: 0; + float: none; + height: auto; + margin: 0; + max-width: none; + outline: 0; + padding: 0; + position: static; + width: auto; +} +.tox:not([dir=rtl]) { + direction: ltr; + text-align: left; +} +.tox[dir=rtl] { + direction: rtl; + text-align: right; +} +.tox-tinymce { + border: 1px solid #000000; + border-radius: 0; + box-shadow: none; + box-sizing: border-box; + display: flex; + flex-direction: column; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + overflow: hidden; + position: relative; + visibility: inherit !important; +} +.tox-tinymce-inline { + border: none; + box-shadow: none; +} +.tox-tinymce-inline .tox-editor-header { + border: 1px solid #000000; + border-radius: 0; + box-shadow: none; +} +.tox-tinymce-aux { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + z-index: 1300; +} +.tox-tinymce *:focus, +.tox-tinymce-aux *:focus { + outline: none; +} +button::-moz-focus-inner { + border: 0; +} +.tox .accessibility-issue__header { + align-items: center; + display: flex; + margin-bottom: 4px; +} +.tox .accessibility-issue__description { + align-items: stretch; + border: 1px solid #000000; + border-radius: 3px; + display: flex; + justify-content: space-between; +} +.tox .accessibility-issue__description > div { + padding-bottom: 4px; +} +.tox .accessibility-issue__description > div > div { + align-items: center; + display: flex; + margin-bottom: 4px; +} +.tox .accessibility-issue__description > *:last-child:not(:only-child) { + border-color: #000000; + border-style: solid; +} +.tox .accessibility-issue__repair { + margin-top: 16px; +} +.tox .accessibility-issue--info .accessibility-issue__description { + background-color: rgba(32, 122, 183, 0.5); + border-color: #207ab7; + color: #fff; +} +.tox .accessibility-issue--info .accessibility-issue__description > *:last-child { + border-color: #207ab7; +} +.tox .accessibility-issue--info h2 { + color: #fff; +} +.tox .accessibility-issue--info .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--info a .tox-icon { + color: #fff; +} +.tox .accessibility-issue--warn .accessibility-issue__description { + background-color: rgba(255, 165, 0, 0.5); + border-color: rgba(255, 165, 0, 0.8); + color: #fff; +} +.tox .accessibility-issue--warn .accessibility-issue__description > *:last-child { + border-color: rgba(255, 165, 0, 0.8); +} +.tox .accessibility-issue--warn h2 { + color: #fff; +} +.tox .accessibility-issue--warn .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--warn a .tox-icon { + color: #fff; +} +.tox .accessibility-issue--error .accessibility-issue__description { + background-color: rgba(204, 0, 0, 0.5); + border-color: rgba(204, 0, 0, 0.8); + color: #fff; +} +.tox .accessibility-issue--error .accessibility-issue__description > *:last-child { + border-color: rgba(204, 0, 0, 0.8); +} +.tox .accessibility-issue--error h2 { + color: #fff; +} +.tox .accessibility-issue--error .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--error a .tox-icon { + color: #fff; +} +.tox .accessibility-issue--success .accessibility-issue__description { + background-color: rgba(120, 171, 70, 0.5); + border-color: rgba(120, 171, 70, 0.8); + color: #fff; +} +.tox .accessibility-issue--success .accessibility-issue__description > *:last-child { + border-color: rgba(120, 171, 70, 0.8); +} +.tox .accessibility-issue--success h2 { + color: #fff; +} +.tox .accessibility-issue--success .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--success a .tox-icon { + color: #fff; +} +.tox .tox-dialog__body-content .accessibility-issue__header h1, +.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 { + margin-top: 0; +} +.tox:not([dir=rtl]) .accessibility-issue__header .tox-button { + margin-left: 4px; +} +.tox:not([dir=rtl]) .accessibility-issue__header > *:nth-last-child(2) { + margin-left: auto; +} +.tox:not([dir=rtl]) .accessibility-issue__description { + padding: 4px 4px 4px 8px; +} +.tox:not([dir=rtl]) .accessibility-issue__description > *:last-child { + border-left-width: 1px; + padding-left: 4px; +} +.tox[dir=rtl] .accessibility-issue__header .tox-button { + margin-right: 4px; +} +.tox[dir=rtl] .accessibility-issue__header > *:nth-last-child(2) { + margin-right: auto; +} +.tox[dir=rtl] .accessibility-issue__description { + padding: 4px 8px 4px 4px; +} +.tox[dir=rtl] .accessibility-issue__description > *:last-child { + border-right-width: 1px; + padding-right: 4px; +} +.tox .tox-anchorbar { + display: flex; + flex: 0 0 auto; +} +.tox .tox-bar { + display: flex; + flex: 0 0 auto; +} +.tox .tox-button { + background-color: #207ab7; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #207ab7; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 14px; + font-weight: bold; + letter-spacing: normal; + line-height: 24px; + margin: 0; + outline: none; + padding: 4px 16px; + text-align: center; + text-decoration: none; + text-transform: capitalize; + white-space: nowrap; +} +.tox .tox-button[disabled] { + background-color: #207ab7; + background-image: none; + border-color: #207ab7; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} +.tox .tox-button:focus:not(:disabled) { + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; +} +.tox .tox-button:hover:not(:disabled) { + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; +} +.tox .tox-button:active:not(:disabled) { + background-color: #185d8c; + background-image: none; + border-color: #185d8c; + box-shadow: none; + color: #fff; +} +.tox .tox-button--secondary { + background-color: #3d546f; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #3d546f; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + color: #fff; + outline: none; + padding: 4px 16px; + text-decoration: none; + text-transform: capitalize; +} +.tox .tox-button--secondary[disabled] { + background-color: #3d546f; + background-image: none; + border-color: #3d546f; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); +} +.tox .tox-button--secondary:focus:not(:disabled) { + background-color: #34485f; + background-image: none; + border-color: #34485f; + box-shadow: none; + color: #fff; +} +.tox .tox-button--secondary:hover:not(:disabled) { + background-color: #34485f; + background-image: none; + border-color: #34485f; + box-shadow: none; + color: #fff; +} +.tox .tox-button--secondary:active:not(:disabled) { + background-color: #2b3b4e; + background-image: none; + border-color: #2b3b4e; + box-shadow: none; + color: #fff; +} +.tox .tox-button--icon, +.tox .tox-button.tox-button--icon, +.tox .tox-button.tox-button--secondary.tox-button--icon { + padding: 4px; +} +.tox .tox-button--icon .tox-icon svg, +.tox .tox-button.tox-button--icon .tox-icon svg, +.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg { + display: block; + fill: currentColor; +} +.tox .tox-button-link { + background: 0; + border: none; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-weight: normal; + line-height: 1.3; + margin: 0; + padding: 0; + white-space: nowrap; +} +.tox .tox-button-link--sm { + font-size: 14px; +} +.tox .tox-button--naked { + background-color: transparent; + border-color: transparent; + box-shadow: unset; + color: #fff; +} +.tox .tox-button--naked[disabled] { + background-color: #3d546f; + border-color: #3d546f; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); +} +.tox .tox-button--naked:hover:not(:disabled) { + background-color: #34485f; + border-color: #34485f; + box-shadow: none; + color: #fff; +} +.tox .tox-button--naked:focus:not(:disabled) { + background-color: #34485f; + border-color: #34485f; + box-shadow: none; + color: #fff; +} +.tox .tox-button--naked:active:not(:disabled) { + background-color: #2b3b4e; + border-color: #2b3b4e; + box-shadow: none; + color: #fff; +} +.tox .tox-button--naked .tox-icon svg { + fill: currentColor; +} +.tox .tox-button--naked.tox-button--icon:hover:not(:disabled) { + color: #fff; +} +.tox .tox-checkbox { + align-items: center; + border-radius: 3px; + cursor: pointer; + display: flex; + height: 36px; + min-width: 36px; +} +.tox .tox-checkbox__input { + /* Hide from view but visible to screen readers */ + height: 1px; + overflow: hidden; + position: absolute; + top: auto; + width: 1px; +} +.tox .tox-checkbox__icons { + align-items: center; + border-radius: 3px; + box-shadow: 0 0 0 2px transparent; + box-sizing: content-box; + display: flex; + height: 24px; + justify-content: center; + padding: calc(4px - 1px); + width: 24px; +} +.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + display: block; + fill: rgba(255, 255, 255, 0.2); +} +.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + display: none; + fill: #207ab7; +} +.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg { + display: none; + fill: #207ab7; +} +.tox .tox-checkbox--disabled { + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg { + fill: rgba(255, 255, 255, 0.5); +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + fill: rgba(255, 255, 255, 0.5); +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + fill: rgba(255, 255, 255, 0.5); +} +.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + display: none; +} +.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg { + display: block; +} +.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + display: none; +} +.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + display: block; +} +.tox input.tox-checkbox__input:focus + .tox-checkbox__icons { + border-radius: 3px; + box-shadow: inset 0 0 0 1px #207ab7; + padding: calc(4px - 1px); +} +.tox:not([dir=rtl]) .tox-checkbox__label { + margin-left: 4px; +} +.tox:not([dir=rtl]) .tox-checkbox__input { + left: -10000px; +} +.tox:not([dir=rtl]) .tox-bar .tox-checkbox { + margin-left: 4px; +} +.tox[dir=rtl] .tox-checkbox__label { + margin-right: 4px; +} +.tox[dir=rtl] .tox-checkbox__input { + right: -10000px; +} +.tox[dir=rtl] .tox-bar .tox-checkbox { + margin-right: 4px; +} +.tox { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox .tox-collection--toolbar .tox-collection__group { + display: flex; + padding: 0; +} +.tox .tox-collection--grid .tox-collection__group { + display: flex; + flex-wrap: wrap; + max-height: 208px; + overflow-x: hidden; + overflow-y: auto; + padding: 0; +} +.tox .tox-collection--list .tox-collection__group { + border-bottom-width: 0; + border-color: #1a1a1a; + border-left-width: 0; + border-right-width: 0; + border-style: solid; + border-top-width: 1px; + padding: 4px 0; +} +.tox .tox-collection--list .tox-collection__group:first-child { + border-top-width: 0; +} +.tox .tox-collection__group-heading { + background-color: #333333; + color: #fff; + cursor: default; + font-size: 12px; + font-style: normal; + font-weight: normal; + margin-bottom: 4px; + margin-top: -4px; + padding: 4px 8px; + text-transform: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.tox .tox-collection__item { + align-items: center; + color: #fff; + cursor: pointer; + display: flex; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.tox .tox-collection--list .tox-collection__item { + padding: 4px 8px; +} +.tox .tox-collection--toolbar .tox-collection__item { + border-radius: 3px; + padding: 4px; +} +.tox .tox-collection--grid .tox-collection__item { + border-radius: 3px; + padding: 4px; +} +.tox .tox-collection--list .tox-collection__item--enabled { + background-color: #2b3b4e; + color: #fff; +} +.tox .tox-collection--list .tox-collection__item--active { + background-color: #4a5562; +} +.tox .tox-collection--toolbar .tox-collection__item--enabled { + background-color: #757d87; + color: #fff; +} +.tox .tox-collection--toolbar .tox-collection__item--active { + background-color: #4a5562; +} +.tox .tox-collection--grid .tox-collection__item--enabled { + background-color: #757d87; + color: #fff; +} +.tox .tox-collection--grid .tox-collection__item--active { + background-color: #4a5562; +} +.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) { + color: #fff; +} +.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) { + color: #fff; +} +.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) { + color: #fff; +} +.tox .tox-collection__item--state-disabled { + background-color: transparent; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} +.tox .tox-collection__item-icon { + align-items: center; + display: flex; + height: 24px; + justify-content: center; + width: 24px; +} +.tox .tox-collection__item-icon svg { + fill: currentColor; +} +.tox .tox-collection--toolbar-lg .tox-collection__item-icon { + height: 48px; + width: 48px; +} +.tox .tox-collection__item-label { + color: currentColor; + display: inline-block; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 24px; + text-transform: none; + word-break: break-all; +} +.tox .tox-collection__item-accessory { + color: rgba(255, 255, 255, 0.5); + display: inline-block; + font-size: 14px; + height: 24px; + line-height: 24px; + text-transform: none; +} +.tox .tox-collection__item-caret { + align-items: center; + display: flex; + min-height: 24px; +} +.tox .tox-collection__item-caret::after { + content: ''; + font-size: 0; + min-height: inherit; +} +.tox .tox-collection__item-caret svg { + fill: #fff; +} +.tox .tox-collection__item[role="menuitemcheckbox"]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { + display: none; +} +.tox .tox-collection--horizontal { + background-color: #2b3b4e; + border: 1px solid #1a1a1a; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: nowrap; + margin-bottom: 0; + overflow-x: auto; + padding: 0; +} +.tox .tox-collection--horizontal .tox-collection__group { + align-items: center; + display: flex; + flex-wrap: nowrap; + margin: 0; + padding: 0 4px; +} +.tox .tox-collection--horizontal .tox-collection__item { + height: 34px; + margin: 2px 0 3px 0; + padding: 0 4px; +} +.tox .tox-collection--horizontal .tox-collection__item-label { + white-space: nowrap; +} +.tox .tox-collection--horizontal .tox-collection__item-caret { + margin-left: 4px; +} +.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { + border-right: 1px solid #000000; +} +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) { + margin-left: 8px; +} +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child { + margin-left: 4px; +} +.tox:not([dir=rtl]) .tox-collection__item-accessory { + margin-left: 16px; + text-align: right; +} +.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret { + margin-left: 16px; +} +.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { + border-left: 1px solid #000000; +} +.tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) { + margin-right: 8px; +} +.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child { + margin-right: 4px; +} +.tox[dir=rtl] .tox-collection__item-icon-rtl { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg { + transform: rotateY(180deg); +} +.tox[dir=rtl] .tox-collection__item-accessory { + margin-right: 16px; + text-align: left; +} +.tox[dir=rtl] .tox-collection .tox-collection__item-caret { + margin-right: 16px; + transform: rotateY(180deg); +} +.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret { + margin-right: 4px; +} +.tox .tox-color-picker-container { + display: flex; + flex-direction: row; + height: 225px; + margin: 0; +} +.tox .tox-sv-palette { + box-sizing: border-box; + display: flex; + height: 100%; +} +.tox .tox-sv-palette-spectrum { + height: 100%; +} +.tox .tox-sv-palette, +.tox .tox-sv-palette-spectrum { + width: 225px; +} +.tox .tox-sv-palette-thumb { + background: none; + border: 1px solid black; + border-radius: 50%; + box-sizing: content-box; + height: 12px; + position: absolute; + width: 12px; +} +.tox .tox-sv-palette-inner-thumb { + border: 1px solid white; + border-radius: 50%; + height: 10px; + position: absolute; + width: 10px; +} +.tox .tox-hue-slider { + box-sizing: border-box; + height: 100%; + width: 25px; +} +.tox .tox-hue-slider-spectrum { + background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); + height: 100%; + width: 100%; +} +.tox .tox-hue-slider, +.tox .tox-hue-slider-spectrum { + width: 20px; +} +.tox .tox-hue-slider-thumb { + background: white; + border: 1px solid black; + box-sizing: content-box; + height: 4px; + width: 100%; +} +.tox .tox-rgb-form { + display: flex; + flex-direction: column; + justify-content: space-between; +} +.tox .tox-rgb-form div { + align-items: center; + display: flex; + justify-content: space-between; + margin-bottom: 5px; + width: inherit; +} +.tox .tox-rgb-form input { + width: 6em; +} +.tox .tox-rgb-form input.tox-invalid { + /* Need !important to override Chrome's focus styling unfortunately */ + border: 1px solid red !important; +} +.tox .tox-rgb-form .tox-rgba-preview { + border: 1px solid black; + flex-grow: 2; + margin-bottom: 0; +} +.tox:not([dir=rtl]) .tox-sv-palette { + margin-right: 15px; +} +.tox:not([dir=rtl]) .tox-hue-slider { + margin-right: 15px; +} +.tox:not([dir=rtl]) .tox-hue-slider-thumb { + margin-left: -1px; +} +.tox:not([dir=rtl]) .tox-rgb-form label { + margin-right: 0.5em; +} +.tox[dir=rtl] .tox-sv-palette { + margin-left: 15px; +} +.tox[dir=rtl] .tox-hue-slider { + margin-left: 15px; +} +.tox[dir=rtl] .tox-hue-slider-thumb { + margin-right: -1px; +} +.tox[dir=rtl] .tox-rgb-form label { + margin-left: 0.5em; +} +.tox .tox-toolbar .tox-swatches, +.tox .tox-toolbar__primary .tox-swatches, +.tox .tox-toolbar__overflow .tox-swatches { + margin: 2px 0 3px 4px; +} +.tox .tox-collection--list .tox-collection__group .tox-swatches-menu { + border: 0; + margin: -4px 0; +} +.tox .tox-swatches__row { + display: flex; +} +.tox .tox-swatch { + height: 30px; + transition: transform 0.15s, box-shadow 0.15s; + width: 30px; +} +.tox .tox-swatch:hover, +.tox .tox-swatch:focus { + box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; + transform: scale(0.8); +} +.tox .tox-swatch--remove { + align-items: center; + display: flex; + justify-content: center; +} +.tox .tox-swatch--remove svg path { + stroke: #e74c3c; +} +.tox .tox-swatches__picker-btn { + align-items: center; + background-color: transparent; + border: 0; + cursor: pointer; + display: flex; + height: 30px; + justify-content: center; + outline: none; + padding: 0; + width: 30px; +} +.tox .tox-swatches__picker-btn svg { + height: 24px; + width: 24px; +} +.tox .tox-swatches__picker-btn:hover { + background: #4a5562; +} +.tox:not([dir=rtl]) .tox-swatches__picker-btn { + margin-left: auto; +} +.tox[dir=rtl] .tox-swatches__picker-btn { + margin-right: auto; +} +.tox .tox-comment-thread { + background: #2b3b4e; + position: relative; +} +.tox .tox-comment-thread > *:not(:first-child) { + margin-top: 8px; +} +.tox .tox-comment { + background: #2b3b4e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); + padding: 8px 8px 16px 8px; + position: relative; +} +.tox .tox-comment__header { + align-items: center; + color: #fff; + display: flex; + justify-content: space-between; +} +.tox .tox-comment__date { + color: rgba(255, 255, 255, 0.5); + font-size: 12px; +} +.tox .tox-comment__body { + color: #fff; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin-top: 8px; + position: relative; + text-transform: initial; +} +.tox .tox-comment__body textarea { + resize: none; + white-space: normal; + width: 100%; +} +.tox .tox-comment__expander { + padding-top: 8px; +} +.tox .tox-comment__expander p { + color: rgba(255, 255, 255, 0.5); + font-size: 14px; + font-style: normal; +} +.tox .tox-comment__body p { + margin: 0; +} +.tox .tox-comment__buttonspacing { + padding-top: 16px; + text-align: center; +} +.tox .tox-comment-thread__overlay::after { + background: #2b3b4e; + bottom: 0; + content: ""; + display: flex; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + top: 0; + z-index: 5; +} +.tox .tox-comment__reply { + display: flex; + flex-shrink: 0; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 8px; +} +.tox .tox-comment__reply > *:first-child { + margin-bottom: 8px; + width: 100%; +} +.tox .tox-comment__edit { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 16px; +} +.tox .tox-comment__gradient::after { + background: linear-gradient(rgba(43, 59, 78, 0), #2b3b4e); + bottom: 0; + content: ""; + display: block; + height: 5em; + margin-top: -40px; + position: absolute; + width: 100%; +} +.tox .tox-comment__overlay { + background: #2b3b4e; + bottom: 0; + display: flex; + flex-direction: column; + flex-grow: 1; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + text-align: center; + top: 0; + z-index: 5; +} +.tox .tox-comment__loading-text { + align-items: center; + color: #fff; + display: flex; + flex-direction: column; + position: relative; +} +.tox .tox-comment__loading-text > div { + padding-bottom: 16px; +} +.tox .tox-comment__overlaytext { + bottom: 0; + flex-direction: column; + font-size: 14px; + left: 0; + padding: 1em; + position: absolute; + right: 0; + top: 0; + z-index: 10; +} +.tox .tox-comment__overlaytext p { + background-color: #2b3b4e; + box-shadow: 0 0 8px 8px #2b3b4e; + color: #fff; + text-align: center; +} +.tox .tox-comment__overlaytext div:nth-of-type(2) { + font-size: 0.8em; +} +.tox .tox-comment__busy-spinner { + align-items: center; + background-color: #2b3b4e; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 20; +} +.tox .tox-comment__scroll { + display: flex; + flex-direction: column; + flex-shrink: 1; + overflow: auto; +} +.tox .tox-conversations { + margin: 8px; +} +.tox:not([dir=rtl]) .tox-comment__edit { + margin-left: 8px; +} +.tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child, +.tox:not([dir=rtl]) .tox-comment__edit > *:last-child, +.tox:not([dir=rtl]) .tox-comment__reply > *:last-child { + margin-left: 8px; +} +.tox[dir=rtl] .tox-comment__edit { + margin-right: 8px; +} +.tox[dir=rtl] .tox-comment__buttonspacing > *:last-child, +.tox[dir=rtl] .tox-comment__edit > *:last-child, +.tox[dir=rtl] .tox-comment__reply > *:last-child { + margin-right: 8px; +} +.tox .tox-user { + align-items: center; + display: flex; +} +.tox .tox-user__avatar svg { + fill: rgba(255, 255, 255, 0.5); +} +.tox .tox-user__name { + color: rgba(255, 255, 255, 0.5); + font-size: 12px; + font-style: normal; + font-weight: bold; + text-transform: uppercase; +} +.tox:not([dir=rtl]) .tox-user__avatar svg { + margin-right: 8px; +} +.tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name { + margin-left: 8px; +} +.tox[dir=rtl] .tox-user__avatar svg { + margin-left: 8px; +} +.tox[dir=rtl] .tox-user__avatar + .tox-user__name { + margin-right: 8px; +} +.tox .tox-dialog-wrap { + align-items: center; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 1100; +} +.tox .tox-dialog-wrap__backdrop { + background-color: rgba(34, 47, 62, 0.75); + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 1; +} +.tox .tox-dialog-wrap__backdrop--opaque { + background-color: #222f3e; +} +.tox .tox-dialog { + background-color: #2b3b4e; + border-color: #000000; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: 0 16px 16px -10px rgba(42, 55, 70, 0.15), 0 0 40px 1px rgba(42, 55, 70, 0.15); + display: flex; + flex-direction: column; + max-height: 100%; + max-width: 480px; + overflow: hidden; + position: relative; + width: 95vw; + z-index: 2; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog { + align-self: flex-start; + margin: 8px auto; + width: calc(100vw - 16px); + } +} +.tox .tox-dialog-inline { + z-index: 1100; +} +.tox .tox-dialog__header { + align-items: center; + background-color: #2b3b4e; + border-bottom: none; + color: #fff; + display: flex; + font-size: 16px; + justify-content: space-between; + padding: 8px 16px 0 16px; + position: relative; +} +.tox .tox-dialog__header .tox-button { + z-index: 1; +} +.tox .tox-dialog__draghandle { + cursor: grab; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.tox .tox-dialog__draghandle:active { + cursor: grabbing; +} +.tox .tox-dialog__dismiss { + margin-left: auto; +} +.tox .tox-dialog__title { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 20px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin: 0; + text-transform: none; +} +.tox .tox-dialog__body { + color: #fff; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + min-width: 0; + text-align: left; + text-transform: none; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body { + flex-direction: column; + } +} +.tox .tox-dialog__body-nav { + align-items: flex-start; + display: flex; + flex-direction: column; + padding: 16px 16px; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { + flex-direction: row; + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding-bottom: 0; + } +} +.tox .tox-dialog__body-nav-item { + border-bottom: 2px solid transparent; + color: rgba(255, 255, 255, 0.5); + display: inline-block; + font-size: 14px; + line-height: 1.3; + margin-bottom: 8px; + text-decoration: none; + white-space: nowrap; +} +.tox .tox-dialog__body-nav-item:focus { + background-color: rgba(32, 122, 183, 0.1); +} +.tox .tox-dialog__body-nav-item--active { + border-bottom: 2px solid #207ab7; + color: #207ab7; +} +.tox .tox-dialog__body-content { + box-sizing: border-box; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; + max-height: 650px; + overflow: auto; + -webkit-overflow-scrolling: touch; + padding: 16px 16px; +} +.tox .tox-dialog__body-content > * { + margin-bottom: 0; + margin-top: 16px; +} +.tox .tox-dialog__body-content > *:first-child { + margin-top: 0; +} +.tox .tox-dialog__body-content > *:last-child { + margin-bottom: 0; +} +.tox .tox-dialog__body-content > *:only-child { + margin-bottom: 0; + margin-top: 0; +} +.tox .tox-dialog__body-content a { + color: #207ab7; + cursor: pointer; + text-decoration: none; +} +.tox .tox-dialog__body-content a:hover, +.tox .tox-dialog__body-content a:focus { + color: #185d8c; + text-decoration: none; +} +.tox .tox-dialog__body-content a:active { + color: #185d8c; + text-decoration: none; +} +.tox .tox-dialog__body-content svg { + fill: #fff; +} +.tox .tox-dialog__body-content ul { + display: block; + list-style-type: disc; + margin-bottom: 16px; + -webkit-margin-end: 0; + margin-inline-end: 0; + -webkit-margin-start: 0; + margin-inline-start: 0; + -webkit-padding-start: 2.5rem; + padding-inline-start: 2.5rem; +} +.tox .tox-dialog__body-content .tox-form__group h1 { + font-size: 20px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.tox .tox-dialog__body-content .tox-form__group h2 { + font-size: 16px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.tox .tox-dialog__body-content .tox-form__group p { + margin-bottom: 16px; +} +.tox .tox-dialog__body-content .tox-form__group h1:first-child, +.tox .tox-dialog__body-content .tox-form__group h2:first-child, +.tox .tox-dialog__body-content .tox-form__group p:first-child { + margin-top: 0; +} +.tox .tox-dialog__body-content .tox-form__group h1:last-child, +.tox .tox-dialog__body-content .tox-form__group h2:last-child, +.tox .tox-dialog__body-content .tox-form__group p:last-child { + margin-bottom: 0; +} +.tox .tox-dialog__body-content .tox-form__group h1:only-child, +.tox .tox-dialog__body-content .tox-form__group h2:only-child, +.tox .tox-dialog__body-content .tox-form__group p:only-child { + margin-bottom: 0; + margin-top: 0; +} +.tox .tox-dialog--width-lg { + height: 650px; + max-width: 1200px; +} +.tox .tox-dialog--width-md { + max-width: 800px; +} +.tox .tox-dialog--width-md .tox-dialog__body-content { + overflow: auto; +} +.tox .tox-dialog__body-content--centered { + text-align: center; +} +.tox .tox-dialog__footer { + align-items: center; + background-color: #2b3b4e; + border-top: 1px solid #000000; + display: flex; + justify-content: space-between; + padding: 8px 16px; +} +.tox .tox-dialog__footer-start, +.tox .tox-dialog__footer-end { + display: flex; +} +.tox .tox-dialog__busy-spinner { + align-items: center; + background-color: rgba(34, 47, 62, 0.75); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 3; +} +.tox .tox-dialog__table { + border-collapse: collapse; + width: 100%; +} +.tox .tox-dialog__table thead th { + font-weight: bold; + padding-bottom: 8px; +} +.tox .tox-dialog__table tbody tr { + border-bottom: 1px solid #000000; +} +.tox .tox-dialog__table tbody tr:last-child { + border-bottom: none; +} +.tox .tox-dialog__table td { + padding-bottom: 8px; + padding-top: 8px; +} +.tox .tox-dialog__popups { + position: absolute; + width: 100%; + z-index: 1100; +} +.tox .tox-dialog__body-iframe { + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; +} +.tox .tox-dialog__body-iframe .tox-navobj { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) { + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; +} +.tox .tox-dialog-dock-fadeout { + opacity: 0; + visibility: hidden; +} +.tox .tox-dialog-dock-fadein { + opacity: 1; + visibility: visible; +} +.tox .tox-dialog-dock-transition { + transition: visibility 0s linear 0.3s, opacity 0.3s ease; +} +.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein { + transition-delay: 0s; +} +body.tox-dialog__disable-scroll { + overflow: hidden; +} +.tox.tox-platform-ie { + /* IE11 CSS styles go here */ +} +.tox.tox-platform-ie .tox-dialog-wrap { + position: -ms-device-fixed; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { + margin-right: 0; + } +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { + margin-left: 8px; + } +} +.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *, +.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * { + margin-left: 8px; +} +.tox[dir=rtl] .tox-dialog__body { + text-align: right; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { + margin-left: 0; + } +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { + margin-right: 8px; + } +} +.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *, +.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * { + margin-right: 8px; +} +.tox .tox-dropzone-container { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-dropzone { + align-items: center; + background: #fff; + border: 2px dashed #000000; + box-sizing: border-box; + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: center; + min-height: 100px; + padding: 10px; +} +.tox .tox-dropzone p { + color: rgba(255, 255, 255, 0.5); + margin: 0 0 16px 0; +} +.tox .tox-edit-area { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + overflow: hidden; + position: relative; +} +.tox .tox-edit-area__iframe { + background-color: #fff; + border: 0; + box-sizing: border-box; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; + position: absolute; + width: 100%; +} +.tox.tox-inline-edit-area { + border: 1px dotted #000000; +} +.tox .tox-editor-container { + display: flex; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; +} +.tox .tox-editor-header { + z-index: 1; +} +.tox:not(.tox-tinymce-inline) .tox-editor-header { + box-shadow: none; + transition: box-shadow 0.5s; +} +.tox.tox-tinymce--toolbar-bottom .tox-editor-header, +.tox.tox-tinymce-inline .tox-editor-header { + margin-bottom: -1px; +} +.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header { + box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); +} +.tox-editor-dock-fadeout { + opacity: 0; + visibility: hidden; +} +.tox-editor-dock-fadein { + opacity: 1; + visibility: visible; +} +.tox-editor-dock-transition { + transition: visibility 0s linear 0.25s, opacity 0.25s ease; +} +.tox-editor-dock-transition.tox-editor-dock-fadein { + transition-delay: 0s; +} +.tox .tox-control-wrap { + flex: 1; + position: relative; +} +.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid, +.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown, +.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid { + display: none; +} +.tox .tox-control-wrap svg { + display: block; +} +.tox .tox-control-wrap__status-icon-wrap { + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.tox .tox-control-wrap__status-icon-invalid svg { + fill: #c00; +} +.tox .tox-control-wrap__status-icon-unknown svg { + fill: orange; +} +.tox .tox-control-wrap__status-icon-valid svg { + fill: green; +} +.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield, +.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield, +.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield { + padding-right: 32px; +} +.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap { + right: 4px; +} +.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield, +.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield, +.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield { + padding-left: 32px; +} +.tox[dir=rtl] .tox-control-wrap__status-icon-wrap { + left: 4px; +} +.tox .tox-autocompleter { + max-width: 25em; +} +.tox .tox-autocompleter .tox-menu { + max-width: 25em; +} +.tox .tox-autocompleter .tox-autocompleter-highlight { + font-weight: bold; +} +.tox .tox-color-input { + display: flex; + position: relative; + z-index: 1; +} +.tox .tox-color-input .tox-textfield { + z-index: -1; +} +.tox .tox-color-input span { + border-color: rgba(42, 55, 70, 0.2); + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + cursor: pointer; + height: 24px; + position: absolute; + top: 6px; + width: 24px; +} +.tox .tox-color-input span:focus { + border-color: #207ab7; +} +.tox .tox-color-input span::before { + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%); + background-position: 0 0, 0 6px, 6px -6px, -6px 0; + background-size: 12px 12px; + border: 1px solid #2b3b4e; + border-radius: 3px; + box-sizing: border-box; + content: ''; + height: 24px; + left: -1px; + position: absolute; + top: -1px; + width: 24px; + z-index: -1; +} +.tox:not([dir=rtl]) .tox-color-input .tox-textfield { + padding-left: 36px; +} +.tox:not([dir=rtl]) .tox-color-input span { + left: 6px; +} +.tox[dir="rtl"] .tox-color-input .tox-textfield { + padding-right: 36px; +} +.tox[dir="rtl"] .tox-color-input span { + right: 6px; +} +.tox .tox-label, +.tox .tox-toolbar-label { + color: rgba(255, 255, 255, 0.5); + display: block; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + padding: 0 8px 0 0; + text-transform: none; + white-space: nowrap; +} +.tox .tox-toolbar-label { + padding: 0 8px; +} +.tox[dir=rtl] .tox-label { + padding: 0 0 0 8px; +} +.tox .tox-form { + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group { + box-sizing: border-box; + margin-bottom: 4px; +} +.tox .tox-form-group--maximize { + flex: 1; +} +.tox .tox-form__group--error { + color: #c00; +} +.tox .tox-form__group--collection { + display: flex; +} +.tox .tox-form__grid { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; +} +.tox .tox-form__grid--2col > .tox-form__group { + width: calc(50% - (8px / 2)); +} +.tox .tox-form__grid--3col > .tox-form__group { + width: calc(100% / 3 - (8px / 2)); +} +.tox .tox-form__grid--4col > .tox-form__group { + width: calc(25% - (8px / 2)); +} +.tox .tox-form__controls-h-stack { + align-items: center; + display: flex; +} +.tox .tox-form__group--inline { + align-items: center; + display: flex; +} +.tox .tox-form__group--stretched { + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group--stretched .tox-textarea { + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group--stretched .tox-navobj { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group--stretched .tox-navobj :nth-child(2) { + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; +} +.tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) { + margin-left: 4px; +} +.tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) { + margin-right: 4px; +} +.tox .tox-lock.tox-locked .tox-lock-icon__unlock, +.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock { + display: none; +} +.tox .tox-textfield, +.tox .tox-toolbar-textfield, +.tox .tox-selectfield select, +.tox .tox-textarea { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #2b3b4e; + border-color: #000000; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + min-height: 34px; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} +.tox .tox-textfield[disabled], +.tox .tox-textarea[disabled] { + background-color: #222f3e; + color: rgba(255, 255, 255, 0.85); + cursor: not-allowed; +} +.tox .tox-textfield:focus, +.tox .tox-selectfield select:focus, +.tox .tox-textarea:focus { + border-color: #207ab7; + box-shadow: none; + outline: none; +} +.tox .tox-toolbar-textfield { + border-width: 0; + margin-bottom: 3px; + margin-top: 2px; + max-width: 250px; +} +.tox .tox-naked-btn { + background-color: transparent; + border: 0; + border-color: transparent; + box-shadow: unset; + color: #207ab7; + cursor: pointer; + display: block; + margin: 0; + padding: 0; +} +.tox .tox-naked-btn svg { + display: block; + fill: #fff; +} +.tox:not([dir=rtl]) .tox-toolbar-textfield + * { + margin-left: 4px; +} +.tox[dir=rtl] .tox-toolbar-textfield + * { + margin-right: 4px; +} +.tox .tox-selectfield { + cursor: pointer; + position: relative; +} +.tox .tox-selectfield select[disabled] { + background-color: #19232e; + color: rgba(255, 255, 255, 0.85); + cursor: not-allowed; +} +.tox .tox-selectfield select::-ms-expand { + display: none; +} +.tox .tox-selectfield svg { + pointer-events: none; + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.tox:not([dir=rtl]) .tox-selectfield select[size="0"], +.tox:not([dir=rtl]) .tox-selectfield select[size="1"] { + padding-right: 24px; +} +.tox:not([dir=rtl]) .tox-selectfield svg { + right: 8px; +} +.tox[dir=rtl] .tox-selectfield select[size="0"], +.tox[dir=rtl] .tox-selectfield select[size="1"] { + padding-left: 24px; +} +.tox[dir=rtl] .tox-selectfield svg { + left: 8px; +} +.tox .tox-textarea { + -webkit-appearance: textarea; + -moz-appearance: textarea; + appearance: textarea; + white-space: pre-wrap; +} +.tox-fullscreen { + border: 0; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + -ms-scroll-chaining: none; + overscroll-behavior: none; + padding: 0; + position: fixed; + top: 0; + touch-action: pinch-zoom; + width: 100%; +} +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { + display: none; +} +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen { + z-index: 1200; +} +.tox-fullscreen .tox.tox-tinymce-aux { + z-index: 1201; +} +.tox .tox-help__more-link { + list-style: none; + margin-top: 1em; +} +.tox .tox-image-tools { + width: 100%; +} +.tox .tox-image-tools__toolbar { + align-items: center; + display: flex; + justify-content: center; +} +.tox .tox-image-tools__image { + background-color: #666; + height: 380px; + overflow: auto; + position: relative; + width: 100%; +} +.tox .tox-image-tools__image, +.tox .tox-image-tools__image + .tox-image-tools__toolbar { + margin-top: 8px; +} +.tox .tox-image-tools__image-bg { + background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); +} +.tox .tox-image-tools__toolbar > .tox-spacer { + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-croprect-block { + background: black; + filter: alpha(opacity=50); + opacity: 0.5; + position: absolute; + zoom: 1; +} +.tox .tox-croprect-handle { + border: 2px solid white; + height: 20px; + left: 0; + position: absolute; + top: 0; + width: 20px; +} +.tox .tox-croprect-handle-move { + border: 0; + cursor: move; + position: absolute; +} +.tox .tox-croprect-handle-nw { + border-width: 2px 0 0 2px; + cursor: nw-resize; + left: 100px; + margin: -2px 0 0 -2px; + top: 100px; +} +.tox .tox-croprect-handle-ne { + border-width: 2px 2px 0 0; + cursor: ne-resize; + left: 200px; + margin: -2px 0 0 -20px; + top: 100px; +} +.tox .tox-croprect-handle-sw { + border-width: 0 0 2px 2px; + cursor: sw-resize; + left: 100px; + margin: -20px 2px 0 -2px; + top: 200px; +} +.tox .tox-croprect-handle-se { + border-width: 0 2px 2px 0; + cursor: se-resize; + left: 200px; + margin: -20px 0 0 -20px; + top: 200px; +} +.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { + margin-left: 8px; +} +.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider { + margin-left: 32px; +} +.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button { + margin-left: 32px; +} +.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { + margin-right: 8px; +} +.tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider { + margin-right: 32px; +} +.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button { + margin-right: 32px; +} +.tox .tox-insert-table-picker { + display: flex; + flex-wrap: wrap; + width: 169px; +} +.tox .tox-insert-table-picker > div { + border-color: #000000; + border-style: solid; + border-width: 0 1px 1px 0; + box-sizing: content-box; + height: 16px; + width: 16px; +} +.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker { + margin: -4px 0; +} +.tox .tox-insert-table-picker .tox-insert-table-picker__selected { + background-color: rgba(32, 122, 183, 0.5); + border-color: rgba(32, 122, 183, 0.5); +} +.tox .tox-insert-table-picker__label { + color: #fff; + display: block; + font-size: 14px; + padding: 4px; + text-align: center; + width: 100%; +} +.tox:not([dir=rtl]) { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) { + border-right: 0; +} +.tox[dir=rtl] { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) { + border-right: 0; +} +.tox { + /* stylelint-disable */ + /* stylelint-enable */ +} +.tox .tox-menu { + background-color: #2b3b4e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); + display: inline-block; + overflow: hidden; + vertical-align: top; + z-index: 1150; +} +.tox .tox-menu.tox-collection.tox-collection--list { + padding: 0; +} +.tox .tox-menu.tox-collection.tox-collection--toolbar { + padding: 4px; +} +.tox .tox-menu.tox-collection.tox-collection--grid { + padding: 4px; +} +.tox .tox-menu__label h1, +.tox .tox-menu__label h2, +.tox .tox-menu__label h3, +.tox .tox-menu__label h4, +.tox .tox-menu__label h5, +.tox .tox-menu__label h6, +.tox .tox-menu__label p, +.tox .tox-menu__label blockquote, +.tox .tox-menu__label code { + margin: 0; +} +.tox .tox-menubar { + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; + background-color: #222f3e; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 4px 0 4px; +} +.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar { + border-top: 1px solid #000000; +} +/* Deprecated. Remove in next major release */ +.tox .tox-mbtn { + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #fff; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0 4px; + text-transform: none; + width: auto; +} +.tox .tox-mbtn[disabled] { + background-color: transparent; + border: 0; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} +.tox .tox-mbtn:focus:not(:disabled) { + background: #4a5562; + border: 0; + box-shadow: none; + color: #fff; +} +.tox .tox-mbtn--active { + background: #757d87; + border: 0; + box-shadow: none; + color: #fff; +} +.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) { + background: #4a5562; + border: 0; + box-shadow: none; + color: #fff; +} +.tox .tox-mbtn__select-label { + cursor: default; + font-weight: normal; + margin: 0 4px; +} +.tox .tox-mbtn[disabled] .tox-mbtn__select-label { + cursor: not-allowed; +} +.tox .tox-mbtn__select-chevron { + align-items: center; + display: flex; + justify-content: center; + width: 16px; + display: none; +} +.tox .tox-notification { + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + display: -ms-grid; + display: grid; + font-size: 14px; + font-weight: normal; + -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + margin-top: 4px; + opacity: 0; + padding: 4px; + transition: transform 100ms ease-in, opacity 150ms ease-in; +} +.tox .tox-notification p { + font-size: 14px; + font-weight: normal; +} +.tox .tox-notification a { + text-decoration: underline; +} +.tox .tox-notification--in { + opacity: 1; +} +.tox .tox-notification--success { + background-color: #e4eeda; + border-color: #d7e6c8; + color: #fff; +} +.tox .tox-notification--success p { + color: #fff; +} +.tox .tox-notification--success a { + color: #547831; +} +.tox .tox-notification--success svg { + fill: #fff; +} +.tox .tox-notification--error { + background-color: #f8dede; + border-color: #f2bfbf; + color: #fff; +} +.tox .tox-notification--error p { + color: #fff; +} +.tox .tox-notification--error a { + color: #c00; +} +.tox .tox-notification--error svg { + fill: #fff; +} +.tox .tox-notification--warn, +.tox .tox-notification--warning { + background-color: #fffaea; + border-color: #ffe89d; + color: #fff; +} +.tox .tox-notification--warn p, +.tox .tox-notification--warning p { + color: #fff; +} +.tox .tox-notification--warn a, +.tox .tox-notification--warning a { + color: #fff; +} +.tox .tox-notification--warn svg, +.tox .tox-notification--warning svg { + fill: #fff; +} +.tox .tox-notification--info { + background-color: #d9edf7; + border-color: #779ecb; + color: #fff; +} +.tox .tox-notification--info p { + color: #fff; +} +.tox .tox-notification--info a { + color: #fff; +} +.tox .tox-notification--info svg { + fill: #fff; +} +.tox .tox-notification__body { + -ms-grid-row-align: center; + align-self: center; + color: #fff; + font-size: 14px; + -ms-grid-column-span: 1; + grid-column-end: 3; + -ms-grid-column: 2; + grid-column-start: 2; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + text-align: center; + white-space: normal; + word-break: break-all; + word-break: break-word; +} +.tox .tox-notification__body > * { + margin: 0; +} +.tox .tox-notification__body > * + * { + margin-top: 1rem; +} +.tox .tox-notification__icon { + -ms-grid-row-align: center; + align-self: center; + -ms-grid-column-span: 1; + grid-column-end: 2; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} +.tox .tox-notification__icon svg { + display: block; +} +.tox .tox-notification__dismiss { + -ms-grid-row-align: start; + align-self: start; + -ms-grid-column-span: 1; + grid-column-end: 4; + -ms-grid-column: 3; + grid-column-start: 3; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} +.tox .tox-notification .tox-progress-bar { + -ms-grid-column-span: 3; + grid-column-end: 4; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 3; + -ms-grid-row: 2; + grid-row-start: 2; + -ms-grid-column-align: center; + justify-self: center; +} +.tox .tox-pop { + display: inline-block; + position: relative; +} +.tox .tox-pop--resizing { + transition: width 0.1s ease; +} +.tox .tox-pop--resizing .tox-toolbar { + flex-wrap: nowrap; +} +.tox .tox-pop__dialog { + background-color: #222f3e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + min-width: 0; + overflow: hidden; +} +.tox .tox-pop__dialog > *:not(.tox-toolbar) { + margin: 4px 4px 4px 8px; +} +.tox .tox-pop__dialog .tox-toolbar { + background-color: transparent; + margin-bottom: -1px; +} +.tox .tox-pop::before, +.tox .tox-pop::after { + border-style: solid; + content: ''; + display: block; + height: 0; + position: absolute; + width: 0; +} +.tox .tox-pop.tox-pop--bottom::before, +.tox .tox-pop.tox-pop--bottom::after { + left: 50%; + top: 100%; +} +.tox .tox-pop.tox-pop--bottom::after { + border-color: #222f3e transparent transparent transparent; + border-width: 8px; + margin-left: -8px; + margin-top: -1px; +} +.tox .tox-pop.tox-pop--bottom::before { + border-color: #000000 transparent transparent transparent; + border-width: 9px; + margin-left: -9px; +} +.tox .tox-pop.tox-pop--top::before, +.tox .tox-pop.tox-pop--top::after { + left: 50%; + top: 0; + transform: translateY(-100%); +} +.tox .tox-pop.tox-pop--top::after { + border-color: transparent transparent #222f3e transparent; + border-width: 8px; + margin-left: -8px; + margin-top: 1px; +} +.tox .tox-pop.tox-pop--top::before { + border-color: transparent transparent #000000 transparent; + border-width: 9px; + margin-left: -9px; +} +.tox .tox-pop.tox-pop--left::before, +.tox .tox-pop.tox-pop--left::after { + left: 0; + top: calc(50% - 1px); + transform: translateY(-50%); +} +.tox .tox-pop.tox-pop--left::after { + border-color: transparent #222f3e transparent transparent; + border-width: 8px; + margin-left: -15px; +} +.tox .tox-pop.tox-pop--left::before { + border-color: transparent #000000 transparent transparent; + border-width: 10px; + margin-left: -19px; +} +.tox .tox-pop.tox-pop--right::before, +.tox .tox-pop.tox-pop--right::after { + left: 100%; + top: calc(50% + 1px); + transform: translateY(-50%); +} +.tox .tox-pop.tox-pop--right::after { + border-color: transparent transparent transparent #222f3e; + border-width: 8px; + margin-left: -1px; +} +.tox .tox-pop.tox-pop--right::before { + border-color: transparent transparent transparent #000000; + border-width: 10px; + margin-left: -1px; +} +.tox .tox-pop.tox-pop--align-left::before, +.tox .tox-pop.tox-pop--align-left::after { + left: 20px; +} +.tox .tox-pop.tox-pop--align-right::before, +.tox .tox-pop.tox-pop--align-right::after { + left: calc(100% - 20px); +} +.tox .tox-sidebar-wrap { + display: flex; + flex-direction: row; + flex-grow: 1; + -ms-flex-preferred-size: 0; + min-height: 0; +} +.tox .tox-sidebar { + background-color: #222f3e; + display: flex; + flex-direction: row; + justify-content: flex-end; +} +.tox .tox-sidebar__slider { + display: flex; + overflow: hidden; +} +.tox .tox-sidebar__pane-container { + display: flex; +} +.tox .tox-sidebar__pane { + display: flex; +} +.tox .tox-sidebar--sliding-closed { + opacity: 0; +} +.tox .tox-sidebar--sliding-open { + opacity: 1; +} +.tox .tox-sidebar--sliding-growing, +.tox .tox-sidebar--sliding-shrinking { + transition: width 0.5s ease, opacity 0.5s ease; +} +.tox .tox-selector { + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + display: inline-block; + height: 10px; + position: absolute; + width: 10px; +} +.tox.tox-platform-touch .tox-selector { + height: 12px; + width: 12px; +} +.tox .tox-slider { + align-items: center; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + height: 24px; + justify-content: center; + position: relative; +} +.tox .tox-slider__rail { + background-color: transparent; + border: 1px solid #000000; + border-radius: 3px; + height: 10px; + min-width: 120px; + width: 100%; +} +.tox .tox-slider__handle { + background-color: #207ab7; + border: 2px solid #185d8c; + border-radius: 3px; + box-shadow: none; + height: 24px; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: 14px; +} +.tox .tox-source-code { + overflow: auto; +} +.tox .tox-spinner { + display: flex; +} +.tox .tox-spinner > div { + animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; + background-color: rgba(255, 255, 255, 0.5); + border-radius: 100%; + height: 8px; + width: 8px; +} +.tox .tox-spinner > div:nth-child(1) { + animation-delay: -0.32s; +} +.tox .tox-spinner > div:nth-child(2) { + animation-delay: -0.16s; +} +@keyframes tam-bouncing-dots { + 0%, + 80%, + 100% { + transform: scale(0); + } + 40% { + transform: scale(1); + } +} +.tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) { + margin-left: 4px; +} +.tox[dir=rtl] .tox-spinner > div:not(:first-child) { + margin-right: 4px; +} +.tox .tox-statusbar { + align-items: center; + background-color: #222f3e; + border-top: 1px solid #000000; + color: #fff; + display: flex; + flex: 0 0 auto; + font-size: 12px; + font-weight: normal; + height: 18px; + overflow: hidden; + padding: 0 8px; + position: relative; + text-transform: uppercase; +} +.tox .tox-statusbar__text-container { + display: flex; + flex: 1 1 auto; + justify-content: flex-end; + overflow: hidden; +} +.tox .tox-statusbar__path { + display: flex; + flex: 1 1 auto; + margin-right: auto; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.tox .tox-statusbar__path > * { + display: inline; + white-space: nowrap; +} +.tox .tox-statusbar__wordcount { + flex: 0 0 auto; + margin-left: 1ch; +} +.tox .tox-statusbar a, +.tox .tox-statusbar__path-item, +.tox .tox-statusbar__wordcount { + color: #fff; + text-decoration: none; +} +.tox .tox-statusbar a:hover, +.tox .tox-statusbar__path-item:hover, +.tox .tox-statusbar__wordcount:hover, +.tox .tox-statusbar a:focus, +.tox .tox-statusbar__path-item:focus, +.tox .tox-statusbar__wordcount:focus { + cursor: pointer; + text-decoration: underline; +} +.tox .tox-statusbar__resize-handle { + align-items: flex-end; + align-self: stretch; + cursor: nwse-resize; + display: flex; + flex: 0 0 auto; + justify-content: flex-end; + margin-left: auto; + margin-right: -8px; + padding-left: 1ch; +} +.tox .tox-statusbar__resize-handle svg { + display: block; + fill: #fff; +} +.tox:not([dir=rtl]) .tox-statusbar__path > * { + margin-right: 4px; +} +.tox:not([dir=rtl]) .tox-statusbar__branding { + margin-left: 1ch; +} +.tox[dir=rtl] .tox-statusbar { + flex-direction: row-reverse; +} +.tox[dir=rtl] .tox-statusbar__path > * { + margin-left: 4px; +} +.tox .tox-throbber { + z-index: 1400; +} +.tox .tox-throbber__busy-spinner { + align-items: center; + background-color: rgba(34, 47, 62, 0.6); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; +} +.tox .tox-tbtn { + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #fff; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0; + text-transform: none; + width: 34px; +} +.tox .tox-tbtn svg { + display: block; + fill: #fff; +} +.tox .tox-tbtn.tox-tbtn-more { + padding-left: 5px; + padding-right: 5px; + width: inherit; +} +.tox .tox-tbtn:focus { + background: #4a5562; + border: 0; + box-shadow: none; +} +.tox .tox-tbtn:hover { + background: #4a5562; + border: 0; + box-shadow: none; + color: #fff; +} +.tox .tox-tbtn:hover svg { + fill: #fff; +} +.tox .tox-tbtn:active { + background: #757d87; + border: 0; + box-shadow: none; + color: #fff; +} +.tox .tox-tbtn:active svg { + fill: #fff; +} +.tox .tox-tbtn--disabled, +.tox .tox-tbtn--disabled:hover, +.tox .tox-tbtn:disabled, +.tox .tox-tbtn:disabled:hover { + background: transparent; + border: 0; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} +.tox .tox-tbtn--disabled svg, +.tox .tox-tbtn--disabled:hover svg, +.tox .tox-tbtn:disabled svg, +.tox .tox-tbtn:disabled:hover svg { + /* stylelint-disable-line no-descending-specificity */ + fill: rgba(255, 255, 255, 0.5); +} +.tox .tox-tbtn--enabled, +.tox .tox-tbtn--enabled:hover { + background: #757d87; + border: 0; + box-shadow: none; + color: #fff; +} +.tox .tox-tbtn--enabled > *, +.tox .tox-tbtn--enabled:hover > * { + transform: none; +} +.tox .tox-tbtn--enabled svg, +.tox .tox-tbtn--enabled:hover svg { + /* stylelint-disable-line no-descending-specificity */ + fill: #fff; +} +.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) { + color: #fff; +} +.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg { + fill: #fff; +} +.tox .tox-tbtn:active > * { + transform: none; +} +.tox .tox-tbtn--md { + height: 51px; + width: 51px; +} +.tox .tox-tbtn--lg { + flex-direction: column; + height: 68px; + width: 68px; +} +.tox .tox-tbtn--return { + -ms-grid-row-align: stretch; + align-self: stretch; + height: unset; + width: 16px; +} +.tox .tox-tbtn--labeled { + padding: 0 4px; + width: unset; +} +.tox .tox-tbtn__vlabel { + display: block; + font-size: 10px; + font-weight: normal; + letter-spacing: -0.025em; + margin-bottom: 4px; + white-space: nowrap; +} +.tox .tox-tbtn--select { + margin: 2px 0 3px 0; + padding: 0 4px; + width: auto; +} +.tox .tox-tbtn__select-label { + cursor: default; + font-weight: normal; + margin: 0 4px; +} +.tox .tox-tbtn__select-chevron { + align-items: center; + display: flex; + justify-content: center; + width: 16px; +} +.tox .tox-tbtn__select-chevron svg { + fill: rgba(255, 255, 255, 0.5); +} +.tox .tox-tbtn--bespoke .tox-tbtn__select-label { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 7em; +} +.tox .tox-split-button { + border: 0; + border-radius: 3px; + box-sizing: border-box; + display: flex; + margin: 2px 0 3px 0; + overflow: hidden; +} +.tox .tox-split-button:hover { + box-shadow: 0 0 0 1px #4a5562 inset; +} +.tox .tox-split-button:focus { + background: #4a5562; + box-shadow: none; + color: #fff; +} +.tox .tox-split-button > * { + border-radius: 0; +} +.tox .tox-split-button__chevron { + width: 16px; +} +.tox .tox-split-button__chevron svg { + fill: rgba(255, 255, 255, 0.5); +} +.tox .tox-split-button .tox-tbtn { + margin: 0; +} +.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child { + width: 30px; +} +.tox.tox-platform-touch .tox-split-button__chevron { + width: 20px; +} +.tox .tox-split-button.tox-tbtn--disabled:hover, +.tox .tox-split-button.tox-tbtn--disabled:focus, +.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover, +.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus { + background: transparent; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); +} +.tox .tox-toolbar-overlord { + background-color: #222f3e; +} +.tox .tox-toolbar, +.tox .tox-toolbar__primary, +.tox .tox-toolbar__overflow { + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; + background-color: #222f3e; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 0; +} +.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed { + height: 0; + opacity: 0; + padding-bottom: 0; + padding-top: 0; + visibility: hidden; +} +.tox .tox-toolbar__overflow--growing { + transition: height 0.3s ease, opacity 0.2s linear 0.1s; +} +.tox .tox-toolbar__overflow--shrinking { + transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; +} +.tox .tox-menubar + .tox-toolbar, +.tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary { + border-top: 1px solid #000000; + margin-top: -1px; +} +.tox .tox-toolbar--scrolling { + flex-wrap: nowrap; + overflow-x: auto; +} +.tox .tox-pop .tox-toolbar { + border-width: 0; +} +.tox .tox-toolbar--no-divider { + background-image: none; +} +.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child, +.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary { + border-top: 1px solid #000000; +} +.tox.tox-tinymce-aux .tox-toolbar__overflow { + background-color: #222f3e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); +} +.tox[dir=rtl] .tox-tbtn__icon-rtl svg { + transform: rotateY(180deg); +} +.tox .tox-toolbar__group { + align-items: center; + display: flex; + flex-wrap: wrap; + margin: 0 0; + padding: 0 4px 0 4px; +} +.tox .tox-toolbar__group--pull-right { + margin-left: auto; +} +.tox .tox-toolbar--scrolling .tox-toolbar__group { + flex-shrink: 0; + flex-wrap: nowrap; +} +.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) { + border-right: 1px solid #000000; +} +.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { + border-left: 1px solid #000000; +} +.tox .tox-tooltip { + display: inline-block; + padding: 8px; + position: relative; +} +.tox .tox-tooltip__body { + background-color: #3d546f; + border-radius: 3px; + box-shadow: 0 2px 4px rgba(42, 55, 70, 0.3); + color: rgba(255, 255, 255, 0.75); + font-size: 14px; + font-style: normal; + font-weight: normal; + padding: 4px 8px; + text-transform: none; +} +.tox .tox-tooltip__arrow { + position: absolute; +} +.tox .tox-tooltip--down .tox-tooltip__arrow { + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid #3d546f; + bottom: 0; + left: 50%; + position: absolute; + transform: translateX(-50%); +} +.tox .tox-tooltip--up .tox-tooltip__arrow { + border-bottom: 8px solid #3d546f; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + left: 50%; + position: absolute; + top: 0; + transform: translateX(-50%); +} +.tox .tox-tooltip--right .tox-tooltip__arrow { + border-bottom: 8px solid transparent; + border-left: 8px solid #3d546f; + border-top: 8px solid transparent; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); +} +.tox .tox-tooltip--left .tox-tooltip__arrow { + border-bottom: 8px solid transparent; + border-right: 8px solid #3d546f; + border-top: 8px solid transparent; + left: 0; + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.tox .tox-well { + border: 1px solid #000000; + border-radius: 3px; + padding: 8px; + width: 100%; +} +.tox .tox-well > *:first-child { + margin-top: 0; +} +.tox .tox-well > *:last-child { + margin-bottom: 0; +} +.tox .tox-well > *:only-child { + margin: 0; +} +.tox .tox-custom-editor { + border: 1px solid #000000; + border-radius: 3px; + display: flex; + flex: 1; + position: relative; +} +/* stylelint-disable */ +.tox { + /* stylelint-enable */ +} +.tox .tox-dialog-loading::before { + background-color: rgba(0, 0, 0, 0.5); + content: ""; + height: 100%; + position: absolute; + width: 100%; + z-index: 1000; +} +.tox .tox-tab { + cursor: pointer; +} +.tox .tox-dialog__content-js { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-dialog__body-content .tox-collection { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-image-tools-edit-panel { + height: 60px; +} +.tox .tox-image-tools__sidebar { + height: 60px; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.min.css new file mode 100644 index 0000000..3ae13e0 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tox{box-sizing:content-box;color:#2a3746;cursor:auto;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:normal;-webkit-tap-highlight-color:transparent;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal}.tox :not(svg):not(rect){box-sizing:inherit;color:inherit;cursor:inherit;direction:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;-webkit-tap-highlight-color:inherit;text-align:inherit;text-decoration:inherit;text-shadow:inherit;text-transform:inherit;vertical-align:inherit;white-space:inherit}.tox :not(svg):not(rect){background:0 0;border:0;float:none;height:auto;margin:0;max-width:none;outline:0;padding:0;position:static;width:auto}.tox:not([dir=rtl]){direction:ltr;text-align:left}.tox[dir=rtl]{direction:rtl;text-align:right}.tox-tinymce{border:1px solid #000;border-radius:0;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;overflow:hidden;position:relative;visibility:inherit!important}.tox-tinymce-inline{border:none;box-shadow:none}.tox-tinymce-inline .tox-editor-header{border:1px solid #000;border-radius:0;box-shadow:none}.tox-tinymce-aux{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;z-index:1300}.tox-tinymce :focus,.tox-tinymce-aux :focus{outline:0}button::-moz-focus-inner{border:0}.tox .accessibility-issue__header{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description{align-items:stretch;border:1px solid #000;border-radius:3px;display:flex;justify-content:space-between}.tox .accessibility-issue__description>div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>:last-child:not(:only-child){border-color:#000;border-style:solid}.tox .accessibility-issue__repair{margin-top:16px}.tox .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.5);border-color:#207ab7;color:#fff}.tox .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:#207ab7}.tox .accessibility-issue--info h2{color:#fff}.tox .accessibility-issue--info .tox-icon svg{fill:#fff}.tox .accessibility-issue--info a .tox-icon{color:#fff}.tox .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.5);border-color:rgba(255,165,0,.8);color:#fff}.tox .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.8)}.tox .accessibility-issue--warn h2{color:#fff}.tox .accessibility-issue--warn .tox-icon svg{fill:#fff}.tox .accessibility-issue--warn a .tox-icon{color:#fff}.tox .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.5);border-color:rgba(204,0,0,.8);color:#fff}.tox .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.8)}.tox .accessibility-issue--error h2{color:#fff}.tox .accessibility-issue--error .tox-icon svg{fill:#fff}.tox .accessibility-issue--error a .tox-icon{color:#fff}.tox .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.5);border-color:rgba(120,171,70,.8);color:#fff}.tox .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.8)}.tox .accessibility-issue--success h2{color:#fff}.tox .accessibility-issue--success .tox-icon svg{fill:#fff}.tox .accessibility-issue--success a .tox-icon{color:#fff}.tox .tox-dialog__body-content .accessibility-issue__header h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{margin-top:0}.tox:not([dir=rtl]) .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .accessibility-issue__description>:last-child{border-right-width:1px;padding-right:4px}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#207ab7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#207ab7;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:0;padding:4px 16px;text-align:center;text-decoration:none;text-transform:capitalize;white-space:nowrap}.tox .tox-button[disabled]{background-color:#207ab7;background-image:none;border-color:#207ab7;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:hover:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#185d8c;background-image:none;border-color:#185d8c;box-shadow:none;color:#fff}.tox .tox-button--secondary{background-color:#3d546f;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#3d546f;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#fff;outline:0;padding:4px 16px;text-decoration:none;text-transform:capitalize}.tox .tox-button--secondary[disabled]{background-color:#3d546f;background-image:none;border-color:#3d546f;box-shadow:none;color:rgba(255,255,255,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#34485f;background-image:none;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--secondary:hover:not(:disabled){background-color:#34485f;background-image:none;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--secondary:active:not(:disabled){background-color:#2b3b4e;background-image:none;border-color:#2b3b4e;box-shadow:none;color:#fff}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#fff}.tox .tox-button--naked[disabled]{background-color:#3d546f;border-color:#3d546f;box-shadow:none;color:rgba(255,255,255,.5)}.tox .tox-button--naked:hover:not(:disabled){background-color:#34485f;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--naked:focus:not(:disabled){background-color:#34485f;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--naked:active:not(:disabled){background-color:#2b3b4e;border-color:#2b3b4e;box-shadow:none;color:#fff}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#fff}.tox .tox-checkbox{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:3px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:calc(4px - 1px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(255,255,255,.2)}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#207ab7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#207ab7}.tox .tox-checkbox--disabled{color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:rgba(255,255,255,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:rgba(255,255,255,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:rgba(255,255,255,.5)}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:3px;box-shadow:inset 0 0 0 1px #207ab7;padding:calc(4px - 1px)}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#1a1a1a;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#333;color:#fff;cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;color:#fff;cursor:pointer;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:#2b3b4e;color:#fff}.tox .tox-collection--list .tox-collection__item--active{background-color:#4a5562}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#757d87;color:#fff}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#4a5562}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#757d87;color:#fff}.tox .tox-collection--grid .tox-collection__item--active{background-color:#4a5562}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#fff}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#fff}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#fff}.tox .tox-collection__item--state-disabled{background-color:transparent;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;-ms-flex-preferred-size:auto;font-size:14px;font-style:normal;font-weight:400;line-height:24px;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:rgba(255,255,255,.5);display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret::after{content:'';font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:#fff}.tox .tox-collection__item[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--horizontal{background-color:#2b3b4e;border:1px solid #1a1a1a;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:34px;margin:2px 0 3px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid #000}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid #000}.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg{transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette{margin-left:15px}.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:2px 0 3px 4px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px 0}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#4a5562}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-comment-thread{background:#2b3b4e;position:relative}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment{background:#2b3b4e;border:1px solid #000;border-radius:3px;box-shadow:0 4px 8px 0 rgba(42,55,70,.1);padding:8px 8px 16px 8px;position:relative}.tox .tox-comment__header{align-items:center;color:#fff;display:flex;justify-content:space-between}.tox .tox-comment__date{color:rgba(255,255,255,.5);font-size:12px}.tox .tox-comment__body{color:#fff;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(255,255,255,.5);font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment-thread__overlay::after{background:#2b3b4e;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:16px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(43,59,78,0),#2b3b4e);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#2b3b4e;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#fff;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#2b3b4e;box-shadow:0 0 8px 8px #2b3b4e;color:#fff;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#2b3b4e;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(255,255,255,.5)}.tox .tox-user__name{color:rgba(255,255,255,.5);font-size:12px;font-style:normal;font-weight:700;text-transform:uppercase}.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar svg{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(34,47,62,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#222f3e}.tox .tox-dialog{background-color:#2b3b4e;border-color:#000;border-radius:3px;border-style:solid;border-width:1px;box-shadow:0 16px 16px -10px rgba(42,55,70,.15),0 0 40px 1px rgba(42,55,70,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#2b3b4e;border-bottom:none;color:#fff;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#fff;display:flex;flex:1;-ms-flex-preferred-size:auto;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;padding:16px 16px}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(255,255,255,.5);display:inline-block;font-size:14px;line-height:1.3;margin-bottom:8px;text-decoration:none;white-space:nowrap}.tox .tox-dialog__body-nav-item:focus{background-color:rgba(32,122,183,.1)}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #207ab7;color:#207ab7}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto;max-height:650px;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#207ab7;cursor:pointer;text-decoration:none}.tox .tox-dialog__body-content a:focus,.tox .tox-dialog__body-content a:hover{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content a:active{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content svg{fill:#fff}.tox .tox-dialog__body-content ul{display:block;list-style-type:disc;margin-bottom:16px;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.tox .tox-dialog__body-content .tox-form__group h1{font-size:20px;font-weight:700;margin-bottom:16px;margin-top:2rem}.tox .tox-dialog__body-content .tox-form__group h2{font-size:16px;font-weight:700;margin-bottom:16px;margin-top:2rem}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#2b3b4e;border-top:1px solid #000;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-end,.tox .tox-dialog__footer-start{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(34,47,62,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #000}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}body.tox-dialog__disable-scroll{overflow:hidden}.tox.tox-platform-ie .tox-dialog-wrap{position:-ms-device-fixed}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right:8px}.tox .tox-dropzone-container{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #000;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(255,255,255,.5);margin:0 0 16px 0}.tox .tox-edit-area{display:flex;flex:1;-ms-flex-preferred-size:auto;overflow:hidden;position:relative}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;-ms-flex-preferred-size:auto;height:100%;position:absolute;width:100%}.tox.tox-inline-edit-area{border:1px dotted #000}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{z-index:1}.tox:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:none;transition:box-shadow .5s}.tox.tox-tinymce--toolbar-bottom .tox-editor-header,.tox.tox-tinymce-inline .tox-editor-header{margin-bottom:-1px}.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header{box-shadow:0 4px 4px -3px rgba(0,0,0,.25)}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:rgba(42,55,70,.2);border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;cursor:pointer;height:24px;position:absolute;top:6px;width:24px}.tox .tox-color-input span:focus{border-color:#207ab7}.tox .tox-color-input span::before{background-image:linear-gradient(45deg,rgba(255,255,255,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #2b3b4e;border-radius:3px;box-sizing:border-box;content:'';height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(255,255,255,.5);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-textarea{flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-selectfield select,.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#2b3b4e;border-color:#000;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-textarea[disabled],.tox .tox-textfield[disabled]{background-color:#222f3e;color:rgba(255,255,255,.85);cursor:not-allowed}.tox .tox-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#207ab7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#fff}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select[disabled]{background-color:#19232e;color:rgba(255,255,255,.85);cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea{-webkit-appearance:textarea;-moz-appearance:textarea;appearance:textarea;white-space:pre-wrap}.tox-fullscreen{border:0;height:100%;left:0;margin:0;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:none;padding:0;position:fixed;top:0;touch-action:pinch-zoom;width:100%}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen{z-index:1200}.tox-fullscreen .tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-image-tools{width:100%}.tox .tox-image-tools__toolbar{align-items:center;display:flex;justify-content:center}.tox .tox-image-tools__image{background-color:#666;height:380px;overflow:auto;position:relative;width:100%}.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top:8px}.tox .tox-image-tools__image-bg{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools__toolbar>.tox-spacer{flex:1;-ms-flex-preferred-size:auto}.tox .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left:8px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left:32px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right:8px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right:32px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:169px}.tox .tox-insert-table-picker>div{border-color:#000;border-style:solid;border-width:0 1px 1px 0;box-sizing:content-box;height:16px;width:16px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px 0}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:rgba(32,122,183,.5);border-color:rgba(32,122,183,.5)}.tox .tox-insert-table-picker__label{color:#fff;display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox .tox-menu{background-color:#2b3b4e;border:1px solid #000;border-radius:3px;box-shadow:0 4px 8px 0 rgba(42,55,70,.1);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:4px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:4px}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e;background-color:#222f3e;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 4px 0 4px}.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar{border-top:1px solid #000}.tox .tox-mbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#fff;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:transparent;border:0;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#4a5562;border:0;box-shadow:none;color:#fff}.tox .tox-mbtn--active{background:#757d87;border:0;box-shadow:none;color:#fff}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#4a5562;border:0;box-shadow:none;color:#fff}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:-ms-grid;display:grid;font-size:14px;font-weight:400;-ms-grid-columns:minmax(40px,1fr) auto minmax(40px,1fr);grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity 150ms ease-in}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification a{text-decoration:underline}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#fff}.tox .tox-notification--success p{color:#fff}.tox .tox-notification--success a{color:#547831}.tox .tox-notification--success svg{fill:#fff}.tox .tox-notification--error{background-color:#f8dede;border-color:#f2bfbf;color:#fff}.tox .tox-notification--error p{color:#fff}.tox .tox-notification--error a{color:#c00}.tox .tox-notification--error svg{fill:#fff}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fffaea;border-color:#ffe89d;color:#fff}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#fff}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#fff}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#fff}.tox .tox-notification--info{background-color:#d9edf7;border-color:#779ecb;color:#fff}.tox .tox-notification--info p{color:#fff}.tox .tox-notification--info a{color:#fff}.tox .tox-notification--info svg{fill:#fff}.tox .tox-notification__body{-ms-grid-row-align:center;align-self:center;color:#fff;font-size:14px;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{-ms-grid-row-align:center;align-self:center;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{-ms-grid-row-align:start;align-self:start;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-column:3;grid-column-start:3;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification .tox-progress-bar{-ms-grid-column-span:3;grid-column-end:4;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:3;-ms-grid-row:2;grid-row-start:2;-ms-grid-column-align:center;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar{flex-wrap:nowrap}.tox .tox-pop__dialog{background-color:#222f3e;border:1px solid #000;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:'';display:block;height:0;position:absolute;width:0}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#222f3e transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#000 transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #222f3e transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #000 transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #222f3e transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #000 transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #222f3e;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #000;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;-ms-flex-preferred-size:0;min-height:0}.tox .tox-sidebar{background-color:#222f3e;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;-ms-flex-preferred-size:auto;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #000;border-radius:3px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#207ab7;border:2px solid #185d8c;border-radius:3px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:14px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(255,255,255,.5);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#222f3e;border-top:1px solid #000;color:#fff;display:flex;flex:0 0 auto;font-size:12px;font-weight:400;height:18px;overflow:hidden;padding:0 8px;position:relative;text-transform:uppercase}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:flex-end;overflow:hidden}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:#fff;text-decoration:none}.tox .tox-statusbar a:focus,.tox .tox-statusbar a:hover,.tox .tox-statusbar__path-item:focus,.tox .tox-statusbar__path-item:hover,.tox .tox-statusbar__wordcount:focus,.tox .tox-statusbar__wordcount:hover{cursor:pointer;text-decoration:underline}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-left:1ch}.tox .tox-statusbar__resize-handle svg{display:block;fill:#fff}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:1ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox .tox-throbber{z-index:1400}.tox .tox-throbber__busy-spinner{align-items:center;background-color:rgba(34,47,62,.6);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#fff;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0;text-transform:none;width:34px}.tox .tox-tbtn svg{display:block;fill:#fff}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#4a5562;border:0;box-shadow:none}.tox .tox-tbtn:hover{background:#4a5562;border:0;box-shadow:none;color:#fff}.tox .tox-tbtn:hover svg{fill:#fff}.tox .tox-tbtn:active{background:#757d87;border:0;box-shadow:none;color:#fff}.tox .tox-tbtn:active svg{fill:#fff}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:0 0;border:0;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(255,255,255,.5)}.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:hover{background:#757d87;border:0;box-shadow:none;color:#fff}.tox .tox-tbtn--enabled:hover>*,.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:hover svg{fill:#fff}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#fff}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#fff}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:51px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:68px;width:68px}.tox .tox-tbtn--return{-ms-grid-row-align:stretch;align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tbtn--select{margin:2px 0 3px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(255,255,255,.5)}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:2px 0 3px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #4a5562 inset}.tox .tox-split-button:focus{background:#4a5562;box-shadow:none;color:#fff}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(255,255,255,.5)}.tox .tox-split-button .tox-tbtn{margin:0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:0 0;box-shadow:none;color:rgba(255,255,255,.5)}.tox .tox-toolbar-overlord{background-color:#222f3e}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e;background-color:#222f3e;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 0}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord .tox-toolbar__primary{border-top:1px solid #000;margin-top:-1px}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary,.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child{border-top:1px solid #000}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#222f3e;border:1px solid #000;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}.tox[dir=rtl] .tox-tbtn__icon-rtl svg{transform:rotateY(180deg)}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px 0 4px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid #000}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid #000}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#3d546f;border-radius:3px;box-shadow:0 2px 4px rgba(42,55,70,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #3d546f;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #3d546f;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #3d546f;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #3d546f;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #000;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #000;border-radius:3px;display:flex;flex:1;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px} +/*# sourceMappingURL=skin.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.mobile.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.mobile.css new file mode 100644 index 0000000..875721a --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.mobile.css @@ -0,0 +1,673 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +/* RESET all the things! */ +.tinymce-mobile-outer-container { + all: initial; + display: block; +} +.tinymce-mobile-outer-container * { + border: 0; + box-sizing: initial; + cursor: inherit; + float: none; + line-height: 1; + margin: 0; + outline: 0; + padding: 0; + -webkit-tap-highlight-color: transparent; + /* TBIO-3691, stop the gray flicker on touch. */ + text-shadow: none; + white-space: nowrap; +} +.tinymce-mobile-icon-arrow-back::before { + content: "\e5cd"; +} +.tinymce-mobile-icon-image::before { + content: "\e412"; +} +.tinymce-mobile-icon-cancel-circle::before { + content: "\e5c9"; +} +.tinymce-mobile-icon-full-dot::before { + content: "\e061"; +} +.tinymce-mobile-icon-align-center::before { + content: "\e234"; +} +.tinymce-mobile-icon-align-left::before { + content: "\e236"; +} +.tinymce-mobile-icon-align-right::before { + content: "\e237"; +} +.tinymce-mobile-icon-bold::before { + content: "\e238"; +} +.tinymce-mobile-icon-italic::before { + content: "\e23f"; +} +.tinymce-mobile-icon-unordered-list::before { + content: "\e241"; +} +.tinymce-mobile-icon-ordered-list::before { + content: "\e242"; +} +.tinymce-mobile-icon-font-size::before { + content: "\e245"; +} +.tinymce-mobile-icon-underline::before { + content: "\e249"; +} +.tinymce-mobile-icon-link::before { + content: "\e157"; +} +.tinymce-mobile-icon-unlink::before { + content: "\eca2"; +} +.tinymce-mobile-icon-color::before { + content: "\e891"; +} +.tinymce-mobile-icon-previous::before { + content: "\e314"; +} +.tinymce-mobile-icon-next::before { + content: "\e315"; +} +.tinymce-mobile-icon-large-font::before, +.tinymce-mobile-icon-style-formats::before { + content: "\e264"; +} +.tinymce-mobile-icon-undo::before { + content: "\e166"; +} +.tinymce-mobile-icon-redo::before { + content: "\e15a"; +} +.tinymce-mobile-icon-removeformat::before { + content: "\e239"; +} +.tinymce-mobile-icon-small-font::before { + content: "\e906"; +} +.tinymce-mobile-icon-readonly-back::before, +.tinymce-mobile-format-matches::after { + content: "\e5ca"; +} +.tinymce-mobile-icon-small-heading::before { + content: "small"; +} +.tinymce-mobile-icon-large-heading::before { + content: "large"; +} +.tinymce-mobile-icon-small-heading::before, +.tinymce-mobile-icon-large-heading::before { + font-family: sans-serif; + font-size: 80%; +} +.tinymce-mobile-mask-edit-icon::before { + content: "\e254"; +} +.tinymce-mobile-icon-back::before { + content: "\e5c4"; +} +.tinymce-mobile-icon-heading::before { + /* TODO: Translate */ + content: "Headings"; + font-family: sans-serif; + font-size: 80%; + font-weight: bold; +} +.tinymce-mobile-icon-h1::before { + content: "H1"; + font-weight: bold; +} +.tinymce-mobile-icon-h2::before { + content: "H2"; + font-weight: bold; +} +.tinymce-mobile-icon-h3::before { + content: "H3"; + font-weight: bold; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask { + align-items: center; + display: flex; + justify-content: center; + background: rgba(51, 51, 51, 0.5); + height: 100%; + position: absolute; + top: 0; + width: 100%; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container { + align-items: center; + border-radius: 50%; + display: flex; + flex-direction: column; + font-family: sans-serif; + font-size: 1em; + justify-content: space-between; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item { + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { + align-items: center; + display: flex; + justify-content: center; + flex-direction: column; + font-size: 1em; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { + font-size: 1.2em; + } +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon { + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; + background-color: white; + color: #207ab7; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before { + content: "\e900"; + font-family: 'tinymce-mobile', sans-serif; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon { + z-index: 2; +} +.tinymce-mobile-android-container.tinymce-mobile-android-maximized { + background: #ffffff; + border: none; + bottom: 0; + display: flex; + flex-direction: column; + left: 0; + position: fixed; + right: 0; + top: 0; +} +.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) { + position: relative; +} +.tinymce-mobile-android-container .tinymce-mobile-editor-socket { + display: flex; + flex-grow: 1; +} +.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe { + display: flex !important; + flex-grow: 1; + height: auto !important; +} +.tinymce-mobile-android-scroll-reload { + overflow: hidden; +} +:not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar { + margin-top: 23px; +} +.tinymce-mobile-toolstrip { + background: #fff; + display: flex; + flex: 0 0 auto; + z-index: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar { + align-items: center; + background-color: #fff; + border-bottom: 1px solid #cccccc; + display: flex; + flex: 1; + height: 2.5em; + width: 100%; + /* Make it no larger than the toolstrip, so that it needs to scroll */ +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group { + align-items: center; + display: flex; + height: 100%; + flex-shrink: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div { + align-items: center; + display: flex; + height: 100%; + flex: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container { + background: #f44336; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group { + flex-grow: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { + padding-left: 0.5em; + padding-right: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button { + align-items: center; + display: flex; + height: 80%; + margin-left: 2px; + margin-right: 2px; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected { + background: #c8cbcf; + color: #cccccc; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type { + background: #207ab7; + color: #eceff1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar { + /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group { + align-items: center; + display: flex; + height: 100%; + flex: 1; + padding-bottom: 0.4em; + padding-top: 0.4em; + /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ + /* For widgets like the colour picker, use the whole height */ +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog { + display: flex; + min-height: 1.5em; + overflow: hidden; + padding-left: 0; + padding-right: 0; + position: relative; + width: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain { + display: flex; + height: 100%; + transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; + width: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen { + display: flex; + flex: 0 0 auto; + justify-content: space-between; + width: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input { + font-family: Sans-serif; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container { + display: flex; + flex-grow: 1; + position: relative; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x { + -ms-grid-row-align: center; + align-self: center; + background: inherit; + border: none; + border-radius: 50%; + color: #888; + font-size: 0.6em; + font-weight: bold; + height: 100%; + padding-right: 2px; + position: absolute; + right: 0; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x { + display: none; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next { + align-items: center; + display: flex; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before { + align-items: center; + display: flex; + font-weight: bold; + height: 100%; + padding-left: 0.5em; + padding-right: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before { + visibility: hidden; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item { + color: #cccccc; + font-size: 10px; + line-height: 10px; + margin: 0 2px; + padding-top: 3px; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active { + color: #c8cbcf; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before { + margin-left: 0.5em; + margin-right: 0.9em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before { + margin-left: 0.9em; + margin-right: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider { + display: flex; + flex: 1; + margin-left: 0; + margin-right: 0; + padding: 0.28em 0; + position: relative; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container { + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line { + background: #cccccc; + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container { + padding-left: 2em; + padding-right: 2em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container { + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient { + background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black { + /* Not part of theming */ + background: black; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white { + /* Not part of theming */ + background: white; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb { + /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave + * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is + * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without + * this approach. + */ + align-items: center; + background-clip: padding-box; + background-color: #455a64; + border: 0.5em solid rgba(136, 136, 136, 0); + border-radius: 3em; + bottom: 0; + color: #fff; + display: flex; + height: 0.5em; + justify-content: center; + left: -10px; + margin: auto; + position: absolute; + top: 0; + transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); + width: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active { + border: 0.5em solid rgba(136, 136, 136, 0.39); +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div { + align-items: center; + display: flex; + height: 100%; + flex: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper { + flex-direction: column; + justify-content: center; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { + align-items: center; + display: flex; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) { + height: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container { + display: flex; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input { + background: #ffffff; + border: none; + border-radius: 0; + color: #455a64; + flex-grow: 1; + font-size: 0.85em; + padding-bottom: 0.1em; + padding-left: 5px; + padding-top: 0.1em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder { + /* WebKit, Blink, Edge */ + color: #888; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder { + /* WebKit, Blink, Edge */ + color: #888; +} +/* dropup */ +.tinymce-mobile-dropup { + background: white; + display: flex; + overflow: hidden; + width: 100%; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking { + transition: height 0.3s ease-out; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-growing { + transition: height 0.3s ease-in; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-closed { + flex-grow: 0; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) { + flex-grow: 1; +} +/* TODO min-height for device size and orientation */ +.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 200px; +} +@media only screen and (orientation: landscape) { + .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 200px; + } +} +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 150px; + } +} +/* styles menu */ +.tinymce-mobile-styles-menu { + font-family: sans-serif; + outline: 4px solid black; + overflow: hidden; + position: relative; + width: 100%; +} +.tinymce-mobile-styles-menu [role="menu"] { + display: flex; + flex-direction: column; + height: 100%; + position: absolute; + width: 100%; +} +.tinymce-mobile-styles-menu [role="menu"].transitioning { + transition: transform 0.5s ease-in-out; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item { + border-bottom: 1px solid #ddd; + color: #455a64; + cursor: pointer; + display: flex; + padding: 1em 1em; + position: relative; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before { + color: #455a64; + content: "\e314"; + font-family: 'tinymce-mobile', sans-serif; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after { + color: #455a64; + content: "\e315"; + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after { + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator, +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser { + align-items: center; + background: #fff; + border-top: #455a64; + color: #455a64; + display: flex; + min-height: 2.5em; + padding-left: 1em; + padding-right: 1em; +} +.tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state], +.tinymce-mobile-styles-menu [data-transitioning-state="before"] { + transform: translate(-100%); +} +.tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state], +.tinymce-mobile-styles-menu [data-transitioning-state="current"] { + transform: translate(0%); +} +.tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state], +.tinymce-mobile-styles-menu [data-transitioning-state="after"] { + transform: translate(100%); +} +@font-face { + font-family: 'tinymce-mobile'; + font-style: normal; + font-weight: normal; + src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); +} +@media (min-device-width: 700px) { + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 25px; + } +} +@media (max-device-width: 700px) { + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 18px; + } +} +.tinymce-mobile-icon { + font-family: 'tinymce-mobile', sans-serif; +} +.mixin-flex-and-centre { + align-items: center; + display: flex; + justify-content: center; +} +.mixin-flex-bar { + align-items: center; + display: flex; + height: 100%; +} +.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe { + background-color: #fff; + width: 100%; +} +.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ + background-color: #207ab7; + border-radius: 50%; + bottom: 1em; + color: white; + font-size: 1em; + height: 2.1em; + position: fixed; + right: 2em; + width: 2.1em; + align-items: center; + display: flex; + justify-content: center; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + font-size: 1.2em; + } +} +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket { + height: 300px; + overflow: hidden; +} +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe { + height: 100%; +} +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip { + display: none; +} +/* + Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets + increased and the whole body becomes scrollable. It's important! + */ +input[type="file"]::-webkit-file-upload-button { + display: none; +} +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + bottom: 50%; + } +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.mobile.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.mobile.min.css new file mode 100644 index 0000000..1555512 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide-dark/skin.mobile.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-outer-container{all:initial;display:block}.tinymce-mobile-outer-container *{border:0;box-sizing:initial;cursor:inherit;float:none;line-height:1;margin:0;outline:0;padding:0;-webkit-tap-highlight-color:transparent;text-shadow:none;white-space:nowrap}.tinymce-mobile-icon-arrow-back::before{content:"\e5cd"}.tinymce-mobile-icon-image::before{content:"\e412"}.tinymce-mobile-icon-cancel-circle::before{content:"\e5c9"}.tinymce-mobile-icon-full-dot::before{content:"\e061"}.tinymce-mobile-icon-align-center::before{content:"\e234"}.tinymce-mobile-icon-align-left::before{content:"\e236"}.tinymce-mobile-icon-align-right::before{content:"\e237"}.tinymce-mobile-icon-bold::before{content:"\e238"}.tinymce-mobile-icon-italic::before{content:"\e23f"}.tinymce-mobile-icon-unordered-list::before{content:"\e241"}.tinymce-mobile-icon-ordered-list::before{content:"\e242"}.tinymce-mobile-icon-font-size::before{content:"\e245"}.tinymce-mobile-icon-underline::before{content:"\e249"}.tinymce-mobile-icon-link::before{content:"\e157"}.tinymce-mobile-icon-unlink::before{content:"\eca2"}.tinymce-mobile-icon-color::before{content:"\e891"}.tinymce-mobile-icon-previous::before{content:"\e314"}.tinymce-mobile-icon-next::before{content:"\e315"}.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content:"\e264"}.tinymce-mobile-icon-undo::before{content:"\e166"}.tinymce-mobile-icon-redo::before{content:"\e15a"}.tinymce-mobile-icon-removeformat::before{content:"\e239"}.tinymce-mobile-icon-small-font::before{content:"\e906"}.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content:"\e5ca"}.tinymce-mobile-icon-small-heading::before{content:"small"}.tinymce-mobile-icon-large-heading::before{content:"large"}.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family:sans-serif;font-size:80%}.tinymce-mobile-mask-edit-icon::before{content:"\e254"}.tinymce-mobile-icon-back::before{content:"\e5c4"}.tinymce-mobile-icon-heading::before{content:"Headings";font-family:sans-serif;font-size:80%;font-weight:700}.tinymce-mobile-icon-h1::before{content:"H1";font-weight:700}.tinymce-mobile-icon-h2::before{content:"H2";font-weight:700}.tinymce-mobile-icon-h3::before{content:"H3";font-weight:700}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{align-items:center;display:flex;justify-content:center;background:rgba(51,51,51,.5);height:100%;position:absolute;top:0;width:100%}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{align-items:center;border-radius:50%;display:flex;flex-direction:column;font-family:sans-serif;font-size:1em;justify-content:space-between}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items:center;display:flex;justify-content:center;flex-direction:column;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1.2em}}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em;background-color:#fff;color:#207ab7}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{content:"\e900";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index:2}.tinymce-mobile-android-container.tinymce-mobile-android-maximized{background:#fff;border:none;bottom:0;display:flex;flex-direction:column;left:0;position:fixed;right:0;top:0}.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position:relative}.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display:flex;flex-grow:1}.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display:flex!important;flex-grow:1;height:auto!important}.tinymce-mobile-android-scroll-reload{overflow:hidden}:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#fff;display:flex;flex:0 0 auto;z-index:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{align-items:center;background-color:#fff;border-bottom:1px solid #ccc;display:flex;flex:1;height:2.5em;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{align-items:center;display:flex;height:80%;margin-left:2px;margin-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#c8cbcf;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#207ab7;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex:1;padding-bottom:.4em;padding-top:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:flex;min-height:1.5em;overflow:hidden;padding-left:0;padding-right:0;position:relative;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display:flex;height:100%;transition:left cubic-bezier(.4,0,1,1) .15s;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display:flex;flex:0 0 auto;justify-content:space-between;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:flex;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{-ms-grid-row-align:center;align-self:center;background:inherit;border:none;border-radius:50%;color:#888;font-size:.6em;font-weight:700;height:100%;padding-right:2px;position:absolute;right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{align-items:center;display:flex;font-weight:700;height:100%;padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{color:#ccc;font-size:10px;line-height:10px;margin:0 2px;padding-top:3px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#c8cbcf}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-left:.5em;margin-right:.9em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:flex;flex:1;margin-left:0;margin-right:0;padding:.28em 0;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{background:#ccc;display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{background:linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:#000;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:#fff;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{align-items:center;background-clip:padding-box;background-color:#455a64;border:.5em solid rgba(136,136,136,0);border-radius:3em;bottom:0;color:#fff;display:flex;height:.5em;justify-content:center;left:-10px;margin:auto;position:absolute;top:0;transition:border 120ms cubic-bezier(.39,.58,.57,1);width:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction:column;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{background:#fff;border:none;border-radius:0;color:#455a64;flex-grow:1;font-size:.85em;padding-bottom:.1em;padding-left:5px;padding-top:.1em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-dropup{background:#fff;display:flex;overflow:hidden;width:100%}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow:1}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation:landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-styles-menu{font-family:sans-serif;outline:4px solid #000;overflow:hidden;position:relative;width:100%}.tinymce-mobile-styles-menu [role=menu]{display:flex;flex-direction:column;height:100%;position:absolute;width:100%}.tinymce-mobile-styles-menu [role=menu].transitioning{transition:transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{border-bottom:1px solid #ddd;color:#455a64;cursor:pointer;display:flex;padding:1em 1em;position:relative}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{color:#455a64;content:"\e314";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{color:#455a64;content:"\e315";font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{align-items:center;background:#fff;border-top:#455a64;color:#455a64;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em}.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform:translate(100%)}@font-face{font-family:tinymce-mobile;font-style:normal;font-weight:400;src:url(fonts/tinymce-mobile.woff?8x92w3) format('woff')}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:tinymce-mobile,sans-serif}.mixin-flex-and-centre{align-items:center;display:flex;justify-content:center}.mixin-flex-bar{align-items:center;display:flex;height:100%}.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{background-color:#fff;width:100%}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{background-color:#207ab7;border-radius:50%;bottom:1em;color:#fff;font-size:1em;height:2.1em;position:fixed;right:2em;width:2.1em;align-items:center;display:flex;justify-content:center}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height:300px;overflow:hidden}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}input[type=file]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} +/*# sourceMappingURL=skin.mobile.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.css new file mode 100644 index 0000000..07607f7 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.css @@ -0,0 +1,618 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} +.mce-content-body .mce-item-anchor[data-mce-selected] { + outline-offset: 1px; +} +.tox-comments-visible .tox-comment { + background-color: #fff0b7; +} +.tox-comments-visible .tox-comment--active { + background-color: #ffe168; +} +.tox-checklist > li:not(.tox-checklist--hidden) { + list-style: none; + margin: 0.25em 0; +} +.tox-checklist > li:not(.tox-checklist--hidden)::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + background-size: 100%; + content: ''; + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); +} +[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { + margin-left: 0; + margin-right: -1.5em; +} +/* stylelint-disable */ +/* http://prismjs.com/ */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} +.token.punctuation { + color: #999; +} +.namespace { + opacity: 0.7; +} +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); +} +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} +.token.function, +.token.class-name { + color: #DD4A68; +} +.token.regex, +.token.important, +.token.variable { + color: #e90; +} +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} +.token.entity { + cursor: help; +} +/* stylelint-enable */ +.mce-content-body { + overflow-wrap: break-word; + word-wrap: break-word; +} +.mce-content-body .mce-visual-caret { + background-color: black; + background-color: currentcolor; + position: absolute; +} +.mce-content-body .mce-visual-caret-hidden { + display: none; +} +.mce-content-body *[data-mce-caret] { + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} +.mce-content-body .mce-offscreen-selection { + left: -2000000px; + max-width: 1000000px; + position: absolute; +} +.mce-content-body *[contentEditable=false] { + cursor: default; +} +.mce-content-body *[contentEditable=true] { + cursor: text; +} +.tox-cursor-format-painter { + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; +} +.mce-content-body figure.align-left { + float: left; +} +.mce-content-body figure.align-right { + float: right; +} +.mce-content-body figure.image.align-center { + display: table; + margin-left: auto; + margin-right: auto; +} +.mce-preview-object { + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; +} +.mce-preview-object .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-preview-object[data-mce-selected="2"] .mce-shim { + display: none; +} +.mce-object { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; +} +.mce-pagebreak { + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} +@media print { + .mce-pagebreak { + border: 0; + } +} +.tiny-pageembed .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.tiny-pageembed[data-mce-selected="2"] .mce-shim { + display: none; +} +.tiny-pageembed { + display: inline-block; + position: relative; +} +.tiny-pageembed--21by9, +.tiny-pageembed--16by9, +.tiny-pageembed--4by3, +.tiny-pageembed--1by1 { + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; +} +.tiny-pageembed--21by9 { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9 { + padding-top: 56.25%; +} +.tiny-pageembed--4by3 { + padding-top: 75%; +} +.tiny-pageembed--1by1 { + padding-top: 100%; +} +.tiny-pageembed--21by9 iframe, +.tiny-pageembed--16by9 iframe, +.tiny-pageembed--4by3 iframe, +.tiny-pageembed--1by1 iframe { + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-content-body[data-mce-placeholder] { + position: relative; +} +.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; +} +.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { + left: 1px; +} +.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { + right: 1px; +} +.mce-content-body div.mce-resizehandle { + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} +.mce-content-body div.mce-resizehandle:hover { + background-color: #4099ff; +} +.mce-content-body div.mce-resizehandle:nth-of-type(1) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(2) { + cursor: nesw-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(3) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(4) { + cursor: nesw-resize; +} +.mce-content-body .mce-clonedresizable { + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; +} +.mce-content-body .mce-resize-helper { + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[data-mce-selected], +.mce-content-body table[data-mce-selected] { + outline: 3px solid #b4d7ff; +} +.mce-content-body hr[data-mce-selected] { + outline: 3px solid #b4d7ff; + outline-offset: 1px; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { + outline: 3px solid #b4d7ff; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { + outline: 3px solid #b4d7ff; +} +.mce-content-body *[contentEditable=false][data-mce-selected] { + cursor: not-allowed; + outline: 3px solid #b4d7ff; +} +.mce-content-body.mce-content-readonly *[contentEditable=true]:focus, +.mce-content-body.mce-content-readonly *[contentEditable=true]:hover { + outline: none; +} +.mce-content-body *[data-mce-selected="inline-boundary"] { + background-color: #b4d7ff; +} +.mce-content-body .mce-edit-focus { + outline: 3px solid #b4d7ff; +} +.mce-content-body td[data-mce-selected], +.mce-content-body th[data-mce-selected] { + background-color: #b4d7ff !important; +} +.mce-content-body td[data-mce-selected]::-moz-selection, +.mce-content-body th[data-mce-selected]::-moz-selection { + background: none; +} +.mce-content-body td[data-mce-selected]::selection, +.mce-content-body th[data-mce-selected]::selection { + background: none; +} +.mce-content-body td[data-mce-selected] *, +.mce-content-body th[data-mce-selected] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #b4d7ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ephox-snooker-resizer-cols { + cursor: col-resize; +} +.ephox-snooker-resizer-rows { + cursor: row-resize; +} +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { + opacity: 1; +} +.mce-spellchecker-word { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} +.mce-spellchecker-grammar { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; +} +.mce-toc { + border: 1px solid gray; +} +.mce-toc h2 { + margin: 4px; +} +.mce-toc li { + list-style-type: none; +} +.mce-item-table, +.mce-item-table td, +.mce-item-table th, +.mce-item-table caption { + border: 1px dashed #bbb; +} +.mce-visualblocks p, +.mce-visualblocks h1, +.mce-visualblocks h2, +.mce-visualblocks h3, +.mce-visualblocks h4, +.mce-visualblocks h5, +.mce-visualblocks h6, +.mce-visualblocks div:not([data-mce-bogus]), +.mce-visualblocks section, +.mce-visualblocks article, +.mce-visualblocks blockquote, +.mce-visualblocks address, +.mce-visualblocks pre, +.mce-visualblocks figure, +.mce-visualblocks figcaption, +.mce-visualblocks hgroup, +.mce-visualblocks aside, +.mce-visualblocks ul, +.mce-visualblocks ol, +.mce-visualblocks dl { + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; +} +.mce-visualblocks p { + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); +} +.mce-visualblocks h1 { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); +} +.mce-visualblocks h2 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); +} +.mce-visualblocks h3 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); +} +.mce-visualblocks h4 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); +} +.mce-visualblocks h5 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); +} +.mce-visualblocks h6 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); +} +.mce-visualblocks div:not([data-mce-bogus]) { + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); +} +.mce-visualblocks section { + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); +} +.mce-visualblocks article { + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); +} +.mce-visualblocks blockquote { + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); +} +.mce-visualblocks address { + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); +} +.mce-visualblocks pre { + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); +} +.mce-visualblocks figure { + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); +} +.mce-visualblocks figcaption { + border: 1px dashed #bbb; +} +.mce-visualblocks hgroup { + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); +} +.mce-visualblocks aside { + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); +} +.mce-visualblocks ul { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); +} +.mce-visualblocks ol { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); +} +.mce-visualblocks dl { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); +} +.mce-visualblocks:not([dir=rtl]) p, +.mce-visualblocks:not([dir=rtl]) h1, +.mce-visualblocks:not([dir=rtl]) h2, +.mce-visualblocks:not([dir=rtl]) h3, +.mce-visualblocks:not([dir=rtl]) h4, +.mce-visualblocks:not([dir=rtl]) h5, +.mce-visualblocks:not([dir=rtl]) h6, +.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]), +.mce-visualblocks:not([dir=rtl]) section, +.mce-visualblocks:not([dir=rtl]) article, +.mce-visualblocks:not([dir=rtl]) blockquote, +.mce-visualblocks:not([dir=rtl]) address, +.mce-visualblocks:not([dir=rtl]) pre, +.mce-visualblocks:not([dir=rtl]) figure, +.mce-visualblocks:not([dir=rtl]) figcaption, +.mce-visualblocks:not([dir=rtl]) hgroup, +.mce-visualblocks:not([dir=rtl]) aside, +.mce-visualblocks:not([dir=rtl]) ul, +.mce-visualblocks:not([dir=rtl]) ol, +.mce-visualblocks:not([dir=rtl]) dl { + margin-left: 3px; +} +.mce-visualblocks[dir=rtl] p, +.mce-visualblocks[dir=rtl] h1, +.mce-visualblocks[dir=rtl] h2, +.mce-visualblocks[dir=rtl] h3, +.mce-visualblocks[dir=rtl] h4, +.mce-visualblocks[dir=rtl] h5, +.mce-visualblocks[dir=rtl] h6, +.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]), +.mce-visualblocks[dir=rtl] section, +.mce-visualblocks[dir=rtl] article, +.mce-visualblocks[dir=rtl] blockquote, +.mce-visualblocks[dir=rtl] address, +.mce-visualblocks[dir=rtl] pre, +.mce-visualblocks[dir=rtl] figure, +.mce-visualblocks[dir=rtl] figcaption, +.mce-visualblocks[dir=rtl] hgroup, +.mce-visualblocks[dir=rtl] aside, +.mce-visualblocks[dir=rtl] ul, +.mce-visualblocks[dir=rtl] ol, +.mce-visualblocks[dir=rtl] dl { + background-position-x: right; + margin-right: 3px; +} +.mce-nbsp, +.mce-shy { + background: #aaa; +} +.mce-shy::after { + content: '-'; +} +body { + font-family: sans-serif; +} +table { + border-collapse: collapse; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.inline.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.inline.css new file mode 100644 index 0000000..1a040d5 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.inline.css @@ -0,0 +1,612 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} +.mce-content-body .mce-item-anchor[data-mce-selected] { + outline-offset: 1px; +} +.tox-comments-visible .tox-comment { + background-color: #fff0b7; +} +.tox-comments-visible .tox-comment--active { + background-color: #ffe168; +} +.tox-checklist > li:not(.tox-checklist--hidden) { + list-style: none; + margin: 0.25em 0; +} +.tox-checklist > li:not(.tox-checklist--hidden)::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + background-size: 100%; + content: ''; + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} +.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); +} +[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { + margin-left: 0; + margin-right: -1.5em; +} +/* stylelint-disable */ +/* http://prismjs.com/ */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; +} +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; +} +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} +.token.punctuation { + color: #999; +} +.namespace { + opacity: 0.7; +} +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); +} +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} +.token.function, +.token.class-name { + color: #DD4A68; +} +.token.regex, +.token.important, +.token.variable { + color: #e90; +} +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} +.token.entity { + cursor: help; +} +/* stylelint-enable */ +.mce-content-body { + overflow-wrap: break-word; + word-wrap: break-word; +} +.mce-content-body .mce-visual-caret { + background-color: black; + background-color: currentcolor; + position: absolute; +} +.mce-content-body .mce-visual-caret-hidden { + display: none; +} +.mce-content-body *[data-mce-caret] { + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} +.mce-content-body .mce-offscreen-selection { + left: -2000000px; + max-width: 1000000px; + position: absolute; +} +.mce-content-body *[contentEditable=false] { + cursor: default; +} +.mce-content-body *[contentEditable=true] { + cursor: text; +} +.tox-cursor-format-painter { + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; +} +.mce-content-body figure.align-left { + float: left; +} +.mce-content-body figure.align-right { + float: right; +} +.mce-content-body figure.image.align-center { + display: table; + margin-left: auto; + margin-right: auto; +} +.mce-preview-object { + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; +} +.mce-preview-object .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-preview-object[data-mce-selected="2"] .mce-shim { + display: none; +} +.mce-object { + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; +} +.mce-pagebreak { + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} +@media print { + .mce-pagebreak { + border: 0; + } +} +.tiny-pageembed .mce-shim { + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.tiny-pageembed[data-mce-selected="2"] .mce-shim { + display: none; +} +.tiny-pageembed { + display: inline-block; + position: relative; +} +.tiny-pageembed--21by9, +.tiny-pageembed--16by9, +.tiny-pageembed--4by3, +.tiny-pageembed--1by1 { + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; +} +.tiny-pageembed--21by9 { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9 { + padding-top: 56.25%; +} +.tiny-pageembed--4by3 { + padding-top: 75%; +} +.tiny-pageembed--1by1 { + padding-top: 100%; +} +.tiny-pageembed--21by9 iframe, +.tiny-pageembed--16by9 iframe, +.tiny-pageembed--4by3 iframe, +.tiny-pageembed--1by1 iframe { + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.mce-content-body[data-mce-placeholder] { + position: relative; +} +.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; +} +.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { + left: 1px; +} +.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { + right: 1px; +} +.mce-content-body div.mce-resizehandle { + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} +.mce-content-body div.mce-resizehandle:hover { + background-color: #4099ff; +} +.mce-content-body div.mce-resizehandle:nth-of-type(1) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(2) { + cursor: nesw-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(3) { + cursor: nwse-resize; +} +.mce-content-body div.mce-resizehandle:nth-of-type(4) { + cursor: nesw-resize; +} +.mce-content-body .mce-clonedresizable { + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; +} +.mce-content-body .mce-resize-helper { + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[data-mce-selected], +.mce-content-body table[data-mce-selected] { + outline: 3px solid #b4d7ff; +} +.mce-content-body hr[data-mce-selected] { + outline: 3px solid #b4d7ff; + outline-offset: 1px; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { + outline: 3px solid #b4d7ff; +} +.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { + outline: 3px solid #b4d7ff; +} +.mce-content-body *[contentEditable=false][data-mce-selected] { + cursor: not-allowed; + outline: 3px solid #b4d7ff; +} +.mce-content-body.mce-content-readonly *[contentEditable=true]:focus, +.mce-content-body.mce-content-readonly *[contentEditable=true]:hover { + outline: none; +} +.mce-content-body *[data-mce-selected="inline-boundary"] { + background-color: #b4d7ff; +} +.mce-content-body .mce-edit-focus { + outline: 3px solid #b4d7ff; +} +.mce-content-body td[data-mce-selected], +.mce-content-body th[data-mce-selected] { + background-color: #b4d7ff !important; +} +.mce-content-body td[data-mce-selected]::-moz-selection, +.mce-content-body th[data-mce-selected]::-moz-selection { + background: none; +} +.mce-content-body td[data-mce-selected]::selection, +.mce-content-body th[data-mce-selected]::selection { + background: none; +} +.mce-content-body td[data-mce-selected] *, +.mce-content-body th[data-mce-selected] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #b4d7ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ephox-snooker-resizer-cols { + cursor: col-resize; +} +.ephox-snooker-resizer-rows { + cursor: row-resize; +} +.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { + opacity: 1; +} +.mce-spellchecker-word { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} +.mce-spellchecker-grammar { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; +} +.mce-toc { + border: 1px solid gray; +} +.mce-toc h2 { + margin: 4px; +} +.mce-toc li { + list-style-type: none; +} +.mce-item-table, +.mce-item-table td, +.mce-item-table th, +.mce-item-table caption { + border: 1px dashed #bbb; +} +.mce-visualblocks p, +.mce-visualblocks h1, +.mce-visualblocks h2, +.mce-visualblocks h3, +.mce-visualblocks h4, +.mce-visualblocks h5, +.mce-visualblocks h6, +.mce-visualblocks div:not([data-mce-bogus]), +.mce-visualblocks section, +.mce-visualblocks article, +.mce-visualblocks blockquote, +.mce-visualblocks address, +.mce-visualblocks pre, +.mce-visualblocks figure, +.mce-visualblocks figcaption, +.mce-visualblocks hgroup, +.mce-visualblocks aside, +.mce-visualblocks ul, +.mce-visualblocks ol, +.mce-visualblocks dl { + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; +} +.mce-visualblocks p { + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); +} +.mce-visualblocks h1 { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); +} +.mce-visualblocks h2 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); +} +.mce-visualblocks h3 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); +} +.mce-visualblocks h4 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); +} +.mce-visualblocks h5 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); +} +.mce-visualblocks h6 { + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); +} +.mce-visualblocks div:not([data-mce-bogus]) { + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); +} +.mce-visualblocks section { + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); +} +.mce-visualblocks article { + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); +} +.mce-visualblocks blockquote { + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); +} +.mce-visualblocks address { + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); +} +.mce-visualblocks pre { + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); +} +.mce-visualblocks figure { + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); +} +.mce-visualblocks figcaption { + border: 1px dashed #bbb; +} +.mce-visualblocks hgroup { + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); +} +.mce-visualblocks aside { + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); +} +.mce-visualblocks ul { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); +} +.mce-visualblocks ol { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); +} +.mce-visualblocks dl { + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); +} +.mce-visualblocks:not([dir=rtl]) p, +.mce-visualblocks:not([dir=rtl]) h1, +.mce-visualblocks:not([dir=rtl]) h2, +.mce-visualblocks:not([dir=rtl]) h3, +.mce-visualblocks:not([dir=rtl]) h4, +.mce-visualblocks:not([dir=rtl]) h5, +.mce-visualblocks:not([dir=rtl]) h6, +.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]), +.mce-visualblocks:not([dir=rtl]) section, +.mce-visualblocks:not([dir=rtl]) article, +.mce-visualblocks:not([dir=rtl]) blockquote, +.mce-visualblocks:not([dir=rtl]) address, +.mce-visualblocks:not([dir=rtl]) pre, +.mce-visualblocks:not([dir=rtl]) figure, +.mce-visualblocks:not([dir=rtl]) figcaption, +.mce-visualblocks:not([dir=rtl]) hgroup, +.mce-visualblocks:not([dir=rtl]) aside, +.mce-visualblocks:not([dir=rtl]) ul, +.mce-visualblocks:not([dir=rtl]) ol, +.mce-visualblocks:not([dir=rtl]) dl { + margin-left: 3px; +} +.mce-visualblocks[dir=rtl] p, +.mce-visualblocks[dir=rtl] h1, +.mce-visualblocks[dir=rtl] h2, +.mce-visualblocks[dir=rtl] h3, +.mce-visualblocks[dir=rtl] h4, +.mce-visualblocks[dir=rtl] h5, +.mce-visualblocks[dir=rtl] h6, +.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]), +.mce-visualblocks[dir=rtl] section, +.mce-visualblocks[dir=rtl] article, +.mce-visualblocks[dir=rtl] blockquote, +.mce-visualblocks[dir=rtl] address, +.mce-visualblocks[dir=rtl] pre, +.mce-visualblocks[dir=rtl] figure, +.mce-visualblocks[dir=rtl] figcaption, +.mce-visualblocks[dir=rtl] hgroup, +.mce-visualblocks[dir=rtl] aside, +.mce-visualblocks[dir=rtl] ul, +.mce-visualblocks[dir=rtl] ol, +.mce-visualblocks[dir=rtl] dl { + background-position-x: right; + margin-right: 3px; +} +.mce-nbsp, +.mce-shy { + background: #aaa; +} +.mce-shy::after { + content: '-'; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.inline.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.inline.min.css new file mode 100644 index 0000000..e1eb7ca --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.inline.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size:100%;content:'';cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentcolor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color:#b4d7ff!important}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'} +/*# sourceMappingURL=content.inline.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.min.css new file mode 100644 index 0000000..565172b --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");background-size:100%;content:'';cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentcolor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[data-mce-selected],.mce-content-body table[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{background-color:#b4d7ff!important}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table,.mce-item-table caption,.mce-item-table td,.mce-item-table th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'}body{font-family:sans-serif}table{border-collapse:collapse} +/*# sourceMappingURL=content.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.mobile.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.mobile.css new file mode 100644 index 0000000..4bdb8ba --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.mobile.css @@ -0,0 +1,29 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { + /* Note: this file is used inside the content, so isn't part of theming */ + background-color: green; + display: inline-block; + opacity: 0.5; + position: absolute; +} +body { + -webkit-text-size-adjust: none; +} +body img { + /* this is related to the content margin */ + max-width: 96vw; +} +body table img { + max-width: 95%; +} +body { + font-family: sans-serif; +} +table { + border-collapse: collapse; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.mobile.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.mobile.min.css new file mode 100644 index 0000000..627f693 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/content.mobile.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} +/*# sourceMappingURL=content.mobile.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff new file mode 100644 index 0000000..1e3be03 Binary files /dev/null and b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff differ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.css new file mode 100644 index 0000000..4d31b07 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.css @@ -0,0 +1,2884 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tox { + box-sizing: content-box; + color: #222f3e; + cursor: auto; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: normal; + -webkit-tap-highlight-color: transparent; + text-decoration: none; + text-shadow: none; + text-transform: none; + vertical-align: initial; + white-space: normal; +} +.tox *:not(svg):not(rect) { + box-sizing: inherit; + color: inherit; + cursor: inherit; + direction: inherit; + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; + line-height: inherit; + -webkit-tap-highlight-color: inherit; + text-align: inherit; + text-decoration: inherit; + text-shadow: inherit; + text-transform: inherit; + vertical-align: inherit; + white-space: inherit; +} +.tox *:not(svg):not(rect) { + /* stylelint-disable-line no-duplicate-selectors */ + background: transparent; + border: 0; + float: none; + height: auto; + margin: 0; + max-width: none; + outline: 0; + padding: 0; + position: static; + width: auto; +} +.tox:not([dir=rtl]) { + direction: ltr; + text-align: left; +} +.tox[dir=rtl] { + direction: rtl; + text-align: right; +} +.tox-tinymce { + border: 1px solid #cccccc; + border-radius: 0; + box-shadow: none; + box-sizing: border-box; + display: flex; + flex-direction: column; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + overflow: hidden; + position: relative; + visibility: inherit !important; +} +.tox-tinymce-inline { + border: none; + box-shadow: none; +} +.tox-tinymce-inline .tox-editor-header { + border: 1px solid #cccccc; + border-radius: 0; + box-shadow: none; +} +.tox-tinymce-aux { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + z-index: 1300; +} +.tox-tinymce *:focus, +.tox-tinymce-aux *:focus { + outline: none; +} +button::-moz-focus-inner { + border: 0; +} +.tox .accessibility-issue__header { + align-items: center; + display: flex; + margin-bottom: 4px; +} +.tox .accessibility-issue__description { + align-items: stretch; + border: 1px solid #cccccc; + border-radius: 3px; + display: flex; + justify-content: space-between; +} +.tox .accessibility-issue__description > div { + padding-bottom: 4px; +} +.tox .accessibility-issue__description > div > div { + align-items: center; + display: flex; + margin-bottom: 4px; +} +.tox .accessibility-issue__description > *:last-child:not(:only-child) { + border-color: #cccccc; + border-style: solid; +} +.tox .accessibility-issue__repair { + margin-top: 16px; +} +.tox .accessibility-issue--info .accessibility-issue__description { + background-color: rgba(32, 122, 183, 0.1); + border-color: rgba(32, 122, 183, 0.4); + color: #222f3e; +} +.tox .accessibility-issue--info .accessibility-issue__description > *:last-child { + border-color: rgba(32, 122, 183, 0.4); +} +.tox .accessibility-issue--info h2 { + color: #207ab7; +} +.tox .accessibility-issue--info .tox-icon svg { + fill: #207ab7; +} +.tox .accessibility-issue--info a .tox-icon { + color: #207ab7; +} +.tox .accessibility-issue--warn .accessibility-issue__description { + background-color: rgba(255, 165, 0, 0.1); + border-color: rgba(255, 165, 0, 0.5); + color: #222f3e; +} +.tox .accessibility-issue--warn .accessibility-issue__description > *:last-child { + border-color: rgba(255, 165, 0, 0.5); +} +.tox .accessibility-issue--warn h2 { + color: #cc8500; +} +.tox .accessibility-issue--warn .tox-icon svg { + fill: #cc8500; +} +.tox .accessibility-issue--warn a .tox-icon { + color: #cc8500; +} +.tox .accessibility-issue--error .accessibility-issue__description { + background-color: rgba(204, 0, 0, 0.1); + border-color: rgba(204, 0, 0, 0.4); + color: #222f3e; +} +.tox .accessibility-issue--error .accessibility-issue__description > *:last-child { + border-color: rgba(204, 0, 0, 0.4); +} +.tox .accessibility-issue--error h2 { + color: #c00; +} +.tox .accessibility-issue--error .tox-icon svg { + fill: #c00; +} +.tox .accessibility-issue--error a .tox-icon { + color: #c00; +} +.tox .accessibility-issue--success .accessibility-issue__description { + background-color: rgba(120, 171, 70, 0.1); + border-color: rgba(120, 171, 70, 0.4); + color: #222f3e; +} +.tox .accessibility-issue--success .accessibility-issue__description > *:last-child { + border-color: rgba(120, 171, 70, 0.4); +} +.tox .accessibility-issue--success h2 { + color: #78AB46; +} +.tox .accessibility-issue--success .tox-icon svg { + fill: #78AB46; +} +.tox .accessibility-issue--success a .tox-icon { + color: #78AB46; +} +.tox .tox-dialog__body-content .accessibility-issue__header h1, +.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 { + margin-top: 0; +} +.tox:not([dir=rtl]) .accessibility-issue__header .tox-button { + margin-left: 4px; +} +.tox:not([dir=rtl]) .accessibility-issue__header > *:nth-last-child(2) { + margin-left: auto; +} +.tox:not([dir=rtl]) .accessibility-issue__description { + padding: 4px 4px 4px 8px; +} +.tox:not([dir=rtl]) .accessibility-issue__description > *:last-child { + border-left-width: 1px; + padding-left: 4px; +} +.tox[dir=rtl] .accessibility-issue__header .tox-button { + margin-right: 4px; +} +.tox[dir=rtl] .accessibility-issue__header > *:nth-last-child(2) { + margin-right: auto; +} +.tox[dir=rtl] .accessibility-issue__description { + padding: 4px 8px 4px 4px; +} +.tox[dir=rtl] .accessibility-issue__description > *:last-child { + border-right-width: 1px; + padding-right: 4px; +} +.tox .tox-anchorbar { + display: flex; + flex: 0 0 auto; +} +.tox .tox-bar { + display: flex; + flex: 0 0 auto; +} +.tox .tox-button { + background-color: #207ab7; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #207ab7; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 14px; + font-weight: bold; + letter-spacing: normal; + line-height: 24px; + margin: 0; + outline: none; + padding: 4px 16px; + text-align: center; + text-decoration: none; + text-transform: capitalize; + white-space: nowrap; +} +.tox .tox-button[disabled] { + background-color: #207ab7; + background-image: none; + border-color: #207ab7; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} +.tox .tox-button:focus:not(:disabled) { + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; +} +.tox .tox-button:hover:not(:disabled) { + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; +} +.tox .tox-button:active:not(:disabled) { + background-color: #185d8c; + background-image: none; + border-color: #185d8c; + box-shadow: none; + color: #fff; +} +.tox .tox-button--secondary { + background-color: #f0f0f0; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #f0f0f0; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + color: #222f3e; + outline: none; + padding: 4px 16px; + text-decoration: none; + text-transform: capitalize; +} +.tox .tox-button--secondary[disabled] { + background-color: #f0f0f0; + background-image: none; + border-color: #f0f0f0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); +} +.tox .tox-button--secondary:focus:not(:disabled) { + background-color: #e3e3e3; + background-image: none; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; +} +.tox .tox-button--secondary:hover:not(:disabled) { + background-color: #e3e3e3; + background-image: none; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; +} +.tox .tox-button--secondary:active:not(:disabled) { + background-color: #d6d6d6; + background-image: none; + border-color: #d6d6d6; + box-shadow: none; + color: #222f3e; +} +.tox .tox-button--icon, +.tox .tox-button.tox-button--icon, +.tox .tox-button.tox-button--secondary.tox-button--icon { + padding: 4px; +} +.tox .tox-button--icon .tox-icon svg, +.tox .tox-button.tox-button--icon .tox-icon svg, +.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg { + display: block; + fill: currentColor; +} +.tox .tox-button-link { + background: 0; + border: none; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-weight: normal; + line-height: 1.3; + margin: 0; + padding: 0; + white-space: nowrap; +} +.tox .tox-button-link--sm { + font-size: 14px; +} +.tox .tox-button--naked { + background-color: transparent; + border-color: transparent; + box-shadow: unset; + color: #222f3e; +} +.tox .tox-button--naked[disabled] { + background-color: #f0f0f0; + border-color: #f0f0f0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); +} +.tox .tox-button--naked:hover:not(:disabled) { + background-color: #e3e3e3; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; +} +.tox .tox-button--naked:focus:not(:disabled) { + background-color: #e3e3e3; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; +} +.tox .tox-button--naked:active:not(:disabled) { + background-color: #d6d6d6; + border-color: #d6d6d6; + box-shadow: none; + color: #222f3e; +} +.tox .tox-button--naked .tox-icon svg { + fill: currentColor; +} +.tox .tox-button--naked.tox-button--icon:hover:not(:disabled) { + color: #222f3e; +} +.tox .tox-checkbox { + align-items: center; + border-radius: 3px; + cursor: pointer; + display: flex; + height: 36px; + min-width: 36px; +} +.tox .tox-checkbox__input { + /* Hide from view but visible to screen readers */ + height: 1px; + overflow: hidden; + position: absolute; + top: auto; + width: 1px; +} +.tox .tox-checkbox__icons { + align-items: center; + border-radius: 3px; + box-shadow: 0 0 0 2px transparent; + box-sizing: content-box; + display: flex; + height: 24px; + justify-content: center; + padding: calc(4px - 1px); + width: 24px; +} +.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + display: block; + fill: rgba(34, 47, 62, 0.3); +} +.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + display: none; + fill: #207ab7; +} +.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg { + display: none; + fill: #207ab7; +} +.tox .tox-checkbox--disabled { + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + display: none; +} +.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg { + display: block; +} +.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + display: none; +} +.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + display: block; +} +.tox input.tox-checkbox__input:focus + .tox-checkbox__icons { + border-radius: 3px; + box-shadow: inset 0 0 0 1px #207ab7; + padding: calc(4px - 1px); +} +.tox:not([dir=rtl]) .tox-checkbox__label { + margin-left: 4px; +} +.tox:not([dir=rtl]) .tox-checkbox__input { + left: -10000px; +} +.tox:not([dir=rtl]) .tox-bar .tox-checkbox { + margin-left: 4px; +} +.tox[dir=rtl] .tox-checkbox__label { + margin-right: 4px; +} +.tox[dir=rtl] .tox-checkbox__input { + right: -10000px; +} +.tox[dir=rtl] .tox-bar .tox-checkbox { + margin-right: 4px; +} +.tox { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox .tox-collection--toolbar .tox-collection__group { + display: flex; + padding: 0; +} +.tox .tox-collection--grid .tox-collection__group { + display: flex; + flex-wrap: wrap; + max-height: 208px; + overflow-x: hidden; + overflow-y: auto; + padding: 0; +} +.tox .tox-collection--list .tox-collection__group { + border-bottom-width: 0; + border-color: #cccccc; + border-left-width: 0; + border-right-width: 0; + border-style: solid; + border-top-width: 1px; + padding: 4px 0; +} +.tox .tox-collection--list .tox-collection__group:first-child { + border-top-width: 0; +} +.tox .tox-collection__group-heading { + background-color: #e6e6e6; + color: rgba(34, 47, 62, 0.7); + cursor: default; + font-size: 12px; + font-style: normal; + font-weight: normal; + margin-bottom: 4px; + margin-top: -4px; + padding: 4px 8px; + text-transform: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.tox .tox-collection__item { + align-items: center; + color: #222f3e; + cursor: pointer; + display: flex; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.tox .tox-collection--list .tox-collection__item { + padding: 4px 8px; +} +.tox .tox-collection--toolbar .tox-collection__item { + border-radius: 3px; + padding: 4px; +} +.tox .tox-collection--grid .tox-collection__item { + border-radius: 3px; + padding: 4px; +} +.tox .tox-collection--list .tox-collection__item--enabled { + background-color: #fff; + color: #222f3e; +} +.tox .tox-collection--list .tox-collection__item--active { + background-color: #dee0e2; +} +.tox .tox-collection--toolbar .tox-collection__item--enabled { + background-color: #c8cbcf; + color: #222f3e; +} +.tox .tox-collection--toolbar .tox-collection__item--active { + background-color: #dee0e2; +} +.tox .tox-collection--grid .tox-collection__item--enabled { + background-color: #c8cbcf; + color: #222f3e; +} +.tox .tox-collection--grid .tox-collection__item--active { + background-color: #dee0e2; +} +.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) { + color: #222f3e; +} +.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) { + color: #222f3e; +} +.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) { + color: #222f3e; +} +.tox .tox-collection__item--state-disabled { + background-color: transparent; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; +} +.tox .tox-collection__item-icon { + align-items: center; + display: flex; + height: 24px; + justify-content: center; + width: 24px; +} +.tox .tox-collection__item-icon svg { + fill: currentColor; +} +.tox .tox-collection--toolbar-lg .tox-collection__item-icon { + height: 48px; + width: 48px; +} +.tox .tox-collection__item-label { + color: currentColor; + display: inline-block; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 24px; + text-transform: none; + word-break: break-all; +} +.tox .tox-collection__item-accessory { + color: rgba(34, 47, 62, 0.7); + display: inline-block; + font-size: 14px; + height: 24px; + line-height: 24px; + text-transform: none; +} +.tox .tox-collection__item-caret { + align-items: center; + display: flex; + min-height: 24px; +} +.tox .tox-collection__item-caret::after { + content: ''; + font-size: 0; + min-height: inherit; +} +.tox .tox-collection__item-caret svg { + fill: #222f3e; +} +.tox .tox-collection__item[role="menuitemcheckbox"]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { + display: none; +} +.tox .tox-collection--horizontal { + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: nowrap; + margin-bottom: 0; + overflow-x: auto; + padding: 0; +} +.tox .tox-collection--horizontal .tox-collection__group { + align-items: center; + display: flex; + flex-wrap: nowrap; + margin: 0; + padding: 0 4px; +} +.tox .tox-collection--horizontal .tox-collection__item { + height: 34px; + margin: 2px 0 3px 0; + padding: 0 4px; +} +.tox .tox-collection--horizontal .tox-collection__item-label { + white-space: nowrap; +} +.tox .tox-collection--horizontal .tox-collection__item-caret { + margin-left: 4px; +} +.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { + border-right: 1px solid #cccccc; +} +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) { + margin-left: 8px; +} +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child { + margin-left: 4px; +} +.tox:not([dir=rtl]) .tox-collection__item-accessory { + margin-left: 16px; + text-align: right; +} +.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret { + margin-left: 16px; +} +.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { + border-left: 1px solid #cccccc; +} +.tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) { + margin-right: 8px; +} +.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child { + margin-right: 4px; +} +.tox[dir=rtl] .tox-collection__item-icon-rtl { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg { + transform: rotateY(180deg); +} +.tox[dir=rtl] .tox-collection__item-accessory { + margin-right: 16px; + text-align: left; +} +.tox[dir=rtl] .tox-collection .tox-collection__item-caret { + margin-right: 16px; + transform: rotateY(180deg); +} +.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret { + margin-right: 4px; +} +.tox .tox-color-picker-container { + display: flex; + flex-direction: row; + height: 225px; + margin: 0; +} +.tox .tox-sv-palette { + box-sizing: border-box; + display: flex; + height: 100%; +} +.tox .tox-sv-palette-spectrum { + height: 100%; +} +.tox .tox-sv-palette, +.tox .tox-sv-palette-spectrum { + width: 225px; +} +.tox .tox-sv-palette-thumb { + background: none; + border: 1px solid black; + border-radius: 50%; + box-sizing: content-box; + height: 12px; + position: absolute; + width: 12px; +} +.tox .tox-sv-palette-inner-thumb { + border: 1px solid white; + border-radius: 50%; + height: 10px; + position: absolute; + width: 10px; +} +.tox .tox-hue-slider { + box-sizing: border-box; + height: 100%; + width: 25px; +} +.tox .tox-hue-slider-spectrum { + background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); + height: 100%; + width: 100%; +} +.tox .tox-hue-slider, +.tox .tox-hue-slider-spectrum { + width: 20px; +} +.tox .tox-hue-slider-thumb { + background: white; + border: 1px solid black; + box-sizing: content-box; + height: 4px; + width: 100%; +} +.tox .tox-rgb-form { + display: flex; + flex-direction: column; + justify-content: space-between; +} +.tox .tox-rgb-form div { + align-items: center; + display: flex; + justify-content: space-between; + margin-bottom: 5px; + width: inherit; +} +.tox .tox-rgb-form input { + width: 6em; +} +.tox .tox-rgb-form input.tox-invalid { + /* Need !important to override Chrome's focus styling unfortunately */ + border: 1px solid red !important; +} +.tox .tox-rgb-form .tox-rgba-preview { + border: 1px solid black; + flex-grow: 2; + margin-bottom: 0; +} +.tox:not([dir=rtl]) .tox-sv-palette { + margin-right: 15px; +} +.tox:not([dir=rtl]) .tox-hue-slider { + margin-right: 15px; +} +.tox:not([dir=rtl]) .tox-hue-slider-thumb { + margin-left: -1px; +} +.tox:not([dir=rtl]) .tox-rgb-form label { + margin-right: 0.5em; +} +.tox[dir=rtl] .tox-sv-palette { + margin-left: 15px; +} +.tox[dir=rtl] .tox-hue-slider { + margin-left: 15px; +} +.tox[dir=rtl] .tox-hue-slider-thumb { + margin-right: -1px; +} +.tox[dir=rtl] .tox-rgb-form label { + margin-left: 0.5em; +} +.tox .tox-toolbar .tox-swatches, +.tox .tox-toolbar__primary .tox-swatches, +.tox .tox-toolbar__overflow .tox-swatches { + margin: 2px 0 3px 4px; +} +.tox .tox-collection--list .tox-collection__group .tox-swatches-menu { + border: 0; + margin: -4px 0; +} +.tox .tox-swatches__row { + display: flex; +} +.tox .tox-swatch { + height: 30px; + transition: transform 0.15s, box-shadow 0.15s; + width: 30px; +} +.tox .tox-swatch:hover, +.tox .tox-swatch:focus { + box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; + transform: scale(0.8); +} +.tox .tox-swatch--remove { + align-items: center; + display: flex; + justify-content: center; +} +.tox .tox-swatch--remove svg path { + stroke: #e74c3c; +} +.tox .tox-swatches__picker-btn { + align-items: center; + background-color: transparent; + border: 0; + cursor: pointer; + display: flex; + height: 30px; + justify-content: center; + outline: none; + padding: 0; + width: 30px; +} +.tox .tox-swatches__picker-btn svg { + height: 24px; + width: 24px; +} +.tox .tox-swatches__picker-btn:hover { + background: #dee0e2; +} +.tox:not([dir=rtl]) .tox-swatches__picker-btn { + margin-left: auto; +} +.tox[dir=rtl] .tox-swatches__picker-btn { + margin-right: auto; +} +.tox .tox-comment-thread { + background: #fff; + position: relative; +} +.tox .tox-comment-thread > *:not(:first-child) { + margin-top: 8px; +} +.tox .tox-comment { + background: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); + padding: 8px 8px 16px 8px; + position: relative; +} +.tox .tox-comment__header { + align-items: center; + color: #222f3e; + display: flex; + justify-content: space-between; +} +.tox .tox-comment__date { + color: rgba(34, 47, 62, 0.7); + font-size: 12px; +} +.tox .tox-comment__body { + color: #222f3e; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin-top: 8px; + position: relative; + text-transform: initial; +} +.tox .tox-comment__body textarea { + resize: none; + white-space: normal; + width: 100%; +} +.tox .tox-comment__expander { + padding-top: 8px; +} +.tox .tox-comment__expander p { + color: rgba(34, 47, 62, 0.7); + font-size: 14px; + font-style: normal; +} +.tox .tox-comment__body p { + margin: 0; +} +.tox .tox-comment__buttonspacing { + padding-top: 16px; + text-align: center; +} +.tox .tox-comment-thread__overlay::after { + background: #fff; + bottom: 0; + content: ""; + display: flex; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + top: 0; + z-index: 5; +} +.tox .tox-comment__reply { + display: flex; + flex-shrink: 0; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 8px; +} +.tox .tox-comment__reply > *:first-child { + margin-bottom: 8px; + width: 100%; +} +.tox .tox-comment__edit { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 16px; +} +.tox .tox-comment__gradient::after { + background: linear-gradient(rgba(255, 255, 255, 0), #fff); + bottom: 0; + content: ""; + display: block; + height: 5em; + margin-top: -40px; + position: absolute; + width: 100%; +} +.tox .tox-comment__overlay { + background: #fff; + bottom: 0; + display: flex; + flex-direction: column; + flex-grow: 1; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + text-align: center; + top: 0; + z-index: 5; +} +.tox .tox-comment__loading-text { + align-items: center; + color: #222f3e; + display: flex; + flex-direction: column; + position: relative; +} +.tox .tox-comment__loading-text > div { + padding-bottom: 16px; +} +.tox .tox-comment__overlaytext { + bottom: 0; + flex-direction: column; + font-size: 14px; + left: 0; + padding: 1em; + position: absolute; + right: 0; + top: 0; + z-index: 10; +} +.tox .tox-comment__overlaytext p { + background-color: #fff; + box-shadow: 0 0 8px 8px #fff; + color: #222f3e; + text-align: center; +} +.tox .tox-comment__overlaytext div:nth-of-type(2) { + font-size: 0.8em; +} +.tox .tox-comment__busy-spinner { + align-items: center; + background-color: #fff; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 20; +} +.tox .tox-comment__scroll { + display: flex; + flex-direction: column; + flex-shrink: 1; + overflow: auto; +} +.tox .tox-conversations { + margin: 8px; +} +.tox:not([dir=rtl]) .tox-comment__edit { + margin-left: 8px; +} +.tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child, +.tox:not([dir=rtl]) .tox-comment__edit > *:last-child, +.tox:not([dir=rtl]) .tox-comment__reply > *:last-child { + margin-left: 8px; +} +.tox[dir=rtl] .tox-comment__edit { + margin-right: 8px; +} +.tox[dir=rtl] .tox-comment__buttonspacing > *:last-child, +.tox[dir=rtl] .tox-comment__edit > *:last-child, +.tox[dir=rtl] .tox-comment__reply > *:last-child { + margin-right: 8px; +} +.tox .tox-user { + align-items: center; + display: flex; +} +.tox .tox-user__avatar svg { + fill: rgba(34, 47, 62, 0.7); +} +.tox .tox-user__name { + color: rgba(34, 47, 62, 0.7); + font-size: 12px; + font-style: normal; + font-weight: bold; + text-transform: uppercase; +} +.tox:not([dir=rtl]) .tox-user__avatar svg { + margin-right: 8px; +} +.tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name { + margin-left: 8px; +} +.tox[dir=rtl] .tox-user__avatar svg { + margin-left: 8px; +} +.tox[dir=rtl] .tox-user__avatar + .tox-user__name { + margin-right: 8px; +} +.tox .tox-dialog-wrap { + align-items: center; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 1100; +} +.tox .tox-dialog-wrap__backdrop { + background-color: rgba(255, 255, 255, 0.75); + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 1; +} +.tox .tox-dialog-wrap__backdrop--opaque { + background-color: #fff; +} +.tox .tox-dialog { + background-color: #fff; + border-color: #cccccc; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: 0 16px 16px -10px rgba(34, 47, 62, 0.15), 0 0 40px 1px rgba(34, 47, 62, 0.15); + display: flex; + flex-direction: column; + max-height: 100%; + max-width: 480px; + overflow: hidden; + position: relative; + width: 95vw; + z-index: 2; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog { + align-self: flex-start; + margin: 8px auto; + width: calc(100vw - 16px); + } +} +.tox .tox-dialog-inline { + z-index: 1100; +} +.tox .tox-dialog__header { + align-items: center; + background-color: #fff; + border-bottom: none; + color: #222f3e; + display: flex; + font-size: 16px; + justify-content: space-between; + padding: 8px 16px 0 16px; + position: relative; +} +.tox .tox-dialog__header .tox-button { + z-index: 1; +} +.tox .tox-dialog__draghandle { + cursor: grab; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} +.tox .tox-dialog__draghandle:active { + cursor: grabbing; +} +.tox .tox-dialog__dismiss { + margin-left: auto; +} +.tox .tox-dialog__title { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 20px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin: 0; + text-transform: none; +} +.tox .tox-dialog__body { + color: #222f3e; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + min-width: 0; + text-align: left; + text-transform: none; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body { + flex-direction: column; + } +} +.tox .tox-dialog__body-nav { + align-items: flex-start; + display: flex; + flex-direction: column; + padding: 16px 16px; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { + flex-direction: row; + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding-bottom: 0; + } +} +.tox .tox-dialog__body-nav-item { + border-bottom: 2px solid transparent; + color: rgba(34, 47, 62, 0.7); + display: inline-block; + font-size: 14px; + line-height: 1.3; + margin-bottom: 8px; + text-decoration: none; + white-space: nowrap; +} +.tox .tox-dialog__body-nav-item:focus { + background-color: rgba(32, 122, 183, 0.1); +} +.tox .tox-dialog__body-nav-item--active { + border-bottom: 2px solid #207ab7; + color: #207ab7; +} +.tox .tox-dialog__body-content { + box-sizing: border-box; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; + max-height: 650px; + overflow: auto; + -webkit-overflow-scrolling: touch; + padding: 16px 16px; +} +.tox .tox-dialog__body-content > * { + margin-bottom: 0; + margin-top: 16px; +} +.tox .tox-dialog__body-content > *:first-child { + margin-top: 0; +} +.tox .tox-dialog__body-content > *:last-child { + margin-bottom: 0; +} +.tox .tox-dialog__body-content > *:only-child { + margin-bottom: 0; + margin-top: 0; +} +.tox .tox-dialog__body-content a { + color: #207ab7; + cursor: pointer; + text-decoration: none; +} +.tox .tox-dialog__body-content a:hover, +.tox .tox-dialog__body-content a:focus { + color: #185d8c; + text-decoration: none; +} +.tox .tox-dialog__body-content a:active { + color: #185d8c; + text-decoration: none; +} +.tox .tox-dialog__body-content svg { + fill: #222f3e; +} +.tox .tox-dialog__body-content ul { + display: block; + list-style-type: disc; + margin-bottom: 16px; + -webkit-margin-end: 0; + margin-inline-end: 0; + -webkit-margin-start: 0; + margin-inline-start: 0; + -webkit-padding-start: 2.5rem; + padding-inline-start: 2.5rem; +} +.tox .tox-dialog__body-content .tox-form__group h1 { + font-size: 20px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.tox .tox-dialog__body-content .tox-form__group h2 { + font-size: 16px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.tox .tox-dialog__body-content .tox-form__group p { + margin-bottom: 16px; +} +.tox .tox-dialog__body-content .tox-form__group h1:first-child, +.tox .tox-dialog__body-content .tox-form__group h2:first-child, +.tox .tox-dialog__body-content .tox-form__group p:first-child { + margin-top: 0; +} +.tox .tox-dialog__body-content .tox-form__group h1:last-child, +.tox .tox-dialog__body-content .tox-form__group h2:last-child, +.tox .tox-dialog__body-content .tox-form__group p:last-child { + margin-bottom: 0; +} +.tox .tox-dialog__body-content .tox-form__group h1:only-child, +.tox .tox-dialog__body-content .tox-form__group h2:only-child, +.tox .tox-dialog__body-content .tox-form__group p:only-child { + margin-bottom: 0; + margin-top: 0; +} +.tox .tox-dialog--width-lg { + height: 650px; + max-width: 1200px; +} +.tox .tox-dialog--width-md { + max-width: 800px; +} +.tox .tox-dialog--width-md .tox-dialog__body-content { + overflow: auto; +} +.tox .tox-dialog__body-content--centered { + text-align: center; +} +.tox .tox-dialog__footer { + align-items: center; + background-color: #fff; + border-top: 1px solid #cccccc; + display: flex; + justify-content: space-between; + padding: 8px 16px; +} +.tox .tox-dialog__footer-start, +.tox .tox-dialog__footer-end { + display: flex; +} +.tox .tox-dialog__busy-spinner { + align-items: center; + background-color: rgba(255, 255, 255, 0.75); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 3; +} +.tox .tox-dialog__table { + border-collapse: collapse; + width: 100%; +} +.tox .tox-dialog__table thead th { + font-weight: bold; + padding-bottom: 8px; +} +.tox .tox-dialog__table tbody tr { + border-bottom: 1px solid #cccccc; +} +.tox .tox-dialog__table tbody tr:last-child { + border-bottom: none; +} +.tox .tox-dialog__table td { + padding-bottom: 8px; + padding-top: 8px; +} +.tox .tox-dialog__popups { + position: absolute; + width: 100%; + z-index: 1100; +} +.tox .tox-dialog__body-iframe { + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; +} +.tox .tox-dialog__body-iframe .tox-navobj { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) { + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; +} +.tox .tox-dialog-dock-fadeout { + opacity: 0; + visibility: hidden; +} +.tox .tox-dialog-dock-fadein { + opacity: 1; + visibility: visible; +} +.tox .tox-dialog-dock-transition { + transition: visibility 0s linear 0.3s, opacity 0.3s ease; +} +.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein { + transition-delay: 0s; +} +body.tox-dialog__disable-scroll { + overflow: hidden; +} +.tox.tox-platform-ie { + /* IE11 CSS styles go here */ +} +.tox.tox-platform-ie .tox-dialog-wrap { + position: -ms-device-fixed; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { + margin-right: 0; + } +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { + margin-left: 8px; + } +} +.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *, +.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * { + margin-left: 8px; +} +.tox[dir=rtl] .tox-dialog__body { + text-align: right; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { + margin-left: 0; + } +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { + margin-right: 8px; + } +} +.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *, +.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * { + margin-right: 8px; +} +.tox .tox-dropzone-container { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-dropzone { + align-items: center; + background: #fff; + border: 2px dashed #cccccc; + box-sizing: border-box; + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: center; + min-height: 100px; + padding: 10px; +} +.tox .tox-dropzone p { + color: rgba(34, 47, 62, 0.7); + margin: 0 0 16px 0; +} +.tox .tox-edit-area { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + overflow: hidden; + position: relative; +} +.tox .tox-edit-area__iframe { + background-color: #fff; + border: 0; + box-sizing: border-box; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; + position: absolute; + width: 100%; +} +.tox.tox-inline-edit-area { + border: 1px dotted #cccccc; +} +.tox .tox-editor-container { + display: flex; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; +} +.tox .tox-editor-header { + z-index: 1; +} +.tox:not(.tox-tinymce-inline) .tox-editor-header { + box-shadow: none; + transition: box-shadow 0.5s; +} +.tox.tox-tinymce--toolbar-bottom .tox-editor-header, +.tox.tox-tinymce-inline .tox-editor-header { + margin-bottom: -1px; +} +.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header { + box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); +} +.tox-editor-dock-fadeout { + opacity: 0; + visibility: hidden; +} +.tox-editor-dock-fadein { + opacity: 1; + visibility: visible; +} +.tox-editor-dock-transition { + transition: visibility 0s linear 0.25s, opacity 0.25s ease; +} +.tox-editor-dock-transition.tox-editor-dock-fadein { + transition-delay: 0s; +} +.tox .tox-control-wrap { + flex: 1; + position: relative; +} +.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid, +.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown, +.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid { + display: none; +} +.tox .tox-control-wrap svg { + display: block; +} +.tox .tox-control-wrap__status-icon-wrap { + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.tox .tox-control-wrap__status-icon-invalid svg { + fill: #c00; +} +.tox .tox-control-wrap__status-icon-unknown svg { + fill: orange; +} +.tox .tox-control-wrap__status-icon-valid svg { + fill: green; +} +.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield, +.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield, +.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield { + padding-right: 32px; +} +.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap { + right: 4px; +} +.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield, +.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield, +.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield { + padding-left: 32px; +} +.tox[dir=rtl] .tox-control-wrap__status-icon-wrap { + left: 4px; +} +.tox .tox-autocompleter { + max-width: 25em; +} +.tox .tox-autocompleter .tox-menu { + max-width: 25em; +} +.tox .tox-autocompleter .tox-autocompleter-highlight { + font-weight: bold; +} +.tox .tox-color-input { + display: flex; + position: relative; + z-index: 1; +} +.tox .tox-color-input .tox-textfield { + z-index: -1; +} +.tox .tox-color-input span { + border-color: rgba(34, 47, 62, 0.2); + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + cursor: pointer; + height: 24px; + position: absolute; + top: 6px; + width: 24px; +} +.tox .tox-color-input span:focus { + border-color: #207ab7; +} +.tox .tox-color-input span::before { + background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%); + background-position: 0 0, 0 6px, 6px -6px, -6px 0; + background-size: 12px 12px; + border: 1px solid #fff; + border-radius: 3px; + box-sizing: border-box; + content: ''; + height: 24px; + left: -1px; + position: absolute; + top: -1px; + width: 24px; + z-index: -1; +} +.tox:not([dir=rtl]) .tox-color-input .tox-textfield { + padding-left: 36px; +} +.tox:not([dir=rtl]) .tox-color-input span { + left: 6px; +} +.tox[dir="rtl"] .tox-color-input .tox-textfield { + padding-right: 36px; +} +.tox[dir="rtl"] .tox-color-input span { + right: 6px; +} +.tox .tox-label, +.tox .tox-toolbar-label { + color: rgba(34, 47, 62, 0.7); + display: block; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + padding: 0 8px 0 0; + text-transform: none; + white-space: nowrap; +} +.tox .tox-toolbar-label { + padding: 0 8px; +} +.tox[dir=rtl] .tox-label { + padding: 0 0 0 8px; +} +.tox .tox-form { + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group { + box-sizing: border-box; + margin-bottom: 4px; +} +.tox .tox-form-group--maximize { + flex: 1; +} +.tox .tox-form__group--error { + color: #c00; +} +.tox .tox-form__group--collection { + display: flex; +} +.tox .tox-form__grid { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; +} +.tox .tox-form__grid--2col > .tox-form__group { + width: calc(50% - (8px / 2)); +} +.tox .tox-form__grid--3col > .tox-form__group { + width: calc(100% / 3 - (8px / 2)); +} +.tox .tox-form__grid--4col > .tox-form__group { + width: calc(25% - (8px / 2)); +} +.tox .tox-form__controls-h-stack { + align-items: center; + display: flex; +} +.tox .tox-form__group--inline { + align-items: center; + display: flex; +} +.tox .tox-form__group--stretched { + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group--stretched .tox-textarea { + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group--stretched .tox-navobj { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-form__group--stretched .tox-navobj :nth-child(2) { + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; +} +.tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) { + margin-left: 4px; +} +.tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) { + margin-right: 4px; +} +.tox .tox-lock.tox-locked .tox-lock-icon__unlock, +.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock { + display: none; +} +.tox .tox-textfield, +.tox .tox-toolbar-textfield, +.tox .tox-selectfield select, +.tox .tox-textarea { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #cccccc; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #222f3e; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + min-height: 34px; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} +.tox .tox-textfield[disabled], +.tox .tox-textarea[disabled] { + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; +} +.tox .tox-textfield:focus, +.tox .tox-selectfield select:focus, +.tox .tox-textarea:focus { + border-color: #207ab7; + box-shadow: none; + outline: none; +} +.tox .tox-toolbar-textfield { + border-width: 0; + margin-bottom: 3px; + margin-top: 2px; + max-width: 250px; +} +.tox .tox-naked-btn { + background-color: transparent; + border: 0; + border-color: transparent; + box-shadow: unset; + color: #207ab7; + cursor: pointer; + display: block; + margin: 0; + padding: 0; +} +.tox .tox-naked-btn svg { + display: block; + fill: #222f3e; +} +.tox:not([dir=rtl]) .tox-toolbar-textfield + * { + margin-left: 4px; +} +.tox[dir=rtl] .tox-toolbar-textfield + * { + margin-right: 4px; +} +.tox .tox-selectfield { + cursor: pointer; + position: relative; +} +.tox .tox-selectfield select[disabled] { + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; +} +.tox .tox-selectfield select::-ms-expand { + display: none; +} +.tox .tox-selectfield svg { + pointer-events: none; + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.tox:not([dir=rtl]) .tox-selectfield select[size="0"], +.tox:not([dir=rtl]) .tox-selectfield select[size="1"] { + padding-right: 24px; +} +.tox:not([dir=rtl]) .tox-selectfield svg { + right: 8px; +} +.tox[dir=rtl] .tox-selectfield select[size="0"], +.tox[dir=rtl] .tox-selectfield select[size="1"] { + padding-left: 24px; +} +.tox[dir=rtl] .tox-selectfield svg { + left: 8px; +} +.tox .tox-textarea { + -webkit-appearance: textarea; + -moz-appearance: textarea; + appearance: textarea; + white-space: pre-wrap; +} +.tox-fullscreen { + border: 0; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + -ms-scroll-chaining: none; + overscroll-behavior: none; + padding: 0; + position: fixed; + top: 0; + touch-action: pinch-zoom; + width: 100%; +} +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { + display: none; +} +.tox-fullscreen .tox.tox-tinymce.tox-fullscreen { + z-index: 1200; +} +.tox-fullscreen .tox.tox-tinymce-aux { + z-index: 1201; +} +.tox .tox-help__more-link { + list-style: none; + margin-top: 1em; +} +.tox .tox-image-tools { + width: 100%; +} +.tox .tox-image-tools__toolbar { + align-items: center; + display: flex; + justify-content: center; +} +.tox .tox-image-tools__image { + background-color: #666; + height: 380px; + overflow: auto; + position: relative; + width: 100%; +} +.tox .tox-image-tools__image, +.tox .tox-image-tools__image + .tox-image-tools__toolbar { + margin-top: 8px; +} +.tox .tox-image-tools__image-bg { + background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); +} +.tox .tox-image-tools__toolbar > .tox-spacer { + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-croprect-block { + background: black; + filter: alpha(opacity=50); + opacity: 0.5; + position: absolute; + zoom: 1; +} +.tox .tox-croprect-handle { + border: 2px solid white; + height: 20px; + left: 0; + position: absolute; + top: 0; + width: 20px; +} +.tox .tox-croprect-handle-move { + border: 0; + cursor: move; + position: absolute; +} +.tox .tox-croprect-handle-nw { + border-width: 2px 0 0 2px; + cursor: nw-resize; + left: 100px; + margin: -2px 0 0 -2px; + top: 100px; +} +.tox .tox-croprect-handle-ne { + border-width: 2px 2px 0 0; + cursor: ne-resize; + left: 200px; + margin: -2px 0 0 -20px; + top: 100px; +} +.tox .tox-croprect-handle-sw { + border-width: 0 0 2px 2px; + cursor: sw-resize; + left: 100px; + margin: -20px 2px 0 -2px; + top: 200px; +} +.tox .tox-croprect-handle-se { + border-width: 0 2px 2px 0; + cursor: se-resize; + left: 200px; + margin: -20px 0 0 -20px; + top: 200px; +} +.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { + margin-left: 8px; +} +.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider { + margin-left: 32px; +} +.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button { + margin-left: 32px; +} +.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { + margin-right: 8px; +} +.tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider { + margin-right: 32px; +} +.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button { + margin-right: 32px; +} +.tox .tox-insert-table-picker { + display: flex; + flex-wrap: wrap; + width: 169px; +} +.tox .tox-insert-table-picker > div { + border-color: #cccccc; + border-style: solid; + border-width: 0 1px 1px 0; + box-sizing: content-box; + height: 16px; + width: 16px; +} +.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker { + margin: -4px 0; +} +.tox .tox-insert-table-picker .tox-insert-table-picker__selected { + background-color: rgba(32, 122, 183, 0.5); + border-color: rgba(32, 122, 183, 0.5); +} +.tox .tox-insert-table-picker__label { + color: rgba(34, 47, 62, 0.7); + display: block; + font-size: 14px; + padding: 4px; + text-align: center; + width: 100%; +} +.tox:not([dir=rtl]) { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) { + border-right: 0; +} +.tox[dir=rtl] { + /* stylelint-disable-next-line no-descending-specificity */ +} +.tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) { + border-right: 0; +} +.tox { + /* stylelint-disable */ + /* stylelint-enable */ +} +.tox .tox-menu { + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); + display: inline-block; + overflow: hidden; + vertical-align: top; + z-index: 1150; +} +.tox .tox-menu.tox-collection.tox-collection--list { + padding: 0; +} +.tox .tox-menu.tox-collection.tox-collection--toolbar { + padding: 4px; +} +.tox .tox-menu.tox-collection.tox-collection--grid { + padding: 4px; +} +.tox .tox-menu__label h1, +.tox .tox-menu__label h2, +.tox .tox-menu__label h3, +.tox .tox-menu__label h4, +.tox .tox-menu__label h5, +.tox .tox-menu__label h6, +.tox .tox-menu__label p, +.tox .tox-menu__label blockquote, +.tox .tox-menu__label code { + margin: 0; +} +.tox .tox-menubar { + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; + background-color: #fff; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 4px 0 4px; +} +.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar { + border-top: 1px solid #cccccc; +} +/* Deprecated. Remove in next major release */ +.tox .tox-mbtn { + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #222f3e; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0 4px; + text-transform: none; + width: auto; +} +.tox .tox-mbtn[disabled] { + background-color: transparent; + border: 0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; +} +.tox .tox-mbtn:focus:not(:disabled) { + background: #dee0e2; + border: 0; + box-shadow: none; + color: #222f3e; +} +.tox .tox-mbtn--active { + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; +} +.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) { + background: #dee0e2; + border: 0; + box-shadow: none; + color: #222f3e; +} +.tox .tox-mbtn__select-label { + cursor: default; + font-weight: normal; + margin: 0 4px; +} +.tox .tox-mbtn[disabled] .tox-mbtn__select-label { + cursor: not-allowed; +} +.tox .tox-mbtn__select-chevron { + align-items: center; + display: flex; + justify-content: center; + width: 16px; + display: none; +} +.tox .tox-notification { + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + display: -ms-grid; + display: grid; + font-size: 14px; + font-weight: normal; + -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + margin-top: 4px; + opacity: 0; + padding: 4px; + transition: transform 100ms ease-in, opacity 150ms ease-in; +} +.tox .tox-notification p { + font-size: 14px; + font-weight: normal; +} +.tox .tox-notification a { + text-decoration: underline; +} +.tox .tox-notification--in { + opacity: 1; +} +.tox .tox-notification--success { + background-color: #e4eeda; + border-color: #d7e6c8; + color: #222f3e; +} +.tox .tox-notification--success p { + color: #222f3e; +} +.tox .tox-notification--success a { + color: #547831; +} +.tox .tox-notification--success svg { + fill: #222f3e; +} +.tox .tox-notification--error { + background-color: #f8dede; + border-color: #f2bfbf; + color: #222f3e; +} +.tox .tox-notification--error p { + color: #222f3e; +} +.tox .tox-notification--error a { + color: #c00; +} +.tox .tox-notification--error svg { + fill: #222f3e; +} +.tox .tox-notification--warn, +.tox .tox-notification--warning { + background-color: #fffaea; + border-color: #ffe89d; + color: #222f3e; +} +.tox .tox-notification--warn p, +.tox .tox-notification--warning p { + color: #222f3e; +} +.tox .tox-notification--warn a, +.tox .tox-notification--warning a { + color: #222f3e; +} +.tox .tox-notification--warn svg, +.tox .tox-notification--warning svg { + fill: #222f3e; +} +.tox .tox-notification--info { + background-color: #d9edf7; + border-color: #779ecb; + color: #222f3e; +} +.tox .tox-notification--info p { + color: #222f3e; +} +.tox .tox-notification--info a { + color: #222f3e; +} +.tox .tox-notification--info svg { + fill: #222f3e; +} +.tox .tox-notification__body { + -ms-grid-row-align: center; + align-self: center; + color: #222f3e; + font-size: 14px; + -ms-grid-column-span: 1; + grid-column-end: 3; + -ms-grid-column: 2; + grid-column-start: 2; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + text-align: center; + white-space: normal; + word-break: break-all; + word-break: break-word; +} +.tox .tox-notification__body > * { + margin: 0; +} +.tox .tox-notification__body > * + * { + margin-top: 1rem; +} +.tox .tox-notification__icon { + -ms-grid-row-align: center; + align-self: center; + -ms-grid-column-span: 1; + grid-column-end: 2; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} +.tox .tox-notification__icon svg { + display: block; +} +.tox .tox-notification__dismiss { + -ms-grid-row-align: start; + align-self: start; + -ms-grid-column-span: 1; + grid-column-end: 4; + -ms-grid-column: 3; + grid-column-start: 3; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} +.tox .tox-notification .tox-progress-bar { + -ms-grid-column-span: 3; + grid-column-end: 4; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 3; + -ms-grid-row: 2; + grid-row-start: 2; + -ms-grid-column-align: center; + justify-self: center; +} +.tox .tox-pop { + display: inline-block; + position: relative; +} +.tox .tox-pop--resizing { + transition: width 0.1s ease; +} +.tox .tox-pop--resizing .tox-toolbar { + flex-wrap: nowrap; +} +.tox .tox-pop__dialog { + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + min-width: 0; + overflow: hidden; +} +.tox .tox-pop__dialog > *:not(.tox-toolbar) { + margin: 4px 4px 4px 8px; +} +.tox .tox-pop__dialog .tox-toolbar { + background-color: transparent; + margin-bottom: -1px; +} +.tox .tox-pop::before, +.tox .tox-pop::after { + border-style: solid; + content: ''; + display: block; + height: 0; + position: absolute; + width: 0; +} +.tox .tox-pop.tox-pop--bottom::before, +.tox .tox-pop.tox-pop--bottom::after { + left: 50%; + top: 100%; +} +.tox .tox-pop.tox-pop--bottom::after { + border-color: #fff transparent transparent transparent; + border-width: 8px; + margin-left: -8px; + margin-top: -1px; +} +.tox .tox-pop.tox-pop--bottom::before { + border-color: #cccccc transparent transparent transparent; + border-width: 9px; + margin-left: -9px; +} +.tox .tox-pop.tox-pop--top::before, +.tox .tox-pop.tox-pop--top::after { + left: 50%; + top: 0; + transform: translateY(-100%); +} +.tox .tox-pop.tox-pop--top::after { + border-color: transparent transparent #fff transparent; + border-width: 8px; + margin-left: -8px; + margin-top: 1px; +} +.tox .tox-pop.tox-pop--top::before { + border-color: transparent transparent #cccccc transparent; + border-width: 9px; + margin-left: -9px; +} +.tox .tox-pop.tox-pop--left::before, +.tox .tox-pop.tox-pop--left::after { + left: 0; + top: calc(50% - 1px); + transform: translateY(-50%); +} +.tox .tox-pop.tox-pop--left::after { + border-color: transparent #fff transparent transparent; + border-width: 8px; + margin-left: -15px; +} +.tox .tox-pop.tox-pop--left::before { + border-color: transparent #cccccc transparent transparent; + border-width: 10px; + margin-left: -19px; +} +.tox .tox-pop.tox-pop--right::before, +.tox .tox-pop.tox-pop--right::after { + left: 100%; + top: calc(50% + 1px); + transform: translateY(-50%); +} +.tox .tox-pop.tox-pop--right::after { + border-color: transparent transparent transparent #fff; + border-width: 8px; + margin-left: -1px; +} +.tox .tox-pop.tox-pop--right::before { + border-color: transparent transparent transparent #cccccc; + border-width: 10px; + margin-left: -1px; +} +.tox .tox-pop.tox-pop--align-left::before, +.tox .tox-pop.tox-pop--align-left::after { + left: 20px; +} +.tox .tox-pop.tox-pop--align-right::before, +.tox .tox-pop.tox-pop--align-right::after { + left: calc(100% - 20px); +} +.tox .tox-sidebar-wrap { + display: flex; + flex-direction: row; + flex-grow: 1; + -ms-flex-preferred-size: 0; + min-height: 0; +} +.tox .tox-sidebar { + background-color: #fff; + display: flex; + flex-direction: row; + justify-content: flex-end; +} +.tox .tox-sidebar__slider { + display: flex; + overflow: hidden; +} +.tox .tox-sidebar__pane-container { + display: flex; +} +.tox .tox-sidebar__pane { + display: flex; +} +.tox .tox-sidebar--sliding-closed { + opacity: 0; +} +.tox .tox-sidebar--sliding-open { + opacity: 1; +} +.tox .tox-sidebar--sliding-growing, +.tox .tox-sidebar--sliding-shrinking { + transition: width 0.5s ease, opacity 0.5s ease; +} +.tox .tox-selector { + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + display: inline-block; + height: 10px; + position: absolute; + width: 10px; +} +.tox.tox-platform-touch .tox-selector { + height: 12px; + width: 12px; +} +.tox .tox-slider { + align-items: center; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + height: 24px; + justify-content: center; + position: relative; +} +.tox .tox-slider__rail { + background-color: transparent; + border: 1px solid #cccccc; + border-radius: 3px; + height: 10px; + min-width: 120px; + width: 100%; +} +.tox .tox-slider__handle { + background-color: #207ab7; + border: 2px solid #185d8c; + border-radius: 3px; + box-shadow: none; + height: 24px; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: 14px; +} +.tox .tox-source-code { + overflow: auto; +} +.tox .tox-spinner { + display: flex; +} +.tox .tox-spinner > div { + animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; + background-color: rgba(34, 47, 62, 0.7); + border-radius: 100%; + height: 8px; + width: 8px; +} +.tox .tox-spinner > div:nth-child(1) { + animation-delay: -0.32s; +} +.tox .tox-spinner > div:nth-child(2) { + animation-delay: -0.16s; +} +@keyframes tam-bouncing-dots { + 0%, + 80%, + 100% { + transform: scale(0); + } + 40% { + transform: scale(1); + } +} +.tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) { + margin-left: 4px; +} +.tox[dir=rtl] .tox-spinner > div:not(:first-child) { + margin-right: 4px; +} +.tox .tox-statusbar { + align-items: center; + background-color: #fff; + border-top: 1px solid #cccccc; + color: rgba(34, 47, 62, 0.7); + display: flex; + flex: 0 0 auto; + font-size: 12px; + font-weight: normal; + height: 18px; + overflow: hidden; + padding: 0 8px; + position: relative; + text-transform: uppercase; +} +.tox .tox-statusbar__text-container { + display: flex; + flex: 1 1 auto; + justify-content: flex-end; + overflow: hidden; +} +.tox .tox-statusbar__path { + display: flex; + flex: 1 1 auto; + margin-right: auto; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.tox .tox-statusbar__path > * { + display: inline; + white-space: nowrap; +} +.tox .tox-statusbar__wordcount { + flex: 0 0 auto; + margin-left: 1ch; +} +.tox .tox-statusbar a, +.tox .tox-statusbar__path-item, +.tox .tox-statusbar__wordcount { + color: rgba(34, 47, 62, 0.7); + text-decoration: none; +} +.tox .tox-statusbar a:hover, +.tox .tox-statusbar__path-item:hover, +.tox .tox-statusbar__wordcount:hover, +.tox .tox-statusbar a:focus, +.tox .tox-statusbar__path-item:focus, +.tox .tox-statusbar__wordcount:focus { + cursor: pointer; + text-decoration: underline; +} +.tox .tox-statusbar__resize-handle { + align-items: flex-end; + align-self: stretch; + cursor: nwse-resize; + display: flex; + flex: 0 0 auto; + justify-content: flex-end; + margin-left: auto; + margin-right: -8px; + padding-left: 1ch; +} +.tox .tox-statusbar__resize-handle svg { + display: block; + fill: rgba(34, 47, 62, 0.7); +} +.tox:not([dir=rtl]) .tox-statusbar__path > * { + margin-right: 4px; +} +.tox:not([dir=rtl]) .tox-statusbar__branding { + margin-left: 1ch; +} +.tox[dir=rtl] .tox-statusbar { + flex-direction: row-reverse; +} +.tox[dir=rtl] .tox-statusbar__path > * { + margin-left: 4px; +} +.tox .tox-throbber { + z-index: 1400; +} +.tox .tox-throbber__busy-spinner { + align-items: center; + background-color: rgba(255, 255, 255, 0.6); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; +} +.tox .tox-tbtn { + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #222f3e; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0; + text-transform: none; + width: 34px; +} +.tox .tox-tbtn svg { + display: block; + fill: #222f3e; +} +.tox .tox-tbtn.tox-tbtn-more { + padding-left: 5px; + padding-right: 5px; + width: inherit; +} +.tox .tox-tbtn:focus { + background: #dee0e2; + border: 0; + box-shadow: none; +} +.tox .tox-tbtn:hover { + background: #dee0e2; + border: 0; + box-shadow: none; + color: #222f3e; +} +.tox .tox-tbtn:hover svg { + fill: #222f3e; +} +.tox .tox-tbtn:active { + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; +} +.tox .tox-tbtn:active svg { + fill: #222f3e; +} +.tox .tox-tbtn--disabled, +.tox .tox-tbtn--disabled:hover, +.tox .tox-tbtn:disabled, +.tox .tox-tbtn:disabled:hover { + background: transparent; + border: 0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; +} +.tox .tox-tbtn--disabled svg, +.tox .tox-tbtn--disabled:hover svg, +.tox .tox-tbtn:disabled svg, +.tox .tox-tbtn:disabled:hover svg { + /* stylelint-disable-line no-descending-specificity */ + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-tbtn--enabled, +.tox .tox-tbtn--enabled:hover { + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; +} +.tox .tox-tbtn--enabled > *, +.tox .tox-tbtn--enabled:hover > * { + transform: none; +} +.tox .tox-tbtn--enabled svg, +.tox .tox-tbtn--enabled:hover svg { + /* stylelint-disable-line no-descending-specificity */ + fill: #222f3e; +} +.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) { + color: #222f3e; +} +.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg { + fill: #222f3e; +} +.tox .tox-tbtn:active > * { + transform: none; +} +.tox .tox-tbtn--md { + height: 51px; + width: 51px; +} +.tox .tox-tbtn--lg { + flex-direction: column; + height: 68px; + width: 68px; +} +.tox .tox-tbtn--return { + -ms-grid-row-align: stretch; + align-self: stretch; + height: unset; + width: 16px; +} +.tox .tox-tbtn--labeled { + padding: 0 4px; + width: unset; +} +.tox .tox-tbtn__vlabel { + display: block; + font-size: 10px; + font-weight: normal; + letter-spacing: -0.025em; + margin-bottom: 4px; + white-space: nowrap; +} +.tox .tox-tbtn--select { + margin: 2px 0 3px 0; + padding: 0 4px; + width: auto; +} +.tox .tox-tbtn__select-label { + cursor: default; + font-weight: normal; + margin: 0 4px; +} +.tox .tox-tbtn__select-chevron { + align-items: center; + display: flex; + justify-content: center; + width: 16px; +} +.tox .tox-tbtn__select-chevron svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-tbtn--bespoke .tox-tbtn__select-label { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 7em; +} +.tox .tox-split-button { + border: 0; + border-radius: 3px; + box-sizing: border-box; + display: flex; + margin: 2px 0 3px 0; + overflow: hidden; +} +.tox .tox-split-button:hover { + box-shadow: 0 0 0 1px #dee0e2 inset; +} +.tox .tox-split-button:focus { + background: #dee0e2; + box-shadow: none; + color: #222f3e; +} +.tox .tox-split-button > * { + border-radius: 0; +} +.tox .tox-split-button__chevron { + width: 16px; +} +.tox .tox-split-button__chevron svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-split-button .tox-tbtn { + margin: 0; +} +.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child { + width: 30px; +} +.tox.tox-platform-touch .tox-split-button__chevron { + width: 20px; +} +.tox .tox-split-button.tox-tbtn--disabled:hover, +.tox .tox-split-button.tox-tbtn--disabled:focus, +.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover, +.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus { + background: transparent; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); +} +.tox .tox-toolbar-overlord { + background-color: #fff; +} +.tox .tox-toolbar, +.tox .tox-toolbar__primary, +.tox .tox-toolbar__overflow { + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; + background-color: #fff; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 0; +} +.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed { + height: 0; + opacity: 0; + padding-bottom: 0; + padding-top: 0; + visibility: hidden; +} +.tox .tox-toolbar__overflow--growing { + transition: height 0.3s ease, opacity 0.2s linear 0.1s; +} +.tox .tox-toolbar__overflow--shrinking { + transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; +} +.tox .tox-menubar + .tox-toolbar, +.tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary { + border-top: 1px solid #cccccc; + margin-top: -1px; +} +.tox .tox-toolbar--scrolling { + flex-wrap: nowrap; + overflow-x: auto; +} +.tox .tox-pop .tox-toolbar { + border-width: 0; +} +.tox .tox-toolbar--no-divider { + background-image: none; +} +.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child, +.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary { + border-top: 1px solid #cccccc; +} +.tox.tox-tinymce-aux .tox-toolbar__overflow { + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); +} +.tox[dir=rtl] .tox-tbtn__icon-rtl svg { + transform: rotateY(180deg); +} +.tox .tox-toolbar__group { + align-items: center; + display: flex; + flex-wrap: wrap; + margin: 0 0; + padding: 0 4px 0 4px; +} +.tox .tox-toolbar__group--pull-right { + margin-left: auto; +} +.tox .tox-toolbar--scrolling .tox-toolbar__group { + flex-shrink: 0; + flex-wrap: nowrap; +} +.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) { + border-right: 1px solid #cccccc; +} +.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { + border-left: 1px solid #cccccc; +} +.tox .tox-tooltip { + display: inline-block; + padding: 8px; + position: relative; +} +.tox .tox-tooltip__body { + background-color: #222f3e; + border-radius: 3px; + box-shadow: 0 2px 4px rgba(34, 47, 62, 0.3); + color: rgba(255, 255, 255, 0.75); + font-size: 14px; + font-style: normal; + font-weight: normal; + padding: 4px 8px; + text-transform: none; +} +.tox .tox-tooltip__arrow { + position: absolute; +} +.tox .tox-tooltip--down .tox-tooltip__arrow { + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid #222f3e; + bottom: 0; + left: 50%; + position: absolute; + transform: translateX(-50%); +} +.tox .tox-tooltip--up .tox-tooltip__arrow { + border-bottom: 8px solid #222f3e; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + left: 50%; + position: absolute; + top: 0; + transform: translateX(-50%); +} +.tox .tox-tooltip--right .tox-tooltip__arrow { + border-bottom: 8px solid transparent; + border-left: 8px solid #222f3e; + border-top: 8px solid transparent; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); +} +.tox .tox-tooltip--left .tox-tooltip__arrow { + border-bottom: 8px solid transparent; + border-right: 8px solid #222f3e; + border-top: 8px solid transparent; + left: 0; + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.tox .tox-well { + border: 1px solid #cccccc; + border-radius: 3px; + padding: 8px; + width: 100%; +} +.tox .tox-well > *:first-child { + margin-top: 0; +} +.tox .tox-well > *:last-child { + margin-bottom: 0; +} +.tox .tox-well > *:only-child { + margin: 0; +} +.tox .tox-custom-editor { + border: 1px solid #cccccc; + border-radius: 3px; + display: flex; + flex: 1; + position: relative; +} +/* stylelint-disable */ +.tox { + /* stylelint-enable */ +} +.tox .tox-dialog-loading::before { + background-color: rgba(0, 0, 0, 0.5); + content: ""; + height: 100%; + position: absolute; + width: 100%; + z-index: 1000; +} +.tox .tox-tab { + cursor: pointer; +} +.tox .tox-dialog__content-js { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-dialog__body-content .tox-collection { + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; +} +.tox .tox-image-tools-edit-panel { + height: 60px; +} +.tox .tox-image-tools__sidebar { + height: 60px; +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.min.css new file mode 100644 index 0000000..6d206b0 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tox{box-sizing:content-box;color:#222f3e;cursor:auto;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:normal;-webkit-tap-highlight-color:transparent;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal}.tox :not(svg):not(rect){box-sizing:inherit;color:inherit;cursor:inherit;direction:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;-webkit-tap-highlight-color:inherit;text-align:inherit;text-decoration:inherit;text-shadow:inherit;text-transform:inherit;vertical-align:inherit;white-space:inherit}.tox :not(svg):not(rect){background:0 0;border:0;float:none;height:auto;margin:0;max-width:none;outline:0;padding:0;position:static;width:auto}.tox:not([dir=rtl]){direction:ltr;text-align:left}.tox[dir=rtl]{direction:rtl;text-align:right}.tox-tinymce{border:1px solid #ccc;border-radius:0;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;overflow:hidden;position:relative;visibility:inherit!important}.tox-tinymce-inline{border:none;box-shadow:none}.tox-tinymce-inline .tox-editor-header{border:1px solid #ccc;border-radius:0;box-shadow:none}.tox-tinymce-aux{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;z-index:1300}.tox-tinymce :focus,.tox-tinymce-aux :focus{outline:0}button::-moz-focus-inner{border:0}.tox .accessibility-issue__header{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description{align-items:stretch;border:1px solid #ccc;border-radius:3px;display:flex;justify-content:space-between}.tox .accessibility-issue__description>div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>:last-child:not(:only-child){border-color:#ccc;border-style:solid}.tox .accessibility-issue__repair{margin-top:16px}.tox .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.1);border-color:rgba(32,122,183,.4);color:#222f3e}.tox .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:rgba(32,122,183,.4)}.tox .accessibility-issue--info h2{color:#207ab7}.tox .accessibility-issue--info .tox-icon svg{fill:#207ab7}.tox .accessibility-issue--info a .tox-icon{color:#207ab7}.tox .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.1);border-color:rgba(255,165,0,.5);color:#222f3e}.tox .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.5)}.tox .accessibility-issue--warn h2{color:#cc8500}.tox .accessibility-issue--warn .tox-icon svg{fill:#cc8500}.tox .accessibility-issue--warn a .tox-icon{color:#cc8500}.tox .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.1);border-color:rgba(204,0,0,.4);color:#222f3e}.tox .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.4)}.tox .accessibility-issue--error h2{color:#c00}.tox .accessibility-issue--error .tox-icon svg{fill:#c00}.tox .accessibility-issue--error a .tox-icon{color:#c00}.tox .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.1);border-color:rgba(120,171,70,.4);color:#222f3e}.tox .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.4)}.tox .accessibility-issue--success h2{color:#78ab46}.tox .accessibility-issue--success .tox-icon svg{fill:#78ab46}.tox .accessibility-issue--success a .tox-icon{color:#78ab46}.tox .tox-dialog__body-content .accessibility-issue__header h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{margin-top:0}.tox:not([dir=rtl]) .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .accessibility-issue__description>:last-child{border-right-width:1px;padding-right:4px}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#207ab7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#207ab7;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:0;padding:4px 16px;text-align:center;text-decoration:none;text-transform:capitalize;white-space:nowrap}.tox .tox-button[disabled]{background-color:#207ab7;background-image:none;border-color:#207ab7;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:hover:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#185d8c;background-image:none;border-color:#185d8c;box-shadow:none;color:#fff}.tox .tox-button--secondary{background-color:#f0f0f0;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#f0f0f0;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;outline:0;padding:4px 16px;text-decoration:none;text-transform:capitalize}.tox .tox-button--secondary[disabled]{background-color:#f0f0f0;background-image:none;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:hover:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:active:not(:disabled){background-color:#d6d6d6;background-image:none;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked[disabled]{background-color:#f0f0f0;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--naked:hover:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:focus:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:active:not(:disabled){background-color:#d6d6d6;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#222f3e}.tox .tox-checkbox{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:3px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:calc(4px - 1px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(34,47,62,.3)}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#207ab7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#207ab7}.tox .tox-checkbox--disabled{color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:rgba(34,47,62,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:rgba(34,47,62,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:rgba(34,47,62,.5)}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:3px;box-shadow:inset 0 0 0 1px #207ab7;padding:calc(4px - 1px)}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#ccc;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#e6e6e6;color:rgba(34,47,62,.7);cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;color:#222f3e;cursor:pointer;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:#fff;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active{background-color:#dee0e2}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#c8cbcf;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#dee0e2}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#c8cbcf;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active{background-color:#dee0e2}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection__item--state-disabled{background-color:transparent;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;-ms-flex-preferred-size:auto;font-size:14px;font-style:normal;font-weight:400;line-height:24px;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:rgba(34,47,62,.7);display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret::after{content:'';font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:#222f3e}.tox .tox-collection__item[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--horizontal{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:34px;margin:2px 0 3px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid #ccc}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid #ccc}.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg{transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette{margin-left:15px}.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:2px 0 3px 4px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px 0}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#dee0e2}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-comment-thread{background:#fff;position:relative}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment{background:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);padding:8px 8px 16px 8px;position:relative}.tox .tox-comment__header{align-items:center;color:#222f3e;display:flex;justify-content:space-between}.tox .tox-comment__date{color:rgba(34,47,62,.7);font-size:12px}.tox .tox-comment__body{color:#222f3e;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(34,47,62,.7);font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment-thread__overlay::after{background:#fff;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:16px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(255,255,255,0),#fff);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#fff;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#222f3e;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#fff;box-shadow:0 0 8px 8px #fff;color:#222f3e;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#fff;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(34,47,62,.7)}.tox .tox-user__name{color:rgba(34,47,62,.7);font-size:12px;font-style:normal;font-weight:700;text-transform:uppercase}.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar svg{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(255,255,255,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#fff}.tox .tox-dialog{background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#fff;border-bottom:none;color:#222f3e;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#222f3e;display:flex;flex:1;-ms-flex-preferred-size:auto;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;padding:16px 16px}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(34,47,62,.7);display:inline-block;font-size:14px;line-height:1.3;margin-bottom:8px;text-decoration:none;white-space:nowrap}.tox .tox-dialog__body-nav-item:focus{background-color:rgba(32,122,183,.1)}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #207ab7;color:#207ab7}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto;max-height:650px;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#207ab7;cursor:pointer;text-decoration:none}.tox .tox-dialog__body-content a:focus,.tox .tox-dialog__body-content a:hover{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content a:active{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content svg{fill:#222f3e}.tox .tox-dialog__body-content ul{display:block;list-style-type:disc;margin-bottom:16px;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.tox .tox-dialog__body-content .tox-form__group h1{font-size:20px;font-weight:700;margin-bottom:16px;margin-top:2rem}.tox .tox-dialog__body-content .tox-form__group h2{font-size:16px;font-weight:700;margin-bottom:16px;margin-top:2rem}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#fff;border-top:1px solid #ccc;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-end,.tox .tox-dialog__footer-start{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(255,255,255,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #ccc}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}body.tox-dialog__disable-scroll{overflow:hidden}.tox.tox-platform-ie .tox-dialog-wrap{position:-ms-device-fixed}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right:8px}.tox .tox-dropzone-container{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #ccc;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(34,47,62,.7);margin:0 0 16px 0}.tox .tox-edit-area{display:flex;flex:1;-ms-flex-preferred-size:auto;overflow:hidden;position:relative}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;-ms-flex-preferred-size:auto;height:100%;position:absolute;width:100%}.tox.tox-inline-edit-area{border:1px dotted #ccc}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{z-index:1}.tox:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:none;transition:box-shadow .5s}.tox.tox-tinymce--toolbar-bottom .tox-editor-header,.tox.tox-tinymce-inline .tox-editor-header{margin-bottom:-1px}.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header{box-shadow:0 4px 4px -3px rgba(0,0,0,.25)}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:rgba(34,47,62,.2);border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;cursor:pointer;height:24px;position:absolute;top:6px;width:24px}.tox .tox-color-input span:focus{border-color:#207ab7}.tox .tox-color-input span::before{background-image:linear-gradient(45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(0,0,0,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #fff;border-radius:3px;box-sizing:border-box;content:'';height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(34,47,62,.7);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-textarea{flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-selectfield select,.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-textarea[disabled],.tox .tox-textfield[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#207ab7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#222f3e}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea{-webkit-appearance:textarea;-moz-appearance:textarea;appearance:textarea;white-space:pre-wrap}.tox-fullscreen{border:0;height:100%;left:0;margin:0;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:none;padding:0;position:fixed;top:0;touch-action:pinch-zoom;width:100%}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen{z-index:1200}.tox-fullscreen .tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-image-tools{width:100%}.tox .tox-image-tools__toolbar{align-items:center;display:flex;justify-content:center}.tox .tox-image-tools__image{background-color:#666;height:380px;overflow:auto;position:relative;width:100%}.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top:8px}.tox .tox-image-tools__image-bg{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools__toolbar>.tox-spacer{flex:1;-ms-flex-preferred-size:auto}.tox .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left:8px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left:32px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right:8px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right:32px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:169px}.tox .tox-insert-table-picker>div{border-color:#ccc;border-style:solid;border-width:0 1px 1px 0;box-sizing:content-box;height:16px;width:16px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px 0}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:rgba(32,122,183,.5);border-color:rgba(32,122,183,.5)}.tox .tox-insert-table-picker__label{color:rgba(34,47,62,.7);display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox .tox-menu{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:4px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:4px}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 4px 0 4px}.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar{border-top:1px solid #ccc}.tox .tox-mbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:transparent;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#dee0e2;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn--active{background:#c8cbcf;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#dee0e2;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:-ms-grid;display:grid;font-size:14px;font-weight:400;-ms-grid-columns:minmax(40px,1fr) auto minmax(40px,1fr);grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity 150ms ease-in}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification a{text-decoration:underline}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#222f3e}.tox .tox-notification--success p{color:#222f3e}.tox .tox-notification--success a{color:#547831}.tox .tox-notification--success svg{fill:#222f3e}.tox .tox-notification--error{background-color:#f8dede;border-color:#f2bfbf;color:#222f3e}.tox .tox-notification--error p{color:#222f3e}.tox .tox-notification--error a{color:#c00}.tox .tox-notification--error svg{fill:#222f3e}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fffaea;border-color:#ffe89d;color:#222f3e}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#222f3e}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#222f3e}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#222f3e}.tox .tox-notification--info{background-color:#d9edf7;border-color:#779ecb;color:#222f3e}.tox .tox-notification--info p{color:#222f3e}.tox .tox-notification--info a{color:#222f3e}.tox .tox-notification--info svg{fill:#222f3e}.tox .tox-notification__body{-ms-grid-row-align:center;align-self:center;color:#222f3e;font-size:14px;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{-ms-grid-row-align:center;align-self:center;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{-ms-grid-row-align:start;align-self:start;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-column:3;grid-column-start:3;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification .tox-progress-bar{-ms-grid-column-span:3;grid-column-end:4;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:3;-ms-grid-row:2;grid-row-start:2;-ms-grid-column-align:center;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar{flex-wrap:nowrap}.tox .tox-pop__dialog{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:'';display:block;height:0;position:absolute;width:0}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#fff transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#ccc transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #fff transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #ccc transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #fff transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #ccc transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #fff;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #ccc;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;-ms-flex-preferred-size:0;min-height:0}.tox .tox-sidebar{background-color:#fff;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;-ms-flex-preferred-size:auto;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #ccc;border-radius:3px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#207ab7;border:2px solid #185d8c;border-radius:3px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:14px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(34,47,62,.7);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#fff;border-top:1px solid #ccc;color:rgba(34,47,62,.7);display:flex;flex:0 0 auto;font-size:12px;font-weight:400;height:18px;overflow:hidden;padding:0 8px;position:relative;text-transform:uppercase}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:flex-end;overflow:hidden}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:rgba(34,47,62,.7);text-decoration:none}.tox .tox-statusbar a:focus,.tox .tox-statusbar a:hover,.tox .tox-statusbar__path-item:focus,.tox .tox-statusbar__path-item:hover,.tox .tox-statusbar__wordcount:focus,.tox .tox-statusbar__wordcount:hover{cursor:pointer;text-decoration:underline}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-left:1ch}.tox .tox-statusbar__resize-handle svg{display:block;fill:rgba(34,47,62,.7)}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:1ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox .tox-throbber{z-index:1400}.tox .tox-throbber__busy-spinner{align-items:center;background-color:rgba(255,255,255,.6);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0;text-transform:none;width:34px}.tox .tox-tbtn svg{display:block;fill:#222f3e}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#dee0e2;border:0;box-shadow:none}.tox .tox-tbtn:hover{background:#dee0e2;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:hover svg{fill:#222f3e}.tox .tox-tbtn:active{background:#c8cbcf;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:active svg{fill:#222f3e}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:0 0;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(34,47,62,.5)}.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:hover{background:#c8cbcf;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn--enabled:hover>*,.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:hover svg{fill:#222f3e}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#222f3e}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#222f3e}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:51px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:68px;width:68px}.tox .tox-tbtn--return{-ms-grid-row-align:stretch;align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tbtn--select{margin:2px 0 3px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(34,47,62,.5)}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:2px 0 3px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #dee0e2 inset}.tox .tox-split-button:focus{background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(34,47,62,.5)}.tox .tox-split-button .tox-tbtn{margin:0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:0 0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-toolbar-overlord{background-color:#fff}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 0}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord .tox-toolbar__primary{border-top:1px solid #ccc;margin-top:-1px}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary,.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child{border-top:1px solid #ccc}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}.tox[dir=rtl] .tox-tbtn__icon-rtl svg{transform:rotateY(180deg)}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px 0 4px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid #ccc}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid #ccc}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:3px;box-shadow:0 2px 4px rgba(34,47,62,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #ccc;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #ccc;border-radius:3px;display:flex;flex:1;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px} +/*# sourceMappingURL=skin.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.mobile.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.mobile.css new file mode 100644 index 0000000..875721a --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.mobile.css @@ -0,0 +1,673 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +/* RESET all the things! */ +.tinymce-mobile-outer-container { + all: initial; + display: block; +} +.tinymce-mobile-outer-container * { + border: 0; + box-sizing: initial; + cursor: inherit; + float: none; + line-height: 1; + margin: 0; + outline: 0; + padding: 0; + -webkit-tap-highlight-color: transparent; + /* TBIO-3691, stop the gray flicker on touch. */ + text-shadow: none; + white-space: nowrap; +} +.tinymce-mobile-icon-arrow-back::before { + content: "\e5cd"; +} +.tinymce-mobile-icon-image::before { + content: "\e412"; +} +.tinymce-mobile-icon-cancel-circle::before { + content: "\e5c9"; +} +.tinymce-mobile-icon-full-dot::before { + content: "\e061"; +} +.tinymce-mobile-icon-align-center::before { + content: "\e234"; +} +.tinymce-mobile-icon-align-left::before { + content: "\e236"; +} +.tinymce-mobile-icon-align-right::before { + content: "\e237"; +} +.tinymce-mobile-icon-bold::before { + content: "\e238"; +} +.tinymce-mobile-icon-italic::before { + content: "\e23f"; +} +.tinymce-mobile-icon-unordered-list::before { + content: "\e241"; +} +.tinymce-mobile-icon-ordered-list::before { + content: "\e242"; +} +.tinymce-mobile-icon-font-size::before { + content: "\e245"; +} +.tinymce-mobile-icon-underline::before { + content: "\e249"; +} +.tinymce-mobile-icon-link::before { + content: "\e157"; +} +.tinymce-mobile-icon-unlink::before { + content: "\eca2"; +} +.tinymce-mobile-icon-color::before { + content: "\e891"; +} +.tinymce-mobile-icon-previous::before { + content: "\e314"; +} +.tinymce-mobile-icon-next::before { + content: "\e315"; +} +.tinymce-mobile-icon-large-font::before, +.tinymce-mobile-icon-style-formats::before { + content: "\e264"; +} +.tinymce-mobile-icon-undo::before { + content: "\e166"; +} +.tinymce-mobile-icon-redo::before { + content: "\e15a"; +} +.tinymce-mobile-icon-removeformat::before { + content: "\e239"; +} +.tinymce-mobile-icon-small-font::before { + content: "\e906"; +} +.tinymce-mobile-icon-readonly-back::before, +.tinymce-mobile-format-matches::after { + content: "\e5ca"; +} +.tinymce-mobile-icon-small-heading::before { + content: "small"; +} +.tinymce-mobile-icon-large-heading::before { + content: "large"; +} +.tinymce-mobile-icon-small-heading::before, +.tinymce-mobile-icon-large-heading::before { + font-family: sans-serif; + font-size: 80%; +} +.tinymce-mobile-mask-edit-icon::before { + content: "\e254"; +} +.tinymce-mobile-icon-back::before { + content: "\e5c4"; +} +.tinymce-mobile-icon-heading::before { + /* TODO: Translate */ + content: "Headings"; + font-family: sans-serif; + font-size: 80%; + font-weight: bold; +} +.tinymce-mobile-icon-h1::before { + content: "H1"; + font-weight: bold; +} +.tinymce-mobile-icon-h2::before { + content: "H2"; + font-weight: bold; +} +.tinymce-mobile-icon-h3::before { + content: "H3"; + font-weight: bold; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask { + align-items: center; + display: flex; + justify-content: center; + background: rgba(51, 51, 51, 0.5); + height: 100%; + position: absolute; + top: 0; + width: 100%; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container { + align-items: center; + border-radius: 50%; + display: flex; + flex-direction: column; + font-family: sans-serif; + font-size: 1em; + justify-content: space-between; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item { + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { + align-items: center; + display: flex; + justify-content: center; + flex-direction: column; + font-size: 1em; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { + font-size: 1.2em; + } +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon { + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; + background-color: white; + color: #207ab7; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before { + content: "\e900"; + font-family: 'tinymce-mobile', sans-serif; +} +.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon { + z-index: 2; +} +.tinymce-mobile-android-container.tinymce-mobile-android-maximized { + background: #ffffff; + border: none; + bottom: 0; + display: flex; + flex-direction: column; + left: 0; + position: fixed; + right: 0; + top: 0; +} +.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) { + position: relative; +} +.tinymce-mobile-android-container .tinymce-mobile-editor-socket { + display: flex; + flex-grow: 1; +} +.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe { + display: flex !important; + flex-grow: 1; + height: auto !important; +} +.tinymce-mobile-android-scroll-reload { + overflow: hidden; +} +:not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar { + margin-top: 23px; +} +.tinymce-mobile-toolstrip { + background: #fff; + display: flex; + flex: 0 0 auto; + z-index: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar { + align-items: center; + background-color: #fff; + border-bottom: 1px solid #cccccc; + display: flex; + flex: 1; + height: 2.5em; + width: 100%; + /* Make it no larger than the toolstrip, so that it needs to scroll */ +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group { + align-items: center; + display: flex; + height: 100%; + flex-shrink: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div { + align-items: center; + display: flex; + height: 100%; + flex: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container { + background: #f44336; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group { + flex-grow: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { + padding-left: 0.5em; + padding-right: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button { + align-items: center; + display: flex; + height: 80%; + margin-left: 2px; + margin-right: 2px; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected { + background: #c8cbcf; + color: #cccccc; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type { + background: #207ab7; + color: #eceff1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar { + /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group { + align-items: center; + display: flex; + height: 100%; + flex: 1; + padding-bottom: 0.4em; + padding-top: 0.4em; + /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ + /* For widgets like the colour picker, use the whole height */ +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog { + display: flex; + min-height: 1.5em; + overflow: hidden; + padding-left: 0; + padding-right: 0; + position: relative; + width: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain { + display: flex; + height: 100%; + transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; + width: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen { + display: flex; + flex: 0 0 auto; + justify-content: space-between; + width: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input { + font-family: Sans-serif; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container { + display: flex; + flex-grow: 1; + position: relative; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x { + -ms-grid-row-align: center; + align-self: center; + background: inherit; + border: none; + border-radius: 50%; + color: #888; + font-size: 0.6em; + font-weight: bold; + height: 100%; + padding-right: 2px; + position: absolute; + right: 0; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x { + display: none; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next { + align-items: center; + display: flex; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before { + align-items: center; + display: flex; + font-weight: bold; + height: 100%; + padding-left: 0.5em; + padding-right: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before { + visibility: hidden; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item { + color: #cccccc; + font-size: 10px; + line-height: 10px; + margin: 0 2px; + padding-top: 3px; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active { + color: #c8cbcf; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before { + margin-left: 0.5em; + margin-right: 0.9em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before { + margin-left: 0.9em; + margin-right: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider { + display: flex; + flex: 1; + margin-left: 0; + margin-right: 0; + padding: 0.28em 0; + position: relative; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container { + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line { + background: #cccccc; + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container { + padding-left: 2em; + padding-right: 2em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container { + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient { + background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black { + /* Not part of theming */ + background: black; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white { + /* Not part of theming */ + background: white; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb { + /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave + * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is + * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without + * this approach. + */ + align-items: center; + background-clip: padding-box; + background-color: #455a64; + border: 0.5em solid rgba(136, 136, 136, 0); + border-radius: 3em; + bottom: 0; + color: #fff; + display: flex; + height: 0.5em; + justify-content: center; + left: -10px; + margin: auto; + position: absolute; + top: 0; + transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); + width: 0.5em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active { + border: 0.5em solid rgba(136, 136, 136, 0.39); +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper, +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div { + align-items: center; + display: flex; + height: 100%; + flex: 1; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper { + flex-direction: column; + justify-content: center; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { + align-items: center; + display: flex; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) { + height: 100%; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container { + display: flex; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input { + background: #ffffff; + border: none; + border-radius: 0; + color: #455a64; + flex-grow: 1; + font-size: 0.85em; + padding-bottom: 0.1em; + padding-left: 5px; + padding-top: 0.1em; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder { + /* WebKit, Blink, Edge */ + color: #888; +} +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder { + /* WebKit, Blink, Edge */ + color: #888; +} +/* dropup */ +.tinymce-mobile-dropup { + background: white; + display: flex; + overflow: hidden; + width: 100%; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking { + transition: height 0.3s ease-out; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-growing { + transition: height 0.3s ease-in; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-closed { + flex-grow: 0; +} +.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) { + flex-grow: 1; +} +/* TODO min-height for device size and orientation */ +.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 200px; +} +@media only screen and (orientation: landscape) { + .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 200px; + } +} +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 150px; + } +} +/* styles menu */ +.tinymce-mobile-styles-menu { + font-family: sans-serif; + outline: 4px solid black; + overflow: hidden; + position: relative; + width: 100%; +} +.tinymce-mobile-styles-menu [role="menu"] { + display: flex; + flex-direction: column; + height: 100%; + position: absolute; + width: 100%; +} +.tinymce-mobile-styles-menu [role="menu"].transitioning { + transition: transform 0.5s ease-in-out; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item { + border-bottom: 1px solid #ddd; + color: #455a64; + cursor: pointer; + display: flex; + padding: 1em 1em; + position: relative; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before { + color: #455a64; + content: "\e314"; + font-family: 'tinymce-mobile', sans-serif; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after { + color: #455a64; + content: "\e315"; + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after { + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; +} +.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator, +.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser { + align-items: center; + background: #fff; + border-top: #455a64; + color: #455a64; + display: flex; + min-height: 2.5em; + padding-left: 1em; + padding-right: 1em; +} +.tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state], +.tinymce-mobile-styles-menu [data-transitioning-state="before"] { + transform: translate(-100%); +} +.tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state], +.tinymce-mobile-styles-menu [data-transitioning-state="current"] { + transform: translate(0%); +} +.tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state], +.tinymce-mobile-styles-menu [data-transitioning-state="after"] { + transform: translate(100%); +} +@font-face { + font-family: 'tinymce-mobile'; + font-style: normal; + font-weight: normal; + src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); +} +@media (min-device-width: 700px) { + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 25px; + } +} +@media (max-device-width: 700px) { + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 18px; + } +} +.tinymce-mobile-icon { + font-family: 'tinymce-mobile', sans-serif; +} +.mixin-flex-and-centre { + align-items: center; + display: flex; + justify-content: center; +} +.mixin-flex-bar { + align-items: center; + display: flex; + height: 100%; +} +.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe { + background-color: #fff; + width: 100%; +} +.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ + background-color: #207ab7; + border-radius: 50%; + bottom: 1em; + color: white; + font-size: 1em; + height: 2.1em; + position: fixed; + right: 2em; + width: 2.1em; + align-items: center; + display: flex; + justify-content: center; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + font-size: 1.2em; + } +} +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket { + height: 300px; + overflow: hidden; +} +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe { + height: 100%; +} +.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip { + display: none; +} +/* + Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets + increased and the whole body becomes scrollable. It's important! + */ +input[type="file"]::-webkit-file-upload-button { + display: none; +} +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + bottom: 50%; + } +} diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.mobile.min.css b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.mobile.min.css new file mode 100644 index 0000000..1555512 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/skins/ui/oxide/skin.mobile.min.css @@ -0,0 +1,8 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +.tinymce-mobile-outer-container{all:initial;display:block}.tinymce-mobile-outer-container *{border:0;box-sizing:initial;cursor:inherit;float:none;line-height:1;margin:0;outline:0;padding:0;-webkit-tap-highlight-color:transparent;text-shadow:none;white-space:nowrap}.tinymce-mobile-icon-arrow-back::before{content:"\e5cd"}.tinymce-mobile-icon-image::before{content:"\e412"}.tinymce-mobile-icon-cancel-circle::before{content:"\e5c9"}.tinymce-mobile-icon-full-dot::before{content:"\e061"}.tinymce-mobile-icon-align-center::before{content:"\e234"}.tinymce-mobile-icon-align-left::before{content:"\e236"}.tinymce-mobile-icon-align-right::before{content:"\e237"}.tinymce-mobile-icon-bold::before{content:"\e238"}.tinymce-mobile-icon-italic::before{content:"\e23f"}.tinymce-mobile-icon-unordered-list::before{content:"\e241"}.tinymce-mobile-icon-ordered-list::before{content:"\e242"}.tinymce-mobile-icon-font-size::before{content:"\e245"}.tinymce-mobile-icon-underline::before{content:"\e249"}.tinymce-mobile-icon-link::before{content:"\e157"}.tinymce-mobile-icon-unlink::before{content:"\eca2"}.tinymce-mobile-icon-color::before{content:"\e891"}.tinymce-mobile-icon-previous::before{content:"\e314"}.tinymce-mobile-icon-next::before{content:"\e315"}.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content:"\e264"}.tinymce-mobile-icon-undo::before{content:"\e166"}.tinymce-mobile-icon-redo::before{content:"\e15a"}.tinymce-mobile-icon-removeformat::before{content:"\e239"}.tinymce-mobile-icon-small-font::before{content:"\e906"}.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content:"\e5ca"}.tinymce-mobile-icon-small-heading::before{content:"small"}.tinymce-mobile-icon-large-heading::before{content:"large"}.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family:sans-serif;font-size:80%}.tinymce-mobile-mask-edit-icon::before{content:"\e254"}.tinymce-mobile-icon-back::before{content:"\e5c4"}.tinymce-mobile-icon-heading::before{content:"Headings";font-family:sans-serif;font-size:80%;font-weight:700}.tinymce-mobile-icon-h1::before{content:"H1";font-weight:700}.tinymce-mobile-icon-h2::before{content:"H2";font-weight:700}.tinymce-mobile-icon-h3::before{content:"H3";font-weight:700}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{align-items:center;display:flex;justify-content:center;background:rgba(51,51,51,.5);height:100%;position:absolute;top:0;width:100%}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{align-items:center;border-radius:50%;display:flex;flex-direction:column;font-family:sans-serif;font-size:1em;justify-content:space-between}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items:center;display:flex;justify-content:center;flex-direction:column;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1.2em}}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em;background-color:#fff;color:#207ab7}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{content:"\e900";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index:2}.tinymce-mobile-android-container.tinymce-mobile-android-maximized{background:#fff;border:none;bottom:0;display:flex;flex-direction:column;left:0;position:fixed;right:0;top:0}.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position:relative}.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display:flex;flex-grow:1}.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display:flex!important;flex-grow:1;height:auto!important}.tinymce-mobile-android-scroll-reload{overflow:hidden}:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#fff;display:flex;flex:0 0 auto;z-index:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{align-items:center;background-color:#fff;border-bottom:1px solid #ccc;display:flex;flex:1;height:2.5em;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{align-items:center;display:flex;height:80%;margin-left:2px;margin-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#c8cbcf;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#207ab7;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex:1;padding-bottom:.4em;padding-top:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:flex;min-height:1.5em;overflow:hidden;padding-left:0;padding-right:0;position:relative;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display:flex;height:100%;transition:left cubic-bezier(.4,0,1,1) .15s;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display:flex;flex:0 0 auto;justify-content:space-between;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:flex;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{-ms-grid-row-align:center;align-self:center;background:inherit;border:none;border-radius:50%;color:#888;font-size:.6em;font-weight:700;height:100%;padding-right:2px;position:absolute;right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{align-items:center;display:flex;font-weight:700;height:100%;padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{color:#ccc;font-size:10px;line-height:10px;margin:0 2px;padding-top:3px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#c8cbcf}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-left:.5em;margin-right:.9em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:flex;flex:1;margin-left:0;margin-right:0;padding:.28em 0;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{background:#ccc;display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{background:linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:#000;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:#fff;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{align-items:center;background-clip:padding-box;background-color:#455a64;border:.5em solid rgba(136,136,136,0);border-radius:3em;bottom:0;color:#fff;display:flex;height:.5em;justify-content:center;left:-10px;margin:auto;position:absolute;top:0;transition:border 120ms cubic-bezier(.39,.58,.57,1);width:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction:column;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{background:#fff;border:none;border-radius:0;color:#455a64;flex-grow:1;font-size:.85em;padding-bottom:.1em;padding-left:5px;padding-top:.1em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-dropup{background:#fff;display:flex;overflow:hidden;width:100%}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow:1}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation:landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-styles-menu{font-family:sans-serif;outline:4px solid #000;overflow:hidden;position:relative;width:100%}.tinymce-mobile-styles-menu [role=menu]{display:flex;flex-direction:column;height:100%;position:absolute;width:100%}.tinymce-mobile-styles-menu [role=menu].transitioning{transition:transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{border-bottom:1px solid #ddd;color:#455a64;cursor:pointer;display:flex;padding:1em 1em;position:relative}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{color:#455a64;content:"\e314";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{color:#455a64;content:"\e315";font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{align-items:center;background:#fff;border-top:#455a64;color:#455a64;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em}.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform:translate(100%)}@font-face{font-family:tinymce-mobile;font-style:normal;font-weight:400;src:url(fonts/tinymce-mobile.woff?8x92w3) format('woff')}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:tinymce-mobile,sans-serif}.mixin-flex-and-centre{align-items:center;display:flex;justify-content:center}.mixin-flex-bar{align-items:center;display:flex;height:100%}.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{background-color:#fff;width:100%}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{background-color:#207ab7;border-radius:50%;bottom:1em;color:#fff;font-size:1em;height:2.1em;position:fixed;right:2em;width:2.1em;align-items:center;display:flex;justify-content:center}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height:300px;overflow:hidden}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}input[type=file]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} +/*# sourceMappingURL=skin.mobile.min.css.map */ diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/themes/mobile/theme.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/themes/mobile/theme.js new file mode 100644 index 0000000..2b329b2 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/themes/mobile/theme.js @@ -0,0 +1,13809 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +(function (domGlobals) { + 'use strict'; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + function __rest(s, e) { + var t = {}; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === 'function') + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + } + function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + } + + var noop = function () { + }; + var compose = function (fa, fb) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + function curry(fn) { + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; + } + var not = function (f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !f.apply(null, args); + }; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var apply = function (f) { + return f(); + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Option = { + some: some, + none: none, + from: from + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var each = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var map = function (obj, f) { + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); + }; + var tupleMap = function (obj, f) { + var r = {}; + each(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var mapToArray = function (obj, f) { + var r = []; + each(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; + }; + var find = function (obj, pred) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + if (pred(x, i, obj)) { + return Option.some(x); + } + } + return Option.none(); + }; + var values = function (obj) { + return mapToArray(obj, function (v) { + return v; + }); + }; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + var hasNonNullableKey = function (obj, key) { + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var isOS = function (name, current) { + return function () { + return current === name; + }; + }; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var nativePush = Array.prototype.push; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -1; + }; + var exists = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; + } + } + return false; + }; + var map$1 = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each$1 = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var eachr = function (xs, f) { + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldr = function (xs, f, acc) { + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var foldl = function (xs, f, acc) { + each$1(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var find$2 = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var findIndex = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(i); + } + } + return Option.none(); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map$1(xs, f)); + }; + var forall = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; + } + } + return true; + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var difference = function (a1, a2) { + return filter(a1, function (x) { + return !contains(a2, x); + }); + }; + var pure = function (x) { + return [x]; + }; + var sort = function (xs, comparator) { + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Option.none(); + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find$2(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var checkRange = function (str, substr, start) { + if (substr === '') { + return true; + } + if (str.length < substr.length) { + return false; + } + var x = str.substr(start, start + substr.length); + return x === substr; + }; + var supplant = function (str, obj) { + var isStringOrNumber = function (a) { + var t = typeof a; + return t === 'string' || t === 'number'; + }; + return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) { + var value = obj[key]; + return isStringOrNumber(value) ? value.toString() : fullMatch; + }); + }; + var contains$1 = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + var endsWith = function (str, suffix) { + return checkRange(str, suffix, str.length - suffix.length); + }; + var trim = function (str) { + return str.replace(/^\s+|\s+$/g, ''); + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains$1(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var touchstart = constant('touchstart'); + var touchmove = constant('touchmove'); + var touchend = constant('touchend'); + var mousedown = constant('mousedown'); + var mousemove = constant('mousemove'); + var mouseup = constant('mouseup'); + var mouseover = constant('mouseover'); + var keydown = constant('keydown'); + var keyup = constant('keyup'); + var input = constant('input'); + var change = constant('change'); + var click = constant('click'); + var transitionend = constant('transitionend'); + var selectstart = constant('selectstart'); + + var alloy = { tap: constant('alloy.tap') }; + var focus = constant('alloy.focus'); + var postBlur = constant('alloy.blur.post'); + var postPaste = constant('alloy.paste.post'); + var receive = constant('alloy.receive'); + var execute = constant('alloy.execute'); + var focusItem = constant('alloy.focus.item'); + var tap = alloy.tap; + var longpress = constant('alloy.longpress'); + var systemInit = constant('alloy.system.init'); + var attachedToDom = constant('alloy.system.attached'); + var detachedFromDom = constant('alloy.system.detached'); + var focusShifted = constant('alloy.focusmanager.shifted'); + var highlight = constant('alloy.highlight'); + var dehighlight = constant('alloy.dehighlight'); + + var emit = function (component, event) { + dispatchWith(component, component.element(), event, {}); + }; + var emitWith = function (component, event, properties) { + dispatchWith(component, component.element(), event, properties); + }; + var emitExecute = function (component) { + emit(component, execute()); + }; + var dispatch = function (component, target, event) { + dispatchWith(component, target, event, {}); + }; + var dispatchWith = function (component, target, event, properties) { + var data = __assign({ target: target }, properties); + component.getSystem().triggerEvent(event, target, map(data, constant)); + }; + var dispatchEvent = function (component, target, event, simulatedEvent) { + component.getSystem().triggerEvent(event, target, simulatedEvent.event()); + }; + var dispatchFocus = function (component, target) { + component.getSystem().triggerFocus(target, component.element()); + }; + + var cached = function (f) { + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var name = function (element) { + var r = element.dom().nodeName; + return r.toLowerCase(); + }; + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isElement = isType$1(ELEMENT); + var isText = isType$1(TEXT); + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + var body = cached(function () { + return getBody(Element.fromDom(domGlobals.document)); + }); + var getBody = function (doc) { + var b = doc.dom().body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return Element.fromDom(b); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each$1(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + var sort$1 = function (arr) { + return arr.slice(0).sort(); + }; + var reqMessage = function (required, keys) { + throw new Error('All required keys (' + sort$1(required).join(', ') + ') were not specified. Specified keys were: ' + sort$1(keys).join(', ') + '.'); + }; + var unsuppMessage = function (unsupported) { + throw new Error('Unsupported keys for object: ' + sort$1(unsupported).join(', ')); + }; + var validateStrArr = function (label, array) { + if (!isArray(array)) { + throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.'); + } + each$1(array, function (a) { + if (!isString(a)) { + throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.'); + } + }); + }; + var checkDupes = function (everything) { + var sorted = sort$1(everything); + var dupe = find$2(sorted, function (s, i) { + return i < sorted.length - 1 && s === sorted[i + 1]; + }); + dupe.each(function (d) { + throw new Error('The field: ' + d + ' occurs more than once in the combined fields: [' + sorted.join(', ') + '].'); + }); + }; + + var MixedBag = function (required, optional) { + var everything = required.concat(optional); + if (everything.length === 0) { + throw new Error('You must specify at least one required or optional field.'); + } + validateStrArr('required', required); + validateStrArr('optional', optional); + checkDupes(everything); + return function (obj) { + var keys$1 = keys(obj); + var allReqd = forall(required, function (req) { + return contains(keys$1, req); + }); + if (!allReqd) { + reqMessage(required, keys$1); + } + var unsupported = filter(keys$1, function (key) { + return !contains(everything, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } + var r = {}; + each$1(required, function (req) { + r[req] = constant(obj[req]); + }); + each$1(optional, function (opt) { + r[opt] = constant(Object.prototype.hasOwnProperty.call(obj, opt) ? Option.some(obj[opt]) : Option.none()); + }); + return r; + }; + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var ELEMENT$1 = ELEMENT; + var DOCUMENT$1 = DOCUMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + var bypassSelector = function (dom) { + return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? [] : map$1(base.querySelectorAll(selector), Element.fromDom); + }; + var one = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.fromDom); + }; + + var eq = function (e1, e2) { + return e1.dom() === e2.dom(); + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom(); + var d2 = e2.dom(); + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$2 = browser.isIE() ? ieContains : regularContains; + + var owner = function (element) { + return Element.fromDom(element.dom().ownerDocument); + }; + var defaultView = function (element) { + return Element.fromDom(element.dom().ownerDocument.defaultView); + }; + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.fromDom); + }; + var parents = function (element, isRoot) { + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom(); + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = Element.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var siblings = function (element) { + var filterSelf = function (elements) { + return filter(elements, function (x) { + return !eq(element, x); + }); + }; + return parent(element).map(children).map(filterSelf).getOr([]); + }; + var nextSibling = function (element) { + return Option.from(element.dom().nextSibling).map(Element.fromDom); + }; + var children = function (element) { + return map$1(element.dom().childNodes, Element.fromDom); + }; + var child = function (element, index) { + var cs = element.dom().childNodes; + return Option.from(cs[index]).map(Element.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var spot = Immutable('element', 'offset'); + + var before = function (marker, element) { + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom().insertBefore(element.dom(), marker.dom()); + }); + }; + var after = function (marker, element) { + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); + }); + }, function (v) { + before(v, element); + }); + }; + var prepend = function (parent, element) { + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom().insertBefore(element.dom(), v.dom()); + }); + }; + var append = function (parent, element) { + parent.dom().appendChild(element.dom()); + }; + var appendAt = function (parent, element, index) { + child(parent, index).fold(function () { + append(parent, element); + }, function (v) { + before(v, element); + }); + }; + + var append$1 = function (parent, elements) { + each$1(elements, function (x) { + append(parent, x); + }); + }; + + var empty = function (element) { + element.dom().textContent = ''; + each$1(children(element), function (rogue) { + remove(rogue); + }); + }; + var remove = function (element) { + var dom = element.dom(); + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + + var fireDetaching = function (component) { + emit(component, detachedFromDom()); + var children = component.components(); + each$1(children, fireDetaching); + }; + var fireAttaching = function (component) { + var children = component.components(); + each$1(children, fireAttaching); + emit(component, attachedToDom()); + }; + var attach = function (parent, child) { + append(parent.element(), child.element()); + }; + var detachChildren = function (component) { + each$1(component.components(), function (childComp) { + return remove(childComp.element()); + }); + empty(component.element()); + component.syncComponents(); + }; + var replaceChildren = function (component, newChildren) { + var subs = component.components(); + detachChildren(component); + var deleted = difference(subs, newChildren); + each$1(deleted, function (comp) { + fireDetaching(comp); + component.getSystem().removeFromWorld(comp); + }); + each$1(newChildren, function (childComp) { + if (!childComp.getSystem().isConnected()) { + component.getSystem().addToWorld(childComp); + attach(component, childComp); + if (inBody(component.element())) { + fireAttaching(childComp); + } + } else { + attach(component, childComp); + } + component.syncComponents(); + }); + }; + + var attach$1 = function (parent, child) { + attachWith(parent, child, append); + }; + var attachWith = function (parent, child, insertion) { + parent.getSystem().addToWorld(child); + insertion(parent.element(), child.element()); + if (inBody(parent.element())) { + fireAttaching(child); + } + parent.syncComponents(); + }; + var doDetach = function (component) { + fireDetaching(component); + remove(component.element()); + component.getSystem().removeFromWorld(component); + }; + var detach = function (component) { + var parent$1 = parent(component.element()).bind(function (p) { + return component.getSystem().getByDom(p).toOption(); + }); + doDetach(component); + parent$1.each(function (p) { + p.syncComponents(); + }); + }; + var attachSystemAfter = function (element, guiSystem) { + attachSystemWith(element, guiSystem, after); + }; + var attachSystemWith = function (element, guiSystem, inserter) { + inserter(element, guiSystem.element()); + var children$1 = children(guiSystem.element()); + each$1(children$1, function (child) { + guiSystem.getByDom(child).each(fireAttaching); + }); + }; + var detachSystem = function (guiSystem) { + var children$1 = children(guiSystem.element()); + each$1(children$1, function (child) { + guiSystem.getByDom(child).each(fireDetaching); + }); + remove(guiSystem.element()); + }; + + var value = function (o) { + var is = function (v) { + return o === v; + }; + var or = function (opt) { + return value(o); + }; + var orThunk = function (f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOption = function () { + return Option.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOption: toOption + }; + }; + var error = function (message) { + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOption: Option.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var generate = function (cases) { + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each$1(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + domGlobals.console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate }; + + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return nu; + }; + var deep = function (old, nu) { + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; + }; + var baseMerge = function (merger) { + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty$1.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var deepMerge = baseMerge(deep); + var merge = baseMerge(shallow); + + var SimpleResultType; + (function (SimpleResultType) { + SimpleResultType[SimpleResultType['Error'] = 0] = 'Error'; + SimpleResultType[SimpleResultType['Value'] = 1] = 'Value'; + }(SimpleResultType || (SimpleResultType = {}))); + var fold = function (res, onError, onValue) { + return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue); + }; + var partition = function (results) { + var values = []; + var errors = []; + each$1(results, function (obj) { + fold(obj, function (err) { + return errors.push(err); + }, function (val) { + return values.push(val); + }); + }); + return { + values: values, + errors: errors + }; + }; + var mapError = function (res, f) { + if (res.stype === SimpleResultType.Error) { + return { + stype: SimpleResultType.Error, + serror: f(res.serror) + }; + } else { + return res; + } + }; + var map$2 = function (res, f) { + if (res.stype === SimpleResultType.Value) { + return { + stype: SimpleResultType.Value, + svalue: f(res.svalue) + }; + } else { + return res; + } + }; + var bind$1 = function (res, f) { + if (res.stype === SimpleResultType.Value) { + return f(res.svalue); + } else { + return res; + } + }; + var bindError = function (res, f) { + if (res.stype === SimpleResultType.Error) { + return f(res.serror); + } else { + return res; + } + }; + var svalue = function (v) { + return { + stype: SimpleResultType.Value, + svalue: v + }; + }; + var serror = function (e) { + return { + stype: SimpleResultType.Error, + serror: e + }; + }; + var toResult = function (res) { + return fold(res, Result.error, Result.value); + }; + var fromResult = function (res) { + return res.fold(serror, svalue); + }; + var SimpleResult = { + fromResult: fromResult, + toResult: toResult, + svalue: svalue, + partition: partition, + serror: serror, + bind: bind$1, + bindError: bindError, + map: map$2, + mapError: mapError, + fold: fold + }; + + var adt = Adt.generate([ + { strict: [] }, + { defaultedThunk: ['fallbackThunk'] }, + { asOption: [] }, + { asDefaultedOptionThunk: ['fallbackThunk'] }, + { mergeWithThunk: ['baseThunk'] } + ]); + var defaulted = function (fallback) { + return adt.defaultedThunk(constant(fallback)); + }; + var mergeWith = function (base) { + return adt.mergeWithThunk(constant(base)); + }; + var strict = adt.strict; + var asOption = adt.asOption; + var defaultedThunk = adt.defaultedThunk; + var asDefaultedOptionThunk = adt.asDefaultedOptionThunk; + var mergeWithThunk = adt.mergeWithThunk; + + var exclude = function (obj, fields) { + var r = {}; + each(obj, function (v, k) { + if (!contains(fields, k)) { + r[k] = v; + } + }); + return r; + }; + + var wrap = function (key, value) { + var _a; + return _a = {}, _a[key] = value, _a; + }; + var wrapAll = function (keyvalues) { + var r = {}; + each$1(keyvalues, function (kv) { + r[kv.key] = kv.value; + }); + return r; + }; + + var comparison = Adt.generate([ + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } + ]); + var partition$1 = function (results) { + var errors = []; + var values = []; + each$1(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); + }); + }); + return { + errors: errors, + values: values + }; + }; + + var exclude$1 = function (obj, fields) { + return exclude(obj, fields); + }; + var wrap$1 = function (key, value) { + return wrap(key, value); + }; + var wrapAll$1 = function (keyvalues) { + return wrapAll(keyvalues); + }; + var mergeValues = function (values, base) { + return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values))); + }; + var mergeErrors = function (errors) { + return Result.error(flatten(errors)); + }; + var consolidate = function (objs, base) { + var partitions = partition$1(objs); + return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base); + }; + + var mergeValues$1 = function (values, base) { + return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base); + }; + var mergeErrors$1 = function (errors) { + return compose(SimpleResult.serror, flatten)(errors); + }; + var consolidateObj = function (objects, base) { + var partition = SimpleResult.partition(objects); + return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base); + }; + var consolidateArr = function (objects) { + var partitions = SimpleResult.partition(objects); + return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values); + }; + var ResultCombine = { + consolidateObj: consolidateObj, + consolidateArr: consolidateArr + }; + + var formatObj = function (input) { + return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2); + }; + var formatErrors = function (errors) { + var es = errors.length > 10 ? errors.slice(0, 10).concat([{ + path: [], + getErrorInfo: function () { + return '... (only showing first ten failures)'; + } + }]) : errors; + return map$1(es, function (e) { + return 'Failed path: (' + e.path.join(' > ') + ')\n' + e.getErrorInfo(); + }); + }; + + var nu$3 = function (path, getErrorInfo) { + return SimpleResult.serror([{ + path: path, + getErrorInfo: getErrorInfo + }]); + }; + var missingStrict = function (path, key, obj) { + return nu$3(path, function () { + return 'Could not find valid *strict* value for "' + key + '" in ' + formatObj(obj); + }); + }; + var missingKey = function (path, key) { + return nu$3(path, function () { + return 'Choice schema did not contain choice key: "' + key + '"'; + }); + }; + var missingBranch = function (path, branches, branch) { + return nu$3(path, function () { + return 'The chosen schema: "' + branch + '" did not exist in branches: ' + formatObj(branches); + }); + }; + var unsupportedFields = function (path, unsupported) { + return nu$3(path, function () { + return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified'; + }); + }; + var custom = function (path, err) { + return nu$3(path, function () { + return err; + }); + }; + + var adt$1 = Adt.generate([ + { + field: [ + 'key', + 'okey', + 'presence', + 'prop' + ] + }, + { + state: [ + 'okey', + 'instantiator' + ] + } + ]); + var strictAccess = function (path, obj, key) { + return get(obj, key).fold(function () { + return missingStrict(path, key, obj); + }, SimpleResult.svalue); + }; + var fallbackAccess = function (obj, key, fallbackThunk) { + var v = get(obj, key).fold(function () { + return fallbackThunk(obj); + }, identity); + return SimpleResult.svalue(v); + }; + var optionAccess = function (obj, key) { + return SimpleResult.svalue(get(obj, key)); + }; + var optionDefaultedAccess = function (obj, key, fallback) { + var opt = get(obj, key).map(function (val) { + return val === true ? fallback(obj) : val; + }); + return SimpleResult.svalue(opt); + }; + var cExtractOne = function (path, obj, field, strength) { + return field.fold(function (key, okey, presence, prop) { + var bundle = function (av) { + var result = prop.extract(path.concat([key]), strength, av); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(res)); + }); + }; + var bundleAsOption = function (optValue) { + return optValue.fold(function () { + var outcome = wrap(okey, strength(Option.none())); + return SimpleResult.svalue(outcome); + }, function (ov) { + var result = prop.extract(path.concat([key]), strength, ov); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(Option.some(res))); + }); + }); + }; + return function () { + return presence.fold(function () { + return SimpleResult.bind(strictAccess(path, obj, key), bundle); + }, function (fallbackThunk) { + return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle); + }, function () { + return SimpleResult.bind(optionAccess(obj, key), bundleAsOption); + }, function (fallbackThunk) { + return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption); + }, function (baseThunk) { + var base = baseThunk(obj); + var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) { + return deepMerge(base, v); + }); + return SimpleResult.bind(result, bundle); + }); + }(); + }, function (okey, instantiator) { + var state = instantiator(obj); + return SimpleResult.svalue(wrap(okey, strength(state))); + }); + }; + var cExtract = function (path, obj, fields, strength) { + var results = map$1(fields, function (field) { + return cExtractOne(path, obj, field, strength); + }); + return ResultCombine.consolidateObj(results, {}); + }; + var value$1 = function (validator) { + var extract = function (path, strength, val) { + return SimpleResult.bindError(validator(val, strength), function (err) { + return custom(path, err); + }); + }; + var toString = function () { + return 'val'; + }; + return { + extract: extract, + toString: toString + }; + }; + var getSetKeys = function (obj) { + var keys$1 = keys(obj); + return filter(keys$1, function (k) { + return hasNonNullableKey(obj, k); + }); + }; + var objOfOnly = function (fields) { + var delegate = objOf(fields); + var fieldNames = foldr(fields, function (acc, f) { + return f.fold(function (key) { + return deepMerge(acc, wrap$1(key, true)); + }, constant(acc)); + }, {}); + var extract = function (path, strength, o) { + var keys = isBoolean(o) ? [] : getSetKeys(o); + var extra = filter(keys, function (k) { + return !hasNonNullableKey(fieldNames, k); + }); + return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra); + }; + return { + extract: extract, + toString: delegate.toString + }; + }; + var objOf = function (fields) { + var extract = function (path, strength, o) { + return cExtract(path, o, fields, strength); + }; + var toString = function () { + var fieldStrings = map$1(fields, function (field) { + return field.fold(function (key, okey, presence, prop) { + return key + ' -> ' + prop.toString(); + }, function (okey, instantiator) { + return 'state(' + okey + ')'; + }); + }); + return 'obj{\n' + fieldStrings.join('\n') + '}'; + }; + return { + extract: extract, + toString: toString + }; + }; + var arrOf = function (prop) { + var extract = function (path, strength, array) { + var results = map$1(array, function (a, i) { + return prop.extract(path.concat(['[' + i + ']']), strength, a); + }); + return ResultCombine.consolidateArr(results); + }; + var toString = function () { + return 'array(' + prop.toString() + ')'; + }; + return { + extract: extract, + toString: toString + }; + }; + var setOf = function (validator, prop) { + var validateKeys = function (path, keys) { + return arrOf(value$1(validator)).extract(path, identity, keys); + }; + var extract = function (path, strength, o) { + var keys$1 = keys(o); + var validatedKeys = validateKeys(path, keys$1); + return SimpleResult.bind(validatedKeys, function (validKeys) { + var schema = map$1(validKeys, function (vk) { + return adt$1.field(vk, vk, strict(), prop); + }); + return objOf(schema).extract(path, strength, o); + }); + }; + var toString = function () { + return 'setOf(' + prop.toString() + ')'; + }; + return { + extract: extract, + toString: toString + }; + }; + var anyValue = constant(value$1(SimpleResult.svalue)); + var state = adt$1.state; + var field = adt$1.field; + + var chooseFrom = function (path, strength, input, branches, ch) { + var fields = get(branches, ch); + return fields.fold(function () { + return missingBranch(path, branches, ch); + }, function (vp) { + return vp.extract(path.concat(['branch: ' + ch]), strength, input); + }); + }; + var choose = function (key, branches) { + var extract = function (path, strength, input) { + var choice = get(input, key); + return choice.fold(function () { + return missingKey(path, key); + }, function (chosen) { + return chooseFrom(path, strength, input, branches, chosen); + }); + }; + var toString = function () { + return 'chooseOn(' + key + '). Possible values: ' + keys(branches); + }; + return { + extract: extract, + toString: toString + }; + }; + + var _anyValue = value$1(SimpleResult.svalue); + var valueOf = function (validator) { + return value$1(function (v) { + return validator(v).fold(SimpleResult.serror, SimpleResult.svalue); + }); + }; + var setOf$1 = function (validator, prop) { + return setOf(function (v) { + return SimpleResult.fromResult(validator(v)); + }, prop); + }; + var extract = function (label, prop, strength, obj) { + var res = prop.extract([label], strength, obj); + return SimpleResult.mapError(res, function (errs) { + return { + input: obj, + errors: errs + }; + }); + }; + var asRaw = function (label, prop, obj) { + return SimpleResult.toResult(extract(label, prop, identity, obj)); + }; + var getOrDie = function (extraction) { + return extraction.fold(function (errInfo) { + throw new Error(formatError(errInfo)); + }, identity); + }; + var asRawOrDie = function (label, prop, obj) { + return getOrDie(asRaw(label, prop, obj)); + }; + var formatError = function (errInfo) { + return 'Errors: \n' + formatErrors(errInfo.errors).join('\n') + '\n\nInput object: ' + formatObj(errInfo.input); + }; + var choose$1 = function (key, branches) { + return choose(key, map(branches, objOf)); + }; + var anyValue$1 = constant(_anyValue); + var typedValue = function (validator, expectedType) { + return value$1(function (a) { + var actualType = typeof a; + return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType); + }); + }; + var functionProcessor = typedValue(isFunction, 'function'); + + var strict$1 = function (key) { + return field(key, key, strict(), anyValue()); + }; + var strictOf = function (key, schema) { + return field(key, key, strict(), schema); + }; + var strictFunction = function (key) { + return strictOf(key, functionProcessor); + }; + var forbid = function (key, message) { + return field(key, key, asOption(), value$1(function (v) { + return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message); + })); + }; + var strictObjOf = function (key, objSchema) { + return field(key, key, strict(), objOf(objSchema)); + }; + var option = function (key) { + return field(key, key, asOption(), anyValue()); + }; + var optionOf = function (key, schema) { + return field(key, key, asOption(), schema); + }; + var optionObjOf = function (key, objSchema) { + return optionOf(key, objOf(objSchema)); + }; + var optionObjOfOnly = function (key, objSchema) { + return optionOf(key, objOfOnly(objSchema)); + }; + var defaulted$1 = function (key, fallback) { + return field(key, key, defaulted(fallback), anyValue()); + }; + var defaultedOf = function (key, fallback, schema) { + return field(key, key, defaulted(fallback), schema); + }; + var defaultedObjOf = function (key, fallback, objSchema) { + return defaultedOf(key, fallback, objOf(objSchema)); + }; + var state$1 = function (okey, instantiator) { + return state(okey, instantiator); + }; + + var ancestor = function (scope, transform, isRoot) { + var element = scope.dom(); + var stop = isFunction(isRoot) ? isRoot : constant(false); + while (element.parentNode) { + element = element.parentNode; + var el = Element.fromDom(element); + var transformed = transform(el); + if (transformed.isSome()) { + return transformed; + } else if (stop(el)) { + break; + } + } + return Option.none(); + }; + var closest = function (scope, transform, isRoot) { + var current = transform(scope); + return current.orThunk(function () { + return isRoot(scope) ? Option.none() : ancestor(scope, transform, isRoot); + }); + }; + + var isSource = function (component, simulatedEvent) { + return eq(component.element(), simulatedEvent.event().target()); + }; + + var nu$4 = function (parts) { + if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) { + throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!'); + } + return asRawOrDie('Extracting event.handler', objOfOnly([ + defaulted$1('can', constant(true)), + defaulted$1('abort', constant(false)), + defaulted$1('run', noop) + ]), parts); + }; + var all$1 = function (handlers, f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc && f(handler).apply(undefined, args); + }, true); + }; + }; + var any = function (handlers, f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc || f(handler).apply(undefined, args); + }, false); + }; + }; + var read = function (handler) { + return isFunction(handler) ? { + can: constant(true), + abort: constant(false), + run: handler + } : handler; + }; + var fuse = function (handlers) { + var can = all$1(handlers, function (handler) { + return handler.can; + }); + var abort = any(handlers, function (handler) { + return handler.abort; + }); + var run = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + each$1(handlers, function (handler) { + handler.run.apply(undefined, args); + }); + }; + return nu$4({ + can: can, + abort: abort, + run: run + }); + }; + + var derive = function (configs) { + return wrapAll$1(configs); + }; + var abort = function (name, predicate) { + return { + key: name, + value: nu$4({ abort: predicate }) + }; + }; + var can = function (name, predicate) { + return { + key: name, + value: nu$4({ can: predicate }) + }; + }; + var run = function (name, handler) { + return { + key: name, + value: nu$4({ run: handler }) + }; + }; + var runActionExtra = function (name, action, extra) { + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + action.apply(undefined, [ + component, + simulatedEvent + ].concat(extra)); + } + }) + }; + }; + var runOnName = function (name) { + return function (handler) { + return run(name, handler); + }; + }; + var runOnSourceName = function (name) { + return function (handler) { + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + if (isSource(component, simulatedEvent)) { + handler(component, simulatedEvent); + } + } + }) + }; + }; + }; + var redirectToUid = function (name, uid) { + return run(name, function (component, simulatedEvent) { + component.getSystem().getByUid(uid).each(function (redirectee) { + dispatchEvent(redirectee, redirectee.element(), name, simulatedEvent); + }); + }); + }; + var redirectToPart = function (name, detail, partName) { + var uid = detail.partUids[partName]; + return redirectToUid(name, uid); + }; + var cutter = function (name) { + return run(name, function (component, simulatedEvent) { + simulatedEvent.cut(); + }); + }; + var stopper = function (name) { + return run(name, function (component, simulatedEvent) { + simulatedEvent.stop(); + }); + }; + var runOnSource = function (name, f) { + return runOnSourceName(name)(f); + }; + var runOnAttached = runOnSourceName(attachedToDom()); + var runOnDetached = runOnSourceName(detachedFromDom()); + var runOnInit = runOnSourceName(systemInit()); + var runOnExecute = runOnName(execute()); + + var markAsBehaviourApi = function (f, apiName, apiFunction) { + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: apiName, + parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3))) + }; + }; + return f; + }; + var cleanParameters = function (parameters) { + return map$1(parameters, function (p) { + return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p; + }); + }; + var markAsExtraApi = function (f, extraName) { + var delegate = f.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: extraName, + parameters: cleanParameters(parameters) + }; + }; + return f; + }; + var markAsSketchApi = function (f, apiFunction) { + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: 'OVERRIDE', + parameters: cleanParameters(parameters.slice(1)) + }; + }; + return f; + }; + + var nu$5 = function (s) { + return { + classes: s.classes !== undefined ? s.classes : [], + attributes: s.attributes !== undefined ? s.attributes : {}, + styles: s.styles !== undefined ? s.styles : {} + }; + }; + var merge$1 = function (defnA, mod) { + return __assign(__assign({}, defnA), { + attributes: __assign(__assign({}, defnA.attributes), mod.attributes), + styles: __assign(__assign({}, defnA.styles), mod.styles), + classes: defnA.classes.concat(mod.classes) + }); + }; + + var executeEvent = function (bConfig, bState, executor) { + return runOnExecute(function (component) { + executor(component, bConfig, bState); + }); + }; + var loadEvent = function (bConfig, bState, f) { + return runOnInit(function (component, simulatedEvent) { + f(component, bConfig, bState); + }); + }; + var create = function (schema, name, active, apis, extra, state) { + var configSchema = objOfOnly(schema); + var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + }; + var createModes = function (modes, name, active, apis, extra, state) { + var configSchema = modes; + var schemaSchema = optionObjOf(name, [optionOf('config', modes)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + }; + var wrapApi = function (bName, apiFunction, apiName) { + var f = function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var args = [component].concat(rest); + return component.config({ name: constant(bName) }).fold(function () { + throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName); + }, function (info) { + var rest = Array.prototype.slice.call(args, 1); + return apiFunction.apply(undefined, [ + component, + info.config, + info.state + ].concat(rest)); + }); + }; + return markAsBehaviourApi(f, apiName, apiFunction); + }; + var revokeBehaviour = function (name) { + return { + key: name, + value: undefined + }; + }; + var doCreate = function (configSchema, schemaSchema, name, active, apis, extra, state) { + var getConfig = function (info) { + return hasNonNullableKey(info, name) ? info[name]() : Option.none(); + }; + var wrappedApis = map(apis, function (apiF, apiName) { + return wrapApi(name, apiF, apiName); + }); + var wrappedExtra = map(extra, function (extraF, extraName) { + return markAsExtraApi(extraF, extraName); + }); + var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), { + revoke: curry(revokeBehaviour, name), + config: function (spec) { + var prepared = asRawOrDie(name + '-config', configSchema, spec); + return { + key: name, + value: { + config: prepared, + me: me, + configAsRaw: cached(function () { + return asRawOrDie(name + '-config', configSchema, spec); + }), + initialConfig: spec, + state: state + } + }; + }, + schema: function () { + return schemaSchema; + }, + exhibit: function (info, base) { + return getConfig(info).bind(function (behaviourInfo) { + return get(active, 'exhibit').map(function (exhibitor) { + return exhibitor(base, behaviourInfo.config, behaviourInfo.state); + }); + }).getOr(nu$5({})); + }, + name: function () { + return name; + }, + handlers: function (info) { + return getConfig(info).map(function (behaviourInfo) { + var getEvents = get(active, 'events').getOr(function () { + return {}; + }); + return getEvents(behaviourInfo.config, behaviourInfo.state); + }).getOr({}); + } + }); + return me; + }; + + var NoState = { + init: function () { + return nu$6({ + readState: function () { + return 'No State required'; + } + }); + } + }; + var nu$6 = function (spec) { + return spec; + }; + + var derive$1 = function (capabilities) { + return wrapAll$1(capabilities); + }; + var simpleSchema = objOfOnly([ + strict$1('fields'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) + ]); + var create$1 = function (data) { + var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data); + return create(value.fields, value.name, value.active, value.apis, value.extra, value.state); + }; + var modeSchema = objOfOnly([ + strict$1('branchKey'), + strict$1('branches'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) + ]); + var createModes$1 = function (data) { + var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data); + return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state); + }; + var revoke = constant(undefined); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom(), key, value); + }; + var setAll = function (element, attrs) { + var dom = element.dom(); + each(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var get$1 = function (element, key) { + var v = element.dom().getAttribute(key); + return v === null ? undefined : v; + }; + var has$1 = function (element, key) { + var dom = element.dom(); + return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; + }; + var remove$1 = function (element, key) { + element.dom().removeAttribute(key); + }; + + var read$1 = function (element, attr) { + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add = function (element, attr, id) { + var old = read$1(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; + }; + var remove$2 = function (element, attr, id) { + var nu = filter(read$1(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove$1(element, attr); + } + return false; + }; + + var supports = function (element) { + return element.dom().classList !== undefined; + }; + var get$2 = function (element) { + return read$1(element, 'class'); + }; + var add$1 = function (element, clazz) { + return add(element, 'class', clazz); + }; + var remove$3 = function (element, clazz) { + return remove$2(element, 'class', clazz); + }; + + var add$2 = function (element, clazz) { + if (supports(element)) { + element.dom().classList.add(clazz); + } else { + add$1(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom().classList : get$2(element); + if (classList.length === 0) { + remove$1(element, 'class'); + } + }; + var remove$4 = function (element, clazz) { + if (supports(element)) { + var classList = element.dom().classList; + classList.remove(clazz); + } else { + remove$3(element, clazz); + } + cleanClass(element); + }; + var has$2 = function (element, clazz) { + return supports(element) && element.dom().classList.contains(clazz); + }; + + var swap = function (element, addCls, removeCls) { + remove$4(element, removeCls); + add$2(element, addCls); + }; + var toAlpha = function (component, swapConfig, swapState) { + swap(component.element(), swapConfig.alpha, swapConfig.omega); + }; + var toOmega = function (component, swapConfig, swapState) { + swap(component.element(), swapConfig.omega, swapConfig.alpha); + }; + var clear = function (component, swapConfig, swapState) { + remove$4(component.element(), swapConfig.alpha); + remove$4(component.element(), swapConfig.omega); + }; + var isAlpha = function (component, swapConfig, swapState) { + return has$2(component.element(), swapConfig.alpha); + }; + var isOmega = function (component, swapConfig, swapState) { + return has$2(component.element(), swapConfig.omega); + }; + + var SwapApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + toAlpha: toAlpha, + toOmega: toOmega, + isAlpha: isAlpha, + isOmega: isOmega, + clear: clear + }); + + var SwapSchema = [ + strict$1('alpha'), + strict$1('omega') + ]; + + var Swapping = create$1({ + fields: SwapSchema, + name: 'swapping', + apis: SwapApis + }); + + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot); + } + + var ancestor$1 = function (scope, predicate, isRoot) { + var element = scope.dom(); + var stop = isFunction(isRoot) ? isRoot : constant(false); + while (element.parentNode) { + element = element.parentNode; + var el = Element.fromDom(element); + if (predicate(el)) { + return Option.some(el); + } else if (stop(el)) { + break; + } + } + return Option.none(); + }; + var closest$1 = function (scope, predicate, isRoot) { + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot); + }; + var descendant = function (scope, predicate) { + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = Element.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Option.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Option.none(); + }; + return descend(scope.dom()); + }; + + var focus$1 = function (element) { + element.dom().focus(); + }; + var blur = function (element) { + element.dom().blur(); + }; + var hasFocus = function (element) { + var doc = owner(element).dom(); + return element.dom() === doc.activeElement; + }; + var active = function (_doc) { + var doc = _doc !== undefined ? _doc.dom() : domGlobals.document; + return Option.from(doc.activeElement).map(Element.fromDom); + }; + var search = function (element) { + return active(owner(element)).filter(function (e) { + return element.dom().contains(e.dom()); + }); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.ThemeManager'); + + var openLink = function (target) { + var link = domGlobals.document.createElement('a'); + link.target = '_blank'; + link.href = target.href; + link.rel = 'noreferrer noopener'; + var nuEvt = domGlobals.document.createEvent('MouseEvents'); + nuEvt.initMouseEvent('click', true, true, domGlobals.window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + domGlobals.document.body.appendChild(link); + link.dispatchEvent(nuEvt); + domGlobals.document.body.removeChild(link); + }; + var TinyCodeDupe = { openLink: openLink }; + + var isSkinDisabled = function (editor) { + return editor.settings.skin === false; + }; + var readOnlyOnInit = function (editor) { + return false; + }; + + var formatChanged = 'formatChanged'; + var orientationChanged = 'orientationChanged'; + var dropupDismissed = 'dropupDismissed'; + var TinyChannels = { + formatChanged: constant(formatChanged), + orientationChanged: constant(orientationChanged), + dropupDismissed: constant(dropupDismissed) + }; + + var fromHtml$1 = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(Element.fromDom(div)); + }; + + var get$3 = function (element) { + return element.dom().innerHTML; + }; + var set$1 = function (element, content) { + var owner$1 = owner(element); + var docDom = owner$1.dom(); + var fragment = Element.fromDom(docDom.createDocumentFragment()); + var contentElements = fromHtml$1(content, docDom); + append$1(fragment, contentElements); + empty(element); + append(element, fragment); + }; + var getOuter = function (element) { + var container = Element.fromTag('div'); + var clone = Element.fromDom(element.dom().cloneNode(true)); + append(container, clone); + return get$3(container); + }; + + var clone = function (original, isDeep) { + return Element.fromDom(original.dom().cloneNode(isDeep)); + }; + var shallow$1 = function (original) { + return clone(original, false); + }; + + var getHtml = function (element) { + var clone = shallow$1(element); + return getOuter(clone); + }; + + var element = function (elem) { + return getHtml(elem); + }; + + var chooseChannels = function (channels, message) { + return message.universal() ? channels : filter(channels, function (ch) { + return contains(message.channels(), ch); + }); + }; + var events = function (receiveConfig) { + return derive([run(receive(), function (component, message) { + var channelMap = receiveConfig.channels; + var channels = keys(channelMap); + var receivingData = message; + var targetChannels = chooseChannels(channels, receivingData); + each$1(targetChannels, function (ch) { + var channelInfo = channelMap[ch]; + var channelSchema = channelInfo.schema; + var data = asRawOrDie('channel[' + ch + '] data\nReceiver: ' + element(component.element()), channelSchema, receivingData.data()); + channelInfo.onReceive(component, data); + }); + })]); + }; + + var ActiveReceiving = /*#__PURE__*/Object.freeze({ + __proto__: null, + events: events + }); + + var unknown$3 = 'unknown'; + var EventConfiguration; + (function (EventConfiguration) { + EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP'; + EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL'; + EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING'; + }(EventConfiguration || (EventConfiguration = {}))); + var eventConfig = Cell({}); + var makeEventLogger = function (eventName, initialTarget) { + var sequence = []; + var startTime = new Date().getTime(); + return { + logEventCut: function (name, target, purpose) { + sequence.push({ + outcome: 'cut', + target: target, + purpose: purpose + }); + }, + logEventStopped: function (name, target, purpose) { + sequence.push({ + outcome: 'stopped', + target: target, + purpose: purpose + }); + }, + logNoParent: function (name, target, purpose) { + sequence.push({ + outcome: 'no-parent', + target: target, + purpose: purpose + }); + }, + logEventNoHandlers: function (name, target) { + sequence.push({ + outcome: 'no-handlers-left', + target: target + }); + }, + logEventResponse: function (name, target, purpose) { + sequence.push({ + outcome: 'response', + purpose: purpose, + target: target + }); + }, + write: function () { + var finishTime = new Date().getTime(); + if (contains([ + 'mousemove', + 'mouseover', + 'mouseout', + systemInit() + ], eventName)) { + return; + } + domGlobals.console.log(eventName, { + event: eventName, + time: finishTime - startTime, + target: initialTarget.dom(), + sequence: map$1(sequence, function (s) { + if (!contains([ + 'cut', + 'stopped', + 'response' + ], s.outcome)) { + return s.outcome; + } else { + return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')'; + } + }) + }); + } + }; + }; + var processEvent = function (eventName, initialTarget, f) { + var status = get(eventConfig.get(), eventName).orThunk(function () { + var patterns = keys(eventConfig.get()); + return findMap(patterns, function (p) { + return eventName.indexOf(p) > -1 ? Option.some(eventConfig.get()[p]) : Option.none(); + }); + }).getOr(EventConfiguration.NORMAL); + switch (status) { + case EventConfiguration.NORMAL: + return f(noLogger()); + case EventConfiguration.LOGGING: { + var logger = makeEventLogger(eventName, initialTarget); + var output = f(logger); + logger.write(); + return output; + } + case EventConfiguration.STOP: + return true; + } + }; + var path = [ + 'alloy/data/Fields', + 'alloy/debugging/Debugging' + ]; + var getTrace = function () { + var err = new Error(); + if (err.stack !== undefined) { + var lines = err.stack.split('\n'); + return find$2(lines, function (line) { + return line.indexOf('alloy') > 0 && !exists(path, function (p) { + return line.indexOf(p) > -1; + }); + }).getOr(unknown$3); + } else { + return unknown$3; + } + }; + var ignoreEvent = { + logEventCut: noop, + logEventStopped: noop, + logNoParent: noop, + logEventNoHandlers: noop, + logEventResponse: noop, + write: noop + }; + var monitorEvent = function (eventName, initialTarget, f) { + return processEvent(eventName, initialTarget, f); + }; + var noLogger = constant(ignoreEvent); + + var menuFields = constant([ + strict$1('menu'), + strict$1('selectedMenu') + ]); + var itemFields = constant([ + strict$1('item'), + strict$1('selectedItem') + ]); + var schema = constant(objOf(itemFields().concat(menuFields()))); + var itemSchema = constant(objOf(itemFields())); + + var _initSize = strictObjOf('initSize', [ + strict$1('numColumns'), + strict$1('numRows') + ]); + var itemMarkers = function () { + return strictOf('markers', itemSchema()); + }; + var tieredMenuMarkers = function () { + return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields())); + }; + var markers = function (required) { + return strictObjOf('markers', map$1(required, strict$1)); + }; + var onPresenceHandler = function (label, fieldName, presence) { + var trace = getTrace(); + return field(fieldName, fieldName, presence, valueOf(function (f) { + return Result.value(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return f.apply(undefined, args); + }); + })); + }; + var onHandler = function (fieldName) { + return onPresenceHandler('onHandler', fieldName, defaulted(noop)); + }; + var onKeyboardHandler = function (fieldName) { + return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Option.none)); + }; + var onStrictHandler = function (fieldName) { + return onPresenceHandler('onHandler', fieldName, strict()); + }; + var onStrictKeyboardHandler = function (fieldName) { + return onPresenceHandler('onKeyboardHandler', fieldName, strict()); + }; + var output = function (name, value) { + return state$1(name, constant(value)); + }; + var snapshot = function (name) { + return state$1(name, identity); + }; + var initSize = constant(_initSize); + + var ReceivingSchema = [strictOf('channels', setOf$1(Result.value, objOfOnly([ + onStrictHandler('onReceive'), + defaulted$1('schema', anyValue$1()) + ])))]; + + var Receiving = create$1({ + fields: ReceivingSchema, + name: 'receiving', + active: ActiveReceiving + }); + + var updateAriaState = function (component, toggleConfig, toggleState) { + var ariaInfo = toggleConfig.aria; + ariaInfo.update(component, ariaInfo, toggleState.get()); + }; + var updateClass = function (component, toggleConfig, toggleState) { + toggleConfig.toggleClass.each(function (toggleClass) { + if (toggleState.get()) { + add$2(component.element(), toggleClass); + } else { + remove$4(component.element(), toggleClass); + } + }); + }; + var toggle = function (component, toggleConfig, toggleState) { + set$2(component, toggleConfig, toggleState, !toggleState.get()); + }; + var on = function (component, toggleConfig, toggleState) { + toggleState.set(true); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); + }; + var off = function (component, toggleConfig, toggleState) { + toggleState.set(false); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); + }; + var set$2 = function (component, toggleConfig, toggleState, state) { + var action = state ? on : off; + action(component, toggleConfig, toggleState); + }; + var isOn = function (component, toggleConfig, toggleState) { + return toggleState.get(); + }; + var onLoad = function (component, toggleConfig, toggleState) { + set$2(component, toggleConfig, toggleState, toggleConfig.selected); + }; + + var ToggleApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + onLoad: onLoad, + toggle: toggle, + isOn: isOn, + on: on, + off: off, + set: set$2 + }); + + var exhibit = function () { + return nu$5({}); + }; + var events$1 = function (toggleConfig, toggleState) { + var execute = executeEvent(toggleConfig, toggleState, toggle); + var load = loadEvent(toggleConfig, toggleState, onLoad); + return derive(flatten([ + toggleConfig.toggleOnExecute ? [execute] : [], + [load] + ])); + }; + + var ActiveToggle = /*#__PURE__*/Object.freeze({ + __proto__: null, + exhibit: exhibit, + events: events$1 + }); + + var SetupBehaviourCellState = function (initialState) { + var init = function () { + var cell = Cell(initialState); + var get = function () { + return cell.get(); + }; + var set = function (newState) { + return cell.set(newState); + }; + var clear = function () { + return cell.set(initialState); + }; + var readState = function () { + return cell.get(); + }; + return { + get: get, + set: set, + clear: clear, + readState: readState + }; + }; + return { init: init }; + }; + + var updatePressed = function (component, ariaInfo, status) { + set(component.element(), 'aria-pressed', status); + if (ariaInfo.syncWithExpanded) { + updateExpanded(component, ariaInfo, status); + } + }; + var updateSelected = function (component, ariaInfo, status) { + set(component.element(), 'aria-selected', status); + }; + var updateChecked = function (component, ariaInfo, status) { + set(component.element(), 'aria-checked', status); + }; + var updateExpanded = function (component, ariaInfo, status) { + set(component.element(), 'aria-expanded', status); + }; + + var ToggleSchema = [ + defaulted$1('selected', false), + option('toggleClass'), + defaulted$1('toggleOnExecute', true), + defaultedOf('aria', { mode: 'none' }, choose$1('mode', { + pressed: [ + defaulted$1('syncWithExpanded', false), + output('update', updatePressed) + ], + checked: [output('update', updateChecked)], + expanded: [output('update', updateExpanded)], + selected: [output('update', updateSelected)], + none: [output('update', noop)] + })) + ]; + + var Toggling = create$1({ + fields: ToggleSchema, + name: 'toggling', + active: ActiveToggle, + apis: ToggleApis, + state: SetupBehaviourCellState(false) + }); + + var format = function (command, update) { + return Receiving.config({ + channels: wrap$1(TinyChannels.formatChanged(), { + onReceive: function (button, data) { + if (data.command === command) { + update(button, data.state); + } + } + }) + }); + }; + var orientation = function (onReceive) { + return Receiving.config({ channels: wrap$1(TinyChannels.orientationChanged(), { onReceive: onReceive }) }); + }; + var receive$1 = function (channel, onReceive) { + return { + key: channel, + value: { onReceive: onReceive } + }; + }; + var Receivers = { + format: format, + orientation: orientation, + receive: receive$1 + }; + + var prefix = 'tinymce-mobile'; + var resolve = function (p) { + return prefix + '-' + p; + }; + var Styles = { + resolve: resolve, + prefix: constant(prefix) + }; + + var pointerEvents = function () { + var onClick = function (component, simulatedEvent) { + simulatedEvent.stop(); + emitExecute(component); + }; + return [ + run(click(), onClick), + run(tap(), onClick), + cutter(touchstart()), + cutter(mousedown()) + ]; + }; + var events$2 = function (optAction) { + var executeHandler = function (action) { + return runOnExecute(function (component, simulatedEvent) { + action(component); + simulatedEvent.stop(); + }); + }; + return derive(flatten([ + optAction.map(executeHandler).toArray(), + pointerEvents() + ])); + }; + + var focus$2 = function (component, focusConfig) { + if (!focusConfig.ignore) { + focus$1(component.element()); + focusConfig.onFocus(component); + } + }; + var blur$1 = function (component, focusConfig) { + if (!focusConfig.ignore) { + blur(component.element()); + } + }; + var isFocused = function (component) { + return hasFocus(component.element()); + }; + + var FocusApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + focus: focus$2, + blur: blur$1, + isFocused: isFocused + }); + + var exhibit$1 = function (base, focusConfig) { + var mod = focusConfig.ignore ? {} : { attributes: { tabindex: '-1' } }; + return nu$5(mod); + }; + var events$3 = function (focusConfig) { + return derive([run(focus(), function (component, simulatedEvent) { + focus$2(component, focusConfig); + simulatedEvent.stop(); + })].concat(focusConfig.stopMousedown ? [run(mousedown(), function (_, simulatedEvent) { + simulatedEvent.event().prevent(); + })] : [])); + }; + + var ActiveFocus = /*#__PURE__*/Object.freeze({ + __proto__: null, + exhibit: exhibit$1, + events: events$3 + }); + + var FocusSchema = [ + onHandler('onFocus'), + defaulted$1('stopMousedown', false), + defaulted$1('ignore', false) + ]; + + var Focusing = create$1({ + fields: FocusSchema, + name: 'focusing', + active: ActiveFocus, + apis: FocusApis + }); + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } + }; + var internalRemove = function (dom, property) { + if (isSupported(dom)) { + dom.style.removeProperty(property); + } + }; + var set$3 = function (element, property, value) { + var dom = element.dom(); + internalSet(dom, property, value); + }; + var setAll$1 = function (element, css) { + var dom = element.dom(); + each(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$4 = function (element, property) { + var dom = element.dom(); + var styles = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + var getRaw = function (element, property) { + var dom = element.dom(); + var raw = getUnsafeProperty(dom, property); + return Option.from(raw).filter(function (r) { + return r.length > 0; + }); + }; + var remove$5 = function (element, property) { + var dom = element.dom(); + internalRemove(dom, property); + if (has$1(element, 'style') && trim(get$1(element, 'style')) === '') { + remove$1(element, 'style'); + } + }; + var reflow = function (e) { + return e.dom().offsetWidth; + }; + + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom(); + if (isSupported(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$4(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$4(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; + } + + var api = Dimension('height', function (element) { + var dom = element.dom(); + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + }); + var get$5 = function (element) { + return api.get(element); + }; + + var ancestors = function (scope, predicate, isRoot) { + return filter(parents(scope, isRoot), predicate); + }; + var siblings$1 = function (scope, predicate) { + return filter(siblings(scope), predicate); + }; + + var all$2 = function (selector) { + return all(selector); + }; + var ancestors$1 = function (scope, selector, isRoot) { + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var siblings$2 = function (scope, selector) { + return siblings$1(scope, function (e) { + return is(e, selector); + }); + }; + var descendants = function (scope, selector) { + return all(selector, scope); + }; + + var first = function (selector) { + return one(selector); + }; + var ancestor$2 = function (scope, selector, isRoot) { + return ancestor$1(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var descendant$1 = function (scope, selector) { + return one(selector, scope); + }; + var closest$2 = function (scope, selector, isRoot) { + return ClosestOrAncestor(is, ancestor$2, scope, selector, isRoot); + }; + + var BACKSPACE = function () { + return [8]; + }; + var TAB = function () { + return [9]; + }; + var ENTER = function () { + return [13]; + }; + var ESCAPE = function () { + return [27]; + }; + var SPACE = function () { + return [32]; + }; + var LEFT = function () { + return [37]; + }; + var UP = function () { + return [38]; + }; + var RIGHT = function () { + return [39]; + }; + var DOWN = function () { + return [40]; + }; + + var cyclePrev = function (values, index, predicate) { + var before = reverse(values.slice(0, index)); + var after = reverse(values.slice(index + 1)); + return find$2(before.concat(after), predicate); + }; + var tryPrev = function (values, index, predicate) { + var before = reverse(values.slice(0, index)); + return find$2(before, predicate); + }; + var cycleNext = function (values, index, predicate) { + var before = values.slice(0, index); + var after = values.slice(index + 1); + return find$2(after.concat(before), predicate); + }; + var tryNext = function (values, index, predicate) { + var after = values.slice(index + 1); + return find$2(after, predicate); + }; + + var inSet = function (keys) { + return function (event) { + var raw = event.raw(); + return contains(keys, raw.which); + }; + }; + var and = function (preds) { + return function (event) { + return forall(preds, function (pred) { + return pred(event); + }); + }; + }; + var isShift = function (event) { + var raw = event.raw(); + return raw.shiftKey === true; + }; + var isControl = function (event) { + var raw = event.raw(); + return raw.ctrlKey === true; + }; + var isNotShift = not(isShift); + + var rule = function (matches, action) { + return { + matches: matches, + classification: action + }; + }; + var choose$2 = function (transitions, event) { + var transition = find$2(transitions, function (t) { + return t.matches(event); + }); + return transition.map(function (t) { + return t.classification; + }); + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + var sequence = function (arr) { + var r = []; + for (var i = 0; i < arr.length; i++) { + var x = arr[i]; + if (x.isSome()) { + r.push(x.getOrDie()); + } else { + return Option.none(); + } + } + return Option.some(r); + }; + var someIf = function (b, a) { + return b ? Option.some(a) : Option.none(); + }; + + var cycleBy = function (value, delta, min, max) { + var r = value + delta; + return r > max ? min : r < min ? max : r; + }; + var clamp = function (value, min, max) { + return Math.min(Math.max(value, min), max); + }; + + var dehighlightAllExcept = function (component, hConfig, hState, skip) { + var highlighted = descendants(component.element(), '.' + hConfig.highlightClass); + each$1(highlighted, function (h) { + if (!exists(skip, function (skipComp) { + return skipComp.element() === h; + })) { + remove$4(h, hConfig.highlightClass); + component.getSystem().getByDom(h).each(function (target) { + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + }); + } + }); + }; + var dehighlightAll = function (component, hConfig, hState) { + return dehighlightAllExcept(component, hConfig, hState, []); + }; + var dehighlight$1 = function (component, hConfig, hState, target) { + if (isHighlighted(component, hConfig, hState, target)) { + remove$4(target.element(), hConfig.highlightClass); + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + } + }; + var highlight$1 = function (component, hConfig, hState, target) { + dehighlightAllExcept(component, hConfig, hState, [target]); + if (!isHighlighted(component, hConfig, hState, target)) { + add$2(target.element(), hConfig.highlightClass); + hConfig.onHighlight(component, target); + emit(target, highlight()); + } + }; + var highlightFirst = function (component, hConfig, hState) { + getFirst(component, hConfig).each(function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); + }; + var highlightLast = function (component, hConfig, hState) { + getLast(component, hConfig).each(function (lastComp) { + highlight$1(component, hConfig, hState, lastComp); + }); + }; + var highlightAt = function (component, hConfig, hState, index) { + getByIndex(component, hConfig, hState, index).fold(function (err) { + throw new Error(err); + }, function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); + }; + var highlightBy = function (component, hConfig, hState, predicate) { + var candidates = getCandidates(component, hConfig); + var targetComp = find$2(candidates, predicate); + targetComp.each(function (c) { + highlight$1(component, hConfig, hState, c); + }); + }; + var isHighlighted = function (component, hConfig, hState, queryTarget) { + return has$2(queryTarget.element(), hConfig.highlightClass); + }; + var getHighlighted = function (component, hConfig, hState) { + return descendant$1(component.element(), '.' + hConfig.highlightClass).bind(function (e) { + return component.getSystem().getByDom(e).toOption(); + }); + }; + var getByIndex = function (component, hConfig, hState, index) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + return Option.from(items[index]).fold(function () { + return Result.error('No element found with index ' + index); + }, component.getSystem().getByDom); + }; + var getFirst = function (component, hConfig, hState) { + return descendant$1(component.element(), '.' + hConfig.itemClass).bind(function (e) { + return component.getSystem().getByDom(e).toOption(); + }); + }; + var getLast = function (component, hConfig, hState) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + var last = items.length > 0 ? Option.some(items[items.length - 1]) : Option.none(); + return last.bind(function (c) { + return component.getSystem().getByDom(c).toOption(); + }); + }; + var getDelta = function (component, hConfig, hState, delta) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + var current = findIndex(items, function (item) { + return has$2(item, hConfig.highlightClass); + }); + return current.bind(function (selected) { + var dest = cycleBy(selected, delta, 0, items.length - 1); + return component.getSystem().getByDom(items[dest]).toOption(); + }); + }; + var getPrevious = function (component, hConfig, hState) { + return getDelta(component, hConfig, hState, -1); + }; + var getNext = function (component, hConfig, hState) { + return getDelta(component, hConfig, hState, +1); + }; + var getCandidates = function (component, hConfig, hState) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + return cat(map$1(items, function (i) { + return component.getSystem().getByDom(i).toOption(); + })); + }; + + var HighlightApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + dehighlightAll: dehighlightAll, + dehighlight: dehighlight$1, + highlight: highlight$1, + highlightFirst: highlightFirst, + highlightLast: highlightLast, + highlightAt: highlightAt, + highlightBy: highlightBy, + isHighlighted: isHighlighted, + getHighlighted: getHighlighted, + getFirst: getFirst, + getLast: getLast, + getPrevious: getPrevious, + getNext: getNext, + getCandidates: getCandidates + }); + + var HighlightSchema = [ + strict$1('highlightClass'), + strict$1('itemClass'), + onHandler('onHighlight'), + onHandler('onDehighlight') + ]; + + var Highlighting = create$1({ + fields: HighlightSchema, + name: 'highlighting', + apis: HighlightApis + }); + + var reportFocusShifting = function (component, prevFocus, newFocus) { + var noChange = prevFocus.exists(function (p) { + return newFocus.exists(function (n) { + return eq(n, p); + }); + }); + if (!noChange) { + emitWith(component, focusShifted(), { + prevFocus: prevFocus, + newFocus: newFocus + }); + } + }; + var dom = function () { + var get = function (component) { + return search(component.element()); + }; + var set = function (component, focusee) { + var prevFocus = get(component); + component.getSystem().triggerFocus(focusee, component.element()); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; + }; + var highlights = function () { + var get = function (component) { + return Highlighting.getHighlighted(component).map(function (item) { + return item.element(); + }); + }; + var set = function (component, element) { + var prevFocus = get(component); + component.getSystem().getByDom(element).fold(noop, function (item) { + Highlighting.highlight(component, item); + }); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; + }; + + var FocusInsideModes; + (function (FocusInsideModes) { + FocusInsideModes['OnFocusMode'] = 'onFocus'; + FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace'; + FocusInsideModes['OnApiMode'] = 'onApi'; + }(FocusInsideModes || (FocusInsideModes = {}))); + + var typical = function (infoSchema, stateInit, getKeydownRules, getKeyupRules, optFocusIn) { + var schema = function () { + return infoSchema.concat([ + defaulted$1('focusManager', dom()), + defaultedOf('focusInside', 'onFocus', valueOf(function (val) { + return contains([ + 'onFocus', + 'onEnterOrSpace', + 'onApi' + ], val) ? Result.value(val) : Result.error('Invalid value for focusInside'); + })), + output('handler', me), + output('state', stateInit), + output('sendFocusIn', optFocusIn) + ]); + }; + var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) { + var rules = getRules(component, simulatedEvent, keyingConfig, keyingState); + return choose$2(rules, simulatedEvent.event()).bind(function (rule) { + return rule(component, simulatedEvent, keyingConfig, keyingState); + }); + }; + var toEvents = function (keyingConfig, keyingState) { + var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Option.none() : optFocusIn(keyingConfig).map(function (focusIn) { + return run(focus(), function (component, simulatedEvent) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + }); + var tryGoInsideComponent = function (component, simulatedEvent) { + var isEnterOrSpace = inSet(SPACE().concat(ENTER()))(simulatedEvent.event()); + if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) { + optFocusIn(keyingConfig).each(function (focusIn) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + } + }; + return derive(onFocusHandler.toArray().concat([ + run(keydown(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () { + tryGoInsideComponent(component, simulatedEvent); + }, function (_) { + simulatedEvent.stop(); + }); + }), + run(keyup(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) { + simulatedEvent.stop(); + }); + }) + ])); + }; + var me = { + schema: schema, + processKey: processKey, + toEvents: toEvents + }; + return me; + }; + + var create$2 = function (cyclicField) { + var schema = [ + option('onEscape'), + option('onEnter'), + defaulted$1('selector', '[data-alloy-tabstop="true"]:not(:disabled)'), + defaulted$1('firstTabstop', 0), + defaulted$1('useTabstopAt', constant(true)), + option('visibilitySelector') + ].concat([cyclicField]); + var isVisible = function (tabbingConfig, element) { + var target = tabbingConfig.visibilitySelector.bind(function (sel) { + return closest$2(element, sel); + }).getOr(element); + return get$5(target) > 0; + }; + var findInitial = function (component, tabbingConfig) { + var tabstops = descendants(component.element(), tabbingConfig.selector); + var visibles = filter(tabstops, function (elem) { + return isVisible(tabbingConfig, elem); + }); + return Option.from(visibles[tabbingConfig.firstTabstop]); + }; + var findCurrent = function (component, tabbingConfig) { + return tabbingConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, tabbingConfig.selector); + }); + }; + var isTabstop = function (tabbingConfig, element) { + return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element); + }; + var focusIn = function (component, tabbingConfig, tabbingState) { + findInitial(component, tabbingConfig).each(function (target) { + tabbingConfig.focusManager.set(component, target); + }); + }; + var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) { + return cycle(tabstops, stopIndex, function (elem) { + return isTabstop(tabbingConfig, elem); + }).fold(function () { + return tabbingConfig.cyclic ? Option.some(true) : Option.none(); + }, function (target) { + tabbingConfig.focusManager.set(component, target); + return Option.some(true); + }); + }; + var go = function (component, simulatedEvent, tabbingConfig, cycle) { + var tabstops = descendants(component.element(), tabbingConfig.selector); + return findCurrent(component, tabbingConfig).bind(function (tabstop) { + var optStopIndex = findIndex(tabstops, curry(eq, tabstop)); + return optStopIndex.bind(function (stopIndex) { + return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle); + }); + }); + }; + var goBackwards = function (component, simulatedEvent, tabbingConfig) { + var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var goForwards = function (component, simulatedEvent, tabbingConfig) { + var navigate = tabbingConfig.cyclic ? cycleNext : tryNext; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var execute = function (component, simulatedEvent, tabbingConfig) { + return tabbingConfig.onEnter.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var exit = function (component, simulatedEvent, tabbingConfig) { + return tabbingConfig.onEscape.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var getKeydownRules = constant([ + rule(and([ + isShift, + inSet(TAB()) + ]), goBackwards), + rule(inSet(TAB()), goForwards), + rule(inSet(ESCAPE()), exit), + rule(and([ + isNotShift, + inSet(ENTER()) + ]), execute) + ]); + var getKeyupRules = constant([]); + return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () { + return Option.some(focusIn); + }); + }; + + var AcyclicType = create$2(state$1('cyclic', constant(false))); + + var CyclicType = create$2(state$1('cyclic', constant(true))); + + var inside = function (target) { + return name(target) === 'input' && get$1(target, 'type') !== 'radio' || name(target) === 'textarea'; + }; + + var doDefaultExecute = function (component, simulatedEvent, focused) { + dispatch(component, focused, execute()); + return Option.some(true); + }; + var defaultExecute = function (component, simulatedEvent, focused) { + return inside(focused) && inSet(SPACE())(simulatedEvent.event()) ? Option.none() : doDefaultExecute(component, simulatedEvent, focused); + }; + var stopEventForFirefox = function (component, simulatedEvent) { + return Option.some(true); + }; + + var schema$1 = [ + defaulted$1('execute', defaultExecute), + defaulted$1('useSpace', false), + defaulted$1('useEnter', true), + defaulted$1('useControlEnter', false), + defaulted$1('useDown', false) + ]; + var execute$1 = function (component, simulatedEvent, executeConfig) { + return executeConfig.execute(component, simulatedEvent, component.element()); + }; + var getKeydownRules = function (component, simulatedEvent, executeConfig, executeState) { + var spaceExec = executeConfig.useSpace && !inside(component.element()) ? SPACE() : []; + var enterExec = executeConfig.useEnter ? ENTER() : []; + var downExec = executeConfig.useDown ? DOWN() : []; + var execKeys = spaceExec.concat(enterExec).concat(downExec); + return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([ + isControl, + inSet(ENTER()) + ]), execute$1)] : []); + }; + var getKeyupRules = function (component, simulatedEvent, executeConfig, executeState) { + return executeConfig.useSpace && !inside(component.element()) ? [rule(inSet(SPACE()), stopEventForFirefox)] : []; + }; + var ExecutionType = typical(schema$1, NoState.init, getKeydownRules, getKeyupRules, function () { + return Option.none(); + }); + + var flatgrid = function () { + var dimensions = Cell(Option.none()); + var setGridSize = function (numRows, numColumns) { + dimensions.set(Option.some({ + numRows: constant(numRows), + numColumns: constant(numColumns) + })); + }; + var getNumRows = function () { + return dimensions.get().map(function (d) { + return d.numRows(); + }); + }; + var getNumColumns = function () { + return dimensions.get().map(function (d) { + return d.numColumns(); + }); + }; + return nu$6({ + readState: function () { + return dimensions.get().map(function (d) { + return { + numRows: String(d.numRows()), + numColumns: String(d.numColumns()) + }; + }).getOr({ + numRows: '?', + numColumns: '?' + }); + }, + setGridSize: setGridSize, + getNumRows: getNumRows, + getNumColumns: getNumColumns + }); + }; + var init = function (spec) { + return spec.state(spec); + }; + + var KeyingState = /*#__PURE__*/Object.freeze({ + __proto__: null, + flatgrid: flatgrid, + init: init + }); + + var onDirection = function (isLtr, isRtl) { + return function (element) { + return getDirection(element) === 'rtl' ? isRtl : isLtr; + }; + }; + var getDirection = function (element) { + return get$4(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + var useH = function (movement) { + return function (component, simulatedEvent, config, state) { + var move = movement(component.element()); + return use(move, component, simulatedEvent, config, state); + }; + }; + var west = function (moveLeft, moveRight) { + var movement = onDirection(moveLeft, moveRight); + return useH(movement); + }; + var east = function (moveLeft, moveRight) { + var movement = onDirection(moveRight, moveLeft); + return useH(movement); + }; + var useV = function (move) { + return function (component, simulatedEvent, config, state) { + return use(move, component, simulatedEvent, config, state); + }; + }; + var use = function (move, component, simulatedEvent, config, state) { + var outcome = config.focusManager.get(component).bind(function (focused) { + return move(component.element(), focused, config, state); + }); + return outcome.map(function (newFocus) { + config.focusManager.set(component, newFocus); + return true; + }); + }; + var north = useV; + var south = useV; + var move = useV; + + var isHidden = function (dom) { + return dom.offsetWidth <= 0 && dom.offsetHeight <= 0; + }; + var isVisible = function (element) { + var dom = element.dom(); + return !isHidden(dom); + }; + + var locate = function (candidates, predicate) { + return findIndex(candidates, predicate).map(function (index) { + return { + index: constant(index), + candidates: constant(candidates) + }; + }); + }; + + var locateVisible = function (container, current, selector) { + var predicate = function (x) { + return eq(x, current); + }; + var candidates = descendants(container, selector); + var visible = filter(candidates, isVisible); + return locate(visible, predicate); + }; + var findIndex$1 = function (elements, target) { + return findIndex(elements, function (elem) { + return eq(target, elem); + }); + }; + + var withGrid = function (values, index, numCols, f) { + var oldRow = Math.floor(index / numCols); + var oldColumn = index % numCols; + return f(oldRow, oldColumn).bind(function (address) { + var newIndex = address.row() * numCols + address.column(); + return newIndex >= 0 && newIndex < values.length ? Option.some(values[newIndex]) : Option.none(); + }); + }; + var cycleHorizontal = function (values, index, numRows, numCols, delta) { + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var onLastRow = oldRow === numRows - 1; + var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols; + var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1); + return Option.some({ + row: constant(oldRow), + column: constant(newColumn) + }); + }); + }; + var cycleVertical = function (values, index, numRows, numCols, delta) { + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var newRow = cycleBy(oldRow, delta, 0, numRows - 1); + var onLastRow = newRow === numRows - 1; + var colsInRow = onLastRow ? values.length - newRow * numCols : numCols; + var newCol = clamp(oldColumn, 0, colsInRow - 1); + return Option.some({ + row: constant(newRow), + column: constant(newCol) + }); + }); + }; + var cycleRight = function (values, index, numRows, numCols) { + return cycleHorizontal(values, index, numRows, numCols, +1); + }; + var cycleLeft = function (values, index, numRows, numCols) { + return cycleHorizontal(values, index, numRows, numCols, -1); + }; + var cycleUp = function (values, index, numRows, numCols) { + return cycleVertical(values, index, numRows, numCols, -1); + }; + var cycleDown = function (values, index, numRows, numCols) { + return cycleVertical(values, index, numRows, numCols, +1); + }; + + var schema$2 = [ + strict$1('selector'), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('captureTab', false), + initSize() + ]; + var focusIn = function (component, gridConfig, gridState) { + descendant$1(component.element(), gridConfig.selector).each(function (first) { + gridConfig.focusManager.set(component, first); + }); + }; + var findCurrent = function (component, gridConfig) { + return gridConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, gridConfig.selector); + }); + }; + var execute$2 = function (component, simulatedEvent, gridConfig, gridState) { + return findCurrent(component, gridConfig).bind(function (focused) { + return gridConfig.execute(component, simulatedEvent, focused); + }); + }; + var doMove = function (cycle) { + return function (element, focused, gridConfig, gridState) { + return locateVisible(element, focused, gridConfig.selector).bind(function (identified) { + return cycle(identified.candidates(), identified.index(), gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns)); + }); + }; + }; + var handleTab = function (component, simulatedEvent, gridConfig) { + return gridConfig.captureTab ? Option.some(true) : Option.none(); + }; + var doEscape = function (component, simulatedEvent, gridConfig) { + return gridConfig.onEscape(component, simulatedEvent); + }; + var moveLeft = doMove(cycleLeft); + var moveRight = doMove(cycleRight); + var moveNorth = doMove(cycleUp); + var moveSouth = doMove(cycleDown); + var getKeydownRules$1 = constant([ + rule(inSet(LEFT()), west(moveLeft, moveRight)), + rule(inSet(RIGHT()), east(moveLeft, moveRight)), + rule(inSet(UP()), north(moveNorth)), + rule(inSet(DOWN()), south(moveSouth)), + rule(and([ + isShift, + inSet(TAB()) + ]), handleTab), + rule(and([ + isNotShift, + inSet(TAB()) + ]), handleTab), + rule(inSet(ESCAPE()), doEscape), + rule(inSet(SPACE().concat(ENTER())), execute$2) + ]); + var getKeyupRules$1 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var FlatgridType = typical(schema$2, flatgrid, getKeydownRules$1, getKeyupRules$1, function () { + return Option.some(focusIn); + }); + + var horizontal = function (container, selector, current, delta) { + var isDisabledButton = function (candidate) { + return name(candidate) === 'button' && get$1(candidate, 'disabled') === 'disabled'; + }; + var tryCycle = function (initial, index, candidates) { + var newIndex = cycleBy(index, delta, 0, candidates.length - 1); + if (newIndex === initial) { + return Option.none(); + } else { + return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Option.from(candidates[newIndex]); + } + }; + return locateVisible(container, current, selector).bind(function (identified) { + var index = identified.index(); + var candidates = identified.candidates(); + return tryCycle(index, index, candidates); + }); + }; + + var schema$3 = [ + strict$1('selector'), + defaulted$1('getInitial', Option.none), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('executeOnMove', false), + defaulted$1('allowVertical', true) + ]; + var findCurrent$1 = function (component, flowConfig) { + return flowConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, flowConfig.selector); + }); + }; + var execute$3 = function (component, simulatedEvent, flowConfig) { + return findCurrent$1(component, flowConfig).bind(function (focused) { + return flowConfig.execute(component, simulatedEvent, focused); + }); + }; + var focusIn$1 = function (component, flowConfig, state) { + flowConfig.getInitial(component).orThunk(function () { + return descendant$1(component.element(), flowConfig.selector); + }).each(function (first) { + flowConfig.focusManager.set(component, first); + }); + }; + var moveLeft$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, -1); + }; + var moveRight$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, +1); + }; + var doMove$1 = function (movement) { + return function (component, simulatedEvent, flowConfig, flowState) { + return movement(component, simulatedEvent, flowConfig, flowState).bind(function () { + return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Option.some(true); + }); + }; + }; + var doEscape$1 = function (component, simulatedEvent, flowConfig) { + return flowConfig.onEscape(component, simulatedEvent); + }; + var getKeydownRules$2 = function (_component, _se, flowConfig, _flowState) { + var westMovers = LEFT().concat(flowConfig.allowVertical ? UP() : []); + var eastMovers = RIGHT().concat(flowConfig.allowVertical ? DOWN() : []); + return [ + rule(inSet(westMovers), doMove$1(west(moveLeft$1, moveRight$1))), + rule(inSet(eastMovers), doMove$1(east(moveLeft$1, moveRight$1))), + rule(inSet(ENTER()), execute$3), + rule(inSet(SPACE()), execute$3), + rule(inSet(ESCAPE()), doEscape$1) + ]; + }; + var getKeyupRules$2 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var FlowType = typical(schema$3, NoState.init, getKeydownRules$2, getKeyupRules$2, function () { + return Option.some(focusIn$1); + }); + + var outcome = MixedBag([ + 'rowIndex', + 'columnIndex', + 'cell' + ], []); + var toCell = function (matrix, rowIndex, columnIndex) { + return Option.from(matrix[rowIndex]).bind(function (row) { + return Option.from(row[columnIndex]).map(function (cell) { + return outcome({ + rowIndex: rowIndex, + columnIndex: columnIndex, + cell: cell + }); + }); + }); + }; + var cycleHorizontal$1 = function (matrix, rowIndex, startCol, deltaCol) { + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); + }; + var cycleVertical$1 = function (matrix, colIndex, startRow, deltaRow) { + var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); + }; + var moveHorizontal = function (matrix, rowIndex, startCol, deltaCol) { + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); + }; + var moveVertical = function (matrix, colIndex, startRow, deltaRow) { + var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); + }; + var cycleRight$1 = function (matrix, startRow, startCol) { + return cycleHorizontal$1(matrix, startRow, startCol, +1); + }; + var cycleLeft$1 = function (matrix, startRow, startCol) { + return cycleHorizontal$1(matrix, startRow, startCol, -1); + }; + var cycleUp$1 = function (matrix, startRow, startCol) { + return cycleVertical$1(matrix, startCol, startRow, -1); + }; + var cycleDown$1 = function (matrix, startRow, startCol) { + return cycleVertical$1(matrix, startCol, startRow, +1); + }; + var moveLeft$2 = function (matrix, startRow, startCol) { + return moveHorizontal(matrix, startRow, startCol, -1); + }; + var moveRight$2 = function (matrix, startRow, startCol) { + return moveHorizontal(matrix, startRow, startCol, +1); + }; + var moveUp = function (matrix, startRow, startCol) { + return moveVertical(matrix, startCol, startRow, -1); + }; + var moveDown = function (matrix, startRow, startCol) { + return moveVertical(matrix, startCol, startRow, +1); + }; + + var schema$4 = [ + strictObjOf('selectors', [ + strict$1('row'), + strict$1('cell') + ]), + defaulted$1('cycles', true), + defaulted$1('previousSelector', Option.none), + defaulted$1('execute', defaultExecute) + ]; + var focusIn$2 = function (component, matrixConfig, state) { + var focused = matrixConfig.previousSelector(component).orThunk(function () { + var selectors = matrixConfig.selectors; + return descendant$1(component.element(), selectors.cell); + }); + focused.each(function (cell) { + matrixConfig.focusManager.set(component, cell); + }); + }; + var execute$4 = function (component, simulatedEvent, matrixConfig) { + return search(component.element()).bind(function (focused) { + return matrixConfig.execute(component, simulatedEvent, focused); + }); + }; + var toMatrix = function (rows, matrixConfig) { + return map$1(rows, function (row) { + return descendants(row, matrixConfig.selectors.cell); + }); + }; + var doMove$2 = function (ifCycle, ifMove) { + return function (element, focused, matrixConfig) { + var move = matrixConfig.cycles ? ifCycle : ifMove; + return closest$2(focused, matrixConfig.selectors.row).bind(function (inRow) { + var cellsInRow = descendants(inRow, matrixConfig.selectors.cell); + return findIndex$1(cellsInRow, focused).bind(function (colIndex) { + var allRows = descendants(element, matrixConfig.selectors.row); + return findIndex$1(allRows, inRow).bind(function (rowIndex) { + var matrix = toMatrix(allRows, matrixConfig); + return move(matrix, rowIndex, colIndex).map(function (next) { + return next.cell(); + }); + }); + }); + }); + }; + }; + var moveLeft$3 = doMove$2(cycleLeft$1, moveLeft$2); + var moveRight$3 = doMove$2(cycleRight$1, moveRight$2); + var moveNorth$1 = doMove$2(cycleUp$1, moveUp); + var moveSouth$1 = doMove$2(cycleDown$1, moveDown); + var getKeydownRules$3 = constant([ + rule(inSet(LEFT()), west(moveLeft$3, moveRight$3)), + rule(inSet(RIGHT()), east(moveLeft$3, moveRight$3)), + rule(inSet(UP()), north(moveNorth$1)), + rule(inSet(DOWN()), south(moveSouth$1)), + rule(inSet(SPACE().concat(ENTER())), execute$4) + ]); + var getKeyupRules$3 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var MatrixType = typical(schema$4, NoState.init, getKeydownRules$3, getKeyupRules$3, function () { + return Option.some(focusIn$2); + }); + + var schema$5 = [ + strict$1('selector'), + defaulted$1('execute', defaultExecute), + defaulted$1('moveOnTab', false) + ]; + var execute$5 = function (component, simulatedEvent, menuConfig) { + return menuConfig.focusManager.get(component).bind(function (focused) { + return menuConfig.execute(component, simulatedEvent, focused); + }); + }; + var focusIn$3 = function (component, menuConfig, state) { + descendant$1(component.element(), menuConfig.selector).each(function (first) { + menuConfig.focusManager.set(component, first); + }); + }; + var moveUp$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, -1); + }; + var moveDown$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, +1); + }; + var fireShiftTab = function (component, simulatedEvent, menuConfig, menuState) { + return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Option.none(); + }; + var fireTab = function (component, simulatedEvent, menuConfig, menuState) { + return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Option.none(); + }; + var getKeydownRules$4 = constant([ + rule(inSet(UP()), move(moveUp$1)), + rule(inSet(DOWN()), move(moveDown$1)), + rule(and([ + isShift, + inSet(TAB()) + ]), fireShiftTab), + rule(and([ + isNotShift, + inSet(TAB()) + ]), fireTab), + rule(inSet(ENTER()), execute$5), + rule(inSet(SPACE()), execute$5) + ]); + var getKeyupRules$4 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var MenuType = typical(schema$5, NoState.init, getKeydownRules$4, getKeyupRules$4, function () { + return Option.some(focusIn$3); + }); + + var schema$6 = [ + onKeyboardHandler('onSpace'), + onKeyboardHandler('onEnter'), + onKeyboardHandler('onShiftEnter'), + onKeyboardHandler('onLeft'), + onKeyboardHandler('onRight'), + onKeyboardHandler('onTab'), + onKeyboardHandler('onShiftTab'), + onKeyboardHandler('onUp'), + onKeyboardHandler('onDown'), + onKeyboardHandler('onEscape'), + defaulted$1('stopSpaceKeyup', false), + option('focusIn') + ]; + var getKeydownRules$5 = function (component, simulatedEvent, specialInfo) { + return [ + rule(inSet(SPACE()), specialInfo.onSpace), + rule(and([ + isNotShift, + inSet(ENTER()) + ]), specialInfo.onEnter), + rule(and([ + isShift, + inSet(ENTER()) + ]), specialInfo.onShiftEnter), + rule(and([ + isShift, + inSet(TAB()) + ]), specialInfo.onShiftTab), + rule(and([ + isNotShift, + inSet(TAB()) + ]), specialInfo.onTab), + rule(inSet(UP()), specialInfo.onUp), + rule(inSet(DOWN()), specialInfo.onDown), + rule(inSet(LEFT()), specialInfo.onLeft), + rule(inSet(RIGHT()), specialInfo.onRight), + rule(inSet(SPACE()), specialInfo.onSpace), + rule(inSet(ESCAPE()), specialInfo.onEscape) + ]; + }; + var getKeyupRules$5 = function (component, simulatedEvent, specialInfo) { + return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE()), stopEventForFirefox)] : []; + }; + var SpecialType = typical(schema$6, NoState.init, getKeydownRules$5, getKeyupRules$5, function (specialInfo) { + return specialInfo.focusIn; + }); + + var acyclic = AcyclicType.schema(); + var cyclic = CyclicType.schema(); + var flow = FlowType.schema(); + var flatgrid$1 = FlatgridType.schema(); + var matrix = MatrixType.schema(); + var execution = ExecutionType.schema(); + var menu = MenuType.schema(); + var special = SpecialType.schema(); + + var KeyboardBranches = /*#__PURE__*/Object.freeze({ + __proto__: null, + acyclic: acyclic, + cyclic: cyclic, + flow: flow, + flatgrid: flatgrid$1, + matrix: matrix, + execution: execution, + menu: menu, + special: special + }); + + var isFlatgridState = function (keyState) { + return hasNonNullableKey(keyState, 'setGridSize'); + }; + var Keying = createModes$1({ + branchKey: 'mode', + branches: KeyboardBranches, + name: 'keying', + active: { + events: function (keyingConfig, keyingState) { + var handler = keyingConfig.handler; + return handler.toEvents(keyingConfig, keyingState); + } + }, + apis: { + focusIn: function (component, keyConfig, keyState) { + keyConfig.sendFocusIn(keyConfig).fold(function () { + component.getSystem().triggerFocus(component.element(), component.element()); + }, function (sendFocusIn) { + sendFocusIn(component, keyConfig, keyState); + }); + }, + setGridSize: function (component, keyConfig, keyState, numRows, numColumns) { + if (!isFlatgridState(keyState)) { + domGlobals.console.error('Layout does not support setGridSize'); + } else { + keyState.setGridSize(numRows, numColumns); + } + } + }, + state: KeyingState + }); + + var field$1 = function (name, forbidden) { + return defaultedObjOf(name, {}, map$1(forbidden, function (f) { + return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name); + }).concat([state$1('dump', identity)])); + }; + var get$6 = function (data) { + return data.dump; + }; + var augment = function (data, original) { + return __assign(__assign({}, data.dump), derive$1(original)); + }; + var SketchBehaviours = { + field: field$1, + augment: augment, + get: get$6 + }; + + var _placeholder = 'placeholder'; + var adt$2 = Adt.generate([ + { + single: [ + 'required', + 'valueThunk' + ] + }, + { + multiple: [ + 'required', + 'valueThunks' + ] + } + ]); + var isSubstituted = function (spec) { + return has(spec, 'uiType'); + }; + var subPlaceholder = function (owner, detail, compSpec, placeholders) { + if (owner.exists(function (o) { + return o !== compSpec.owner; + })) { + return adt$2.single(true, constant(compSpec)); + } + return get(placeholders, compSpec.name).fold(function () { + throw new Error('Unknown placeholder component: ' + compSpec.name + '\nKnown: [' + keys(placeholders) + ']\nNamespace: ' + owner.getOr('none') + '\nSpec: ' + JSON.stringify(compSpec, null, 2)); + }, function (newSpec) { + return newSpec.replace(); + }); + }; + var scan = function (owner, detail, compSpec, placeholders) { + if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) { + return subPlaceholder(owner, detail, compSpec, placeholders); + } else { + return adt$2.single(false, constant(compSpec)); + } + }; + var substitute = function (owner, detail, compSpec, placeholders) { + var base = scan(owner, detail, compSpec, placeholders); + return base.fold(function (req, valueThunk) { + var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail); + var childSpecs = get(value, 'components').getOr([]); + var substituted = bind(childSpecs, function (c) { + return substitute(owner, detail, c, placeholders); + }); + return [__assign(__assign({}, value), { components: substituted })]; + }, function (req, valuesThunk) { + if (isSubstituted(compSpec)) { + var values = valuesThunk(detail, compSpec.config, compSpec.validated); + var preprocessor = compSpec.validated.preprocess.getOr(identity); + return preprocessor(values); + } else { + return valuesThunk(detail); + } + }); + }; + var substituteAll = function (owner, detail, components, placeholders) { + return bind(components, function (c) { + return substitute(owner, detail, c, placeholders); + }); + }; + var oneReplace = function (label, replacements) { + var called = false; + var used = function () { + return called; + }; + var replace = function () { + if (called) { + throw new Error('Trying to use the same placeholder more than once: ' + label); + } + called = true; + return replacements; + }; + var required = function () { + return replacements.fold(function (req, _) { + return req; + }, function (req, _) { + return req; + }); + }; + return { + name: constant(label), + required: required, + used: used, + replace: replace + }; + }; + var substitutePlaces = function (owner, detail, components, placeholders) { + var ps = map(placeholders, function (ph, name) { + return oneReplace(name, ph); + }); + var outcome = substituteAll(owner, detail, components, ps); + each(ps, function (p) { + if (p.used() === false && p.required()) { + throw new Error('Placeholder: ' + p.name() + ' was not found in components list\nNamespace: ' + owner.getOr('none') + '\nComponents: ' + JSON.stringify(detail.components, null, 2)); + } + }); + return outcome; + }; + var single = adt$2.single; + var multiple = adt$2.multiple; + var placeholder = constant(_placeholder); + + var unique = 0; + var generate$1 = function (prefix) { + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); + }; + + var adt$3 = Adt.generate([ + { required: ['data'] }, + { external: ['data'] }, + { optional: ['data'] }, + { group: ['data'] } + ]); + var fFactory = defaulted$1('factory', { sketch: identity }); + var fSchema = defaulted$1('schema', []); + var fName = strict$1('name'); + var fPname = field('pname', 'pname', defaultedThunk(function (typeSpec) { + return ''; + }), anyValue$1()); + var fGroupSchema = state$1('schema', function () { + return [option('preprocess')]; + }); + var fDefaults = defaulted$1('defaults', constant({})); + var fOverrides = defaulted$1('overrides', constant({})); + var requiredSpec = objOf([ + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides + ]); + var externalSpec = objOf([ + fFactory, + fSchema, + fName, + fDefaults, + fOverrides + ]); + var optionalSpec = objOf([ + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides + ]); + var groupSpec = objOf([ + fFactory, + fGroupSchema, + fName, + strict$1('unit'), + fPname, + fDefaults, + fOverrides + ]); + var asNamedPart = function (part) { + return part.fold(Option.some, Option.none, Option.some, Option.some); + }; + var name$1 = function (part) { + var get = function (data) { + return data.name; + }; + return part.fold(get, get, get, get); + }; + var convert = function (adtConstructor, partSchema) { + return function (spec) { + var data = asRawOrDie('Converting part type', partSchema, spec); + return adtConstructor(data); + }; + }; + var required = convert(adt$3.required, requiredSpec); + var external = convert(adt$3.external, externalSpec); + var optional = convert(adt$3.optional, optionalSpec); + var group = convert(adt$3.group, groupSpec); + var original = constant('entirety'); + + var combine = function (detail, data, partSpec, partValidated) { + return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, { uid: detail.partUids[data.name] }, data.overrides(detail, partSpec, partValidated)); + }; + var subs = function (owner, detail, parts) { + var internals = {}; + var externals = {}; + each$1(parts, function (part) { + part.fold(function (data) { + internals[data.pname] = single(true, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine(detail, data, partSpec, partValidated)); + }); + }, function (data) { + var partSpec = detail.parts[data.name]; + externals[data.name] = constant(data.factory.sketch(combine(detail, data, partSpec[original()]), partSpec)); + }, function (data) { + internals[data.pname] = single(false, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine(detail, data, partSpec, partValidated)); + }); + }, function (data) { + internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) { + var units = detail[data.name]; + return map$1(units, function (u) { + return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u))); + }); + }); + }); + }); + return { + internals: constant(internals), + externals: constant(externals) + }; + }; + + var generate$2 = function (owner, parts) { + var r = {}; + each$1(parts, function (part) { + asNamedPart(part).each(function (np) { + var g = doGenerateOne(owner, np.pname); + r[np.name] = function (config) { + var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config); + return __assign(__assign({}, g), { + config: config, + validated: validated + }); + }; + }); + }); + return r; + }; + var doGenerateOne = function (owner, pname) { + return { + uiType: placeholder(), + owner: owner, + name: pname + }; + }; + var generateOne = function (owner, pname, config) { + return { + uiType: placeholder(), + owner: owner, + name: pname, + config: config, + validated: {} + }; + }; + var schemas = function (parts) { + return bind(parts, function (part) { + return part.fold(Option.none, Option.some, Option.none, Option.none).map(function (data) { + return strictObjOf(data.name, data.schema.concat([snapshot(original())])); + }).toArray(); + }); + }; + var names = function (parts) { + return map$1(parts, name$1); + }; + var substitutes = function (owner, detail, parts) { + return subs(owner, detail, parts); + }; + var components = function (owner, detail, internals) { + return substitutePlaces(Option.some(owner), detail, detail.components, internals); + }; + var getPart = function (component, detail, partKey) { + var uid = detail.partUids[partKey]; + return component.getSystem().getByUid(uid).toOption(); + }; + var getPartOrDie = function (component, detail, partKey) { + return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey); + }; + var getAllParts = function (component, detail) { + var system = component.getSystem(); + return map(detail.partUids, function (pUid, k) { + return constant(system.getByUid(pUid)); + }); + }; + var defaultUids = function (baseUid, partTypes) { + var partNames = names(partTypes); + return wrapAll$1(map$1(partNames, function (pn) { + return { + key: pn, + value: baseUid + '-' + pn + }; + })); + }; + var defaultUidsSchema = function (partTypes) { + return field('partUids', 'partUids', mergeWithThunk(function (spec) { + return defaultUids(spec.uid, partTypes); + }), anyValue$1()); + }; + + var premadeTag = generate$1('alloy-premade'); + var premade = function (comp) { + return wrap$1(premadeTag, comp); + }; + var getPremade = function (spec) { + return get(spec, premadeTag); + }; + var makeApi = function (f) { + return markAsSketchApi(function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + return f.apply(undefined, [component.getApis()].concat([component].concat(rest))); + }, f); + }; + + var prefix$1 = constant('alloy-id-'); + var idAttr = constant('data-alloy-id'); + + var prefix$2 = prefix$1(); + var idAttr$1 = idAttr(); + var write = function (label, elem) { + var id = generate$1(prefix$2 + label); + writeOnly(elem, id); + return id; + }; + var writeOnly = function (elem, uid) { + Object.defineProperty(elem.dom(), idAttr$1, { + value: uid, + writable: true + }); + }; + var read$2 = function (elem) { + var id = isElement(elem) ? elem.dom()[idAttr$1] : null; + return Option.from(id); + }; + var generate$3 = function (prefix) { + return generate$1(prefix); + }; + + var base = function (partSchemas, partUidsSchemas) { + var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : []; + return ps.concat([ + strict$1('uid'), + defaulted$1('dom', {}), + defaulted$1('components', []), + snapshot('originalSpec'), + defaulted$1('debug.sketcher', {}) + ]).concat(partUidsSchemas); + }; + var asRawOrDie$1 = function (label, schema, spec, partSchemas, partUidsSchemas) { + var baseS = base(partSchemas, partUidsSchemas); + return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec); + }; + + var single$1 = function (owner, schema, factory, spec) { + var specWithUid = supplyUid(spec); + var detail = asRawOrDie$1(owner, schema, specWithUid, [], []); + return factory(detail, specWithUid); + }; + var composite = function (owner, schema, partTypes, factory, spec) { + var specWithUid = supplyUid(spec); + var partSchemas = schemas(partTypes); + var partUidsSchema = defaultUidsSchema(partTypes); + var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]); + var subs = substitutes(owner, detail, partTypes); + var components$1 = components(owner, detail, subs.internals()); + return factory(detail, components$1, specWithUid, subs.externals()); + }; + var hasUid = function (spec) { + return has(spec, 'uid'); + }; + var supplyUid = function (spec) { + return hasUid(spec) ? spec : __assign(__assign({}, spec), { uid: generate$3('uid') }); + }; + + function isSketchSpec(spec) { + return spec.uid !== undefined; + } + var singleSchema = objOfOnly([ + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) + ]); + var compositeSchema = objOfOnly([ + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + strict$1('partFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) + ]); + var single$2 = function (rawConfig) { + var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig); + var sketch = function (spec) { + return single$1(config.name, config.configFields, config.factory, spec); + }; + var apis = map(config.apis, makeApi); + var extraApis = map(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: constant(config.name), + configFields: constant(config.configFields), + sketch: sketch + }, apis), extraApis); + }; + var composite$1 = function (rawConfig) { + var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig); + var sketch = function (spec) { + return composite(config.name, config.configFields, config.partFields, config.factory, spec); + }; + var parts = generate$2(config.name, config.partFields); + var apis = map(config.apis, makeApi); + var extraApis = map(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: constant(config.name), + partFields: constant(config.partFields), + configFields: constant(config.configFields), + sketch: sketch, + parts: constant(parts) + }, apis), extraApis); + }; + + var factory = function (detail) { + var events = events$2(detail.action); + var tag = detail.dom.tag; + var lookupAttr = function (attr) { + return get(detail.dom, 'attributes').bind(function (attrs) { + return get(attrs, attr); + }); + }; + var getModAttributes = function () { + if (tag === 'button') { + var type = lookupAttr('type').getOr('button'); + var roleAttrs = lookupAttr('role').map(function (role) { + return { role: role }; + }).getOr({}); + return __assign({ type: type }, roleAttrs); + } else { + var role = lookupAttr('role').getOr('button'); + return { role: role }; + } + }; + return { + uid: detail.uid, + dom: detail.dom, + components: detail.components, + events: events, + behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [ + Focusing.config({}), + Keying.config({ + mode: 'execution', + useSpace: true, + useEnter: true + }) + ]), + domModification: { attributes: getModAttributes() }, + eventOrder: detail.eventOrder + }; + }; + var Button = single$2({ + name: 'Button', + factory: factory, + configFields: [ + defaulted$1('uid', undefined), + strict$1('dom'), + defaulted$1('components', []), + SketchBehaviours.field('buttonBehaviours', [ + Focusing, + Keying + ]), + option('action'), + option('role'), + defaulted$1('eventOrder', {}) + ] + }); + + var exhibit$2 = function () { + return nu$5({ + styles: { + '-webkit-user-select': 'none', + 'user-select': 'none', + '-ms-user-select': 'none', + '-moz-user-select': '-moz-none' + }, + attributes: { unselectable: 'on' } + }); + }; + var events$4 = function () { + return derive([abort(selectstart(), constant(true))]); + }; + + var ActiveUnselecting = /*#__PURE__*/Object.freeze({ + __proto__: null, + events: events$4, + exhibit: exhibit$2 + }); + + var Unselecting = create$1({ + fields: [], + name: 'unselecting', + active: ActiveUnselecting + }); + + var getAttrs = function (elem) { + var attributes = elem.dom().attributes !== undefined ? elem.dom().attributes : []; + return foldl(attributes, function (b, attr) { + var _a; + if (attr.name === 'class') { + return b; + } else { + return __assign(__assign({}, b), (_a = {}, _a[attr.name] = attr.value, _a)); + } + }, {}); + }; + var getClasses = function (elem) { + return Array.prototype.slice.call(elem.dom().classList, 0); + }; + var fromHtml$2 = function (html) { + var elem = Element.fromHtml(html); + var children$1 = children(elem); + var attrs = getAttrs(elem); + var classes = getClasses(elem); + var contents = children$1.length === 0 ? {} : { innerHtml: get$3(elem) }; + return __assign({ + tag: name(elem), + classes: classes, + attributes: attrs + }, contents); + }; + + var dom$1 = function (rawHtml) { + var html = supplant(rawHtml, { prefix: Styles.prefix() }); + return fromHtml$2(html); + }; + var spec = function (rawHtml) { + var sDom = dom$1(rawHtml); + return { dom: sDom }; + }; + + var forToolbarCommand = function (editor, command) { + return forToolbar(command, function () { + editor.execCommand(command); + }, {}, editor); + }; + var getToggleBehaviours = function (command) { + return derive$1([ + Toggling.config({ + toggleClass: Styles.resolve('toolbar-button-selected'), + toggleOnExecute: false, + aria: { mode: 'pressed' } + }), + Receivers.format(command, function (button, status) { + var toggle = status ? Toggling.on : Toggling.off; + toggle(button); + }) + ]); + }; + var forToolbarStateCommand = function (editor, command) { + var extraBehaviours = getToggleBehaviours(command); + return forToolbar(command, function () { + editor.execCommand(command); + }, extraBehaviours, editor); + }; + var forToolbarStateAction = function (editor, clazz, command, action) { + var extraBehaviours = getToggleBehaviours(command); + return forToolbar(clazz, action, extraBehaviours, editor); + }; + var getToolbarIconButton = function (clazz, editor) { + var icons = editor.ui.registry.getAll().icons; + var optOxideIcon = Option.from(icons[clazz]); + return optOxideIcon.fold(function () { + return dom$1(''); + }, function (icon) { + return dom$1('' + icon + ''); + }); + }; + var forToolbar = function (clazz, action, extraBehaviours, editor) { + return Button.sketch({ + dom: getToolbarIconButton(clazz, editor), + action: action, + buttonBehaviours: deepMerge(derive$1([Unselecting.config({})]), extraBehaviours) + }); + }; + var Buttons = { + forToolbar: forToolbar, + forToolbarCommand: forToolbarCommand, + forToolbarStateAction: forToolbarStateAction, + forToolbarStateCommand: forToolbarStateCommand, + getToolbarIconButton: getToolbarIconButton + }; + + var labelPart = optional({ + schema: [strict$1('dom')], + name: 'label' + }); + var edgePart = function (name) { + return optional({ + name: '' + name + '-edge', + overrides: function (detail) { + var action = detail.model.manager.edgeActions[name]; + return action.fold(function () { + return {}; + }, function (a) { + return { + events: derive([ + runActionExtra(touchstart(), function (comp, se, d) { + return a(comp, d); + }, [detail]), + runActionExtra(mousedown(), function (comp, se, d) { + return a(comp, d); + }, [detail]), + runActionExtra(mousemove(), function (comp, se, det) { + if (det.mouseIsDown.get()) { + a(comp, det); + } + }, [detail]) + ]) + }; + }); + } + }); + }; + var tlEdgePart = edgePart('top-left'); + var tedgePart = edgePart('top'); + var trEdgePart = edgePart('top-right'); + var redgePart = edgePart('right'); + var brEdgePart = edgePart('bottom-right'); + var bedgePart = edgePart('bottom'); + var blEdgePart = edgePart('bottom-left'); + var ledgePart = edgePart('left'); + var thumbPart = required({ + name: 'thumb', + defaults: constant({ dom: { styles: { position: 'absolute' } } }), + overrides: function (detail) { + return { + events: derive([ + redirectToPart(touchstart(), detail, 'spectrum'), + redirectToPart(touchmove(), detail, 'spectrum'), + redirectToPart(touchend(), detail, 'spectrum'), + redirectToPart(mousedown(), detail, 'spectrum'), + redirectToPart(mousemove(), detail, 'spectrum'), + redirectToPart(mouseup(), detail, 'spectrum') + ]) + }; + } + }); + var spectrumPart = required({ + schema: [state$1('mouseIsDown', function () { + return Cell(false); + })], + name: 'spectrum', + overrides: function (detail) { + var modelDetail = detail.model; + var model = modelDetail.manager; + var setValueFrom = function (component, simulatedEvent) { + return model.getValueFromEvent(simulatedEvent).map(function (value) { + return model.setValueFrom(component, detail, value); + }); + }; + return { + behaviours: derive$1([ + Keying.config({ + mode: 'special', + onLeft: function (spectrum) { + return model.onLeft(spectrum, detail); + }, + onRight: function (spectrum) { + return model.onRight(spectrum, detail); + }, + onUp: function (spectrum) { + return model.onUp(spectrum, detail); + }, + onDown: function (spectrum) { + return model.onDown(spectrum, detail); + } + }), + Focusing.config({}) + ]), + events: derive([ + run(touchstart(), setValueFrom), + run(touchmove(), setValueFrom), + run(mousedown(), setValueFrom), + run(mousemove(), function (spectrum, se) { + if (detail.mouseIsDown.get()) { + setValueFrom(spectrum, se); + } + }) + ]) + }; + } + }); + var SliderParts = [ + labelPart, + ledgePart, + redgePart, + tedgePart, + bedgePart, + tlEdgePart, + trEdgePart, + blEdgePart, + brEdgePart, + thumbPart, + spectrumPart + ]; + + var onLoad$1 = function (component, repConfig, repState) { + repConfig.store.manager.onLoad(component, repConfig, repState); + }; + var onUnload = function (component, repConfig, repState) { + repConfig.store.manager.onUnload(component, repConfig, repState); + }; + var setValue = function (component, repConfig, repState, data) { + repConfig.store.manager.setValue(component, repConfig, repState, data); + }; + var getValue = function (component, repConfig, repState) { + return repConfig.store.manager.getValue(component, repConfig, repState); + }; + var getState = function (component, repConfig, repState) { + return repState; + }; + + var RepresentApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + onLoad: onLoad$1, + onUnload: onUnload, + setValue: setValue, + getValue: getValue, + getState: getState + }); + + var events$5 = function (repConfig, repState) { + var es = repConfig.resetOnDom ? [ + runOnAttached(function (comp, se) { + onLoad$1(comp, repConfig, repState); + }), + runOnDetached(function (comp, se) { + onUnload(comp, repConfig, repState); + }) + ] : [loadEvent(repConfig, repState, onLoad$1)]; + return derive(es); + }; + + var ActiveRepresenting = /*#__PURE__*/Object.freeze({ + __proto__: null, + events: events$5 + }); + + var memory = function () { + var data = Cell(null); + var readState = function () { + return { + mode: 'memory', + value: data.get() + }; + }; + var isNotSet = function () { + return data.get() === null; + }; + var clear = function () { + data.set(null); + }; + return nu$6({ + set: data.set, + get: data.get, + isNotSet: isNotSet, + clear: clear, + readState: readState + }); + }; + var manual = function () { + var readState = function () { + }; + return nu$6({ readState: readState }); + }; + var dataset = function () { + var dataByValue = Cell({}); + var dataByText = Cell({}); + var readState = function () { + return { + mode: 'dataset', + dataByValue: dataByValue.get(), + dataByText: dataByText.get() + }; + }; + var clear = function () { + dataByValue.set({}); + dataByText.set({}); + }; + var lookup = function (itemString) { + return get(dataByValue.get(), itemString).orThunk(function () { + return get(dataByText.get(), itemString); + }); + }; + var update = function (items) { + var currentDataByValue = dataByValue.get(); + var currentDataByText = dataByText.get(); + var newDataByValue = {}; + var newDataByText = {}; + each$1(items, function (item) { + newDataByValue[item.value] = item; + get(item, 'meta').each(function (meta) { + get(meta, 'text').each(function (text) { + newDataByText[text] = item; + }); + }); + }); + dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue)); + dataByText.set(__assign(__assign({}, currentDataByText), newDataByText)); + }; + return nu$6({ + readState: readState, + lookup: lookup, + update: update, + clear: clear + }); + }; + var init$1 = function (spec) { + return spec.store.manager.state(spec); + }; + + var RepresentState = /*#__PURE__*/Object.freeze({ + __proto__: null, + memory: memory, + dataset: dataset, + manual: manual, + init: init$1 + }); + + var setValue$1 = function (component, repConfig, repState, data) { + var store = repConfig.store; + repState.update([data]); + store.setValue(component, data); + repConfig.onSetValue(component, data); + }; + var getValue$1 = function (component, repConfig, repState) { + var store = repConfig.store; + var key = store.getDataKey(component); + return repState.lookup(key).fold(function () { + return store.getFallbackEntry(key); + }, function (data) { + return data; + }); + }; + var onLoad$2 = function (component, repConfig, repState) { + var store = repConfig.store; + store.initialValue.each(function (data) { + setValue$1(component, repConfig, repState, data); + }); + }; + var onUnload$1 = function (component, repConfig, repState) { + repState.clear(); + }; + var DatasetStore = [ + option('initialValue'), + strict$1('getFallbackEntry'), + strict$1('getDataKey'), + strict$1('setValue'), + output('manager', { + setValue: setValue$1, + getValue: getValue$1, + onLoad: onLoad$2, + onUnload: onUnload$1, + state: dataset + }) + ]; + + var getValue$2 = function (component, repConfig, repState) { + return repConfig.store.getValue(component); + }; + var setValue$2 = function (component, repConfig, repState, data) { + repConfig.store.setValue(component, data); + repConfig.onSetValue(component, data); + }; + var onLoad$3 = function (component, repConfig, repState) { + repConfig.store.initialValue.each(function (data) { + repConfig.store.setValue(component, data); + }); + }; + var ManualStore = [ + strict$1('getValue'), + defaulted$1('setValue', noop), + option('initialValue'), + output('manager', { + setValue: setValue$2, + getValue: getValue$2, + onLoad: onLoad$3, + onUnload: noop, + state: NoState.init + }) + ]; + + var setValue$3 = function (component, repConfig, repState, data) { + repState.set(data); + repConfig.onSetValue(component, data); + }; + var getValue$3 = function (component, repConfig, repState) { + return repState.get(); + }; + var onLoad$4 = function (component, repConfig, repState) { + repConfig.store.initialValue.each(function (initVal) { + if (repState.isNotSet()) { + repState.set(initVal); + } + }); + }; + var onUnload$2 = function (component, repConfig, repState) { + repState.clear(); + }; + var MemoryStore = [ + option('initialValue'), + output('manager', { + setValue: setValue$3, + getValue: getValue$3, + onLoad: onLoad$4, + onUnload: onUnload$2, + state: memory + }) + ]; + + var RepresentSchema = [ + defaultedOf('store', { mode: 'memory' }, choose$1('mode', { + memory: MemoryStore, + manual: ManualStore, + dataset: DatasetStore + })), + onHandler('onSetValue'), + defaulted$1('resetOnDom', false) + ]; + + var Representing = create$1({ + fields: RepresentSchema, + name: 'representing', + active: ActiveRepresenting, + apis: RepresentApis, + extra: { + setValueFrom: function (component, source) { + var value = Representing.getValue(source); + Representing.setValue(component, value); + } + }, + state: RepresentState + }); + + var api$1 = Dimension('width', function (element) { + return element.dom().offsetWidth; + }); + var set$4 = function (element, h) { + api$1.set(element, h); + }; + var get$7 = function (element) { + return api$1.get(element); + }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: constant(left), + top: constant(top), + translate: translate + }; + }; + var Position = r; + + var _sliderChangeEvent = 'slider.change.value'; + var sliderChangeEvent = constant(_sliderChangeEvent); + var isTouchEvent = function (evt) { + return evt.type.indexOf('touch') !== -1; + }; + var getEventSource = function (simulatedEvent) { + var evt = simulatedEvent.event().raw(); + if (isTouchEvent(evt)) { + var touchEvent = evt; + return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Option.some(touchEvent.touches[0]).map(function (t) { + return Position(t.clientX, t.clientY); + }) : Option.none(); + } else { + var mouseEvent = evt; + return mouseEvent.clientX !== undefined ? Option.some(mouseEvent).map(function (me) { + return Position(me.clientX, me.clientY); + }) : Option.none(); + } + }; + + var t = 'top', r$1 = 'right', b = 'bottom', l = 'left'; + var minX = function (detail) { + return detail.model.minX; + }; + var minY = function (detail) { + return detail.model.minY; + }; + var min1X = function (detail) { + return detail.model.minX - 1; + }; + var min1Y = function (detail) { + return detail.model.minY - 1; + }; + var maxX = function (detail) { + return detail.model.maxX; + }; + var maxY = function (detail) { + return detail.model.maxY; + }; + var max1X = function (detail) { + return detail.model.maxX + 1; + }; + var max1Y = function (detail) { + return detail.model.maxY + 1; + }; + var range = function (detail, max, min) { + return max(detail) - min(detail); + }; + var xRange = function (detail) { + return range(detail, maxX, minX); + }; + var yRange = function (detail) { + return range(detail, maxY, minY); + }; + var halfX = function (detail) { + return xRange(detail) / 2; + }; + var halfY = function (detail) { + return yRange(detail) / 2; + }; + var step = function (detail) { + return detail.stepSize; + }; + var snap = function (detail) { + return detail.snapToGrid; + }; + var snapStart = function (detail) { + return detail.snapStart; + }; + var rounded = function (detail) { + return detail.rounded; + }; + var hasEdge = function (detail, edgeName) { + return detail[edgeName + '-edge'] !== undefined; + }; + var hasLEdge = function (detail) { + return hasEdge(detail, l); + }; + var hasREdge = function (detail) { + return hasEdge(detail, r$1); + }; + var hasTEdge = function (detail) { + return hasEdge(detail, t); + }; + var hasBEdge = function (detail) { + return hasEdge(detail, b); + }; + var currentValue = function (detail) { + return detail.model.value.get(); + }; + + var xValue = function (x) { + return { x: constant(x) }; + }; + var yValue = function (y) { + return { y: constant(y) }; + }; + var xyValue = function (x, y) { + return { + x: constant(x), + y: constant(y) + }; + }; + var fireSliderChange = function (component, value) { + emitWith(component, sliderChangeEvent(), { value: value }); + }; + var setToTLEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail))); + }; + var setToTEdge = function (edge, detail) { + fireSliderChange(edge, yValue(min1Y(detail))); + }; + var setToTEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail))); + }; + var setToTREdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail))); + }; + var setToREdge = function (edge, detail) { + fireSliderChange(edge, xValue(max1X(detail))); + }; + var setToREdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(max1X(detail), halfY(detail))); + }; + var setToBREdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail))); + }; + var setToBEdge = function (edge, detail) { + fireSliderChange(edge, yValue(max1Y(detail))); + }; + var setToBEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail))); + }; + var setToBLEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail))); + }; + var setToLEdge = function (edge, detail) { + fireSliderChange(edge, xValue(min1X(detail))); + }; + var setToLEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(min1X(detail), halfY(detail))); + }; + + var reduceBy = function (value, min, max, step) { + if (value < min) { + return value; + } else if (value > max) { + return max; + } else if (value === min) { + return min - 1; + } else { + return Math.max(min, value - step); + } + }; + var increaseBy = function (value, min, max, step) { + if (value > max) { + return value; + } else if (value < min) { + return min; + } else if (value === max) { + return max + 1; + } else { + return Math.min(max, value + step); + } + }; + var capValue = function (value, min, max) { + return Math.max(min, Math.min(max, value)); + }; + var snapValueOf = function (value, min, max, step, snapStart) { + return snapStart.fold(function () { + var initValue = value - min; + var extraValue = Math.round(initValue / step) * step; + return capValue(min + extraValue, min - 1, max + 1); + }, function (start) { + var remainder = (value - start) % step; + var adjustment = Math.round(remainder / step); + var rawSteps = Math.floor((value - start) / step); + var maxSteps = Math.floor((max - start) / step); + var numSteps = Math.min(maxSteps, rawSteps + adjustment); + var r = start + numSteps * step; + return Math.max(start, r); + }); + }; + var findOffsetOf = function (value, min, max) { + return Math.min(max, Math.max(value, min)) - min; + }; + var findValueOf = function (args) { + var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, screenRange = args.screenRange; + var capMin = hasMinEdge ? min - 1 : min; + var capMax = hasMaxEdge ? max + 1 : max; + if (value < minBound) { + return capMin; + } else if (value > maxBound) { + return capMax; + } else { + var offset = findOffsetOf(value, minBound, maxBound); + var newValue = capValue(offset / screenRange * range + min, capMin, capMax); + if (snap && newValue >= min && newValue <= max) { + return snapValueOf(newValue, min, max, step, snapStart); + } else if (rounded) { + return Math.round(newValue); + } else { + return newValue; + } + } + }; + var findOffsetOfValue = function (args) { + var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge; + if (value < min) { + return hasMinEdge ? 0 : centerMinEdge; + } else if (value > max) { + return hasMaxEdge ? maxBound : centerMaxEdge; + } else { + return (value - min) / range * maxOffset; + } + }; + + var top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height'; + var getBounds = function (component) { + return component.element().dom().getBoundingClientRect(); + }; + var getBoundsProperty = function (bounds, property) { + return bounds[property]; + }; + var getMinXBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, left); + }; + var getMaxXBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, right); + }; + var getMinYBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, top); + }; + var getMaxYBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, bottom); + }; + var getXScreenRange = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, width); + }; + var getYScreenRange = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, height); + }; + var getCenterOffsetOf = function (componentMinEdge, componentMaxEdge, spectrumMinEdge) { + return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; + }; + var getXCenterOffSetOf = function (component, spectrum) { + var componentBounds = getBounds(component); + var spectrumBounds = getBounds(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, left); + var componentMaxEdge = getBoundsProperty(componentBounds, right); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, left); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + }; + var getYCenterOffSetOf = function (component, spectrum) { + var componentBounds = getBounds(component); + var spectrumBounds = getBounds(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, top); + var componentMaxEdge = getBoundsProperty(componentBounds, bottom); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, top); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + }; + + var fireSliderChange$1 = function (spectrum, value) { + emitWith(spectrum, sliderChangeEvent(), { value: value }); + }; + var sliderValue = function (x) { + return { x: constant(x) }; + }; + var findValueOfOffset = function (spectrum, detail, left) { + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: left, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + maxBound: getMaxXBounds(spectrum), + screenRange: getXScreenRange(spectrum) + }; + return findValueOf(args); + }; + var setValueFrom = function (spectrum, detail, value) { + var xValue = findValueOfOffset(spectrum, detail, value); + var sliderVal = sliderValue(xValue); + fireSliderChange$1(spectrum, sliderVal); + return xValue; + }; + var setToMin = function (spectrum, detail) { + var min = minX(detail); + fireSliderChange$1(spectrum, sliderValue(min)); + }; + var setToMax = function (spectrum, detail) { + var max = maxX(detail); + fireSliderChange$1(spectrum, sliderValue(max)); + }; + var moveBy = function (direction, spectrum, detail) { + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail)); + fireSliderChange$1(spectrum, sliderValue(xValue)); + return Option.some(xValue); + }; + var handleMovement = function (direction) { + return function (spectrum, detail) { + return moveBy(direction, spectrum, detail).map(function () { + return true; + }); + }; + }; + var getValueFromEvent = function (simulatedEvent) { + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.left(); + }); + }; + var findOffsetOfValue$1 = function (spectrum, detail, value, minEdge, maxEdge) { + var minOffset = 0; + var maxOffset = getXScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Option.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Option.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: value, + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxXBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); + }; + var findPositionOfValue = function (slider, spectrum, value, minEdge, maxEdge, detail) { + var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge); + return getMinXBounds(spectrum) - getMinXBounds(slider) + offset; + }; + var setPositionFromValue = function (slider, thumb, detail, edges) { + var value = currentValue(detail); + var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var thumbRadius = get$7(thumb.element()) / 2; + set$3(thumb.element(), 'left', pos - thumbRadius + 'px'); + }; + var onLeft = handleMovement(-1); + var onRight = handleMovement(1); + var onUp = Option.none; + var onDown = Option.none; + var edgeActions = { + 'top-left': Option.none(), + 'top': Option.none(), + 'top-right': Option.none(), + 'right': Option.some(setToREdge), + 'bottom-right': Option.none(), + 'bottom': Option.none(), + 'bottom-left': Option.none(), + 'left': Option.some(setToLEdge) + }; + + var HorizontalModel = /*#__PURE__*/Object.freeze({ + __proto__: null, + setValueFrom: setValueFrom, + setToMin: setToMin, + setToMax: setToMax, + findValueOfOffset: findValueOfOffset, + getValueFromEvent: getValueFromEvent, + findPositionOfValue: findPositionOfValue, + setPositionFromValue: setPositionFromValue, + onLeft: onLeft, + onRight: onRight, + onUp: onUp, + onDown: onDown, + edgeActions: edgeActions + }); + + var fireSliderChange$2 = function (spectrum, value) { + emitWith(spectrum, sliderChangeEvent(), { value: value }); + }; + var sliderValue$1 = function (y) { + return { y: constant(y) }; + }; + var findValueOfOffset$1 = function (spectrum, detail, top) { + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: top, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + maxBound: getMaxYBounds(spectrum), + screenRange: getYScreenRange(spectrum) + }; + return findValueOf(args); + }; + var setValueFrom$1 = function (spectrum, detail, value) { + var yValue = findValueOfOffset$1(spectrum, detail, value); + var sliderVal = sliderValue$1(yValue); + fireSliderChange$2(spectrum, sliderVal); + return yValue; + }; + var setToMin$1 = function (spectrum, detail) { + var min = minY(detail); + fireSliderChange$2(spectrum, sliderValue$1(min)); + }; + var setToMax$1 = function (spectrum, detail) { + var max = maxY(detail); + fireSliderChange$2(spectrum, sliderValue$1(max)); + }; + var moveBy$1 = function (direction, spectrum, detail) { + var f = direction > 0 ? increaseBy : reduceBy; + var yValue = f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail)); + fireSliderChange$2(spectrum, sliderValue$1(yValue)); + return Option.some(yValue); + }; + var handleMovement$1 = function (direction) { + return function (spectrum, detail) { + return moveBy$1(direction, spectrum, detail).map(function () { + return true; + }); + }; + }; + var getValueFromEvent$1 = function (simulatedEvent) { + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.top(); + }); + }; + var findOffsetOfValue$2 = function (spectrum, detail, value, minEdge, maxEdge) { + var minOffset = 0; + var maxOffset = getYScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Option.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Option.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: value, + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxYBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); + }; + var findPositionOfValue$1 = function (slider, spectrum, value, minEdge, maxEdge, detail) { + var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge); + return getMinYBounds(spectrum) - getMinYBounds(slider) + offset; + }; + var setPositionFromValue$1 = function (slider, thumb, detail, edges) { + var value = currentValue(detail); + var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbRadius = get$5(thumb.element()) / 2; + set$3(thumb.element(), 'top', pos - thumbRadius + 'px'); + }; + var onLeft$1 = Option.none; + var onRight$1 = Option.none; + var onUp$1 = handleMovement$1(-1); + var onDown$1 = handleMovement$1(1); + var edgeActions$1 = { + 'top-left': Option.none(), + 'top': Option.some(setToTEdge), + 'top-right': Option.none(), + 'right': Option.none(), + 'bottom-right': Option.none(), + 'bottom': Option.some(setToBEdge), + 'bottom-left': Option.none(), + 'left': Option.none() + }; + + var VerticalModel = /*#__PURE__*/Object.freeze({ + __proto__: null, + setValueFrom: setValueFrom$1, + setToMin: setToMin$1, + setToMax: setToMax$1, + findValueOfOffset: findValueOfOffset$1, + getValueFromEvent: getValueFromEvent$1, + findPositionOfValue: findPositionOfValue$1, + setPositionFromValue: setPositionFromValue$1, + onLeft: onLeft$1, + onRight: onRight$1, + onUp: onUp$1, + onDown: onDown$1, + edgeActions: edgeActions$1 + }); + + var fireSliderChange$3 = function (spectrum, value) { + emitWith(spectrum, sliderChangeEvent(), { value: value }); + }; + var sliderValue$2 = function (x, y) { + return { + x: constant(x), + y: constant(y) + }; + }; + var setValueFrom$2 = function (spectrum, detail, value) { + var xValue = findValueOfOffset(spectrum, detail, value.left()); + var yValue = findValueOfOffset$1(spectrum, detail, value.top()); + var val = sliderValue$2(xValue, yValue); + fireSliderChange$3(spectrum, val); + return val; + }; + var moveBy$2 = function (direction, isVerticalMovement, spectrum, detail) { + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = isVerticalMovement ? currentValue(detail).x() : f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail)); + var yValue = !isVerticalMovement ? currentValue(detail).y() : f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail)); + fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue)); + return Option.some(xValue); + }; + var handleMovement$2 = function (direction, isVerticalMovement) { + return function (spectrum, detail) { + return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () { + return true; + }); + }; + }; + var setToMin$2 = function (spectrum, detail) { + var mX = minX(detail); + var mY = minY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + }; + var setToMax$2 = function (spectrum, detail) { + var mX = maxX(detail); + var mY = maxY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + }; + var getValueFromEvent$2 = function (simulatedEvent) { + return getEventSource(simulatedEvent); + }; + var setPositionFromValue$2 = function (slider, thumb, detail, edges) { + var value = currentValue(detail); + var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbXRadius = get$7(thumb.element()) / 2; + var thumbYRadius = get$5(thumb.element()) / 2; + set$3(thumb.element(), 'left', xPos - thumbXRadius + 'px'); + set$3(thumb.element(), 'top', yPos - thumbYRadius + 'px'); + }; + var onLeft$2 = handleMovement$2(-1, false); + var onRight$2 = handleMovement$2(1, false); + var onUp$2 = handleMovement$2(-1, true); + var onDown$2 = handleMovement$2(1, true); + var edgeActions$2 = { + 'top-left': Option.some(setToTLEdgeXY), + 'top': Option.some(setToTEdgeXY), + 'top-right': Option.some(setToTREdgeXY), + 'right': Option.some(setToREdgeXY), + 'bottom-right': Option.some(setToBREdgeXY), + 'bottom': Option.some(setToBEdgeXY), + 'bottom-left': Option.some(setToBLEdgeXY), + 'left': Option.some(setToLEdgeXY) + }; + + var TwoDModel = /*#__PURE__*/Object.freeze({ + __proto__: null, + setValueFrom: setValueFrom$2, + setToMin: setToMin$2, + setToMax: setToMax$2, + getValueFromEvent: getValueFromEvent$2, + setPositionFromValue: setPositionFromValue$2, + onLeft: onLeft$2, + onRight: onRight$2, + onUp: onUp$2, + onDown: onDown$2, + edgeActions: edgeActions$2 + }); + + var SliderSchema = [ + defaulted$1('stepSize', 1), + defaulted$1('onChange', noop), + defaulted$1('onChoose', noop), + defaulted$1('onInit', noop), + defaulted$1('onDragStart', noop), + defaulted$1('onDragEnd', noop), + defaulted$1('snapToGrid', false), + defaulted$1('rounded', true), + option('snapStart'), + strictOf('model', choose$1('mode', { + x: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minX); + }), + strict$1('getInitialValue'), + output('manager', HorizontalModel) + ], + y: [ + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minY); + }), + strict$1('getInitialValue'), + output('manager', VerticalModel) + ], + xy: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell({ + x: constant(spec.mode.minX), + y: constant(spec.mode.minY) + }); + }), + strict$1('getInitialValue'), + output('manager', TwoDModel) + ] + })), + field$1('sliderBehaviours', [ + Keying, + Representing + ]), + state$1('mouseIsDown', function () { + return Cell(false); + }) + ]; + + var mouseReleased = constant('mouse.released'); + + var sketch = function (detail, components, _spec, _externals) { + var _a; + var getThumb = function (component) { + return getPartOrDie(component, detail, 'thumb'); + }; + var getSpectrum = function (component) { + return getPartOrDie(component, detail, 'spectrum'); + }; + var getLeftEdge = function (component) { + return getPart(component, detail, 'left-edge'); + }; + var getRightEdge = function (component) { + return getPart(component, detail, 'right-edge'); + }; + var getTopEdge = function (component) { + return getPart(component, detail, 'top-edge'); + }; + var getBottomEdge = function (component) { + return getPart(component, detail, 'bottom-edge'); + }; + var modelDetail = detail.model; + var model = modelDetail.manager; + var refresh = function (slider, thumb) { + model.setPositionFromValue(slider, thumb, detail, { + getLeftEdge: getLeftEdge, + getRightEdge: getRightEdge, + getTopEdge: getTopEdge, + getBottomEdge: getBottomEdge, + getSpectrum: getSpectrum + }); + }; + var changeValue = function (slider, newValue) { + modelDetail.value.set(newValue); + var thumb = getThumb(slider); + refresh(slider, thumb); + detail.onChange(slider, thumb, newValue); + return Option.some(true); + }; + var resetToMin = function (slider) { + model.setToMin(slider, detail); + }; + var resetToMax = function (slider) { + model.setToMax(slider, detail); + }; + var choose = function (slider) { + var fireOnChoose = function () { + getPart(slider, detail, 'thumb').each(function (thumb) { + var value = modelDetail.value.get(); + detail.onChoose(slider, thumb, value); + }); + }; + var wasDown = detail.mouseIsDown.get(); + detail.mouseIsDown.set(false); + if (wasDown) { + fireOnChoose(); + } + }; + var onDragStart = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.mouseIsDown.set(true); + detail.onDragStart(slider, getThumb(slider)); + }; + var onDragEnd = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.onDragEnd(slider, getThumb(slider)); + choose(slider); + }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.sliderBehaviours, [ + Keying.config({ + mode: 'special', + focusIn: function (slider) { + return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(constant(true)); + } + }), + Representing.config({ + store: { + mode: 'manual', + getValue: function (_) { + return modelDetail.value.get(); + } + } + }), + Receiving.config({ channels: (_a = {}, _a[mouseReleased()] = { onReceive: choose }, _a) }) + ]), + events: derive([ + run(sliderChangeEvent(), function (slider, simulatedEvent) { + changeValue(slider, simulatedEvent.event().value()); + }), + runOnAttached(function (slider, simulatedEvent) { + var getInitial = modelDetail.getInitialValue(); + modelDetail.value.set(getInitial); + var thumb = getThumb(slider); + refresh(slider, thumb); + var spectrum = getSpectrum(slider); + detail.onInit(slider, thumb, spectrum, modelDetail.value.get()); + }), + run(touchstart(), onDragStart), + run(touchend(), onDragEnd), + run(mousedown(), onDragStart), + run(mouseup(), onDragEnd) + ]), + apis: { + resetToMin: resetToMin, + resetToMax: resetToMax, + changeValue: changeValue, + refresh: refresh + }, + domModification: { styles: { position: 'relative' } } + }; + }; + + var Slider = composite$1({ + name: 'Slider', + configFields: SliderSchema, + partFields: SliderParts, + factory: sketch, + apis: { + resetToMin: function (apis, slider) { + apis.resetToMin(slider); + }, + resetToMax: function (apis, slider) { + apis.resetToMax(slider); + }, + refresh: function (apis, slider) { + apis.refresh(slider); + } + } + }); + + var button = function (realm, clazz, makeItems, editor) { + return Buttons.forToolbar(clazz, function () { + var items = makeItems(); + realm.setContextToolbar([{ + label: clazz + ' group', + items: items + }]); + }, {}, editor); + }; + + var BLACK = -1; + var makeSlider = function (spec$1) { + var getColor = function (hue) { + if (hue < 0) { + return 'black'; + } else if (hue > 360) { + return 'white'; + } else { + return 'hsl(' + hue + ', 100%, 50%)'; + } + }; + var onInit = function (slider, thumb, spectrum, value) { + var color = getColor(value.x()); + set$3(thumb.element(), 'background-color', color); + }; + var onChange = function (slider, thumb, value) { + var color = getColor(value.x()); + set$3(thumb.element(), 'background-color', color); + spec$1.onChange(slider, thumb, color); + }; + return Slider.sketch({ + dom: dom$1('
    '), + components: [ + Slider.parts()['left-edge'](spec('
    ')), + Slider.parts().spectrum({ + dom: dom$1('
    '), + components: [spec('
    ')], + behaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('thumb-active') })]) + }), + Slider.parts()['right-edge'](spec('
    ')), + Slider.parts().thumb({ + dom: dom$1('
    '), + behaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('thumb-active') })]) + }) + ], + onChange: onChange, + onDragStart: function (slider, thumb) { + Toggling.on(thumb); + }, + onDragEnd: function (slider, thumb) { + Toggling.off(thumb); + }, + onInit: onInit, + stepSize: 10, + model: { + mode: 'x', + minX: 0, + maxX: 360, + getInitialValue: function () { + return { + x: function () { + return spec$1.getInitialValue(); + } + }; + } + }, + sliderBehaviours: derive$1([Receivers.orientation(Slider.refresh)]) + }); + }; + var makeItems = function (spec) { + return [makeSlider(spec)]; + }; + var sketch$1 = function (realm, editor) { + var spec = { + onChange: function (slider, thumb, color) { + editor.undoManager.transact(function () { + editor.formatter.apply('forecolor', { value: color }); + editor.nodeChanged(); + }); + }, + getInitialValue: function () { + return BLACK; + } + }; + return button(realm, 'color-levels', function () { + return makeItems(spec); + }, editor); + }; + var ColorSlider = { + makeItems: makeItems, + sketch: sketch$1 + }; + + var schema$7 = objOfOnly([ + strict$1('getInitialValue'), + strict$1('onChange'), + strict$1('category'), + strict$1('sizes') + ]); + var sketch$2 = function (rawSpec) { + var spec$1 = asRawOrDie('SizeSlider', schema$7, rawSpec); + var isValidValue = function (valueIndex) { + return valueIndex >= 0 && valueIndex < spec$1.sizes.length; + }; + var onChange = function (slider, thumb, valueIndex) { + var index = valueIndex.x(); + if (isValidValue(index)) { + spec$1.onChange(index); + } + }; + return Slider.sketch({ + dom: { + tag: 'div', + classes: [ + Styles.resolve('slider-' + spec$1.category + '-size-container'), + Styles.resolve('slider'), + Styles.resolve('slider-size-container') + ] + }, + onChange: onChange, + onDragStart: function (slider, thumb) { + Toggling.on(thumb); + }, + onDragEnd: function (slider, thumb) { + Toggling.off(thumb); + }, + model: { + mode: 'x', + minX: 0, + maxX: spec$1.sizes.length - 1, + getInitialValue: function () { + return { + x: function () { + return spec$1.getInitialValue(); + } + }; + } + }, + stepSize: 1, + snapToGrid: true, + sliderBehaviours: derive$1([Receivers.orientation(Slider.refresh)]), + components: [ + Slider.parts().spectrum({ + dom: dom$1('
    '), + components: [spec('
    ')] + }), + Slider.parts().thumb({ + dom: dom$1('
    '), + behaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('thumb-active') })]) + }) + ] + }); + }; + var SizeSlider = { sketch: sketch$2 }; + + var candidates = [ + '9px', + '10px', + '11px', + '12px', + '14px', + '16px', + '18px', + '20px', + '24px', + '32px', + '36px' + ]; + var defaultSize = 'medium'; + var defaultIndex = 2; + var indexToSize = function (index) { + return Option.from(candidates[index]); + }; + var sizeToIndex = function (size) { + return findIndex(candidates, function (v) { + return v === size; + }); + }; + var getRawOrComputed = function (isRoot, rawStart) { + var optStart = isElement(rawStart) ? Option.some(rawStart) : parent(rawStart).filter(isElement); + return optStart.map(function (start) { + var inline = closest$1(start, function (elem) { + return getRaw(elem, 'font-size').isSome(); + }, isRoot).bind(function (elem) { + return getRaw(elem, 'font-size'); + }); + return inline.getOrThunk(function () { + return get$4(start, 'font-size'); + }); + }).getOr(''); + }; + var getSize = function (editor) { + var node = editor.selection.getStart(); + var elem = Element.fromDom(node); + var root = Element.fromDom(editor.getBody()); + var isRoot = function (e) { + return eq(root, e); + }; + var elemSize = getRawOrComputed(isRoot, elem); + return find$2(candidates, function (size) { + return elemSize === size; + }).getOr(defaultSize); + }; + var applySize = function (editor, value) { + var currentValue = getSize(editor); + if (currentValue !== value) { + editor.execCommand('fontSize', false, value); + } + }; + var get$8 = function (editor) { + var size = getSize(editor); + return sizeToIndex(size).getOr(defaultIndex); + }; + var apply$1 = function (editor, index) { + indexToSize(index).each(function (size) { + applySize(editor, size); + }); + }; + var FontSizes = { + candidates: constant(candidates), + get: get$8, + apply: apply$1 + }; + + var sizes = FontSizes.candidates(); + var makeSlider$1 = function (spec) { + return SizeSlider.sketch({ + onChange: spec.onChange, + sizes: sizes, + category: 'font', + getInitialValue: spec.getInitialValue + }); + }; + var makeItems$1 = function (spec$1) { + return [ + spec(''), + makeSlider$1(spec$1), + spec('') + ]; + }; + var sketch$3 = function (realm, editor) { + var spec = { + onChange: function (value) { + FontSizes.apply(editor, value); + }, + getInitialValue: function () { + return FontSizes.get(editor); + } + }; + return button(realm, 'font-size', function () { + return makeItems$1(spec); + }, editor); + }; + + var record = function (spec) { + var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$3('memento'); + var get = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).getOrDie(); + }; + var getOpt = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).toOption(); + }; + var asSpec = function () { + return __assign(__assign({}, spec), { uid: uid }); + }; + return { + get: get, + getOpt: getOpt, + asSpec: asSpec + }; + }; + + var promise = function () { + var Promise = function (fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('not a function'); + } + this._state = null; + this._value = null; + this._deferreds = []; + doResolve(fn, bind(resolve, this), bind(reject, this)); + }; + var asap = Promise.immediateFn || typeof window.setImmediate === 'function' && window.setImmediate || function (fn) { + domGlobals.setTimeout(fn, 1); + }; + function bind(fn, thisArg) { + return function () { + return fn.apply(thisArg, arguments); + }; + } + var isArray = Array.isArray || function (value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + function handle(deferred) { + var me = this; + if (this._state === null) { + this._deferreds.push(deferred); + return; + } + asap(function () { + var cb = me._state ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (me._state ? deferred.resolve : deferred.reject)(me._value); + return; + } + var ret; + try { + ret = cb(me._value); + } catch (e) { + deferred.reject(e); + return; + } + deferred.resolve(ret); + }); + } + function resolve(newValue) { + try { + if (newValue === this) { + throw new TypeError('A promise cannot be resolved with itself.'); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (typeof then === 'function') { + doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); + return; + } + } + this._state = true; + this._value = newValue; + finale.call(this); + } catch (e) { + reject.call(this, e); + } + } + function reject(newValue) { + this._state = false; + this._value = newValue; + finale.call(this); + } + function finale() { + for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { + var deferred = _a[_i]; + handle.call(this, deferred); + } + this._deferreds = []; + } + function Handler(onFulfilled, onRejected, resolve, reject) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.resolve = resolve; + this.reject = reject; + } + function doResolve(fn, onFulfilled, onRejected) { + var done = false; + try { + fn(function (value) { + if (done) { + return; + } + done = true; + onFulfilled(value); + }, function (reason) { + if (done) { + return; + } + done = true; + onRejected(reason); + }); + } catch (ex) { + if (done) { + return; + } + done = true; + onRejected(ex); + } + } + Promise.prototype.catch = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var me = this; + return new Promise(function (resolve, reject) { + handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); + }); + }; + Promise.all = function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); + return new Promise(function (resolve, reject) { + if (args.length === 0) { + return resolve([]); + } + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + value.then(resolve, reject); + } + }); + }; + return Promise; + }; + var Promise = window.Promise ? window.Promise : promise(); + + function blobToDataUri(blob) { + return new Promise(function (resolve) { + var reader = new domGlobals.FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); + } + function blobToBase64(blob) { + return blobToDataUri(blob).then(function (dataUri) { + return dataUri.split(',')[1]; + }); + } + + var blobToBase64$1 = function (blob) { + return blobToBase64(blob); + }; + + var addImage = function (editor, blob) { + blobToBase64$1(blob).then(function (base64) { + editor.undoManager.transact(function () { + var cache = editor.editorUpload.blobCache; + var info = cache.create(generate$1('mceu'), blob, base64); + cache.add(info); + var img = editor.dom.createHTML('img', { src: info.blobUri() }); + editor.insertContent(img); + }); + }); + }; + var extractBlob = function (simulatedEvent) { + var event = simulatedEvent.event(); + var files = event.raw().target.files || event.raw().dataTransfer.files; + return Option.from(files[0]); + }; + var sketch$4 = function (editor) { + var pickerDom = { + tag: 'input', + attributes: { + accept: 'image/*', + type: 'file', + title: '' + }, + styles: { + visibility: 'hidden', + position: 'absolute' + } + }; + var memPicker = record({ + dom: pickerDom, + events: derive([ + cutter(click()), + run(change(), function (picker, simulatedEvent) { + extractBlob(simulatedEvent).each(function (blob) { + addImage(editor, blob); + }); + }) + ]) + }); + return Button.sketch({ + dom: Buttons.getToolbarIconButton('image', editor), + components: [memPicker.asSpec()], + action: function (button) { + var picker = memPicker.get(button); + picker.element().dom().click(); + } + }); + }; + + var get$9 = function (element) { + return element.dom().textContent; + }; + var set$5 = function (element, value) { + element.dom().textContent = value; + }; + + var isNotEmpty = function (val) { + return val.length > 0; + }; + var defaultToEmpty = function (str) { + return str === undefined || str === null ? '' : str; + }; + var noLink = function (editor) { + var text = editor.selection.getContent({ format: 'text' }); + return { + url: '', + text: text, + title: '', + target: '', + link: Option.none() + }; + }; + var fromLink = function (link) { + var text = get$9(link); + var url = get$1(link, 'href'); + var title = get$1(link, 'title'); + var target = get$1(link, 'target'); + return { + url: defaultToEmpty(url), + text: text !== url ? defaultToEmpty(text) : '', + title: defaultToEmpty(title), + target: defaultToEmpty(target), + link: Option.some(link) + }; + }; + var getInfo = function (editor) { + return query(editor).fold(function () { + return noLink(editor); + }, function (link) { + return fromLink(link); + }); + }; + var wasSimple = function (link) { + var prevHref = get$1(link, 'href'); + var prevText = get$9(link); + return prevHref === prevText; + }; + var getTextToApply = function (link, url, info) { + return info.text.toOption().filter(isNotEmpty).fold(function () { + return wasSimple(link) ? Option.some(url) : Option.none(); + }, Option.some); + }; + var unlinkIfRequired = function (editor, info) { + var activeLink = info.link.bind(identity); + activeLink.each(function (link) { + editor.execCommand('unlink'); + }); + }; + var getAttrs$1 = function (url, info) { + var attrs = {}; + attrs.href = url; + info.title.toOption().filter(isNotEmpty).each(function (title) { + attrs.title = title; + }); + info.target.toOption().filter(isNotEmpty).each(function (target) { + attrs.target = target; + }); + return attrs; + }; + var applyInfo = function (editor, info) { + info.url.toOption().filter(isNotEmpty).fold(function () { + unlinkIfRequired(editor, info); + }, function (url) { + var attrs = getAttrs$1(url, info); + var activeLink = info.link.bind(identity); + activeLink.fold(function () { + var text = info.text.toOption().filter(isNotEmpty).getOr(url); + editor.insertContent(editor.dom.createHTML('a', attrs, editor.dom.encode(text))); + }, function (link) { + var text = getTextToApply(link, url, info); + setAll(link, attrs); + text.each(function (newText) { + set$5(link, newText); + }); + }); + }); + }; + var query = function (editor) { + var start = Element.fromDom(editor.selection.getStart()); + return closest$2(start, 'a'); + }; + var LinkBridge = { + getInfo: getInfo, + applyInfo: applyInfo, + query: query + }; + + var platform$1 = detect$3(); + var preserve = function (f, editor) { + var rng = editor.selection.getRng(); + f(); + editor.selection.setRng(rng); + }; + var forAndroid = function (editor, f) { + var wrapper = platform$1.os.isAndroid() ? preserve : apply; + wrapper(f, editor); + }; + var RangePreserver = { forAndroid: forAndroid }; + + var events$6 = function (name, eventHandlers) { + var events = derive(eventHandlers); + return create$1({ + fields: [strict$1('enabled')], + name: name, + active: { events: constant(events) } + }); + }; + var config = function (name, eventHandlers) { + var me = events$6(name, eventHandlers); + return { + key: name, + value: { + config: {}, + me: me, + configAsRaw: constant({}), + initialConfig: {}, + state: NoState + } + }; + }; + + var getCurrent = function (component, composeConfig, composeState) { + return composeConfig.find(component); + }; + + var ComposeApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + getCurrent: getCurrent + }); + + var ComposeSchema = [strict$1('find')]; + + var Composing = create$1({ + fields: ComposeSchema, + name: 'composing', + apis: ComposeApis + }); + + var factory$1 = function (detail) { + var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']); + return { + uid: detail.uid, + dom: __assign({ + tag: 'div', + attributes: __assign({ role: 'presentation' }, attributes) + }, domWithoutAttributes), + components: detail.components, + behaviours: get$6(detail.containerBehaviours), + events: detail.events, + domModification: detail.domModification, + eventOrder: detail.eventOrder + }; + }; + var Container = single$2({ + name: 'Container', + factory: factory$1, + configFields: [ + defaulted$1('components', []), + field$1('containerBehaviours', []), + defaulted$1('events', {}), + defaulted$1('domModification', {}), + defaulted$1('eventOrder', {}) + ] + }); + + var factory$2 = function (detail) { + return { + uid: detail.uid, + dom: detail.dom, + behaviours: SketchBehaviours.augment(detail.dataBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.getInitialValue() + } + }), + Composing.config({ find: Option.some }) + ]), + events: derive([runOnAttached(function (component, simulatedEvent) { + Representing.setValue(component, detail.getInitialValue()); + })]) + }; + }; + var DataField = single$2({ + name: 'DataField', + factory: factory$2, + configFields: [ + strict$1('uid'), + strict$1('dom'), + strict$1('getInitialValue'), + SketchBehaviours.field('dataBehaviours', [ + Representing, + Composing + ]) + ] + }); + + var get$a = function (element) { + return element.dom().value; + }; + var set$6 = function (element, value) { + if (value === undefined) { + throw new Error('Value.set was undefined'); + } + element.dom().value = value; + }; + + var schema$8 = constant([ + option('data'), + defaulted$1('inputAttributes', {}), + defaulted$1('inputStyles', {}), + defaulted$1('tag', 'input'), + defaulted$1('inputClasses', []), + onHandler('onSetValue'), + defaulted$1('styles', {}), + defaulted$1('eventOrder', {}), + field$1('inputBehaviours', [ + Representing, + Focusing + ]), + defaulted$1('selectOnFocus', true) + ]); + var focusBehaviours = function (detail) { + return derive$1([Focusing.config({ + onFocus: !detail.selectOnFocus ? noop : function (component) { + var input = component.element(); + var value = get$a(input); + input.dom().setSelectionRange(0, value.length); + } + })]); + }; + var behaviours = function (detail) { + return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({ + store: __assign(__assign({ mode: 'manual' }, detail.data.map(function (data) { + return { initialValue: data }; + }).getOr({})), { + getValue: function (input) { + return get$a(input.element()); + }, + setValue: function (input, data) { + var current = get$a(input.element()); + if (current !== data) { + set$6(input.element(), data); + } + } + }), + onSetValue: detail.onSetValue + })])); + }; + var dom$2 = function (detail) { + return { + tag: detail.tag, + attributes: __assign({ type: 'text' }, detail.inputAttributes), + styles: detail.inputStyles, + classes: detail.inputClasses + }; + }; + + var factory$3 = function (detail, spec) { + return { + uid: detail.uid, + dom: dom$2(detail), + components: [], + behaviours: behaviours(detail), + eventOrder: detail.eventOrder + }; + }; + var Input = single$2({ + name: 'Input', + configFields: schema$8(), + factory: factory$3 + }); + + var exhibit$3 = function (base, tabConfig) { + return nu$5({ + attributes: wrapAll$1([{ + key: tabConfig.tabAttr, + value: 'true' + }]) + }); + }; + + var ActiveTabstopping = /*#__PURE__*/Object.freeze({ + __proto__: null, + exhibit: exhibit$3 + }); + + var TabstopSchema = [defaulted$1('tabAttr', 'data-alloy-tabstop')]; + + var Tabstopping = create$1({ + fields: TabstopSchema, + name: 'tabstopping', + active: ActiveTabstopping + }); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n'); + + var clearInputBehaviour = 'input-clearing'; + var field$2 = function (name, placeholder) { + var inputSpec = record(Input.sketch({ + inputAttributes: { placeholder: global$3.translate(placeholder) }, + onSetValue: function (input$1, data) { + emit(input$1, input()); + }, + inputBehaviours: derive$1([ + Composing.config({ find: Option.some }), + Tabstopping.config({}), + Keying.config({ mode: 'execution' }) + ]), + selectOnFocus: false + })); + var buttonSpec = record(Button.sketch({ + dom: dom$1(''), + action: function (button) { + var input = inputSpec.get(button); + Representing.setValue(input, ''); + } + })); + return { + name: name, + spec: Container.sketch({ + dom: dom$1('
    '), + components: [ + inputSpec.asSpec(), + buttonSpec.asSpec() + ], + containerBehaviours: derive$1([ + Toggling.config({ toggleClass: Styles.resolve('input-container-empty') }), + Composing.config({ + find: function (comp) { + return Option.some(inputSpec.get(comp)); + } + }), + config(clearInputBehaviour, [run(input(), function (iContainer) { + var input = inputSpec.get(iContainer); + var val = Representing.getValue(input); + var f = val.length > 0 ? Toggling.off : Toggling.on; + f(iContainer); + })]) + ]) + }) + }; + }; + var hidden = function (name) { + return { + name: name, + spec: DataField.sketch({ + dom: { + tag: 'span', + styles: { display: 'none' } + }, + getInitialValue: function () { + return Option.none(); + } + }) + }; + }; + + var nativeDisabled = [ + 'input', + 'button', + 'textarea', + 'select' + ]; + var onLoad$5 = function (component, disableConfig, disableState) { + if (disableConfig.disabled) { + disable(component, disableConfig); + } + }; + var hasNative = function (component, config) { + return config.useNative === true && contains(nativeDisabled, name(component.element())); + }; + var nativeIsDisabled = function (component) { + return has$1(component.element(), 'disabled'); + }; + var nativeDisable = function (component) { + set(component.element(), 'disabled', 'disabled'); + }; + var nativeEnable = function (component) { + remove$1(component.element(), 'disabled'); + }; + var ariaIsDisabled = function (component) { + return get$1(component.element(), 'aria-disabled') === 'true'; + }; + var ariaDisable = function (component) { + set(component.element(), 'aria-disabled', 'true'); + }; + var ariaEnable = function (component) { + set(component.element(), 'aria-disabled', 'false'); + }; + var disable = function (component, disableConfig, disableState) { + disableConfig.disableClass.each(function (disableClass) { + add$2(component.element(), disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable; + f(component); + disableConfig.onDisabled(component); + }; + var enable = function (component, disableConfig, disableState) { + disableConfig.disableClass.each(function (disableClass) { + remove$4(component.element(), disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable; + f(component); + disableConfig.onEnabled(component); + }; + var isDisabled = function (component, disableConfig) { + return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component); + }; + var set$7 = function (component, disableConfig, disableState, disabled) { + var f = disabled ? disable : enable; + f(component, disableConfig, disableState); + }; + + var DisableApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + enable: enable, + disable: disable, + isDisabled: isDisabled, + onLoad: onLoad$5, + set: set$7 + }); + + var exhibit$4 = function (base, disableConfig) { + return nu$5({ classes: disableConfig.disabled ? disableConfig.disableClass.map(pure).getOr([]) : [] }); + }; + var events$7 = function (disableConfig, disableState) { + return derive([ + abort(execute(), function (component, simulatedEvent) { + return isDisabled(component, disableConfig); + }), + loadEvent(disableConfig, disableState, onLoad$5) + ]); + }; + + var ActiveDisable = /*#__PURE__*/Object.freeze({ + __proto__: null, + exhibit: exhibit$4, + events: events$7 + }); + + var DisableSchema = [ + defaulted$1('disabled', false), + defaulted$1('useNative', true), + option('disableClass'), + onHandler('onDisabled'), + onHandler('onEnabled') + ]; + + var Disabling = create$1({ + fields: DisableSchema, + name: 'disabling', + active: ActiveDisable, + apis: DisableApis + }); + + var owner$1 = 'form'; + var schema$9 = [field$1('formBehaviours', [Representing])]; + var getPartName = function (name) { + return ''; + }; + var sketch$5 = function (fSpec) { + var parts = function () { + var record = []; + var field = function (name, config) { + record.push(name); + return generateOne(owner$1, getPartName(name), config); + }; + return { + field: field, + record: function () { + return record; + } + }; + }(); + var spec = fSpec(parts); + var partNames = parts.record(); + var fieldParts = map$1(partNames, function (n) { + return required({ + name: n, + pname: getPartName(n) + }); + }); + return composite(owner$1, schema$9, fieldParts, make, spec); + }; + var toResult$1 = function (o, e) { + return o.fold(function () { + return Result.error(e); + }, Result.value); + }; + var make = function (detail, components) { + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.formBehaviours, [Representing.config({ + store: { + mode: 'manual', + getValue: function (form) { + var resPs = getAllParts(form, detail); + return map(resPs, function (resPThunk, pName) { + return resPThunk().bind(function (v) { + var opt = Composing.getCurrent(v); + return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \'' + pName + '\': ' + element(v.element()))); + }).map(Representing.getValue); + }); + }, + setValue: function (form, values) { + each(values, function (newValue, key) { + getPart(form, detail, key).each(function (wrapper) { + Composing.getCurrent(wrapper).each(function (field) { + Representing.setValue(field, newValue); + }); + }); + }); + } + } + })]), + apis: { + getField: function (form, key) { + return getPart(form, detail, key).bind(Composing.getCurrent); + } + } + }; + }; + var Form = { + getField: makeApi(function (apis, component, key) { + return apis.getField(component, key); + }), + sketch: sketch$5 + }; + + var api$2 = function () { + var subject = Cell(Option.none()); + var revoke = function () { + subject.get().each(function (s) { + s.destroy(); + }); + }; + var clear = function () { + revoke(); + subject.set(Option.none()); + }; + var set = function (s) { + revoke(); + subject.set(Option.some(s)); + }; + var run = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + isSet: isSet, + set: set, + run: run + }; + }; + var value$2 = function () { + var subject = Cell(Option.none()); + var clear = function () { + subject.set(Option.none()); + }; + var set = function (s) { + subject.set(Option.some(s)); + }; + var on = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var SWIPING_LEFT = 1; + var SWIPING_RIGHT = -1; + var SWIPING_NONE = 0; + var init$2 = function (xValue) { + return { + xValue: xValue, + points: [] + }; + }; + var move$1 = function (model, xValue) { + if (xValue === model.xValue) { + return model; + } + var currentDirection = xValue - model.xValue > 0 ? SWIPING_LEFT : SWIPING_RIGHT; + var newPoint = { + direction: currentDirection, + xValue: xValue + }; + var priorPoints = function () { + if (model.points.length === 0) { + return []; + } else { + var prev = model.points[model.points.length - 1]; + return prev.direction === currentDirection ? model.points.slice(0, model.points.length - 1) : model.points; + } + }(); + return { + xValue: xValue, + points: priorPoints.concat([newPoint]) + }; + }; + var complete = function (model) { + if (model.points.length === 0) { + return SWIPING_NONE; + } else { + var firstDirection = model.points[0].direction; + var lastDirection = model.points[model.points.length - 1].direction; + return firstDirection === SWIPING_RIGHT && lastDirection === SWIPING_RIGHT ? SWIPING_RIGHT : firstDirection === SWIPING_LEFT && lastDirection === SWIPING_LEFT ? SWIPING_LEFT : SWIPING_NONE; + } + }; + var SwipingModel = { + init: init$2, + move: move$1, + complete: complete + }; + + var sketch$6 = function (rawSpec) { + var navigateEvent = 'navigateEvent'; + var wrapperAdhocEvents = 'serializer-wrapper-events'; + var formAdhocEvents = 'form-events'; + var schema = objOf([ + strict$1('fields'), + defaulted$1('maxFieldIndex', rawSpec.fields.length - 1), + strict$1('onExecute'), + strict$1('getInitialValue'), + state$1('state', function () { + return { + dialogSwipeState: value$2(), + currentScreen: Cell(0) + }; + }) + ]); + var spec$1 = asRawOrDie('SerialisedDialog', schema, rawSpec); + var navigationButton = function (direction, directionName, enabled) { + return Button.sketch({ + dom: dom$1(''), + action: function (button) { + emitWith(button, navigateEvent, { direction: direction }); + }, + buttonBehaviours: derive$1([Disabling.config({ + disableClass: Styles.resolve('toolbar-navigation-disabled'), + disabled: !enabled + })]) + }); + }; + var reposition = function (dialog, message) { + descendant$1(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) { + set$3(parent, 'left', -spec$1.state.currentScreen.get() * message.width + 'px'); + }); + }; + var navigate = function (dialog, direction) { + var screens = descendants(dialog.element(), '.' + Styles.resolve('serialised-dialog-screen')); + descendant$1(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) { + if (spec$1.state.currentScreen.get() + direction >= 0 && spec$1.state.currentScreen.get() + direction < screens.length) { + getRaw(parent, 'left').each(function (left) { + var currentLeft = parseInt(left, 10); + var w = get$7(screens[0]); + set$3(parent, 'left', currentLeft - direction * w + 'px'); + }); + spec$1.state.currentScreen.set(spec$1.state.currentScreen.get() + direction); + } + }); + }; + var focusInput = function (dialog) { + var inputs = descendants(dialog.element(), 'input'); + var optInput = Option.from(inputs[spec$1.state.currentScreen.get()]); + optInput.each(function (input) { + dialog.getSystem().getByDom(input).each(function (inputComp) { + dispatchFocus(dialog, inputComp.element()); + }); + }); + var dotitems = memDots.get(dialog); + Highlighting.highlightAt(dotitems, spec$1.state.currentScreen.get()); + }; + var resetState = function () { + spec$1.state.currentScreen.set(0); + spec$1.state.dialogSwipeState.clear(); + }; + var memForm = record(Form.sketch(function (parts) { + return { + dom: dom$1('
    '), + components: [Container.sketch({ + dom: dom$1('
    '), + components: map$1(spec$1.fields, function (field, i) { + return i <= spec$1.maxFieldIndex ? Container.sketch({ + dom: dom$1('
    '), + components: [ + navigationButton(-1, 'previous', i > 0), + parts.field(field.name, field.spec), + navigationButton(+1, 'next', i < spec$1.maxFieldIndex) + ] + }) : parts.field(field.name, field.spec); + }) + })], + formBehaviours: derive$1([ + Receivers.orientation(function (dialog, message) { + reposition(dialog, message); + }), + Keying.config({ + mode: 'special', + focusIn: function (dialog) { + focusInput(dialog); + }, + onTab: function (dialog) { + navigate(dialog, +1); + return Option.some(true); + }, + onShiftTab: function (dialog) { + navigate(dialog, -1); + return Option.some(true); + } + }), + config(formAdhocEvents, [ + runOnAttached(function (dialog, simulatedEvent) { + resetState(); + var dotitems = memDots.get(dialog); + Highlighting.highlightFirst(dotitems); + spec$1.getInitialValue(dialog).each(function (v) { + Representing.setValue(dialog, v); + }); + }), + runOnExecute(spec$1.onExecute), + run(transitionend(), function (dialog, simulatedEvent) { + var event = simulatedEvent.event(); + if (event.raw().propertyName === 'left') { + focusInput(dialog); + } + }), + run(navigateEvent, function (dialog, simulatedEvent) { + var event = simulatedEvent.event(); + var direction = event.direction(); + navigate(dialog, direction); + }) + ]) + ]) + }; + })); + var memDots = record({ + dom: dom$1('
    '), + behaviours: derive$1([Highlighting.config({ + highlightClass: Styles.resolve('dot-active'), + itemClass: Styles.resolve('dot-item') + })]), + components: bind(spec$1.fields, function (_f, i) { + return i <= spec$1.maxFieldIndex ? [spec('
    ')] : []; + }) + }); + return { + dom: dom$1('
    '), + components: [ + memForm.asSpec(), + memDots.asSpec() + ], + behaviours: derive$1([ + Keying.config({ + mode: 'special', + focusIn: function (wrapper) { + var form = memForm.get(wrapper); + Keying.focusIn(form); + } + }), + config(wrapperAdhocEvents, [ + run(touchstart(), function (wrapper, simulatedEvent) { + var event = simulatedEvent.event(); + spec$1.state.dialogSwipeState.set(SwipingModel.init(event.raw().touches[0].clientX)); + }), + run(touchmove(), function (wrapper, simulatedEvent) { + var event = simulatedEvent.event(); + spec$1.state.dialogSwipeState.on(function (state) { + simulatedEvent.event().prevent(); + spec$1.state.dialogSwipeState.set(SwipingModel.move(state, event.raw().touches[0].clientX)); + }); + }), + run(touchend(), function (wrapper) { + spec$1.state.dialogSwipeState.on(function (state) { + var dialog = memForm.get(wrapper); + var direction = -1 * SwipingModel.complete(state); + navigate(dialog, direction); + }); + }) + ]) + ]) + }; + }; + + var getGroups = cached(function (realm, editor) { + return [{ + label: 'the link group', + items: [sketch$6({ + fields: [ + field$2('url', 'Type or paste URL'), + field$2('text', 'Link text'), + field$2('title', 'Link title'), + field$2('target', 'Link target'), + hidden('link') + ], + maxFieldIndex: [ + 'url', + 'text', + 'title', + 'target' + ].length - 1, + getInitialValue: function () { + return Option.some(LinkBridge.getInfo(editor)); + }, + onExecute: function (dialog) { + var info = Representing.getValue(dialog); + LinkBridge.applyInfo(editor, info); + realm.restoreToolbar(); + editor.focus(); + } + })] + }]; + }); + var sketch$7 = function (realm, editor) { + return Buttons.forToolbarStateAction(editor, 'link', 'link', function () { + var groups = getGroups(realm, editor); + realm.setContextToolbar(groups); + RangePreserver.forAndroid(editor, function () { + realm.focusToolbar(); + }); + LinkBridge.query(editor).each(function (link) { + editor.selection.select(link.dom()); + }); + }); + }; + + var DefaultStyleFormats = [ + { + title: 'Headings', + items: [ + { + title: 'Heading 1', + format: 'h1' + }, + { + title: 'Heading 2', + format: 'h2' + }, + { + title: 'Heading 3', + format: 'h3' + }, + { + title: 'Heading 4', + format: 'h4' + }, + { + title: 'Heading 5', + format: 'h5' + }, + { + title: 'Heading 6', + format: 'h6' + } + ] + }, + { + title: 'Inline', + items: [ + { + title: 'Bold', + icon: 'bold', + format: 'bold' + }, + { + title: 'Italic', + icon: 'italic', + format: 'italic' + }, + { + title: 'Underline', + icon: 'underline', + format: 'underline' + }, + { + title: 'Strikethrough', + icon: 'strikethrough', + format: 'strikethrough' + }, + { + title: 'Superscript', + icon: 'superscript', + format: 'superscript' + }, + { + title: 'Subscript', + icon: 'subscript', + format: 'subscript' + }, + { + title: 'Code', + icon: 'code', + format: 'code' + } + ] + }, + { + title: 'Blocks', + items: [ + { + title: 'Paragraph', + format: 'p' + }, + { + title: 'Blockquote', + format: 'blockquote' + }, + { + title: 'Div', + format: 'div' + }, + { + title: 'Pre', + format: 'pre' + } + ] + }, + { + title: 'Alignment', + items: [ + { + title: 'Left', + icon: 'alignleft', + format: 'alignleft' + }, + { + title: 'Center', + icon: 'aligncenter', + format: 'aligncenter' + }, + { + title: 'Right', + icon: 'alignright', + format: 'alignright' + }, + { + title: 'Justify', + icon: 'alignjustify', + format: 'alignjustify' + } + ] + } + ]; + + var isRecursive = function (component, originator, target) { + return eq(originator, component.element()) && !eq(originator, target); + }; + var events$8 = derive([can(focus(), function (component, simulatedEvent) { + var originator = simulatedEvent.event().originator(); + var target = simulatedEvent.event().target(); + if (isRecursive(component, originator, target)) { + domGlobals.console.warn(focus() + ' did not get interpreted by the desired target. ' + '\nOriginator: ' + element(originator) + '\nTarget: ' + element(target) + '\nCheck the ' + focus() + ' event handlers'); + return false; + } else { + return true; + } + })]); + + var DefaultEvents = /*#__PURE__*/Object.freeze({ + __proto__: null, + events: events$8 + }); + + var make$1 = identity; + + var NoContextApi = function (getComp) { + var fail = function (event) { + return function () { + throw new Error('The component must be in a context to send: ' + event + (getComp ? '\n' + element(getComp().element()) + ' is not in context.' : '')); + }; + }; + return { + debugInfo: constant('fake'), + triggerEvent: fail('triggerEvent'), + triggerFocus: fail('triggerFocus'), + triggerEscape: fail('triggerEscape'), + build: fail('build'), + addToWorld: fail('addToWorld'), + removeFromWorld: fail('removeFromWorld'), + addToGui: fail('addToGui'), + removeFromGui: fail('removeFromGui'), + getByUid: fail('getByUid'), + getByDom: fail('getByDom'), + broadcast: fail('broadcast'), + broadcastOn: fail('broadcastOn'), + broadcastEvent: fail('broadcastEvent'), + isConnected: constant(false) + }; + }; + var singleton = NoContextApi(); + + var generateFrom = function (spec, all) { + var schema = map$1(all, function (a) { + return optionObjOf(a.name(), [ + strict$1('config'), + defaulted$1('state', NoState) + ]); + }); + var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) { + throw new Error(formatError(errInfo) + '\nComplete spec:\n' + JSON.stringify(spec, null, 2)); + }, function (v) { + return v; + }); + return { + list: all, + data: map(validated, function (optBlobThunk) { + var output = optBlobThunk.map(function (blob) { + return { + config: blob.config, + state: blob.state.init(blob.config) + }; + }); + return function () { + return output; + }; + }) + }; + }; + var getBehaviours = function (bData) { + return bData.list; + }; + var getData = function (bData) { + return bData.data; + }; + + var byInnerKey = function (data, tuple) { + var r = {}; + each(data, function (detail, key) { + each(detail, function (value, indexKey) { + var chain = get(r, indexKey).getOr([]); + r[indexKey] = chain.concat([tuple(key, value)]); + }); + }); + return r; + }; + + var combine$1 = function (info, baseMod, behaviours, base) { + var modsByBehaviour = __assign({}, baseMod); + each$1(behaviours, function (behaviour) { + modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base); + }); + var byAspect = byInnerKey(modsByBehaviour, function (name, modification) { + return { + name: name, + modification: modification + }; + }); + var combineObjects = function (objects) { + return foldr(objects, function (b, a) { + return __assign(__assign({}, a.modification), b); + }, {}); + }; + var combinedClasses = foldr(byAspect.classes, function (b, a) { + return a.modification.concat(b); + }, []); + var combinedAttributes = combineObjects(byAspect.attributes); + var combinedStyles = combineObjects(byAspect.styles); + return nu$5({ + classes: combinedClasses, + attributes: combinedAttributes, + styles: combinedStyles + }); + }; + + var sortKeys = function (label, keyName, array, order) { + try { + var sorted = sort(array, function (a, b) { + var aKey = a[keyName](); + var bKey = b[keyName](); + var aIndex = order.indexOf(aKey); + var bIndex = order.indexOf(bKey); + if (aIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (bIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (aIndex < bIndex) { + return -1; + } else if (bIndex < aIndex) { + return 1; + } else { + return 0; + } + }); + return Result.value(sorted); + } catch (err) { + return Result.error([err]); + } + }; + + var uncurried = function (handler, purpose) { + return { + handler: handler, + purpose: constant(purpose) + }; + }; + var curried = function (handler, purpose) { + return { + cHandler: handler, + purpose: constant(purpose) + }; + }; + var curryArgs = function (descHandler, extraArgs) { + return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose()); + }; + var getCurried = function (descHandler) { + return descHandler.cHandler; + }; + + var behaviourTuple = function (name, handler) { + return { + name: constant(name), + handler: constant(handler) + }; + }; + var nameToHandlers = function (behaviours, info) { + var r = {}; + each$1(behaviours, function (behaviour) { + r[behaviour.name()] = behaviour.handlers(info); + }); + return r; + }; + var groupByEvents = function (info, behaviours, base) { + var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info)); + return byInnerKey(behaviourEvents, behaviourTuple); + }; + var combine$2 = function (info, eventOrder, behaviours, base) { + var byEventName = groupByEvents(info, behaviours, base); + return combineGroups(byEventName, eventOrder); + }; + var assemble = function (rawHandler) { + var handler = read(rawHandler); + return function (component, simulatedEvent) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } + var args = [ + component, + simulatedEvent + ].concat(rest); + if (handler.abort.apply(undefined, args)) { + simulatedEvent.stop(); + } else if (handler.can.apply(undefined, args)) { + handler.run.apply(undefined, args); + } + }; + }; + var missingOrderError = function (eventName, tuples) { + return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map$1(tuples, function (c) { + return c.name(); + }), null, 2)]); + }; + var fuse$1 = function (tuples, eventOrder, eventName) { + var order = eventOrder[eventName]; + if (!order) { + return missingOrderError(eventName, tuples); + } else { + return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) { + var handlers = map$1(sortedTuples, function (tuple) { + return tuple.handler(); + }); + return fuse(handlers); + }); + } + }; + var combineGroups = function (byEventName, eventOrder) { + var r = mapToArray(byEventName, function (tuples, eventName) { + var combined = tuples.length === 1 ? Result.value(tuples[0].handler()) : fuse$1(tuples, eventOrder, eventName); + return combined.map(function (handler) { + var assembled = assemble(handler); + var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) { + return exists(tuples, function (t) { + return t.name() === o; + }); + }).join(' > ') : tuples[0].name(); + return wrap$1(eventName, uncurried(assembled, purpose)); + }); + }); + return consolidate(r, {}); + }; + + var toInfo = function (spec) { + return asRaw('custom.definition', objOf([ + field('dom', 'dom', strict(), objOf([ + strict$1('tag'), + defaulted$1('styles', {}), + defaulted$1('classes', []), + defaulted$1('attributes', {}), + option('value'), + option('innerHtml') + ])), + strict$1('components'), + strict$1('uid'), + defaulted$1('events', {}), + defaulted$1('apis', {}), + field('eventOrder', 'eventOrder', mergeWith({ + 'alloy.execute': [ + 'disabling', + 'alloy.base.behaviour', + 'toggling', + 'typeaheadevents' + ], + 'alloy.focus': [ + 'alloy.base.behaviour', + 'focusing', + 'keying' + ], + 'alloy.system.init': [ + 'alloy.base.behaviour', + 'disabling', + 'toggling', + 'representing' + ], + 'input': [ + 'alloy.base.behaviour', + 'representing', + 'streaming', + 'invalidating' + ], + 'alloy.system.detached': [ + 'alloy.base.behaviour', + 'representing', + 'item-events', + 'tooltipping' + ], + 'mousedown': [ + 'focusing', + 'alloy.base.behaviour', + 'item-type-events' + ], + 'touchstart': [ + 'focusing', + 'alloy.base.behaviour', + 'item-type-events' + ], + 'mouseover': [ + 'item-type-events', + 'tooltipping' + ] + }), anyValue$1()), + option('domModification') + ]), spec); + }; + var toDefinition = function (detail) { + return __assign(__assign({}, detail.dom), { + uid: detail.uid, + domChildren: map$1(detail.components, function (comp) { + return comp.element(); + }) + }); + }; + var toModification = function (detail) { + return detail.domModification.fold(function () { + return nu$5({}); + }, nu$5); + }; + var toEvents = function (info) { + return info.events; + }; + + var add$3 = function (element, classes) { + each$1(classes, function (x) { + add$2(element, x); + }); + }; + var remove$6 = function (element, classes) { + each$1(classes, function (x) { + remove$4(element, x); + }); + }; + + var renderToDom = function (definition) { + var subject = Element.fromTag(definition.tag); + setAll(subject, definition.attributes); + add$3(subject, definition.classes); + setAll$1(subject, definition.styles); + definition.innerHtml.each(function (html) { + return set$1(subject, html); + }); + var children = definition.domChildren; + append$1(subject, children); + definition.value.each(function (value) { + set$6(subject, value); + }); + if (!definition.uid) { + debugger; + } + writeOnly(subject, definition.uid); + return subject; + }; + + var getBehaviours$1 = function (spec) { + var behaviours = get(spec, 'behaviours').getOr({}); + var keys$1 = filter(keys(behaviours), function (k) { + return behaviours[k] !== undefined; + }); + return map$1(keys$1, function (k) { + return behaviours[k].me; + }); + }; + var generateFrom$1 = function (spec, all) { + return generateFrom(spec, all); + }; + var generate$4 = function (spec) { + var all = getBehaviours$1(spec); + return generateFrom$1(spec, all); + }; + + var getDomDefinition = function (info, bList, bData) { + var definition = toDefinition(info); + var infoModification = toModification(info); + var baseModification = { 'alloy.base.modification': infoModification }; + var modification = bList.length > 0 ? combine$1(bData, baseModification, bList, definition) : infoModification; + return merge$1(definition, modification); + }; + var getEvents = function (info, bList, bData) { + var baseEvents = { 'alloy.base.behaviour': toEvents(info) }; + return combine$2(bData, info.eventOrder, bList, baseEvents).getOrDie(); + }; + var build = function (spec) { + var getMe = function () { + return me; + }; + var systemApi = Cell(singleton); + var info = getOrDie(toInfo(spec)); + var bBlob = generate$4(spec); + var bList = getBehaviours(bBlob); + var bData = getData(bBlob); + var modDefinition = getDomDefinition(info, bList, bData); + var item = renderToDom(modDefinition); + var events = getEvents(info, bList, bData); + var subcomponents = Cell(info.components); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(getMe)); + }; + var syncComponents = function () { + var children$1 = children(item); + var subs = bind(children$1, function (child) { + return systemApi.get().getByDom(child).fold(function () { + return []; + }, function (c) { + return [c]; + }); + }); + subcomponents.set(subs); + }; + var config = function (behaviour) { + var b = bData; + var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () { + throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2)); + }; + return f(); + }; + var hasConfigured = function (behaviour) { + return isFunction(bData[behaviour.name()]); + }; + var getApis = function () { + return info.apis; + }; + var readState = function (behaviourName) { + return bData[behaviourName]().map(function (b) { + return b.state.readState(); + }).getOr('not enabled'); + }; + var me = { + getSystem: systemApi.get, + config: config, + hasConfigured: hasConfigured, + spec: constant(spec), + readState: readState, + getApis: getApis, + connect: connect, + disconnect: disconnect, + element: constant(item), + syncComponents: syncComponents, + components: subcomponents.get, + events: constant(events) + }; + return me; + }; + + var buildSubcomponents = function (spec) { + var components = get(spec, 'components').getOr([]); + return map$1(components, build$1); + }; + var buildFromSpec = function (userSpec) { + var _a = make$1(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']); + var components = buildSubcomponents(spec); + var completeSpec = __assign(__assign({}, spec), { + events: __assign(__assign({}, DefaultEvents), specEvents), + components: components + }); + return Result.value(build(completeSpec)); + }; + var text = function (textContent) { + var element = Element.fromText(textContent); + return external$1({ element: element }); + }; + var external$1 = function (spec) { + var extSpec = asRawOrDie('external.component', objOfOnly([ + strict$1('element'), + option('uid') + ]), spec); + var systemApi = Cell(NoContextApi()); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(function () { + return me; + })); + }; + extSpec.uid.each(function (uid) { + writeOnly(extSpec.element, uid); + }); + var me = { + getSystem: systemApi.get, + config: Option.none, + hasConfigured: constant(false), + connect: connect, + disconnect: disconnect, + getApis: function () { + return {}; + }, + element: constant(extSpec.element), + spec: constant(spec), + readState: constant('No state'), + syncComponents: noop, + components: constant([]), + events: constant({}) + }; + return premade(me); + }; + var uids = generate$3; + var build$1 = function (spec) { + return getPremade(spec).fold(function () { + var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({ uid: uids('') }, spec); + return buildFromSpec(userSpecWithUid).getOrDie(); + }, function (prebuilt) { + return prebuilt; + }); + }; + var premade$1 = premade; + + var hoverEvent = 'alloy.item-hover'; + var focusEvent = 'alloy.item-focus'; + var onHover = function (item) { + if (search(item.element()).isNone() || Focusing.isFocused(item)) { + if (!Focusing.isFocused(item)) { + Focusing.focus(item); + } + emitWith(item, hoverEvent, { item: item }); + } + }; + var onFocus = function (item) { + emitWith(item, focusEvent, { item: item }); + }; + var hover = constant(hoverEvent); + var focus$3 = constant(focusEvent); + + var builder = function (detail) { + return { + dom: detail.dom, + domModification: __assign(__assign({}, detail.domModification), { attributes: __assign(__assign(__assign({ 'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem' }, detail.domModification.attributes), { 'aria-haspopup': detail.hasSubmenu }), detail.hasSubmenu ? { 'aria-expanded': false } : {}) }), + behaviours: SketchBehaviours.augment(detail.itemBehaviours, [ + detail.toggling.fold(Toggling.revoke, function (tConfig) { + return Toggling.config(__assign({ aria: { mode: 'checked' } }, tConfig)); + }), + Focusing.config({ + ignore: detail.ignoreFocus, + stopMousedown: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ mode: 'execution' }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + config('item-type-events', __spreadArrays(pointerEvents(), [ + run(mouseover(), onHover), + run(focusItem(), Focusing.focus) + ])) + ]), + components: detail.components, + eventOrder: detail.eventOrder + }; + }; + var schema$a = [ + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('hasSubmenu', false), + option('toggling'), + SketchBehaviours.field('itemBehaviours', [ + Toggling, + Focusing, + Keying, + Representing + ]), + defaulted$1('ignoreFocus', false), + defaulted$1('domModification', {}), + output('builder', builder), + defaulted$1('eventOrder', {}) + ]; + + var builder$1 = function (detail) { + return { + dom: detail.dom, + components: detail.components, + events: derive([stopper(focusItem())]) + }; + }; + var schema$b = [ + strict$1('dom'), + strict$1('components'), + output('builder', builder$1) + ]; + + var owner$2 = function () { + return 'item-widget'; + }; + var parts = constant([required({ + name: 'widget', + overrides: function (detail) { + return { + behaviours: derive$1([Representing.config({ + store: { + mode: 'manual', + getValue: function (component) { + return detail.data; + }, + setValue: function () { + } + } + })]) + }; + } + })]); + + var builder$2 = function (detail) { + var subs = substitutes(owner$2(), detail, parts()); + var components$1 = components(owner$2(), detail, subs.internals()); + var focusWidget = function (component) { + return getPart(component, detail, 'widget').map(function (widget) { + Keying.focusIn(widget); + return widget; + }); + }; + var onHorizontalArrow = function (component, simulatedEvent) { + return inside(simulatedEvent.event().target()) ? Option.none() : function () { + if (detail.autofocus) { + simulatedEvent.setSource(component.element()); + return Option.none(); + } else { + return Option.none(); + } + }(); + }; + return { + dom: detail.dom, + components: components$1, + domModification: detail.domModification, + events: derive([ + runOnExecute(function (component, simulatedEvent) { + focusWidget(component).each(function (widget) { + simulatedEvent.stop(); + }); + }), + run(mouseover(), onHover), + run(focusItem(), function (component, simulatedEvent) { + if (detail.autofocus) { + focusWidget(component); + } else { + Focusing.focus(component); + } + }) + ]), + behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + Focusing.config({ + ignore: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ + mode: 'special', + focusIn: detail.autofocus ? function (component) { + focusWidget(component); + } : revoke(), + onLeft: onHorizontalArrow, + onRight: onHorizontalArrow, + onEscape: function (component, simulatedEvent) { + if (!Focusing.isFocused(component) && !detail.autofocus) { + Focusing.focus(component); + return Option.some(true); + } else if (detail.autofocus) { + simulatedEvent.setSource(component.element()); + return Option.none(); + } else { + return Option.none(); + } + } + }) + ]) + }; + }; + var schema$c = [ + strict$1('uid'), + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('autofocus', false), + defaulted$1('ignoreFocus', false), + SketchBehaviours.field('widgetBehaviours', [ + Representing, + Focusing, + Keying + ]), + defaulted$1('domModification', {}), + defaultUidsSchema(parts()), + output('builder', builder$2) + ]; + + var itemSchema$1 = choose$1('type', { + widget: schema$c, + item: schema$a, + separator: schema$b + }); + var configureGrid = function (detail, movementInfo) { + return { + mode: 'flatgrid', + selector: '.' + detail.markers.item, + initSize: { + numColumns: movementInfo.initSize.numColumns, + numRows: movementInfo.initSize.numRows + }, + focusManager: detail.focusManager + }; + }; + var configureMatrix = function (detail, movementInfo) { + return { + mode: 'matrix', + selectors: { + row: movementInfo.rowSelector, + cell: '.' + detail.markers.item + }, + focusManager: detail.focusManager + }; + }; + var configureMenu = function (detail, movementInfo) { + return { + mode: 'menu', + selector: '.' + detail.markers.item, + moveOnTab: movementInfo.moveOnTab, + focusManager: detail.focusManager + }; + }; + var parts$1 = constant([group({ + factory: { + sketch: function (spec) { + var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec); + return itemInfo.builder(itemInfo); + } + }, + name: 'items', + unit: 'item', + defaults: function (detail, u) { + return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), { uid: generate$3('item') }); + }, + overrides: function (detail, u) { + return { + type: u.type, + ignoreFocus: detail.fakeFocus, + domModification: { classes: [detail.markers.item] } + }; + } + })]); + var schema$d = constant([ + strict$1('value'), + strict$1('items'), + strict$1('dom'), + strict$1('components'), + defaulted$1('eventOrder', {}), + field$1('menuBehaviours', [ + Highlighting, + Representing, + Composing, + Keying + ]), + defaultedOf('movement', { + mode: 'menu', + moveOnTab: true + }, choose$1('mode', { + grid: [ + initSize(), + output('config', configureGrid) + ], + matrix: [ + output('config', configureMatrix), + strict$1('rowSelector') + ], + menu: [ + defaulted$1('moveOnTab', true), + output('config', configureMenu) + ] + })), + itemMarkers(), + defaulted$1('fakeFocus', false), + defaulted$1('focusManager', dom()), + onHandler('onHighlight') + ]); + + var focus$4 = constant('alloy.menu-focus'); + + var make$2 = function (detail, components, spec, externals) { + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.menuBehaviours, [ + Highlighting.config({ + highlightClass: detail.markers.selectedItem, + itemClass: detail.markers.item, + onHighlight: detail.onHighlight + }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.value + } + }), + Composing.config({ find: Option.some }), + Keying.config(detail.movement.config(detail, detail.movement)) + ]), + events: derive([ + run(focus$3(), function (menu, simulatedEvent) { + var event = simulatedEvent.event(); + menu.getSystem().getByDom(event.target()).each(function (item) { + Highlighting.highlight(menu, item); + simulatedEvent.stop(); + emitWith(menu, focus$4(), { + menu: menu, + item: item + }); + }); + }), + run(hover(), function (menu, simulatedEvent) { + var item = simulatedEvent.event().item(); + Highlighting.highlight(menu, item); + }) + ]), + components: components, + eventOrder: detail.eventOrder, + domModification: { attributes: { role: 'menu' } } + }; + }; + + var Menu = composite$1({ + name: 'Menu', + configFields: schema$d(), + partFields: parts$1(), + factory: make$2 + }); + + var preserve$1 = function (f, container) { + var ownerDoc = owner(container); + var refocus = active(ownerDoc).bind(function (focused) { + var hasFocus = function (elem) { + return eq(focused, elem); + }; + return hasFocus(container) ? Option.some(container) : descendant(container, hasFocus); + }); + var result = f(container); + refocus.each(function (oldFocus) { + active(ownerDoc).filter(function (newFocus) { + return eq(newFocus, oldFocus); + }).fold(function () { + focus$1(oldFocus); + }, noop); + }); + return result; + }; + + var set$8 = function (component, replaceConfig, replaceState, data) { + preserve$1(function () { + var newChildren = map$1(data, component.getSystem().build); + replaceChildren(component, newChildren); + }, component.element()); + }; + var insert = function (component, replaceConfig, insertion, childSpec) { + var child = component.getSystem().build(childSpec); + attachWith(component, child, insertion); + }; + var append$2 = function (component, replaceConfig, replaceState, appendee) { + insert(component, replaceConfig, append, appendee); + }; + var prepend$1 = function (component, replaceConfig, replaceState, prependee) { + insert(component, replaceConfig, prepend, prependee); + }; + var remove$7 = function (component, replaceConfig, replaceState, removee) { + var children = contents(component); + var foundChild = find$2(children, function (child) { + return eq(removee.element(), child.element()); + }); + foundChild.each(detach); + }; + var contents = function (component, replaceConfig) { + return component.components(); + }; + var replaceAt = function (component, replaceConfig, replaceState, replaceeIndex, replacer) { + var children = contents(component); + return Option.from(children[replaceeIndex]).map(function (replacee) { + remove$7(component, replaceConfig, replaceState, replacee); + replacer.each(function (r) { + insert(component, replaceConfig, function (p, c) { + appendAt(p, c, replaceeIndex); + }, r); + }); + return replacee; + }); + }; + var replaceBy = function (component, replaceConfig, replaceState, replaceePred, replacer) { + var children = contents(component); + return findIndex(children, replaceePred).bind(function (replaceeIndex) { + return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer); + }); + }; + + var ReplaceApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + append: append$2, + prepend: prepend$1, + remove: remove$7, + replaceAt: replaceAt, + replaceBy: replaceBy, + set: set$8, + contents: contents + }); + + var Replacing = create$1({ + fields: [], + name: 'replacing', + apis: ReplaceApis + }); + + var transpose = function (obj) { + return tupleMap(obj, function (v, k) { + return { + k: v, + v: k + }; + }); + }; + var trace = function (items, byItem, byMenu, finish) { + return get(byMenu, finish).bind(function (triggerItem) { + return get(items, triggerItem).bind(function (triggerMenu) { + var rest = trace(items, byItem, byMenu, triggerMenu); + return Option.some([triggerMenu].concat(rest)); + }); + }).getOr([]); + }; + var generate$5 = function (menus, expansions) { + var items = {}; + each(menus, function (menuItems, menu) { + each$1(menuItems, function (item) { + items[item] = menu; + }); + }); + var byItem = expansions; + var byMenu = transpose(expansions); + var menuPaths = map(byMenu, function (_triggerItem, submenu) { + return [submenu].concat(trace(items, byItem, byMenu, submenu)); + }); + return map(items, function (menu) { + return get(menuPaths, menu).getOr([menu]); + }); + }; + + var init$3 = function () { + var expansions = Cell({}); + var menus = Cell({}); + var paths = Cell({}); + var primary = Cell(Option.none()); + var directory = Cell({}); + var clear = function () { + expansions.set({}); + menus.set({}); + paths.set({}); + primary.set(Option.none()); + }; + var isClear = function () { + return primary.get().isNone(); + }; + var setMenuBuilt = function (menuName, built) { + var _a; + menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = { + type: 'prepared', + menu: built + }, _a))); + }; + var setContents = function (sPrimary, sMenus, sExpansions, dir) { + primary.set(Option.some(sPrimary)); + expansions.set(sExpansions); + menus.set(sMenus); + directory.set(dir); + var sPaths = generate$5(dir, sExpansions); + paths.set(sPaths); + }; + var getTriggeringItem = function (menuValue) { + return find(expansions.get(), function (v, k) { + return v === menuValue; + }); + }; + var getTriggerData = function (menuValue, getItemByValue, path) { + return getPreparedMenu(menuValue).bind(function (menu) { + return getTriggeringItem(menuValue).bind(function (triggeringItemValue) { + return getItemByValue(triggeringItemValue).map(function (triggeredItem) { + return { + triggeredMenu: menu, + triggeringItem: triggeredItem, + triggeringPath: path + }; + }); + }); + }); + }; + var getTriggeringPath = function (itemValue, getItemByValue) { + var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) { + return getPreparedMenu(menuValue).isSome(); + }); + return get(paths.get(), itemValue).bind(function (path) { + var revPath = reverse(extraPath.concat(path)); + var triggers = bind(revPath, function (menuValue, menuIndex) { + return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () { + return primary.get().is(menuValue) ? [] : [Option.none()]; + }, function (data) { + return [Option.some(data)]; + }); + }); + return sequence(triggers); + }); + }; + var expand = function (itemValue) { + return get(expansions.get(), itemValue).map(function (menu) { + var current = get(paths.get(), itemValue).getOr([]); + return [menu].concat(current); + }); + }; + var collapse = function (itemValue) { + return get(paths.get(), itemValue).bind(function (path) { + return path.length > 1 ? Option.some(path.slice(1)) : Option.none(); + }); + }; + var refresh = function (itemValue) { + return get(paths.get(), itemValue); + }; + var getPreparedMenu = function (menuValue) { + return lookupMenu(menuValue).bind(extractPreparedMenu); + }; + var lookupMenu = function (menuValue) { + return get(menus.get(), menuValue); + }; + var lookupItem = function (itemValue) { + return get(expansions.get(), itemValue); + }; + var otherMenus = function (path) { + var menuValues = directory.get(); + return difference(keys(menuValues), path); + }; + var getPrimary = function () { + return primary.get().bind(getPreparedMenu); + }; + var getMenus = function () { + return menus.get(); + }; + return { + setMenuBuilt: setMenuBuilt, + setContents: setContents, + expand: expand, + refresh: refresh, + collapse: collapse, + lookupMenu: lookupMenu, + lookupItem: lookupItem, + otherMenus: otherMenus, + getPrimary: getPrimary, + getMenus: getMenus, + clear: clear, + isClear: isClear, + getTriggeringPath: getTriggeringPath + }; + }; + var extractPreparedMenu = function (prep) { + return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none(); + }; + var LayeredState = { + init: init$3, + extractPreparedMenu: extractPreparedMenu + }; + + var make$3 = function (detail, rawUiSpec) { + var submenuParentItems = Cell(Option.none()); + var buildMenus = function (container, primaryName, menus) { + return map(menus, function (spec, name) { + var makeSketch = function () { + return Menu.sketch(__assign(__assign({ dom: spec.dom }, spec), { + value: name, + items: spec.items, + markers: detail.markers, + fakeFocus: detail.fakeFocus, + onHighlight: detail.onHighlight, + focusManager: detail.fakeFocus ? highlights() : dom() + })); + }; + return name === primaryName ? { + type: 'prepared', + menu: container.getSystem().build(makeSketch()) + } : { + type: 'notbuilt', + nbMenu: makeSketch + }; + }); + }; + var layeredState = LayeredState.init(); + var setup = function (container) { + var componentMap = buildMenus(container, detail.data.primary, detail.data.menus); + var directory = toDirectory(); + layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory); + return layeredState.getPrimary(); + }; + var getItemValue = function (item) { + return Representing.getValue(item).value; + }; + var getItemByValue = function (container, menus, itemValue) { + return findMap(menus, function (menu) { + if (!menu.getSystem().isConnected()) { + return Option.none(); + } + var candidates = Highlighting.getCandidates(menu); + return find$2(candidates, function (c) { + return getItemValue(c) === itemValue; + }); + }); + }; + var toDirectory = function (container) { + return map(detail.data.menus, function (data, menuName) { + return bind(data.items, function (item) { + return item.type === 'separator' ? [] : [item.data.value]; + }); + }); + }; + var setActiveMenu = function (container, menu) { + Highlighting.highlight(container, menu); + Highlighting.getHighlighted(menu).orThunk(function () { + return Highlighting.getFirst(menu); + }).each(function (item) { + dispatch(container, item.element(), focusItem()); + }); + }; + var getMenus = function (state, menuValues) { + return cat(map$1(menuValues, function (mv) { + return state.lookupMenu(mv).bind(function (prep) { + return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none(); + }); + })); + }; + var closeOthers = function (container, state, path) { + var others = getMenus(state, state.otherMenus(path)); + each$1(others, function (o) { + remove$6(o.element(), [detail.markers.backgroundMenu]); + if (!detail.stayInDom) { + Replacing.remove(container, o); + } + }); + }; + var getSubmenuParents = function (container) { + return submenuParentItems.get().getOrThunk(function () { + var r = {}; + var items = descendants(container.element(), '.' + detail.markers.item); + var parentItems = filter(items, function (i) { + return get$1(i, 'aria-haspopup') === 'true'; + }); + each$1(parentItems, function (i) { + container.getSystem().getByDom(i).each(function (itemComp) { + var key = getItemValue(itemComp); + r[key] = itemComp; + }); + }); + submenuParentItems.set(Option.some(r)); + return r; + }); + }; + var updateAriaExpansions = function (container, path) { + var parentItems = getSubmenuParents(container); + each(parentItems, function (v, k) { + var expanded = contains(path, k); + set(v.element(), 'aria-expanded', expanded); + }); + }; + var updateMenuPath = function (container, state, path) { + return Option.from(path[0]).bind(function (latestMenuName) { + return state.lookupMenu(latestMenuName).bind(function (menuPrep) { + if (menuPrep.type === 'notbuilt') { + return Option.none(); + } else { + var activeMenu = menuPrep.menu; + var rest = getMenus(state, path.slice(1)); + each$1(rest, function (r) { + add$2(r.element(), detail.markers.backgroundMenu); + }); + if (!inBody(activeMenu.element())) { + Replacing.append(container, premade$1(activeMenu)); + } + remove$6(activeMenu.element(), [detail.markers.backgroundMenu]); + setActiveMenu(container, activeMenu); + closeOthers(container, state, path); + return Option.some(activeMenu); + } + }); + }); + }; + var ExpandHighlightDecision; + (function (ExpandHighlightDecision) { + ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu'; + ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent'; + }(ExpandHighlightDecision || (ExpandHighlightDecision = {}))); + var buildIfRequired = function (container, menuName, menuPrep) { + if (menuPrep.type === 'notbuilt') { + var menu = container.getSystem().build(menuPrep.nbMenu()); + layeredState.setMenuBuilt(menuName, menu); + return menu; + } else { + return menuPrep.menu; + } + }; + var expandRight = function (container, item, decision) { + if (decision === void 0) { + decision = ExpandHighlightDecision.HighlightSubmenu; + } + var value = getItemValue(item); + return layeredState.expand(value).bind(function (path) { + updateAriaExpansions(container, path); + return Option.from(path[0]).bind(function (menuName) { + return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) { + var activeMenu = buildIfRequired(container, menuName, activeMenuPrep); + if (!inBody(activeMenu.element())) { + Replacing.append(container, premade$1(activeMenu)); + } + detail.onOpenSubmenu(container, item, activeMenu, reverse(path)); + if (decision === ExpandHighlightDecision.HighlightSubmenu) { + Highlighting.highlightFirst(activeMenu); + return updateMenuPath(container, layeredState, path); + } else { + Highlighting.dehighlightAll(activeMenu); + return Option.some(item); + } + }); + }); + }); + }; + var collapseLeft = function (container, item) { + var value = getItemValue(item); + return layeredState.collapse(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path).map(function (activeMenu) { + detail.onCollapseMenu(container, item, activeMenu); + return activeMenu; + }); + }); + }; + var updateView = function (container, item) { + var value = getItemValue(item); + return layeredState.refresh(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path); + }); + }; + var onRight = function (container, item) { + return inside(item.element()) ? Option.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu); + }; + var onLeft = function (container, item) { + return inside(item.element()) ? Option.none() : collapseLeft(container, item); + }; + var onEscape = function (container, item) { + return collapseLeft(container, item).orThunk(function () { + return detail.onEscape(container, item).map(function () { + return container; + }); + }); + }; + var keyOnItem = function (f) { + return function (container, simulatedEvent) { + return closest$2(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) { + return container.getSystem().getByDom(target).toOption().bind(function (item) { + return f(container, item).map(function () { + return true; + }); + }); + }); + }; + }; + var events = derive([ + run(focus$4(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event().item(); + layeredState.lookupItem(getItemValue(item)).each(function () { + var menu = simulatedEvent.event().menu(); + Highlighting.highlight(sandbox, menu); + var value = getItemValue(simulatedEvent.event().item()); + layeredState.refresh(value).each(function (path) { + return closeOthers(sandbox, layeredState, path); + }); + }); + }), + runOnExecute(function (component, simulatedEvent) { + var target = simulatedEvent.event().target(); + component.getSystem().getByDom(target).each(function (item) { + var itemValue = getItemValue(item); + if (itemValue.indexOf('collapse-item') === 0) { + collapseLeft(component, item); + } + expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () { + detail.onExecute(component, item); + }, function () { + }); + }); + }), + runOnAttached(function (container, simulatedEvent) { + setup(container).each(function (primary) { + Replacing.append(container, premade$1(primary)); + detail.onOpenMenu(container, primary); + if (detail.highlightImmediately) { + setActiveMenu(container, primary); + } + }); + }) + ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event().item(); + updateView(sandbox, item); + expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent); + detail.onHover(sandbox, item); + })] : [])); + var getActiveItem = function (container) { + return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted); + }; + var collapseMenuApi = function (container) { + getActiveItem(container).each(function (currentItem) { + collapseLeft(container, currentItem); + }); + }; + var highlightPrimary = function (container) { + layeredState.getPrimary().each(function (primary) { + setActiveMenu(container, primary); + }); + }; + var extractMenuFromContainer = function (container) { + return Option.from(container.components()[0]).filter(function (comp) { + return get$1(comp.element(), 'role') === 'menu'; + }); + }; + var repositionMenus = function (container) { + var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) { + return getActiveItem(container).bind(function (currentItem) { + var itemValue = getItemValue(currentItem); + var allMenus = values(layeredState.getMenus()); + var preparedMenus = cat(map$1(allMenus, LayeredState.extractPreparedMenu)); + return layeredState.getTriggeringPath(itemValue, function (v) { + return getItemByValue(container, preparedMenus, v); + }); + }).map(function (triggeringPath) { + return { + primary: primary, + triggeringPath: triggeringPath + }; + }); + }); + maybeActivePrimary.fold(function () { + extractMenuFromContainer(container).each(function (primaryMenu) { + detail.onRepositionMenu(container, primaryMenu, []); + }); + }, function (_a) { + var primary = _a.primary, triggeringPath = _a.triggeringPath; + detail.onRepositionMenu(container, primary, triggeringPath); + }); + }; + var apis = { + collapseMenu: collapseMenuApi, + highlightPrimary: highlightPrimary, + repositionMenus: repositionMenus + }; + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.tmenuBehaviours, [ + Keying.config({ + mode: 'special', + onRight: keyOnItem(onRight), + onLeft: keyOnItem(onLeft), + onEscape: keyOnItem(onEscape), + focusIn: function (container, keyInfo) { + layeredState.getPrimary().each(function (primary) { + dispatch(container, primary.element(), focusItem()); + }); + } + }), + Highlighting.config({ + highlightClass: detail.markers.selectedMenu, + itemClass: detail.markers.menu + }), + Composing.config({ + find: function (container) { + return Highlighting.getHighlighted(container); + } + }), + Replacing.config({}) + ]), + eventOrder: detail.eventOrder, + apis: apis, + events: events + }; + }; + var collapseItem = constant('collapse-item'); + + var tieredData = function (primary, menus, expansions) { + return { + primary: primary, + menus: menus, + expansions: expansions + }; + }; + var singleData = function (name, menu) { + return { + primary: name, + menus: wrap$1(name, menu), + expansions: {} + }; + }; + var collapseItem$1 = function (text) { + return { + value: generate$1(collapseItem()), + meta: { text: text } + }; + }; + var tieredMenu = single$2({ + name: 'TieredMenu', + configFields: [ + onStrictKeyboardHandler('onExecute'), + onStrictKeyboardHandler('onEscape'), + onStrictHandler('onOpenMenu'), + onStrictHandler('onOpenSubmenu'), + onHandler('onRepositionMenu'), + onHandler('onCollapseMenu'), + defaulted$1('highlightImmediately', true), + strictObjOf('data', [ + strict$1('primary'), + strict$1('menus'), + strict$1('expansions') + ]), + defaulted$1('fakeFocus', false), + onHandler('onHighlight'), + onHandler('onHover'), + tieredMenuMarkers(), + strict$1('dom'), + defaulted$1('navigateOnHover', true), + defaulted$1('stayInDom', false), + field$1('tmenuBehaviours', [ + Keying, + Highlighting, + Composing, + Replacing + ]), + defaulted$1('eventOrder', {}) + ], + apis: { + collapseMenu: function (apis, tmenu) { + apis.collapseMenu(tmenu); + }, + highlightPrimary: function (apis, tmenu) { + apis.highlightPrimary(tmenu); + }, + repositionMenus: function (apis, tmenu) { + apis.repositionMenus(tmenu); + } + }, + factory: make$3, + extraApis: { + tieredData: tieredData, + singleData: singleData, + collapseItem: collapseItem$1 + } + }); + + var findRoute = function (component, transConfig, transState, route) { + return get(transConfig.routes, route.start).bind(function (sConfig) { + return get(sConfig, route.destination); + }); + }; + var getTransition = function (comp, transConfig, transState) { + var route = getCurrentRoute(comp, transConfig); + return route.bind(function (r) { + return getTransitionOf(comp, transConfig, transState, r); + }); + }; + var getTransitionOf = function (comp, transConfig, transState, route) { + return findRoute(comp, transConfig, transState, route).bind(function (r) { + return r.transition.map(function (t) { + return { + transition: t, + route: r + }; + }); + }); + }; + var disableTransition = function (comp, transConfig, transState) { + getTransition(comp, transConfig, transState).each(function (routeTransition) { + var t = routeTransition.transition; + remove$4(comp.element(), t.transitionClass); + remove$1(comp.element(), transConfig.destinationAttr); + }); + }; + var getNewRoute = function (comp, transConfig, transState, destination) { + return { + start: get$1(comp.element(), transConfig.stateAttr), + destination: destination + }; + }; + var getCurrentRoute = function (comp, transConfig, transState) { + var el = comp.element(); + return has$1(el, transConfig.destinationAttr) ? Option.some({ + start: get$1(comp.element(), transConfig.stateAttr), + destination: get$1(comp.element(), transConfig.destinationAttr) + }) : Option.none(); + }; + var jumpTo = function (comp, transConfig, transState, destination) { + disableTransition(comp, transConfig, transState); + if (has$1(comp.element(), transConfig.stateAttr) && get$1(comp.element(), transConfig.stateAttr) !== destination) { + transConfig.onFinish(comp, destination); + } + set(comp.element(), transConfig.stateAttr, destination); + }; + var fasttrack = function (comp, transConfig, transState, destination) { + if (has$1(comp.element(), transConfig.destinationAttr)) { + set(comp.element(), transConfig.stateAttr, get$1(comp.element(), transConfig.destinationAttr)); + remove$1(comp.element(), transConfig.destinationAttr); + } + }; + var progressTo = function (comp, transConfig, transState, destination) { + fasttrack(comp, transConfig); + var route = getNewRoute(comp, transConfig, transState, destination); + getTransitionOf(comp, transConfig, transState, route).fold(function () { + jumpTo(comp, transConfig, transState, destination); + }, function (routeTransition) { + disableTransition(comp, transConfig, transState); + var t = routeTransition.transition; + add$2(comp.element(), t.transitionClass); + set(comp.element(), transConfig.destinationAttr, destination); + }); + }; + var getState$1 = function (comp, transConfig, transState) { + var e = comp.element(); + return has$1(e, transConfig.stateAttr) ? Option.some(get$1(e, transConfig.stateAttr)) : Option.none(); + }; + + var TransitionApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + findRoute: findRoute, + disableTransition: disableTransition, + getCurrentRoute: getCurrentRoute, + jumpTo: jumpTo, + progressTo: progressTo, + getState: getState$1 + }); + + var events$9 = function (transConfig, transState) { + return derive([ + run(transitionend(), function (component, simulatedEvent) { + var raw = simulatedEvent.event().raw(); + getCurrentRoute(component, transConfig).each(function (route) { + findRoute(component, transConfig, transState, route).each(function (rInfo) { + rInfo.transition.each(function (rTransition) { + if (raw.propertyName === rTransition.property) { + jumpTo(component, transConfig, transState, route.destination); + transConfig.onTransition(component, route); + } + }); + }); + }); + }), + runOnAttached(function (comp, se) { + jumpTo(comp, transConfig, transState, transConfig.initialState); + }) + ]); + }; + + var ActiveTransitioning = /*#__PURE__*/Object.freeze({ + __proto__: null, + events: events$9 + }); + + var TransitionSchema = [ + defaulted$1('destinationAttr', 'data-transitioning-destination'), + defaulted$1('stateAttr', 'data-transitioning-state'), + strict$1('initialState'), + onHandler('onTransition'), + onHandler('onFinish'), + strictOf('routes', setOf$1(Result.value, setOf$1(Result.value, objOfOnly([optionObjOfOnly('transition', [ + strict$1('property'), + strict$1('transitionClass') + ])])))) + ]; + + var createRoutes = function (routes) { + var r = {}; + each(routes, function (v, k) { + var waypoints = k.split('<->'); + r[waypoints[0]] = wrap$1(waypoints[1], v); + r[waypoints[1]] = wrap$1(waypoints[0], v); + }); + return r; + }; + var createBistate = function (first, second, transitions) { + return wrapAll$1([ + { + key: first, + value: wrap$1(second, transitions) + }, + { + key: second, + value: wrap$1(first, transitions) + } + ]); + }; + var createTristate = function (first, second, third, transitions) { + return wrapAll$1([ + { + key: first, + value: wrapAll$1([ + { + key: second, + value: transitions + }, + { + key: third, + value: transitions + } + ]) + }, + { + key: second, + value: wrapAll$1([ + { + key: first, + value: transitions + }, + { + key: third, + value: transitions + } + ]) + }, + { + key: third, + value: wrapAll$1([ + { + key: first, + value: transitions + }, + { + key: second, + value: transitions + } + ]) + } + ]); + }; + var Transitioning = create$1({ + fields: TransitionSchema, + name: 'transitioning', + active: ActiveTransitioning, + apis: TransitionApis, + extra: { + createRoutes: createRoutes, + createBistate: createBistate, + createTristate: createTristate + } + }); + + var scrollable = Styles.resolve('scrollable'); + var register = function (element) { + add$2(element, scrollable); + }; + var deregister = function (element) { + remove$4(element, scrollable); + }; + var Scrollable = { + register: register, + deregister: deregister, + scrollable: constant(scrollable) + }; + + var getValue$4 = function (item) { + return get(item, 'format').getOr(item.title); + }; + var convert$1 = function (formats, memMenuThunk) { + var mainMenu = makeMenu('Styles', [].concat(map$1(formats.items, function (k) { + return makeItem(getValue$4(k), k.title, k.isSelected(), k.getPreview(), hasNonNullableKey(formats.expansions, getValue$4(k))); + })), memMenuThunk, false); + var submenus = map(formats.menus, function (menuItems, menuName) { + var items = map$1(menuItems, function (item) { + return makeItem(getValue$4(item), item.title, item.isSelected !== undefined ? item.isSelected() : false, item.getPreview !== undefined ? item.getPreview() : '', hasNonNullableKey(formats.expansions, getValue$4(item))); + }); + return makeMenu(menuName, items, memMenuThunk, true); + }); + var menus = deepMerge(submenus, wrap$1('styles', mainMenu)); + var tmenu = tieredMenu.tieredData('styles', menus, formats.expansions); + return { tmenu: tmenu }; + }; + var makeItem = function (value, text, selected, preview, isMenu) { + return { + data: { + value: value, + text: text + }, + type: 'item', + dom: { + tag: 'div', + classes: isMenu ? [Styles.resolve('styles-item-is-menu')] : [] + }, + toggling: { + toggleOnExecute: false, + toggleClass: Styles.resolve('format-matches'), + selected: selected + }, + itemBehaviours: derive$1(isMenu ? [] : [Receivers.format(value, function (comp, status) { + var toggle = status ? Toggling.on : Toggling.off; + toggle(comp); + })]), + components: [{ + dom: { + tag: 'div', + attributes: { style: preview }, + innerHtml: text + } + }] + }; + }; + var makeMenu = function (value, items, memMenuThunk, collapsable) { + return { + value: value, + dom: { tag: 'div' }, + components: [ + Button.sketch({ + dom: { + tag: 'div', + classes: [Styles.resolve('styles-collapser')] + }, + components: collapsable ? [ + { + dom: { + tag: 'span', + classes: [Styles.resolve('styles-collapse-icon')] + } + }, + text(value) + ] : [text(value)], + action: function (item) { + if (collapsable) { + var comp = memMenuThunk().get(item); + tieredMenu.collapseMenu(comp); + } + } + }), + { + dom: { + tag: 'div', + classes: [Styles.resolve('styles-menu-items-container')] + }, + components: [Menu.parts().items({})], + behaviours: derive$1([config('adhoc-scrollable-menu', [ + runOnAttached(function (component, simulatedEvent) { + set$3(component.element(), 'overflow-y', 'auto'); + set$3(component.element(), '-webkit-overflow-scrolling', 'touch'); + Scrollable.register(component.element()); + }), + runOnDetached(function (component) { + remove$5(component.element(), 'overflow-y'); + remove$5(component.element(), '-webkit-overflow-scrolling'); + Scrollable.deregister(component.element()); + }) + ])]) + } + ], + items: items, + menuBehaviours: derive$1([Transitioning.config({ + initialState: 'after', + routes: Transitioning.createTristate('before', 'current', 'after', { + transition: { + property: 'transform', + transitionClass: 'transitioning' + } + }) + })]) + }; + }; + var sketch$8 = function (settings) { + var dataset = convert$1(settings.formats, function () { + return memMenu; + }); + var memMenu = record(tieredMenu.sketch({ + dom: { + tag: 'div', + classes: [Styles.resolve('styles-menu')] + }, + components: [], + fakeFocus: true, + stayInDom: true, + onExecute: function (tmenu, item) { + var v = Representing.getValue(item); + settings.handle(item, v.value); + return Option.none(); + }, + onEscape: function () { + return Option.none(); + }, + onOpenMenu: function (container, menu) { + var w = get$7(container.element()); + set$4(menu.element(), w); + Transitioning.jumpTo(menu, 'current'); + }, + onOpenSubmenu: function (container, item, submenu) { + var w = get$7(container.element()); + var menu = ancestor$2(item.element(), '[role="menu"]').getOrDie('hacky'); + var menuComp = container.getSystem().getByDom(menu).getOrDie(); + set$4(submenu.element(), w); + Transitioning.progressTo(menuComp, 'before'); + Transitioning.jumpTo(submenu, 'after'); + Transitioning.progressTo(submenu, 'current'); + }, + onCollapseMenu: function (container, item, menu) { + var submenu = ancestor$2(item.element(), '[role="menu"]').getOrDie('hacky'); + var submenuComp = container.getSystem().getByDom(submenu).getOrDie(); + Transitioning.progressTo(submenuComp, 'after'); + Transitioning.progressTo(menu, 'current'); + }, + navigateOnHover: false, + highlightImmediately: true, + data: dataset.tmenu, + markers: { + backgroundMenu: Styles.resolve('styles-background-menu'), + menu: Styles.resolve('styles-menu'), + selectedMenu: Styles.resolve('styles-selected-menu'), + item: Styles.resolve('styles-item'), + selectedItem: Styles.resolve('styles-selected-item') + } + })); + return memMenu.asSpec(); + }; + var StylesMenu = { sketch: sketch$8 }; + + var getFromExpandingItem = function (item) { + var newItem = deepMerge(exclude$1(item, ['items']), { menu: true }); + var rest = expand(item.items); + var newMenus = deepMerge(rest.menus, wrap$1(item.title, rest.items)); + var newExpansions = deepMerge(rest.expansions, wrap$1(item.title, item.title)); + return { + item: newItem, + menus: newMenus, + expansions: newExpansions + }; + }; + var getFromItem = function (item) { + return hasNonNullableKey(item, 'items') ? getFromExpandingItem(item) : { + item: item, + menus: {}, + expansions: {} + }; + }; + var expand = function (items) { + return foldr(items, function (acc, item) { + var newData = getFromItem(item); + return { + menus: deepMerge(acc.menus, newData.menus), + items: [newData.item].concat(acc.items), + expansions: deepMerge(acc.expansions, newData.expansions) + }; + }, { + menus: {}, + expansions: {}, + items: [] + }); + }; + var StyleConversions = { expand: expand }; + + var register$1 = function (editor, settings) { + var isSelectedFor = function (format) { + return function () { + return editor.formatter.match(format); + }; + }; + var getPreview = function (format) { + return function () { + var styles = editor.formatter.getCssText(format); + return styles; + }; + }; + var enrichSupported = function (item) { + return deepMerge(item, { + isSelected: isSelectedFor(item.format), + getPreview: getPreview(item.format) + }); + }; + var enrichMenu = function (item) { + return deepMerge(item, { + isSelected: constant(false), + getPreview: constant('') + }); + }; + var enrichCustom = function (item) { + var formatName = generate$1(item.title); + var newItem = deepMerge(item, { + format: formatName, + isSelected: isSelectedFor(formatName), + getPreview: getPreview(formatName) + }); + editor.formatter.register(formatName, newItem); + return newItem; + }; + var formats = get(settings, 'style_formats').getOr(DefaultStyleFormats); + var doEnrich = function (items) { + return map$1(items, function (item) { + if (hasNonNullableKey(item, 'items')) { + var newItems = doEnrich(item.items); + return deepMerge(enrichMenu(item), { items: newItems }); + } else if (hasNonNullableKey(item, 'format')) { + return enrichSupported(item); + } else { + return enrichCustom(item); + } + }); + }; + return doEnrich(formats); + }; + var prune = function (editor, formats) { + var doPrune = function (items) { + return bind(items, function (item) { + if (item.items !== undefined) { + var newItems = doPrune(item.items); + return newItems.length > 0 ? [item] : []; + } else { + var keep = hasNonNullableKey(item, 'format') ? editor.formatter.canApply(item.format) : true; + return keep ? [item] : []; + } + }); + }; + var prunedItems = doPrune(formats); + return StyleConversions.expand(prunedItems); + }; + var ui = function (editor, formats, onDone) { + var pruned = prune(editor, formats); + return StylesMenu.sketch({ + formats: pruned, + handle: function (item, value) { + editor.undoManager.transact(function () { + if (Toggling.isOn(item)) { + editor.formatter.remove(value); + } else { + editor.formatter.apply(value); + } + }); + onDone(); + } + }); + }; + var StyleFormats = { + register: register$1, + ui: ui + }; + + var defaults = [ + 'undo', + 'bold', + 'italic', + 'link', + 'image', + 'bullist', + 'styleselect' + ]; + var extract$1 = function (rawToolbar) { + var toolbar = rawToolbar.replace(/\|/g, ' ').trim(); + return toolbar.length > 0 ? toolbar.split(/\s+/) : []; + }; + var identifyFromArray = function (toolbar) { + return bind(toolbar, function (item) { + return isArray(item) ? identifyFromArray(item) : extract$1(item); + }); + }; + var identify = function (settings) { + var toolbar = settings.toolbar !== undefined ? settings.toolbar : defaults; + return isArray(toolbar) ? identifyFromArray(toolbar) : extract$1(toolbar); + }; + var setup = function (realm, editor) { + var commandSketch = function (name) { + return function () { + return Buttons.forToolbarCommand(editor, name); + }; + }; + var stateCommandSketch = function (name) { + return function () { + return Buttons.forToolbarStateCommand(editor, name); + }; + }; + var actionSketch = function (name, query, action) { + return function () { + return Buttons.forToolbarStateAction(editor, name, query, action); + }; + }; + var undo = commandSketch('undo'); + var redo = commandSketch('redo'); + var bold = stateCommandSketch('bold'); + var italic = stateCommandSketch('italic'); + var underline = stateCommandSketch('underline'); + var removeformat = commandSketch('removeformat'); + var link = function () { + return sketch$7(realm, editor); + }; + var unlink = actionSketch('unlink', 'link', function () { + editor.execCommand('unlink', null, false); + }); + var image = function () { + return sketch$4(editor); + }; + var bullist = actionSketch('unordered-list', 'ul', function () { + editor.execCommand('InsertUnorderedList', null, false); + }); + var numlist = actionSketch('ordered-list', 'ol', function () { + editor.execCommand('InsertOrderedList', null, false); + }); + var fontsizeselect = function () { + return sketch$3(realm, editor); + }; + var forecolor = function () { + return ColorSlider.sketch(realm, editor); + }; + var styleFormats = StyleFormats.register(editor, editor.settings); + var styleFormatsMenu = function () { + return StyleFormats.ui(editor, styleFormats, function () { + editor.fire('scrollIntoView'); + }); + }; + var styleselect = function () { + return Buttons.forToolbar('style-formats', function (button) { + editor.fire('toReading'); + realm.dropup().appear(styleFormatsMenu, Toggling.on, button); + }, derive$1([ + Toggling.config({ + toggleClass: Styles.resolve('toolbar-button-selected'), + toggleOnExecute: false, + aria: { mode: 'pressed' } + }), + Receiving.config({ + channels: wrapAll$1([ + Receivers.receive(TinyChannels.orientationChanged(), Toggling.off), + Receivers.receive(TinyChannels.dropupDismissed(), Toggling.off) + ]) + }) + ]), editor); + }; + var feature = function (prereq, sketch) { + return { + isSupported: function () { + var buttons = editor.ui.registry.getAll().buttons; + return prereq.forall(function (p) { + return hasNonNullableKey(buttons, p); + }); + }, + sketch: sketch + }; + }; + return { + undo: feature(Option.none(), undo), + redo: feature(Option.none(), redo), + bold: feature(Option.none(), bold), + italic: feature(Option.none(), italic), + underline: feature(Option.none(), underline), + removeformat: feature(Option.none(), removeformat), + link: feature(Option.none(), link), + unlink: feature(Option.none(), unlink), + image: feature(Option.none(), image), + bullist: feature(Option.some('bullist'), bullist), + numlist: feature(Option.some('numlist'), numlist), + fontsizeselect: feature(Option.none(), fontsizeselect), + forecolor: feature(Option.none(), forecolor), + styleselect: feature(Option.none(), styleselect) + }; + }; + var detect$4 = function (settings, features) { + var itemNames = identify(settings); + var present = {}; + return bind(itemNames, function (iName) { + var r = !hasNonNullableKey(present, iName) && hasNonNullableKey(features, iName) && features[iName].isSupported() ? [features[iName].sketch()] : []; + present[iName] = true; + return r; + }); + }; + var Features = { + identify: identify, + setup: setup, + detect: detect$4 + }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: constant(target), + x: constant(x), + y: constant(y), + stop: stop, + prevent: prevent, + kill: kill, + raw: constant(raw) + }; + }; + var fromRawEvent = function (rawEvent) { + var target = Element.fromDom(rawEvent.target); + var stop = function () { + rawEvent.stopPropagation(); + }; + var prevent = function () { + rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + }; + var handle = function (filter, handler) { + return function (rawEvent) { + if (!filter(rawEvent)) { + return; + } + handler(fromRawEvent(rawEvent)); + }; + }; + var binder = function (element, event, filter, handler, useCapture) { + var wrapped = handle(filter, handler); + element.dom().addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; + }; + var bind$2 = function (element, event, filter, handler) { + return binder(element, event, filter, handler, false); + }; + var capture = function (element, event, filter, handler) { + return binder(element, event, filter, handler, true); + }; + var unbind = function (element, event, handler, useCapture) { + element.dom().removeEventListener(event, handler, useCapture); + }; + + var filter$1 = constant(true); + var bind$3 = function (element, event, handler) { + return bind$2(element, event, filter$1, handler); + }; + var capture$1 = function (element, event, handler) { + return capture(element, event, filter$1, handler); + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var INTERVAL = 50; + var INSURANCE = 1000 / INTERVAL; + var get$b = function (outerWindow) { + var isPortrait = outerWindow.matchMedia('(orientation: portrait)').matches; + return { isPortrait: constant(isPortrait) }; + }; + var getActualWidth = function (outerWindow) { + var isIos = detect$3().os.isiOS(); + var isPortrait = get$b(outerWindow).isPortrait(); + return isIos && !isPortrait ? outerWindow.screen.height : outerWindow.screen.width; + }; + var onChange = function (outerWindow, listeners) { + var win = Element.fromDom(outerWindow); + var poller = null; + var change = function () { + global$4.clearInterval(poller); + var orientation = get$b(outerWindow); + listeners.onChange(orientation); + onAdjustment(function () { + listeners.onReady(orientation); + }); + }; + var orientationHandle = bind$3(win, 'orientationchange', change); + var onAdjustment = function (f) { + global$4.clearInterval(poller); + var flag = outerWindow.innerHeight; + var insurance = 0; + poller = global$4.setInterval(function () { + if (flag !== outerWindow.innerHeight) { + global$4.clearInterval(poller); + f(Option.some(outerWindow.innerHeight)); + } else if (insurance > INSURANCE) { + global$4.clearInterval(poller); + f(Option.none()); + } + insurance++; + }, INTERVAL); + }; + var destroy = function () { + orientationHandle.unbind(); + }; + return { + onAdjustment: onAdjustment, + destroy: destroy + }; + }; + var Orientation = { + get: get$b, + onChange: onChange, + getActualWidth: getActualWidth + }; + + function DelayedFunction (fun, delay) { + var ref = null; + var schedule = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + ref = domGlobals.setTimeout(function () { + fun.apply(null, args); + ref = null; + }, delay); + }; + var cancel = function () { + if (ref !== null) { + domGlobals.clearTimeout(ref); + ref = null; + } + }; + return { + cancel: cancel, + schedule: schedule + }; + } + + var SIGNIFICANT_MOVE = 5; + var LONGPRESS_DELAY = 400; + var getTouch = function (event) { + var raw = event.raw(); + if (raw.touches === undefined || raw.touches.length !== 1) { + return Option.none(); + } + return Option.some(raw.touches[0]); + }; + var isFarEnough = function (touch, data) { + var distX = Math.abs(touch.clientX - data.x()); + var distY = Math.abs(touch.clientY - data.y()); + return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; + }; + var monitor = function (settings) { + var startData = Cell(Option.none()); + var longpressFired = Cell(false); + var longpress$1 = DelayedFunction(function (event) { + settings.triggerEvent(longpress(), event); + longpressFired.set(true); + }, LONGPRESS_DELAY); + var handleTouchstart = function (event) { + getTouch(event).each(function (touch) { + longpress$1.cancel(); + var data = { + x: constant(touch.clientX), + y: constant(touch.clientY), + target: event.target + }; + longpress$1.schedule(event); + longpressFired.set(false); + startData.set(Option.some(data)); + }); + return Option.none(); + }; + var handleTouchmove = function (event) { + longpress$1.cancel(); + getTouch(event).each(function (touch) { + startData.get().each(function (data) { + if (isFarEnough(touch, data)) { + startData.set(Option.none()); + } + }); + }); + return Option.none(); + }; + var handleTouchend = function (event) { + longpress$1.cancel(); + var isSame = function (data) { + return eq(data.target(), event.target()); + }; + return startData.get().filter(isSame).map(function (data) { + if (longpressFired.get()) { + event.prevent(); + return false; + } else { + return settings.triggerEvent(tap(), event); + } + }); + }; + var handlers = wrapAll$1([ + { + key: touchstart(), + value: handleTouchstart + }, + { + key: touchmove(), + value: handleTouchmove + }, + { + key: touchend(), + value: handleTouchend + } + ]); + var fireIfReady = function (event, type) { + return get(handlers, type).bind(function (handler) { + return handler(event); + }); + }; + return { fireIfReady: fireIfReady }; + }; + + var monitor$1 = function (editorApi) { + var tapEvent = monitor({ + triggerEvent: function (type, evt) { + editorApi.onTapContent(evt); + } + }); + var onTouchend = function () { + return bind$3(editorApi.body(), 'touchend', function (evt) { + tapEvent.fireIfReady(evt, 'touchend'); + }); + }; + var onTouchmove = function () { + return bind$3(editorApi.body(), 'touchmove', function (evt) { + tapEvent.fireIfReady(evt, 'touchmove'); + }); + }; + var fireTouchstart = function (evt) { + tapEvent.fireIfReady(evt, 'touchstart'); + }; + return { + fireTouchstart: fireTouchstart, + onTouchend: onTouchend, + onTouchmove: onTouchmove + }; + }; + var TappingEvent = { monitor: monitor$1 }; + + var isAndroid6 = detect$3().os.version.major >= 6; + var initEvents = function (editorApi, toolstrip, alloy) { + var tapping = TappingEvent.monitor(editorApi); + var outerDoc = owner(toolstrip); + var isRanged = function (sel) { + return !eq(sel.start(), sel.finish()) || sel.soffset() !== sel.foffset(); + }; + var hasRangeInUi = function () { + return active(outerDoc).filter(function (input) { + return name(input) === 'input'; + }).exists(function (input) { + return input.dom().selectionStart !== input.dom().selectionEnd; + }); + }; + var updateMargin = function () { + var rangeInContent = editorApi.doc().dom().hasFocus() && editorApi.getSelection().exists(isRanged); + alloy.getByDom(toolstrip).each((rangeInContent || hasRangeInUi()) === true ? Toggling.on : Toggling.off); + }; + var listeners = [ + bind$3(editorApi.body(), 'touchstart', function (evt) { + editorApi.onTouchContent(); + tapping.fireTouchstart(evt); + }), + tapping.onTouchmove(), + tapping.onTouchend(), + bind$3(toolstrip, 'touchstart', function (evt) { + editorApi.onTouchToolstrip(); + }), + editorApi.onToReading(function () { + blur(editorApi.body()); + }), + editorApi.onToEditing(noop), + editorApi.onScrollToCursor(function (tinyEvent) { + tinyEvent.preventDefault(); + editorApi.getCursorBox().each(function (bounds) { + var cWin = editorApi.win(); + var isOutside = bounds.top() > cWin.innerHeight || bounds.bottom() > cWin.innerHeight; + var cScrollBy = isOutside ? bounds.bottom() - cWin.innerHeight + 50 : 0; + if (cScrollBy !== 0) { + cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); + } + }); + }) + ].concat(isAndroid6 === true ? [] : [ + bind$3(Element.fromDom(editorApi.win()), 'blur', function () { + alloy.getByDom(toolstrip).each(Toggling.off); + }), + bind$3(outerDoc, 'select', updateMargin), + bind$3(editorApi.doc(), 'selectionchange', updateMargin) + ]); + var destroy = function () { + each$1(listeners, function (l) { + l.unbind(); + }); + }; + return { destroy: destroy }; + }; + var AndroidEvents = { initEvents: initEvents }; + + var safeParse = function (element, attribute) { + var parsed = parseInt(get$1(element, attribute), 10); + return isNaN(parsed) ? 0 : parsed; + }; + var DataAttributes = { safeParse: safeParse }; + + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Option.from(element.dom().nodeValue) : Option.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom().nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; + } + + var api$3 = NodeValue(isText, 'text'); + var getOption = function (element) { + return api$3.getOption(element); + }; + + var getEnd = function (element) { + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); + }; + + var create$3 = Immutable('start', 'soffset', 'finish', 'foffset'); + var SimRange = { create: create$3 }; + + var adt$4 = Adt.generate([ + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } + ]); + var cata = function (subject, onBefore, onOn, onAfter) { + return subject.fold(onBefore, onOn, onAfter); + }; + var getStart = function (situ) { + return situ.fold(identity, identity, identity); + }; + var before$1 = adt$4.before; + var on$1 = adt$4.on; + var after$1 = adt$4.after; + var Situ = { + before: before$1, + on: on$1, + after: after$1, + cata: cata, + getStart: getStart + }; + + var adt$5 = Adt.generate([ + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var exactFromRange = function (simRange) { + return adt$5.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset()); + }; + var getStart$1 = function (selection) { + return selection.match({ + domRange: function (rng) { + return Element.fromDom(rng.startContainer); + }, + relative: function (startSitu, finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, soffset, finish, foffset) { + return start; + } + }); + }; + var domRange = adt$5.domRange; + var relative = adt$5.relative; + var exact = adt$5.exact; + var getWin = function (selection) { + var start = getStart$1(selection); + return defaultView(start); + }; + var range$1 = SimRange.create; + var Selection = { + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$1 + }; + + var setStart = function (rng, situ) { + situ.fold(function (e) { + rng.setStartBefore(e.dom()); + }, function (e, o) { + rng.setStart(e.dom(), o); + }, function (e) { + rng.setStartAfter(e.dom()); + }); + }; + var setFinish = function (rng, situ) { + situ.fold(function (e) { + rng.setEndBefore(e.dom()); + }, function (e, o) { + rng.setEnd(e.dom(), o); + }, function (e) { + rng.setEndAfter(e.dom()); + }); + }; + var relativeToNative = function (win, startSitu, finishSitu) { + var range = win.document.createRange(); + setStart(range, startSitu); + setFinish(range, finishSitu); + return range; + }; + var exactToNative = function (win, start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom(), soffset); + rng.setEnd(finish.dom(), foffset); + return rng; + }; + var toRect = function (rect) { + return { + left: constant(rect.left), + top: constant(rect.top), + right: constant(rect.right), + bottom: constant(rect.bottom), + width: constant(rect.width), + height: constant(rect.height) + }; + }; + var getFirstRect = function (rng) { + var rects = rng.getClientRects(); + var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect) : Option.none(); + }; + + var adt$6 = Adt.generate([ + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var fromRange = function (win, type, range) { + return type(Element.fromDom(range.startContainer), range.startOffset, Element.fromDom(range.endContainer), range.endOffset); + }; + var getRanges = function (win, selection) { + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Option.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Option.some(relativeToNative(win, finishSitu, startSitu)); + }) + }; + }, + exact: function (start, soffset, finish, foffset) { + return { + ltr: cached(function () { + return exactToNative(win, start, soffset, finish, foffset); + }), + rtl: cached(function () { + return Option.some(exactToNative(win, finish, foffset, start, soffset)); + }) + }; + } + }); + }; + var doDiagnose = function (win, ranges) { + var rng = ranges.ltr(); + if (rng.collapsed) { + var reversed = ranges.rtl().filter(function (rev) { + return rev.collapsed === false; + }); + return reversed.map(function (rev) { + return adt$6.rtl(Element.fromDom(rev.endContainer), rev.endOffset, Element.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$6.ltr, rng); + }); + } else { + return fromRange(win, adt$6.ltr, rng); + } + }; + var diagnose = function (win, selection) { + var ranges = getRanges(win, selection); + return doDiagnose(win, ranges); + }; + var asLtrRange = function (win, selection) { + var diagnosis = diagnose(win, selection); + return diagnosis.match({ + ltr: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom(), soffset); + rng.setEnd(finish.dom(), foffset); + return rng; + }, + rtl: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(finish.dom(), foffset); + rng.setEnd(start.dom(), soffset); + return rng; + } + }); + }; + var ltr = adt$6.ltr; + var rtl = adt$6.rtl; + + var beforeSpecial = function (element, offset) { + var name$1 = name(element); + if ('input' === name$1) { + return Situ.after(element); + } else if (!contains([ + 'br', + 'img' + ], name$1)) { + return Situ.on(element, offset); + } else { + return offset === 0 ? Situ.before(element) : Situ.after(element); + } + }; + var preprocessExact = function (start, soffset, finish, foffset) { + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return Selection.relative(startSitu, finishSitu); + }; + + var makeRange = function (start, soffset, finish, foffset) { + var doc = owner(start); + var rng = doc.dom().createRange(); + rng.setStart(start.dom(), soffset); + rng.setEnd(finish.dom(), foffset); + return rng; + }; + var after$2 = function (start, soffset, finish, foffset) { + var r = makeRange(start, soffset, finish, foffset); + var same = eq(start, finish) && soffset === foffset; + return r.collapsed && !same; + }; + + var doSetNativeRange = function (win, rng) { + Option.from(win.getSelection()).each(function (selection) { + selection.removeAllRanges(); + selection.addRange(rng); + }); + }; + var doSetRange = function (win, start, soffset, finish, foffset) { + var rng = exactToNative(win, start, soffset, finish, foffset); + doSetNativeRange(win, rng); + }; + var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) { + selection.collapse(start.dom(), soffset); + selection.extend(finish.dom(), foffset); + }; + var setRangeFromRelative = function (win, relative) { + return diagnose(win, relative).match({ + ltr: function (start, soffset, finish, foffset) { + doSetRange(win, start, soffset, finish, foffset); + }, + rtl: function (start, soffset, finish, foffset) { + var selection = win.getSelection(); + if (selection.setBaseAndExtent) { + selection.setBaseAndExtent(start.dom(), soffset, finish.dom(), foffset); + } else if (selection.extend) { + try { + setLegacyRtlRange(win, selection, start, soffset, finish, foffset); + } catch (e) { + doSetRange(win, finish, foffset, start, soffset); + } + } else { + doSetRange(win, finish, foffset, start, soffset); + } + } + }); + }; + var setExact = function (win, start, soffset, finish, foffset) { + var relative = preprocessExact(start, soffset, finish, foffset); + setRangeFromRelative(win, relative); + }; + var readRange = function (selection) { + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Option.some(SimRange.create(Element.fromDom(firstRng.startContainer), firstRng.startOffset, Element.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Option.none(); + } + }; + var doGetExact = function (selection) { + var anchor = Element.fromDom(selection.anchorNode); + var focus = Element.fromDom(selection.focusNode); + return after$2(anchor, selection.anchorOffset, focus, selection.focusOffset) ? Option.some(SimRange.create(anchor, selection.anchorOffset, focus, selection.focusOffset)) : readRange(selection); + }; + var getExact = function (win) { + return Option.from(win.getSelection()).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); + }; + var get$c = function (win) { + return getExact(win).map(function (range) { + return Selection.exact(range.start(), range.soffset(), range.finish(), range.foffset()); + }); + }; + var getFirstRect$1 = function (win, selection) { + var rng = asLtrRange(win, selection); + return getFirstRect(rng); + }; + var clear$1 = function (win) { + var selection = win.getSelection(); + selection.removeAllRanges(); + }; + + var COLLAPSED_WIDTH = 2; + var collapsedRect = function (rect) { + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: constant(COLLAPSED_WIDTH), + height: rect.height + }; + }; + var toRect$1 = function (rawRect) { + return { + left: constant(rawRect.left), + top: constant(rawRect.top), + right: constant(rawRect.right), + bottom: constant(rawRect.bottom), + width: constant(rawRect.width), + height: constant(rawRect.height) + }; + }; + var getRectsFromRange = function (range) { + if (!range.collapsed) { + return map$1(range.getClientRects(), toRect$1); + } else { + var start_1 = Element.fromDom(range.startContainer); + return parent(start_1).bind(function (parent) { + var selection = Selection.exact(start_1, range.startOffset, parent, getEnd(parent)); + var optRect = getFirstRect$1(range.startContainer.ownerDocument.defaultView, selection); + return optRect.map(collapsedRect).map(pure); + }).getOr([]); + } + }; + var getRectangles = function (cWin) { + var sel = cWin.getSelection(); + return sel !== undefined && sel.rangeCount > 0 ? getRectsFromRange(sel.getRangeAt(0)) : []; + }; + var Rectangles = { getRectangles: getRectangles }; + + var autocompleteHack = function () { + return function (f) { + global$4.setTimeout(function () { + f(); + }, 0); + }; + }; + var resume = function (cWin) { + cWin.focus(); + var iBody = Element.fromDom(cWin.document.body); + var inInput = active().exists(function (elem) { + return contains([ + 'input', + 'textarea' + ], name(elem)); + }); + var transaction = inInput ? autocompleteHack() : apply; + transaction(function () { + active().each(blur); + focus$1(iBody); + }); + }; + var ResumeEditing = { resume: resume }; + + var EXTRA_SPACING = 50; + var data = 'data-' + Styles.resolve('last-outer-height'); + var setLastHeight = function (cBody, value) { + set(cBody, data, value); + }; + var getLastHeight = function (cBody) { + return DataAttributes.safeParse(cBody, data); + }; + var getBoundsFrom = function (rect) { + return { + top: constant(rect.top()), + bottom: constant(rect.top() + rect.height()) + }; + }; + var getBounds$1 = function (cWin) { + var rects = Rectangles.getRectangles(cWin); + return rects.length > 0 ? Option.some(rects[0]).map(getBoundsFrom) : Option.none(); + }; + var findDelta = function (outerWindow, cBody) { + var last = getLastHeight(cBody); + var current = outerWindow.innerHeight; + return last > current ? Option.some(last - current) : Option.none(); + }; + var calculate = function (cWin, bounds, delta) { + var isOutside = bounds.top() > cWin.innerHeight || bounds.bottom() > cWin.innerHeight; + return isOutside ? Math.min(delta, bounds.bottom() - cWin.innerHeight + EXTRA_SPACING) : 0; + }; + var setup$1 = function (outerWindow, cWin) { + var cBody = Element.fromDom(cWin.document.body); + var toEditing = function () { + ResumeEditing.resume(cWin); + }; + var onResize = bind$3(Element.fromDom(outerWindow), 'resize', function () { + findDelta(outerWindow, cBody).each(function (delta) { + getBounds$1(cWin).each(function (bounds) { + var cScrollBy = calculate(cWin, bounds, delta); + if (cScrollBy !== 0) { + cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); + } + }); + }); + setLastHeight(cBody, outerWindow.innerHeight); + }); + setLastHeight(cBody, outerWindow.innerHeight); + var destroy = function () { + onResize.unbind(); + }; + return { + toEditing: toEditing, + destroy: destroy + }; + }; + var AndroidSetup = { setup: setup$1 }; + + var getBodyFromFrame = function (frame) { + return Option.some(Element.fromDom(frame.dom().contentWindow.document.body)); + }; + var getDocFromFrame = function (frame) { + return Option.some(Element.fromDom(frame.dom().contentWindow.document)); + }; + var getWinFromFrame = function (frame) { + return Option.from(frame.dom().contentWindow); + }; + var getSelectionFromFrame = function (frame) { + var optWin = getWinFromFrame(frame); + return optWin.bind(getExact); + }; + var getFrame = function (editor) { + return editor.getFrame(); + }; + var getOrDerive = function (name, f) { + return function (editor) { + var g = editor[name].getOrThunk(function () { + var frame = getFrame(editor); + return function () { + return f(frame); + }; + }); + return g(); + }; + }; + var getOrListen = function (editor, doc, name, type) { + return editor[name].getOrThunk(function () { + return function (handler) { + return bind$3(doc, type, handler); + }; + }); + }; + var toRect$2 = function (rect) { + return { + left: constant(rect.left), + top: constant(rect.top), + right: constant(rect.right), + bottom: constant(rect.bottom), + width: constant(rect.width), + height: constant(rect.height) + }; + }; + var getActiveApi = function (editor) { + var frame = getFrame(editor); + var tryFallbackBox = function (win) { + var isCollapsed = function (sel) { + return eq(sel.start(), sel.finish()) && sel.soffset() === sel.foffset(); + }; + var toStartRect = function (sel) { + var rect = sel.start().dom().getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect$2) : Option.none(); + }; + return getExact(win).filter(isCollapsed).bind(toStartRect); + }; + return getBodyFromFrame(frame).bind(function (body) { + return getDocFromFrame(frame).bind(function (doc) { + return getWinFromFrame(frame).map(function (win) { + var html = Element.fromDom(doc.dom().documentElement); + var getCursorBox = editor.getCursorBox.getOrThunk(function () { + return function () { + return get$c(win).bind(function (sel) { + return getFirstRect$1(win, sel).orThunk(function () { + return tryFallbackBox(win); + }); + }); + }; + }); + var setSelection = editor.setSelection.getOrThunk(function () { + return function (start, soffset, finish, foffset) { + setExact(win, start, soffset, finish, foffset); + }; + }); + var clearSelection = editor.clearSelection.getOrThunk(function () { + return function () { + clear$1(win); + }; + }); + return { + body: constant(body), + doc: constant(doc), + win: constant(win), + html: constant(html), + getSelection: curry(getSelectionFromFrame, frame), + setSelection: setSelection, + clearSelection: clearSelection, + frame: constant(frame), + onKeyup: getOrListen(editor, doc, 'onKeyup', 'keyup'), + onNodeChanged: getOrListen(editor, doc, 'onNodeChanged', 'SelectionChange'), + onDomChanged: editor.onDomChanged, + onScrollToCursor: editor.onScrollToCursor, + onScrollToElement: editor.onScrollToElement, + onToReading: editor.onToReading, + onToEditing: editor.onToEditing, + onToolbarScrollStart: editor.onToolbarScrollStart, + onTouchContent: editor.onTouchContent, + onTapContent: editor.onTapContent, + onTouchToolstrip: editor.onTouchToolstrip, + getCursorBox: getCursorBox + }; + }); + }); + }); + }; + var PlatformEditor = { + getBody: getOrDerive('getBody', getBodyFromFrame), + getDoc: getOrDerive('getDoc', getDocFromFrame), + getWin: getOrDerive('getWin', getWinFromFrame), + getSelection: getOrDerive('getSelection', getSelectionFromFrame), + getFrame: getFrame, + getActiveApi: getActiveApi + }; + + var attr = 'data-ephox-mobile-fullscreen-style'; + var siblingStyles = 'display:none!important;'; + var ancestorPosition = 'position:absolute!important;'; + var ancestorStyles = 'top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;'; + var bgFallback = 'background-color:rgb(255,255,255)!important;'; + var isAndroid = detect$3().os.isAndroid(); + var matchColor = function (editorBody) { + var color = get$4(editorBody, 'background-color'); + return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; + }; + var clobberStyles = function (container, editorBody) { + var gatherSibilings = function (element) { + var siblings = siblings$2(element, '*'); + return siblings; + }; + var clobber = function (clobberStyle) { + return function (element) { + var styles = get$1(element, 'style'); + var backup = styles === undefined ? 'no-styles' : styles.trim(); + if (backup === clobberStyle) { + return; + } else { + set(element, attr, backup); + set(element, 'style', clobberStyle); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSibilings); + var bgColor = matchColor(editorBody); + each$1(siblings, clobber(siblingStyles)); + each$1(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); + var containerStyles = isAndroid === true ? '' : ancestorPosition; + clobber(containerStyles + ancestorStyles + bgColor)(container); + }; + var restoreStyles = function () { + var clobberedEls = all$2('[' + attr + ']'); + each$1(clobberedEls, function (element) { + var restore = get$1(element, attr); + if (restore !== 'no-styles') { + set(element, 'style', restore); + } else { + remove$1(element, 'style'); + } + remove$1(element, attr); + }); + }; + var Thor = { + clobberStyles: clobberStyles, + restoreStyles: restoreStyles + }; + + var tag = function () { + var head = first('head').getOrDie(); + var nu = function () { + var meta = Element.fromTag('meta'); + set(meta, 'name', 'viewport'); + append(head, meta); + return meta; + }; + var element = first('meta[name="viewport"]').getOrThunk(nu); + var backup = get$1(element, 'content'); + var maximize = function () { + set(element, 'content', 'width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0'); + }; + var restore = function () { + if (backup !== undefined && backup !== null && backup.length > 0) { + set(element, 'content', backup); + } else { + set(element, 'content', 'user-scalable=yes'); + } + }; + return { + maximize: maximize, + restore: restore + }; + }; + var MetaViewport = { tag: tag }; + + var create$4 = function (platform, mask) { + var meta = MetaViewport.tag(); + var androidApi = api$2(); + var androidEvents = api$2(); + var enter = function () { + mask.hide(); + add$2(platform.container, Styles.resolve('fullscreen-maximized')); + add$2(platform.container, Styles.resolve('android-maximized')); + meta.maximize(); + add$2(platform.body, Styles.resolve('android-scroll-reload')); + androidApi.set(AndroidSetup.setup(platform.win, PlatformEditor.getWin(platform.editor).getOrDie('no'))); + PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) { + Thor.clobberStyles(platform.container, editorApi.body()); + androidEvents.set(AndroidEvents.initEvents(editorApi, platform.toolstrip, platform.alloy)); + }); + }; + var exit = function () { + meta.restore(); + mask.show(); + remove$4(platform.container, Styles.resolve('fullscreen-maximized')); + remove$4(platform.container, Styles.resolve('android-maximized')); + Thor.restoreStyles(); + remove$4(platform.body, Styles.resolve('android-scroll-reload')); + androidEvents.clear(); + androidApi.clear(); + }; + return { + enter: enter, + exit: exit + }; + }; + var AndroidMode = { create: create$4 }; + + var first$1 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer === null) { + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + } + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + var last = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var sketch$9 = function (onView, translate) { + var memIcon = record(Container.sketch({ + dom: dom$1(''), + containerBehaviours: derive$1([Toggling.config({ + toggleClass: Styles.resolve('mask-tap-icon-selected'), + toggleOnExecute: false + })]) + })); + var onViewThrottle = first$1(onView, 200); + return Container.sketch({ + dom: dom$1('
    '), + components: [Container.sketch({ + dom: dom$1('
    '), + components: [Button.sketch({ + dom: dom$1('
    '), + components: [memIcon.asSpec()], + action: function (button) { + onViewThrottle.throttle(); + }, + buttonBehaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('mask-tap-icon-selected') })]) + })] + })] + }); + }; + var TapToEditMask = { sketch: sketch$9 }; + + var MobileSchema = objOf([ + strictObjOf('editor', [ + strict$1('getFrame'), + option('getBody'), + option('getDoc'), + option('getWin'), + option('getSelection'), + option('setSelection'), + option('clearSelection'), + option('cursorSaver'), + option('onKeyup'), + option('onNodeChanged'), + option('getCursorBox'), + strict$1('onDomChanged'), + defaulted$1('onTouchContent', noop), + defaulted$1('onTapContent', noop), + defaulted$1('onTouchToolstrip', noop), + defaulted$1('onScrollToCursor', constant({ unbind: noop })), + defaulted$1('onScrollToElement', constant({ unbind: noop })), + defaulted$1('onToEditing', constant({ unbind: noop })), + defaulted$1('onToReading', constant({ unbind: noop })), + defaulted$1('onToolbarScrollStart', identity) + ]), + strict$1('socket'), + strict$1('toolstrip'), + strict$1('dropup'), + strict$1('toolbar'), + strict$1('container'), + strict$1('alloy'), + state$1('win', function (spec) { + return owner(spec.socket).dom().defaultView; + }), + state$1('body', function (spec) { + return Element.fromDom(spec.socket.dom().ownerDocument.body); + }), + defaulted$1('translate', identity), + defaulted$1('setReadOnly', noop), + defaulted$1('readOnlyOnInit', constant(true)) + ]); + + var produce = function (raw) { + var mobile = asRawOrDie('Getting AndroidWebapp schema', MobileSchema, raw); + set$3(mobile.toolstrip, 'width', '100%'); + var onTap = function () { + mobile.setReadOnly(mobile.readOnlyOnInit()); + mode.enter(); + }; + var mask = build$1(TapToEditMask.sketch(onTap, mobile.translate)); + mobile.alloy.add(mask); + var maskApi = { + show: function () { + mobile.alloy.add(mask); + }, + hide: function () { + mobile.alloy.remove(mask); + } + }; + append(mobile.container, mask.element()); + var mode = AndroidMode.create(mobile, maskApi); + return { + setReadOnly: mobile.setReadOnly, + refreshStructure: noop, + enter: mode.enter, + exit: mode.exit, + destroy: noop + }; + }; + var AndroidWebapp = { produce: produce }; + + var schema$e = constant([ + strict$1('dom'), + defaulted$1('shell', true), + field$1('toolbarBehaviours', [Replacing]) + ]); + var enhanceGroups = function () { + return { behaviours: derive$1([Replacing.config({})]) }; + }; + var parts$2 = constant([optional({ + name: 'groups', + overrides: enhanceGroups + })]); + + var factory$4 = function (detail, components, spec, _externals) { + var setGroups = function (toolbar, groups) { + getGroupContainer(toolbar).fold(function () { + domGlobals.console.error('Toolbar was defined to not be a shell, but no groups container was specified in components'); + throw new Error('Toolbar was defined to not be a shell, but no groups container was specified in components'); + }, function (container) { + Replacing.set(container, groups); + }); + }; + var getGroupContainer = function (component) { + return detail.shell ? Option.some(component) : getPart(component, detail, 'groups'); + }; + var extra = detail.shell ? { + behaviours: [Replacing.config({})], + components: [] + } : { + behaviours: [], + components: components + }; + return { + uid: detail.uid, + dom: detail.dom, + components: extra.components, + behaviours: augment(detail.toolbarBehaviours, extra.behaviours), + apis: { setGroups: setGroups }, + domModification: { attributes: { role: 'group' } } + }; + }; + var Toolbar = composite$1({ + name: 'Toolbar', + configFields: schema$e(), + partFields: parts$2(), + factory: factory$4, + apis: { + setGroups: function (apis, toolbar, groups) { + apis.setGroups(toolbar, groups); + } + } + }); + + var schema$f = constant([ + strict$1('items'), + markers(['itemSelector']), + field$1('tgroupBehaviours', [Keying]) + ]); + var parts$3 = constant([group({ + name: 'items', + unit: 'item' + })]); + + var factory$5 = function (detail, components, spec, _externals) { + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.tgroupBehaviours, [Keying.config({ + mode: 'flow', + selector: detail.markers.itemSelector + })]), + domModification: { attributes: { role: 'toolbar' } } + }; + }; + var ToolbarGroup = composite$1({ + name: 'ToolbarGroup', + configFields: schema$f(), + partFields: parts$3(), + factory: factory$5 + }); + + var dataHorizontal = 'data-' + Styles.resolve('horizontal-scroll'); + var canScrollVertically = function (container) { + container.dom().scrollTop = 1; + var result = container.dom().scrollTop !== 0; + container.dom().scrollTop = 0; + return result; + }; + var canScrollHorizontally = function (container) { + container.dom().scrollLeft = 1; + var result = container.dom().scrollLeft !== 0; + container.dom().scrollLeft = 0; + return result; + }; + var hasVerticalScroll = function (container) { + return container.dom().scrollTop > 0 || canScrollVertically(container); + }; + var hasHorizontalScroll = function (container) { + return container.dom().scrollLeft > 0 || canScrollHorizontally(container); + }; + var markAsHorizontal = function (container) { + set(container, dataHorizontal, 'true'); + }; + var hasScroll = function (container) { + return get$1(container, dataHorizontal) === 'true' ? hasHorizontalScroll(container) : hasVerticalScroll(container); + }; + var exclusive = function (scope, selector) { + return bind$3(scope, 'touchmove', function (event) { + closest$2(event.target(), selector).filter(hasScroll).fold(function () { + event.raw().preventDefault(); + }, noop); + }); + }; + var Scrollables = { + exclusive: exclusive, + markAsHorizontal: markAsHorizontal + }; + + function ScrollingToolbar () { + var makeGroup = function (gSpec) { + var scrollClass = gSpec.scrollable === true ? '${prefix}-toolbar-scrollable-group' : ''; + return { + dom: dom$1('
    '), + tgroupBehaviours: derive$1([config('adhoc-scrollable-toolbar', gSpec.scrollable === true ? [runOnInit(function (component, simulatedEvent) { + set$3(component.element(), 'overflow-x', 'auto'); + Scrollables.markAsHorizontal(component.element()); + Scrollable.register(component.element()); + })] : [])]), + components: [Container.sketch({ components: [ToolbarGroup.parts().items({})] })], + markers: { itemSelector: '.' + Styles.resolve('toolbar-group-item') }, + items: gSpec.items + }; + }; + var toolbar = build$1(Toolbar.sketch({ + dom: dom$1('
    '), + components: [Toolbar.parts().groups({})], + toolbarBehaviours: derive$1([ + Toggling.config({ + toggleClass: Styles.resolve('context-toolbar'), + toggleOnExecute: false, + aria: { mode: 'none' } + }), + Keying.config({ mode: 'cyclic' }) + ]), + shell: true + })); + var wrapper = build$1(Container.sketch({ + dom: { classes: [Styles.resolve('toolstrip')] }, + components: [premade$1(toolbar)], + containerBehaviours: derive$1([Toggling.config({ + toggleClass: Styles.resolve('android-selection-context-toolbar'), + toggleOnExecute: false + })]) + })); + var resetGroups = function () { + Toolbar.setGroups(toolbar, initGroups.get()); + Toggling.off(toolbar); + }; + var initGroups = Cell([]); + var setGroups = function (gs) { + initGroups.set(gs); + resetGroups(); + }; + var createGroups = function (gs) { + return map$1(gs, compose(ToolbarGroup.sketch, makeGroup)); + }; + var refresh = function () { + }; + var setContextToolbar = function (gs) { + Toggling.on(toolbar); + Toolbar.setGroups(toolbar, gs); + }; + var restoreToolbar = function () { + if (Toggling.isOn(toolbar)) { + resetGroups(); + } + }; + var focus = function () { + Keying.focusIn(toolbar); + }; + return { + wrapper: constant(wrapper), + toolbar: constant(toolbar), + createGroups: createGroups, + setGroups: setGroups, + setContextToolbar: setContextToolbar, + restoreToolbar: restoreToolbar, + refresh: refresh, + focus: focus + }; + } + + var makeEditSwitch = function (webapp) { + return build$1(Button.sketch({ + dom: dom$1('
    '), + action: function () { + webapp.run(function (w) { + w.setReadOnly(false); + }); + } + })); + }; + var makeSocket = function () { + return build$1(Container.sketch({ + dom: dom$1('
    '), + components: [], + containerBehaviours: derive$1([Replacing.config({})]) + })); + }; + var showEdit = function (socket, switchToEdit) { + Replacing.append(socket, premade$1(switchToEdit)); + }; + var hideEdit = function (socket, switchToEdit) { + Replacing.remove(socket, switchToEdit); + }; + var updateMode = function (socket, switchToEdit, readOnly, root) { + var swap = readOnly === true ? Swapping.toAlpha : Swapping.toOmega; + swap(root); + var f = readOnly ? showEdit : hideEdit; + f(socket, switchToEdit); + }; + var CommonRealm = { + makeEditSwitch: makeEditSwitch, + makeSocket: makeSocket, + updateMode: updateMode + }; + + var getAnimationRoot = function (component, slideConfig) { + return slideConfig.getAnimationRoot.fold(function () { + return component.element(); + }, function (get) { + return get(component); + }); + }; + + var getDimensionProperty = function (slideConfig) { + return slideConfig.dimension.property; + }; + var getDimension = function (slideConfig, elem) { + return slideConfig.dimension.getDimension(elem); + }; + var disableTransitions = function (component, slideConfig) { + var root = getAnimationRoot(component, slideConfig); + remove$6(root, [ + slideConfig.shrinkingClass, + slideConfig.growingClass + ]); + }; + var setShrunk = function (component, slideConfig) { + remove$4(component.element(), slideConfig.openClass); + add$2(component.element(), slideConfig.closedClass); + set$3(component.element(), getDimensionProperty(slideConfig), '0px'); + reflow(component.element()); + }; + var setGrown = function (component, slideConfig) { + remove$4(component.element(), slideConfig.closedClass); + add$2(component.element(), slideConfig.openClass); + remove$5(component.element(), getDimensionProperty(slideConfig)); + }; + var doImmediateShrink = function (component, slideConfig, slideState, _calculatedSize) { + slideState.setCollapsed(); + set$3(component.element(), getDimensionProperty(slideConfig), getDimension(slideConfig, component.element())); + reflow(component.element()); + disableTransitions(component, slideConfig); + setShrunk(component, slideConfig); + slideConfig.onStartShrink(component); + slideConfig.onShrunk(component); + }; + var doStartShrink = function (component, slideConfig, slideState, calculatedSize) { + var size = calculatedSize.getOrThunk(function () { + return getDimension(slideConfig, component.element()); + }); + slideState.setCollapsed(); + set$3(component.element(), getDimensionProperty(slideConfig), size); + reflow(component.element()); + var root = getAnimationRoot(component, slideConfig); + remove$4(root, slideConfig.growingClass); + add$2(root, slideConfig.shrinkingClass); + setShrunk(component, slideConfig); + slideConfig.onStartShrink(component); + }; + var doStartSmartShrink = function (component, slideConfig, slideState) { + var size = getDimension(slideConfig, component.element()); + var shrinker = size === '0px' ? doImmediateShrink : doStartShrink; + shrinker(component, slideConfig, slideState, Option.some(size)); + }; + var doStartGrow = function (component, slideConfig, slideState) { + var root = getAnimationRoot(component, slideConfig); + var wasShrinking = has$2(root, slideConfig.shrinkingClass); + var beforeSize = getDimension(slideConfig, component.element()); + setGrown(component, slideConfig); + var fullSize = getDimension(slideConfig, component.element()); + var startPartialGrow = function () { + set$3(component.element(), getDimensionProperty(slideConfig), beforeSize); + reflow(component.element()); + }; + var startCompleteGrow = function () { + setShrunk(component, slideConfig); + }; + var setStartSize = wasShrinking ? startPartialGrow : startCompleteGrow; + setStartSize(); + remove$4(root, slideConfig.shrinkingClass); + add$2(root, slideConfig.growingClass); + setGrown(component, slideConfig); + set$3(component.element(), getDimensionProperty(slideConfig), fullSize); + slideState.setExpanded(); + slideConfig.onStartGrow(component); + }; + var refresh = function (component, slideConfig, slideState) { + if (slideState.isExpanded()) { + remove$5(component.element(), getDimensionProperty(slideConfig)); + var fullSize = getDimension(slideConfig, component.element()); + set$3(component.element(), getDimensionProperty(slideConfig), fullSize); + } + }; + var grow = function (component, slideConfig, slideState) { + if (!slideState.isExpanded()) { + doStartGrow(component, slideConfig, slideState); + } + }; + var shrink = function (component, slideConfig, slideState) { + if (slideState.isExpanded()) { + doStartSmartShrink(component, slideConfig, slideState); + } + }; + var immediateShrink = function (component, slideConfig, slideState) { + if (slideState.isExpanded()) { + doImmediateShrink(component, slideConfig, slideState, Option.none()); + } + }; + var hasGrown = function (component, slideConfig, slideState) { + return slideState.isExpanded(); + }; + var hasShrunk = function (component, slideConfig, slideState) { + return slideState.isCollapsed(); + }; + var isGrowing = function (component, slideConfig, slideState) { + var root = getAnimationRoot(component, slideConfig); + return has$2(root, slideConfig.growingClass) === true; + }; + var isShrinking = function (component, slideConfig, slideState) { + var root = getAnimationRoot(component, slideConfig); + return has$2(root, slideConfig.shrinkingClass) === true; + }; + var isTransitioning = function (component, slideConfig, slideState) { + return isGrowing(component, slideConfig) === true || isShrinking(component, slideConfig) === true; + }; + var toggleGrow = function (component, slideConfig, slideState) { + var f = slideState.isExpanded() ? doStartSmartShrink : doStartGrow; + f(component, slideConfig, slideState); + }; + + var SlidingApis = /*#__PURE__*/Object.freeze({ + __proto__: null, + refresh: refresh, + grow: grow, + shrink: shrink, + immediateShrink: immediateShrink, + hasGrown: hasGrown, + hasShrunk: hasShrunk, + isGrowing: isGrowing, + isShrinking: isShrinking, + isTransitioning: isTransitioning, + toggleGrow: toggleGrow, + disableTransitions: disableTransitions + }); + + var exhibit$5 = function (base, slideConfig) { + var expanded = slideConfig.expanded; + return expanded ? nu$5({ + classes: [slideConfig.openClass], + styles: {} + }) : nu$5({ + classes: [slideConfig.closedClass], + styles: wrap$1(slideConfig.dimension.property, '0px') + }); + }; + var events$a = function (slideConfig, slideState) { + return derive([runOnSource(transitionend(), function (component, simulatedEvent) { + var raw = simulatedEvent.event().raw(); + if (raw.propertyName === slideConfig.dimension.property) { + disableTransitions(component, slideConfig); + if (slideState.isExpanded()) { + remove$5(component.element(), slideConfig.dimension.property); + } + var notify = slideState.isExpanded() ? slideConfig.onGrown : slideConfig.onShrunk; + notify(component); + } + })]); + }; + + var ActiveSliding = /*#__PURE__*/Object.freeze({ + __proto__: null, + exhibit: exhibit$5, + events: events$a + }); + + var SlidingSchema = [ + strict$1('closedClass'), + strict$1('openClass'), + strict$1('shrinkingClass'), + strict$1('growingClass'), + option('getAnimationRoot'), + onHandler('onShrunk'), + onHandler('onStartShrink'), + onHandler('onGrown'), + onHandler('onStartGrow'), + defaulted$1('expanded', false), + strictOf('dimension', choose$1('property', { + width: [ + output('property', 'width'), + output('getDimension', function (elem) { + return get$7(elem) + 'px'; + }) + ], + height: [ + output('property', 'height'), + output('getDimension', function (elem) { + return get$5(elem) + 'px'; + }) + ] + })) + ]; + + var init$4 = function (spec) { + var state = Cell(spec.expanded); + var readState = function () { + return 'expanded: ' + state.get(); + }; + return nu$6({ + isExpanded: function () { + return state.get() === true; + }, + isCollapsed: function () { + return state.get() === false; + }, + setCollapsed: curry(state.set, false), + setExpanded: curry(state.set, true), + readState: readState + }); + }; + + var SlidingState = /*#__PURE__*/Object.freeze({ + __proto__: null, + init: init$4 + }); + + var Sliding = create$1({ + fields: SlidingSchema, + name: 'sliding', + active: ActiveSliding, + apis: SlidingApis, + state: SlidingState + }); + + var build$2 = function (refresh, scrollIntoView) { + var dropup = build$1(Container.sketch({ + dom: { + tag: 'div', + classes: [Styles.resolve('dropup')] + }, + components: [], + containerBehaviours: derive$1([ + Replacing.config({}), + Sliding.config({ + closedClass: Styles.resolve('dropup-closed'), + openClass: Styles.resolve('dropup-open'), + shrinkingClass: Styles.resolve('dropup-shrinking'), + growingClass: Styles.resolve('dropup-growing'), + dimension: { property: 'height' }, + onShrunk: function (component) { + refresh(); + scrollIntoView(); + Replacing.set(component, []); + }, + onGrown: function (component) { + refresh(); + scrollIntoView(); + } + }), + Receivers.orientation(function (component, data) { + disappear(noop); + }) + ]) + })); + var appear = function (menu, update, component) { + if (Sliding.hasShrunk(dropup) === true && Sliding.isTransitioning(dropup) === false) { + domGlobals.window.requestAnimationFrame(function () { + update(component); + Replacing.set(dropup, [menu()]); + Sliding.grow(dropup); + }); + } + }; + var disappear = function (onReadyToShrink) { + domGlobals.window.requestAnimationFrame(function () { + onReadyToShrink(); + Sliding.shrink(dropup); + }); + }; + return { + appear: appear, + disappear: disappear, + component: constant(dropup), + element: dropup.element + }; + }; + + var closest$3 = function (scope, selector, isRoot) { + return closest$2(scope, selector, isRoot).isSome(); + }; + + var isDangerous = function (event) { + var keyEv = event.raw(); + return keyEv.which === BACKSPACE()[0] && !contains([ + 'input', + 'textarea' + ], name(event.target())) && !closest$3(event.target(), '[contenteditable="true"]'); + }; + var isFirefox = detect$3().browser.isFirefox(); + var settingsSchema = objOfOnly([ + strictFunction('triggerEvent'), + defaulted$1('stopBackspace', true) + ]); + var bindFocus = function (container, handler) { + if (isFirefox) { + return capture$1(container, 'focus', handler); + } else { + return bind$3(container, 'focusin', handler); + } + }; + var bindBlur = function (container, handler) { + if (isFirefox) { + return capture$1(container, 'blur', handler); + } else { + return bind$3(container, 'focusout', handler); + } + }; + var setup$2 = function (container, rawSettings) { + var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings); + var pointerEvents = [ + 'touchstart', + 'touchmove', + 'touchend', + 'touchcancel', + 'gesturestart', + 'mousedown', + 'mouseup', + 'mouseover', + 'mousemove', + 'mouseout', + 'click' + ]; + var tapEvent = monitor(settings); + var simpleEvents = map$1(pointerEvents.concat([ + 'selectstart', + 'input', + 'contextmenu', + 'change', + 'transitionend', + 'drag', + 'dragstart', + 'dragend', + 'dragenter', + 'dragleave', + 'dragover', + 'drop', + 'keyup' + ]), function (type) { + return bind$3(container, type, function (event) { + tapEvent.fireIfReady(event, type).each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent(type, event); + if (stopped) { + event.kill(); + } + }); + }); + var pasteTimeout = Cell(Option.none()); + var onPaste = bind$3(container, 'paste', function (event) { + tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent('paste', event); + if (stopped) { + event.kill(); + } + pasteTimeout.set(Option.some(domGlobals.setTimeout(function () { + settings.triggerEvent(postPaste(), event); + }, 0))); + }); + var onKeydown = bind$3(container, 'keydown', function (event) { + var stopped = settings.triggerEvent('keydown', event); + if (stopped) { + event.kill(); + } else if (settings.stopBackspace === true && isDangerous(event)) { + event.prevent(); + } + }); + var onFocusIn = bindFocus(container, function (event) { + var stopped = settings.triggerEvent('focusin', event); + if (stopped) { + event.kill(); + } + }); + var focusoutTimeout = Cell(Option.none()); + var onFocusOut = bindBlur(container, function (event) { + var stopped = settings.triggerEvent('focusout', event); + if (stopped) { + event.kill(); + } + focusoutTimeout.set(Option.some(domGlobals.setTimeout(function () { + settings.triggerEvent(postBlur(), event); + }, 0))); + }); + var unbind = function () { + each$1(simpleEvents, function (e) { + e.unbind(); + }); + onKeydown.unbind(); + onFocusIn.unbind(); + onFocusOut.unbind(); + onPaste.unbind(); + pasteTimeout.get().each(domGlobals.clearTimeout); + focusoutTimeout.get().each(domGlobals.clearTimeout); + }; + return { unbind: unbind }; + }; + + var derive$2 = function (rawEvent, rawTarget) { + var source = get(rawEvent, 'target').map(function (getTarget) { + return getTarget(); + }).getOr(rawTarget); + return Cell(source); + }; + + var fromSource = function (event, source) { + var stopper = Cell(false); + var cutter = Cell(false); + var stop = function () { + stopper.set(true); + }; + var cut = function () { + cutter.set(true); + }; + return { + stop: stop, + cut: cut, + isStopped: stopper.get, + isCut: cutter.get, + event: constant(event), + setSource: source.set, + getSource: source.get + }; + }; + var fromExternal = function (event) { + var stopper = Cell(false); + var stop = function () { + stopper.set(true); + }; + return { + stop: stop, + cut: noop, + isStopped: stopper.get, + isCut: constant(false), + event: constant(event), + setSource: die('Cannot set source of a broadcasted event'), + getSource: die('Cannot get source of a broadcasted event') + }; + }; + + var adt$7 = Adt.generate([ + { stopped: [] }, + { resume: ['element'] }, + { complete: [] } + ]); + var doTriggerHandler = function (lookup, eventType, rawEvent, target, source, logger) { + var handler = lookup(eventType, target); + var simulatedEvent = fromSource(rawEvent, source); + return handler.fold(function () { + logger.logEventNoHandlers(eventType, target); + return adt$7.complete(); + }, function (handlerInfo) { + var descHandler = handlerInfo.descHandler(); + var eventHandler = getCurried(descHandler); + eventHandler(simulatedEvent); + if (simulatedEvent.isStopped()) { + logger.logEventStopped(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.stopped(); + } else if (simulatedEvent.isCut()) { + logger.logEventCut(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.complete(); + } else { + return parent(handlerInfo.element()).fold(function () { + logger.logNoParent(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.complete(); + }, function (parent) { + logger.logEventResponse(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.resume(parent); + }); + } + }); + }; + var doTriggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, source, logger) { + return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () { + return true; + }, function (parent) { + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger); + }, function () { + return false; + }); + }; + var triggerHandler = function (lookup, eventType, rawEvent, target, logger) { + var source = derive$2(rawEvent, target); + return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger); + }; + var broadcast = function (listeners, rawEvent, logger) { + var simulatedEvent = fromExternal(rawEvent); + each$1(listeners, function (listener) { + var descHandler = listener.descHandler(); + var handler = getCurried(descHandler); + handler(simulatedEvent); + }); + return simulatedEvent.isStopped(); + }; + var triggerUntilStopped = function (lookup, eventType, rawEvent, logger) { + var rawTarget = rawEvent.target(); + return triggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, logger); + }; + var triggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, logger) { + var source = derive$2(rawEvent, rawTarget); + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger); + }; + + var eventHandler = Immutable('element', 'descHandler'); + var broadcastHandler = function (id, handler) { + return { + id: constant(id), + descHandler: constant(handler) + }; + }; + function EventRegistry () { + var registry = {}; + var registerId = function (extraArgs, id, events) { + each(events, function (v, k) { + var handlers = registry[k] !== undefined ? registry[k] : {}; + handlers[id] = curryArgs(v, extraArgs); + registry[k] = handlers; + }); + }; + var findHandler = function (handlers, elem) { + return read$2(elem).fold(function () { + return Option.none(); + }, function (id) { + return handlers.bind(function (h) { + return get(h, id); + }).map(function (descHandler) { + return eventHandler(elem, descHandler); + }); + }); + }; + var filterByType = function (type) { + return get(registry, type).map(function (handlers) { + return mapToArray(handlers, function (f, id) { + return broadcastHandler(id, f); + }); + }).getOr([]); + }; + var find = function (isAboveRoot, type, target) { + var handlers = get(registry, type); + return closest(target, function (elem) { + return findHandler(handlers, elem); + }, isAboveRoot); + }; + var unregisterId = function (id) { + each(registry, function (handlersById, eventName) { + if (handlersById.hasOwnProperty(id)) { + delete handlersById[id]; + } + }); + }; + return { + registerId: registerId, + unregisterId: unregisterId, + filterByType: filterByType, + find: find + }; + } + + function Registry () { + var events = EventRegistry(); + var components = {}; + var readOrTag = function (component) { + var elem = component.element(); + return read$2(elem).fold(function () { + return write('uid-', component.element()); + }, function (uid) { + return uid; + }); + }; + var failOnDuplicate = function (component, tagId) { + var conflict = components[tagId]; + if (conflict === component) { + unregister(component); + } else { + throw new Error('The tagId "' + tagId + '" is already used by: ' + element(conflict.element()) + '\nCannot use it for: ' + element(component.element()) + '\n' + 'The conflicting element is' + (inBody(conflict.element()) ? ' ' : ' not ') + 'already in the DOM'); + } + }; + var register = function (component) { + var tagId = readOrTag(component); + if (hasNonNullableKey(components, tagId)) { + failOnDuplicate(component, tagId); + } + var extraArgs = [component]; + events.registerId(extraArgs, tagId, component.events()); + components[tagId] = component; + }; + var unregister = function (component) { + read$2(component.element()).each(function (tagId) { + delete components[tagId]; + events.unregisterId(tagId); + }); + }; + var filter = function (type) { + return events.filterByType(type); + }; + var find = function (isAboveRoot, type, target) { + return events.find(isAboveRoot, type, target); + }; + var getById = function (id) { + return get(components, id); + }; + return { + find: find, + filter: filter, + register: register, + unregister: unregister, + getById: getById + }; + } + + var takeover = function (root) { + var isAboveRoot = function (el) { + return parent(root.element()).fold(function () { + return true; + }, function (parent) { + return eq(el, parent); + }); + }; + var registry = Registry(); + var lookup = function (eventName, target) { + return registry.find(isAboveRoot, eventName, target); + }; + var domEvents = setup$2(root.element(), { + triggerEvent: function (eventName, event) { + return monitorEvent(eventName, event.target(), function (logger) { + return triggerUntilStopped(lookup, eventName, event, logger); + }); + } + }); + var systemApi = { + debugInfo: constant('real'), + triggerEvent: function (eventName, target, data) { + monitorEvent(eventName, target, function (logger) { + return triggerOnUntilStopped(lookup, eventName, data, target, logger); + }); + }, + triggerFocus: function (target, originator) { + read$2(target).fold(function () { + focus$1(target); + }, function (_alloyId) { + monitorEvent(focus(), target, function (logger) { + triggerHandler(lookup, focus(), { + originator: constant(originator), + kill: noop, + prevent: noop, + target: constant(target) + }, target, logger); + return false; + }); + }); + }, + triggerEscape: function (comp, simulatedEvent) { + systemApi.triggerEvent('keydown', comp.element(), simulatedEvent.event()); + }, + getByUid: function (uid) { + return getByUid(uid); + }, + getByDom: function (elem) { + return getByDom(elem); + }, + build: build$1, + addToGui: function (c) { + add(c); + }, + removeFromGui: function (c) { + remove$1(c); + }, + addToWorld: function (c) { + addToWorld(c); + }, + removeFromWorld: function (c) { + removeFromWorld(c); + }, + broadcast: function (message) { + broadcast$1(message); + }, + broadcastOn: function (channels, message) { + broadcastOn(channels, message); + }, + broadcastEvent: function (eventName, event) { + broadcastEvent(eventName, event); + }, + isConnected: constant(true) + }; + var addToWorld = function (component) { + component.connect(systemApi); + if (!isText(component.element())) { + registry.register(component); + each$1(component.components(), addToWorld); + systemApi.triggerEvent(systemInit(), component.element(), { target: constant(component.element()) }); + } + }; + var removeFromWorld = function (component) { + if (!isText(component.element())) { + each$1(component.components(), removeFromWorld); + registry.unregister(component); + } + component.disconnect(); + }; + var add = function (component) { + attach$1(root, component); + }; + var remove$1 = function (component) { + detach(component); + }; + var destroy = function () { + domEvents.unbind(); + remove(root.element()); + }; + var broadcastData = function (data) { + var receivers = registry.filter(receive()); + each$1(receivers, function (receiver) { + var descHandler = receiver.descHandler(); + var handler = getCurried(descHandler); + handler(data); + }); + }; + var broadcast$1 = function (message) { + broadcastData({ + universal: constant(true), + data: constant(message) + }); + }; + var broadcastOn = function (channels, message) { + broadcastData({ + universal: constant(false), + channels: constant(channels), + data: constant(message) + }); + }; + var broadcastEvent = function (eventName, event) { + var listeners = registry.filter(eventName); + return broadcast(listeners, event); + }; + var getByUid = function (uid) { + return registry.getById(uid).fold(function () { + return Result.error(new Error('Could not find component with uid: "' + uid + '" in system.')); + }, Result.value); + }; + var getByDom = function (elem) { + var uid = read$2(elem).getOr('not found'); + return getByUid(uid); + }; + addToWorld(root); + return { + root: constant(root), + element: root.element, + destroy: destroy, + add: add, + remove: remove$1, + getByUid: getByUid, + getByDom: getByDom, + addToWorld: addToWorld, + removeFromWorld: removeFromWorld, + broadcast: broadcast$1, + broadcastOn: broadcastOn, + broadcastEvent: broadcastEvent + }; + }; + + var READ_ONLY_MODE_CLASS = constant(Styles.resolve('readonly-mode')); + var EDIT_MODE_CLASS = constant(Styles.resolve('edit-mode')); + function OuterContainer (spec) { + var root = build$1(Container.sketch({ + dom: { classes: [Styles.resolve('outer-container')].concat(spec.classes) }, + containerBehaviours: derive$1([Swapping.config({ + alpha: READ_ONLY_MODE_CLASS(), + omega: EDIT_MODE_CLASS() + })]) + })); + return takeover(root); + } + + function AndroidRealm (scrollIntoView) { + var alloy = OuterContainer({ classes: [Styles.resolve('android-container')] }); + var toolbar = ScrollingToolbar(); + var webapp = api$2(); + var switchToEdit = CommonRealm.makeEditSwitch(webapp); + var socket = CommonRealm.makeSocket(); + var dropup = build$2(noop, scrollIntoView); + alloy.add(toolbar.wrapper()); + alloy.add(socket); + alloy.add(dropup.component()); + var setToolbarGroups = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setGroups(groups); + }; + var setContextToolbar = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setContextToolbar(groups); + }; + var focusToolbar = function () { + toolbar.focus(); + }; + var restoreToolbar = function () { + toolbar.restoreToolbar(); + }; + var init = function (spec) { + webapp.set(AndroidWebapp.produce(spec)); + }; + var exit = function () { + webapp.run(function (w) { + w.exit(); + Replacing.remove(socket, switchToEdit); + }); + }; + var updateMode = function (readOnly) { + CommonRealm.updateMode(socket, switchToEdit, readOnly, alloy.root()); + }; + return { + system: constant(alloy), + element: alloy.element, + init: init, + exit: exit, + setToolbarGroups: setToolbarGroups, + setContextToolbar: setContextToolbar, + focusToolbar: focusToolbar, + restoreToolbar: restoreToolbar, + updateMode: updateMode, + socket: constant(socket), + dropup: constant(dropup) + }; + } + + var input$1 = function (parent, operation) { + var input = Element.fromTag('input'); + setAll$1(input, { + opacity: '0', + position: 'absolute', + top: '-1000px', + left: '-1000px' + }); + append(parent, input); + focus$1(input); + operation(input); + remove(input); + }; + var CaptureBin = { input: input$1 }; + + var refreshInput = function (input) { + var start = input.dom().selectionStart; + var end = input.dom().selectionEnd; + var dir = input.dom().selectionDirection; + global$4.setTimeout(function () { + input.dom().setSelectionRange(start, end, dir); + focus$1(input); + }, 50); + }; + var refresh$1 = function (winScope) { + var sel = winScope.getSelection(); + if (sel.rangeCount > 0) { + var br = sel.getRangeAt(0); + var r = winScope.document.createRange(); + r.setStart(br.startContainer, br.startOffset); + r.setEnd(br.endContainer, br.endOffset); + sel.removeAllRanges(); + sel.addRange(r); + } + }; + var CursorRefresh = { + refreshInput: refreshInput, + refresh: refresh$1 + }; + + var resume$1 = function (cWin, frame) { + active().each(function (active) { + if (!eq(active, frame)) { + blur(active); + } + }); + cWin.focus(); + focus$1(Element.fromDom(cWin.document.body)); + CursorRefresh.refresh(cWin); + }; + var ResumeEditing$1 = { resume: resume$1 }; + + var stubborn = function (outerBody, cWin, page, frame) { + var toEditing = function () { + ResumeEditing$1.resume(cWin, frame); + }; + var toReading = function () { + CaptureBin.input(outerBody, blur); + }; + var captureInput = bind$3(page, 'keydown', function (evt) { + if (!contains([ + 'input', + 'textarea' + ], name(evt.target()))) { + toEditing(); + } + }); + var onToolbarTouch = function () { + }; + var destroy = function () { + captureInput.unbind(); + }; + return { + toReading: toReading, + toEditing: toEditing, + onToolbarTouch: onToolbarTouch, + destroy: destroy + }; + }; + var timid = function (outerBody, cWin, page, frame) { + var dismissKeyboard = function () { + blur(frame); + }; + var onToolbarTouch = function () { + dismissKeyboard(); + }; + var toReading = function () { + dismissKeyboard(); + }; + var toEditing = function () { + ResumeEditing$1.resume(cWin, frame); + }; + return { + toReading: toReading, + toEditing: toEditing, + onToolbarTouch: onToolbarTouch, + destroy: noop + }; + }; + var IosKeyboard = { + stubborn: stubborn, + timid: timid + }; + + var initEvents$1 = function (editorApi, iosApi, toolstrip, socket, dropup) { + var saveSelectionFirst = function () { + iosApi.run(function (api) { + api.highlightSelection(); + }); + }; + var refreshIosSelection = function () { + iosApi.run(function (api) { + api.refreshSelection(); + }); + }; + var scrollToY = function (yTop, height) { + var y = yTop - socket.dom().scrollTop; + iosApi.run(function (api) { + api.scrollIntoView(y, y + height); + }); + }; + var scrollToElement = function (target) { + scrollToY(iosApi, socket); + }; + var scrollToCursor = function () { + editorApi.getCursorBox().each(function (box) { + scrollToY(box.top(), box.height()); + }); + }; + var clearSelection = function () { + iosApi.run(function (api) { + api.clearSelection(); + }); + }; + var clearAndRefresh = function () { + clearSelection(); + refreshThrottle.throttle(); + }; + var refreshView = function () { + scrollToCursor(); + iosApi.run(function (api) { + api.syncHeight(); + }); + }; + var reposition = function () { + var toolbarHeight = get$5(toolstrip); + iosApi.run(function (api) { + api.setViewportOffset(toolbarHeight); + }); + refreshIosSelection(); + refreshView(); + }; + var toEditing = function () { + iosApi.run(function (api) { + api.toEditing(); + }); + }; + var toReading = function () { + iosApi.run(function (api) { + api.toReading(); + }); + }; + var onToolbarTouch = function (event) { + iosApi.run(function (api) { + api.onToolbarTouch(event); + }); + }; + var tapping = TappingEvent.monitor(editorApi); + var refreshThrottle = last(refreshView, 300); + var listeners = [ + editorApi.onKeyup(clearAndRefresh), + editorApi.onNodeChanged(refreshIosSelection), + editorApi.onDomChanged(refreshThrottle.throttle), + editorApi.onDomChanged(refreshIosSelection), + editorApi.onScrollToCursor(function (tinyEvent) { + tinyEvent.preventDefault(); + refreshThrottle.throttle(); + }), + editorApi.onScrollToElement(function (event) { + scrollToElement(event.element()); + }), + editorApi.onToEditing(toEditing), + editorApi.onToReading(toReading), + bind$3(editorApi.doc(), 'touchend', function (touchEvent) { + if (eq(editorApi.html(), touchEvent.target()) || eq(editorApi.body(), touchEvent.target())) ; + }), + bind$3(toolstrip, 'transitionend', function (transitionEvent) { + if (transitionEvent.raw().propertyName === 'height') { + reposition(); + } + }), + capture$1(toolstrip, 'touchstart', function (touchEvent) { + saveSelectionFirst(); + onToolbarTouch(touchEvent); + editorApi.onTouchToolstrip(); + }), + bind$3(editorApi.body(), 'touchstart', function (evt) { + clearSelection(); + editorApi.onTouchContent(); + tapping.fireTouchstart(evt); + }), + tapping.onTouchmove(), + tapping.onTouchend(), + bind$3(editorApi.body(), 'click', function (event) { + event.kill(); + }), + bind$3(toolstrip, 'touchmove', function () { + editorApi.onToolbarScrollStart(); + }) + ]; + var destroy = function () { + each$1(listeners, function (l) { + l.unbind(); + }); + }; + return { destroy: destroy }; + }; + var IosEvents = { initEvents: initEvents$1 }; + + function FakeSelection (win, frame) { + var doc = win.document; + var container = Element.fromTag('div'); + add$2(container, Styles.resolve('unfocused-selections')); + append(Element.fromDom(doc.documentElement), container); + var onTouch = bind$3(container, 'touchstart', function (event) { + event.prevent(); + ResumeEditing$1.resume(win, frame); + clear(); + }); + var make = function (rectangle) { + var span = Element.fromTag('span'); + add$3(span, [ + Styles.resolve('layer-editor'), + Styles.resolve('unfocused-selection') + ]); + setAll$1(span, { + left: rectangle.left() + 'px', + top: rectangle.top() + 'px', + width: rectangle.width() + 'px', + height: rectangle.height() + 'px' + }); + return span; + }; + var update = function () { + clear(); + var rectangles = Rectangles.getRectangles(win); + var spans = map$1(rectangles, make); + append$1(container, spans); + }; + var clear = function () { + empty(container); + }; + var destroy = function () { + onTouch.unbind(); + remove(container); + }; + var isActive = function () { + return children(container).length > 0; + }; + return { + update: update, + isActive: isActive, + destroy: destroy, + clear: clear + }; + } + + var exports$1 = {}, module = { exports: exports$1 }; + (function (define, exports, module, require) { + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); + }(undefined, exports$1, module, undefined)); + var Promise$1 = module.exports.boltExport; + + var nu$7 = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu$7(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.some(x); + run(callbacks); + callbacks = []; + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each$1(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure$1 = function (a) { + return nu$7(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu$7, + pure: pure$1 + }; + + var errorReporter = function (err) { + domGlobals.setTimeout(function () { + throw err; + }, 0); + }; + var make$4 = function (run) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { + return make$4(function () { + return run().then(fab); + }); + }; + var bind = function (aFutureB) { + return make$4(function () { + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); + }); + }; + var anonBind = function (futureB) { + return make$4(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make$4(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$8 = function (baseFn) { + return make$4(function () { + return new Promise$1(baseFn); + }); + }; + var pure$2 = function (a) { + return make$4(function () { + return Promise$1.resolve(a); + }); + }; + var Future = { + nu: nu$8, + pure: pure$2 + }; + + var adjust = function (value, destination, amount) { + if (Math.abs(value - destination) <= amount) { + return Option.none(); + } else if (value < destination) { + return Option.some(value + amount); + } else { + return Option.some(value - amount); + } + }; + var create$5 = function () { + var interval = null; + var animate = function (getCurrent, destination, amount, increment, doFinish, rate) { + var finished = false; + var finish = function (v) { + finished = true; + doFinish(v); + }; + global$4.clearInterval(interval); + var abort = function (v) { + global$4.clearInterval(interval); + finish(v); + }; + interval = global$4.setInterval(function () { + var value = getCurrent(); + adjust(value, destination, amount).fold(function () { + global$4.clearInterval(interval); + finish(destination); + }, function (s) { + increment(s, abort); + if (!finished) { + var newValue = getCurrent(); + if (newValue !== s || Math.abs(newValue - destination) > Math.abs(value - destination)) { + global$4.clearInterval(interval); + finish(destination); + } + } + }); + }, rate); + }; + return { animate: animate }; + }; + var SmoothAnimation = { + create: create$5, + adjust: adjust + }; + + var findDevice = function (deviceWidth, deviceHeight) { + var devices = [ + { + width: 320, + height: 480, + keyboard: { + portrait: 300, + landscape: 240 + } + }, + { + width: 320, + height: 568, + keyboard: { + portrait: 300, + landscape: 240 + } + }, + { + width: 375, + height: 667, + keyboard: { + portrait: 305, + landscape: 240 + } + }, + { + width: 414, + height: 736, + keyboard: { + portrait: 320, + landscape: 240 + } + }, + { + width: 768, + height: 1024, + keyboard: { + portrait: 320, + landscape: 400 + } + }, + { + width: 1024, + height: 1366, + keyboard: { + portrait: 380, + landscape: 460 + } + } + ]; + return findMap(devices, function (device) { + return someIf(deviceWidth <= device.width && deviceHeight <= device.height, device.keyboard); + }).getOr({ + portrait: deviceHeight / 5, + landscape: deviceWidth / 4 + }); + }; + + var softKeyboardLimits = function (outerWindow) { + return findDevice(outerWindow.screen.width, outerWindow.screen.height); + }; + var accountableKeyboardHeight = function (outerWindow) { + var portrait = Orientation.get(outerWindow).isPortrait(); + var limits = softKeyboardLimits(outerWindow); + var keyboard = portrait ? limits.portrait : limits.landscape; + var visualScreenHeight = portrait ? outerWindow.screen.height : outerWindow.screen.width; + return visualScreenHeight - outerWindow.innerHeight > keyboard ? 0 : keyboard; + }; + var getGreenzone = function (socket, dropup) { + var outerWindow = owner(socket).dom().defaultView; + var viewportHeight = get$5(socket) + get$5(dropup); + var acc = accountableKeyboardHeight(outerWindow); + return viewportHeight - acc; + }; + var updatePadding = function (contentBody, socket, dropup) { + var greenzoneHeight = getGreenzone(socket, dropup); + var deltaHeight = get$5(socket) + get$5(dropup) - greenzoneHeight; + set$3(contentBody, 'padding-bottom', deltaHeight + 'px'); + }; + var DeviceZones = { + getGreenzone: getGreenzone, + updatePadding: updatePadding + }; + + var fixture = Adt.generate([ + { + fixed: [ + 'element', + 'property', + 'offsetY' + ] + }, + { + scroller: [ + 'element', + 'offsetY' + ] + } + ]); + var yFixedData = 'data-' + Styles.resolve('position-y-fixed'); + var yFixedProperty = 'data-' + Styles.resolve('y-property'); + var yScrollingData = 'data-' + Styles.resolve('scrolling'); + var windowSizeData = 'data-' + Styles.resolve('last-window-height'); + var getYFixedData = function (element) { + return DataAttributes.safeParse(element, yFixedData); + }; + var getYFixedProperty = function (element) { + return get$1(element, yFixedProperty); + }; + var getLastWindowSize = function (element) { + return DataAttributes.safeParse(element, windowSizeData); + }; + var classifyFixed = function (element, offsetY) { + var prop = getYFixedProperty(element); + return fixture.fixed(element, prop, offsetY); + }; + var classifyScrolling = function (element, offsetY) { + return fixture.scroller(element, offsetY); + }; + var classify = function (element) { + var offsetY = getYFixedData(element); + var classifier = get$1(element, yScrollingData) === 'true' ? classifyScrolling : classifyFixed; + return classifier(element, offsetY); + }; + var findFixtures = function (container) { + var candidates = descendants(container, '[' + yFixedData + ']'); + return map$1(candidates, classify); + }; + var takeoverToolbar = function (toolbar) { + var oldToolbarStyle = get$1(toolbar, 'style'); + setAll$1(toolbar, { + position: 'absolute', + top: '0px' + }); + set(toolbar, yFixedData, '0px'); + set(toolbar, yFixedProperty, 'top'); + var restore = function () { + set(toolbar, 'style', oldToolbarStyle || ''); + remove$1(toolbar, yFixedData); + remove$1(toolbar, yFixedProperty); + }; + return { restore: restore }; + }; + var takeoverViewport = function (toolbarHeight, height, viewport) { + var oldViewportStyle = get$1(viewport, 'style'); + Scrollable.register(viewport); + setAll$1(viewport, { + position: 'absolute', + height: height + 'px', + width: '100%', + top: toolbarHeight + 'px' + }); + set(viewport, yFixedData, toolbarHeight + 'px'); + set(viewport, yScrollingData, 'true'); + set(viewport, yFixedProperty, 'top'); + var restore = function () { + Scrollable.deregister(viewport); + set(viewport, 'style', oldViewportStyle || ''); + remove$1(viewport, yFixedData); + remove$1(viewport, yScrollingData); + remove$1(viewport, yFixedProperty); + }; + return { restore: restore }; + }; + var takeoverDropup = function (dropup, toolbarHeight, viewportHeight) { + var oldDropupStyle = get$1(dropup, 'style'); + setAll$1(dropup, { + position: 'absolute', + bottom: '0px' + }); + set(dropup, yFixedData, '0px'); + set(dropup, yFixedProperty, 'bottom'); + var restore = function () { + set(dropup, 'style', oldDropupStyle || ''); + remove$1(dropup, yFixedData); + remove$1(dropup, yFixedProperty); + }; + return { restore: restore }; + }; + var deriveViewportHeight = function (viewport, toolbarHeight, dropupHeight) { + var outerWindow = owner(viewport).dom().defaultView; + var winH = outerWindow.innerHeight; + set(viewport, windowSizeData, winH + 'px'); + return winH - toolbarHeight - dropupHeight; + }; + var takeover$1 = function (viewport, contentBody, toolbar, dropup) { + var outerWindow = owner(viewport).dom().defaultView; + var toolbarSetup = takeoverToolbar(toolbar); + var toolbarHeight = get$5(toolbar); + var dropupHeight = get$5(dropup); + var viewportHeight = deriveViewportHeight(viewport, toolbarHeight, dropupHeight); + var viewportSetup = takeoverViewport(toolbarHeight, viewportHeight, viewport); + var dropupSetup = takeoverDropup(dropup); + var isActive = true; + var restore = function () { + isActive = false; + toolbarSetup.restore(); + viewportSetup.restore(); + dropupSetup.restore(); + }; + var isExpanding = function () { + var currentWinHeight = outerWindow.innerHeight; + var lastWinHeight = getLastWindowSize(viewport); + return currentWinHeight > lastWinHeight; + }; + var refresh = function () { + if (isActive) { + var newToolbarHeight = get$5(toolbar); + var dropupHeight_1 = get$5(dropup); + var newHeight = deriveViewportHeight(viewport, newToolbarHeight, dropupHeight_1); + set(viewport, yFixedData, newToolbarHeight + 'px'); + set$3(viewport, 'height', newHeight + 'px'); + DeviceZones.updatePadding(contentBody, viewport, dropup); + } + }; + var setViewportOffset = function (newYOffset) { + var offsetPx = newYOffset + 'px'; + set(viewport, yFixedData, offsetPx); + refresh(); + }; + DeviceZones.updatePadding(contentBody, viewport, dropup); + return { + setViewportOffset: setViewportOffset, + isExpanding: isExpanding, + isShrinking: not(isExpanding), + refresh: refresh, + restore: restore + }; + }; + var IosViewport = { + findFixtures: findFixtures, + takeover: takeover$1, + getYFixedData: getYFixedData + }; + + var animator = SmoothAnimation.create(); + var ANIMATION_STEP = 15; + var NUM_TOP_ANIMATION_FRAMES = 10; + var ANIMATION_RATE = 10; + var lastScroll = 'data-' + Styles.resolve('last-scroll-top'); + var getTop = function (element) { + var raw = getRaw(element, 'top').getOr('0'); + return parseInt(raw, 10); + }; + var getScrollTop = function (element) { + return parseInt(element.dom().scrollTop, 10); + }; + var moveScrollAndTop = function (element, destination, finalTop) { + return Future.nu(function (callback) { + var getCurrent = curry(getScrollTop, element); + var update = function (newScroll) { + element.dom().scrollTop = newScroll; + set$3(element, 'top', getTop(element) + ANIMATION_STEP + 'px'); + }; + var finish = function () { + element.dom().scrollTop = destination; + set$3(element, 'top', finalTop + 'px'); + callback(destination); + }; + animator.animate(getCurrent, destination, ANIMATION_STEP, update, finish, ANIMATION_RATE); + }); + }; + var moveOnlyScroll = function (element, destination) { + return Future.nu(function (callback) { + var getCurrent = curry(getScrollTop, element); + set(element, lastScroll, getCurrent()); + var update = function (newScroll, abort) { + var previous = DataAttributes.safeParse(element, lastScroll); + if (previous !== element.dom().scrollTop) { + abort(element.dom().scrollTop); + } else { + element.dom().scrollTop = newScroll; + set(element, lastScroll, newScroll); + } + }; + var finish = function () { + element.dom().scrollTop = destination; + set(element, lastScroll, destination); + callback(destination); + }; + var distance = Math.abs(destination - getCurrent()); + var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); + animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); + }); + }; + var moveOnlyTop = function (element, destination) { + return Future.nu(function (callback) { + var getCurrent = curry(getTop, element); + var update = function (newTop) { + set$3(element, 'top', newTop + 'px'); + }; + var finish = function () { + update(destination); + callback(destination); + }; + var distance = Math.abs(destination - getCurrent()); + var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); + animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); + }); + }; + var updateTop = function (element, amount) { + var newTop = amount + IosViewport.getYFixedData(element) + 'px'; + set$3(element, 'top', newTop); + }; + var moveWindowScroll = function (toolbar, viewport, destY) { + var outerWindow = owner(toolbar).dom().defaultView; + return Future.nu(function (callback) { + updateTop(toolbar, destY); + updateTop(viewport, destY); + outerWindow.scrollTo(0, destY); + callback(destY); + }); + }; + var IosScrolling = { + moveScrollAndTop: moveScrollAndTop, + moveOnlyScroll: moveOnlyScroll, + moveOnlyTop: moveOnlyTop, + moveWindowScroll: moveWindowScroll + }; + + function BackgroundActivity (doAction) { + var action = Cell(LazyValue.pure({})); + var start = function (value) { + var future = LazyValue.nu(function (callback) { + return doAction(value).get(callback); + }); + action.set(future); + }; + var idle = function (g) { + action.get().get(function () { + g(); + }); + }; + return { + start: start, + idle: idle + }; + } + + var scrollIntoView = function (cWin, socket, dropup, top, bottom) { + var greenzone = DeviceZones.getGreenzone(socket, dropup); + var refreshCursor = curry(CursorRefresh.refresh, cWin); + if (top > greenzone || bottom > greenzone) { + IosScrolling.moveOnlyScroll(socket, socket.dom().scrollTop - greenzone + bottom).get(refreshCursor); + } else if (top < 0) { + IosScrolling.moveOnlyScroll(socket, socket.dom().scrollTop + top).get(refreshCursor); + } + }; + var Greenzone = { scrollIntoView: scrollIntoView }; + + var par = function (asyncValues, nu) { + return nu(function (callback) { + var r = []; + var count = 0; + var cb = function (i) { + return function (value) { + r[i] = value; + count++; + if (count >= asyncValues.length) { + callback(r); + } + }; + }; + if (asyncValues.length === 0) { + callback([]); + } else { + each$1(asyncValues, function (asyncValue, i) { + asyncValue.get(cb(i)); + }); + } + }); + }; + + var par$1 = function (futures) { + return par(futures, Future.nu); + }; + + var updateFixed = function (element, property, winY, offsetY) { + var destination = winY + offsetY; + set$3(element, property, destination + 'px'); + return Future.pure(offsetY); + }; + var updateScrollingFixed = function (element, winY, offsetY) { + var destTop = winY + offsetY; + var oldProp = getRaw(element, 'top').getOr(offsetY); + var delta = destTop - parseInt(oldProp, 10); + var destScroll = element.dom().scrollTop + delta; + return IosScrolling.moveScrollAndTop(element, destScroll, destTop); + }; + var updateFixture = function (fixture, winY) { + return fixture.fold(function (element, property, offsetY) { + return updateFixed(element, property, winY, offsetY); + }, function (element, offsetY) { + return updateScrollingFixed(element, winY, offsetY); + }); + }; + var updatePositions = function (container, winY) { + var fixtures = IosViewport.findFixtures(container); + var updates = map$1(fixtures, function (fixture) { + return updateFixture(fixture, winY); + }); + return par$1(updates); + }; + var IosUpdates = { updatePositions: updatePositions }; + + var VIEW_MARGIN = 5; + var register$2 = function (toolstrip, socket, container, outerWindow, structure, cWin) { + var scroller = BackgroundActivity(function (y) { + return IosScrolling.moveWindowScroll(toolstrip, socket, y); + }); + var scrollBounds = function () { + var rects = Rectangles.getRectangles(cWin); + return Option.from(rects[0]).bind(function (rect) { + var viewTop = rect.top() - socket.dom().scrollTop; + var outside = viewTop > outerWindow.innerHeight + VIEW_MARGIN || viewTop < -VIEW_MARGIN; + return outside ? Option.some({ + top: constant(viewTop), + bottom: constant(viewTop + rect.height()) + }) : Option.none(); + }); + }; + var scrollThrottle = last(function () { + scroller.idle(function () { + IosUpdates.updatePositions(container, outerWindow.pageYOffset).get(function () { + var extraScroll = scrollBounds(); + extraScroll.each(function (extra) { + socket.dom().scrollTop = socket.dom().scrollTop + extra.top(); + }); + scroller.start(0); + structure.refresh(); + }); + }); + }, 1000); + var onScroll = bind$3(Element.fromDom(outerWindow), 'scroll', function () { + if (outerWindow.pageYOffset < 0) { + return; + } + scrollThrottle.throttle(); + }); + IosUpdates.updatePositions(container, outerWindow.pageYOffset).get(identity); + return { unbind: onScroll.unbind }; + }; + var setup$3 = function (bag) { + var cWin = bag.cWin(); + var ceBody = bag.ceBody(); + var socket = bag.socket(); + var toolstrip = bag.toolstrip(); + var toolbar = bag.toolbar(); + var contentElement = bag.contentElement(); + var keyboardType = bag.keyboardType(); + var outerWindow = bag.outerWindow(); + var dropup = bag.dropup(); + var structure = IosViewport.takeover(socket, ceBody, toolstrip, dropup); + var keyboardModel = keyboardType(bag.outerBody(), cWin, body(), contentElement, toolstrip, toolbar); + var toEditing = function () { + keyboardModel.toEditing(); + clearSelection(); + }; + var toReading = function () { + keyboardModel.toReading(); + }; + var onToolbarTouch = function (event) { + keyboardModel.onToolbarTouch(event); + }; + var onOrientation = Orientation.onChange(outerWindow, { + onChange: noop, + onReady: structure.refresh + }); + onOrientation.onAdjustment(function () { + structure.refresh(); + }); + var onResize = bind$3(Element.fromDom(outerWindow), 'resize', function () { + if (structure.isExpanding()) { + structure.refresh(); + } + }); + var onScroll = register$2(toolstrip, socket, bag.outerBody(), outerWindow, structure, cWin); + var unfocusedSelection = FakeSelection(cWin, contentElement); + var refreshSelection = function () { + if (unfocusedSelection.isActive()) { + unfocusedSelection.update(); + } + }; + var highlightSelection = function () { + unfocusedSelection.update(); + }; + var clearSelection = function () { + unfocusedSelection.clear(); + }; + var scrollIntoView = function (top, bottom) { + Greenzone.scrollIntoView(cWin, socket, dropup, top, bottom); + }; + var syncHeight = function () { + set$3(contentElement, 'height', contentElement.dom().contentWindow.document.body.scrollHeight + 'px'); + }; + var setViewportOffset = function (newYOffset) { + structure.setViewportOffset(newYOffset); + IosScrolling.moveOnlyTop(socket, newYOffset).get(identity); + }; + var destroy = function () { + structure.restore(); + onOrientation.destroy(); + onScroll.unbind(); + onResize.unbind(); + keyboardModel.destroy(); + unfocusedSelection.destroy(); + CaptureBin.input(body(), blur); + }; + return { + toEditing: toEditing, + toReading: toReading, + onToolbarTouch: onToolbarTouch, + refreshSelection: refreshSelection, + clearSelection: clearSelection, + highlightSelection: highlightSelection, + scrollIntoView: scrollIntoView, + updateToolbarPadding: noop, + setViewportOffset: setViewportOffset, + syncHeight: syncHeight, + refreshStructure: structure.refresh, + destroy: destroy + }; + }; + var IosSetup = { setup: setup$3 }; + + var create$6 = function (platform, mask) { + var meta = MetaViewport.tag(); + var priorState = value$2(); + var scrollEvents = value$2(); + var iosApi = api$2(); + var iosEvents = api$2(); + var enter = function () { + mask.hide(); + var doc = Element.fromDom(domGlobals.document); + PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) { + priorState.set({ + socketHeight: getRaw(platform.socket, 'height'), + iframeHeight: getRaw(editorApi.frame(), 'height'), + outerScroll: domGlobals.document.body.scrollTop + }); + scrollEvents.set({ exclusives: Scrollables.exclusive(doc, '.' + Scrollable.scrollable()) }); + add$2(platform.container, Styles.resolve('fullscreen-maximized')); + Thor.clobberStyles(platform.container, editorApi.body()); + meta.maximize(); + set$3(platform.socket, 'overflow', 'scroll'); + set$3(platform.socket, '-webkit-overflow-scrolling', 'touch'); + focus$1(editorApi.body()); + var setupBag = MixedBag([ + 'cWin', + 'ceBody', + 'socket', + 'toolstrip', + 'toolbar', + 'dropup', + 'contentElement', + 'cursor', + 'keyboardType', + 'isScrolling', + 'outerWindow', + 'outerBody' + ], []); + iosApi.set(IosSetup.setup(setupBag({ + cWin: editorApi.win(), + ceBody: editorApi.body(), + socket: platform.socket, + toolstrip: platform.toolstrip, + toolbar: platform.toolbar, + dropup: platform.dropup.element(), + contentElement: editorApi.frame(), + cursor: noop, + outerBody: platform.body, + outerWindow: platform.win, + keyboardType: IosKeyboard.stubborn, + isScrolling: function () { + var scrollValue = scrollEvents; + return scrollValue.get().exists(function (s) { + return s.socket.isScrolling(); + }); + } + }))); + iosApi.run(function (api) { + api.syncHeight(); + }); + iosEvents.set(IosEvents.initEvents(editorApi, iosApi, platform.toolstrip, platform.socket, platform.dropup)); + }); + }; + var exit = function () { + meta.restore(); + iosEvents.clear(); + iosApi.clear(); + mask.show(); + priorState.on(function (s) { + s.socketHeight.each(function (h) { + set$3(platform.socket, 'height', h); + }); + s.iframeHeight.each(function (h) { + set$3(platform.editor.getFrame(), 'height', h); + }); + domGlobals.document.body.scrollTop = s.scrollTop; + }); + priorState.clear(); + scrollEvents.on(function (s) { + s.exclusives.unbind(); + }); + scrollEvents.clear(); + remove$4(platform.container, Styles.resolve('fullscreen-maximized')); + Thor.restoreStyles(); + Scrollable.deregister(platform.toolbar); + remove$5(platform.socket, 'overflow'); + remove$5(platform.socket, '-webkit-overflow-scrolling'); + blur(platform.editor.getFrame()); + PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) { + editorApi.clearSelection(); + }); + }; + var refreshStructure = function () { + iosApi.run(function (api) { + api.refreshStructure(); + }); + }; + return { + enter: enter, + refreshStructure: refreshStructure, + exit: exit + }; + }; + var IosMode = { create: create$6 }; + + var produce$1 = function (raw) { + var mobile = asRawOrDie('Getting IosWebapp schema', MobileSchema, raw); + set$3(mobile.toolstrip, 'width', '100%'); + set$3(mobile.container, 'position', 'relative'); + var onView = function () { + mobile.setReadOnly(mobile.readOnlyOnInit()); + mode.enter(); + }; + var mask = build$1(TapToEditMask.sketch(onView, mobile.translate)); + mobile.alloy.add(mask); + var maskApi = { + show: function () { + mobile.alloy.add(mask); + }, + hide: function () { + mobile.alloy.remove(mask); + } + }; + var mode = IosMode.create(mobile, maskApi); + return { + setReadOnly: mobile.setReadOnly, + refreshStructure: mode.refreshStructure, + enter: mode.enter, + exit: mode.exit, + destroy: noop + }; + }; + var IosWebapp = { produce: produce$1 }; + + function IosRealm (scrollIntoView) { + var alloy = OuterContainer({ classes: [Styles.resolve('ios-container')] }); + var toolbar = ScrollingToolbar(); + var webapp = api$2(); + var switchToEdit = CommonRealm.makeEditSwitch(webapp); + var socket = CommonRealm.makeSocket(); + var dropup = build$2(function () { + webapp.run(function (w) { + w.refreshStructure(); + }); + }, scrollIntoView); + alloy.add(toolbar.wrapper()); + alloy.add(socket); + alloy.add(dropup.component()); + var setToolbarGroups = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setGroups(groups); + }; + var setContextToolbar = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setContextToolbar(groups); + }; + var focusToolbar = function () { + toolbar.focus(); + }; + var restoreToolbar = function () { + toolbar.restoreToolbar(); + }; + var init = function (spec) { + webapp.set(IosWebapp.produce(spec)); + }; + var exit = function () { + webapp.run(function (w) { + Replacing.remove(socket, switchToEdit); + w.exit(); + }); + }; + var updateMode = function (readOnly) { + CommonRealm.updateMode(socket, switchToEdit, readOnly, alloy.root()); + }; + return { + system: constant(alloy), + element: alloy.element, + init: init, + exit: exit, + setToolbarGroups: setToolbarGroups, + setContextToolbar: setContextToolbar, + focusToolbar: focusToolbar, + restoreToolbar: restoreToolbar, + updateMode: updateMode, + socket: constant(socket), + dropup: constant(dropup) + }; + } + + var global$5 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var derive$3 = function (editor) { + var base = get(editor.settings, 'skin_url').fold(function () { + return global$5.baseURL + '/skins/ui/oxide'; + }, function (url) { + return url; + }); + return { + content: base + '/content.mobile.min.css', + ui: base + '/skin.mobile.min.css' + }; + }; + var CssUrls = { derive: derive$3 }; + + var fontSizes = [ + 'x-small', + 'small', + 'medium', + 'large', + 'x-large' + ]; + var fireChange = function (realm, command, state) { + realm.system().broadcastOn([TinyChannels.formatChanged()], { + command: command, + state: state + }); + }; + var init$5 = function (realm, editor) { + var allFormats = keys(editor.formatter.get()); + each$1(allFormats, function (command) { + editor.formatter.formatChanged(command, function (state) { + fireChange(realm, command, state); + }); + }); + each$1([ + 'ul', + 'ol' + ], function (command) { + editor.selection.selectorChanged(command, function (state, data) { + fireChange(realm, command, state); + }); + }); + }; + var FormatChangers = { + init: init$5, + fontSizes: constant(fontSizes) + }; + + var fireSkinLoaded = function (editor) { + var done = function () { + editor._skinLoaded = true; + editor.fire('SkinLoaded'); + }; + return function () { + if (editor.initialized) { + done(); + } else { + editor.on('init', done); + } + }; + }; + var SkinLoaded = { fireSkinLoaded: fireSkinLoaded }; + + var READING = constant('toReading'); + var EDITING = constant('toEditing'); + var renderMobileTheme = function (editor) { + var renderUI = function () { + var targetNode = editor.getElement(); + var cssUrls = CssUrls.derive(editor); + if (isSkinDisabled(editor) === false) { + editor.contentCSS.push(cssUrls.content); + global$1.DOM.styleSheetLoader.load(cssUrls.ui, SkinLoaded.fireSkinLoaded(editor)); + } else { + SkinLoaded.fireSkinLoaded(editor)(); + } + var doScrollIntoView = function () { + editor.fire('ScrollIntoView'); + }; + var realm = detect$3().os.isAndroid() ? AndroidRealm(doScrollIntoView) : IosRealm(doScrollIntoView); + var original = Element.fromDom(targetNode); + attachSystemAfter(original, realm.system()); + var findFocusIn = function (elem) { + return search(elem).bind(function (focused) { + return realm.system().getByDom(focused).toOption(); + }); + }; + var outerWindow = targetNode.ownerDocument.defaultView; + var orientation = Orientation.onChange(outerWindow, { + onChange: function () { + var alloy = realm.system(); + alloy.broadcastOn([TinyChannels.orientationChanged()], { width: Orientation.getActualWidth(outerWindow) }); + }, + onReady: noop + }); + var setReadOnly = function (dynamicGroup, readOnlyGroups, mainGroups, ro) { + if (ro === false) { + editor.selection.collapse(); + } + var toolbars = configureToolbar(dynamicGroup, readOnlyGroups, mainGroups); + realm.setToolbarGroups(ro === true ? toolbars.readOnly : toolbars.main); + editor.setMode(ro === true ? 'readonly' : 'design'); + editor.fire(ro === true ? READING() : EDITING()); + realm.updateMode(ro); + }; + var configureToolbar = function (dynamicGroup, readOnlyGroups, mainGroups) { + var dynamic = dynamicGroup.get(); + var toolbars = { + readOnly: dynamic.backToMask.concat(readOnlyGroups.get()), + main: dynamic.backToMask.concat(mainGroups.get()) + }; + return toolbars; + }; + var bindHandler = function (label, handler) { + editor.on(label, handler); + return { + unbind: function () { + editor.off(label); + } + }; + }; + editor.on('init', function () { + realm.init({ + editor: { + getFrame: function () { + return Element.fromDom(editor.contentAreaContainer.querySelector('iframe')); + }, + onDomChanged: function () { + return { unbind: noop }; + }, + onToReading: function (handler) { + return bindHandler(READING(), handler); + }, + onToEditing: function (handler) { + return bindHandler(EDITING(), handler); + }, + onScrollToCursor: function (handler) { + editor.on('ScrollIntoView', function (tinyEvent) { + handler(tinyEvent); + }); + var unbind = function () { + editor.off('ScrollIntoView'); + orientation.destroy(); + }; + return { unbind: unbind }; + }, + onTouchToolstrip: function () { + hideDropup(); + }, + onTouchContent: function () { + var toolbar = Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolbar'))); + findFocusIn(toolbar).each(emitExecute); + realm.restoreToolbar(); + hideDropup(); + }, + onTapContent: function (evt) { + var target = evt.target(); + if (name(target) === 'img') { + editor.selection.select(target.dom()); + evt.kill(); + } else if (name(target) === 'a') { + var component = realm.system().getByDom(Element.fromDom(editor.editorContainer)); + component.each(function (container) { + if (Swapping.isAlpha(container)) { + TinyCodeDupe.openLink(target.dom()); + } + }); + } + } + }, + container: Element.fromDom(editor.editorContainer), + socket: Element.fromDom(editor.contentAreaContainer), + toolstrip: Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolstrip'))), + toolbar: Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolbar'))), + dropup: realm.dropup(), + alloy: realm.system(), + translate: noop, + setReadOnly: function (ro) { + setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, ro); + }, + readOnlyOnInit: function () { + return readOnlyOnInit(); + } + }); + var hideDropup = function () { + realm.dropup().disappear(function () { + realm.system().broadcastOn([TinyChannels.dropupDismissed()], {}); + }); + }; + var backToMaskGroup = { + label: 'The first group', + scrollable: false, + items: [Buttons.forToolbar('back', function () { + editor.selection.collapse(); + realm.exit(); + }, {}, editor)] + }; + var backToReadOnlyGroup = { + label: 'Back to read only', + scrollable: false, + items: [Buttons.forToolbar('readonly-back', function () { + setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, true); + }, {}, editor)] + }; + var readOnlyGroup = { + label: 'The read only mode group', + scrollable: true, + items: [] + }; + var features = Features.setup(realm, editor); + var items = Features.detect(editor.settings, features); + var actionGroup = { + label: 'the action group', + scrollable: true, + items: items + }; + var extraGroup = { + label: 'The extra group', + scrollable: false, + items: [] + }; + var mainGroups = Cell([ + actionGroup, + extraGroup + ]); + var readOnlyGroups = Cell([ + readOnlyGroup, + extraGroup + ]); + var dynamicGroup = Cell({ + backToMask: [backToMaskGroup], + backToReadOnly: [backToReadOnlyGroup] + }); + FormatChangers.init(realm, editor); + }); + editor.on('remove', function () { + realm.exit(); + }); + editor.on('detach', function () { + detachSystem(realm.system()); + realm.system().destroy(); + }); + return { + iframeContainer: realm.socket().element().dom(), + editorContainer: realm.element().dom() + }; + }; + return { + getNotificationManagerImpl: function () { + return { + open: constant({ + progressBar: { value: noop }, + close: noop, + text: noop, + getEl: constant(null), + moveTo: noop, + moveRel: noop, + settings: {} + }), + close: noop, + reposition: noop, + getArgs: constant({}) + }; + }, + renderUI: renderUI + }; + }; + function Theme () { + global$2.add('mobile', renderMobileTheme); + } + + Theme(); + +}(window)); diff --git a/src/RemoteLab/RemoteLab/Scripts/tinymce/themes/mobile/theme.min.js b/src/RemoteLab/RemoteLab/Scripts/tinymce/themes/mobile/theme.min.js new file mode 100644 index 0000000..8a59f65 --- /dev/null +++ b/src/RemoteLab/RemoteLab/Scripts/tinymce/themes/mobile/theme.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.2.1 (2020-03-25) + */ +!function(l){"use strict";var x=function(){return(x=Object.assign||function(n){for(var e,t=1,r=arguments.length;t "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"}}},Kr=b(It(Rr)),Jr=qr.state,Qr=qr.field,Zr=It(Rr),no=function(n){return"Errors: \n"+function(n){var e=10 ")+")\n"+n.getErrorInfo()})}(n.errors).join("\n")+"\n\nInput object: "+Et(n.input)},eo=b(Zr),to=(_r=ee,Mr="function",It(function(n){var e=typeof n;return _r(n)?Rr(n):Vr("Expected type: "+Mr+" but got: "+e)})),ro=function(n,e,t){return e(n).orThunk(function(){return t(n)?On.none():function(n,e,t){for(var r=n.dom(),o=ee(t)?t:b(!1);r.parentNode;){r=r.parentNode;var i=$e.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return On.none()}(n,e,t)})},oo=ir(je()),io=ir(He()),uo=ir(Ne()),co=(Ir=Fe(),function(n){return rr(Ir,n)}),ao=function(n){return ue(n,function(n){return function(n,e){return function(n,e,t){return""===e||!(n.length"}),eo()),Ga=Jt("schema",function(){return[$t("preprocess")]}),Ua=Yt("defaults",b({})),$a=Yt("overrides",b({})),Wa=Yr([Ha,Pa,za,La,Ua,$a]),Xa=Yr([Ha,Pa,za,Ua,$a]),qa=Yr([Ha,Pa,za,La,Ua,$a]),Ya=Yr([Ha,Ga,za,Lt("unit"),La,Ua,$a]),Ka=gc(ja.required,Wa),Ja=(gc(ja.external,Xa),gc(ja.optional,qa)),Qa=gc(ja.group,Ya),Za=b("entirety"),nf=function(n,e){return{uiType:Va(),owner:n,name:e}},ef=dc("alloy-premade"),tf=b("alloy-id-"),rf=b("data-alloy-id"),of=tf(),uf=rf(),cf=function(n,e){Object.defineProperty(n.dom(),uf,{value:e,writable:!0})},af=function(n){var e=Ye(n)?n.dom()[uf]:null;return On.from(e)},ff=function(n){return function(n){return In(n,"uid")}(n)?n:x(x({},n),{uid:kc("uid")})};function sf(n){var e=Pt("Sketcher for "+n.name,Bs,n),t=S(e.apis,Oc),r=S(e.extraApis,function(n,e){return ar(n,e)});return x(x({name:b(e.name),configFields:b(e.configFields),sketch:function(n){return function(n,e,t,r){var o=ff(r);return t(Ec(n,e,o,[],[]),o)}(e.name,e.configFields,e.factory,n)}},t),r)}function lf(n){var e=Pt("Sketcher for "+n.name,Vs,n),t=hc(e.name,e.partFields),r=S(e.apis,Oc),o=S(e.extraApis,function(n,e){return ar(n,e)});return x(x({name:b(e.name),partFields:b(e.partFields),configFields:b(e.configFields),sketch:function(n){return Cc(e.name,e.configFields,e.partFields,e.factory,n)},parts:b(t)},r),o)}function df(n){var e=$e.fromHtml(n),t=tt(e),r=function(n){var e=n.dom().attributes!==undefined?n.dom().attributes:[];return M(e,function(n,e){var t;return"class"===e.name?n:x(x({},n),((t={})[e.name]=e.value,t))},{})}(e),o=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(e),i=0===t.length?{}:{innerHtml:Eo(e)};return x({tag:Y(e),classes:o,attributes:r},i)}function mf(n){return{dom:Hs(n)}}function gf(n){return mo([ki.config({toggleClass:Mi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Ei(n,function(n,e){(e?ki.on:ki.off)(n)})])}function pf(n,e){var t=e.ui.registry.getAll().icons;return On.from(t[n]).fold(function(){return Hs('')},function(n){return Hs(''+n+"")})}function hf(e){return Ja({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(r){return{events:er([or(ge(),function(n,e,t){return r(n,t)},[n]),or(ve(),function(n,e,t){return r(n,t)},[n]),or(ye(),function(n,e,t){t.mouseIsDown.get()&&r(n,t)},[n])])}})}})}function vf(n,e,t){e.store.manager.onLoad(n,e,t)}function yf(n,e,t){e.store.manager.onUnload(n,e,t)}function bf(){var n=An(null);return lo({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function xf(){var i=An({}),u=An({});return lo({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return Mn(i.get(),n).orThunk(function(){return Mn(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};C(n,function(e){r[e.value]=e,Mn(e,"meta").each(function(n){Mn(n,"text").each(function(n){o[n]=e})})}),i.set(x(x({},e),r)),u.set(x(x({},t),o))},clear:function(){i.set({}),u.set({})}})}function wf(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)}function Sf(n,e){il.set(n,e)}function Tf(n){return il.get(n)}function Of(n){var e=n.event().raw();if(function(n){return-1!==n.type.indexOf("touch")}(e)){var t=e;return t.touches!==undefined&&1===t.touches.length?On.some(t.touches[0]).map(function(n){return cl(n.clientX,n.clientY)}):On.none()}var r=e;return r.clientX!==undefined?On.some(r).map(function(n){return cl(n.clientX,n.clientY)}):On.none()}function kf(n){return n.model.minX}function Ef(n){return n.model.minY}function Cf(n){return n.model.minX-1}function Df(n){return n.model.minY-1}function _f(n){return n.model.maxX}function Mf(n){return n.model.maxY}function If(n){return n.model.maxX+1}function Af(n){return n.model.maxY+1}function Ff(n,e,t){return e(n)-t(n)}function Rf(n){return Ff(n,_f,kf)}function Bf(n){return Ff(n,Mf,Ef)}function Vf(n){return Rf(n)/2}function Nf(n){return Bf(n)/2}function jf(n){return n.stepSize}function Hf(n){return n.snapToGrid}function Pf(n){return n.snapStart}function zf(n){return n.rounded}function Lf(n,e){return n[e+"-edge"]!==undefined}function Gf(n){return Lf(n,"left")}function Uf(n){return Lf(n,"right")}function $f(n){return Lf(n,"top")}function Wf(n){return Lf(n,"bottom")}function Xf(n){return n.model.value.get()}function qf(n){return{x:b(n)}}function Yf(n){return{y:b(n)}}function Kf(n,e){return{x:b(n),y:b(e)}}function Jf(n,e){$(n,al(),{value:e})}function Qf(n,e,t,r){return n'),components:[Ml.parts()["left-edge"](mf('
    ')),Ml.parts().spectrum({dom:Hs('
    '),components:[mf('
    ')],behaviours:mo([ki.config({toggleClass:Mi.resolve("thumb-active")})])}),Ml.parts()["right-edge"](mf('
    ')),Ml.parts().thumb({dom:Hs('
    '),behaviours:mo([ki.config({toggleClass:Mi.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Bi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){ki.on(e)},onDragEnd:function(n,e){ki.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Bi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:mo([Ci(Ml.refresh)])})}(n)]}function _s(e,n){return(Ye(n)?On.some(n):sn(n).filter(Ye)).map(function(n){return function(n,e,t){return xo(function(n,e){return e(n)},wo,n,e,t)}(n,function(n){return ui(n,"font-size").isSome()},e).bind(function(n){return ui(n,"font-size")}).getOrThunk(function(){return ii(n,"font-size")})}).getOr("")}function Ms(n){var e=n.selection.getStart(),t=$e.fromDom(e),r=$e.fromDom(n.getBody()),o=_s(function(n){return an(r,n)},t);return I(Rl,function(n){return o===n}).getOr("medium")}function Is(n){return[mf(''),function(n){return Fl({onChange:n.onChange,sizes:Vl,category:"font",getInitialValue:n.getInitialValue})}(n),mf('')]}function As(n){var e=function t(n){return n.uid!==undefined}(n)&&v(n,"uid")?n.uid:kc("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOption()},asSpec:function(){return x(x({},n),{uid:e})}}}var Fs,Rs,Bs=At([Lt("name"),Lt("factory"),Lt("configFields"),Yt("apis",{}),Yt("extraApis",{})]),Vs=At([Lt("name"),Lt("factory"),Lt("configFields"),Lt("partFields"),Yt("apis",{}),Yt("extraApis",{})]),Ns=sf({name:"Button",factory:function(n){function t(e){return Mn(n.dom,"attributes").bind(function(n){return Mn(n,e)})}var e=function(n){return er(F([n.map(function(t){return co(function(n,e){t(n),e.stop()})}).toArray(),ni()]))}(n.action),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:e,behaviours:Ma(n.buttonBehaviours,[Ri.config({}),Da.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return x({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[Yt("uid",undefined),Lt("dom"),Yt("components",[]),_a("buttonBehaviours",[Ri,Da]),$t("action"),$t("role"),Yt("eventOrder",{})]}),js=mr({fields:[],name:"unselecting",active:/* */Object.freeze({__proto__:null,events:function(){return er([tr(Ce(),b(!0))])},exhibit:function(){return fr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Hs=function(n){var e=function(n,r){return n.replace(/\$\{([^{}]*)\}/g,function(n,e){var t=r[e];return function(n){var e=typeof n;return"string"==e||"number"==e}(t)?t.toString():n})}(n,{prefix:Mi.prefix()});return df(e)},Ps=function(n,e,t,r){return Ns.sketch({dom:pf(n,r),action:e,buttonBehaviours:gt(mo([js.config({})]),t)})},zs={forToolbar:Ps,forToolbarCommand:function(n,e){return Ps(e,function(){n.execCommand(e)},{},n)},forToolbarStateAction:function(n,e,t,r){var o=gf(t);return Ps(e,r,o,n)},forToolbarStateCommand:function(n,e){var t=gf(e);return Ps(e,function(){n.execCommand(e)},t,n)},getToolbarIconButton:pf},Ls=Ja({schema:[Lt("dom")],name:"label"}),Gs=hf("top-left"),Us=hf("top"),$s=hf("top-right"),Ws=hf("right"),Xs=hf("bottom-right"),qs=hf("bottom"),Ys=hf("bottom-left"),Ks=[Ls,hf("left"),Ws,Us,qs,Gs,$s,Ys,Xs,Ka({name:"thumb",defaults:b({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:er([ur(ge(),n,"spectrum"),ur(pe(),n,"spectrum"),ur(he(),n,"spectrum"),ur(ve(),n,"spectrum"),ur(ye(),n,"spectrum"),ur(be(),n,"spectrum")])}}}),Ka({schema:[Jt("mouseIsDown",function(){return An(!1)})],name:"spectrum",overrides:function(t){function r(e,n){return o.getValueFromEvent(n).map(function(n){return o.setValueFrom(e,t,n)})}var o=t.model.manager;return{behaviours:mo([Da.config({mode:"special",onLeft:function(n){return o.onLeft(n,t)},onRight:function(n){return o.onRight(n,t)},onUp:function(n){return o.onUp(n,t)},onDown:function(n){return o.onDown(n,t)}}),Ri.config({})]),events:er([rr(ge(),r),rr(pe(),r),rr(ve(),r),rr(ye(),function(n,e){t.mouseIsDown.get()&&r(n,e)})])}}})],Js=/* */Object.freeze({__proto__:null,onLoad:vf,onUnload:yf,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),Qs=/* */Object.freeze({__proto__:null,events:function(t,r){var n=t.resetOnDom?[oo(function(n,e){vf(n,t,r)}),io(function(n,e){yf(n,t,r)})]:[sr(t,r,vf)];return er(n)}}),Zs=/* */Object.freeze({__proto__:null,memory:bf,dataset:xf,manual:function(){return lo({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),nl=[$t("initialValue"),Lt("getFallbackEntry"),Lt("getDataKey"),Lt("setValue"),Wo("manager",{setValue:wf,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){wf(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:xf})],el=[Lt("getValue"),Yt("setValue",w),$t("initialValue"),Wo("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:w,state:so.init})],tl=[$t("initialValue"),Wo("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:bf})],rl=[Kt("store",{mode:"memory"},zt("mode",{memory:tl,manual:el,dataset:nl})),Lo("onSetValue"),Yt("resetOnDom",!1)],ol=mr({fields:rl,name:"representing",active:Qs,apis:Js,extra:{setValueFrom:function(n,e){var t=ol.getValue(e);ol.setValue(n,t)}},state:Zs}),il=Ni("width",function(n){return n.dom().offsetWidth}),ul=function(t,r){return{left:b(t),top:b(r),translate:function(n,e){return ul(t+n,r+e)}}},cl=ul,al=b("slider.change.value"),fl="left",sl=vs(-1),ll=vs(1),dl=On.none,ml=On.none,gl={"top-left":On.none(),top:On.none(),"top-right":On.none(),right:On.some(function(n,e){Jf(n,qf(If(e)))}),"bottom-right":On.none(),bottom:On.none(),"bottom-left":On.none(),left:On.some(function(n,e){Jf(n,qf(Cf(e)))})},pl=/* */Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var r=hs(n,e,t),o=ps(r);return gs(n,o),r},setToMin:function(n,e){var t=kf(e);gs(n,ps(t))},setToMax:function(n,e){var t=_f(e);gs(n,ps(t))},findValueOfOffset:hs,getValueFromEvent:function(n){return Of(n).map(function(n){return n.left()})},findPositionOfValue:ys,setPositionFromValue:function(n,e,t,r){var o=Xf(t),i=ys(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Tf(e.element())/2;Bi(e.element(),"left",i-u+"px")},onLeft:sl,onRight:ll,onUp:dl,onDown:ml,edgeActions:gl}),hl=On.none,vl=On.none,yl=Ss(-1),bl=Ss(1),xl={"top-left":On.none(),top:On.some(function(n,e){Jf(n,Yf(Df(e)))}),"top-right":On.none(),right:On.none(),"bottom-right":On.none(),bottom:On.some(function(n,e){Jf(n,Yf(Af(e)))}),"bottom-left":On.none(),left:On.none()},wl=/* */Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var r=ws(n,e,t),o=xs(r);return bs(n,o),r},setToMin:function(n,e){var t=Ef(e);bs(n,xs(t))},setToMax:function(n,e){var t=Mf(e);bs(n,xs(t))},findValueOfOffset:ws,getValueFromEvent:function(n){return Of(n).map(function(n){return n.top()})},findPositionOfValue:Ts,setPositionFromValue:function(n,e,t,r){var o=Xf(t),i=Ts(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=ji(e.element())/2;Bi(e.element(),"top",i-u+"px")},onLeft:hl,onRight:vl,onUp:yl,onDown:bl,edgeActions:xl}),Sl=Es(-1,!1),Tl=Es(1,!1),Ol=Es(-1,!0),kl=Es(1,!0),El={"top-left":On.some(function(n,e){Jf(n,Kf(Cf(e),Df(e)))}),top:On.some(function(n,e){Jf(n,Kf(Vf(e),Df(e)))}),"top-right":On.some(function(n,e){Jf(n,Kf(If(e),Df(e)))}),right:On.some(function(n,e){Jf(n,Kf(If(e),Nf(e)))}),"bottom-right":On.some(function(n,e){Jf(n,Kf(If(e),Af(e)))}),bottom:On.some(function(n,e){Jf(n,Kf(Vf(e),Af(e)))}),"bottom-left":On.some(function(n,e){Jf(n,Kf(Cf(e),Af(e)))}),left:On.some(function(n,e){Jf(n,Kf(Cf(e),Nf(e)))})},Cl=/* */Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var r=hs(n,e,t.left()),o=ws(n,e,t.top()),i=ks(r,o);return Os(n,i),i},setToMin:function(n,e){var t=kf(e),r=Ef(e);Os(n,ks(t,r))},setToMax:function(n,e){var t=_f(e),r=Mf(e);Os(n,ks(t,r))},getValueFromEvent:function(n){return Of(n)},setPositionFromValue:function(n,e,t,r){var o=Xf(t),i=ys(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Ts(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),c=Tf(e.element())/2,a=ji(e.element())/2;Bi(e.element(),"left",i-c+"px"),Bi(e.element(),"top",u-a+"px")},onLeft:Sl,onRight:Tl,onUp:Ol,onDown:kl,edgeActions:El}),Dl=[Yt("stepSize",1),Yt("onChange",w),Yt("onChoose",w),Yt("onInit",w),Yt("onDragStart",w),Yt("onDragEnd",w),Yt("snapToGrid",!1),Yt("rounded",!0),$t("snapStart"),Gt("model",zt("mode",{x:[Yt("minX",0),Yt("maxX",100),Jt("value",function(n){return An(n.mode.minX)}),Lt("getInitialValue"),Wo("manager",pl)],y:[Yt("minY",0),Yt("maxY",100),Jt("value",function(n){return An(n.mode.minY)}),Lt("getInitialValue"),Wo("manager",wl)],xy:[Yt("minX",0),Yt("maxX",100),Yt("minY",0),Yt("maxY",100),Jt("value",function(n){return An({x:b(n.mode.minX),y:b(n.mode.minY)})}),Lt("getInitialValue"),Wo("manager",Cl)]})),uc("sliderBehaviours",[Da,ol]),Jt("mouseIsDown",function(){return An(!1)})],_l=b("mouse.released"),Ml=lf({name:"Slider",configFields:Dl,partFields:Ks,factory:function(i,n,e,t){function u(n){return xc(n,i,"thumb")}function c(n){return xc(n,i,"spectrum")}function r(n){return bc(n,i,"left-edge")}function o(n){return bc(n,i,"right-edge")}function a(n){return bc(n,i,"top-edge")}function f(n){return bc(n,i,"bottom-edge")}function s(n,e){v.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:a,getBottomEdge:f,getSpectrum:c})}function l(n,e){h.value.set(e);var t=u(n);return s(n,t),i.onChange(n,t,e),On.some(!0)}function d(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&bc(t,i,"thumb").each(function(n){var e=h.value.get();i.onChoose(t,n,e)})}function m(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,e){e.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:ac(i.sliderBehaviours,[Da.config({mode:"special",focusIn:function(n){return bc(n,i,"spectrum").map(Da.focusIn).map(b(!0))}}),ol.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),bi.config({channels:(p={},p[_l()]={onReceive:d},p)})]),events:er([rr(al(),function(n,e){l(n,e.event().value())}),oo(function(n,e){var t=h.getInitialValue();h.value.set(t);var r=u(n);s(n,r);var o=c(n);i.onInit(n,r,o,h.value.get())}),rr(ge(),m),rr(he(),g),rr(ve(),m),rr(be(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},changeValue:l,refresh:s},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Il=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Cs(n,"color-levels",function(){return Ds(e)},r)},Al=At([Lt("getInitialValue"),Lt("onChange"),Lt("category"),Lt("sizes")]),Fl=function(n){var o=Pt("SizeSlider",Al,n);return Ml.sketch({dom:{tag:"div",classes:[Mi.resolve("slider-"+o.category+"-size-container"),Mi.resolve("slider"),Mi.resolve("slider-size-container")]},onChange:function(n,e,t){var r=t.x();!function(n){return 0<=n&&n'),components:[mf('
    ')]}),Ml.parts().thumb({dom:Hs('
    '),behaviours:mo([ki.config({toggleClass:Mi.resolve("thumb-active")})])})]})},Rl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Bl={candidates:b(Rl),get:function(n){return function(e){return A(Rl,function(n){return n===e})}(Ms(n)).getOr(2)},apply:function(e,n){(function(n){return On.from(Rl[n])})(n).each(function(n){!function(n,e){Ms(n)!==e&&n.execCommand("fontSize",!1,e)}(e,n)})}},Vl=Bl.candidates(),Nl=window.Promise?window.Promise:(Fs=jl.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){l.setTimeout(n,1)},Rs=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},jl.prototype["catch"]=function(n){return this.then(null,n)},jl.prototype.then=function(t,r){var o=this;return new jl(function(n,e){Pl.call(o,new Ul(t,r,n,e))})},jl.all=function(){for(var n=[],e=0;e'),action:function(n){var e=t.get(n);ol.setValue(e,"")}}));return{name:n,spec:fm.sketch({dom:Hs('
    '),components:[t.asSpec(),r.asSpec()],containerBehaviours:mo([ki.config({toggleClass:Mi.resolve("input-container-empty")}),am.config({find:function(n){return On.some(t.get(n))}}),im("input-clearing",[rr(Te(),function(n){var e=t.get(n);(0"}function md(){function e(){t.get().each(function(n){n.destroy()})}var t=An(On.none());return{clear:function(){e(),t.set(On.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(On.some(n))},run:function(n){t.get().each(n)}}}function gd(){var e=An(On.none());return{clear:function(){e.set(On.none())},set:function(n){e.set(On.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}}function pd(n){function r(e,n,t){return Ns.sketch({dom:Hs(''),action:function(n){$(n,u,{direction:e})},buttonBehaviours:mo([Sm.config({disableClass:Mi.resolve("toolbar-navigation-disabled"),disabled:!t})])})}function o(n,o){var i=zi(n.element(),"."+Mi.resolve("serialised-dialog-screen"));Ui(n.element(),"."+Mi.resolve("serialised-dialog-chain")).each(function(r){0<=c.state.currentScreen.get()+o&&c.state.currentScreen.get()+o'),components:[fm.sketch({dom:Hs('
    '),components:ue(c.fields,function(n,e){return e<=c.maxFieldIndex?fm.sketch({dom:Hs('
    '),components:[r(-1,"previous",0'),behaviours:mo([xu.config({highlightClass:Mi.resolve("dot-active"),itemClass:Mi.resolve("dot-item")})]),components:R(c.fields,function(n,e){return e<=c.maxFieldIndex?[mf('
    ')]:[]})});return{dom:Hs('
    '),components:[a.asSpec(),f.asSpec()],behaviours:mo([Da.config({mode:"special",focusIn:function(n){var e=a.get(n);Da.focusIn(e)}}),im("serializer-wrapper-events",[rr(ge(),function(n,e){var t=e.event();c.state.dialogSwipeState.set(Em(t.raw().touches[0].clientX))}),rr(pe(),function(n,e){var t=e.event();c.state.dialogSwipeState.on(function(n){e.event().prevent(),c.state.dialogSwipeState.set(Cm(n,t.raw().touches[0].clientX))})}),rr(he(),function(r){c.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*Dm(n);o(e,t)})})])])}}function hd(e){function n(n){return function(){throw new Error("The component must be in a context to send: "+n+(e?"\n"+Mo(e().element())+" is not in context.":""))}}return{debugInfo:b("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:b(!1)}}function vd(n,o){var i={};return Cn(n,function(n,r){Cn(n,function(n,e){var t=Mn(i,e).getOr([]);i[e]=t.concat([o(r,n)])})}),i}function yd(u,c,n,a){try{var e=function(n,e){var t=re.call(n,0);return t.sort(e),t}(n,function(n,e){var t=n[c](),r=e[c](),o=a.indexOf(t),i=a.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(a,null,2));return o "):r[0].name();return St(o,function(n,e){return{handler:n,purpose:b(e)}}(e,t))})});return Ot(e,{})},Nm=function(n){var e=Pt("external.component",At([Lt("element"),$t("uid")]),n),t=An(hd());e.uid.each(function(n){cf(e.element,n)});var r={getSystem:t.get,config:On.none,hasConfigured:b(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(hd(function(){return r}))},getApis:function(){return{}},element:b(e.element),spec:b(n),readState:b("No state"),syncComponents:w,components:b([]),events:b({})};return Tc(r)},jm=kc,Hm=function(e){return function(n){return Mn(n,ef)}(e).fold(function(){var n=e.hasOwnProperty("uid")?e:x({uid:jm("")},e);return Ad(n).getOrDie()},function(n){return n})},Pm=Tc,zm="alloy.item-hover",Lm="alloy.item-focus",Gm=b(zm),Um=b(Lm),$m=[Lt("data"),Lt("components"),Lt("dom"),Yt("hasSubmenu",!1),$t("toggling"),_a("itemBehaviours",[ki,Ri,Da,ol]),Yt("ignoreFocus",!1),Yt("domModification",{}),Wo("builder",function(n){return{dom:n.dom,domModification:x(x({},n.domModification),{attributes:x(x(x({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Ma(n.itemBehaviours,[n.toggling.fold(ki.revoke,function(n){return ki.config(x({aria:{mode:"checked"}},n))}),Ri.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Bd(n)}}),Da.config({mode:"execution"}),ol.config({store:{mode:"memory",initialValue:n.data}}),im("item-type-events",function a(){for(var n=0,e=0,t=arguments.length;e");r[t[0]]=St(t[1],n),r[t[1]]=St(t[0],n)}),r},createBistate:function(n,e,t){return Tt([{key:n,value:St(e,t)},{key:e,value:St(n,t)}])},createTristate:function(n,e,t,r){return Tt([{key:n,value:Tt([{key:e,value:r},{key:t,value:r}])},{key:e,value:Tt([{key:n,value:r},{key:t,value:r}])},{key:t,value:Tt([{key:n,value:r},{key:e,value:r}])}])}}}),mg=Mi.resolve("scrollable"),gg={register:function(n){Or(n,mg)},deregister:function(n){Er(n,mg)},scrollable:b(mg)},pg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[Mi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Mi.resolve("format-matches"),selected:t},itemBehaviours:mo(o?[]:[Ei(n,function(n,e){(e?ki.on:ki.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},hg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Ns.sketch({dom:{tag:"div",classes:[Mi.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Mi.resolve("styles-collapse-icon")]}},Fd(n)]:[Fd(n)],action:function(n){if(r){var e=t().get(n);ug.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Mi.resolve("styles-menu-items-container")]},components:[Zm.parts().items({})],behaviours:mo([im("adhoc-scrollable-menu",[oo(function(n,e){Bi(n.element(),"overflow-y","auto"),Bi(n.element(),"-webkit-overflow-scrolling","touch"),gg.register(n.element())}),io(function(n){ci(n.element(),"overflow-y"),ci(n.element(),"-webkit-overflow-scrolling"),gg.deregister(n.element())})])])}],items:e,menuBehaviours:mo([dg.config({initialState:"after",routes:dg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},vg=function(r){var n=function(r,o){var n=hg("Styles",[].concat(ue(r.items,function(n){return pg(Ud(n),n.title,n.isSelected(),n.getPreview(),v(r.expansions,Ud(n)))})),o,!1),e=S(r.menus,function(n,e){var t=ue(n,function(n){return pg(Ud(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",v(r.expansions,Ud(n)))});return hg(e,t,o,!0)}),t=gt(e,St("styles",n));return{tmenu:ug.tieredData("styles",t,r.expansions)}}(r.formats,function(){return e}),e=As(ug.sketch({dom:{tag:"div",classes:[Mi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=ol.getValue(e);return r.handle(e,t.value),On.none()},onEscape:function(){return On.none()},onOpenMenu:function(n,e){var t=Tf(n.element());Sf(e.element(),t),dg.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=Tf(n.element()),o=Gi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();Sf(t.element(),r),dg.progressTo(i,"before"),dg.jumpTo(t,"after"),dg.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Gi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();dg.progressTo(o,"after"),dg.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:n.tmenu,markers:{backgroundMenu:Mi.resolve("styles-background-menu"),menu:Mi.resolve("styles-menu"),selectedMenu:Mi.resolve("styles-selected-menu"),item:Mi.resolve("styles-item"),selectedItem:Mi.resolve("styles-selected-item")}}));return e.asSpec()},yg=function(n){return _(n,function(n,e){var t=$d(e);return{menus:gt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:gt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},bg={expand:yg},xg=function(r,n){function o(n){return function(){return r.formatter.match(n)}}function i(n){return function(){return r.formatter.getCssText(n)}}var e=Mn(n,"style_formats").getOr(Mm),t=function(n){return ue(n,function(n){if(v(n,"items")){var e=t(n.items);return gt(function(n){return gt(n,{isSelected:b(!1),getPreview:b("")})}(n),{items:e})}return v(n,"format")?function(n){return gt(n,{isSelected:o(n.format),getPreview:i(n.format)})}(n):function(n){var e=dc(n.title),t=gt(n,{format:e,isSelected:o(e),getPreview:i(e)});return r.formatter.register(e,t),t}(n)})};return t(e)},wg=function(t,n,r){var e=function(e,n){var t=function(n){return R(n,function(n){return n.items===undefined?!v(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!=t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0==Bg?[]:[Kd($e.fromDom(r.win()),"blur",function(){t.getByDom(e).each(ki.off)}),Kd(u,"select",n),Kd(r.doc(),"selectionchange",n)]);return{destroy:function(){C(c,function(n){n.unbind()})}}},Ng=function(n,e){var t=parseInt(vr(n,e),10);return isNaN(t)?0:t};function jg(n){return"img"===Y(n)?1:function(n){return mp.getOption(n)}(n).fold(function(){return tt(n).length},function(n){return n.length})}function Hg(n,e,t){var r=n.document.createRange();return function(t,n){n.fold(function(n){t.setStartBefore(n.dom())},function(n,e){t.setStart(n.dom(),e)},function(n){t.setStartAfter(n.dom())})}(r,e),function(t,n){n.fold(function(n){t.setEndBefore(n.dom())},function(n,e){t.setEnd(n.dom(),e)},function(n){t.setEndAfter(n.dom())})}(r,t),r}function Pg(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i}function zg(n){return{left:b(n.left),top:b(n.top),right:b(n.right),bottom:b(n.bottom),width:b(n.width),height:b(n.height)}}function Lg(n,e,t){return e($e.fromDom(t.startContainer),t.startOffset,$e.fromDom(t.endContainer),t.endOffset)}function Gg(n,e){return function(n,e){var t=e.ltr();return t.collapsed?e.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return bp.rtl($e.fromDom(n.endContainer),n.endOffset,$e.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Lg(0,bp.ltr,t)}):Lg(0,bp.ltr,t)}(0,function(o,n){return n.match({domRange:function(n){return{ltr:b(n),rtl:On.none}},relative:function(n,e){return{ltr:q(function(){return Hg(o,n,e)}),rtl:q(function(){return On.some(Hg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:q(function(){return Pg(o,n,e,t,r)}),rtl:q(function(){return On.some(Pg(o,t,r,n,e))})}}})}(n,e))}function Ug(n,e){var t=Y(n);return"input"===t?hp.after(n):k(["br","img"],t)?0===e?hp.before(n):hp.after(n):hp.on(n,e)}function $g(n,e,t,r){var o=function(n,e,t,r){var o=fn(n).dom().createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o}(n,e,t,r),i=an(n,t)&&e===r;return o.collapsed&&!i}function Wg(n,e,t,r,o){!function(n,e){On.from(n.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(e)})}(n,Pg(n,e,t,r,o))}function Xg(n,e,t,r,o){!function(u,n){Gg(u,n).match({ltr:function(n,e,t,r){Wg(u,n,e,t,r)},rtl:function(n,e,t,r){var o=u.getSelection();if(o.setBaseAndExtent)o.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(o.extend)try{!function(n,e,t,r,o,i){e.collapse(t.dom(),r),e.extend(o.dom(),i)}(0,o,n,e,t,r)}catch(i){Wg(u,t,r,n,e)}else Wg(u,t,r,n,e)}})}(n,function(n,e,t,r){var o=Ug(n,e),i=Ug(t,r);return yp.relative(o,i)}(e,t,r,o))}function qg(n){var e=$e.fromDom(n.anchorNode),t=$e.fromDom(n.focusNode);return $g(e,n.anchorOffset,t,n.focusOffset)?On.some(gp.create(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0n.innerHeight||e.bottom()>n.innerHeight?Math.min(t,e.bottom()-n.innerHeight+50):0}(r,n,t);0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),Zg(e,n.innerHeight)});Zg(e,n.innerHeight);return{toEditing:function(){wp(r)},destroy:function(){t.unbind()}}},Op={getBody:cp("getBody",tp),getDoc:cp("getDoc",rp),getWin:cp("getWin",op),getSelection:cp("getSelection",ip),getFrame:up,getActiveApi:function(c){var a=up(c);return tp(a).bind(function(u){return rp(a).bind(function(i){return op(a).map(function(o){var n=$e.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return function(n){return Yg(n).map(function(n){return yp.exact(n.start(),n.soffset(),n.finish(),n.foffset())})}(o).bind(function(n){return Kg(o,n).orThunk(function(){return function(n){return Yg(n).filter(function(n){return an(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0